/-- Given two pairs of distinct points on the same line, such that the vectors between those
pairs of points are on the same ray (oriented in the same direction on that line), and a fifth
point, the angles at the fifth point between each of those two pairs of points have the same
sign. -/
theorem _root_.Collinear.oangle_sign_of_sameRay_vsub {p₁ p₂ p₃ p₄ : P} (p₅ : P) (hp₁p₂ : p₁ ≠ p₂)
    (hp₃p₄ : p₃ ≠ p₄) (hc : Collinear ℝ ({p₁, p₂, p₃, p₄} : Set P))
    (hr : SameRay ℝ (p₂ -ᵥ p₁) (p₄ -ᵥ p₃)) : (∡ p₁ p₅ p₂).sign = (∡ p₃ p₅ p₄).sign

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


@[to_additive]
-- Porting note (#11119): removed `simp` attribute because `simpNF` says it can prove it.
protected theorem map_one [FunLike F α β] [OneHomClass F α β] (φ : F) : map φ 1 = 1

{F : Type u_1}
{α : Type u_2}
{β : Type u_3}
[Zero α]
[Zero β]
[FunLike F α β]
[ZeroHomClass F α β]
(φ : F)


@[simp]
theorem mem_Ico : x ∈ Ico a b ↔ a ≤ x ∧ x < b

{α : Type u_1}
[Preorder α]
[LocallyFiniteOrder α]
{a b x : α}


lemma hasProduct_of_equiv_of_iso (f : α → C) (g : β → C)
    [HasProduct f] (e : β ≃ α) (iso : ∀ j, g j ≅ f (e j)) : HasProduct g

{β : Type w}
{α : Type w₂}
{C : Type u}
[CategoryTheory.Category.{v, u} C]
(f : α → C)
(g : β → C)
[CategoryTheory.Limits.HasProduct f]
(e : β ≃ α)
(iso : (j : β) → g j ≅ f (e j))


@[simp]
theorem mem_Iic : x ∈ Iic a ↔ x ≤ a

{α : Type u_1}
[Preorder α]
[LocallyFiniteOrderBot α]
{a x : α}


theorem le_one_div_of_neg (ha : a < 0) (hb : b < 0) : a ≤ 1 / b ↔ b ≤ 1 / a

{α : Type u_2}
[LinearOrderedField α]
{a b : α}
(ha : a < 0)
(hb : b < 0)


theorem adjoin_eq_span_of_subset {s : Set A} (hs : ↑(Submonoid.closure s) ⊆ (span R s : Set A)) :
    Subalgebra.toSubmodule (adjoin R s) = span R s

(hs : ↑(Submonoid.closure s) ⊆ ↑(Submodule.span R s))

Subalgebra.toSubmodule (Algebra.adjoin R s) = Submodule.span R s


theorem to_reflTransGen : ∀ {a b}, ReflGen r a b → ReflTransGen r a b

{α : Type u_1}
{r : α → α → Prop}
{a b : α}

Relation.ReflGen r a b → Relation.ReflTransGen r a b


protected theorem isRefl (f : r ↪r s) [IsRefl β s] : IsRefl α r

{α : Type u_1}
{β : Type u_2}
{r : α → α → Prop}
{s : β → β → Prop}
(f : r ↪r s)
[IsRefl β s]


protected theorem Subsingleton.monovaryOn [Subsingleton ι] (f : ι → α) (g : ι → β) (s : Set ι) :
    MonovaryOn f g s

{ι : Type u_1}
{α : Type u_3}
{β : Type u_4}
[Preorder α]
[Preorder β]
[Subsingleton ι]
(f : ι → α)
(g : ι → β)
(s : Set ι)


@[simp]
theorem toLinearEquiv_eq_coe (f : A ≃ₗc[R] B) : f.toLinearEquiv = f

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
[CommSemiring R]
[AddCommMonoid A]
[AddCommMonoid B]
[Module R A]
[Module R B]
[CoalgebraStruct R A]
[CoalgebraStruct R B]
(f : A ≃ₗc[R] B)


theorem isSimpleOrder [BoundedOrder α] [BoundedOrder β] [h : IsSimpleOrder β] (f : α ≃o β) :
    IsSimpleOrder α

{α : Type u_2}
{β : Type u_3}
[PartialOrder α]
[PartialOrder β]
[BoundedOrder α]
[BoundedOrder β]
[h : IsSimpleOrder β]
(f : α ≃o β)


@[simp]
theorem map_comp (g' : P' →ₐ[R] P'') : I.map (g'.comp g) = (I.map g).map g'

{R : Type u_1}
[CommRing R]
{S : Submonoid R}
{P : Type u_2}
[CommRing P]
[Algebra R P]
{P' : Type u_3}
[CommRing P']
[Algebra R P']
{P'' : Type u_4}
[CommRing P'']
[Algebra R P'']
(I : FractionalIdeal S P)
(g : P →ₐ[R] P')
(g' : P' →ₐ[R] P'')

FractionalIdeal.map (g'.comp g) I = FractionalIdeal.map g' (FractionalIdeal.map g I)


theorem lowerCentralSeries_prod (n : ℕ) :
    lowerCentralSeries (G₁ × G₂) n = (lowerCentralSeries G₁ n).prod (lowerCentralSeries G₂ n)

{G₁ : Type u_2}
{G₂ : Type u_3}
[Group G₁]
[Group G₂]
(n : ℕ)


@[to_additive]
theorem finprod_mem_univ (f : α → M) : ∏ᶠ i ∈ @Set.univ α, f i = ∏ᶠ i : α, f i

{α : Type u_1}
{M : Type u_5}
[AddCommMonoid M]
(f : α → M)

∑ᶠ (i : α) (_ : i ∈ Set.univ), f i = ∑ᶠ (i : α), f i


/-- A version of `getElem_map` that can be used for rewriting. -/
theorem getElem_map_rev (f : α → β) {l} {n : Nat} {h : n < l.length} :
    f l[n] = (map f l)[n]'((l.length_map f).symm ▸ h)

{α : Type u}
{β : Type v}
(f : α → β)
{l : List α}
{n : ℕ}
{h : n < l.length}


@[simp]
nonrec theorem Ici_bot [OrderBot α] : Ici (⊥ : α) = ⊥

{α : Type u_1}
[Preorder α]
[OrderBot α]


lemma lintegral_toKernel_univ [IsFiniteKernel κ] (hf : IsCondKernelCDF f κ ν) (a : α) :
    ∫⁻ b, hf.toKernel f (a, b) univ ∂(ν a) = κ a univ

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

(hf : ProbabilityTheory.IsCondKernelCDF f κ ν)

∫⁻ (b : β), ((ProbabilityTheory.IsCondKernelCDF.toKernel f hf) (a, b)) Set.univ ∂ν a = (κ a) Set.univ


theorem nfBelow_iff_topBelow {b} [NF b] : ∀ {o}, NFBelow o (repr b) ↔ NF o ∧ TopBelow b o


theorem subset_succChain : s ⊆ SuccChain r s

{α : Type u_1}
{r : α → α → Prop}
{s : Set α}


/-- `OneHom M N` is the type of functions `M → N` that preserve one.

When possible, instead of parametrizing results over `(f : OneHom M N)`,
you should parametrize over `(F : Type*) [OneHomClass F M N] (f : F)`.

When you extend this structure, make sure to also extend `OneHomClass`.
-/
@[to_additive]
structure OneHom (M : Type*) (N : Type*) [One M] [One N] where
  /-- The underlying function -/
  protected toFun : M → N
  /-- The proposition that the function preserves 1 -/
  protected map_one' : toFun 1 = 1

{M : Type u_10}
{N : Type u_11}
[One M]
[One N]
(self : OneHom M N)


theorem mem_weightSpace (χ : L → R) (m : M) :
    m ∈ weightSpace M χ ↔ ∀ x, ∃ k : ℕ, ((toEnd R L M x - χ x • ↑1) ^ k) m = 0

{R : Type u_2}
{L : Type u_3}
(M : Type u_4)
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[LieAlgebra.IsNilpotent R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
(χ : L → R)
(m : M)

m ∈ LieModule.weightSpace M χ ↔ ∀ (x : L), ∃ k, (((LieModule.toEnd R L M) x - χ x • 1) ^ k) m = 0


theorem exp_diagonal (v : m → 𝔸) : exp 𝕂 (diagonal v) = diagonal (exp 𝕂 v)

(𝕂 : Type u_1)
{m : Type u_2}
{𝔸 : Type u_6}
[Fintype m]
[DecidableEq m]
[Field 𝕂]
[Ring 𝔸]
[TopologicalSpace 𝔸]
[TopologicalRing 𝔸]
[Algebra 𝕂 𝔸]
[T2Space 𝔸]
(v : m → 𝔸)

NormedSpace.exp 𝕂 (Matrix.diagonal v) = Matrix.diagonal (NormedSpace.exp 𝕂 v)


theorem EqualizerCondition.bijective_mapToEqualizer_pullback (P : Cᵒᵖ ⥤ Type*)
    (hP : EqualizerCondition P) : ∀ (X B : C) (π : X ⟶ B) [EffectiveEpi π] [HasPullback π π],
    Function.Bijective
      (MapToEqualizer P π (pullback.fst π π) (pullback.snd π π) pullback.condition)

(P : CategoryTheory.Functor Cᵒᵖ (Type u_4))

(hP : CategoryTheory.regularTopology.EqualizerCondition P)

Function.Bijective
  (CategoryTheory.regularTopology.MapToEqualizer P π (CategoryTheory.Limits.pullback.fst π π)
    (CategoryTheory.Limits.pullback.snd π π) ⋯)


@[simp]
theorem liftAlternating_apply_ιMulti {n : ℕ} (f : ∀ i, M [⋀^Fin i]→ₗ[R] N)
    (v : Fin n → M) : liftAlternating (R := R) (M := M) (N := N) f (ιMulti R n v) = f n v

{R : Type u_1}
{M : Type u_2}
{N : Type u_3}
[CommRing R]
[AddCommGroup M]
[AddCommGroup N]
[Module R M]
[Module R N]
{n : ℕ}
(f : (i : ℕ) → M [⋀^Fin i]→ₗ[R] N)
(v : Fin n → M)

(ExteriorAlgebra.liftAlternating f) ((ExteriorAlgebra.ιMulti R n) v) = (f n) v


nonrec theorem RCond.min {ι : Type*} {r₁ r₂ : (ι → ℝ) → Ioi (0 : ℝ)} (h₁ : l.RCond r₁)
    (h₂ : l.RCond r₂) : l.RCond fun x => min (r₁ x) (r₂ x)

{l : BoxIntegral.IntegrationParams}
{ι : Type u_2}
{r₁ r₂ : (ι → ℝ) → ↑(Set.Ioi 0)}
(h₁ : l.RCond r₁)
(h₂ : l.RCond r₂)


@[simp] lemma coeff_mul_natCast {a k : ℕ} :
  coeff (p * (a : R[X])) k = coeff p k * (↑a : R)

{R : Type u}
[Semiring R]
{p : R[X]}
{a k : ℕ}


@[to_additive Set.AddAntidiagonal.eq_of_snd_eq_snd]
theorem eq_of_snd_eq_snd (h : (x : α × α).snd = (y : α × α).snd) : x = y

{α : Type u_1}
[AddCancelCommMonoid α]
{s t : Set α}
{a : α}
{x y : ↑(s.addAntidiagonal t a)}
(h : (↑x).2 = (↑y).2)


theorem mem_def (a : α) (as : Array α) : a ∈ as ↔ a ∈ as.data


/-- A subgraph is preconnected if it is preconnected when coerced to be a simple graph.

Note: This is a structure to make it so one can be precise about how dot notation resolves. -/
protected structure Preconnected (H : G.Subgraph) : Prop where
  protected coe : H.coe.Preconnected

{V : Type u}
{G : SimpleGraph V}
{H : G.Subgraph}
(self : H.Preconnected)


theorem isCompl_iff [∀ i, BoundedOrder (α' i)] {f g : ∀ i, α' i} :
    IsCompl f g ↔ ∀ i, IsCompl (f i) (g i)

{ι : Type u_1}
{α' : ι → Type u_2}
[(i : ι) → PartialOrder (α' i)]
[(i : ι) → BoundedOrder (α' i)]
{f g : (i : ι) → α' i}

IsCompl f g ↔ ∀ (i : ι), IsCompl (f i) (g i)


@[simp]
theorem zero_disjSum : (0 : Multiset α).disjSum t = t.map inr

{α : Type u_1}
{β : Type u_2}
(t : Multiset β)

Multiset.disjSum 0 t = Multiset.map Sum.inr t


/-- Given `hA : IsUnit A.det` and `b : Basis R b`, `A.toLinearEquiv b hA` is
the `LinearEquiv` arising from `toLin b b A`.

See `Matrix.toLinearEquiv'` for this result on `n → R`.
-/
@[simps apply]
noncomputable def toLinearEquiv [DecidableEq n] (A : Matrix n n R) (hA : IsUnit A.det) :
    M ≃ₗ[R] M

{n : Type u_1}
[Fintype n]
{R : Type u_2}
{M : Type u_3}
[CommRing R]
[AddCommGroup M]
[Module R M]
(b : Basis n R M)
[DecidableEq n]
(A : Matrix n n R)
(hA : IsUnit A.det)
(a : M)

(Matrix.toLinearEquiv b A hA) a = ((Matrix.toLin b b) A) a


/-- In a codirected order, the union of bounded below sets is bounded below. -/
theorem BddBelow.union [IsDirected α (· ≥ ·)] {s t : Set α} :
    BddBelow s → BddBelow t → BddBelow (s ∪ t)

{α : Type u}
[Preorder α]
[IsDirected α fun x x_1 => x ≥ x_1]
{s t : Set α}


lemma hom_ext (hP : IsPushout f g inl inr) {W : C} {k l : P ⟶ W}
    (h₀ : inl ≫ k = inl ≫ l) (h₁ : inr ≫ k = inr ≫ l) : k = l

(hP : CategoryTheory.IsPushout f g inl inr)


/-- The `tail` of a `nil` vector is `nil`. -/
@[simp]
theorem tail_nil : (@nil α).tail = nil


@[simp]
theorem ofFn_succ {n} (f : Fin (succ n) → α) : ofFn f = f 0 :: ofFn fun i => f i.succ

{α : Type u}
{n : ℕ}
(f : Fin n.succ → α)

List.ofFn f = f 0 :: List.ofFn fun i => f i.succ


theorem isStoppingTime_of_measurableSet_eq [Preorder ι] [Countable ι] {f : Filtration ι m}
    {τ : Ω → ι} (hτ : ∀ i, MeasurableSet[f i] {ω | τ ω = i}) : IsStoppingTime f τ

(hτ : ∀ (i : ι), MeasurableSet {ω | τ ω = i})


@[simp] lemma norm_down (x : ULift E) : ‖x.down‖ = ‖x‖

{E : Type u_2}
[Norm E]
(x : ULift.{u_5, u_2} E)


theorem scaleRoots_eval₂_eq_zero_of_eval₂_div_eq_zero {p : S[X]} {f : S →+* K}
    (hf : Function.Injective f) {r s : S} (hr : eval₂ f (f r / f s) p = 0)
    (hs : s ∈ nonZeroDivisors S) : eval₂ f (f r) (scaleRoots p s) = 0

(hr : Polynomial.eval₂ f (f r / f s) p = 0)

Polynomial.eval₂ f (f r) (p.scaleRoots s) = 0


@[simp]
theorem rdrop_zero : rdrop l 0 = l


theorem locallyIntegrable_finset_sum {ι} (s : Finset ι) {f : ι → X → E}
    (hf : ∀ i ∈ s, LocallyIntegrable (f i) μ) : LocallyIntegrable (fun a ↦ ∑ i ∈ s, f i a) μ

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

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


/-- The yoneda version of the sheaf condition is equivalent to the sheaf condition.

C2.1.4 of [Elephant].
-/
theorem isSheafFor_iff_yonedaSheafCondition {P : Cᵒᵖ ⥤ Type v₁} :
    IsSheafFor P (S : Presieve X) ↔ YonedaSheafCondition P S

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

CategoryTheory.Presieve.IsSheafFor P S.arrows ↔ CategoryTheory.Presieve.YonedaSheafCondition P S


@[simp]
theorem mul_transvection_apply_of_ne (a b : n) (hb : b ≠ j) (c : R) (M : Matrix n n R) :
    (M * transvection i j c) a b = M a b

{n : Type u_1}
{R : Type u₂}
[DecidableEq n]
[CommRing R]
(i j : n)
[Fintype n]
(a b : n)
(hb : b ≠ j)
(c : R)
(M : Matrix n n R)

(M * Matrix.transvection i j c) a b = M a b


theorem mem_polar_iff {x' : Dual 𝕜 E} (s : Set E) : x' ∈ polar 𝕜 s ↔ ∀ z ∈ s, ‖x' z‖ ≤ 1

(𝕜 : Type u_1)
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[SeminormedAddCommGroup E]
[NormedSpace 𝕜 E]
{x' : NormedSpace.Dual 𝕜 E}
(s : Set E)

x' ∈ NormedSpace.polar 𝕜 s ↔ ∀ z ∈ s, ‖x' z‖ ≤ 1


@[simp]
theorem symm_symm : e.symm.symm = e

{R : Type u_1}
{R₂ : Type u_2}
{E : Type u_5}
{E₂ : Type u_6}
[Semiring R]
[Semiring R₂]
{σ₁₂ : R →+* R₂}
{σ₂₁ : R₂ →+* R}
[RingHomInvPair σ₁₂ σ₂₁]
[RingHomInvPair σ₂₁ σ₁₂]
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup E₂]
[Module R E]
[Module R₂ E₂]
(e : E ≃ₛₗᵢ[σ₁₂] E₂)


@[simp]
theorem monoOver_terminal_to_subterminals_comp [HasTerminal C] :
    (subterminalsEquivMonoOverTerminal C).inverse ⋙ subterminalInclusion C =
      MonoOver.forget _ ⋙ Over.forget _

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

(CategoryTheory.subterminalsEquivMonoOverTerminal C).inverse.comp (CategoryTheory.subterminalInclusion C) =
  (CategoryTheory.MonoOver.forget (⊤_ C)).comp (CategoryTheory.Over.forget (⊤_ C))


/-- When the first map `S.f` is zero, this is the right homology data on `S` given
by any limit kernel fork of `S.g` -/
@[simps]
def ofIsLimitKernelFork (hf : S.f = 0) (c : KernelFork S.g) (hc : IsLimit c) :
    S.RightHomologyData

(c : CategoryTheory.Limits.KernelFork S.g)

(CategoryTheory.ShortComplex.RightHomologyData.ofIsLimitKernelFork S hf c hc).p = CategoryTheory.CategoryStruct.id S.X₂


/-- The Lebesgue integral of the exponential pdf over nonpositive reals equals 0-/
lemma lintegral_exponentialPDF_of_nonpos {x r : ℝ} (hx : x ≤ 0) :
    ∫⁻ y in Iio x, exponentialPDF r y = 0

∫⁻ (y : ℝ) in Set.Iio x, ProbabilityTheory.exponentialPDF r y = 0


/-- The functor `Comma L R₁ ⥤ Comma L R₃` induced by the composition of the natural transformations
    `r : R₁ ⟶ R₂` and `r' : R₂ ⟶ R₃` is naturally isomorphic to the composition of the functors
    induced by these natural transformations. -/
@[simps!]
def mapRightComp (r : R₁ ⟶ R₂) (r' : R₂ ⟶ R₃) :
    mapRight L (r ≫ r') ≅ mapRight L r ⋙ mapRight L r'

{A : Type u₁}
[CategoryTheory.Category.{v₁, u₁} A]
{B : Type u₂}
[CategoryTheory.Category.{v₂, u₂} B]
{T : Type u₃}
[CategoryTheory.Category.{v₃, u₃} T]
(L : CategoryTheory.Functor A T)
{R₁ R₂ R₃ : CategoryTheory.Functor B T}
(r : R₁ ⟶ R₂)
(r' : R₂ ⟶ R₃)
(X : CategoryTheory.Comma L R₁)

((CategoryTheory.Comma.mapRightComp L r r').hom.app X).right = CategoryTheory.CategoryStruct.id X.right


{R : Type u_2}
{M : Type u_5}
[Ring R]
[AddCommGroup M]
[Module R M]
(r : R)
(x : M)


/-- Constructs an equivalence between bounded lattices from an order isomorphism
between them. -/
@[simps]
def Iso.mk {α β : BddLat.{u}} (e : α ≃o β) : α ≅ β

{α β : BddLat}
(e : ↑α.toLat ≃o ↑β.toLat)
(a : ↑β.toLat)

(BddLat.Iso.mk e).inv.toSupHom a = e.symm a


theorem ContDiff.comp_contMDiff {g : F → F'} {f : M → F} (hg : ContDiff 𝕜 n g)
    (hf : ContMDiff I 𝓘(𝕜, F) n f) : ContMDiff I 𝓘(𝕜, F') n (g ∘ f)

{𝕜 : 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]
{F : Type u_8}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{F' : Type u_11}
[NormedAddCommGroup F']
[NormedSpace 𝕜 F']
{n : ℕ∞}
{g : F → F'}
{f : M → F}
(hg : ContDiff 𝕜 n g)
(hf : ContMDiff I 𝓘(𝕜, F) n f)


/-- The definition of `0 ⧏ x` on pre-games, in terms of `0 ≤`. -/
theorem zero_lf_le {x : PGame} : 0 ⧏ x ↔ ∃ i, 0 ≤ x.moveLeft i

SetTheory.PGame.LF 0 x ↔ ∃ i, 0 ≤ x.moveLeft i


lemma quasiIso_of_epi_of_isIso_of_mono (φ : S₁ ⟶ S₂) [Epi φ.τ₁] [IsIso φ.τ₂] [Mono φ.τ₃] :
    QuasiIso φ


@[simp]
theorem insert_ne_empty (a : α) (s : Finset α) : insert a s ≠ ∅

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


/-- `X ⨯ -` has a comonad structure. This is sometimes called the writer comonad. -/
@[simps!]
def prodComonad : Comonad C

(CategoryTheory.prodComonad X).obj Y = (X ⨯ Y)


@[simp]
theorem not_ite_eq_false_eq_false (p : Prop) [h : Decidable p] (b c : Bool) :
  ¬(ite p (b = false) (c = false)) ↔ (ite p (b = true) (c = true))

(¬if p then b = false else c = false) ↔ if p then b = true else c = true


theorem exists_mem_nil (p : α → Prop) : ¬ (∃ x, ∃ _ : x ∈ @nil α, p x)


/-- Auxiliary lemma for `rnDeriv_add_right_of_mutuallySingular`. -/
lemma rnDeriv_add_right_of_absolutelyContinuous_of_mutuallySingular {ν' : Measure α}
    [SigmaFinite μ] [SigmaFinite ν] [SigmaFinite ν']
    (hμν : μ ≪ ν) (hνν' : ν ⟂ₘ ν') :
    μ.rnDeriv (ν + ν') =ᵐ[ν] μ.rnDeriv ν

{α : Type u_1}
{m : MeasurableSpace α}
{μ ν ν' : MeasureTheory.Measure α}
[MeasureTheory.SigmaFinite μ]
[MeasureTheory.SigmaFinite ν]
[MeasureTheory.SigmaFinite ν']
(hμν : μ ≪ ν)
(hνν' : ν ⟂ₘ ν')


@[simp, norm_cast]
theorem coe_linearMap_mk {f : A →ₗ[R] B} (h h₁) : ((⟨f, h, h₁⟩ : A →ₗc[R] B) : A →ₗ[R] B) = f

(h : Coalgebra.counit ∘ₗ f = Coalgebra.counit)

(h₁ : TensorProduct.map f f ∘ₗ Coalgebra.comul = Coalgebra.comul ∘ₗ f)

↑{ toLinearMap := f, counit_comp := h, map_comp_comul := h₁ } = f


theorem continuousOn_iff' [TopologicalSpace β] {f : β → α} {s : Set β} :
    ContinuousOn f s ↔ ∀ b ∈ s, ∀ ε > 0, ∀ᶠ x in 𝓝[s] b, dist (f x) (f b) < ε

{α : Type u}
{β : Type v}
[PseudoMetricSpace α]
[TopologicalSpace β]
{f : β → α}
{s : Set β}

ContinuousOn f s ↔ ∀ b ∈ s, ∀ ε > 0, ∀ᶠ (x : β) in 𝓝[s] b, dist (f x) (f b) < ε


@[simp] theorem ofReal_ofNat (n : ℕ) [n.AtLeastTwo] :
    ENNReal.ofReal (no_index (OfNat.ofNat n)) = OfNat.ofNat n

ENNReal.ofReal (OfNat.ofNat n) = OfNat.ofNat n


/-- If `x` is in the domain of the induced map of a scheme `A`,
its image under this map is in each set along the corresponding branch. -/
theorem map_mem (x : (inducedMap A).1) (n : ℕ) : (inducedMap A).2 x ∈ A (res x n)

{β : Type u_1}
{α : Type u_2}
{A : List β → Set α}
(x : ↑(CantorScheme.inducedMap A).fst)
(n : ℕ)

(CantorScheme.inducedMap A).snd x ∈ A (PiNat.res (↑x) n)


@[norm_cast] theorem ofNat_sub (h : m ≤ n) : ((n - m : Nat) : Int) = n - m


/-- `limit F` is functorial in `F`, when `C` has all limits of shape `J`. -/
@[simps]
def lim : (J ⥤ C) ⥤ C

∀ {X Y : J ⥤ C} (α : X ⟶ Y), CategoryTheory.Limits.lim.map α = CategoryTheory.Limits.limMap α


@[simp] theorem tendsto_top {f : α → β} {l : Filter α} : Tendsto f l ⊤

{α : Type u}
{β : Type v}
{f : α → β}
{l : Filter α}


theorem trans_source'' : (e.trans e').source = e.symm '' (e.target ∩ e'.source)

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

(e.trans e').source = ↑e.symm '' (e.target ∩ e'.source)


lemma inv_smul_le_iff_of_neg (h : a < 0) : a⁻¹ • b₁ ≤ b₂ ↔ a • b₂ ≤ b₁

{α : Type u_1}
{β : Type u_2}
[LinearOrderedField α]
[OrderedAddCommGroup β]
[Module α β]
{a : α}
{b₁ b₂ : β}
[PosSMulMono α β]
(h : a < 0)

a⁻¹ • b₁ ≤ b₂ ↔ a • b₂ ≤ b₁


@[csimp]
private theorem rec_eq_recCompiled : @Nat.rec = @Nat.recCompiled


/-- The converse of this is true with additional assumptions, see `mono_iff_mono_right`. -/
theorem mono_of_mono_right {A B : StructuredArrow S T} (f : A ⟶ B) [h : Mono f.right] : Mono f

{A B : CategoryTheory.StructuredArrow S T}


@[to_additive (attr := simp)]
theorem inv_le_inv_iff : a⁻¹ ≤ b⁻¹ ↔ b ≤ a

[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]


@[to_additive (attr := simp) top_prod_top]
theorem top_prod_top : (⊤ : Submonoid M).prod (⊤ : Submonoid N) = ⊤

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


protected theorem eq_of_add_eq_add_right {a b c : Cardinal} (h : a + b = c + b) (hb : b < ℵ₀) :
    a = c

{a b c : Cardinal.{u_1}}
(h : a + b = c + b)
(hb : b < ℵ₀)


@[simp] lemma inv_op_smul_set_distrib₀ (a : α) (s : Set α) : (op a • s)⁻¹ = a⁻¹ • s⁻¹

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


theorem map_mk_sublist_sym2 (x : α) (xs : List α) (h : x ∈ xs) :
    map (fun y ↦ s(x, y)) xs <+ xs.sym2

{α : Type u_1}
(x : α)
(xs : List α)
(h : x ∈ xs)

(List.map (fun y => s(x, y)) xs).Sublist xs.sym2


theorem card_fintypeIic : Fintype.card (Set.Iic b) = b + 1


/-- If a product of a `Finset` of a subsingleton type has a given
value, so do the terms in that product. -/
@[to_additive "If a sum of a `Finset` of a subsingleton type has a given
  value, so do the terms in that sum."]
theorem eq_of_subsingleton_of_prod_eq {ι : Type*} [Subsingleton ι] {s : Finset ι} {f : ι → M}
    {b : M} (h : ∏ i ∈ s, f i = b) : ∀ i ∈ s, f i = b

{M : Type u_4}
[CommMonoid M]
{ι : Type u_5}
[Subsingleton ι]
{s : Finset ι}
{f : ι → M}
{b : M}
(h : ∏ i ∈ s, f i = b)
(i : ι)


@[simp]
theorem deriv_sin : deriv sin = cos


theorem minFac_dvd (n : ℕ) : minFac n ∣ n


theorem Ico_mem_nhds {a b x : α} (ha : a < x) (hb : x < b) : Ico a b ∈ 𝓝 x

{α : Type u}
[TopologicalSpace α]
[LinearOrder α]
[OrderClosedTopology α]
{a b x : α}
(ha : a < x)
(hb : x < b)


theorem to_product_injective_of_isLimit {D : Cone F} (hD : IsLimit D) :
    Function.Injective fun (x : D.pt) (j : J) => D.π.app j x

[CategoryTheory.Limits.PreservesLimit F (CategoryTheory.forget C)]

Function.Injective fun x j => (D.π.app j) x


/-- A family is affinely independent if and only if the differences
from a base point in that family are linearly independent. -/
theorem affineIndependent_iff_linearIndependent_vsub (p : ι → P) (i1 : ι) :
    AffineIndependent k p ↔ LinearIndependent k fun i : { x // x ≠ i1 } => (p i -ᵥ p i1 : V)

(k : Type u_1)
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{ι : Type u_4}
(p : ι → P)
(i1 : ι)

AffineIndependent k p ↔ LinearIndependent k fun i => p ↑i -ᵥ p i1


/-- Given an equivalence `e : R ≃+* S` of semirings and a subsemiring `s` of `R`,
`subsemiring_map e s` is the induced equivalence between `s` and `s.map e` -/
@[simps!]
def subsemiringMap (e : R ≃+* S) (s : Subsemiring R) : s ≃+* s.map e.toRingHom

{R : Type u}
{S : Type v}
[NonAssocSemiring R]
[NonAssocSemiring S]
(e : R ≃+* S)
(s : Subsemiring R)
(x : ↑↑s.toAddSubmonoid)


theorem toList_cons {a : α} {s : Finset α} (h : a ∉ s) : (cons a s h).toList ~ a :: s.toList

{α : Type u_1}
{a : α}
{s : Finset α}
(h : a ∉ s)

(Finset.cons a s h).toList.Perm (a :: s.toList)


@[simp]
theorem single_smul {i : ι} (c : γ) (x : β i) : single i (c • x) = c • single i x

{ι : Type u}
{γ : Type w}
{β : ι → Type v}
[DecidableEq ι]
[Monoid γ]
[(i : ι) → AddMonoid (β i)]
[(i : ι) → DistribMulAction γ (β i)]
{i : ι}
(c : γ)
(x : β i)

DFinsupp.single i (c • x) = c • DFinsupp.single i x


theorem ae_essInf_le
    (hf : IsBoundedUnder (· ≥ ·) (ae μ) f := by isBoundedDefault) :
    ∀ᵐ y ∂μ, essInf f μ ≤ f y

(hf : Filter.IsBoundedUnder (fun x x_1 => x ≥ x_1) (MeasureTheory.ae μ) f := by isBoundedDefault)


@[simp] theorem succRecOn_succ {motive : ∀ n, Fin n → Sort _} {zero succ} {n} (i : Fin n) :
    @Fin.succRecOn (n + 1) i.succ motive zero succ = succ n i (Fin.succRecOn i zero succ)

{succ : (n : Nat) → (i : Fin n) → motive n i → motive n.succ i.succ}

i.succ.succRecOn zero succ = succ n i (i.succRecOn zero succ)


theorem end_hom_mk_of_mk {s} (sec : s ∈ G.end) {K L : (Finset V)ᵒᵖ} (h : L ⟶ K) {v : V}
    (vnL : v ∉ L.unop) (hs : s L = G.componentComplMk vnL) :
    s K = G.componentComplMk (Set.not_mem_subset (le_of_op_hom h : _ ⊆ _) vnL)

{s : (j : (Finset V)ᵒᵖ) → G.componentComplFunctor.obj j}


/-- The inf of two affine subspaces, coerced to a set, is the intersection of the two sets of
points. -/
@[simp]
theorem inf_coe (s1 s2 : AffineSubspace k P) : (s1 ⊓ s2 : Set P) = (s1 : Set P) ∩ s2

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


theorem nonempty_of_exists {α : Sort u} {p : α → Prop} : Exists (fun x => p x) → Nonempty α


theorem verschiebung_nonzero {x : 𝕎 R} (hx : x ≠ 0) :
    ∃ n : ℕ, ∃ x' : 𝕎 R, x'.coeff 0 ≠ 0 ∧ x = verschiebung^[n] x'

{p : ℕ}
{R : Type u_1}
[hp : Fact (Nat.Prime p)]
[CommRing R]
{x : WittVector p R}
(hx : x ≠ 0)

∃ n x', x'.coeff 0 ≠ 0 ∧ x = (⇑WittVector.verschiebung)^[n] x'


/-- The `star` map in a normed star group is an isometry -/
theorem star_isometry : Isometry (star : E → E)

{E : Type u_2}
[SeminormedAddCommGroup E]
[StarAddMonoid E]
[NormedStarGroup E]


lemma shiftIso_add'_hom_app (n m mn : M) (hnm : m + n = mn) (a a' a'' : M)
    (ha' : n + a = a') (ha'' : m + a' = a'') (X : C) :
    (F.shiftIso mn a a'' (by rw [← hnm, ← ha'', ← ha', add_assoc])).hom.app X =
      (shift F a).map ((shiftFunctorAdd' C m n mn hnm).hom.app X) ≫
        (shiftIso F n a a' ha').hom.app ((shiftFunctor C m).obj X) ≫
          (shiftIso F m a' a'' ha'').hom.app X

{C : Type u_1}
{A : Type u_2}
[CategoryTheory.Category.{u_6, u_1} C]
[CategoryTheory.Category.{u_5, u_2} A]
(F : C ⥤ A)
{M : Type u_3}
[AddMonoid M]
[CategoryTheory.HasShift C M]
[F.ShiftSequence M]
(n m mn : M)
(hnm : m + n = mn)
(a a' a'' : M)
(ha' : n + a = a')
(ha'' : m + a' = a'')
(X : C)

(F.shiftIso mn a a'' ⋯).hom.app X =
  (F.shift a).map ((CategoryTheory.shiftFunctorAdd' C m n mn hnm).hom.app X) ≫
    (F.shiftIso n a a' ha').hom.app ((CategoryTheory.shiftFunctor C m).obj X) ≫ (F.shiftIso m a' a'' ha'').hom.app X


@[simp]
theorem relabel_relabel (f : α → β) (g : β → γ) (t : L.Term α) :
    (t.relabel f).relabel g = t.relabel (g ∘ f)

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

FirstOrder.Language.Term.relabel g (FirstOrder.Language.Term.relabel f t) = FirstOrder.Language.Term.relabel (g ∘ f) t


theorem nodupKeys_dedupKeys (l : List (Sigma β)) : NodupKeys (dedupKeys l)

{α : Type u}
{β : α → Type v}
[DecidableEq α]
(l : List (Sigma β))


theorem measure_biUnion_le {I : Set ι} (μ : F) (hI : I.Countable) (s : ι → Set α) :
    μ (⋃ i ∈ I, s i) ≤ ∑' i : I, μ (s i)

{α : Type u_1}
{ι : Type u_2}
{F : Type u_3}
[FunLike F (Set α) ℝ≥0∞]
[MeasureTheory.OuterMeasureClass F α]
{I : Set ι}
(μ : F)
(hI : I.Countable)
(s : ι → Set α)

μ (⋃ i ∈ I, s i) ≤ ∑' (i : ↑I), μ (s ↑i)


lemma exists_ideal_comap_le_prime (P : Ideal R) [P.IsPrime]
    (I : Ideal S) (hI : I.comap (algebraMap R S) ≤ P) :
    ∃ Q ≥ I, Q.IsPrime ∧ Q.comap (algebraMap R S) ≤ P

(hI : Ideal.comap (algebraMap R S) I ≤ P)

∃ Q ≥ I, Q.IsPrime ∧ Ideal.comap (algebraMap R S) Q ≤ P


theorem homotopyPToId_eventually_constant {q n : ℕ} (hqn : n < q) :
    ((homotopyPToId X (q + 1)).hom n (n + 1) : X _[n] ⟶ X _[n + 1]) =
      (homotopyPToId X q).hom n (n + 1)

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Preadditive C]
(X : CategoryTheory.SimplicialObject C)
{q n : ℕ}
(hqn : n < q)

(AlgebraicTopology.DoldKan.homotopyPToId X (q + 1)).hom n (n + 1) =
  (AlgebraicTopology.DoldKan.homotopyPToId X q).hom n (n + 1)


lemma ofComplex_apply (z : ℍ) : ofComplex (z : ℂ) = z


/-- The characteristic polynomial of the map `fun x => a * x` is the minimal polynomial of `a`.

In combination with `det_eq_sign_charpoly_coeff` or `trace_eq_neg_charpoly_coeff`
and a bit of rewriting, this will allow us to conclude the
field norm resp. trace of `x` is the product resp. sum of `x`'s conjugates.
-/
theorem charpoly_leftMulMatrix {S : Type*} [Ring S] [Algebra R S] (h : PowerBasis R S) :
    (leftMulMatrix h.basis h.gen).charpoly = minpoly R h.gen

{R : Type u}
[CommRing R]
{S : Type u_1}
[Ring S]
[Algebra R S]
(h : PowerBasis R S)

((Algebra.leftMulMatrix h.basis) h.gen).charpoly = minpoly R h.gen


@[mono]
protected theorem subset ⦃m n : ℕ⦄ (h : m ≤ n) : K m ⊆ K n

{X : Type u_1}
[TopologicalSpace X]
(K : CompactExhaustion X)
⦃m n : ℕ⦄
(h : m ≤ n)


/-- The (identity) equivalence between `C` and its monoidal opposite. -/
@[simps] def MonoidalOpposite.mopEquiv : C ≌ Cᴹᵒᵖ

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

(CategoryTheory.MonoidalOpposite.mopEquiv C).unitIso = CategoryTheory.Iso.refl (𝟭 C)


@[to_additive (attr := simp)]
theorem MonoidHom.coe_copy {_ : MulOneClass M} {_ : MulOneClass N} (f : M →* N) (f' : M → N)
    (h : f' = f) : (f.copy f' h) = f'

∀ {x : AddZeroClass M} {x_1 : AddZeroClass N} (f : M →+ N) (f' : M → N) (h : f' = ⇑f), ⇑(f.copy f' h) = f'


/-- An `R`-algebra `A` is formally unramified if for every `R`-algebra, every square-zero ideal
`I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at most one lift `A →ₐ[R] B`.

See <https://stacks.math.columbia.edu/tag/00UM>. -/
@[mk_iff]
class FormallyUnramified : Prop where
  comp_injective :
    ∀ ⦃B : Type u⦄ [CommRing B],
      ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥),
        Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I)

{R : Type u}
[CommSemiring R]
{A : Type u}
[Semiring A]
[Algebra R A]
[self : Algebra.FormallyUnramified R A]
⦃B : Type u⦄
[CommRing B]
[Algebra R B]
(I : Ideal B)

I ^ 2 = ⊥ → Function.Injective (Ideal.Quotient.mkₐ R I).comp


theorem suffixLevenshtein_cons₁
    (x : α) (xs ys) :
    suffixLevenshtein C (x :: xs) ys =
      ⟨levenshtein C (x :: xs) ys ::
        (suffixLevenshtein C xs ys).1, by simp⟩

{α : Type u_1}
{β : Type u_2}
{δ : Type u_3}
[AddZeroClass δ]
[Min δ]
{C : Levenshtein.Cost α β δ}
(x : α)
(xs : List α)
(ys : List β)

suffixLevenshtein C (x :: xs) ys = ⟨levenshtein C (x :: xs) ys :: (suffixLevenshtein C xs ys).val, ⋯⟩


theorem _root_.ContinuousMultilinearMap.integral_apply {ι : Type*} [Fintype ι] {M : ι → Type*}
    [∀ i, NormedAddCommGroup (M i)] [∀ i, NormedSpace 𝕜 (M i)]
    {φ : X → ContinuousMultilinearMap 𝕜 M E} (φ_int : Integrable φ μ) (m : ∀ i, M i) :
    (∫ x, φ x ∂μ) m = ∫ x, φ x m ∂μ

(∫ (x : X), φ x ∂μ) m = ∫ (x : X), (φ x) m ∂μ


@[simp]
theorem coe_coe'' : ⇑(e : E →SL[σ₁₂] E₂) = e

{R : Type u_1}
{R₂ : Type u_2}
{E : Type u_5}
{E₂ : Type u_6}
[Semiring R]
[Semiring R₂]
{σ₁₂ : R →+* R₂}
{σ₂₁ : R₂ →+* R}
[RingHomInvPair σ₁₂ σ₂₁]
[RingHomInvPair σ₂₁ σ₁₂]
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup E₂]
[Module R E]
[Module R₂ E₂]
(e : E ≃ₛₗᵢ[σ₁₂] E₂)

⇑↑{ toLinearEquiv := e.toLinearEquiv, continuous_toFun := ⋯, continuous_invFun := ⋯ } = ⇑e


/-- **Tychonoff's theorem** formulated using `Set.pi`: product of compact sets is compact. -/
theorem isCompact_univ_pi {s : ∀ i, Set (X i)} (h : ∀ i, IsCompact (s i)) :
    IsCompact (pi univ s)

{ι : Type u_1}
{X : ι → Type u_2}
[(i : ι) → TopologicalSpace (X i)]
{s : (i : ι) → Set (X i)}
(h : ∀ (i : ι), IsCompact (s i))


@[to_additive]
theorem smul_def [Group G] [MulAction G β] (g : G) (f : α ↪ β) :
    g • f = f.trans (MulAction.toPerm g).toEmbedding

{G : Type u_1}
{α : Type u_3}
{β : Type u_4}
[Group G]
[MulAction G β]
(g : G)
(f : α ↪ β)

g • f = f.trans (Equiv.toEmbedding (MulAction.toPerm g))


/-- Two finite measures on a Borel space are equal if they agree on all closed-open intervals.  If
`α` is a conditionally complete linear order with no top element,
`MeasureTheory.Measure.ext_of_Ico` is an extensionality lemma with weaker assumptions on `μ` and
`ν`. -/
theorem ext_of_Ico_finite {α : Type*} [TopologicalSpace α] {m : MeasurableSpace α}
    [SecondCountableTopology α] [LinearOrder α] [OrderTopology α] [BorelSpace α] (μ ν : Measure α)
    [IsFiniteMeasure μ] (hμν : μ univ = ν univ) (h : ∀ ⦃a b⦄, a < b → μ (Ico a b) = ν (Ico a b)) :
    μ = ν

(h : ∀ ⦃a b : α⦄, a < b → μ (Set.Ico a b) = ν (Set.Ico a b))


@[simp]
theorem comp_continuous_iff {γ} [TopologicalSpace γ] (h : α ≃ᵢ β) {f : γ → α} :
    Continuous (h ∘ f) ↔ Continuous f

{α : Type u}
{β : Type v}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
{γ : Type u_2}
[TopologicalSpace γ]
(h : α ≃ᵢ β)
{f : γ → α}


theorem card_Ico : (Ico a b).card = (∏ i, (Icc (a i) (b i)).card) - 1

{ι : Type u_1}
{α : ι → Type u_2}
[Fintype ι]
[DecidableEq ι]
[(i : ι) → DecidableEq (α i)]
[(i : ι) → PartialOrder (α i)]
[(i : ι) → LocallyFiniteOrder (α i)]
(a b : (i : ι) → α i)

(Finset.Ico a b).card = ∏ i : ι, (Finset.Icc (a i) (b i)).card - 1


@[simp]
theorem mem_principal : x ∈ principal y ↔ x ≤ y


theorem isPell_one : IsPell (⟨a, 1⟩ : ℤ√(d a1))


@[to_additive]
lemma mul_le_prod {i j : ι} (hf : ∀ i ∈ s, 1 ≤ f i) (hi : i ∈ s) (hj : j ∈ s) (hne : i ≠ j) :
    f i * f j ≤ ∏ k ∈ s, f k

{ι : Type u_1}
{N : Type u_5}
[OrderedAddCommMonoid N]
{f : ι → N}
{s : Finset ι}
{i j : ι}
(hf : ∀ i ∈ s, 0 ≤ f i)
(hi : i ∈ s)
(hj : j ∈ s)
(hne : i ≠ j)


@[simp]
theorem mem_graph_iff (x : M × M₂) : x ∈ f.graph ↔ x.2 = f x.1

{R : Type u}
{M : Type v}
{M₂ : Type w}
[Semiring R]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R M₂]
(f : M →ₗ[R] M₂)
(x : M × M₂)


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


theorem finStronglyMeasurable_zero {α β} {m : MeasurableSpace α} {μ : Measure α} [Zero β]
    [TopologicalSpace β] : FinStronglyMeasurable (0 : α → β) μ

{α : Type u_5}
{β : Type u_6}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[Zero β]
[TopologicalSpace β]


/-- The coercion `C(X, R)₀ → C(X, R)` bundled as a non-unital star algebra homomorphism. -/
@[simps]
def toContinuousMapHom [StarRing R] [ContinuousStar R] : C(X, R)₀ →⋆ₙₐ[R] C(X, R)

{X : Type u_1}
{R : Type u_2}
[Zero X]
[TopologicalSpace X]
[TopologicalSpace R]
[CommSemiring R]
[TopologicalSemiring R]
[StarRing R]
[ContinuousStar R]
(f : ContinuousMapZero X R)

ContinuousMapZero.toContinuousMapHom f = ↑f


/-- (implementation) The constructured limit cone. -/
@[simps]
noncomputable def liftedCone : Cone F

(F : CategoryTheory.Functor I A.Elements)

↑((CategoryTheory.CategoryOfElements.CreatesLimitsAux.liftedCone F).π.app i) =
  CategoryTheory.Limits.limit.π (F.comp (CategoryTheory.CategoryOfElements.π A)) i


theorem natDegree_pow' {n : ℕ} (h : leadingCoeff p ^ n ≠ 0) : natDegree (p ^ n) = n * natDegree p

{R : Type u}
[Semiring R]
{p : R[X]}
{n : ℕ}
(h : p.leadingCoeff ^ n ≠ 0)


theorem map_ofDual (f : α → β) (a : WithBot αᵒᵈ) : map f (WithBot.ofDual a) = a.map (ofDual ∘ f)

{α : Type u_1}
{β : Type u_2}
(f : α → β)
(a : WithBot αᵒᵈ)

WithTop.map f (WithBot.ofDual a) = WithBot.map (⇑OrderDual.ofDual ∘ f) a


@[simp] theorem polar_pi (Q : ∀ i, QuadraticMap R (Mᵢ i) P) (x y : ∀ i, Mᵢ i) :
    polar (pi Q) x y = ∑ i, polar (Q i) (x i) (y i)

{ι : Type u_1}
{R : Type u_2}
{P : Type u_7}
{Mᵢ : ι → Type u_8}
[CommRing R]
[(i : ι) → AddCommGroup (Mᵢ i)]
[AddCommGroup P]
[(i : ι) → Module R (Mᵢ i)]
[Module R P]
[Fintype ι]
(Q : (i : ι) → QuadraticMap R (Mᵢ i) P)
(x y : (i : ι) → Mᵢ i)

QuadraticMap.polar (⇑(QuadraticMap.pi Q)) x y = ∑ i : ι, QuadraticMap.polar (⇑(Q i)) (x i) (y i)


@[simp]
theorem unop_id (F : Cᵒᵖ ⥤ Dᵒᵖ) : NatTrans.unop (𝟙 F) = 𝟙 F.unop

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
(F : CategoryTheory.Functor Cᵒᵖ Dᵒᵖ)

CategoryTheory.NatTrans.unop (CategoryTheory.CategoryStruct.id F) = CategoryTheory.CategoryStruct.id F.unop


/-- `NoZeroSMulDivisors R M` states that a scalar multiple is `0` only if either argument is `0`.
This is a version of saying that `M` is torsion free, without assuming `R` is zero-divisor free.

The main application of `NoZeroSMulDivisors R M`, when `M` is a module,
is the result `smul_eq_zero`: a scalar multiple is `0` iff either argument is `0`.

It is a generalization of the `NoZeroDivisors` class to heterogeneous multiplication.
-/
@[mk_iff]
class NoZeroSMulDivisors (R M : Type*) [Zero R] [Zero M] [SMul R M] : Prop where
  /-- If scalar multiplication yields zero, either the scalar or the vector was zero. -/
  eq_zero_or_eq_zero_of_smul_eq_zero : ∀ {c : R} {x : M}, c • x = 0 → c = 0 ∨ x = 0

(R : Type u_9)
(M : Type u_10)
[Zero R]
[Zero M]
[SMul R M]

NoZeroSMulDivisors R M ↔ ∀ {c : R} {x : M}, c • x = 0 → c = 0 ∨ x = 0


@[simp]
theorem acc_liftOn₂'_iff {s : Setoid α} {r : α → α → Prop} {H} {a} :
    Acc (fun x y => Quotient.liftOn₂' x y r H) (Quotient.mk'' a : Quotient s) ↔ Acc r a

{H : ∀ (a₁ a₂ b₁ b₂ : α), Setoid.r a₁ b₁ → Setoid.r a₂ b₂ → r a₁ a₂ = r b₁ b₂}

Acc (fun x y => x.liftOn₂' y r H) (Quotient.mk'' a) ↔ Acc r a


/-- Given `S : Solution`, we have that
`S.Y ^ 3 + (S.u₄ * S.Z) ^ 3 = S.u₅ * (λ ^ (S.multiplicity - 1) * S.X) ^ 3`. -/
private lemma formula3 :
    S.Y ^ 3 + (S.u₄ * S.Z) ^ 3 = S.u₅ * (λ ^ (S.multiplicity - 1) * S.X) ^ 3

(S : FermatLastTheoremForThreeGen.Solution hζ)

FermatLastTheoremForThreeGen.Solution.Y S ^ 3 +
    (↑(FermatLastTheoremForThreeGen.Solution.u₄ S) * FermatLastTheoremForThreeGen.Solution.Z S) ^ 3 =
  ↑(FermatLastTheoremForThreeGen.Solution.u₅ S) *
    ((hζ.toInteger - 1) ^ (S.multiplicity - 1) * FermatLastTheoremForThreeGen.Solution.X S) ^ 3


@[simp] theorem add_eq (x y : BitVec w)                   : BitVec.add x y = x + y


/-- The inner dual cone of a singleton is given by the preimage of the positive cone under the
linear map `fun y ↦ ⟪x, y⟫`. -/
theorem innerDualCone_singleton (x : H) :
    ({x} : Set H).innerDualCone = (ConvexCone.positive ℝ ℝ).comap (innerₛₗ ℝ x)

{H : Type u_5}
[NormedAddCommGroup H]
[InnerProductSpace ℝ H]
(x : H)

{x}.innerDualCone = ConvexCone.comap ((innerₛₗ ℝ) x) (ConvexCone.positive ℝ ℝ)


theorem equiv_def {x y : PGame} : x ≈ y ↔ x ≤ y ∧ y ≤ x


/-- Constructor for `Cocycle F G n`, taking as inputs `z : Cochain F G n`, an integer
`m : ℤ` such that `n + 1 = m`, and the relation `δ n m z = 0`. -/
@[simps]
def mk (z : Cochain F G n) (m : ℤ) (hnm : n + 1 = m) (h : δ n m z = 0) : Cocycle F G n

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

(h : CochainComplex.HomComplex.δ n m z = 0)

↑(CochainComplex.HomComplex.Cocycle.mk z m hnm h) = z


theorem smul_def [SMul A α] {S : Subalgebra R A} (g : S) (m : α) : g • m = (g : A) • m

{R : Type u}
{A : Type v}
[CommSemiring R]
[Semiring A]
[Algebra R A]
{α : Type u_1}
[SMul A α]
{S : Subalgebra R A}
(g : ↥S)
(m : α)


theorem aevalTower_comp_algebraMap :
    (aevalTower g y : MvPolynomial σ R →+* A).comp (algebraMap R (MvPolynomial σ R)) = g

{R : Type u}
{σ : Type u_1}
[CommSemiring R]
{S : Type u_2}
{A : Type u_3}
[CommSemiring S]
[CommSemiring A]
[Algebra S R]
[Algebra S A]
(g : R →ₐ[S] A)
(y : σ → A)

(↑(MvPolynomial.aevalTower g y)).comp (algebraMap R (MvPolynomial σ R)) = ↑g


theorem chain_singleton {a b : α} : Chain R a [b] ↔ R a b

{α : Type u}
{R : α → α → Prop}
{a b : α}


/-- The **Compactness Theorem of first-order logic**: A theory is satisfiable if and only if it is
finitely satisfiable. -/
theorem isSatisfiable_iff_isFinitelySatisfiable {T : L.Theory} :
    T.IsSatisfiable ↔ T.IsFinitelySatisfiable

{L : FirstOrder.Language}
{T : L.Theory}


@[to_additive (attr := simp)]
theorem mul_get_eq [Mul α] (a b : Part α) (hab : Dom (a * b)) :
    (a * b).get hab = a.get (left_dom_of_mul_dom hab) * b.get (right_dom_of_mul_dom hab)

{α : Type u_1}
[Mul α]
(a b : Part α)
(hab : (a * b).Dom)


theorem mem_implicitToPartialHomeomorphOfComplemented_target (hf : HasStrictFDerivAt f f' a)
    (hf' : range f' = ⊤) (hker : (ker f').ClosedComplemented) :
    (f a, (0 : ker f')) ∈ (hf.implicitToPartialHomeomorphOfComplemented f f' hf' hker).target

(hker : (LinearMap.ker f').ClosedComplemented)

(f a, 0) ∈ (HasStrictFDerivAt.implicitToPartialHomeomorphOfComplemented f f' hf hf' hker).target


@[simp]
theorem prod_singleton : s ×ˢ ({b} : Set β) = (fun a => (a, b)) '' s

{α : Type u_1}
{β : Type u_2}
{s : Set α}
{b : β}


/-- Change-of-variables formula for `Ioi` integrals of vector-valued functions, proved by taking
limits from the result for finite intervals. -/
theorem integral_comp_smul_deriv_Ioi {f f' : ℝ → ℝ} {g : ℝ → E} {a : ℝ}
    (hf : ContinuousOn f <| Ici a) (hft : Tendsto f atTop atTop)
    (hff' : ∀ x ∈ Ioi a, HasDerivWithinAt f (f' x) (Ioi x) x)
    (hg_cont : ContinuousOn g <| f '' Ioi a) (hg1 : IntegrableOn g <| f '' Ici a)
    (hg2 : IntegrableOn (fun x => f' x • (g ∘ f) x) (Ici a)) :
    (∫ x in Ioi a, f' x • (g ∘ f) x) = ∫ u in Ioi (f a), g u

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

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

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

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

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

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


@[fun_prop]
theorem HasStrictFDerivAt.sum (h : ∀ i ∈ u, HasStrictFDerivAt (A i) (A' i) x) :
    HasStrictFDerivAt (fun y => ∑ i ∈ u, A i y) (∑ i ∈ u, A' i) x


@[to_additive]
theorem Red.reduce_right (h : Red L₁ L₂) : Red L₁ (reduce L₂)

{α : Type u}
{L₁ L₂ : List (α × Bool)}
[DecidableEq α]
(h : FreeGroup.Red L₁ L₂)


theorem get?_pmap {p : α → Prop} (f : ∀ a, p a → β) {l : List α} (h : ∀ a ∈ l, p a) (n : ℕ) :
    get? (pmap f l h) n = Option.pmap f (get? l n) fun x H => h x (get?_mem H)

{α : Type u}
{β : Type v}
{p : α → Prop}
(f : (a : α) → p a → β)
{l : List α}
(h : ∀ (a : α), a ∈ l → p a)
(n : ℕ)

(List.pmap f l h).get? n = Option.pmap f (l.get? n) ⋯


protected lemma existsUnique_congr_left : (∃! a, p a) ↔ ∃! b, p (e.symm b)

{α : Sort u}
{β : Sort v}
{p : α → Prop}
(e : α ≃ β)


@[simp]
theorem get_le_get {x y : PartENat} {hx : x.Dom} {hy : y.Dom} : x.get hx ≤ y.get hy ↔ x ≤ y


@[norm_cast] lemma cast_id (n : ℚ) : Rat.cast n = n


/-- The commutation with the shift isomorphism for the functor on cochain complexes
induced by an additive functor between preadditive categories. -/
@[simps!]
def mapCochainComplexShiftIso (n : ℤ) :
    shiftFunctor _ n ⋙ F.mapHomologicalComplex (ComplexShape.up ℤ) ≅
      F.mapHomologicalComplex (ComplexShape.up ℤ) ⋙ shiftFunctor _ n

(X : HomologicalComplex C (ComplexShape.up ℤ))

((F.mapCochainComplexShiftIso n).inv.app X).f i = 𝟙 (F.obj (X.X (i + n)))


theorem of_eq {f g : α → σ} (hf : Computable f) (H : ∀ n, f n = g n) : Computable g

{α : Type u_1}
{σ : Type u_4}
[Primcodable α]
[Primcodable σ]
{f g : α → σ}
(hf : Computable f)
(H : ∀ (n : α), f n = g n)


/-- Construct a left adjoint functor to `G`, given the functor's value on objects `F_obj` and
a bijection `e` between `F_obj X ⟶ Y` and `X ⟶ G.obj Y` satisfying a naturality law
`he : ∀ X Y Y' g h, e X Y' (h ≫ g) = e X Y h ≫ G.map g`.
Dual to `rightAdjointOfEquiv`. -/
@[simps!]
def leftAdjointOfEquiv (he : ∀ X Y Y' g h, e X Y' (h ≫ g) = e X Y h ≫ G.map g) : C ⥤ D

(e : (X : C) → (Y : D) → (F_obj X ⟶ Y) ≃ (X ⟶ G.obj Y))

(he :
  ∀ (X : C) (Y Y' : D) (g : Y ⟶ Y') (h : F_obj X ⟶ Y),
    (e X Y') (CategoryTheory.CategoryStruct.comp h g) = CategoryTheory.CategoryStruct.comp ((e X Y) h) (G.map g))

(CategoryTheory.Adjunction.leftAdjointOfEquiv e he).map f =
  (e X (F_obj X')).symm
    (CategoryTheory.CategoryStruct.comp f ((e X' (F_obj X')) (CategoryTheory.CategoryStruct.id (F_obj X'))))


@[simp, norm_cast]
theorem coe_preimage {f : α → β} (s : Finset β) (hf : Set.InjOn f (f ⁻¹' ↑s)) :
    (↑(preimage s f hf) : Set α) = f ⁻¹' ↑s

{α : Type u}
{β : Type v}
{f : α → β}
(s : Finset β)
(hf : Set.InjOn f (f ⁻¹' ↑s))


@[simp]
theorem pdiv_apply [GroupWithZero R] (f g : ArithmeticFunction R) (n : ℕ) :
    pdiv f g n = f n / g n

{R : Type u_1}
[GroupWithZero R]
(f g : ArithmeticFunction R)
(n : ℕ)


@[simp]
theorem bind₁_X_left : bind₁ (X : σ → MvPolynomial σ R) = AlgHom.id R _

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

MvPolynomial.bind₁ MvPolynomial.X = AlgHom.id R (MvPolynomial σ R)


@[simp]
theorem coeff_natTrailingDegree_pred_eq_zero {p : R[X]} {hp : (0 : ℕ∞) < natTrailingDegree p} :
    p.coeff (p.natTrailingDegree - 1) = 0

{R : Type u}
[Semiring R]
{p : R[X]}
{hp : 0 < ↑p.natTrailingDegree}


@[simp, norm_cast]
theorem castNum_xor : ∀ m n : Num, ↑(m ^^^ n) = (↑m ^^^ ↑n : ℕ)


@[simp]
lemma _root_.NonUnitalAlgHom.map_adjoin_singleton (f : F) (x : A) :
    map f (adjoin R {x}) = adjoin R {f x}

{F : Type u_1}
(R : Type u)
(A : Type v)
{B : Type w}
[CommSemiring R]
[NonUnitalNonAssocSemiring A]
[Module R A]
[IsScalarTower R A A]
[SMulCommClass R A A]
[NonUnitalNonAssocSemiring B]
[Module R B]
[IsScalarTower R B B]
[SMulCommClass R B B]
[FunLike F A B]
[NonUnitalAlgHomClass F R A B]
(f : F)
(x : A)

NonUnitalSubalgebra.map f (NonUnitalAlgebra.adjoin R {x}) = NonUnitalAlgebra.adjoin R {f x}


/-- The weak operator topology is coarser than the norm topology, i.e. the inclusion map is
continuous. -/
@[continuity, fun_prop]
lemma ContinuousLinearMap.continuous_toWOT :
    Continuous (ContinuousLinearMap.toWOT 𝕜 E F)

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[RCLike 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]

Continuous ⇑(ContinuousLinearMap.toWOT 𝕜 E F)


@[to_additive]
theorem mul_mem_ball_iff_norm : a * b ∈ ball a r ↔ ‖b‖ < r

{E : Type u_6}
[SeminormedCommGroup E]
{a b : E}
{r : ℝ}


@[simp]
theorem map_const (l : Filter α) (a : β) (f : β → γ) : (↑a : Germ l β).map f = ↑(f a)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
(l : Filter α)
(a : β)
(f : β → γ)


@[to_additive (attr := simp)]
theorem prod_cons (h : a ∉ s) : ∏ x ∈ cons a s h, f x = f a * ∏ x ∈ s, f x

{α : Type u_3}
{β : Type u_4}
{s : Finset α}
{a : α}
{f : α → β}
[CommMonoid β]
(h : a ∉ s)

∏ x ∈ Finset.cons a s h, f x = f a * ∏ x ∈ s, f x


/-- An isomorphism of short complexes `S₁ ≅ S₂` induces an isomorphism on the `Q` fields
of right homology data of `S₁` and `S₂`. -/
@[simps]
def opcyclesMapIso' (e : S₁ ≅ S₂) (h₁ : S₁.RightHomologyData)
    (h₂ : S₂.RightHomologyData) : h₁.Q ≅ h₂.Q

(CategoryTheory.ShortComplex.opcyclesMapIso' e h₁ h₂).inv = CategoryTheory.ShortComplex.opcyclesMap' e.inv h₂ h₁


@[to_additive (attr := simp) AddSubmonoid.center_toAddSubsemigroup]
theorem center_toSubsemigroup : (center M).toSubsemigroup = Subsemigroup.center M

(Submonoid.center M).toSubsemigroup = Subsemigroup.center M


theorem UInt64.toNat_mod (x y : UInt64) : (x % y).toNat = x.toNat % y.toNat


theorem le_natDegree_of_coe_le_degree (hdeg : ↑n ≤ p.degree) : n ≤ p.natDegree

{R : Type u}
{n : ℕ}
[Semiring R]
{p : R[X]}
(hdeg : ↑n ≤ p.degree)


theorem lintegral_nnnorm_eq_lintegral_edist (f : α → β) :
    ∫⁻ a, ‖f a‖₊ ∂μ = ∫⁻ a, edist (f a) 0 ∂μ

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup β]
(f : α → β)

∫⁻ (a : α), ↑‖f a‖₊ ∂μ = ∫⁻ (a : α), edist (f a) 0 ∂μ


@[simp, norm_cast]
theorem coe_one_unitClosedBall [SeminormedRing 𝕜] [NormOneClass 𝕜] :
    ((1 : closedBall (0 : 𝕜) 1) : 𝕜) = 1

{𝕜 : Type u_1}
[SeminormedRing 𝕜]
[NormOneClass 𝕜]


theorem UInt64.le_antisymm {x y : UInt64} (h1 : x ≤ y) (h2 : y ≤ x) : x = y


@[ext]
theorem ext (f g : Ω^ N X x) (H : ∀ y, f y = g y) : f = g

{N : Type u_1}
{X : Type u_2}
[TopologicalSpace X]
{x : X}
(f g : ↑(Ω^ N X x))
(H : ∀ (y : N → ↑I), f y = g y)


@[simp]
theorem card_join (S) : card (@join α S) = sum (map card S)

{α : Type u_1}
(S : Multiset (Multiset α))

Multiset.card S.join = (Multiset.map (⇑Multiset.card) S).sum


@[simp]
theorem coe_of (α : Type*) [BooleanRing α] : ↥(of α) = α


@[to_additive mem_leftAddCoset]
theorem mem_leftCoset {s : Set α} {x : α} (a : α) (hxS : x ∈ s) : a * x ∈ a • s

{α : Type u_1}
[Add α]
{s : Set α}
{x : α}
(a : α)
(hxS : x ∈ s)


/-- The Ping-Pong-Lemma.

Given a group action of `G` on `X` so that the generators of the free groups act in specific
ways on disjoint subsets `X i` and `Y i` we can prove that `lift f` is injective, and thus the image
of `lift f` is isomorphic to the free group.

Often the Ping-Pong-Lemma is stated with regard to group elements that generate the whole group;
we generalize to arbitrary group homomorphisms from the free group to `G` and do not require the
group to be generated by the elements.
-/
theorem _root_.FreeGroup.injective_lift_of_ping_pong : Function.Injective (FreeGroup.lift a)

(hXnonempty : ∀ (i : ι), (X i).Nonempty)

(hXdisj : Pairwise fun i j => Disjoint (X i) (X j))

(hYdisj : Pairwise fun i j => Disjoint (Y i) (Y j))

(hXYdisj : ∀ (i j : ι), Disjoint (X i) (Y j))


@[to_additive]
theorem smul_Lp_neg (c : Mᵈᵐᵃ) (f : Lp E p μ) : c • (-f) = -(c • f)

[MeasureTheory.SMulInvariantMeasure M α μ]


lemma Tendsto.eventually_mem {f : α → β} {l₁ : Filter α} {l₂ : Filter β} {s : Set β}
    (hf : Tendsto f l₁ l₂) (h : s ∈ l₂) : ∀ᶠ x in l₁, f x ∈ s

{α : Type u}
{β : Type v}
{f : α → β}
{l₁ : Filter α}
{l₂ : Filter β}
{s : Set β}
(hf : Filter.Tendsto f l₁ l₂)
(h : s ∈ l₂)


@[to_additive]
theorem uniformContinuous_monoidHom_of_continuous {hom : Type*} [UniformSpace β] [Group β]
    [UniformGroup β] [FunLike hom α β] [MonoidHomClass hom α β] {f : hom} (h : Continuous f) :
    UniformContinuous f

{α : Type u_1}
{β : Type u_2}
[UniformSpace α]
[Group α]
[UniformGroup α]
{hom : Type u_3}
[UniformSpace β]
[Group β]
[UniformGroup β]
[FunLike hom α β]
[MonoidHomClass hom α β]
{f : hom}
(h : Continuous ⇑f)


run_cmd
  for typeName' in [`UInt8, `UInt16, `UInt32, `UInt64, `USize] do
  let typeName := Lean.mkIdent typeName'
  Lean.Elab.Command.elabCommand (← `(
    namespace $typeName
      instance neZero : NeZero size := ⟨by decide⟩

      instance : Neg $typeName where
        neg a := mk (-a.val)

      instance : Pow $typeName ℕ where
        pow a n := mk (a.val ^ n)

      instance : SMul ℕ $typeName where
        smul n a := mk (n • a.val)

      instance : SMul ℤ $typeName where
        smul z a := mk (z • a.val)

      lemma neg_def (a : $typeName) : -a = ⟨-a.val⟩ := rfl

      lemma pow_def (a : $typeName) (n : ℕ) : a ^ n = ⟨a.val ^ n⟩ := rfl

      lemma nsmul_def (n : ℕ) (a : $typeName) : n • a = ⟨n • a.val⟩ := rfl

      lemma zsmul_def (z : ℤ) (a : $typeName) : z • a = ⟨z • a.val⟩ := rfl

      open $typeName (eq_of_val_eq) in
      lemma val_injective : Function.Injective val := @eq_of_val_eq

      instance instCommMonoid : CommMonoid $typeName :=
        Function.Injective.commMonoid val val_injective
          rfl (fun _ _ => rfl) (fun _ _ => rfl)

      instance instNonUnitalCommRing : NonUnitalCommRing $typeName :=
        Function.Injective.nonUnitalCommRing val val_injective
          rfl (fun _ _ => rfl) (fun _ _ => rfl) (fun _ => rfl) (fun _ _ => rfl)
          (fun _ _ => rfl) (fun _ _ => rfl)

      local instance instNatCast : NatCast $typeName where
        natCast n := mk n

      local instance instIntCast : IntCast $typeName where
        intCast z := mk z

      lemma natCast_def (n : ℕ) : (n : $typeName) = ⟨n⟩ := rfl

      lemma intCast_def (z : ℤ) : (z : $typeName) = ⟨z⟩ := rfl

      local instance instCommRing : CommRing $typeName :=
        Function.Injective.commRing val val_injective
          rfl rfl (fun _ _ => rfl) (fun _ _ => rfl) (fun _ => rfl) (fun _ _ => rfl)
          (fun _ _ => rfl) (fun _ _ => rfl) (fun _ _ => rfl) (fun _ => rfl) (fun _ => rfl)

      namespace CommRing
      attribute [scoped instance] instCommRing instNatCast instIntCast
      end CommRing

    end $typeName
  ))
  -- interpolating docstrings above is more trouble than it's worth
  let docString :=
    s!"To use this instance, use `open scoped {typeName'}.CommRing`.\n\n" ++
    "See the module docstring for an explanation"
  Lean.addDocString (typeName'.mkStr "instCommRing") docString
  Lean.addDocString (typeName'.mkStr "instNatCast") docString
  Lean.addDocString (typeName'.mkStr "instIntCast") docString


@[simp]
theorem lcm_union (s₁ s₂ : Multiset α) : (s₁ ∪ s₂).lcm = GCDMonoid.lcm s₁.lcm s₂.lcm

{α : Type u_1}
[CancelCommMonoidWithZero α]
[NormalizedGCDMonoid α]
[DecidableEq α]
(s₁ s₂ : Multiset α)


@[simp]
theorem independent_pempty (t : PEmpty → α) : Independent t

{α : Type u_1}
[CompleteLattice α]
(t : PEmpty.{u_5} → α)


@[to_additive add_image_prod]
theorem image_mul_prod : (fun x : α × α => x.fst * x.snd) '' s ×ˢ t = s * t


@[to_additive]
theorem isCompact (hf : HasCompactMulSupport f) : IsCompact (mulTSupport f)

{α : Type u_2}
{β : Type u_4}
[TopologicalSpace α]
[One β]
{f : α → β}
(hf : HasCompactMulSupport f)


lemma atomistic : ∀ I : LieIdeal K L, sSup {J : LieIdeal K L | IsAtom J ∧ J ≤ I} = I

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

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


/-- A group is isomorphic to its group of units. -/
@[to_additive (attr := simps apply_val symm_apply)
"An additive group is isomorphic to its group of additive units"]
def toUnits [Group G] : G ≃* Gˣ


/-- If a finset `u` is contained in the scalar product of two sets `s • t`, we can find two finsets
`s'`, `t'` such that `s' ⊆ s`, `t' ⊆ t` and `u ⊆ s' • t'`. -/
@[to_additive
      "If a finset `u` is contained in the scalar sum of two sets `s +ᵥ t`, we can find two
      finsets `s'`, `t'` such that `s' ⊆ s`, `t' ⊆ t` and `u ⊆ s' +ᵥ t'`."]
theorem subset_smul {s : Set α} {t : Set β} :
    ↑u ⊆ s • t → ∃ (s' : Finset α) (t' : Finset β), ↑s' ⊆ s ∧ ↑t' ⊆ t ∧ u ⊆ s' • t'

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

↑u ⊆ s • t → ∃ s' t', ↑s' ⊆ s ∧ ↑t' ⊆ t ∧ u ⊆ s' • t'


theorem bind_congr [Bind m] {x : m α} {f g : α → m β} (h : ∀ a, f a = g a) : x >>= f = x >>= g

{m : Type u_1 → Type u_2}
{α β : Type u_1}
[Bind m]
{x : m α}
{f g : α → m β}
(h : ∀ (a : α), f a = g a)


@[continuity]
theorem Continuous.matrix_blockDiag' {A : X → Matrix (Σi, m' i) (Σi, n' i) R} (hA : Continuous A) :
    Continuous fun x => blockDiag' (A x)

{A : X → Matrix ((i : l) × m' i) ((i : l) × n' i) R}


theorem Symmetric.flip_eq (h : Symmetric r) : flip r = r

{α : Type u_1}
{r : α → α → Prop}
(h : Symmetric r)


/-- Two subgroups are equal if they have the same elements. -/
@[to_additive (attr := ext) "Two `AddSubgroup`s are equal if they have the same elements."]
theorem ext {H K : Subgroup G} (h : ∀ x, x ∈ H ↔ x ∈ K) : H = K

{G : Type u_1}
[Group G]
{H K : Subgroup G}
(h : ∀ (x : G), x ∈ H ↔ x ∈ K)


/-- `Part` eta expansion -/
@[simp]
theorem eta : ∀ o : Part α, (⟨o.Dom, fun h => o.get h⟩ : Part α) = o

{ Dom := o.Dom, get := fun h => o.get h } = o


theorem filter_eq' (s : Multiset α) (b : α) : s.filter (· = b) = replicate (count b s) b

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

Multiset.filter (fun x => x = b) s = Multiset.replicate (Multiset.count b s) b


theorem mdifferentiableOn_const : MDifferentiableOn I I' (fun _ : M => c) s

{𝕜 : 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']
{s : Set M}
{c : M'}


/-- Functions `ℍ → ℂ` that are invariant under the `SlashAction`. -/
structure SlashInvariantForm where
  toFun : ℍ → ℂ
  slash_action_eq' : ∀ γ : Γ, toFun ∣[k] γ = toFun

{Γ : outParam (Subgroup SL(2, ℤ))}
{k : outParam ℤ}
(self : SlashInvariantForm Γ k)
(γ : ↥Γ)


/-- From a functor `F : J ⥤ C`, given a terminal object of `J`, construct a cocone for `J`.
In `colimitOfDiagramTerminal` we show it is a colimit cocone. -/
@[simps]
def coconeOfDiagramTerminal {X : J} (tX : IsTerminal X) (F : J ⥤ C) : Cocone F

(tX : CategoryTheory.Limits.IsTerminal X)

(CategoryTheory.Limits.coconeOfDiagramTerminal tX F).ι.app j = F.map (tX.from j)


@[mono]
theorem toAddSubmonoid_strictMono :
    StrictMono (toAddSubmonoid : NonUnitalSubsemiring R → AddSubmonoid R)

{R : Type u}
[NonUnitalNonAssocSemiring R]


@[simp]
theorem star_of (x : α) : star (of x) = of x

star (FreeMonoid.of x) = FreeMonoid.of x


/-- A strong epi category is a category in which every epimorphism is strong. -/
class StrongEpiCategory : Prop where
  /-- A strong epi category is a category in which every epimorphism is strong. -/
  strongEpi_of_epi : ∀ {X Y : C} (f : X ⟶ Y) [Epi f], StrongEpi f

[self : CategoryTheory.StrongEpiCategory C]


@[simp]
theorem preimage_add_const_Ioc : (fun x => x + a) ⁻¹' Ioc b c = Ioc (b - a) (c - a)

{α : Type u_1}
[OrderedAddCommGroup α]
(a b c : α)

(fun x => x + a) ⁻¹' Set.Ioc b c = Set.Ioc (b - a) (c - a)


theorem Summable.matrix_blockDiag' {f : X → Matrix (Σi, m' i) (Σi, n' i) R} (hf : Summable f) :
    Summable fun x => blockDiag' (f x)

{f : X → Matrix ((i : l) × m' i) ((i : l) × n' i) R}


@[simp]
theorem attach_zero : (0 : Multiset α).attach = 0


/-- The linear equivalence `Cochain K L n ≃+ Cochain K L⟦a⟧ n'` when `n' + a = n` and
the category is `R`-linear. -/
@[simps!]
def rightShiftLinearEquiv (n a n' : ℤ) (hn' : n' + a = n) :
    Cochain K L n ≃ₗ[R] Cochain K (L⟦a⟧) n'

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Preadditive C]
(R : Type u_1)
[Ring R]
[CategoryTheory.Linear R C]
(K L : CochainComplex C ℤ)
(n a n' : ℤ)
(hn' : n' + a = n)

∀ (a_1 : CochainComplex.HomComplex.Cochain K ((CategoryTheory.shiftFunctor (CochainComplex C ℤ) a).obj L) n'),
  (CochainComplex.HomComplex.Cochain.rightShiftLinearEquiv R K L n a n' hn').symm a_1 = a_1.rightUnshift n hn'


@[simp, norm_cast] lemma coe_mul {α} [MulZeroOneClass α] [HasDistribNeg α] (a b : SignType) :
    ↑(a * b) = (a : α) * b

{α : Type u_1}
[MulZeroOneClass α]
[HasDistribNeg α]
(a b : SignType)


/-- A `StrongFEPair` structure with `f = oddKernel a` and `g = sinKernel a`. -/
@[simps]
def hurwitzOddFEPair (a : UnitAddCircle) : StrongFEPair ℂ


@[simp]
theorem initial.to_comp [HasInitial C] {P Q : C} (f : P ⟶ Q) : initial.to P ≫ f = initial.to Q

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.Limits.HasInitial C]
{P Q : C}
(f : P ⟶ Q)

CategoryTheory.Limits.initial.to P ≫ f = CategoryTheory.Limits.initial.to Q


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


theorem monic_of_degree_le_of_coeff_eq_one (n : ℕ) (pn : p.degree ≤ n) (p1 : p.coeff n = 1) :
    Monic p

{R : Type u}
[Semiring R]
{p : R[X]}
(n : ℕ)
(pn : p.degree ≤ ↑n)
(p1 : p.coeff n = 1)


@[simp]
theorem mem_coe (a : α) (s : Subtype (MeasurableSet : Set α → Prop)) : a ∈ (s : Set α) ↔ a ∈ s

{α : Type u_1}
[MeasurableSpace α]
(a : α)
(s : Subtype MeasurableSet)

a ∈ ↑s ↔ a ∈ s


theorem map_add_supp (a : R) {s : R} (h : s ∈ supp v) : v (a + s) = v a

{R : Type u_3}
{Γ₀ : Type u_4}
[CommRing R]
[LinearOrderedCommMonoidWithZero Γ₀]
(v : Valuation R Γ₀)
(a : R)
{s : R}
(h : s ∈ v.supp)


theorem toLin_restrict_ker_eq_inf_orthogonal (B : BilinForm K V) (W : Subspace K V) (b : B.IsRefl) :
    (B.domRestrict W).ker.map W.subtype = (W ⊓ B.orthogonal ⊤ : Subspace K V)

{V : Type u_5}
{K : Type u_6}
[Field K]
[AddCommGroup V]
[Module K V]
(B : LinearMap.BilinForm K V)
(W : Subspace K V)
(b : B.IsRefl)

Submodule.map (Submodule.subtype W) (LinearMap.ker (LinearMap.domRestrict B W)) = W ⊓ B.orthogonal ⊤


lemma not_ordConnected_inter_Icc_iff (hx : x ∈ s) (hy : y ∈ s) :
    ¬ OrdConnected (s ∩ Icc x y) ↔ ∃ z ∉ s, z ∈ Ioo x y

{α : Type u_1}
[PartialOrder α]
{s : Set α}
{x y : α}
(hx : x ∈ s)
(hy : y ∈ s)

¬(s ∩ Set.Icc x y).OrdConnected ↔ ∃ z ∉ s, z ∈ Set.Ioo x y


theorem ne_zero_of_mem_factors {R : Type v} [CommRing R] [IsDomain R] [IsPrincipalIdealRing R]
    {a b : R} (ha : a ≠ 0) (hb : b ∈ factors a) : b ≠ 0

{R : Type v}
[CommRing R]
[IsDomain R]
[IsPrincipalIdealRing R]
{a b : R}
(ha : a ≠ 0)
(hb : b ∈ PrincipalIdealRing.factors a)


theorem dimH_of_mem_nhds {x : E} {s : Set E} (h : s ∈ 𝓝 x) : dimH s = finrank ℝ E

{E : Type u_4}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[FiniteDimensional ℝ E]
{x : E}
{s : Set E}
(h : s ∈ 𝓝 x)

dimH s = ↑(FiniteDimensional.finrank ℝ E)


theorem le_einfsep_pair : edist x y ⊓ edist y x ≤ ({x, y} : Set α).einfsep


/-- This lemma demonstrates the origin of the `foldr` name. -/
theorem foldr_prod_map_ι (l : List M) (f : M →ₗ[R] N →ₗ[R] N) (hf) (n : N) :
    foldr Q f hf n (l.map <| ι Q).prod = List.foldr (fun m n => f m n) n l

((CliffordAlgebra.foldr Q f hf) n) (List.map (⇑(CliffordAlgebra.ι Q)) l).prod = List.foldr (fun m n => (f m) n) n l


@[simp]
theorem objUp_objDown {C} (A : ULiftHom C) : ULiftHom.objUp A.objDown = A

{C : Type u_1}
(A : CategoryTheory.ULiftHom C)

CategoryTheory.ULiftHom.objUp A.objDown = A


@[simp]
theorem toPrincipalIdeal_eq_iff {I : (FractionalIdeal R⁰ K)ˣ} {x : Kˣ} :
    toPrincipalIdeal R K x = I ↔ spanSingleton R⁰ (x : K) = I

{R : Type u_1}
{K : Type u_2}
[CommRing R]
[Field K]
[Algebra R K]
[IsFractionRing R K]
{I : (FractionalIdeal R⁰ K)ˣ}
{x : Kˣ}

(toPrincipalIdeal R K) x = I ↔ FractionalIdeal.spanSingleton R⁰ ↑x = ↑I


/-- If `I` is an additive monoid and `c : ComplexShape I`, `c.TensorSigns` contains the data of
map `ε : I → ℤˣ` and properties which allows the construction of a `TotalComplexShape c c c`. -/
class TensorSigns where
  /-- the signs which appear in the vertical differential of the total complex -/
  ε' : Multiplicative I →* ℤˣ
  rel_add (p q r : I) (hpq : c.Rel p q) : c.Rel (p + r) (q + r)
  add_rel (p q r : I) (hpq : c.Rel p q) : c.Rel (r + p) (r + q)
  ε'_succ (p q : I) (hpq : c.Rel p q) : ε' q = - ε' p

{I : Type u_4}
[AddMonoid I]
{c : ComplexShape I}
[self : c.TensorSigns]
(p q r : I)
(hpq : c.Rel p q)


theorem dimH_finite {s : Set X} (hs : s.Finite) : dimH s = 0

{X : Type u_2}
[EMetricSpace X]
{s : Set X}
(hs : s.Finite)


@[to_additive (attr := fun_prop) Continuous.nnnorm]
theorem Continuous.nnnorm' : Continuous f → Continuous fun x => ‖f x‖₊

{α : Type u_3}
{E : Type u_6}
[SeminormedGroup E]
[TopologicalSpace α]
{f : α → E}


@[to_additive]
theorem absolutelyContinuous_map_mul_right (g : G) : μ ≪ map (· * g) μ

{G : Type u_1}
[MeasurableSpace G]
[Group G]
[MeasurableMul₂ G]
(μ : MeasureTheory.Measure G)
[MeasureTheory.SFinite μ]
[MeasurableInv G]
[μ.IsMulLeftInvariant]
(g : G)

μ ≪ MeasureTheory.Measure.map (fun x => x * g) μ


lemma polyCharpolyAux_baseChange (A : Type*) [CommRing A] [Algebra R A] :
    polyCharpolyAux (tensorProduct _ _ _ _ ∘ₗ φ.baseChange A) (basis A b) (basis A bₘ) =
      (polyCharpolyAux φ b bₘ).map (MvPolynomial.map (algebraMap R A))

{R : Type u_1}
{L : Type u_2}
{M : Type u_3}
{ι : Type u_5}
{ιM : Type u_7}
[CommRing R]
[AddCommGroup L]
[Module R L]
[AddCommGroup M]
[Module R M]
(φ : L →ₗ[R] Module.End R M)
[Fintype ι]
[Fintype ιM]
[DecidableEq ι]
[DecidableEq ιM]
(b : Basis ι R L)
(bₘ : Basis ιM R M)
(A : Type u_8)
[CommRing A]
[Algebra R A]

(LinearMap.tensorProduct R A M M ∘ₗ LinearMap.baseChange A φ).polyCharpolyAux (Algebra.TensorProduct.basis A b)
    (Algebra.TensorProduct.basis A bₘ) =
  Polynomial.map (MvPolynomial.map (algebraMap R A)) (φ.polyCharpolyAux b bₘ)


/-- This lemma follows from the finite correctness proof, the determinant equality, and
by simplifying the difference. -/
theorem sub_convs_eq {ifp : IntFractPair K}
    (stream_nth_eq : IntFractPair.stream v n = some ifp) :
    let g := of v
    let B := (g.contsAux (n + 1)).b
    let pB := (g.contsAux n).b
    v - g.convs n = if ifp.fr = 0 then 0 else (-1) ^ n / (B * (ifp.fr⁻¹ * B + pB))

(stream_nth_eq : GenContFract.IntFractPair.stream v n = some ifp)

let g := GenContFract.of v;
let B := (g.contsAux (n + 1)).b;
let pB := (g.contsAux n).b;
v - g.convs n = if ifp.fr = 0 then 0 else (-1) ^ n / (B * (ifp.fr⁻¹ * B + pB))


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


theorem disjoint_right_iff (h : IsCompl y z) : Disjoint x z ↔ x ≤ y

{α : Type u_1}
[DistribLattice α]
[BoundedOrder α]
{x y z : α}
(h : IsCompl y z)


@[simp]
theorem isLittleO_prod_left : (fun x => (f' x, g' x)) =o[l] k' ↔ f' =o[l] k' ∧ g' =o[l] k'

{α : Type u_1}
{E' : Type u_6}
{F' : Type u_7}
{G' : Type u_8}
[SeminormedAddCommGroup E']
[SeminormedAddCommGroup F']
[SeminormedAddCommGroup G']
{f' : α → E'}
{g' : α → F'}
{k' : α → G'}
{l : Filter α}


@[simp]
theorem zero_toProd : (0 : 𝓜(𝕜, A)).toProd = 0

{𝕜 : Type u_1}
{A : Type u_2}
[NontriviallyNormedField 𝕜]
[NonUnitalNormedRing A]
[NormedSpace 𝕜 A]
[SMulCommClass 𝕜 A A]
[IsScalarTower 𝕜 A A]


@[simp]
theorem ker_prod (f : M →ₗ[R] M₂) (g : M →ₗ[R] M₃) : ker (prod f g) = ker f ⊓ ker g

{R : Type u}
{M : Type v}
{M₂ : Type w}
{M₃ : Type y}
[Semiring R]
[AddCommMonoid M]
[AddCommMonoid M₂]
[AddCommMonoid M₃]
[Module R M]
[Module R M₂]
[Module R M₃]
(f : M →ₗ[R] M₂)
(g : M →ₗ[R] M₃)

LinearMap.ker (f.prod g) = LinearMap.ker f ⊓ LinearMap.ker g


/-- The two words of length `M i i'` that alternate between `i` and `i'` have the same product.
This is known as the "braid relation" or "Artin-Tits relation". -/
theorem wordProd_braidWord_eq (i i' : B) :
    π (braidWord M i i') = π (braidWord M i' i)

{B : Type u_1}
{W : Type u_3}
[Group W]
{M : CoxeterMatrix B}
(cs : CoxeterSystem M W)
(i i' : B)

cs.wordProd (CoxeterSystem.braidWord M i i') = cs.wordProd (CoxeterSystem.braidWord M i' i)


/-- The operator norm on `Matrix n n 𝕜` given by the identification with (continuous) linear
endmorphisms of `EuclideanSpace 𝕜 n` makes it into a `L2OpRing`. -/
lemma instCstarRing : CstarRing (Matrix n n 𝕜)

{𝕜 : Type u_1}
{n : Type u_3}
[RCLike 𝕜]
[Fintype n]
[DecidableEq n]


@[simp]
theorem iter_deriv_exp : ∀ n : ℕ, deriv^[n] exp = exp


@[simp]
theorem head_le {s : CompositionSeries X} (i : Fin (s.length + 1)) : s.head ≤ s i

{X : Type u}
[Lattice X]
[JordanHolderLattice X]
{s : CompositionSeries X}
(i : Fin (s.length + 1))


theorem MeasurableSet.tProd (l : List δ) {s : ∀ i, Set (π i)} (hs : ∀ i, MeasurableSet (s i)) :
    MeasurableSet (Set.tprod l s)

{δ : Type u_4}
{π : δ → Type u_6}
[(x : δ) → MeasurableSpace (π x)]
(l : List δ)
{s : (i : δ) → Set (π i)}
(hs : ∀ (i : δ), MeasurableSet (s i))


@[simp]
theorem map_right (g : N ⋊[φ] G) : (map f₁ f₂ h g).right = f₂ g.right

(h : ∀ (g : G), f₁.comp (MulEquiv.toMonoidHom (φ g)) = (MulEquiv.toMonoidHom (φ₁ (f₂ g))).comp f₁)

((SemidirectProduct.map f₁ f₂ h) g).right = f₂ g.right


theorem IsOpen.trans (ht : IsOpen t) (hs : IsOpen s) : IsOpen (t : Set X)

{X : Type u}
[TopologicalSpace X]
{s : Set X}
{t : Set ↑s}
(ht : IsOpen t)
(hs : IsOpen s)


@[simp]
theorem cthickening_union (δ : ℝ) (s t : Set α) :
    cthickening δ (s ∪ t) = cthickening δ s ∪ cthickening δ t

{α : Type u}
[PseudoEMetricSpace α]
(δ : ℝ)
(s t : Set α)

Metric.cthickening δ (s ∪ t) = Metric.cthickening δ s ∪ Metric.cthickening δ t


lemma _root_.AEMeasurable.withDensity_rnDeriv {β : Type*} {_ : MeasurableSpace β} {f : α → β}
    (hf : AEMeasurable f μ) (ν : Measure α) :
    AEMeasurable f (ν.withDensity (μ.rnDeriv ν))

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

∀ {x : MeasurableSpace β} {f : α → β},
  AEMeasurable f μ → ∀ (ν : MeasureTheory.Measure α), AEMeasurable f (ν.withDensity (μ.rnDeriv ν))


@[simp]
theorem symm_reindex (g : σ ≃ σ') : (reindex (α := α) g).symm = reindex g.symm

{α : Type u}
{σ : Type v}
{σ' : Type u_2}
(g : σ ≃ σ')

(DFA.reindex g).symm = DFA.reindex g.symm


theorem toSheafification_app (P : Cᵒᵖ ⥤ D) : (toSheafification J D).app P = toSheafify J P

(J : CategoryTheory.GrothendieckTopology C)

(CategoryTheory.toSheafification J D).app P = CategoryTheory.toSheafify J P


/-- The functor from `Pointed` to `TwoP` which adds a second point. -/
@[simps]
noncomputable def pointedToTwoPFst : Pointed.{u} ⥤ TwoP

∀ {X Y : Pointed} (f : X ⟶ Y) (a : Option X.X), (pointedToTwoPFst.map f).toFun a = Option.map f.toFun a


theorem split_dvd {o o' m} [NF o] (h : split o = (o', m)) : ω ∣ repr o'

{o o' : ONote}
{m : ℕ}
[o.NF]
(h : o.split = (o', m))


theorem mul_limZero_left {f} (g : CauSeq β abv) (hg : LimZero f) : LimZero (f * g)

{α : Type u_1}
{β : Type u_2}
[LinearOrderedField α]
[Ring β]
{abv : β → α}
[IsAbsoluteValue abv]
{f : CauSeq β abv}
(g : CauSeq β abv)
(hg : f.LimZero)


@[simp]
theorem coe_id_continuousOrderHom : (EsakiaHom.id α : α →Co α) = ContinuousOrderHom.id α

{α : Type u_2}
[TopologicalSpace α]
[Preorder α]

↑(EsakiaHom.id α) = ContinuousOrderHom.id α


theorem cardFactors_mul {m n : ℕ} (m0 : m ≠ 0) (n0 : n ≠ 0) : Ω (m * n) = Ω m + Ω n

ArithmeticFunction.cardFactors (m * n) = ArithmeticFunction.cardFactors m + ArithmeticFunction.cardFactors n


theorem and_or_imp {a b c : Prop} : a ∧ b ∨ (a → c) ↔ a → b ∨ c


@[simp]
theorem constantCoeff_invOfUnit (φ : MvPowerSeries σ R) (u : Rˣ) :
    constantCoeff σ R (invOfUnit φ u) = ↑u⁻¹

{σ : Type u_1}
{R : Type u_2}
[Ring R]
(φ : MvPowerSeries σ R)
(u : Rˣ)

(MvPowerSeries.constantCoeff σ R) (φ.invOfUnit u) = ↑u⁻¹


/-- This structure permits to define a vector bundle when trivializations are given as local
equivalences but there is not yet a topology on the total space or the fibers.
The total space is hence given a topology in such a way that there is a fiber bundle structure for
which the partial equivalences are also partial homeomorphisms and hence vector bundle
trivializations. The topology on the fibers is induced from the one on the total space.

The field `exists_coordChange` is stated as an existential statement (instead of 3 separate
fields), since it depends on propositional information (namely `e e' ∈ pretrivializationAtlas`).
This makes it inconvenient to explicitly define a `coordChange` function when constructing a
`VectorPrebundle`. -/
-- Porting note(#5171): was @[nolint has_nonempty_instance]
structure VectorPrebundle where
  pretrivializationAtlas : Set (Pretrivialization F (π F E))
  pretrivialization_linear' : ∀ e, e ∈ pretrivializationAtlas → e.IsLinear R
  pretrivializationAt : B → Pretrivialization F (π F E)
  mem_base_pretrivializationAt : ∀ x : B, x ∈ (pretrivializationAt x).baseSet
  pretrivialization_mem_atlas : ∀ x : B, pretrivializationAt x ∈ pretrivializationAtlas
  exists_coordChange : ∀ᵉ (e ∈ pretrivializationAtlas) (e' ∈ pretrivializationAtlas),
    ∃ f : B → F →L[R] F, ContinuousOn f (e.baseSet ∩ e'.baseSet) ∧
      ∀ᵉ (b ∈ e.baseSet ∩ e'.baseSet) (v : F), f b v = (e' ⟨b, e.symm b v⟩).2
  totalSpaceMk_inducing : ∀ b : B, Inducing (pretrivializationAt b ∘ .mk b)

(e : Pretrivialization F Bundle.TotalSpace.proj)

e ∈ self.pretrivializationAtlas →
  ∀ e' ∈ self.pretrivializationAtlas,
    ∃ f,
      ContinuousOn f (e.baseSet ∩ e'.baseSet) ∧
        ∀ b ∈ e.baseSet ∩ e'.baseSet, ∀ (v : F), (f b) v = (↑e' { proj := b, snd := e.symm b v }).2


@[to_additive] lemma MonovaryOn.mul_right (h₁ : MonovaryOn f g₁ s) (h₂ : MonovaryOn f g₂ s) :
    MonovaryOn f (g₁ * g₂) s

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[OrderedAddCommGroup α]
[LinearOrderedAddCommGroup β]
{s : Set ι}
{f : ι → α}
{g₁ g₂ : ι → β}
(h₁ : MonovaryOn f g₁ s)
(h₂ : MonovaryOn f g₂ s)


theorem minimalPeriod_eq_minimalPeriod_iff {g : β → β} {y : β} :
    minimalPeriod f x = minimalPeriod g y ↔ ∀ n, IsPeriodicPt f n x ↔ IsPeriodicPt g n y

{α : Type u_1}
{β : Type u_2}
{f : α → α}
{x : α}
{g : β → β}
{y : β}

Function.minimalPeriod f x = Function.minimalPeriod g y ↔
  ∀ (n : ℕ), Function.IsPeriodicPt f n x ↔ Function.IsPeriodicPt g n y


@[simp] lemma op_hom_braiding (X Y : C) : (β_ X Y).hom.op = (β_ (op Y) (op X)).hom

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

(β_ X Y).hom.op = (β_ (Opposite.op Y) (Opposite.op X)).hom


theorem isRat_le_true [LinearOrderedRing α] : {a b : α} → {na nb : ℤ} → {da db : ℕ} →
    IsRat a na da → IsRat b nb db →
    decide (Int.mul na (.ofNat db) ≤ Int.mul nb (.ofNat da)) → a ≤ b

{α : Type u_1}
[LinearOrderedRing α]
{a b : α}
{na nb : ℤ}
{da db : ℕ}

Mathlib.Meta.NormNum.IsRat a na da →
  Mathlib.Meta.NormNum.IsRat b nb db → decide (na.mul (Int.ofNat db) ≤ nb.mul (Int.ofNat da)) = true → a ≤ b


lemma CharP.isInt_of_mod {e' r : ℤ} {α : Type _} [Ring α] {n n' : ℕ} (inst : CharP α n) {e : α}
    (he : IsInt e e') (hn : IsNat n n') (h₂ : IsInt (e' % n') r) : IsInt e r

(h₂ : Mathlib.Meta.NormNum.IsInt (e' % ↑n') r)


theorem sym_surjective : Surjective (sym : α → αˢʸᵐ)


theorem IsBigO.rpow (hr : 0 ≤ r) (hg : 0 ≤ᶠ[l] g) (h : f =O[l] g) :
    (fun x => f x ^ r) =O[l] fun x => g x ^ r

{α : Type u_1}
{r : ℝ}
{l : Filter α}
{f g : α → ℝ}
(hr : 0 ≤ r)
(hg : 0 ≤ᶠ[l] g)
(h : f =O[l] g)


theorem ker_smul (f : V →ₗ[K] V₂) (a : K) (h : a ≠ 0) : ker (a • f) = ker f

{K : Type u_5}
{V : Type u_10}
{V₂ : Type u_11}
[Semifield K]
[AddCommMonoid V]
[Module K V]
[AddCommMonoid V₂]
[Module K V₂]
(f : V →ₗ[K] V₂)
(a : K)
(h : a ≠ 0)


lemma ne_zero_of_one_lt_re {s : ℂ} (hs : 1 < s.re) : s ≠ 0


@[simp, norm_cast]
theorem coe_eq_empty : (s : Set α) = ∅ ↔ s = ⊥

↑s = ∅ ↔ s = ⊥


theorem disjoint_prod_perm {l₁ l₂ : List (Perm α)} (hl : l₁.Pairwise Disjoint) (hp : l₁ ~ l₂) :
    l₁.prod = l₂.prod

(hl : List.Pairwise Equiv.Perm.Disjoint l₁)


theorem nfpFamily_le_apply [Nonempty ι] (H : ∀ i, IsNormal (f i)) {a b} :
    (∃ i, nfpFamily.{u, v} f a ≤ f i b) ↔ nfpFamily.{u, v} f a ≤ b

{f : ι → Ordinal.{max u v} → Ordinal.{max u v}}

(∃ i, Ordinal.nfpFamily f a ≤ f i b) ↔ Ordinal.nfpFamily f a ≤ b


theorem tan_sub_nat_mul_pi (x : ℝ) (n : ℕ) : tan (x - n * π) = tan x

Real.tan (x - ↑n * Real.pi) = Real.tan x


@[to_additive]
theorem hom_map_lift (g : M →* N) (f : α → M) (x : FreeMonoid α) : g (lift f x) = lift (g ∘ f) x

{α : Type u_1}
{M : Type u_4}
[AddMonoid M]
{N : Type u_5}
[AddMonoid N]
(g : M →+ N)
(f : α → M)
(x : FreeAddMonoid α)

g ((FreeAddMonoid.lift f) x) = (FreeAddMonoid.lift (⇑g ∘ f)) x


@[simp] lemma succAbove_pred_self (p : Fin (n + 1)) (h : p ≠ 0) :
    succAbove p (p.pred h) = (p.pred h).castSucc

p.succAbove (p.pred h) = (p.pred h).castSucc


@[simp]
theorem top_toSubalgebra : (⊤ : IntermediateField F E).toSubalgebra = ⊤

{F : Type u_1}
[Field F]
{E : Type u_2}
[Field E]
[Algebra F E]


@[simp]
theorem equivSubtypeMap_apply {p : Submodule R M} {q : Submodule R p} (x : q) :
    (p.equivSubtypeMap q x : M) = p.subtype.domRestrict q x

{R : Type u_1}
{M : Type u_5}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{p : Submodule R M}
{q : Submodule R ↥p}
(x : ↥q)

↑((p.equivSubtypeMap q) x) = (p.subtype.domRestrict q) x


@[simp]
theorem forget_map {U V : Under X} {f : U ⟶ V} : (forget X).map f = f.right

{T : Type u₁}
[CategoryTheory.Category.{v₁, u₁} T]
{X : T}
{U V : CategoryTheory.Under X}
{f : U ⟶ V}

(CategoryTheory.Under.forget X).map f = f.right


/-- The head term of the sequence with head of `v` is just the integer part of `v`. -/
@[simp]
theorem IntFractPair.seq1_fst_eq_of : (IntFractPair.seq1 v).fst = IntFractPair.of v

{K : Type u_1}
[LinearOrderedField K]
[FloorRing K]
{v : K}

(GenContFract.IntFractPair.seq1 v).1 = GenContFract.IntFractPair.of v


@[simp]
theorem card_support_eraseLead : f.eraseLead.support.card = f.support.card - 1


/-- A typeclass stating that multiplication is right distributive over addition. -/
class RightDistribClass (R : Type*) [Mul R] [Add R] : Prop where
  /-- Multiplication is right distributive over addition -/
  protected right_distrib : ∀ a b c : R, (a + b) * c = a * c + b * c

{R : Type u_1}
[Mul R]
[Add R]
[self : RightDistribClass R]
(a b c : R)


/-- The cokernel of `biprod.inl : X ⟶ X ⊞ Y` is `Y`. -/
@[simps!]
def cokernelBiprodInlIso : cokernel (biprod.inl : X ⟶ X ⊞ Y) ≅ Y

CategoryTheory.Limits.cokernelBiprodInlIso.inv =
  (CategoryTheory.Limits.biprod.isCokernelInlCokernelFork X Y).desc
    (CategoryTheory.Limits.colimit.cocone (CategoryTheory.Limits.parallelPair CategoryTheory.Limits.biprod.inl 0))


lemma traceForm_eq_sum_finrank_nsmul_mul (x y : L) :
    traceForm K L M x y = ∑ χ : Weight K L M, finrank K (weightSpace M χ) • (χ x * χ y)

(K : Type u_2)
(L : Type u_3)
(M : Type u_4)
[LieRing L]
[AddCommGroup M]
[LieRingModule L M]
[Field K]
[LieAlgebra K L]
[Module K M]
[LieModule K L M]
[FiniteDimensional K M]
[LieAlgebra.IsNilpotent K L]
[LieModule.LinearWeights K L M]
[LieModule.IsTriangularizable K L M]
(x y : L)

((LieModule.traceForm K L M) x) y =
  ∑ χ : LieModule.Weight K L M, FiniteDimensional.finrank K ↥↑(LieModule.weightSpace M ⇑χ) • (χ x * χ y)


/-- If `b` mod `p` spans `S/p` as `R/p`-space, then `b` itself spans `Frac(S)` as `K`-space.

Here,
 * `p` is an ideal of `R` such that `R / p` is nontrivial
 * `K` is a field that has an embedding of `R` (in particular we can take `K = Frac(R)`)
 * `L` is a field extension of `K`
 * `S` is the integral closure of `R` in `L`

More precisely, we avoid quotients in this statement and instead require that `b ∪ pS` spans `S`.
-/
theorem FinrankQuotientMap.span_eq_top [IsDomain R] [IsDomain S] [Algebra K L] [IsNoetherian R S]
    [Algebra R L] [IsScalarTower R S L] [IsScalarTower R K L] [IsIntegralClosure S R L]
    [NoZeroSMulDivisors R K] (hp : p ≠ ⊤) (b : Set S)
    (hb' : Submodule.span R b ⊔ (p.map (algebraMap R S)).restrictScalars R = ⊤) :
    Submodule.span K (algebraMap S L '' b) = ⊤

(hb' : Submodule.span R b ⊔ Submodule.restrictScalars R (Ideal.map (algebraMap R S) p) = ⊤)

Submodule.span K (⇑(algebraMap S L) '' b) = ⊤


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

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

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


lemma Gammaℝ_def (s : ℂ) : Gammaℝ s = π ^ (-s / 2) * Gamma (s / 2)

s.Gammaℝ = ↑π ^ (-s / 2) * Complex.Gamma (s / 2)


/-- The evaluation `SingleFunctors C D A ⥤ C ⥤ D` for some `a : A`. -/
@[simps]
def evaluation (a : A) : SingleFunctors C D A ⥤ C ⥤ D

{F G : CategoryTheory.SingleFunctors C D A}

(CategoryTheory.SingleFunctors.evaluation C D a).map φ = φ.hom a


theorem exists_conts_a_of_num {A : K} (nth_num_eq : g.nums n = A) :
    ∃ conts, g.conts n = conts ∧ conts.a = A

{K : Type u_1}
{g : GenContFract K}
{n : ℕ}
[DivisionRing K]
{A : K}
(nth_num_eq : g.nums n = A)


theorem zero_not_mem_normalizedFactors (x : α) : (0 : α) ∉ normalizedFactors x

{α : Type u_1}
[CancelCommMonoidWithZero α]
[NormalizationMonoid α]
[UniqueFactorizationMonoid α]
(x : α)

0 ∉ UniqueFactorizationMonoid.normalizedFactors x


theorem eventually_mapsTo_of_isOpen_of_omegaLimit_subset [CompactSpace β] {v : Set β}
    (hv₁ : IsOpen v) (hv₂ : ω f ϕ s ⊆ v) : ∀ᶠ t in f, MapsTo (ϕ t) s v

{τ : Type u_1}
{α : Type u_2}
{β : Type u_3}
[TopologicalSpace β]
(f : Filter τ)
(ϕ : τ → α → β)
(s : Set α)
[CompactSpace β]
{v : Set β}
(hv₁ : IsOpen v)
(hv₂ : omegaLimit f ϕ s ⊆ v)


theorem innerProp_neg_one : innerProp' E ((-1 : ℤ) : 𝕜)

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


@[simp]
theorem cast_inj {α β : Type u} (h : α = β) {x y : α} : cast h x = cast h y ↔ x = y


theorem norm_lt_iff {M : ℝ} (M0 : 0 < M) : ‖f‖ < M ↔ ∀ x, ‖f x‖ < M

{α : Type u_1}
{E : Type u_3}
[TopologicalSpace α]
[CompactSpace α]
[NormedAddCommGroup E]
(f : C(α, E))
{M : ℝ}
(M0 : 0 < M)


@[simp]
theorem mem_sInf {S : Set (Closeds α)} {x : α} : x ∈ sInf S ↔ ∀ s ∈ S, x ∈ s

{α : Type u_2}
[TopologicalSpace α]
{S : Set (TopologicalSpace.Closeds α)}
{x : α}


theorem sMod'_eq_sMod (p k : ℕ) (hp : 2 ≤ p) : (sMod' (2 ^ p - 1) k : ℤ) = sMod p k

↑(LucasLehmer.norm_num_ext.sMod' (2 ^ p - 1) k) = LucasLehmer.sMod p k


@[simp]
theorem opNorm_flip (f : E →SL[σ₁₃] F →SL[σ₂₃] G) : ‖f.flip‖ = ‖f‖

{𝕜 : Type u_1}
{𝕜₂ : Type u_2}
{𝕜₃ : Type u_3}
{E : Type u_4}
{F : Type u_6}
{G : Type u_8}
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup F]
[SeminormedAddCommGroup G]
[NontriviallyNormedField 𝕜]
[NontriviallyNormedField 𝕜₂]
[NontriviallyNormedField 𝕜₃]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜₂ F]
[NormedSpace 𝕜₃ G]
{σ₂₃ : 𝕜₂ →+* 𝕜₃}
{σ₁₃ : 𝕜 →+* 𝕜₃}
[RingHomIsometric σ₂₃]
[RingHomIsometric σ₁₃]
(f : E →SL[σ₁₃] F →SL[σ₂₃] G)


/-- A function from a locally finite partial order is monotone if and only if it is monotone when
restricted to pairs satisfying `a ⋖ b`. -/
lemma monotone_iff_forall_covBy [PartialOrder α] [LocallyFiniteOrder α] [Preorder β]
    (f : α → β) : Monotone f ↔ ∀ a b : α, a ⋖ b → f a ≤ f b

{α : Type u_2}
{β : Type u_3}
[PartialOrder α]
[LocallyFiniteOrder α]
[Preorder β]
(f : α → β)

Monotone f ↔ ∀ (a b : α), a ⋖ b → f a ≤ f b


theorem _root_.Wbtw.wOppSide₃₁ {s : AffineSubspace R P} {x y z : P} (h : Wbtw R x y z)
    (hy : y ∈ s) : s.WOppSide z x

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[StrictOrderedCommRing R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
{s : AffineSubspace R P}
{x y z : P}
(h : Wbtw R x y z)
(hy : y ∈ s)


/-- `f x / g x` is analytic away from `g x = 0` -/
theorem AnalyticOn.div {f g : E → 𝕝} {s : Set E}
    (fa : AnalyticOn 𝕜 f s) (ga : AnalyticOn 𝕜 g s) (g0 : ∀ x ∈ s, g x ≠ 0) :
    AnalyticOn 𝕜 (fun x ↦ f x / g x) s

{𝕜 : Type u_2}
[NontriviallyNormedField 𝕜]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{𝕝 : Type u_7}
[NontriviallyNormedField 𝕝]
[NormedAlgebra 𝕜 𝕝]
{f g : E → 𝕝}
{s : Set E}
(fa : AnalyticOn 𝕜 f s)
(ga : AnalyticOn 𝕜 g s)
(g0 : ∀ x ∈ s, g x ≠ 0)


@[to_additive (attr := simp)]
theorem mulSupport_eq_empty_iff {f : α → M} : mulSupport f = ∅ ↔ f = 1

{α : Type u_1}
{M : Type u_5}
[One M]
{f : α → M}


theorem contDiffWithinAt_top : ContDiffWithinAt 𝕜 ∞ f s x ↔ ∀ n : ℕ, ContDiffWithinAt 𝕜 n f s x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{s : Set E}
{f : E → F}
{x : E}

ContDiffWithinAt 𝕜 ⊤ f s x ↔ ∀ (n : ℕ), ContDiffWithinAt 𝕜 (↑n) f s x


/-- If `f : R ≃+* S` is a ring isomorphism and `I : Ideal R`, then `map f I = comap f.symm I`. -/
theorem map_comap_of_equiv (I : Ideal R) (f : R ≃+* S) : I.map (f : R →+* S) = I.comap f.symm

{R : Type u}
{S : Type v}
[Semiring R]
[Semiring S]
(I : Ideal R)
(f : R ≃+* S)


theorem continuousOn_coordChange [VectorBundle R F E] (e e' : Trivialization F (π F E))
    [MemTrivializationAtlas e] [MemTrivializationAtlas e'] :
    ContinuousOn (fun b => Trivialization.coordChangeL R e e' b : B → F →L[R] F)
      (e.baseSet ∩ e'.baseSet)

[TopologicalSpace (Bundle.TotalSpace F E)]

(e e' : Trivialization F Bundle.TotalSpace.proj)

ContinuousOn (fun b => ↑(Trivialization.coordChangeL R e e' b)) (e.baseSet ∩ e'.baseSet)


@[simp] theorem back?_push (a : Array α) : (a.push x).back? = some x


/-- Consider a series of functions `∑' n, f n x` on a preconnected open set. If the series converges
at a point, and all functions in the series are differentiable with a summable bound on the
derivatives, then the series is differentiable on the set and its derivative is the sum of the
derivatives. -/
theorem hasFDerivAt_tsum_of_isPreconnected (hu : Summable u) (hs : IsOpen s)
    (h's : IsPreconnected s) (hf : ∀ n x, x ∈ s → HasFDerivAt (f n) (f' n x) x)
    (hf' : ∀ n x, x ∈ s → ‖f' n x‖ ≤ u n) (hx₀ : x₀ ∈ s) (hf0 : Summable fun n => f n x₀)
    (hx : x ∈ s) : HasFDerivAt (fun y => ∑' n, f n y) (∑' n, f' n x) x

(hf : ∀ (n : α), ∀ x ∈ s, HasFDerivAt (f n) (f' n x) x)

(hf' : ∀ (n : α), ∀ x ∈ s, ‖f' n x‖ ≤ u n)

HasFDerivAt (fun y => ∑' (n : α), f n y) (∑' (n : α), f' n x) x


/-- 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]

∀ {X Y : C} (f : X ⟶ Y), (CategoryTheory.ULiftHom.up.map f).down = f


@[ext]
theorem ext {f g : CauSeq β abv} (h : ∀ i, f i = g i) : f = g

{α : Type u_1}
{β : Type u_2}
[LinearOrderedField α]
[Ring β]
{abv : β → α}
{f g : CauSeq β abv}
(h : ∀ (i : ℕ), ↑f i = ↑g i)


theorem abelian_iff_derived_succ_eq_bot (I : LieIdeal R L) (k : ℕ) :
    IsLieAbelian (derivedSeriesOfIdeal R L k I) ↔ derivedSeriesOfIdeal R L (k + 1) I = ⊥

{R : Type u}
{L : Type v}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
(I : LieIdeal R L)
(k : ℕ)

IsLieAbelian ↥↑(LieAlgebra.derivedSeriesOfIdeal R L k I) ↔ LieAlgebra.derivedSeriesOfIdeal R L (k + 1) I = ⊥


@[elementwise, reassoc]
theorem toOpen_comp_comap (f : R →+* S) (U : Opens (PrimeSpectrum.Top R)) :
    (toOpen R U ≫ comap f U (Opens.comap (PrimeSpectrum.comap f) U) fun _ => id) =
      CommRingCat.ofHom f ≫ toOpen S _

(U : TopologicalSpace.Opens ↑(AlgebraicGeometry.PrimeSpectrum.Top R))

AlgebraicGeometry.StructureSheaf.toOpen R U ≫
    AlgebraicGeometry.StructureSheaf.comap f U ((TopologicalSpace.Opens.comap (PrimeSpectrum.comap f)) U) ⋯ =
  CommRingCat.ofHom f ≫
    AlgebraicGeometry.StructureSheaf.toOpen S ((TopologicalSpace.Opens.comap (PrimeSpectrum.comap f)) U)


@[simp]
theorem mem_map {f : α → β} {b : β} {z : Sym2 α} : b ∈ Sym2.map f z ↔ ∃ a, a ∈ z ∧ f a = b

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{b : β}
{z : Sym2 α}


@[simp]
theorem ad_ker_eq_self_module_ker : (ad R L).ker = LieModule.ker R L L

(R : Type u)
(L : Type v)
[CommRing R]
[LieRing L]
[LieAlgebra R L]

(LieAlgebra.ad R L).ker = LieModule.ker R L L


private lemma max_ne (ha : a ≠ c) (hb : b ≠ c) : max a b ≠ c

{R : Type u_2}
[LinearOrder R]
{a b c : R}
(ha : a ≠ c)
(hb : b ≠ c)


@[to_additive]
theorem prod_eq_foldr (s : Multiset α) :
    prod s = foldr (· * ·) (fun x y z => by simp [mul_left_comm]) 1 s

{α : Type u_3}
[AddCommMonoid α]
(s : Multiset α)

s.sum = Multiset.foldr (fun x x_1 => x + x_1) ⋯ 0 s


/-- `Matrix.comp` as `AddEquiv` -/
@[simps!]
def compAddEquiv : Matrix I J (Matrix K L R) ≃+ Matrix (I × K) (J × L) R

(I : Type u_1)
(J : Type u_2)
(K : Type u_3)
(L : Type u_4)
(R : Type u_5)
[AddCommMonoid R]
(m : Matrix I J (Matrix K L R))
(ik : I × K)
(jl : J × L)

(Matrix.compAddEquiv I J K L R) m ik jl = m ik.1 jl.1 ik.2 jl.2


/-- If A ≠ B and C ≠ B then ∠ABC = π if and only if (dist A C) = (dist A B) + (dist B C). -/
theorem dist_eq_add_dist_iff_angle_eq_pi {p1 p2 p3 : P} (hp1p2 : p1 ≠ p2) (hp3p2 : p3 ≠ p2) :
    dist p1 p3 = dist p1 p2 + dist p3 p2 ↔ ∠ p1 p2 p3 = π

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{p1 p2 p3 : P}
(hp1p2 : p1 ≠ p2)
(hp3p2 : p3 ≠ p2)

dist p1 p3 = dist p1 p2 + dist p3 p2 ↔ EuclideanGeometry.angle p1 p2 p3 = π


theorem mem_replicate {a b : α} {n : ℕ} : b ∈ replicate n a ↔ n ≠ 0 ∧ b = a

b ∈ Multiset.replicate n a ↔ n ≠ 0 ∧ b = a


@[to_additive]
theorem exponent_eq_zero_iff : exponent G = 0 ↔ ¬ExponentExists G

Monoid.exponent G = 0 ↔ ¬Monoid.ExponentExists G


private theorem signAux_swap_zero_one' (n : ℕ) : signAux (swap (0 : Fin (n + 2)) 1) = -1


theorem map_rel_iff (f : r ↪r s) {a b} : s (f a) (f b) ↔ r a b

{α : Type u_1}
{β : Type u_2}
{r : α → α → Prop}
{s : β → β → Prop}
(f : r ↪r s)
{a b : α}


theorem div_eq_of_lt (h₀ : a < b) : a / b = 0


/-- `ContDiffBump` is `𝒞ⁿ` in all its arguments. -/
protected theorem _root_.ContDiffWithinAt.contDiffBump {c g : X → E} {s : Set X}
    {f : ∀ x, ContDiffBump (c x)} {x : X} (hc : ContDiffWithinAt ℝ n c s x)
    (hr : ContDiffWithinAt ℝ n (fun x => (f x).rIn) s x)
    (hR : ContDiffWithinAt ℝ n (fun x => (f x).rOut) s x)
    (hg : ContDiffWithinAt ℝ n g s x) :
    ContDiffWithinAt ℝ n (fun x => f x (g x)) s x

ContDiffWithinAt ℝ n (fun x => ↑(f x) (g x)) s x


@[simp]
theorem isOpen_singleton_true : IsOpen ({True} : Set Prop)


@[simp]
theorem edist_toAdd (a b : Multiplicative X) : edist (toAdd a) (toAdd b) = edist a b

{X : Type u_1}
[EDist X]
(a b : Multiplicative X)

edist (Multiplicative.toAdd a) (Multiplicative.toAdd b) = edist a b


@[simp]
theorem image_uncurry_product (f : α → β → γ) (s : Finset α) (t : Finset β) :
    (s ×ˢ t).image (uncurry f) = image₂ f s t

{α : Type u_1}
{β : Type u_3}
{γ : Type u_5}
[DecidableEq γ]
(f : α → β → γ)
(s : Finset α)
(t : Finset β)

Finset.image (Function.uncurry f) (s ×ˢ t) = Finset.image₂ f s t


theorem toLex_monotone : Monotone (@toLex (∀ i, β i))

{ι : Type u_1}
{β : ι → Type u_2}
[LinearOrder ι]
[IsWellOrder ι fun x x_1 => x < x_1]
[(i : ι) → PartialOrder (β i)]


/-- The separable degree of `F⟮α⟯ / F` is smaller than the degree of `F⟮α⟯ / F` if `α` is
algebraic over `F`. -/
theorem finSepDegree_adjoin_simple_le_finrank (α : E) (halg : IsAlgebraic F α) :
    finSepDegree F F⟮α⟯ ≤ finrank F F⟮α⟯

(F : Type u)
(E : Type v)
[Field F]
[Field E]
[Algebra F E]
(α : E)
(halg : IsAlgebraic F α)

Field.finSepDegree F ↥F⟮α⟯ ≤ FiniteDimensional.finrank F ↥F⟮α⟯


theorem vsub_def : s -ᵥ t = image₂ (· -ᵥ ·) s t

{α : Type u_2}
{β : Type u_3}
[VSub α β]
[DecidableEq α]
{s t : Finset β}

s -ᵥ t = Finset.image₂ (fun x x_1 => x -ᵥ x_1) s t


theorem map_tensorProduct_mk_eq_top {N : Submodule R M} [Module.Finite R M] :
    N.map (TensorProduct.mk R k M 1) = ⊤ ↔ N = ⊤

{R : Type u_1}
[CommRing R]
[LocalRing R]
{M : Type u_2}
[AddCommGroup M]
[Module R M]
{N : Submodule R M}
[Module.Finite R M]

Submodule.map ((TensorProduct.mk R (LocalRing.ResidueField R) M) 1) N = ⊤ ↔ N = ⊤


theorem coeff_mul_natTrailingDegree_add_natTrailingDegree : (p * q).coeff
    (p.natTrailingDegree + q.natTrailingDegree) = p.trailingCoeff * q.trailingCoeff


lemma _root_.ContinuousOn.compCM (hg : ContinuousOn g s) (hf : ContinuousOn f s) :
    ContinuousOn (fun x ↦ (g x).comp (f x)) s

{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)}
{s : Set X'}
(hg : ContinuousOn g s)
(hf : ContinuousOn f s)

ContinuousOn (fun x => (g x).comp (f x)) s


theorem ofDigits_zmodeq (b : ℤ) (k : ℕ) (L : List ℕ) : ofDigits b L ≡ ofDigits (b % k) L [ZMOD k]

Nat.ofDigits b L ≡ Nat.ofDigits (b % ↑k) L [ZMOD ↑k]


@[to_additive]
lemma Group.toDivInvMonoid_injective {G : Type*} : Injective (@Group.toDivInvMonoid G)


@[simp] lemma uniformConvexOn_zero : UniformConvexOn s 0 f ↔ ConvexOn ℝ s f

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{s : Set E}
{f : E → ℝ}


theorem map_comm {f₁ : α → β} {f₂ : α → γ} {g₁ : β → δ} {g₂ : γ → δ}
    (h : g₁ ∘ f₁ = g₂ ∘ f₂) (a : α) :
    map g₁ (map f₁ a) = map g₂ (map f₂ a)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{δ : Type u_4}
{f₁ : α → β}
{f₂ : α → γ}
{g₁ : β → δ}
{g₂ : γ → δ}
(h : g₁ ∘ f₁ = g₂ ∘ f₂)
(a : α)

WithBot.map g₁ (WithBot.map f₁ ↑a) = WithBot.map g₂ (WithBot.map f₂ ↑a)


lemma CFC.quasispectrum_zero_eq : σₙ R (0 : A) = {0}


lemma coxeterWeight_non_neg : 0 ≤ P.coxeterWeight i j

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


lemma map_map {A : Type v} [CommRing A] (φ : R →+* A) {B : Type w} [CommRing B] (ψ : A →+* B) :
    (C.map φ).map ψ = C.map (ψ.comp φ)

{R : Type u}
[CommRing R]
(C : WeierstrassCurve.VariableChange R)
{A : Type v}
[CommRing A]
(φ : R →+* A)
{B : Type w}
[CommRing B]
(ψ : A →+* B)

WeierstrassCurve.VariableChange.map ψ (WeierstrassCurve.VariableChange.map φ C) =
  WeierstrassCurve.VariableChange.map (ψ.comp φ) C


/-- The global sections of the restriction is isomorphic to the sections on the open set. -/
@[simps!]
def topIso : Γ(U, ⊤) ≅ Γ(X, U)

{X : AlgebraicGeometry.Scheme}
(U : X.Opens)

U.topIso.hom = X.presheaf.map (CategoryTheory.eqToHom ⋯).op


/-- The transitivity of homotopy between morphisms of short complexes. -/
@[simps]
def trans (h₁₂ : Homotopy φ₁ φ₂) (h₂₃ : Homotopy φ₂ φ₃) : Homotopy φ₁ φ₃

{φ₁ φ₂ φ₃ : S₁ ⟶ S₂}

(h₁₂ : CategoryTheory.ShortComplex.Homotopy φ₁ φ₂)

(h₂₃ : CategoryTheory.ShortComplex.Homotopy φ₂ φ₃)


theorem exists_le_of_tendsto_atTop [SemilatticeSup α] [Preorder β] {u : α → β}
    (h : Tendsto u atTop atTop) (a : α) (b : β) : ∃ a' ≥ a, b ≤ u a'

(h : Filter.Tendsto u Filter.atTop Filter.atTop)


/-- An exponential lower bound on the central binomial coefficient.
This bound is of interest because it appears in
[Tochiori's refinement of Erdős's proof of Bertrand's postulate](tochiori_bertrand).
-/
theorem four_pow_lt_mul_centralBinom (n : ℕ) (n_big : 4 ≤ n) : 4 ^ n < n * centralBinom n


/-- In a noetherian module over a division ring,
if a basis is indexed by a set, that set is finite. -/
theorem finite_basis_index {ι : Type*} {s : Set ι} [IsNoetherian K V] (b : Basis s K V) :
    s.Finite

{K : Type u}
{V : Type v}
[DivisionRing K]
[AddCommGroup V]
[Module K V]
{ι : Type u_1}
{s : Set ι}
[IsNoetherian K V]
(b : Basis (↑s) K V)


theorem log_le_of_logEmbedding_le {r : ℝ} {x : (𝓞 K)ˣ} (hr : 0 ≤ r) (h : ‖logEmbedding K x‖ ≤ r)
    (w : InfinitePlace K) : |Real.log (w x)| ≤ (Fintype.card (InfinitePlace K)) * r

(h : ‖(NumberField.Units.logEmbedding K) x‖ ≤ r)

|Real.log (w ((algebraMap (𝓞 K) K) ↑x))| ≤ ↑(Fintype.card (NumberField.InfinitePlace K)) * r


@[simp]
theorem coe_comp (f : B →⋆ₙ+* C) (g : A →⋆ₙ+* B) : ⇑(comp f g) = f ∘ g

{A : Type u_1}
{B : Type u_2}
{C : Type u_3}
[NonUnitalNonAssocSemiring A]
[Star A]
[NonUnitalNonAssocSemiring B]
[Star B]
[NonUnitalNonAssocSemiring C]
[Star C]
(f : B →⋆ₙ+* C)
(g : A →⋆ₙ+* B)


/-- The elements of a set of sets partitioning α are the equivalence classes of the
    equivalence relation defined by the set of sets. -/
theorem eq_eqv_class_of_mem {c : Set (Set α)} (H : ∀ a, ∃! b ∈ c, a ∈ b) {s y}
    (hs : s ∈ c) (hy : y ∈ s) : s = { x | (mkClasses c H).Rel x y }

{α : Type u_1}
{c : Set (Set α)}
(H : ∀ (a : α), ∃! b, b ∈ c ∧ a ∈ b)
{s : Set α}
{y : α}
(hs : s ∈ c)
(hy : y ∈ s)

s = {x | (Setoid.mkClasses c H).Rel x y}


theorem inv_def (a : Rat) : a.inv = a.den /. a.num


@[continuity]
theorem Continuous.matrix_diag {A : X → Matrix n n R} (hA : Continuous A) :
    Continuous fun x => Matrix.diag (A x)

{X : Type u_1}
{n : Type u_5}
{R : Type u_8}
[TopologicalSpace X]
[TopologicalSpace R]
{A : X → Matrix n n R}
(hA : Continuous A)


@[to_additive] lemma pow_mul_comm (a : M) (m n : ℕ) : a ^ m * a ^ n = a ^ n * a ^ m

{M : Type u_2}
[AddMonoid M]
(a : M)
(m n : ℕ)


theorem unop_ne_zero_iff [Zero α] (a : αᵐᵒᵖ) : a.unop ≠ (0 : α) ↔ a ≠ (0 : αᵐᵒᵖ)


@[simp]
theorem smul_ball_preimage (p : Seminorm 𝕜 E) (y : E) (r : ℝ) (a : 𝕜) (ha : a ≠ 0) :
    (a • ·) ⁻¹' p.ball y r = p.ball (a⁻¹ • y) (r / ‖a‖)

{𝕜 : Type u_3}
{E : Type u_7}
[NormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
(p : Seminorm 𝕜 E)
(y : E)
(r : ℝ)
(a : 𝕜)
(ha : a ≠ 0)

(fun x => a • x) ⁻¹' p.ball y r = p.ball (a⁻¹ • y) (r / ‖a‖)


/-- `TransGen r`: transitive closure of `r` -/
@[mk_iff]
inductive TransGen (r : α → α → Prop) (a : α) : α → Prop
  | single {b} : r a b → TransGen r a b
  | tail {b c} : TransGen r a b → r b c → TransGen r a c

{α : Type u_1}
(r : α → α → Prop)
(a : α)

∀ (a_1 : α), Relation.TransGen r a a_1 ↔ r a a_1 ∨ ∃ b, Relation.TransGen r a b ∧ r b a_1


theorem AffineMap.lineMap_mem {k V P : Type*} [Ring k] [AddCommGroup V] [Module k V]
    [AddTorsor V P] {Q : AffineSubspace k P} {p₀ p₁ : P} (c : k) (h₀ : p₀ ∈ Q) (h₁ : p₁ ∈ Q) :
    AffineMap.lineMap p₀ p₁ c ∈ Q

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{Q : AffineSubspace k P}
{p₀ p₁ : P}
(c : k)
(h₀ : p₀ ∈ Q)
(h₁ : p₁ ∈ Q)


theorem mem_comap_iff_compl : s ∈ comap f l ↔ (f '' sᶜ)ᶜ ∈ l

{α : Type u}
{β : Type v}
{f : α → β}
{l : Filter β}
{s : Set α}


/-- Two equal natural transformations `L₁ ⟶ L₂` yield naturally isomorphic functors
    `Comma L₁ R ⥤ Comma L₂ R`. -/
@[simps!]
def mapLeftEq (l l' : L₁ ⟶ L₂) (h : l = l') : mapLeft R l ≅ mapLeft R l'

{A : Type u₁}
[CategoryTheory.Category.{v₁, u₁} A]
{B : Type u₂}
[CategoryTheory.Category.{v₂, u₂} B]
{T : Type u₃}
[CategoryTheory.Category.{v₃, u₃} T]
(R : CategoryTheory.Functor B T)
{L₁ L₂ : CategoryTheory.Functor A T}
(l l' : L₁ ⟶ L₂)
(h : l = l')
(X : CategoryTheory.Comma L₂ R)

((CategoryTheory.Comma.mapLeftEq R l l' h).hom.app X).right = CategoryTheory.CategoryStruct.id X.right


theorem mem_iff_inf_principal_compl {f : Filter α} {s : Set α} : s ∈ f ↔ f ⊓ 𝓟 sᶜ = ⊥

{α : Type u_1}
{f : Filter α}
{s : Set α}

s ∈ f ↔ f ⊓ 𝓟 sᶜ = ⊥


/-- A natural isomorphism `L₁ ≅ L₂` induces an equivalence of categories
    `Comma L₁ R ≌ Comma L₂ R`. -/
@[simps!]
def mapLeftIso (i : L₁ ≅ L₂) : Comma L₁ R ≌ Comma L₂ R

{A : Type u₁}
[CategoryTheory.Category.{v₁, u₁} A]
{B : Type u₂}
[CategoryTheory.Category.{v₂, u₂} B]
{T : Type u₃}
[CategoryTheory.Category.{v₃, u₃} T]
(R : CategoryTheory.Functor B T)
{L₁ L₂ : CategoryTheory.Functor A T}
(i : L₁ ≅ L₂)
(X : CategoryTheory.Comma L₁ R)

((CategoryTheory.Comma.mapLeftIso R i).functor.obj X).left = X.left


lemma intCast_cast_mul (x y : ZMod n) : (cast (x * y) : ℤ) = cast x * cast y % n


@[simp]
theorem mk_eq_mk (f : CauSeq _ abv) : @Eq (Cauchy abv) ⟦f⟧ (mk f)

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


@[simp]
theorem toNNReal_mul {a b : ℝ≥0∞} : (a * b).toNNReal = a.toNNReal * b.toNNReal


@[simp]
theorem comp_assoc {a b c : V} :
    ∀ {d} (p : Path a b) (q : Path b c) (r : Path c d), (p.comp q).comp r = p.comp (q.comp r)

{V : Type u}
[Quiver V]
{a b c d : V}
(p : Quiver.Path a b)
(q : Quiver.Path b c)
(r : Quiver.Path c d)


theorem ultrafilter_le_nhds_infty {f : Ultrafilter (OnePoint X)} :
    (f : Filter (OnePoint X)) ≤ 𝓝 ∞ ↔ ∀ s : Set X, IsClosed s → IsCompact s → (↑) '' s ∉ f

{X : Type u_1}
[TopologicalSpace X]
{f : Ultrafilter (OnePoint X)}

↑f ≤ 𝓝 OnePoint.infty ↔ ∀ (s : Set X), IsClosed s → IsCompact s → OnePoint.some '' s ∉ f


@[simp]
theorem castPred_castSucc {i : Fin n} (h' := Fin.ext_iff.not.2 (castSucc_lt_last i).ne) :
    castPred (castSucc i) h' = i

{n : ℕ}
{i : Fin n}
(h' : ¬i.castSucc = Fin.last n := ⋯)


theorem ne_zero_iff [Nontrivial Γ₀] (v : Valuation K Γ₀) {x : K} : v x ≠ 0 ↔ x ≠ 0

{K : Type u_1}
[DivisionRing K]
{Γ₀ : Type u_4}
[LinearOrderedCommMonoidWithZero Γ₀]
[Nontrivial Γ₀]
(v : Valuation K Γ₀)
{x : K}


/-- In the canonical isometric isomorphism between a Hilbert sum `E` of `G` and `lp G 2`,
a vector `w : lp G 2` is the image of the infinite sum of the associated elements in `E`, and this
sum indeed converges. -/
protected theorem IsHilbertSum.hasSum_linearIsometryEquiv_symm (hV : IsHilbertSum 𝕜 G V)
    (w : lp G 2) : HasSum (fun i => V i (w i)) (hV.linearIsometryEquiv.symm w)

{ι : Type u_1}
{𝕜 : Type u_2}
[RCLike 𝕜]
{E : Type u_3}
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[cplt : CompleteSpace E]
{G : ι → Type u_4}
[(i : ι) → NormedAddCommGroup (G i)]
[(i : ι) → InnerProductSpace 𝕜 (G i)]
{V : (i : ι) → G i →ₗᵢ[𝕜] E}
(hV : IsHilbertSum 𝕜 G V)
(w : ↥(lp G 2))

HasSum (fun i => (V i) (↑w i)) (hV.linearIsometryEquiv.symm w)


/--
The category of sheaves on the bottom (trivial) grothendieck topology is equivalent to the category
of presheaves.
-/
@[simps]
def sheafOfTypesBotEquiv : SheafOfTypes (⊥ : GrothendieckTopology C) ≌ Cᵒᵖ ⥤ Type w

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

∀ {X Y : CategoryTheory.Functor Cᵒᵖ (Type w)} (f : X ⟶ Y), (CategoryTheory.sheafOfTypesBotEquiv.inverse.map f).val = f


@[simp]
theorem coe_of (α : Type*) [DistribLattice α] [BoundedOrder α] : ↥(of α) = α

(α : Type u_1)
[DistribLattice α]
[BoundedOrder α]


/-- This theorem can't be used to rewrite without specifying `rlt`, since `rlt` would have to be
  guessed. See `mem_minimals_iff_forall_ssubset_not_mem` and `mem_minimals_iff_forall_lt_not_mem`
  for `⊆` and `≤` versions.  -/
theorem mem_minimals_iff_forall_lt_not_mem'
    (rlt : α → α → Prop) [IsNonstrictStrictOrder α r rlt] :
    x ∈ minimals r s ↔ x ∈ s ∧ ∀ ⦃y⦄, rlt y x → y ∉ s

{α : Type u_1}
{r : α → α → Prop}
{s : Set α}
{x : α}
(rlt : α → α → Prop)
[IsNonstrictStrictOrder α r rlt]

x ∈ minimals r s ↔ x ∈ s ∧ ∀ ⦃y : α⦄, rlt y x → y ∉ s


@[to_additive (attr := simp, aesop safe apply (rule_sets := [finsetNonempty]))]
theorem smul_nonempty_iff : (s • t).Nonempty ↔ s.Nonempty ∧ t.Nonempty

{α : Type u_2}
{β : Type u_3}
[DecidableEq β]
[VAdd α β]
{s : Finset α}
{t : Finset β}

(s +ᵥ t).Nonempty ↔ s.Nonempty ∧ t.Nonempty


@[simp]
protected theorem length_reverseAux {u v w : V} (p : G.Walk u v) (q : G.Walk u w) :
    (p.reverseAux q).length = p.length + q.length

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


theorem normalizedFactors_of_irreducible_pow {p : α} (hp : Irreducible p) (k : ℕ) :
    normalizedFactors (p ^ k) = Multiset.replicate k (normalize p)

{α : Type u_1}
[CancelCommMonoidWithZero α]
[NormalizationMonoid α]
[UniqueFactorizationMonoid α]
{p : α}
(hp : Irreducible p)
(k : ℕ)

UniqueFactorizationMonoid.normalizedFactors (p ^ k) = Multiset.replicate k (normalize p)


theorem iteratedDerivWithin_congr (hfg : Set.EqOn f g s) :
    Set.EqOn (iteratedDerivWithin n f s) (iteratedDerivWithin n g s) s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type u_2}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{n : ℕ}
{s : Set 𝕜}
(h : UniqueDiffOn 𝕜 s)
{f g : 𝕜 → F}
(hfg : Set.EqOn f g s)