/-- **Equality case of the Rearrangement Inequality**: Pointwise multiplication of `f` and `g`,
which antivary together, is unchanged by a permutation if and only if `f ∘ σ` and `g` antivary
together. Stated by permuting the entries of `f`. -/
theorem AntivaryOn.sum_comp_perm_mul_eq_sum_mul_iff (hfg : AntivaryOn f g s)
    (hσ : {x | σ x ≠ x} ⊆ s) :
    ∑ i ∈ s, f (σ i) * g i = ∑ i ∈ s, f i * g i ↔ AntivaryOn (f ∘ σ) g s

{ι : Type u_1}
{α : Type u_2}
[LinearOrderedRing α]
{s : Finset ι}
{σ : Equiv.Perm ι}
{f g : ι → α}
(hfg : AntivaryOn f g ↑s)
(hσ : {x | σ x ≠ x} ⊆ ↑s)

∑ i ∈ s, f (σ i) * g i = ∑ i ∈ s, f i * g i ↔ AntivaryOn (f ∘ ⇑σ) g ↑s


theorem iterate_le_id_of_le_id (h : f ≤ id) (n : ℕ) : f^[n] ≤ id

{α : Type u_1}
[Preorder α]
{f : α → α}
(h : f ≤ id)
(n : ℕ)


@[simp] theorem emod_emod_of_dvd (n : Int) {m k : Int}
    (h : m ∣ k) : (n % k) % m = n % m


@[simp]
theorem extend_eq (x : E) : extend f e h_dense h_e (e x) = f x

{𝕜 : Type u_1}
{𝕜₂ : Type u_2}
{E : Type u_4}
{F : Type u_6}
{Fₗ : Type u_7}
[NormedAddCommGroup E]
[NormedAddCommGroup F]
[NormedAddCommGroup Fₗ]
[NontriviallyNormedField 𝕜]
[NontriviallyNormedField 𝕜₂]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜₂ F]
[NormedSpace 𝕜 Fₗ]
{σ₁₂ : 𝕜 →+* 𝕜₂}
(f : E →SL[σ₁₂] F)
[CompleteSpace F]
(e : E →L[𝕜] Fₗ)
(h_dense : DenseRange ⇑e)
(h_e : UniformInducing ⇑e)
(x : E)


@[simp, elementwise]
theorem biprodIsoProd_inv_comp_snd (M N : ModuleCat.{v} R) :
    (biprodIsoProd M N).inv ≫ biprod.snd = LinearMap.snd R M N

{R : Type u}
[Ring R]
(M N : ModuleCat R)

(M.biprodIsoProd N).inv ≫ CategoryTheory.Limits.biprod.snd = LinearMap.snd R ↑M ↑N


/-- Change-of-variables formula for `Ioi` integrals of scalar-valued functions -/
theorem integral_comp_mul_deriv_Ioi {f f' : ℝ → ℝ} {g : ℝ → ℝ} {a : ℝ}
    (hf : ContinuousOn f <| Ici a) (hft : Tendsto f atTop atTop)
    (hff' : ∀ x ∈ Ioi a, HasDerivWithinAt f (f' x) (Ioi x) x)
    (hg_cont : ContinuousOn g <| f '' Ioi a) (hg1 : IntegrableOn g <| f '' Ici a)
    (hg2 : IntegrableOn (fun x => (g ∘ f) x * f' x) (Ici a)) :
    (∫ x in Ioi a, (g ∘ f) x * f' x) = ∫ u in Ioi (f a), g u

(hft : Filter.Tendsto f Filter.atTop Filter.atTop)

(hff' : ∀ x ∈ Set.Ioi a, HasDerivWithinAt f (f' x) (Set.Ioi x) x)

(hg_cont : ContinuousOn g (f '' Set.Ioi a))

(hg1 : MeasureTheory.IntegrableOn g (f '' Set.Ici a) MeasureTheory.volume)

(hg2 : MeasureTheory.IntegrableOn (fun x => (g ∘ f) x * f' x) (Set.Ici a) MeasureTheory.volume)

∫ (x : ℝ) in Set.Ioi a, (g ∘ f) x * f' x = ∫ (u : ℝ) in Set.Ioi (f a), g u


theorem prod_mem_prod (hs : s ∈ f) (ht : t ∈ g) : s ×ˢ t ∈ f ×ˢ g

{α : Type u_1}
{β : Type u_2}
{s : Set α}
{t : Set β}
{f : Filter α}
{g : Filter β}
(hs : s ∈ f)
(ht : t ∈ g)

s ×ˢ t ∈ f ×ˢ g


@[to_additive]
theorem sup_subgroupOf_eq {H K L : Subgroup G} (hH : H ≤ L) (hK : K ≤ L) :
    H.subgroupOf L ⊔ K.subgroupOf L = (H ⊔ K).subgroupOf L

{G : Type u_1}
[Group G]
{H K L : Subgroup G}
(hH : H ≤ L)
(hK : K ≤ L)


theorem isBounded_Icc (a b : α) : IsBounded (Icc a b)

{α : Type u}
[PseudoMetricSpace α]
[Preorder α]
[CompactIccSpace α]
(a b : α)


@[simp]
theorem nndist_conj_conj (z w : ℂ) : nndist (conj z) (conj w) = nndist z w

nndist ((starRingEnd ℂ) z) ((starRingEnd ℂ) w) = nndist z w


theorem congr_reverse {X Y : Paths <| Quiver.Symmetrify V} (p q : X ⟶ Y) :
    Quotient.CompClosure redStep p q → Quotient.CompClosure redStep p.reverse q.reverse

{X Y : CategoryTheory.Paths (Quiver.Symmetrify V)}

CategoryTheory.Quotient.CompClosure CategoryTheory.Groupoid.Free.redStep p q →
  CategoryTheory.Quotient.CompClosure CategoryTheory.Groupoid.Free.redStep (Quiver.Path.reverse p)
    (Quiver.Path.reverse q)


/-- A natural transformation is a monomorphism if each component is. -/
theorem mono_of_mono_app (α : F ⟶ G) [∀ X : C, Mono (α.app X)] : Mono α

[∀ (X : C), CategoryTheory.Mono (α.app X)]


theorem right_mem_Icc : b ∈ Icc a b ↔ a ≤ b

{α : Type u_2}
[Preorder α]
[LocallyFiniteOrder α]
{a b : α}


@[simp] theorem ofNat_fst (n : ℕ) [n.AtLeastTwo] :
    (no_index (OfNat.ofNat n) : X q).fst = OfNat.ofNat n


theorem age.hereditary : Hereditary (L.age M)

{L : FirstOrder.Language}
(M : Type w)
[L.Structure M]


/-- A `StrictOrderedSemiring` is a nontrivial semiring with a partial order such that addition is
strictly monotone and multiplication by a positive number is strictly monotone. -/
class StrictOrderedSemiring (α : Type u) extends Semiring α, OrderedCancelAddCommMonoid α,
    Nontrivial α where
  /-- In a strict ordered semiring, `0 ≤ 1`. -/
  protected zero_le_one : (0 : α) ≤ 1
  /-- Left multiplication by a positive element is strictly monotone. -/
  protected mul_lt_mul_of_pos_left : ∀ a b c : α, a < b → 0 < c → c * a < c * b
  /-- Right multiplication by a positive element is strictly monotone. -/
  protected mul_lt_mul_of_pos_right : ∀ a b c : α, a < b → 0 < c → a * c < b * c

{α : Type u}
[self : StrictOrderedSemiring α]
(a b c : α)


@[simp]
theorem not_nonempty_empty : ¬PSet.Nonempty ∅


@[norm_cast]
theorem coe_toCoalgHom (f : A →ₐc[R] B) : ⇑(f : A →ₗc[R] B) = f

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[Semiring B]
[Algebra R B]
[CoalgebraStruct R A]
[CoalgebraStruct R B]
(f : A →ₐc[R] B)


@[simps!]
instance : Category (CosimplicialObject C)

(C : Type u)
[CategoryTheory.Category.{v, u} C]
(F : SimplexCategory ⥤ C)
(X : SimplexCategory)


@[to_additive]
theorem CauchySeq.const_mul {ι : Type*} [Preorder ι] {u : ι → α} {x : α} (hu : CauchySeq u) :
    CauchySeq fun n => x * u n

{α : Type u_1}
[UniformSpace α]
[Group α]
[UniformGroup α]
{ι : Type u_3}
[Preorder ι]
{u : ι → α}
{x : α}
(hu : CauchySeq u)


theorem bot_lt_succ (a : α) : ⊥ < succ a

{α : Type u_1}
[PartialOrder α]
[SuccOrder α]
[OrderBot α]
[Nontrivial α]
(a : α)


theorem Basis.tensorProduct_apply' (b : Basis ι S M) (c : Basis κ R N) (i : ι × κ) :
    Basis.tensorProduct b c i = b i.1 ⊗ₜ c i.2

{R : Type u_1}
{S : Type u_2}
{M : Type u_3}
{N : Type u_4}
{ι : Type u_5}
{κ : Type u_6}
[CommSemiring R]
[Semiring S]
[Algebra R S]
[AddCommMonoid M]
[Module R M]
[Module S M]
[IsScalarTower R S M]
[AddCommMonoid N]
[Module R N]
(b : Basis ι S M)
(c : Basis κ R N)
(i : ι × κ)

(b.tensorProduct c) i = b i.1 ⊗ₜ[R] c i.2


theorem HasDerivWithinAt.congr_of_eventuallyEq (h : HasDerivWithinAt f f' s x)
    (h₁ : f₁ =ᶠ[𝓝[s] x] f) (hx : f₁ x = f x) : HasDerivWithinAt f₁ f' s x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f f₁ : 𝕜 → F}
{f' : F}
{x : 𝕜}
{s : Set 𝕜}
(h : HasDerivWithinAt f f' s x)
(h₁ : f₁ =ᶠ[𝓝[s] x] f)
(hx : f₁ x = f x)


@[simp, norm_cast]
theorem coe_treesOfNumNodesEq (n : ℕ) :
    ↑(treesOfNumNodesEq n) = { x : Tree Unit | x.numNodes = n }

↑(Tree.treesOfNumNodesEq n) = {x | x.numNodes = n}


theorem UniformSpace.hasBasis_ofFun {α : Type u} {β : Type v} [LinearOrderedAddCommMonoid β]
    (h₀ : ∃ x : β, 0 < x) (d : α → α → β) (refl : ∀ x, d x x = 0) (symm : ∀ x y, d x y = d y x)
    (triangle : ∀ x y z, d x z ≤ d x y + d y z)
    (half : ∀ ε > (0 : β), ∃ δ > (0 : β), ∀ x < δ, ∀ y < δ, x + y < ε) :
    𝓤[.ofFun d refl symm triangle half].HasBasis ((0 : β) < ·) (fun ε => { x | d x.1 x.2 < ε })

(d : α → α → β)

(triangle : ∀ (x y z : α), d x z ≤ d x y + d y z)

(half : ∀ ε > 0, ∃ δ > 0, ∀ x < δ, ∀ y < δ, x + y < ε)

(𝓤 α).HasBasis (fun x => 0 < x) fun ε => {x | d x.1 x.2 < ε}


/-- Two maps out of the semidirect product are equal if they're equal after composition
  with both `inl` and `inr` -/
theorem hom_ext {f g : N ⋊[φ] G →* H} (hl : f.comp inl = g.comp inl)
    (hr : f.comp inr = g.comp inr) : f = g

(hl : f.comp SemidirectProduct.inl = g.comp SemidirectProduct.inl)

(hr : f.comp SemidirectProduct.inr = g.comp SemidirectProduct.inr)


protected theorem summable [CompleteSpace F] (p : FormalMultilinearSeries 𝕜 E F) {x : E}
    (hx : x ∈ EMetric.ball (0 : E) p.radius) : Summable fun n : ℕ => p n fun _ => x

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[CompleteSpace F]
(p : FormalMultilinearSeries 𝕜 E F)
{x : E}
(hx : x ∈ EMetric.ball 0 p.radius)


@[simp]
theorem nim_add_fuzzy_zero_iff {o₁ o₂ : Ordinal} : nim o₁ + nim o₂ ‖ 0 ↔ o₁ ≠ o₂

(SetTheory.PGame.nim o₁ + SetTheory.PGame.nim o₂).Fuzzy 0 ↔ o₁ ≠ o₂


/-- A sequential limit of strongly measurable functions is strongly measurable. -/
theorem _root_.stronglyMeasurable_of_tendsto {ι : Type*} {m : MeasurableSpace α}
    [TopologicalSpace β] [PseudoMetrizableSpace β] (u : Filter ι) [NeBot u] [IsCountablyGenerated u]
    {f : ι → α → β} {g : α → β} (hf : ∀ i, StronglyMeasurable (f i)) (lim : Tendsto f u (𝓝 g)) :
    StronglyMeasurable g

{f : ι → α → β}

(hf : ∀ (i : ι), MeasureTheory.StronglyMeasurable (f i))


/-- If a function admits a power series expansion at `x`, then it is the uniform limit of the
partial sums of this power series on strict subdisks of the disk of convergence, i.e., `f y`
is the uniform limit of `p.partialSum n (y - x)` there. -/
theorem HasFPowerSeriesOnBall.tendstoUniformlyOn' {r' : ℝ≥0} (hf : HasFPowerSeriesOnBall f p x r)
    (h : (r' : ℝ≥0∞) < r) :
    TendstoUniformlyOn (fun n y => p.partialSum n (y - x)) f atTop (Metric.ball (x : E) r')

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{p : FormalMultilinearSeries 𝕜 E F}
{x : E}
{r : ℝ≥0∞}
{r' : ℝ≥0}
(hf : HasFPowerSeriesOnBall f p x r)
(h : ↑r' < r)

TendstoUniformlyOn (fun n y => p.partialSum n (y - x)) f Filter.atTop (Metric.ball x ↑r')


@[to_additive]
theorem unop_injective : Injective (unop : αᵐᵒᵖ → α)


@[to_additive (attr := simp)]
lemma stabilizer_smul_eq_left [SMul α β] [IsScalarTower G α β] (a : α) (b : β)
    (h : Injective (· • b : α → β)) : stabilizer G (a • b) = stabilizer G a

{G : Type u_1}
{α : Type u_2}
{β : Type u_3}
[Group G]
[MulAction G α]
[MulAction G β]
[SMul α β]
[IsScalarTower G α β]
(a : α)
(b : β)
(h : Function.Injective fun x => x • b)

MulAction.stabilizer G (a • b) = MulAction.stabilizer G a


/--
  A form of the chain rule: if `f` is a polynomial over `R`
  and `d : A → M` is an `R`-derivation then for all `a : A` we have
  $$ d(f(a)) = f' (a) d a. $$
  The equation is in the `R[X]`-module `Module.AEval R M a`.
  For the same equation in `M`, see `Derivation.compAEval_eq`.
-/
theorem compAEval_eq (d : Derivation R A M) (f : R[X]) :
    d.compAEval a f = derivative f • (AEval.of R M a (d a))

{R : Type u_1}
{A : Type u_2}
{M : Type u_3}
[CommSemiring R]
[CommSemiring A]
[Algebra R A]
[AddCommMonoid M]
[Module A M]
[Module R M]
[IsScalarTower R A M]
(a : A)
(d : Derivation R A M)
(f : Polynomial R)

(d.compAEval a) f = Polynomial.derivative f • (Module.AEval.of R M a) (d a)


@[simp]
theorem prod_factors [Nontrivial α] (s : FactorSet α) : s.prod.factors = s

{α : Type u_1}
[CancelCommMonoidWithZero α]
[UniqueFactorizationMonoid α]
[Nontrivial α]
(s : Associates.FactorSet α)


/-- If `‖f n‖ ≤ C * r ^ n` for all `n : ℕ` and some `r < 1`, then the partial sums of `f` are within
distance `C * r ^ n / (1 - r)` of the sum of the series. This lemma does not assume `0 ≤ r` or
`0 ≤ C`. -/
theorem norm_sub_le_of_geometric_bound_of_hasSum (hr : r < 1) (hf : ∀ n, ‖f n‖ ≤ C * r ^ n) {a : α}
    (ha : HasSum f a) (n : ℕ) : ‖(∑ x ∈ Finset.range n, f x) - a‖ ≤ C * r ^ n / (1 - r)

{α : Type u_1}
[SeminormedAddCommGroup α]
{r C : ℝ}
{f : ℕ → α}
(hr : r < 1)
(hf : ∀ (n : ℕ), ‖f n‖ ≤ C * r ^ n)
{a : α}
(ha : HasSum f a)
(n : ℕ)

‖∑ x ∈ Finset.range n, f x - a‖ ≤ C * r ^ n / (1 - r)


theorem bind_const (f : α →ₛ β) : f.bind (const α) = f

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
(f : MeasureTheory.SimpleFunc α β)

f.bind (MeasureTheory.SimpleFunc.const α) = f


theorem Pairwise.on_injective (hs : s.Pairwise r) (hf : Function.Injective f) (hfs : ∀ x, f x ∈ s) :
    Pairwise (r on f)

{α : Type u_1}
{ι : Type u_4}
{r : α → α → Prop}
{f : ι → α}
{s : Set α}
(hs : s.Pairwise r)
(hf : Function.Injective f)
(hfs : ∀ (x : ι), f x ∈ s)


@[to_additive (attr := simp, to_additive) (reorder := 1 2, 4 5) ofDual_smul]
theorem ofDual_pow [Pow α β] (a : αᵒᵈ) (b : β) : ofDual (a ^ b) = ofDual a ^ b

{α : Type u_1}
{β : Type u_2}
[Pow α β]
(a : αᵒᵈ)
(b : β)

OrderDual.ofDual (a ^ b) = OrderDual.ofDual a ^ b


@[to_additive]
theorem eq_bot_of_card_eq (h : Nat.card H = 1) : H = ⊥

{G : Type u_1}
[Group G]
(H : Subgroup G)
(h : Nat.card ↥H = 1)


theorem eval_of (n : ℕ) (x : M) : eval I M n (of I M x) = mkQ (I ^ n • ⊤ : Submodule R M) x

{R : Type u_1}
[CommRing R]
(I : Ideal R)
(M : Type u_2)
[AddCommGroup M]
[Module R M]
(n : ℕ)
(x : M)

(AdicCompletion.eval I M n) ((AdicCompletion.of I M) x) = (I ^ n • ⊤).mkQ x


theorem IsPrimitiveRoot.arg_ext {n m : ℕ} {ζ μ : ℂ} (hζ : IsPrimitiveRoot ζ n)
    (hμ : IsPrimitiveRoot μ m) (hn : n ≠ 0) (hm : m ≠ 0) (h : ζ.arg = μ.arg) : ζ = μ


theorem le_of_forall_lt [LinearOrder α] {a b : α} (H : ∀ c, c < a → c < b) : a ≤ b

{α : Type u_2}
[LinearOrder α]
{a b : α}
(H : ∀ (c : α), c < a → c < b)


theorem map_neBot_iff (f : α → β) {F : Filter α} : NeBot (map f F) ↔ NeBot F

{α : Type u}
{β : Type v}
(f : α → β)
{F : Filter α}


/-- See also `injective_pow_iff_not_isOfFinOrder`. -/
@[to_additive "See also `injective_nsmul_iff_not_isOfFinAddOrder`."]
theorem not_isOfFinOrder_of_injective_pow {x : G} (h : Injective fun n : ℕ => x ^ n) :
    ¬IsOfFinOrder x

{G : Type u_1}
[Monoid G]
{x : G}
(h : Function.Injective fun n => x ^ n)


/-- For a self-adjoint operator `T`, a minimum of the Rayleigh quotient of `T` on a sphere centred
at the origin is an eigenvector of `T`, with eigenvalue the global infimum of the Rayleigh
quotient. -/
theorem hasEigenvector_of_isMinOn (hT : IsSelfAdjoint T) {x₀ : E} (hx₀ : x₀ ≠ 0)
    (hextr : IsMinOn T.reApplyInnerSelf (sphere (0 : E) ‖x₀‖) x₀) :
    HasEigenvector (T : E →ₗ[𝕜] E) (↑(⨅ x : { x : E // x ≠ 0 }, T.rayleighQuotient x)) x₀

(hextr : IsMinOn T.reApplyInnerSelf (Metric.sphere 0 ‖x₀‖) x₀)

Module.End.HasEigenvector (↑T) (↑(⨅ x, T.rayleighQuotient ↑x)) x₀


lemma rTensor_exact [Small.{v} R] [flat : Flat R M] ⦃N N' N'' : Type v⦄
    [AddCommGroup N] [AddCommGroup N'] [AddCommGroup N''] [Module R N] [Module R N'] [Module R N'']
    ⦃f : N →ₗ[R] N'⦄ ⦃g : N' →ₗ[R] N''⦄ (exact : Function.Exact f g) :
    Function.Exact (f.rTensor M) (g.rTensor M)

{R : Type u}
(M : Type v)
[CommRing R]
[AddCommGroup M]
[Module R M]
[Small.{v, u} R]
[flat : Module.Flat R M]
⦃N N' N'' : Type v⦄
[AddCommGroup N]
[AddCommGroup N']
[AddCommGroup N'']
[Module R N]
[Module R N']
[Module R N'']
⦃f : N →ₗ[R] N'⦄
⦃g : N' →ₗ[R] N''⦄
(exact : Function.Exact ⇑f ⇑g)

Function.Exact ⇑(LinearMap.rTensor M f) ⇑(LinearMap.rTensor M g)


theorem msb_zeroExtend' (x : BitVec w) (h : w ≤ v) : (x.zeroExtend' h).msb = (decide (0 < v) && x.getLsb (v - 1))

(BitVec.zeroExtend' h x).msb = (decide (0 < v) && x.getLsb (v - 1))


@[simp]
theorem essInf_measure_zero {_ : MeasurableSpace α} {f : α → β} : essInf f (0 : Measure α) = ⊤

{α : Type u_1}
{β : Type u_2}
[CompleteLattice β]

∀ {x : MeasurableSpace α} {f : α → β}, essInf f 0 = ⊤


protected theorem map_sum' {ι} (Q : QuadraticMap R M N) (s : Finset ι) (f : ι → M) :
    Q (∑ i ∈ s, f i) =
      ∑ ij in s.sym2,
        Sym2.lift ⟨fun i j => polar Q (f i) (f j), fun _ _ => polar_comm _ _ _⟩ ij
      - ∑ i ∈ s, Q (f i)

{R : Type u_3}
{M : Type u_4}
{N : Type u_5}
[CommRing R]
[AddCommGroup M]
[AddCommGroup N]
[Module R M]
[Module R N]
{ι : Type u_8}
(Q : QuadraticMap R M N)
(s : Finset ι)
(f : ι → M)

Q (∑ i ∈ s, f i) = ∑ ij ∈ s.sym2, Sym2.lift ⟨fun i j => QuadraticMap.polar (⇑Q) (f i) (f j), ⋯⟩ ij - ∑ i ∈ s, Q (f i)


/-- When the first map `S.f` is zero, this is the right homology data on `S` given by
the chosen `kernel S.g` -/
@[simps!]
noncomputable def ofHasKernel [HasKernel S.g] (hf : S.f = 0) : S.RightHomologyData

(CategoryTheory.ShortComplex.RightHomologyData.ofHasKernel S hf).p = CategoryTheory.CategoryStruct.id S.X₂


lemma eval_polynomial (P : Fin 3 → R) : eval P W.polynomial =
    P y ^ 2 * P z + W.a₁ * P x * P y * P z + W.a₃ * P y * P z ^ 2
      - (P x ^ 3 + W.a₂ * P x ^ 2 * P z + W.a₄ * P x * P z ^ 2 + W.a₆ * P z ^ 3)

{R : Type u}
[CommRing R]
(W : WeierstrassCurve.Projective R)
(P : Fin 3 → R)

(MvPolynomial.eval P) W.polynomial =
  P 1 ^ 2 * P 2 + W.a₁ * P 0 * P 1 * P 2 + W.a₃ * P 1 * P 2 ^ 2 -
    (P 0 ^ 3 + W.a₂ * P 0 ^ 2 * P 2 + W.a₄ * P 0 * P 2 ^ 2 + W.a₆ * P 2 ^ 3)


@[to_additive]
theorem tendsto_mulIndicator_biUnion_finset {ι} [One β] (s : ι → Set α) (f : α → β) (a : α) :
    Tendsto (fun n : Finset ι => mulIndicator (⋃ i ∈ n, s i) f a) atTop
      (pure <| mulIndicator (iUnion s) f a)

{α : Type u_1}
{β : Type u_2}
{ι : Type u_5}
[One β]
(s : ι → Set α)
(f : α → β)
(a : α)

Filter.Tendsto (fun n => (⋃ i ∈ n, s i).mulIndicator f a) Filter.atTop (pure ((Set.iUnion s).mulIndicator f a))


@[simp]
theorem pointReflection_midpoint_left (x y : P) : pointReflection ℝ (midpoint ℝ x y) x = y

{V : Type u_2}
{P : Type u_10}
[SeminormedAddCommGroup V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]
[NormedSpace ℝ V]
(x y : P)

(AffineIsometryEquiv.pointReflection ℝ (midpoint ℝ x y)) x = y


theorem subset_iterate_compRel {s t : Set (α × α)} (h : idRel ⊆ s) (n : ℕ) :
    t ⊆ (s ○ ·)^[n] t

{α : Type ua}
{s t : Set (α × α)}
(h : idRel ⊆ s)
(n : ℕ)


/-- Equivalence between `Π j : Fin (n + 1), α j` and `α i × Π j : Fin n, α (Fin.succAbove i j)`. -/
@[simps (config := .asFn)]
def Equiv.piFinSuccAbove (α : Fin (n + 1) → Type u) (i : Fin (n + 1)) :
    (∀ j, α j) ≃ α i × ∀ j, α (i.succAbove j)

{n : ℕ}
(α : Fin (n + 1) → Type u)
(i : Fin (n + 1))

⇑(Equiv.piFinSuccAbove α i).symm = fun f => i.insertNth f.1 f.2


theorem edge_mem_incidenceSet_iff {e : G.edgeSet} : ↑e ∈ G.incidenceSet a ↔ a ∈ (e : Sym2 V)

{V : Type u}
(G : SimpleGraph V)
{a : V}
{e : ↑G.edgeSet}


/-- Suppose we are given a triangle `t₁`, and replace one of its
vertices by its orthocenter, yielding triangle `t₂` (with vertices not
necessarily listed in the same order).  Then an altitude of `t₂` from
a vertex that was not replaced is the corresponding side of `t₁`. -/
theorem altitude_replace_orthocenter_eq_affineSpan {t₁ t₂ : Triangle ℝ P}
    {i₁ i₂ i₃ j₁ j₂ j₃ : Fin 3} (hi₁₂ : i₁ ≠ i₂) (hi₁₃ : i₁ ≠ i₃) (hi₂₃ : i₂ ≠ i₃) (hj₁₂ : j₁ ≠ j₂)
    (hj₁₃ : j₁ ≠ j₃) (hj₂₃ : j₂ ≠ j₃) (h₁ : t₂.points j₁ = t₁.orthocenter)
    (h₂ : t₂.points j₂ = t₁.points i₂) (h₃ : t₂.points j₃ = t₁.points i₃) :
    t₂.altitude j₂ = line[ℝ, t₁.points i₁, t₁.points i₂]

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{t₁ t₂ : Affine.Triangle ℝ P}
{i₁ i₂ i₃ j₁ j₂ j₃ : Fin 3}
(hi₁₂ : i₁ ≠ i₂)
(hi₁₃ : i₁ ≠ i₃)
(hi₂₃ : i₂ ≠ i₃)
(hj₁₂ : j₁ ≠ j₂)
(hj₁₃ : j₁ ≠ j₃)
(hj₂₃ : j₂ ≠ j₃)
(h₁ : t₂.points j₁ = t₁.orthocenter)
(h₂ : t₂.points j₂ = t₁.points i₂)
(h₃ : t₂.points j₃ = t₁.points i₃)

Affine.Simplex.altitude t₂ j₂ = affineSpan ℝ {t₁.points i₁, t₁.points i₂}


/-- When the reference set is dense, the embedding map is an isometry on its image. -/
theorem embeddingOfSubset_isometry (H : DenseRange x) : Isometry (embeddingOfSubset x)

{α : Type u}
[MetricSpace α]
(x : ℕ → α)
(H : DenseRange x)


/-- The right whiskering of a 2-isomorphism is a 2-isomorphism. -/
@[simps!]
def whiskerRightIso {f g : a ⟶ b} (η : f ≅ g) (h : b ⟶ c) : f ≫ h ≅ g ≫ h

{B : Type u}
[CategoryTheory.Bicategory B]
{a b c : B}
{f g : a ⟶ b}
(η : f ≅ g)
(h : b ⟶ c)

(CategoryTheory.Bicategory.whiskerRightIso η h).inv = CategoryTheory.Bicategory.whiskerRight η.inv h


@[simp]
lemma coe_castPred (i : Fin (n + 1)) (h : i ≠ last _) : (castPred i h : ℕ) = i

{n : ℕ}
(i : Fin (n + 1))
(h : i ≠ Fin.last n)


protected theorem Subsingleton.strictAntiOn (h : s.Subsingleton) : StrictAntiOn f s

{α : Type u}
{β : Type v}
{s : Set α}
[Preorder α]
[Preorder β]
(f : α → β)
(h : s.Subsingleton)


@[to_additive (attr := simp)]
protected theorem map_smul : map (fun b => a • b) f = a • f

{α : Type u_2}
{β : Type u_3}
[SMul α β]
{f : Filter β}
{a : α}


@[simp]
theorem lift_mk_shrink'' (α : Type max u v) [Small.{v} α] :
    Cardinal.lift.{u} #(Shrink.{v} α) = #α

(α : Type (max u v))
[Small.{v, max u v} α]

Cardinal.lift.{u, v} (Cardinal.mk (Shrink.{v, max u v} α)) = Cardinal.mk α


theorem natSepDegree_C_mul_X_sub_C_pow {x y : F} {n : ℕ} (hx : x ≠ 0) :
    (C x * (X - C y) ^ n).natSepDegree = if n = 0 then 0 else 1

{F : Type u}
[Field F]
{x y : F}
{n : ℕ}
(hx : x ≠ 0)

(Polynomial.C x * (Polynomial.X - Polynomial.C y) ^ n).natSepDegree = if n = 0 then 0 else 1


@[simp]
theorem lists_coe (l : List α) : lists (l : Multiset α) = l.permutations.toFinset

{α : Type u_1}
[DecidableEq α]
(l : List α)


theorem UniformSpace.ofCoreEq_toCore (u : UniformSpace α) (t : TopologicalSpace α)
    (h : t = u.toCore.toTopologicalSpace) : .ofCoreEq u.toCore t h = u

{α : Type ua}
(u : UniformSpace α)
(t : TopologicalSpace α)
(h : t = u.toCore.toTopologicalSpace)


/-- The functor `ComposableArrows C n ⥤ ComposableArrows D n` obtained by postcomposition
with a functor `C ⥤ D`. -/
@[simps!]
def Functor.mapComposableArrows :
    ComposableArrows C n ⥤ ComposableArrows D n

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
{D : Type u_2}
[CategoryTheory.Category.{u_4, u_2} D]
(G : CategoryTheory.Functor C D)
(n : ℕ)

∀ {X Y : CategoryTheory.Functor (Fin (n + 1)) C} (α : X ⟶ Y) (X_1 : Fin (n + 1)),
  ((G.mapComposableArrows n).map α).app X_1 = G.map (α.app X_1)


@[simp]
theorem _root_.Set.up_union (s t : Set α) : up (s ∪ t) = up s + up t


theorem monotone_lift' [Preorder γ] {f : γ → Filter α} {g : γ → Set α → Set β} (hf : Monotone f)
    (hg : Monotone g) : Monotone fun c => (f c).lift' (g c)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[Preorder γ]
{f : γ → Filter α}
{g : γ → Set α → Set β}
(hf : Monotone f)
(hg : Monotone g)


theorem ker_toSpanSingleton_isMaximal {m : M} (hm : m ≠ 0) :
    Ideal.IsMaximal (ker (toSpanSingleton R M m))

(R : Type u_2)
[Ring R]
{M : Type u_4}
[AddCommGroup M]
[Module R M]
[IsSimpleModule R M]
{m : M}
(hm : m ≠ 0)

Ideal.IsMaximal (LinearMap.ker (LinearMap.toSpanSingleton R M m))


theorem pNilradical_prime {R : Type*} [CommSemiring R] {p : ℕ} (hp : p.Prime) :
    pNilradical R p = nilradical R

{R : Type u_1}
[CommSemiring R]
{p : ℕ}
(hp : Nat.Prime p)


/-- Ranges of continuous local sections of a local homeomorphism
form a basis of the source space. -/
theorem isTopologicalBasis (hf : IsLocalHomeomorph f) : IsTopologicalBasis
    {U : Set X | ∃ V : Set Y, IsOpen V ∧ ∃ s : C(V,X), f ∘ s = (↑) ∧ Set.range s = U}

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
{f : X → Y}
(hf : IsLocalHomeomorph f)

TopologicalSpace.IsTopologicalBasis {U | ∃ V, IsOpen V ∧ ∃ s, f ∘ ⇑s = Subtype.val ∧ Set.range ⇑s = U}


theorem Continuous.aemeasurable2 [SecondCountableTopologyEither α β]
    {f : δ → α} {g : δ → β} {c : α → β → γ} {μ : Measure δ}
    (h : Continuous fun p : α × β => c p.1 p.2) (hf : AEMeasurable f μ) (hg : AEMeasurable g μ) :
    AEMeasurable (fun a => c (f a) (g a)) μ

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{δ : Type u_5}
[TopologicalSpace α]
[MeasurableSpace α]
[OpensMeasurableSpace α]
[TopologicalSpace β]
[MeasurableSpace β]
[OpensMeasurableSpace β]
[TopologicalSpace γ]
[MeasurableSpace γ]
[BorelSpace γ]
[MeasurableSpace δ]
[SecondCountableTopologyEither α β]
{f : δ → α}
{g : δ → β}
{c : α → β → γ}
{μ : MeasureTheory.Measure δ}
(h : Continuous fun p => c p.1 p.2)
(hf : AEMeasurable f μ)
(hg : AEMeasurable g μ)


@[simp]
theorem diff_union_inter (s t : Set α) : s \ t ∪ s ∩ t = s


theorem localTrivAsPartialEquiv_apply (p : Z.TotalSpace) :
    (Z.localTrivAsPartialEquiv i) p = ⟨p.1, Z.coordChange (Z.indexAt p.1) i p.1 p.2⟩

{ι : Type u_1}
{B : Type u_2}
{F : Type u_3}
[TopologicalSpace B]
[TopologicalSpace F]
(Z : FiberBundleCore ι B F)
(i : ι)
(p : Z.TotalSpace)

↑(Z.localTrivAsPartialEquiv i) p = (p.proj, Z.coordChange (Z.indexAt p.proj) i p.proj p.snd)


lemma toUpper_inj {a b : α} : toUpper a = toUpper b ↔ a = b

Topology.WithUpper.toUpper a = Topology.WithUpper.toUpper b ↔ a = b


@[simp] theorem replicate_zero (a : α) : replicate 0 a = 0


theorem measurableSet_inter_eq_iff (hτ : IsStoppingTime f τ) (s : Set Ω) (i : ι) :
    MeasurableSet[hτ.measurableSpace] (s ∩ {ω | τ ω = i}) ↔
      MeasurableSet[f i] (s ∩ {ω | τ ω = i})

{Ω : Type u_1}
{ι : Type u_3}
{m : MeasurableSpace Ω}
[Preorder ι]
{f : MeasureTheory.Filtration ι m}
{τ : Ω → ι}
(hτ : MeasureTheory.IsStoppingTime f τ)
(s : Set Ω)
(i : ι)

MeasurableSet (s ∩ {ω | τ ω = i}) ↔ MeasurableSet (s ∩ {ω | τ ω = i})


theorem lintegral_const_mul' (r : ℝ≥0∞) (f : α → ℝ≥0∞) (hr : r ≠ ∞) :
    ∫⁻ a, r * f a ∂μ = r * ∫⁻ a, f a ∂μ

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
(r : ℝ≥0∞)
(f : α → ℝ≥0∞)
(hr : r ≠ ⊤)

∫⁻ (a : α), r * f a ∂μ = r * ∫⁻ (a : α), f a ∂μ


@[to_additive] lemma IsMulFreimanHom.comp (hg : IsMulFreimanHom n B C g)
    (hf : IsMulFreimanHom n A B f) : IsMulFreimanHom n A C (g ∘ f)

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[CommMonoid α]
[CommMonoid β]
[CommMonoid γ]
{A : Set α}
{B : Set β}
{C : Set γ}
{f : α → β}
{g : β → γ}
{n : ℕ}
(hg : IsMulFreimanHom n B C g)
(hf : IsMulFreimanHom n A B f)


@[simp]
theorem toεNFA_εClosure (M : NFA α σ) (S : Set σ) : M.toεNFA.εClosure S = S

{α : Type u}
{σ : Type v}
(M : NFA α σ)
(S : Set σ)


/-- When `cfc` is applied to a function that maps zero to zero, it is equivalent to using
`cfcₙ`. -/
lemma cfcₙ_eq_cfc [UniqueNonUnitalContinuousFunctionalCalculus R A] {f : R → R} {a : A}
    (hf : ContinuousOn f (σₙ R a) := by cfc_cont_tac) (hf0 : f 0 = 0 := by cfc_zero_tac) :
    cfcₙ f a = cfc f a

[h_cpct : ∀ (a : A), CompactSpace ↑(spectrum R a)]


theorem affineCombination_mem_convexHull {s : Finset ι} {v : ι → E} {w : ι → R}
    (hw₀ : ∀ i ∈ s, 0 ≤ w i) (hw₁ : s.sum w = 1) :
    s.affineCombination R v w ∈ convexHull R (range v)

{R : Type u_1}
{E : Type u_3}
{ι : Type u_5}
[LinearOrderedField R]
[AddCommGroup E]
[Module R E]
{s : Finset ι}
{v : ι → E}
{w : ι → R}
(hw₀ : ∀ i ∈ s, 0 ≤ w i)
(hw₁ : s.sum w = 1)

(Finset.affineCombination R s v) w ∈ (convexHull R) (Set.range v)


protected theorem comp_right_iff {g : α → β} {e : γ ≃ᵐ α} (h : MeasurePreserving e μc μa) :
    MeasurePreserving (g ∘ e) μc μb ↔ MeasurePreserving g μa μb

{e : γ ≃ᵐ α}

(h : MeasureTheory.MeasurePreserving (⇑e) μc μa)

MeasureTheory.MeasurePreserving (g ∘ ⇑e) μc μb ↔ MeasureTheory.MeasurePreserving g μa μb


theorem eq_empty_of_size_eq_zero {as : Array α} (h : as.size = 0) : as = #[]

{α : Type u_1}
{as : Array α}
(h : as.size = 0)


/--
We have a bijection of homsets which will be used to construct the left adjoint to the comparison
functor.
-/
@[simps!]
def comparisonLeftAdjointHomEquiv (A : adj.toMonad.Algebra) (B : D)
    [HasCoequalizer (F.map A.a) (adj.counit.app (F.obj A.A))] :
    (comparisonLeftAdjointObj adj A ⟶ B) ≃ (A ⟶ (comparison adj).obj B)

[CategoryTheory.Limits.HasCoequalizer (F.map A.a) (adj.counit.app (F.obj A.A))]

∀ (a : CategoryTheory.Monad.MonadicityInternal.comparisonLeftAdjointObj adj A ⟶ B),
  ((CategoryTheory.Monad.MonadicityInternal.comparisonLeftAdjointHomEquiv adj A B) a).f =
    CategoryTheory.CategoryStruct.comp (adj.unit.app A.A)
      (G.map
        ↑((CategoryTheory.Limits.Cofork.IsColimit.homIso
              (CategoryTheory.Limits.colimit.isColimit
                (CategoryTheory.Limits.parallelPair (F.map A.a) (adj.counit.app (F.obj A.A))))
              B)
            a))


theorem coeff_mul_X_zero (p : R[X]) : coeff (p * X) 0 = 0


/-- The identity map preserves multiplication. -/
@[to_additive "The identity map preserves addition"]
theorem id : IsMulHom (id : α → α)


@[to_additive]
theorem prod_insert_div {M : Type*} [CommGroup M] [DecidableEq α] (ha : a ∉ s) {f : α → M} :
    (∏ x ∈ insert a s, f x) / f a = ∏ x ∈ s, f x

{α : Type u_3}
{s : Finset α}
{a : α}
{M : Type u_6}
[CommGroup M]
[DecidableEq α]
(ha : a ∉ s)
{f : α → M}


lemma isPullback_iff_map_coyoneda_isPullback :
    sq.IsPullback ↔ ∀ (X : Cᵒᵖ), (sq.map (coyoneda.obj X)).IsPullback

{C : Type u}
[CategoryTheory.Category.{v, u} C]
(sq : CategoryTheory.Square C)

sq.IsPullback ↔ ∀ (X : Cᵒᵖ), (sq.map (CategoryTheory.coyoneda.obj X)).IsPullback


/-- Over any ring `R` satisfying the strong rank condition,
if `b` is an infinite basis for a module `M`,
then every maximal linearly independent set has the same cardinality as `b`.

This proof (along with some of the lemmas above) comes from
[Les familles libres maximales d'un module ont-elles le meme cardinal?][lazarus1973]
-/
theorem maximal_linearIndependent_eq_infinite_basis {ι : Type w} (b : Basis ι R M) [Infinite ι]
    {κ : Type w} (v : κ → M) (i : LinearIndependent R v) (m : i.Maximal) : #κ = #ι

{R : Type u}
{M : Type v}
[Ring R]
[AddCommGroup M]
[Module R M]
[StrongRankCondition R]
{ι : Type w}
(b : Basis ι R M)
[Infinite ι]
{κ : Type w}
(v : κ → M)
(i : LinearIndependent R v)
(m : i.Maximal)


theorem Nonempty.mono (ht : s ⊆ t) (hs : s.Nonempty) : t.Nonempty

{α : Type u}
{s t : Set α}
(ht : s ⊆ t)
(hs : s.Nonempty)


@[to_additive (attr := simp)]
theorem noncommProd_insert_of_not_mem [DecidableEq α] (s : Finset α) (a : α) (f : α → β) (comm)
    (ha : a ∉ s) :
    noncommProd (insert a s) f comm =
      f a * noncommProd s f (comm.mono fun _ => mem_insert_of_mem)

(comm : (↑(insert a s)).Pairwise fun a b => AddCommute (f a) (f b))

(insert a s).noncommSum f comm = f a + s.noncommSum f ⋯


theorem isClosed_preimage (A : Set S) : IsClosed (S.proj ⁻¹' A)

{X : Type u_2}
[TopologicalSpace X]
(S : DiscreteQuotient X)
(A : Set (Quotient S.toSetoid))


theorem toNNReal_iSup (hf : ∀ i, f i ≠ ∞) : (iSup f).toNNReal = ⨆ i, (f i).toNNReal

{ι : Sort u_1}
{f : ι → ℝ≥0∞}
(hf : ∀ (i : ι), f i ≠ ⊤)


theorem Valid.dual {t : Ordnode α} : Valid t → @Valid αᵒᵈ _ (.dual t)

{α : Type u_1}
[Preorder α]
{t : Ordnode α}


theorem HasFDerivWithinAt.csinh (hf : HasFDerivWithinAt f f' s x) :
    HasFDerivWithinAt (fun x => Complex.sinh (f x)) (Complex.cosh (f x) • f') s x

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
{f : E → ℂ}
{f' : E →L[ℂ] ℂ}
{x : E}
{s : Set E}
(hf : HasFDerivWithinAt f f' s x)


protected theorem lt_neg_of_lt_neg {a b : Int} (h : a < -b) : b < -a


lemma star_apply' (χ : MulChar R ℂ) (a : R) : star (χ a) = χ⁻¹ a

{R : Type u_1}
[CommRing R]
[Finite Rˣ]
(χ : MulChar R ℂ)
(a : R)


theorem differentiableAt {f : X → Y} {x : X} (h : ConformalAt f x) : DifferentiableAt ℝ f x

{X : Type u_1}
{Y : Type u_2}
[NormedAddCommGroup X]
[NormedAddCommGroup Y]
[NormedSpace ℝ X]
[NormedSpace ℝ Y]
{f : X → Y}
{x : X}
(h : ConformalAt f x)


lemma eventually_isCompact_closedBall [WeaklyLocallyCompactSpace α] (x : α) :
    ∀ᶠ r in 𝓝 (0 : ℝ), IsCompact (closedBall x r)

{α : Type u_2}
[PseudoMetricSpace α]
[WeaklyLocallyCompactSpace α]
(x : α)

∀ᶠ (r : ℝ) in 𝓝 0, IsCompact (Metric.closedBall x r)


@[to_additive]
theorem CauchySeq.mul_const {ι : Type*} [Preorder ι] {u : ι → α} {x : α} (hu : CauchySeq u) :
    CauchySeq fun n => u n * x

{α : Type u_1}
[UniformSpace α]
[AddGroup α]
[UniformAddGroup α]
{ι : Type u_3}
[Preorder ι]
{u : ι → α}
{x : α}
(hu : CauchySeq u)


lemma CompleteOrthogonalIdempotents.pair_iff {x y : R} :
    CompleteOrthogonalIdempotents ![x, y] ↔ IsIdempotentElem x ∧ y = 1 - x


/--
A class describing the property of preserving effective epimorphic families.
-/
class PreservesEffectiveEpiFamilies (F : C ⥤ D) : Prop where
  /--
  A functor preserves effective epimorphic families if it maps effective epimorphic families to
  effective epimorphic families.
  -/
  preserves : ∀ {α : Type u} {B : C} (X : α → C) (π : (a : α) → (X a ⟶ B)) [EffectiveEpiFamily X π],
    EffectiveEpiFamily (fun a ↦ F.obj (X a)) (fun a  ↦ F.map (π a))

CategoryTheory.EffectiveEpiFamily (fun a => F.obj (X a)) fun a => F.map (π a)


lemma Preadditive.mono_iff_injective' {X Y : C} (f : X ⟶ Y) :
    Mono f ↔ Function.Injective ((forget C).map f)

CategoryTheory.Mono f ↔ Function.Injective ((CategoryTheory.forget C).map f)


theorem inl_mem_sumLift₂ {c₁ : γ₁} :
    inl c₁ ∈ sumLift₂ f g a b ↔ ∃ a₁ b₁, a = inl a₁ ∧ b = inl b₁ ∧ c₁ ∈ f a₁ b₁

{α₁ : Type u_1}
{α₂ : Type u_2}
{β₁ : Type u_3}
{β₂ : Type u_4}
{γ₁ : Type u_5}
{γ₂ : Type u_6}
{f : α₁ → β₁ → Finset γ₁}
{g : α₂ → β₂ → Finset γ₂}
{a : α₁ ⊕ α₂}
{b : β₁ ⊕ β₂}
{c₁ : γ₁}

Sum.inl c₁ ∈ Finset.sumLift₂ f g a b ↔ ∃ a₁ b₁, a = Sum.inl a₁ ∧ b = Sum.inl b₁ ∧ c₁ ∈ f a₁ b₁


@[simp]
theorem disjUnion_product (hs : Disjoint s s') :
    s.disjUnion s' hs ×ˢ t = (s ×ˢ t).disjUnion (s' ×ˢ t) (disjoint_product.mpr <| Or.inl hs)

{α : Type u_1}
{β : Type u_2}
{s s' : Finset α}
{t : Finset β}
(hs : Disjoint s s')

s.disjUnion s' hs ×ˢ t = (s ×ˢ t).disjUnion (s' ×ˢ t) ⋯


theorem sup_le_inf : a ⊔ b ≤ a ⊓ b ↔ a = b


theorem Surjective.lieAlgebra_isSolvable [h₁ : IsSolvable R L'] (h₂ : Surjective f) :
    IsSolvable R L

{R : Type u}
{L : Type v}
{L' : Type w₁}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[LieRing L']
[LieAlgebra R L']
{f : L' →ₗ⁅R⁆ L}
[h₁ : LieAlgebra.IsSolvable R L']
(h₂ : Function.Surjective ⇑f)


@[simp]
protected theorem mul_neg (M : Matrix m n α) (N : Matrix n o α) : M * (-N) = -(M * N)

{m : Type u_2}
{n : Type u_3}
{o : Type u_4}
{α : Type v}
[NonUnitalNonAssocRing α]
[Fintype n]
(M : Matrix m n α)
(N : Matrix n o α)


theorem mapDomain_congr {f g : α → β} (h : ∀ x ∈ v.support, f x = g x) :
    v.mapDomain f = v.mapDomain g

{α : Type u_1}
{β : Type u_2}
{M : Type u_5}
[AddCommMonoid M]
{v : α →₀ M}
{f g : α → β}
(h : ∀ x ∈ v.support, f x = g x)

Finsupp.mapDomain f v = Finsupp.mapDomain g v


theorem monic_descPochhammer (n : ℕ) [Nontrivial R] [NoZeroDivisors R] :
    Monic <| descPochhammer R n

(R : Type u)
[Ring R]
(n : ℕ)
[Nontrivial R]
[NoZeroDivisors R]


@[simp, norm_cast]
protected theorem coe_zero [Zero α] [Preorder α] : ((0 : { x : α // 0 ≤ x }) : α) = 0


theorem infLELeft_apply (U V : Opens X) (x) :
    (infLELeft U V) x = ⟨x.1, (@inf_le_left _ _ U V : _ ≤ _) x.2⟩

{X : TopCat}
(U V : TopologicalSpace.Opens ↑X)
(x : ↥(U ⊓ V))


theorem uniformity_prod_eq_comap_prod [UniformSpace α] [UniformSpace β] :
    𝓤 (α × β) =
      comap (fun p : (α × β) × α × β => ((p.1.1, p.2.1), (p.1.2, p.2.2))) (𝓤 α ×ˢ 𝓤 β)

{α : Type ua}
{β : Type ub}
[UniformSpace α]
[UniformSpace β]


theorem sum_totient (n : ℕ) : n.divisors.sum φ = n


theorem isLittleO_const_mul_left_iff' {f : α → R} {c : R} (hc : IsUnit c) :
    (fun x => c * f x) =o[l] g ↔ f =o[l] g

{α : Type u_1}
{F : Type u_4}
{R : Type u_13}
[Norm F]
[SeminormedRing R]
{g : α → F}
{l : Filter α}
{f : α → R}
{c : R}
(hc : IsUnit c)


theorem Sphere.mk_center (c : P) (r : ℝ) : (⟨c, r⟩ : Sphere P).center = c

{P : Type u_2}
[MetricSpace P]
(c : P)
(r : ℝ)


/-- The equivalence between β-graded objects and γ-graded objects,
given an equivalence between β and γ.
-/
@[simps]
def comapEquiv {β γ : Type w} (e : β ≃ γ) : GradedObject β C ≌ GradedObject γ C

(C : Type u)
[CategoryTheory.Category.{v, u} C]
{β γ : Type w}
(e : β ≃ γ)

(CategoryTheory.GradedObject.comapEquiv C e).counitIso =
  CategoryTheory.Pi.comapComp (fun x => C) ⇑e.symm ⇑e ≪≫ CategoryTheory.GradedObject.comapEq C ⋯


lemma image_val_injective : Function.Injective ((↑) : Set A → Set α)


/-- A structure requiring that a scalar product is positive definite and symmetric, from which one
can construct an `InnerProductSpace` instance in `InnerProductSpace.ofCore`. -/
-- @[nolint HasNonemptyInstance] porting note: I don't think we have this linter anymore
structure InnerProductSpace.Core (𝕜 : Type*) (F : Type*) [RCLike 𝕜] [AddCommGroup F]
  [Module 𝕜 F] extends Inner 𝕜 F where
  /-- The inner product is *hermitian*, taking the `conj` swaps the arguments. -/
  conj_symm : ∀ x y, conj (inner y x) = inner x y
  /-- The inner product is positive (semi)definite. -/
  nonneg_re : ∀ x, 0 ≤ re (inner x x)
  /-- The inner product is positive definite. -/
  definite : ∀ x, inner x x = 0 → x = 0
  /-- The inner product is additive in the first coordinate. -/
  add_left : ∀ x y z, inner (x + y) z = inner x z + inner y z
  /-- The inner product is conjugate linear in the first coordinate. -/
  smul_left : ∀ x y r, inner (r • x) y = conj r * inner x y

{𝕜 : Type u_4}
{F : Type u_5}
[RCLike 𝕜]
[AddCommGroup F]
[Module 𝕜 F]
(self : InnerProductSpace.Core 𝕜 F)
(x y : F)


@[to_additive]
theorem Antitone.mulIndicator_eventuallyEq_iInter {ι} [Preorder ι] [One β] (s : ι → Set α)
    (hs : Antitone s) (f : α → β) (a : α) :
    (fun i => mulIndicator (s i) f a) =ᶠ[atTop] fun _ ↦ mulIndicator (⋂ i, s i) f a

{α : Type u_1}
{β : Type u_2}
{ι : Type u_5}
[Preorder ι]
[Zero β]
(s : ι → Set α)
(hs : Antitone s)
(f : α → β)
(a : α)

(fun i => (s i).indicator f a) =ᶠ[Filter.atTop] fun x => (⋂ i, s i).indicator f a


theorem cliqueSet_mono' (h : G ≤ H) : G.cliqueSet ≤ H.cliqueSet

{α : Type u_1}
{G H : SimpleGraph α}
(h : G ≤ H)


theorem mem_unique {o : Option α} {a b : α} (ha : a ∈ o) (hb : b ∈ o) : a = b

{α : Type u_1}
{o : Option α}
{a b : α}
(ha : a ∈ o)
(hb : b ∈ o)


/-- Characterization of the coproduct of the `Filter.map`s of two principal filters `𝓟 {a}` and
`𝓟 {i}`, the first under the constant function `fun a => b` and the second under the identity
function. Together with the next lemma, `map_prod_map_const_id_principal_coprod_principal`, this
provides an example showing that the inequality in the lemma `map_prod_map_coprod_le` can be strict.
-/
theorem map_const_principal_coprod_map_id_principal {α β ι : Type*} (a : α) (b : β) (i : ι) :
    (map (fun _ => b) (𝓟 {a})).coprod (map id (𝓟 {i})) =
      𝓟 ((({b} : Set β) ×ˢ univ) ∪ (univ ×ˢ ({i} : Set ι)))

{α : Type u_6}
{β : Type u_7}
{ι : Type u_8}
(a : α)
(b : β)
(i : ι)

(Filter.map (fun x => b) (𝓟 {a})).coprod (Filter.map id (𝓟 {i})) = 𝓟 ({b} ×ˢ Set.univ ∪ Set.univ ×ˢ {i})


theorem srangeRestrict_surjective (f : F) :
    Function.Surjective (srangeRestrict f : R → (srange f : NonUnitalSubsemiring S))

{R : Type u}
{S : Type v}
[NonUnitalNonAssocSemiring R]
[NonUnitalNonAssocSemiring S]
{F : Type u_1}
[FunLike F R S]
[NonUnitalRingHomClass F R S]
(f : F)


theorem strictMono_u [Preorder α] [Preorder β] (gi : GaloisInsertion l u) : StrictMono u

{α : Type u}
{β : Type v}
{l : α → β}
{u : β → α}
[Preorder α]
[Preorder β]
(gi : GaloisInsertion l u)


/-- If `R` contains a `n`-th primitive root, and `S/R` is a ring extension,
then the `n`-th roots of unity in `R` and `S` are isomorphic.
Also see `IsPrimitiveRoot.map_rootsOfUnity` for the equality as `Subgroup Sˣ`. -/
@[simps! (config := .lemmasOnly) apply_coe_val apply_coe_inv_val]
noncomputable
def _root_.rootsOfUnityEquivOfPrimitiveRoots {S F} [CommRing S] [IsDomain S]
    [FunLike F R S] [MonoidHomClass F R S]
    {n : ℕ+} {f : F} (hf : Function.Injective f) (hζ : (primitiveRoots n R).Nonempty) :
    (rootsOfUnity n R) ≃* rootsOfUnity n S

{R : Type u_4}
[CommRing R]
[IsDomain R]
{S : Type u_7}
{F : Type u_8}
[CommRing S]
[IsDomain S]
[FunLike F R S]
[MonoidHomClass F R S]
{n : ℕ+}
{f : F}
(hf : Function.Injective ⇑f)
(hζ : (primitiveRoots (↑n) R).Nonempty)

∀ (a : ↥(rootsOfUnity n R)), ↑↑((rootsOfUnityEquivOfPrimitiveRoots hf hζ) a) = f ↑↑a


protected theorem rel_eq_eqvGen_quot_rel :
    FilteredColimit.Rel.{v, u} F = EqvGen (Quot.Rel F)

{J : Type v}
[CategoryTheory.Category.{w, v} J]
(F : J ⥤ Type u)
[CategoryTheory.IsFilteredOrEmpty J]

CategoryTheory.Limits.Types.FilteredColimit.Rel F = EqvGen (CategoryTheory.Limits.Types.Quot.Rel F)


@[to_additive]
lemma inf_mul_left [SemilatticeInf β] [OrderTop β] (s t : Finset α) (f : α → β) :
    inf (s * t) f = inf s fun x ↦ inf t (f <| x * ·)

{α : Type u_2}
{β : Type u_3}
[DecidableEq α]
[Add α]
[SemilatticeInf β]
[OrderTop β]
(s t : Finset α)
(f : α → β)

(s + t).inf f = s.inf fun x => t.inf fun x_1 => f (x + x_1)


@[to_additive (attr := simp)]
theorem MulHom.id_comp [Mul M] [Mul N] (f : M →ₙ* N) : (MulHom.id N).comp f = f

{M : Type u_4}
{N : Type u_5}
[Add M]
[Add N]
(f : AddHom M N)


@[simp]
theorem toComon_forget : toComon_ C ⋙ Comon_.forget C = forget C

(C : Type u₁)
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.MonoidalCategory C]
[CategoryTheory.BraidedCategory C]

Bimon_.toComon_ C ⋙ Comon_.forget C = Bimon_.forget C


@[simp]
theorem cast_pos [Zero α] [One α] [Add α] [Neg α] (n : PosNum) : (pos n : α) = n

{α : Type u_1}
[Zero α]
[One α]
[Add α]
[Neg α]
(n : PosNum)


@[to_additive]
theorem mulSupport_pow [Monoid M] (f : α → M) (n : ℕ) :
    (mulSupport fun x => f x ^ n) ⊆ mulSupport f

{α : Type u_1}
{M : Type u_5}
[AddMonoid M]
(f : α → M)
(n : ℕ)

(Function.support fun x => n • f x) ⊆ Function.support f


theorem mul_den (q₁ q₂ : ℚ) :
    (q₁ * q₂).den =
      q₁.den * q₂.den / Nat.gcd (q₁.num * q₂.num).natAbs (q₁.den * q₂.den)

(q₁ * q₂).den = q₁.den * q₂.den / (q₁.num * q₂.num).natAbs.gcd (q₁.den * q₂.den)


theorem map_le_idealRange : I.map f ≤ f.idealRange

{R : Type u}
{L : Type v}
{L' : Type w₂}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[LieRing L']
[LieAlgebra R L']
(f : L →ₗ⁅R⁆ L')
(I : LieIdeal R L)


/-- To show that two subobjects are equal, it suffices to exhibit an isomorphism commuting with
    the arrows. -/
theorem eq_mk_of_comm {B A : C} {X : Subobject B} (f : A ⟶ B) [Mono f] (i : (X : C) ≅ A)
    (w : i.hom ≫ f = X.arrow) : X = mk f

(i : CategoryTheory.Subobject.underlying.obj X ≅ A)

(w : CategoryTheory.CategoryStruct.comp i.hom f = X.arrow)


theorem geomSum_injective {n : ℕ} (hn : 2 ≤ n) :
    Function.Injective (fun s : Finset ℕ ↦ ∑ i in s, n ^ i)

Function.Injective fun s => ∑ i ∈ s, n ^ i


theorem _root_.stronglyMeasurable_bot_iff [Nonempty β] [T2Space β] :
    StronglyMeasurable[⊥] f ↔ ∃ c, f = fun _ => c

{α : Type u_1}
{β : Type u_2}
{f : α → β}
[TopologicalSpace β]
[Nonempty β]
[T2Space β]

MeasureTheory.StronglyMeasurable f ↔ ∃ c, f = fun x => c


theorem isBoundedUnder_le_finset_sup' [LinearOrder β] [Nonempty β] {f : Filter α} {F : ι → α → β}
    {s : Finset ι} (hs : s.Nonempty) (h : ∀ i ∈ s, f.IsBoundedUnder (· ≤ ·) (F i)) :
    f.IsBoundedUnder (· ≤ ·) (fun a ↦ sup' s hs (fun i ↦ F i a))

{F : ι → α → β}

(h : ∀ i ∈ s, Filter.IsBoundedUnder (fun x x_1 => x ≤ x_1) f (F i))

Filter.IsBoundedUnder (fun x x_1 => x ≤ x_1) f fun a => s.sup' hs fun i => F i a


/-- A Galois coinsertion is a Galois connection where `u ∘ l = id`. It also contains a constructive
choice function, to give better definitional equalities when lifting order structures. Dual to
`GaloisInsertion` -/
structure GaloisCoinsertion [Preorder α] [Preorder β] (l : α → β) (u : β → α) where
  /-- A contructive choice function for images of `u`. -/
  choice : ∀ x : β, x ≤ l (u x) → α
  /-- The Galois connection associated to a Galois coinsertion. -/
  gc : GaloisConnection l u
  /-- Main property of a Galois coinsertion. -/
  u_l_le : ∀ x, u (l x) ≤ x
  /-- Property of the choice function. -/
  choice_eq : ∀ a h, choice a h = u a

{α : Type u}
{β : Type v}
[Preorder α]
[Preorder β]
{l : α → β}
{u : β → α}
(self : GaloisCoinsertion l u)
(a : β)
(h : a ≤ l (u a))


protected theorem memℓp (f : lp E p) : Memℓp f p

{α : Type u_1}
{E : α → Type u_2}
{p : ℝ≥0∞}
[(i : α) → NormedAddCommGroup (E i)]
(f : ↥(lp E p))


lemma quasiIso_of_comp_right (φ : S₁ ⟶ S₂) (φ' : S₂ ⟶ S₃)
    [hφ' : QuasiIso φ'] [hφφ' : QuasiIso (φ ≫ φ')] :
    QuasiIso φ

{S₁ S₂ S₃ : CategoryTheory.ShortComplex C}

[hφ' : CategoryTheory.ShortComplex.QuasiIso φ']

[hφφ' : CategoryTheory.ShortComplex.QuasiIso (CategoryTheory.CategoryStruct.comp φ φ')]


theorem card_Iic : (Finset.Iic s).card = ∏ i ∈ s.toFinset, (s.count i + 1)

{α : Type u_1}
[DecidableEq α]
(s : Multiset α)

(Finset.Iic s).card = ∏ i ∈ s.toFinset, (Multiset.count i s + 1)


theorem Basis'.indep (hI : M.Basis' I X) : M.Indep I

{α : Type u_1}
{M : Matroid α}
{I X : Set α}
(hI : M.Basis' I X)


theorem sup_of_mem {s : Finset β} (f : β → α) {b : β} (h : b ∈ s) :
    ∃ a : α, s.sup ((↑) ∘ f : β → WithBot α) = ↑a

{α : Type u_2}
{β : Type u_3}
[SemilatticeSup α]
{s : Finset β}
(f : β → α)
{b : β}
(h : b ∈ s)


/-- The cosine of an angle in a right-angled triangle as a ratio of sides. -/
theorem cos_angle_of_angle_eq_pi_div_two {p₁ p₂ p₃ : P} (h : ∠ p₁ p₂ p₃ = π / 2) :
    Real.cos (∠ p₂ p₃ p₁) = dist p₃ p₂ / dist p₁ p₃

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{p₁ p₂ p₃ : P}
(h : ∠ p₁ p₂ p₃ = π / 2)


@[simp]
theorem iSup_adj {f : ι → G.Subgraph} : (⨆ i, f i).Adj a b ↔ ∃ i, (f i).Adj a b

{ι : Sort u_1}
{V : Type u}
{G : SimpleGraph V}
{a b : V}
{f : ι → G.Subgraph}


@[simp]
theorem wOppSide_self_iff {s : AffineSubspace R P} {x : P} : s.WOppSide x x ↔ x ∈ s

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[LinearOrderedField R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
{s : AffineSubspace R P}
{x : P}


theorem zeroLocus_empty_of_one_mem {s : Set R} (h : (1 : R) ∈ s) : zeroLocus s = ∅

{R : Type u}
[CommSemiring R]
{s : Set R}
(h : 1 ∈ s)


@[simp]
theorem extendWith_none [∀ i, Zero (α i)] (f : Π₀ i, α (some i)) (a : α none) :
    f.extendWith a none = a

{ι : Type u}
{α : Option ι → Type v}
[(i : Option ι) → Zero (α i)]
(f : Π₀ (i : ι), α (some i))
(a : α none)


theorem insert_of_symmetric (hs : IsAntichain r s) (hr : Symmetric r)
    (h : ∀ ⦃b⦄, b ∈ s → a ≠ b → ¬r a b) : IsAntichain r (insert a s)

{α : Type u_1}
{r : α → α → Prop}
{s : Set α}
{a : α}
(hs : IsAntichain r s)
(hr : Symmetric r)
(h : ∀ ⦃b : α⦄, b ∈ s → a ≠ b → ¬r a b)


/-- The right inverse of matrix A equals the left inverse of A when they exist. -/
theorem right_inv_eq_left_inv (h : A * B = 1) (g : C * A = 1) : B = C

{n : Type u'}
{α : Type v}
[Fintype n]
[DecidableEq n]
[CommRing α]
{A B C : Matrix n n α}
(h : A * B = 1)
(g : C * A = 1)


theorem finite_setOf_restriction (M : Matroid α) [M.Finite] : {N | N ≤r M}.Finite

{α : Type u_1}
(M : Matroid α)
[M.Finite]


/-- Auxiliary definition for `IsMeasurableRatCDF.stieltjesFunction`: turn `f : α → ℚ → ℝ` into
a function `α → ℝ → ℝ` by assigning to `f a x` the infimum of `f a q` over `q : ℚ` with `x < q`. -/
noncomputable irreducible_def IsMeasurableRatCDF.stieltjesFunctionAux (f : α → ℚ → ℝ) :
    α → ℝ → ℝ

{α : Type u_4}
(f : α → ℚ → ℝ)
(a : α)
(x : ℝ)

ProbabilityTheory.IsMeasurableRatCDF.stieltjesFunctionAux f a x = ⨅ q, f a ↑q


@[to_additive]
theorem mem_list_prod {l : List (Set α)} {a : α} :
    a ∈ l.prod ↔
      ∃ l' : List (Σs : Set α, ↥s),
        List.prod (l'.map fun x ↦ (Sigma.snd x : α)) = a ∧ l'.map Sigma.fst = l

{α : Type u_2}
[AddMonoid α]
{l : List (Set α)}
{a : α}

a ∈ l.sum ↔ ∃ l', (List.map (fun x => ↑x.snd) l').sum = a ∧ List.map Sigma.fst l' = l


theorem MonoidalCategory.braiding_hom_apply {A B : Rep k G} (x : A) (y : B) :
    Action.Hom.hom (β_ A B).hom (TensorProduct.tmul k x y) = TensorProduct.tmul k y x

{k G : Type u}
[CommRing k]
[Monoid G]
{A B : Rep k G}
(x : CoeSort.coe A)
(y : CoeSort.coe B)

(β_ A B).hom.hom (x ⊗ₜ[k] y) = y ⊗ₜ[k] x


@[simp]
theorem zipWith_map {μ} (f : γ → δ → μ) (g : α → γ) (h : β → δ) (l₁ : List α) (l₂ : List β) :
    zipWith f (l₁.map g) (l₂.map h) = zipWith (fun a b => f (g a) (h b)) l₁ l₂

{γ : Type u_1}
{δ : Type u_2}
{α : Type u_3}
{β : Type u_4}
{μ : Type u_5}
(f : γ → δ → μ)
(g : α → γ)
(h : β → δ)
(l₁ : List α)
(l₂ : List β)

List.zipWith f (List.map g l₁) (List.map h l₂) = List.zipWith (fun a b => f (g a) (h b)) l₁ l₂


lemma sSup_eq_zero : sSup s = 0 ↔ ∀ a ∈ s, a = 0


@[simp]
theorem coe_fn_eq {f g : F} : (f : ∀ a : α, β a) = (g : ∀ a : α, β a) ↔ f = g

{F : Sort u_1}
{α : Sort u_2}
{β : α → Sort u_3}
[i : DFunLike F α β]
{f g : F}


lemma log_pos_of_isNegNat {n : ℕ} (h : NormNum.IsInt e (.negOfNat n)) (w : Nat.blt 1 n = true) :
    0 < Real.log (e : ℝ)

(h : Mathlib.Meta.NormNum.IsInt e (Int.negOfNat n))


/-- Infinite ordinals that are cardinals are unbounded. -/
theorem ord_card_unbounded' : Unbounded (· < ·) { b : Ordinal | b.card.ord = b ∧ ω ≤ b }

Set.Unbounded (fun x x_1 => x < x_1) {b | b.card.ord = b ∧ ω ≤ b}


/-- An element admitting a left inverse is left-regular. -/
@[to_additive "An element admitting a left additive opposite is add-left-regular."]
theorem isLeftRegular_of_mul_eq_one (h : b * a = 1) : IsLeftRegular a

{R : Type u_1}
[Monoid R]
{a b : R}
(h : b * a = 1)


theorem card_fintype_Ioc_of_le (h : a ≤ b) : (Fintype.card (Set.Ioc a b) : ℤ) = b - a


/-- An induction principle to deduce results for `Angle` from those for `ℝ`, used with
`induction θ using Real.Angle.induction_on`. -/
@[elab_as_elim]
protected theorem induction_on {p : Angle → Prop} (θ : Angle) (h : ∀ x : ℝ, p x) : p θ

{p : Real.Angle → Prop}
(θ : Real.Angle)
(h : ∀ (x : ℝ), p ↑x)


/-- For any functor `F : C ⥤ D`, this is the obvious isomorphism
`shiftFunctor C (0 : A) ⋙ F ≅ F ⋙ shiftFunctor D (0 : A)` deduced from the
isomorphisms `shiftFunctorZero` on both categories `C` and `D`. -/
@[simps!]
noncomputable def isoZero : shiftFunctor C (0 : A) ⋙ F ≅ F ⋙ shiftFunctor D (0 : A)

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_6, u_1} C]
[CategoryTheory.Category.{u_7, u_2} D]
(F : CategoryTheory.Functor C D)
(A : Type u_4)
[AddMonoid A]
[CategoryTheory.HasShift C A]
[CategoryTheory.HasShift D A]
(X : C)

(CategoryTheory.Functor.CommShift.isoZero F A).hom.app X =
  CategoryTheory.CategoryStruct.comp (F.map ((CategoryTheory.shiftFunctorZero C A).hom.app X))
    ((CategoryTheory.shiftFunctorZero D A).inv.app (F.obj X))


theorem Functor.isZero_iff [HasZeroObject D] (F : C ⥤ D) : IsZero F ↔ ∀ X, IsZero (F.obj X)

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{D : Type u'}
[CategoryTheory.Category.{v', u'} D]
[CategoryTheory.Limits.HasZeroObject D]
(F : C ⥤ D)

CategoryTheory.Limits.IsZero F ↔ ∀ (X : C), CategoryTheory.Limits.IsZero (F.obj X)


theorem isTorsion'_powers_iff (p : R) :
    IsTorsion' M (Submonoid.powers p) ↔ ∀ x : M, ∃ n : ℕ, p ^ n • x = 0

{R : Type u_1}
{M : Type u_2}
[Monoid R]
[AddCommMonoid M]
[DistribMulAction R M]
(p : R)

Module.IsTorsion' M ↥(Submonoid.powers p) ↔ ∀ (x : M), ∃ n, p ^ n • x = 0


/-- If `l` lists all the elements of `α` without duplicates, then `List.get` defines
a bijection `Fin l.length → α`.  See `List.Nodup.getEquivOfForallMemList`
for a version giving an equivalence when there is decidable equality. -/
@[simps]
def getBijectionOfForallMemList (l : List α) (nd : l.Nodup) (h : ∀ x : α, x ∈ l) :
    { f : Fin l.length → α // Function.Bijective f }

{α : Type u_1}
(l : List α)
(nd : l.Nodup)
(h : ∀ (x : α), x ∈ l)
(i : Fin l.length)

↑(List.Nodup.getBijectionOfForallMemList l nd h) i = l.get i


@[simp, aesop norm (rule_sets := [Sym2])]
theorem mem_iff {a b c : α} : a ∈ s(b, c) ↔ a = b ∨ a = c


theorem map₂_sup_right (f : M →ₗ[R] N →ₗ[R] P) (p : Submodule R M) (q₁ q₂ : Submodule R N) :
    map₂ f p (q₁ ⊔ q₂) = map₂ f p q₁ ⊔ map₂ f p q₂

{R : Type u_1}
{M : Type u_2}
{N : Type u_3}
{P : Type u_4}
[CommSemiring R]
[AddCommMonoid M]
[AddCommMonoid N]
[AddCommMonoid P]
[Module R M]
[Module R N]
[Module R P]
(f : M →ₗ[R] N →ₗ[R] P)
(p : Submodule R M)
(q₁ q₂ : Submodule R N)

Submodule.map₂ f p (q₁ ⊔ q₂) = Submodule.map₂ f p q₁ ⊔ Submodule.map₂ f p q₂


theorem truncate_eq_of_agree {n : ℕ} (x : CofixA F n) (y : CofixA F (succ n)) (h : Agree x y) :
    truncate y = x

{F : PFunctor.{u}}
{n : ℕ}
(x : PFunctor.Approx.CofixA F n)
(y : PFunctor.Approx.CofixA F n.succ)
(h : PFunctor.Approx.Agree x y)


theorem lt_opow_iff_log_lt {b x c : Ordinal} (hb : 1 < b) (hx : x ≠ 0) : x < b ^ c ↔ log b x < c

{b x c : Ordinal.{u_1}}
(hb : 1 < b)
(hx : x ≠ 0)


/-- Expand `inner (x + y) (x + y)` -/
theorem inner_add_add_self (x y : F) : ⟪x + y, x + y⟫ = ⟪x, x⟫ + ⟪x, y⟫ + ⟪y, x⟫ + ⟪y, y⟫

{𝕜 : Type u_1}
{F : Type u_3}
[RCLike 𝕜]
[AddCommGroup F]
[Module 𝕜 F]
[c : InnerProductSpace.Core 𝕜 F]
(x y : F)

⟪x + y, x + y⟫_𝕜 = ⟪x, x⟫_𝕜 + ⟪x, y⟫_𝕜 + ⟪y, x⟫_𝕜 + ⟪y, y⟫_𝕜


theorem mul_ofDigits (n : ℕ) {b : ℕ} {l : List ℕ} :
    n * ofDigits b l = ofDigits b (l.map (n * ·))

n * Nat.ofDigits b l = Nat.ofDigits b (List.map (fun x => n * x) l)


theorem covBy_iff_wcovBy_and_ne : a ⋖ b ↔ a ⩿ b ∧ a ≠ b

{α : Type u_1}
[PartialOrder α]
{a b : α}


theorem integrable_finset_sum {ι} (s : Finset ι) {f : ι → α → β}
    (hf : ∀ i ∈ s, Integrable (f i) μ) : Integrable (fun a => ∑ i ∈ s, f i a) μ

{f : ι → α → β}

(hf : ∀ i ∈ s, MeasureTheory.Integrable (f i) μ)

MeasureTheory.Integrable (fun a => ∑ i ∈ s, f i a) μ


/-- The prepartition with boxes `{J ∈ π | p J}`. -/
@[simps]
def filter (π : Prepartition I) (p : Box ι → Prop) : Prepartition I

{ι : Type u_1}
{I : BoxIntegral.Box ι}
(π : BoxIntegral.Prepartition I)
(p : BoxIntegral.Box ι → Prop)

(π.filter p).boxes = Finset.filter p π.boxes


@[simp] lemma toENat_eq_nat {a : Cardinal} {n : ℕ} : toENat a = n ↔ a = n


theorem Embedding.prod_map {f : X → Y} {g : Z → W} (hf : Embedding f) (hg : Embedding g) :
    Embedding (Prod.map f g)

{X : Type u}
{Y : Type v}
{Z : Type u_1}
{W : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
[TopologicalSpace W]
{f : X → Y}
{g : Z → W}
(hf : Embedding f)
(hg : Embedding g)


@[simp]
theorem symm_comp_self (f : M ≃[L] N) : f.symm.comp f = refl L M

{L : FirstOrder.Language}
{M : Type w}
{N : Type w'}
[L.Structure M]
[L.Structure N]
(f : L.Equiv M N)

f.symm.comp f = FirstOrder.Language.Equiv.refl L M


/-- Core data defining a locally trivial bundle with fiber `F` over a topological
space `B`. Note that "bundle" is used in its mathematical sense. This is the (computer science)
bundled version, i.e., all the relevant data is contained in the following structure. A family of
local trivializations is indexed by a type `ι`, on open subsets `baseSet i` for each `i : ι`.
Trivialization changes from `i` to `j` are given by continuous maps `coordChange i j` from
`baseSet i ∩ baseSet j` to the set of homeomorphisms of `F`, but we express them as maps
`B → F → F` and require continuity on `(baseSet i ∩ baseSet j) × F` to avoid the topology on the
space of continuous maps on `F`. -/
-- Porting note(#5171): was @[nolint has_nonempty_instance]
structure FiberBundleCore (ι : Type*) (B : Type*) [TopologicalSpace B] (F : Type*)
    [TopologicalSpace F] where
  baseSet : ι → Set B
  isOpen_baseSet : ∀ i, IsOpen (baseSet i)
  indexAt : B → ι
  mem_baseSet_at : ∀ x, x ∈ baseSet (indexAt x)
  coordChange : ι → ι → B → F → F
  coordChange_self : ∀ i, ∀ x ∈ baseSet i, ∀ v, coordChange i i x v = v
  continuousOn_coordChange : ∀ i j,
    ContinuousOn (fun p : B × F => coordChange i j p.1 p.2) ((baseSet i ∩ baseSet j) ×ˢ univ)
  coordChange_comp : ∀ i j k, ∀ x ∈ baseSet i ∩ baseSet j ∩ baseSet k, ∀ v,
    (coordChange j k x) (coordChange i j x v) = coordChange i k x v

{ι : Type u_5}
{B : Type u_6}
[TopologicalSpace B]
{F : Type u_7}
[TopologicalSpace F]
(self : FiberBundleCore ι B F)
(i : ι)


lemma IsIntegralCurve.comp_mul (hγ : IsIntegralCurve γ v) (a : ℝ) :
    IsIntegralCurve (γ ∘ (· * a)) (a • v)

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{H : Type u_2}
[TopologicalSpace H]
{I : ModelWithCorners ℝ E H}
{M : Type u_3}
[TopologicalSpace M]
[ChartedSpace H M]
[SmoothManifoldWithCorners I M]
{γ : ℝ → M}
{v : (x : M) → TangentSpace I x}
(hγ : IsIntegralCurve γ v)
(a : ℝ)

IsIntegralCurve (γ ∘ fun x => x * a) (a • v)


theorem inv_lt_inv₀ (ha : a ≠ 0) (hb : b ≠ 0) : a⁻¹ < b⁻¹ ↔ b < a

{α : Type u_1}
[LinearOrderedCommGroupWithZero α]
{a b : α}
(ha : a ≠ 0)
(hb : b ≠ 0)


@[to_additive]
theorem mul_subset_iff_right : s * t ⊆ u ↔ ∀ b ∈ t, op b • s ⊆ u

s * t ⊆ u ↔ ∀ b ∈ t, MulOpposite.op b • s ⊆ u


lemma elim'_eq_elim {α β : Type*} (b : β) (f : α → β) (a : Option α) :
    Option.elim' b f a = Option.elim a b f

{α : Type u_3}
{β : Type u_4}
(b : β)
(f : α → β)
(a : Option α)


theorem leftpad_prefix (n : Nat) (a : α) (l : List α) :
    replicate (n - length l) a <+: leftpad n a l

{α : Type u_1}
(n : Nat)
(a : α)
(l : List α)

List.replicate (n - l.length) a <+: List.leftpad n a l


/-- At each step of the inductive construction, the cardinality bound `≤ (max #s 2) ^ ℵ₀` holds.
-/
theorem cardinal_generateMeasurableRec_le (s : Set (Set α)) (i : ω₁) :
    #(generateMeasurableRec s i) ≤ max #s 2 ^ aleph0.{u}

(i : (Quotient.out (Cardinal.aleph 1).ord).α)

#↑(MeasurableSpace.generateMeasurableRec s i) ≤ max (#↑s) 2 ^ ℵ₀


@[to_additive]
theorem subset_mul_self (B : GroupFilterBasis G) {U : Set G} (h : U ∈ B) : U ⊆ U * U

{G : Type u}
[AddGroup G]
(B : AddGroupFilterBasis G)
{U : Set G}
(h : U ∈ B)


theorem expand_C (p : ℕ) (r : R) : expand p (C r : MvPolynomial σ R) = C r

{σ : Type u_1}
{R : Type u_3}
[CommSemiring R]
(p : ℕ)
(r : R)

(MvPolynomial.expand p) (MvPolynomial.C r) = MvPolynomial.C r


theorem pointwise_smul_eq_comap {a : M} (S : Ideal R) :
    a • S = S.comap (MulSemiringAction.toRingAut _ _ a).symm

{M : Type u_1}
{R : Type u_2}
[Group M]
[CommRing R]
[MulSemiringAction M R]
{a : M}
(S : Ideal R)

a • S = Ideal.comap (RingEquiv.symm ((MulSemiringAction.toRingAut M R) a)) S


@[to_additive]
lemma units_sInf {s : Set (Submonoid M)} : (sInf s).units = ⨅ S ∈ s, S.units

{M : Type u_1}
[Monoid M]
{s : Set (Submonoid M)}


theorem le_div_iff_mul_le {I J K : Submodule R A} : I ≤ J / K ↔ I * K ≤ J

{R : Type u}
[CommSemiring R]
{A : Type v}
[CommSemiring A]
[Algebra R A]
{I J K : Submodule R A}


protected theorem ContinuousLinearMap.hasDerivAtFilter : HasDerivAtFilter e (e 1) x L

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{x : 𝕜}
{L : Filter 𝕜}
(e : 𝕜 →L[𝕜] F)


@[simp, reassoc]
lemma comp_val {A B C : PointedGaloisObject F} (f : A ⟶ B) (g : B ⟶ C) :
    (f ≫ g).val = f.val ≫ g.val

{F : CategoryTheory.Functor C FintypeCat}

{A B : CategoryTheory.PreGaloisCategory.PointedGaloisObject F}

∀ {C_1 : CategoryTheory.PreGaloisCategory.PointedGaloisObject F} (f : A ⟶ B) (g : B ⟶ C_1),
  (CategoryTheory.CategoryStruct.comp f g).val = CategoryTheory.CategoryStruct.comp f.val g.val


@[simp high]
theorem tangentBundleCore_baseSet (i) : (tangentBundleCore I M).baseSet i = i.1.source

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_4}
[TopologicalSpace H]
(I : ModelWithCorners 𝕜 E H)
(M : Type u_6)
[TopologicalSpace M]
[ChartedSpace H M]
[SmoothManifoldWithCorners I M]
(i : ↑(atlas H M))

(tangentBundleCore I M).baseSet i = (↑i).source


theorem Sublist.prod_dvd_prod [CommMonoid M] {l₁ l₂ : List M} (h : l₁ <+ l₂) :
    l₁.prod ∣ l₂.prod

{M : Type u_4}
[CommMonoid M]
{l₁ l₂ : List M}
(h : l₁ <+ l₂)


{α : Type u_1}
[LinearOrder α]
{a c : α}


@[simp]
theorem prod_comap_inl : (prod p q).comap (inl R M M₂) = p

{R : Type u}
{M : Type v}
{M₂ : Type w}
[Semiring R]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R M₂]
(p : Submodule R M)
(q : Submodule R M₂)

Submodule.comap (LinearMap.inl R M M₂) (p.prod q) = p


@[to_additive (attr := simp)]
theorem coe_subtype : ⇑S.subtype = Subtype.val

{M : Type u_1}
[MulOneClass M]
(S : Submonoid M)


theorem Countable.union {s t : Set α} (hs : s.Countable) (ht : t.Countable) : (s ∪ t).Countable

{α : Type u}
{s t : Set α}
(hs : s.Countable)
(ht : t.Countable)


@[simp]
lemma prodMkRight_zero : Kernel.prodMkRight α (0 : Kernel β γ) = 0

{α : Type u_1}
{β : Type u_2}
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}
{γ : Type u_5}
{mγ : MeasurableSpace γ}

ProbabilityTheory.Kernel.prodMkRight α 0 = 0


/-- The point in a simplex constructed with `mkOfPoint`. -/
@[simp]
theorem mkOfPoint_points (p : P) (i : Fin 1) : (mkOfPoint k p).points i = p

(k : Type u_1)
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
(p : P)
(i : Fin 1)

(Affine.Simplex.mkOfPoint k p).points i = p


theorem adjoin_rootSet_isSplittingField {p : F[X]} (hp : p.Splits (algebraMap F E)) :
    p.IsSplittingField F (adjoin F (p.rootSet E))

(hp : Polynomial.Splits (algebraMap F E) p)

Polynomial.IsSplittingField F (↥(IntermediateField.adjoin F (p.rootSet E))) p


theorem thickenedIndicatorAux_zero {δ : ℝ} (δ_pos : 0 < δ) (E : Set α) {x : α}
    (x_out : x ∉ thickening δ E) : thickenedIndicatorAux δ E x = 0

{α : Type u_1}
[PseudoEMetricSpace α]
{δ : ℝ}
(δ_pos : 0 < δ)
(E : Set α)
{x : α}
(x_out : x ∉ Metric.thickening δ E)


/-- Angles in a vector space are translation invariant -/
@[simp]
theorem angle_sub_const (v₁ v₂ v₃ : V) (v : V) : ∠ (v₁ - v) (v₂ - v) (v₃ - v) = ∠ v₁ v₂ v₃

{V : Type u_1}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
(v₁ v₂ v₃ v : V)

EuclideanGeometry.angle (v₁ - v) (v₂ - v) (v₃ - v) = EuclideanGeometry.angle v₁ v₂ v₃


theorem isLinearMap_smul' {R M : Type*} [Semiring R] [AddCommMonoid M] [Module R M] (a : M) :
    IsLinearMap R fun c : R ↦ c • a

{R : Type u_17}
{M : Type u_18}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(a : M)


{R : Type u}
[CommSemiring R]
{A : Type v}
[Semiring A]
[Algebra R A]
(M : Submodule R A)


@[to_additive (attr := simp)]
theorem inv_eq_empty : s⁻¹ = ∅ ↔ s = ∅

{α : Type u_2}
[InvolutiveInv α]
{s : Set α}

s⁻¹ = ∅ ↔ s = ∅


theorem conductor_eq_of_eq {y : S} (h : (R<x> : Set S) = R<y>) : conductor R x = conductor R y

(h : ↑(Algebra.adjoin R {x}) = ↑(Algebra.adjoin R {y}))


@[simp]
theorem extend_comp_coe {f : hatα → β} (hf : UniformContinuous f) : pkg.extend (f ∘ ι) = f

{α : Type u_1}
[UniformSpace α]
(pkg : AbstractCompletion α)
{β : Type u_2}
[UniformSpace β]
[CompleteSpace β]
[T0Space β]
{f : pkg.space → β}
(hf : UniformContinuous f)


@[to_additive (attr := simp)]
theorem MonoidHom.coe_comp [MulOneClass M] [MulOneClass N] [MulOneClass P]
    (g : N →* P) (f : M →* N) : ↑(g.comp f) = g ∘ f

{M : Type u_4}
{N : Type u_5}
{P : Type u_6}
[AddZeroClass M]
[AddZeroClass N]
[AddZeroClass P]
(g : N →+ P)
(f : M →+ N)


@[simp]
theorem mapAccumr₂_cons :
    mapAccumr₂ f (x ::ᵥ xs) (y ::ᵥ ys) s
    = let r := mapAccumr₂ f xs ys s
      let q := f x y r.1
      (q.1, q.2 ::ᵥ r.2)

{α β : Type}
{n : ℕ}
(xs : Mathlib.Vector α n)
(ys : Mathlib.Vector β n)

∀ {α_1 β_1 : Type} {f : α → β → α_1 → α_1 × β_1} {x : α} {y : β} {s : α_1},
  Mathlib.Vector.mapAccumr₂ f (x ::ᵥ xs) (y ::ᵥ ys) s =
    let r := Mathlib.Vector.mapAccumr₂ f xs ys s;
    let q := f x y r.1;
    (q.1, q.2 ::ᵥ r.2)


theorem update_data (self : Buckets α β) (i d h) :
    (self.update i d h).1.data = self.1.data.set i.toNat d

(self : Batteries.HashMap.Imp.Buckets α β)

(self.update i d h).val.data = self.val.data.set i.toNat d


@[simp]
theorem out_truncateFun (x : 𝕎 R) : (truncateFun n x).out = init n x

{p n : ℕ}
{R : Type u_1}
[CommRing R]
(x : 𝕎 R)

(WittVector.truncateFun n x).out = WittVector.init n x


@[simp] theorem exists_exists_and_eq_and {f : α → β} {p : α → Prop} {q : β → Prop} :
    (∃ b, (∃ a, p a ∧ f a = b) ∧ q b) ↔ ∃ a, p a ∧ q (f a)

{α : Sort u_1}
{β : Sort u_2}
{f : α → β}
{p : α → Prop}
{q : β → Prop}


/-- If `F` and `G` are naturally isomorphic functors, then they have equivalent categories of
cones.
-/
@[simps]
def postcomposeEquivalence {G : J ⥤ C} (α : F ≅ G) : Cone F ≌ Cone G

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{F G : J ⥤ C}
(α : F ≅ G)

(CategoryTheory.Limits.Cones.postcomposeEquivalence α).functor = CategoryTheory.Limits.Cones.postcompose α.hom


@[to_additive (attr := simp)]
theorem coe_comap (K : Subgroup N) (f : G →* N) : (K.comap f : Set G) = f ⁻¹' K

{G : Type u_1}
[AddGroup G]
{N : Type u_5}
[AddGroup N]
(K : AddSubgroup N)
(f : G →+ N)


protected theorem Function.Surjective.iInf_congr {g : ι' → α} (h : ι → ι') (h1 : Surjective h)
    (h2 : ∀ x, g (h x) = f x) : ⨅ x, f x = ⨅ y, g y

{α : Type u_1}
{ι : Sort u_5}
{ι' : Sort u_6}
[InfSet α]
{f : ι → α}
{g : ι' → α}
(h : ι → ι')
(h1 : Function.Surjective h)
(h2 : ∀ (x : ι), g (h x) = f x)


theorem suffix_or_suffix_of_suffix (h₁ : l₁ <:+ l₃) (h₂ : l₂ <:+ l₃) : l₁ <:+ l₂ ∨ l₂ <:+ l₁

∀ {α : Type u_1} {l₁ l₃ l₂ : List α}, l₁ <:+ l₃ → l₂ <:+ l₃ → l₁ <:+ l₂ ∨ l₂ <:+ l₁


/-- A system of complete orthogonal idempotents lift along nil ideals. -/
lemma CompleteOrthogonalIdempotents.lift_of_isNilpotent_ker
    (h : ∀ x ∈ RingHom.ker f, IsNilpotent x)
    {e : I → S} (he : CompleteOrthogonalIdempotents e) (he' : ∀ i, e i ∈ f.range) :
    ∃ e' : I → R, CompleteOrthogonalIdempotents e' ∧ f ∘ e' = e

∃ e', CompleteOrthogonalIdempotents e' ∧ ⇑f ∘ e' = e


/-- To show that an invariant σ-finite measure is regular it is sufficient to show that it is finite
  on some compact set with non-empty interior. -/
@[to_additive
"To show that an invariant σ-finite measure is regular it is sufficient to show that it is finite on
some compact set with non-empty interior."]
theorem regular_of_isMulLeftInvariant {μ : Measure G} [SigmaFinite μ] [IsMulLeftInvariant μ]
    {K : Set G} (hK : IsCompact K) (h2K : (interior K).Nonempty) (hμK : μ K ≠ ∞) : Regular μ

{G : Type u_1}
[Group G]
[TopologicalSpace G]
[TopologicalGroup G]
[MeasurableSpace G]
[BorelSpace G]
[SecondCountableTopology G]
{μ : MeasureTheory.Measure G}
[MeasureTheory.SigmaFinite μ]
[μ.IsMulLeftInvariant]
{K : Set G}
(hK : IsCompact K)
(h2K : (interior K).Nonempty)
(hμK : μ K ≠ ⊤)


theorem bsize : ∀ {s}, ValidFor l m r s → s.bsize = utf8Len m

Substring.ValidFor l m r s → s.bsize = String.utf8Len m


theorem lcs_top : (⊤ : LieIdeal R L).lcs M k = lowerCentralSeries R L M k

{R : Type u_1}
{L : Type u_2}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
(M : Type u_3)
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
(k : ℕ)

⊤.lcs M k = LieModule.lowerCentralSeries R L M k


@[to_additive (attr := simp)]
lemma unop_smul [SMul α β] (a : α) (b : βᵐᵒᵖ) : unop (a • b) = a • unop b

{α : Type u_1}
{β : Type u_2}
[VAdd α β]
(a : α)
(b : βᵃᵒᵖ)

AddOpposite.unop (a +ᵥ b) = a +ᵥ AddOpposite.unop b


theorem lipschitz_sub (hf : ApproximatesLinearOn f f' s c) :
    LipschitzWith c fun x : s => f x - f' x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{f' : E →L[𝕜] F}
{s : Set E}
{c : ℝ≥0}
(hf : ApproximatesLinearOn f f' s c)


@[simp]
theorem mem_sortedUniv {α} [Fintype α] [Encodable α] (x : α) : x ∈ sortedUniv α

{α : Type u_2}
[Fintype α]
[Encodable α]
(x : α)


@[to_additive]
theorem div_le_div_iff_right (c : α) : a / c ≤ b / c ↔ a ≤ b

[CovariantClass α α (Function.swap fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1]


/-- See note [partially-applied ext lemmas]. -/
@[ext high]
theorem nonUnitalAlgHom_ext' [DistribMulAction k A] {φ₁ φ₂ : k[G] →ₙₐ[k] A}
    (h : φ₁.toMulHom.comp (ofMagma k G) = φ₂.toMulHom.comp (ofMagma k G)) : φ₁ = φ₂

(h : φ₁.toMulHom.comp (AddMonoidAlgebra.ofMagma k G) = φ₂.toMulHom.comp (AddMonoidAlgebra.ofMagma k G))


lemma IsInvertedBy.iff_le_inverseImage_isomorphisms (W : MorphismProperty C) (F : C ⥤ D) :
    W.IsInvertedBy F ↔ W ≤ (isomorphisms D).inverseImage F

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{D : Type u'}
[CategoryTheory.Category.{v', u'} D]
(W : CategoryTheory.MorphismProperty C)
(F : CategoryTheory.Functor C D)

W.IsInvertedBy F ↔ W ≤ (CategoryTheory.MorphismProperty.isomorphisms D).inverseImage F


@[simp] protected theorem max_eq_or : max = or


/-- Two-pointing of a type. This is a Type-valued termed `Nontrivial`. -/
@[ext]
structure TwoPointing (α : Type*) extends α × α where
  /-- `fst` and `snd` are distinct terms -/
  fst_ne_snd : fst ≠ snd
  deriving DecidableEq


@[simp]
theorem explicitCokernelIso_hom_desc {X Y Z : SemiNormedGrp.{u}} {f : X ⟶ Y} {g : Y ⟶ Z}
    (w : f ≫ g = 0) :
    (explicitCokernelIso f).hom ≫ cokernel.desc f g w = explicitCokernelDesc w

{X Y Z : SemiNormedGrp}
{f : X ⟶ Y}
{g : Y ⟶ Z}
(w : f ≫ g = 0)

(SemiNormedGrp.explicitCokernelIso f).hom ≫ CategoryTheory.Limits.cokernel.desc f g w =
  SemiNormedGrp.explicitCokernelDesc w


theorem mapsTo_sin (s : Set ℝ) : MapsTo sin s (Icc (-1 : ℝ) 1)


lemma dotProduct_le_dotProduct_of_nonneg_right {u v w : n → R} (huv : u ≤ v) (hw : 0 ≤ w) :
    dotProduct u w ≤ dotProduct v w

{n : Type u_2}
{R : Type u_4}
[OrderedSemiring R]
[Fintype n]
{u v w : n → R}
(huv : u ≤ v)
(hw : 0 ≤ w)

Matrix.dotProduct u w ≤ Matrix.dotProduct v w


lemma comp_assoc (C C' C'' : VariableChange R) : comp (comp C C') C'' = comp C (comp C' C'')

(C C' C'' : WeierstrassCurve.VariableChange R)

(C.comp C').comp C'' = C.comp (C'.comp C'')


theorem Valid'.rotateL {l} {x : α} {r o₁ o₂} (hl : Valid' o₁ l x) (hr : Valid' x r o₂)
    (H1 : ¬size l + size r ≤ 1) (H2 : delta * size l < size r)
    (H3 : 2 * size r ≤ 9 * size l + 5 ∨ size r ≤ 3) : Valid' o₁ (@rotateL α l x r) o₂

(H3 : 2 * r.size ≤ 9 * l.size + 5 ∨ r.size ≤ 3)


theorem val_sub {n : ℕ} [NeZero n] {a b : ZMod n} (h : b.val ≤ a.val) :
    (a - b).val = a.val - b.val


theorem div_pos {b c : Ordinal} (h : c ≠ 0) : 0 < b / c ↔ c ≤ b


@[simp]
theorem Path.reverse_toPath [HasReverse V] {a b : V} (f : a ⟶ b) :
    f.toPath.reverse = (Quiver.reverse f).toPath

{V : Type u_2}
[Quiver V]
[Quiver.HasReverse V]
{a b : V}
(f : a ⟶ b)


@[simp]
theorem compl_insert : (insert a s)ᶜ = sᶜ.erase a

{α : Type u_1}
[Fintype α]
{s : Finset α}
[DecidableEq α]
{a : α}


/-- A normed ring is a ring endowed with a norm which satisfies the inequality `‖x y‖ ≤ ‖x‖ ‖y‖`. -/
class NormedRing (α : Type*) extends Norm α, Ring α, MetricSpace α where
  /-- The distance is induced by the norm. -/
  dist_eq : ∀ x y, dist x y = norm (x - y)
  /-- The norm is submultiplicative. -/
  norm_mul : ∀ a b, norm (a * b) ≤ norm a * norm b

{α : Type u_5}
[self : NormedRing α]
(x y : α)


theorem isRat_zpow_pos {α : Type*} [DivisionRing α] {a : α} {b : ℤ} {nb : ℕ}
    {num : ℤ} {den : ℕ}
    (pb : IsNat b nb) (pe' : IsRat (a^nb) num den) :
    IsRat (a^b) num den

(pe' : Mathlib.Meta.NormNum.IsRat (a ^ nb) num den)

Mathlib.Meta.NormNum.IsRat (a ^ b) num den


@[simp]
lemma add'_map (f₁ f₂ : X ⟶ Y) :
    add' W (L.map f₁) (L.map f₂) = L.map (f₁ + f₂)

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Category.{u_4, u_2} D]
[CategoryTheory.Preadditive C]
{L : CategoryTheory.Functor C D}
(W : CategoryTheory.MorphismProperty C)
[L.IsLocalization W]
[W.HasLeftCalculusOfFractions]
{X Y : C}
(f₁ f₂ : X ⟶ Y)

CategoryTheory.Localization.Preadditive.add' W (L.map f₁) (L.map f₂) = L.map (f₁ + f₂)


theorem gaugeRescale_gaugeRescale {s t u : Set E} (hta : Absorbent ℝ t) (htb : IsVonNBounded ℝ t)
    (x : E) : gaugeRescale t u (gaugeRescale s t x) = gaugeRescale s u x

{E : Type u_1}
[AddCommGroup E]
[Module ℝ E]
[TopologicalSpace E]
[T1Space E]
{s t u : Set E}
(hta : Absorbent ℝ t)
(htb : Bornology.IsVonNBounded ℝ t)
(x : E)


@[ext]
theorem terminal.strict_hom_ext {A : C} (f g : ⊤_ C ⟶ A) : f = g


lemma ofMulEquiv (e : G ≃* H) : IsFreeGroup H

{G : Type u_1}
[Group G]
[IsFreeGroup G]
{H : Type u_2}
[Group H]
(e : G ≃* H)


/-- Given a family of points, if we use a member of the family as a base point, the
`weightedVSubOfPoint` does not depend on the value of the weights at this point. -/
theorem weightedVSubOfPoint_eq_of_weights_eq (p : ι → P) (j : ι) (w₁ w₂ : ι → k)
    (hw : ∀ i, i ≠ j → w₁ i = w₂ i) :
    s.weightedVSubOfPoint p (p j) w₁ = s.weightedVSubOfPoint p (p j) w₂

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[S : AffineSpace V P]
{ι : Type u_4}
(s : Finset ι)
(p : ι → P)
(j : ι)
(w₁ w₂ : ι → k)
(hw : ∀ (i : ι), i ≠ j → w₁ i = w₂ i)

(s.weightedVSubOfPoint p (p j)) w₁ = (s.weightedVSubOfPoint p (p j)) w₂


/-- If `x` and `y` are on the same ray, then the triangle inequality becomes the equality: the norm
of `x + y` is the sum of the norms of `x` and `y`. The converse is true for a strictly convex
space. -/
theorem norm_add (h : SameRay ℝ x y) : ‖x + y‖ = ‖x‖ + ‖y‖

{E : Type u_1}
[SeminormedAddCommGroup E]
[NormedSpace ℝ E]
{x y : E}
(h : SameRay ℝ x y)


/-- If a function has a limit, then its limsup coincides with its limit. -/
theorem Filter.Tendsto.limsup_eq {f : Filter β} {u : β → α} {a : α} [NeBot f]
    (h : Tendsto u f (𝓝 a)) : limsup u f = a

{α : Type u_2}
{β : Type u_3}
[ConditionallyCompleteLinearOrder α]
[TopologicalSpace α]
[OrderTopology α]
{f : Filter β}
{u : β → α}
{a : α}
[f.NeBot]
(h : Filter.Tendsto u f (𝓝 a))


theorem divInt_eq_iff (z₁ : d₁ ≠ 0) (z₂ : d₂ ≠ 0) :
    n₁ /. d₁ = n₂ /. d₂ ↔ n₁ * d₂ = n₂ * d₁

{d₁ d₂ n₁ n₂ : Int}
(z₁ : d₁ ≠ 0)
(z₂ : d₂ ≠ 0)


theorem wf (h₁ : Subrelation q r) (h₂ : WellFounded r) : WellFounded q

{α : Sort u}
{r q : α → α → Prop}
(h₁ : Subrelation q r)
(h₂ : WellFounded r)


lemma finsuppLeft_apply_tmul (p : ι →₀ M) (n : N) :
    finsuppLeft R M N ι (p ⊗ₜ[R] n) = p.sum fun i m ↦ Finsupp.single i (m ⊗ₜ[R] n)

{R : Type u_1}
[CommSemiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
{N : Type u_3}
[AddCommMonoid N]
[Module R N]
{ι : Type u_4}
[DecidableEq ι]
(p : ι →₀ M)
(n : N)

(TensorProduct.finsuppLeft R M N ι) (p ⊗ₜ[R] n) = p.sum fun i m => Finsupp.single i (m ⊗ₜ[R] n)


/-- Any category with pullbacks and binary products, has equalizers. -/
theorem hasCoequalizers_of_hasPushouts_and_binary_coproducts [HasBinaryCoproducts C]
    [HasPushouts C] : HasCoequalizers C


theorem Substructure.fg_iff_structure_fg (S : L.Substructure M) : S.FG ↔ Structure.FG L S

{L : FirstOrder.Language}
{M : Type u_1}
[L.Structure M]
(S : L.Substructure M)

S.FG ↔ FirstOrder.Language.Structure.FG L ↥S


theorem isCauSeq_im (f : CauSeq ℂ Complex.abs) : IsCauSeq abs' fun n => (f n).im


@[simp]
theorem exp_sub_sinh : exp x - sinh x = cosh x

Complex.exp x - Complex.sinh x = Complex.cosh x


/-- `QuaternionAlgebra.imK` as a `LinearMap`-/
@[simps]
def imKₗ : ℍ[R,c₁,c₂] →ₗ[R] R

{R : Type u_3}
[CommRing R]
(c₁ c₂ : R)
(self : ℍ[R,c₁,c₂])

(QuaternionAlgebra.imKₗ c₁ c₂) self = self.imK


theorem nonuniformWitness_mem_nonuniformWitnesses (h : ¬G.IsUniform ε s t) (ht : t ∈ P.parts)
    (hst : s ≠ t) : G.nonuniformWitness ε s t ∈ P.nonuniformWitnesses G ε s

{α : Type u_1}
{𝕜 : Type u_2}
[LinearOrderedField 𝕜]
[DecidableEq α]
{A : Finset α}
{P : Finpartition A}
{G : SimpleGraph α}
[DecidableRel G.Adj]
{ε : 𝕜}
{s t : Finset α}
(h : ¬G.IsUniform ε s t)
(ht : t ∈ P.parts)
(hst : s ≠ t)


theorem image_mem_toPartialHomeomorph_target {n : ℕ∞} (hf : ContDiffAt 𝕂 n f a)
    (hf' : HasFDerivAt f (f' : E →L[𝕂] F) a) (hn : 1 ≤ n) :
    f a ∈ (hf.toPartialHomeomorph f hf' hn).target

{𝕂 : Type u_1}
[RCLike 𝕂]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕂 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕂 F]
[CompleteSpace E]
{f : E → F}
{f' : E ≃L[𝕂] F}
{a : E}
{n : ℕ∞}
(hf : ContDiffAt 𝕂 n f a)
(hf' : HasFDerivAt f (↑f') a)
(hn : 1 ≤ n)

f a ∈ (ContDiffAt.toPartialHomeomorph f hf hf' hn).target


protected nonrec theorem ContinuousAt.inversion (hc : ContinuousAt c a₀) (hR : ContinuousAt R a₀)
    (hx : ContinuousAt x a₀) (hne : x a₀ ≠ c a₀) :
    ContinuousAt (fun a ↦ inversion (c a) (R a) (x a)) a₀

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{X : Type u_3}
[TopologicalSpace X]
{c x : X → P}
{R : X → ℝ}
{a₀ : X}
(hc : ContinuousAt c a₀)
(hR : ContinuousAt R a₀)
(hx : ContinuousAt x a₀)
(hne : x a₀ ≠ c a₀)

ContinuousAt (fun a => EuclideanGeometry.inversion (c a) (R a) (x a)) a₀


/-- The sum of entries in a row of Pascal's triangle -/
theorem sum_range_choose (n : ℕ) : (∑ m ∈ range (n + 1), choose n m) = 2 ^ n

∑ m ∈ Finset.range (n + 1), n.choose m = 2 ^ n


@[simp]
theorem ofMulAction_apply {G : Type u} {H : FintypeCat.{u}} [Monoid G] [MulAction G H]
    (g : G) (x : H) : (FintypeCat.ofMulAction G H).ρ g x = (g • x : H)

{G : Type u}
{H : FintypeCat}
[Monoid G]
[MulAction G ↑H]
(g : G)
(x : ↑H)

(Action.FintypeCat.ofMulAction G H).ρ g x = g • x


@[to_additive]
theorem smul_def : a • x = x.map (a • ·) (a • ·)

{M : Type u_1}
{α : Type u_4}
{β : Type u_5}
[SMul M α]
[SMul M β]
(a : M)
(x : α ⊕ β)

a • x = Sum.map (fun x => a • x) (fun x => a • x) x


@[to_additive]
theorem mem_closure {x : M} : x ∈ closure s ↔ ∀ S : Submonoid M, s ⊆ S → x ∈ S

{M : Type u_1}
[AddZeroClass M]
{s : Set M}
{x : M}

x ∈ AddSubmonoid.closure s ↔ ∀ (S : AddSubmonoid M), s ⊆ ↑S → x ∈ S


@[simp, norm_cast] lemma coe_lt_one : (r : ℝ) < 1 ↔ r < 1


theorem get_attach (L : List α) (i) :
    (L.attach.get i).1 = L.get ⟨i, length_attach L ▸ i.2⟩

{α : Type u}
(L : List α)
(i : Fin L.attach.length)


@[to_additive eq_of_norm_sub_le_zero]
theorem eq_of_norm_div_le_zero (h : ‖a / b‖ ≤ 0) : a = b

{E : Type u_6}
[NormedGroup E]
{a b : E}
(h : ‖a / b‖ ≤ 0)


@[to_additive (attr := simp)]
theorem map_inv (f : α → β) (x : FreeGroup α) : f <$> x⁻¹ = (f <$> x)⁻¹

{α β : Type u}
(f : α → β)
(x : FreeGroup α)


@[to_additive]
theorem prod_filter_index [CommMonoid N] (g : α → M → N) :
    (f.filter p).prod g = ∏ x ∈ (f.filter p).support, g x (f x)

{α : Type u_1}
{M : Type u_5}
{N : Type u_7}
[Zero M]
(p : α → Prop)
[DecidablePred p]
(f : α →₀ M)
[CommMonoid N]
(g : α → M → N)

(Finsupp.filter p f).prod g = ∏ x ∈ (Finsupp.filter p f).support, g x (f x)


theorem wSameSide_smul_vsub_vadd_right {s : AffineSubspace R P} {p₁ p₂ : P} (x : P) (hp₁ : p₁ ∈ s)
    (hp₂ : p₂ ∈ s) {t : R} (ht : 0 ≤ t) : s.WSameSide x (t • (x -ᵥ p₁) +ᵥ p₂)

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[StrictOrderedCommRing R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
{s : AffineSubspace R P}
{p₁ p₂ : P}
(x : P)
(hp₁ : p₁ ∈ s)
(hp₂ : p₂ ∈ s)
{t : R}
(ht : 0 ≤ t)


lemma normalClosure_le_iSup_adjoin :
    normalClosure F K L ≤ ⨆ x : K, IntermediateField.adjoin F ((minpoly F x).rootSet L)

{F : Type u_1}
{K : Type u_2}
{L : Type u_3}
[Field F]
[Field K]
[Field L]
[Algebra F K]
[Algebra F L]
[Algebra.IsAlgebraic F K]

normalClosure F K L ≤ ⨆ x, IntermediateField.adjoin F ((minpoly F x).rootSet L)


/-- The functor `Triangle C ⥤ Triangle D` that is induced by a functor `F : C ⥤ D`
which commutes with shift by `ℤ`. -/
@[simps]
def mapTriangle : Triangle C ⥤ Triangle D

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_4, u_1} C]
[CategoryTheory.Category.{u_5, u_2} D]
[CategoryTheory.HasShift C ℤ]
[CategoryTheory.HasShift D ℤ]
(F : CategoryTheory.Functor C D)
[F.CommShift ℤ]

∀ {X Y : CategoryTheory.Pretriangulated.Triangle C} (f : X ⟶ Y), (F.mapTriangle.map f).hom₂ = F.map f.hom₂


@[simp, mfld_simps]
lemma chart_mem_atlas (H : Type*) {M : Type*} [TopologicalSpace H] [TopologicalSpace M]
    [ChartedSpace H M] (x : M) : chartAt H x ∈ atlas H M

(H : Type u_5)
{M : Type u_6}
[TopologicalSpace H]
[TopologicalSpace M]
[ChartedSpace H M]
(x : M)


theorem span_natAbs (a : ℤ) : Ideal.span ({(a.natAbs : ℤ)} : Set ℤ) = Ideal.span {a}


theorem separatingRight_iff_linear_flip_nontrivial {B : M₁ →ₛₗ[I₁] M₂ →ₛₗ[I₂] M} :
    B.SeparatingRight ↔ ∀ y : M₂, B.flip y = 0 → y = 0

{R : Type u_1}
{R₁ : Type u_2}
{R₂ : Type u_3}
{M : Type u_5}
{M₁ : Type u_6}
{M₂ : Type u_7}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
[CommSemiring R₁]
[AddCommMonoid M₁]
[Module R₁ M₁]
[CommSemiring R₂]
[AddCommMonoid M₂]
[Module R₂ M₂]
{I₁ : R₁ →+* R}
{I₂ : R₂ →+* R}
{B : M₁ →ₛₗ[I₁] M₂ →ₛₗ[I₂] M}

B.SeparatingRight ↔ ∀ (y : M₂), B.flip y = 0 → y = 0


/-- Let `f` be a function continuous on a convex (or, equivalently, connected) subset `D`
of the real line. If `f` is differentiable on the interior of `D` and `f'` is strictly positive,
then `f` is a strictly monotone function on `D`. -/
lemma strictAntiOn_of_hasDerivWithinAt_neg {D : Set ℝ} (hD : Convex ℝ D) {f f' : ℝ → ℝ}
    (hf : ContinuousOn f D) (hf' : ∀ x ∈ interior D, HasDerivWithinAt f (f' x) (interior D) x)
    (hf'₀ : ∀ x ∈ interior D, f' x < 0) : StrictAntiOn f D


@[simp]
theorem zero_apply (i : ι) : (0 : ⨁ i, β i) i = 0

{ι : Type v}
(β : ι → Type w)
[(i : ι) → AddCommMonoid (β i)]
(i : ι)


@[to_additive]
theorem map_comap_le {S : Subsemigroup N} {f : M →ₙ* N} : (S.comap f).map f ≤ S

{M : Type u_1}
{N : Type u_2}
[Mul M]
[Mul N]
{S : Subsemigroup N}
{f : M →ₙ* N}

Subsemigroup.map f (Subsemigroup.comap f S) ≤ S


theorem leadingCoeff_add_eq_right {Γ} [LinearOrder Γ] {x y : HahnSeries Γ R}
    (hxy : y.orderTop < x.orderTop) : (x + y).leadingCoeff = y.leadingCoeff

{R : Type u_2}
[AddMonoid R]
{Γ : Type u_3}
[LinearOrder Γ]
{x y : HahnSeries Γ R}
(hxy : y.orderTop < x.orderTop)


{α : Type u_1}
[Monoid α]
{a b : α}
(h : a = b)


theorem le_trailingDegree_monomial : ↑n ≤ trailingDegree (monomial n a)

{R : Type u}
{a : R}
{n : ℕ}
[Semiring R]

↑n ≤ ((Polynomial.monomial n) a).trailingDegree


/-- The `Ideal` version of `Set.preimage_subset_image_of_inverse`. -/
theorem comap_le_map_of_inverse (g : G) (I : Ideal S) (h : Function.LeftInverse g f) :
    I.comap f ≤ I.map g

{R : Type u}
{S : Type v}
{F : Type u_1}
[Semiring R]
[Semiring S]
[FunLike F R S]
[rc : RingHomClass F R S]
(f : F)
{G : Type u_2}
[FunLike G S R]
(g : G)
(I : Ideal S)
(h : Function.LeftInverse ⇑g ⇑f)


@[simp]
theorem length_darts {u v : V} (p : G.Walk u v) : p.darts.length = p.length

{V : Type u}
{G : SimpleGraph V}
{u v : V}
(p : G.Walk u v)


theorem measurableSet_coe : MeasurableSet (I : Set (ι → ℝ))

{ι : Type u_1}
(I : BoxIntegral.Box ι)
[Countable ι]


@[simp]
theorem Icc_inr_inl : Icc (inr b₁) (inl a₂) = ∅

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
[LocallyFiniteOrder α]
[LocallyFiniteOrder β]
(a₂ : α)
(b₁ : β)

Finset.Icc (Sum.inr b₁) (Sum.inl a₂) = ∅


theorem le_iterate_comp_of_le (hf : Monotone f) (H : h ∘ g ≤ f ∘ h) (n : ℕ) :
    h ∘ g^[n] ≤ f^[n] ∘ h

{α : Type u_1}
[Preorder α]
{f : α → α}
{β : Type u_2}
{g : β → β}
{h : β → α}
(hf : Monotone f)
(H : h ∘ g ≤ f ∘ h)
(n : ℕ)


@[simp]
lemma inv_zero : (0 : EReal)⁻¹ = 0


@[to_additive]
theorem Step.diamond :
    ∀ {L₁ L₂ L₃ L₄ : List (α × Bool)},
      Red.Step L₁ L₃ → Red.Step L₂ L₄ → L₁ = L₂ → L₃ = L₄ ∨ ∃ L₅, Red.Step L₃ L₅ ∧ Red.Step L₄ L₅

{α : Type u}
{L₁ L₂ L₃ L₄ : List (α × Bool)}

FreeGroup.Red.Step L₁ L₃ →
  FreeGroup.Red.Step L₂ L₄ → L₁ = L₂ → L₃ = L₄ ∨ ∃ L₅, FreeGroup.Red.Step L₃ L₅ ∧ FreeGroup.Red.Step L₄ L₅


@[simp]
theorem right_inl (n : N) : (inl n : N ⋊[φ] G).right = 1

{N : Type u_1}
{G : Type u_2}
[Group N]
[Group G]
{φ : G →* MulAut N}
(n : N)


theorem summable_Lp_add {f g : ι → ℝ≥0} {p : ℝ} (hp : 1 ≤ p) (hf : Summable fun i => f i ^ p)
    (hg : Summable fun i => g i ^ p) : Summable fun i => (f i + g i) ^ p

{ι : Type u}
{f g : ι → ℝ≥0}
{p : ℝ}
(hp : 1 ≤ p)
(hf : Summable fun i => f i ^ p)
(hg : Summable fun i => g i ^ p)


/-- A map `f : E × F → G` satisfies `IsBoundedBilinearMap 𝕜 f` if it is bilinear and
continuous. -/
structure IsBoundedBilinearMap (f : E × F → G) : Prop where
  add_left : ∀ (x₁ x₂ : E) (y : F), f (x₁ + x₂, y) = f (x₁, y) + f (x₂, y)
  smul_left : ∀ (c : 𝕜) (x : E) (y : F), f (c • x, y) = c • f (x, y)
  add_right : ∀ (x : E) (y₁ y₂ : F), f (x, y₁ + y₂) = f (x, y₁) + f (x, y₂)
  smul_right : ∀ (c : 𝕜) (x : E) (y : F), f (x, c • y) = c • f (x, y)
  bound : ∃ C > 0, ∀ (x : E) (y : F), ‖f (x, y)‖ ≤ C * ‖x‖ * ‖y‖

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{f : E × F → G}
(self : IsBoundedBilinearMap 𝕜 f)
(c : 𝕜)
(x : E)
(y : F)


@[to_additive]
theorem NormedCommGroup.tendsto_nhds_one {f : α → E} {l : Filter α} :
    Tendsto f l (𝓝 1) ↔ ∀ ε > 0, ∀ᶠ x in l, ‖f x‖ < ε

{α : Type u_3}
{E : Type u_6}
[SeminormedAddGroup E]
{f : α → E}
{l : Filter α}

Filter.Tendsto f l (𝓝 0) ↔ ∀ ε > 0, ∀ᶠ (x : α) in l, ‖f x‖ < ε


protected theorem Monotone.Iio (hf : Monotone f) : Monotone fun x => Iio (f x)

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
{f : α → β}
(hf : Monotone f)


theorem l_iSup_u [CompleteLattice α] [CompleteLattice β] (gi : GaloisInsertion l u) {ι : Sort x}
    (f : ι → β) : l (⨆ i, u (f i)) = ⨆ i, f i

{α : Type u}
{β : Type v}
{l : α → β}
{u : β → α}
[CompleteLattice α]
[CompleteLattice β]
(gi : GaloisInsertion l u)
{ι : Sort x}
(f : ι → β)


@[simp]
theorem mk_out : ∀ x : ZFSet, mk x.out = x


/--
The equivalence between `LocallyConstant X Z` and `LocallyConstant Y Z` given a
homeomorphism `X ≃ₜ Y`
-/
@[simps]
def congrLeft [TopologicalSpace Y] (e : X ≃ₜ Y) : LocallyConstant X Z ≃ LocallyConstant Y Z

{X : Type u_1}
{Y : Type u_2}
{Z : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
(e : X ≃ₜ Y)
(g : LocallyConstant Y Z)

(LocallyConstant.congrLeft e).symm g = LocallyConstant.comap e.toContinuousMap g


{α : Type u_2}
[Preorder α]
[LocallyFiniteOrder α]
{a b : α}


@[simp, reassoc, elementwise] lemma smoothSheafCommRing.ι_evalHom (x : TopCat.of M) (U) :
    colimit.ι ((OpenNhds.inclusion x).op ⋙ _) U ≫ smoothSheafCommRing.evalHom IM I M R x =
    smoothSheafCommRing.evalAt _ _ _ _ _ _

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{EM : Type u_2}
[NormedAddCommGroup EM]
[NormedSpace 𝕜 EM]
{HM : Type u_3}
[TopologicalSpace HM]
(IM : ModelWithCorners 𝕜 EM HM)
{E : Type u_4}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_5}
[TopologicalSpace H]
(I : ModelWithCorners 𝕜 E H)
(M : Type u)
[TopologicalSpace M]
[ChartedSpace HM M]
(R : Type u)
[TopologicalSpace R]
[ChartedSpace H R]
[CommRing R]
[SmoothRing I R]
(x : ↑(TopCat.of M))
(U : (TopologicalSpace.OpenNhds x)ᵒᵖ)

CategoryTheory.CategoryStruct.comp
    (CategoryTheory.Limits.colimit.ι
      ((TopologicalSpace.OpenNhds.inclusion x).op.comp (smoothSheafCommRing IM I M R).presheaf) U)
    (smoothSheafCommRing.evalHom IM I M R x) =
  smoothSheafCommRing.evalAt IM I M R x (Opposite.unop U)


protected theorem Perm.congr_arg {f : Equiv.Perm α} {x x' : α} : x = x' → f x = f x'

{α : Sort u}
{f : Equiv.Perm α}
{x x' : α}


theorem commute_sub_int (n : ℤ) : Function.Commute f (· - n)


protected theorem MeasurableSet.univ_pi [Countable δ] {t : ∀ i : δ, Set (π i)}
    (ht : ∀ i, MeasurableSet (t i)) : MeasurableSet (pi univ t)

{δ : Type u_4}
{π : δ → Type u_6}
[(a : δ) → MeasurableSpace (π a)]
[Countable δ]
{t : (i : δ) → Set (π i)}
(ht : ∀ (i : δ), MeasurableSet (t i))


theorem Partrec.dom_re {α β} [Primcodable α] [Primcodable β] {f : α →. β} (h : Partrec f) :
    RePred fun a => (f a).Dom

{α : Type u_1}
{β : Type u_2}
[Primcodable α]
[Primcodable β]
{f : α →. β}
(h : Partrec f)


lemma two_mul_apply_root_root :
    2 * B (P.root i) (P.root j) = P.pairing i j * B (P.root j) (P.root j)

{ι : Type u_1}
{R : Type u_2}
{M : Type u_3}
{N : Type u_4}
[LinearOrderedCommRing R]
[AddCommGroup M]
[Module R M]
[AddCommGroup N]
[Module R N]
{P : RootPairing ι R M N}
(B : M →ₗ[R] M →ₗ[R] R)
[P.IsRootPositive B]
(i j : ι)

2 * (B (P.root i)) (P.root j) = P.pairing i j * (B (P.root j)) (P.root j)


theorem abs_exp_sub_one_le {x : ℂ} (hx : abs x ≤ 1) : abs (exp x - 1) ≤ 2 * abs x

Complex.abs (Complex.exp x - 1) ≤ 2 * Complex.abs x


/-- If `k` does not divide `torsionOrder` then there are no nontrivial roots of unity of
  order dividing `k`. -/
theorem rootsOfUnity_eq_one [NumberField K] {k : ℕ+} (hc : Nat.Coprime k (torsionOrder K))
    {ζ : (𝓞 K)ˣ} : ζ ∈ rootsOfUnity k (𝓞 K) ↔ ζ = 1

(hc : (↑k).Coprime ↑(NumberField.Units.torsionOrder K))


theorem tangentBundleCore_coordChange_model_space (x x' z : H) :
    (tangentBundleCore I H).coordChange (achart H x) (achart H x') z =
    ContinuousLinearMap.id 𝕜 E

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_4}
[TopologicalSpace H]
(I : ModelWithCorners 𝕜 E H)
(x x' z : H)


/-- Slight reformulation of
    `MeasureTheory.AECover.integral_tendsto_of_countably_generated`. -/
theorem AECover.integral_eq_of_tendsto [l.NeBot] [l.IsCountablyGenerated] {φ : ι → Set α}
    (hφ : AECover μ l φ) {f : α → E} (I : E) (hfi : Integrable f μ)
    (h : Tendsto (fun n => ∫ x in φ n, f x ∂μ) l (𝓝 I)) : ∫ x, f x ∂μ = I

(h : Filter.Tendsto (fun n => ∫ (x : α) in φ n, f x ∂μ) l (𝓝 I))


@[to_additive (attr := simp)]
theorem dist_div_right [DivInvMonoid M] [PseudoMetricSpace M] [IsometricSMul Mᵐᵒᵖ M]
    (a b c : M) : dist (a / c) (b / c) = dist a b

{M : Type u}
[SubNegMonoid M]
[PseudoMetricSpace M]
[IsometricVAdd Mᵃᵒᵖ M]
(a b c : M)


@[simp]
theorem leftUnitor_hom_apply {X : Type u} {x : X} {p : PUnit} :
    ((λ_ X).hom : 𝟙_ (Type u) ⊗ X → X) (p, x) = x

{X : Type u}
{x : X}
{p : PUnit.{u + 1}}


lemma map_mk (f₁ : α₁ → α₂) (f₂ : ∀ a, β₁ a → β₂ (f₁ a)) (x : α₁) (y : β₁ x) :
    map f₁ f₂ ⟨x, y⟩ = ⟨f₁ x, f₂ x y⟩

{α₁ : Type u_2}
{α₂ : Type u_3}
{β₁ : α₁ → Type u_5}
{β₂ : α₂ → Type u_6}
(f₁ : α₁ → α₂)
(f₂ : (a : α₁) → β₁ a → β₂ (f₁ a))
(x : α₁)
(y : β₁ x)


/-- Lemma to normalize a vector in a normed space `E` over either `ℂ` or `ℝ` to length `r`. -/
theorem norm_smul_inv_norm' {r : ℝ} (r_nonneg : 0 ≤ r) {x : E} (hx : x ≠ 0) :
    ‖((r : 𝕜) * (‖x‖ : 𝕜)⁻¹) • x‖ = r

{𝕜 : Type u_1}
[RCLike 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{r : ℝ}
(r_nonneg : 0 ≤ r)
{x : E}
(hx : x ≠ 0)


@[to_additive (attr := fun_prop) ContinuousOn.norm]
theorem ContinuousOn.norm' {s : Set α} (h : ContinuousOn f s) : ContinuousOn (fun x => ‖f x‖) s

{α : Type u_3}
{E : Type u_6}
[SeminormedAddGroup E]
[TopologicalSpace α]
{f : α → E}
{s : Set α}
(h : ContinuousOn f s)


/-- **Nakayama's Lemma**. Atiyah-Macdonald 2.5, Eisenbud 4.7, Matsumura 2.2,
[Stacks 00DV](https://stacks.math.columbia.edu/tag/00DV) -/
theorem exists_sub_one_mem_and_smul_eq_zero_of_fg_of_le_smul {R : Type*} [CommRing R] {M : Type*}
    [AddCommGroup M] [Module R M] (I : Ideal R) (N : Submodule R M) (hn : N.FG) (hin : N ≤ I • N) :
    ∃ r : R, r - 1 ∈ I ∧ ∀ n ∈ N, r • n = (0 : M)

{R : Type u_3}
[CommRing R]
{M : Type u_4}
[AddCommGroup M]
[Module R M]
(I : Ideal R)
(N : Submodule R M)
(hn : N.FG)
(hin : N ≤ I • N)


/-- `CauSeq.Completion.ofRat` as a `RingHom` -/
@[simps]
def ofRatRingHom : β →+* (Cauchy abv)

{α : Type u_1}
[LinearOrderedField α]
{β : Type u_2}
[Ring β]
{abv : β → α}
[IsAbsoluteValue abv]
(x : β)

CauSeq.Completion.ofRatRingHom x = CauSeq.Completion.ofRat x


@[fun_prop]
theorem ContinuousOn.inv₀ (hf : ContinuousOn f s) (h0 : ∀ x ∈ s, f x ≠ 0) :
    ContinuousOn (fun x => (f x)⁻¹) s

{α : Type u_1}
{G₀ : Type u_3}
[Zero G₀]
[Inv G₀]
[TopologicalSpace G₀]
[HasContinuousInv₀ G₀]
{f : α → G₀}
{s : Set α}
[TopologicalSpace α]
(hf : ContinuousOn f s)
(h0 : ∀ x ∈ s, f x ≠ 0)


@[to_additive]
protected theorem UniformOnFun.hasBasis_nhds_one (𝔖 : Set <| Set α) (h𝔖₁ : 𝔖.Nonempty)
    (h𝔖₂ : DirectedOn (· ⊆ ·) 𝔖) :
    (𝓝 1 : Filter (α →ᵤ[𝔖] G)).HasBasis
      (fun SV : Set α × Set G => SV.1 ∈ 𝔖 ∧ SV.2 ∈ (𝓝 1 : Filter G)) fun SV =>
      { f : α →ᵤ[𝔖] G | ∀ x ∈ SV.1, f x ∈ SV.2 }

(h𝔖₂ : DirectedOn (fun x x_1 => x ⊆ x_1) 𝔖)

(𝓝 1).HasBasis (fun SV => SV.1 ∈ 𝔖 ∧ SV.2 ∈ 𝓝 1) fun SV => {f | ∀ x ∈ SV.1, f x ∈ SV.2}


theorem HasColimits.hasColimitsOfShape {C : Type u} [Category.{v} C] [HasColimits C] (J : Type v)
    [Category.{v} J] : HasColimitsOfShape J C

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Limits.HasColimits C]
(J : Type v)
[CategoryTheory.Category.{v, v} J]


theorem isFractionRing_of_isDomain_of_isLocalization [IsDomain R] (S T : Type*) [CommRing S]
    [CommRing T] [Algebra R S] [Algebra R T] [Algebra S T] [IsScalarTower R S T]
    [IsLocalization M S] [IsFractionRing R T] : IsFractionRing S T

{R : Type u_1}
[CommRing R]
(M : Submonoid R)
[IsDomain R]
(S : Type u_3)
(T : Type u_4)
[CommRing S]
[CommRing T]
[Algebra R S]
[Algebra R T]
[Algebra S T]
[IsScalarTower R S T]
[IsLocalization M S]
[IsFractionRing R T]


theorem superFactorial_two_mul : ∀ n : ℕ,
    sf (2 * n) = (∏ i ∈ range n, (2 * i + 1) !) ^ 2 * 2 ^ n * n !

(2 * n).superFactorial = (∏ i ∈ Finset.range n, (2 * i + 1).factorial) ^ 2 * 2 ^ n * n.factorial


theorem setToL1_add_left' (hT : DominatedFinMeasAdditive μ T C)
    (hT' : DominatedFinMeasAdditive μ T' C') (hT'' : DominatedFinMeasAdditive μ T'' C'')
    (h_add : ∀ s, MeasurableSet s → μ s < ∞ → T'' s = T s + T' s) (f : α →₁[μ] E) :
    setToL1 hT'' f = setToL1 hT f + setToL1 hT' f

(hT : MeasureTheory.DominatedFinMeasAdditive μ T C)

(hT' : MeasureTheory.DominatedFinMeasAdditive μ T' C')

(hT'' : MeasureTheory.DominatedFinMeasAdditive μ T'' C'')

(h_add : ∀ (s : Set α), MeasurableSet s → μ s < ⊤ → T'' s = T s + T' s)

(MeasureTheory.L1.setToL1 hT'') f = (MeasureTheory.L1.setToL1 hT) f + (MeasureTheory.L1.setToL1 hT') f


@[simp] theorem none_orElse (x : Option α) : (none <|> x) = x


theorem add_one_le_add_one_iff : a + 1 ≤ b + 1 ↔ a ≤ b


/-- Product of elements of a subfield indexed by a `Finset` is in the subfield. -/
protected theorem prod_mem {ι : Type*} {t : Finset ι} {f : ι → K} (h : ∀ c ∈ t, f c ∈ s) :
    (∏ i ∈ t, f i) ∈ s

{K : Type u}
[Field K]
(s : Subfield K)
{ι : Type u_1}
{t : Finset ι}
{f : ι → K}
(h : ∀ c ∈ t, f c ∈ s)


theorem _root_.Filter.Tendsto.clog {l : Filter α} {f : α → ℂ} {x : ℂ} (h : Tendsto f l (𝓝 x))
    (hx : x ∈ slitPlane) : Tendsto (fun t => log (f t)) l (𝓝 <| log x)

{α : Type u_1}
{l : Filter α}
{f : α → ℂ}
{x : ℂ}
(h : Filter.Tendsto f l (nhds x))
(hx : x ∈ Complex.slitPlane)

Filter.Tendsto (fun t => Complex.log (f t)) l (nhds (Complex.log x))


/-- The distance between `secondInter` and the center equals the distance between the original
point and the center. -/
@[simp]
theorem Sphere.secondInter_dist (s : Sphere P) (p : P) (v : V) :
    dist (s.secondInter p v) s.center = dist p s.center

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
(s : EuclideanGeometry.Sphere P)
(p : P)
(v : V)


/-- If the codomain of a closed embedding is a T₄ space, then so is the domain. -/
protected theorem ClosedEmbedding.t4Space [TopologicalSpace Y] [T4Space Y] {f : X → Y}
    (hf : ClosedEmbedding f) : T4Space X

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
[T4Space Y]
{f : X → Y}
(hf : ClosedEmbedding f)


lemma angle_exp_exp (x y : ℝ) :
    angle (exp (x * I)) (exp (y * I)) = |toIocMod Real.two_pi_pos (-π) (x - y)|

InnerProductGeometry.angle (Complex.exp (↑x * Complex.I)) (Complex.exp (↑y * Complex.I)) =
  |toIocMod Real.two_pi_pos (-π) (x - y)|


theorem geom_mean_weighted_of_constant (w z : ι → ℝ) (x : ℝ) (hw : ∀ i ∈ s, 0 ≤ w i)
    (hw' : ∑ i ∈ s, w i = 1) (hz : ∀ i ∈ s, 0 ≤ z i) (hx : ∀ i ∈ s, w i ≠ 0 → z i = x) :
    ∏ i ∈ s, z i ^ w i = x

{ι : Type u}
(s : Finset ι)
(w z : ι → ℝ)
(x : ℝ)
(hw : ∀ i ∈ s, 0 ≤ w i)
(hw' : ∑ i ∈ s, w i = 1)
(hz : ∀ i ∈ s, 0 ≤ z i)
(hx : ∀ i ∈ s, w i ≠ 0 → z i = x)


@[simp]
theorem symm_dual_comp (g : SupHom βᵒᵈ γᵒᵈ) (f : SupHom αᵒᵈ βᵒᵈ) :
    InfHom.dual.symm (g.comp f) =
      (InfHom.dual.symm g).comp (InfHom.dual.symm f)

{α : Type u_3}
{β : Type u_4}
{γ : Type u_5}
[Inf α]
[Inf β]
[Inf γ]
(g : SupHom βᵒᵈ γᵒᵈ)
(f : SupHom αᵒᵈ βᵒᵈ)


@[to_additive]
theorem _root_.isCompact_range_of_mulSupport_subset_isCompact [TopologicalSpace β]
    (hf : Continuous f) {k : Set α} (hk : IsCompact k) (h'f : mulSupport f ⊆ k) :
    IsCompact (range f)

{α : Type u_2}
{β : Type u_4}
[TopologicalSpace α]
[Zero β]
{f : α → β}
[TopologicalSpace β]
(hf : Continuous f)
{k : Set α}
(hk : IsCompact k)
(h'f : Function.support f ⊆ k)


private theorem add''_char (r₁ : X) (s₁ : S) (r₂ : X) (s₂ : S) (rb : R) (sb : R)
    (hb : sb * s₁ = rb * s₂) (h : sb * s₁ ∈ S) :
    add'' r₁ s₁ r₂ s₂ = (sb • r₁ + rb • r₂) /ₒ ⟨sb * s₁, h⟩

{R : Type u_1}
[Monoid R]
{S : Submonoid R}
[OreLocalization.OreSet S]
{X : Type u_2}
[AddMonoid X]
[DistribMulAction R X]
(r₁ : X)
(s₁ : ↥S)
(r₂ : X)
(s₂ : ↥S)
(rb sb : R)
(hb : sb * ↑s₁ = rb * ↑s₂)
(h : sb * ↑s₁ ∈ S)

OreLocalization.add'' r₁ s₁ r₂ s₂ = (sb • r₁ + rb • r₂) /ₒ ⟨sb * ↑s₁, h⟩


@[simp]
theorem mem_toSubring {R : Type u} {A : Type v} [CommRing R] [Ring A] [Algebra R A]
    {S : Subalgebra R A} {x} : x ∈ S.toSubring ↔ x ∈ S

{R : Type u}
{A : Type v}
[CommRing R]
[Ring A]
[Algebra R A]
{S : Subalgebra R A}
{x : A}


@[simp]
lemma homMkSucc_app_zero : (homMkSucc α β w).app 0 = α

{F G : CategoryTheory.ComposableArrows C (n + 1)}

(w :
  CategoryTheory.CategoryStruct.comp (F.map' 0 1 ⋯ ⋯) (CategoryTheory.ComposableArrows.app' β 0 ⋯) =
    CategoryTheory.CategoryStruct.comp α (G.map' 0 1 ⋯ ⋯))

(CategoryTheory.ComposableArrows.homMkSucc α β w).app 0 = α


@[simp]
theorem strictAnti_toDual_comp_iff : StrictAnti (toDual ∘ f : α → βᵒᵈ) ↔ StrictMono f

{α : Type u}
{β : Type v}
[Preorder α]
[Preorder β]
{f : α → β}

StrictAnti (⇑OrderDual.toDual ∘ f) ↔ StrictMono f


@[simp]
theorem coe_funUnique : ⇑(funUnique ι R M) = Function.eval default

{ι : Type u_1}
{R : Type u_2}
{M : Type u_3}
[Unique ι]
[Semiring R]
[AddCommMonoid M]
[Module R M]
[TopologicalSpace M]

⇑(ContinuousLinearEquiv.funUnique ι R M) = Function.eval default


@[to_additive]
theorem prime_card [Fintype α] : (Fintype.card α).Prime

{α : Type u}
[AddCommGroup α]
[IsSimpleAddGroup α]
[Fintype α]


theorem Int.Prime.dvd_mul' {m n : ℤ} {p : ℕ} (hp : Nat.Prime p) (h : (p : ℤ) ∣ m * n) :
    (p : ℤ) ∣ m ∨ (p : ℤ) ∣ n

{m n : ℤ}
{p : ℕ}
(hp : Nat.Prime p)
(h : ↑p ∣ m * n)

↑p ∣ m ∨ ↑p ∣ n


theorem circulant_neg [Neg α] [Sub n] (v : n → α) : circulant (-v) = -circulant v

{α : Type u_1}
{n : Type u_4}
[Neg α]
[Sub n]
(v : n → α)

Matrix.circulant (-v) = -Matrix.circulant v


@[reassoc, simp]
theorem braiding_inv_tensorUnit_right (X : C) : (β_ X (𝟙_ C)).inv = (λ_ X).hom ≫ (ρ_ X).inv

(C : Type u₁)
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.MonoidalCategory C]
[CategoryTheory.BraidedCategory C]
(X : C)


@[simp]
theorem lTensor_sub (f g : N →ₗ[R] P) : (f - g).lTensor M = f.lTensor M - g.lTensor M

{R : Type u_1}
[CommSemiring R]
{M : Type u_2}
{N : Type u_3}
{P : Type u_4}
[AddCommGroup M]
[AddCommGroup N]
[AddCommGroup P]
[Module R M]
[Module R N]
[Module R P]
(f g : N →ₗ[R] P)

LinearMap.lTensor M (f - g) = LinearMap.lTensor M f - LinearMap.lTensor M g


@[mono]
theorem deleteVerts_mono {G' G'' : G.Subgraph} (h : G' ≤ G'') :
    G'.deleteVerts s ≤ G''.deleteVerts s

{V : Type u}
{G : SimpleGraph V}
{s : Set V}
{G' G'' : G.Subgraph}
(h : G' ≤ G'')


@[reassoc (attr := simp)]
lemma singleObjCyclesSelfIso_inv_iCycles :
    (singleObjCyclesSelfIso _ _ _).inv ≫ ((single C c j).obj A).iCycles j =
      (singleObjXSelf c j A).inv

(HomologicalComplex.singleObjCyclesSelfIso c j A).inv ≫ ((HomologicalComplex.single C c j).obj A).iCycles j =
  (HomologicalComplex.singleObjXSelf c j A).inv


/-- If two monoid homomorphisms are equal on a set, then they are equal on its subgroup closure. -/
@[to_additive
      "If two monoid homomorphisms are equal on a set, then they are equal on its subgroup
      closure."]
theorem eqOn_closure {f g : G →* M} {s : Set G} (h : Set.EqOn f g s) : Set.EqOn f g (closure s)

{G : Type u_1}
[AddGroup G]
{M : Type u_7}
[AddMonoid M]
{f g : G →+ M}
{s : Set G}
(h : Set.EqOn (⇑f) (⇑g) s)


theorem Embedding.tendsto_nhds_iff {f : ι → Y} {l : Filter ι} {y : Y}
    (hg : Embedding g) : Tendsto f l (𝓝 y) ↔ Tendsto (g ∘ f) l (𝓝 (g y))

{Y : Type u_2}
{Z : Type u_3}
{ι : Type u_4}
{g : Y → Z}
[TopologicalSpace Y]
[TopologicalSpace Z]
{f : ι → Y}
{l : Filter ι}
{y : Y}
(hg : Embedding g)

Filter.Tendsto f l (𝓝 y) ↔ Filter.Tendsto (g ∘ f) l (𝓝 (g y))


/-- **Cauchy-Schwarz inequality** for finsets using square roots in `ℝ≥0`. -/
lemma sum_mul_le_sqrt_mul_sqrt (s : Finset ι) (f g : ι → ℝ≥0) :
    ∑ i ∈ s, f i * g i ≤ sqrt (∑ i ∈ s, f i ^ 2) * sqrt (∑ i ∈ s, g i ^ 2)

{ι : Type u_2}
(s : Finset ι)
(f g : ι → ℝ≥0)

∑ i ∈ s, f i * g i ≤ NNReal.sqrt (∑ i ∈ s, f i ^ 2) * NNReal.sqrt (∑ i ∈ s, g i ^ 2)


theorem HasDerivWithinAt.differentiableWithinAt (h : HasDerivWithinAt f f' s x) :
    DifferentiableWithinAt 𝕜 f s x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : 𝕜 → F}
{f' : F}
{x : 𝕜}
{s : Set 𝕜}
(h : HasDerivWithinAt f f' s x)


@[norm_cast] -- Porting note (#10618): simp can prove this
theorem coe_add : ((f + g : PowerSeries R) : LaurentSeries R) = f + g

{R : Type u_1}
[Semiring R]
(f g : PowerSeries R)

(HahnSeries.ofPowerSeries ℤ R) (f + g) = (HahnSeries.ofPowerSeries ℤ R) f + (HahnSeries.ofPowerSeries ℤ R) g