/-- A language map defined on two factors of a sum. -/
@[simps]
protected def sumElim : L.sum L'' →ᴸ L'

{L : FirstOrder.Language}
{L' : FirstOrder.Language}
(ϕ : L →ᴸ L')
{L'' : FirstOrder.Language}
(ψ : L'' →ᴸ L')
(_n : ℕ)

∀ (a : L.Relations _n ⊕ L''.Relations _n),
  (ϕ.sumElim ψ).onRelation a = Sum.elim (fun f => ϕ.onRelation f) (fun f => ψ.onRelation f) a


/-- Let `α` be a densely ordered linear order with order topology. If `α` is a separable space, then
it has second countable topology. Note that the "densely ordered" assumption cannot be dropped, see
[double arrow space](https://topology.pi-base.org/spaces/S000093) for a counterexample. -/
theorem SecondCountableTopology.of_separableSpace_orderTopology [OrderTopology α] [DenselyOrdered α]
    [SeparableSpace α] : SecondCountableTopology α

(α : Type u)
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
[DenselyOrdered α]
[TopologicalSpace.SeparableSpace α]


lemma Prop.forall {f : Prop → Prop} : (∀ p, f p) ↔ f True ∧ f False


/-- The functor `Arrow (Arrow C) ⥤ Square C` which sends
a morphism `Arrow.mk f ⟶ Arrow.mk g` to the commutative square
with `f` on the top side and `g` on the bottom side. -/
@[simps!]
def fromArrowArrowFunctor' : Arrow (Arrow C) ⥤ Square C

{C : Type u}
[CategoryTheory.Category.{v, u} C]

∀ {X Y : CategoryTheory.Arrow (CategoryTheory.Arrow C)} (φ : X ⟶ Y),
  (CategoryTheory.Square.fromArrowArrowFunctor'.map φ).τ₄ = φ.right.right


theorem exists_nat_pos_mul_gt (ha : a ≠ 0) (hb : b ≠ ∞) : ∃ n > 0, b < (n : ℕ) * a

{a b : ENNReal}
(ha : a ≠ 0)
(hb : b ≠ ⊤)


@[to_additive]
theorem prod_sum_index {ι₁ : Type u₁} [DecidableEq ι₁] {β₁ : ι₁ → Type v₁} [∀ i₁, Zero (β₁ i₁)]
    [∀ (i) (x : β₁ i), Decidable (x ≠ 0)] [∀ i, AddCommMonoid (β i)]
    [∀ (i) (x : β i), Decidable (x ≠ 0)] [CommMonoid γ] {f : Π₀ i₁, β₁ i₁}
    {g : ∀ i₁, β₁ i₁ → Π₀ i, β i} {h : ∀ i, β i → γ} (h_zero : ∀ i, h i 0 = 1)
    (h_add : ∀ i b₁ b₂, h i (b₁ + b₂) = h i b₁ * h i b₂) :
    (f.sum g).prod h = f.prod fun i b => (g i b).prod h

[(i : ι₁) → (x : β₁ i) → Decidable (x ≠ 0)]

[(i : ι) → (x : β i) → Decidable (x ≠ 0)]

{g : (i₁ : ι₁) → β₁ i₁ → Π₀ (i : ι), β i}

(h_add : ∀ (i : ι) (b₁ b₂ : β i), h i (b₁ + b₂) = h i b₁ * h i b₂)


theorem eq_true_of_ne_false : {b : Bool} → Not (Eq b false) → Eq b true


/-- Swap the `ᵐᵒᵖ` on an algebra isomorphism to the opposite side. -/
@[simps!]
def opComm : (A ≃ₐ[R] Bᵐᵒᵖ) ≃ (Aᵐᵒᵖ ≃ₐ[R] B)

{R : Type u_1}
{A : Type u_3}
{B : Type u_4}
[CommSemiring R]
[Semiring A]
[Semiring B]
[Algebra R A]
[Algebra R B]

∀ (a : A ≃ₐ[R] Bᵐᵒᵖ) (a_1 : Aᵐᵒᵖ), (AlgEquiv.opComm a) a_1 = MulOpposite.unop (a (MulOpposite.unop a_1))


lemma adjoin_eq_span (s : Set A) : (adjoin R s).toSubmodule = span R (Subsemigroup.closure s)

{R : Type u}
{A : Type v}
[CommSemiring R]
[NonUnitalNonAssocSemiring A]
[Module R A]
[IsScalarTower R A A]
[SMulCommClass R A A]
(s : Set A)

(NonUnitalAlgebra.adjoin R s).toSubmodule = Submodule.span R ↑(Subsemigroup.closure s)


/-- The inverse of a partial homeomorphism `e` is an open map on `e.target`. -/
lemma isOpen_image_symm_of_subset_target {t : Set Y} (ht : IsOpen t) (hte : t ⊆ e.target) :
    IsOpen (e.symm '' t)

{X : Type u_1}
{Y : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
(e : PartialHomeomorph X Y)
{t : Set Y}
(ht : IsOpen t)
(hte : t ⊆ e.target)


@[simp]
theorem εClosure_univ : M.εClosure univ = univ

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


theorem edist_le (p : G.Walk u v) :
    G.edist u v ≤ p.length

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


theorem ContDiff.sum {ι : Type*} {f : ι → E → F} {s : Finset ι}
    (h : ∀ i ∈ s, ContDiff 𝕜 n fun x => f i x) : ContDiff 𝕜 n fun x => ∑ i ∈ s, f i x


theorem ulower_down : Primrec (ULower.down : α → ULower α)


@[reassoc (attr := simp)]
lemma opcyclesMap_comp_descOpcycles (φ : S₁ ⟶ S) [S₁.HasRightHomology] :
    opcyclesMap φ ≫ S.descOpcycles k hk =
      S₁.descOpcycles (φ.τ₂ ≫ k) (by rw [← φ.comm₁₂_assoc, hk, comp_zero])

(hk : CategoryTheory.CategoryStruct.comp S.f k = 0)

CategoryTheory.CategoryStruct.comp (CategoryTheory.ShortComplex.opcyclesMap φ) (S.descOpcycles k hk) =
  S₁.descOpcycles (CategoryTheory.CategoryStruct.comp φ.τ₂ k) ⋯


theorem subset_vanishingIdeal_zeroLocus (s : Set A) : s ⊆ vanishingIdeal (zeroLocus 𝒜 s)

{R : Type u_1}
{A : Type u_2}
[CommSemiring R]
[CommRing A]
[Algebra R A]
(𝒜 : ℕ → Submodule R A)
[GradedAlgebra 𝒜]
(s : Set A)

s ⊆ ↑(ProjectiveSpectrum.vanishingIdeal (ProjectiveSpectrum.zeroLocus 𝒜 s))


theorem stronglyMeasurable_const {α β} {_ : MeasurableSpace α} [TopologicalSpace β] {b : β} :
    StronglyMeasurable fun _ : α => b

∀ {x : MeasurableSpace α} [inst : TopologicalSpace β] {b : β}, MeasureTheory.StronglyMeasurable fun x => b


/-- Left component of the associator as a natural isomorphism. -/
@[simps!]
def associatorNatIsoLeft (a : B) (g : b ⟶ c) (h : c ⟶ d) :
    (postcomposing a ..).obj g ⋙ (postcomposing ..).obj h ≅ (postcomposing ..).obj (g ≫ h)

{B : Type u}
[CategoryTheory.Bicategory B]
{b c d : B}
(a : B)
(g : b ⟶ c)
(h : c ⟶ d)
(X : a ⟶ b)

(CategoryTheory.Bicategory.associatorNatIsoLeft a g h).inv.app X = (CategoryTheory.Bicategory.associator X g h).inv


/-- A homology map data for a morphism of short complexes induces
a homology map data in the opposite category. -/
@[simps]
def op {φ : S₁ ⟶ S₂} {h₁ : S₁.HomologyData} {h₂ : S₂.HomologyData}
    (ψ : HomologyMapData φ h₁ h₂) :
    HomologyMapData (opMap φ) h₂.op h₁.op

(ψ : CategoryTheory.ShortComplex.HomologyMapData φ h₁ h₂)


@[simp]
theorem map_dfinsupp_sumAddHom [AddCommMonoid R] [AddCommMonoid S] [∀ i, AddZeroClass (β i)]
    (h : R →+ S) (f : Π₀ i, β i) (g : ∀ i, β i →+ R) :
    h (sumAddHom g f) = sumAddHom (fun i => h.comp (g i)) f

{ι : Type u}
{β : ι → Type v}
[DecidableEq ι]
{R : Type u_1}
{S : Type u_2}
[AddCommMonoid R]
[AddCommMonoid S]
[(i : ι) → AddZeroClass (β i)]
(h : R →+ S)
(f : Π₀ (i : ι), β i)
(g : (i : ι) → β i →+ R)

h ((DFinsupp.sumAddHom g) f) = (DFinsupp.sumAddHom fun i => h.comp (g i)) f


theorem iInf_sets_eq_finite' (f : ι → Filter α) :
    (⨅ i, f i).sets = ⋃ t : Finset (PLift ι), (⨅ i ∈ t, f (PLift.down i)).sets

{α : Type u}
{ι : Sort x}
(f : ι → Filter α)

(⨅ i, f i).sets = ⋃ t, (⨅ i ∈ t, f i.down).sets


theorem hom_inv_id : hom P Q L ≫ inv P Q L = 𝟙 _

[(X : C) →
    CategoryTheory.Limits.PreservesColimitsOfSize.{0, 0, v₁, v₁, u₁, u₁} (CategoryTheory.MonoidalCategory.tensorLeft X)]

[(X : C) →
    CategoryTheory.Limits.PreservesColimitsOfSize.{0, 0, v₁, v₁, u₁, u₁}
      (CategoryTheory.MonoidalCategory.tensorRight X)]

Bimod.AssociatorBimod.hom P Q L ≫ Bimod.AssociatorBimod.inv P Q L = 𝟙 ((P.tensorBimod Q).tensorBimod L).X


@[reassoc (attr := simp)]
lemma IsLimit.lift_fst {t : PullbackCone f g} (ht : IsLimit t) {W : C} (h : W ⟶ X) (k : W ⟶ Y)
    (w : h ≫ f = k ≫ g) : IsLimit.lift ht h k w ≫ fst t = h

{t : CategoryTheory.Limits.PullbackCone f g}

CategoryTheory.Limits.PullbackCone.IsLimit.lift ht h k w ≫ t.fst = h


/-- Casting a `HomotopyRel f₀ f₁ S` to a `HomotopyRel g₀ g₁ S` where `f₀ = g₀` and `f₁ = g₁`.
-/
@[simps!]
def cast {f₀ f₁ g₀ g₁ : C(X, Y)} (F : HomotopyRel f₀ f₁ S) (h₀ : f₀ = g₀) (h₁ : f₁ = g₁) :
    HomotopyRel g₀ g₁ S

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]
{S : Set X}
{f₀ f₁ g₀ g₁ : C(X, Y)}
(F : f₀.HomotopyRel f₁ S)
(h₀ : f₀ = g₀)
(h₁ : f₁ = g₁)
(a : ↑I × X)


theorem cons_union_distrib (a : α) (s t : Multiset α) : a ::ₘ (s ∪ t) = a ::ₘ s ∪ a ::ₘ t

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


/-- Auxiliary definition for `CategoryTheory.Functor.closed`.
The internal hom functor `F ⟶[C] -` -/
@[simps!]
def closedIhom (F : D ⥤ C) : (D ⥤ C) ⥤ D ⥤ C

{D : Type u_1}
{C : Type u_2}
[CategoryTheory.Groupoid D]
[CategoryTheory.Category.{u_4, u_2} C]
[CategoryTheory.MonoidalCategory C]
[CategoryTheory.MonoidalClosed C]
(F : D ⥤ C)

∀ {X Y : D ⥤ C} (g : X ⟶ Y) (X_1 : D), (F.closedIhom.map g).app X_1 = (CategoryTheory.ihom (F.obj X_1)).map (g.app X_1)


@[reassoc (attr := simp)]
lemma map_hom_inv_id_eval_app (e : X ≅ Y) (F : C ⥤ D ⥤ E) (j : J) (Y : D) :
    (F.map (e.hom j)).app Y ≫ (F.map (e.inv j)).app Y = 𝟙 _

(F : CategoryTheory.Functor C (CategoryTheory.Functor D E))

∀ (Y_1 : D),
  CategoryTheory.CategoryStruct.comp ((F.map (e.hom j)).app Y_1) ((F.map (e.inv j)).app Y_1) =
    CategoryTheory.CategoryStruct.id ((F.obj (X j)).obj Y_1)


@[deprecated getElem_reverse_aux₂ (since := "2024-06-12")]
theorem get_reverse_aux₂ (l r : List α) (i : Nat) (h1) (h2) :
    get (reverseAux l r) ⟨length l - 1 - i, h1⟩ = get l ⟨i, h2⟩

(h1 : l.length - 1 - i < (l.reverseAux r).length)

(l.reverseAux r).get ⟨l.length - 1 - i, h1⟩ = l.get ⟨i, h2⟩


theorem sup_sigma [SemilatticeSup β] [OrderBot β] :
    (s.sigma t).sup f = s.sup fun i => (t i).sup fun b => f ⟨i, b⟩

{ι : Type u_1}
{α : ι → Type u_2}
{β : Type u_3}
(s : Finset ι)
(t : (i : ι) → Finset (α i))
(f : (i : ι) × α i → β)
[SemilatticeSup β]
[OrderBot β]


theorem enum_zero_eq_bot {o : Ordinal} (ho : 0 < o) :
    enum (· < ·) 0 (by rwa [type_lt]) =
      haveI H := outOrderBotOfPos ho
      (⊥ : (Quotient.out o).α)

Ordinal.enum (fun x x_1 => x < x_1) 0 ⋯ = ⊥


@[symm]
theorem IsRotated.symm (h : l ~r l') : l' ~r l

{α : Type u}
{l l' : List α}
(h : l ~r l')


@[simp, norm_cast]
theorem coe_max [LinearOrder α] (x y : α) : ((max x y : α) : WithBot α) = max (x : WithBot α) y

{α : Type u_1}
[LinearOrder α]
(x y : α)


/-- A vector has an angle of `θ` from the rotation of that vector by `θ`. -/
@[simp]
theorem oangle_rotation_self_right {x : V} (hx : x ≠ 0) (θ : Real.Angle) :
    o.oangle x (o.rotation θ x) = θ

[Fact (FiniteDimensional.finrank ℝ V = 2)]


/-- If two measures agree on all measurable subsets of `s` and `t`, then they agree on all
measurable subsets of `s ∪ t`. -/
theorem restrict_union_congr :
    μ.restrict (s ∪ t) = ν.restrict (s ∪ t) ↔
      μ.restrict s = ν.restrict s ∧ μ.restrict t = ν.restrict t

{α : Type u_2}
{m0 : MeasurableSpace α}
{μ ν : MeasureTheory.Measure α}
{s t : Set α}


/-- The mates equivalence commutes with this composition, essentially by `mateEquiv_vcomp`. -/
theorem conjugateEquiv_mateEquiv_vcomp
    (α : L₂ ⟶ L₁) (β : G ⋙ L₃ ⟶ L₂ ⋙ H) :
    (mateEquiv adj₁ adj₃) (leftAdjointConjugateSquare.vcomp α β) =
      rightAdjointConjugateSquare.vcomp (conjugateEquiv adj₁ adj₂ α) (mateEquiv adj₂ adj₃ β)

{A : Type u₁}
{B : Type u₂}
{C : Type u₃}
{D : Type u₄}
[CategoryTheory.Category.{v₁, u₁} A]
[CategoryTheory.Category.{v₂, u₂} B]
[CategoryTheory.Category.{v₃, u₃} C]
[CategoryTheory.Category.{v₄, u₄} D]
{G : CategoryTheory.Functor A C}
{H : CategoryTheory.Functor B D}
{L₁ : CategoryTheory.Functor A B}
{R₁ : CategoryTheory.Functor B A}
{L₂ : CategoryTheory.Functor A B}
{R₂ : CategoryTheory.Functor B A}
{L₃ : CategoryTheory.Functor C D}
{R₃ : CategoryTheory.Functor D C}
(adj₁ : L₁ ⊣ R₁)
(adj₂ : L₂ ⊣ R₂)
(adj₃ : L₃ ⊣ R₃)
(α : L₂ ⟶ L₁)
(β : G.comp L₃ ⟶ L₂.comp H)

(CategoryTheory.mateEquiv adj₁ adj₃) (CategoryTheory.leftAdjointConjugateSquare.vcomp α β) =
  CategoryTheory.rightAdjointConjugateSquare.vcomp ((CategoryTheory.conjugateEquiv adj₁ adj₂) α)
    ((CategoryTheory.mateEquiv adj₂ adj₃) β)


theorem of'_mul_modOf (g : G) (x : k[G]) : of' k G g * x %ᵒᶠ g = 0

{k : Type u_1}
{G : Type u_2}
[Semiring k]
[AddCancelCommMonoid G]
(g : G)
(x : AddMonoidAlgebra k G)

(AddMonoidAlgebra.of' k G g * x).modOf g = 0


@[simp]
theorem ofReal_cos_ofReal_re (x : ℝ) : ((cos x).re : ℂ) = cos x


/-- Represent `log (1 + z)` as an integral over the unit interval -/
lemma log_eq_integral {z : ℂ} (hz : 1 + z ∈ slitPlane) :
    log (1 + z) = z * ∫ (t : ℝ) in (0 : ℝ)..1, (1 + t • z)⁻¹

{z : ℂ}
(hz : 1 + z ∈ Complex.slitPlane)

Complex.log (1 + z) = z * ∫ (t : ℝ) in 0 ..1, (1 + t • z)⁻¹


theorem exists_subset_lt_add (H : InnerRegularWRT μ p q) (h0 : p ∅) (hU : q U) (hμU : μ U ≠ ∞)
    (hε : ε ≠ 0) : ∃ K, K ⊆ U ∧ p K ∧ μ U < μ K + ε

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{p q : Set α → Prop}
{U : Set α}
{ε : ℝ≥0∞}
(H : μ.InnerRegularWRT p q)
(h0 : p ∅)
(hU : q U)
(hμU : μ U ≠ ⊤)
(hε : ε ≠ 0)


@[simp]
theorem realize_boundedFormula (g : M ≃[L] N) (φ : L.BoundedFormula α n) {v : α → M}
    {xs : Fin n → M} : φ.Realize (g ∘ v) (g ∘ xs) ↔ φ.Realize v xs

{L : FirstOrder.Language}
{M : Type w}
{N : Type u_1}
[L.Structure M]
[L.Structure N]
{α : Type u'}
{n : ℕ}
(g : L.Equiv M N)
(φ : L.BoundedFormula α n)
{v : α → M}
{xs : Fin n → M}

φ.Realize (⇑g ∘ v) (⇑g ∘ xs) ↔ φ.Realize v xs


/-- For a real `r > 1` we have `n = o(r ^ n)` as `n → ∞`. -/
theorem isLittleO_coe_const_pow_of_one_lt {R : Type*} [NormedRing R] {r : ℝ} (hr : 1 < r) :
    ((↑) : ℕ → R) =o[atTop] fun n ↦ r ^ n

{R : Type u_4}
[NormedRing R]
{r : ℝ}
(hr : 1 < r)

Nat.cast =o[Filter.atTop] fun n => r ^ n


theorem edist_le_zero {x y : γ} : edist x y ≤ 0 ↔ x = y


theorem nullMeasurableSet_lt [LinearOrder β] [OrderClosedTopology β] [PseudoMetrizableSpace β]
    {f g : α → β} (hf : AEStronglyMeasurable f μ) (hg : AEStronglyMeasurable g μ) :
    NullMeasurableSet { a | f a < g a } μ

(hf : MeasureTheory.AEStronglyMeasurable f μ)

(hg : MeasureTheory.AEStronglyMeasurable g μ)

MeasureTheory.NullMeasurableSet {a | f a < g a} μ


theorem sub_equiv_sub {f1 f2 g1 g2 : CauSeq β abv} (hf : f1 ≈ f2) (hg : g1 ≈ g2) :
    f1 - g1 ≈ f2 - g2

{α : Type u_1}
{β : Type u_2}
[LinearOrderedField α]
[Ring β]
{abv : β → α}
[IsAbsoluteValue abv]
{f1 f2 g1 g2 : CauSeq β abv}
(hf : f1 ≈ f2)
(hg : g1 ≈ g2)


theorem liftAlgHom_injective (φ : K[X] →ₐ[S] L) (hφ : Function.Injective φ)
    (hφ' : K[X]⁰ ≤ L⁰.comap φ := nonZeroDivisors_le_comap_nonZeroDivisors_of_injective _ hφ) :
    Function.Injective (liftAlgHom φ hφ')

(hφ' : K[X]⁰ ≤ Submonoid.comap φ L⁰ := ⋯)

Function.Injective ⇑(RatFunc.liftAlgHom φ hφ')


/-- The units group of `S →ₐ[R] S` is `S ≃ₐ[R] S`.
See `LinearMap.GeneralLinearGroup.generalLinearEquiv` for the linear map version. -/
@[simps]
def algHomUnitsEquiv (R S : Type*) [CommSemiring R] [Semiring S] [Algebra R S] :
    (S →ₐ[R] S)ˣ ≃* (S ≃ₐ[R] S)

(R : Type u_1)
(S : Type u_2)
[CommSemiring R]
[Semiring S]
[Algebra R S]
(f : (S →ₐ[R] S)ˣ)

∀ (a : S), ((AlgEquiv.algHomUnitsEquiv R S) f) a = (↑↑(↑f).toRingHom).toFun a


@[to_additive]
theorem iUnion_smul_left_image : ⋃ a ∈ s, a • t = s • t

{α : Type u_2}
{β : Type u_3}
[SMul α β]
{s : Set α}
{t : Set β}


@[simp]
theorem val_one' (n : ℕ) [NeZero n] : ((1 : Fin n) : ℕ) = 1 % n


@[simp]
theorem hnot_sdiff (a : α) : ￢a \ a = ￢a

{α : Type u_2}
[CoheytingAlgebra α]
(a : α)


@[simp, norm_cast] lemma ofENat_nat (n : ℕ) : ofENat n = n


@[simp]
theorem cosh_ofReal_im (x : ℝ) : (cosh x).im = 0


/-- A finitely generated torsion module over a PID is an internal direct sum of its
`p i ^ e i`-torsion submodules for some primes `p i` and numbers `e i`. -/
theorem Submodule.exists_isInternal_prime_power_torsion_of_pid [Module.Finite R M]
    (hM : Module.IsTorsion R M) :
    ∃ (ι : Type u) (_ : Fintype ι) (_ : DecidableEq ι) (p : ι → R) (_ : ∀ i, Irreducible <| p i)
        (e : ι → ℕ), DirectSum.IsInternal fun i => torsionBy R M <| p i ^ e i

{R : Type u}
[CommRing R]
[IsDomain R]
[IsPrincipalIdealRing R]
{M : Type v}
[AddCommGroup M]
[Module R M]
[Module.Finite R M]
(hM : Module.IsTorsion R M)

∃ ι x x p, ∃ (_ : ∀ (i : ι), Irreducible (p i)), ∃ e, DirectSum.IsInternal fun i => Submodule.torsionBy R M (p i ^ e i)


theorem cos_sub_two_pi (x : ℂ) : cos (x - 2 * π) = cos x

Complex.cos (x - 2 * ↑Real.pi) = Complex.cos x


lemma volume_euclideanSpace_eq_dirac [IsEmpty ι] :
    (volume : Measure (EuclideanSpace ℝ ι)) = Measure.dirac 0

MeasureTheory.volume = MeasureTheory.Measure.dirac 0


/-- The shift functor `Triangle C ⥤ Triangle C` by `n : ℤ` sends a triangle
to the triangle obtained by shifting the objects by `n` in `C` and by
multiplying the three morphisms by `(-1)^n`. -/
@[simps]
noncomputable def Triangle.shiftFunctor (n : ℤ) : Triangle C ⥤ Triangle C

(C : Type u)
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Preadditive C]
[CategoryTheory.HasShift C ℤ]
(n : ℤ)

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


theorem Antiperiodic.int_odd_mul_antiperiodic [Ring α] [InvolutiveNeg β] (h : Antiperiodic f c)
    (n : ℤ) : Antiperiodic f (n * (2 * c) + c)

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{c : α}
[Ring α]
[InvolutiveNeg β]
(h : Function.Antiperiodic f c)
(n : ℤ)

Function.Antiperiodic f (↑n * (2 * c) + c)


@[simp, elementwise]
    -- Porting note (#11036): broken dot notation
theorem kernelIsoKer_inv_kernel_ι : (kernelIsoKer f).inv ≫ kernel.ι f =
    (LinearMap.ker f).subtype

{R : Type u}
[Ring R]
{G H : ModuleCat R}
(f : G ⟶ H)

(ModuleCat.kernelIsoKer f).inv ≫ CategoryTheory.Limits.kernel.ι f = (LinearMap.ker f).subtype


@[simp]
theorem not_nonempty_iff_eq_empty {s : Finset α} : ¬s.Nonempty ↔ s = ∅


theorem map_natDegree_eq_sub {S F : Type*} [Semiring S]
    [FunLike F R[X] S[X]] [AddMonoidHomClass F R[X] S[X]] {φ : F}
    {p : R[X]} {k : ℕ} (φ_k : ∀ f : R[X], f.natDegree < k → φ f = 0)
    (φ_mon : ∀ n c, c ≠ 0 → (φ (monomial n c)).natDegree = n - k) :
    (φ p).natDegree = p.natDegree - k

(φ_k : ∀ (f : R[X]), f.natDegree < k → φ f = 0)

(φ_mon : ∀ (n : ℕ) (c : R), c ≠ 0 → (φ ((Polynomial.monomial n) c)).natDegree = n - k)


theorem DifferentiableAt.congr_of_eventuallyEq (h : DifferentiableAt 𝕜 f x) (hL : f₁ =ᶠ[𝓝 x] f) :
    DifferentiableAt 𝕜 f₁ x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f f₁ : E → F}
{x : E}
(h : DifferentiableAt 𝕜 f x)
(hL : f₁ =ᶠ[𝓝 x] f)


/-- **HM-GM inequality**: The harmonic mean is less than or equal to the geometric mean, weighted
version for real-valued nonnegative functions. -/
theorem harm_mean_le_geom_mean_weighted (w z : ι → ℝ) (hs : s.Nonempty) (hw : ∀ i ∈ s, 0 < w i)
    (hw' : ∑ i in s, w i = 1) (hz : ∀ i ∈ s, 0 < z i) :
    (∑ i in s, w i / z i)⁻¹ ≤ ∏ i in s, z i ^ w i

{ι : Type u}
(s : Finset ι)
(w z : ι → ℝ)
(hs : s.Nonempty)
(hw : ∀ i ∈ s, 0 < w i)
(hw' : ∑ i ∈ s, w i = 1)
(hz : ∀ i ∈ s, 0 < z i)

(∑ i ∈ s, w i / z i)⁻¹ ≤ ∏ i ∈ s, z i ^ w i


/-- Canonical form of the **equality case of Jensen's equality**.

For a strictly concave function `f` and nonnegative weights `w`, we have
`f (∑ i ∈ t, w i • p i) = ∑ i ∈ t, w i • f (p i)` if and only if the points `p` with nonzero
weight are all equal (and in fact all equal to their center of mass wrt `w`). -/
lemma StrictConcaveOn.map_sum_eq_iff' (hf : StrictConcaveOn 𝕜 s f) (h₀ : ∀ i ∈ t, 0 ≤ w i)
    (h₁ : ∑ i ∈ t, w i = 1) (hmem : ∀ i ∈ t, p i ∈ s) :
    f (∑ i ∈ t, w i • p i) = ∑ i ∈ t, w i • f (p i) ↔
      ∀ j ∈ t, w j ≠ 0 → p j = ∑ i ∈ t, w i • p i

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_4}
{ι : Type u_5}
[LinearOrderedField 𝕜]
[AddCommGroup E]
[OrderedAddCommGroup β]
[Module 𝕜 E]
[Module 𝕜 β]
[OrderedSMul 𝕜 β]
{s : Set E}
{f : E → β}
{t : Finset ι}
{w : ι → 𝕜}
{p : ι → E}
(hf : StrictConcaveOn 𝕜 s f)
(h₀ : ∀ i ∈ t, 0 ≤ w i)
(h₁ : ∑ i ∈ t, w i = 1)
(hmem : ∀ i ∈ t, p i ∈ s)


theorem nontrivial_iff :
    Nontrivial R[S⁻¹] ↔ 0 ∉ S

{R : Type u_1}
[Ring R]
{S : Submonoid R}
[OreLocalization.OreSet S]

Nontrivial (OreLocalization S R) ↔ 0 ∉ S


protected theorem mul_mem {x y : A} (hx : x ∈ S) (hy : y ∈ S) : x * y ∈ S

{R : Type u}
{A : Type v}
[CommSemiring R]
[Semiring A]
[Algebra R A]
(S : Subalgebra R A)
{x y : A}
(hx : x ∈ S)
(hy : y ∈ S)


/-- A binary bicone for a pair of objects `P Q : C` consists of the cone point `X`,
maps from `X` to both `P` and `Q`, and maps from both `P` and `Q` to `X`,
so that `inl ≫ fst = 𝟙 P`, `inl ≫ snd = 0`, `inr ≫ fst = 0`, and `inr ≫ snd = 𝟙 Q`
-/
-- @[nolint has_nonempty_instance] Porting note (#5171): removed
structure BinaryBicone (P Q : C) where
  pt : C
  fst : pt ⟶ P
  snd : pt ⟶ Q
  inl : P ⟶ pt
  inr : Q ⟶ pt
  inl_fst : inl ≫ fst = 𝟙 P := by aesop
  inl_snd : inl ≫ snd = 0 := by aesop
  inr_fst : inr ≫ fst = 0 := by aesop
  inr_snd : inr ≫ snd = 𝟙 Q := by aesop

(self : CategoryTheory.Limits.BinaryBicone P Q)


/-- Reinterpret an `⨅`-homomorphism as a `⨆`-homomorphism between the dual orders. -/
@[simps]
protected def dual : sInfHom α β ≃ sSupHom αᵒᵈ βᵒᵈ

{α : Type u_2}
{β : Type u_3}
[InfSet α]
[InfSet β]
(f : sSupHom αᵒᵈ βᵒᵈ)

∀ (a : α), (sInfHom.dual.symm f).toFun a = (⇑OrderDual.ofDual ∘ ⇑f ∘ ⇑OrderDual.toDual) a


/-- The uniform neighborhoods of all points of a dense set cover the whole space. -/
theorem Dense.biUnion_uniformity_ball {s : Set α} {U : Set (α × α)} (hs : Dense s) (hU : U ∈ 𝓤 α) :
    ⋃ x ∈ s, ball x U = univ

{α : Type ua}
[UniformSpace α]
{s : Set α}
{U : Set (α × α)}
(hs : Dense s)
(hU : U ∈ 𝓤 α)

⋃ x ∈ s, UniformSpace.ball x U = Set.univ


theorem Context.mergeIdem_head2 (h : x ≠ y) : mergeIdem (x :: y :: ys) = x :: mergeIdem (y :: ys)

Lean.Data.AC.mergeIdem (x :: y :: ys) = x :: Lean.Data.AC.mergeIdem (y :: ys)


theorem bihimp_left_involutive (a : α) : Involutive (· ⇔ a)

{α : Type u_2}
[BooleanAlgebra α]
(a : α)


/-- This class states that a ring homomorphism is isometric. This is a sufficient assumption
for a continuous semilinear map to be bounded and this is the main use for this typeclass. -/
class RingHomIsometric [Semiring R₁] [Semiring R₂] [Norm R₁] [Norm R₂] (σ : R₁ →+* R₂) : Prop where
  /-- The ring homomorphism is an isometry. -/
  is_iso : ∀ {x : R₁}, ‖σ x‖ = ‖x‖

{R₁ : Type u_5}
{R₂ : Type u_6}
[Semiring R₁]
[Semiring R₂]
[Norm R₁]
[Norm R₂]
{σ : R₁ →+* R₂}
[self : RingHomIsometric σ]
{x : R₁}


theorem isCompl_iff_coe_toSubmodule :
    IsCompl N N' ↔ IsCompl (N : Submodule R M) (N' : Submodule R M)

{R : Type u}
{L : Type v}
{M : Type w}
[CommRing R]
[LieRing L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
(N N' : LieSubmodule R L M)


/-- Each element of the group defines a multiplicative monoid isomorphism.

This is a stronger version of `MulAction.toPerm`. -/
@[simps (config := { simpRhs := true })]
def MulDistribMulAction.toMulEquiv (x : α) : β ≃* β

{α : Type u}
(β : Type v)
[Group α]
[Monoid β]
[MulDistribMulAction α β]
(x : α)

∀ (a : β), (MulDistribMulAction.toMulEquiv β x).symm a = x⁻¹ • a


theorem coe_injective : Function.Injective (SetLike.coe : A → Set B)

{A : Type u_1}
{B : Type u_2}
[i : SetLike A B]


/-- If `b` semiconjugates `x` to `y` and `a` semiconjugates `y` to `z`, then `a * b`
semiconjugates `x` to `z`. -/
@[to_additive "If `b` semiconjugates `x` to `y` and `a` semiconjugates `y` to `z`, then `a + b`
semiconjugates `x` to `z`."]
theorem mul_left (ha : SemiconjBy a y z) (hb : SemiconjBy b x y) : SemiconjBy (a * b) x z

{S : Type u_1}
[Semigroup S]
{a b x y z : S}
(ha : SemiconjBy a y z)
(hb : SemiconjBy b x y)


@[gcongr]
theorem inf_mono (h : s₁ ⊆ s₂) : s₂.inf f ≤ s₁.inf f

{α : Type u_2}
{β : Type u_3}
[SemilatticeInf α]
[OrderTop α]
{s₁ s₂ : Finset β}
{f : β → α}
(h : s₁ ⊆ s₂)


theorem Lat_dual_comp_forget_to_partOrd :
    Lat.dual ⋙ forget₂ Lat PartOrd = forget₂ Lat PartOrd ⋙ PartOrd.dual

Lat.dual ⋙ CategoryTheory.forget₂ Lat PartOrd = CategoryTheory.forget₂ Lat PartOrd ⋙ PartOrd.dual


theorem _root_.separatingDual_iff_injective : SeparatingDual R V ↔
    Function.Injective (ContinuousLinearMap.coeLM (R := R) R (M := V) (N₃ := R)).flip

{R : Type u_1}
{V : Type u_2}
[Field R]
[AddCommGroup V]
[TopologicalSpace R]
[TopologicalSpace V]
[TopologicalRing R]
[Module R V]

SeparatingDual R V ↔ Function.Injective ⇑(ContinuousLinearMap.coeLM R).flip


/-- Unfold the definition of `dimH` using `[MeasurableSpace X] [BorelSpace X]` from the
environment. -/
theorem dimH_def (s : Set X) : dimH s = ⨆ (d : ℝ≥0) (_ : μH[d] s = ∞), (d : ℝ≥0∞)

{X : Type u_2}
[EMetricSpace X]
[MeasurableSpace X]
[BorelSpace X]
(s : Set X)


/-- The left homology map data associated to the identity morphism of a short complex. -/
@[simps]
def id (h : S.LeftHomologyData) : LeftHomologyMapData (𝟙 S) h h

(CategoryTheory.ShortComplex.LeftHomologyMapData.id h).φK = CategoryTheory.CategoryStruct.id h.K


theorem Integrable.smul_of_top_right {f : α → β} {φ : α → 𝕜} (hf : Integrable f μ)
    (hφ : Memℒp φ ∞ μ) : Integrable (φ • f) μ

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup β]
{𝕜 : Type u_5}
[NormedRing 𝕜]
[Module 𝕜 β]
[BoundedSMul 𝕜 β]
{f : α → β}
{φ : α → 𝕜}
(hf : MeasureTheory.Integrable f μ)
(hφ : MeasureTheory.Memℒp φ ⊤ μ)


theorem isCoseparator_iff_faithful_yoneda_obj (G : C) : IsCoseparator G ↔ (yoneda.obj G).Faithful

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

CategoryTheory.IsCoseparator G ↔ (CategoryTheory.yoneda.obj G).Faithful


theorem iteratedDerivWithin_const_mul (c : 𝕜) {f : 𝕜 → 𝕜} (hf : ContDiffOn 𝕜 n f s) :
    iteratedDerivWithin n (fun z => c * f z) s x = c * iteratedDerivWithin n f s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{n : ℕ}
{x : 𝕜}
{s : Set 𝕜}
(hx : x ∈ s)
(h : UniqueDiffOn 𝕜 s)
(c : 𝕜)
{f : 𝕜 → 𝕜}
(hf : ContDiffOn 𝕜 (↑n) f s)


theorem rTensor_mul (f g : N ≃ₗ[R] N) : (f * g).rTensor M = f.rTensor M * g.rTensor M

{R : Type u_1}
[CommSemiring R]
(M : Type u_4)
{N : Type u_5}
[AddCommMonoid M]
[AddCommMonoid N]
[Module R M]
[Module R N]
(f g : N ≃ₗ[R] N)

LinearEquiv.rTensor M (f * g) = LinearEquiv.rTensor M f * LinearEquiv.rTensor M g


theorem separated_by_continuous [TopologicalSpace Y] [T2Space Y]
    {f : X → Y} (hf : Continuous f) {x y : X} (h : f x ≠ f y) :
    ∃ u v : Set X, IsOpen u ∧ IsOpen v ∧ x ∈ u ∧ y ∈ v ∧ Disjoint u v

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
[T2Space Y]
{f : X → Y}
(hf : Continuous f)
{x y : X}
(h : f x ≠ f y)

∃ u v, IsOpen u ∧ IsOpen v ∧ x ∈ u ∧ y ∈ v ∧ Disjoint u v


theorem Monic.ne_zero {R : Type*} [Semiring R] [Nontrivial R] {p : R[X]} (hp : p.Monic) :
    p ≠ 0

{R : Type u_2}
[Semiring R]
[Nontrivial R]
{p : R[X]}
(hp : p.Monic)


/-- The categorical kernel inclusion for `f : G ⟶ H`, as an object over `G`,
agrees with the `AddSubgroup.subtype` map.
-/
@[simps! hom_left_apply_coe inv_left_apply]
def kernelIsoKerOver {G H : AddCommGrp.{u}} (f : G ⟶ H) :
    Over.mk (kernel.ι f) ≅ @Over.mk _ _ G (AddCommGrp.of f.ker) (AddSubgroup.subtype f.ker)

{G H : AddCommGrp}
(f : G ⟶ H)
(g : ↑(CategoryTheory.Limits.kernel f))

↑((AddCommGrp.kernelIsoKerOver f).hom.left g) = (CategoryTheory.Limits.kernel.ι f) g


/-- We shall say that a category `C` is a category with homology when all short complexes
have homology. -/
class _root_.CategoryTheory.CategoryWithHomology : Prop where
  hasHomology : ∀ (S : ShortComplex C), S.HasHomology

[self : CategoryTheory.CategoryWithHomology C]


theorem toNormedDual_apply (x : WeakDual 𝕜 E) (y : E) : (toNormedDual x) y = x y

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[SeminormedAddCommGroup E]
[NormedSpace 𝕜 E]
(x : WeakDual 𝕜 E)
(y : E)


@[to_additive]
-- Porting note (#11119): removed `simp` attribute because `simpNF` says it can prove it.
theorem pure_mul_pure : (pure a : Filter α) * pure b = pure (a * b)


theorem IsBounded.fst_of_prod (h : IsBounded (s ×ˢ t)) (ht : t.Nonempty) : IsBounded s

{α : Type u_1}
{β : Type u_2}
[Bornology α]
[Bornology β]
{s : Set α}
{t : Set β}
(h : Bornology.IsBounded (s ×ˢ t))
(ht : t.Nonempty)


/-- Stabilizers in group SubMulAction coincide with stabilizers in the ambient space -/
theorem stabilizer_of_subMul {p : SubMulAction R M} (m : p) :
    MulAction.stabilizer R m = MulAction.stabilizer R (m : M)

{R : Type u}
{M : Type v}
[Group R]
[MulAction R M]
{p : SubMulAction R M}
(m : ↥p)

MulAction.stabilizer R m = MulAction.stabilizer R ↑m


/-- If `λ` divides `x + 1`, then `λ ^ 4` divides `x ^ 3 + 1`. -/
lemma lambda_pow_four_dvd_cube_add_one_of_dvd_add_one {x : 𝓞 K} (h : λ ∣ x + 1) :
    λ ^ 4 ∣ x ^ 3 + 1

{K : Type u_1}
[Field K]
[NumberField K]
[IsCyclotomicExtension {3} ℚ K]
{ζ : K}
(hζ : IsPrimitiveRoot ζ ↑3)
{x : 𝓞 K}
(h : hζ.toInteger - 1 ∣ x + 1)


lemma iIndepFun.indepFun_prod_mk_prod_mk (h_indep : iIndepFun m f μ) (hf : ∀ i, Measurable (f i))
    (i j k l : ι) (hik : i ≠ k) (hil : i ≠ l) (hjk : j ≠ k) (hjl : j ≠ l) :
    IndepFun (fun a ↦ (f i a, f j a)) (fun a ↦ (f k a, f l a)) μ

(h_indep : ProbabilityTheory.iIndepFun m f μ)

ProbabilityTheory.IndepFun (fun a => (f i a, f j a)) (fun a => (f k a, f l a)) μ


/-- A finite kernel which satisfies the disintegration property is almost everywhere equal to the
disintegration kernel. -/
theorem eq_condKernel_of_kernel_eq_compProd [CountableOrCountablyGenerated α β]
    {ρ : Kernel α (β × Ω)} [IsFiniteKernel ρ] {κ : Kernel (α × β) Ω} [IsFiniteKernel κ]
    (hκ : Kernel.fst ρ ⊗ₖ κ = ρ) (a : α) :
    ∀ᵐ x ∂(Kernel.fst ρ a), κ (a, x) = Kernel.condKernel ρ (a, x)

{ρ : ProbabilityTheory.Kernel α (β × Ω)}

{κ : ProbabilityTheory.Kernel (α × β) Ω}

∀ᵐ (x : β) ∂ρ.fst a, κ (a, x) = ρ.condKernel (a, x)


@[simp]
theorem coeff_one_X : coeff R 1 (X : R⟦X⟧) = 1

(PowerSeries.coeff R 1) PowerSeries.X = 1


lemma quotientInfToPiQuotient_mk (I : ι → Ideal R) (x : R) :
    quotientInfToPiQuotient I (Quotient.mk _ x) = fun i : ι ↦ Quotient.mk (I i) x

{R : Type u}
[CommRing R]
{ι : Type u_1}
(I : ι → Ideal R)
(x : R)

(Ideal.quotientInfToPiQuotient I) ((Ideal.Quotient.mk (⨅ i, I i)) x) = fun i => (Ideal.Quotient.mk (I i)) x


@[simp]
theorem fst_swap {p : α × β} : (swap p).1 = p.2

{α : Type u_1}
{β : Type u_2}
{p : α × β}


theorem Matrix.range_mulVecLin (M : Matrix m n R) :
    LinearMap.range M.mulVecLin = span R (range Mᵀ)

{R : Type u_1}
[CommSemiring R]
{m : Type u_4}
{n : Type u_5}
[Fintype n]
(M : Matrix m n R)

LinearMap.range M.mulVecLin = Submodule.span R (Set.range Mᵀ)


@[to_additive (attr := simp)]
theorem toFinset_smul_set (a : α) (s : Set β) [Fintype s] [Fintype ↑(a • s)] :
    (a • s).toFinset = a • s.toFinset

{α : Type u_2}
{β : Type u_3}
[DecidableEq β]
[SMul α β]
(a : α)
(s : Set β)
[Fintype ↑s]
[Fintype ↑(a • s)]


/-- Change of variable formula for differentiable functions, set version: if a function `f` is
injective and differentiable on a measurable set `s`, then the pushforward of the measure with
density `|(f' x).det|` on `s` is the Lebesgue measure on the image set. This version is expressed
in terms of the restricted function `s.restrict f`.
For a version for the original function, but with a measurability assumption,
see `map_withDensity_abs_det_fderiv_eq_addHaar`.
-/
theorem restrict_map_withDensity_abs_det_fderiv_eq_addHaar (hs : MeasurableSet s)
    (hf' : ∀ x ∈ s, HasFDerivWithinAt f (f' x) s x) (hf : InjOn f s) :
    Measure.map (s.restrict f) (comap (↑) (μ.withDensity fun x => ENNReal.ofReal |(f' x).det|)) =
      μ.restrict (f '' s)

MeasureTheory.Measure.map (s.restrict f)
    (MeasureTheory.Measure.comap Subtype.val (μ.withDensity fun x => ENNReal.ofReal |(f' x).det|)) =
  μ.restrict (f '' s)


@[simp]
theorem tail_pure (a : α) : tail (pure a) = pure a

(Computation.pure a).tail = Computation.pure a


protected theorem add_pos_left (h : 0 < m) (n) : 0 < m + n


theorem min_left_comm : ∀ a b c : α, min a (min b c) = min b (min a c)

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


theorem map_map (g : F →ₗ[𝕜] G) (f : E →ₗ[𝕜] F) (S : PointedCone 𝕜 E) :
    (S.map f).map g = S.map (g.comp f)

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
{G : Type u_4}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[Module 𝕜 E]
[AddCommMonoid F]
[Module 𝕜 F]
[AddCommMonoid G]
[Module 𝕜 G]
(g : F →ₗ[𝕜] G)
(f : E →ₗ[𝕜] F)
(S : PointedCone 𝕜 E)

PointedCone.map g (PointedCone.map f S) = PointedCone.map (g ∘ₗ f) S


@[simp]
theorem pow_log_eq_self [DecidableEq M] {n : M} (p : powers n) : pow n (log p) = p

{M : Type u_1}
[Monoid M]
[DecidableEq M]
{n : M}
(p : ↥(Submonoid.powers n))


@[to_additive (attr := simp)]
theorem liftOfRightInverse_comp (hf : Function.RightInverse f_inv f)
    (g : { g : G₁ →* G₃ // f.ker ≤ g.ker }) : (f.liftOfRightInverse f_inv hf g).comp f = g

{G₁ : Type u_5}
{G₂ : Type u_6}
{G₃ : Type u_7}
[Group G₁]
[Group G₂]
[Group G₃]
(f : G₁ →* G₂)
(f_inv : G₂ → G₁)
(hf : Function.RightInverse f_inv ⇑f)
(g : { g // f.ker ≤ g.ker })

((f.liftOfRightInverse f_inv hf) g).comp f = ↑g


@[simp]
theorem reverse_eq_zero : f.reverse = 0 ↔ f = 0

{R : Type u_1}
[Semiring R]
{f : Polynomial R}


/-- Given two finite disjoint sets `s` and `t`, the product of `f i` over `i ∈ s ∪ t` equals the
product of `f i` over `i ∈ s` times the product of `f i` over `i ∈ t`. -/
@[to_additive
      "Given two finite disjoint sets `s` and `t`, the sum of `f i` over `i ∈ s ∪ t` equals
      the sum of `f i` over `i ∈ s` plus the sum of `f i` over `i ∈ t`."]
theorem finprod_mem_union (hst : Disjoint s t) (hs : s.Finite) (ht : t.Finite) :
    ∏ᶠ i ∈ s ∪ t, f i = (∏ᶠ i ∈ s, f i) * ∏ᶠ i ∈ t, f i

{α : Type u_1}
{M : Type u_5}
[AddCommMonoid M]
{f : α → M}
{s t : Set α}
(hst : Disjoint s t)
(hs : s.Finite)
(ht : t.Finite)

∑ᶠ (i : α) (_ : i ∈ s ∪ t), f i = ∑ᶠ (i : α) (_ : i ∈ s), f i + ∑ᶠ (i : α) (_ : i ∈ t), f i


theorem ext_iff {f g : r →r s} : f = g ↔ ∀ x, f x = g x

{α : Type u_1}
{β : Type u_2}
{r : α → α → Prop}
{s : β → β → Prop}
{f g : r →r s}


theorem add_left (x y z : M) : B (x + y) z = B x z + B y z

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
{B : LinearMap.BilinForm R M}
(x y z : M)


/-- If all but one object in a diagram is strict terminal, then the limit is isomorphic to the
said object via `limit.π`. -/
theorem limit_π_isIso_of_is_strict_terminal (F : J ⥤ C) [HasLimit F] (i : J)
    (H : ∀ (j) (_ : j ≠ i), IsTerminal (F.obj j)) [Subsingleton (i ⟶ i)] : IsIso (limit.π F i)

(H : (j : J) → j ≠ i → CategoryTheory.Limits.IsTerminal (F.obj j))

CategoryTheory.IsIso (CategoryTheory.Limits.limit.π F i)


@[simp]
lemma preimage_coe_Iio_top : Real.toEReal ⁻¹' Iio ⊤ = univ


/-- A balanced set absorbs itself. -/
theorem Balanced.absorbs_self (hA : Balanced 𝕜 A) : Absorbs 𝕜 A A

{𝕜 : Type u_1}
{E : Type u_3}
[NormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{A : Set E}
(hA : Balanced 𝕜 A)


@[reassoc]
lemma stalkSpecializes_stalkMap (x x' : X)
    (h : x ⤳ x') : Y.presheaf.stalkSpecializes (f.val.base.map_specializes h) ≫ f.stalkMap x =
      f.stalkMap x' ≫ X.presheaf.stalkSpecializes h

{X Y : AlgebraicGeometry.Scheme}
(f : X ⟶ Y)
(x x' : ↑↑X.toPresheafedSpace)
(h : x ⤳ x')

Y.presheaf.stalkSpecializes ⋯ ≫ AlgebraicGeometry.Scheme.Hom.stalkMap f x =
  AlgebraicGeometry.Scheme.Hom.stalkMap f x' ≫ X.presheaf.stalkSpecializes h


lemma piecewise_insert [DecidableEq ι] (j : ι) [∀ i, Decidable (i ∈ insert j s)] :
    (insert j s).piecewise f g = update (s.piecewise f g) j (f j)

{ι : Type u_1}
{π : ι → Sort u_2}
(s : Finset ι)
(f g : (i : ι) → π i)
[(j : ι) → Decidable (j ∈ s)]
[DecidableEq ι]
(j : ι)
[(i : ι) → Decidable (i ∈ insert j s)]

(insert j s).piecewise f g = Function.update (s.piecewise f g) j (f j)


theorem map_hausdorffMeasure (hf : Isometry f) (hd : 0 ≤ d ∨ Surjective f) :
    Measure.map f μH[d] = μH[d].restrict (range f)

{X : Type u_2}
{Y : Type u_3}
[EMetricSpace X]
[EMetricSpace Y]
[MeasurableSpace X]
[BorelSpace X]
[MeasurableSpace Y]
[BorelSpace Y]
{f : X → Y}
{d : ℝ}
(hf : Isometry f)
(hd : 0 ≤ d ∨ Function.Surjective f)

MeasureTheory.Measure.map f μH[d] = μH[d].restrict (Set.range f)


/-- The cosine of `π / 6` is `√3 / 2`. -/
@[simp]
theorem cos_pi_div_six : cos (π / 6) = √3 / 2


lemma IsReal.comap (f : k →+* K) {w : InfinitePlace K} (hφ : IsReal w) :
    IsReal (w.comap f)

{k : Type u_1}
[Field k]
{K : Type u_2}
[Field K]
(f : k →+* K)
{w : NumberField.InfinitePlace K}
(hφ : w.IsReal)


theorem toSeminorm_comp (f : F →ₗ[𝕜] 𝕜) (g : E →ₗ[𝕜] F) :
    f.toSeminorm.comp g = (f.comp g).toSeminorm

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[AddCommGroup F]
[Module 𝕜 F]
(f : F →ₗ[𝕜] 𝕜)
(g : E →ₗ[𝕜] F)

f.toSeminorm.comp g = (f ∘ₗ g).toSeminorm


theorem sqLe_add {c d x y z w : ℕ} (xy : SqLe x c y d) (zw : SqLe z c w d) :
    SqLe (x + z) c (y + w) d

{c d x y z w : ℕ}
(xy : Zsqrtd.SqLe x c y d)
(zw : Zsqrtd.SqLe z c w d)


protected theorem comp (hg : IsOpenMap g) (hf : IsOpenMap f) :
    IsOpenMap (g ∘ f)

{X : Type u_1}
{Y : Type u_2}
{Z : Type u_3}
{f : X → Y}
{g : Y → Z}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
(hg : IsOpenMap g)
(hf : IsOpenMap f)


@[simp]
theorem _root_.OrderIso.invENNReal_symm_apply (a : ℝ≥0∞ᵒᵈ) :
    OrderIso.invENNReal.symm a = (OrderDual.ofDual a)⁻¹


theorem Equiv.cg_iff {N : Type*} [L.Structure N] (f : M ≃[L] N) :
    Structure.CG L M ↔ Structure.CG L N

{L : FirstOrder.Language}
{M : Type u_1}
[L.Structure M]
{N : Type u_2}
[L.Structure N]
(f : M ≃[L] N)

FirstOrder.Language.Structure.CG L M ↔ FirstOrder.Language.Structure.CG L N


@[to_additive (attr := simp)]
theorem comap_bot (f : G →* N) : (⊥ : Subgroup N).comap f = f.ker

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


/-- `AddHomClass F M N` states that `F` is a type of addition-preserving homomorphisms.
You should declare an instance of this typeclass when you extend `AddHom`.
-/
class AddHomClass (F : Type*) (M N : outParam Type*) [Add M] [Add N] [FunLike F M N] : Prop where
  /-- The proposition that the function preserves addition -/
  map_add : ∀ (f : F) (x y : M), f (x + y) = f x + f y

{F : Type u_10}
{M : outParam (Type u_11)}
{N : outParam (Type u_12)}
[Add M]
[Add N]
[FunLike F M N]
[self : AddHomClass F M N]
(f : F)
(x y : M)


/-- Coercion to a function as a `MonoidHom`. Similar to `MonoidHom.coeFn`. -/
@[to_additive (attr := simps)
  "Coercion to a function as an `AddMonoidHom`. Similar to `AddMonoidHom.coeFn`." ]
def coeFnMonoidHom [Monoid β] [ContinuousMul β] : C(α, β) →* α → β

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
[AddMonoid β]
[ContinuousAdd β]
(f : C(α, β))
(a : α)

ContinuousMap.coeFnAddMonoidHom f a = f a


@[simp]
theorem lTensorOne'_tmul (y : R) (n : N) :
    N.lTensorOne' (algebraMap R _ y ⊗ₜ[R] n) = y • n

{R : Type u}
{S : Type v}
[CommSemiring R]
[Semiring S]
[Algebra R S]
{N : Submodule R S}
(y : R)
(n : ↥N)

N.lTensorOne' ((algebraMap R ↥⊥) y ⊗ₜ[R] n) = y • n


@[simp]
theorem mem_periodicOrbit_iff (hx : x ∈ periodicPts f) :
    y ∈ periodicOrbit f x ↔ ∃ n, f^[n] x = y

{α : Type u_1}
{f : α → α}
{x y : α}
(hx : x ∈ Function.periodicPts f)

y ∈ Function.periodicOrbit f x ↔ ∃ n, f^[n] x = y


lemma IsConj.isReal_comp (h : IsConj φ σ) : IsReal (φ.comp (algebraMap k K))

(h : NumberField.ComplexEmbedding.IsConj φ σ)

NumberField.ComplexEmbedding.IsReal (φ.comp (algebraMap k K))


@[simp] theorem UInt32.toUInt8_toNat (x : UInt32) : x.toUInt8.toNat = x.toNat % 2 ^ 8


theorem compl_bijective : Function.Bijective (compl : α → α)


theorem tendsto_nat_floor_div_atTop : Tendsto (fun x ↦ (⌊x⌋₊ : R) / x) atTop (𝓝 1)

{R : Type u_4}
[TopologicalSpace R]
[LinearOrderedField R]
[OrderTopology R]
[FloorRing R]

Filter.Tendsto (fun x => ↑⌊x⌋₊ / x) Filter.atTop (𝓝 1)


theorem mk_le_mk_iff_left : (a₁, b) ≤ (a₂, b) ↔ a₁ ≤ a₂

{α : Type u_2}
{β : Type u_3}
[Preorder α]
[Preorder β]
{a₁ a₂ : α}
{b : β}


theorem sourceAffineLocally_morphismRestrict {X Y : Scheme.{u}} (f : X ⟶ Y)
    (U : Y.Opens) (hU : IsAffineOpen U) :
    @sourceAffineLocally P _ _ (f ∣_ U) hU ↔
      ∀ (V : X.affineOpens) (e : V.1 ≤ f ⁻¹ᵁ U), P (f.appLE U V e)

(P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop)

AlgebraicGeometry.sourceAffineLocally (fun {R S} [CommRing R] [CommRing S] => P) (f ∣_ U) ↔
  ∀ (V : ↑X.affineOpens) (e : ↑V ≤ f ⁻¹ᵁ U), P (AlgebraicGeometry.Scheme.Hom.appLE f U (↑V) e)


@[to_additive] lemma eq_or_eq_inv_of_mabs_eq (h : |a|ₘ = b) : a = b ∨ a = b⁻¹

{α : Type u_1}
[AddGroup α]
[LinearOrder α]
{a b : α}
(h : |a| = b)


lemma orthogonal_isCompl_coe_submodule (I : LieIdeal K L) (hI : IsAtom I) :
    IsCompl I.toSubmodule (orthogonal Φ hΦ_inv I).toSubmodule

(hΦ_inv : LinearMap.BilinForm.lieInvariant L Φ)

(hL : ∀ (I : LieIdeal K L), IsAtom I → ¬IsLieAbelian ↥↑I)

IsCompl ↑I ↑(LieAlgebra.InvariantForm.orthogonal Φ hΦ_inv I)


/-- See also `Finset.prod_pi_mulSingle'`. -/
@[to_additive "See also `Finset.sum_pi_single'`."]
lemma prod_pi_mulSingle' (i : ι) (a : α) : ∏ j, Pi.mulSingle i a j = a

{ι : Type u_6}
{α : Type u_8}
[Fintype ι]
[CommMonoid α]
[DecidableEq ι]
(i : ι)
(a : α)


/-- If `α` is a natural transformation between left adjoints whose conjugate natural transformation
is an isomorphism, then `α` is an isomorphism. The converse is given in `Conjugate_iso`.
-/
theorem conjugateEquiv_of_iso (α : L₂ ⟶ L₁) [IsIso (conjugateEquiv adj₁ adj₂ α)] :
    IsIso α

[CategoryTheory.IsIso ((CategoryTheory.conjugateEquiv adj₁ adj₂) α)]


@[to_additive]
theorem quasiMeasurePreserving_div_left_of_right_invariant [IsMulRightInvariant μ] (g : G) :
    QuasiMeasurePreserving (fun h : G => g / h) μ μ

{G : Type u_1}
[MeasurableSpace G]
[AddGroup G]
[MeasurableAdd₂ G]
(μ : MeasureTheory.Measure G)
[MeasureTheory.SFinite μ]
[MeasurableNeg G]
[μ.IsAddRightInvariant]
(g : G)

MeasureTheory.Measure.QuasiMeasurePreserving (fun h => g - h) μ μ


theorem Int.alternating_sum_range_choose {n : ℕ} :
    (∑ m ∈ range (n + 1), ((-1) ^ m * ↑(choose n m) : ℤ)) = if n = 0 then 1 else 0

∑ m ∈ Finset.range (n + 1), (-1) ^ m * ↑(n.choose m) = if n = 0 then 1 else 0


@[simp]
theorem coeSubmodule_bot : coeSubmodule S (⊥ : Ideal R) = ⊥

{R : Type u_1}
[CommRing R]
(S : Type u_2)
[CommRing S]
[Algebra R S]


@[simp]
theorem one : IsSymmetric (1 : MvPolynomial σ R)

{σ : Type u_1}
{R : Type u_2}
[CommSemiring R]


theorem laverage_one [IsFiniteMeasure μ] [NeZero μ] : ⨍⁻ _x, (1 : ℝ≥0∞) ∂μ = 1

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[MeasureTheory.IsFiniteMeasure μ]
[NeZero μ]


@[simp]
theorem floor_le_neg_one_iff : ⌊a⌋ ≤ -1 ↔ a < 0

{α : Type u_2}
[LinearOrderedRing α]
[FloorRing α]
{a : α}


/-- When the domain is non-empty, we do not need the `0 ≤ C` condition in the formula for `‖f‖` as a
`sInf`. -/
theorem norm_eq_of_nonempty [h : Nonempty α] : ‖f‖ = sInf { C : ℝ | ∀ x : α, ‖f x‖ ≤ C }

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[SeminormedAddCommGroup β]
(f : BoundedContinuousFunction α β)
[h : Nonempty α]


@[to_additive (attr := simp)]
theorem isLUB_inv : IsLUB s⁻¹ a ↔ IsGLB s a⁻¹

[CovariantClass G G (fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1]

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


@[simp] theorem pwFilter_cons_of_neg [DecidableRel (α := α) R] {a : α} {l : List α}
    (h : ¬∀ b ∈ pwFilter R l, R a b) : pwFilter R (a :: l) = pwFilter R l

(h : ¬∀ (b : α), b ∈ List.pwFilter R l → R a b)

List.pwFilter R (a :: l) = List.pwFilter R l


@[simp]
theorem fourier_zero' {x : AddCircle T} : @toCircle T 0 = (1 : ℂ)


theorem isInteger_one : IsInteger R (1 : S)

{R : Type u_1}
[CommSemiring R]
{S : Type u_2}
[CommSemiring S]
[Algebra R S]


@[simp]
lemma prod_map_neg (l : List M) :
    (l.map Neg.neg).prod = (-1) ^ l.length * l.prod

{M : Type u_3}
[CommMonoid M]
[HasDistribNeg M]
(l : List M)

(List.map Neg.neg l).prod = (-1) ^ l.length * l.prod


theorem blockDiagonal_apply' (M : o → Matrix m n α) (i k j k') :
    blockDiagonal M ⟨i, k⟩ ⟨j, k'⟩ = if k = k' then M k i j else 0

{m : Type u_2}
{n : Type u_3}
{o : Type u_4}
{α : Type u_12}
[DecidableEq o]
[Zero α]
(M : o → Matrix m n α)
(i : m)
(k : o)
(j : n)
(k' : o)

Matrix.blockDiagonal M (i, k) (j, k') = if k = k' then M k i j else 0


/-- If two additive homomorphisms from `Π₀ i, β i` are equal on each `single a b`, then
they are equal.

See note [partially-applied ext lemmas]. -/
@[ext]
theorem addHom_ext' {γ : Type w} [AddZeroClass γ] ⦃f g : (Π₀ i, β i) →+ γ⦄
    (H : ∀ x, f.comp (singleAddHom β x) = g.comp (singleAddHom β x)) : f = g

(H : ∀ (x : ι), f.comp (DFinsupp.singleAddHom β x) = g.comp (DFinsupp.singleAddHom β x))


@[simp] lemma toNat_natCast_add_one {n : ℕ} : ((n : ℤ) + 1).toNat = n + 1


/-- Subtracting the `orthogonalProjection` from `p` produces a result
in the orthogonal direction. -/
theorem vsub_orthogonalProjection_mem_direction_orthogonal (s : AffineSubspace ℝ P) [Nonempty s]
    [HasOrthogonalProjection s.direction] (p : P) : p -ᵥ orthogonalProjection s p ∈ s.directionᗮ

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
(s : AffineSubspace ℝ P)
[Nonempty ↥s]
[HasOrthogonalProjection s.direction]
(p : P)

p -ᵥ ↑((EuclideanGeometry.orthogonalProjection s) p) ∈ s.directionᗮ


theorem addOrderOf_period_div {n : ℕ} (h : 0 < n) : addOrderOf ((p / n : 𝕜) : AddCircle p) = n

{𝕜 : Type u_1}
[LinearOrderedField 𝕜]
{p : 𝕜}
[hp : Fact (0 < p)]
{n : ℕ}
(h : 0 < n)


/-- An injective homomorphism of monoids preserves orders of elements. -/
@[to_additive "An injective homomorphism of additive monoids preserves orders of elements."]
theorem orderOf_injective {H : Type*} [Monoid H] (f : G →* H) (hf : Function.Injective f) (x : G) :
    orderOf (f x) = orderOf x

{G : Type u_1}
[AddMonoid G]
{H : Type u_6}
[AddMonoid H]
(f : G →+ H)
(hf : Function.Injective ⇑f)
(x : G)


@[to_additive (attr := simp)]
theorem le_one_iff : f ≤ 1 ↔ (1 : Set α) ∈ f


theorem smul_compLpL [Fact (1 ≤ p)] {𝕜'} [NormedRing 𝕜'] [Module 𝕜' F] [BoundedSMul 𝕜' F]
    [SMulCommClass 𝕜 𝕜' F] (c : 𝕜') (L : E →L[𝕜] F) : (c • L).compLpL p μ = c • L.compLpL p μ

{α : Type u_1}
{E : Type u_2}
{F : Type u_3}
{m0 : MeasurableSpace α}
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup E]
[NormedAddCommGroup F]
{𝕜 : Type u_5}
[NontriviallyNormedField 𝕜]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜 F]
[Fact (1 ≤ p)]
{𝕜' : Type u_6}
[NormedRing 𝕜']
[Module 𝕜' F]
[BoundedSMul 𝕜' F]
[SMulCommClass 𝕜 𝕜' F]
(c : 𝕜')
(L : E →L[𝕜] F)

ContinuousLinearMap.compLpL p μ (c • L) = c • ContinuousLinearMap.compLpL p μ L


theorem SetLike.homogeneous_one [Zero ι] [One R] (A : ι → S) [SetLike.GradedOne A] :
    SetLike.Homogeneous A (1 : R)

{ι : Type u_1}
{R : Type u_2}
{S : Type u_3}
[SetLike S R]
[Zero ι]
[One R]
(A : ι → S)
[SetLike.GradedOne A]


theorem _root_.totallyBounded_Ioc (a b : α) : TotallyBounded (Ioc a b)

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


/-- The spectrum of a commutative ring, as a `LocallyRingedSpace`.
-/
@[simps! toSheafedSpace presheaf]
def Spec.locallyRingedSpaceObj (R : CommRingCat.{u}) : LocallyRingedSpace

(AlgebraicGeometry.Spec.locallyRingedSpaceObj R).presheaf = (AlgebraicGeometry.Spec.structureSheaf ↑R).val


theorem mapsTo_sphere (hf : Isometry f) (x : α) (r : ℝ) :
    MapsTo f (Metric.sphere x r) (Metric.sphere (f x) r)

{α : Type u}
{β : Type v}
[PseudoMetricSpace α]
[PseudoMetricSpace β]
{f : α → β}
(hf : Isometry f)
(x : α)
(r : ℝ)

Set.MapsTo f (Metric.sphere x r) (Metric.sphere (f x) r)


@[deprecated (since := "2023-08-23")]
theorem count_cons' (a b : α) (l : List α) :
    count a (b :: l) = count a l + if a = b then 1 else 0

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

List.count a (b :: l) = List.count a l + if a = b then 1 else 0


/-- If `φ : S₁ ⟶ S₂` is a morphism of short complexes such that `φ.τ₁` is epi, `φ.τ₂` is an iso
and `φ.τ₃` is mono, then a homology data for `S₁` induces a homology data for `S₂`.
The inverse construction is `ofEpiOfIsIsoOfMono'`. -/
@[simps]
noncomputable def ofEpiOfIsIsoOfMono (φ : S₁ ⟶ S₂) (h : HomologyData S₁)
    [Epi φ.τ₁] [IsIso φ.τ₂] [Mono φ.τ₃] : HomologyData S₂

(CategoryTheory.ShortComplex.HomologyData.ofEpiOfIsIsoOfMono φ h).iso = h.iso


theorem toJordanDecomposition_eq_of_eq_add_withDensity {f : α → ℝ} (hf : Measurable f)
    (hfi : Integrable f μ) (htμ : t ⟂ᵥ μ.toENNRealVectorMeasure) (hadd : s = t + μ.withDensityᵥ f) :
    s.toJordanDecomposition =
      @JordanDecomposition.mk α _
        (t.toJordanDecomposition.posPart + μ.withDensity fun x => ENNReal.ofReal (f x))
        (t.toJordanDecomposition.negPart + μ.withDensity fun x => ENNReal.ofReal (-f x))
        (by haveI := isFiniteMeasure_withDensity_ofReal hfi.2; infer_instance)
        (by haveI := isFiniteMeasure_withDensity_ofReal hfi.neg.2; infer_instance)
        (jordanDecomposition_add_withDensity_mutuallySingular hf htμ)

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s t : MeasureTheory.SignedMeasure α}
{f : α → ℝ}
(hf : Measurable f)
(hfi : MeasureTheory.Integrable f μ)
(htμ : t ⟂ᵥ μ.toENNRealVectorMeasure)
(hadd : s = t + μ.withDensityᵥ f)

s.toJordanDecomposition =
  MeasureTheory.JordanDecomposition.mk (t.toJordanDecomposition.posPart + μ.withDensity fun x => ENNReal.ofReal (f x))
    (t.toJordanDecomposition.negPart + μ.withDensity fun x => ENNReal.ofReal (-f x)) ⋯


/-- A version of `padicValRat.pow` for `padicValNat`. -/
protected theorem pow (n : ℕ) (ha : a ≠ 0) : padicValNat p (a ^ n) = n * padicValNat p a

{p a : ℕ}
[hp : Fact (Nat.Prime p)]
(n : ℕ)
(ha : a ≠ 0)


theorem le_comap_apply {β} [MeasurableSpace α] {mβ : MeasurableSpace β} (f : α → β) (μ : Measure β)
    (hfi : Injective f) (hf : ∀ s, MeasurableSet s → NullMeasurableSet (f '' s) μ) (s : Set α) :
    μ (f '' s) ≤ comap f μ s

(hf : ∀ (s : Set α), MeasurableSet s → MeasureTheory.NullMeasurableSet (f '' s) μ)

μ (f '' s) ≤ (MeasureTheory.Measure.comap f μ) s


theorem ae_restrict_eq_bot {s} : ae (μ.restrict s) = ⊥ ↔ μ s = 0

{α : Type u_2}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s : Set α}

MeasureTheory.ae (μ.restrict s) = ⊥ ↔ μ s = 0


theorem upperSemicontinuous_sum {f : ι → α → γ} {a : Finset ι}
    (ha : ∀ i ∈ a, UpperSemicontinuous (f i)) : UpperSemicontinuous fun z => ∑ i ∈ a, f i z

{f : ι → α → γ}


theorem eq_empty (x : ZFSet.{u}) : x = ∅ ↔ ∀ y : ZFSet.{u}, y ∉ x


theorem contMDiffAt_pi_space :
    ContMDiffAt I 𝓘(𝕜, ∀ i, Fi i) n φ x ↔ ∀ i, ContMDiffAt I 𝓘(𝕜, Fi i) n (fun x => φ x i) x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{x : M}
{n : ℕ∞}
{ι : Type u_21}
[Fintype ι]
{Fi : ι → Type u_22}
[(i : ι) → NormedAddCommGroup (Fi i)]
[(i : ι) → NormedSpace 𝕜 (Fi i)]
{φ : M → (i : ι) → Fi i}

ContMDiffAt I 𝓘(𝕜, (i : ι) → Fi i) n φ x ↔ ∀ (i : ι), ContMDiffAt I 𝓘(𝕜, Fi i) n (fun x => φ x i) x


@[to_additive]
theorem measure_smul_eq_zero_iff {s} (c : G) : μ (c • s) = 0 ↔ μ s = 0

[MeasureTheory.VAddInvariantMeasure G α μ]


/-- The equivalence between `C` and `AsSmall C`. -/
@[simps]
def AsSmall.equiv : C ≌ AsSmall C

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]


theorem Zigzag.of_hom {j₁ j₂ : J} (f : j₁ ⟶ j₂) : Zigzag j₁ j₂

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{j₁ j₂ : J}
(f : j₁ ⟶ j₂)


@[simp]
theorem nextCoeffUp_C_eq_zero (c : R) : nextCoeffUp (C c) = 0


theorem all_eq {l : List α} : l.all p = decide (∀ x, x ∈ l →  p x)

{α : Type u_1}
{p : α → Bool}
{l : List α}

l.all p = decide (∀ (x : α), x ∈ l → p x = true)


@[measurability, fun_prop]
theorem Measurable.infNndist {f : β → α} (hf : Measurable f) {s : Set α} :
    Measurable fun x => infNndist (f x) s

{α : Type u_1}
{β : Type u_2}
[PseudoMetricSpace α]
[MeasurableSpace α]
[OpensMeasurableSpace α]
[MeasurableSpace β]
{f : β → α}
(hf : Measurable f)
{s : Set α}

Measurable fun x => Metric.infNndist (f x) s


theorem reflection_mem_subspace_eq_self {x : E} (hx : x ∈ K) : reflection K x = x

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{K : Submodule 𝕜 E}
[HasOrthogonalProjection K]
{x : E}
(hx : x ∈ K)


/-- If `f : ℕ → M` has product `m`, then the partial products `∏ i ∈ range n, f i` converge
to `m`. -/
@[to_additive "If `f : ℕ → M` has sum `m`, then the partial sums `∑ i ∈ range n, f i` converge
to `m`."]
theorem tendsto_prod_nat {f : ℕ → M} (h : HasProd f m) :
    Tendsto (fun n ↦ ∏ i ∈ range n, f i) atTop (𝓝 m)

{M : Type u_1}
[CommMonoid M]
[TopologicalSpace M]
{m : M}
{f : ℕ → M}
(h : HasProd f m)

Filter.Tendsto (fun n => ∏ i ∈ Finset.range n, f i) Filter.atTop (𝓝 m)


theorem iSup_mul {ι : Sort v} (l : ι → Language α) (m : Language α) :
    (⨆ i, l i) * m = ⨆ i, l i * m

{α : Type u_1}
{ι : Sort v}
(l : ι → Language α)
(m : Language α)


/-- If `f : α → E` is a function such that `norm ∘ f` has a local maximum at a point `c`, then the
function `fun x => ‖f x + f c‖` has a local maximum at `c`. -/
theorem IsLocalMax.norm_add_self (h : IsLocalMax (norm ∘ f) c) :
    IsLocalMax (fun x => ‖f x + f c‖) c

{X : Type u_2}
{E : Type u_3}
[SeminormedAddCommGroup E]
[NormedSpace ℝ E]
[TopologicalSpace X]
{f : X → E}
{c : X}
(h : IsLocalMax (norm ∘ f) c)


theorem indep_bot_right [IsProbabilityMeasure μ] : Indep m' ⊥ μ

{Ω : Type u_1}
(m' : MeasurableSpace Ω)
{_mΩ : MeasurableSpace Ω}
{μ : MeasureTheory.Measure Ω}
[MeasureTheory.IsProbabilityMeasure μ]


@[simp]
theorem coe_two_pi : ↑(2 * π : ℝ) = (0 : Angle)


private theorem pairMap_mem_pairs {k : ℕ} (t : Finset σ × σ) (h : t ∈ pairs σ k) :
    pairMap σ t ∈ pairs σ k

(h : t ∈ MvPolynomial.NewtonIdentities.pairs σ k)

MvPolynomial.NewtonIdentities.pairMap σ t ∈ MvPolynomial.NewtonIdentities.pairs σ k


theorem subtype_apply (x : S) : S.subtype x = (x : A)

{R : Type u_2}
{A : Type u_3}
[CommSemiring R]
[StarRing R]
[Semiring A]
[StarRing A]
[Algebra R A]
[StarModule R A]
(S : StarSubalgebra R A)
(x : ↥S)


theorem mem_of_formPerm_apply_mem (h : l.formPerm x ∈ l) : x ∈ l

{α : Type u_1}
[DecidableEq α]
{l : List α}
{x : α}
(h : l.formPerm x ∈ l)


theorem comp_apply (hnp : β →+* γ) (hmn : α →+* β) (x : α) :
    (hnp.comp hmn : α → γ) x = hnp (hmn x)

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}

∀ {x : NonAssocSemiring α} {x_1 : NonAssocSemiring β} {x_2 : NonAssocSemiring γ} (hnp : β →+* γ) (hmn : α →+* β)
  (x_3 : α), (hnp.comp hmn) x_3 = hnp (hmn x_3)


theorem coeFn_compLpL [Fact (1 ≤ p)] (L : E →L[𝕜] F) (f : Lp E p μ) :
    L.compLpL p μ f =ᵐ[μ] fun a => L (f a)

{α : Type u_1}
{E : Type u_2}
{F : Type u_3}
{m0 : MeasurableSpace α}
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup E]
[NormedAddCommGroup F]
{𝕜 : Type u_5}
[NontriviallyNormedField 𝕜]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜 F]
[Fact (1 ≤ p)]
(L : E →L[𝕜] F)
(f : ↥(MeasureTheory.Lp E p μ))

↑↑((ContinuousLinearMap.compLpL p μ L) f) =ᵐ[μ] fun a => L (↑↑f a)


@[simp]
theorem lift_natCast : ∀ n : ℕ, lift.{u, v} n = n


lemma min_pow_dvd_add (ha : c ^ m ∣ a) (hb : c ^ n ∣ b) : c ^ min m n ∣ a + b

{α : Type u_1}
[Semiring α]
{a b c : α}
{m n : ℕ}
(ha : c ^ m ∣ a)
(hb : c ^ n ∣ b)


theorem image_cast_int_Iic (a : ℕ) : (↑) '' Iic a = Icc (0 : ℤ) a


theorem two_mul_card_alternatingGroup [Nontrivial α] :
    2 * card (alternatingGroup α) = card (Perm α)

{α : Type u_1}
[Fintype α]
[DecidableEq α]
[Nontrivial α]

2 * Fintype.card ↥(alternatingGroup α) = Fintype.card (Equiv.Perm α)


/-- If a topological group embeds into a nonarchimedean group, then it is nonarchimedean. -/
@[to_additive]
theorem nonarchimedean_of_emb (f : G →* H) (emb : OpenEmbedding f) : NonarchimedeanGroup H

{G : Type u_1}
[Group G]
[TopologicalSpace G]
[NonarchimedeanGroup G]
{H : Type u_2}
[Group H]
[TopologicalSpace H]
[TopologicalGroup H]
(f : G →* H)
(emb : OpenEmbedding ⇑f)


@[to_additive]
theorem mul_left_injective (a : G) : Function.Injective (· * a)

{G : Type u_3}
[Add G]
[IsRightCancelAdd G]
(a : G)


theorem fderivWithin_congr_set' (y : E) (h : s =ᶠ[𝓝[{y}ᶜ] x] t) :
    fderivWithin 𝕜 f s x = fderivWithin 𝕜 f t x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{x : E}
{s t : Set E}
(y : E)
(h : s =ᶠ[𝓝[{y}ᶜ] x] t)


private theorem average_density_near_total_density [Nonempty α]
    (hPα : P.parts.card * 16 ^ P.parts.card ≤ card α) (hPε : ↑100 ≤ ↑4 ^ P.parts.card * ε ^ 5)
    (hε₁ : ε ≤ 1) {hU : U ∈ P.parts} {hV : V ∈ P.parts} {A B : Finset (Finset α)}
    (hA : A ⊆ (chunk hP G ε hU).parts) (hB : B ⊆ (chunk hP G ε hV).parts) :
    |(∑ ab ∈ A.product B, G.edgeDensity ab.1 ab.2 : ℝ) / (A.card * B.card) -
      G.edgeDensity (A.biUnion id) (B.biUnion id)| ≤ ε ^ 5 / 49

(hPα : P.parts.card * 16 ^ P.parts.card ≤ Fintype.card α)

(hA : A ⊆ (SzemerediRegularity.chunk hP G ε hU).parts)

(hB : B ⊆ (SzemerediRegularity.chunk hP G ε hV).parts)

|(∑ ab ∈ A.product B, ↑(G.edgeDensity ab.1 ab.2)) / (↑A.card * ↑B.card) -
      ↑(G.edgeDensity (A.biUnion id) (B.biUnion id))| ≤
  ε ^ 5 / 49


/-- The Galois insertion associated to a closure operator can be used to reconstruct the closure
operator.
Note that the inverse in the opposite direction does not hold in general. -/
@[simp]
theorem closureOperator_gi_self [PartialOrder α] (c : ClosureOperator α) :
    c.gi.gc.closureOperator = c

{α : Type u_1}
[PartialOrder α]
(c : ClosureOperator α)


theorem lowerSemicontinuousOn_biSup {p : ι → Prop} {f : ∀ i, p i → α → δ}
    (h : ∀ i hi, LowerSemicontinuousOn (f i hi) s) :
    LowerSemicontinuousOn (fun x' => ⨆ (i) (hi), f i hi x') s

(h : ∀ (i : ι) (hi : p i), LowerSemicontinuousOn (f i hi) s)

LowerSemicontinuousOn (fun x' => ⨆ i, ⨆ (hi : p i), f i hi x') s


theorem prod_eq_sup_map (p : Submodule R M) (q : Submodule R M₂) :
    p.prod q = p.map (LinearMap.inl R M M₂) ⊔ q.map (LinearMap.inr R M M₂)

{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₂)

p.prod q = Submodule.map (LinearMap.inl R M M₂) p ⊔ Submodule.map (LinearMap.inr R M M₂) q


theorem comp {g : B →+* C} {f : A →+* B} (hg : g.Finite) (hf : f.Finite) : (g.comp f).Finite

{A : Type u_1}
{B : Type u_2}
{C : Type u_3}
[CommRing A]
[CommRing B]
[CommRing C]
{g : B →+* C}
{f : A →+* B}
(hg : g.Finite)
(hf : f.Finite)


@[simp]
theorem mk_one (h : (1 : α) ∈ Icc (0 : α) 1) : (⟨1, h⟩ : Icc (0 : α) 1) = 1

{α : Type u_1}
[OrderedSemiring α]
(h : 1 ∈ Set.Icc 0 1)


theorem get_finRange {n : ℕ} {i : ℕ} (h) :
    (finRange n).get ⟨i, h⟩ = ⟨i, length_finRange n ▸ h⟩

{n i : ℕ}
(h : i < (List.finRange n).length)


theorem conj_mul (z : K) : conj z * z = ‖z‖ ^ 2


theorem linearProjOfIsCompl_comp_subtype (h : IsCompl p q) :
    (linearProjOfIsCompl p q h).comp p.subtype = LinearMap.id

{R : Type u_1}
[Ring R]
{E : Type u_2}
[AddCommGroup E]
[Module R E]
{p q : Submodule R E}
(h : IsCompl p q)

p.linearProjOfIsCompl q h ∘ₗ p.subtype = LinearMap.id


theorem gcd_dvd (a b : R) : gcd a b ∣ a ∧ gcd a b ∣ b

{R : Type u}
[EuclideanDomain R]
[DecidableEq R]
(a b : R)

EuclideanDomain.gcd a b ∣ a ∧ EuclideanDomain.gcd a b ∣ b


/-- Bisimulation is the standard proof technique for equality between
infinite tree-like structures -/
structure IsBisimulation : Prop where
  /-- The head of the trees are equal -/
  head : ∀ {a a'} {f f'}, M.mk ⟨a, f⟩ ~ M.mk ⟨a', f'⟩ → a = a'
  /-- The tails are equal -/
  tail : ∀ {a} {f f' : F.B a → M F}, M.mk ⟨a, f⟩ ~ M.mk ⟨a, f'⟩ → ∀ i : F.B a, f i ~ f' i

{F : PFunctor.{u}}
{R : F.M → F.M → Prop}
(self : PFunctor.M.IsBisimulation R)
{a a' : F.A}
{f : F.B a → F.M}
{f' : F.B a' → F.M}

R (PFunctor.M.mk ⟨a, f⟩) (PFunctor.M.mk ⟨a', f'⟩) → a = a'


/-- A family of equivalences between preimages of points gives an equivalence between domains. -/
@[simps!]
def ofPreimageEquiv {α β γ} {f : α → γ} {g : β → γ} (e : ∀ c, f ⁻¹' {c} ≃ g ⁻¹' {c}) : α ≃ β

∀ (a : α), (Equiv.ofPreimageEquiv e) a = ↑((e (f a)) ((Equiv.sigmaFiberEquiv f).symm a).snd)


/-- The residue of `completedHurwitzZetaEven a s` at `s = 0` is equal to `-1` if `a = 0`, and `0`
otherwise. -/
lemma completedHurwitzZetaEven_residue_zero (a : UnitAddCircle) :
    Tendsto (fun s ↦ s * completedHurwitzZetaEven a s) (𝓝[≠] 0) (𝓝 (if a = 0 then -1 else 0))

Filter.Tendsto (fun s => s * HurwitzZeta.completedHurwitzZetaEven a s) (𝓝[≠] 0) (𝓝 (if a = 0 then -1 else 0))


theorem reesAlgebra.fg (hI : I.FG) : (reesAlgebra I).FG

{R : Type u}
[CommRing R]
{I : Ideal R}
(hI : I.FG)


@[simp] lemma lowerBounds_infClosure (s : Set α) : lowerBounds (infClosure s) = lowerBounds s

{α : Type u_2}
[SemilatticeInf α]
(s : Set α)


theorem sInter_prod_sInter {S : Set (Set α)} {T : Set (Set β)} (hS : S.Nonempty) (hT : T.Nonempty) :
    ⋂₀ S ×ˢ ⋂₀ T = ⋂ r ∈ S ×ˢ T, r.1 ×ˢ r.2

{α : Type u_1}
{β : Type u_2}
{S : Set (Set α)}
{T : Set (Set β)}
(hS : S.Nonempty)
(hT : T.Nonempty)


@[simp]
theorem mem_neighborSet (v w : V) : w ∈ G.neighborSet v ↔ G.Adj v w

{V : Type u}
(G : SimpleGraph V)
(v w : V)


theorem norm_neg (a : PadicSeq p) : (-a).norm = a.norm

{p : ℕ}
[hp : Fact (Nat.Prime p)]
(a : PadicSeq p)


lemma natAbs_add_of_nonneg : ∀ {a b : Int}, 0 ≤ a → 0 ≤ b → natAbs (a + b) = natAbs a + natAbs b

0 ≤ a → 0 ≤ b → (a + b).natAbs = a.natAbs + b.natAbs


theorem Perm.subperm_right {l₁ l₂ l : List α} (p : l₁ ~ l₂) : l₁ <+~ l ↔ l₂ <+~ l

{α : Type u_1}
{l₁ l₂ l : List α}
(p : l₁ ~ l₂)


theorem IsLinearOrder.swap (r) [IsLinearOrder α r] : IsLinearOrder α (swap r)

{α : Type u}
(r : α → α → Prop)
[IsLinearOrder α r]


@[simp]
theorem _root_.LinearIsometry.toSpanSingleton_apply {v : E} (hv : ‖v‖ = 1) (a : 𝕜) :
    LinearIsometry.toSpanSingleton 𝕜 E hv a = a • v

{𝕜 : Type u_1}
{E : Type u_4}
[SeminormedAddCommGroup E]
[NontriviallyNormedField 𝕜]
[NormedSpace 𝕜 E]
{v : E}
(hv : ‖v‖ = 1)
(a : 𝕜)

(LinearIsometry.toSpanSingleton 𝕜 E hv) a = a • v


@[simp] lemma mem_mk (h_sup h_inf) : a ∈ mk s h_sup h_inf ↔ a ∈ s

{α : Type u_2}
[Lattice α]
{s : Set α}
{a : α}
(h_sup : SupClosed s)
(h_inf : InfClosed s)

a ∈ { carrier := s, supClosed' := h_sup, infClosed' := h_inf } ↔ a ∈ s


/-- Differentiation under integral of `x ↦ ∫ x in a..b, F x t` at a given point `x₀ ∈ (a,b)`,
assuming `F x₀` is integrable on `(a,b)`, that `x ↦ F x t` is Lipschitz on a ball around `x₀`
for almost every `t` (with a ball radius independent of `t`) with integrable Lipschitz bound,
and `F x` is a.e.-measurable for `x` in a possibly smaller neighborhood of `x₀`. -/
theorem hasFDerivAt_integral_of_dominated_loc_of_lip_interval [NormedSpace ℝ H] {μ : Measure ℝ}
    {F : H → ℝ → E} {F' : ℝ → H →L[ℝ] E} {a b : ℝ} {bound : ℝ → ℝ} (ε_pos : 0 < ε)
    (hF_meas : ∀ᶠ x in 𝓝 x₀, AEStronglyMeasurable (F x) <| μ.restrict (Ι a b))
    (hF_int : IntervalIntegrable (F x₀) μ a b)
    (hF'_meas : AEStronglyMeasurable F' <| μ.restrict (Ι a b))
    (h_lip : ∀ᵐ t ∂μ.restrict (Ι a b),
      LipschitzOnWith (Real.nnabs <| bound t) (F · t) (ball x₀ ε))
    (bound_integrable : IntervalIntegrable bound μ a b)
    (h_diff : ∀ᵐ t ∂μ.restrict (Ι a b), HasFDerivAt (F · t) (F' t) x₀) :
    IntervalIntegrable F' μ a b ∧
      HasFDerivAt (fun x ↦ ∫ t in a..b, F x t ∂μ) (∫ t in a..b, F' t ∂μ) x₀

(hF_meas : ∀ᶠ (x : H) in 𝓝 x₀, MeasureTheory.AEStronglyMeasurable (F x) (μ.restrict (Ι a b)))

(hF'_meas : MeasureTheory.AEStronglyMeasurable F' (μ.restrict (Ι a b)))

(h_lip : ∀ᵐ (t : ℝ) ∂μ.restrict (Ι a b), LipschitzOnWith (Real.nnabs (bound t)) (fun x => F x t) (Metric.ball x₀ ε))

(h_diff : ∀ᵐ (t : ℝ) ∂μ.restrict (Ι a b), HasFDerivAt (fun x => F x t) (F' t) x₀)

IntervalIntegrable F' μ a b ∧ HasFDerivAt (fun x => ∫ (t : ℝ) in a..b, F x t ∂μ) (∫ (t : ℝ) in a..b, F' t ∂μ) x₀


@[simp]
theorem pointwise_smul_le_pointwise_smul_iff₀ {a : α} (ha : a ≠ 0) {S T : AddSubmonoid A} :
    a • S ≤ a • T ↔ S ≤ T

{α : Type u_1}
{A : Type u_5}
[AddMonoid A]
[GroupWithZero α]
[DistribMulAction α A]
{a : α}
(ha : a ≠ 0)
{S T : AddSubmonoid A}


theorem IsRelPrime.mul_dvd (H : IsRelPrime x y) (H1 : x ∣ z) (H2 : y ∣ z) : x * y ∣ z

{α : Type u_1}
[CommMonoid α]
{x y z : α}
[DecompositionMonoid α]
(H : IsRelPrime x y)
(H1 : x ∣ z)
(H2 : y ∣ z)


@[measurability]
theorem aemeasurable_id' : AEMeasurable (fun x => x) μ

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}


/-- Given any `S : Solution`, there is another `S₁ : Solution` such that
  `S₁.multiplicity < S.multiplicity` -/
theorem exists_Solution_multiplicity_lt :
    ∃ S₁ : Solution hζ, S₁.multiplicity < S.multiplicity

(S : FermatLastTheoremForThreeGen.Solution hζ)


lemma addNSMul_eq_right [Archimedean α] (hδ : 0 < δ) :
    ∃ m, ∀ n ≥ m, addNSMul h δ n = b

{α : Type u_1}
[LinearOrderedAddCommGroup α]
{a b : α}
(h : a ≤ b)
{δ : α}
[Archimedean α]
(hδ : 0 < δ)

∃ m, ∀ n ≥ m, ↑(Set.Icc.addNSMul h δ n) = b


/-- The duality equivalence `(WidePushoutShape J)ᵒᵖ ≌ WidePullbackShape J` -/
@[simps]
def widePushoutShapeOpEquiv : (WidePushoutShape J)ᵒᵖ ≌ WidePullbackShape J

(CategoryTheory.Limits.widePushoutShapeOpEquiv J).inverse = CategoryTheory.Limits.widePullbackShapeOp J


@[to_additive (attr := simp)]
theorem map_id : map (MonoidHom.id M) = MonoidHom.id Mˣ

AddUnits.map (AddMonoidHom.id M) = AddMonoidHom.id (AddUnits M)


theorem refl [IsRefl α r] (a : α) : a ≺ a

{α : Sort u}
{r : α → α → Prop}
[IsRefl α r]
(a : α)


/-- `PseudoEpimorphismClass F α β` states that `F` is a type of `⊔`-preserving morphisms.

You should extend this class when you extend `PseudoEpimorphism`. -/
class PseudoEpimorphismClass (F : Type*) (α β : outParam Type*)
    [Preorder α] [Preorder β] [FunLike F α β]
    extends RelHomClass F ((· ≤ ·) : α → α → Prop) ((· ≤ ·) : β → β → Prop) : Prop where
  exists_map_eq_of_map_le (f : F) ⦃a : α⦄ ⦃b : β⦄ : f a ≤ b → ∃ c, a ≤ c ∧ f c = b

{F : Type u_6}
{α : outParam (Type u_7)}
{β : outParam (Type u_8)}
[Preorder α]
[Preorder β]
[FunLike F α β]
[self : PseudoEpimorphismClass F α β]
(f : F)
⦃a : α⦄
⦃b : β⦄


@[reassoc]
lemma XIsoOfEq_inv_naturality {K L : HomologicalComplex V c} (φ : K ⟶ L) {n n' : ι} (h : n = n') :
    φ.f n' ≫ (L.XIsoOfEq h).inv = (K.XIsoOfEq h).inv ≫ φ.f n


@[simp]
lemma coeff_Ψ₂Sq : W.Ψ₂Sq.coeff 3 = 4

{R : Type u}
[CommRing R]
(W : WeierstrassCurve R)


theorem bddBelow_iff_subset_Ici : BddBelow s ↔ ∃ a, s ⊆ Ici a


lemma sqrt_le_sqrt (h : m ≤ n) : sqrt m ≤ sqrt n


/-- If `f` has derivative `f'` within `s` at `x`, then for any `r > ‖f'‖` the ratio
`(‖f z‖ - ‖f x‖) / ‖z - x‖` is less than `r` in some neighborhood of `x` within `s`.
In other words, the limit superior of this ratio as `z` tends to `x` along `s`
is less than or equal to `‖f'‖`.

This lemma is a weaker version of `HasDerivWithinAt.limsup_norm_slope_le`
where `‖f z‖ - ‖f x‖` is replaced by `‖f z - f x‖`. -/
theorem HasDerivWithinAt.limsup_slope_norm_le (hf : HasDerivWithinAt f f' s x) (hr : ‖f'‖ < r) :
    ∀ᶠ z in 𝓝[s] x, ‖z - x‖⁻¹ * (‖f z‖ - ‖f x‖) < r

{E : Type u}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : ℝ → E}
{f' : E}
{s : Set ℝ}
{x r : ℝ}
(hf : HasDerivWithinAt f f' s x)
(hr : ‖f'‖ < r)

∀ᶠ (z : ℝ) in 𝓝[s] x, ‖z - x‖⁻¹ * (‖f z‖ - ‖f x‖) < r


protected theorem norm_eq_zero_iff {x : E K} :
    mixedEmbedding.norm x = 0 ↔ ∃ w, normAtPlace w x = 0

{x : ({ w // w.IsReal } → ℝ) × ({ w // w.IsComplex } → ℂ)}

NumberField.mixedEmbedding.norm x = 0 ↔ ∃ w, (NumberField.mixedEmbedding.normAtPlace w) x = 0


theorem extract (h₁ : ValidFor l (m ++ r) it₁) (h₂ : ValidFor (m.reverse ++ l) r it₂) :
    it₁.extract it₂ = ⟨m⟩

(h₁ : String.Iterator.ValidFor l (m ++ r) it₁)

(h₂ : String.Iterator.ValidFor (m.reverse ++ l) r it₂)


@[simp]
theorem component.lof_self (i : ι) (b : M i) : component R ι M i ((lof R ι M i) b) = b

(R : Type u)
[Semiring R]
{ι : Type v}
[dec_ι : DecidableEq ι]
{M : ι → Type w}
[(i : ι) → AddCommMonoid (M i)]
[(i : ι) → Module R (M i)]
(i : ι)
(b : M i)

(DirectSum.component R ι M i) ((DirectSum.lof R ι M i) b) = b


@[simp]
theorem iSup_eq_zero {ι : Sort*} {f : ι → ℝ≥0∞} : ⨆ i, f i = 0 ↔ ∀ i, f i = 0


@[simp, mfld_simps]
theorem ofSet_target (s : Set α) : (PartialEquiv.ofSet s).target = s


theorem starClosure_le {S₁ : Subalgebra R A} {S₂ : StarSubalgebra R A} (h : S₁ ≤ S₂.toSubalgebra) :
    S₁.starClosure ≤ S₂

{R : Type u_2}
{A : Type u_3}
[CommSemiring R]
[StarRing R]
[Semiring A]
[Algebra R A]
[StarRing A]
[StarModule R A]
{S₁ : Subalgebra R A}
{S₂ : StarSubalgebra R A}
(h : S₁ ≤ S₂.toSubalgebra)


@[to_additive]
theorem image_mulSingle_uIcc (i : ι) (a b : α i) :
    Pi.mulSingle i '' uIcc a b = uIcc (Pi.mulSingle i a) (Pi.mulSingle i b)

{ι : Type u_1}
{α : ι → Type u_2}
[(i : ι) → Lattice (α i)]
[DecidableEq ι]
[(i : ι) → Zero (α i)]
(i : ι)
(a b : α i)

Pi.single i '' Set.uIcc a b = Set.uIcc (Pi.single i a) (Pi.single i b)


@[simp]
theorem toPGame_moveLeft' {o : Ordinal} (i) :
    o.toPGame.moveLeft i = (toLeftMovesToPGame.symm i).val.toPGame

{o : Ordinal.{u_1}}
(i : o.toPGame.LeftMoves)

o.toPGame.moveLeft i = (↑(Ordinal.toLeftMovesToPGame.symm i)).toPGame


lemma injOn_iff_surjOn {p : Submodule K V} [FiniteDimensional K p]
    {f : V →ₗ[K] V} (h : ∀ x ∈ p, f x ∈ p) :
    Set.InjOn f p ↔ Set.SurjOn f p p

{K : Type u}
{V : Type v}
[DivisionRing K]
[AddCommGroup V]
[Module K V]
{p : Submodule K V}
[FiniteDimensional K ↥p]
{f : V →ₗ[K] V}
(h : ∀ x ∈ p, f x ∈ p)


theorem integral_cos_sq_sub_sin_sq :
    ∫ x in a..b, cos x ^ 2 - sin x ^ 2 = sin b * cos b - sin a * cos a

∫ (x : ℝ) in a..b, Real.cos x ^ 2 - Real.sin x ^ 2 = Real.sin b * Real.cos b - Real.sin a * Real.cos a


lemma cpow_ofReal (x : ℂ) (y : ℝ) :
    x ^ (y : ℂ) = ↑(abs x ^ y) * (Real.cos (arg x * y) + Real.sin (arg x * y) * I)

x ^ ↑y = ↑(Complex.abs x ^ y) * (↑(Real.cos (x.arg * y)) + ↑(Real.sin (x.arg * y)) * Complex.I)


lemma pullback.condition {X Y Z : Stonean.{u}} (f : X ⟶ Z) {i : Y ⟶ Z}
    (hi : OpenEmbedding i) : pullback.fst f hi ≫ f = pullback.snd f hi ≫ i

{X Y Z : Stonean}
(f : X ⟶ Z)
{i : Y ⟶ Z}
(hi : OpenEmbedding ⇑i)

Stonean.pullback.fst f hi ≫ f = Stonean.pullback.snd f hi ≫ i


theorem uniformContinuous_iInf_dom {f : α → β} {u₁ : ι → UniformSpace α} {u₂ : UniformSpace β}
    {i : ι} (hf : UniformContinuous[u₁ i, u₂] f) : UniformContinuous[iInf u₁, u₂] f

{α : Type ua}
{β : Type ub}
{ι : Sort u_1}
{f : α → β}
{u₁ : ι → UniformSpace α}
{u₂ : UniformSpace β}
{i : ι}
(hf : UniformContinuous f)


theorem MDifferentiable.add (hf : MDifferentiable I 𝓘(𝕜, E') f)
    (hg : MDifferentiable I 𝓘(𝕜, E') g) : MDifferentiable I 𝓘(𝕜, E') (f + g)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
[SmoothManifoldWithCorners I M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{f g : M → E'}
(hf : MDifferentiable I 𝓘(𝕜, E') f)
(hg : MDifferentiable I 𝓘(𝕜, E') g)


theorem compProd_apply (κ : Kernel α β) [IsSFiniteKernel κ] (η : Kernel (α × β) γ)
    [IsSFiniteKernel η] (a : α) (hs : MeasurableSet s) :
    (κ ⊗ₖ η) a s = ∫⁻ b, η (a, b) {c | (b, c) ∈ s} ∂κ a

(η : ProbabilityTheory.Kernel (α × β) γ)

((κ.compProd η) a) s = ∫⁻ (b : β), (η (a, b)) {c | (b, c) ∈ s} ∂κ a


@[simp] theorem endofunctorMonoidalCategory_leftUnitor_inv_app (F : C ⥤ C) (X : C) :
  (λ_ F).inv.app X = 𝟙 _

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

(CategoryTheory.MonoidalCategory.leftUnitor F).inv.app X = CategoryTheory.CategoryStruct.id (F.obj X)


lemma LSeries.term_smul_apply (f : ℕ → ℂ) (c s : ℂ) (n : ℕ) :
    term (c • f) s n = c * term f s n

LSeries.term (c • f) s n = c * LSeries.term f s n


protected lemma monotone_iff_continuous [TopologicalSpace α] [TopologicalSpace β]
    [Topology.IsLowerSet α] [Topology.IsLowerSet β] {f : α → β} : Monotone f ↔ Continuous f

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
[TopologicalSpace α]
[TopologicalSpace β]
[Topology.IsLowerSet α]
[Topology.IsLowerSet β]
{f : α → β}


@[simp]
theorem bot_prod : (⊥ : LowerSet α) ×ˢ t = ⊥

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
(t : LowerSet β)


lemma mk₀_surjective (F : ComposableArrows C 0) : ∃ (X : C), F = mk₀ X

(F : CategoryTheory.ComposableArrows C 0)

∃ X, F = CategoryTheory.ComposableArrows.mk₀ X


@[simp]
theorem divX_zero : divX (0 : R[X]) = 0


lemma iIndep.iIndepSets' {m : ι → MeasurableSpace Ω}
    {_ : MeasurableSpace Ω} {μ : Measure Ω} (hμ : iIndep m μ) :
    iIndepSets (fun x ↦ {s | MeasurableSet[m x] s}) μ

{Ω : Type u_1}
{ι : Type u_2}
{m : ι → MeasurableSpace Ω}

∀ {x : MeasurableSpace Ω} {μ : MeasureTheory.Measure Ω},
  ProbabilityTheory.iIndep m μ → ProbabilityTheory.iIndepSets (fun x => {s | MeasurableSet s}) μ


@[field_simps]
theorem divp_sub (a b : α) (u : αˣ) : a /ₚ u - b = (a - b * u) /ₚ u

{α : Type u}
[Ring α]
(a b : α)
(u : αˣ)


lemma measure_mutuallySingularSetSlice (κ η : Kernel α γ) [IsFiniteKernel κ] [IsFiniteKernel η]
    (a : α) :
    η a (mutuallySingularSetSlice κ η a) = 0

[hαγ : MeasurableSpace.CountableOrCountablyGenerated α γ]

(η a) (κ.mutuallySingularSetSlice η a) = 0


theorem of_mul (x y : α) : of (x * y) = of x * of y

FreeAbelianGroup.of (x * y) = FreeAbelianGroup.of x * FreeAbelianGroup.of y


theorem iInf_ker_proj_le_iSup_range_stdBasis {I : Finset ι} {J : Set ι} (hu : Set.univ ⊆ ↑I ∪ J) :
    ⨅ i ∈ J, ker (proj i : (∀ i, φ i) →ₗ[R] φ i) ≤ ⨆ i ∈ I, range (stdBasis R φ i)

(R : Type u_1)
{ι : Type u_2}
[Semiring R]
(φ : ι → Type u_3)
[(i : ι) → AddCommMonoid (φ i)]
[(i : ι) → Module R (φ i)]
[DecidableEq ι]
{I : Finset ι}
{J : Set ι}
(hu : Set.univ ⊆ ↑I ∪ J)

⨅ i ∈ J, LinearMap.ker (LinearMap.proj i) ≤ ⨆ i ∈ I, LinearMap.range (LinearMap.stdBasis R φ i)


theorem biSup_add_biSup_le {ι ι'} {s : Set ι} {t : Set ι'} (hs : s.Nonempty) (ht : t.Nonempty)
    {f : ι → ℝ≥0∞} {g : ι' → ℝ≥0∞} {a : ℝ≥0∞} (h : ∀ i ∈ s, ∀ j ∈ t, f i + g j ≤ a) :
    ((⨆ i ∈ s, f i) + ⨆ j ∈ t, g j) ≤ a

{ι : Type u_4}
{ι' : Type u_5}
{s : Set ι}
{t : Set ι'}
(hs : s.Nonempty)
(ht : t.Nonempty)
{f : ι → ℝ≥0∞}
{g : ι' → ℝ≥0∞}
{a : ℝ≥0∞}
(h : ∀ i ∈ s, ∀ j ∈ t, f i + g j ≤ a)


protected theorem Commute.geom_sum₂_mul [Ring α] {x y : α} (h : Commute x y) (n : ℕ) :
    (∑ i ∈ range n, x ^ i * y ^ (n - 1 - i)) * (x - y) = x ^ n - y ^ n

{α : Type u}
[Ring α]
{x y : α}
(h : Commute x y)
(n : ℕ)

(∑ i ∈ Finset.range n, x ^ i * y ^ (n - 1 - i)) * (x - y) = x ^ n - y ^ n


theorem iSup_prod {f : β × γ → α} : ⨆ x, f x = ⨆ (i) (j), f (i, j)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_4}
[CompleteLattice α]
{f : β × γ → α}


lemma union_eq_empty : s ∪ t = ∅ ↔ s = ∅ ∧ t = ∅

{α : Type u_1}
[DecidableEq α]
{s t : Finset α}


/-- The supremum of the Rayleigh quotient of a symmetric operator `T` on a nontrivial
finite-dimensional vector space is an eigenvalue for that operator. -/
theorem hasEigenvalue_iSup_of_finiteDimensional (hT : T.IsSymmetric) :
    HasEigenvalue T ↑(⨆ x : { x : E // x ≠ 0 }, RCLike.re ⟪T x, x⟫ / ‖(x : E)‖ ^ 2 : ℝ)

{𝕜 : Type u_1}
[RCLike 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[FiniteDimensional 𝕜 E]
[_i : Nontrivial E]
{T : E →ₗ[𝕜] E}
(hT : T.IsSymmetric)

Module.End.HasEigenvalue T ↑(⨆ x, RCLike.re ⟪T ↑x, ↑x⟫_𝕜 / ‖↑x‖ ^ 2)


theorem IsLowerSet.memberSubfamily (h : IsLowerSet (𝒜 : Set (Finset α))) :
    IsLowerSet (𝒜.memberSubfamily a : Set (Finset α))

{α : Type u_1}
[DecidableEq α]
{𝒜 : Finset (Finset α)}
{a : α}
(h : IsLowerSet ↑𝒜)

IsLowerSet ↑(Finset.memberSubfamily a 𝒜)


theorem option_isSome : Primrec (@Option.isSome α)


theorem indepFun_iff_measure_inter_preimage_eq_mul {mβ : MeasurableSpace β}
    {mβ' : MeasurableSpace β'} :
    IndepFun f g μ ↔
      ∀ s t, MeasurableSet s → MeasurableSet t
        → μ (f ⁻¹' s ∩ g ⁻¹' t) = μ (f ⁻¹' s) * μ (g ⁻¹' t)

{Ω : Type u_1}
{β : Type u_6}
{β' : Type u_7}
{_mΩ : MeasurableSpace Ω}
{μ : MeasureTheory.Measure Ω}
{f : Ω → β}
{g : Ω → β'}
{mβ : MeasurableSpace β}
{mβ' : MeasurableSpace β'}

ProbabilityTheory.IndepFun f g μ ↔
  ∀ (s : Set β) (t : Set β'), MeasurableSet s → MeasurableSet t → μ (f ⁻¹' s ∩ g ⁻¹' t) = μ (f ⁻¹' s) * μ (g ⁻¹' t)


@[simp]
theorem pairwise_zero (r : α → α → Prop) : Multiset.Pairwise r 0


theorem partOfVertex_ne_of_adj {v w : V} (h : G.Adj v w) : P.partOfVertex v ≠ P.partOfVertex w

{V : Type u}
{G : SimpleGraph V}
(P : G.Partition)
{v w : V}
(h : G.Adj v w)


/-- The torsion submonoid of a torsion monoid is `⊤`. -/
@[to_additive (attr := simp) "The additive torsion submonoid of an additive torsion monoid is `⊤`."]
theorem torsion_eq_top (tG : IsTorsion G) : torsion G = ⊤

{G : Type u_1}
[CommMonoid G]
(tG : Monoid.IsTorsion G)


theorem inv_mul (t : TransvectionStruct n R) : t.inv.toMatrix * t.toMatrix = 1

{n : Type u_1}
{R : Type u₂}
[DecidableEq n]
[CommRing R]
[Fintype n]
(t : Matrix.TransvectionStruct n R)


theorem bind₂_bind₂ (f : R →+* MvPolynomial σ S) (g : S →+* MvPolynomial σ T)
    (φ : MvPolynomial σ R) : (bind₂ g) (bind₂ f φ) = bind₂ ((bind₂ g).comp f) φ

{σ : Type u_1}
{R : Type u_3}
{S : Type u_4}
{T : Type u_5}
[CommSemiring R]
[CommSemiring S]
[CommSemiring T]
(f : R →+* MvPolynomial σ S)
(g : S →+* MvPolynomial σ T)
(φ : MvPolynomial σ R)

(MvPolynomial.bind₂ g) ((MvPolynomial.bind₂ f) φ) = (MvPolynomial.bind₂ ((MvPolynomial.bind₂ g).comp f)) φ


@[simp]
theorem toIocMod_toIcoMod (a₁ a₂ b : α) : toIocMod hp a₁ (toIcoMod hp a₂ b) = toIocMod hp a₁ b

{α : Type u_1}
[LinearOrderedAddCommGroup α]
[hα : Archimedean α]
{p : α}
(hp : 0 < p)
(a₁ a₂ b : α)


@[simp]
theorem inner_self_nonpos {x : E} : re ⟪x, x⟫ ≤ 0 ↔ x = 0

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{x : E}


@[simp]
theorem deg_add (c1 c2 : NumDenSameDeg 𝒜 x) : (c1 + c2).deg = c1.deg + c2.deg

(c1 c2 : HomogeneousLocalization.NumDenSameDeg 𝒜 x)


theorem isNat_le_false [OrderedSemiring α] [CharZero α] {a b : α} {a' b' : ℕ}
    (ha : IsNat a a') (hb : IsNat b b') (h : Nat.ble a' b' = false) : ¬a ≤ b

{α : Type u_1}
[OrderedSemiring α]
[CharZero α]
{a b : α}
{a' b' : ℕ}
(ha : Mathlib.Meta.NormNum.IsNat a a')
(hb : Mathlib.Meta.NormNum.IsNat b b')
(h : a'.ble b' = false)


/-- The orthogonal projection of `y` on `U` minimizes the distance `‖y - x‖` for `x ∈ U`. -/
theorem orthogonalProjection_minimal {U : Submodule 𝕜 E} [HasOrthogonalProjection U] (y : E) :
    ‖y - orthogonalProjection U y‖ = ⨅ x : U, ‖y - x‖

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{U : Submodule 𝕜 E}
[HasOrthogonalProjection U]
(y : E)

‖y - ↑((orthogonalProjection U) y)‖ = ⨅ x, ‖y - ↑x‖


@[simp]
lemma iso_hom_app (a : A) (X : C) :
    (iso F r hF a).hom.app ((functor r).obj X) =
      (lift r F hF).map (((functor r).commShiftIso a).inv.app X) ≫
      (F.commShiftIso a).hom.app X

(hF : ∀ (x y : C) (f₁ f₂ : x ⟶ y), r f₁ f₂ → F.map f₁ = F.map f₂)

(CategoryTheory.Quotient.LiftCommShift.iso F r hF a).hom.app ((CategoryTheory.Quotient.functor r).obj X) =
  (CategoryTheory.Quotient.lift r F hF).map (((CategoryTheory.Quotient.functor r).commShiftIso a).inv.app X) ≫
    (F.commShiftIso a).hom.app X


theorem irreducible_units_mul (a : αˣ) (b : α) : Irreducible (↑a * b) ↔ Irreducible b

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


theorem isOpen_range_inr : IsOpen (range (inr : Y → X ⊕ Y))

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]


@[to_additive]
theorem center_le_centralizer (s) : center G ≤ centralizer s

Subgroup.center G ≤ Subgroup.centralizer s


theorem add_eq_left_iff_le : a + b = a ↔ b ≤ a

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


theorem Memℒp.mono_measure {f : α → E} (hμν : ν ≤ μ) (hf : Memℒp f p μ) : Memℒp f p ν

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
{p : ℝ≥0∞}
{μ ν : MeasureTheory.Measure α}
[NormedAddCommGroup E]
{f : α → E}
(hμν : ν ≤ μ)
(hf : MeasureTheory.Memℒp f p μ)


@[simp]
theorem bind₁_frobeniusPoly_wittPolynomial (n : ℕ) :
    bind₁ (frobeniusPoly p) (wittPolynomial p ℤ n) = wittPolynomial p ℤ (n + 1)

(p : ℕ)
[hp : Fact (Nat.Prime p)]
(n : ℕ)

(MvPolynomial.bind₁ (WittVector.frobeniusPoly p)) (wittPolynomial p ℤ n) = wittPolynomial p ℤ (n + 1)


@[simp] protected theorem div_zero : ∀ a : Int, div a 0 = 0


theorem continuousWithinAt_Ioi_iff_Ici {a : α} {f : α → β} :
    ContinuousWithinAt f (Ioi a) a ↔ ContinuousWithinAt f (Ici a) a

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[PartialOrder α]
[TopologicalSpace β]
{a : α}
{f : α → β}

ContinuousWithinAt f (Set.Ioi a) a ↔ ContinuousWithinAt f (Set.Ici a) a


@[simp]
theorem smul_apply (a : S) (Q : QuadraticMap R M N) (x : M) : (a • Q) x = a • Q x

{S : Type u_1}
{R : Type u_3}
{M : Type u_4}
{N : Type u_5}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
[AddCommMonoid N]
[Module R N]
[Monoid S]
[DistribMulAction S N]
[SMulCommClass S R N]
(a : S)
(Q : QuadraticMap R M N)
(x : M)


theorem antidiagonalTuple_two (n : ℕ) :
    antidiagonalTuple 2 n = (antidiagonal n).map (piFinTwoEquiv fun _ => ℕ).symm.toEmbedding

Finset.Nat.antidiagonalTuple 2 n = Finset.map (piFinTwoEquiv fun x => ℕ).symm.toEmbedding (Finset.antidiagonal n)


/-- Note that this is an equality of elements of `ℝ≥0∞`. See also
`MeasureTheory.ProbabilityMeasure.map_apply` for the corresponding equality as elements of `ℝ≥0`. -/
lemma map_apply' (ν : ProbabilityMeasure Ω) {f : Ω → Ω'} (f_aemble : AEMeasurable f ν)
    {A : Set Ω'} (A_mble : MeasurableSet A) :
    (ν.map f_aemble : Measure Ω') A = (ν : Measure Ω) (f ⁻¹' A)

(ν : MeasureTheory.ProbabilityMeasure Ω)


/-- An element `m ∈ M` is contained in the `R`-submodule spanned by a set `s ⊆ M`, if and only if
`m` can be written as a finite `R`-linear combination of elements of `s`.
The implementation uses a sum indexed by `Fin n` for some `n`. -/
lemma mem_span_set' {m : M} {s : Set M} :
    m ∈ Submodule.span R s ↔ ∃ (n : ℕ) (f : Fin n → R) (g : Fin n → s),
      ∑ i, f i • (g i : M) = m

{R : Type u_1}
{M : Type u_2}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{m : M}
{s : Set M}

m ∈ Submodule.span R s ↔ ∃ n f g, ∑ i : Fin n, f i • ↑(g i) = m


@[simp, mfld_simps]
theorem piChartedSpace_chartAt {ι : Type*} [Finite ι] (H : ι → Type*)
    [∀ i, TopologicalSpace (H i)] (M : ι → Type*) [∀ i, TopologicalSpace (M i)]
    [∀ i, ChartedSpace (H i) (M i)] (f : ∀ i, M i) :
    chartAt (H := ModelPi H) f = PartialHomeomorph.pi fun i ↦ chartAt (H i) (f i)

{ι : Type u_5}
[Finite ι]
(H : ι → Type u_6)
[(i : ι) → TopologicalSpace (H i)]
(M : ι → Type u_7)
[(i : ι) → TopologicalSpace (M i)]
[(i : ι) → ChartedSpace (H i) (M i)]
(f : (i : ι) → M i)

chartAt (ModelPi H) f = PartialHomeomorph.pi fun i => chartAt (H i) (f i)


theorem l_iSup₂ (gc : GaloisConnection l u) {f : ∀ i, κ i → α} :
    l (⨆ (i) (j), f i j) = ⨆ (i) (j), l (f i j)

{α : Type u}
{β : Type v}
{ι : Sort x}
{κ : ι → Sort u_1}
[CompleteLattice α]
[CompleteLattice β]
{l : α → β}
{u : β → α}
(gc : GaloisConnection l u)
{f : (i : ι) → κ i → α}

l (⨆ i, ⨆ j, f i j) = ⨆ i, ⨆ j, l (f i j)


@[simp]
theorem submatrix_one_embedding [Zero α] [One α] [DecidableEq m] [DecidableEq l] (e : l ↪ m) :
    (1 : Matrix m m α).submatrix e e = 1

{l : Type u_1}
{m : Type u_2}
{α : Type v}
[Zero α]
[One α]
[DecidableEq m]
[DecidableEq l]
(e : l ↪ m)


theorem divInt_add_divInt (n₁ n₂ : Int) {d₁ d₂} (z₁ : d₁ ≠ 0) (z₂ : d₂ ≠ 0) :
    n₁ /. d₁ + n₂ /. d₂ = (n₁ * d₂ + n₂ * d₁) /. (d₁ * d₂)

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


/-- **Wilson's Theorem**: For `n ≠ 1`, `(n-1)!` is congruent to `-1` modulo `n` iff n is prime. -/
theorem prime_iff_fac_equiv_neg_one (h : n ≠ 1) : Prime n ↔ ((n - 1)! : ZMod n) = -1


theorem abelian_of_solvable_ideal_eq_bot_iff (I : LieIdeal R L) [h : IsSolvable R I] :
    derivedAbelianOfIdeal I = ⊥ ↔ I = ⊥

{R : Type u}
{L : Type v}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
(I : LieIdeal R L)
[h : LieAlgebra.IsSolvable R ↥↑I]

LieAlgebra.derivedAbelianOfIdeal I = ⊥ ↔ I = ⊥


theorem factor_dvd_of_natDegree_ne_zero {f : K[X]} (hf : f.natDegree ≠ 0) : factor f ∣ f

{K : Type v}
[Field K]
{f : K[X]}
(hf : f.natDegree ≠ 0)


/-- If `yoneda.map f` is an isomorphism, so was `f`.
-/
theorem isIso {X Y : C} (f : X ⟶ Y) [IsIso (yoneda.map f)] : IsIso f


theorem setLIntegral_withDensity_eq_setLIntegral_mul_non_measurable₀' (μ : Measure α) [SFinite μ]
    {f : α → ℝ≥0∞} (s : Set α) (hf : AEMeasurable f (μ.restrict s)) (g : α → ℝ≥0∞)
    (h'f : ∀ᵐ x ∂μ.restrict s, f x < ∞) :
    ∫⁻ a in s, g a ∂μ.withDensity f = ∫⁻ a in s, (f * g) a ∂μ

{f : α → ℝ≥0∞}

(g : α → ℝ≥0∞)

(h'f : ∀ᵐ (x : α) ∂μ.restrict s, f x < ⊤)

∫⁻ (a : α) in s, g a ∂μ.withDensity f = ∫⁻ (a : α) in s, (f * g) a ∂μ


theorem coe_dualBasis [_root_.Finite ι] : ⇑h.basis.dualBasis = ε

{R : Type u_1}
{M : Type u_2}
{ι : Type u_3}
[CommRing R]
[AddCommGroup M]
[Module R M]
{e : ι → M}
{ε : ι → Module.Dual R M}
[DecidableEq ι]
(h : Module.DualBases e ε)
[Finite ι]


theorem natDegree_prod_le : (∏ i ∈ s, f i).natDegree ≤ ∑ i ∈ s, (f i).natDegree

{R : Type u}
{ι : Type w}
(s : Finset ι)
[CommSemiring R]
(f : ι → R[X])


/-- Making this a global instance would make the typeclass search go in an infinite loop. -/
theorem hasPushout_symmetry [HasPushout f g] : HasPushout g f

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X Y Z : C}
(f : X ⟶ Y)
(g : X ⟶ Z)
[CategoryTheory.Limits.HasPushout f g]


theorem eq_C_of_degree_eq_zero (h : degree p = 0) : p = C (coeff p 0)

{R : Type u}
[Semiring R]
{p : R[X]}
(h : p.degree = 0)


/-- If multiplying by `1` on either side is the identity, `1` is regular. -/
@[to_additive "If adding `0` on either side is the identity, `0` is regular."]
theorem isRegular_one : IsRegular (1 : R)


@[simp]
theorem inf_zero : (0 : Multiset α).inf = ⊤

{α : Type u_1}
[SemilatticeInf α]
[OrderTop α]


lemma units_natAbs (u : ℤˣ) : natAbs u = 1


@[simp]
theorem strictMonoOn_singleton : StrictMonoOn f {a}

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


theorem contDiff_univBall : ContDiff ℝ n (univBall c r)

{n : ℕ∞}
{E : Type u_1}
[NormedAddCommGroup E]
[InnerProductSpace ℝ E]
{c : E}
{r : ℝ}

ContDiff ℝ n ↑(PartialHomeomorph.univBall c r)


theorem measure_compl_le_add_of_le_add [IsFiniteMeasure μ] (hs : MeasurableSet s)
    (ht : MeasurableSet t) {ε : ℝ≥0∞} (h : μ s ≤ μ t + ε) : μ tᶜ ≤ μ sᶜ + ε

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s t : Set α}
[MeasureTheory.IsFiniteMeasure μ]
(hs : MeasurableSet s)
(ht : MeasurableSet t)
{ε : ℝ≥0∞}
(h : μ s ≤ μ t + ε)

μ tᶜ ≤ μ sᶜ + ε


/-- Composition by continuous linear equivs on the right respects higher differentiability on
domains. -/
theorem ContinuousLinearEquiv.contDiffOn_comp_iff (e : G ≃L[𝕜] E) :
    ContDiffOn 𝕜 n (f ∘ e) (e ⁻¹' s) ↔ ContDiffOn 𝕜 n f s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type uG}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{s : Set E}
{f : E → F}
{n : ℕ∞}
(e : G ≃L[𝕜] E)

ContDiffOn 𝕜 n (f ∘ ⇑e) (⇑e ⁻¹' s) ↔ ContDiffOn 𝕜 n f s


@[simp] lemma slope_neg (f : k → E) (x y : k) : slope (fun t ↦ -f t) x y = -slope f x y

{k : Type u_1}
{E : Type u_2}
[Field k]
[AddCommGroup E]
[Module k E]
(f : k → E)
(x y : k)

slope (fun t => -f t) x y = -slope f x y


theorem eq_singleton_iff_unique_mem {s : Finset α} {a : α} : s = {a} ↔ a ∈ s ∧ ∀ x ∈ s, x = a


theorem wcovBy_iff_covBy_or_eq : a ⩿ b ↔ a ⋖ b ∨ a = b

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


@[measurability]
theorem measurable_inl [MeasurableSpace α] [MeasurableSpace β] : Measurable (@Sum.inl α β)

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


@[to_additive (attr := simp)]
theorem invRev_length : (invRev L₁).length = L₁.length

(FreeAddGroup.negRev L₁).length = L₁.length


theorem nontrivial_of_hasRankNullity : Nontrivial R

(R : Type u_1)
[Ring R]
[HasRankNullity.{u, u_1} R]


@[simp]
theorem toFinsupp_eq_one {a : R[X]} : a.toFinsupp = 1 ↔ a = 1


protected theorem multiset_sum_mem {m : Multiset A} (h : ∀ x ∈ m, x ∈ S) : m.sum ∈ S

{R : Type u}
{A : Type v}
[CommSemiring R]
[Semiring A]
[Algebra R A]
(S : Subalgebra R A)
{m : Multiset A}
(h : ∀ x ∈ m, x ∈ S)


/-- Lift a `OneHom` to `Finset` via `image`. -/
@[to_additive (attr := simps) "Lift a `ZeroHom` to `Finset` via `image`"]
def imageOneHom [DecidableEq β] [One β] [FunLike F α β] [OneHomClass F α β] (f : F) :
    OneHom (Finset α) (Finset β)

{F : Type u_1}
{α : Type u_2}
{β : Type u_3}
[Zero α]
[DecidableEq β]
[Zero β]
[FunLike F α β]
[ZeroHomClass F α β]
(f : F)
(s : Finset α)

(Finset.imageZeroHom f) s = Finset.image (⇑f) s


@[simp, norm_cast]
theorem cast_zero : ((0 : ℕ) : R) = 0


@[ext]
theorem ext {f g : C(α, β)} (h : ∀ a, f a = g a) : f = g

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
{f g : C(α, β)}
(h : ∀ (a : α), f a = g a)


@[simp] theorem true_iff (p : Prop) : (True ↔ p) = p


theorem proj_quotientMap : QuotientMap S.proj

{X : Type u_2}
[TopologicalSpace X]
(S : DiscreteQuotient X)


@[to_additive]
lemma card_div_le : Nat.card (s / t) ≤ Nat.card s * Nat.card t

Nat.card ↑(s / t) ≤ Nat.card ↑s * Nat.card ↑t


@[simp] theorem dropLast_single : [x].dropLast = []

∀ {α : Type u_1} {x : α}, (x :: List.nil).dropLast = List.nil


/-- If `r` is a positive constant, `fun x ↦ f x * r` tends to infinity along a filter
if and only if `f` tends to infinity along the same filter. -/
theorem tendsto_mul_const_atTop_of_pos (hr : 0 < r) :
    Tendsto (fun x => f x * r) l atTop ↔ Tendsto f l atTop

{α : Type u_3}
{β : Type u_4}
[LinearOrderedSemifield α]
{l : Filter β}
{f : β → α}
{r : α}
(hr : 0 < r)

Filter.Tendsto (fun x => f x * r) l Filter.atTop ↔ Filter.Tendsto f l Filter.atTop


theorem mem_spanningSets_of_index_le (μ : Measure α) [SigmaFinite μ] (x : α) {n : ℕ}
    (hn : spanningSetsIndex μ x ≤ n) : x ∈ spanningSets μ n

(hn : MeasureTheory.spanningSetsIndex μ x ≤ n)


lemma hasFTaylorSeriesUpTo_fourierIntegral {N : ℕ∞}
    (hf : ∀ (n : ℕ), n ≤ N → Integrable (fun v ↦ ‖v‖^n * ‖f v‖) μ)
    (h'f : AEStronglyMeasurable f μ) :
    HasFTaylorSeriesUpTo N (fourierIntegral 𝐞 μ L.toLinearMap₂ f)
      (fun w n ↦ fourierIntegral 𝐞 μ L.toLinearMap₂ (fun v ↦ fourierPowSMulRight L f v n) w)

(hf : ∀ (n : ℕ), ↑n ≤ N → MeasureTheory.Integrable (fun v => ‖v‖ ^ n * ‖f v‖) μ)

(h'f : MeasureTheory.AEStronglyMeasurable f μ)

HasFTaylorSeriesUpTo N (VectorFourier.fourierIntegral 𝐞 μ L.toLinearMap₂ f) fun w n =>
  VectorFourier.fourierIntegral 𝐞 μ L.toLinearMap₂ (fun v => VectorFourier.fourierPowSMulRight L f v n) w


theorem LSeriesSummable_iff_of_re_eq_re {f : ℕ → ℂ} {s s' : ℂ} (h : s.re = s'.re) :
    LSeriesSummable f s ↔ LSeriesSummable f s'


theorem mul_neg_geom_sum [Ring α] (x : α) (n : ℕ) : ((1 - x) * ∑ i ∈ range n, x ^ i) = 1 - x ^ n

(1 - x) * ∑ i ∈ Finset.range n, x ^ i = 1 - x ^ n


@[simp]
theorem join_nil (a : α) (S) : join ((a, nil), S) = (a, Seq.join S)

{α : Type u}
(a : α)
(S : Stream'.Seq (Stream'.Seq1 α))

Stream'.Seq1.join ((a, Stream'.Seq.nil), S) = (a, S.join)


@[simp]
theorem cos_ofReal_im (x : ℝ) : (cos x).im = 0


@[to_additive (attr := elab_as_elim)]
theorem induction_on₂ {p : Localization S → Localization S → Prop} (x y)
    (H : ∀ x y : M × S, p (mk x.1 x.2) (mk y.1 y.2)) : p x y

(H : ∀ (x y : M × ↥S), p (Localization.mk x.1 x.2) (Localization.mk y.1 y.2))


@[simp]
theorem quot_mk_to_coe' (l : List α) : @Eq (Multiset α) (Quot.mk (· ≈ ·) l) l


@[to_additive]
theorem const_mul_eq_map [Mul β] (f : α →ₛ β) (b : β) : const α b * f = f.map fun a => b * a

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

MeasureTheory.SimpleFunc.const α b * f = MeasureTheory.SimpleFunc.map (fun a => b * a) f


@[simp]
theorem equivOfMinpoly_map (pb : PowerBasis A S) (e : S ≃ₐ[A] S')
    (h : minpoly A pb.gen = minpoly A (pb.map e).gen) : pb.equivOfMinpoly (pb.map e) h = e


theorem perm_ext_iff_of_nodup {l₁ l₂ : List α} (d₁ : Nodup l₁) (d₂ : Nodup l₂) :
    l₁ ~ l₂ ↔ ∀ a, a ∈ l₁ ↔ a ∈ l₂

{α : Type u_1}
{l₁ l₂ : List α}
(d₁ : l₁.Nodup)
(d₂ : l₂.Nodup)


theorem X_pow_eq (s : σ) (n : ℕ) : (X s : MvPowerSeries σ R) ^ n = monomial R (single s n) 1

{σ : Type u_1}
{R : Type u_2}
[Semiring R]
(s : σ)
(n : ℕ)

MvPowerSeries.X s ^ n = (MvPowerSeries.monomial R (Finsupp.single s n)) 1


/-- The dual of the dual of a proper cone is itself. -/
@[simp]
theorem dual_dual (K : ProperCone ℝ E) : K.dual.dual = K

{E : Type u_1}
[NormedAddCommGroup E]
[InnerProductSpace ℝ E]
[CompleteSpace E]
(K : ProperCone ℝ E)


@[to_additive]
lemma mul_sup (a b c : α) : c * (a ⊔ b) = c * a ⊔ c * b

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


theorem forall_prop_of_true {p : Prop} {q : p → Prop} (h : p) : (∀ h' : p, q h') ↔ q h


theorem mem_nhds_left (x : α) {s : Set (α × α)} (h : s ∈ 𝓤 α) : { y : α | (x, y) ∈ s } ∈ 𝓝 x

{α : Type ua}
[UniformSpace α]
(x : α)
{s : Set (α × α)}
(h : s ∈ 𝓤 α)


@[reassoc]
lemma shiftFunctorComm_hom_app_comp_shift_shiftFunctorAdd_hom_app (m₁ m₂ m₃ : A) (X : C) :
    (shiftFunctorComm C m₁ (m₂ + m₃)).hom.app X ≫
    ((shiftFunctorAdd C m₂ m₃).hom.app X)⟦m₁⟧' =
  (shiftFunctorAdd C m₂ m₃).hom.app (X⟦m₁⟧) ≫
    ((shiftFunctorComm C m₁ m₂).hom.app X)⟦m₃⟧' ≫
    (shiftFunctorComm C m₁ m₃).hom.app (X⟦m₂⟧)

{C : Type u}
{A : Type u_1}
[CategoryTheory.Category.{v, u} C]
[AddCommMonoid A]
[CategoryTheory.HasShift C A]
(m₁ m₂ m₃ : A)
(X : C)

CategoryTheory.CategoryStruct.comp ((CategoryTheory.shiftFunctorComm C m₁ (m₂ + m₃)).hom.app X)
    ((CategoryTheory.shiftFunctor C m₁).map ((CategoryTheory.shiftFunctorAdd C m₂ m₃).hom.app X)) =
  CategoryTheory.CategoryStruct.comp
    ((CategoryTheory.shiftFunctorAdd C m₂ m₃).hom.app ((CategoryTheory.shiftFunctor C m₁).obj X))
    (CategoryTheory.CategoryStruct.comp
      ((CategoryTheory.shiftFunctor C m₃).map ((CategoryTheory.shiftFunctorComm C m₁ m₂).hom.app X))
      ((CategoryTheory.shiftFunctorComm C m₁ m₃).hom.app ((CategoryTheory.shiftFunctor C m₂).obj X)))


@[to_additive (attr := measurability)]
theorem Measurable.div_const [MeasurableDiv G] (hf : Measurable f) (c : G) :
    Measurable fun x => f x / c

{G : Type u_2}
{α : Type u_3}
[MeasurableSpace G]
[Div G]
{m : MeasurableSpace α}
{f : α → G}
[MeasurableDiv G]
(hf : Measurable f)
(c : G)


theorem one_def : (1 : PerfectClosure K p) = mk K p (0, 1)

(K : Type u)
[CommRing K]
(p : ℕ)
[Fact (Nat.Prime p)]
[CharP K p]


@[simp] theorem of_symm_zero : (of R).symm (0 : HahnModule Γ R V) = 0

{Γ : Type u_1}
{R : Type u_3}
{V : Type u_4}
[PartialOrder Γ]
[AddCommMonoid V]
[SMul R V]


theorem hasFTaylorSeriesUpTo_top_iff :
    HasFTaylorSeriesUpTo ∞ f p ↔ ∀ n : ℕ, HasFTaylorSeriesUpTo n f p

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{p : E → FormalMultilinearSeries 𝕜 E F}

HasFTaylorSeriesUpTo ⊤ f p ↔ ∀ (n : ℕ), HasFTaylorSeriesUpTo (↑n) f p


theorem val_cast_of_lt {n : ℕ} {a : ℕ} (h : a < n) : (a : ZMod n).val = a


theorem prod_X_add_C_coeff' {σ} (s : Multiset σ) (r : σ → R) {k : ℕ} (h : k ≤ Multiset.card s) :
    (s.map fun i => X + C (r i)).prod.coeff k = (s.map r).esymm (Multiset.card s - k)

{R : Type u_1}
[CommSemiring R]
{σ : Type u_2}
(s : Multiset σ)
(r : σ → R)
{k : ℕ}
(h : k ≤ Multiset.card s)

(Multiset.map (fun i => Polynomial.X + Polynomial.C (r i)) s).prod.coeff k =
  (Multiset.map r s).esymm (Multiset.card s - k)


theorem insertNth_of_length_lt (l : List α) (x : α) (n : ℕ) (h : l.length < n) :
    insertNth n x l = l

{α : Type u}
(l : List α)
(x : α)
(n : ℕ)
(h : l.length < n)


@[simp]
theorem degree_scaleRoots (p : R[X]) {s : R} : degree (scaleRoots p s) = degree p

{R : Type u_1}
[Semiring R]
(p : Polynomial R)
{s : R}


@[simp]
theorem toEquiv_symm_fun (i : X ≅ Y) : (i.toEquiv.symm : Y → X) = i.inv


@[to_additive (attr := simp)] lemma inv_right_iff : SemiconjBy a x⁻¹ y⁻¹ ↔ SemiconjBy a x y

AddSemiconjBy a (-x) (-y) ↔ AddSemiconjBy a x y


theorem Prime.even_sub_one {p : ℕ} (hp : p.Prime) (h2 : p ≠ 2) : Even (p - 1)


theorem ConcaveOn.sub (hf : ConcaveOn 𝕜 s f) (hg : ConvexOn 𝕜 s g) : ConcaveOn 𝕜 s (f - g)

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_5}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[OrderedAddCommGroup β]
[SMul 𝕜 E]
[Module 𝕜 β]
{s : Set E}
{f g : E → β}
(hf : ConcaveOn 𝕜 s f)
(hg : ConvexOn 𝕜 s g)


/-- `QuaternionAlgebra.linearEquivTuple` as a `LinearIsometryEquiv`. -/
@[simps apply symm_apply]
noncomputable def linearIsometryEquivTuple : ℍ ≃ₗᵢ[ℝ] EuclideanSpace ℝ (Fin 4)

Quaternion.linearIsometryEquivTuple a = (WithLp.equiv 2 (Fin 4 → ℝ)).symm ![a.re, a.imI, a.imJ, a.imK]


@[deprecated UniformSpace.inseparableSetoid_ring (since := "2024-02-16")]
theorem ring_sep_quot (α : Type u) [r : CommRing α] [TopologicalSpace α] [TopologicalRing α] :
    SeparationQuotient α = (α ⧸ (⊥ : Ideal α).closure)


/-- We give an expression of the `LSeries.term` of the convolution of two functions
in terms of an a priori infinte sum over all pairs `(k, m)` with `k * m = n`
(the set we sum over is infinite when `n = 0`). This is the version needed for the
proof that `L (f ⍟ g) = L f * L g`. -/
lemma term_convolution' (f g : ℕ → ℂ) (s : ℂ) :
    term (f ⍟ g) s = fun n ↦
      ∑' (b : (fun p : ℕ × ℕ ↦ p.1 * p.2) ⁻¹' {n}), term f s b.val.1 * term g s b.val.2

LSeries.term (f ⍟ g) s = fun n =>
  ∑' (b : ↑((fun p => p.1 * p.2) ⁻¹' {n})), LSeries.term f s (↑b).1 * LSeries.term g s (↑b).2


theorem inner_sub_right (x y z : E) : ⟪x, y - z⟫ = ⟪x, y⟫ - ⟪x, z⟫

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
(x y z : E)


theorem ediam_thickening_le (ε : ℝ≥0) : EMetric.diam (thickening ε s) ≤ EMetric.diam s + 2 * ε

{α : Type u}
[PseudoEMetricSpace α]
{s : Set α}
(ε : ℝ≥0)

EMetric.diam (Metric.thickening (↑ε) s) ≤ EMetric.diam s + 2 * ↑ε


protected theorem neg_add_le_left_of_le_add {a b c : Int} (h : a ≤ b + c) : -b + a ≤ c


@[to_additive existing (attr := simp)]
theorem bot_div : ⊥ / t = ⊥


/-- A map `f : α → β` between uniform spaces is a *uniform embedding* if it is uniform inducing and
injective. If `α` is a separated space, then the latter assumption follows from the former. -/
@[mk_iff]
structure UniformEmbedding (f : α → β) extends UniformInducing f : Prop where
  /-- A uniform embedding is injective. -/
  inj : Function.Injective f

{α : Type u}
{β : Type v}
[UniformSpace α]
[UniformSpace β]
{f : α → β}
(self : UniformEmbedding f)


theorem comap_iInf {ι : Sort*} (f : M →[L] N) (s : ι → L.Substructure N) :
    (iInf s).comap f = ⨅ i, (s i).comap f

{L : FirstOrder.Language}
{M : Type w}
{N : Type u_1}
[L.Structure M]
[L.Structure N]
{ι : Sort u_3}
(f : L.Hom M N)
(s : ι → L.Substructure N)

FirstOrder.Language.Substructure.comap f (iInf s) = ⨅ i, FirstOrder.Language.Substructure.comap f (s i)


@[simp] lemma op_zero (X Y : C) : (0 : X ⟶ Y).op = 0


theorem getElem?_eq_data_get? (a : Array α) (i : Nat) : a[i]? = a.data.get? i


/-- A continuous function is box-integrable with respect to any locally finite measure.

This is true for any volume with bounded variation. -/
theorem integrable_of_continuousOn [CompleteSpace E] {I : Box ι} {f : ℝⁿ → E}
    (hc : ContinuousOn f (Box.Icc I)) (μ : Measure ℝⁿ) [IsLocallyFiniteMeasure μ] :
    Integrable.{u, v, v} I l f μ.toBoxAdditive.toSMul

(hc : ContinuousOn f (BoxIntegral.Box.Icc I))

BoxIntegral.Integrable I l f μ.toBoxAdditive.toSMul


@[simp]
theorem aevalTower_id :
    aevalTower (AlgHom.id S S) = (aeval : (σ → S) → MvPolynomial σ S →ₐ[S] S)

{σ : Type u_1}
{S : Type u_2}
[CommSemiring S]

MvPolynomial.aevalTower (AlgHom.id S S) = MvPolynomial.aeval


theorem isGLB_iff_le_iff : IsGLB s a ↔ ∀ b, b ≤ a ↔ b ∈ lowerBounds s

{α : Type u}
[Preorder α]
{s : Set α}
{a : α}

IsGLB s a ↔ ∀ (b : α), b ≤ a ↔ b ∈ lowerBounds s


private theorem mul_assoc' [NonUnitalSemiring R] (x y z : HahnSeries Γ R) :
    x * y * z = x * (y * z)

{Γ : Type u_1}
{R : Type u_3}
[OrderedCancelAddCommMonoid Γ]
[NonUnitalSemiring R]
(x y z : HahnSeries Γ R)


/-- The counit isomorphism of the equivalence
`ShortComplex.functorEquivalence : ShortComplex (J ⥤ C) ≌ J ⥤ ShortComplex C`. -/
@[simps!]
def counitIso : inverse J C ⋙ functor J C ≅ 𝟭 _

(X : CategoryTheory.Functor J (CategoryTheory.ShortComplex C))

∀ (X_1 : J),
  (((CategoryTheory.ShortComplex.FunctorEquivalence.counitIso J C).inv.app X).app X_1).τ₂ =
    CategoryTheory.CategoryStruct.id (X.obj X_1).X₂


theorem singleton_inj {a b : α} : [a] = [b] ↔ a = b


theorem exists_algHom_of_adjoin_splits' (hS : adjoin L S = ⊤) :
    ∃ φ : E →ₐ[F] K, φ.comp (IsScalarTower.toAlgHom F L E) = f

(hK : ∀ s ∈ S, IsIntegral L s ∧ Polynomial.Splits f.toRingHom (minpoly L s))

∃ φ, φ.comp (IsScalarTower.toAlgHom F L E) = f