lemma even_sub' (h : n ≤ m) : Even (m - n) ↔ (Odd m ↔ Odd n)


theorem foldr_rev (f : α → Fin n → α) (x) :
     foldr n (fun i x => f x i.rev) x = foldl n f x

{α : Sort u_1}
{n : Nat}
(f : α → Fin n → α)
(x : α)

Fin.foldr n (fun i x => f x i.rev) x = Fin.foldl n f x


@[simp] lemma Finset.centerMass_neg_left : t.centerMass (-w) z = t.centerMass w z

{R : Type u_1}
{E : Type u_3}
{ι : Type u_5}
[LinearOrderedField R]
[AddCommGroup E]
[Module R E]
(t : Finset ι)
{w : ι → R}
(z : ι → E)


/-- Equality of elements of `AutGalois F` can be checked on the projections on each pointed
Galois object. -/
lemma AutGalois.ext {f g : AutGalois F}
    (h : ∀ (A : PointedGaloisObject F), AutGalois.π F A f = AutGalois.π F A g) : f = g

(F : CategoryTheory.Functor C FintypeCat)

{f g : CategoryTheory.PreGaloisCategory.AutGalois F}

(h :
  ∀ (A : CategoryTheory.PreGaloisCategory.PointedGaloisObject F),
    (CategoryTheory.PreGaloisCategory.AutGalois.π F A) f = (CategoryTheory.PreGaloisCategory.AutGalois.π F A) g)


@[to_additive (attr := simp)]
theorem prod_dite_eq [DecidableEq α] (s : Finset α) (a : α) (b : ∀ x : α, a = x → β) :
    ∏ x ∈ s, (if h : a = x then b x h else 1) = ite (a ∈ s) (b a rfl) 1

{α : Type u_3}
{β : Type u_4}
[CommMonoid β]
[DecidableEq α]
(s : Finset α)
(a : α)
(b : (x : α) → a = x → β)

(∏ x ∈ s, if h : a = x then b x h else 1) = if a ∈ s then b a ⋯ else 1


theorem isClosed_setOf_map_smul {N : Type*} [Monoid N] (α β) [MulAction M α] [MulAction N β]
    [TopologicalSpace β] [T2Space β] [ContinuousConstSMul N β] (σ : M → N) :
    IsClosed { f : α → β | ∀ c x, f (c • x) = σ c • f x }

{M : Type u_1}
[Monoid M]
{N : Type u_4}
[Monoid N]
(α : Type u_5)
(β : Type u_6)
[MulAction M α]
[MulAction N β]
[TopologicalSpace β]
[T2Space β]
[ContinuousConstSMul N β]
(σ : M → N)

IsClosed {f | ∀ (c : M) (x : α), f (c • x) = σ c • f x}


/-- in a `T1Space`, coatoms of `TopologicalSpace.Opens α` are precisely complements of singletons:
`(TopologicalSpace.Closeds.singleton x).compl`. -/
theorem Opens.isCoatom_iff [T1Space α] {s : Opens α} :
    IsCoatom s ↔ ∃ x, s = (Closeds.singleton x).compl

{α : Type u_2}
[TopologicalSpace α]
[T1Space α]
{s : TopologicalSpace.Opens α}

IsCoatom s ↔ ∃ x, s = (TopologicalSpace.Closeds.singleton x).compl


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

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


@[ext]
theorem ext ⦃α β : X ≅ Y⦄ (w : α.hom = β.hom) : α = β

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X Y : C}
⦃α β : X ≅ Y⦄
(w : α.hom = β.hom)


@[simp (default + 1)] -- otherwise `simp` doesn't use `forall_image₂_iff`
lemma sup_image₂_le {g : γ → δ} {a : δ} :
    sup (image₂ f s t) g ≤ a ↔ ∀ x ∈ s, ∀ y ∈ t, g (f x y) ≤ a

{α : Type u_1}
{β : Type u_3}
{γ : Type u_5}
{δ : Type u_7}
[DecidableEq γ]
{f : α → β → γ}
{s : Finset α}
{t : Finset β}
[SemilatticeSup δ]
[OrderBot δ]
{g : γ → δ}
{a : δ}

(Finset.image₂ f s t).sup g ≤ a ↔ ∀ x ∈ s, ∀ y ∈ t, g (f x y) ≤ a


@[to_additive]
theorem map_srange (g : N →ₙ* P) (f : M →ₙ* N) : f.srange.map g = (g.comp f).srange

{M : Type u_1}
{N : Type u_2}
{P : Type u_3}
[Mul M]
[Mul N]
[Mul P]
(g : N →ₙ* P)
(f : M →ₙ* N)

Subsemigroup.map g f.srange = (g.comp f).srange


lemma dblXYZ_of_Y_eq' [NoZeroDivisors R] {P Q : Fin 3 → R} (hQz : Q z ≠ 0)
    (hx : P x * Q z ^ 2 = Q x * P z ^ 2) (hy : P y * Q z ^ 3 = Q y * P z ^ 3)
    (hy' : P y * Q z ^ 3 = W'.negY Q * P z ^ 3) :
    W'.dblXYZ P = ![W'.dblU P ^ 2, W'.dblU P ^ 3, 0]


@[simp] lemma ceilDiv_of_nonpos (ha : a ≤ 0) (b : β) : b ⌈/⌉ a = 0

{α : Type u_2}
{β : Type u_3}
[OrderedAddCommMonoid α]
[OrderedAddCommMonoid β]
[SMulZeroClass α β]
[CeilDiv α β]
{a : α}
(ha : a ≤ 0)
(b : β)


lemma W_sheafToPreheaf_map_iff_isIso {F₁ F₂ : Sheaf J A} (φ : F₁ ⟶ F₂) :
    J.W ((sheafToPresheaf J A).map φ) ↔ IsIso φ

(J : CategoryTheory.GrothendieckTopology C)

J.W ((CategoryTheory.sheafToPresheaf J A).map φ) ↔ CategoryTheory.IsIso φ


@[simp]
theorem walkingParallelPairOp_zero : walkingParallelPairOp.obj zero = op one

CategoryTheory.Limits.walkingParallelPairOp.obj CategoryTheory.Limits.WalkingParallelPair.zero =
  Opposite.op CategoryTheory.Limits.WalkingParallelPair.one


@[simp]
theorem LinearMap.coe_isometryOfOrthonormal (f : E →ₗ[𝕜] E') {v : Basis ι 𝕜 E}
    (hv : Orthonormal 𝕜 v) (hf : Orthonormal 𝕜 (f ∘ v)) : ⇑(f.isometryOfOrthonormal hv hf) = f

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{ι : Type u_4}
{E' : Type u_7}
[NormedAddCommGroup E']
[InnerProductSpace 𝕜 E']
(f : E →ₗ[𝕜] E')
{v : Basis ι 𝕜 E}
(hv : Orthonormal 𝕜 ⇑v)
(hf : Orthonormal 𝕜 (⇑f ∘ ⇑v))


theorem charpoly_degree_eq_dim [Nontrivial R] (M : Matrix n n R) :
    M.charpoly.degree = Fintype.card n

{R : Type u}
[CommRing R]
{n : Type v}
[DecidableEq n]
[Fintype n]
[Nontrivial R]
(M : Matrix n n R)


lemma lie_baseChange {I : LieIdeal R L} {N : LieSubmodule R L M} :
    ⁅I, N⁆.baseChange A = ⁅I.baseChange A, N.baseChange A⁆

(R : Type u_1)
(A : Type u_2)
(L : Type u_3)
(M : Type u_4)
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
[CommRing A]
[Algebra R A]
{I : LieIdeal R L}
{N : LieSubmodule R L M}

LieSubmodule.baseChange A ⁅I, N⁆ = ⁅LieSubmodule.baseChange A I, LieSubmodule.baseChange A N⁆


@[reassoc (attr := simp)]
lemma colimitHomIsoLimitYoneda_hom_comp_π [HasLimitsOfShape Iᵒᵖ (Type u₂)] (A : C) (i : I) :
    (colimitHomIsoLimitYoneda F A).hom ≫ limit.π (F.op ⋙ 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.op.comp (CategoryTheory.yoneda.obj A)) (Opposite.op i)) =
  (CategoryTheory.coyoneda.map (CategoryTheory.Limits.colimit.ι F i).op).app A


@[to_additive]
theorem comap_inf_map_of_injective (S T : Submonoid M) : (S.map f ⊓ T.map f).comap f = S ⊓ T

{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]
{f : F}
(hf : Function.Injective ⇑f)
(S T : AddSubmonoid M)

AddSubmonoid.comap f (AddSubmonoid.map f S ⊓ AddSubmonoid.map f T) = S ⊓ T


theorem comp_iff {X Y Z : Scheme} (f : X ⟶ Y) (g : Y ⟶ Z) [IsPreimmersion g] :
    IsPreimmersion (f ≫ g) ↔ IsPreimmersion f

{X Y Z : AlgebraicGeometry.Scheme}
(f : X ⟶ Y)
(g : Y ⟶ Z)
[AlgebraicGeometry.IsPreimmersion g]

AlgebraicGeometry.IsPreimmersion (f ≫ g) ↔ AlgebraicGeometry.IsPreimmersion f


@[simp]
theorem unop_star [Star R] (r : Rᵐᵒᵖ) : unop (star r) = star (unop r)

MulOpposite.unop (star r) = star (MulOpposite.unop r)


theorem effectiveEpi_desc_iff_effectiveEpiFamily {α : Type} [Finite α]
    {B : C} (X : α → C) (π : (a : α) → X a ⟶ B) :
    EffectiveEpi (Sigma.desc π) ↔ EffectiveEpiFamily X π

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.FinitaryPreExtensive C]
{α : Type}
[Finite α]
{B : C}
(X : α → C)
(π : (a : α) → X a ⟶ B)

CategoryTheory.EffectiveEpi (CategoryTheory.Limits.Sigma.desc π) ↔ CategoryTheory.EffectiveEpiFamily X π


@[symm] theorem IsRelPrime.symm (H : IsRelPrime x y) : IsRelPrime y x

{α : Type u_1}
[CommMonoid α]
{x y : α}
(H : IsRelPrime x y)


theorem argmax_cons (f : α → β) (a : α) (l : List α) :
    argmax f (a :: l) =
      Option.casesOn (argmax f l) (some a) fun c => if f a < f c then some c else some a

{α : Type u_1}
{β : Type u_2}
[LinearOrder β]
(f : α → β)
(a : α)
(l : List α)

List.argmax f (a :: l) = Option.casesOn (List.argmax f l) (some a) fun c => if f a < f c then some c else some a


@[simp]
theorem sq_abs_sub_sq_im (z : ℂ) : Complex.abs z ^ 2 - z.im ^ 2 = z.re ^ 2


lemma map_δ :
    (G.mapHomologicalComplex (ComplexShape.up ℤ)).map (triangle φ).mor₃ ≫
      NatTrans.app ((Functor.mapHomologicalComplex G (ComplexShape.up ℤ)).commShiftIso  1).hom K =
    (mapHomologicalComplexIso φ G).hom ≫
      (triangle ((G.mapHomologicalComplex (ComplexShape.up ℤ)).map φ)).mor₃

(G.mapHomologicalComplex (ComplexShape.up ℤ)).map (CochainComplex.mappingCone.triangle φ).mor₃ ≫
    ((G.mapHomologicalComplex (ComplexShape.up ℤ)).commShiftIso 1).hom.app K =
  (CochainComplex.mappingCone.mapHomologicalComplexIso φ G).hom ≫
    (CochainComplex.mappingCone.triangle ((G.mapHomologicalComplex (ComplexShape.up ℤ)).map φ)).mor₃


@[simp]
theorem LinearMap.toMatrix'_apply (f : (n → R) →ₗ[R] m → R) (i j) :
    LinearMap.toMatrix' f i j = f (fun j' ↦ if j' = j then 1 else 0) i

{R : Type u_1}
[CommSemiring R]
{m : Type u_4}
{n : Type u_5}
[DecidableEq n]
[Fintype n]
(f : (n → R) →ₗ[R] m → R)
(i : m)
(j : n)

LinearMap.toMatrix' f i j = f (fun j' => if j' = j then 1 else 0) i


theorem ofReal_div_of_pos {x y : ℝ} (hy : 0 < y) :
    ENNReal.ofReal (x / y) = ENNReal.ofReal x / ENNReal.ofReal y


theorem isReflection_of_mem_leftInvSeq (ω : List B) {t : W} (ht : t ∈ lis ω) :
    cs.IsReflection t

{B : Type u_1}
{W : Type u_2}
[Group W]
{M : CoxeterMatrix B}
(cs : CoxeterSystem M W)
(ω : List B)
{t : W}
(ht : t ∈ cs.leftInvSeq ω)


/-- A filter with the countable intersection property that is finer than the principal filter on
a Lindelöf set `s` contains any open set that contains all clusterpoints of `s`. -/
theorem IsLindelof.adherence_nhdset {f : Filter X} [CountableInterFilter f] (hs : IsLindelof s)
    (hf₂ : f ≤ 𝓟 s) (ht₁ : IsOpen t) (ht₂ : ∀ x ∈ s, ClusterPt x f → x ∈ t) : t ∈ f

{X : Type u}
[TopologicalSpace X]
{s t : Set X}
{f : Filter X}
[CountableInterFilter f]
(hs : IsLindelof s)
(hf₂ : f ≤ 𝓟 s)
(ht₁ : IsOpen t)
(ht₂ : ∀ x ∈ s, ClusterPt x f → x ∈ t)


@[simp]
theorem evalFrom_singleton (S : Set σ) (a : α) : M.evalFrom S [a] = M.stepSet S a

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


theorem Fintype.univ_empty : @univ Empty _ = ∅


/-- If all the binary fans involved a limit cones, `BinaryFan.assoc` produces another limit cone.
-/
@[simps]
def IsLimit.assoc {X Y Z : C} {sXY : BinaryFan X Y} (P : IsLimit sXY) {sYZ : BinaryFan Y Z}
    (Q : IsLimit sYZ) {s : BinaryFan sXY.pt Z} (R : IsLimit s) : IsLimit (BinaryFan.assoc Q s)

{sXY : CategoryTheory.Limits.BinaryFan X Y}

{sYZ : CategoryTheory.Limits.BinaryFan Y Z}

{s : CategoryTheory.Limits.BinaryFan sXY.pt Z}

(t : CategoryTheory.Limits.Cone (CategoryTheory.Limits.pair X sYZ.pt))

(P.assoc Q R).lift t = R.lift (CategoryTheory.Limits.BinaryFan.assocInv P t)


@[simp] theorem utf8Len_eq_zero : utf8Len l = 0 ↔ l = []


theorem isTorsionBySet_iff_is_torsion_by_span :
    IsTorsionBySet R M s ↔ IsTorsionBySet R M (Ideal.span s)

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
(s : Set R)

Module.IsTorsionBySet R M s ↔ Module.IsTorsionBySet R M ↑(Ideal.span s)


/-- Given a right homology map data for morphism `φ`, this is the induced right homology
map data for `a • φ`. -/
@[simps]
def smul (a : R) : RightHomologyMapData (a • φ) h₁ h₂

(γ : CategoryTheory.ShortComplex.RightHomologyMapData φ h₁ h₂)


theorem associatedPrimes.nonempty [IsNoetherianRing R] [Nontrivial M] :
    (associatedPrimes R M).Nonempty

(R : Type u_1)
[CommRing R]
(M : Type u_2)
[AddCommGroup M]
[Module R M]
[IsNoetherianRing R]
[Nontrivial M]


@[gcongr] theorem tsub_le_tsub (hab : a ≤ b) (hcd : c ≤ d) : a - d ≤ b - c

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


@[simp] lemma _root_.isCauSeq_neg : IsCauSeq abv (-f) ↔ IsCauSeq abv f

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


/-- The recursive step of `scanl` splits a vector made up of a single element
`x ::ᵥ nil : Vector α 1` into a `Vector` of the provided starting value `b : β`
and the mapped `f b x : β` as the last value.
-/
@[simp]
theorem scanl_singleton (v : Vector α 1) : scanl f b v = b ::ᵥ f b v.head ::ᵥ nil

{α : Type u_1}
{β : Type u_2}
(f : β → α → β)
(b : β)
(v : Mathlib.Vector α 1)

Mathlib.Vector.scanl f b v = b ::ᵥ f b v.head ::ᵥ Mathlib.Vector.nil


theorem iff_of_false (ha : ¬a) (hb : ¬b) : a ↔ b


theorem eq_of_perm_primeFactorsList {a b : ℕ} (ha : a ≠ 0) (hb : b ≠ 0)
    (h : a.primeFactorsList ~ b.primeFactorsList) : a = b

(h : a.primeFactorsList.Perm b.primeFactorsList)


/-- The fully faithful embedding of `CompactlyGenerated` in `TopCat`. -/
@[simps!]
def compactlyGeneratedToTop : CompactlyGenerated.{u, w} ⥤ TopCat.{w}

∀ {X Y : CategoryTheory.InducedCategory TopCat CompactlyGenerated.toTop} (f : X ⟶ Y),
  CompactlyGenerated.compactlyGeneratedToTop.map f = f


@[to_additive (attr := simp, norm_cast)]
theorem toSubgroup_prod (U : OpenSubgroup G) (V : OpenSubgroup H) :
    (U.prod V : Subgroup (G × H)) = (U : Subgroup G).prod V

{G : Type u_1}
[AddGroup G]
[TopologicalSpace G]
{H : Type u_2}
[AddGroup H]
[TopologicalSpace H]
(U : OpenAddSubgroup G)
(V : OpenAddSubgroup H)


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

(CategoryTheory.ShortComplex.LeftHomologyData.ofEpiOfIsIsoOfMono φ h).i = CategoryTheory.CategoryStruct.comp h.i φ.τ₂


lemma involutive_invert : Involutive (invert (R := R))


@[to_additive (attr := simp)]
theorem ker_toHomUnits {M} [Monoid M] (f : G →* M) : f.toHomUnits.ker = f.ker

{G : Type u_1}
[Group G]
{M : Type u_8}
[Monoid M]
(f : G →* M)


theorem nndist_conj_self (z : ℂ) : nndist (conj z) z = 2 * Real.nnabs z.im

nndist ((starRingEnd ℂ) z) z = 2 * Real.nnabs z.im


/-- The preimage of a submonoid under a monoid hom is a submonoid of the domain. -/
@[to_additive
      "The preimage of an `AddSubmonoid` under an `AddMonoid` hom is
      an `AddSubmonoid` of the domain."]
theorem IsSubmonoid.preimage {N : Type*} [Monoid N] {f : M → N} (hf : IsMonoidHom f) {s : Set N}
    (hs : IsSubmonoid s) : IsSubmonoid (f ⁻¹' s)

{M : Type u_1}
[Monoid M]
{N : Type u_3}
[Monoid N]
{f : M → N}
(hf : IsMonoidHom f)
{s : Set N}
(hs : IsSubmonoid s)


theorem le_iff (f g : ι →₀ α) : f ≤ g ↔ ∀ i ∈ f.support, f i ≤ g i

{ι : Type u_1}
{α : Type u_2}
[CanonicallyOrderedAddCommMonoid α]
(f g : ι →₀ α)


@[simp]
theorem prod_top : (prod ⊤ ⊤ : Submodule R (M × M')) = ⊤

{R : Type u_1}
{M : Type u_4}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{M' : Type u_9}
[AddCommMonoid M']
[Module R M']


theorem range_eq_map_coprodSubtypeLEquivOfIsCompl {F : Type*} [NormedAddCommGroup F]
    [NormedSpace 𝕜 F] [CompleteSpace F] (f : E →L[𝕜] F) {G : Submodule 𝕜 F}
    (h : IsCompl (LinearMap.range f) G) [CompleteSpace G] (hker : ker f = ⊥) :
    LinearMap.range f =
      ((⊤ : Submodule 𝕜 E).prod (⊥ : Submodule 𝕜 G)).map
        (f.coprodSubtypeLEquivOfIsCompl h hker : E × G →ₗ[𝕜] F)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[CompleteSpace E]
{F : Type u_5}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[CompleteSpace F]
(f : E →L[𝕜] F)
{G : Submodule 𝕜 F}
(h : IsCompl (LinearMap.range f) G)
[CompleteSpace ↥G]
(hker : LinearMap.ker f = ⊥)

LinearMap.range f = Submodule.map (↑↑(f.coprodSubtypeLEquivOfIsCompl h hker)) (⊤.prod ⊥)


theorem ediam_of_unbounded (h : ¬IsBounded s) : EMetric.diam s = ∞

{α : Type u}
[PseudoMetricSpace α]
{s : Set α}
(h : ¬Bornology.IsBounded s)


theorem le_add_ge (a : Nat) {b c : Nat} (h : a ≥ c) : (a ≤ b + c) = (a - c ≤ b)


/-- The natural `ℝ`-linear isometry equivalence between `𝕜` satisfying `RCLike 𝕜` and `ℝ` when
`RCLike.I = 0`. -/
@[simps]
noncomputable def realLinearIsometryEquiv (h : I = (0 : K)) : K ≃ₗᵢ[ℝ] ℝ

{K : Type u_1}
[RCLike K]
(h : RCLike.I = 0)

∀ (a : ℝ), (RCLike.realLinearIsometryEquiv h).invFun a = (RCLike.realRingEquiv h).invFun a


@[simp]
theorem comp_id (p : Seminorm 𝕜 E) : p.comp LinearMap.id = p

{𝕜 : Type u_3}
{E : Type u_7}
[SeminormedRing 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
(p : Seminorm 𝕜 E)


@[to_additive]
theorem iInter₂_div_subset (s : ∀ i, κ i → Set α) (t : Set α) :
    (⋂ (i) (j), s i j) / t ⊆ ⋂ (i) (j), s i j / t

{α : Type u_2}
{ι : Sort u_5}
{κ : ι → Sort u_6}
[Sub α]
(s : (i : ι) → κ i → Set α)
(t : Set α)

(⋂ i, ⋂ j, s i j) - t ⊆ ⋂ i, ⋂ j, s i j - t


theorem zmodChar_apply' {n : ℕ} [NeZero n] {ζ : C} (hζ : ζ ^ n = 1) (a : ℕ) :
    zmodChar n hζ a = ζ ^ a

{C : Type v}
[CommMonoid C]
{n : ℕ}
[NeZero n]
{ζ : C}
(hζ : ζ ^ n = 1)
(a : ℕ)


@[reassoc (attr := simp)]
theorem δ_naturality {X' X : CosimplicialObject C} (f : X ⟶ X') {n : ℕ} (i : Fin (n + 2)) :
    X.δ i ≫ f.app (SimplexCategory.mk (n + 1)) = f.app (SimplexCategory.mk n) ≫ X'.δ i

{X' X : CategoryTheory.CosimplicialObject C}


theorem subset_of_ssubset (h : a ⊂ b) : a ⊆ b

[IsNonstrictStrictOrder α (fun x x_1 => x ⊆ x_1) fun x x_1 => x ⊂ x_1]


theorem has_colimits_of_finite_and_filtered [HasFiniteColimits C]
    [HasFilteredColimitsOfSize.{w, w} C] : HasColimitsOfSize.{w, w} C

[CategoryTheory.Limits.HasFilteredColimitsOfSize.{w, w, v, u} C]

CategoryTheory.Limits.HasColimitsOfSize.{w, w, v, u} C


/-- A sheaf of modules is a presheaf of modules such that the underlying presheaf
of abelian groups is a sheaf. -/
structure SheafOfModules where
  /-- the underlying presheaf of modules of a sheaf of modules -/
  val : PresheafOfModules.{v} R.val
  isSheaf : Presheaf.IsSheaf J val.presheaf

{J : CategoryTheory.GrothendieckTopology C}


protected lemma MapsTo.extendDomain (h : MapsTo g s t) :
    MapsTo (g.extendDomain f) ((↑) ∘ f '' s) ((↑) ∘ f '' t)

{α : Type u_1}
{β : Type u_2}
{p : β → Prop}
[DecidablePred p]
{f : α ≃ Subtype p}
{g : Equiv.Perm α}
{s t : Set α}
(h : Set.MapsTo (⇑g) s t)

Set.MapsTo (⇑(g.extendDomain f)) (Subtype.val ∘ ⇑f '' s) (Subtype.val ∘ ⇑f '' t)


/-- The unbundled `directLimit` of modules is a colimit
in the sense of `CategoryTheory`. -/
@[simps]
def directLimitIsColimit [IsDirected ι (· ≤ ·)] : IsColimit (directLimitCocone G f)

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

(s : CategoryTheory.Limits.Cocone (ModuleCat.directLimitDiagram G f))

(ModuleCat.directLimitIsColimit G f).desc s = Module.DirectLimit.lift R ι G f s.ι.app ⋯


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

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


theorem le_div_iff_mul_le {I J J' : FractionalIdeal R₁⁰ K} (hJ' : J' ≠ 0) :
    I ≤ J / J' ↔ I * J' ≤ J

{R₁ : Type u_3}
[CommRing R₁]
{K : Type u_4}
[Field K]
[Algebra R₁ K]
[frac : IsFractionRing R₁ K]
[IsDomain R₁]
{I J J' : FractionalIdeal R₁⁰ K}
(hJ' : J' ≠ 0)


@[simp]
theorem moveRight_mk {xl xr xL xR} : (⟨xl, xr, xL, xR⟩ : PGame).moveRight = xR

{xl xr : Type u_1}
{xL : xl → SetTheory.PGame}
{xR : xr → SetTheory.PGame}

(SetTheory.PGame.mk xl xr xL xR).moveRight = xR


theorem closure.mono (h : t₁ ≤ t₂) : closure[t₁] s ⊆ closure[t₂] s

{α : Type u_1}
{t₁ t₂ : TopologicalSpace α}
{s : Set α}
(h : t₁ ≤ t₂)


theorem MeasurablySeparable.iUnion [Countable ι] {α : Type*} [MeasurableSpace α] {s t : ι → Set α}
    (h : ∀ m n, MeasurablySeparable (s m) (t n)) : MeasurablySeparable (⋃ n, s n) (⋃ m, t m)

(h : ∀ (m n : ι), MeasureTheory.MeasurablySeparable (s m) (t n))

MeasureTheory.MeasurablySeparable (⋃ n, s n) (⋃ m, t m)


theorem mul_def [Add α] [Mul α] [One α] [OfNat α 2] [Invertible (2 : α)] (a b : αˢʸᵐ) :
    a * b = sym (⅟ 2 * (unsym a * unsym b + unsym b * unsym a))

{α : Type u_1}
[Add α]
[Mul α]
[One α]
[OfNat α 2]
[Invertible 2]
(a b : αˢʸᵐ)

a * b = SymAlg.sym (⅟2 * (SymAlg.unsym a * SymAlg.unsym b + SymAlg.unsym b * SymAlg.unsym a))


/-- If two homomorphisms from a division monoid to a monoid are equal at a unit `x`, then they are
equal at `x⁻¹`. -/
@[to_additive
  "If two homomorphisms from a subtraction monoid to an additive monoid are equal at an
  additive unit `x`, then they are equal at `-x`."]
theorem IsUnit.eq_on_inv {F G N} [DivisionMonoid G] [Monoid N] [FunLike F G N]
    [MonoidHomClass F G N] {x : G} (hx : IsUnit x) (f g : F) (h : f x = g x) : f x⁻¹ = g x⁻¹

{F : Type u_1}
{G : Type u_2}
{N : Type u_3}
[DivisionMonoid G]
[Monoid N]
[FunLike F G N]
[MonoidHomClass F G N]
{x : G}
(hx : IsUnit x)
(f g : F)
(h : f x = g x)


@[to_additive (attr := simp)]
theorem mulRothNumber_singleton (a : α) : mulRothNumber ({a} : Finset α) = 1

{α : Type u_2}
[DecidableEq α]
[AddMonoid α]
(a : α)


/-- Given `X : T`, to upgrade a functor `F : S ⥤ T` to a functor `S ⥤ Under X`, it suffices to
    provide maps `X ⟶ F.obj Y` for all `Y` making the obvious triangles involving all `F.map g`
    commute.  -/
@[simps! obj_right map_right]
def toUnder (F : S ⥤ T) (X : T) (f : (Y : S) → X ⟶ F.obj Y)
    (h : ∀ {Y Z : S} (g : Y ⟶ Z), f Y ≫ F.map g = f Z) : S ⥤ Under X

(h : ∀ {Y Z : S} (g : Y ⟶ Z), CategoryTheory.CategoryStruct.comp (f Y) (F.map g) = f Z)

∀ {X_1 Y : S} (g : X_1 ⟶ Y), ((F.toUnder X f h).map g).right = F.map g


@[mono]
theorem EventuallyLE.inter {s t s' t' : Set α} {l : Filter α} (h : s ≤ᶠ[l] t) (h' : s' ≤ᶠ[l] t') :
    (s ∩ s' : Set α) ≤ᶠ[l] (t ∩ t' : Set α)

{α : Type u}
{s t s' t' : Set α}
{l : Filter α}
(h : s ≤ᶠ[l] t)
(h' : s' ≤ᶠ[l] t')


theorem fderiv.snd (h : DifferentiableAt 𝕜 f₂ x) :
    fderiv 𝕜 (fun x => (f₂ x).2) x = (snd 𝕜 F G).comp (fderiv 𝕜 f₂ x)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{x : E}
{f₂ : E → F × G}
(h : DifferentiableAt 𝕜 f₂ x)

fderiv 𝕜 (fun x => (f₂ x).2) x = (ContinuousLinearMap.snd 𝕜 F G).comp (fderiv 𝕜 f₂ x)


theorem hasDerivAt_arctan' (x : ℝ) : HasDerivAt arctan (1 + x ^ 2)⁻¹ x


/-- Multiplicative congruence relations preserve natural powers. -/
@[to_additive "Additive congruence relations preserve natural scaling."]
protected theorem pow {M : Type*} [Monoid M] (c : Con M) :
    ∀ (n : ℕ) {w x}, c w x → c (w ^ n) (x ^ n)

{M : Type u_4}
[AddMonoid M]
(c : AddCon M)
(n : ℕ)
{w x : M}


theorem newtonMap_apply_of_isUnit (h : IsUnit <| aeval x (derivative P)) :
    P.newtonMap x = x - h.unit⁻¹ * aeval x P

(h : IsUnit ((Polynomial.aeval x) (Polynomial.derivative P)))

P.newtonMap x = x - ↑h.unit⁻¹ * (Polynomial.aeval x) P


/-- A collection of elements in an `AddCommGroup` designated as "non-negative".
This is useful for constructing an `OrderedAddCommGroup`
by choosing a positive cone in an existing `AddCommGroup`. -/
-- Porting note(#5171): @[nolint has_nonempty_instance]
structure PositiveCone (α : Type*) [AddCommGroup α] where
  /-- The characteristic predicate of a positive cone. `nonneg a` means that `0 ≤ a` according to
  the cone. -/
  nonneg : α → Prop
  /-- The characteristic predicate of a positive cone. `pos a` means that `0 < a` according to
  the cone. -/
  pos : α → Prop := fun a => nonneg a ∧ ¬nonneg (-a)
  pos_iff : ∀ a, pos a ↔ nonneg a ∧ ¬nonneg (-a) := by intros; rfl
  zero_nonneg : nonneg 0
  add_nonneg : ∀ {a b}, nonneg a → nonneg b → nonneg (a + b)
  nonneg_antisymm : ∀ {a}, nonneg a → nonneg (-a) → a = 0

{α : Type u_1}
[AddCommGroup α]
(self : AddCommGroup.PositiveCone α)
(a : α)

self.pos a ↔ self.nonneg a ∧ ¬self.nonneg (-a)


@[simp]
theorem iSupLift_inclusion {i : ι} (x : K i) (h : K i ≤ T) :
    iSupLift K dir f hf T hT (inclusion h x) = f i x

{dir : Directed (fun x x_1 => x ≤ x_1) K}

{hf : ∀ (i j : ι) (h : K i ≤ K j), f i = (f j).comp (NonUnitalStarSubalgebra.inclusion h)}

(NonUnitalStarSubalgebra.iSupLift K dir f hf T hT) ((NonUnitalStarSubalgebra.inclusion h) x) = (f i) x


@[simp 1100]
theorem dNext_cochainComplex (f : ∀ i j, P.X i ⟶ Q.X j) (j : ℕ) :
    dNext j f = P.d _ _ ≫ f (j + 1) j

{V : Type u}
[CategoryTheory.Category.{v, u} V]
[CategoryTheory.Preadditive V]
{P Q : CochainComplex V ℕ}
(f : (i j : ℕ) → P.X i ⟶ Q.X j)
(j : ℕ)

(dNext j) f = P.d j (j + 1) ≫ f (j + 1) j


theorem ComputablePred.of_eq {α} [Primcodable α] {p q : α → Prop} (hp : ComputablePred p)
    (H : ∀ a, p a ↔ q a) : ComputablePred q

{α : Type u_1}
[Primcodable α]
{p q : α → Prop}
(hp : ComputablePred p)
(H : ∀ (a : α), p a ↔ q a)


lemma dens_inter_add_dens_union (s t : Finset α) :
    dens (s ∩ t) + dens (s ∪ t) = dens s + dens t

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

(s ∩ t).dens + (s ∪ t).dens = s.dens + t.dens


theorem size_erase_of_mem [@DecidableRel α (· ≤ ·)] {x : α} {t a₁ a₂} (h : Valid' a₁ t a₂)
    (h_mem : x ∈ t) : size (erase x t) = size t - 1

{α : Type u_1}
[Preorder α]
[DecidableRel fun x x_1 => x ≤ x_1]
{x : α}
{t : Ordnode α}
{a₁ : WithBot α}
{a₂ : WithTop α}
(h : Ordnode.Valid' a₁ t a₂)
(h_mem : x ∈ t)


lemma σ_ε₁ {i₁ i₁' : I₁} (h₁ : c₁.Rel i₁ i₁') (i₂ : I₂) :
    σ c₁ c₂ c₁₂ i₁ i₂ * ε₁ c₁ c₂ c₁₂ ⟨i₁, i₂⟩ = ε₂ c₂ c₁ c₁₂ ⟨i₂, i₁⟩ * σ c₁ c₂ c₁₂ i₁' i₂

{I₁ : Type u_1}
{I₂ : Type u_2}
{I₁₂ : Type u_3}
{c₁ : ComplexShape I₁}
(c₂ : ComplexShape I₂)
(c₁₂ : ComplexShape I₁₂)
[TotalComplexShape c₁ c₂ c₁₂]
[TotalComplexShape c₂ c₁ c₁₂]
[TotalComplexShapeSymmetry c₁ c₂ c₁₂]
{i₁ i₁' : I₁}
(h₁ : c₁.Rel i₁ i₁')
(i₂ : I₂)

c₁.σ c₂ c₁₂ i₁ i₂ * c₁.ε₁ c₂ c₁₂ (i₁, i₂) = c₂.ε₂ c₁ c₁₂ (i₂, i₁) * c₁.σ c₂ c₁₂ i₁' i₂


theorem nonempty_def (u : ZFSet) : u.Nonempty ↔ ∃ x, x ∈ u


theorem conj_trans (e₁ : M ≃ₗ[R] M₂) (e₂ : M₂ ≃ₗ[R] M₃) :
    e₁.conj.trans e₂.conj = (e₁.trans e₂).conj

{R : Type u_1}
{M : Type u_8}
{M₂ : Type u_10}
{M₃ : Type u_11}
[CommSemiring R]
[AddCommMonoid M]
[AddCommMonoid M₂]
[AddCommMonoid M₃]
[Module R M]
[Module R M₂]
[Module R M₃]
(e₁ : M ≃ₗ[R] M₂)
(e₂ : M₂ ≃ₗ[R] M₃)


@[simp]
theorem toIocMod_apply_left (a : α) : toIocMod hp a a = a + p

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


theorem ne_zero_of_coprime (hc : Int.gcd x y = 1) : z ≠ 0

{x y z : ℤ}
(h : PythagoreanTriple x y z)
(hc : x.gcd y = 1)


/-- Two functions defined on two (possibly different) measure spaces are identically distributed if
their image measures coincide. This only makes sense when the functions are ae measurable
(as otherwise the image measures are not defined), so we require this as well in the definition. -/
structure IdentDistrib (f : α → γ) (g : β → γ)
    (μ : Measure α := by volume_tac)
    (ν : Measure β := by volume_tac) : Prop where
  aemeasurable_fst : AEMeasurable f μ
  aemeasurable_snd : AEMeasurable g ν
  map_eq : Measure.map f μ = Measure.map g ν

{μ : autoParam (MeasureTheory.Measure α) _auto✝}

{ν : autoParam (MeasureTheory.Measure β) _auto✝¹}

(self : ProbabilityTheory.IdentDistrib f g μ ν)

MeasureTheory.Measure.map f μ = MeasureTheory.Measure.map g ν


theorem eq_to (h : IsZero X) (f : X ⟶ Y) : f = h.to_ Y

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


theorem iterate_derivative_neg {f : R[X]} {k : ℕ} : derivative^[k] (-f) = -derivative^[k] f

{R : Type u}
[Ring R]
{f : R[X]}
{k : ℕ}

(⇑Polynomial.derivative)^[k] (-f) = -(⇑Polynomial.derivative)^[k] f


theorem mul_eq_zero_iff {R : Type*} [LinearOrderedAddCommMonoid R] {a b : Tropical (WithTop R)} :
    a * b = 0 ↔ a = 0 ∨ b = 0

{R : Type u_1}
[LinearOrderedAddCommMonoid R]
{a b : Tropical (WithTop R)}


theorem Associated.of_pow_associated_of_prime' [CancelCommMonoidWithZero α] {p₁ p₂ : α} {k₁ k₂ : ℕ}
    (hp₁ : Prime p₁) (hp₂ : Prime p₂) (hk₂ : 0 < k₂) (h : p₁ ^ k₁ ~ᵤ p₂ ^ k₂) : p₁ ~ᵤ p₂

{α : Type u_1}
[CancelCommMonoidWithZero α]
{p₁ p₂ : α}
{k₁ k₂ : ℕ}
(hp₁ : Prime p₁)
(hp₂ : Prime p₂)
(hk₂ : 0 < k₂)
(h : p₁ ^ k₁ ~ᵤ p₂ ^ k₂)


theorem AECover.integral_eq_of_tendsto_of_nonneg_ae [l.NeBot] [l.IsCountablyGenerated]
    {φ : ι → Set α} (hφ : AECover μ l φ) {f : α → ℝ} (I : ℝ) (hnng : 0 ≤ᵐ[μ] f)
    (hfi : ∀ n, IntegrableOn f (φ n) μ) (htendsto : Tendsto (fun n => ∫ x in φ n, f x ∂μ) l (𝓝 I)) :
    ∫ x, f x ∂μ = I

(hfi : ∀ (n : ι), MeasureTheory.IntegrableOn f (φ n) μ)

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


theorem locPathConnected_of_bases {p : ι → Prop} {s : X → ι → Set X}
    (h : ∀ x, (𝓝 x).HasBasis p (s x)) (h' : ∀ x i, p i → IsPathConnected (s x i)) :
    LocPathConnectedSpace X

(h' : ∀ (x : X) (i : ι), p i → IsPathConnected (s x i))


lemma empty_not_mem_diffFinset (hC : IsSetSemiring C) (hs : s ∈ C) (ht : t ∈ C) :
    ∅ ∉ hC.diffFinset hs ht

{α : Type u_1}
{C : Set (Set α)}
{s t : Set α}
(hC : MeasureTheory.IsSetSemiring C)
(hs : s ∈ C)
(ht : t ∈ C)


@[simp]
theorem bsup_id_succ (o) : (bsup.{u, u} (succ o) fun x _ => x) = o

((Order.succ o).bsup fun x x_1 => x) = o


/-- If `re s` is greater than the abscissa of absolute convergence of `f`, then the L-series
of `f` is differentiable with derivative the negative of the L-series of the point-wise
product of `log` with `f`. -/
lemma LSeries_hasDerivAt {f : ℕ → ℂ} {s : ℂ} (h : abscissaOfAbsConv f < s.re) :
    HasDerivAt (LSeries f) (- LSeries (logMul f) s) s

(h : LSeries.abscissaOfAbsConv f < ↑s.re)

HasDerivAt (LSeries f) (-LSeries (LSeries.logMul f) s) s


nonrec theorem ContDiffAt.div_const {f : E → 𝕜'} {n} (hf : ContDiffAt 𝕜 n f x) (c : 𝕜') :
    ContDiffAt 𝕜 n (fun x => f x / c) x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{x : E}
{𝕜' : Type u_6}
[NormedField 𝕜']
[NormedAlgebra 𝕜 𝕜']
{f : E → 𝕜'}
{n : ℕ∞}
(hf : ContDiffAt 𝕜 n f x)
(c : 𝕜')


@[simp]
theorem lt_max_iff : a < max b c ↔ a < b ∨ a < c

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


theorem IsClosed.lowerSemicontinuous_indicator (hs : IsClosed s) (hy : y ≤ 0) :
    LowerSemicontinuous (indicator s fun _x => y)

{α : Type u_1}
[TopologicalSpace α]
{β : Type u_2}
[Preorder β]
{s : Set α}
{y : β}
[Zero β]
(hs : IsClosed s)
(hy : y ≤ 0)

LowerSemicontinuous (s.indicator fun _x => y)


/-- `γ` is an integral curve for `v` at `t₀` iff `γ` is an integral curve on some interval
containing `t₀`. -/
lemma isIntegralCurveAt_iff' :
    IsIntegralCurveAt γ v t₀ ↔ ∃ ε > 0, IsIntegralCurveOn γ v (Metric.ball t₀ ε)

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


theorem infs_sups_subset_left : s ⊼ (t ⊻ u) ⊆ s ⊼ t ⊻ s ⊼ u

{α : Type u_2}
[DecidableEq α]
[DistribLattice α]
(s t u : Finset α)


/-- Predicate for semiring homomorphisms (deprecated -- use the bundled `RingHom` version). -/
structure IsSemiringHom {α : Type u} {β : Type v} [Semiring α] [Semiring β] (f : α → β) : Prop where
  /-- The proposition that `f` preserves the additive identity. -/
  map_zero : f 0 = 0
  /-- The proposition that `f` preserves the multiplicative identity. -/
  map_one : f 1 = 1
  /-- The proposition that `f` preserves addition. -/
  map_add : ∀ x y, f (x + y) = f x + f y
  /-- The proposition that `f` preserves multiplication. -/
  map_mul : ∀ x y, f (x * y) = f x * f y

{α : Type u}
{β : Type v}
[Semiring α]
[Semiring β]
{f : α → β}
(self : IsSemiringHom f)


@[reassoc (attr := simp)]
theorem ι_sndSigmaMap (b) : Sigma.ι I.left b ≫ I.sndSigmaMap = I.snd b ≫ Sigma.ι I.right _

(I : CategoryTheory.Limits.MultispanIndex C)

CategoryTheory.CategoryStruct.comp (CategoryTheory.Limits.Sigma.ι I.left b) I.sndSigmaMap =
  CategoryTheory.CategoryStruct.comp (I.snd b) (CategoryTheory.Limits.Sigma.ι I.right (I.sndFrom b))


/-- The map `ComposableArrows C m → ComposableArrows C n` obtained by precomposition with
a functor `Fin (n + 1) ⥤ Fin (m + 1)`. -/
@[simps!]
def whiskerLeft (F : ComposableArrows C m) (Φ : Fin (n + 1) ⥤ Fin (m + 1)) :
    ComposableArrows C n

(F : CategoryTheory.ComposableArrows C m)

(Φ : CategoryTheory.Functor (Fin (n + 1)) (Fin (m + 1)))

(F.whiskerLeft Φ).obj X = F.obj (Φ.obj X)


/-- If `a` is a greatest lower bound for sets `s` and `p`, then it is a greater lower bound for any
set `t`, `s ⊆ t ⊆ p`. -/
theorem IsGLB.of_subset_of_superset {s t p : Set α} (hs : IsGLB s a) (hp : IsGLB p a) (hst : s ⊆ t)
    (htp : t ⊆ p) : IsGLB t a

{α : Type u}
[Preorder α]
{a : α}
{s t p : Set α}
(hs : IsGLB s a)
(hp : IsGLB p a)
(hst : s ⊆ t)
(htp : t ⊆ p)


theorem Smooth.mdifferentiable (hf : Smooth I I' f) : MDifferentiable I I' f

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{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']
{f : M → M'}
(hf : Smooth I I' f)


@[simp]
theorem apply_eq_prod_smul_coeff : p n y = (∏ i, y i) • p.coeff n

{𝕜 : Type u}
{E : Type v}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{p : FormalMultilinearSeries 𝕜 𝕜 E}
{n : ℕ}
{y : Fin n → 𝕜}

(p n) y = (∏ i : Fin n, y i) • p.coeff n


@[to_additive (attr := simp)]
theorem smul_pure : f • pure b = f.map (· • b)

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

f • pure b = Filter.map (fun x => x • b) f


/-- The 2-adic norm of the n-th harmonic number is 2 raised to the logarithm of n in base 2. -/
lemma padicNorm_two_harmonic {n : ℕ} (hn : n ≠ 0) :
    ‖(harmonic n : ℚ_[2])‖ = 2 ^ (Nat.log 2 n)


@[reassoc (attr := simp)]
lemma p_descQ (k : S.X₂ ⟶ A) (hk : S.f ≫ k = 0) : h.p ≫ h.descQ k hk = k

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

CategoryTheory.CategoryStruct.comp h.p (h.descQ k hk) = k


/-- A separable extension has inseparable degree one. -/
theorem Algebra.IsSeparable.insepDegree_eq [Algebra.IsSeparable F E] : insepDegree F E = 1

(F : Type u)
(E : Type v)
[Field F]
[Field E]
[Algebra F E]
[Algebra.IsSeparable F E]


/-- **Hahn-Banach theorem** for continuous linear functions over `𝕜` satisfying `RCLike 𝕜`. -/
theorem exists_extension_norm_eq (p : Subspace 𝕜 E) (f : p →L[𝕜] 𝕜) :
    ∃ g : E →L[𝕜] 𝕜, (∀ x : p, g x = f x) ∧ ‖g‖ = ‖f‖

{𝕜 : Type u_1}
[RCLike 𝕜]
{E : Type u_2}
[SeminormedAddCommGroup E]
[NormedSpace 𝕜 E]
(p : Subspace 𝕜 E)
(f : ↥p →L[𝕜] 𝕜)

∃ g, (∀ (x : ↥p), g ↑x = f x) ∧ ‖g‖ = ‖f‖


theorem diffContOnCl_univ : DiffContOnCl 𝕜 f univ ↔ Differentiable 𝕜 f

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜 F]
{f : E → F}

DiffContOnCl 𝕜 f Set.univ ↔ Differentiable 𝕜 f


@[simp]
theorem dualPairing_apply {W : Submodule R M} (φ : Module.Dual R M) (x : W) :
    W.dualPairing (Quotient.mk φ) x = φ x

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
{W : Submodule R M}
(φ : Module.Dual R M)
(x : ↥W)

(W.dualPairing (Submodule.Quotient.mk φ)) x = φ ↑x


@[to_additive]
protected theorem inv_mem_iff {x : G} : x⁻¹ ∈ H ↔ x ∈ H

{G : Type u_1}
[AddGroup G]
(H : AddSubgroup G)
{x : G}


theorem _root_.Decidable.Partrec.const' (s : Part σ) [Decidable s.Dom] : Partrec fun _ : α => s

{α : Type u_1}
{σ : Type u_4}
[Primcodable α]
[Primcodable σ]
(s : Part σ)
[Decidable s.Dom]


@[to_additive]
theorem prod_Ico_succ_top {a b : ℕ} (hab : a ≤ b) (f : ℕ → M) :
    (∏ k ∈ Ico a (b + 1), f k) = (∏ k ∈ Ico a b, f k) * f b

{M : Type u_2}
[CommMonoid M]
{a b : ℕ}
(hab : a ≤ b)
(f : ℕ → M)

∏ k ∈ Finset.Ico a (b + 1), f k = (∏ k ∈ Finset.Ico a b, f k) * f b


lemma mul_right_eq_self_iff (ha : 0 < a) : a * b = a ↔ b = 1


theorem cast_id : ∀ (n) (i : ZMod n), (ZMod.cast i : ZMod n) = i


@[simp] theorem simple_sq (i : B) : s i ^ 2 = 1

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


/-- An angle in a right-angled triangle is at most `π / 2`. -/
theorem angle_add_le_pi_div_two_of_inner_eq_zero {x y : V} (h : ⟪x, y⟫ = 0) :
    angle x (x + y) ≤ π / 2

{V : Type u_1}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
{x y : V}
(h : ⟪x, y⟫_ℝ = 0)

InnerProductGeometry.angle x (x + y) ≤ π / 2


theorem support_prod_of_pairwise_disjoint (l : List (Perm α)) (h : l.Pairwise Disjoint) :
    l.prod.support = (l.map support).foldr (· ⊔ ·) ⊥

(h : List.Pairwise Equiv.Perm.Disjoint l)

l.prod.support = List.foldr (fun x x_1 => x ⊔ x_1) ⊥ (List.map Equiv.Perm.support l)


lemma succ_eq_of_lt_aleph0 {c : Cardinal} (h : c < ℵ₀) : Order.succ c = c + 1

{c : Cardinal.{u_1}}
(h : c < Cardinal.aleph0)


/-- Given a family of morphisms `f i : A i ⟶ B i` and a morphism `πX : X ⟶ S`,
this type parametrizes the commutative squares with a morphism `f i` on the left
and `πX` in the right. -/
structure FunctorObjIndex where
  /-- an element in the index type -/
  i : I
  /-- the top morphism in the square -/
  t : A i ⟶ X
  /-- the bottom morphism in the square -/
  b : B i ⟶ S
  w : t ≫ πX = f i ≫ b

(self : CategoryTheory.SmallObject.FunctorObjIndex f πX)

CategoryTheory.CategoryStruct.comp self.t πX = CategoryTheory.CategoryStruct.comp (f self.i) self.b


theorem nodup_permsOfList : ∀ {l : List α}, l.Nodup → (permsOfList l).Nodup

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


/-- A holomorphic function on a compact connected complex manifold is the constant function `f ≡ v`,
for some value `v`. -/
theorem exists_eq_const_of_compactSpace [PreconnectedSpace M] {f : M → F}
    (hf : MDifferentiable I 𝓘(ℂ, F) f) : ∃ v : F, f = Function.const M v

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
{F : Type u_2}
[NormedAddCommGroup F]
[NormedSpace ℂ F]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners ℂ E H}
[I.Boundaryless]
{M : Type u_4}
[TopologicalSpace M]
[CompactSpace M]
[ChartedSpace H M]
[SmoothManifoldWithCorners I M]
[PreconnectedSpace M]
{f : M → F}
(hf : MDifferentiable I 𝓘(ℂ, F) f)


lemma two_mul_ediv_two_of_even : Even n → 2 * (n / 2) = n


theorem setToL1SCLM_zero_left' (hT : DominatedFinMeasAdditive μ T C)
    (h_zero : ∀ s, MeasurableSet s → μ s < ∞ → T s = 0) (f : α →₁ₛ[μ] E) :
    setToL1SCLM α E μ hT f = 0

(hT : MeasureTheory.DominatedFinMeasAdditive μ T C)

(h_zero : ∀ (s : Set α), MeasurableSet s → μ s < ⊤ → T s = 0)

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

(MeasureTheory.L1.SimpleFunc.setToL1SCLM α E μ hT) f = 0


protected theorem DFinsupp.wellFoundedLT [∀ i, Zero (α i)] [∀ i, Preorder (α i)]
    [∀ i, WellFoundedLT (α i)] (hbot : ∀ ⦃i⦄ ⦃a : α i⦄, ¬a < 0) : WellFoundedLT (Π₀ i, α i)

{ι : Type u_1}
{α : ι → Type u_2}
[(i : ι) → Zero (α i)]
[(i : ι) → Preorder (α i)]
[∀ (i : ι), WellFoundedLT (α i)]
(hbot : ∀ ⦃i : ι⦄ ⦃a : α i⦄, ¬a < 0)


/-- A sum is infinite iff one term is infinite. -/
lemma sum_eq_bot_iff : ∑ i ∈ s, f i = ⊥ ↔ ∃ i ∈ s, f i = ⊥

{ι : Type u_1}
{α : Type u_2}
[AddCommMonoid α]
{s : Finset ι}
{f : ι → WithBot α}


/-- Simplification of the integral of `sin x ^ m * cos x ^ n`, case `m` is odd. -/
theorem integral_sin_pow_odd_mul_cos_pow (m n : ℕ) :
    (∫ x in a..b, sin x ^ (2 * m + 1) * cos x ^ n) = ∫ u in cos b..cos a, u^n * (↑1 - u ^ 2) ^ m

∫ (x : ℝ) in a..b, Real.sin x ^ (2 * m + 1) * Real.cos x ^ n =
  ∫ (u : ℝ) in Real.cos b..Real.cos a, u ^ n * (1 - u ^ 2) ^ m


theorem det_of_card_zero (h : Fintype.card n = 0) (M : Matrix n n R) : M.det = 1

{R : Type u}
[CommRing R]
{n : Type v}
[DecidableEq n]
[Fintype n]
(h : Fintype.card n = 0)
(M : Matrix n n R)


theorem append_left_inj {s₁ s₂ : List α} (t) : s₁ ++ t = s₂ ++ t ↔ s₁ = s₂

{α : Type u_1}
{s₁ s₂ : List α}
(t : List α)


theorem mem_smul_set_iff_inv_smul_mem₀ (ha : a ≠ 0) (A : Set β) (x : β) : x ∈ a • A ↔ a⁻¹ • x ∈ A

{α : Type u_2}
{β : Type u_3}
[GroupWithZero α]
[MulAction α β]
{a : α}
(ha : a ≠ 0)
(A : Set β)
(x : β)

x ∈ a • A ↔ a⁻¹ • x ∈ A


@[congr]
theorem sup'_congr {t : Finset β} {f g : β → α} (h₁ : s = t) (h₂ : ∀ x ∈ s, f x = g x) :
    s.sup' H f = t.sup' (h₁ ▸ H) g

{α : Type u_2}
{β : Type u_3}
[SemilatticeSup α]
{s : Finset β}
(H : s.Nonempty)
{t : Finset β}
{f g : β → α}
(h₁ : s = t)
(h₂ : ∀ x ∈ s, f x = g x)


lemma IsQuasiregular.isUnit_one_add {R : Type*} [Semiring R] {x : R} (hx : IsQuasiregular x) :
    IsUnit (1 + x)

{R : Type u_1}
[Semiring R]
{x : R}
(hx : IsQuasiregular x)


theorem add_eq_one_iff {n m : WithBot ℕ} : n + m = 1 ↔ n = 0 ∧ m = 1 ∨ n = 1 ∧ m = 0


theorem minimals_Ico (hab : a < b) : minimals (· ≤ ·) (Ico a b) = {a}

{α : Type u_1}
[PartialOrder α]
{a b : α}
(hab : a < b)

minimals (fun x x_1 => x ≤ x_1) (Set.Ico a b) = {a}


/-- The scalar multiplication of two `C^n` functions on a domain is `C^n`. -/
theorem ContDiffOn.smul {s : Set E} {f : E → 𝕜} {g : E → F} (hf : ContDiffOn 𝕜 n f s)
    (hg : ContDiffOn 𝕜 n g s) : ContDiffOn 𝕜 n (fun x => f x • g x) s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{n : ℕ∞}
{s : Set E}
{f : E → 𝕜}
{g : E → F}
(hf : ContDiffOn 𝕜 n f s)
(hg : ContDiffOn 𝕜 n g s)


theorem ContDiffWithinAt.iteratedFderivWithin_right {i : ℕ} (hf : ContDiffWithinAt 𝕜 n f s x₀)
    (hs : UniqueDiffOn 𝕜 s) (hmn : (m + i : ℕ∞) ≤ n) (hx₀s : x₀ ∈ s) :
    ContDiffWithinAt 𝕜 m (iteratedFDerivWithin 𝕜 i f s) s x₀

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{s : Set E}
{f : E → F}
{x₀ : E}
{m n : ℕ∞}
{i : ℕ}
(hf : ContDiffWithinAt 𝕜 n f s x₀)
(hs : UniqueDiffOn 𝕜 s)
(hmn : m + ↑i ≤ n)
(hx₀s : x₀ ∈ s)


theorem fg_restrictScalars {R S M : Type*} [CommSemiring R] [Semiring S] [Algebra R S]
    [AddCommGroup M] [Module S M] [Module R M] [IsScalarTower R S M] (N : Submodule S M)
    (hfin : N.FG) (h : Function.Surjective (algebraMap R S)) :
    (Submodule.restrictScalars R N).FG

(h : Function.Surjective ⇑(algebraMap R S))


theorem interior_Ici [NoMinOrder α] {a : α} : interior (Ici a) = Ioi a

{α : Type u_1}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
[DenselyOrdered α]
[NoMinOrder α]
{a : α}


/-- If for some `n`, `m ^ n • a = a`, then `period m a ≤ n`. -/
@[to_additive "If for some `n`, `(n • m) +ᵥ a = a`, then `period m a ≤ n`."]
theorem period_le_of_fixed {m : M} {a : α} {n : ℕ} (n_pos : 0 < n) (fixed : m ^ n • a = a) :
    period m a ≤ n

{α : Type v}
{M : Type u}
[Monoid M]
[MulAction M α]
{m : M}
{a : α}
{n : ℕ}
(n_pos : 0 < n)
(fixed : m ^ n • a = a)


theorem mono_iff_injective {A B : NonemptyFinLinOrd.{u}} (f : A ⟶ B) :
    Mono f ↔ Function.Injective f

CategoryTheory.Mono f ↔ Function.Injective ⇑f


theorem H1LequivOfIsTrivial_comp_H1_π [A.IsTrivial] :
    (H1LequivOfIsTrivial A).comp (H1_π A) = oneCocyclesLequivOfIsTrivial A

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

↑(groupCohomology.H1LequivOfIsTrivial A) ∘ₗ groupCohomology.H1_π A = ↑(groupCohomology.oneCocyclesLequivOfIsTrivial A)


/-- Given a star `ℝ≥0`-algebra homomorphism `φ` from `C(X, ℝ≥0)` into an `ℝ`-algebra `A`, this is
the unique extension of `φ` from `C(X, ℝ)` to `A` as a star `ℝ`-algebra homomorphism. -/
@[simps]
noncomputable def realContinuousMapOfNNReal (φ : C(X, ℝ≥0) →⋆ₐ[ℝ≥0] A) :
    C(X, ℝ) →⋆ₐ[ℝ] A

{X : Type u_1}
[TopologicalSpace X]
{A : Type u_2}
[Ring A]
[StarRing A]
[Algebra ℝ A]
(φ : C(X, NNReal) →⋆ₐ[NNReal] A)
(f : C(X, ℝ))

φ.realContinuousMapOfNNReal f = φ f.toNNReal - φ (-f).toNNReal


/-- The chosen kernels and cokernels of the limits API give a `LeftHomologyData` -/
@[simps]
noncomputable def ofHasKernelOfHasCokernel
    [HasKernel S.g] [HasCokernel (kernel.lift S.g S.f S.zero)] :
    S.LeftHomologyData

[CategoryTheory.Limits.HasCokernel (CategoryTheory.Limits.kernel.lift S.g S.f ⋯)]

(CategoryTheory.ShortComplex.LeftHomologyData.ofHasKernelOfHasCokernel S).π =
  CategoryTheory.Limits.cokernel.π (CategoryTheory.Limits.kernel.lift S.g S.f ⋯)


theorem tr_respects {enc₀} :
    Respects (step M) (step (tr enc dec M)) fun c₁ c₂ ↦ trCfg enc enc₀ c₁ = c₂

(enc0 : enc default = Mathlib.Vector.replicate n false)

{enc₀ : enc default = Mathlib.Vector.replicate n false}

Turing.Respects (Turing.TM1.step M) (Turing.TM1.step (Turing.TM1to1.tr enc dec M)) fun c₁ c₂ =>
  Turing.TM1to1.trCfg enc enc₀ c₁ = c₂


/-- Compressing an element is idempotent. -/
@[simp]
theorem compress_idem (u v a : α) : compress u v (compress u v a) = compress u v a

{α : Type u_1}
[GeneralizedBooleanAlgebra α]
[DecidableRel Disjoint]
[DecidableRel fun x x_1 => x ≤ x_1]
(u v a : α)

UV.compress u v (UV.compress u v a) = UV.compress u v a


@[simp]
theorem diagram_right : D.diagram.right = D.U

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


lemma coeff_Φ_ne_zero [Nontrivial R] (n : ℤ) : (W.Φ n).coeff (n.natAbs ^ 2) ≠ 0

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


lemma mem_part_iff_part_eq_part {b : α} (ha : a ∈ s) (hb : b ∈ s) :
    a ∈ P.part b ↔ P.part a = P.part b

{α : Type u_1}
[DecidableEq α]
{s : Finset α}
(P : Finpartition s)
{a b : α}
(ha : a ∈ s)
(hb : b ∈ s)


theorem equicontinuous_finite [Finite ι] {F : ι → X → α} :
    Equicontinuous F ↔ ∀ i, Continuous (F i)

{ι : Type u_1}
{X : Type u_3}
{α : Type u_7}
[tX : TopologicalSpace X]
[uα : UniformSpace α]
[Finite ι]
{F : ι → X → α}

Equicontinuous F ↔ ∀ (i : ι), Continuous (F i)


/-- `BoundedOrderHomClass F α β` states that `F` is a type of bounded order morphisms.

You should extend this class when you extend `BoundedOrderHom`. -/
class BoundedOrderHomClass (F α β : Type*) [LE α] [LE β]
  [BoundedOrder α] [BoundedOrder β] [FunLike F α β]
  extends RelHomClass F ((· ≤ ·) : α → α → Prop) ((· ≤ ·) : β → β → Prop) : Prop where
  /-- Morphisms preserve the top element. The preferred spelling is `_root_.map_top`. -/
  map_top (f : F) : f ⊤ = ⊤
  /-- Morphisms preserve the bottom element. The preferred spelling is `_root_.map_bot`. -/
  map_bot (f : F) : f ⊥ = ⊥

{F : Type u_6}
{α : Type u_7}
{β : Type u_8}
[LE α]
[LE β]
[BoundedOrder α]
[BoundedOrder β]
[FunLike F α β]
[self : BoundedOrderHomClass F α β]
(f : F)


theorem mk_list_eq_max_mk_aleph0 (α : Type u) [Nonempty α] : #(List α) = max #α ℵ₀


/-- This lemma corresponds to one of the coherence laws for duals in rigid categories, see
  `CategoryTheory.Monoidal.Rigid`. -/
theorem contractLeft_assoc_coevaluation :
    (contractLeft K V).rTensor _ ∘ₗ
        (TensorProduct.assoc K _ _ _).symm.toLinearMap ∘ₗ
          (coevaluation K V).lTensor (Module.Dual K V) =
      (TensorProduct.lid K _).symm.toLinearMap ∘ₗ (TensorProduct.rid K _).toLinearMap

(K : Type u)
[Field K]
(V : Type v)
[AddCommGroup V]
[Module K V]
[FiniteDimensional K V]

LinearMap.rTensor (Module.Dual K V) (contractLeft K V) ∘ₗ
    ↑(TensorProduct.assoc K (Module.Dual K V) V (Module.Dual K V)).symm ∘ₗ
      LinearMap.lTensor (Module.Dual K V) (coevaluation K V) =
  ↑(TensorProduct.lid K (Module.Dual K V)).symm ∘ₗ ↑(TensorProduct.rid K (Module.Dual K V))


/-- A monoidal functor induces a monoidal functor between
the categories of `G`-actions within those categories. -/
@[simps!]
def mapAction : MonoidalFunctor (Action V G) (Action W G)

(F : CategoryTheory.MonoidalFunctor V W)

∀ (a : Action V G), ((F.mapAction G).obj a).V = F.obj a.V


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

{M : Type u_1}
{N : Type u_2}
[Add M]
[Add N]
(s : AddSubsemigroup M)

s.prod ⊤ = AddSubsemigroup.comap (AddHom.fst M N) s


theorem Coprime.symm : Coprime n m → Coprime m n


nonrec theorem IsPWO.exists_monotone_subseq (h : s.IsPWO) (f : ℕ → α) (hf : ∀ n, f n ∈ s) :
    ∃ g : ℕ ↪o ℕ, Monotone (f ∘ g)

{α : Type u_2}
[Preorder α]
{s : Set α}
(h : s.IsPWO)
(f : ℕ → α)
(hf : ∀ (n : ℕ), f n ∈ s)


theorem annihilator_mono (h : N ≤ P) : P.annihilator ≤ N.annihilator

{R : Type u}
{M : Type v}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
{N P : Submodule R M}
(h : N ≤ P)


@[simp]
theorem invFun_zero : invFun R A n 0 = 0

(R : Type u)
[CommSemiring R]
(A : Type v)
[Semiring A]
[Algebra R A]
(n : Type w)
[DecidableEq n]
[Fintype n]


@[simp]
theorem toReal_pi : (π : Angle).toReal = π


theorem ofNat_snd_mk {α} {x : α} {y : Nat} : (Prod.mk x y).snd = (y : Int)


@[simp]
theorem getVert_zero {u v} (w : G.Walk u v) : w.getVert 0 = u

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


theorem hom.congr_left {f g : Arrow T} {φ₁ φ₂ : f ⟶ g} (h : φ₁ = φ₂) : φ₁.left = φ₂.left

{T : Type u}
[CategoryTheory.Category.{v, u} T]
{f g : CategoryTheory.Arrow T}
{φ₁ φ₂ : f ⟶ g}
(h : φ₁ = φ₂)


theorem chain'_reverse : ∀ {l}, Chain' R (reverse l) ↔ Chain' (flip R) l

{α : Type u}
{R : α → α → Prop}
{l : List α}

List.Chain' R l.reverse ↔ List.Chain' (flip R) l


/-- The validity predicate for an `Ordnode` subtree. This asserts that the `size` fields are
correct, the tree is balanced, and the elements of the tree are organized according to the
ordering. This version of `Valid` also puts all elements in the tree in the interval `(lo, hi)`. -/
structure Valid' (lo : WithBot α) (t : Ordnode α) (hi : WithTop α) : Prop where
  ord : t.Bounded lo hi
  sz : t.Sized
  bal : t.Balanced

{α : Type u_1}
[Preorder α]
{lo : WithBot α}
{t : Ordnode α}
{hi : WithTop α}
(self : Ordnode.Valid' lo t hi)


theorem fderiv_smul (hc : DifferentiableAt 𝕜 c x) (hf : DifferentiableAt 𝕜 f x) :
    fderiv 𝕜 (fun y => c y • f y) x = c x • fderiv 𝕜 f x + (fderiv 𝕜 c x).smulRight (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}
{𝕜' : Type u_6}
[NontriviallyNormedField 𝕜']
[NormedAlgebra 𝕜 𝕜']
[NormedSpace 𝕜' F]
[IsScalarTower 𝕜 𝕜' F]
{c : E → 𝕜'}
(hc : DifferentiableAt 𝕜 c x)
(hf : DifferentiableAt 𝕜 f x)


@[simp]
theorem mk_reindex_fin_cast {n m : ℕ} (h : n = m) (x : ⨂[R]^n M) :
    GradedMonoid.mk (A := fun i => (⨂[R]^i) M) m
    (PiTensorProduct.reindex R (fun _ ↦ M) (finCongr h) x) = GradedMonoid.mk n x

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
{n m : ℕ}
(h : n = m)
(x : ⨂[R]^n M)

GradedMonoid.mk m ((PiTensorProduct.reindex R (fun x => M) (finCongr h)) x) = GradedMonoid.mk n x


theorem min'_subset {s t : Finset α} (H : s.Nonempty) (hst : s ⊆ t) :
    t.min' (H.mono hst) ≤ s.min' H

{α : Type u_2}
[LinearOrder α]
{s t : Finset α}
(H : s.Nonempty)
(hst : s ⊆ t)


theorem take_all_of_le {n} {l : List α} (h : length l ≤ n) : take n l = l

{α : Type u_1}
{n : Nat}
{l : List α}
(h : l.length ≤ n)


@[simp]
theorem coe_ofMapBounded (f : α → β) {h} : ⇑(ofMapBounded f h) = f

{h : ∀ ⦃s : Set α⦄, Bornology.IsBounded s → Bornology.IsBounded (f '' s)}

⇑(LocallyBoundedMap.ofMapBounded f h) = f


/-- A vector is in the same ray as a nonnegative multiple of itself. -/
lemma sameRay_nonneg_smul_right (v : M) (h : 0 ≤ a) : SameRay R v (a • v)

{R : Type u_1}
[StrictOrderedCommSemiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
{S : Type u_5}
[OrderedCommSemiring S]
[Algebra S R]
[Module S M]
[SMulPosMono S R]
[IsScalarTower S R M]
{a : S}
(v : M)
(h : 0 ≤ a)


@[deprecated drop_eq_getElem_cons (since := "2024-06-12")]
theorem drop_eq_get_cons {n} {l : List α} (h) : drop n l = get l ⟨n, h⟩ :: drop (n + 1) l

{α : Type u_1}
{n : Nat}
{l : List α}
(h : n < l.length)

List.drop n l = l.get ⟨n, h⟩ :: List.drop (n + 1) l


/-- A custom induction principle for nilpotent groups. The base case is a trivial group
(`subsingleton G`), and in the induction step, one can assume the hypothesis for
the group quotiented by its center. -/
@[elab_as_elim]
theorem nilpotent_center_quotient_ind {P : ∀ (G) [Group G] [IsNilpotent G], Prop}
    (G : Type*) [Group G] [IsNilpotent G]
    (hbase : ∀ (G) [Group G] [Subsingleton G], P G)
    (hstep : ∀ (G) [Group G] [IsNilpotent G], P (G ⧸ center G) → P G) : P G

{P : (G : Type u_2) → [inst : Group G] → [inst : Group.IsNilpotent G] → Prop}

(hbase : ∀ (G : Type u_2) [inst : Group G] [inst_1 : Subsingleton G], P G)

(hstep : ∀ (G : Type u_2) [inst : Group G] [inst_1 : Group.IsNilpotent G], P (G ⧸ Subgroup.center G) → P G)


/-- If `Irreducible (cyclotomic n K)` (in particular for `K = ℚ`), then the norm of
`ζ - 1` is `eval 1 (cyclotomic n ℤ)`. -/
theorem sub_one_norm_eq_eval_cyclotomic [IsCyclotomicExtension {n} K L] (h : 2 < (n : ℕ))
    (hirr : Irreducible (cyclotomic n K)) : norm K (ζ - 1) = ↑(eval 1 (cyclotomic n ℤ))

(hirr : Irreducible (Polynomial.cyclotomic (↑n) K))

(Algebra.norm K) (ζ - 1) = ↑(Polynomial.eval 1 (Polynomial.cyclotomic ↑n ℤ))


theorem length_insertNth : ∀ n as, n ≤ length as → length (insertNth n a as) = length as + 1

{α : Type u}
{a : α}
(n : ℕ)
(as : List α)

n ≤ as.length → (List.insertNth n a as).length = as.length + 1


protected theorem piecewise {m : MeasurableSpace α} [TopologicalSpace β] {s : Set α}
    {_ : DecidablePred (· ∈ s)} (hs : MeasurableSet s) (hf : StronglyMeasurable f)
    (hg : StronglyMeasurable g) : StronglyMeasurable (Set.piecewise s f g)

{α : Type u_1}
{β : Type u_2}
{f g : α → β}
{m : MeasurableSpace α}
[TopologicalSpace β]
{s : Set α}

∀ {x : DecidablePred fun x => x ∈ s},
  MeasurableSet s →
    MeasureTheory.StronglyMeasurable f →
      MeasureTheory.StronglyMeasurable g → MeasureTheory.StronglyMeasurable (s.piecewise f g)


/-- When one splits a list along a composition `c`, the lengths of the sublists thus created are
given by the block sizes in `c`. -/
theorem map_length_splitWrtComposition (l : List α) (c : Composition l.length) :
    map length (l.splitWrtComposition c) = c.blocks

{α : Type u_1}
(l : List α)
(c : Composition l.length)

List.map List.length (l.splitWrtComposition c) = c.blocks


lemma ofReal_le_ofReal_iff' {p q : ℝ} : ENNReal.ofReal p ≤ .ofReal q ↔ p ≤ q ∨ p ≤ 0

ENNReal.ofReal p ≤ ENNReal.ofReal q ↔ p ≤ q ∨ p ≤ 0


theorem le_iff_subset (s : Set β) (S : α) : l s ≤ S ↔ s ⊆ S

{α : Type u_1}
{β : Type u_4}
[SetLike α β]
(l : LowerAdjoint SetLike.coe)
(s : Set β)
(S : α)


theorem ncard_lt_ncard (h : s ⊂ t) (ht : t.Finite := by toFinite_tac) :
    s.ncard < t.ncard

{α : Type u_1}
{s t : Set α}
(h : s ⊂ t)
(ht : t.Finite := by toFinite_tac)


@[simp]
theorem coconeOfConeLeftOp_ι_app (c : Cone F.leftOp) (j) :
    (coconeOfConeLeftOp c).ι.app j = (c.π.app (op j)).op

(c : CategoryTheory.Limits.Cone F.leftOp)

(CategoryTheory.Limits.coconeOfConeLeftOp c).ι.app j = (c.π.app (Opposite.op j)).op


/-- The product of the factors is the original number -/
theorem prod_factorMultiset (n : ℕ+) : (factorMultiset n).prod = n


/-- `L/F` is a normal closure of `K/F` if the minimal polynomial of every element of `K` over `F`
  splits in `L`, and `L` is generated by roots of such minimal polynomials over `F`.
  (Since the minimal polynomial of a transcendental element is 0,
  the normal closure of `K/F` is the same as the normal closure over `F`
  of the algebraic closure of `F` in `K`.) -/
class IsNormalClosure : Prop where
  splits (x : K) : (minpoly F x).Splits (algebraMap F L)
  adjoin_rootSet : ⨆ x : K, adjoin F ((minpoly F x).rootSet L) = ⊤

{F : Type u_1}
{K : Type u_2}
{L : Type u_3}
[Field F]
[Field K]
[Field L]
[Algebra F K]
[Algebra F L]
[self : IsNormalClosure F K L]

⨆ x, IntermediateField.adjoin F ((minpoly F x).rootSet L) = ⊤


@[to_additive]
protected theorem Inseparable.mul {a b c d : M} (hab : Inseparable a b) (hcd : Inseparable c d) :
    Inseparable (a * c) (b * d)

{M : Type u_3}
[TopologicalSpace M]
[Add M]
[ContinuousAdd M]
{a b c d : M}
(hab : Inseparable a b)
(hcd : Inseparable c d)


/-- The angle between three points is zero if and only if one of the first and third points is
weakly between the other two, and not equal to the second. -/
theorem angle_eq_zero_iff_ne_and_wbtw {p₁ p₂ p₃ : P} :
    ∠ p₁ p₂ p₃ = 0 ↔ p₁ ≠ p₂ ∧ Wbtw ℝ p₂ p₁ p₃ ∨ p₃ ≠ p₂ ∧ Wbtw ℝ p₂ p₃ p₁

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{p₁ p₂ p₃ : P}

EuclideanGeometry.angle p₁ p₂ p₃ = 0 ↔ p₁ ≠ p₂ ∧ Wbtw ℝ p₂ p₁ p₃ ∨ p₃ ≠ p₂ ∧ Wbtw ℝ p₂ p₃ p₁


/-- The complement of a set has the same frontier as the original set. -/
@[simp]
theorem frontier_compl (s : Set X) : frontier sᶜ = frontier s

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


theorem exists_clusterPt_of_compactSpace [CompactSpace X] (f : Filter X) [NeBot f] :
    ∃ x, ClusterPt x f

{X : Type u}
[TopologicalSpace X]
[CompactSpace X]
(f : Filter X)
[f.NeBot]


theorem RingHom.map_frobenius : g (frobenius R p x) = frobenius S p (g x)

{R : Type u}
[CommSemiring R]
{S : Type u_1}
[CommSemiring S]
(g : R →+* S)
(p : ℕ)
[ExpChar R p]
[ExpChar S p]
(x : R)

g ((frobenius R p) x) = (frobenius S p) (g x)


/-- The underlying set of a non-empty directed sSup of subfields is just a union of the subfields.
  Note that this fails without the directedness assumption (the union of two subfields is
  typically not a subfield) -/
theorem mem_iSup_of_directed {ι} [hι : Nonempty ι] {S : ι → Subfield K} (hS : Directed (· ≤ ·) S)
    {x : K} : (x ∈ ⨆ i, S i) ↔ ∃ i, x ∈ S i

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


/-- The imaginary part of a complex measure is a signed measure. -/
@[simps! apply]
def im : ComplexMeasure α →ₗ[ℝ] SignedMeasure α

{α : Type u_1}
{m : MeasurableSpace α}
(v : MeasureTheory.VectorMeasure α ℂ)

MeasureTheory.ComplexMeasure.im v = v.mapRange Complex.imLm.toAddMonoidHom Complex.continuous_im


theorem restrict_lintegral (f : α →ₛ ℝ≥0∞) {s : Set α} (hs : MeasurableSet s) :
    (restrict f s).lintegral μ = ∑ r ∈ f.range, r * μ (f ⁻¹' {r} ∩ s)

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
(f : MeasureTheory.SimpleFunc α ℝ≥0∞)
{s : Set α}
(hs : MeasurableSet s)

(f.restrict s).lintegral μ = ∑ r ∈ f.range, r * μ (↑f ⁻¹' {r} ∩ s)


/-- The discrete sieve on a type, which only includes arrows whose image is a subsingleton. -/
@[simps]
def discreteSieve (α : Type u) : Sieve α

∀ (x : Type u) (f : x ⟶ α), (CategoryTheory.discreteSieve α).arrows f = ∃ x_1, ∀ (y : x), f y = x_1


@[simp]
theorem coe_mul (f g : α →*₀o β) : ⇑(f * g) = f * g

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


theorem succ_injective : Injective (succ : α → α)

{α : Type u_1}
[PartialOrder α]
[SuccOrder α]
[NoMaxOrder α]


theorem arg_eq_nhds_of_re_neg_of_im_pos (hx_re : x.re < 0) (hx_im : 0 < x.im) :
    arg =ᶠ[𝓝 x] fun x => Real.arcsin ((-x).im / abs x) + π

Complex.arg =ᶠ[𝓝 x] fun x => Real.arcsin ((-x).im / Complex.abs x) + π


theorem tendsto_atTop_embedding [Preorder β] [Preorder γ] {f : α → β} {e : β → γ} {l : Filter α}
    (hm : ∀ b₁ b₂, e b₁ ≤ e b₂ ↔ b₁ ≤ b₂) (hu : ∀ c, ∃ b, c ≤ e b) :
    Tendsto (e ∘ f) l atTop ↔ Tendsto f l atTop

(hm : ∀ (b₁ b₂ : β), e b₁ ≤ e b₂ ↔ b₁ ≤ b₂)

Filter.Tendsto (e ∘ f) l Filter.atTop ↔ Filter.Tendsto f l Filter.atTop


theorem HasLines.existsUnique_line [HasLines P L] (p₁ p₂ : P) (hp : p₁ ≠ p₂) :
    ∃! l : L, p₁ ∈ l ∧ p₂ ∈ l

(P : Type u_1)
(L : Type u_2)
[Membership P L]
[Configuration.HasLines P L]
(p₁ p₂ : P)
(hp : p₁ ≠ p₂)


@[simp]
theorem refl_trans_refl {a : X} :
    (Path.refl a).trans (Path.refl a) = Path.refl a

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


@[simp]
theorem coe_equivMap_apply (x : L) : ↑(equivMap L f x) = f x

{F : Type u_1}
[Field F]
{E : Type u_2}
[Field E]
[Algebra F E]
{K : Type u_3}
[Field K]
[Algebra F K]
(L : IntermediateField F E)
(f : E →ₐ[F] K)
(x : ↥L)


@[simp]
theorem some_inj {a b : α} : Part.some a = some b ↔ a = b


/-- If a set `s` of semilinear functions is bounded and is closed in the weak-* topology, then its
image under coercion to functions `E → F` is a closed set. We don't have a name for `E →SL[σ] F`
with weak-* topology in `mathlib`, so we use an equivalent condition (see `isClosed_induced_iff'`).

TODO: reformulate this in terms of a type synonym with the right topology. -/
theorem isClosed_image_coe_of_bounded_of_weak_closed {s : Set (E' →SL[σ₁₂] F)} (hb : IsBounded s)
    (hc : ∀ f : E' →SL[σ₁₂] F,
      (⇑f : E' → F) ∈ closure (((↑) : (E' →SL[σ₁₂] F) → E' → F) '' s) → f ∈ s) :
    IsClosed (((↑) : (E' →SL[σ₁₂] F) → E' → F) '' s)

{σ₁₂ : 𝕜 →+* 𝕜₂}

(hc : ∀ (f : E' →SL[σ₁₂] F), ⇑f ∈ closure (DFunLike.coe '' s) → f ∈ s)


/-- `C` has reflexive coequalizers if it has coequalizers for every reflexive pair. -/
class HasReflexiveCoequalizers : Prop where
  has_coeq : ∀ ⦃A B : C⦄ (f g : A ⟶ B) [IsReflexivePair f g], HasCoequalizer f g

[self : CategoryTheory.Limits.HasReflexiveCoequalizers C]


@[simp]
theorem coeff_X_pow (k n : ℕ) : coeff (X ^ k : R[X]) n = if n = k then 1 else 0

(Polynomial.X ^ k).coeff n = if n = k then 1 else 0


@[to_additive (attr := simp)]
theorem singleton_smul (a : α) : ({a} : Finset α) • t = a • t

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


theorem mem_of_formPerm_ne_self (l : List α) (x : α) (h : formPerm l x ≠ x) : x ∈ l

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


theorem snd : IsBoundedLinearMap 𝕜 fun x : E × F => x.2

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


@[simp]
theorem J_transpose : (J l R)ᵀ = -J l R

(l : Type u_1)
(R : Type u_2)
[DecidableEq l]
[CommRing R]


theorem decide_True' (h : Decidable True) : decide True = true


{M : Type u_1}
{α : Type u_2}
[Bornology M]
[SMul M α]
{s : Set α}


@[simp]
lemma inv_apply (γ : ZeroCochain G U) (i : I) : γ⁻¹ i = (γ i)⁻¹

(γ : CategoryTheory.PresheafOfGroups.ZeroCochain G U)

γ⁻¹ i = (γ i)⁻¹


theorem NoetherianSpace.range [NoetherianSpace α] (f : α → β) (hf : Continuous f) :
    NoetherianSpace (Set.range f)

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
[TopologicalSpace.NoetherianSpace α]
(f : α → β)
(hf : Continuous f)


theorem IsSubring.inter {S₁ S₂ : Set R} (hS₁ : IsSubring S₁) (hS₂ : IsSubring S₂) :
    IsSubring (S₁ ∩ S₂)

{R : Type u}
[Ring R]
{S₁ S₂ : Set R}
(hS₁ : IsSubring S₁)
(hS₂ : IsSubring S₂)


/-- I by J matrix where each entry is a K by L matrix is equivalent to
    I × K by J × L matrix -/
@[simps]
def comp : Matrix I J (Matrix K L R) ≃ Matrix (I × K) (J × L) R

(I : Type u_1)
(J : Type u_2)
(K : Type u_3)
(L : Type u_4)
(R : Type u_5)
(n : Matrix (I × K) (J × L) R)
(i : I)
(j : J)
(k : K)
(l : L)

(Matrix.comp I J K L R).symm n i j k l = n (i, k) (j, l)


@[to_additive]
theorem smul_card_le : (s • t).card ≤ s.card • t.card

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


@[simp] theorem get_extract {as : Array α} {start stop : Nat}
    (h : i < (as.extract start stop).size) :
    (as.extract start stop)[i] = as[start + i]'(get_extract_aux h)

{α : Type u_1}
{i : Nat}
{as : Array α}
{start stop : Nat}
(h : i < (as.extract start stop).size)


theorem contDiffOn_inv {n} : ContDiffOn 𝕜 n (Inv.inv : 𝕜' → 𝕜') {0}ᶜ

(𝕜 : Type u_1)
[NontriviallyNormedField 𝕜]
{𝕜' : Type u_4}
[NormedField 𝕜']
[NormedAlgebra 𝕜 𝕜']
[CompleteSpace 𝕜']
{n : ℕ∞}


theorem fpowerSeriesBilinear_apply_two (f : E →L[𝕜] F →L[𝕜] G) (x : E × F) :
    fpowerSeriesBilinear f x 2 = f.uncurryBilinear

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

f.fpowerSeriesBilinear x 2 = f.uncurryBilinear


@[to_additive]
theorem smul_oreDiv (r : R) (x : X) (s : S) :
    r • (x /ₒ s) = oreNum (r • 1) s • x /ₒ oreDenom (r • 1) s

{R : Type u_1}
{M : Type u_3}
{X : Type u_4}
[Monoid M]
{S : Submonoid M}
[OreLocalization.OreSet S]
[MulAction M X]
[SMul R X]
[SMul R M]
[IsScalarTower R M M]
[IsScalarTower R M X]
(r : R)
(x : X)
(s : ↥S)

r • (x /ₒ s) = OreLocalization.oreNum (r • 1) s • x /ₒ OreLocalization.oreDenom (r • 1) s


theorem pi_univ_Ico_subset [Nonempty ι]: (pi univ fun i ↦ Ico (x i) (y i)) ⊆ Ico x y

{ι : Type u_1}
{α : ι → Type u_2}
[(i : ι) → Preorder (α i)]
(x y : (i : ι) → α i)
[Nonempty ι]

(Set.univ.pi fun i => Set.Ico (x i) (y i)) ⊆ Set.Ico x y


theorem isRadical_iff_squarefree_of_ne_zero (h : x ≠ 0) : IsRadical x ↔ Squarefree x

{R : Type u_1}
[CancelCommMonoidWithZero R]
{x : R}
[DecompositionMonoid R]
(h : x ≠ 0)


@[simp, norm_cast]
theorem zero_le_real {x : ℝ} : (0 : ℂ) ≤ (x : ℂ) ↔ 0 ≤ x

0 ≤ ↑x ↔ 0 ≤ x


lemma norm_pi_le_of_le {ι : Type*} [Fintype ι]
    {M : ι → Type*} [∀ i, SeminormedAddCommGroup (M i)] [∀ i, NormedSpace 𝕜 (M i)] {C : ℝ}
    {L : (i : ι) → (E →L[𝕜] M i)} (hL : ∀ i, ‖L i‖ ≤ C) (hC : 0 ≤ C) :
    ‖pi L‖ ≤ C

[(i : ι) → SeminormedAddCommGroup (M i)]


theorem Integrable.comp_smul {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
    [MeasurableSpace E] [BorelSpace E] [FiniteDimensional ℝ E] {μ : Measure E} [IsAddHaarMeasure μ]
    {f : E → F} (hf : Integrable f μ) {R : ℝ} (hR : R ≠ 0) : Integrable (fun x => f (R • x)) μ

{F : Type u_1}
[NormedAddCommGroup F]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[MeasurableSpace E]
[BorelSpace E]
[FiniteDimensional ℝ E]
{μ : MeasureTheory.Measure E}
[μ.IsAddHaarMeasure]
{f : E → F}
(hf : MeasureTheory.Integrable f μ)
{R : ℝ}
(hR : R ≠ 0)

MeasureTheory.Integrable (fun x => f (R • x)) μ


lemma inf_eq_and_sup_eq_iff : a ⊓ b = c ∧ a ⊔ b = c ↔ a = c ∧ b = c


theorem isConnected_Ico (h : a < b) : IsConnected (Ico a b)

{α : Type u}
[ConditionallyCompleteLinearOrder α]
[TopologicalSpace α]
[OrderTopology α]
[DenselyOrdered α]
{a b : α}
(h : a < b)


/-- A T₂ space, also known as a Hausdorff space, is one in which for every
  `x ≠ y` there exists disjoint open sets around `x` and `y`. This is
  the most widely used of the separation axioms. -/
@[mk_iff]
class T2Space (X : Type u) [TopologicalSpace X] : Prop where
  /-- Every two points in a Hausdorff space admit disjoint open neighbourhoods. -/
  t2 : Pairwise fun x y => ∃ u v : Set X, IsOpen u ∧ IsOpen v ∧ x ∈ u ∧ y ∈ v ∧ Disjoint u v

{X : Type u}
[TopologicalSpace X]
[self : T2Space X]

Pairwise fun x y => ∃ u v, IsOpen u ∧ IsOpen v ∧ x ∈ u ∧ y ∈ v ∧ Disjoint u v


/-- The isomorphism `S₁.cycles ≅ S₂.cycles` induced by an isomorphism
of short complexes `S₁ ≅ S₂`. -/
@[simps]
noncomputable def cyclesMapIso (e : S₁ ≅ S₂) [S₁.HasLeftHomology]
    [S₂.HasLeftHomology] : S₁.cycles ≅ S₂.cycles

(CategoryTheory.ShortComplex.cyclesMapIso e).hom = CategoryTheory.ShortComplex.cyclesMap e.hom


@[to_additive (attr := simp) prod_eq_bot_iff]
theorem prod_eq_bot_iff {H : Subgroup G} {K : Subgroup N} : H.prod K = ⊥ ↔ H = ⊥ ∧ K = ⊥

{G : Type u_1}
[AddGroup G]
{N : Type u_5}
[AddGroup N]
{H : AddSubgroup G}
{K : AddSubgroup N}


/-- The **Matrix determinant lemma**

TODO: show the more general version without `hA : IsUnit A.det` as
`(A + col u * row v).det = A.det + v ⬝ᵥ (adjugate A) *ᵥ u`.
-/
theorem det_add_col_mul_row {ι : Type*} [Unique ι]
    {A : Matrix m m α} (hA : IsUnit A.det) (u v : m → α) :
    (A + col ι u * row ι v).det = A.det * (1 + row ι v * A⁻¹ * col ι u).det

{m : Type u_2}
{α : Type u_4}
[Fintype m]
[DecidableEq m]
[CommRing α]
{ι : Type u_5}
[Unique ι]
{A : Matrix m m α}
(hA : IsUnit A.det)
(u v : m → α)

(A + Matrix.col ι u * Matrix.row ι v).det = A.det * (1 + Matrix.row ι v * A⁻¹ * Matrix.col ι u).det


@[to_additive]
theorem leftInv_leftInv_eq (hS : S ≤ IsUnit.submonoid M) : S.leftInv.leftInv = S

{M : Type u_1}
[Monoid M]
(S : Submonoid M)
(hS : S ≤ IsUnit.submonoid M)


/-- A predicate is true in a neighborhood of `x` iff it is true for all the points in an open set
containing `x`. -/
theorem eventually_nhds_iff {p : X → Prop} :
    (∀ᶠ y in 𝓝 x, p y) ↔ ∃ t : Set X, (∀ y ∈ t, p y) ∧ IsOpen t ∧ x ∈ t

{X : Type u}
{x : X}
[TopologicalSpace X]
{p : X → Prop}

(∀ᶠ (y : X) in 𝓝 x, p y) ↔ ∃ t, (∀ y ∈ t, p y) ∧ IsOpen t ∧ x ∈ t


theorem filter_map (f : β → α) (l : List β) : filter p (map f l) = map f (filter (p ∘ f) l)

{β : Type u_1}
{α : Type u_2}
{p : α → Bool}
(f : β → α)
(l : List β)

List.filter p (List.map f l) = List.map f (List.filter (p ∘ f) l)


theorem compl_neighborFinset_sdiff_inter_eq {v w : V} :
    (G.neighborFinset v)ᶜ \ {v} ∩ ((G.neighborFinset w)ᶜ \ {w}) =
      ((G.neighborFinset v)ᶜ ∩ (G.neighborFinset w)ᶜ) \ ({w} ∪ {v})

{V : Type u}
[Fintype V]
[DecidableEq V]
{G : SimpleGraph V}
[DecidableRel G.Adj]
{v w : V}


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

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

LinearEquiv.lTensor M g ≪≫ₗ LinearEquiv.rTensor Q f = TensorProduct.congr f g


@[simp]
theorem mk_len (n : SimplexCategory) : ([n.len] : SimplexCategory) = n


theorem pow_atom (a : R) (b) : a ^ b = a ^ b * (nat_lit 1).rawCast + 0

{R : Type u_1}
[CommSemiring R]
(a : R)
(b : ℕ)


theorem integral_add {f g : α → G} (hf : Integrable f μ) (hg : Integrable g μ) :
    ∫ a, f a + g a ∂μ = ∫ a, f a ∂μ + ∫ a, g a ∂μ

{α : Type u_1}
{G : Type u_5}
[NormedAddCommGroup G]
[NormedSpace ℝ G]
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f g : α → G}
(hf : MeasureTheory.Integrable f μ)
(hg : MeasureTheory.Integrable g μ)

∫ (a : α), f a + g a ∂μ = ∫ (a : α), f a ∂μ + ∫ (a : α), g a ∂μ


lemma map_lowerCentralSeries_eq {f : M →ₗ⁅R,L⁆ M₂} (hf : Function.Surjective f) :
    (lowerCentralSeries R L M k).map f = lowerCentralSeries R L M₂ k

{R : Type u}
{L : Type v}
{M : Type w}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
(k : ℕ)
{M₂ : Type w₁}
[AddCommGroup M₂]
[Module R M₂]
[LieRingModule L M₂]
[LieModule R L M₂]
{f : M →ₗ⁅R,L⁆ M₂}
(hf : Function.Surjective ⇑f)

LieSubmodule.map f (LieModule.lowerCentralSeries R L M k) = LieModule.lowerCentralSeries R L M₂ k


/-- The minimal distances to a set and its closure coincide. -/
theorem infDist_closure : infDist x (closure s) = infDist x s

{α : Type u}
[PseudoMetricSpace α]
{s : Set α}
{x : α}

Metric.infDist x (closure s) = Metric.infDist x s


lemma support_prod_subset (s : Finset ι) (f : ι → κ → M₀) :
    support (fun x ↦ ∏ i ∈ s, f i x) ⊆ ⋂ i ∈ s, support (f i)

{ι : Type u_1}
{κ : Type u_2}
{M₀ : Type u_4}
[CommMonoidWithZero M₀]
(s : Finset ι)
(f : ι → κ → M₀)

(Function.support fun x => ∏ i ∈ s, f i x) ⊆ ⋂ i ∈ s, Function.support (f i)


@[simp]
lemma equiv_mk (L : C ⥤ D) [L.IsLocalization W] {X Y : C}
    [HasSmallLocalizedHom.{w} W X Y] (f : X ⟶ Y) :
    equiv.{w} W L (mk W f) = L.map f

[CategoryTheory.Localization.HasSmallLocalizedHom W X Y]

(CategoryTheory.Localization.SmallHom.equiv W L) (CategoryTheory.Localization.SmallHom.mk W f) = L.map f


theorem zeroLocus_inf (I J : Ideal A) :
    zeroLocus 𝒜 ((I ⊓ J : Ideal A) : Set A) = zeroLocus 𝒜 I ∪ zeroLocus 𝒜 J

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

ProjectiveSpectrum.zeroLocus 𝒜 ↑(I ⊓ J) = ProjectiveSpectrum.zeroLocus 𝒜 ↑I ∪ ProjectiveSpectrum.zeroLocus 𝒜 ↑J


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


theorem exists_pair_of_one_lt_card (h : 1 < card α) : ∃ a b : α, a ≠ b

{α : Type u_1}
[Fintype α]
(h : 1 < Fintype.card α)


@[simp, norm_cast] theorem intCast_add (a b : Int) :
    ((a + b : Int) : Rat) = (a : Rat) + (b : Rat)


@[to_additive]
theorem dist_mul_mul_le (a₁ a₂ b₁ b₂ : E) : dist (a₁ * a₂) (b₁ * b₂) ≤ dist a₁ b₁ + dist a₂ b₂

{E : Type u_3}
[SeminormedAddCommGroup E]
(a₁ a₂ b₁ b₂ : E)

dist (a₁ + a₂) (b₁ + b₂) ≤ dist a₁ b₁ + dist a₂ b₂


@[simp]
theorem nat_mul_continuum {n : ℕ} (hn : n ≠ 0) : ↑n * 𝔠 = 𝔠

↑n * Cardinal.continuum = Cardinal.continuum


@[simp]
theorem length_reverse (s : Cycle α) : s.reverse.length = s.length


@[simp]
theorem coe_toFinset (s : Set α) [Fintype s] : (↑s.toFinset : Set α) = s


/-- The push-forward of an ideal `I` of `R` to `R[X]` via inclusion
 is exactly the set of polynomials whose coefficients are in `I` -/
theorem mem_map_C_iff {I : Ideal R} {f : R[X]} :
    f ∈ (Ideal.map (C : R →+* R[X]) I : Ideal R[X]) ↔ ∀ n : ℕ, f.coeff n ∈ I

{R : Type u}
[CommSemiring R]
{I : Ideal R}
{f : R[X]}

f ∈ Ideal.map Polynomial.C I ↔ ∀ (n : ℕ), f.coeff n ∈ I


theorem copy_eq (f : A →ₗc[R] B) (f' : A → B) (h : f' = ⇑f) : f.copy f' h = f

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
[CommSemiring R]
[AddCommMonoid A]
[Module R A]
[AddCommMonoid B]
[Module R B]
[CoalgebraStruct R A]
[CoalgebraStruct R B]
(f : A →ₗc[R] B)
(f' : A → B)
(h : f' = ⇑f)


theorem add_pow_add_eq_zero_of_pow_eq_zero (h_comm : Commute x y) {m n : ℕ}
    (hx : x ^ m = 0) (hy : y ^ n = 0) :
    (x + y) ^ (m + n - 1) = 0

{R : Type u_1}
{x y : R}
[Semiring R]
(h_comm : Commute x y)
{m n : ℕ}
(hx : x ^ m = 0)
(hy : y ^ n = 0)


theorem symm_bijective :
    Function.Bijective (MeasurableEquiv.symm : (α ≃ᵐ β) → β ≃ᵐ α)

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


theorem eLpNorm_map_measure (hg : AEStronglyMeasurable g (Measure.map f μ))
    (hf : AEMeasurable f μ) : eLpNorm g p (Measure.map f μ) = eLpNorm (g ∘ f) p μ

(hg : MeasureTheory.AEStronglyMeasurable g (MeasureTheory.Measure.map f μ))

MeasureTheory.eLpNorm g p (MeasureTheory.Measure.map f μ) = MeasureTheory.eLpNorm (g ∘ f) p μ


theorem le_translationNumber_of_add_nat_le {x : ℝ} {m : ℕ} (h : x + m ≤ f x) : ↑m ≤ τ f

(f : CircleDeg1Lift)
{x : ℝ}
{m : ℕ}
(h : x + ↑m ≤ f x)


/-- If `f : X → Y` is a continuous map in a locally compact pair of topological spaces,
`K : set X` is a compact set, and `U` is an open neighbourhood of `f '' K`,
then there exists a compact neighbourhood `L` of `K` such that `f` maps `L` to `U`.

This is a generalization of `exists_mem_nhds_isCompact_mapsTo`. -/
lemma exists_mem_nhdsSet_isCompact_mapsTo [LocallyCompactPair X Y] {f : X → Y} {K : Set X}
    {U : Set Y} (hf : Continuous f) (hK : IsCompact K) (hU : IsOpen U) (hKU : MapsTo f K U) :
    ∃ L ∈ 𝓝ˢ K, IsCompact L ∧ MapsTo f L U

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
[LocallyCompactPair X Y]
{f : X → Y}
{K : Set X}
{U : Set Y}
(hf : Continuous f)
(hK : IsCompact K)
(hU : IsOpen U)
(hKU : Set.MapsTo f K U)

∃ L ∈ 𝓝ˢ K, IsCompact L ∧ Set.MapsTo f L U


@[to_additive]
theorem prod_hom [CommMonoid β] (s : Multiset α) {F : Type*} [FunLike F α β]
    [MonoidHomClass F α β] (f : F) :
    (s.map f).prod = f s.prod

{α : Type u_3}
{β : Type u_4}
[CommMonoid α]
[CommMonoid β]
(s : Multiset α)
{F : Type u_6}
[FunLike F α β]
[MonoidHomClass F α β]
(f : F)


@[simp] lemma range_succ (n : ℕ) : Set.range (Fin.succ : Fin n → Fin (n + 1)) = {0}ᶜ


@[simp] theorem isNone_some : isNone (some a) = false

∀ {α : Type u_1} {a : α}, (some a).isNone = false


theorem eq_withDensity_rnDeriv₀ {s : Measure α} {f : α → ℝ≥0∞}
    (hf : AEMeasurable f ν) (hs : s ⟂ₘ ν) (hadd : μ = s + ν.withDensity f) :
    ν.withDensity f = ν.withDensity (μ.rnDeriv ν)

{α : Type u_1}
{m : MeasurableSpace α}
{μ ν s : MeasureTheory.Measure α}
{f : α → ℝ≥0∞}
(hf : AEMeasurable f ν)
(hs : s ⟂ₘ ν)
(hadd : μ = s + ν.withDensity f)


theorem Isometry.preimage_perpBisector {f : P → P'} (h : Isometry f) (p₁ p₂ : P) :
    f ⁻¹' (perpBisector (f p₁) (f p₂)) = perpBisector p₁ p₂

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{V' : Type u_3}
{P' : Type u_4}
[NormedAddCommGroup V']
[InnerProductSpace ℝ V']
[MetricSpace P']
[NormedAddTorsor V' P']
{f : P → P'}
(h : Isometry f)
(p₁ p₂ : P)

f ⁻¹' ↑(AffineSubspace.perpBisector (f p₁) (f p₂)) = ↑(AffineSubspace.perpBisector p₁ p₂)


@[reassoc (attr := simp)]
lemma rightHomologyIso_inv_comp_rightHomologyι :
    h.rightHomologyIso.inv ≫ S.rightHomologyι = h.ι ≫ h.opcyclesIso.inv

CategoryTheory.CategoryStruct.comp h.rightHomologyIso.inv S.rightHomologyι =
  CategoryTheory.CategoryStruct.comp h.ι h.opcyclesIso.inv


@[simp]
theorem le_sup_sdiff_sup_sdiff : a ≤ b ⊔ (a \ c ⊔ c \ b)

{α : Type u_2}
[GeneralizedCoheytingAlgebra α]
{a b c : α}


lemma cPolyomialOn : CPolynomialOn 𝕜 f ⊤

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{ι : Type u_2}
{E : ι → Type u_3}
[(i : ι) → NormedAddCommGroup (E i)]
[(i : ι) → NormedSpace 𝕜 (E i)]
[Fintype ι]
(f : ContinuousMultilinearMap 𝕜 E F)


theorem IsClopenable.iUnion [t : TopologicalSpace α] [PolishSpace α] {s : ℕ → Set α}
    (hs : ∀ n, IsClopenable (s n)) : IsClopenable (⋃ n, s n)

(hs : ∀ (n : ℕ), PolishSpace.IsClopenable (s n))


theorem aeval_zeta [IsDomain B] [NeZero ((n : ℕ) : B)] :
    aeval (zeta n A B) (cyclotomic n A) = 0

(n : ℕ+)
(A : Type w)
(B : Type z)
[CommRing A]
[CommRing B]
[Algebra A B]
[IsCyclotomicExtension {n} A B]
[IsDomain B]
[NeZero ↑↑n]

(Polynomial.aeval (IsCyclotomicExtension.zeta n A B)) (Polynomial.cyclotomic (↑n) A) = 0


@[simp]
protected theorem single_smul (p) (i : α) (a : E i) (c : 𝕜) :
    lp.single p i (c • a) = c • lp.single p i a

{α : Type u_1}
{E : α → Type u_2}
[(i : α) → NormedAddCommGroup (E i)]
{𝕜 : Type u_3}
[NormedRing 𝕜]
[(i : α) → Module 𝕜 (E i)]
[∀ (i : α), BoundedSMul 𝕜 (E i)]
[DecidableEq α]
(p : ℝ≥0∞)
(i : α)
(a : E i)
(c : 𝕜)


theorem subset_of_mem_powerset {x s : Set α} (h : x ∈ 𝒫 s) : x ⊆ s

{α : Type u}
{x s : Set α}
(h : x ∈ 𝒫 s)


theorem succ_le_iff_eq_top : succ a ≤ a ↔ a = ⊤

{α : Type u_1}
[PartialOrder α]
[SuccOrder α]
{a : α}
[OrderTop α]


/-- The element `0` is `M`-regular if and only if `M` is trivial. -/
theorem zero_iff_subsingleton : IsSMulRegular M (0 : R) ↔ Subsingleton M

{R : Type u_1}
{M : Type u_3}
[MonoidWithZero R]
[Zero M]
[MulActionWithZero R M]


theorem MDifferentiable.neg (hf : MDifferentiable I 𝓘(𝕜, E') f) : MDifferentiable I 𝓘(𝕜, E') (-f)

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


/-- A version of `GradedMonoid.GOne` for internally graded objects. -/
class SetLike.GradedOne {S : Type*} [SetLike S R] [One R] [Zero ι] (A : ι → S) : Prop where
  /-- One has grade zero -/
  one_mem : (1 : R) ∈ A 0

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


lemma freeHomEquiv_symm_comp {M N : SheafOfModules.{u} R} {I : Type u} (s : I → M.sections)
    (p : M ⟶ N) :
    M.freeHomEquiv.symm s ≫ p = N.freeHomEquiv.symm (fun i ↦ sectionsMap p (s i))

{J : CategoryTheory.GrothendieckTopology C}

[J.HasSheafCompose (CategoryTheory.forget₂ RingCat AddCommGrp)]

M.freeHomEquiv.symm s ≫ p = N.freeHomEquiv.symm fun i => SheafOfModules.sectionsMap p (s i)


@[simp] theorem getMsb_shiftLeft (x : BitVec w) (i) :
    (x <<< i).getMsb k = x.getMsb (k + i)


@[simp]
theorem ofDual_compares_ofDual [LT α] {a b : αᵒᵈ} {o : Ordering} :
    Compares o (ofDual a) (ofDual b) ↔ Compares o b a

{α : Type u_1}
[LT α]
{a b : αᵒᵈ}
{o : Ordering}

o.Compares (OrderDual.ofDual a) (OrderDual.ofDual b) ↔ o.Compares b a


@[simp] lemma neg_apply {f : E →WOT[𝕜] F} (x : E) : (-f) x = -(f x)

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[RCLike 𝕜]
[AddCommGroup E]
[TopologicalSpace E]
[Module 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E →WOT[𝕜]F}
(x : E)


@[simp]
theorem map_comp_proj (cond : LEComap f A B) : map f cond ∘ A.proj = B.proj ∘ f

{X : Type u_2}
{Y : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
{f : C(X, Y)}
{A : DiscreteQuotient X}
{B : DiscreteQuotient Y}
(cond : DiscreteQuotient.LEComap f A B)

DiscreteQuotient.map f cond ∘ A.proj = B.proj ∘ ⇑f


theorem invFun_monomial (n : ℕ) (a : A) :
    invFun R A (monomial n a) = (a ⊗ₜ[R] 1) * 1 ⊗ₜ[R] X ^ n

(R : Type u_1)
(A : Type u_2)
[CommSemiring R]
[Semiring A]
[Algebra R A]
(n : ℕ)
(a : A)

PolyEquivTensor.invFun R A ((Polynomial.monomial n) a) = a ⊗ₜ[R] 1 * 1 ⊗ₜ[R] Polynomial.X ^ n


@[simp]
theorem unpair_pair (a b : ℕ) : unpair (pair a b) = (a, b)


nonrec theorem star_eq_two_re_sub : star a = ↑(2 * a.re) - a


theorem range_bind_sublistsLen_perm (l : List α) :
    ((List.range (l.length + 1)).bind fun n => sublistsLen n l) ~ sublists' l

((List.range (l.length + 1)).bind fun n => List.sublistsLen n l).Perm l.sublists'


theorem IsHermitian.exp [StarRing 𝔸] [ContinuousStar 𝔸] {A : Matrix m m 𝔸} (h : A.IsHermitian) :
    (exp 𝕂 A).IsHermitian

(𝕂 : Type u_1)
{m : Type u_2}
{𝔸 : Type u_6}
[Fintype m]
[DecidableEq m]
[Field 𝕂]
[Ring 𝔸]
[TopologicalSpace 𝔸]
[TopologicalRing 𝔸]
[Algebra 𝕂 𝔸]
[T2Space 𝔸]
[StarRing 𝔸]
[ContinuousStar 𝔸]
{A : Matrix m m 𝔸}
(h : A.IsHermitian)


/-- An element of `k[G]` is in the submodule generated by its support. -/
theorem mem_span_support [AddZeroClass G] (f : k[G]) :
    f ∈ Submodule.span k (of k G '' (f.support : Set G))

{k : Type u₁}
{G : Type u₂}
[Semiring k]
[AddZeroClass G]
(f : AddMonoidAlgebra k G)

f ∈ Submodule.span k (⇑(AddMonoidAlgebra.of k G) '' ↑f.support)


@[to_additive (attr := norm_cast) (reorder := 7 8)]
theorem coe_zpow [Group β] [TopologicalGroup β] (f : C(α, β)) (z : ℤ) : ⇑(f ^ z) = (⇑f) ^ z

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
[Group β]
[TopologicalGroup β]
(f : C(α, β))
(z : ℤ)


@[norm_cast]
lemma cast_inv_of_ne_zero (hq : (q.num : α) ≠ 0) : (q⁻¹ : ℚ≥0) = (q⁻¹ : α)

{α : Type u_3}
[DivisionSemiring α]
{q : ℚ≥0}
(hq : ↑q.num ≠ 0)

↑q⁻¹ = (↑q)⁻¹


@[to_additive]
theorem orderOf_eq_prime (hg : x ^ p = 1) (hg1 : x ≠ 1) : orderOf x = p

{G : Type u_1}
[Monoid G]
{x : G}
{p : ℕ}
[hp : Fact (Nat.Prime p)]
(hg : x ^ p = 1)
(hg1 : x ≠ 1)


@[to_additive (attr := simp)]
theorem restrict_range (f : G →* N) : (f.restrict K).range = K.map f

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

(f.restrict K).range = AddSubgroup.map f K


/-- Convergence in the metric on `C₀(α, β)` is uniform convergence. -/
theorem tendsto_iff_tendstoUniformly {ι : Type*} {F : ι → C₀(α, β)} {f : C₀(α, β)} {l : Filter ι} :
    Tendsto F l (𝓝 f) ↔ TendstoUniformly (fun i => F i) f l

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[PseudoMetricSpace β]
[Zero β]
{ι : Type u_2}
{F : ι → α →C₀ β}
{f : α →C₀ β}
{l : Filter ι}

Filter.Tendsto F l (𝓝 f) ↔ TendstoUniformly (fun i => ⇑(F i)) (⇑f) l


@[simp]
theorem some_dom (a : α) : (some a).Dom


/-- A version of `iInf_option` useful for rewriting right-to-left. -/
theorem iInf_option_elim (a : α) (f : β → α) : ⨅ o : Option β, o.elim a f = a ⊓ ⨅ b, f b

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


lemma toENatAux_nat (n : ℕ) : toENatAux n = n


@[simp]
theorem coeff_expand_mul {p : ℕ} (hp : 0 < p) (f : R[X]) (n : ℕ) :
    (expand R p f).coeff (n * p) = f.coeff n

{R : Type u}
[CommSemiring R]
{p : ℕ}
(hp : 0 < p)
(f : R[X])
(n : ℕ)

((Polynomial.expand R p) f).coeff (n * p) = f.coeff n


@[simp] theorem drop_replicate (a : α) : ∀ n m : Nat, drop n (replicate m a) = replicate (m - n) a

List.drop n (List.replicate m a) = List.replicate (m - n) a


theorem IsRegular.pos {c : Cardinal} (H : c.IsRegular) : 0 < c


@[to_additive]
theorem mul_inv_eq_one : a * b⁻¹ = 1 ↔ a = b


@[simp]
theorem snoc_cast_add {α : Fin (n + m + 1) → Type*} (f : ∀ i : Fin (n + m), α (castSucc i))
    (a : α (last (n + m))) (i : Fin n) : (snoc f a) (castAdd (m + 1) i) = f (castAdd m i)

{m n : ℕ}
{α : Fin (n + m + 1) → Type u_1}
(f : (i : Fin (n + m)) → α i.castSucc)
(a : α (Fin.last (n + m)))
(i : Fin n)

Fin.snoc f a (Fin.castAdd (m + 1) i) = f (Fin.castAdd m i)


@[simp] protected theorem Matroidᵣ.le_iff {M M' : Matroidᵣ α} :
    M ≤ M' ↔ (M : Matroid α) ≤r (M' : Matroid α)

{α : Type u_1}
{M M' : Matroid.Matroidᵣ α}

M ≤ M' ↔ M.toMatroid.Restriction M'.toMatroid


@[rclike_simps]
theorem im_ofReal_mul (r : ℝ) (z : K) : im (↑r * z) = r * im z

{K : Type u_1}
[RCLike K]
(r : ℝ)
(z : K)


theorem colimit_topology (F : J ⥤ TopCat.{max v u}) :
    (colimit F).str = ⨆ j, (F.obj j).str.coinduced (colimit.ι F j)

{J : Type v}
[CategoryTheory.SmallCategory J]
(F : J ⥤ TopCat)

(CategoryTheory.Limits.colimit F).str =
  ⨆ j, TopologicalSpace.coinduced (⇑(CategoryTheory.Limits.colimit.ι F j)) (F.obj j).str


theorem map_mem_maximals_iff (ha : a ∈ x) : f a ∈ maximals s (f '' x) ↔ a ∈ maximals r x

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


theorem MvPolynomial.sum_eval_eq_zero (f : MvPolynomial σ K)
    (h : f.totalDegree < (q - 1) * Fintype.card σ) : ∑ x, eval x f = 0

(h : f.totalDegree < (Fintype.card K - 1) * Fintype.card σ)

∑ x : σ → K, (MvPolynomial.eval x) f = 0


theorem IsPreconnected.subset_right_of_subset_union (hu : IsOpen u) (hv : IsOpen v)
    (huv : Disjoint u v) (hsuv : s ⊆ u ∪ v) (hsv : (s ∩ v).Nonempty) (hs : IsPreconnected s) :
    s ⊆ v

{α : Type u}
[TopologicalSpace α]
{s u v : Set α}
(hu : IsOpen u)
(hv : IsOpen v)
(huv : Disjoint u v)
(hsuv : s ⊆ u ∪ v)
(hsv : (s ∩ v).Nonempty)
(hs : IsPreconnected s)


/-- If `G` is adjoint to `F` then `F.op` is adjoint to `G.op`. -/
@[simps! unit_app counit_app]
-- Porting note: in mathlib3 we generated all the default `simps` lemmas.
-- However the `simpNF` linter correctly flags some of these as unsuitable simp lemmas.
-- `unit_app` and `counit_app` appear to suffice (tested in mathlib3).
-- See also the porting note on adjointOfOpAdjointOp
def opAdjointOpOfAdjoint (F : C ⥤ D) (G : D ⥤ C) (h : G ⊣ F) : F.op ⊣ G.op

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
(F : C ⥤ D)
(G : D ⥤ C)
(h : G ⊣ F)
(Y : Dᵒᵖ)

(CategoryTheory.Adjunction.opAdjointOpOfAdjoint F G h).counit.app Y =
  (CategoryTheory.opEquiv (Opposite.op (F.obj (G.obj (Opposite.unop Y)))) Y).symm
    (h.unit.app (Opposite.unop Y) ≫
      F.map
        ((CategoryTheory.opEquiv (Opposite.op (G.obj (Opposite.unop Y)))
            (Opposite.op (G.toPrefunctor.1 (Opposite.unop Y))))
          (𝟙 (Opposite.op (G.obj (Opposite.unop Y))))))


theorem IsSuccLimit.succ_lt (hb : IsSuccLimit b) (ha : a < b) : succ a < b

{α : Type u_1}
[PartialOrder α]
[SuccOrder α]
{a b : α}
(hb : Order.IsSuccLimit b)
(ha : a < b)


@[simp, nolint simpNF]
lemma toScott_inj {a b : α} : toScott a = toScott b ↔ a = b

Topology.WithScott.toScott a = Topology.WithScott.toScott b ↔ a = b


/-- Given a finite-dimensional subspace `W` of a space `V` with separating dual, any
  linear functional on `W` extends to a continuous linear functional on `V`.
  This is stated more generally for an injective linear map from `W` to `V`. -/
theorem dualMap_surjective_iff {W} [AddCommGroup W] [Module R W] [FiniteDimensional R W]
    {f : W →ₗ[R] V} : Surjective (f.dualMap ∘ ContinuousLinearMap.toLinearMap) ↔ Injective f

{R : Type u_1}
{V : Type u_2}
[Field R]
[AddCommGroup V]
[TopologicalSpace R]
[TopologicalSpace V]
[TopologicalRing R]
[Module R V]
[SeparatingDual R V]
{W : Type u_3}
[AddCommGroup W]
[Module R W]
[FiniteDimensional R W]
{f : W →ₗ[R] V}

Function.Surjective (⇑f.dualMap ∘ ContinuousLinearMap.toLinearMap) ↔ Function.Injective ⇑f


@[simp]
theorem star_smul [Monoid S] [DistribMulAction S R] (s : S) (a : ℍ[R]) :
    star (s • a) = s • star a

{S : Type u_1}
{R : Type u_3}
[CommRing R]
[Monoid S]
[DistribMulAction S R]
(s : S)
(a : ℍ[R])


@[simp]
theorem xor_bit : ∀ a m b n, bit a m ^^^ bit b n = bit (bne a b) (m ^^^ n)

Nat.bit a m ^^^ Nat.bit b n = Nat.bit (a != b) (m ^^^ n)


theorem reindexRange_repr_self (i : ι) :
    b.reindexRange.repr (b i) = Finsupp.single ⟨b i, mem_range_self i⟩ 1

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

b.reindexRange.repr (b i) = Finsupp.single ⟨b i, ⋯⟩ 1


theorem sInf_def (S : Set ℝ) : sInf S = -sSup (-S)


@[simp]
theorem coe_id (X : CompHausLike P) : (𝟙 ((forget (CompHausLike P)).obj X)) = id

(P : TopCat → Prop)
(X : CompHausLike P)

𝟙 ((CategoryTheory.forget (CompHausLike P)).obj X) = id


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

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[TopologicalSpace β]
[Zero β]
{f g : α →C₀ β}
(h : ∀ (x : α), f x = g x)


@[simp]
theorem mem_comap {f : E →ₗ[𝕜] F} {S : ConvexCone 𝕜 F} {x : E} : x ∈ S.comap f ↔ f x ∈ S

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[AddCommMonoid F]
[Module 𝕜 E]
[Module 𝕜 F]
{f : E →ₗ[𝕜] F}
{S : ConvexCone 𝕜 F}
{x : E}


/-- If `S` is an `R' = M⁻¹R` algebra, and `x ∈ adjoin R' s`,
then `t • x ∈ adjoin R s` for some `t : M`. -/
theorem multiple_mem_adjoin_of_mem_localization_adjoin [Algebra R' S] [Algebra R S]
    [IsScalarTower R R' S] [IsLocalization M R'] (s : Set S) (x : S)
    (hx : x ∈ Algebra.adjoin R' s) : ∃ t : M, t • x ∈ Algebra.adjoin R s

{R S : Type u}
[CommRing R]
[CommRing S]
(M : Submonoid R)
(R' : Type u)
[CommRing R']
[Algebra R R']
[Algebra R' S]
[Algebra R S]
[IsScalarTower R R' S]
[IsLocalization M R']
(s : Set S)
(x : S)
(hx : x ∈ Algebra.adjoin R' s)


/-- this is slightly different from `StronglyMeasurable.piecewise`. It can be used to show
`StronglyMeasurable (ite (x=0) 0 1)` by
`exact StronglyMeasurable.ite (measurableSet_singleton 0) stronglyMeasurable_const
stronglyMeasurable_const`, but replacing `StronglyMeasurable.ite` by
`StronglyMeasurable.piecewise` in that example proof does not work. -/
protected theorem ite {_ : MeasurableSpace α} [TopologicalSpace β] {p : α → Prop}
    {_ : DecidablePred p} (hp : MeasurableSet { a : α | p a }) (hf : StronglyMeasurable f)
    (hg : StronglyMeasurable g) : StronglyMeasurable fun x => ite (p x) (f x) (g x)

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

∀ {x : MeasurableSpace α} [inst : TopologicalSpace β] {p : α → Prop} {x_1 : DecidablePred p},
  MeasurableSet {a | p a} →
    MeasureTheory.StronglyMeasurable f →
      MeasureTheory.StronglyMeasurable g → MeasureTheory.StronglyMeasurable fun x => if p x then f x else g x


theorem ae_restrict_biUnion_iff (s : ι → Set α) {t : Set ι} (ht : t.Countable) (p : α → Prop) :
    (∀ᵐ x ∂μ.restrict (⋃ i ∈ t, s i), p x) ↔ ∀ i ∈ t, ∀ᵐ x ∂μ.restrict (s i), p x

{α : Type u_2}
{ι : Type u_6}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
(s : ι → Set α)
{t : Set ι}
(ht : t.Countable)
(p : α → Prop)

(∀ᵐ (x : α) ∂μ.restrict (⋃ i ∈ t, s i), p x) ↔ ∀ i ∈ t, ∀ᵐ (x : α) ∂μ.restrict (s i), p x


theorem mul_principal_add_is_principal_add (a : Ordinal.{u}) {b : Ordinal.{u}} (hb₁ : b ≠ 1)
    (hb : Principal (· + ·) b) : Principal (· + ·) (a * b)

(hb : Ordinal.Principal (fun x x_1 => x + x_1) b)

Ordinal.Principal (fun x x_1 => x + x_1) (a * b)


/-- Any retract of a `TietzeExtension` space is one itself. -/
theorem TietzeExtension.of_retract {Y : Type v} {Z : Type w} [TopologicalSpace Y]
    [TopologicalSpace Z] [TietzeExtension.{u, w} Z] (ι : C(Y, Z)) (r : C(Z, Y))
    (h : r.comp ι = .id Y) : TietzeExtension.{u, v} Y

{Y : Type v}
{Z : Type w}
[TopologicalSpace Y]
[TopologicalSpace Z]
[TietzeExtension Z]
(ι : C(Y, Z))
(r : C(Z, Y))
(h : r.comp ι = ContinuousMap.id Y)


@[simp] theorem head_cons : @head α (a::l) h = a

{α : Type u}
{a : α}
{l : List α}
{h : a :: l ≠ List.nil}


protected theorem dist_comm (z w : ℍ) : dist z w = dist w z


theorem map_ciInf (e : α ≃o β) {f : ι → α} (hf : BddBelow (range f)) :
    e (⨅ i, f i) = ⨅ i, e (f i)

{α : Type u_1}
{β : Type u_2}
{ι : Sort u_4}
[ConditionallyCompleteLattice α]
[ConditionallyCompleteLattice β]
[Nonempty ι]
(e : α ≃o β)
{f : ι → α}
(hf : BddBelow (Set.range f))


@[simp]
theorem tan_toReal (θ : Angle) : Real.tan θ.toReal = tan θ


@[simp]
theorem union_ae_eq_left_iff_ae_subset : (s ∪ t : Set α) =ᵐ[μ] s ↔ t ≤ᵐ[μ] s

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


theorem Lex.mono_right (hs : ∀ a b, s₁ a b → s₂ a b) (h : Lex r s₁ x y) : Lex r s₂ x y

∀ {β : Type u_1} {s₁ s₂ : β → β → Prop} {α : Type u_2} {r : α → α → Prop} {x y : α ⊕ β},
  (∀ (a b : β), s₁ a b → s₂ a b) → Sum.Lex r s₁ x y → Sum.Lex r s₂ x y


@[to_additive]
protected lemma MulAction.injective (g : α) : Function.Injective (g • · : β → β)

{α : Type u_1}
{β : Type u_2}
[AddGroup α]
[AddAction α β]
(g : α)


theorem mem_rangeS_self (f : R →+* S) (x : R) : f x ∈ f.rangeS

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


theorem jacobiSymNat.qr₁'_mod (a b ab : ℕ) (r : ℤ) (ha : a % 2 = 1) (hb : b % 4 = 1)
    (hab : b % a = ab) (hr : jacobiSymNat ab a = r) : jacobiSymNat a b = r

(hr : Mathlib.Meta.NormNum.jacobiSymNat ab a = r)

Mathlib.Meta.NormNum.jacobiSymNat a b = r


theorem nndist_eq_of_L2 {β : ι → Type*} [∀ i, SeminormedAddCommGroup (β i)] (x y : PiLp 2 β) :
    nndist x y = NNReal.sqrt (∑ i, nndist (x i) (y i) ^ 2)

[(i : ι) → SeminormedAddCommGroup (β i)]

nndist x y = NNReal.sqrt (∑ i : ι, nndist (x i) (y i) ^ 2)


theorem mod_eq_zero_of_dvd : ∀ {a b : Int}, a ∣ b → mod b a = 0


@[simp, norm_cast]
theorem coe_neg : ((-f : RatFunc F) : LaurentSeries F) = -f


@[measurability]
protected theorem measurable (e : α ≃ᵐ β) : Measurable (e : α → β)

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
[MeasurableSpace β]
(e : α ≃ᵐ β)


@[to_additive]
theorem eq_iff_div_mem {N : Subgroup G} [nN : N.Normal] {x y : G} :
    (x : G ⧸ N) = y ↔ x / y ∈ N

{G : Type u}
[AddGroup G]
{N : AddSubgroup G}
[nN : N.Normal]
{x y : G}


/-- Viewing a module as an affine space modelled on itself, we can characterise affine independence
in terms of linear combinations. -/
theorem affineIndependent_iff {ι} {p : ι → V} :
    AffineIndependent k p ↔
      ∀ (s : Finset ι) (w : ι → k), s.sum w = 0 → ∑ e ∈ s, w e • p e = 0 → ∀ e ∈ s, w e = 0

{k : Type u_1}
{V : Type u_2}
[Ring k]
[AddCommGroup V]
[Module k V]
{ι : Type u_5}
{p : ι → V}


protected theorem IsOpen.upperClosure : IsOpen s → IsOpen (upperClosure s : Set α)

{α : Type u_1}
[TopologicalSpace α]
[Preorder α]
[HasUpperLowerClosure α]
{s : Set α}


theorem map_add_one [AddMonoidWithOne G] [Add H] [AddConstMapClass F G H 1 b]
    (f : F) (x : G) : f (x + 1) = f x + b

{F : Type u_1}
{G : Type u_2}
{H : Type u_3}
[FunLike F G H]
{b : H}
[AddMonoidWithOne G]
[Add H]
[AddConstMapClass F G H 1 b]
(f : F)
(x : G)


@[simp]
theorem coe_inr : (inr R A B : B → A × B) = Prod.mk 0

{R : Type u}
[Monoid R]
{A : Type v}
{B : Type w}
[NonUnitalNonAssocSemiring A]
[DistribMulAction R A]
[NonUnitalNonAssocSemiring B]
[DistribMulAction R B]

⇑(NonUnitalAlgHom.inr R A B) = Prod.mk 0


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

(CategoryTheory.Limits.widePushoutShapeOpEquiv J).functor = CategoryTheory.Limits.widePushoutShapeUnop J


@[simp]
theorem isAdjointPair_toBilin [DecidableEq n] :
    BilinForm.IsAdjointPair (Matrix.toBilin b J) (Matrix.toBilin b J₃) (Matrix.toLin b b A)
        (Matrix.toLin b b A') ↔
      Matrix.IsAdjointPair J J₃ A A'

{R₃ : Type u_7}
{M₃ : Type u_8}
[CommRing R₃]
[AddCommGroup M₃]
[Module R₃ M₃]
{n : Type u_11}
[Fintype n]
(b : Basis n R₃ M₃)
(J J₃ A A' : Matrix n n R₃)
[DecidableEq n]

((Matrix.toBilin b) J).IsAdjointPair ((Matrix.toBilin b) J₃) ((Matrix.toLin b b) A) ((Matrix.toLin b b) A') ↔
  J.IsAdjointPair J₃ A A'


theorem FactorSet.coe_add {a b : Multiset { a : Associates α // Irreducible a }} :
    (↑(a + b) : FactorSet α) = a + b

{α : Type u_1}
[CancelCommMonoidWithZero α]
{a b : Multiset { a // Irreducible a }}


theorem AlgebraicIndependent.isTranscendenceBasis_iff {ι : Type w} {R : Type u} [CommRing R]
    [Nontrivial R] {A : Type v} [CommRing A] [Algebra R A] {x : ι → A}
    (i : AlgebraicIndependent R x) :
    IsTranscendenceBasis R x ↔
      ∀ (κ : Type v) (w : κ → A) (_ : AlgebraicIndependent R w) (j : ι → κ) (_ : w ∘ j = x),
        Surjective j

IsTranscendenceBasis R x ↔
  ∀ (κ : Type v) (w : κ → A), AlgebraicIndependent R w → ∀ (j : ι → κ), w ∘ j = x → Function.Surjective j


/-- If a predicate `p` is true on some set `s ⊆ L`, true for `0`, stable by scalar multiplication,
by addition and by Lie bracket, then the predicate is true on the Lie span of `s`. (Since `s` can be
empty, and the Lie span always contains `0`, the assumption that `p 0` holds cannot be removed.) -/
@[elab_as_elim]
theorem lieSpan_induction {p : L → Prop} {x : L} (h : x ∈ lieSpan R L s) (mem : ∀ x ∈ s, p x)
    (zero : p 0) (smul : ∀ (r : R), ∀ {x : L}, p x → p (r • x))
    (add : ∀ x y, p x → p y → p (x + y)) (lie : ∀ x y, p x → p y → p ⁅x, y⁆) : p x

(smul : ∀ (r : R) {x : L}, p x → p (r • x))

(add : ∀ (x y : L), p x → p y → p (x + y))

(lie : ∀ (x y : L), p x → p y → p ⁅x, y⁆)


/-- A `MorphismProperty` in `W.Localization` is satisfied by all
morphisms in the localized category if it contains the image of the
morphisms in the original category, if is stable under composition
and if the property is stable by passing to inverses. -/
theorem morphismProperty_is_top' (P : MorphismProperty W.Localization)
    [P.IsStableUnderComposition] (hP₁ : ∀ ⦃X Y : C⦄ (f : X ⟶ Y), P (W.Q.map f))
    (hP₂ : ∀ ⦃X Y : W.Localization⦄ (e : X ≅ Y) (_ : P e.hom), P e.inv) : P = ⊤

(P : CategoryTheory.MorphismProperty W.Localization)

(hP₂ : ∀ ⦃X Y : W.Localization⦄ (e : X ≅ Y), P e.hom → P e.inv)


theorem _root_.IsMax.Ioi_eq (h : IsMax a) : Ioi a = ∅

{α : Type u_1}
[Preorder α]
{a : α}
(h : IsMax a)


@[simp]
theorem insert_lookupFinsupp [DecidableEq α] (l : AList fun _x : α => M) (a : α) (m : M) :
    (l.insert a m).lookupFinsupp = l.lookupFinsupp.update a m

{α : Type u_1}
{M : Type u_2}
[Zero M]
[DecidableEq α]
(l : AList fun _x => M)
(a : α)
(m : M)

(AList.insert a m l).lookupFinsupp = l.lookupFinsupp.update a m


@[simp]
theorem map_fract_sub_fract_eq (x : ℝ) : f (fract x) - fract x = f x - x


@[simp]
theorem mem_sigma {l₁ : List α} {l₂ : ∀ a, List (σ a)} {a : α} {b : σ a} :
    Sigma.mk a b ∈ l₁.sigma l₂ ↔ a ∈ l₁ ∧ b ∈ l₂ a

{α : Type u_1}
{σ : α → Type u_3}
{l₁ : List α}
{l₂ : (a : α) → List (σ a)}
{a : α}
{b : σ a}

⟨a, b⟩ ∈ l₁.sigma l₂ ↔ a ∈ l₁ ∧ b ∈ l₂ a


theorem equivQuotient_index : hs.equivQuotient ∘ hs.index = hs.proj

{ι : Type u_1}
{α : Type u_2}
{s : ι → Set α}
(hs : IndexedPartition s)


@[simp]
theorem eval_intCast_map {R S : Type*} [Ring R] [Ring S] (f : R →+* S) (p : R[X]) (i : ℤ) :
    (p.map f).eval (i : S) = f (p.eval i)

{R : Type u_1}
{S : Type u_2}
[Ring R]
[Ring S]
(f : R →+* S)
(p : R[X])
(i : ℤ)

Polynomial.eval (↑i) (Polynomial.map f p) = f (Polynomial.eval (↑i) p)


theorem fold_distrib {f g : β → α} (u₁ u₂ : α) (s : Multiset β) :
    (s.map fun x => f x * g x).fold op (u₁ * u₂) = (s.map f).fold op u₁ * (s.map g).fold op u₂

{α : Type u_1}
{β : Type u_2}
(op : α → α → α)
[hc : Std.Commutative op]
[ha : Std.Associative op]
{f g : β → α}
(u₁ u₂ : α)
(s : Multiset β)

Multiset.fold op (op u₁ u₂) (Multiset.map (fun x => op (f x) (g x)) s) =
  op (Multiset.fold op u₁ (Multiset.map f s)) (Multiset.fold op u₂ (Multiset.map g s))


@[simp 1100]
theorem dNext_comp_left (f : C ⟶ D) (g : ∀ i j, D.X i ⟶ E.X j) (i : ι) :
    (dNext i fun i j => f.f i ≫ g i j) = f.f i ≫ dNext i g

{ι : Type u_1}
{V : Type u}
[CategoryTheory.Category.{v, u} V]
[CategoryTheory.Preadditive V]
{c : ComplexShape ι}
{C D E : HomologicalComplex V c}
(f : C ⟶ D)
(g : (i j : ι) → D.X i ⟶ E.X j)
(i : ι)

((dNext i) fun i j => f.f i ≫ g i j) = f.f i ≫ (dNext i) g


nonrec theorem Valid.left {s l x r} (H : Valid (@node α s l x r)) : Valid l

{α : Type u_1}
[Preorder α]
{s : ℕ}
{l : Ordnode α}
{x : α}
{r : Ordnode α}
(H : (Ordnode.node s l x r).Valid)


@[simp] theorem AlgHom.comp_id_algebraCat
    {R} [CommRing R] {G : AlgebraCat.{u} R} {H : Type u} [Ring H] [Algebra R H] (f : G →ₐ[R] H) :
    f.comp (𝟙 G) = f

{R : Type u_1}
[CommRing R]
{G : AlgebraCat R}
{H : Type u}
[Ring H]
[Algebra R H]
(f : ↑G →ₐ[R] H)


lemma lt_of_div_lt_div (h : a / c < b / c) : a < b