theorem atTop_le_cocompact [NoMaxOrder α] [ClosedIciTopology α] :
    atTop ≤ cocompact α

{α : Type u_2}
[LinearOrder α]
[TopologicalSpace α]
[NoMaxOrder α]
[ClosedIciTopology α]


theorem submatrix {M : Matrix n n R} (hM : M.PosSemidef) (e : m → n) :
    (M.submatrix e e).PosSemidef

{m : Type u_1}
{n : Type u_2}
{R : Type u_3}
[Fintype m]
[Fintype n]
[CommRing R]
[PartialOrder R]
[StarRing R]
{M : Matrix n n R}
(hM : M.PosSemidef)
(e : m → n)


/-- Given a quotient space `G ⧸ Γ` where `Γ` is `Countable`, and the restriction,
  `μ_𝓕`, of a right-invariant measure `μ` on `G` to a fundamental domain `𝓕`, a set
  in the quotient which has `μ_𝓕`-measure zero, also has measure zero under the
  folding of `μ` under the quotient. Note that, if `Γ` is infinite, then the folded map
  will take the value `∞` on any open set in the quotient! -/
@[to_additive "Given an additive quotient space `G ⧸ Γ` where `Γ` is `Countable`, and the
  restriction, `μ_𝓕`, of a right-invariant measure `μ` on `G` to a fundamental domain `𝓕`, a set
  in the quotient which has `μ_𝓕`-measure zero, also has measure zero under the
  folding of `μ` under the quotient. Note that, if `Γ` is infinite, then the folded map
  will take the value `∞` on any open set in the quotient!"]
lemma _root_.MeasureTheory.IsFundamentalDomain.absolutelyContinuous_map
    [μ.IsMulRightInvariant] :
    map (QuotientGroup.mk : G → G ⧸ Γ) μ ≪ map (QuotientGroup.mk : G → G ⧸ Γ) (μ.restrict 𝓕)

(h𝓕 : MeasureTheory.IsAddFundamentalDomain (↥Γ.op) 𝓕 μ)

MeasureTheory.Measure.map QuotientAddGroup.mk μ ≪ MeasureTheory.Measure.map QuotientAddGroup.mk (μ.restrict 𝓕)


theorem biInf_sup_biInf {ι ι' : Type*} {f : ι → α} {g : ι' → α} {s : Set ι} {t : Set ι'} :
    ((⨅ i ∈ s, f i) ⊔ ⨅ j ∈ t, g j) = ⨅ p ∈ s ×ˢ t, f (p : ι × ι').1 ⊔ g p.2

{α : Type u}
[Order.Coframe α]
{ι : Type u_1}
{ι' : Type u_2}
{f : ι → α}
{g : ι' → α}
{s : Set ι}
{t : Set ι'}

(⨅ i ∈ s, f i) ⊔ ⨅ j ∈ t, g j = ⨅ p ∈ s ×ˢ t, f p.1 ⊔ g p.2


theorem sin_arccos (x : ℝ) : sin (arccos x) = √(1 - x ^ 2)


/-- Reindexing a family of categories gives equivalent `Pi` categories. -/
@[simps]
noncomputable def Pi.equivalenceOfEquiv (e : J ≃ I) :
    (∀ j, C (e j)) ≌ (∀ i, C i)

[(i : I) → CategoryTheory.Category.{v₁, u₁} (C i)]

(CategoryTheory.Pi.equivalenceOfEquiv C e).unitIso =
  CategoryTheory.NatIso.pi' fun i' =>
    (CategoryTheory.Pi.eval (fun i => C (e i)) i').leftUnitor ≪≫
      (CategoryTheory.Pi.evalCompEqToEquivalenceFunctor (fun j => C (e j)) ⋯).symm ≪≫
        CategoryTheory.isoWhiskerLeft (CategoryTheory.Pi.eval (fun j => C (e j)) (e.symm (e i')))
            (CategoryTheory.Pi.eqToEquivalenceFunctorIso C ⇑e ⋯).symm ≪≫
          (CategoryTheory.Functor.pi'CompEval (CategoryTheory.Pi.eval (fun j => C (e j)) (e.symm (e i'))).comp
                (CategoryTheory.Pi.eqToEquivalence C ⋯).functor).symm ≪≫
            CategoryTheory.isoWhiskerLeft
                (CategoryTheory.Functor.pi' (CategoryTheory.Pi.eval (fun j => C (e j)) (e.symm (e i'))).comp)
                (CategoryTheory.Functor.pi'CompEval (CategoryTheory.Pi.eval fun i => C (e i'))
                    (CategoryTheory.Pi.eqToEquivalence C ⋯).functor).symm ≪≫
              ((CategoryTheory.Functor.pi' (CategoryTheory.Pi.eval (fun j => C (e j)) (e.symm (e i'))).comp).associator
                  (CategoryTheory.Functor.pi' (CategoryTheory.Pi.eval fun i => C (e i')))
                  (CategoryTheory.Pi.eval (fun i => C (e i')) (CategoryTheory.Pi.eqToEquivalence C ⋯).functor)).symm


theorem range_euclideanHalfSpace (n : ℕ) [Zero (Fin n)] :
    (range fun x : EuclideanHalfSpace n => x.val) = { y | 0 ≤ y 0 }


theorem toMeasure_eq_iff_eq_toPMF (μ : Measure α) [IsProbabilityMeasure μ] :
    p.toMeasure = μ ↔ p = μ.toPMF

{α : Type u_1}
[Countable α]
[MeasurableSpace α]
[MeasurableSingletonClass α]
(p : PMF α)
(μ : MeasureTheory.Measure α)
[MeasureTheory.IsProbabilityMeasure μ]


@[simp]
theorem eqToHom_f {X Y : DifferentialObject S C} (h : X = Y) :
    Hom.f (eqToHom h) = eqToHom (congr_arg _ h)

{X Y : CategoryTheory.DifferentialObject S C}

(CategoryTheory.eqToHom h).f = CategoryTheory.eqToHom ⋯


theorem uniformity_lift_le_swap {g : Set (α × α) → Filter β} {f : Filter β} (hg : Monotone g)
    (h : ((𝓤 α).lift fun s => g (preimage Prod.swap s)) ≤ f) : (𝓤 α).lift g ≤ f

(h : ((𝓤 α).lift fun s => g (Prod.swap ⁻¹' s)) ≤ f)


theorem integral_smul_const {𝕜 : Type*} [RCLike 𝕜] [NormedSpace 𝕜 E] [CompleteSpace E]
    (f : X → 𝕜) (c : E) :
    ∫ x, f x • c ∂μ = (∫ x, f x ∂μ) • c

{X : Type u_1}
{E : Type u_3}
[MeasurableSpace X]
{μ : MeasureTheory.Measure X}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{𝕜 : Type u_6}
[RCLike 𝕜]
[NormedSpace 𝕜 E]
[CompleteSpace E]
(f : X → 𝕜)
(c : E)

∫ (x : X), f x • c ∂μ = (∫ (x : X), f x ∂μ) • c


@[simp]
theorem reCLM_apply (z : ℂ) : (reCLM : ℂ → ℝ) z = z.re


theorem algebraMap_apply {r : R} : algebraMap R A⟦X⟧ r = C A (algebraMap R A r)

{R : Type u_1}
{A : Type u_2}
[CommSemiring R]
[Semiring A]
[Algebra R A]
{r : R}

(algebraMap R (PowerSeries A)) r = (PowerSeries.C A) ((algebraMap R A) r)


@[to_additive]
theorem finprod_mem_eq_finite_toFinset_prod (f : α → M) {s : Set α} (hs : s.Finite) :
    ∏ᶠ i ∈ s, f i = ∏ i ∈ hs.toFinset, f i

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

∑ᶠ (i : α) (_ : i ∈ s), f i = ∑ i ∈ hs.toFinset, f i


theorem Separable.of_pow' {f : R[X]} :
    ∀ {n : ℕ} (_h : (f ^ n).Separable), IsUnit f ∨ f.Separable ∧ n = 1 ∨ n = 0

{R : Type u}
[CommSemiring R]
{f : R[X]}
{n : ℕ}
(_h : (f ^ n).Separable)


@[simp]
theorem constantsVarsEquivLeft_symm_apply (t : L.Term ((γ ⊕ α) ⊕ β)) :
    constantsVarsEquivLeft.symm t = varsToConstants (t.relabel (Equiv.sumAssoc _ _ _))

{L : FirstOrder.Language}
{α : Type u'}
{β : Type v'}
{γ : Type u_3}
(t : L.Term ((γ ⊕ α) ⊕ β))

FirstOrder.Language.Term.constantsVarsEquivLeft.symm t =
  (FirstOrder.Language.Term.relabel (⇑(Equiv.sumAssoc γ α β)) t).varsToConstants


@[to_additive (attr := simp)]
theorem preimage_mul_right_closedBall [IsometricSMul Gᵐᵒᵖ G] (a b : G) (r : ℝ) :
    (fun x => x * a) ⁻¹' closedBall b r = closedBall (b / a) r

{G : Type v}
[AddGroup G]
[PseudoMetricSpace G]
[IsometricVAdd Gᵃᵒᵖ G]
(a b : G)
(r : ℝ)

(fun x => x + a) ⁻¹' Metric.closedBall b r = Metric.closedBall (b - a) r


/-- The inclusion of the Moore complex in the alternating face map complex
is a homotopy equivalence -/
@[simps]
def homotopyEquivNormalizedMooreComplexAlternatingFaceMapComplex {A : Type*} [Category A]
    [Abelian A] {Y : SimplicialObject A} :
    HomotopyEquiv ((normalizedMooreComplex A).obj Y) ((alternatingFaceMapComplex A).obj Y)

{A : Type u_2}
[CategoryTheory.Category.{u_3, u_2} A]
[CategoryTheory.Abelian A]
{Y : CategoryTheory.SimplicialObject A}

AlgebraicTopology.DoldKan.homotopyEquivNormalizedMooreComplexAlternatingFaceMapComplex.homotopyInvHomId =
  (Homotopy.ofEq ⋯).trans (AlgebraicTopology.DoldKan.homotopyPInftyToId Y)


theorem SameCycle.of_pow {n : ℕ} : SameCycle (f ^ n) x y → SameCycle f x y

{α : Type u_2}
{f : Equiv.Perm α}
{x y : α}
{n : ℕ}


theorem Integrable.of_smul {c : ℝ} (hf : Integrable I l (c • f) vol) (hc : c ≠ 0) :
    Integrable I l f vol

(hf : BoxIntegral.Integrable I l (c • f) vol)


/-- Updating the first element of a tuple does not change the tail. -/
@[simp]
theorem tail_update_zero : tail (update q 0 z) = tail q

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

Fin.tail (Function.update q 0 z) = Fin.tail q


@[simp]
theorem toIcoDiv_add_right' (a b : α) : toIcoDiv hp (a + p) b = toIcoDiv hp a b - 1

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


theorem restrict_restrict₀' (ht : NullMeasurableSet t μ) :
    (μ.restrict t).restrict s = μ.restrict (s ∩ t)

(ht : MeasureTheory.NullMeasurableSet t μ)


theorem And.imp_right (h : a → b) : c ∧ a → c ∧ b


/-- Permuting rows and columns with the same equivalence has no effect. -/
@[simp]
theorem det_submatrix_equiv_self (e : n ≃ m) (A : Matrix m m R) :
    det (A.submatrix e e) = det A

{m : Type u_1}
{n : Type u_2}
[DecidableEq n]
[Fintype n]
[DecidableEq m]
[Fintype m]
{R : Type v}
[CommRing R]
(e : n ≃ m)
(A : Matrix m m R)


/-- Precompose a partial equivalence with an equivalence.
We modify the source and target to have better definitional behavior. -/
@[simps!]
def transPartialEquiv (e : α ≃ β) (f' : PartialEquiv β γ) : PartialEquiv α γ

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
(e : α ≃ β)
(f' : PartialEquiv β γ)

∀ (a : γ), ↑(e.transPartialEquiv f').symm a = e.symm (↑f'.symm a)


/-- A minimal polynomial is not `1`. -/
theorem ne_one [Nontrivial B] : minpoly A x ≠ 1

(A : Type u_1)
{B : Type u_2}
[CommRing A]
[Ring B]
[Algebra A B]
(x : B)
[Nontrivial B]


/-- The duality equivalence `WalkingSpanᵒᵖ ≌ WalkingCospan` -/
@[simps!]
def walkingSpanOpEquiv : WalkingSpanᵒᵖ ≌ WalkingCospan

(X : CategoryTheory.Limits.WidePullbackShape CategoryTheory.Limits.WalkingPair)

CategoryTheory.Limits.walkingSpanOpEquiv.counitIso.hom.app X = 𝟙 X


theorem destruct_some_of_destruct_tail_some {s : WSeq α} {a} (h : some a ∈ destruct (tail s)) :
    ∃ a', some a' ∈ destruct s

{α : Type u}
{s : Stream'.WSeq α}
{a : α × Stream'.WSeq α}
(h : some a ∈ s.tail.destruct)


theorem mem_doset {s t : Set α} {a b : α} : b ∈ doset a s t ↔ ∃ x ∈ s, ∃ y ∈ t, b = x * a * y

{α : Type u_2}
[Mul α]
{s t : Set α}
{a b : α}

b ∈ Doset.doset a s t ↔ ∃ x ∈ s, ∃ y ∈ t, b = x * a * y


lemma isProbabilityMeasure [∀ i, IsProbabilityMeasure (P i)] (hμ : IsProjectiveLimit μ P) :
    IsProbabilityMeasure μ

{P : (J : Finset ι) → MeasureTheory.Measure ((j : { x // x ∈ J }) → α ↑j)}

{μ : MeasureTheory.Measure ((i : ι) → α i)}

[∀ (i : Finset ι), MeasureTheory.IsProbabilityMeasure (P i)]

(hμ : MeasureTheory.IsProjectiveLimit μ P)


@[simp]
theorem integrableOn_finset_iUnion {s : Finset β} {t : β → Set α} :
    IntegrableOn f (⋃ i ∈ s, t i) μ ↔ ∀ i ∈ s, IntegrableOn f (t i) μ

{α : Type u_1}
{β : Type u_2}
{E : Type u_3}
[MeasurableSpace α]
[NormedAddCommGroup E]
{f : α → E}
{μ : MeasureTheory.Measure α}
{s : Finset β}
{t : β → Set α}

MeasureTheory.IntegrableOn f (⋃ i ∈ s, t i) μ ↔ ∀ i ∈ s, MeasureTheory.IntegrableOn f (t i) μ


/-- The limit of the constant `⊤_ C` functor is `⊤_ C`. -/
@[simps hom]
def limitConstTerminal {J : Type*} [Category J] {C : Type*} [Category C] [HasTerminal C] :
    limit ((CategoryTheory.Functor.const J).obj (⊤_ C)) ≅ ⊤_ C

{J : Type u_1}
[CategoryTheory.Category.{u_3, u_1} J]
{C : Type u_2}
[CategoryTheory.Category.{u_4, u_2} C]
[CategoryTheory.Limits.HasTerminal C]

CategoryTheory.Limits.limitConstTerminal.hom =
  CategoryTheory.Limits.terminal.from (CategoryTheory.Limits.limit ((CategoryTheory.Functor.const J).obj (⊤_ C)))


theorem fourierIntegral_add (he : Continuous e) (hL : Continuous fun p : V × W ↦ L p.1 p.2)
    {f g : V → E} (hf : Integrable f μ) (hg : Integrable g μ) :
    fourierIntegral e μ L f + fourierIntegral e μ L g = fourierIntegral e μ L (f + g)

{𝕜 : Type u_1}
[CommRing 𝕜]
{V : Type u_2}
[AddCommGroup V]
[Module 𝕜 V]
[MeasurableSpace V]
{W : Type u_3}
[AddCommGroup W]
[Module 𝕜 W]
{E : Type u_4}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
[TopologicalSpace 𝕜]
[TopologicalRing 𝕜]
[TopologicalSpace V]
[BorelSpace V]
[TopologicalSpace W]
{e : AddChar 𝕜 ↥𝕊}
{μ : MeasureTheory.Measure V}
{L : V →ₗ[𝕜] W →ₗ[𝕜] 𝕜}
(he : Continuous ⇑e)
(hL : Continuous fun p => (L p.1) p.2)
{f g : V → E}
(hf : MeasureTheory.Integrable f μ)
(hg : MeasureTheory.Integrable g μ)

VectorFourier.fourierIntegral e μ L f + VectorFourier.fourierIntegral e μ L g =
  VectorFourier.fourierIntegral e μ L (f + g)


@[reassoc, elementwise, simp, nolint simpNF] -- see std4#365 for the simpNF issue
theorem stalkSpecializes_stalkPushforward (f : X ⟶ Y) (F : X.Presheaf C) {x y : X} (h : x ⤳ y) :
    (f _* F).stalkSpecializes (f.map_specializes h) ≫ F.stalkPushforward _ f x =
      F.stalkPushforward _ f y ≫ F.stalkSpecializes h

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Limits.HasColimits C]
{X Y : TopCat}
(f : X ⟶ Y)
(F : TopCat.Presheaf C X)
{x y : ↑X}
(h : x ⤳ y)

((TopCat.Presheaf.pushforward C f).obj F).stalkSpecializes ⋯ ≫ TopCat.Presheaf.stalkPushforward C f F x =
  TopCat.Presheaf.stalkPushforward C f F y ≫ F.stalkSpecializes h


@[to_additive]
lemma range_toContinuousMap :
    Set.range (toContinuousMap : ContinuousMonoidHom A B → C(A, B)) =
      {f : C(A, B) | f 1 = 1 ∧ ∀ x y, f (x * y) = f x * f y}

(A : Type u_2)
(B : Type u_3)
[AddMonoid A]
[AddMonoid B]
[TopologicalSpace A]
[TopologicalSpace B]

Set.range ContinuousAddMonoidHom.toContinuousMap = {f | f 0 = 0 ∧ ∀ (x y : A), f (x + y) = f x + f y}


@[simp]
theorem IsInitial.to_comp {X : C} (t : IsInitial X) {Y Z : C} (f : Y ⟶ Z) : t.to Y ≫ f = t.to Z

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


/-- One half of the quivalence between `C` and `ULiftHom C`. -/
@[simps]
def ULiftHom.up : C ⥤ ULiftHom C

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

CategoryTheory.ULiftHom.up.obj A = CategoryTheory.ULiftHom.objUp A


/-- Converts a `LinearEquiv` to an isomorphism in the category `FGModuleCat R`. -/
@[simps]
def _root_.LinearEquiv.toFGModuleCatIso
    {V W : Type u} [AddCommGroup V] [Module R V] [Module.Finite R V]
    [AddCommGroup W] [Module R W] [Module.Finite R W] (e : V ≃ₗ[R] W) :
    FGModuleCat.of R V ≅ FGModuleCat.of R W

{R : Type u}
[Ring R]
{V W : Type u}
[AddCommGroup V]
[Module R V]
[Module.Finite R V]
[AddCommGroup W]
[Module R W]
[Module.Finite R W]
(e : V ≃ₗ[R] W)


theorem eq_mp_bijective {α β : Sort _} (h : α = β) : Function.Bijective (Eq.mp h)


@[simp]
theorem coe_top : ((⊤ : Subfield K) : Set K) = Set.univ


theorem of_int_add (m : ℤ) (h : Irrational (m + x)) : Irrational x

{x : ℝ}
(m : ℤ)
(h : Irrational (↑m + x))


/-- An alternative version of `Subtype.forall`. This one is useful if Lean cannot figure out `q`
  when using `Subtype.forall` from right to left. -/
protected theorem forall' {q : ∀ x, p x → Prop} : (∀ x h, q x h) ↔ ∀ x : { a // p a }, q x x.2

{α : Sort u_1}
{p : α → Prop}
{q : (x : α) → p x → Prop}

(∀ (x : α) (h : p x), q x h) ↔ ∀ (x : { a // p a }), q ↑x ⋯


/-- An isomorphism of differential objects can be constructed
from an isomorphism of the underlying objects that commutes with the differentials. -/
@[simps]
def mkIso {X Y : DifferentialObject S C} (f : X.obj ≅ Y.obj) (hf : X.d ≫ f.hom⟦1⟧' = f.hom ≫ Y.d) :
    X ≅ Y

{X Y : CategoryTheory.DifferentialObject S C}

(hf :
  CategoryTheory.CategoryStruct.comp X.d ((CategoryTheory.shiftFunctor C 1).map f.hom) =
    CategoryTheory.CategoryStruct.comp f.hom Y.d)

(CategoryTheory.DifferentialObject.mkIso f hf).hom.f = f.hom


lemma infClosed_pi {ι : Type*} {α : ι → Type*} [∀ i, SemilatticeInf (α i)] {s : Set ι}
    {t : ∀ i, Set (α i)} (ht : ∀ i ∈ s, InfClosed (t i)) : InfClosed (s.pi t)

{ι : Type u_5}
{α : ι → Type u_6}
[(i : ι) → SemilatticeInf (α i)]
{s : Set ι}
{t : (i : ι) → Set (α i)}
(ht : ∀ i ∈ s, InfClosed (t i))


@[simp]
theorem smul_mem_iff' {G} [Group G] [SMul G R] [MulAction G M] [IsScalarTower G R M] (g : G)
    {x : M} : g • x ∈ p ↔ x ∈ p

{R : Type u}
{M : Type v}
[Monoid R]
[MulAction R M]
(p : SubMulAction R M)
{G : Type u_1}
[Group G]
[SMul G R]
[MulAction G M]
[IsScalarTower G R M]
(g : G)
{x : M}


theorem mem_atomise :
    t ∈ (atomise s F).parts ↔
      t.Nonempty ∧ ∃ Q ⊆ F, (s.filter fun i ↦ ∀ u ∈ F, u ∈ Q ↔ i ∈ u) = t

{α : Type u_1}
[DecidableEq α]
{s t : Finset α}
[Fintype α]
{F : Finset (Finset α)}

t ∈ (Finpartition.atomise s F).parts ↔ t.Nonempty ∧ ∃ Q ⊆ F, Finset.filter (fun i => ∀ u ∈ F, u ∈ Q ↔ i ∈ u) s = t


theorem IsProper.ne_top (_ : IsProper I) : I ≠ ⊤

{P : Type u_1}
[LE P]
[IsDirected P fun x x_1 => x ≤ x_1]
[Nonempty P]
{I : Order.Ideal P}


@[simp]
theorem iInter_Ioi_coe_nat : ⋂ n : ℕ, Ioi (n : ℝ≥0∞) = {∞}


@[parity_simps] lemma odd_sub : Odd (m - n) ↔ (Odd m ↔ Even n)


protected theorem UniformEmbedding.embedding {f : α → β} (h : UniformEmbedding f) : Embedding f

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


@[to_additive]
theorem mul_def [Mul β] (x y : α) :
    letI := Equiv.mul e
    x * y = e.symm (e x * e y)

{α : Type u}
{β : Type v}
(e : α ≃ β)
[Add β]
(x y : α)


theorem left_nonuniformWitnesses_card (h : ¬G.IsUniform ε s t) :
    (s.card : 𝕜) * ε ≤ (G.nonuniformWitnesses ε s t).1.card

{α : Type u_1}
{𝕜 : Type u_2}
[LinearOrderedField 𝕜]
(G : SimpleGraph α)
[DecidableRel G.Adj]
{ε : 𝕜}
{s t : Finset α}
(h : ¬G.IsUniform ε s t)

↑s.card * ε ≤ ↑(G.nonuniformWitnesses ε s t).1.card


theorem biUnion_pair (a b : α) (s : α → Set β) : ⋃ x ∈ ({a, b} : Set α), s x = s a ∪ s b

{α : Type u_1}
{β : Type u_2}
(a b : α)
(s : α → Set β)


theorem hasGradientAt_iff_isLittleO_nhds_zero : HasGradientAt f f' x ↔
    (fun h => f (x + h) - f x - ⟪f', h⟫) =o[𝓝 0] fun h => h

{𝕜 : Type u_1}
{F : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup F]
[InnerProductSpace 𝕜 F]
[CompleteSpace F]
{f : F → 𝕜}
{f' x : F}

HasGradientAt f f' x ↔ (fun h => f (x + h) - f x - ⟪f', h⟫_𝕜) =o[𝓝 0] fun h => h


theorem IsCompact.ne_univ [NoncompactSpace X] (hs : IsCompact s) : s ≠ univ

{X : Type u}
[TopologicalSpace X]
{s : Set X}
[NoncompactSpace X]
(hs : IsCompact s)


protected theorem min_eq_right {a b : Nat} (h : b ≤ a) : min a b = b


@[simps!]
instance : MonoidalCategoryStruct (Dial C)


@[simp]
theorem comp_toHom (hnp : N ↪[L] P) (hmn : M ↪[L] N) :
    (hnp.comp hmn).toHom = hnp.toHom.comp hmn.toHom

{L : FirstOrder.Language}
{M : Type w}
{N : Type w'}
[L.Structure M]
[L.Structure N]
{P : Type u_1}
[L.Structure P]
(hnp : L.Embedding N P)
(hmn : L.Embedding M N)


@[simp]
theorem mul_invOfUnit (φ : R⟦X⟧) (u : Rˣ) (h : constantCoeff R φ = u) :
    φ * invOfUnit φ u = 1

(h : (PowerSeries.constantCoeff R) φ = ↑u)


@[measurability, fun_prop]
theorem Measurable.nnnorm {f : β → α} (hf : Measurable f) : Measurable fun a => ‖f a‖₊

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


theorem zero_zpow : ∀ z : ℤ, z ≠ 0 → (0 : M) ^ z = 0

{n' : Type u_1}
[DecidableEq n']
[Fintype n']
{R : Type u_2}
[CommRing R]
(z : ℤ)


lemma id_mem (W : MorphismProperty C) [W.ContainsIdentities] (X : C) :
    W (𝟙 X)

{C : Type u}
[CategoryTheory.Category.{v, u} C]
(W : CategoryTheory.MorphismProperty C)
[W.ContainsIdentities]
(X : C)


/-- Two functions antivary iff the rearrangement inequality holds. -/
lemma antivary_iff_smul_rearrangement :
    Antivary f g ↔ ∀ i j, f i • g i + f j • g j ≤ f i • g j + f j • g i

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[LinearOrderedRing α]
[LinearOrderedAddCommGroup β]
[Module α β]
[OrderedSMul α β]
{f : ι → α}
{g : ι → β}

Antivary f g ↔ ∀ (i j : ι), f i • g i + f j • g j ≤ f i • g j + f j • g i


@[norm_cast]
theorem coe_ringHom_apply (f : α →+*o β) (a : α) : (f : α →+* β) a = f a

{α : Type u_2}
{β : Type u_3}
[NonAssocSemiring α]
[Preorder α]
[NonAssocSemiring β]
[Preorder β]
(f : α →+*o β)
(a : α)


@[to_additive]
lemma mul_prod_Ioc_eq_prod_Icc (h : a ≤ b) : f a * ∏ x ∈ Ioc a b, f x = ∏ x ∈ Icc a b, f x

{α : Type u_1}
{M : Type u_2}
[PartialOrder α]
[AddCommMonoid M]
{f : α → M}
{a b : α}
[LocallyFiniteOrder α]
(h : a ≤ b)

f a + ∑ x ∈ Finset.Ioc a b, f x = ∑ x ∈ Finset.Icc a b, f x


/-- `castPred` commutes with `succAbove`. -/
lemma castPred_succAbove_castPred {a : Fin (n + 2)} {b : Fin (n + 1)} (ha : a ≠ last (n + 1))
    (hb : b ≠ last n) (hk := succAbove_ne_last ha hb) :
    (a.castPred ha).succAbove (b.castPred hb) = (a.succAbove b).castPred hk

(hk : a.succAbove b ≠ Fin.last (n + 1) := ⋯)


theorem leftInverse_symm (e : A ≃⋆ₐ[R] B) : Function.LeftInverse e.symm e

{R : Type u_2}
{A : Type u_3}
{B : Type u_4}
[Add A]
[Add B]
[Mul A]
[Mul B]
[SMul R A]
[SMul R B]
[Star A]
[Star B]
(e : A ≃⋆ₐ[R] B)


@[simp]
theorem corec_eq (f : β → α ⊕ β) (b : β) : destruct (corec f b) = rmap (corec f) (f b)

{α : Type u}
{β : Type v}
(f : β → α ⊕ β)
(b : β)

(Computation.corec f b).destruct = Computation.rmap (Computation.corec f) (f b)


/-- Assuming that `f` is invertible and closable, then the closure is invertible if and only
if the inverse of `f` is closable. -/
theorem inverse_isClosable_iff (hf : LinearMap.ker f.toFun = ⊥) (hf' : f.IsClosable) :
    f.inverse.IsClosable ↔ LinearMap.ker f.closure.toFun = ⊥

{R : Type u_1}
{E : Type u_2}
{F : Type u_3}
[CommRing R]
[AddCommGroup E]
[AddCommGroup F]
[Module R E]
[Module R F]
[TopologicalSpace E]
[TopologicalSpace F]
[ContinuousAdd E]
[ContinuousAdd F]
[TopologicalSpace R]
[ContinuousSMul R E]
[ContinuousSMul R F]
{f : E →ₗ.[R] F}
(hf : LinearMap.ker f.toFun = ⊥)
(hf' : f.IsClosable)


@[simp]
theorem filter_single_neg {p : ι → Prop} [DecidablePred p] (i : ι) (x : β i) (h : ¬p i) :
    (single i x).filter p = 0

{ι : Type u}
{β : ι → Type v}
[DecidableEq ι]
[(i : ι) → Zero (β i)]
{p : ι → Prop}
[DecidablePred p]
(i : ι)
(x : β i)
(h : ¬p i)

DFinsupp.filter p (DFinsupp.single i x) = 0


lemma lipschitzWith_posPart : LipschitzWith 1 (posPart : α → α)

{α : Type u_1}
[NormedLatticeAddCommGroup α]


@[to_additive]
lemma coe_val_mul_coe_inv_val (S : Submonoid M) {x : Sˣ} :
    ((x : Sˣ) : M) * ((x⁻¹ : Sˣ) : M) = 1

{M : Type u_1}
[Monoid M]
(S : Submonoid M)
{x : (↥S)ˣ}

↑↑x * ↑↑x⁻¹ = 1


@[to_additive (attr := simp)]
theorem inv_surjective : Function.Surjective (Inv.inv : G → G)


@[simp, norm_cast] lemma coe_add (κ η : Kernel α β) : ⇑(κ + η) = κ + η

{α : Type u_1}
{β : Type u_2}
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}
(κ η : ProbabilityTheory.Kernel α β)

⇑(κ + η) = ⇑κ + ⇑η


/-- A split coequalizer diagram consists of morphisms

      f   π
    X ⇉ Y → Z
      g

satisfying `f ≫ π = g ≫ π` together with morphisms

      t   s
    X ← Y ← Z

satisfying `s ≫ π = 𝟙 Z`, `t ≫ g = 𝟙 Y` and `t ≫ f = π ≫ s`.

The name "coequalizer" is appropriate, since any split coequalizer is a coequalizer, see
`CategoryTheory.IsSplitCoequalizer.isCoequalizer`.
Split coequalizers are also absolute, since a functor preserves all the structure above.
-/
structure IsSplitCoequalizer {Z : C} (π : Y ⟶ Z) where
  /-- A map from the coequalizer to `Y` -/
  rightSection : Z ⟶ Y
  /-- A map in the opposite direction to `f` and `g` -/
  leftSection : Y ⟶ X
  /-- Composition of `π` with `f` and with `g` agree -/
  condition : f ≫ π = g ≫ π := by aesop_cat
  /-- `rightSection` splits `π` -/
  rightSection_π : rightSection ≫ π = 𝟙 Z := by aesop_cat
  /-- `leftSection` splits `g` -/
  leftSection_bottom : leftSection ≫ g = 𝟙 Y := by aesop_cat
  /-- `leftSection` composed with `f` is `pi` composed with `rightSection` -/
  leftSection_top : leftSection ≫ f = π ≫ rightSection := by aesop_cat

(self : CategoryTheory.IsSplitCoequalizer f g π)

CategoryTheory.CategoryStruct.comp self.rightSection π = CategoryTheory.CategoryStruct.id Z


protected theorem ediv_lt_of_lt_mul {a b c : Int} (H : 0 < c) (H' : a < b * c) : a / c < b


theorem rotate_rotate (l : List α) (n m : ℕ) : (l.rotate n).rotate m = l.rotate (n + m)


@[simp]
theorem submatrix_apply (A : Matrix m n α) (r_reindex : l → m) (c_reindex : o → n) (i j) :
    A.submatrix r_reindex c_reindex i j = A (r_reindex i) (c_reindex j)

{l : Type u_1}
{m : Type u_2}
{n : Type u_3}
{o : Type u_4}
{α : Type v}
(A : Matrix m n α)
(r_reindex : l → m)
(c_reindex : o → n)
(i : l)
(j : o)


@[simp]
theorem comp_id (f : α →. β) : f.comp (PFun.id α) = f

{α : Type u_1}
{β : Type u_2}
(f : α →. β)


lemma Cofan.IsColimit.hom_ext {I : Type*} {F : I → C} {c : Cofan F} (hc : IsColimit c) {A : C}
    (f g : c.pt ⟶ A) (h : ∀ i, c.inj i ≫ f = c.inj i ≫ g) : f = g

(hc : CategoryTheory.Limits.IsColimit c)

(h : ∀ (i : I), c.inj i ≫ f = c.inj i ≫ g)


@[to_additive (attr := simp)] theorem fst_comp_inr : (fst : M ∗ N →* M).comp inr = 1

{M : Type u_1}
{N : Type u_2}
[AddMonoid M]
[AddMonoid N]

AddMonoid.Coprod.fst.comp AddMonoid.Coprod.inr = 0


@[to_additive]
theorem op_iSup (S : ι → Subgroup G) : (iSup S).op = ⨆ i, (S i).op

{ι : Sort u_1}
{G : Type u_2}
[Group G]
(S : ι → Subgroup G)


@[simp] lemma of_add : of (w + z) = of w + of z

{R : Type u}
{S : Type v}
[CommRing R]
[CommRing S]
[Algebra R S]
{P : Algebra.Generators R S}
(w z : P.ker.Cotangent)

Algebra.Generators.Cotangent.of (w + z) = Algebra.Generators.Cotangent.of w + Algebra.Generators.Cotangent.of z


@[simp]
theorem coe_eq_univ_iff (Q : AffineSubspace k P) : (Q : Set P) = univ ↔ Q = ⊤

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[S : AffineSpace V P]
(Q : AffineSubspace k P)


lemma charP_of_card_eq_prime {R : Type*} [NonAssocRing R] [Fintype R] (p : ℕ) [hp : Fact p.Prime]
    (hR : Fintype.card R = p) : CharP R p

{R : Type u_1}
[NonAssocRing R]
[Fintype R]
(p : ℕ)
[hp : Fact (Nat.Prime p)]
(hR : Fintype.card R = p)


@[simp] lemma lt_erase : s < s.erase a ↔ a ∈ s

{α : Type u_1}
[Preorder α]
{s : UpperSet α}
{a : α}


/-- The norm, relative to `ℤ`, of `ζ - 1` in a `p ^ (k + 1)`-th cyclotomic extension of `ℚ` is
`p` if `p ≠ 2`. -/
lemma norm_toInteger_sub_one_of_prime_ne_two [IsCyclotomicExtension {p ^ (k + 1)} ℚ K]
    (hζ : IsPrimitiveRoot ζ ↑(p ^ (k + 1))) (hodd : p ≠ 2) :
    Algebra.norm ℤ (hζ.toInteger - 1) = p

(Algebra.norm ℤ) (hζ.toInteger - 1) = ↑↑p


@[simp]
theorem mem_positive {x : E} : x ∈ positive 𝕜 E ↔ 0 ≤ x

(𝕜 : Type u_1)
(E : Type u_2)
[OrderedSemiring 𝕜]
[OrderedAddCommGroup E]
[Module 𝕜 E]
[OrderedSMul 𝕜 E]
{x : E}


@[to_additive]
theorem op_le_iff {S₁ : Subgroup G} {S₂ : Subgroup Gᵐᵒᵖ} : S₁.op ≤ S₂ ↔ S₁ ≤ S₂.unop

{G : Type u_2}
[AddGroup G]
{S₁ : AddSubgroup G}
{S₂ : AddSubgroup Gᵃᵒᵖ}


@[to_additive (attr := simp)]
theorem coe_toMonoidHom (e : M ≃* N) : ⇑e.toMonoidHom = e

{M : Type u_6}
{N : Type u_7}
[AddZeroClass M]
[AddZeroClass N]
(e : M ≃+ N)


/-- The fourth simplicial identity -/
@[reassoc]
theorem δ_comp_σ_of_gt {n} {i : Fin (n + 2)} {j : Fin (n + 1)} (H : Fin.castSucc j < i) :
    δ i.succ ≫ σ (Fin.castSucc j) = σ j ≫ δ i

{n : ℕ}
{i : Fin (n + 2)}
{j : Fin (n + 1)}
(H : j.castSucc < i)

SimplexCategory.δ i.succ ≫ SimplexCategory.σ j.castSucc = SimplexCategory.σ j ≫ SimplexCategory.δ i


@[simp]
theorem isCoatomistic_dual_iff_isAtomistic : IsCoatomistic αᵒᵈ ↔ IsAtomistic α


theorem Iio_mem_nhds_zero (hγ : γ ≠ 0) : Iio γ ∈ 𝓝 (0 : Γ₀)

{Γ₀ : Type u_2}
[LinearOrderedCommGroupWithZero Γ₀]
{γ : Γ₀}
(hγ : γ ≠ 0)


/-- The equivalence of categories between `(A ⥤ B) × (A ⥤ C)` and `A ⥤ (B × C)` -/
@[simps]
def functorProdFunctorEquiv : (A ⥤ B) × (A ⥤ C) ≌ A ⥤ B × C

(A : Type u₁)
[CategoryTheory.Category.{v₁, u₁} A]
(B : Type u₂)
[CategoryTheory.Category.{v₂, u₂} B]
(C : Type u₃)
[CategoryTheory.Category.{v₃, u₃} C]

(CategoryTheory.functorProdFunctorEquiv A B C).inverse = CategoryTheory.functorProdToProdFunctor A B C


@[simp]
theorem units_inv_eq_self (u : ℤˣ) : u⁻¹ = u


@[simp] lemma toZeroHom_coe (f : α →*₀ β) : (f.toZeroHom : α → β) = f

{α : Type u_2}
{β : Type u_3}
[MulZeroOneClass α]
[MulZeroOneClass β]
(f : α →*₀ β)


/-- An affine basis is a family of affine-independent points whose span is the top subspace. -/
structure AffineBasis (ι : Type u₁) (k : Type u₂) {V : Type u₃} (P : Type u₄) [AddCommGroup V]
  [AffineSpace V P] [Ring k] [Module k V] where
  protected toFun : ι → P
  protected ind' : AffineIndependent k toFun
  protected tot' : affineSpan k (range toFun) = ⊤

{ι : Type u₁}
{k : Type u₂}
{V : Type u₃}
{P : Type u₄}
[AddCommGroup V]
[AffineSpace V P]
[Ring k]
[Module k V]
(self : AffineBasis ι k P)


theorem star_mul_self (A : unitaryGroup n α) : star A.1 * A.1 = 1

{n : Type u}
[DecidableEq n]
[Fintype n]
{α : Type v}
[CommRing α]
[StarRing α]
(A : ↥(Matrix.unitaryGroup n α))


@[symm]
theorem IndepSets.symm {_mΩ : MeasurableSpace Ω} {κ : Kernel α Ω} {μ : Measure α}
    {s₁ s₂ : Set (Set Ω)} (h : IndepSets s₁ s₂ κ μ) :
    IndepSets s₂ s₁ κ μ

(h : ProbabilityTheory.Kernel.IndepSets s₁ s₂ κ μ)

ProbabilityTheory.Kernel.IndepSets s₂ s₁ κ μ


theorem pow_le_self {n : ℕ} (hn : n ≠ 0) : I ^ n ≤ I

{R : Type u}
[CommSemiring R]
{I : Ideal R}
{n : ℕ}
(hn : n ≠ 0)


/-- `F.mapTriangle` commutes with the rotation of triangles. -/
@[simps!]
def mapTriangleRotateIso :
    F.mapTriangle ⋙ Pretriangulated.rotate D ≅
      Pretriangulated.rotate C ⋙ F.mapTriangle

(X : CategoryTheory.Pretriangulated.Triangle C)

(F.mapTriangleRotateIso.inv.app X).hom₃ = (F.commShiftIso 1).hom.app X.obj₁


theorem rank_sup_eq_rank_left_mul_rank_of_free :
    Module.rank R ↥(A ⊔ B) = Module.rank R A * Module.rank A (Algebra.adjoin A (B : Set S))

[Module.Free ↥A ↥(Algebra.adjoin ↥A ↑B)]

Module.rank R ↥(A ⊔ B) = Module.rank R ↥A * Module.rank ↥A ↥(Algebra.adjoin ↥A ↑B)


theorem le_map {f : Filter α} {m : α → β} {g : Filter β} (h : ∀ s ∈ f, m '' s ∈ g) : g ≤ f.map m

{α : Type u}
{β : Type v}
{f : Filter α}
{m : α → β}
{g : Filter β}
(h : ∀ s ∈ f, m '' s ∈ g)


/-- Implementation: If each costructured arrow category on `G` has a terminal object, an equivalence
which is helpful for constructing a right adjoint to `G`.
-/
@[simps]
def rightAdjointOfCostructuredArrowTerminalsAux (B : D) (A : C) :
    (G.obj B ⟶ A) ≃ (B ⟶ (⊤_ CostructuredArrow G A).left)

[∀ (A : C), CategoryTheory.Limits.HasTerminal (CategoryTheory.CostructuredArrow G A)]

(CategoryTheory.rightAdjointOfCostructuredArrowTerminalsAux G B A) g =
  (CategoryTheory.Limits.terminal.from (CategoryTheory.CostructuredArrow.mk g)).left


@[simp]
nonrec theorem volume_pi_closedBall (a : ι → ℝ) {r : ℝ} (hr : 0 ≤ r) :
    volume (Metric.closedBall a r) = ENNReal.ofReal ((2 * r) ^ Fintype.card ι)

{ι : Type u_1}
[Fintype ι]
(a : ι → ℝ)
{r : ℝ}
(hr : 0 ≤ r)

MeasureTheory.volume (Metric.closedBall a r) = ENNReal.ofReal ((2 * r) ^ Fintype.card ι)


@[to_additive]
lemma prod_map_ite_eq {A : Type*} [DecidableEq A] (l : List A) (f g : A → G) (a : A) :
    (l.map fun x => if x = a then f x else g x).prod
      = (f a / g a) ^ (l.count a) * (l.map g).prod

{G : Type u_7}
[AddCommGroup G]
{A : Type u_8}
[DecidableEq A]
(l : List A)
(f g : A → G)
(a : A)

(List.map (fun x => if x = a then f x else g x) l).sum = List.count a l • (f a - g a) + (List.map g l).sum


theorem one_lt_card_iff_nontrivial : 1 < card α ↔ Nontrivial α


@[simp]
theorem Part.bind_comp (f : β →. γ) (g : α →. β) (a : Part α) :
    a.bind (f.comp g) = (a.bind g).bind f

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
(f : β →. γ)
(g : α →. β)
(a : Part α)


@[simp]
theorem zipRight'_cons_cons :
    zipRight' (a :: as) (b :: bs) =
      let r := zipRight' as bs
      ((some a, b) :: r.fst, r.snd)

{α : Type u}
{β : Type v}
(a : α)
(as : List α)
(b : β)
(bs : List β)

(a :: as).zipRight' (b :: bs) =
  let r := as.zipRight' bs;
  ((some a, b) :: r.1, r.2)


@[simp] lemma closure_insert_closure_eq_closure_insert (M : Matroid α) (e : α) (X : Set α) :
    M.closure (insert e (M.closure X)) = M.closure (insert e X)

{α : Type u_2}
(M : Matroid α)
(e : α)
(X : Set α)


@[simp, norm_cast]
theorem coe_toList (s : Finset α) : (s.toList : Multiset α) = s.val


theorem isCompl_range_inl_range_inr : IsCompl (range <| @Sum.inl α β) (range Sum.inr)

IsCompl (Set.range Sum.inl) (Set.range Sum.inr)


@[fun_prop]
theorem Differentiable.star (h : Differentiable 𝕜 f) : Differentiable 𝕜 fun y => star (f y)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
[StarRing 𝕜]
[TrivialStar 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[StarAddMonoid F]
[NormedSpace 𝕜 F]
[StarModule 𝕜 F]
[ContinuousStar F]
{f : E → F}
(h : Differentiable 𝕜 f)


@[simp, mfld_simps]
theorem right_inv {x : β} (h : x ∈ e.target) : e (e.symm x) = x

{α : Type u_1}
{β : Type u_2}
(e : PartialEquiv α β)
{x : β}
(h : x ∈ e.target)


@[simp]
theorem coe_neg_linearMap (D : LieDerivation R L M) : ↑(-D) = (-D : L →ₗ[R] M)

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


/-- The sequence `stirlingSeq ∘ succ` is monotone decreasing -/
theorem stirlingSeq'_antitone : Antitone (stirlingSeq ∘ succ)

Antitone (Stirling.stirlingSeq ∘ Nat.succ)


@[simp] lemma lie_lieDerivation_apply (x y : L) (D : LieDerivation R L M) :
    ⁅x, D⁆ y = ⁅y, D x⁆

(R : Type u_1)
(L : Type u_2)
(M : Type u_3)
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
(x y : L)
(D : LieDerivation R L M)


theorem mul_add_left_right_iff {x y z : R} : IsCoprime x (x * z + y) ↔ IsCoprime x y


/-- The special-value formula `Γ(1/2) = √π`, which is equivalent to the Gaussian integral. -/
theorem Complex.Gamma_one_half_eq : Complex.Gamma (1 / 2) = (π : ℂ) ^ (1 / 2 : ℂ)


lemma of_yoneda_arrow {Y : C} {η : yoneda.obj Y ⟶ A} {X : C} {s : yoneda.obj X ⟶ A} {f : X ⟶ Y}
    (hf : yoneda.map f ≫ η = s) : MakesOverArrow η s f

{A : CategoryTheory.Functor Cᵒᵖ (Type v)}

(hf : CategoryTheory.CategoryStruct.comp (CategoryTheory.yoneda.map f) η = s)

CategoryTheory.OverPresheafAux.MakesOverArrow η s f


@[simp]
theorem genEigenspace_zero (f : End R M) (k : ℕ) :
    f.genEigenspace 0 k = LinearMap.ker (f ^ k)

{R : Type v}
{M : Type w}
[CommRing R]
[AddCommGroup M]
[Module R M]
(f : Module.End R M)
(k : ℕ)

(f.genEigenspace 0) k = LinearMap.ker (f ^ k)


theorem HasStrictDerivAt.sub (hf : HasStrictDerivAt f f' x) (hg : HasStrictDerivAt g g' x) :
    HasStrictDerivAt (fun x => f x - g x) (f' - g') x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f g : 𝕜 → F}
{f' g' : F}
{x : 𝕜}
(hf : HasStrictDerivAt f f' x)
(hg : HasStrictDerivAt g g' x)


/-- The *Euler Product* for multiplicative (on coprime arguments) functions.

If `f : ℕ → R`, where `R` is a complete normed commutative ring, `f 0 = 0`, `f 1 = 1`, `f` is
multiplicative on coprime arguments, and `‖f ·‖` is summable, then
`∏' p : {p : ℕ | p.Prime}, ∑' e, f (p ^ e) = ∑' n, f n`. -/
theorem eulerProduct_tprod (hsum : Summable (‖f ·‖)) (hf₀ : f 0 = 0) :
    ∏' p : Primes, ∑' e, f (p ^ e) = ∑' n, f n

(hmul : ∀ {m n : ℕ}, m.Coprime n → f (m * n) = f m * f n)

∏' (p : Nat.Primes), ∑' (e : ℕ), f (↑p ^ e) = ∑' (n : ℕ), f n


/-- The continuous homomorphism given by projection onto the second factor. -/
@[to_additive (attr := simps!)
  "The continuous homomorphism given by projection onto the second factor."]
def snd : ContinuousMonoidHom (A × B) B

(A : Type u_2)
(B : Type u_3)
[AddMonoid A]
[AddMonoid B]
[TopologicalSpace A]
[TopologicalSpace B]
(self : A × B)

(ContinuousAddMonoidHom.snd A B) self = self.2


@[simp] theorem congr_trans_rTensor (f' : P ≃ₗ[R] S) (f : M ≃ₗ[R] P) (g : N ≃ₗ[R] Q) :
    TensorProduct.congr f g ≪≫ₗ f'.rTensor _ = TensorProduct.congr (f ≪≫ₗ f') g

{R : Type u_1}
[CommSemiring R]
(M : Type u_4)
{N : Type u_5}
{P : Type u_6}
{Q : Type u_7}
{S : Type u_8}
[AddCommMonoid M]
[AddCommMonoid N]
[AddCommMonoid P]
[AddCommMonoid Q]
[AddCommMonoid S]
[Module R M]
[Module R N]
[Module R P]
[Module R Q]
[Module R S]
(f' : P ≃ₗ[R] S)
(f : M ≃ₗ[R] P)
(g : N ≃ₗ[R] Q)

TensorProduct.congr f g ≪≫ₗ LinearEquiv.rTensor Q f' = TensorProduct.congr (f ≪≫ₗ f') g


theorem Periodic.add_period [AddSemigroup α] (h1 : Periodic f c₁) (h2 : Periodic f c₂) :
    Periodic f (c₁ + c₂)

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{c₁ c₂ : α}
[AddSemigroup α]
(h1 : Function.Periodic f c₁)
(h2 : Function.Periodic f c₂)


theorem map_injective_of_injective : Function.Injective (map f)

{R : Type u_1}
{R₂ : Type u_3}
{M : Type u_5}
{M₂ : Type u_7}
[Semiring R]
[Semiring R₂]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R₂ M₂]
{σ₁₂ : R →+* R₂}
{F : Type u_9}
[FunLike F M M₂]
[SemilinearMapClass F σ₁₂ M M₂]
[RingHomSurjective σ₁₂]
{f : F}
(hf : Function.Injective ⇑f)


/-- If `x ∈ [a, b]`, then the distance between `c` and `b` is less than or equal to
that of `a` and `b`  -/
theorem abs_sub_right_of_mem_uIcc (h : c ∈ [[a, b]]) : |b - c| ≤ |b - a|

{α : Type u_1}
[LinearOrderedAddCommGroup α]
{a b c : α}
(h : c ∈ [[a, b]])


@[simp]
theorem Equiv.realize_term {v : α → M} (t : L.Term α) (g : M ≃[L] N) :
    t.realize (g ∘ v) = g (t.realize v)

{L : FirstOrder.Language}
{M : Type w}
{N : Type u_1}
[L.Structure M]
[L.Structure N]
{α : Type u'}
{v : α → M}
(t : L.Term α)
(g : L.Equiv M N)

FirstOrder.Language.Term.realize (⇑g ∘ v) t = g (FirstOrder.Language.Term.realize v t)


/-- Any homeomorphisms induces an isomorphism in `Top`. -/
@[simps]
def isoOfHomeo {X Y : TopCat.{u}} (f : X ≃ₜ Y) : X ≅ Y

(TopCat.isoOfHomeo f).inv = f.symm.toContinuousMap


/-- If `C` has an initial object and `G` preserves initial objects, then `D` has an initial object
also.
Note this property is somewhat unique to colimits of the empty diagram: for general `J`, if `C`
has colimits of shape `J` and `G` preserves them, then `D` does not necessarily have colimits of
shape `J`.
-/
theorem hasInitial_of_hasInitial_of_preservesColimit [PreservesColimit (Functor.empty.{0} C) G] :
    HasInitial D

[CategoryTheory.Limits.PreservesColimit (CategoryTheory.Functor.empty C) G]


theorem fderiv_const_smul (h : DifferentiableAt 𝕜 f x) (c : R) :
    fderiv 𝕜 (fun y => c • f y) x = c • fderiv 𝕜 f x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{x : E}
{R : Type u_6}
[Semiring R]
[Module R F]
[SMulCommClass 𝕜 R F]
[ContinuousConstSMul R F]
(h : DifferentiableAt 𝕜 f x)
(c : R)


/-- `SameRay` is reflexive. -/
@[refl]
theorem refl (x : M) : SameRay R x x

{R : Type u_1}
[StrictOrderedCommSemiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
(x : M)


/-- Given a linear map `f : N → P`, `f ⊗ M` is surjective if and only if `M ⊗ f` is surjective. -/
theorem lTensor_surj_iff_rTensor_surj :
    Function.Surjective (lTensor M f) ↔ Function.Surjective (rTensor M f)

{R : Type u_1}
[CommSemiring R]
(M : Type u_4)
{N : Type u_5}
{P : Type u_6}
[AddCommMonoid M]
[AddCommMonoid N]
[AddCommMonoid P]
[Module R M]
[Module R N]
[Module R P]
(f : N →ₗ[R] P)

Function.Surjective ⇑(LinearMap.lTensor M f) ↔ Function.Surjective ⇑(LinearMap.rTensor M f)


/-- The unit isomorphism of the equivalence -/
@[simps!]
def unitIso : 𝟭 (Karoubi C) ≅ toKaroubi (Karoubi C) ⋙ inverse C

(X : CategoryTheory.Idempotents.Karoubi C)

((CategoryTheory.Idempotents.KaroubiKaroubi.unitIso C).hom.app X).f = X.p


/-- A copy of `DirectedSystem.map_map` specialized to `L`-embeddings, as otherwise the
`fun i j h ↦ f i j h` can confuse the simplifier. -/
nonrec theorem map_map [DirectedSystem G fun i j h => f i j h] {i j k} (hij hjk x) :
    f j k hjk (f i j hij x) = f i k (le_trans hij hjk) x

[DirectedSystem G fun i j h => ⇑(f i j h)]

(f j k hjk) ((f i j hij) x) = (f i k ⋯) x


theorem setIntegral_congr (hs : MeasurableSet s) (h : EqOn f g s) :
    ∫ x in s, f x ∂μ = ∫ x in s, g x ∂μ

{X : Type u_1}
{E : Type u_3}
[MeasurableSpace X]
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f g : X → E}
{s : Set X}
{μ : MeasureTheory.Measure X}
(hs : MeasurableSet s)
(h : Set.EqOn f g s)

∫ (x : X) in s, f x ∂μ = ∫ (x : X) in s, g x ∂μ


@[to_additive]
theorem Monotone.inv (hf : Monotone f) : Antitone fun x => (f x)⁻¹

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

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


/-- The oriented angle between two nonzero vectors is zero if and only if the unoriented angle
is zero. -/
theorem oangle_eq_zero_iff_angle_eq_zero {x y : V} (hx : x ≠ 0) (hy : y ≠ 0) :
    o.oangle x y = 0 ↔ InnerProductGeometry.angle x y = 0

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


theorem Orthonormal.ne_zero {v : ι → E} (hv : Orthonormal 𝕜 v) (i : ι) : v i ≠ 0

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{ι : Type u_4}
{v : ι → E}
(hv : Orthonormal 𝕜 v)
(i : ι)


theorem t1Space_iff_isField [IsDomain R] : T1Space (PrimeSpectrum R) ↔ IsField R

{R : Type u}
[CommSemiring R]
[IsDomain R]


@[simp]
theorem div_mul_cancel_of_invertible (a b : α) [Invertible b] : a / b * b = a

{α : Type u}
[GroupWithZero α]
(a b : α)
[Invertible b]


theorem leftAdjointSquare.comp_vhcomp
    (α : G₁ ⋙ L₃ ⟶ L₁ ⋙ H₁) (β : H₁ ⋙ L₄ ⟶ L₂ ⋙ K₁)
    (γ : G₂ ⋙ L₅ ⟶ L₃ ⋙ H₂) (δ : H₂ ⋙ L₆ ⟶ L₄ ⋙ K₂) :
    leftAdjointSquare.comp α β γ δ =
      leftAdjointSquare.vcomp (leftAdjointSquare.hcomp α β) (leftAdjointSquare.hcomp γ δ)

{A : Type u₁}
{B : Type u₂}
{C : Type u₃}
{D : Type u₄}
{E : Type u₅}
{F : Type u₆}
{X : Type u₇}
{Y : Type u₈}
{Z : Type u₉}
[CategoryTheory.Category.{v₁, u₁} A]
[CategoryTheory.Category.{v₂, u₂} B]
[CategoryTheory.Category.{v₃, u₃} C]
[CategoryTheory.Category.{v₄, u₄} D]
[CategoryTheory.Category.{v₅, u₅} E]
[CategoryTheory.Category.{v₆, u₆} F]
[CategoryTheory.Category.{v₇, u₇} X]
[CategoryTheory.Category.{v₈, u₈} Y]
[CategoryTheory.Category.{v₉, u₉} Z]
{G₁ : CategoryTheory.Functor A D}
{H₁ : CategoryTheory.Functor B E}
{K₁ : CategoryTheory.Functor C F}
{G₂ : CategoryTheory.Functor D X}
{H₂ : CategoryTheory.Functor E Y}
{K₂ : CategoryTheory.Functor F Z}
{L₁ : CategoryTheory.Functor A B}
{L₂ : CategoryTheory.Functor B C}
{L₃ : CategoryTheory.Functor D E}
{L₄ : CategoryTheory.Functor E F}
{L₅ : CategoryTheory.Functor X Y}
{L₆ : CategoryTheory.Functor Y Z}
(α : G₁.comp L₃ ⟶ L₁.comp H₁)
(β : H₁.comp L₄ ⟶ L₂.comp K₁)
(γ : G₂.comp L₅ ⟶ L₃.comp H₂)
(δ : H₂.comp L₆ ⟶ L₄.comp K₂)

CategoryTheory.leftAdjointSquare.comp α β γ δ =
  CategoryTheory.leftAdjointSquare.vcomp (CategoryTheory.leftAdjointSquare.hcomp α β)
    (CategoryTheory.leftAdjointSquare.hcomp γ δ)


theorem assert_pos {p : Prop} {f : p → Part α} (h : p) : assert p f = f h

{α : Type u_1}
{p : Prop}
{f : p → Part α}
(h : p)


@[simp]
theorem const_max [LinearOrder β] (x y : β) : (↑(max x y : β) : β*) = max ↑x ↑y

{α : Type u}
{β : Type v}
{φ : Ultrafilter α}
[LinearOrder β]
(x y : β)


/-- If `0 : X ⟶ Y` is a monomorphism, then `X ≅ 0`. -/
@[simps]
def isoZeroOfMonoZero {X Y : C} (h : Mono (0 : X ⟶ Y)) : X ≅ 0

(CategoryTheory.Limits.isoZeroOfMonoZero h).inv = 0


/-- The affine span of a set is nonempty if and only if that set is. -/
theorem affineSpan_nonempty : (affineSpan k s : Set P).Nonempty ↔ s.Nonempty

(k : Type u_1)
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{s : Set P}

(↑(affineSpan k s)).Nonempty ↔ s.Nonempty


/-- If `s` is a closed set and two functions `f` and `g` are continuous on `s`,
then the set `{x ∈ s | f x ≤ g x}` is a closed set. -/
theorem IsClosed.isClosed_le [TopologicalSpace β] {f g : β → α} {s : Set β} (hs : IsClosed s)
    (hf : ContinuousOn f s) (hg : ContinuousOn g s) : IsClosed ({ x ∈ s | f x ≤ g x })

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[Preorder α]
[t : OrderClosedTopology α]
[TopologicalSpace β]
{f g : β → α}
{s : Set β}
(hs : IsClosed s)
(hf : ContinuousOn f s)
(hg : ContinuousOn g s)


theorem coe_iSup_of_directed [Nonempty ι] {S : ι → NonUnitalStarSubalgebra R A}
    (dir : Directed (· ≤ ·) S) : ↑(iSup S) = ⋃ i, (S i : Set A)

(dir : Directed (fun x x_1 => x ≤ x_1) S)


@[deprecated drop_drop (since := "2024-06-15")]
theorem drop_add (m n) (l : List α) : drop (m + n) l = drop m (drop n l)

List.drop (m + n) l = List.drop m (List.drop n l)


theorem ne_none_iff_exists' : o ≠ none ↔ ∃ x, o = some x

∀ {α : Type u_1} {o : Option α}, o ≠ none ↔ ∃ x, o = some x


/-- Read off the continuity of a function `f : Z → X` at `z : Z` by transferring via a
trivialization of `Z` containing `z`. -/
theorem continuousAt_of_comp_right {X : Type*} [TopologicalSpace X] {f : Z → X} {z : Z}
    (e : Trivialization F proj) (he : proj z ∈ e.baseSet)
    (hf : ContinuousAt (f ∘ e.toPartialEquiv.symm) (e z)) : ContinuousAt f z

(hf : ContinuousAt (f ∘ ↑e.symm) (↑e z))


@[simp]
theorem coeffs_ofSubring {p : T[X]} : (↑(p.ofSubring T).coeffs : Set R) ⊆ T

{R : Type u}
[Ring R]
(T : Subring R)
{p : (↥T)[X]}


@[to_additive]
theorem unique_one {α : Type*} [Unique α] [One α] : default = (1 : α)


lemma mem_uIcc_of_ge (hb : b ≤ x) (ha : x ≤ a) : x ∈ [[a, b]]

{α : Type u_1}
[Lattice α]
{a b x : α}
(hb : b ≤ x)
(ha : x ≤ a)


theorem conformalFactorAt_inner_eq_mul_inner' {f : E → F} {x : E} (h : ConformalAt f x) (u v : E) :
    ⟪(fderiv ℝ f x) u, (fderiv ℝ f x) v⟫ = (conformalFactorAt h : ℝ) * ⟪u, v⟫

{E : Type u_1}
{F : Type u_2}
[NormedAddCommGroup E]
[NormedAddCommGroup F]
[InnerProductSpace ℝ E]
[InnerProductSpace ℝ F]
{f : E → F}
{x : E}
(h : ConformalAt f x)
(u v : E)

⟪(fderiv ℝ f x) u, (fderiv ℝ f x) v⟫_ℝ = conformalFactorAt h * ⟪u, v⟫_ℝ


theorem mk_one' (p : K[X]) :
    RatFunc.mk p 1 = ofFractionRing (algebraMap K[X] (FractionRing K[X]) p)

{K : Type u}
[CommRing K]
[IsDomain K]
(p : K[X])

RatFunc.mk p 1 = { toFractionRing := (algebraMap K[X] (FractionRing K[X])) p }


/-- Given `F : { i // i ≤ j } ⥤ C`, `i : J` such that `hi : i ≤ j`, this is the
cocone consisting of all maps `F.obj ⟨k, hk⟩ ⟶ F.obj ⟨i, hi⟩` for `k : J` such that `k < i`. -/
@[simps]
def coconeOfLE : Cocone (restrictionLT F hi)

(F : CategoryTheory.Functor { i // i ≤ j } C)

∀ (x : { k // k < i }),
  (CategoryTheory.Functor.Iteration.coconeOfLE F hi).ι.app x =
    match x with
    | ⟨k, hk⟩ => F.map (CategoryTheory.homOfLE ⋯)


theorem funLeft_injective_of_surjective (f : m → n) (hf : Surjective f) :
    Injective (funLeft R M f)

(R : Type u_1)
(M : Type u_8)
[Semiring R]
[AddCommMonoid M]
[Module R M]
{m : Type u_17}
{n : Type u_18}
(f : m → n)
(hf : Function.Surjective f)

Function.Injective ⇑(LinearMap.funLeft R M f)


@[to_additive (attr := simp)]
theorem biUnion_smul_finset (s : Finset α) (t : Finset β) : s.biUnion (· • t) = s • t

{α : Type u_2}
{β : Type u_3}
[DecidableEq β]
[SMul α β]
(s : Finset α)
(t : Finset β)


/-- Over a characteristic-zero division ring, the centroids of two
faces of a simplex are equal if and only if those faces are given by
the same subset of points. -/
theorem face_centroid_eq_iff [CharZero k] {n : ℕ} (s : Simplex k P n)
    {fs₁ fs₂ : Finset (Fin (n + 1))} {m₁ m₂ : ℕ} (h₁ : fs₁.card = m₁ + 1) (h₂ : fs₂.card = m₂ + 1) :
    Finset.univ.centroid k (s.face h₁).points = Finset.univ.centroid k (s.face h₂).points ↔
      fs₁ = fs₂

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[DivisionRing k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
[CharZero k]
{n : ℕ}
(s : Affine.Simplex k P n)
{fs₁ fs₂ : Finset (Fin (n + 1))}
{m₁ m₂ : ℕ}
(h₁ : fs₁.card = m₁ + 1)
(h₂ : fs₂.card = m₂ + 1)

Finset.centroid k Finset.univ (s.face h₁).points = Finset.centroid k Finset.univ (s.face h₂).points ↔ fs₁ = fs₂


theorem toOuterMeasure_apply_eq_of_inter_support_eq {s t : Set α}
    (h : s ∩ p.support = t ∩ p.support) : p.toOuterMeasure s = p.toOuterMeasure t

{α : Type u_1}
(p : PMF α)
{s t : Set α}
(h : s ∩ p.support = t ∩ p.support)


theorem Submartingale.bddAbove_iff_exists_tendsto_aux [IsFiniteMeasure μ] (hf : Submartingale f ℱ μ)
    (hf0 : f 0 = 0) (hbdd : ∀ᵐ ω ∂μ, ∀ i, |f (i + 1) ω - f i ω| ≤ R) :
    ∀ᵐ ω ∂μ, BddAbove (Set.range fun n => f n ω) ↔ ∃ c, Tendsto (fun n => f n ω) atTop (𝓝 c)

{f : ℕ → Ω → ℝ}

(hf : MeasureTheory.Submartingale f ℱ μ)

(hbdd : ∀ᵐ (ω : Ω) ∂μ, ∀ (i : ℕ), |f (i + 1) ω - f i ω| ≤ ↑R)

∀ᵐ (ω : Ω) ∂μ, BddAbove (Set.range fun n => f n ω) ↔ ∃ c, Filter.Tendsto (fun n => f n ω) Filter.atTop (𝓝 c)


@[simp]
theorem mkPiAlgebra_apply (m : ι → A) : MultilinearMap.mkPiAlgebra R ι A m = ∏ i, m i

{R : Type uR}
{ι : Type uι}
[CommSemiring R]
{A : Type u_1}
[CommSemiring A]
[Algebra R A]
[Fintype ι]
(m : ι → A)

(MultilinearMap.mkPiAlgebra R ι A) m = ∏ i : ι, m i


@[simp]
protected lemma comp_add {n₁ n₂ n₁₂ : ℤ} (z₁ : Cochain F G n₁) (z₂ z₂' : Cochain G K n₂)
    (h : n₁ + n₂ = n₁₂) : z₁.comp (z₂ + z₂') h = z₁.comp z₂ h + z₁.comp z₂' h

(z₁ : CochainComplex.HomComplex.Cochain F G n₁)

(z₂ z₂' : CochainComplex.HomComplex.Cochain G K n₂)


@[to_additive prod_top]
theorem prod_top (s : Subsemigroup M) : s.prod (⊤ : Subsemigroup N) = s.comap (MulHom.fst M N)

{M : Type u_1}
{N : Type u_2}
[Mul M]
[Mul N]
(s : Subsemigroup M)

s.prod ⊤ = Subsemigroup.comap (MulHom.fst M N) s


theorem hasDerivAt_single (i : ι) (y : 𝕜) :
    HasDerivAt (Pi.single (f := fun _ ↦ 𝕜) i) (Pi.single i (1 : 𝕜)) y

{𝕜 : Type u_1}
{ι : Type u_2}
[DecidableEq ι]
[Fintype ι]
[NontriviallyNormedField 𝕜]
(i : ι)
(y : 𝕜)

HasDerivAt (Pi.single i) (Pi.single i 1) y


/-- A strong epimorphism `f` is an epimorphism which has the left lifting property
with respect to monomorphisms. -/
class StrongEpi (f : P ⟶ Q) : Prop where
  /-- The epimorphism condition on `f` -/
  epi : Epi f
  /-- The left lifting property with respect to all monomorphism -/
  llp : ∀ ⦃X Y : C⦄ (z : X ⟶ Y) [Mono z], HasLiftingProperty f z

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{P Q : C}
{f : P ⟶ Q}
[self : CategoryTheory.StrongEpi f]
⦃X Y : C⦄
(z : X ⟶ Y)
[CategoryTheory.Mono z]


theorem extendScalars_le_extendScalars_iff : extendScalars h ≤ extendScalars h' ↔ E ≤ E'

{L : Type u_2}
[Field L]
{F E E' : Subfield L}
(h : F ≤ E)
(h' : F ≤ E')

Subfield.extendScalars h ≤ Subfield.extendScalars h' ↔ E ≤ E'


@[simp]
theorem comap_map_comap {S : L.Substructure N} {f : M →[L] N} :
    ((S.comap f).map f).comap f = S.comap f

{L : FirstOrder.Language}
{M : Type w}
{N : Type u_1}
[L.Structure M]
[L.Structure N]
{S : L.Substructure N}
{f : L.Hom M N}

FirstOrder.Language.Substructure.comap f
    (FirstOrder.Language.Substructure.map f (FirstOrder.Language.Substructure.comap f S)) =
  FirstOrder.Language.Substructure.comap f S


theorem pairwise_coe_iff_pairwise {r : α → α → Prop} (hr : Symmetric r) {l : List α} :
    Multiset.Pairwise r l ↔ l.Pairwise r

{α : Type u_1}
{r : α → α → Prop}
(hr : Symmetric r)
{l : List α}

Multiset.Pairwise r ↑l ↔ List.Pairwise r l


theorem of_iUnion_nonpos {M : Type*} [TopologicalSpace M] [OrderedAddCommMonoid M]
    [OrderClosedTopology M] {v : VectorMeasure α M} (hf₁ : ∀ i, MeasurableSet (f i))
    (hf₂ : Pairwise (Disjoint on f)) (hf₃ : ∀ i, v (f i) ≤ 0) : v (⋃ i, f i) ≤ 0

{α : Type u_1}
{m : MeasurableSpace α}
{f : ℕ → Set α}
{M : Type u_4}
[TopologicalSpace M]
[OrderedAddCommMonoid M]
[OrderClosedTopology M]
{v : MeasureTheory.VectorMeasure α M}
(hf₁ : ∀ (i : ℕ), MeasurableSet (f i))
(hf₂ : Pairwise (Disjoint on f))
(hf₃ : ∀ (i : ℕ), ↑v (f i) ≤ 0)


/--
Turn a comonoid object into a monoid object in the opposite category.
-/
@[simps] def Comon_ToMon_OpOp_obj' (A : Comon_ C) : Mon_ (Cᵒᵖ)

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

(Comon_.Comon_ToMon_OpOp_obj' C A).one = A.counit.op


@[simp] protected theorem false_le : ∀ (x : Bool), false ≤ x


theorem isMaxOn_iff : IsMaxOn f s a ↔ ∀ x ∈ s, f x ≤ f a

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


theorem arcsin_sin {x : ℝ} (hx₁ : -(π / 2) ≤ x) (hx₂ : x ≤ π / 2) : arcsin (sin x) = x


theorem coordinate_eval_1 : (coordinate 1).eval (.ofList (a0 :: a1 :: t)) = a1

(Lean.Omega.LinearCombo.coordinate 1).eval (Lean.Omega.Coeffs.ofList (a0 :: a1 :: t)) = a1


theorem isUnit_to_map_iff (x : R) : IsUnit ((algebraMap R S) x) ↔ x ∈ I.primeCompl

{R : Type u_1}
[CommSemiring R]
(S : Type u_2)
[CommSemiring S]
[Algebra R S]
(I : Ideal R)
[hI : I.IsPrime]
[IsLocalization.AtPrime S I]
(x : R)


/-- Double integrals commute with addition. This is the version with `(f + g) (x, y)`
  (instead of `f (x, y) + g (x, y)`) in the LHS. -/
theorem integral_integral_add' ⦃f g : α × β → E⦄ (hf : Integrable f (μ.prod ν))
    (hg : Integrable g (μ.prod ν)) :
    (∫ x, ∫ y, (f + g) (x, y) ∂ν ∂μ) = (∫ x, ∫ y, f (x, y) ∂ν ∂μ) + ∫ x, ∫ y, g (x, y) ∂ν ∂μ

⦃f g : α × β → E⦄

(hf : MeasureTheory.Integrable f (μ.prod ν))

(hg : MeasureTheory.Integrable g (μ.prod ν))

∫ (x : α), ∫ (y : β), (f + g) (x, y) ∂ν ∂μ = ∫ (x : α), ∫ (y : β), f (x, y) ∂ν ∂μ + ∫ (x : α), ∫ (y : β), g (x, y) ∂ν ∂μ


theorem surjective_eval {α : Sort u} {β : α → Sort v} [h : ∀ a, Nonempty (β a)] (a : α) :
    Surjective (eval a : (∀ a, β a) → β a)

{α : Sort u}
{β : α → Sort v}
[h : ∀ (a : α), Nonempty (β a)]
(a : α)


theorem inv_eq_zero {φ : MvPowerSeries σ k} : φ⁻¹ = 0 ↔ constantCoeff σ k φ = 0

{σ : Type u_1}
{k : Type u_3}
[Field k]
{φ : MvPowerSeries σ k}

φ⁻¹ = 0 ↔ (MvPowerSeries.constantCoeff σ k) φ = 0


@[to_additive (attr := simp)]
protected theorem smul_cancel {r : X} {s t : S} : ((s : R) /ₒ t) • (r /ₒ s) = r /ₒ t

{R : Type u_1}
[Monoid R]
{S : Submonoid R}
[OreLocalization.OreSet S]
{X : Type u_2}
[MulAction R X]
{r : X}
{s t : ↥S}


@[simp]
theorem kstar_eq_self : a∗ = a ↔ a * a = a ∧ 1 ≤ a

{α : Type u_1}
[KleeneAlgebra α]
{a : α}


@[to_additive]
theorem IsUpperSet.div_right (hs : IsUpperSet s) : IsUpperSet (s / t)

{α : Type u_1}
[OrderedCommGroup α]
{s t : Set α}
(hs : IsUpperSet s)


@[simp, nolint simpComm]
theorem unop_eq_zero_iff [Zero α] (a : αᵐᵒᵖ) : a.unop = (0 : α) ↔ a = (0 : αᵐᵒᵖ)


@[simp, norm_cast]
theorem mem_coe_interval [PartialOrder α] {s : NonemptyInterval α} {x : α} :
    x ∈ (s : Interval α) ↔ x ∈ s

{α : Type u_1}
[PartialOrder α]
{s : NonemptyInterval α}
{x : α}

x ∈ ↑s ↔ x ∈ s


/-- Let `v` be an indexed family of `n` orthogonal vectors in an oriented `n`-dimensional
real inner product space `E`. The output of the volume form of `E` when evaluated on `v` is, up to
sign, the product of the norms of the vectors `v i`. -/
theorem abs_volumeForm_apply_of_pairwise_orthogonal {v : Fin n → E}
    (hv : Pairwise fun i j => ⟪v i, v j⟫ = 0) : |o.volumeForm v| = ∏ i : Fin n, ‖v i‖

[_i : Fact (FiniteDimensional.finrank ℝ E = n)]

(hv : Pairwise fun i j => ⟪v i, v j⟫_ℝ = 0)


/-- A function `f` has the continuous linear map `f'` as derivative along the filter `L` if
`f x' = f x + f' (x' - x) + o (x' - x)` when `x'` converges along the filter `L`. This definition
is designed to be specialized for `L = 𝓝 x` (in `HasFDerivAt`), giving rise to the usual notion
of Fréchet derivative, and for `L = 𝓝[s] x` (in `HasFDerivWithinAt`), giving rise to
the notion of Fréchet derivative along the set `s`. -/
@[mk_iff hasFDerivAtFilter_iff_isLittleO]
structure HasFDerivAtFilter (f : E → F) (f' : E →L[𝕜] F) (x : E) (L : Filter E) : Prop where
  of_isLittleO :: isLittleO : (fun x' => f x' - f x - f' (x' - x)) =o[L] fun x' => x' - x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
(f : E → F)
(f' : E →L[𝕜] F)
(x : E)
(L : Filter E)

HasFDerivAtFilter f f' x L ↔ (fun x' => f x' - f x - f' (x' - x)) =o[L] fun x' => x' - x


@[to_additive zsmul_right_injective
"See also `smul_right_injective`. TODO: provide a `NoZeroSMulDivisors` instance. We can't do
that here because importing that definition would create import cycles."]
lemma zpow_left_injective (hn : n ≠ 0) : Injective ((· ^ n) : α → α)

{α : Type u_1}
[LinearOrderedCommGroup α]
{n : ℤ}
(hn : n ≠ 0)


/-- Test for convergence of the `p`-series: the real-valued series `∑' n : ℕ, (n ^ p)⁻¹` converges
if and only if `1 < p`. -/
@[simp]
theorem summable_nat_pow_inv {p : ℕ} :
    Summable (fun n => ((n : ℝ) ^ p)⁻¹ : ℕ → ℝ) ↔ 1 < p


/-- Every polynomial splits in the field extension `f : K →+* k` if `k` is algebraically closed.

See also `IsAlgClosed.splits_domain` for the case where `K` is algebraically closed.
-/
theorem IsAlgClosed.splits_codomain {k K : Type*} [Field k] [IsAlgClosed k] [Field K] {f : K →+* k}
    (p : K[X]) : p.Splits f

{k : Type u_1}
{K : Type u_2}
[Field k]
[IsAlgClosed k]
[Field K]
{f : K →+* k}
(p : K[X])


@[simp]
theorem range_eq {α : Type*} (f : Bool → α) : range f = {f false, f true}


theorem norm_injOn_ray_right (hy : y ≠ 0) : { x | SameRay ℝ x y }.InjOn norm

{F : Type u_2}
[NormedAddCommGroup F]
[NormedSpace ℝ F]
{y : F}
(hy : y ≠ 0)


theorem IsRat.den_nz {α} [DivisionRing α] {a n d} : IsRat (a : α) n d → (d : α) ≠ 0

{α : Type u_1}
[DivisionRing α]
{a : α}
{n : ℤ}
{d : ℕ}

Mathlib.Meta.NormNum.IsRat a n d → ↑d ≠ 0


theorem iff_preimage_eq : e.IsImage s t ↔ e.source ∩ e ⁻¹' t = e.source ∩ s

{α : Type u_1}
{β : Type u_2}
{e : PartialEquiv α β}
{s : Set α}
{t : Set β}

e.IsImage s t ↔ e.source ∩ ↑e ⁻¹' t = e.source ∩ s


theorem mem_Lp_of_nnnorm_ae_le {f : α →ₘ[μ] E} {g : Lp F p μ} (h : ∀ᵐ x ∂μ, ‖f x‖₊ ≤ ‖g x‖₊) :
    f ∈ Lp E p μ

{α : Type u_1}
{E : Type u_2}
{F : Type u_3}
{m0 : MeasurableSpace α}
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup E]
[NormedAddCommGroup F]
{f : α →ₘ[μ] E}
{g : ↥(MeasureTheory.Lp F p μ)}
(h : ∀ᵐ (x : α) ∂μ, ‖↑f x‖₊ ≤ ‖↑↑g x‖₊)


@[reassoc (attr := simp)]
theorem map_inv_hom_id_app {X Y : C} (e : X ≅ Y) (F : C ⥤ D ⥤ E) (Z : D) :
    (F.map e.inv).app Z ≫ (F.map e.hom).app Z = 𝟙 _

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

CategoryTheory.CategoryStruct.comp ((F.map e.inv).app Z) ((F.map e.hom).app Z) =
  CategoryTheory.CategoryStruct.id ((F.obj Y).obj Z)


theorem id_as_one (x : SingleObj M) : 𝟙 x = 1

(M : Type u)
[Monoid M]
(x : CategoryTheory.SingleObj M)


theorem iterate_right {f : α → β} {ga : α → α} {gb : β → β} (h : Semiconj f ga gb) (n : ℕ) :
    Semiconj f ga^[n] gb^[n]

{α : Type u}
{β : Type v}
{f : α → β}
{ga : α → α}
{gb : β → β}
(h : Function.Semiconj f ga gb)
(n : ℕ)


theorem HasDerivWithinAt.scomp_hasDerivAt_of_eq (hg : HasDerivWithinAt g₁ g₁' s' y)
    (hh : HasDerivAt h h' x) (hs : ∀ x, h x ∈ s') (hy : y = h x) :
    HasDerivAt (g₁ ∘ h) (h' • g₁') x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
(x : 𝕜)
{𝕜' : Type u_1}
[NontriviallyNormedField 𝕜']
[NormedAlgebra 𝕜 𝕜']
[NormedSpace 𝕜' F]
[IsScalarTower 𝕜 𝕜' F]
{s' : Set 𝕜'}
{h : 𝕜 → 𝕜'}
{h' : 𝕜'}
{g₁ : 𝕜' → F}
{g₁' : F}
{y : 𝕜'}
(hg : HasDerivWithinAt g₁ g₁' s' y)
(hh : HasDerivAt h h' x)
(hs : ∀ (x : 𝕜), h x ∈ s')
(hy : y = h x)


theorem zero_smul_filter (hg : g.NeBot) : (0 : α) • g = 0

{α : Type u_2}
{β : Type u_3}
[Zero α]
[Zero β]
[SMulWithZero α β]
{g : Filter β}
(hg : g.NeBot)


theorem cos_eq_iff_eq_or_eq_neg {θ ψ : Angle} : cos θ = cos ψ ↔ θ = ψ ∨ θ = -ψ


theorem LinearMap.exists_leftInverse_of_injective (f : V →ₗ[K] V') (hf_inj : LinearMap.ker f = ⊥) :
    ∃ g : V' →ₗ[K] V, g.comp f = LinearMap.id

{K : Type u_3}
{V : Type u_4}
{V' : Type u_5}
[DivisionRing K]
[AddCommGroup V]
[AddCommGroup V']
[Module K V]
[Module K V']
(f : V →ₗ[K] V')
(hf_inj : LinearMap.ker f = ⊥)


theorem StableUnderCobaseChange.respectsIso {P : MorphismProperty C}
    (hP : StableUnderCobaseChange P) : RespectsIso P

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{P : CategoryTheory.MorphismProperty C}
(hP : P.StableUnderCobaseChange)


theorem smul_def (x : T) (m : M) (s : S) :
    x • mk m s = mk ((IsLocalization.sec S x).1 • m) ((IsLocalization.sec S x).2 * s)

{R : Type u}
[CommSemiring R]
{S : Submonoid R}
{M : Type v}
[AddCommMonoid M]
[Module R M]
(T : Type u_1)
[CommSemiring T]
[Algebra R T]
[IsLocalization S T]
(x : T)
(m : M)
(s : ↥S)

x • LocalizedModule.mk m s = LocalizedModule.mk ((IsLocalization.sec S x).1 • m) ((IsLocalization.sec S x).2 * s)


@[simp] theorem extractLsb'_toNat (s m : Nat) (x : BitVec n) :
  (extractLsb' s m x).toNat = (x.toNat >>> s) % 2^m

(BitVec.extractLsb' s m x).toNat = x.toNat >>> s % 2 ^ m


/-- Convex hull of a finite set is compact. -/
theorem Set.Finite.isCompact_convexHull {s : Set E} (hs : s.Finite) :
    IsCompact (convexHull ℝ s)

{E : Type u_3}
[AddCommGroup E]
[Module ℝ E]
[TopologicalSpace E]
[TopologicalAddGroup E]
[ContinuousSMul ℝ E]
{s : Set E}
(hs : s.Finite)


@[simp]
theorem id_apply (a : α) : EsakiaHom.id α a = a

{α : Type u_2}
[TopologicalSpace α]
[Preorder α]
(a : α)


theorem mt {a b : Prop} (h₁ : a → b) (h₂ : ¬b) : ¬a


theorem natAbs_div_le_natAbs (a b : Int) : natAbs (a / b) ≤ natAbs a


theorem preimage_boolIndicator_false : s.boolIndicator ⁻¹' {false} = sᶜ


@[simp]
theorem map_apply {β} (f : α → β) (m : OuterMeasure α) (s : Set β) : map f m s = m (f ⁻¹' s)

{α : Type u_1}
{β : Type u_3}
(f : α → β)
(m : MeasureTheory.OuterMeasure α)
(s : Set β)

((MeasureTheory.OuterMeasure.map f) m) s = m (f ⁻¹' s)


theorem liftPropWithinAt_indep_chart_source_aux (g : M → H') (he : e ∈ G.maximalAtlas M)
    (xe : x ∈ e.source) (he' : e' ∈ G.maximalAtlas M) (xe' : x ∈ e'.source) :
    P (g ∘ e.symm) (e.symm ⁻¹' s) (e x) ↔ P (g ∘ e'.symm) (e'.symm ⁻¹' s) (e' x)

(he : e ∈ StructureGroupoid.maximalAtlas M G)

(he' : e' ∈ StructureGroupoid.maximalAtlas M G)

P (g ∘ ↑e.symm) (↑e.symm ⁻¹' s) (↑e x) ↔ P (g ∘ ↑e'.symm) (↑e'.symm ⁻¹' s) (↑e' x)


/-- Let `F` be a `Type`-valued functor. If two elements `a : F c` and `b : F d` represent the same
element of `colimit F`, then `c` and `d` are related by a `Zigzag`. -/
theorem zigzag_of_eqvGen_quot_rel (F : C ⥤ Type w) (c d : Σ j, F.obj j)
    (h : EqvGen (Quot.Rel F) c d) : Zigzag c.1 d.1

(h : EqvGen (CategoryTheory.Limits.Types.Quot.Rel F) c d)


theorem image_maximals_of_rel_iff_rel : f '' maximals r x = maximals s (f '' x)

(hf : ∀ ⦃a a' : α⦄, a ∈ x → a' ∈ x → (r a a' ↔ s (f a) (f a')))


theorem mem_closedBall_zero : y ∈ closedBall p 0 r ↔ p y ≤ r

{𝕜 : Type u_3}
{E : Type u_7}
[SeminormedRing 𝕜]
[AddCommGroup E]
[SMul 𝕜 E]
(p : Seminorm 𝕜 E)
{y : E}
{r : ℝ}


theorem diam_range [SemilinearIsometryClass 𝓕 σ₁₂ E E₂] (f : 𝓕) :
    Metric.diam (range f) = Metric.diam (univ : Set E)

{R : Type u_1}
{R₂ : Type u_2}
{E : Type u_5}
{E₂ : Type u_6}
{𝓕 : Type u_10}
[Semiring R]
[Semiring R₂]
{σ₁₂ : R →+* R₂}
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup E₂]
[Module R E]
[Module R₂ E₂]
[FunLike 𝓕 E E₂]
[SemilinearIsometryClass 𝓕 σ₁₂ E E₂]
(f : 𝓕)

Metric.diam (Set.range ⇑f) = Metric.diam Set.univ


@[reassoc (attr := simp)]
lemma map_inv_hom_id (F : C ⥤ D) :
    F.map e.inv ≫ F.map e.hom = 𝟙 _

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{D : Type u_1}
[CategoryTheory.Category.{u_3, u_1} D]
{X Y : C}
(e : X ≅ Y)
(F : CategoryTheory.Functor C D)

CategoryTheory.CategoryStruct.comp (F.map e.inv) (F.map e.hom) = CategoryTheory.CategoryStruct.id (F.obj Y)


theorem exact_iff_epi_imageToKernel' : S.Exact ↔ Epi (imageToKernel' S.f S.g S.zero)

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

S.Exact ↔ CategoryTheory.Epi (imageToKernel' S.f S.g ⋯)


theorem b_eq_three_roots (ha : P.a ≠ 0) (h3 : (map φ P).roots = {x, y, z}) :
    φ P.b = φ P.a * -(x + y + z)

(h3 : (Cubic.map φ P).roots = {x, y, z})


theorem OrderTop.ext_top {α} {hA : PartialOrder α} (A : OrderTop α) {hB : PartialOrder α}
    (B : OrderTop α) (H : ∀ x y : α, (haveI := hA; x ≤ y) ↔ x ≤ y) :
    (@Top.top α (@OrderTop.toTop α hA.toLE A)) = (@Top.top α (@OrderTop.toTop α hB.toLE B))

{α : Type u_3}
{hA : PartialOrder α}
(A : OrderTop α)
{hB : PartialOrder α}
(B : OrderTop α)
(H : ∀ (x y : α), x ≤ y ↔ x ≤ y)


lemma IsDivSequence.smul (h : IsDivSequence W) (x : R) : IsDivSequence (x • W)

{R : Type u}
[CommRing R]
{W : ℤ → R}
(h : IsDivSequence W)
(x : R)


@[reassoc]
lemma ιTensorObj₃_eq (i₁ i₂ i₃ j : I) (h : i₁ + i₂ + i₃ = j) (i₂₃ : I) (h' : i₂ + i₃ = i₂₃) :
    ιTensorObj₃ X₁ X₂ X₃ i₁ i₂ i₃ j h =
      (X₁ i₁ ◁ ιTensorObj X₂ X₃ i₂ i₃ i₂₃ h') ≫
        ιTensorObj X₁ (tensorObj X₂ X₃) i₁ i₂₃ j (by rw [← h', ← add_assoc, h])

(X₁ X₂ X₃ : CategoryTheory.GradedObject I C)

[X₁.HasTensor (CategoryTheory.GradedObject.Monoidal.tensorObj X₂ X₃)]

CategoryTheory.GradedObject.Monoidal.ιTensorObj₃ X₁ X₂ X₃ i₁ i₂ i₃ j h =
  CategoryTheory.CategoryStruct.comp
    (CategoryTheory.MonoidalCategory.whiskerLeft (X₁ i₁)
      (CategoryTheory.GradedObject.Monoidal.ιTensorObj X₂ X₃ i₂ i₃ i₂₃ h'))
    (CategoryTheory.GradedObject.Monoidal.ιTensorObj X₁ (CategoryTheory.GradedObject.Monoidal.tensorObj X₂ X₃) i₁ i₂₃ j
      ⋯)


@[simp]
theorem integral_sub (hf : IntervalIntegrable f μ a b) (hg : IntervalIntegrable g μ a b) :
    ∫ x in a..b, f x - g x ∂μ = (∫ x in a..b, f x ∂μ) - ∫ x in a..b, g x ∂μ

{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{a b : ℝ}
{f g : ℝ → E}
{μ : MeasureTheory.Measure ℝ}
(hf : IntervalIntegrable f μ a b)
(hg : IntervalIntegrable g μ a b)

∫ (x : ℝ) in a..b, f x - g x ∂μ = ∫ (x : ℝ) in a..b, f x ∂μ - ∫ (x : ℝ) in a..b, g x ∂μ


theorem gramSchmidtOrthonormalBasis_inv_triangular {i j : ι} (hij : i < j) :
    ⟪gramSchmidtOrthonormalBasis h f j, f i⟫ = 0

(h : FiniteDimensional.finrank 𝕜 E = Fintype.card ι)

⟪(gramSchmidtOrthonormalBasis h f) j, f i⟫_𝕜 = 0


theorem Poly.of_denote_le_cancelAux (ctx : Context) (fuel : Nat) (m₁ m₂ r₁ r₂ : Poly)
    (h : denote_le ctx (cancelAux fuel m₁ m₂ r₁ r₂)) : denote_le ctx (r₁.reverse ++ m₁, r₂.reverse ++ m₂)

(h : Nat.Linear.Poly.denote_le ctx (Nat.Linear.Poly.cancelAux fuel m₁ m₂ r₁ r₂))

Nat.Linear.Poly.denote_le ctx (List.reverse r₁ ++ m₁, List.reverse r₂ ++ m₂)


@[to_additive]
theorem prod_neg_index [AddGroup G] [CommMonoid M] {g : α →₀ G} {h : α → G → M}
    (h0 : ∀ a, h a 0 = 1) : (-g).prod h = g.prod fun a b => h a (-b)

{α : Type u_1}
{M : Type u_8}
{G : Type u_12}
[AddGroup G]
[AddCommMonoid M]
{g : α →₀ G}
{h : α → G → M}
(h0 : ∀ (a : α), h a 0 = 0)


/-- Given a limit cone over `G : D ⥤ E` we can construct a limit cone over `F ⋙ G`. -/
@[simps]
def limitConeComp (t : LimitCone G) : LimitCone (F ⋙ G)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
(F : CategoryTheory.Functor C D)
[F.Initial]
{E : Type u₃}
[CategoryTheory.Category.{v₃, u₃} E]
{G : CategoryTheory.Functor D E}
(t : CategoryTheory.Limits.LimitCone G)

(CategoryTheory.Functor.Initial.limitConeComp F t).cone = CategoryTheory.Limits.Cone.whisker F t.cone


@[to_additive (attr := simp) nnnorm_neg]
theorem nnnorm_inv' (a : E) : ‖a⁻¹‖₊ = ‖a‖₊

{E : Type u_6}
[SeminormedAddGroup E]
(a : E)

‖-a‖₊ = ‖a‖₊


theorem mem_of_mem_tail {s : WSeq α} {a} : a ∈ tail s → a ∈ s

{α : Type u}
{s : Stream'.WSeq α}
{a : α}


@[deprecated _root_.Continuous.compCM (since := "2024-01-30")]
lemma continuous.comp' (hf : Continuous f) (hg : Continuous g) :
    Continuous fun x => (g x).comp (f x)

{X : Type u_2}
{Y : Type u_3}
{Z : Type u_4}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
[LocallyCompactPair Y Z]
{X' : Type u_6}
[TopologicalSpace X']
{g : X' → C(Y, Z)}
{f : X' → C(X, Y)}
(hf : Continuous f)
(hg : Continuous g)


theorem splits_of_splits_mul' {f g : K[X]} (hfg : (f * g).map i ≠ 0) (h : Splits i (f * g)) :
    Splits i f ∧ Splits i g

{K : Type v}
{L : Type w}
[CommRing K]
[Field L]
(i : K →+* L)
{f g : K[X]}
(hfg : Polynomial.map i (f * g) ≠ 0)
(h : Polynomial.Splits i (f * g))

Polynomial.Splits i f ∧ Polynomial.Splits i g


@[to_additive (attr := simp, norm_cast)]
lemma val_pow_eq_pow_val (n : ℕ) : ↑(a ^ n) = (a ^ n : α)

{α : Type u}
[AddMonoid α]
(a : AddUnits α)
(n : ℕ)


/-- The `alter` function preserves the ordering invariants. -/
protected theorem Ordered.alter {t : RBNode α}
    (H : ∀ {x t' p}, t.zoom cut = (t', p) → f t'.root? = some x →
      p.RootOrdered cmp x ∧ t'.OnRoot (cmpEq cmp x))
    (h : t.Ordered cmp) : (alter cut f t).Ordered cmp

(H :
  ∀ {x : α} {t' : Batteries.RBNode α} {p : Batteries.RBNode.Path α},
    Batteries.RBNode.zoom cut t = (t', p) →
      f t'.root? = some x →
        Batteries.RBNode.Path.RootOrdered cmp p x ∧ Batteries.RBNode.OnRoot (Batteries.RBNode.cmpEq cmp x) t')

Batteries.RBNode.Ordered cmp (Batteries.RBNode.alter cut f t)


/-- Given a subpresheaf `G` of `F`, an `F`-section `s` on `U`, we may define a sieve of `U`
consisting of all `f : V ⟶ U` such that the restriction of `s` along `f` is in `G`. -/
@[simps]
def Subpresheaf.sieveOfSection {U : Cᵒᵖ} (s : F.obj U) : Sieve (unop U)

(G : CategoryTheory.GrothendieckTopology.Subpresheaf F)

(G.sieveOfSection s).arrows f = (F.map f.op s ∈ G.obj (Opposite.op V))


theorem lift_comp_of (f : M →ₗ[R] N) : (lift I f).comp (of I M) = f

{R : Type u_1}
[CommRing R]
(I : Ideal R)
{M : Type u_2}
[AddCommGroup M]
[Module R M]
{N : Type u_3}
[AddCommGroup N]
[Module R N]
[h : IsHausdorff I N]
(f : M →ₗ[R] N)

Hausdorffification.lift I f ∘ₗ Hausdorffification.of I M = f


@[simp]
theorem finsetCongr_refl : (Equiv.refl α).finsetCongr = Equiv.refl _

(Equiv.refl α).finsetCongr = Equiv.refl (Finset α)


theorem iff_fg {N : Submodule R M} : Module.Finite R N ↔ N.FG

{R : Type u_1}
{M : Type u_4}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{N : Submodule R M}


/-- If the second of three points is strictly between the other two, the oriented angle at that
point (reversed) is π. -/
theorem _root_.Sbtw.oangle₃₂₁_eq_pi {p₁ p₂ p₃ : P} (h : Sbtw ℝ p₁ p₂ p₃) : ∡ p₃ p₂ p₁ = π

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

∡ p₃ p₂ p₁ = ↑π


theorem Ring.inverse_eq_inv (a : G₀) : Ring.inverse a = a⁻¹

{G₀ : Type u_3}
[GroupWithZero G₀]
(a : G₀)


theorem coeffIntegerNormalization_mem_support (p : S[X]) (i : ℕ)
    (h : coeffIntegerNormalization M p i ≠ 0) : i ∈ p.support

(h : IsLocalization.coeffIntegerNormalization M p i ≠ 0)


theorem forall_leftMoves_fuzzy_iff_equiv_zero : (∀ i, G.moveLeft i ‖ 0) ↔ (G ≈ 0)

(∀ (i : G.LeftMoves), (G.moveLeft i).Fuzzy 0) ↔ G ≈ 0


theorem tendsto_leftLim_within (x : α) : Tendsto f (𝓝[<] x) (𝓝[≤] leftLim f x)

{α : Type u_1}
{β : Type u_2}
[LinearOrder α]
[ConditionallyCompleteLinearOrder β]
[TopologicalSpace β]
[OrderTopology β]
{f : α → β}
(hf : Monotone f)
[TopologicalSpace α]
[OrderTopology α]
(x : α)

Filter.Tendsto f (𝓝[<] x) (𝓝[≤] Function.leftLim f x)


@[simp]
theorem lTensorHomEquivHomLTensor_apply (x : P ⊗[R] (M →ₗ[R] Q)) :
    lTensorHomEquivHomLTensor R M P Q x = lTensorHomToHomLTensor R M P Q x

{R : Type u}
{M : Type v₁}
{P : Type v₃}
{Q : Type v₄}
[CommRing R]
[AddCommGroup M]
[AddCommGroup P]
[AddCommGroup Q]
[Module R M]
[Module R P]
[Module R Q]
[Module.Free R M]
[Module.Finite R M]
(x : TensorProduct R P (M →ₗ[R] Q))

(lTensorHomEquivHomLTensor R M P Q) x = (TensorProduct.lTensorHomToHomLTensor R M P Q) x


/-- The p-adic valuation of `n` is less than or equal to its logarithm w.r.t `p`. -/
lemma padicValNat_le_nat_log (n : ℕ) : padicValNat p n ≤ Nat.log p n


theorem condIndep_iSup_directed_limsup [StandardBorelSpace Ω]
    [Nonempty Ω] (hm : m ≤ m0) [IsFiniteMeasure μ]
    (h_le : ∀ n, s n ≤ m0) (h_indep : iCondIndep m hm s μ)
    (hf : ∀ t, p t → tᶜ ∈ f) (hns : Directed (· ≤ ·) ns) (hnsp : ∀ a, p (ns a)) :
    CondIndep m (⨆ a, ⨆ n ∈ ns a, s n) (limsup s f) hm μ

(h_indep : ProbabilityTheory.iCondIndep m hm s μ)

(hns : Directed (fun x x_1 => x ≤ x_1) ns)

ProbabilityTheory.CondIndep m (⨆ a, ⨆ n ∈ ns a, s n) (Filter.limsup s f) hm μ


@[to_additive (attr := simp, norm_cast)]
theorem coe_mul (x y : S) : (↑(x * y) : M) = ↑x * ↑y

{M : Type u_1}
[AddZeroClass M]
(S : AddSubmonoid M)
(x y : ↥S)


theorem Finset.eq_univ_of_card [Fintype α] (s : Finset α) (hs : s.card = Fintype.card α) :
    s = univ

{α : Type u_1}
[Fintype α]
(s : Finset α)
(hs : s.card = Fintype.card α)


theorem source_inter_preimage_target_inter (s : Set Y) :
    e.source ∩ e ⁻¹' (e.target ∩ s) = e.source ∩ e ⁻¹' s

{X : Type u_1}
{Y : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
(e : PartialHomeomorph X Y)
(s : Set Y)

e.source ∩ ↑e ⁻¹' (e.target ∩ s) = e.source ∩ ↑e ⁻¹' s


theorem ofFiberEquiv_map {α β γ} {f : α → γ} {g : β → γ}
    (e : ∀ c, { a // f a = c } ≃ { b // g b = c }) (a : α) : g (ofFiberEquiv e a) = f a


theorem unbot'_eq_unbot'_iff {d : α} {x y : WithBot α} :
    unbot' d x = unbot' d y ↔ x = y ∨ x = d ∧ y = ⊥ ∨ x = ⊥ ∧ y = d

{α : Type u_1}
{d : α}
{x y : WithBot α}

WithBot.unbot' d x = WithBot.unbot' d y ↔ x = y ∨ x = ↑d ∧ y = ⊥ ∨ x = ⊥ ∧ y = ↑d


/-- The function `fun x ↦ f x * r` tends to negative infinity along a nontrivial filter
if and only if `r > 0` and `f` tends to negative infinity or `r < 0` and `f` tends to infinity. -/
theorem tendsto_mul_const_atBot_iff [NeBot l] :
    Tendsto (fun x => f x * r) l atBot ↔ 0 < r ∧ Tendsto f l atBot ∨ r < 0 ∧ Tendsto f l atTop

{α : Type u_3}
{β : Type u_4}
[LinearOrderedField α]
{l : Filter β}
{f : β → α}
{r : α}
[l.NeBot]

Filter.Tendsto (fun x => f x * r) l Filter.atBot ↔
  0 < r ∧ Filter.Tendsto f l Filter.atBot ∨ r < 0 ∧ Filter.Tendsto f l Filter.atTop


@[simp]
lemma toNat_eq_zero : toNat c = 0 ↔ c = 0 ∨ ℵ₀ ≤ c

Cardinal.toNat c = 0 ↔ c = 0 ∨ Cardinal.aleph0 ≤ c


@[to_additive]
theorem IsClosed.inv (hs : IsClosed s) : IsClosed s⁻¹

{G : Type w}
[TopologicalSpace G]
[InvolutiveInv G]
[ContinuousInv G]
{s : Set G}
(hs : IsClosed s)


theorem mem_of_mem_eraseP {l : List α} : a ∈ l.eraseP p → a ∈ l

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


theorem Function.Bijective.finite_iff {f : α → β} (h : Bijective f) : Finite α ↔ Finite β

{α : Sort u_1}
{β : Sort u_2}
{f : α → β}
(h : Function.Bijective f)


theorem upcrossingStrat_le_one : upcrossingStrat a b f N n ω ≤ 1

{Ω : Type u_1}
{a b : ℝ}
{f : ℕ → Ω → ℝ}
{N n : ℕ}
{ω : Ω}

MeasureTheory.upcrossingStrat a b f N n ω ≤ 1


/-- The inverse map `fun x ↦ x⁻¹` is an order isomorphism between `ℝ≥0∞` and its `OrderDual` -/
@[simps! apply]
def _root_.OrderIso.invENNReal : ℝ≥0∞ ≃o ℝ≥0∞ᵒᵈ

∀ (a : ENNReal), OrderIso.invENNReal a = (OrderDual.toDual a)⁻¹


theorem uniformOfFinset_apply_of_mem (ha : a ∈ s) : uniformOfFinset s hs a = (s.card : ℝ≥0∞)⁻¹

{α : Type u_1}
{s : Finset α}
(hs : s.Nonempty)
{a : α}
(ha : a ∈ s)

(PMF.uniformOfFinset s hs) a = (↑s.card)⁻¹


@[simp] theorem gcd_gcd_self_left_left (m n : Nat) : gcd (gcd m n) m = gcd m n


theorem equivalence (p : α → Prop) : Equivalence (@HasEquiv.Equiv (Subtype p) _)

{α : Sort u_1}
[Setoid α]
(p : α → Prop)


theorem gcd_comm [NormalizedGCDMonoid α] (a b : α) : gcd a b = gcd b a

{α : Type u_1}
[CancelCommMonoidWithZero α]
[NormalizedGCDMonoid α]
(a b : α)


theorem sum_lineCount_eq_sum_pointCount [Fintype P] [Fintype L] :
    ∑ p : P, lineCount L p = ∑ l : L, pointCount P l

(P : Type u_1)
(L : Type u_2)
[Membership P L]
[Fintype P]
[Fintype L]

∑ p : P, Configuration.lineCount L p = ∑ l : L, Configuration.pointCount P l


/--
A *semisimple* Lie algebra is one that is a direct sum of non-abelian atomic ideals.
These ideals are simple Lie algebras, by `LieAlgebra.IsSemisimple.isSimple_of_isAtom`.

Note that the label 'semisimple' is apparently not universally agreed
[upon](https://mathoverflow.net/questions/149391/on-radicals-of-a-lie-algebra#comment383669_149391)
for general coefficients.

For example [Seligman, page 15](seligman1967) uses the label for `LieAlgebra.HasTrivialRadical`,
the weakest of the various properties which are all equivalent over a field of characteristic zero.
-/
class IsSemisimple : Prop where
  /-- In a semisimple Lie algebra, the supremum of the atoms is the whole Lie algebra. -/
  sSup_atoms_eq_top : sSup {I : LieIdeal R L | IsAtom I} = ⊤
  /-- In a semisimple Lie algebra, the atoms are independent. -/
  setIndependent_isAtom : CompleteLattice.SetIndependent {I : LieIdeal R L | IsAtom I}
  /-- In a semisimple Lie algebra, the atoms are non-abelian. -/
  non_abelian_of_isAtom : ∀ I : LieIdeal R L, IsAtom I → ¬ IsLieAbelian I

{R : Type u_1}
{L : Type u_2}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[self : LieAlgebra.IsSemisimple R L]


theorem cycleType_ofSubtype {p : α → Prop} [DecidablePred p] {g : Perm (Subtype p)} :
    cycleType (ofSubtype g) = cycleType g

{α : Type u_1}
[Fintype α]
[DecidableEq α]
{p : α → Prop}
[DecidablePred p]
{g : Equiv.Perm (Subtype p)}

(Equiv.Perm.ofSubtype g).cycleType = g.cycleType


/--
The continuous map from `ℕ∪{∞}` to `ℝ` sending `n` to `1/(n+1)` and `∞` to `0` is a closed
embedding.
-/
lemma closedEmbedding_natUnionInftyEmbedding : ClosedEmbedding natUnionInftyEmbedding


theorem of_pos [Preorder M] [Zero M] (h : 0 < x) : NeZero x

{M : Type u_2}
{x : M}
[Preorder M]
[Zero M]
(h : 0 < x)


theorem IsCycle.existsUnique_cycle_nontrivial_subtype {f : Perm α} (hf : IsCycle f) :
    ∃! s : { s : Cycle α // s.Nodup ∧ s.Nontrivial }, (s : Cycle α).formPerm s.prop.left = f

{α : Type u_1}
[Finite α]
[DecidableEq α]
{f : Equiv.Perm α}
(hf : f.IsCycle)


@[simp]
lemma restrictScalars_apply (d : Derivation S A M) (x : A) : d.restrictScalars R x = d x

(R : Type u_1)
{A : Type u_2}
{M : Type u_4}
[CommSemiring R]
[CommSemiring A]
[AddCommMonoid M]
[Algebra R A]
[Module A M]
[Module R M]
{S : Type u_5}
[CommSemiring S]
[Algebra S A]
[Module S M]
[LinearMap.CompatibleSMul A M R S]
(d : Derivation S A M)
(x : A)

(Derivation.restrictScalars R d) x = d x


theorem Ioi_ae_eq_Ici : Ioi a =ᵐ[μ] Ici a

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[MeasureTheory.NoAtoms μ]
[PartialOrder α]
{a : α}


@[csimp] theorem fillNones_eq_fillNonesTR : @fillNones = @fillNonesTR


theorem _root_.WCovBy.fst (h : x ⩿ y) : x.1 ⩿ y.1

{α : Type u_1}
{β : Type u_2}
[PartialOrder α]
[PartialOrder β]
{x y : α × β}
(h : x ⩿ y)


theorem _root_.MeasureTheory.SignedMeasure.toComplexMeasure_apply
    {s t : SignedMeasure α} {i : Set α} : s.toComplexMeasure t i = ⟨s i, t i⟩

{α : Type u_1}
{m : MeasurableSpace α}
{s t : MeasureTheory.SignedMeasure α}
{i : Set α}

↑(s.toComplexMeasure t) i = { re := ↑s i, im := ↑t i }


@[to_additive]
theorem iUnion_div_right_image : ⋃ a ∈ t, (· / a) '' s = s / t


/-- If `(r : R)`, then `C (f r)` lifts. -/
theorem C_mem_lifts (f : R →+* S) (r : R) : C (f r) ∈ lifts f

{R : Type u}
[Semiring R]
{S : Type v}
[Semiring S]
(f : R →+* S)
(r : R)


/-- Applying a `MulDistribMulAction` results in an isomorphic subgroup -/
@[simps!]
def equivSMul (a : α) (H : Subgroup G) : H ≃* (a • H : Subgroup G)

{α : Type u_1}
{G : Type u_2}
[Group G]
[Group α]
[MulDistribMulAction α G]
(a : α)
(H : Subgroup G)
(x : ↑↑H.toSubmonoid)


theorem derivWithin.neg (hxs : UniqueDiffWithinAt 𝕜 s x) :
    derivWithin (fun y => -f y) s x = -derivWithin f s x

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


theorem mem_edges_toSubgraph (p : G.Walk u v) {e : Sym2 V} :
    e ∈ p.toSubgraph.edgeSet ↔ e ∈ p.edges

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


theorem self_eq_neg
    (R) (M) [Semiring R] [CharZero R] [AddCommGroup M] [Module R M] [NoZeroSMulDivisors R M]
    {v : M} : v = -v ↔ v = 0

(R : Type u_9)
(M : Type u_10)
[Semiring R]
[CharZero R]
[AddCommGroup M]
[Module R M]
[NoZeroSMulDivisors R M]
{v : M}


theorem inr_sum {ι} [AddCommMonoid R] [AddCommMonoid M] (s : Finset ι) (f : ι → M) :
    (inr (∑ i ∈ s, f i) : tsze R M) = ∑ i ∈ s, inr (f i)

(R : Type u)
{M : Type v}
{ι : Type u_3}
[AddCommMonoid R]
[AddCommMonoid M]
(s : Finset ι)
(f : ι → M)

TrivSqZeroExt.inr (∑ i ∈ s, f i) = ∑ i ∈ s, TrivSqZeroExt.inr (f i)


@[simp] theorem dropWhile_replicate_eq_filter_not (p : α → Bool) :
    (replicate n a).dropWhile p = (replicate n a).filter (fun a => !p a)

{α : Type u_1}
{n : Nat}
{a : α}
(p : α → Bool)

List.dropWhile p (List.replicate n a) = List.filter (fun a => !p a) (List.replicate n a)


/-- The quotient map to `α ⧸ G` is measure-preserving between the restriction of `volume` to a
  fundamental domain in `α` and a related measure satisfying `QuotientMeasureEqMeasurePreimage`. -/
@[to_additive IsAddFundamentalDomain.measurePreserving_add_quotient_mk]
theorem IsFundamentalDomain.measurePreserving_quotient_mk
    {𝓕 : Set α} (h𝓕 : IsFundamentalDomain G 𝓕 ν)
    (μ : Measure (Quotient α_mod_G)) [QuotientMeasureEqMeasurePreimage ν μ] :
    MeasurePreserving π (ν.restrict 𝓕) μ

(h𝓕 : MeasureTheory.IsFundamentalDomain G 𝓕 ν)

(μ : MeasureTheory.Measure (Quotient (MulAction.orbitRel G α)))

MeasureTheory.MeasurePreserving (Quotient.mk (MulAction.orbitRel G α)) (ν.restrict 𝓕) μ


theorem tangentCone_mono_nhds (h : 𝓝[s] x ≤ 𝓝[t] x) :
    tangentConeAt 𝕜 s x ⊆ tangentConeAt 𝕜 t x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{x : E}
{s t : Set E}
(h : 𝓝[s] x ≤ 𝓝[t] x)


/-- An intermediate equivalence `A ≅ B` obtained as the composition of `equivalence₁` and
the inverse of `eB : B ≌ B'`. -/
@[simps! functor]
def equivalence₂ : A ≌ B

{A : Type u_1}
{A' : Type u_2}
{B : Type u_3}
{B' : Type u_4}
[CategoryTheory.Category.{u_5, u_1} A]
[CategoryTheory.Category.{u_6, u_2} A']
[CategoryTheory.Category.{u_7, u_3} B]
[CategoryTheory.Category.{u_8, u_4} B']
{eA : A ≌ A'}
(eB : B ≌ B')
{e' : A' ≌ B'}
{F : A ⥤ B'}
(hF : eA.functor ⋙ e'.functor ≅ F)

(AlgebraicTopology.DoldKan.Compatibility.equivalence₂ eB hF).functor = F ⋙ eB.inverse


theorem indep_iSup_of_monotone [SemilatticeSup ι] [IsProbabilityMeasure μ]
    (h_indep : ∀ i, Indep (m i) m1 μ) (h_le : ∀ i, m i ≤ _mΩ) (h_le' : m1 ≤ _mΩ) (hm : Monotone m) :
    Indep (⨆ i, m i) m1 μ

(h_indep : ∀ (i : ι), ProbabilityTheory.Indep (m i) m1 μ)


@[to_additive (attr := gcongr) neg_lt_neg]
theorem inv_lt_inv' : a < b → b⁻¹ < a⁻¹

{α : Type u}
[OrderedCommGroup α]
{a b : α}


/-- **Phragmen-Lindelöf principle** in a strip `U = {z : ℂ | a < re z < b}`.
Let `f : ℂ → E` be a function such that

* `f` is differentiable on `U` and is continuous on its closure;
* `‖f z‖` is bounded from above by `A * exp(B * exp(c * |im z|))` on `U` for some `c < π / (b - a)`;
* `‖f z‖` is bounded from above by a constant `C` on the boundary of `U`.

Then `‖f z‖` is bounded by the same constant on the closed strip
`{z : ℂ | a ≤ re z ≤ b}`. Moreover, it suffices to verify the second assumption
only for sufficiently large values of `|im z|`.
-/
theorem vertical_strip (hfd : DiffContOnCl ℂ f (re ⁻¹' Ioo a b))
    (hB : ∃ c < π / (b - a), ∃ B, f =O[comap (_root_.abs ∘ im) atTop ⊓ 𝓟 (re ⁻¹' Ioo a b)]
      fun z ↦ expR (B * expR (c * |z.im|)))
    (hle_a : ∀ z : ℂ, re z = a → ‖f z‖ ≤ C) (hle_b : ∀ z, re z = b → ‖f z‖ ≤ C) (hza : a ≤ re z)
    (hzb : re z ≤ b) : ‖f z‖ ≤ C

(hfd : DiffContOnCl ℂ f (Complex.re ⁻¹' Set.Ioo a b))

(hB :
  ∃ c < π / (b - a),
    ∃ B,
      f =O[Filter.comap (abs ∘ Complex.im) Filter.atTop ⊓ 𝓟 (Complex.re ⁻¹' Set.Ioo a b)] fun z =>
        expR (B * expR (c * |z.im|)))

(hle_a : ∀ (z : ℂ), z.re = a → ‖f z‖ ≤ C)

(hle_b : ∀ (z : ℂ), z.re = b → ‖f z‖ ≤ C)


@[to_additive (attr := simp)]
lemma coe_comp {X Y Z : Grp} {f : X ⟶ Y} {g : Y ⟶ Z} : (f ≫ g : X → Z) = g ∘ f


@[simp]
theorem toDual_inf [SemilatticeInf α] [OrderTop α] (s : Finset β) (f : β → α) :
    toDual (s.inf f) = s.sup (toDual ∘ f)

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

OrderDual.toDual (s.inf f) = s.sup (⇑OrderDual.toDual ∘ f)


lemma density_fst_univ (κ : Kernel α (γ × β)) [IsFiniteKernel κ] (a : α) :
    ∀ᵐ x ∂(fst κ a), density κ (fst κ) a x univ = 1

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

∀ᵐ (x : γ) ∂κ.fst a, κ.density κ.fst a x Set.univ = 1


protected theorem Balanced.insertNew {path : Path α} (H : path.Balanced c n black 0) :
    ∃ n, (path.insertNew v).Balanced black n

(H : Batteries.RBNode.Path.Balanced c n path Batteries.RBColor.black 0)

∃ n, (path.insertNew v).Balanced Batteries.RBColor.black n


theorem isClosed_iff_of_not_mem (h : ∞ ∉ s) :
    IsClosed s ↔ IsClosed ((↑) ⁻¹' s : Set X) ∧ IsCompact ((↑) ⁻¹' s : Set X)

{X : Type u_1}
[TopologicalSpace X]
{s : Set (OnePoint X)}
(h : OnePoint.infty ∉ s)

IsClosed s ↔ IsClosed (OnePoint.some ⁻¹' s) ∧ IsCompact (OnePoint.some ⁻¹' s)


theorem tr_eval_dom (k) (L : List (Γ k)) :
    (TM1.eval (tr M) (trInit k L)).Dom ↔ (TM2.eval M k L).Dom

{K : Type u_1}
[DecidableEq K]
{Γ : K → Type u_2}
{Λ : Type u_3}
[Inhabited Λ]
{σ : Type u_4}
[Inhabited σ]
(M : Λ → Turing.TM2.Stmt Γ Λ σ)
(k : K)
(L : List (Γ k))

(Turing.TM1.eval (Turing.TM2to1.tr M) (Turing.TM2to1.trInit k L)).Dom ↔ (Turing.TM2.eval M k L).Dom


@[to_additive]
theorem op_sSup (S : Set (Subgroup G)) : (sSup S).op = sSup (.unop ⁻¹' S)

{G : Type u_2}
[Group G]
(S : Set (Subgroup G))

(sSup S).op = sSup (Subgroup.unop ⁻¹' S)


@[simp]
theorem toAdd_prod (s : Finset ι) (f : ι → Multiplicative α) :
    toAdd (∏ i ∈ s, f i) = ∑ i ∈ s, toAdd (f i)

{ι : Type u_1}
{α : Type u_3}
[AddCommMonoid α]
(s : Finset ι)
(f : ι → Multiplicative α)

Multiplicative.toAdd (∏ i ∈ s, f i) = ∑ i ∈ s, Multiplicative.toAdd (f i)


theorem map_nhds_induced_eq (a : α) : map f (@nhds α (induced f t) a) = 𝓝[range f] f a

{α : Type u_1}
{β : Type u_2}
[t : TopologicalSpace β]
{f : α → β}
(a : α)


/-- Given `φ : α → β → Sort*`, we have an equivalence between `∀ a b, φ a b` and `∀ b a, φ a b`.
This is `Function.swap` as an `Equiv`. -/
@[simps apply]
def piComm (φ : α → β → Sort*) : (∀ a b, φ a b) ≃ ∀ b a, φ a b

{α : Sort u_2}
{β : Sort u_3}
(φ : α → β → Sort u_1)
(f : (x : α) → (y : β) → φ x y)
(y : β)
(x : α)

(Equiv.piComm φ) f y x = Function.swap f y x


theorem degree_linear_lt : degree (C a * X + C b) < 2

(Polynomial.C a * Polynomial.X + Polynomial.C b).degree < 2


lemma Sigma.map'_eq {f : α → C} {g : β → C} [HasCoproduct f] [HasCoproduct g]
    {p p' : α → β} {q : ∀ (a : α), f a ⟶ g (p a)} {q' : ∀ (a : α), f a ⟶ g (p' a)}
    (hp : p = p') (hq : ∀ (a : α), q a ≫ eqToHom (hp ▸ rfl) = q' a) :
    Sigma.map' p q = Sigma.map' p' q'

(hq : ∀ (a : α), q a ≫ CategoryTheory.eqToHom ⋯ = q' a)

CategoryTheory.Limits.Sigma.map' p q = CategoryTheory.Limits.Sigma.map' p' q'


(S : CategoryTheory.ShortComplex.SnakeInput C)

CategoryTheory.CategoryStruct.comp S.δ S.L₃.f = 0


theorem exists_cons_of_ne_nil : ∀ {l : List α}, l ≠ [] → ∃ b L, l = b :: L


theorem IsCoprime.pow_right (H : IsCoprime x y) : IsCoprime x (y ^ n)

{R : Type u}
[CommSemiring R]
{x y : R}
{n : ℕ}
(H : IsCoprime x y)


@[simp] theorem append_cancel_right_eq (as bs cs : List α) : (as ++ bs = cs ++ bs) = (as = cs)


/-- The limit of `J : SingleObj M ⥤ Type u` is equivalent to the fixed points of the
induced action on `J.obj (SingleObj.star M)`. -/
@[simps!]
noncomputable def Types.limitEquivFixedPoints :
    limit J ≃ MulAction.fixedPoints M (J.obj (SingleObj.star M))

(J : CategoryTheory.Functor (CategoryTheory.SingleObj M) (Type u))

∀ (a : ↑(MulAction.fixedPoints M (J.obj (CategoryTheory.SingleObj.star M)))),
  (CategoryTheory.Limits.SingleObj.Types.limitEquivFixedPoints J).symm a =
    (CategoryTheory.Limits.Types.limitEquivSections J).symm
      ((CategoryTheory.Limits.SingleObj.Types.sections.equivFixedPoints J).symm a)


/-- If the equalizer of two morphisms is an epimorphism, then the two morphisms are equal. -/
theorem eq_of_epi_equalizer [HasEqualizer f g] [Epi (equalizer.ι f g)] : f = g

[CategoryTheory.Epi (CategoryTheory.Limits.equalizer.ι f g)]


theorem ucs_add (k l : ℕ) : N.ucs (k + l) = (N.ucs l).ucs k

{R : Type u}
{L : Type v}
{M : Type w}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
(N : LieSubmodule R L M)
(k l : ℕ)

LieSubmodule.ucs (k + l) N = LieSubmodule.ucs k (LieSubmodule.ucs l N)


/-- The spectrum of a commutative ring, as a `SheafedSpace`.
-/
@[simps]
def Spec.sheafedSpaceObj (R : CommRingCat.{u}) : SheafedSpace CommRingCat

↑(AlgebraicGeometry.Spec.sheafedSpaceObj R).toPresheafedSpace = AlgebraicGeometry.Spec.topObj R


theorem emod_two_eq (x : Int) : x % 2 = 0 ∨ x % 2 = 1


@[to_additive (attr := simp)]
lemma max'_one [LinearOrder α] : (1 : Finset α).max' one_nonempty = 1


private theorem one_smul_aux (p : LocalizedModule S M) : (1 : T) • p = p

{R : Type u}
[CommSemiring R]
{S : Submonoid R}
{M : Type v}
[AddCommMonoid M]
[Module R M]
{T : Type u_1}
[CommSemiring T]
[Algebra R T]
[IsLocalization S T]
(p : LocalizedModule S M)


protected theorem mdifferentiable (h : M ≃ₘ^n⟮I, I'⟯ M') (hn : 1 ≤ n) : MDifferentiable I I' h

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{E' : Type u_3}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H : Type u_5}
[TopologicalSpace H]
{H' : Type u_6}
[TopologicalSpace H']
{I : ModelWithCorners 𝕜 E H}
{I' : ModelWithCorners 𝕜 E' H'}
{M : Type u_9}
[TopologicalSpace M]
[ChartedSpace H M]
{M' : Type u_10}
[TopologicalSpace M']
[ChartedSpace H' M']
{n : ℕ∞}
(h : M ≃ₘ^n⟮I, I'⟯ M')
(hn : 1 ≤ n)


/-- If the oriented angle between three points is `-π / 2`, the unoriented angle (reversed) is
`π / 2`. -/
theorem angle_rev_eq_pi_div_two_of_oangle_eq_neg_pi_div_two {p₁ p₂ p₃ : P}
    (h : ∡ p₁ p₂ p₃ = ↑(-π / 2)) : ∠ p₃ p₂ p₁ = π / 2

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


lemma normal_iff_forall_map_eq' : Normal F K ↔ ∀ σ : L ≃ₐ[F] L, K.map ↑σ = K

{F : Type u_1}
{L : Type u_3}
[Field F]
[Field L]
[Algebra F L]
[Normal F L]
{K : IntermediateField F L}

Normal F ↥K ↔ ∀ (σ : L ≃ₐ[F] L), IntermediateField.map (↑σ) K = K


theorem valid_singleton {x : α} : Valid (singleton x : Ordnode α)


theorem mfderiv_prod_right {x₀ : M} {y₀ : M'} :
    mfderiv I' (I.prod I') (fun y => (x₀, y)) y₀ =
      ContinuousLinearMap.inr 𝕜 (TangentSpace I x₀) (TangentSpace I' y₀)

{𝕜 : 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']
{H' : Type u_6}
[TopologicalSpace H']
(I' : ModelWithCorners 𝕜 E' H')
{M' : Type u_7}
[TopologicalSpace M']
[ChartedSpace H' M']
[SmoothManifoldWithCorners I' M']
{x₀ : M}
{y₀ : M'}


@[simp]
theorem arsinh_lt_arsinh : arsinh x < arsinh y ↔ x < y


theorem ofSeq_lt_ofSeq {f g : ℕ → ℝ} : ofSeq f < ofSeq g ↔ ∀ᶠ n in hyperfilter ℕ, f n < g n

Hyperreal.ofSeq f < Hyperreal.ofSeq g ↔ ∀ᶠ (n : ℕ) in ↑(Filter.hyperfilter ℕ), f n < g n


theorem inv_comp_eq_id (g : X ⟶ Y) [IsIso g] {f : X ⟶ Y} : inv g ≫ f = 𝟙 Y ↔ f = g

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

CategoryTheory.CategoryStruct.comp (CategoryTheory.inv g) f = CategoryTheory.CategoryStruct.id Y ↔ f = g


/-- Product of two equivalences, in terms of `PProd`. If `α ≃ β` and `γ ≃ δ`, then
`PProd α γ ≃ PProd β δ`. -/
-- Porting note: in Lean 3 this had `@[congr]`
@[simps apply]
def pprodCongr (e₁ : α ≃ β) (e₂ : γ ≃ δ) : PProd α γ ≃ PProd β δ

{α : Sort u_1}
{β : Sort u_2}
{γ : Sort u_3}
{δ : Sort u_4}
(e₁ : α ≃ β)
(e₂ : γ ≃ δ)
(x : PProd α γ)

(e₁.pprodCongr e₂) x = ⟨e₁ x.fst, e₂ x.snd⟩


@[simp]
theorem Unit_of_divided_by_X_pow_order_zero : Unit_of_divided_by_X_pow_order (0 : k⟦X⟧) = 1

PowerSeries.Unit_of_divided_by_X_pow_order 0 = 1


@[simp]
theorem trans_conjAut {Z : C} (β : Y ≅ Z) (f : Aut X) :
    (α ≪≫ β).conjAut f = β.conjAut (α.conjAut f)

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X Y : C}
(α : X ≅ Y)
{Z : C}
(β : Y ≅ Z)
(f : CategoryTheory.Aut X)


/-- `Matrix.blockDiagonal'` as a `RingHom`. -/
@[simps]
def blockDiagonal'RingHom [∀ i, DecidableEq (m' i)] [Fintype o] [∀ i, Fintype (m' i)]
    [NonAssocSemiring α] : (∀ i, Matrix (m' i) (m' i) α) →+* Matrix (Σi, m' i) (Σi, m' i) α

{o : Type u_4}
(m' : o → Type u_7)
(α : Type u_12)
[DecidableEq o]
[(i : o) → DecidableEq (m' i)]
[Fintype o]
[(i : o) → Fintype (m' i)]
[NonAssocSemiring α]
(M : (i : o) → Matrix (m' i) (m' i) α)

(Matrix.blockDiagonal'RingHom m' α) M = Matrix.blockDiagonal' M


/-- The space `Fin 2 → α` is measurably equivalent to `α × α`. -/
@[simps! (config := .asFn)]
def finTwoArrow : (Fin 2 → α) ≃ᵐ α × α

⇑MeasurableEquiv.finTwoArrow = fun f => (f 0, f 1)


lemma edist_ne_top_iff_reachable : G.edist u v ≠ ⊤ ↔ G.Reachable u v

{V : Type u_1}
{G : SimpleGraph V}
{u v : V}


theorem le_ndunion_left {s} (t : Multiset α) (d : Nodup s) : s ≤ ndunion s t

{α : Type u_1}
[DecidableEq α]
{s : Multiset α}
(t : Multiset α)
(d : s.Nodup)


theorem length_foldr_permutationsAux2' (t : α) (ts : List α) (r L : List (List α)) (n)
    (H : ∀ l ∈ L, length l = n) :
    length (foldr (fun y r => (permutationsAux2 t ts r y id).2) r L) = n * length L + length r

(H : ∀ (l : List α), l ∈ L → l.length = n)

(List.foldr (fun y r => (List.permutationsAux2 t ts r y id).2) r L).length = n * L.length + r.length


@[simp]
theorem neg_apply (m : ι → M) : (-g) m = -g m

{R : Type u_1}
[Semiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
{N' : Type u_6}
[AddCommGroup N']
[Module R N']
{ι : Type u_7}
(g : M [⋀^ι]→ₗ[R] N')
(m : ι → M)


/-- Functoriality maps for `ComposableArrows.sc'`. -/
@[simps]
def sc'Map {S₁ S₂ : ComposableArrows C n} (φ : S₁ ⟶ S₂) (h₁ : S₁.IsComplex) (h₂ : S₂.IsComplex)
    (i j k : ℕ) (hij : i + 1 = j := by omega)
    (hjk : j + 1 = k := by omega) (hk : k ≤ n := by omega) :
    S₁.sc' h₁ i j k ⟶ S₂.sc' h₂ i j k

{S₁ S₂ : CategoryTheory.ComposableArrows C n}

(CategoryTheory.ComposableArrows.sc'Map φ h₁ h₂ i j k hij hjk hk).τ₁ = φ.app ⟨i, ⋯⟩


theorem mem_centralizer_iff {s : Set R} {z : R} : z ∈ centralizer s ↔ ∀ g ∈ s, g * z = z * g

{R : Type u}
[Ring R]
{s : Set R}
{z : R}

z ∈ Subring.centralizer s ↔ ∀ g ∈ s, g * z = z * g


@[simp]
theorem _root_.AffineEquiv.wSameSide_map_iff {s : AffineSubspace R P} {x y : P} (f : P ≃ᵃ[R] P') :
    (s.map ↑f).WSameSide (f x) (f y) ↔ s.WSameSide x y

{R : Type u_1}
{V : Type u_2}
{V' : Type u_3}
{P : Type u_4}
{P' : Type u_5}
[StrictOrderedCommRing R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
[AddCommGroup V']
[Module R V']
[AddTorsor V' P']
{s : AffineSubspace R P}
{x y : P}
(f : P ≃ᵃ[R] P')

(AffineSubspace.map (↑f) s).WSameSide (f x) (f y) ↔ s.WSameSide x y


@[simp]
theorem toENat_lift {a : Cardinal.{v}} : toENat (lift.{u} a) = toENat a

Cardinal.toENat (Cardinal.lift.{u, v} a) = Cardinal.toENat a


/-- Auxiliary lemma used as an argument to `CliffordAlgebra.changeForm` -/
theorem changeForm.add_proof : (B + B').toQuadraticMap = Q'' - Q

(h : LinearMap.BilinMap.toQuadraticMap B = Q' - Q)

(h' : LinearMap.BilinMap.toQuadraticMap B' = Q'' - Q')

LinearMap.BilinMap.toQuadraticMap (B + B') = Q'' - Q


theorem measure_lt_top_of_nhdsWithin (h : IsCompact s) (hμ : ∀ x ∈ s, μ.FiniteAtFilter (𝓝[s] x)) :
    μ s < ∞


@[simp]
lemma ranAdjunction_counit : (L.ranAdjunction H).counit = L.ranCounit

[∀ (F : CategoryTheory.Functor C H), L.HasRightKanExtension F]


lemma toENat_injOn : InjOn toENat (Iic ℵ₀)

Set.InjOn (⇑Cardinal.toENat) (Set.Iic Cardinal.aleph0)


@[simp] theorem Bool.or_eq_true (a b : Bool) : ((a || b) = true) = (a = true ∨ b = true)


@[simp]
theorem associator_map_inr {X Y : E} (f : inr X ⟶ inr Y) : (associator C D E).map f = f

(C : Type u)
[CategoryTheory.Category.{v, u} C]
(D : Type u)
[CategoryTheory.Category.{v, u} D]
(E : Type u)
[CategoryTheory.Category.{v, u} E]
{X Y : E}
(f : Sum.inr X ⟶ Sum.inr Y)

(CategoryTheory.sum.associator C D E).map f = f


@[to_additive (attr := simp)]
theorem zpow_iterate (n : ℤ) (j : ℕ) : (fun x : G => x ^ n)^[j] = fun x => x ^ n ^ j

{G : Type u_3}
[AddGroup G]
(n : ℤ)
(j : ℕ)

(fun x => n • x)^[j] = fun x => n ^ j • x


theorem isBigO_refl_left : (fun x => f' x - f' x) =O[l] g'

{α : Type u_1}
{E' : Type u_6}
{F' : Type u_7}
[SeminormedAddCommGroup E']
[SeminormedAddCommGroup F']
{f' : α → E'}
(g' : α → F')
(l : Filter α)


@[to_additive]
theorem mulLeftEmbedding_eq_mulRightEmbedding [CommSemigroup G] [IsCancelMul G] (g : G) :
    mulLeftEmbedding g = mulRightEmbedding g

{G : Type u_1}
[CommSemigroup G]
[IsCancelMul G]
(g : G)


/-- Writing a liminf as a supremum of infimum, in a (possibly non-complete) conditionally complete
linear order. A reparametrization trick is needed to avoid taking the infimum of sets which are
not bounded below. -/
theorem HasBasis.liminf_eq_ite {v : Filter ι} {p : ι' → Prop} {s : ι' → Set ι}
    [Countable (Subtype p)] [Nonempty (Subtype p)] (hv : v.HasBasis p s) (f : ι → α) :
    liminf f v = if ∃ (j : Subtype p), s j = ∅ then sSup univ else
      if ∀ (j : Subtype p), ¬BddBelow (range (fun (i : s j) ↦ f i)) then sSup ∅
      else ⨆ (j : Subtype p), ⨅ (i : s (liminf_reparam f s p j)), f i

{α : Type u_1}
{ι : Type u_4}
{ι' : Type u_5}
[ConditionallyCompleteLinearOrder α]
{v : Filter ι}
{p : ι' → Prop}
{s : ι' → Set ι}
[Countable (Subtype p)]
[Nonempty (Subtype p)]
(hv : v.HasBasis p s)
(f : ι → α)

Filter.liminf f v =
  if ∃ j, s ↑j = ∅ then sSup Set.univ
  else if ∀ (j : Subtype p), ¬BddBelow (Set.range fun i => f ↑i) then sSup ∅ else ⨆ j, ⨅ i, f ↑i


theorem isOpen_pi_iff {s : Set (∀ a, π a)} :
    IsOpen s ↔
      ∀ f, f ∈ s → ∃ (I : Finset ι) (u : ∀ a, Set (π a)),
        (∀ a, a ∈ I → IsOpen (u a) ∧ f a ∈ u a) ∧ (I : Set ι).pi u ⊆ s

{ι : Type u_5}
{π : ι → Type u_6}
[T : (i : ι) → TopologicalSpace (π i)]
{s : Set ((a : ι) → π a)}

IsOpen s ↔ ∀ f ∈ s, ∃ I u, (∀ a ∈ I, IsOpen (u a) ∧ f a ∈ u a) ∧ (↑I).pi u ⊆ s


theorem c_eq_three_roots (ha : P.a ≠ 0) (h3 : (map φ P).roots = {x, y, z}) :
    φ P.c = φ P.a * (x * y + x * z + y * z)

(h3 : (Cubic.map φ P).roots = {x, y, z})


@[simp]
theorem star_eq_self {a : ℍ[R]} : star a = a ↔ a = a.re

{R : Type u_3}
[CommRing R]
[NoZeroDivisors R]
[CharZero R]
{a : ℍ[R]}


@[simp]
theorem finrank_ulift : finrank R (ULift M) = finrank R M

{R : Type u}
{M : Type v}
[Ring R]
[AddCommGroup M]
[Module R M]

FiniteDimensional.finrank R (ULift.{u_2, v} M) = FiniteDimensional.finrank R M


theorem supp_eq_of_isUniform (h : q.IsUniform) {α : TypeVec n} (a : q.P.A) (f : q.P.B a ⟹ α) :
    ∀ i, supp (abs ⟨a, f⟩) i = f i '' univ

{n : ℕ}
{F : TypeVec.{u} n → Type u_1}
[q : MvQPF F]
(h : MvQPF.IsUniform)
{α : TypeVec.{u} n}
(a : (MvQPF.P F).A)
(f : (MvQPF.P F).B a ⟹ α)
(i : Fin2 n)

MvFunctor.supp (MvQPF.abs ⟨a, f⟩) i = f i '' Set.univ


theorem natTrailingDegree_monomial_le : natTrailingDegree (monomial n a) ≤ n

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

((Polynomial.monomial n) a).natTrailingDegree ≤ n


theorem isLindelof_iff_countable [DiscreteTopology X] : IsLindelof s ↔ s.Countable

{X : Type u}
[TopologicalSpace X]
{s : Set X}
[DiscreteTopology X]


theorem Ideal.toIdeal_homogeneousCore_le : (I.homogeneousCore 𝒜).toIdeal ≤ I

{ι : Type u_1}
{σ : Type u_2}
{A : Type u_4}
[Semiring A]
[SetLike σ A]
[AddSubmonoidClass σ A]
(𝒜 : ι → σ)
[DecidableEq ι]
[AddMonoid ι]
[GradedRing 𝒜]
(I : Ideal A)


private theorem HD_lipschitz_aux2 (f g : Cb X Y) :
    (⨆ y, ⨅ x, f (inl x, inr y)) ≤ (⨆ y, ⨅ x, g (inl x, inr y)) + dist f g

{X : Type u}
{Y : Type v}
[MetricSpace X]
[Nonempty X]
[MetricSpace Y]
[Nonempty Y]
(f g : GromovHausdorff.Cb X Y)

⨆ y, ⨅ x, f (Sum.inl x, Sum.inr y) ≤ (⨆ y, ⨅ x, g (Sum.inl x, Sum.inr y)) + dist f g


@[simp]
theorem lanIsKan_desc [HasLeftKanExtension f g] (s : LeftExtension f g) :
    (lanIsKan f g).desc s = lanDesc s

(s : CategoryTheory.Bicategory.LeftExtension f g)

(CategoryTheory.Bicategory.lanIsKan f g).desc s = CategoryTheory.Bicategory.lanDesc s


@[simp, norm_cast] lemma coe_mul (a b : α) : (↑(a * b) : WithTop α) = a * b

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


/-- Polynomial evaluation commutes with `Finset.prod`
-/
theorem eval_prod {ι : Type*} (s : Finset ι) (p : ι → R[X]) (x : R) :
    eval x (∏ j ∈ s, p j) = ∏ j ∈ s, eval x (p j)

{R : Type u}
[CommSemiring R]
{ι : Type u_1}
(s : Finset ι)
(p : ι → R[X])
(x : R)

Polynomial.eval x (∏ j ∈ s, p j) = ∏ j ∈ s, Polynomial.eval x (p j)


@[to_additive (attr := simp)]
theorem coe_comp' {G H K : Type _} [CommGroup G] [CommGroup H] [CommGroup K]
    (f : G →* H) (g : H →* K) :
    @DFunLike.coe (G →* K) G (fun _ ↦ K) MonoidHom.instFunLike (CategoryStruct.comp
      (X := CommGrp.of G) (Y := CommGrp.of H) (Z := CommGrp.of K) f g) = g ∘ f

{G H K : Type u_1}
[CommGroup G]
[CommGroup H]
[CommGroup K]
(f : G →* H)
(g : H →* K)


/-- Order equipped with a sensible predecessor function. -/
@[ext]
class PredOrder (α : Type*) [Preorder α] where
  /-- Predecessor function-/
  pred : α → α
  /-- Proof of basic ordering with respect to `pred`-/
  pred_le : ∀ a, pred a ≤ a
  /-- Proof of interaction between `pred` and minimal element-/
  min_of_le_pred {a} : a ≤ pred a → IsMin a
  /-- Proof that `pred` satisfies ordering invariants between `LT` and `LE`-/
  le_pred_of_lt {a b} : a < b → a ≤ pred b
  /-- Proof that `pred` satisfies ordering invariants between `LE` and `LT`-/
  le_of_pred_lt {a b} : pred a < b → a ≤ b

{α : Type u_3}
[Preorder α]
[self : PredOrder α]
{a b : α}


theorem comm : IsMetricSeparated s t ↔ IsMetricSeparated t s

{X : Type u_1}
[EMetricSpace X]
{s t : Set X}


@[simp]
theorem mul_refl (e : Perm α) : e * Equiv.refl α = e