@[simp]
theorem coe_deriv₂ (f : E →L[𝕜] Fₗ →L[𝕜] Gₗ) (p : E × Fₗ) :
    ⇑(f.deriv₂ p) = fun q : E × Fₗ => f p.1 q.2 + f q.1 p.2

{𝕜 : Type u_1}
{E : Type u_4}
{Fₗ : Type u_7}
{Gₗ : Type u_9}
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup Fₗ]
[SeminormedAddCommGroup Gₗ]
[NontriviallyNormedField 𝕜]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜 Fₗ]
[NormedSpace 𝕜 Gₗ]
(f : E →L[𝕜] Fₗ →L[𝕜] Gₗ)
(p : E × Fₗ)

⇑(f.deriv₂ p) = fun q => (f p.1) q.2 + (f q.1) p.2


@[simp]
theorem inv_apply_self (f : Perm α) (x) : f⁻¹ (f x) = x


@[to_additive]
theorem const_ne_one : const ι a ≠ 1 ↔ a ≠ 1

{ι : Type u_1}
{α : Type u_2}
[One α]
[Nonempty ι]
{a : α}


@[simp]
lemma comp_toLoc {a b c : C} (f : a ⟶ b) (g : b ⟶ c) : (f ≫ g).toLoc = f.toLoc ≫ g.toLoc

(CategoryTheory.CategoryStruct.comp f g).toLoc = CategoryTheory.CategoryStruct.comp f.toLoc g.toLoc


lemma zero_of_num_zero {q : ℚ} (hq : q.num = 0) : q = 0


theorem hasFiniteColimits_of_hasInitial_and_pushouts [HasInitial C] [HasPushouts C] :
    HasFiniteColimits C

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


@[measurability]
theorem Measurable.nat_ceil (hf : Measurable f) : Measurable fun x => ⌈f x⌉₊

{α : Type u_1}
{R : Type u_2}
[MeasurableSpace α]
[LinearOrderedSemiring R]
[FloorSemiring R]
[TopologicalSpace R]
[OrderTopology R]
[MeasurableSpace R]
[OpensMeasurableSpace R]
{f : α → R}
(hf : Measurable f)


@[simp]
theorem sub_apply (f g : SlashInvariantForm Γ k) (z : ℍ) : (f - g) z = f z - g z

{Γ : Subgroup SL(2, ℤ)}
{k : ℤ}
(f g : SlashInvariantForm Γ k)
(z : ℍ)


/-- If a monoid homomorphism `f` between two `GroupWithZero`s maps `0` to `0`, then it maps `x^n`,
`n : ℤ`, to `(f x)^n`. -/
@[simp]
theorem map_zpow₀ {F G₀ G₀' : Type*} [GroupWithZero G₀] [GroupWithZero G₀'] [FunLike F G₀ G₀']
    [MonoidWithZeroHomClass F G₀ G₀'] (f : F) (x : G₀) (n : ℤ) : f (x ^ n) = f x ^ n

{F : Type u_8}
{G₀ : Type u_9}
{G₀' : Type u_10}
[GroupWithZero G₀]
[GroupWithZero G₀']
[FunLike F G₀ G₀']
[MonoidWithZeroHomClass F G₀ G₀']
(f : F)
(x : G₀)
(n : ℤ)


@[to_additive]
theorem prod_Ico_eq_div {δ : Type*} [CommGroup δ] (f : ℕ → δ) {m n : ℕ} (h : m ≤ n) :
    ∏ k ∈ Ico m n, f k = (∏ k ∈ range n, f k) / ∏ k ∈ range m, f k

{δ : Type u_3}
[AddCommGroup δ]
(f : ℕ → δ)
{m n : ℕ}
(h : m ≤ n)

∑ k ∈ Finset.Ico m n, f k = ∑ k ∈ Finset.range n, f k - ∑ k ∈ Finset.range m, f k


theorem Ioo_ae_eq_Icc' (ha : μ {a} = 0) (hb : μ {b} = 0) : Ioo a b =ᵐ[μ] Icc a b

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[PartialOrder α]
{a b : α}
(ha : μ {a} = 0)
(hb : μ {b} = 0)


theorem eq_zero_of_mulVec_eq_zero [DecidableEq m] {M : Matrix m m A} (hM : M.det ≠ 0) {v : m → A}
    (hv : M *ᵥ v = 0) : v = 0

{m : Type u_1}
{A : Type u_3}
[Fintype m]
[CommRing A]
[IsDomain A]
[DecidableEq m]
{M : Matrix m m A}
(hM : M.det ≠ 0)
{v : m → A}
(hv : M.mulVec v = 0)


theorem le_div_iff (hc : 0 < c) : a ≤ b / c ↔ a * c ≤ b

{α : Type u_2}
[LinearOrderedSemifield α]
{a b c : α}
(hc : 0 < c)


theorem iSup_lt_lift_of_isRegular {ι} {f : ι → Cardinal} {c} (hc : IsRegular c)
    (hι : Cardinal.lift.{v, u} #ι < c) : (∀ i, f i < c) → iSup.{max u v + 1, u + 1} f < c

{ι : Type u}
{f : ι → Cardinal.{max u v}}
{c : Cardinal.{max u v}}
(hc : c.IsRegular)
(hι : Cardinal.lift.{v, u} #ι < c)


/-- If `f` is an embedding, then `Nat.card α ≤ Nat.card β`. We must also assume
  `Nat.card β = 0 → Nat.card α = 0` since `Nat.card` is defined to be `0` for infinite types. -/
theorem card_le_of_embedding' (f : α ↪ β) (h : Nat.card β = 0 → Nat.card α = 0) :
    Nat.card α ≤ Nat.card β

{α : Type u_1}
{β : Type u_2}
(f : α ↪ β)
(h : Nat.card β = 0 → Nat.card α = 0)


@[to_additive]
theorem hasProd_ite_eq (b : β) [DecidablePred (· = b)] (a : α) :
    HasProd (fun b' ↦ if b' = b then a else 1) a

{α : Type u_1}
{β : Type u_2}
[CommMonoid α]
[TopologicalSpace α]
(b : β)
[DecidablePred fun x => x = b]
(a : α)

HasProd (fun b' => if b' = b then a else 1) a


theorem id_apply (p : A) : AlgHom.id R A p = p

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


theorem le_infDegree_add (f g : R[A]) :
    (f.infDegree D) ⊓ (g.infDegree D) ≤ (f + g).infDegree D

{R : Type u_1}
{A : Type u_3}
{T : Type u_4}
[Semiring R]
[AddZeroClass A]
[SemilatticeInf T]
[OrderTop T]
(D : A → T)
(f g : AddMonoidAlgebra R A)

AddMonoidAlgebra.infDegree D f ⊓ AddMonoidAlgebra.infDegree D g ≤ AddMonoidAlgebra.infDegree D (f + g)


@[deprecated getElem?_zipWith (since := "2024-06-12")]
theorem get?_zipWith {f : α → β → γ} :
    (List.zipWith f as bs).get? i = match as.get? i, bs.get? i with
      | some a, some b => some (f a b) | _, _ => none

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{as : List α}
{bs : List β}
{i : Nat}
{f : α → β → γ}

(List.zipWith f as bs).get? i =
  match as.get? i, bs.get? i with
  | some a, some b => some (f a b)
  | x, x_1 => none


@[to_additive] theorem inducing_mk : Inducing (@mk M)


lemma ofColex_ne_ofColex {s t : Colex α} : ofColex s ≠ ofColex t ↔ s ≠ t


theorem step_supports (M : Machine₀) {S : Set Λ} (ss : Supports M S) :
    ∀ {c c' : Cfg₀}, c' ∈ step M c → c.q ∈ S → c'.q ∈ S

{Γ : Type u_1}
[Inhabited Γ]
{Λ : Type u_2}
[Inhabited Λ]
(M : Turing.TM0.Machine Γ Λ)
{S : Set Λ}
(ss : Turing.TM0.Supports M S)
{c c' : Turing.TM0.Cfg Γ Λ}

c' ∈ Turing.TM0.step M c → c.q ∈ S → c'.q ∈ S


protected theorem linearIndependent : LinearIndependent R b

{ι : Type u_1}
{R : Type u_3}
{M : Type u_6}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(b : Basis ι R M)


/--
A presheaf of sets on a category which is `FinitaryExtensive` is a sheaf iff it preserves finite
products.
-/
theorem Presieve.isSheaf_iff_preservesFiniteProducts (F : Cᵒᵖ ⥤ Type w) :
    Presieve.IsSheaf (extensiveTopology C) F ↔
    Nonempty (PreservesFiniteProducts F)

(F : CategoryTheory.Functor Cᵒᵖ (Type w))

CategoryTheory.Presieve.IsSheaf (CategoryTheory.extensiveTopology C) F ↔
  Nonempty (CategoryTheory.Limits.PreservesFiniteProducts F)


lemma coe_variableChange_Δ' : (E.variableChange C).Δ' = C.u⁻¹ ^ 12 * E.Δ'

{R : Type u}
[CommRing R]
(E : EllipticCurve R)
(C : WeierstrassCurve.VariableChange R)


@[simp]
theorem toWeakDual_eq_iff (x' y' : Dual 𝕜 E) : toWeakDual x' = toWeakDual y' ↔ x' = y'

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

NormedSpace.Dual.toWeakDual x' = NormedSpace.Dual.toWeakDual y' ↔ x' = y'


@[measurability]
protected theorem aemeasurable [MeasurableSpace E] (f : Lp.simpleFunc E p μ) :
    AEMeasurable (toSimpleFunc f) μ

(f : ↥(MeasureTheory.Lp.simpleFunc E p μ))

AEMeasurable (↑(MeasureTheory.Lp.simpleFunc.toSimpleFunc f)) μ


/-- `rpow` version of `Finset.prod_pow`. -/
theorem _root_.Real.finset_prod_rpow
    {ι} (s : Finset ι) (f : ι → ℝ) (hs : ∀ i ∈ s, 0 ≤ f i) (r : ℝ) :
    (∏ i ∈ s, f i ^ r) = (∏ i ∈ s, f i) ^ r

{ι : Type u_1}
(s : Finset ι)
(f : ι → ℝ)
(hs : ∀ i ∈ s, 0 ≤ f i)
(r : ℝ)


theorem forIn_eq_data_forIn [Monad m]
    (as : Array α) (b : β) (f : α → β → m (ForInStep β)) :
    forIn as b f = forIn as.data b f

{m : Type u_1 → Type u_2}
{α : Type u_3}
{β : Type u_1}
[Monad m]
(as : Array α)
(f : α → β → m (ForInStep β))
{i : Nat}
{h : i ≤ as.size}
{b : β}
{j : Nat}

j + i = as.size → Array.forIn.loop as f i h b = forIn (List.drop j as.data) b f


@[simp] protected theorem one_mul : ∀ a : Int, 1 * a = a


/-- Given a distinguished triangle `T` such that `T.mor₃ = 0` and the datum of morphisms
`inr : T.obj₃ ⟶ T.obj₂` and `fst : T.obj₂ ⟶ T.obj₁` satisfying suitable relations, this
is the binary biproduct data expressing that `T.obj₂` identifies to the binary
biproduct of `T.obj₁` and `T.obj₃`.
See also `exists_iso_binaryBiproduct_of_distTriang`. -/
@[simps]
def binaryBiproductData (T : Triangle C) (hT : T ∈ distTriang C) (hT₀ : T.mor₃ = 0)
    (inr : T.obj₃ ⟶ T.obj₂) (inr_snd : inr ≫ T.mor₂ = 𝟙 _) (fst : T.obj₂ ⟶ T.obj₁)
    (total : fst ≫ T.mor₁ + T.mor₂ ≫ inr = 𝟙 T.obj₂) :
    BinaryBiproductData T.obj₁ T.obj₃

[∀ (n : ℤ), (CategoryTheory.shiftFunctor C n).Additive]

(T : CategoryTheory.Pretriangulated.Triangle C)

(hT : T ∈ CategoryTheory.Pretriangulated.distinguishedTriangles)

(CategoryTheory.Pretriangulated.binaryBiproductData T hT hT₀ inr inr_snd fst total).isBilimit =
  CategoryTheory.Limits.isBinaryBilimitOfTotal
    { pt := T.obj₂, fst := fst, snd := T.mor₂, inl := T.mor₁, inr := inr, inl_fst := ⋯, inl_snd := ⋯, inr_fst := ⋯,
      inr_snd := inr_snd }
    total


@[reassoc (attr := simp)]
lemma lift_φ₂ {A : C} (a : A ⟶ S.L₁.X₂) (b : A ⟶ S.L₀.X₃) (h : a ≫ S.L₁.g = b ≫ S.v₀₁.τ₃) :
    pullback.lift a b h ≫ S.φ₂ = a ≫ S.v₁₂.τ₂

(S : CategoryTheory.ShortComplex.SnakeInput C)

(h : CategoryTheory.CategoryStruct.comp a S.L₁.g = CategoryTheory.CategoryStruct.comp b S.v₀₁.τ₃)

CategoryTheory.CategoryStruct.comp (CategoryTheory.Limits.pullback.lift a b h) S.φ₂ =
  CategoryTheory.CategoryStruct.comp a S.v₁₂.τ₂


theorem dual_base_iff' : M✶.Base B ↔ M.Base (M.E \ B) ∧ B ⊆ M.E

{α : Type u_1}
{M : Matroid α}
{B : Set α}


@[to_additive existing, simp] lemma prod_neg_index [InvolutiveNeg ι] (s : Finset ι) (f : ι → α) :
    ∏ i ∈ -s, f i = ∏ i ∈ s, f (-i)

{α : Type u_2}
[CommMonoid α]
{ι : Type u_5}
[DecidableEq ι]
[InvolutiveNeg ι]
(s : Finset ι)
(f : ι → α)


@[to_additive] lemma mulEnergy_pos (hs : s.Nonempty) (ht : t.Nonempty) : 0 < Eₘ[s, t]

{α : Type u_1}
[DecidableEq α]
[Add α]
{s t : Finset α}
(hs : s.Nonempty)
(ht : t.Nonempty)


@[simp]
theorem fract_zspan_add (m : E) {v : E} (h : v ∈ span ℤ (Set.range b)) :
    fract b (v + m) = fract b m

(h : v ∈ Submodule.span ℤ (Set.range ⇑b))


theorem Monotone.ball {P : β → α → Prop} {s : Set β} (hP : ∀ x ∈ s, Monotone (P x)) :
    Monotone fun y => ∀ x ∈ s, P x y

(hP : ∀ (x : β), x ∈ s → Monotone (P x))

Monotone fun y => ∀ (x : β), x ∈ s → P x y


theorem val_add_one_of_lt {n : Nat} {i : Fin n.succ} (h : i < last _) : (i + 1).1 = i + 1

{n : Nat}
{i : Fin n.succ}
(h : i < Fin.last n)


theorem isClosed_aeStronglyMeasurable' [Fact (1 ≤ p)] [CompleteSpace F] (hm : m ≤ m0) :
    IsClosed {f : Lp F p μ | AEStronglyMeasurable' m f μ}

{α : Type u_1}
{F : Type u_3}
{p : ℝ≥0∞}
[NormedAddCommGroup F]
{m m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[Fact (1 ≤ p)]
[CompleteSpace F]
(hm : m ≤ m0)

IsClosed {f | MeasureTheory.AEStronglyMeasurable' m (↑↑f) μ}


@[mono]
theorem arctan_strictMono : StrictMono arctan


theorem image_inter_subset (f : α → β) (s t : Set α) : f '' (s ∩ t) ⊆ f '' s ∩ f '' t

{α : Type u_1}
{β : Type u_2}
(f : α → β)
(s t : Set α)


theorem inclusion_faithful {S T : Subgroupoid C} (h : S ≤ T) (s t : S.objs) :
    Function.Injective fun f : s ⟶ t => (inclusion h).map f

{C : Type u}
[CategoryTheory.Groupoid C]
{S T : CategoryTheory.Subgroupoid C}
(h : S ≤ T)
(s t : ↑S.objs)

Function.Injective fun f => (CategoryTheory.Subgroupoid.inclusion h).map f


@[simp]
protected theorem preimage_symm_preimage (e : M₁ ≃SL[σ₁₂] M₂) (s : Set M₁) :
    e ⁻¹' (e.symm ⁻¹' s) = s

{R₁ : Type u_1}
{R₂ : Type u_2}
[Semiring R₁]
[Semiring R₂]
{σ₁₂ : R₁ →+* R₂}
{σ₂₁ : R₂ →+* R₁}
[RingHomInvPair σ₁₂ σ₂₁]
[RingHomInvPair σ₂₁ σ₁₂]
{M₁ : Type u_4}
[TopologicalSpace M₁]
[AddCommMonoid M₁]
{M₂ : Type u_6}
[TopologicalSpace M₂]
[AddCommMonoid M₂]
[Module R₁ M₁]
[Module R₂ M₂]
(e : M₁ ≃SL[σ₁₂] M₂)
(s : Set M₁)


@[simp, norm_cast] lemma coe_zero : ((0 : ℚ≥0) : ℚ) = 0


/-- In a `RegularNormedAlgebra`, the map `Unitization.splitMul 𝕜 A` is injective.
We will use this to pull back the norm from `𝕜 × (A →L[𝕜] A)` to `Unitization 𝕜 A`. -/
theorem splitMul_injective : Function.Injective (splitMul 𝕜 A)

(𝕜 : Type u_1)
(A : Type u_2)
[NontriviallyNormedField 𝕜]
[NonUnitalNormedRing A]
[NormedSpace 𝕜 A]
[IsScalarTower 𝕜 A A]
[SMulCommClass 𝕜 A A]
[RegularNormedAlgebra 𝕜 A]

Function.Injective ⇑(Unitization.splitMul 𝕜 A)


@[simp]
theorem coe_mk (e : P ≃ᵃ[𝕜] P₂) (he : ∀ x, ‖e.linear x‖ = ‖x‖) : ⇑(mk e he) = e

{𝕜 : Type u_1}
{V : Type u_2}
{V₂ : Type u_5}
{P : Type u_10}
{P₂ : Type u_11}
[NormedField 𝕜]
[SeminormedAddCommGroup V]
[NormedSpace 𝕜 V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]
[SeminormedAddCommGroup V₂]
[NormedSpace 𝕜 V₂]
[PseudoMetricSpace P₂]
[NormedAddTorsor V₂ P₂]
(e : P ≃ᵃ[𝕜] P₂)
(he : ∀ (x : V), ‖e.linear x‖ = ‖x‖)

⇑{ toAffineEquiv := e, norm_map := he } = ⇑e


@[simp 1100, nolint simpNF]
theorem image_mem_map_iff (hf : Injective m) : m '' s ∈ map m f ↔ s ∈ f

{α : Type u}
{β : Type v}
{f : Filter α}
{m : α → β}
{s : Set α}
(hf : Function.Injective m)


theorem zero_eq_one_iff {I : Ideal R} : (0 : R ⧸ I) = 1 ↔ I = ⊤


theorem negSucc_eq (n : Nat) : -[n+1] = -((n : Int) + 1)


/-- Extracts the erased value, if it is a proof. -/
theorem out_proof {p : Prop} (a : Erased p) : p


@[deprecated mem_eraseIdx_iff_getElem (since := "2024-06-12")]
theorem mem_eraseIdx_iff_get {x : α} {l} {k} :
    x ∈ eraseIdx l k ↔ ∃ i : Fin l.length, ↑i ≠ k ∧ l.get i = x

{α : Type u}
{x : α}
{l : List α}
{k : Nat}

x ∈ l.eraseIdx k ↔ ∃ i, ↑i ≠ k ∧ l.get i = x


theorem x_mul_y_le_y_mul_x {a₁ : Solution₁ d} (h : IsFundamental a₁) {a : Solution₁ d}
    (hax : 1 < a.x) (hay : 0 < a.y) : a.x * a₁.y ≤ a.y * a₁.x

{d : ℤ}
{a₁ : Pell.Solution₁ d}
(h : Pell.IsFundamental a₁)
{a : Pell.Solution₁ d}
(hax : 1 < a.x)
(hay : 0 < a.y)


@[to_additive (attr := simp)]
theorem zpowers_one_eq_bot : Subgroup.zpowers (1 : G) = ⊥


/-- If `p` is a prime factor of `b` then `p` is also a prime factor of `a * b` for any `a > 0` -/
theorem mem_primeFactorsList_mul_right {p a b : ℕ} (hpb : p ∈ b.primeFactorsList) (ha : a ≠ 0) :
    p ∈ (a * b).primeFactorsList


lemma coprime_factorizationLCMLeft_factorizationLCMRight :
    (factorizationLCMLeft a b).Coprime (factorizationLCMRight a b)

(a.factorizationLCMLeft b).Coprime (a.factorizationLCMRight b)


theorem eq_zero_of_src {X Y : C} (o : IsZero X) (f : X ⟶ Y) : f = 0


@[simp, norm_cast] lemma coe_one : ((1 : ℝ≥0) : ℝ) = 1


theorem I_mul_I : (I : K) = 0 ∨ (I : K) * I = -1


lemma inf_iSup_eq (a : α) (f : ι → α) : (a ⊓ ⨆ i, f i) = ⨆ i, a ⊓ f i

{α : Type u}
{ι : Sort w}
(minAx : Order.Frame.MinimalAxioms α)
(a : α)
(f : ι → α)


theorem constantCoeff_wittStructureInt (Φ : MvPolynomial idx ℤ) (h : constantCoeff Φ = 0) (n : ℕ) :
    constantCoeff (wittStructureInt p Φ n) = 0

(p : ℕ)
{idx : Type u_2}
[hp : Fact (Nat.Prime p)]
(Φ : MvPolynomial idx ℤ)
(h : MvPolynomial.constantCoeff Φ = 0)
(n : ℕ)

MvPolynomial.constantCoeff (wittStructureInt p Φ n) = 0


/-- A `Matroid α` is a ground set `E` of type `Set α`, and a nonempty collection of its subsets
  satisfying the exchange property and the maximal subset property. Each such set is called a
  `Base` of `M`. An `Indep`endent set is just a set contained in a base, but we include this
  predicate as a structure field for better definitional properties.

  In most cases, using this definition directly is not the best way to construct a matroid,
  since it requires specifying both the bases and independent sets. If the bases are known,
  use `Matroid.ofBase` or a variant. If just the independent sets are known,
  define an `IndepMatroid`, and then use `IndepMatroid.matroid`.
  -/
@[ext] structure Matroid (α : Type _) where
  /-- `M` has a ground set `E`. -/
  (E : Set α)
  /-- `M` has a predicate `Base` definining its bases. -/
  (Base : Set α → Prop)
  /-- `M` has a predicate `Indep` defining its independent sets. -/
  (Indep : Set α → Prop)
  /-- The `Indep`endent sets are those contained in `Base`s. -/
  (indep_iff' : ∀ ⦃I⦄, Indep I ↔ ∃ B, Base B ∧ I ⊆ B)
  /-- There is at least one `Base`. -/
  (exists_base : ∃ B, Base B)
  /-- For any bases `B`, `B'` and `e ∈ B \ B'`, there is some `f ∈ B' \ B` for which `B-e+f`
    is a base. -/
  (base_exchange : Matroid.ExchangeProperty Base)
  /-- Every independent subset `I` of a set `X` for is contained in a maximal independent
    subset of `X`. -/
  (maximality : ∀ X, X ⊆ E → Matroid.ExistsMaximalSubsetProperty Indep X)
  /-- Every base is contained in the ground set. -/
  (subset_ground : ∀ B, Base B → B ⊆ E)


@[simp]
theorem sup_unique {ι} [Unique ι] (f : ι → Ordinal) : sup f = f default

{ι : Type u_4}
[Unique ι]
(f : ι → Ordinal.{max u_5 u_4})


@[simp] theorem back_eq_back? [Inhabited α] (a : Array α) : a.back = a.back?.getD default

{α : Type u_1}
[Inhabited α]
(a : Array α)


theorem range_comp_of_range_eq_top [RingHomSurjective τ₁₂] [RingHomSurjective τ₂₃]
    [RingHomSurjective τ₁₃] {f : M →ₛₗ[τ₁₂] M₂} (g : M₂ →ₛₗ[τ₂₃] M₃) (hf : range f = ⊤) :
    range (g.comp f : M →ₛₗ[τ₁₃] M₃) = range g

{R : Type u_1}
{R₂ : Type u_2}
{R₃ : Type u_3}
{M : Type u_6}
{M₂ : Type u_7}
{M₃ : Type u_8}
[Semiring R]
[Semiring R₂]
[Semiring R₃]
[AddCommMonoid M]
[AddCommMonoid M₂]
[AddCommMonoid M₃]
[Module R M]
[Module R₂ M₂]
[Module R₃ M₃]
{τ₁₂ : R →+* R₂}
{τ₂₃ : R₂ →+* R₃}
{τ₁₃ : R →+* R₃}
[RingHomCompTriple τ₁₂ τ₂₃ τ₁₃]
[RingHomSurjective τ₁₂]
[RingHomSurjective τ₂₃]
[RingHomSurjective τ₁₃]
{f : M →ₛₗ[τ₁₂] M₂}
(g : M₂ →ₛₗ[τ₂₃] M₃)
(hf : LinearMap.range f = ⊤)

LinearMap.range (g.comp f) = LinearMap.range g


theorem Measure.restrict_singleton' {a : α} : μ.restrict {a} = 0

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


/-- An equivalence of bounded formulas given by an equivalence of terms and an equivalence of
relations. -/
@[simps]
def mapTermRelEquiv (ft : ∀ n, L.Term (α ⊕ (Fin n)) ≃ L'.Term (β ⊕ (Fin n)))
    (fr : ∀ n, L.Relations n ≃ L'.Relations n) {n} : L.BoundedFormula α n ≃ L'.BoundedFormula β n

(ft : (n : ℕ) → L.Term (α ⊕ Fin n) ≃ L'.Term (β ⊕ Fin n))

(fr : (n : ℕ) → L.Relations n ≃ L'.Relations n)

∀ (a : L'.BoundedFormula β n),
  (FirstOrder.Language.BoundedFormula.mapTermRelEquiv ft fr).symm a =
    FirstOrder.Language.BoundedFormula.mapTermRel (fun n => ⇑(ft n).symm) (fun n => ⇑(fr n).symm) (fun x => id) a


theorem smoothOn_continuousLinearMapCoordChange
    [SmoothVectorBundle F₁ E₁ IB] [SmoothVectorBundle F₂ E₂ IB] [MemTrivializationAtlas e₁]
    [MemTrivializationAtlas e₁'] [MemTrivializationAtlas e₂] [MemTrivializationAtlas e₂'] :
    SmoothOn IB 𝓘(𝕜, (F₁ →L[𝕜] F₂) →L[𝕜] F₁ →L[𝕜] F₂)
      (continuousLinearMapCoordChange (RingHom.id 𝕜) e₁ e₁' e₂ e₂')
      (e₁.baseSet ∩ e₂.baseSet ∩ (e₁'.baseSet ∩ e₂'.baseSet))

[TopologicalSpace (Bundle.TotalSpace F₁ E₁)]

[TopologicalSpace (Bundle.TotalSpace F₂ E₂)]

{e₁ e₁' : Trivialization F₁ Bundle.TotalSpace.proj}

{e₂ e₂' : Trivialization F₂ Bundle.TotalSpace.proj}

SmoothOn IB 𝓘(𝕜, (F₁ →L[𝕜] F₂) →L[𝕜] F₁ →L[𝕜] F₂)
  (Pretrivialization.continuousLinearMapCoordChange (RingHom.id 𝕜) e₁ e₁' e₂ e₂')
  (e₁.baseSet ∩ e₂.baseSet ∩ (e₁'.baseSet ∩ e₂'.baseSet))


/--
The natural transformation from identity functor on `R`-module to the composition of extension and
restriction of scalars.
-/
@[simps]
def unit : 𝟭 (ModuleCat R) ⟶ extendScalars f ⋙ restrictScalars.{max v u₂,u₁,u₂} f

{R : Type u₁}
{S : Type u₂}
[CommRing R]
[CommRing S]
(f : R →+* S)

∀ (x : ModuleCat R), (ModuleCat.ExtendRestrictScalarsAdj.unit f).app x = ModuleCat.ExtendRestrictScalarsAdj.Unit.map f


theorem Infinite.exists_superset_ncard_eq {s t : Set α} (ht : t.Infinite) (hst : s ⊆ t)
    (hs : s.Finite) {k : ℕ} (hsk : s.ncard ≤ k) : ∃ s', s ⊆ s' ∧ s' ⊆ t ∧ s'.ncard = k

{α : Type u_1}
{s t : Set α}
(ht : t.Infinite)
(hst : s ⊆ t)
(hs : s.Finite)
{k : ℕ}
(hsk : s.ncard ≤ k)


theorem map_mk' (x) (y : M) : map Q g hy (mk' S x y) = mk' Q (g x) ⟨g y, hy y.2⟩

{R : Type u_1}
[CommSemiring R]
{M : Submonoid R}
{S : Type u_2}
[CommSemiring S]
[Algebra R S]
{P : Type u_3}
[CommSemiring P]
[IsLocalization M S]
{g : R →+* P}
{T : Submonoid P}
{Q : Type u_4}
[CommSemiring Q]
(hy : M ≤ Submonoid.comap g T)
[Algebra P Q]
[IsLocalization T Q]
(x : R)
(y : ↥M)

(IsLocalization.map Q g hy) (IsLocalization.mk' S x y) = IsLocalization.mk' Q (g x) ⟨g ↑y, ⋯⟩


@[simp]
theorem algebraMap_X : algebraMap K[X] (RatFunc K) Polynomial.X = X

(algebraMap (Polynomial K) (RatFunc K)) Polynomial.X = RatFunc.X


theorem foldr (f) (init : α) : ∀ {s}, Valid s → s.foldr f init = s.toString.1.foldr f init

{α : Type u_1}
(f : Char → α → α)
(init : α)
{s : Substring}

s.Valid → Substring.foldr f init s = List.foldr f init s.toString.data


lemma map_apply_of_aemeasurable (ν : ProbabilityMeasure Ω) {f : Ω → Ω'}
    (f_aemble : AEMeasurable f ν) {A : Set Ω'} (A_mble : MeasurableSet A) :
    (ν.map f_aemble) A = ν (f ⁻¹' A)

(ν : MeasureTheory.ProbabilityMeasure Ω)


lemma coeff_natTrailingDegree_ne_zero : coeff p p.natTrailingDegree ≠ 0 ↔ p ≠ 0


@[simp] lemma isRegular_X_pow (k : ℕ) : IsRegular (X n ^ k : MvPolynomial σ R)

{R : Type u}
{σ : Type u_1}
{n : σ}
[CommSemiring R]
(k : ℕ)


theorem revzip_powersetAux_perm {l₁ l₂ : List α} (p : l₁ ~ l₂) :
    revzip (powersetAux l₁) ~ revzip (powersetAux l₂)

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

(Multiset.powersetAux l₁).revzip.Perm (Multiset.powersetAux l₂).revzip


lemma eq_zero_of_character_apply {a : A} (h : ∀ c : CharacterModule A, c a = 0) : a = 0

(h : ∀ (c : CharacterModule A), c a = 0)


/-- An iso `α ≃* β` can equivalently be viewed as an iso `αᵐᵒᵖ ≃* βᵐᵒᵖ`. -/
@[to_additive (attr := simps)
  "An iso `α ≃+ β` can equivalently be viewed as an iso `αᵃᵒᵖ ≃+ βᵃᵒᵖ`."]
def MulEquiv.op {α β} [Mul α] [Mul β] : α ≃* β ≃ (αᵐᵒᵖ ≃* βᵐᵒᵖ)

{α : Type u_2}
{β : Type u_3}
[Mul α]
[Mul β]
(f : αᵐᵒᵖ ≃* βᵐᵒᵖ)

∀ (a : β), (MulEquiv.op.symm f).symm a = (MulOpposite.unop ∘ ⇑f.symm ∘ MulOpposite.op) a


@[to_additive]
theorem map_comap_eq_self {f : F} {S : Submonoid N} (h : S ≤ MonoidHom.mrange f) :
    (S.comap f).map f = S

{M : Type u_1}
{N : Type u_2}
[MulOneClass M]
[MulOneClass N]
{F : Type u_5}
[FunLike F M N]
[mc : MonoidHomClass F M N]
{f : F}
{S : Submonoid N}
(h : S ≤ MonoidHom.mrange f)

Submonoid.map f (Submonoid.comap f S) = S


/-- Note that `StarModule` is quite a strong requirement; as such we also provide the following
variants which this lemma would not apply to:
* `Matrix.conjTranspose_smul_non_comm`
* `Matrix.conjTranspose_nsmul`
* `Matrix.conjTranspose_zsmul`
* `Matrix.conjTranspose_natCast_smul`
* `Matrix.conjTranspose_intCast_smul`
* `Matrix.conjTranspose_inv_natCast_smul`
* `Matrix.conjTranspose_inv_intCast_smul`
* `Matrix.conjTranspose_rat_smul`
* `Matrix.conjTranspose_ratCast_smul`
-/
@[simp]
theorem conjTranspose_smul [Star R] [Star α] [SMul R α] [StarModule R α] (c : R)
    (M : Matrix m n α) : (c • M)ᴴ = star c • Mᴴ

{m : Type u_2}
{n : Type u_3}
{R : Type u_7}
{α : Type v}
[Star R]
[Star α]
[SMul R α]
[StarModule R α]
(c : R)
(M : Matrix m n α)


protected theorem isCompact (s : PositiveCompacts α) : IsCompact (s : Set α)

(s : TopologicalSpace.PositiveCompacts α)


/-- The equivalence of categories
`(Φ.LeftResolution X₂)ᵒᵖ ≌ Φ.op.RightResolution (Opposite.op X₂)`. -/
@[simps]
def LeftResolution.opEquivalence (X₂ : C₂) [W₁.IsMultiplicative] :
    (Φ.LeftResolution X₂)ᵒᵖ ≌ Φ.op.RightResolution (Opposite.op X₂)

{W₁ : CategoryTheory.MorphismProperty C₁}

{W₂ : CategoryTheory.MorphismProperty C₂}

(Φ : CategoryTheory.LocalizerMorphism W₁ W₂)

(CategoryTheory.LocalizerMorphism.LeftResolution.opEquivalence Φ X₂).unitIso =
  CategoryTheory.Iso.refl (CategoryTheory.Functor.id (Φ.LeftResolution X₂)ᵒᵖ)


/-- Two n-simplices among cospherical points in n-space have the same
circumcenter. -/
theorem circumcenter_eq_of_cospherical {ps : Set P} {n : ℕ} [FiniteDimensional ℝ V]
    (hd : finrank ℝ V = n) (hc : Cospherical ps) {sx₁ sx₂ : Simplex ℝ P n}
    (hsx₁ : Set.range sx₁.points ⊆ ps) (hsx₂ : Set.range sx₂.points ⊆ ps) :
    sx₁.circumcenter = sx₂.circumcenter

(hd : FiniteDimensional.finrank ℝ V = n)


@[simp]
theorem nonempty_iUnion : (⋃ i, s i).Nonempty ↔ ∃ i, (s i).Nonempty

{α : Type u_1}
{ι : Sort u_4}
{s : ι → Set α}


@[simp]
theorem sup_mem_iff : x ⊔ y ∈ I ↔ x ∈ I ∧ y ∈ I

{P : Type u_1}
[SemilatticeSup P]
{x y : P}
{I : Order.Ideal P}


theorem actRight_one' : (_ ◁ T.one) ≫ actRight P Q = (ρ_ _).hom

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

Bimod.TensorBimod.X P Q ◁ T.one ≫ Bimod.TensorBimod.actRight P Q = (ρ_ (Bimod.TensorBimod.X P Q)).hom


/-- # mem -/

theorem mem_data {a : α} {l : Array α} : a ∈ l.data ↔ a ∈ l


lemma IsUpperSet.supClosed (hs : IsUpperSet s) : SupClosed s

{α : Type u_2}
[SemilatticeSup α]
{s : Set α}
(hs : IsUpperSet s)


@[mono, gcongr]
theorem compactCovering_subset ⦃m n : ℕ⦄ (h : m ≤ n) : compactCovering X m ⊆ compactCovering X n

(X : Type u_1)
[TopologicalSpace X]
[SigmaCompactSpace X]
⦃m n : ℕ⦄
(h : m ≤ n)


@[simp]
theorem sumAssoc_apply_inr (c) : sumAssoc α β γ (inr c) = inr (inr c)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
(c : γ)

(Equiv.sumAssoc α β γ) (Sum.inr c) = Sum.inr (Sum.inr c)


@[simp]
theorem mk'_eq_coe (l : Filter α) (f : α → β) :
    @Quotient.mk' _ (germSetoid _ _) f = (f : Germ l β)

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


theorem conformalAt {f : X → Y} (h : Conformal f) (x : X) : ConformalAt f x

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


/-- There exists a non-null vector with respect to any symmetric, nonzero bilinear form `B`
on a module `M` over a ring `R` with invertible `2`, i.e. there exists some
`x : M` such that `B x x ≠ 0`. -/
theorem exists_bilinForm_self_ne_zero [htwo : Invertible (2 : R)] {B : BilinForm R M}
    (hB₁ : B ≠ 0) (hB₂ : B.IsSymm) : ∃ x, ¬B.IsOrtho x x

{R : Type u_3}
{M : Type u_4}
[CommRing R]
[AddCommGroup M]
[Module R M]
[htwo : Invertible 2]
{B : LinearMap.BilinForm R M}
(hB₁ : B ≠ 0)
(hB₂ : LinearMap.IsSymm B)


theorem val_eq_one_iff (v : Valuation K Γ₀) {x : K} : v x = 1 ↔ v x⁻¹ = 1

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


@[to_additive]
theorem map_eq_map_iff {f : G →* N} {H K : Subgroup G} :
    H.map f = K.map f ↔ H ⊔ f.ker = K ⊔ f.ker

{G : Type u_1}
[Group G]
{N : Type u_5}
[Group N]
{f : G →* N}
{H K : Subgroup G}

Subgroup.map f H = Subgroup.map f K ↔ H ⊔ f.ker = K ⊔ f.ker


theorem ratio_le_opNorm (x : V₁) : ‖f x‖ / ‖x‖ ≤ ‖f‖

{V₁ : Type u_2}
{V₂ : Type u_3}
[SeminormedAddCommGroup V₁]
[SeminormedAddCommGroup V₂]
(f : NormedAddGroupHom V₁ V₂)
(x : V₁)

‖f x‖ / ‖x‖ ≤ ‖f‖


@[reassoc]
theorem comp_P_eq_self {Y : C} {n q : ℕ} {φ : Y ⟶ X _[n + 1]} (v : HigherFacesVanish q φ) :
    φ ≫ (P q).f (n + 1) = φ

(v : AlgebraicTopology.DoldKan.HigherFacesVanish q φ)

φ ≫ (AlgebraicTopology.DoldKan.P q).f (n + 1) = φ


theorem map_ne {x y : F} (h : x ≠ y) : f₁ x ≠ f₁ y

{R : Type u_1}
{R₂ : Type u_2}
{E₂ : Type u_6}
{F : Type u_9}
[Semiring R]
[Semiring R₂]
{σ₁₂ : R →+* R₂}
[SeminormedAddCommGroup E₂]
[Module R₂ E₂]
[NormedAddCommGroup F]
[Module R F]
(f₁ : F →ₛₗᵢ[σ₁₂] E₂)
{x y : F}
(h : x ≠ y)


/-- Monoidal functors commute with left tensoring up to isomorphism -/
@[simps!]
noncomputable def commTensorLeft (X : C) :
    F.toFunctor ⋙ tensorLeft (F.toFunctor.obj X) ≅ tensorLeft X ⋙ F.toFunctor

(F : CategoryTheory.MonoidalFunctor C D)

∀ (X_1 : C), (F.commTensorLeft X).inv.app X_1 = (F.μIso X X_1).inv


theorem dvd_emod_sub_self {x : Int} {m : Nat} : (m : Int) ∣ x % m - x


@[to_additive]
theorem subset_lowerBounds_mul (s t : Set M) :
    lowerBounds s * lowerBounds t ⊆ lowerBounds (s * t)

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

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


@[simp, norm_cast]
theorem round_cast (x : ℚ) : round (x : α) = round x

{α : Type u_1}
[LinearOrderedField α]
[FloorRing α]
(x : ℚ)


theorem Function.Injective.embedding_induced [t : TopologicalSpace Y] (hf : Injective f) :
    @_root_.Embedding X Y (t.induced f) t f

{X : Type u_1}
{Y : Type u_2}
{f : X → Y}
[t : TopologicalSpace Y]
(hf : Function.Injective f)


theorem isConnected_setOf_sOppSide {s : AffineSubspace ℝ P} {x : P} (hx : x ∉ s)
    (h : (s : Set P).Nonempty) : IsConnected { y | s.SOppSide x y }

{V : Type u_2}
{P : Type u_4}
[SeminormedAddCommGroup V]
[NormedSpace ℝ V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]
{s : AffineSubspace ℝ P}
{x : P}
(hx : x ∉ s)
(h : (↑s).Nonempty)


lemma rTensor_apply (t : MvPolynomial σ S ⊗[R] N) (d : σ →₀ ℕ) :
    rTensor t d = ((lcoeff S d).restrictScalars R).rTensor N t

(t : TensorProduct R (MvPolynomial σ S) N)

(d : σ →₀ ℕ)

(MvPolynomial.rTensor t) d = (LinearMap.rTensor N (↑R (MvPolynomial.lcoeff S d))) t


@[simp]
theorem not_isMin_iff : ¬IsMin a ↔ ∃ b, b < a


theorem nhdsWithin_restrict {a : α} (s : Set α) {t : Set α} (h₀ : a ∈ t) (h₁ : IsOpen t) :
    𝓝[s] a = 𝓝[s ∩ t] a

{α : Type u_1}
[TopologicalSpace α]
{a : α}
(s : Set α)
{t : Set α}
(h₀ : a ∈ t)
(h₁ : IsOpen t)


/-- Composition of monoid morphisms (`MonoidHom.comp`) as a monoid morphism.

Note that unlike `MonoidHom.comp_hom'` this requires commutativity of `N`. -/
@[to_additive (attr := simps)
      "Composition of additive monoid morphisms (`AddMonoidHom.comp`) as an additive
      monoid morphism.

      Note that unlike `AddMonoidHom.comp_hom'` this requires commutativity of `N`.

      This also exists in a `LinearMap` version, `LinearMap.llcomp`."]
def compHom [MulOneClass M] [CommMonoid N] [CommMonoid P] :
    (N →* P) →* (M →* N) →* M →* P

{M : Type uM}
{N : Type uN}
{P : Type uP}
[MulOneClass M]
[CommMonoid N]
[CommMonoid P]
(g : N →* P)
(hmn : M →* N)


theorem add_pow_char_of_commute [Semiring R] {p : ℕ} [hp : Fact p.Prime] [CharP R p] (x y : R)
    (h : Commute x y) : (x + y) ^ p = x ^ p + y ^ p

(R : Type u_1)
[Semiring R]
{p : ℕ}
[hp : Fact (Nat.Prime p)]
[CharP R p]
(x y : R)
(h : Commute x y)


@[simp]
theorem map_think (f : α → β) (s) : map f (think s) = think (map f s)

{α : Type u}
{β : Type v}
(f : α → β)
(s : Stream'.WSeq α)

Stream'.WSeq.map f s.think = (Stream'.WSeq.map f s).think


@[to_additive (attr := ext)]
theorem ext : (∀ x, p x = q x) → p = q

{E : Type u_4}
[AddGroup E]
{p q : AddGroupSeminorm E}


/-- An integral domain is a Dedekind domain if and only if it is
Noetherian, has dimension ≤ 1, and is integrally closed in a given fraction field.
In particular, this definition does not depend on the choice of this fraction field. -/
theorem isDedekindRing_iff (K : Type*) [CommRing K] [Algebra A K] [IsFractionRing A K] :
    IsDedekindRing A ↔
      IsNoetherianRing A ∧ DimensionLEOne A ∧
        ∀ {x : K}, IsIntegral A x → ∃ y, algebraMap A K y = x

(A : Type u_2)
[CommRing A]
(K : Type u_4)
[CommRing K]
[Algebra A K]
[IsFractionRing A K]

IsDedekindRing A ↔ IsNoetherianRing A ∧ Ring.DimensionLEOne A ∧ ∀ {x : K}, IsIntegral A x → ∃ y, (algebraMap A K) y = x


theorem left_inv : Function.LeftInverse (invFun p) (toFun p)

{ι : Type u_1}
{R : Type u_2}
[CommRing R]
{Ms : ι → Type u_3}
[(i : ι) → AddCommGroup (Ms i)]
[(i : ι) → Module R (Ms i)]
[Fintype ι]
[DecidableEq ι]
(p : (i : ι) → Submodule R (Ms i))

Function.LeftInverse (Submodule.quotientPi_aux.invFun p) (Submodule.quotientPi_aux.toFun p)


theorem isRelPrime_mul_unit_left : IsRelPrime (x * y) (x * z) ↔ IsRelPrime y z

{α : Type u_1}
[CommMonoid α]
{x y z : α}
(hu : IsUnit x)


@[simp]
theorem swap_eq_refl_iff {x y : α} : swap x y = Equiv.refl _ ↔ x = y

{α : Sort u_1}
[DecidableEq α]
{x y : α}


@[simp]
theorem natCoe_one [AddMonoidWithOne R] :
    ((1 : ArithmeticFunction ℕ) : ArithmeticFunction R) = 1


@[to_additive]
theorem Nonempty.div : s.Nonempty → t.Nonempty → (s / t).Nonempty

{α : Type u_2}
[DecidableEq α]
[Sub α]
{s t : Finset α}

s.Nonempty → t.Nonempty → (s - t).Nonempty


theorem IsPartition.pairwiseDisjoint {c : Set (Set α)} (hc : IsPartition c) :
    c.PairwiseDisjoint id

{α : Type u_1}
{c : Set (Set α)}
(hc : Setoid.IsPartition c)


@[simp]
theorem map_map (g : β →o γ) (f : α →o β) (a : NonemptyInterval α) :
    (a.map f).map g = a.map (g.comp f)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[Preorder α]
[Preorder β]
[Preorder γ]
(g : β →o γ)
(f : α →o β)
(a : NonemptyInterval α)

NonemptyInterval.map g (NonemptyInterval.map f a) = NonemptyInterval.map (g.comp f) a


@[simp, norm_cast]
theorem natCast_imK (n : ℕ) : (n : ℍ[R]).imK = 0


theorem discreteTopology_iff_forall_isClosed [TopologicalSpace α] :
    DiscreteTopology α ↔ ∀ s : Set α, IsClosed s

DiscreteTopology α ↔ ∀ (s : Set α), IsClosed s


lemma shortExact_iff_op : S.ShortExact ↔ S.op.ShortExact


@[ext]
theorem ext : ∀ {d₁ d₂ : DynkinSystem α}, (∀ s : Set α, d₁.Has s ↔ d₂.Has s) → d₁ = d₂

{d₁ d₂ : MeasurableSpace.DynkinSystem α}

(∀ (s : Set α), d₁.Has s ↔ d₂.Has s) → d₁ = d₂


@[simp]
theorem equivFunOnFinite_single [DecidableEq α] [Finite α] (x : α) (m : M) :
    Finsupp.equivFunOnFinite (Finsupp.single x m) = Pi.single x m

{α : Type u_1}
{M : Type u_5}
[Zero M]
[DecidableEq α]
[Finite α]
(x : α)
(m : M)


theorem not_inseparable_coe_infty {x : X} : ¬Inseparable (x : OnePoint X) ∞

{X : Type u_1}
[TopologicalSpace X]
{x : X}


/-- Let `X` be a compact topological space, `α` a uniform space, and `F : ι → (X → α)` an
equicontinuous family. Then, the uniform structures of uniform convergence and pointwise
convergence induce the same uniform structure on `ι`.

In other words, pointwise convergence and uniform convergence coincide on an equicontinuous
subset of `X → α`.

This is a version of `Equicontinuous.comap_uniformFun_eq` stated in terms of `UniformInducing`
for convenuence. -/
lemma Equicontinuous.uniformInducing_uniformFun_iff_pi [UniformSpace ι] [CompactSpace X]
    (F_eqcont : Equicontinuous F) :
    UniformInducing (UniformFun.ofFun ∘ F) ↔ UniformInducing F

{ι : Type u_1}
{X : Type u_2}
{α : Type u_4}
[TopologicalSpace X]
[UniformSpace α]
{F : ι → X → α}
[UniformSpace ι]
[CompactSpace X]
(F_eqcont : Equicontinuous F)

UniformInducing (⇑UniformFun.ofFun ∘ F) ↔ UniformInducing F


theorem Iic_iInf (f : ι → α) : Iic (⨅ i, f i) = ⋂ i, Iic (f i)

{α : Type u_1}
{ι : Sort u_4}
[CompleteLattice α]
(f : ι → α)


@[to_additive sum_range_one]
theorem prod_range_one (f : ℕ → β) : ∏ k ∈ range 1, f k = f 0

{β : Type u_4}
[AddCommMonoid β]
(f : ℕ → β)


/-- From a functor `F : J ⥤ C`, given an initial object of `J`, construct a cocone for `J`,
provided that the morphisms in the diagram are isomorphisms.
In `colimitOfDiagramInitial` we show it is a colimit cocone. -/
@[simps]
def coconeOfDiagramInitial {X : J} (hX : IsInitial X) (F : J ⥤ C)
    [∀ (i j : J) (f : i ⟶ j), IsIso (F.map f)] : Cocone F

(hX : CategoryTheory.Limits.IsInitial X)

[∀ (i j : J) (f : i ⟶ j), CategoryTheory.IsIso (F.map f)]

(CategoryTheory.Limits.coconeOfDiagramInitial hX F).pt = F.obj X


@[ext]
theorem ConeMorphism.ext {c c' : Cone F} (f g : c ⟶ c') (w : f.hom = g.hom) : f = g

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{F : J ⥤ C}
{c c' : CategoryTheory.Limits.Cone F}
(f g : c ⟶ c')
(w : f.hom = g.hom)


@[to_additive]
theorem snd_prod : (∏ c ∈ s, f c).2 = ∏ c ∈ s, (f c).2

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[CommMonoid α]
[CommMonoid β]
{s : Finset γ}
{f : γ → α × β}


@[simp] theorem empty_eq : (∅ : AssocList α β) = nil


@[to_additive MeasureTheory.IsAddFundamentalDomain.measure_addFundamentalInterior]
theorem measure_fundamentalInterior : μ (fundamentalInterior G s) = μ s

(hs : MeasureTheory.IsFundamentalDomain G s μ)

μ (MeasureTheory.fundamentalInterior G s) = μ s


theorem derivWithin_id (hxs : UniqueDiffWithinAt 𝕜 s x) : derivWithin id s x = 1

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
(x : 𝕜)
(s : Set 𝕜)
(hxs : UniqueDiffWithinAt 𝕜 s x)


/-- Vitali covering theorem, closed balls version: given a family `t` of closed balls, one can
extract a disjoint subfamily `u ⊆ t` so that all balls in `t` are covered by the τ-times
dilations of balls in `u`, for some `τ > 3`. -/
theorem exists_disjoint_subfamily_covering_enlargment_closedBall [MetricSpace α] (t : Set ι)
    (x : ι → α) (r : ι → ℝ) (R : ℝ) (hr : ∀ a ∈ t, r a ≤ R) (τ : ℝ) (hτ : 3 < τ) :
    ∃ u ⊆ t,
      (u.PairwiseDisjoint fun a => closedBall (x a) (r a)) ∧
        ∀ a ∈ t, ∃ b ∈ u, closedBall (x a) (r a) ⊆ closedBall (x b) (τ * r b)

{α : Type u_1}
{ι : Type u_2}
[MetricSpace α]
(t : Set ι)
(x : ι → α)
(r : ι → ℝ)
(R : ℝ)
(hr : ∀ a ∈ t, r a ≤ R)
(τ : ℝ)
(hτ : 3 < τ)

∃ u ⊆ t,
  (u.PairwiseDisjoint fun a => Metric.closedBall (x a) (r a)) ∧
    ∀ a ∈ t, ∃ b ∈ u, Metric.closedBall (x a) (r a) ⊆ Metric.closedBall (x b) (τ * r b)


@[to_additive]
theorem Filter.EventuallyEq.of_mulIndicator_const [One β] {l : Filter α} {c : β} (hc : c ≠ 1)
    {s t : Set α} (h : s.mulIndicator (fun _ ↦ c) =ᶠ[l] t.mulIndicator fun _ ↦ c) : s =ᶠ[l] t

(h : (s.mulIndicator fun x => c) =ᶠ[l] t.mulIndicator fun x => c)


theorem UpperSemicontinuous.upperSemicontinuousWithinAt (h : UpperSemicontinuous f) (s : Set α)
    (x : α) : UpperSemicontinuousWithinAt f s x

{α : Type u_1}
[TopologicalSpace α]
{β : Type u_2}
[Preorder β]
{f : α → β}
(h : UpperSemicontinuous f)
(s : Set α)
(x : α)


theorem map_piecewise_add [DecidableEq ι] (m m' : ι → M) (t : Finset ι) :
    f (t.piecewise (m + m') m') = ∑ s ∈ t.powerset, f (s.piecewise m m')

{R : Type u_1}
{M : Type u_2}
{N : Type u_4}
{ι : Type u_6}
[Semiring R]
[AddCommMonoid M]
[Module R M]
[TopologicalSpace M]
[AddCommMonoid N]
[Module R N]
[TopologicalSpace N]
(f : M [⋀^ι]→L[R] N)
[DecidableEq ι]
(m m' : ι → M)
(t : Finset ι)


theorem preservesEpimorphisms.of_iso {F G : C ⥤ D} [PreservesEpimorphisms F] (α : F ≅ G) :
    PreservesEpimorphisms G

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


/-- The shift functor by `n` on `CochainComplex C ℤ` identifies to the identity
functor when `n = 0`. -/
@[simps!]
def shiftFunctorZero' (n : ℤ) (h : n = 0) :
    shiftFunctor C n ≅ 𝟭 _

(C : Type u)
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Preadditive C]
(n : ℤ)
(h : n = 0)
(X : CochainComplex C ℤ)
(i : ℤ)

((CochainComplex.shiftFunctorZero' C n h).hom.app X).f i = (HomologicalComplex.XIsoOfEq X ⋯).hom


theorem IsMaxFilter.comp_tendsto {g : δ → α} {l' : Filter δ} {b : δ} (hf : IsMaxFilter f l (g b))
    (hg : Tendsto g l' l) : IsMaxFilter (f ∘ g) l' b

{α : Type u}
{β : Type v}
{δ : Type x}
[Preorder β]
{f : α → β}
{l : Filter α}
{g : δ → α}
{l' : Filter δ}
{b : δ}
(hf : IsMaxFilter f l (g b))
(hg : Filter.Tendsto g l' l)


theorem mk_eq_top_of_isIso {X Y : C} (f : X ⟶ Y) [IsIso f] : mk f = ⊤

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


lemma mul_def (a b : SemidirectProduct N G φ) : a * b = ⟨a.1 * φ a.2 b.1, a.2 * b.2⟩

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

a * b = { left := a.left * (φ a.right) b.left, right := a.right * b.right }


theorem of_associative_ring_bracket (x y : A) : ⁅x, y⁆ = x * y - y * x


theorem monotone_preimage {f : α → β} (h : Injective f) :
    Monotone fun s => preimage s f h.injOn

{α : Type u}
{β : Type v}
{f : α → β}
(h : Function.Injective f)


/-- An element is `M`-regular if and only if multiplying it on the left by an `M`-regular element
is `M`-regular. -/
@[simp]
theorem smul_iff (b : S) (ha : IsSMulRegular M a) : IsSMulRegular M (a • b) ↔ IsSMulRegular M b

{R : Type u_1}
{S : Type u_2}
{M : Type u_3}
{a : R}
[SMul R M]
[SMul R S]
[SMul S M]
[IsScalarTower R S M]
(b : S)
(ha : IsSMulRegular M a)


theorem empty_eq (v : Fin 0 → α) : v = ![]


theorem eq_orthogonalProjection_of_eq_subspace {s s' : AffineSubspace ℝ P} [Nonempty s]
    [Nonempty s'] [HasOrthogonalProjection s.direction] [HasOrthogonalProjection s'.direction]
    (h : s = s') (p : P) : (orthogonalProjection s p : P) = (orthogonalProjection s' p : P)

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

↑((EuclideanGeometry.orthogonalProjection s) p) = ↑((EuclideanGeometry.orthogonalProjection s') p)


@[to_additive]
theorem uniformity_translate_mul (a : α) : ((𝓤 α).map fun x : α × α => (x.1 * a, x.2 * a)) = 𝓤 α

{α : Type u_1}
[UniformSpace α]
[Group α]
[UniformGroup α]
(a : α)

Filter.map (fun x => (x.1 * a, x.2 * a)) (𝓤 α) = 𝓤 α


theorem compl_mem_cocardinal_of_card_lt {s : Set α} (hs : #s < c) :
    sᶜ ∈ cocardinal α hreg

{α : Type u}
{c : Cardinal.{u}}
{hreg : c.IsRegular}
{s : Set α}
(hs : #↑s < c)


theorem floor_eq_iff' (hn : n ≠ 0) : ⌊a⌋₊ = n ↔ ↑n ≤ a ∧ a < ↑n + 1

{α : Type u_2}
[LinearOrderedSemiring α]
[FloorSemiring α]
{a : α}
{n : ℕ}
(hn : n ≠ 0)


lemma addUnits_eq_zero (u : AddUnits ℕ) : u = 0


@[simp] lemma one_uzpow (x : R) : (1 : ℤˣ) ^ x = 1

{R : Type u_1}
[CommSemiring R]
[Module R (Additive ℤˣ)]
(x : R)


lemma neg {f : 𝕜 → E} {x : 𝕜} (hf : MeromorphicAt f x) : MeromorphicAt (-f) x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{f : 𝕜 → E}
{x : 𝕜}
(hf : MeromorphicAt f x)


theorem jacobson_radical_eq_jacobson : I.radical.jacobson = I.jacobson


theorem linearIndependent_rows_of_invertible (A : Matrix m m K) [Invertible A] :
    LinearIndependent K (fun i ↦ A i)

{m : Type u}
[DecidableEq m]
{K : Type u_3}
[Field K]
[Fintype m]
(A : Matrix m m K)
[Invertible A]


/-- The functor lifting a braided category to its center, using the braiding as the half-braiding.
-/
@[simps]
def ofBraided : MonoidalFunctor C (Center C)

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

∀ {X Y : C} (f : X ⟶ Y), ((CategoryTheory.Center.ofBraided C).map f).f = f


theorem Or.resolve_left  (h: Or a b) (na : Not a) : b


lemma _root_.rootsOfUnityEquivOfPrimitiveRoots_symm_apply
    {S F} [CommRing S] [IsDomain S] [FunLike F R S] [MonoidHomClass F R S]
    {n : ℕ+} {f : F} (hf : Function.Injective f) (hζ : (primitiveRoots n R).Nonempty) (η) :
    f ((rootsOfUnityEquivOfPrimitiveRoots hf hζ).symm η : Rˣ) = (η : Sˣ)

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

f ↑↑((rootsOfUnityEquivOfPrimitiveRoots hf hζ).symm η) = ↑↑η


theorem separable_or {f : F[X]} (hf : Irreducible f) :
    f.Separable ∨ ¬f.Separable ∧ ∃ g : F[X], Irreducible g ∧ expand F p g = f

{F : Type u}
[Field F]
(p : ℕ)
[HF : CharP F p]
{f : F[X]}
(hf : Irreducible f)

f.Separable ∨ ¬f.Separable ∧ ∃ g, Irreducible g ∧ (Polynomial.expand F p) g = f


/-- The map `Square C → Square Cᵒᵖ` which switches `X₁` and `X₃`, but
does not move `X₂` and `X₃`. -/
@[simps]
protected def op (sq : Square C) : Square Cᵒᵖ

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


/-- The **Erdős–Ginzburg–Ziv theorem** for `ℤ` for multiset.

Any multiset of at least `2 * n - 1` elements of `ℤ` contains a submultiset of `n` elements whose
sum is divisible by `n`. -/
theorem Int.erdos_ginzburg_ziv_multiset (s : Multiset ℤ) (hs : 2 * n - 1 ≤ Multiset.card s) :
    ∃ t ≤ s, Multiset.card t = n ∧ ↑n ∣ t.sum

{n : ℕ}
(s : Multiset ℤ)
(hs : 2 * n - 1 ≤ Multiset.card s)


theorem Monotone.const_mul_of_nonpos [ExistsAddOfLE α] [PosMulMono α]
    [CovariantClass α α (swap (· + ·)) (· ≤ ·)] [ContravariantClass α α (swap (· + ·)) (· ≤ ·)]
    (hf : Monotone f) (ha : a ≤ 0) : Antitone fun x => a * f x

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

[ContravariantClass α α (Function.swap fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1]


@[simp]
theorem dom_zero : (0 : PartENat).Dom


theorem range_dualMap_eq_dualAnnihilator_ker (f : V₁ →ₗ[K] V₂) :
    LinearMap.range f.dualMap = f.ker.dualAnnihilator

{K : Type uK}
[Field K]
{V₁ : Type uV₁}
{V₂ : Type uV₂}
[AddCommGroup V₁]
[Module K V₁]
[AddCommGroup V₂]
[Module K V₂]
(f : V₁ →ₗ[K] V₂)

LinearMap.range f.dualMap = (LinearMap.ker f).dualAnnihilator


/-- A family of morphisms `T' ⟶ T j` lifts to a morphism `T' ⟶ productTriangle T`. -/
@[simps]
def productTriangle.lift {T' : Triangle C} (φ : ∀ j, T' ⟶ T j) :
    T' ⟶ productTriangle T

(T : J → CategoryTheory.Pretriangulated.Triangle C)

[CategoryTheory.Limits.HasProduct fun j => (T j).obj₁]

[CategoryTheory.Limits.HasProduct fun j => (T j).obj₂]

[CategoryTheory.Limits.HasProduct fun j => (T j).obj₃]

[CategoryTheory.Limits.HasProduct fun j => (CategoryTheory.shiftFunctor C 1).obj (T j).obj₁]

{T' : CategoryTheory.Pretriangulated.Triangle C}

(CategoryTheory.Pretriangulated.productTriangle.lift T φ).hom₂ = CategoryTheory.Limits.Pi.lift fun j => (φ j).hom₂


/-- The strong pigeonhole principle for infinitely many pigeons in
finitely many pigeonholes.  If there are infinitely many pigeons in
finitely many pigeonholes, then there is a pigeonhole with infinitely
many pigeons.

See also: `Finite.exists_ne_map_eq_of_infinite`
-/
theorem Finite.exists_infinite_fiber [Infinite α] [Finite β] (f : α → β) :
    ∃ y : β, Infinite (f ⁻¹' {y})

{α : Type u_1}
{β : Type u_2}
[Infinite α]
[Finite β]
(f : α → β)


theorem himp_bihimp : a ⇨ b ⇔ c = (a ⊓ c ⇨ b) ⊓ (a ⊓ b ⇨ c)

{α : Type u_2}
[GeneralizedHeytingAlgebra α]
(a b c : α)


@[ext]
theorem hom_ext {W : C} (i j : W ⟶ multiequalizer I)
    (h : ∀ a, i ≫ Multiequalizer.ι I a = j ≫ Multiequalizer.ι I a) : i = j

(I : CategoryTheory.Limits.MulticospanIndex C)

(i j : W ⟶ CategoryTheory.Limits.multiequalizer I)

(h :
  ∀ (a : I.L),
    CategoryTheory.CategoryStruct.comp i (CategoryTheory.Limits.Multiequalizer.ι I a) =
      CategoryTheory.CategoryStruct.comp j (CategoryTheory.Limits.Multiequalizer.ι I a))


theorem addHaar_image_le_lintegral_abs_det_fderiv_aux1 (hs : MeasurableSet s)
    (hf' : ∀ x ∈ s, HasFDerivWithinAt f (f' x) s x) {ε : ℝ≥0} (εpos : 0 < ε) :
    μ (f '' s) ≤ (∫⁻ x in s, ENNReal.ofReal |(f' x).det| ∂μ) + 2 * ε * μ s

μ (f '' s) ≤ ∫⁻ (x : E) in s, ENNReal.ofReal |(f' x).det| ∂μ + 2 * ↑ε * μ s


@[simp]
theorem stalkFunctor_obj (ℱ : X.Presheaf C) (x : X) : (stalkFunctor C x).obj ℱ = ℱ.stalk x

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Limits.HasColimits C]
{X : TopCat}
(ℱ : TopCat.Presheaf C X)
(x : ↑X)

(TopCat.Presheaf.stalkFunctor C x).obj ℱ = ℱ.stalk x


protected theorem eq {x y : M} : (mk x : M ⧸ p) = (mk y : M ⧸ p) ↔ x - y ∈ p

{R : Type u_1}
{M : Type u_2}
[Ring R]
[AddCommGroup M]
[Module R M]
(p : Submodule R M)
{x y : M}

Submodule.Quotient.mk x = Submodule.Quotient.mk y ↔ x - y ∈ p


theorem inner_eq_tsum (f g : lp G 2) : ⟪f, g⟫ = ∑' i, ⟪f i, g i⟫

{ι : Type u_1}
{𝕜 : Type u_2}
[RCLike 𝕜]
{G : ι → Type u_4}
[(i : ι) → NormedAddCommGroup (G i)]
[(i : ι) → InnerProductSpace 𝕜 (G i)]
(f g : ↥(lp G 2))


theorem left_of_comp {g : α → α} (hco : Commute f g) (hfg : IsPeriodicPt (f ∘ g) n x)
    (hg : IsPeriodicPt g n x) : IsPeriodicPt f n x

(hfg : Function.IsPeriodicPt (f ∘ g) n x)


lemma _root_.AntitoneOn.image_uIcc_subset (hf : AntitoneOn f (uIcc a b)) :
    f '' uIcc a b ⊆ uIcc (f a) (f b)

{α : Type u_1}
{β : Type u_2}
[LinearOrder α]
[Lattice β]
{f : α → β}
{a b : α}
(hf : AntitoneOn f (Set.uIcc a b))

f '' Set.uIcc a b ⊆ Set.uIcc (f a) (f b)


@[simp]
theorem toComplex_ofComplex (c : ℂ) : toComplex (ofComplex c) = c

CliffordAlgebraComplex.toComplex (CliffordAlgebraComplex.ofComplex c) = c


@[to_additive]
theorem div_eq_div_iff_div_eq_div : a / b = c / d ↔ a / c = b / d

{G : Type u_3}
[CommGroup G]
{a b c d : G}


nonrec theorem half_lt_self {a : ℝ≥0} (h : a ≠ 0) : a / 2 < a


@[to_additive]
theorem prod_finset_product_right (r : Finset (α × γ)) (s : Finset γ) (t : γ → Finset α)
    (h : ∀ p : α × γ, p ∈ r ↔ p.2 ∈ s ∧ p.1 ∈ t p.2) {f : α × γ → β} :
    ∏ p ∈ r, f p = ∏ c ∈ s, ∏ a ∈ t c, f (a, c)

(h : ∀ (p : α × γ), p ∈ r ↔ p.2 ∈ s ∧ p.1 ∈ t p.2)

{f : α × γ → β}

∑ p ∈ r, f p = ∑ c ∈ s, ∑ a ∈ t c, f (a, c)


/-- If `s : ι → Set α` is a sequence of sets, `S = ⋃ n, s n`, and `m (S \ s n)` tends to zero along
some nontrivial filter (usually `atTop` on `ι = ℕ`), then `m S = ⨆ n, m (s n)`. -/
theorem iUnion_of_tendsto_zero {ι} (m : OuterMeasure α) {s : ι → Set α} (l : Filter ι) [NeBot l]
    (h0 : Tendsto (fun k => m ((⋃ n, s n) \ s k)) l (𝓝 0)) : m (⋃ n, s n) = ⨆ n, m (s n)

(h0 : Filter.Tendsto (fun k => m ((⋃ n, s n) \ s k)) l (𝓝 0))


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

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


@[to_additive]
theorem comap_iInf {ι : Sort*} (f : F) (s : ι → Submonoid N) :
    (iInf s).comap f = ⨅ i, (s i).comap f

{M : Type u_1}
{N : Type u_2}
[AddZeroClass M]
[AddZeroClass N]
{F : Type u_4}
[FunLike F M N]
[mc : AddMonoidHomClass F M N]
{ι : Sort u_5}
(f : F)
(s : ι → AddSubmonoid N)

AddSubmonoid.comap f (iInf s) = ⨅ i, AddSubmonoid.comap f (s i)


@[norm_cast]
theorem coe_ennreal_nsmul (n : ℕ) (x : ℝ≥0∞) : (↑(n • x) : EReal) = n • (x : EReal)


theorem finite_edist_eq (x y : e.finiteSubspace) : edist x y = e (x - y)

{𝕜 : Type u_1}
{V : Type u_2}
[NormedField 𝕜]
[AddCommGroup V]
[Module 𝕜 V]
(e : ENorm 𝕜 V)
(x y : ↥e.finiteSubspace)


theorem contMDiffWithinAt_iff_target_of_mem_source {x : M} {y : M'}
    (hy : f x ∈ (chartAt H' y).source) :
    ContMDiffWithinAt I I' n f s x ↔
      ContinuousWithinAt f s x ∧ ContMDiffWithinAt I 𝓘(𝕜, E') n (extChartAt I' y ∘ f) s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{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']
{f : M → M'}
{s : Set M}
{n : ℕ∞}
{x : M}
{y : M'}
(hy : f x ∈ (chartAt H' y).source)

ContMDiffWithinAt I I' n f s x ↔ ContinuousWithinAt f s x ∧ ContMDiffWithinAt I 𝓘(𝕜, E') n (↑(extChartAt I' y) ∘ f) s x


theorem pred_eq_iff_eq_succ {n : Nat} (i : Fin (n + 1)) (hi : i ≠ 0) (j : Fin n) :
    i.pred hi = j ↔ i = j.succ


@[simp] theorem reverse_perm : ∀ l : List α, reverse l ~ l


/-- The inner product of a linear combination of a set of orthonormal vectors with one of those
vectors picks out the coefficient of that vector. -/
theorem Orthonormal.inner_right_sum {v : ι → E} (hv : Orthonormal 𝕜 v) (l : ι → 𝕜) {s : Finset ι}
    {i : ι} (hi : i ∈ s) : ⟪v i, ∑ i ∈ s, l i • v i⟫ = l i

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


theorem IsBigOWith.mul {f₁ f₂ : α → R} {g₁ g₂ : α → 𝕜} {c₁ c₂ : ℝ} (h₁ : IsBigOWith c₁ l f₁ g₁)
    (h₂ : IsBigOWith c₂ l f₂ g₂) :
    IsBigOWith (c₁ * c₂) l (fun x => f₁ x * f₂ x) fun x => g₁ x * g₂ x

{g₁ g₂ : α → 𝕜}

(h₁ : Asymptotics.IsBigOWith c₁ l f₁ g₁)

(h₂ : Asymptotics.IsBigOWith c₂ l f₂ g₂)

Asymptotics.IsBigOWith (c₁ * c₂) l (fun x => f₁ x * f₂ x) fun x => g₁ x * g₂ x


/-- The term of `TopologicalSpace.Closeds α` corresponding to a singleton. -/
@[simps]
def singleton [T1Space α] (x : α) : Closeds α

{α : Type u_2}
[TopologicalSpace α]
[T1Space α]
(x : α)

↑(TopologicalSpace.Closeds.singleton x) = {x}


theorem convexJoin_subset (hs : s ⊆ u) (ht : t ⊆ u) (hu : Convex 𝕜 u) : convexJoin 𝕜 s t ⊆ u

{𝕜 : Type u_2}
{E : Type u_3}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[Module 𝕜 E]
{s t u : Set E}
(hs : s ⊆ u)
(ht : t ⊆ u)
(hu : Convex 𝕜 u)


theorem list_get?₁ : ∀ l : List α, Primrec l.get?

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


theorem lt_iff_cons_le {s t : Multiset α} : s < t ↔ ∃ a, a ::ₘ s ≤ t


theorem IsNatPowT.bit1 :
    IsNatPowT (Nat.pow a b = c) a (nat_lit 2 * b + nat_lit 1) (Nat.mul c (Nat.mul c a))

Mathlib.Meta.NormNum.IsNatPowT (a.pow b = c) a (2 * b + 1) (c.mul (c.mul a))


@[simp]
theorem univ_subset_iff {s : Finset α} : univ ⊆ s ↔ s = univ

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


theorem Icc_inl_inl : Icc (inl a₁ : α ⊕ β) (inl a₂) = (Icc a₁ a₂).map Embedding.inl

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

Finset.Icc (Sum.inl a₁) (Sum.inl a₂) = Finset.map Function.Embedding.inl (Finset.Icc a₁ a₂)


theorem comp_ofDual (f : α → E) (s : Set α) :
    eVariationOn (f ∘ ofDual) (ofDual ⁻¹' s) = eVariationOn f s

{α : Type u_1}
[LinearOrder α]
{E : Type u_2}
[PseudoEMetricSpace E]
(f : α → E)
(s : Set α)

eVariationOn (f ∘ ⇑OrderDual.ofDual) (⇑OrderDual.ofDual ⁻¹' s) = eVariationOn f s


theorem dist_lt_iff_of_compact [CompactSpace α] (C0 : (0 : ℝ) < C) :
    dist f g < C ↔ ∀ x : α, dist (f x) (g x) < C

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[PseudoMetricSpace β]
{f g : BoundedContinuousFunction α β}
{C : ℝ}
[CompactSpace α]
(C0 : 0 < C)

dist f g < C ↔ ∀ (x : α), dist (f x) (g x) < C


@[reassoc (attr := simp)]
theorem pullbackIsoProdSubtype_inv_fst (f : X ⟶ Z) (g : Y ⟶ Z) :
    (pullbackIsoProdSubtype f g).inv ≫ pullback.fst _ _ = pullbackFst f g

{X Y Z : TopCat}
(f : X ⟶ Z)
(g : Y ⟶ Z)

(TopCat.pullbackIsoProdSubtype f g).inv ≫ CategoryTheory.Limits.pullback.fst f g = TopCat.pullbackFst f g


theorem PairwiseDisjoint.image_finset_of_le [DecidableEq ι] {s : Finset ι} {f : ι → α}
    (hs : (s : Set ι).PairwiseDisjoint f) {g : ι → ι} (hf : ∀ a, f (g a) ≤ f a) :
    (s.image g : Set ι).PairwiseDisjoint f

{α : Type u_1}
{ι : Type u_2}
[SemilatticeInf α]
[OrderBot α]
[DecidableEq ι]
{s : Finset ι}
{f : ι → α}
(hs : (↑s).PairwiseDisjoint f)
{g : ι → ι}
(hf : ∀ (a : ι), f (g a) ≤ f a)

(↑(Finset.image g s)).PairwiseDisjoint f


theorem IsCoprime.isUnit_of_dvd (H : IsCoprime x y) (d : x ∣ y) : IsUnit x

{R : Type u}
[CommSemiring R]
{x y : R}
(H : IsCoprime x y)
(d : x ∣ y)


@[to_additive (attr := simp)]
theorem inv_lt_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]


/-- The members of the opposite of a set are in bijection with the members of the set itself. -/
@[simps]
def opEquiv_self (s : Set α) : s.op ≃ s


@[simp]
theorem image2_nonempty_iff : (image2 f s t).Nonempty ↔ s.Nonempty ∧ t.Nonempty

{α : Type u_1}
{β : Type u_3}
{γ : Type u_5}
{f : α → β → γ}
{s : Set α}
{t : Set β}

(Set.image2 f s t).Nonempty ↔ s.Nonempty ∧ t.Nonempty


@[to_additive]
protected theorem map_noncommProd_aux [MonoidHomClass F α β] (s : Multiset α)
    (comm : { x | x ∈ s }.Pairwise Commute) (f : F) : { x | x ∈ s.map f }.Pairwise Commute

(comm : {x | x ∈ s}.Pairwise AddCommute)

{x | x ∈ Multiset.map (⇑f) s}.Pairwise AddCommute


theorem sum_lt' {α : Type*} {F : α → ℚ} {t : ℚ} {s : Finset α}
    (hF : ∀ i ∈ s, padicNorm p (F i) < t) (ht : 0 < t) : padicNorm p (∑ i ∈ s, F i) < t

{p : ℕ}
[hp : Fact (Nat.Prime p)]
{α : Type u_1}
{F : α → ℚ}
{t : ℚ}
{s : Finset α}
(hF : ∀ i ∈ s, padicNorm p (F i) < t)
(ht : 0 < t)


theorem filter_zero : (0 : α →₀ M).filter p = 0

{α : Type u_1}
{M : Type u_5}
[Zero M]
(p : α → Prop)
[DecidablePred p]


@[to_additive]
theorem ofQuotientStabilizer_smul (g : α) (g' : α ⧸ MulAction.stabilizer α x) :
    ofQuotientStabilizer α x (g • g') = g • ofQuotientStabilizer α x g'

(α : Type u)
{β : Type v}
[Group α]
[MulAction α β]
(x : β)
(g : α)
(g' : α ⧸ MulAction.stabilizer α x)

MulAction.ofQuotientStabilizer α x (g • g') = g • MulAction.ofQuotientStabilizer α x g'


/-- Rotating the second of two vectors by `θ` scales their Kahler form by `cos θ + sin θ * I`. -/
@[simp]
theorem kahler_rotation_right (x y : V) (θ : Real.Angle) :
    o.kahler x (o.rotation θ y) = θ.expMapCircle * o.kahler x y

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

(o.kahler x) ((o.rotation θ) y) = ↑θ.expMapCircle * (o.kahler x) y


/-- An `R`-coalgebra is a comonoid object in the category of `R`-modules. -/
@[simps] def toComonObj (X : CoalgebraCat R) : Comon_ (ModuleCat R)

{R : Type u}
[CommRing R]
(X : CoalgebraCat R)

X.toComonObj.comul = ModuleCat.ofHom Coalgebra.comul


theorem mem_carrier : x ∈ p.carrier ↔ x ∈ (p : Set M)

{R : Type u}
{M : Type v}
[Semiring R]
[AddCommMonoid M]
{module_M : Module R M}
(p : Submodule R M)
{x : M}


/-- A gluing datum consists of
1. An index type `J`
2. An object `U i` for each `i : J`.
3. An object `V i j` for each `i j : J`.
4. A monomorphism `f i j : V i j ⟶ U i` for each `i j : J`.
5. A transition map `t i j : V i j ⟶ V j i` for each `i j : J`.
such that
6. `f i i` is an isomorphism.
7. `t i i` is the identity.
8. The pullback for `f i j` and `f i k` exists.
9. `V i j ×[U i] V i k ⟶ V i j ⟶ V j i` factors through `V j k ×[U j] V j i ⟶ V j i` via some
    `t' : V i j ×[U i] V i k ⟶ V j k ×[U j] V j i`.
10. `t' i j k ≫ t' j k i ≫ t' k i j = 𝟙 _`.
-/
-- Porting note(#5171): linter not ported yet
-- @[nolint has_nonempty_instance]
structure GlueData where
  J : Type v
  U : J → C
  V : J × J → C
  f : ∀ i j, V (i, j) ⟶ U i
  f_mono : ∀ i j, Mono (f i j) := by infer_instance
  f_hasPullback : ∀ i j k, HasPullback (f i j) (f i k) := by infer_instance
  f_id : ∀ i, IsIso (f i i) := by infer_instance
  t : ∀ i j, V (i, j) ⟶ V (j, i)
  t_id : ∀ i, t i i = 𝟙 _
  t' : ∀ i j k, pullback (f i j) (f i k) ⟶ pullback (f j k) (f j i)
  t_fac : ∀ i j k, t' i j k ≫ pullback.snd _ _ = pullback.fst _ _ ≫ t i j
  cocycle : ∀ i j k, t' i j k ≫ t' j k i ≫ t' k i j = 𝟙 _

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

self.t i i = CategoryTheory.CategoryStruct.id (self.V (i, i))


@[to_additive lt_of_add_lt_add_right]
theorem lt_of_mul_lt_mul_right' [i : ContravariantClass α α (swap (· * ·)) (· < ·)] {a b c : α}
    (bc : b * a < c * a) :
    b < c

[i : ContravariantClass α α (Function.swap fun x x_1 => x * x_1) fun x x_1 => x < x_1]


/-- A version of **Markov's inequality** for two functions. It doesn't follow from the standard
Markov's inequality because we only assume measurability of `g`, not `f`. -/
theorem lintegral_add_mul_meas_add_le_le_lintegral {f g : α → ℝ≥0∞} (hle : f ≤ᵐ[μ] g)
    (hg : AEMeasurable g μ) (ε : ℝ≥0∞) :
    ∫⁻ a, f a ∂μ + ε * μ { x | f x + ε ≤ g x } ≤ ∫⁻ a, g a ∂μ

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f g : α → ℝ≥0∞}
(hle : f ≤ᵐ[μ] g)
(hg : AEMeasurable g μ)
(ε : ℝ≥0∞)

∫⁻ (a : α), f a ∂μ + ε * μ {x | f x + ε ≤ g x} ≤ ∫⁻ (a : α), g a ∂μ


theorem map_comp_apply {f : α → β} {g : β → γ} (x : FreeAbelianGroup α) :
    map (g ∘ f) x = (map g) ((map f) x)

{α : Type u}
{β : Type v}
{γ : Type w}
{f : α → β}
{g : β → γ}
(x : FreeAbelianGroup α)

(FreeAbelianGroup.map (g ∘ f)) x = (FreeAbelianGroup.map g) ((FreeAbelianGroup.map f) x)


@[simp] theorem getElem?_cons_zero {l : List α} : (a::l)[0]? = some a


theorem injective_iff_preservesEpimorphisms_preadditiveYoneda_obj (J : C) :
    Injective J ↔ (preadditiveYoneda.obj J).PreservesEpimorphisms

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

CategoryTheory.Injective J ↔ (CategoryTheory.preadditiveYoneda.obj J).PreservesEpimorphisms


theorem of_hasBinaryCoproduct [HasBinaryCoproduct X Y] [HasZeroObject C] [HasZeroMorphisms C] :
    IsPushout (0 : 0 ⟶ X) (0 : 0 ⟶ Y) coprod.inl coprod.inr

CategoryTheory.IsPushout 0 0 CategoryTheory.Limits.coprod.inl CategoryTheory.Limits.coprod.inr


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

{G : Type u_1}
[Group G]
(K : Subgroup G)


@[simp] theorem domCongr_support (e : G ≃+ H) (f : MonoidAlgebra A G) :
    (domCongr k A e f).support = f.support.map e

(k : Type u₁)
{G : Type u₂}
{H : Type u_1}
(A : Type u_3)
[CommSemiring k]
[AddMonoid G]
[AddMonoid H]
[Semiring A]
[Algebra k A]
(e : G ≃+ H)
(f : MonoidAlgebra A G)

((AddMonoidAlgebra.domCongr k A e) f).support = Finset.map (↑e).toEmbedding f.support


/-- If two functions coincide on a set `s`, then their iterated differentials within this set
coincide. See also `Filter.EventuallyEq.iteratedFDerivWithin_eq` and
`Filter.EventuallyEq.iteratedFDerivWithin`. -/
protected theorem Set.EqOn.iteratedFDerivWithin (hs : EqOn f₁ f s) (n : ℕ) :
    EqOn (iteratedFDerivWithin 𝕜 n f₁ s) (iteratedFDerivWithin 𝕜 n f s) s

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{s : Set E}
{f f₁ : E → F}
(hs : Set.EqOn f₁ f s)
(n : ℕ)

Set.EqOn (iteratedFDerivWithin 𝕜 n f₁ s) (iteratedFDerivWithin 𝕜 n f s) s


theorem IsTheta.isBigO_congr_right (h : g' =Θ[l] k') : f =O[l] g' ↔ f =O[l] k'

{α : Type u_1}
{E : Type u_3}
{F' : Type u_7}
{G' : Type u_8}
[Norm E]
[SeminormedAddCommGroup F']
[SeminormedAddCommGroup G']
{f : α → E}
{g' : α → F'}
{k' : α → G'}
{l : Filter α}
(h : g' =Θ[l] k')


theorem uniformEmbedding_comap {α : Type*} {β : Type*} {f : α → β} [u : UniformSpace β]
    (hf : Function.Injective f) : @UniformEmbedding α β (UniformSpace.comap f u) u f

{α : Type u_1}
{β : Type u_2}
{f : α → β}
[u : UniformSpace β]
(hf : Function.Injective f)


theorem image_compl [BooleanAlgebra α] (hs : IsAntichain (· ≤ ·) s) :
    IsAntichain (· ≤ ·) (compl '' s)

(hs : IsAntichain (fun x x_1 => x ≤ x_1) s)

IsAntichain (fun x x_1 => x ≤ x_1) (compl '' s)


@[to_additive (attr := measurability)]
theorem _root_.Finset.stronglyMeasurable_prod {ι : Type*} {f : ι → α → M} (s : Finset ι)
    (hf : ∀ i ∈ s, StronglyMeasurable (f i)) : StronglyMeasurable fun a => ∏ i ∈ s, f i a

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

MeasureTheory.StronglyMeasurable fun a => ∏ i ∈ s, f i a


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

{α β : SemilatInfCat}
(e : α.X ≃o β.X)
(a : β.X)

(SemilatInfCat.Iso.mk e).inv.toInfHom a = e.symm a


@[simp]
theorem thickening_closure : thickening δ (closure s) = thickening δ s

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

Metric.thickening δ (closure s) = Metric.thickening δ s


theorem IndepSets.union {s₁ s₂ s' : Set (Set Ω)} {_mΩ : MeasurableSpace Ω}
    {κ : Kernel α Ω} {μ : Measure α}
    (h₁ : IndepSets s₁ s' κ μ) (h₂ : IndepSets s₂ s' κ μ) :
    IndepSets (s₁ ∪ s₂) s' κ μ

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

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

ProbabilityTheory.Kernel.IndepSets (s₁ ∪ s₂) s' κ μ


/-- If a function `f` tends to negative infinity along a filter, then `f` multiplied by
a positive constant (on the left) also tends to negative infinity. -/
theorem Tendsto.const_mul_atBot (hr : 0 < r) (hf : Tendsto f l atBot) :
    Tendsto (fun x => r * f x) l atBot

{α : Type u_3}
{β : Type u_4}
[LinearOrderedField α]
{l : Filter β}
{f : β → α}
{r : α}
(hr : 0 < r)
(hf : Filter.Tendsto f l Filter.atBot)

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


/-- If the domain of a `DenseInducing` map is a separable space, then so is the codomain. -/
protected theorem separableSpace [SeparableSpace α] : SeparableSpace β

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
{i : α → β}
(di : DenseInducing i)
[TopologicalSpace.SeparableSpace α]


@[reassoc (attr := simp)]
lemma colimitHomIsoLimitYoneda'_hom_comp_π [HasLimitsOfShape I (Type u₂)] (A : C) (i : I) :
    (colimitHomIsoLimitYoneda' F A).hom ≫ limit.π (F.rightOp ⋙ yoneda.obj A) i
      = (coyoneda.map (colimit.ι F ⟨i⟩).op).app A

[CategoryTheory.Limits.HasLimitsOfShape I (Type u₂)]

CategoryTheory.CategoryStruct.comp (CategoryTheory.Limits.colimitHomIsoLimitYoneda' F A).hom
    (CategoryTheory.Limits.limit.π (F.rightOp.comp (CategoryTheory.yoneda.obj A)) i) =
  (CategoryTheory.coyoneda.map (CategoryTheory.Limits.colimit.ι F (Opposite.op i)).op).app A


@[simp]
theorem subset_compl_singleton_iff {a : α} {s : Set α} : s ⊆ {a}ᶜ ↔ a ∉ s


lemma mk_mem_toSpec_base_apply {f} (x : Proj| pbo f)
    (z : NumDenSameDeg 𝒜 (.powers f)) :
    HomogeneousLocalization.mk z ∈ ((toSpec 𝒜 f).1.base x).asIdeal ↔
      z.num.1 ∈ x.1.asHomogeneousIdeal

(x : ↑((AlgebraicGeometry.Proj.toLocallyRingedSpace 𝒜).restrict ⋯).toTopCat)

(z : HomogeneousLocalization.NumDenSameDeg 𝒜 (Submonoid.powers f))

HomogeneousLocalization.mk z ∈ ((AlgebraicGeometry.ProjectiveSpectrum.Proj.toSpec 𝒜 f).val.base x).asIdeal ↔
  ↑z.num ∈ (↑x).asHomogeneousIdeal


theorem setToSimpleFunc_add_left' (T T' T'' : Set α → E →L[ℝ] F)
    (h_add : ∀ s, MeasurableSet s → μ s < ∞ → T'' s = T s + T' s) {f : α →ₛ E}
    (hf : Integrable f μ) : setToSimpleFunc T'' f = setToSimpleFunc T f + setToSimpleFunc T' f

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

MeasureTheory.SimpleFunc.setToSimpleFunc T'' f =
  MeasureTheory.SimpleFunc.setToSimpleFunc T f + MeasureTheory.SimpleFunc.setToSimpleFunc T' f


theorem of_surjective (f : A →ₐ[R] B) (hf : Surjective f) (hker : f.toRingHom.ker.FG) :
    f.FinitePresentation

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
[CommRing R]
[CommRing A]
[CommRing B]
[Algebra R A]
[Algebra R B]
(f : A →ₐ[R] B)
(hf : Function.Surjective ⇑f)
(hker : (RingHom.ker f.toRingHom).FG)


@[to_additive]
theorem mk_of_inv_mul : ∀ x : G ⊕ H, mk (of (x.map Inv.inv Inv.inv)) * mk (of x) = 1

{G : Type u_1}
{H : Type u_2}
[Group G]
[Group H]
(x : G ⊕ H)

Monoid.Coprod.mk (FreeMonoid.of (Sum.map Inv.inv Inv.inv x)) * Monoid.Coprod.mk (FreeMonoid.of x) = 1


theorem equivalence_of_oneOneEquiv {α} [Primcodable α] : Equivalence (@OneOneEquiv α α _ _)


theorem prime_of_coprime (n : ℕ) (h1 : 1 < n) (h : ∀ m < n, m ≠ 0 → n.Coprime m) : Prime n

(h : ∀ (m : ℕ), m < n → m ≠ 0 → n.Coprime m)


/-- When `s` is an infinite set, `nth` agrees with `Nat.Subtype.orderIsoOfNat`. -/
theorem nth_apply_eq_orderIsoOfNat (hf : (setOf p).Infinite) (n : ℕ) :
    nth p n = @Nat.Subtype.orderIsoOfNat (setOf p) hf.to_subtype n

{p : ℕ → Prop}
(hf : (setOf p).Infinite)
(n : ℕ)

Nat.nth p n = ↑((Nat.Subtype.orderIsoOfNat (setOf p)) n)


@[to_additive (attr := simp)]
theorem div_neBot_iff : (f / g).NeBot ↔ f.NeBot ∧ g.NeBot


theorem coeff_injective : Injective (coeff : HahnSeries Γ R → Γ → R)

{Γ : Type u_1}
{R : Type u_2}
[PartialOrder Γ]
[Zero R]


theorem le_sInf {A : C} (s : Set (Subobject A)) (f : Subobject A) (k : ∀ g ∈ s, f ≤ g) :
    f ≤ sInf s


@[simp] lemma coeff_intCast_mul [Ring S] {p : S[X]} {a : ℤ} {k : ℕ} :
  coeff ((a : S[X]) * p) k = a * coeff p k

{S : Type v}
[Ring S]
{p : S[X]}
{a : ℤ}
{k : ℕ}


@[simp] theorem coe_smul (r : R) (f : AddMonoid.End A) : ⇑(r • f) = r • ⇑f

{R : Type u_1}
{A : Type u_4}
[Monoid R]
[AddCommMonoid A]
[DistribMulAction R A]
(r : R)
(f : AddMonoid.End A)


@[simp]
theorem Prod.toSigma_mk {α β} (x : α) (y : β) : (x, y).toSigma = ⟨x, y⟩

{α : Type u_7}
{β : Type u_8}
(x : α)
(y : β)


/-- If two maps of short complexes are homotopic, their opposites also are. -/
@[simps]
def neg (h : Homotopy φ₁ φ₂) : Homotopy (-φ₁) (-φ₂)

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

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


@[simp]
theorem iSup_join {ι : Sort w} {f : ι → Filter (Filter α)} : ⨆ x, join (f x) = join (⨆ x, f x)

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


@[simp]
theorem log_one_left : ∀ n, log 1 n = 0


/-- If `α` is locally compact, and an infinite sum of functions in `C(α, β)`
converges to `g` (for the compact-open topology), then the pointwise sum converges to `g x` for
all `x ∈ α`. -/
theorem hasSum_apply {γ : Type*} [AddCommMonoid β] [ContinuousAdd β]
    {f : γ → C(α, β)} {g : C(α, β)} (hf : HasSum f g) (x : α) :
    HasSum (fun i : γ => f i x) (g x)

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
{γ : Type u_3}
[AddCommMonoid β]
[ContinuousAdd β]
{f : γ → C(α, β)}
{g : C(α, β)}
(hf : HasSum f g)
(x : α)


theorem units_smul_resolvent {r : Rˣ} {s : R} {a : A} :
    r • resolvent a (s : R) = resolvent (r⁻¹ • a) (r⁻¹ • s : R)

{R : Type u}
{A : Type v}
[CommSemiring R]
[Ring A]
[Algebra R A]
{r : Rˣ}
{s : R}
{a : A}

r • resolvent a s = resolvent (r⁻¹ • a) (r⁻¹ • s)


/-- If `R` is a Jacobson ring, then maximal ideals in the localization at `y`
correspond to maximal ideals in the original ring `R` that don't contain `y`.
This lemma gives the correspondence in the particular case of an ideal and its map.
See `le_relIso_of_maximal` for the more general statement, and the reverse of this implication -/
theorem isMaximal_of_isMaximal_disjoint [IsJacobson R] (I : Ideal R) (hI : I.IsMaximal)
    (hy : y ∉ I) : (map (algebraMap R S) I).IsMaximal

{R : Type u_1}
{S : Type u_2}
[CommRing R]
[CommRing S]
(y : R)
[Algebra R S]
[IsLocalization.Away y S]
[Ideal.IsJacobson R]
(I : Ideal R)
(hI : I.IsMaximal)
(hy : y ∉ I)

(Ideal.map (algebraMap R S) I).IsMaximal


@[to_additive]
theorem M.mk_eq (x y : Σ j, F.obj j)
    (h : ∃ (k : J) (f : x.1 ⟶ k) (g : y.1 ⟶ k), F.map f x.2 = F.map g y.2) :
    M.mk.{v, u} F x = M.mk F y

(h : ∃ k f g, (F.map f) x.snd = (F.map g) y.snd)

MonCat.FilteredColimits.M.mk F x = MonCat.FilteredColimits.M.mk F y


/-- The frontier of the closed thickening of a set is contained in an `EMetric.infEdist` level
set. -/
theorem frontier_cthickening_subset (E : Set α) {δ : ℝ} :
    frontier (cthickening δ E) ⊆ { x : α | infEdist x E = ENNReal.ofReal δ }

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

frontier (Metric.cthickening δ E) ⊆ {x | EMetric.infEdist x E = ENNReal.ofReal δ}


/-- The natural isomorphism `(K⟦n⟧).sc' i j k ≅ K.sc' i' j' k'` when `n + i = i'`,
`n + j = j'` and `n + k = k'`. -/
@[simps!]
def shiftShortComplexFunctor' (n i j k i' j' k' : ℤ)
    (hi : n + i = i') (hj : n + j = j') (hk : n + k = k') :
    (CategoryTheory.shiftFunctor (CochainComplex C ℤ) n) ⋙ shortComplexFunctor' C _ i j k ≅
      shortComplexFunctor' C _ i' j' k'

(C : Type u_1)
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Preadditive C]
(n i j k i' j' k' : ℤ)
(hi : n + i = i')
(hj : n + j = j')
(hk : n + k = k')
(X : CochainComplex C ℤ)

((CochainComplex.shiftShortComplexFunctor' C n i j k i' j' k' hi hj hk).hom.app X).τ₂ =
  (HomologicalComplex.XIsoOfEq X ⋯).hom


/-- In an abelian category, an object satisfying the dual of the definition of a simple object is
    simple. -/
theorem simple_of_cosimple (X : C) (h : ∀ {Z : C} (f : X ⟶ Z) [Epi f], IsIso f ↔ f ≠ 0) :
    Simple X

(h : ∀ {Z : C} (f : X ⟶ Z) [inst : CategoryTheory.Epi f], CategoryTheory.IsIso f ↔ f ≠ 0)


@[to_additive (attr := simp)]
theorem MulEquiv.inv_symm (G : Type*) [DivisionCommMonoid G] :
    (MulEquiv.inv G).symm = MulEquiv.inv G

(G : Type u_12)
[SubtractionCommMonoid G]


@[simp]
theorem coassoc_symm_apply (a : A) :
    (TensorProduct.assoc R A A A).symm (comul.lTensor A (comul a)) = comul.rTensor A (comul a)

{R : Type u}
{A : Type v}
[CommSemiring R]
[AddCommMonoid A]
[Module R A]
[Coalgebra R A]
(a : A)

(TensorProduct.assoc R A A A).symm ((LinearMap.lTensor A Coalgebra.comul) (Coalgebra.comul a)) =
  (LinearMap.rTensor A Coalgebra.comul) (Coalgebra.comul a)


/-- Compare with `Int.zero_shiftRight`, which has `n : ℕ`. -/
@[simp]
theorem zero_shiftRight' (n : ℤ) : 0 >>> n = 0


theorem countP_eq_countP_filter_add (s) (p q : α → Prop) [DecidablePred p] [DecidablePred q] :
    countP p s = (filter q s).countP p + (filter (fun a => ¬q a) s).countP p

{α : Type u_1}
(s : Multiset α)
(p q : α → Prop)
[DecidablePred p]
[DecidablePred q]

Multiset.countP p s = Multiset.countP p (Multiset.filter q s) + Multiset.countP p (Multiset.filter (fun a => ¬q a) s)


theorem dropn_add (s : Seq α) (m) : ∀ n, drop s (m + n) = drop (drop s m) n

{α : Type u}
(s : Stream'.Seq α)
(m n : ℕ)


class LawfulMonadCont (m : Type u → Type v) [Monad m] [MonadCont m]
    extends LawfulMonad m : Prop where
  callCC_bind_right {α ω γ} (cmd : m α) (next : Label ω m γ → α → m ω) :
    (callCC fun f => cmd >>= next f) = cmd >>= fun x => callCC fun f => next f x
  callCC_bind_left {α} (β) (x : α) (dead : Label α m β → β → m α) :
    (callCC fun f : Label α m β => goto f x >>= dead f) = pure x
  callCC_dummy {α β} (dummy : m α) : (callCC fun _ : Label α m β => dummy) = dummy

{m : Type u → Type v}
[Monad m]
[MonadCont m]
[self : LawfulMonadCont m]
{α β : Type u}
(dummy : m α)

(MonadCont.callCC fun x => dummy) = dummy


/-- The edist to a set is `< r` iff there exists a point in the set at edistance `< r` -/
theorem infEdist_lt_iff {r : ℝ≥0∞} : infEdist x s < r ↔ ∃ y ∈ s, edist x y < r

{α : Type u}
[PseudoEMetricSpace α]
{x : α}
{s : Set α}
{r : ℝ≥0∞}

EMetric.infEdist x s < r ↔ ∃ y ∈ s, edist x y < r


theorem emod_add_ediv : ∀ a b : Int, a % b + b * (a / b) = a


@[simp]
theorem map_fun (φ : M ≃[L] N) {n : ℕ} (f : L.Functions n) (x : Fin n → M) :
    φ (funMap f x) = funMap f (φ ∘ x)

{L : FirstOrder.Language}
{M : Type w}
{N : Type w'}
[L.Structure M]
[L.Structure N]
(φ : L.Equiv M N)
{n : ℕ}
(f : L.Functions n)
(x : Fin n → M)

φ (FirstOrder.Language.Structure.funMap f x) = FirstOrder.Language.Structure.funMap f (⇑φ ∘ x)


@[to_additive (attr := gcongr) add_lt_add_right]
theorem mul_lt_mul_right' [i : CovariantClass α α (swap (· * ·)) (· < ·)] {b c : α} (bc : b < c)
    (a : α) :
    b * a < c * a

[i : CovariantClass α α (Function.swap fun x x_1 => x * x_1) fun x x_1 => x < x_1]


theorem not_inr_le_inl [LE α] [LE β] {a : α} {b : β} : ¬toLex (inr b) ≤ toLex (inl a)

{α : Type u_1}
{β : Type u_2}
[LE α]
[LE β]
{a : α}
{b : β}


@[simp]
lemma succ_add_sub_one (n m : ℕ) : succ m + n - 1 = m + n


/-- A `NonUnitalSubring` `t` includes `closure s` if and only if it includes `s`. -/
@[simp]
theorem closure_le {s : Set R} {t : NonUnitalSubring R} : closure s ≤ t ↔ s ⊆ t

{R : Type u}
[NonUnitalNonAssocRing R]
{s : Set R}
{t : NonUnitalSubring R}


theorem _root_.Int.add_one_le_of_not_le {a b : ℤ} (h : ¬b ≤ a) : a + 1 ≤ b


theorem mem_nhds_uniformity_iff_right {x : α} {s : Set α} :
    s ∈ 𝓝 x ↔ { p : α × α | p.1 = x → p.2 ∈ s } ∈ 𝓤 α

{α : Type ua}
[UniformSpace α]
{x : α}
{s : Set α}


theorem isSeparating_op_iff (𝒢 : Set C) : IsSeparating 𝒢.op ↔ IsCoseparating 𝒢

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

CategoryTheory.IsSeparating 𝒢.op ↔ CategoryTheory.IsCoseparating 𝒢


theorem List.dProdIndex_eq_map_sum (l : List α) (fι : α → ι) :
    l.dProdIndex fι = (l.map fι).sum

{ι : Type u_1}
{α : Type u_2}
[AddMonoid ι]
(l : List α)
(fι : α → ι)


theorem IsLittleO.right_isBigO_add {f₁ f₂ : α → E'} (h : f₁ =o[l] f₂) :
    f₂ =O[l] fun x => f₁ x + f₂ x

{α : Type u_1}
{E' : Type u_6}
[SeminormedAddCommGroup E']
{l : Filter α}
{f₁ f₂ : α → E'}
(h : f₁ =o[l] f₂)


/-- A "proof" of the fact that `f` eventually reaches `b` in at most `m` steps when repeatedly
evaluated on `a`, remembering the number of steps it takes. -/
structure EvalsToInTime {σ : Type*} (f : σ → Option σ) (a : σ) (b : Option σ) (m : ℕ) extends
  EvalsTo f a b where
  steps_le_m : steps ≤ m

{σ : Type u_1}
{f : σ → Option σ}
{a : σ}
{b : Option σ}
{m : ℕ}
(self : Turing.EvalsToInTime f a b m)


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

(c1 c2 : HomogeneousLocalization.NumDenSameDeg 𝒜 x)


theorem splitFun_inj {α α' : TypeVec (n + 1)} {f f' : drop α ⟹ drop α'} {g g' : last α → last α'}
    (H : splitFun f g = splitFun f' g') : f = f' ∧ g = g'

(H : TypeVec.splitFun f g = TypeVec.splitFun f' g')


private theorem add_le_add_left : ∀ (a b : ZNum), a ≤ b → ∀ (c : ZNum), c + a ≤ c + b


theorem MeasurableSet.ite' {s t : Set α} {p : Prop} (hs : p → MeasurableSet s)
    (ht : ¬p → MeasurableSet t) : MeasurableSet (ite p s t)

{α : Type u_1}
{m : MeasurableSpace α}
{s t : Set α}
{p : Prop}
(hs : p → MeasurableSet s)
(ht : ¬p → MeasurableSet t)


theorem hasBasis_coclosedLindelof :
    (Filter.coclosedLindelof X).HasBasis (fun s => IsClosed s ∧ IsLindelof s) compl


theorem to₂ {f : α × β →. σ} (hf : Partrec f) : Partrec₂ fun a b => f (a, b)

{α : Type u_1}
{β : Type u_2}
{σ : Type u_4}
[Primcodable α]
[Primcodable β]
[Primcodable σ]
{f : α × β →. σ}
(hf : Partrec f)


@[simp]
theorem natSepDegree_X_sub_C (x : F) : (X - C x).natSepDegree = 1

(Polynomial.X - Polynomial.C x).natSepDegree = 1


@[to_additive]
theorem prod_zpow (f : α → β) (s : Finset α) (n : ℤ) : ∏ a ∈ s, f a ^ n = (∏ a ∈ s, f a) ^ n

{α : Type u_3}
{β : Type u_4}
[SubtractionCommMonoid β]
(f : α → β)
(s : Finset α)
(n : ℤ)


theorem apply_eq_iff_eq (f : E) {x y : α} : f x = f y ↔ x = y

{E : Sort u_1}
{α : Sort u_3}
{β : Sort u_4}
[iE : EquivLike E α β]
(f : E)
{x y : α}


@[to_additive]
theorem is_mul_left_invariant_outerMeasure [Group G] [TopologicalGroup G]
    (h : ∀ (g : G) {K : Compacts G}, μ (K.map _ <| continuous_mul_left g) = μ K) (g : G)
    (A : Set G) : μ.outerMeasure ((g * ·) ⁻¹' A) = μ.outerMeasure A

(h :
  ∀ (g : G) {K : TopologicalSpace.Compacts G},
    (fun s => ↑(μ.toFun s)) (TopologicalSpace.Compacts.map (fun b => g + b) ⋯ K) = (fun s => ↑(μ.toFun s)) K)

μ.outerMeasure ((fun x => g + x) ⁻¹' A) = μ.outerMeasure A


/-- We have a bound for successive elements in the sequence `log (stirlingSeq k)`.
-/
theorem log_stirlingSeq_diff_le_geo_sum (n : ℕ) :
    log (stirlingSeq (n + 1)) - log (stirlingSeq (n + 2)) ≤
      ((1 : ℝ) / (2 * ↑(n + 1) + 1)) ^ 2 / (1 - ((1 : ℝ) / (2 * ↑(n + 1) + 1)) ^ 2)

Real.log (Stirling.stirlingSeq (n + 1)) - Real.log (Stirling.stirlingSeq (n + 2)) ≤
  (1 / (2 * ↑(n + 1) + 1)) ^ 2 / (1 - (1 / (2 * ↑(n + 1) + 1)) ^ 2)


theorem of.zero_exact_aux [Nonempty ι] [IsDirected ι (· ≤ ·)] {x : FreeCommRing (Σi, G i)}
    (H : (Ideal.Quotient.mk _ x : DirectLimit G fun i j h => f' i j h)
        = (0 : DirectLimit G fun i j h => f' i j h)) :
    ∃ j s, ∃ H : ∀ k : Σ i, G i, k ∈ s → k.1 ≤ j,
        IsSupported x s ∧
          ∀ [DecidablePred (· ∈ s)],
            lift (fun ix : s => f' ix.1.1 j (H ix ix.2) ix.1.2) (restriction s x) = (0 : G j)

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

(H :
  (Ideal.Quotient.mk
        (Ideal.span
          {a |
            (∃ i j,
                ∃ (H : i ≤ j),
                  ∃ x, FreeCommRing.of ⟨j, (fun i j h => ⇑(f' i j h)) i j H x⟩ - FreeCommRing.of ⟨i, x⟩ = a) ∨
              (∃ i, FreeCommRing.of ⟨i, 1⟩ - 1 = a) ∨
                (∃ i x y, FreeCommRing.of ⟨i, x + y⟩ - (FreeCommRing.of ⟨i, x⟩ + FreeCommRing.of ⟨i, y⟩) = a) ∨
                  ∃ i x y, FreeCommRing.of ⟨i, x * y⟩ - FreeCommRing.of ⟨i, x⟩ * FreeCommRing.of ⟨i, y⟩ = a}))
      x =
    0)

∃ j s,
  ∃ (H : ∀ k ∈ s, k.fst ≤ j),
    x.IsSupported s ∧
      ∀ [inst : DecidablePred fun x => x ∈ s],
        (FreeCommRing.lift fun ix => (f' (↑ix).fst j ⋯) (↑ix).snd) ((FreeCommRing.restriction s) x) = 0


/-- If `f = O[l] g` on measurably generated `l`, `f` is strongly measurable at `l`,
and `g` is integrable at `l`, then `f` is integrable at `l`. -/
theorem _root_.Asymptotics.IsBigO.integrableAtFilter [IsMeasurablyGenerated l]
    (hf : f =O[l] g) (hfm : StronglyMeasurableAtFilter f l μ) (hg : IntegrableAtFilter g l μ) :
    IntegrableAtFilter f l μ

(hg : MeasureTheory.IntegrableAtFilter g l μ)


@[simp]
theorem integral_log_of_neg (ha : a < 0) (hb : b < 0) :
    ∫ x in a..b, log x = b * log b - a * log a - b + a

∫ (x : ℝ) in a..b, Real.log x = b * Real.log b - a * Real.log a - b + a


theorem eqv_lt_iff_eq {α : Sort u} {lt : α → α → Prop} [IsTrichotomous α lt] [IsIrrefl α lt] (a b) :
    a ≈[lt]b ↔ a = b

{α : Sort u}
{lt : α → α → Prop}
[IsTrichotomous α lt]
[IsIrrefl α lt]
(a b : α)


lemma eventually_deriv_one_add_smoothingFn :
    deriv (fun x => 1 + ε x) =ᶠ[atTop] fun x => -x⁻¹ / (log x ^ 2)

(deriv fun x => 1 + AkraBazziRecurrence.smoothingFn x) =ᶠ[Filter.atTop] fun x => -x⁻¹ / Real.log x ^ 2


@[to_additive]
theorem mulSupport_mulSingle [DecidableEq B] :
    mulSupport (mulSingle a b) = if b = 1 then ∅ else {a}

{A : Type u_1}
{B : Type u_2}
[DecidableEq A]
[Zero B]
{a : A}
{b : B}
[DecidableEq B]

Function.support (Pi.single a b) = if b = 0 then ∅ else {a}


@[simp]
theorem upperClosure_sups [SemilatticeSup α] (s t : Set α) :
    upperClosure (s ⊻ t) = upperClosure s ⊔ upperClosure t

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


lemma Pi.continuous_restrict (S : Set ι) :
    Continuous (S.restrict : (∀ i : ι, π i) → (∀ i : S, π i))

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


theorem setAverage_congr_fun (hs : MeasurableSet s) (h : ∀ᵐ x ∂μ, x ∈ s → f x = g x) :
    ⨍ x in s, f x ∂μ = ⨍ x in s, g x ∂μ

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{μ : MeasureTheory.Measure α}
{s : Set α}
{f g : α → E}
(hs : MeasurableSet s)
(h : ∀ᵐ (x : α) ∂μ, x ∈ s → f x = g x)

⨍ (x : α) in s, f x ∂μ = ⨍ (x : α) in s, g x ∂μ


@[simp]
lemma toMatrix_baseChange (f : M₁ →ₗ[R] M₂) (b₁ : Basis ι R M₁) (b₂ : Basis ι₂ R M₂) :
    toMatrix (basis A b₁) (basis A b₂) (f.baseChange A) =
    (toMatrix b₁ b₂ f).map (algebraMap R A)

{R : Type u_1}
{M₁ : Type u_2}
{M₂ : Type u_3}
{ι : Type u_4}
{ι₂ : Type u_5}
(A : Type u_6)
[Fintype ι]
[Finite ι₂]
[DecidableEq ι]
[CommSemiring R]
[CommSemiring A]
[Algebra R A]
[AddCommMonoid M₁]
[Module R M₁]
[AddCommMonoid M₂]
[Module R M₂]
(f : M₁ →ₗ[R] M₂)
(b₁ : Basis ι R M₁)
(b₂ : Basis ι₂ R M₂)

(LinearMap.toMatrix (Algebra.TensorProduct.basis A b₁) (Algebra.TensorProduct.basis A b₂)) (LinearMap.baseChange A f) =
  ((LinearMap.toMatrix b₁ b₂) f).map ⇑(algebraMap R A)


@[simp]
theorem natDegree_map_eq_iff {f : R →+* S} {p : Polynomial R} :
    natDegree (map f p) = natDegree p ↔ f (p.leadingCoeff) ≠ 0 ∨ natDegree p = 0

{R : Type u}
{S : Type v}
[Semiring R]
[Semiring S]
{f : R →+* S}
{p : R[X]}

(Polynomial.map f p).natDegree = p.natDegree ↔ f p.leadingCoeff ≠ 0 ∨ p.natDegree = 0


@[ext]
theorem rightDistributor_ext_right {J : Type} [Fintype J]
    {f : J → C} {X Y : C} {g h : X ⟶ (⨁ f) ⊗ Y}
    (w : ∀ j, g ≫ (biproduct.π f j ▷ Y) = h ≫ (biproduct.π f j ▷ Y)) : g = h

{g h : X ⟶ CategoryTheory.MonoidalCategory.tensorObj (⨁ f) Y}

(w :
  ∀ (j : J),
    CategoryTheory.CategoryStruct.comp g
        (CategoryTheory.MonoidalCategory.whiskerRight (CategoryTheory.Limits.biproduct.π f j) Y) =
      CategoryTheory.CategoryStruct.comp h
        (CategoryTheory.MonoidalCategory.whiskerRight (CategoryTheory.Limits.biproduct.π f j) Y))


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


theorem IsCompact.isGreatest_sSup [ClosedIciTopology α] {s : Set α} (hs : IsCompact s)
    (ne_s : s.Nonempty) : IsGreatest s (sSup s)

{α : Type u_2}
[ConditionallyCompleteLinearOrder α]
[TopologicalSpace α]
[ClosedIciTopology α]
{s : Set α}
(hs : IsCompact s)
(ne_s : s.Nonempty)


/-- The set in the definition of subtraction is nonempty. -/
theorem sub_nonempty {a b : Ordinal} : { o | a ≤ b + o }.Nonempty


theorem comap_le_comap_iff {f g : Filter β} {m : α → β} (hf : range m ∈ f) :
    comap m f ≤ comap m g ↔ f ≤ g

{α : Type u}
{β : Type v}
{f g : Filter β}
{m : α → β}
(hf : Set.range m ∈ f)

Filter.comap m f ≤ Filter.comap m g ↔ f ≤ g


@[simp]
theorem mem_finsupport (x₀ : X) {i} :
    i ∈ ρ.finsupport x₀ ↔ i ∈ support fun i ↦ ρ i x₀

{ι : Type u}
{X : Type v}
[TopologicalSpace X]
{s : Set X}
(ρ : PartitionOfUnity ι X s)
(x₀ : X)
{i : ι}

i ∈ ρ.finsupport x₀ ↔ i ∈ Function.support fun i => (ρ i) x₀


/-- Constructs an isomorphism of groups with zero from a group isomorphism between them. -/
@[simps]
def Iso.mk {α β : GrpWithZero.{u}} (e : α ≃* β) : α ≅ β


@[simp] theorem mod_one (a : Int) : mod a 1 = 0


theorem get_modify {arr : Array α} {x i} (h : i < arr.size) :
    (arr.modify x f).get ⟨i, by simp [h]⟩ =
    if x = i then f (arr.get ⟨i, h⟩) else arr.get ⟨i, h⟩

{α : Type u_1}
{f : α → α}
{arr : Array α}
{x i : Nat}
(h : i < arr.size)

(arr.modify x f).get ⟨i, ⋯⟩ = if x = i then f (arr.get ⟨i, h⟩) else arr.get ⟨i, h⟩


/-- Extending a cocone by the identity does nothing. -/
@[simps!]
def extendId (s : Cocone F) : s ≅ s.extend (𝟙 s.pt)

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{F : J ⥤ C}
(s : CategoryTheory.Limits.Cocone F)

(CategoryTheory.Limits.Cocones.extendId s).hom.hom = 𝟙 s.pt


lemma preimage_val_subset_preimage_val_iff (s t u : Set α) :
    (Subtype.val ⁻¹' t : Set s) ⊆ Subtype.val ⁻¹' u ↔ s ∩ t ⊆ s ∩ u

Subtype.val ⁻¹' t ⊆ Subtype.val ⁻¹' u ↔ s ∩ t ⊆ s ∩ u


@[simp]
theorem max_insert {a : α} {s : Finset α} : (insert a s).max = max ↑a s.max

{α : Type u_2}
[LinearOrder α]
{a : α}
{s : Finset α}


theorem integrable_iff_mem_L1 {f : α →ₘ[μ] β} : Integrable f ↔ f ∈ (α →₁[μ] β)

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

f.Integrable ↔ f ∈ MeasureTheory.Lp β 1 μ


/-- A variant of `lift` with `Z` a terminal object. -/
@[simps!]
def liftToTerminal {D : Type*} [Category D] {Z : D} (F : C ⥤ D) (hZ : Limits.IsTerminal Z) :
    WithTerminal C ⥤ D

(hZ : CategoryTheory.Limits.IsTerminal Z)

(CategoryTheory.WithTerminal.liftToTerminal F hZ).obj X =
  match X with
  | CategoryTheory.WithTerminal.of x => F.obj x
  | CategoryTheory.WithTerminal.star => Z


/-- Given a homomorphism `f` from the quotient of a monoid by a congruence relation, `f` equals the
    homomorphism on the quotient induced by `f` composed with the natural map from the monoid to
    the quotient. -/
@[to_additive (attr := simp) "Given a homomorphism `f` from the quotient of an `AddMonoid` by an
additive congruence relation, `f` equals the homomorphism on the quotient induced by `f` composed
with the natural map from the `AddMonoid` to the quotient."]
theorem lift_apply_mk' (f : c.Quotient →* P) :
    (c.lift (f.comp c.mk') fun x y h => show f ↑x = f ↑y by rw [c.eq.2 h]) = f

{M : Type u_1}
{P : Type u_3}
[AddZeroClass M]
[AddZeroClass P]
{c : AddCon M}
(f : c.Quotient →+ P)


/-- If `f` is a linear map from `M₁` to `M₂` that preserves the quadratic forms, and if it has
a linear retraction `g` that also preserves the quadratic forms, then `CliffordAlgebra.map g`
is a retraction of `CliffordAlgebra.map f`. -/
lemma leftInverse_map_of_leftInverse {Q₁ : QuadraticForm R M₁} {Q₂ : QuadraticForm R M₂}
    (f : Q₁ →qᵢ Q₂) (g : Q₂ →qᵢ Q₁) (h : LeftInverse g f) : LeftInverse (map g) (map f)

{R : Type u_1}
[CommRing R]
{M₁ : Type u_4}
{M₂ : Type u_5}
[AddCommGroup M₁]
[AddCommGroup M₂]
[Module R M₁]
[Module R M₂]
{Q₁ : QuadraticForm R M₁}
{Q₂ : QuadraticForm R M₂}
(f : Q₁ →qᵢ Q₂)
(g : Q₂ →qᵢ Q₁)
(h : Function.LeftInverse ⇑g ⇑f)

Function.LeftInverse ⇑(CliffordAlgebra.map g) ⇑(CliffordAlgebra.map f)


/-- The linear map `Cochain K L n ≃+ Cochain (K⟦a⟧) (L⟦a⟧) n` when the category is `R`-linear. -/
@[simps!]
def shiftLinearMap (n a : ℤ) :
    Cochain K L n →ₗ[R] Cochain (K⟦a⟧) (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 : ℤ)

∀ (a_1 : CochainComplex.HomComplex.Cochain K L n),
  (CochainComplex.HomComplex.Cochain.shiftLinearMap R K L n a) a_1 = a_1.shift a


@[to_additive] lemma min_lt_max_of_mul_lt_mul
    [CovariantClass α α (· * ·) (· ≤ ·)] [CovariantClass α α (swap (· * ·)) (· ≤ ·)]
    (h : a * b < c * d) : min a b < max c d

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


theorem hasFiniteIntegral_congr' {f : α → β} {g : α → γ} (h : ∀ᵐ a ∂μ, ‖f a‖ = ‖g a‖) :
    HasFiniteIntegral f μ ↔ HasFiniteIntegral g μ

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup β]
[NormedAddCommGroup γ]
{f : α → β}
{g : α → γ}
(h : ∀ᵐ (a : α) ∂μ, ‖f a‖ = ‖g a‖)

MeasureTheory.HasFiniteIntegral f μ ↔ MeasureTheory.HasFiniteIntegral g μ


theorem zip_eq (s₁ : Stream' α) (s₂ : Stream' β) :
    zip f s₁ s₂ = f (head s₁) (head s₂)::zip f (tail s₁) (tail s₂)

{α : Type u}
{β : Type v}
{δ : Type w}
(f : α → β → δ)
(s₁ : Stream' α)
(s₂ : Stream' β)

Stream'.zip f s₁ s₂ = Stream'.cons (f s₁.head s₂.head) (Stream'.zip f s₁.tail s₂.tail)


theorem map_comp : map (g.comp f) = (map g).comp (map f)

{R : Type u_1}
[Semiring R]
{S : Type u_2}
{T : Type u_3}
[Semiring S]
[Semiring T]
(f : R →+* S)
(g : S →+* T)

PowerSeries.map (g.comp f) = (PowerSeries.map g).comp (PowerSeries.map f)


@[ext high]
theorem lhom_ext' {M : Type*} [AddCommMonoid M] [Module R M] {f g : R[X] →ₗ[R] M}
    (h : ∀ n, f.comp (monomial n) = g.comp (monomial n)) : f = g

(h : ∀ (n : ℕ), f ∘ₗ Polynomial.monomial n = g ∘ₗ Polynomial.monomial n)


@[simp]
theorem restrictScalars_inj (fₗ gₗ : M →ₗ[S] M₂) :
    fₗ.restrictScalars R = gₗ.restrictScalars R ↔ fₗ = gₗ

(R : Type u_1)
{S : Type u_6}
{M : Type u_9}
{M₂ : Type u_11}
[Semiring R]
[Semiring S]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R M₂]
[Module S M]
[Module S M₂]
[LinearMap.CompatibleSMul M M₂ R S]
(fₗ gₗ : M →ₗ[S] M₂)


theorem translationNumber_le_of_le_add {z : ℝ} (hz : ∀ x, f x ≤ x + z) : τ f ≤ z

(f : CircleDeg1Lift)
{z : ℝ}
(hz : ∀ (x : ℝ), f x ≤ x + z)


lemma div_eq_iff_mul_eq (hb : b ≠ 0) : a / b = c ↔ c * b = a

{G₀ : Type u_3}
[GroupWithZero G₀]
{a b c : G₀}
(hb : b ≠ 0)


@[simp] lemma δ_add (z₁ z₂ : Cochain F G n) : δ n m (z₁ + z₂) = δ n m z₁ + δ n m z₂

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

CochainComplex.HomComplex.δ n m (z₁ + z₂) = CochainComplex.HomComplex.δ n m z₁ + CochainComplex.HomComplex.δ n m z₂


lemma mul_add_mod_of_lt (h : c < b) : (a * b + c) % b = c


/-- Every object in `Mat_ C` is isomorphic to the biproduct of its summands.
-/
@[simps]
def isoBiproductEmbedding (M : Mat_ C) : M ≅ ⨁ fun i => (embedding C).obj (M.X i)

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

M.isoBiproductEmbedding.inv =
  CategoryTheory.Limits.biproduct.desc fun i j k => if h : i = k then CategoryTheory.eqToHom ⋯ else 0


theorem coeff_monomial : coeff (monomial n a) m = if n = m then a else 0

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

((Polynomial.monomial n) a).coeff m = if n = m then a else 0


theorem deriv_smul (hc : DifferentiableAt 𝕜 c x) (hf : DifferentiableAt 𝕜 f x) :
    deriv (fun y => c y • f y) x = c x • deriv f x + deriv c x • f x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : 𝕜 → F}
{x : 𝕜}
{𝕜' : Type u_2}
[NontriviallyNormedField 𝕜']
[NormedAlgebra 𝕜 𝕜']
[NormedSpace 𝕜' F]
[IsScalarTower 𝕜 𝕜' F]
{c : 𝕜 → 𝕜'}
(hc : DifferentiableAt 𝕜 c x)
(hf : DifferentiableAt 𝕜 f x)


lemma mem_closure_of_mem (M : Matroid α) (h : e ∈ X) (hX : X ⊆ M.E := by aesop_mat) :
    e ∈ M.closure X

{α : Type u_2}
{X : Set α}
{e : α}
(M : Matroid α)
(h : e ∈ X)
(hX : X ⊆ M.E := by aesop_mat)


lemma groupCohomologyπ_comp_isoH0_hom  :
    groupCohomologyπ A 0 ≫ (isoH0 A).hom = (isoZeroCocycles A).hom

{k G : Type u}
[CommRing k]
[Group G]
(A : Rep k G)

groupCohomologyπ A 0 ≫ (groupCohomology.isoH0 A).hom = (groupCohomology.isoZeroCocycles A).hom


@[simp]
theorem IsSymm.smul [SMul R α] {A : Matrix n n α} (h : A.IsSymm) (k : R) : (k • A).IsSymm

{α : Type u_1}
{n : Type u_3}
{R : Type u_5}
[SMul R α]
{A : Matrix n n α}
(h : A.IsSymm)
(k : R)


theorem Asymptotics.IsBigO.hasFDerivAt {x₀ : E} {n : ℕ} (h : f =O[𝓝 x₀] fun x => ‖x - x₀‖ ^ n)
    (hn : 1 < n) : HasFDerivAt f (0 : E →L[𝕜] F) x₀

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{x₀ : E}
{n : ℕ}
(h : f =O[𝓝 x₀] fun x => ‖x - x₀‖ ^ n)
(hn : 1 < n)


/-- The `v`-adic valuation of a product equals the product of the valuations. -/
theorem intValuation.map_mul' (x y : R) :
    v.intValuationDef (x * y) = v.intValuationDef x * v.intValuationDef y

(v : IsDedekindDomain.HeightOneSpectrum R)


@[simp]
theorem Prefunctor.costar_apply {u v : U} (e : u ⟶ v) :
    φ.costar v (Quiver.Costar.mk e) = Quiver.Costar.mk (φ.map e)

{U : Type u_1}
[Quiver U]
{V : Type u_2}
[Quiver V]
(φ : U ⥤q V)
{u v : U}
(e : u ⟶ v)


theorem div_C_mul : p / (C a * q) = C a⁻¹ * (p / q)

{R : Type u}
{a : R}
[Field R]
{p q : R[X]}

p / (Polynomial.C a * q) = Polynomial.C a⁻¹ * (p / q)


@[ext]
lemma hom_ext₄ {f g : ComposableArrows C 4} {φ φ' : f ⟶ g}
    (h₀ : app' φ 0 = app' φ' 0) (h₁ : app' φ 1 = app' φ' 1) (h₂ : app' φ 2 = app' φ' 2)
    (h₃ : app' φ 3 = app' φ' 3) (h₄ : app' φ 4 = app' φ' 4) :
    φ = φ'

{f g : CategoryTheory.ComposableArrows C 4}

(h₀ : CategoryTheory.ComposableArrows.app' φ 0 ⋯ = CategoryTheory.ComposableArrows.app' φ' 0 ⋯)

(h₁ : CategoryTheory.ComposableArrows.app' φ 1 ⋯ = CategoryTheory.ComposableArrows.app' φ' 1 ⋯)

(h₂ : CategoryTheory.ComposableArrows.app' φ 2 ⋯ = CategoryTheory.ComposableArrows.app' φ' 2 ⋯)

(h₃ : CategoryTheory.ComposableArrows.app' φ 3 ⋯ = CategoryTheory.ComposableArrows.app' φ' 3 ⋯)

(h₄ : CategoryTheory.ComposableArrows.app' φ 4 ⋯ = CategoryTheory.ComposableArrows.app' φ' 4 ⋯)


lemma mul_top' : ∀ (a : WithTop α), a * ⊤ = if a = 0 then 0 else ⊤

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


lemma tangentCoordChange_self {x z : M} {v : E} (h : z ∈ (extChartAt I x).source) :
    tangentCoordChange I x x z v = v

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_4}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_6}
[TopologicalSpace M]
[ChartedSpace H M]
[SmoothManifoldWithCorners I M]
{x z : M}
{v : E}
(h : z ∈ (extChartAt I x).source)


@[refl]
theorem manyOneEquiv_refl {α} [Primcodable α] (p : α → Prop) : ManyOneEquiv p p

{α : Type u_1}
[Primcodable α]
(p : α → Prop)


/-- The kernel of `quotLeftToQuotSup` -/
theorem ker_quotLeftToQuotSup : RingHom.ker (quotLeftToQuotSup I J) =
    J.map (Ideal.Quotient.mk I)

{R : Type u}
[CommRing R]
(I J : Ideal R)

RingHom.ker (DoubleQuot.quotLeftToQuotSup I J) = Ideal.map (Ideal.Quotient.mk I) J


@[simp]
theorem self_trans_symm (e : r ≃r s) : e.trans e.symm = RelIso.refl r

{α : Type u_1}
{β : Type u_2}
{r : α → α → Prop}
{s : β → β → Prop}
(e : r ≃r s)


@[simp]
theorem lTensor_smul_action (r : R) :
    (DistribMulAction.toLinearMap R N r).lTensor M =
      DistribMulAction.toLinearMap R (M ⊗[R] N) r

{R : Type u_1}
[CommSemiring R]
(M : Type u_4)
(N : Type u_5)
[AddCommMonoid M]
[AddCommMonoid N]
[Module R M]
[Module R N]
(r : R)

LinearMap.lTensor M (DistribMulAction.toLinearMap R N r) = DistribMulAction.toLinearMap R (TensorProduct R M N) r


@[simp]
theorem Matrix.toLin_finTwoProd_apply (a b c d : R) (x : R × R) :
    Matrix.toLin (Basis.finTwoProd R) (Basis.finTwoProd R) !![a, b; c, d] x =
      (a * x.fst + b * x.snd, c * x.fst + d * x.snd)

{R : Type u_1}
[CommSemiring R]
(a b c d : R)
(x : R × R)

((Matrix.toLin (Basis.finTwoProd R) (Basis.finTwoProd R)) !![a, b; c, d]) x = (a * x.1 + b * x.2, c * x.1 + d * x.2)


/-- A morphism of Eilenberg-Moore coalgebras for the comonad `G`. -/
-- Porting note(#5171): linter not ported yet
--@[ext, nolint has_nonempty_instance]
@[ext]
structure Hom (A B : Coalgebra G) where
  /-- The underlying morphism associated to a morphism of coalgebras. -/
  f : A.A ⟶ B.A
  /-- Compatibility with the structure morphism, for a morphism of coalgebras. -/
  h : A.a ≫ (G : C ⥤ C).map f = f ≫ B.a := by aesop_cat

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{G : CategoryTheory.Comonad C}
{A B : G.Coalgebra}
(self : A.Hom B)

CategoryTheory.CategoryStruct.comp A.a (G.map self.f) = CategoryTheory.CategoryStruct.comp self.f B.a


theorem Ico_toDual : Ico (toDual a) (toDual b) = (Ioc b a).map toDual.toEmbedding

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

Finset.Ico (OrderDual.toDual a) (OrderDual.toDual b) = Finset.map OrderDual.toDual.toEmbedding (Finset.Ioc b a)


theorem le_def : K ≤ K' ↔ (K : Set L) ⊆ K'

{R : Type u}
{L : Type v}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
(K K' : LieSubalgebra R L)


@[simp]
theorem apply_symm_apply (e : M ≃ₗ⁅R,L⁆ N) : ∀ x, e (e.symm x) = x

{R : Type u}
{L : Type v}
{M : Type w}
{N : Type w₁}
[CommRing R]
[LieRing L]
[AddCommGroup M]
[AddCommGroup N]
[Module R M]
[Module R N]
[LieRingModule L M]
[LieRingModule L N]
(e : M ≃ₗ⁅R,L⁆ N)
(x : N)


@[mono]
theorem rowLen_anti (μ : YoungDiagram) (i1 i2 : ℕ) (hi : i1 ≤ i2) : μ.rowLen i2 ≤ μ.rowLen i1


/-- $x^n-y^n = (x-y) \sum x^ky^{n-1-k}$ reformulated without `-` signs. -/
theorem geom_sum₂_mul_add [CommSemiring α] (x y : α) (n : ℕ) :
    (∑ i ∈ range n, (x + y) ^ i * y ^ (n - 1 - i)) * x + y ^ n = (x + y) ^ n

{α : Type u}
[CommSemiring α]
(x y : α)
(n : ℕ)

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


theorem onBoundedFormula_symm (φ : L ≃ᴸ L') :
    (φ.onBoundedFormula.symm : L'.BoundedFormula α n ≃ L.BoundedFormula α n) =
      φ.symm.onBoundedFormula

{L : FirstOrder.Language}
{L' : FirstOrder.Language}
{α : Type u'}
{n : ℕ}
(φ : L ≃ᴸ L')


@[to_additive]
theorem tprod_range {g : γ → β} (f : β → α) (hg : Injective g) :
    ∏' x : Set.range g, f x = ∏' x, f (g x)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[AddCommMonoid α]
[TopologicalSpace α]
{g : γ → β}
(f : β → α)
(hg : Function.Injective g)

∑' (x : ↑(Set.range g)), f ↑x = ∑' (x : γ), f (g x)


/-- A basic equivalence `A ≅ B'` obtained by composing `eA : A ≅ A'` and `e' : A' ≅ B'`. -/
@[simps! functor inverse unitIso_hom_app]
def equivalence₀ : A ≌ B'

{A : Type u_1}
{A' : Type u_2}
{B' : Type u_4}
[CategoryTheory.Category.{u_5, u_1} A]
[CategoryTheory.Category.{u_6, u_2} A']
[CategoryTheory.Category.{u_7, u_4} B']
(eA : A ≌ A')
(e' : A' ≌ B')
(X : A)

(AlgebraicTopology.DoldKan.Compatibility.equivalence₀ eA e').unitIso.hom.app X =
  eA.unitIso.hom.app X ≫ eA.inverse.map (e'.unitIso.hom.app (eA.functor.obj X))