lemma isNilpotent_trace_of_isNilpotent {f : M →ₗ[R] M} (hf : IsNilpotent f) :
    IsNilpotent (trace R M f)

{R : Type u_1}
[CommRing R]
{M : Type u_2}
[AddCommGroup M]
[Module R M]
[Module.Free R M]
[Module.Finite R M]
{f : M →ₗ[R] M}
(hf : IsNilpotent f)


theorem natCast_fst (n : ℕ) : (n : 𝓜(𝕜, A)).fst = n

{𝕜 : Type u_1}
{A : Type u_2}
[NontriviallyNormedField 𝕜]
[NonUnitalNormedRing A]
[NormedSpace 𝕜 A]
[SMulCommClass 𝕜 A A]
[IsScalarTower 𝕜 A A]
(n : ℕ)


@[elab_as_elim]
theorem induction_on₂ {β : LocalizedModule S M → LocalizedModule S M → Prop}
    (h : ∀ (m m' : M) (s s' : S), β (mk m s) (mk m' s')) : ∀ x y, β x y

(h : ∀ (m m' : M) (s s' : ↥S), β (LocalizedModule.mk m s) (LocalizedModule.mk m' s'))


@[to_additive (attr := simp)]
theorem lift_eval_of (f : α → M) (x : α) : lift f (of x) = f x

{α : Type u_1}
{M : Type u_4}
[AddMonoid M]
(f : α → M)
(x : α)

(FreeAddMonoid.lift f) (FreeAddMonoid.of x) = f x


protected theorem mdifferentiableOn {s} : MDifferentiableOn I 𝓘(𝕜, E) I s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
(I : ModelWithCorners 𝕜 E H)
{s : Set H}


/-- Every open cover of a quasi-compact scheme can be refined into a finite subcover.
-/
@[simps! obj map]
def OpenCover.finiteSubcover {X : Scheme.{u}} (𝒰 : OpenCover X) [H : CompactSpace X] :
    OpenCover X

[H : CompactSpace ↑↑X.toPresheafedSpace]


/-- Given any rational approximation `q` to the irrational real number `ξ`, there is
a good rational approximation `q'` such that `|ξ - q'| < |ξ - q|`. -/
theorem exists_rat_abs_sub_lt_and_lt_of_irrational {ξ : ℝ} (hξ : Irrational ξ) (q : ℚ) :
    ∃ q' : ℚ, |ξ - q'| < 1 / (q'.den : ℝ) ^ 2 ∧ |ξ - q'| < |ξ - q|


/-- If the second of three points is weakly between the other two, the oriented angle at the
first point (reversed) is zero. -/
theorem _root_.Wbtw.oangle₃₁₂_eq_zero {p₁ p₂ p₃ : P} (h : Wbtw ℝ p₁ p₂ p₃) : ∡ p₃ p₁ p₂ = 0

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


theorem as_sum_range' (p : R[X]) (n : ℕ) (w : p.natDegree < n) :
    p = ∑ i ∈ range n, monomial i (coeff p i)

{R : Type u}
[Semiring R]
(p : R[X])
(n : ℕ)
(w : p.natDegree < n)

p = ∑ i ∈ Finset.range n, (Polynomial.monomial i) (p.coeff i)


/-- Left unitor as a natural isomorphism. -/
@[simps!]
def leftUnitorNatIso (a b : B) : (precomposing _ _ b).obj (𝟙 a) ≅ 𝟭 (a ⟶ b)

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

(CategoryTheory.Bicategory.leftUnitorNatIso a b).hom.app X = (CategoryTheory.Bicategory.leftUnitor X).hom


@[simp]
theorem toSet_sep (a : ZFSet) (p : ZFSet → Prop) :
    (ZFSet.sep p a).toSet = { x ∈ a.toSet | p x }

(ZFSet.sep p a).toSet = {x | x ∈ a.toSet ∧ p x}


theorem isClosed_iff_zeroLocus (Z : Set (ProjectiveSpectrum 𝒜)) :
    IsClosed Z ↔ ∃ s, Z = zeroLocus 𝒜 s

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

IsClosed Z ↔ ∃ s, Z = ProjectiveSpectrum.zeroLocus 𝒜 s


theorem iUnion_ge_eq_iUnion_nat_add (u : ℕ → Set α) (n : ℕ) : ⋃ i ≥ n, u i = ⋃ i, u (i + n)

⋃ i, ⋃ (_ : i ≥ n), u i = ⋃ i, u (i + n)


@[to_additive (attr := simp)]
theorem inv_cthickening : (cthickening δ s)⁻¹ = cthickening δ s⁻¹

{E : Type u_1}
[SeminormedCommGroup E]
(δ : ℝ)
(s : Set E)

(Metric.cthickening δ s)⁻¹ = Metric.cthickening δ s⁻¹


theorem IsEquivalent.congr_right {u v w : α → β} {l : Filter α} (huv : u ~[l] v) (hvw : v =ᶠ[l] w) :
    u ~[l] w

{α : Type u_1}
{β : Type u_2}
[NormedAddCommGroup β]
{u v w : α → β}
{l : Filter α}
(huv : u ~[l] v)
(hvw : v =ᶠ[l] w)


@[simp]
theorem prodZeroIso_hom (X : C) : (prodZeroIso X).hom = prod.fst

(CategoryTheory.Limits.prodZeroIso X).hom = CategoryTheory.Limits.prod.fst


theorem coind_surjective {α β} {f : α → β} {p : β → Prop} (h : ∀ a, p (f a)) (hf : Surjective f) :
    Surjective (coind f h)

{α : Sort u_4}
{β : Sort u_5}
{f : α → β}
{p : β → Prop}
(h : ∀ (a : α), p (f a))
(hf : Function.Surjective f)


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

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

(CategoryTheory.MonoidalOpposite.mopEquiv C).functor = CategoryTheory.mopFunctor C


/-- A measure `μ` on a measurable additive group is left invariant
  if the measure of left translations of a set are equal to the measure of the set itself. -/
class IsAddLeftInvariant [Add G] (μ : Measure G) : Prop where
  map_add_left_eq_self : ∀ g : G, map (g + ·) μ = μ

{G : Type u_2}
[MeasurableSpace G]
[Add G]
{μ : MeasureTheory.Measure G}
[self : μ.IsAddLeftInvariant]
(g : G)

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


lemma of_symm_X_smul (m : AEval R M a) :
    (of R M a).symm ((X : R[X]) • m) = a • (of R M a).symm m

{R : Type u_1}
{A : Type u_3}
{M : Type u_2}
[CommSemiring R]
[Semiring A]
(a : A)
[Algebra R A]
[AddCommMonoid M]
[Module A M]
[Module R M]
[IsScalarTower R A M]
(m : Module.AEval R M a)

(Module.AEval.of R M a).symm (Polynomial.X • m) = a • (Module.AEval.of R M a).symm m


theorem bit1_of_bit1 : ∀ n : ZNum, n + n + 1 = n.bit1


theorem dim_ne_zero [Nontrivial S] (pb : PowerBasis R S) : pb.dim ≠ 0

{R : Type u_1}
{S : Type u_2}
[CommRing R]
[Ring S]
[Algebra R S]
[Nontrivial S]
(pb : PowerBasis R S)


@[simp]
theorem LinearDisjoint.val_mulMap_tmul (H : M.LinearDisjoint N) (m : M) (n : N) :
    (H.mulMap (m ⊗ₜ[R] n) : S) = m.1 * n.1

{R : Type u}
{S : Type v}
[CommSemiring R]
[Semiring S]
[Algebra R S]
{M N : Submodule R S}
(H : M.LinearDisjoint N)
(m : ↥M)
(n : ↥N)


theorem le_one_toAddSubmonoid : 1 ≤ (1 : Submodule R A).toAddSubmonoid

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


theorem linear_isometry_complex_aux {f : ℂ ≃ₗᵢ[ℝ] ℂ} (h : f 1 = 1) :
    f = LinearIsometryEquiv.refl ℝ ℂ ∨ f = conjLIE

f = LinearIsometryEquiv.refl ℝ ℂ ∨ f = Complex.conjLIE


theorem l_sInf_u_image [CompleteLattice α] [CompleteLattice β] (gi : GaloisInsertion l u)
    (s : Set β) : l (sInf (u '' s)) = sInf s

{α : Type u}
{β : Type v}
{l : α → β}
{u : β → α}
[CompleteLattice α]
[CompleteLattice β]
(gi : GaloisInsertion l u)
(s : Set β)


/-- Any power of a regular element is regular. -/
theorem IsRegular.pow (n : ℕ) (ra : IsRegular a) : IsRegular (a ^ n)

{R : Type u_1}
{a : R}
[Monoid R]
(n : ℕ)
(ra : IsRegular a)


/-- Coproducts in the categories of modules and additive monoids commute with the forgetful functor
from modules to additive monoids. -/
theorem coe_toModule_eq_coe_toAddMonoid :
    (toModule R ι N φ : (⨁ i, M i) → N) = toAddMonoid fun i ↦ (φ i).toAddMonoidHom

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

⇑(DirectSum.toModule R ι N φ) = ⇑(DirectSum.toAddMonoid fun i => (φ i).toAddMonoidHom)


/-- The composition of `C^n` functions is `C^n`. -/
theorem ContDiff.comp {g : F → G} {f : E → F} (hg : ContDiff 𝕜 n g) (hf : ContDiff 𝕜 n f) :
    ContDiff 𝕜 n (g ∘ f)

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


protected lemma ContinuousOn.partialSups_apply (hf : ∀ k ≤ n, ContinuousOn (f k) s) :
    ContinuousOn (fun a ↦ partialSups (f · a) n) s

{L : Type u_1}
[SemilatticeSup L]
[TopologicalSpace L]
[ContinuousSup L]
{X : Type u_2}
[TopologicalSpace X]
{f : ℕ → X → L}
{n : ℕ}
{s : Set X}
(hf : ∀ k ≤ n, ContinuousOn (f k) s)

ContinuousOn (fun a => (partialSups fun x => f x a) n) s


@[simp] protected theorem not_le {a b : Char} : ¬ a ≤ b ↔ b < a


@[simp]
theorem coe_comp (g : E₂ →ₛₗᵢ[σ₂₃] E₃) (f : E →ₛₗᵢ[σ₁₂] E₂) : ⇑(g.comp f) = g ∘ f

{R : Type u_1}
{R₂ : Type u_2}
{R₃ : Type u_3}
{E : Type u_5}
{E₂ : Type u_6}
{E₃ : Type u_7}
[Semiring R]
[Semiring R₂]
[Semiring R₃]
{σ₁₂ : R →+* R₂}
{σ₁₃ : R →+* R₃}
{σ₂₃ : R₂ →+* R₃}
[RingHomCompTriple σ₁₂ σ₂₃ σ₁₃]
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup E₂]
[SeminormedAddCommGroup E₃]
[Module R E]
[Module R₂ E₂]
[Module R₃ E₃]
(g : E₂ →ₛₗᵢ[σ₂₃] E₃)
(f : E →ₛₗᵢ[σ₁₂] E₂)


lemma diffFinset_subset (hC : IsSetSemiring C) (hs : s ∈ C) (ht : t ∈ C) :
    ↑(hC.diffFinset hs ht) ⊆ C

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


@[to_additive (attr := simp)]
theorem quotientiInfEmbedding_apply_mk {ι : Type*} (f : ι → Subgroup α) (g : α) (i : ι) :
    quotientiInfEmbedding f (QuotientGroup.mk g) i = QuotientGroup.mk g

{α : Type u_1}
[AddGroup α]
{ι : Type u_2}
(f : ι → AddSubgroup α)
(g : α)
(i : ι)

(AddSubgroup.quotientiInfEmbedding f) (↑g) i = ↑g


theorem leftMulMatrix_apply (x : S) : leftMulMatrix b x = LinearMap.toMatrix b b (lmul R S x)

{R : Type u_1}
{S : Type u_2}
[CommRing R]
[Ring S]
[Algebra R S]
{m : Type u_3}
[Fintype m]
[DecidableEq m]
(b : Basis m R S)
(x : S)

(Algebra.leftMulMatrix b) x = (LinearMap.toMatrix b b) ((Algebra.lmul R S) x)


lemma finset_inf'_nhds [SemilatticeInf L] [ContinuousInf L]
    (hne : s.Nonempty) (hs : ∀ i ∈ s, Tendsto (f i) l (𝓝 (g i))) :
    Tendsto (s.inf' hne f) l (𝓝 (s.inf' hne g))

(hs : ∀ i ∈ s, Filter.Tendsto (f i) l (𝓝 (g i)))

Filter.Tendsto (s.inf' hne f) l (𝓝 (s.inf' hne g))


@[to_additive (attr := simp)]
theorem comp_zero : p.comp (1 : F →* E) = 0

{E : Type u_4}
{F : Type u_5}
[Group E]
[Group F]
(p : GroupSeminorm E)


/-- The closure of a set equals the intersection of its closed thickenings of positive radii
accumulating at zero. -/
theorem closure_eq_iInter_cthickening' (E : Set α) (s : Set ℝ)
    (hs : ∀ ε, 0 < ε → (s ∩ Ioc 0 ε).Nonempty) : closure E = ⋂ δ ∈ s, cthickening δ E

(hs : ∀ (ε : ℝ), 0 < ε → (s ∩ Set.Ioc 0 ε).Nonempty)

closure E = ⋂ δ ∈ s, Metric.cthickening δ E


@[simp]
theorem mk_α_hom {X Y Z : F C} : ⟦Hom.α_hom X Y Z⟧ = (α_ X Y Z).hom

{X Y Z : CategoryTheory.FreeMonoidalCategory C}

⟦CategoryTheory.FreeMonoidalCategory.Hom.α_hom X Y Z⟧ = (CategoryTheory.MonoidalCategory.associator X Y Z).hom


theorem mdifferentiableWithinAt_iff' (f : M → M') (s : Set M) (x : M) :
    MDifferentiableWithinAt I I' f s x ↔ ContinuousWithinAt f s x ∧
    DifferentiableWithinAt 𝕜 (writtenInExtChartAt I I' x f)
      ((extChartAt I x).symm ⁻¹' s ∩ range I) ((extChartAt I x) x)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
(I : ModelWithCorners 𝕜 E H)
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
(I' : ModelWithCorners 𝕜 E' H')
{M' : Type u_7}
[TopologicalSpace M']
[ChartedSpace H' M']
(f : M → M')
(s : Set M)
(x : M)

MDifferentiableWithinAt I I' f s x ↔
  ContinuousWithinAt f s x ∧
    DifferentiableWithinAt 𝕜 (writtenInExtChartAt I I' x f) (↑(extChartAt I x).symm ⁻¹' s ∩ Set.range ↑I)
      (↑(extChartAt I x) x)


@[simp]
theorem coe_one : ⇑(1 : P₁ ≃ᵃ[k] P₁) = id

{k : Type u_1}
{P₁ : Type u_2}
{V₁ : Type u_6}
[Ring k]
[AddCommGroup V₁]
[Module k V₁]
[AffineSpace V₁ P₁]


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

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


@[to_additive (attr := simp)]
lemma mker_snd : mker (snd M N) = .prod ⊤ ⊥

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

AddMonoidHom.mker (AddMonoidHom.snd M N) = ⊤.prod ⊥


protected theorem of_dist_le' {K : ℝ} (h : ∀ x ∈ s, ∀ y ∈ s, dist (f x) (f y) ≤ K * dist x y) :
    LipschitzOnWith (Real.toNNReal K) f s


@[simp]
theorem mem_orthogonalBilin_iff {m : M₁} : m ∈ N.orthogonalBilin B ↔ ∀ n ∈ N, B.IsOrtho n m

{R : Type u_1}
{R₁ : Type u_2}
{M : Type u_5}
{M₁ : Type u_6}
[CommRing R]
[CommRing R₁]
[AddCommGroup M₁]
[Module R₁ M₁]
[AddCommGroup M]
[Module R M]
{I₁ I₂ : R₁ →+* R}
{B : M₁ →ₛₗ[I₁] M₁ →ₛₗ[I₂] M}
{N : Submodule R₁ M₁}
{m : M₁}


theorem eq_of_eqOn_sdense {s : Set R} (hs : closure s = ⊤) {f g : R →+* S} (h : s.EqOn f g) :
    f = g

{R : Type u}
{S : Type v}
[NonAssocSemiring R]
[NonAssocSemiring S]
{s : Set R}
(hs : Subsemiring.closure s = ⊤)
{f g : R →+* S}
(h : Set.EqOn (⇑f) (⇑g) s)


theorem StableUnderInverse.op {P : MorphismProperty C} (h : StableUnderInverse P) :
    StableUnderInverse P.op

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


lemma natCast_def [NeZero n] (a : ℕ) : (a : Fin n) = ⟨a % n, mod_lt _ n.pos_of_neZero⟩


/-- A binary cofan with vertex `P` consists of the two inclusions `ι₁ : X ⟶ P` and `ι₂ : Y ⟶ P`. -/
@[simps pt]
def BinaryCofan.mk {P : C} (ι₁ : X ⟶ P) (ι₂ : Y ⟶ P) : BinaryCofan X Y

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X Y P : C}
(ι₁ : X ⟶ P)
(ι₂ : Y ⟶ P)

(CategoryTheory.Limits.BinaryCofan.mk ι₁ ι₂).pt = P


/-- `s < {a}` in colex iff all elements of `s` are strictly less than `a`. -/
lemma toColex_lt_singleton : toColex s < toColex {a} ↔ ∀ b ∈ s, b < a

{α : Type u_1}
[PartialOrder α]
{s : Finset α}
{a : α}

{ ofColex := s } < { ofColex := {a} } ↔ ∀ b ∈ s, b < a


lemma ssubset_of_eq_of_ssubset (hab : a = b) (hbc : b ⊂ c) : a ⊂ c

{α : Type u}
[HasSSubset α]
{a b c : α}
(hab : a = b)
(hbc : b ⊂ c)


@[deprecated support_cycleOf_nonempty (since := "2024-06-16")]
theorem card_support_cycleOf_pos_iff [DecidableEq α] [Fintype α] :
    0 < card (cycleOf f x).support ↔ f x ≠ x

{α : Type u_2}
{f : Equiv.Perm α}
{x : α}
[DecidableRel f.SameCycle]
[DecidableEq α]
[Fintype α]

0 < (f.cycleOf x).support.card ↔ f x ≠ x


theorem pmap_eq_map_attach {p : α → Prop} (f : ∀ a, p a → β) (s) :
    ∀ H, pmap f s H = s.attach.map fun x => f x.1 (H _ x.2)

{α : Type u_1}
{β : Type v}
{p : α → Prop}
(f : (a : α) → p a → β)
(s : Multiset α)
(H : ∀ a ∈ s, p a)

Multiset.pmap f s H = Multiset.map (fun x => f ↑x ⋯) s.attach


theorem mem_comp_of_mem_ball {V W : Set (β × β)} {x y z : β} (hV : SymmetricRel V)
    (hx : x ∈ ball z V) (hy : y ∈ ball z W) : (x, y) ∈ V ○ W

{β : Type ub}
{V W : Set (β × β)}
{x y z : β}
(hV : SymmetricRel V)
(hx : x ∈ UniformSpace.ball z V)
(hy : y ∈ UniformSpace.ball z W)


theorem succ_top {n m : ℕ} (h : n ≤ m) : Ico n (m + 1) = Ico n m ++ [m]

List.Ico n (m + 1) = List.Ico n m ++ [m]


@[to_additive]
theorem pow_eq_mod_exponent {n : ℕ} (g : G) : g ^ n = g ^ (n % exponent G)

{G : Type u}
[AddMonoid G]
{n : ℕ}
(g : G)


theorem equivPair_head {i : ι} {w : Word M} :
    (equivPair i w).head =
      if h : ∃ (h : w.toList ≠ []), (w.toList.head h).1 = i
      then h.snd ▸ (w.toList.head h.1).2
      else 1

{ι : Type u_1}
{M : ι → Type u_2}
[(i : ι) → Monoid (M i)]
[(i : ι) → DecidableEq (M i)]
[DecidableEq ι]
{i : ι}
{w : Monoid.CoprodI.Word M}

((Monoid.CoprodI.Word.equivPair i) w).head =
  if h : ∃ (h : w.toList ≠ []), (w.toList.head h).fst = i then ⋯ ▸ (w.toList.head ⋯).snd else 1


/-- The identity monoidal functor. -/
@[simps]
def id : MonoidalFunctor.{v₁, v₁} C C

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

(CategoryTheory.MonoidalFunctor.id C).ε = 𝟙 (𝟙_ C)


@[simp]
theorem map_coe (f : X ⟶ Y) (U : Opens Y) : ((map f).obj U : Set X) = f ⁻¹' (U : Set Y)

{X Y : TopCat}
(f : X ⟶ Y)
(U : TopologicalSpace.Opens ↑Y)

↑((TopologicalSpace.Opens.map f).obj U) = ⇑f ⁻¹' ↑U


@[simp]
theorem mem_iSup {ι} {x : α} {s : ι → Opens α} : x ∈ iSup s ↔ ∃ i, x ∈ s i

{α : Type u_2}
[TopologicalSpace α]
{ι : Sort u_5}
{x : α}
{s : ι → TopologicalSpace.Opens α}


/-- The cofree functor from the Eilenberg-Moore category, constructing a coalgebra for any
object. -/
@[simps]
def cofree : C ⥤ Coalgebra G

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

∀ {X Y : C} (f : X ⟶ Y), (G.cofree.map f).f = G.map f


theorem interleave_eq (s₁ s₂ : Stream' α) : s₁ ⋈ s₂ = head s₁::head s₂::(tail s₁ ⋈ tail s₂)

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


theorem essInf_congr_ae {f g : α → β} (hfg : f =ᵐ[μ] g) : essInf f μ = essInf g μ

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[ConditionallyCompleteLattice β]
{f g : α → β}
(hfg : f =ᵐ[μ] g)


theorem primeFactorsList_subset_right {n k : ℕ} (h : k ≠ 0) :
    n.primeFactorsList ⊆ (n * k).primeFactorsList


/-- The intersection of two blocks is a block -/
theorem IsBlock.inter {B₁ B₂ : Set X} (h₁ : IsBlock G B₁) (h₂ : IsBlock G B₂) :
    IsBlock G (B₁ ∩ B₂)

{G : Type u_1}
[Group G]
{X : Type u_2}
[MulAction G X]
{B₁ B₂ : Set X}
(h₁ : MulAction.IsBlock G B₁)
(h₂ : MulAction.IsBlock G B₂)


theorem isFiltered (h : IsIndObject A) : IsFiltered (CostructuredArrow yoneda A)

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

(h : CategoryTheory.Limits.IsIndObject A)

CategoryTheory.IsFiltered (CategoryTheory.CostructuredArrow CategoryTheory.yoneda A)


theorem union_subset_right {s t u : Finset α} (h : s ∪ t ⊆ u) : t ⊆ u

{α : Type u_1}
[DecidableEq α]
{s t u : Finset α}
(h : s ∪ t ⊆ u)


@[simp]
theorem conjTranspose_eq_natCast [DecidableEq n] [Semiring α] [StarRing α]
    {M : Matrix n n α} {d : ℕ} :
    Mᴴ = d ↔ M = d

{n : Type u_3}
{α : Type v}
[DecidableEq n]
[Semiring α]
[StarRing α]
{M : Matrix n n α}
{d : ℕ}


/-- A version of **Dickson's lemma** any subset of functions `σ →₀ α` is partially well
ordered, when `σ` is `Finite` and `α` is a linear well order.
This version uses finsupps on a finite type as it is intended for use with `MVPowerSeries`.
-/
theorem Finsupp.isPWO {α σ : Type*} [Zero α] [LinearOrder α] [IsWellOrder α (· < ·)] [Finite σ]
    (S : Set (σ →₀ α)) : S.IsPWO

{α : Type u_1}
{σ : Type u_2}
[Zero α]
[LinearOrder α]
[IsWellOrder α fun x x_1 => x < x_1]
[Finite σ]
(S : Set (σ →₀ α))


theorem IsExtrOn.elim {p : Prop} : IsExtrOn f s a → (IsMinOn f s a → p) → (IsMaxOn f s a → p) → p

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


protected theorem Continuous.seqContinuous {f : X → Y} (hf : Continuous f) : SeqContinuous f

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
{f : X → Y}
(hf : Continuous f)


@[to_additive] lemma op_smul_eq_mul [Mul α] {a a' : α} : op a • a' = a' * a


lemma toSheafify_pullbackSheafificationCompatibility (F : Dᵒᵖ ⥤ A) :
    toSheafify J (G.op ⋙ F) ≫
    ((G.pushforwardContinuousSheafificationCompatibility A J K).hom.app F).val =
    whiskerLeft _ (toSheafify K _)

(J : CategoryTheory.GrothendieckTopology C)

(K : CategoryTheory.GrothendieckTopology D)

[∀ (F : Cᵒᵖ ⥤ A), G.op.HasPointwiseRightKanExtension F]

CategoryTheory.toSheafify J (G.op ⋙ F) ≫ ((G.pushforwardContinuousSheafificationCompatibility A J K).hom.app F).val =
  CategoryTheory.whiskerLeft G.op (CategoryTheory.toSheafify K F)


theorem tr_reaches {σ₁ σ₂ f₁ f₂} {tr : σ₁ → σ₂ → Prop} (H : Respects f₁ f₂ tr) {a₁ a₂}
    (aa : tr a₁ a₂) {b₁} (ab : Reaches f₁ a₁ b₁) : ∃ b₂, tr b₁ b₂ ∧ Reaches f₂ a₂ b₂

{σ₁ : Type u_1}
{σ₂ : Type u_2}
{f₁ : σ₁ → Option σ₁}
{f₂ : σ₂ → Option σ₂}
{tr : σ₁ → σ₂ → Prop}
(H : Turing.Respects f₁ f₂ tr)
{a₁ : σ₁}
{a₂ : σ₂}
(aa : tr a₁ a₂)
{b₁ : σ₁}
(ab : Turing.Reaches f₁ a₁ b₁)

∃ b₂, tr b₁ b₂ ∧ Turing.Reaches f₂ a₂ b₂


theorem tan_int_mul_pi_div_two (n : ℤ) : tan (n * π / 2) = 0


@[simp, norm_cast]
theorem coe_Ico (a b : α) : (Ico a b : Set α) = Set.Ico a b

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


theorem exp_add : exp (x + y) = exp x * exp y

Complex.exp (x + y) = Complex.exp x * Complex.exp y


theorem one_lt_card_iff : 1 < card α ↔ ∃ a b : α, a ≠ b


@[simp]
theorem one_kroneckerTMul_one [DecidableEq m] [DecidableEq n] :
    (1 : Matrix m m α) ⊗ₖₜ[R] (1 : Matrix n n α) = 1

(R : Type u_1)
{α : Type u_2}
{m : Type u_9}
{n : Type u_10}
[CommSemiring R]
[Semiring α]
[Algebra R α]
[DecidableEq m]
[DecidableEq n]

Matrix.kroneckerMap (TensorProduct.tmul R) 1 1 = 1


theorem idealOfSet_ofIdeal_isClosed {I : Ideal C(X, 𝕜)} (hI : IsClosed (I : Set C(X, 𝕜))) :
    idealOfSet 𝕜 (setOfIdeal I) = I

{X : Type u_1}
{𝕜 : Type u_2}
[RCLike 𝕜]
[TopologicalSpace X]
[CompactSpace X]
[T2Space X]
{I : Ideal C(X, 𝕜)}
(hI : IsClosed ↑I)

ContinuousMap.idealOfSet 𝕜 (ContinuousMap.setOfIdeal I) = I


@[simp]
theorem coprime_mul_right_add_right (m n k : ℕ) : Coprime m (k * m + n) ↔ Coprime m n


lemma isRegular_iff_natTrailingDegree_charpoly_eq_rank :
    IsRegular R M x ↔ (toEnd R L M x).charpoly.natTrailingDegree = rank R L M

(R : Type u_1)
{L : Type u_3}
(M : Type u_4)
[CommRing R]
[Nontrivial R]
[LieRing L]
[LieAlgebra R L]
[Module.Finite R L]
[Module.Free R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
[Module.Finite R M]
[Module.Free R M]
(x : L)

LieModule.IsRegular R M x ↔ (LinearMap.charpoly ((LieModule.toEnd R L M) x)).natTrailingDegree = LieModule.rank R L M


@[simp] lemma num_divNat_den (q : ℚ≥0) : divNat q.num q.den = q


theorem extend_iUnion_le_tsum_nat' (s : ℕ → Set α) :
    extend m (⋃ i, s i) ≤ ∑' i, extend m (s i)

(PU : ∀ ⦃f : ℕ → Set α⦄, (∀ (i : ℕ), P (f i)) → P (⋃ i, f i))

(msU : ∀ ⦃f : ℕ → Set α⦄ (hm : ∀ (i : ℕ), P (f i)), m (⋃ i, f i) ⋯ ≤ ∑' (i : ℕ), m (f i) ⋯)

MeasureTheory.extend m (⋃ i, s i) ≤ ∑' (i : ℕ), MeasureTheory.extend m (s i)


/-- Let `m` be a sub-σ-algebra of `m0`, `f` an `m0`-measurable function and `g` an `m`-measurable
function, such that their integrals coincide on `m`-measurable sets with finite measure.
Then `∫ x in s, ‖g x‖ ∂μ ≤ ∫ x in s, ‖f x‖ ∂μ` on all `m`-measurable sets with finite measure. -/
theorem integral_norm_le_of_forall_fin_meas_integral_eq (hm : m ≤ m0) {f g : α → ℝ}
    (hf : StronglyMeasurable f) (hfi : IntegrableOn f s μ) (hg : StronglyMeasurable[m] g)
    (hgi : IntegrableOn g s μ)
    (hgf : ∀ t, MeasurableSet[m] t → μ t < ∞ → ∫ x in t, g x ∂μ = ∫ x in t, f x ∂μ)
    (hs : MeasurableSet[m] s) (hμs : μ s ≠ ∞) : (∫ x in s, ‖g x‖ ∂μ) ≤ ∫ x in s, ‖f x‖ ∂μ

(hf : MeasureTheory.StronglyMeasurable f)

(hfi : MeasureTheory.IntegrableOn f s μ)

(hg : MeasureTheory.StronglyMeasurable g)

(hgi : MeasureTheory.IntegrableOn g s μ)

(hgf : ∀ (t : Set α), MeasurableSet t → μ t < ⊤ → ∫ (x : α) in t, g x ∂μ = ∫ (x : α) in t, f x ∂μ)

∫ (x : α) in s, ‖g x‖ ∂μ ≤ ∫ (x : α) in s, ‖f x‖ ∂μ


@[simp]
theorem isCoatom_comap {H : Type*} [Group H] (f : G ≃* H) {K : Subgroup H} :
    IsCoatom (Subgroup.comap (f : G →* H) K) ↔ IsCoatom K

{G : Type u_1}
[Group G]
{H : Type u_2}
[Group H]
(f : G ≃* H)
{K : Subgroup H}

IsCoatom (Subgroup.comap (↑f) K) ↔ IsCoatom K


@[simp]
theorem compChangeOfVariables_length (m M N : ℕ) {i : Σ n, Fin n → ℕ}
    (hi : i ∈ compPartialSumSource m M N) :
    Composition.length (compChangeOfVariables m M N i hi).2 = i.1

(hi : i ∈ FormalMultilinearSeries.compPartialSumSource m M N)

(FormalMultilinearSeries.compChangeOfVariables m M N i hi).snd.length = i.fst


/-- A preadditive category `C` with an additive shift, and a class of "distinguished triangles"
relative to that shift is called pretriangulated if the following hold:
* Any triangle that is isomorphic to a distinguished triangle is also distinguished.
* Any triangle of the form `(X,X,0,id,0,0)` is distinguished.
* For any morphism `f : X ⟶ Y` there exists a distinguished triangle of the form `(X,Y,Z,f,g,h)`.
* The triangle `(X,Y,Z,f,g,h)` is distinguished if and only if `(Y,Z,X⟦1⟧,g,h,-f⟦1⟧)` is.
* Given a diagram:
  ```
        f       g       h
    X  ───> Y  ───> Z  ───> X⟦1⟧
    │       │                │
    │a      │b               │a⟦1⟧'
    V       V                V
    X' ───> Y' ───> Z' ───> X'⟦1⟧
        f'      g'      h'
  ```
  where the left square commutes, and whose rows are distinguished triangles,
  there exists a morphism `c : Z ⟶ Z'` such that `(a,b,c)` is a triangle morphism.

See <https://stacks.math.columbia.edu/tag/0145>
-/
class Pretriangulated [∀ n : ℤ, Functor.Additive (shiftFunctor C n)] where
  /-- a class of triangle which are called `distinguished` -/
  distinguishedTriangles : Set (Triangle C)
  /-- a triangle that is isomorphic to a distinguished triangle is distinguished -/
  isomorphic_distinguished :
    ∀ T₁ ∈ distinguishedTriangles, ∀ (T₂) (_ : T₂ ≅ T₁), T₂ ∈ distinguishedTriangles
  /-- obvious triangles `X ⟶ X ⟶ 0 ⟶ X⟦1⟧` are distinguished -/
  contractible_distinguished : ∀ X : C, contractibleTriangle X ∈ distinguishedTriangles
  /-- any morphism `X ⟶ Y` is part of a distinguished triangle `X ⟶ Y ⟶ Z ⟶ X⟦1⟧` -/
  distinguished_cocone_triangle :
    ∀ {X Y : C} (f : X ⟶ Y),
      ∃ (Z : C) (g : Y ⟶ Z) (h : Z ⟶ X⟦(1 : ℤ)⟧), Triangle.mk f g h ∈ distinguishedTriangles
  /-- a triangle is distinguished iff it is so after rotating it -/
  rotate_distinguished_triangle :
    ∀ T : Triangle C, T ∈ distinguishedTriangles ↔ T.rotate ∈ distinguishedTriangles
  /-- given two distinguished triangle, a commutative square
        can be extended as morphism of triangles -/
  complete_distinguished_triangle_morphism :
    ∀ (T₁ T₂ : Triangle C) (_ : T₁ ∈ distinguishedTriangles) (_ : T₂ ∈ distinguishedTriangles)
      (a : T₁.obj₁ ⟶ T₂.obj₁) (b : T₁.obj₂ ⟶ T₂.obj₂) (_ : T₁.mor₁ ≫ b = a ≫ T₂.mor₁),
      ∃ c : T₁.obj₃ ⟶ T₂.obj₃, T₁.mor₂ ≫ c = b ≫ T₂.mor₂ ∧ T₁.mor₃ ≫ a⟦1⟧' = c ≫ T₂.mor₃

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

[self : CategoryTheory.Pretriangulated C]

(T₁ T₂ : CategoryTheory.Pretriangulated.Triangle C)

T₁ ∈ CategoryTheory.Pretriangulated.distinguishedTriangles →
  T₂ ∈ CategoryTheory.Pretriangulated.distinguishedTriangles →
    ∀ (a : T₁.obj₁ ⟶ T₂.obj₁) (b : T₁.obj₂ ⟶ T₂.obj₂),
      T₁.mor₁ ≫ b = a ≫ T₂.mor₁ →
        ∃ c, T₁.mor₂ ≫ c = b ≫ T₂.mor₂ ∧ T₁.mor₃ ≫ (CategoryTheory.shiftFunctor C 1).map a = c ≫ T₂.mor₃


theorem dom_of_le_some {x : PartENat} {y : ℕ} (h : x ≤ some y) : x.Dom


theorem NumberField.isUnit_iff_norm [NumberField K] {x : 𝓞 K} :
    IsUnit x ↔ |(RingOfIntegers.norm ℚ x : ℚ)| = 1

{K : Type u_1}
[Field K]
[NumberField K]
{x : 𝓞 K}

IsUnit x ↔ |↑((RingOfIntegers.norm ℚ) x)| = 1


@[simp]
theorem W.mk_dest (p : W P) : W.mk (W.dest p) = p


theorem HasLimit.mk {F : J ⥤ C} (d : LimitCone F) : HasLimit F

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


/-- The monoidal functor from the endomorphisms of the single object
when we promote a monoidal category to a single object bicategory,
to the original monoidal category.

We subsequently show this is an equivalence.
-/
@[simps]
def endMonoidalStarFunctor : MonoidalFunctor (EndMonoidal (MonoidalSingleObj.star C)) C

(X : CategoryTheory.EndMonoidal (CategoryTheory.MonoidalSingleObj.star C))

(CategoryTheory.MonoidalSingleObj.endMonoidalStarFunctor C).obj X = X


theorem eLpNorm_le_add_measure_right (f : α → F) (μ ν : Measure α) {p : ℝ≥0∞} :
    eLpNorm f p μ ≤ eLpNorm f p (μ + ν)

{α : Type u_1}
{F : Type u_3}
{m0 : MeasurableSpace α}
[NormedAddCommGroup F]
(f : α → F)
(μ ν : MeasureTheory.Measure α)
{p : ℝ≥0∞}

MeasureTheory.eLpNorm f p μ ≤ MeasureTheory.eLpNorm f p (μ + ν)


lemma of_isOpenImmersion [IsOpenImmersion f] : P f

{P : CategoryTheory.MorphismProperty AlgebraicGeometry.Scheme}

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


lemma truncatedInf_union_of_not_mem (hs : a ∉ upperClosure s) (ht : a ∉ upperClosure t) :
    truncatedInf (s ∪ t) a = ⊥

{α : Type u_1}
[SemilatticeInf α]
[BoundedOrder α]
[DecidableRel fun x x_1 => x ≤ x_1]
{s t : Finset α}
{a : α}
[DecidableEq α]
(hs : a ∉ upperClosure ↑s)
(ht : a ∉ upperClosure ↑t)


@[simp]
theorem encode_star : encode PUnit.unit = 0


@[simp]
theorem coe_one : ↑(1 : { p : M₁ // IsIdempotentElem p }) = (1 : M₁)


lemma isReal_smul_iff : IsReal (σ • w) ↔ IsReal w

{k : Type u_1}
[Field k]
{K : Type u_2}
[Field K]
[Algebra k K]
{σ : K ≃ₐ[k] K}
{w : NumberField.InfinitePlace K}


theorem Filter.HasBasis.equicontinuousWithinAt_iff_right {p : κ → Prop}
    {s : κ → Set (α × α)} {F : ι → X → α} {S : Set X} {x₀ : X} (hα : (𝓤 α).HasBasis p s) :
    EquicontinuousWithinAt F S x₀ ↔ ∀ k, p k → ∀ᶠ x in 𝓝[S] x₀, ∀ i, (F i x₀, F i x) ∈ s k

{ι : Type u_1}
{κ : Type u_2}
{X : Type u_3}
{α : Type u_7}
[tX : TopologicalSpace X]
[uα : UniformSpace α]
{p : κ → Prop}
{s : κ → Set (α × α)}
{F : ι → X → α}
{S : Set X}
{x₀ : X}
(hα : (uniformity α).HasBasis p s)

EquicontinuousWithinAt F S x₀ ↔ ∀ (k : κ), p k → ∀ᶠ (x : X) in nhdsWithin x₀ S, ∀ (i : ι), (F i x₀, F i x) ∈ s k


theorem mem_pointwise_smul_iff_inv_smul_mem {a : M} {S : Subsemiring R} {x : R} :
    x ∈ a • S ↔ a⁻¹ • x ∈ S

{M : Type u_1}
{R : Type u_2}
[Group M]
[Semiring R]
[MulSemiringAction M R]
{a : M}
{S : Subsemiring R}
{x : R}

x ∈ a • S ↔ a⁻¹ • x ∈ S


theorem get?_zipWith_eq_some (f : α → β → γ) (l₁ : List α) (l₂ : List β) (z : γ) (i : ℕ) :
    (zipWith f l₁ l₂).get? i = some z ↔
      ∃ x y, l₁.get? i = some x ∧ l₂.get? i = some y ∧ f x y = z

{α : Type u}
{β : Type u_1}
{γ : Type u_2}
(f : α → β → γ)
(l₁ : List α)
(l₂ : List β)
(z : γ)
(i : ℕ)

(List.zipWith f l₁ l₂).get? i = some z ↔ ∃ x y, l₁.get? i = some x ∧ l₂.get? i = some y ∧ f x y = z


/-- `Sigma` type with a constant fiber is equivalent to the product. -/
@[simps (config := { attrs := [`mfld_simps] }) apply symm_apply]
def sigmaEquivProd (α β : Type*) : (Σ _ : α, β) ≃ α × β

(α : Type u_1)
(β : Type u_2)
(a : α × β)

(Equiv.sigmaEquivProd α β).symm a = ⟨a.fst, a.snd⟩


@[simp]
theorem singleton_ne_empty (a : α) : ({a} : Set α) ≠ ∅


theorem Dense.interior_compl (h : Dense s) : interior sᶜ = ∅

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


@[simp] theorem dual_base_iff (hB : B ⊆ M.E := by aesop_mat) : M✶.Base B ↔ M.Base (M.E \ B)

{α : Type u_1}
{M : Matroid α}
{B : Set α}
(hB : B ⊆ M.E := by aesop_mat)


theorem Balanced.neg : Balanced 𝕜 s → Balanced 𝕜 (-s)

{𝕜 : Type u_1}
{E : Type u_3}
[SeminormedRing 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{s : Set E}


@[simp]
theorem symm_apply_apply (e : α ≃o β) (x : α) : e.symm (e x) = x

{α : Type u_2}
{β : Type u_3}
[LE α]
[LE β]
(e : α ≃o β)
(x : α)


theorem comp_C_integral_of_surjective_of_jacobson {S : Type*} [Field S] (f : R[X] →+* S)
    (hf : Function.Surjective ↑f) : (f.comp C).IsIntegral

{R : Type u_1}
[CommRing R]
[Ideal.IsJacobson R]
{S : Type u_2}
[Field S]
(f : Polynomial R →+* S)
(hf : Function.Surjective ⇑f)


theorem iSup_or {p q : Prop} {s : p ∨ q → α} :
    ⨆ x, s x = (⨆ i, s (Or.inl i)) ⊔ ⨆ j, s (Or.inr j)

{α : Type u_1}
[CompleteLattice α]
{p q : Prop}
{s : p ∨ q → α}

⨆ (x : p ∨ q), s x = (⨆ (i : p), s ⋯) ⊔ ⨆ (j : q), s ⋯


@[simp]
theorem toOrdinal_symm_eq : NatOrdinal.toOrdinal.symm = Ordinal.toNatOrdinal


theorem monomial_finsupp_sum_index {α β : Type*} [Zero β] (f : α →₀ β) (g : α → β → σ →₀ ℕ)
    (a : R) : monomial (f.sum g) a = C a * f.prod fun a b => monomial (g a b) 1

{R : Type u}
{σ : Type u_1}
[CommSemiring R]
{α : Type u_2}
{β : Type u_3}
[Zero β]
(f : α →₀ β)
(g : α → β → σ →₀ ℕ)
(a : R)

(MvPolynomial.monomial (f.sum g)) a = MvPolynomial.C a * f.prod fun a b => (MvPolynomial.monomial (g a b)) 1


theorem AddSubmonoid.toSubmonoid_closure (S : Set A) :
    (AddSubmonoid.toSubmonoid) (AddSubmonoid.closure S)
      = Submonoid.closure (Multiplicative.toAdd ⁻¹' S)

{A : Type u_4}
[AddZeroClass A]
(S : Set A)

AddSubmonoid.toSubmonoid (AddSubmonoid.closure S) = Submonoid.closure (⇑Multiplicative.toAdd ⁻¹' S)


lemma lie_mem_weightSpaceChain_of_weightSpace_eq_bot_right [LieAlgebra.IsNilpotent R H]
    (hq : weightSpace M (q • α + χ) = ⊥)
    {x : L} (hx : x ∈ rootSpace H α)
    {y : M} (hy : y ∈ weightSpaceChain M α χ p q) :
    ⁅x, y⁆ ∈ weightSpaceChain M α χ p q

(hq : LieModule.weightSpace M (q • α + χ) = ⊥)

(hy : y ∈ LieModule.weightSpaceChain M α χ p q)

⁅x, y⁆ ∈ LieModule.weightSpaceChain M α χ p q


theorem Arrow.to_middle_condition {X : C} {S : J.Cover X} {T : ∀ I : S.Arrow, J.Cover I.Y}
    (I : (S.bind T).Arrow) : (T I.fromMiddle) I.toMiddleHom

{J : CategoryTheory.GrothendieckTopology C}


/-- If `γ` is an integral curve at each `t ∈ s`, it is an integral curve on `s`. -/
lemma IsIntegralCurveAt.isIntegralCurveOn (h : ∀ t ∈ s, IsIntegralCurveAt γ v t) :
    IsIntegralCurveOn γ v s

{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}
{s : Set ℝ}
(h : ∀ t ∈ s, IsIntegralCurveAt γ v t)


theorem hasStrictDerivAt_rpow_const_of_ne {x : ℝ} (hx : x ≠ 0) (p : ℝ) :
    HasStrictDerivAt (fun x => x ^ p) (p * x ^ (p - 1)) x


theorem fastGrowing_zero' (o : ONote) (h : fundamentalSequence o = Sum.inl none) :
    fastGrowing o = Nat.succ

(h : o.fundamentalSequence = Sum.inl none)


theorem map_coe {α β} {a : α} {f : α → β} : f <$> (a : Option α) = ↑(f a)


theorem liftOn'_mk {P : Sort v} (p q : K[X]) (f : K[X] → K[X] → P) (f0 : ∀ p, f p 0 = f 0 1)
    (H : ∀ {p q a} (_hq : q ≠ 0) (_ha : a ≠ 0), f (a * p) (a * q) = f p q) :
    (RatFunc.mk p q).liftOn' f @H = f p q

(H : ∀ {p q a : K[X]}, q ≠ 0 → a ≠ 0 → f (a * p) (a * q) = f p q)


@[reassoc (attr := simp)]
lemma lift_snd (hP : IsPullback fst snd f g) {W : C} (h : W ⟶ X) (k : W ⟶ Y)
    (w : h ≫ f = k ≫ g) : hP.lift h k w ≫ snd = k

(hP : CategoryTheory.IsPullback fst snd f g)


@[simp] theorem eq_mpr_eq_cast (h : α = β) : Eq.mpr h = cast h.symm


theorem mk'_eq_mul_mk'_one (x : R) (y : M) : mk' S x y = (algebraMap R S) x * mk' S 1 y

{R : Type u_1}
[CommSemiring R]
{M : Submonoid R}
{S : Type u_2}
[CommSemiring S]
[Algebra R S]
[IsLocalization M S]
(x : R)
(y : ↥M)

IsLocalization.mk' S x y = (algebraMap R S) x * IsLocalization.mk' S 1 y


lemma succ_succ_ne_one (n : ℕ) : n.succ.succ ≠ 1


/-- An equality of subobjects gives an isomorphism of the corresponding objects. -/
@[simps]
def isoOfMkEqMk {B A₁ A₂ : C} (f : A₁ ⟶ B) (g : A₂ ⟶ B) [Mono f] [Mono g] (h : mk f = mk g) :
    A₁ ≅ A₂

(h : CategoryTheory.Subobject.mk f = CategoryTheory.Subobject.mk g)

(CategoryTheory.Subobject.isoOfMkEqMk f g h).hom = CategoryTheory.Subobject.ofMkLEMk f g ⋯


theorem le_of_eq_of_le {f g h : CauSeq α abs} (hfg : f ≈ g) (hgh : g ≤ h) : f ≤ h

{α : Type u_1}
[LinearOrderedField α]
{f g h : CauSeq α abs}
(hfg : f ≈ g)
(hgh : g ≤ h)


theorem le_stable (s : Computation α) {a m n} (h : m ≤ n) : s.1 m = some a → s.1 n = some a

{α : Type u}
(s : Computation α)
{a : α}
{m n : ℕ}
(h : m ≤ n)


lemma eq_of_mem_uIoc_of_mem_uIoc : a ∈ Ι b c → b ∈ Ι a c → a = b

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


/-- On a finite product space in `n` variables, for a natural number `n`, a product of integrable
functions depending on each coordinate is integrable. -/
theorem Integrable.fin_nat_prod {n : ℕ} {E : Fin n → Type*}
    [∀ i, MeasureSpace (E i)] [∀ i, SigmaFinite (volume : Measure (E i))]
    {f : (i : Fin n) → E i → 𝕜} (hf : ∀ i, Integrable (f i)) :
    Integrable (fun (x : (i : Fin n) → E i) ↦ ∏ i, f i (x i))

[(i : Fin n) → MeasureTheory.MeasureSpace (E i)]

[∀ (i : Fin n), MeasureTheory.SigmaFinite MeasureTheory.volume]

(hf : ∀ (i : Fin n), MeasureTheory.Integrable (f i) MeasureTheory.volume)

MeasureTheory.Integrable (fun x => ∏ i : Fin n, f i (x i)) MeasureTheory.volume


/-- A binomial ring is a ring for which ascending Pochhammer evaluations are uniquely divisible by
suitable factorials. We define this notion as a mixin for additive commutative monoids with natural
number powers, but retain the ring name. We introduce `Ring.multichoose` as the uniquely defined
quotient. -/
class BinomialRing (R : Type*) [AddCommMonoid R] [Pow R ℕ] where
  /-- Scalar multiplication by positive integers is injective -/
  nsmul_right_injective (n : ℕ) (h : n ≠ 0) : Injective (n • · : R → R)
  /-- A multichoose function, giving the quotient of Pochhammer evaluations by factorials. -/
  multichoose : R → ℕ → R
  /-- The `n`th ascending Pochhammer polynomial evaluated at any element is divisible by `n!` -/
  factorial_nsmul_multichoose (r : R) (n : ℕ) :
    n.factorial • multichoose r n = (ascPochhammer ℕ n).smeval r

{R : Type u_1}
[AddCommMonoid R]
[Pow R ℕ]
[self : BinomialRing R]
(r : R)
(n : ℕ)

n.factorial • BinomialRing.multichoose r n = (ascPochhammer ℕ n).smeval r


theorem convexBodySum_neg_mem {x : E K} (hx : x ∈ (convexBodySum K B)) :
    -x ∈ (convexBodySum K B)

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

(hx : x ∈ NumberField.mixedEmbedding.convexBodySum K B)

-x ∈ NumberField.mixedEmbedding.convexBodySum K B


@[simp]
theorem comp_id (f : A →⋆ₙ+* B) : f.comp (NonUnitalStarRingHom.id _) = f

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


@[to_additive]
theorem smul_def (r : R) (x : s) : r • x = ⟨r • x, smul_mem r x.2⟩

{S : Type u'}
{R : Type u}
{M : Type v}
[SMul R M]
[SetLike S M]
[hS : SMulMemClass S R M]
(s : S)
(r : R)
(x : ↥s)

r • x = ⟨r • ↑x, ⋯⟩


@[to_additive]
theorem orderOf_dvd_card : orderOf x ∣ Fintype.card G

{G : Type u_1}
[Group G]
[Fintype G]
{x : G}


lemma uIoc_injective_right (a : α) : Injective fun b => Ι b a


@[to_additive (attr := simp)]
theorem op_le_op_iff {S₁ S₂ : Submonoid M} : S₁.op ≤ S₂.op ↔ S₁ ≤ S₂

{M : Type u_2}
[MulOneClass M]
{S₁ S₂ : Submonoid M}


@[reassoc]
lemma whiskerLeft_whiskerLeft_associator_inv (X Y : C) {Z₁ Z₂ : C} (f : Z₁ ⟶ Z₂) :
    X ◁ Y ◁ f ≫ (α_ _ _ _).inv = (α_ _ _ _).inv ≫ _ ◁ f

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

CategoryTheory.CategoryStruct.comp
    (CategoryTheory.MonoidalCategory.whiskerLeft X (CategoryTheory.MonoidalCategory.whiskerLeft Y f))
    (CategoryTheory.MonoidalCategory.associator X Y Z₂).inv =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.associator X Y Z₁).inv
    (CategoryTheory.MonoidalCategory.whiskerLeft (CategoryTheory.MonoidalCategory.tensorObj X Y) f)


/-- The constructed pushout cocone in the category of types. -/
@[simps!]
def cocone : PushoutCocone f g

{S X₁ X₂ : Type u}
(f : S ⟶ X₁)
(g : S ⟶ X₂)

(CategoryTheory.Limits.Types.Pushout.cocone f g).pt = CategoryTheory.Limits.Types.Pushout f g


theorem Function.IsFixedPt.birkhoffSum_eq {f : α → α} {x : α} (h : IsFixedPt f x) (g : α → M)
    (n : ℕ) : birkhoffSum f g n x = n • g x

{α : Type u_1}
{M : Type u_2}
[AddCommMonoid M]
{f : α → α}
{x : α}
(h : Function.IsFixedPt f x)
(g : α → M)
(n : ℕ)


theorem Red.enum.complete (H : Red L₁ L₂) : L₂ ∈ Red.enum L₁

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


theorem length_add_le : ∀ s t : Interval α, (s + t).length ≤ s.length + t.length

{α : Type u_2}
[OrderedAddCommGroup α]
(s t : Interval α)


theorem not_le_iff {z w : ℂ} : ¬z ≤ w ↔ w.re < z.re ∨ z.im ≠ w.im


theorem toZ_iterate_pred [NoMinOrder ι] (n : ℕ) : toZ i0 (pred^[n] i0) = -n

{ι : Type u_1}
[LinearOrder ι]
[SuccOrder ι]
[IsSuccArchimedean ι]
[PredOrder ι]
{i0 : ι}
[NoMinOrder ι]
(n : ℕ)


theorem neg_apply [NegZeroClass G] (g : α →₀ G) (a : α) : (-g) a = -g a

{α : Type u_1}
{G : Type u_9}
[NegZeroClass G]
(g : α →₀ G)
(a : α)


theorem lookup_isSome {a : α} {s : AList β} : (s.lookup a).isSome ↔ a ∈ s

{α : Type u}
{β : α → Type v}
[DecidableEq α]
{a : α}
{s : AList β}

(AList.lookup a s).isSome = true ↔ a ∈ s


protected theorem mul_lt_mul_of_pos_right {a b c : Int}
  (h₁ : a < b) (h₂ : 0 < c) : a * c < b * c


/-- `p ∧ (p → q) ↔ p ∧ q` -/
@[simp]
theorem inf_himp (a b : α) : a ⊓ (a ⇨ b) = a ⊓ b

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


protected theorem «exists» {p : WithTop α → Prop} : (∃ x, p x) ↔ p ⊤ ∨ ∃ x : α, p x


protected theorem ContinuousLinearMap.hasDerivAt : HasDerivAt e (e 1) x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{x : 𝕜}
(e : 𝕜 →L[𝕜] F)


/-- The extended pseudodistance on a subset of a pseudoemetric space is the restriction of
the original pseudodistance, by definition -/
theorem Subtype.edist_eq {p : α → Prop} (x y : Subtype p) : edist x y = edist (x : α) y

{α : Type u}
[PseudoEMetricSpace α]
{p : α → Prop}
(x y : Subtype p)


theorem symm_proj_apply (e : Pretrivialization F (π F E)) (z : TotalSpace F E)
    (hz : z.proj ∈ e.baseSet) : e.symm z.proj (e z).2 = z.2

(e : Pretrivialization F Bundle.TotalSpace.proj)


@[to_additive] lemma mabs_sup_div_sup_le_mabs (a b c : α) : |(a ⊔ c) / (b ⊔ c)|ₘ ≤ |a / b|ₘ

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


theorem toNNReal_lt_iff_lt_coe {r : ℝ} {p : ℝ≥0} (ha : 0 ≤ r) : Real.toNNReal r < p ↔ r < ↑p


@[to_additive]
lemma Group.isUnit [Group α] (a : α) : IsUnit a


@[simp]
theorem AdditiveFunctor.ofRightExact_map {F G : C ⥤ᵣ D} (α : F ⟶ G) :
    (AdditiveFunctor.ofRightExact C D).map α = α

(CategoryTheory.AdditiveFunctor.ofRightExact C D).map α = α


/-- When one splits a list along a composition `c`, the number of sublists thus created is
`c.length`. -/
@[simp]
theorem length_splitWrtComposition (l : List α) (c : Composition n) :
    length (l.splitWrtComposition c) = c.length

{n : ℕ}
{α : Type u_1}
(l : List α)
(c : Composition n)

(l.splitWrtComposition c).length = c.length


/-- Let `v` be an indexed family of `n` vectors in an oriented `n`-dimensional real inner
product space `E`. The output of the volume form of `E` when evaluated on `v` is bounded in absolute
value by the product of the norms of the vectors `v i`. -/
theorem abs_volumeForm_apply_le (v : Fin n → E) : |o.volumeForm v| ≤ ∏ i : Fin n, ‖v i‖

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


theorem lt_mul_div_add (a) {b : Ordinal} (h : b ≠ 0) : a < b * (a / b) + b

(a : Ordinal.{u_4})
{b : Ordinal.{u_4}}
(h : b ≠ 0)


@[simp, norm_cast]
theorem coe_ofNat [NatCast M] (n : ℕ) [n.AtLeastTwo] :
    ((no_index (OfNat.ofNat n : α → M)) : Germ l M) = OfNat.ofNat n

{α : Type u_1}
{l : Filter α}
{M : Type u_5}
[NatCast M]
(n : ℕ)
[n.AtLeastTwo]


theorem MonoidalClosed.linearHomEquivComm_symm_hom (f : A ⟶ B ⟶[Rep k G] C) :
    ((MonoidalClosed.linearHomEquivComm A B C).symm f).hom
      = TensorProduct.uncurry k A B C f.hom

{k G : Type u}
[CommRing k]
[Group G]
{A B C : Rep k G}
(f : A ⟶ (CategoryTheory.ihom B).obj C)

((Rep.MonoidalClosed.linearHomEquivComm A B C).symm f).hom =
  (TensorProduct.uncurry k (CoeSort.coe A) (CoeSort.coe B) (CoeSort.coe C)) f.hom


theorem Numeric.neg : ∀ {x : PGame} (_ : Numeric x), Numeric (-x)


@[to_additive (attr := simp)]
lemma monovaryOn_inv_right : MonovaryOn f g⁻¹ s ↔ AntivaryOn f g s

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[OrderedAddCommGroup α]
[OrderedAddCommGroup β]
{s : Set ι}
{f : ι → α}
{g : ι → β}


@[simp]
theorem abs_eq_self : |a| = a ↔ 0 ≤ a

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


@[to_additive (attr := simp) one_nsmul]
lemma pow_one (a : M) : a ^ 1 = a


@[to_additive]
theorem swap_bijective : Bijective (swap M N)

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

Function.Bijective ⇑(Monoid.Coprod.swap M N)


/-- See also `Finset.prod_ite_eq`. -/
@[to_additive "See also `Finset.sum_ite_eq`."]
lemma prod_ite_eq (i : ι) (f : ι → α) : ∏ j, (if i = j then f j else 1) = f i

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

(∏ j : ι, if i = j then f j else 1) = f i


@[simp]
theorem natDegree_of_zero : (0 : Cubic R).toPoly.natDegree = 0


@[simp]
theorem finSumEquivOfFinset_inl (hm : s.card = m) (hn : sᶜ.card = n) (i : Fin m) :
    finSumEquivOfFinset hm hn (Sum.inl i) = s.orderEmbOfFin hm i

{α : Type u_1}
[DecidableEq α]
[Fintype α]
[LinearOrder α]
{m n : ℕ}
{s : Finset α}
(hm : s.card = m)
(hn : sᶜ.card = n)
(i : Fin m)

(finSumEquivOfFinset hm hn) (Sum.inl i) = (s.orderEmbOfFin hm) i


@[simp, fun_prop]
theorem differentiableAt_const (c : F) : DifferentiableAt 𝕜 (fun _ => c) x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{x : E}
(c : F)


/-- The conditional cdf tends to 1 at +∞ for all `a : α`. -/
theorem tendsto_condCDF_atTop (ρ : Measure (α × ℝ)) (a : α) :
    Tendsto (condCDF ρ a) atTop (𝓝 1)

{α : Type u_1}
{mα : MeasurableSpace α}
(ρ : MeasureTheory.Measure (α × ℝ))
(a : α)

Filter.Tendsto (↑(ProbabilityTheory.condCDF ρ a)) Filter.atTop (𝓝 1)


theorem isQuasiSeparated_univ {α : Type*} [TopologicalSpace α] [QuasiSeparatedSpace α] :
    IsQuasiSeparated (Set.univ : Set α)

{α : Type u_3}
[TopologicalSpace α]
[QuasiSeparatedSpace α]


theorem congr_trans (e : M ≃ₗ[R] M') (f : M' ≃ₗ[R] M'') :
    (congr e).trans (congr f) = congr (e.trans f)

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
{M' : Type u_7}
{M'' : Type u_8}
[AddCommMonoid M']
[AddCommMonoid M'']
[Module R M']
[Module R M'']
(e : M ≃ₗ[R] M')
(f : M' ≃ₗ[R] M'')

LinearMap.BilinForm.congr e ≪≫ₗ LinearMap.BilinForm.congr f = LinearMap.BilinForm.congr (e ≪≫ₗ f)


@[to_additive]
theorem comap_iInf_map_of_injective (S : ι → Subsemigroup M) :
    (⨅ i, (S i).map f).comap f = iInf S

{M : Type u_1}
{N : Type u_2}
[Mul M]
[Mul N]
{ι : Type u_5}
{f : M →ₙ* N}
(hf : Function.Injective ⇑f)
(S : ι → Subsemigroup M)

Subsemigroup.comap f (⨅ i, Subsemigroup.map f (S i)) = iInf S


theorem toLex_strictMono : StrictMono (toLex : α × β → α ×ₗ β)

{α : Type u_1}
{β : Type u_2}
[PartialOrder α]
[Preorder β]


/-- A space is completely regular if points can be separated from closed sets via
  continuous functions to the unit interval. -/
@[mk_iff]
class CompletelyRegularSpace (X : Type u) [TopologicalSpace X] : Prop where
  completely_regular : ∀ (x : X), ∀ K : Set X, IsClosed K → x ∉ K →
    ∃ f : X → I, Continuous f ∧ f x = 0 ∧ EqOn f 1 K

{X : Type u}
[TopologicalSpace X]
[self : CompletelyRegularSpace X]
(x : X)
(K : Set X)

IsClosed K → x ∉ K → ∃ f, Continuous f ∧ f x = 0 ∧ Set.EqOn f 1 K


/-- For an endomorphism of a Noetherian module, the maximal eigenspace is always of the form kernel
`(f - μ • id) ^ k` for some `k`. -/
theorem maxGenEigenspace_eq [h : IsNoetherian R M] (f : End R M) (μ : R) :
    maxGenEigenspace f μ =
      f.genEigenspace μ (maxGenEigenspaceIndex f μ)

{R : Type v}
{M : Type w}
[CommRing R]
[AddCommGroup M]
[Module R M]
[h : IsNoetherian R M]
(f : Module.End R M)
(μ : R)

f.maxGenEigenspace μ = (f.genEigenspace μ) (f.maxGenEigenspaceIndex μ)


@[simp, nolint simpNF, norm_cast] lemma natCast_eq_one {n : ℕ} : (n : ℚ) = 1 ↔ n = 1


lemma biproduct.whiskerEquiv_hom_eq_lift {f : J → C} {g : K → C} (e : J ≃ K)
    (w : ∀ j, g (e j) ≅ f j) [HasBiproduct f] [HasBiproduct g] :
    (biproduct.whiskerEquiv e w).hom =
      biproduct.lift fun k => biproduct.π f (e.symm k) ≫ (w _).inv ≫ eqToHom (by simp)

(CategoryTheory.Limits.biproduct.whiskerEquiv e w).hom =
  CategoryTheory.Limits.biproduct.lift fun k =>
    CategoryTheory.Limits.biproduct.π f (e.symm k) ≫ (w (e.symm k)).inv ≫ CategoryTheory.eqToHom ⋯


@[to_additive (attr := simp)]
theorem recOn_one {C : FreeMonoid α → Sort*} (h0 : C 1) (ih : ∀ x xs, C xs → C (of x * xs)) :
    @recOn α C 1 h0 ih = h0

(ih : (x : α) → (xs : FreeAddMonoid α) → C xs → C (FreeAddMonoid.of x + xs))


theorem range_comp (f : A →ₙₐ[R] B) (g : B →ₙₐ[R] C) :
    NonUnitalAlgHom.range (g.comp f) = (NonUnitalAlgHom.range f).map g

{R : Type u}
{A : Type v}
{B : Type w}
{C : Type w'}
[CommSemiring R]
[NonUnitalNonAssocSemiring A]
[Module R A]
[NonUnitalNonAssocSemiring B]
[Module R B]
[NonUnitalNonAssocSemiring C]
[Module R C]
(f : A →ₙₐ[R] B)
(g : B →ₙₐ[R] C)

NonUnitalAlgHom.range (g.comp f) = NonUnitalSubalgebra.map g (NonUnitalAlgHom.range f)


theorem succNthVal_spec (n : ℕ) (a₁ a₂ : 𝕎 k) (bs : Fin (n + 1) → k) (ha₁ : a₁.coeff 0 ≠ 0)
    (ha₂ : a₂.coeff 0 ≠ 0) :
    (succNthDefiningPoly p n a₁ a₂ bs).IsRoot (succNthVal p n a₁ a₂ bs ha₁ ha₂)

(p : ℕ)
[hp : Fact (Nat.Prime p)]
{k : Type u_1}
[Field k]
[CharP k p]
[IsAlgClosed k]
(n : ℕ)
(a₁ a₂ : WittVector p k)
(bs : Fin (n + 1) → k)
(ha₁ : a₁.coeff 0 ≠ 0)
(ha₂ : a₂.coeff 0 ≠ 0)

(WittVector.RecursionMain.succNthDefiningPoly p n a₁ a₂ bs).IsRoot
  (WittVector.RecursionMain.succNthVal p n a₁ a₂ bs ha₁ ha₂)


theorem castAdd_lt {m : Nat} (n : Nat) (i : Fin m) : (castAdd n i : Nat) < m


@[simp]
lemma mapDomainAlgHom_comp (k A) {G₁ G₂ G₃} [CommSemiring k] [Semiring A] [Algebra k A]
    [Monoid G₁] [Monoid G₂] [Monoid G₃] (f : G₁ →* G₂) (g : G₂ →* G₃) :
    mapDomainAlgHom k A (g.comp f) = (mapDomainAlgHom k A g).comp (mapDomainAlgHom k A f)

(k : Type u_4)
(A : Type u_5)
{G₁ : Type u_6}
{G₂ : Type u_7}
{G₃ : Type u_8}
[CommSemiring k]
[Semiring A]
[Algebra k A]
[Monoid G₁]
[Monoid G₂]
[Monoid G₃]
(f : G₁ →* G₂)
(g : G₂ →* G₃)

MonoidAlgebra.mapDomainAlgHom k A (g.comp f) =
  (MonoidAlgebra.mapDomainAlgHom k A g).comp (MonoidAlgebra.mapDomainAlgHom k A f)


@[simp]
theorem pair_eq_pair {a b c d : ℕ} : pair a b = pair c d ↔ a = c ∧ b = d

Nat.pair a b = Nat.pair c d ↔ a = c ∧ b = d


/-- The iterated derivative of the composition with a linear map on the left is
obtained by applying the linear map to the iterated derivative. -/
theorem ContinuousLinearMap.iteratedFDeriv_comp_left {f : E → F} (g : F →L[𝕜] G)
    (hf : ContDiff 𝕜 n f) (x : E) {i : ℕ} (hi : (i : ℕ∞) ≤ n) :
    iteratedFDeriv 𝕜 i (g ∘ f) x = g.compContinuousMultilinearMap (iteratedFDeriv 𝕜 i f x)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type uG}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{n : ℕ∞}
{f : E → F}
(g : F →L[𝕜] G)
(hf : ContDiff 𝕜 n f)
(x : E)
{i : ℕ}
(hi : ↑i ≤ n)

iteratedFDeriv 𝕜 i (⇑g ∘ f) x = g.compContinuousMultilinearMap (iteratedFDeriv 𝕜 i f x)


theorem Equiv.swap_mem_stabilizer {α : Type*} [DecidableEq α] {S : Set α} {a b : α} :
    Equiv.swap a b ∈ MulAction.stabilizer (Equiv.Perm α) S ↔ (a ∈ S ↔ b ∈ S)

{α : Type u_1}
[DecidableEq α]
{S : Set α}
{a b : α}


/-- If `E / F` is both purely inseparable and separable, then `algebraMap F E` is bijective. -/
theorem IsPurelyInseparable.bijective_algebraMap_of_isSeparable
    [IsPurelyInseparable F E] [Algebra.IsSeparable F E] : Function.Bijective (algebraMap F E)

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


theorem lt_wf {α} : WellFounded (@LT.lt (Finset α) _)


theorem IsGLB.biUnion_Ici_eq_Ioi (a_glb : IsGLB s a) (a_not_mem : a ∉ s) :
    ⋃ x ∈ s, Ici x = Ioi a

{α : Type v}
[LinearOrder α]
{s : Set α}
{a : α}
(a_glb : IsGLB s a)
(a_not_mem : a ∉ s)


@[to_additive (attr := simp)]
theorem coe_srange (f : M →ₙ* N) : (f.srange : Set N) = Set.range f

{M : Type u_1}
{N : Type u_2}
[Add M]
[Add N]
(f : AddHom M N)


theorem BddAbove.dual (h : BddAbove s) : BddBelow (ofDual ⁻¹' s)

{α : Type u}
[Preorder α]
{s : Set α}
(h : BddAbove s)


theorem isUpperSet_univ : IsUpperSet (univ : Set α)


@[aesop norm -10 destruct (rule_sets := [CategoryTheory])]
theorem hom_inl_inr_false {X : C} {Y : D} (f : Sum.inl X ⟶ Sum.inr Y) : False

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


theorem destruct_congr_iff {s t : WSeq α} :
    s ~ʷ t ↔ Computation.LiftRel (BisimO (· ~ʷ ·)) (destruct s) (destruct t)

s ~ʷ t ↔ Computation.LiftRel (Stream'.WSeq.BisimO fun x x_1 => x ~ʷ x_1) s.destruct t.destruct


theorem deriv_sub_const (c : F) : deriv (fun y => f y - c) x = deriv f x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : 𝕜 → F}
{x : 𝕜}
(c : F)


theorem sinh_add : sinh (x + y) = sinh x * cosh y + cosh x * sinh y

Complex.sinh (x + y) = Complex.sinh x * Complex.cosh y + Complex.cosh x * Complex.sinh y


@[to_additive]
theorem continuous_const_smul_iff (c : G) : (Continuous fun x => c • f x) ↔ Continuous f

{α : Type u_2}
{β : Type u_3}
{G : Type u_4}
[TopologicalSpace α]
[Group G]
[MulAction G α]
[ContinuousConstSMul G α]
[TopologicalSpace β]
{f : β → α}
(c : G)


protected theorem tfae (f : X → Y) :
    TFAE [IsLocallyConstant f,
      ∀ x, ∀ᶠ x' in 𝓝 x, f x' = f x,
      ∀ x, IsOpen { x' | f x' = f x },
      ∀ y, IsOpen (f ⁻¹' {y}),
      ∀ x, ∃ U : Set X, IsOpen U ∧ x ∈ U ∧ ∀ x' ∈ U, f x' = f x]

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
(f : X → Y)

[IsLocallyConstant f, ∀ (x : X), ∀ᶠ (x' : X) in 𝓝 x, f x' = f x, ∀ (x : X), IsOpen {x' | f x' = f x},
    ∀ (y : Y), IsOpen (f ⁻¹' {y}), ∀ (x : X), ∃ U, IsOpen U ∧ x ∈ U ∧ ∀ x' ∈ U, f x' = f x].TFAE


@[simp]
theorem distortion_unionComplToSubordinate (π₁ : TaggedPrepartition I) (π₂ : Prepartition I)
    (hU : π₂.iUnion = ↑I \ π₁.iUnion) (r : (ι → ℝ) → Ioi (0 : ℝ)) :
    (π₁.unionComplToSubordinate π₂ hU r).distortion = max π₁.distortion π₂.distortion

{ι : Type u_1}
[Fintype ι]
{I : BoxIntegral.Box ι}
(π₁ : BoxIntegral.TaggedPrepartition I)
(π₂ : BoxIntegral.Prepartition I)
(hU : π₂.iUnion = ↑I \ π₁.iUnion)
(r : (ι → ℝ) → ↑(Set.Ioi 0))


/-- A cone for a functor `F : J ⥤ HomologicalComplex C c` which is given in degree `n` by
the limit `F ⋙ eval C c n`. -/
@[simps]
noncomputable def coneOfHasLimitEval : Cone F

[∀ (n : ι), CategoryTheory.Limits.HasLimit (F ⋙ HomologicalComplex.eval C c n)]

(HomologicalComplex.coneOfHasLimitEval F).pt.X n = CategoryTheory.Limits.limit (F ⋙ HomologicalComplex.eval C c n)


/-- Additive subsemigroups of an additive semigroup `A` are isomorphic to
multiplicative subsemigroups of `Multiplicative A`. -/
@[simps]
def AddSubsemigroup.toSubsemigroup : AddSubsemigroup A ≃o Subsemigroup (Multiplicative A)

{A : Type u_5}
[Add A]
(S : AddSubsemigroup A)

↑(AddSubsemigroup.toSubsemigroup S) = ⇑Multiplicative.toAdd ⁻¹' ↑S


theorem coeFn_univ_ne_zero (ν : ProbabilityMeasure Ω) : ν univ ≠ 0

(ν : MeasureTheory.ProbabilityMeasure Ω)


theorem nodup_toCycle (f : Perm α) (hf : IsCycle f) : (toCycle f hf).Nodup

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


@[simp]
theorem FullSubcategory.lift_comp_inclusion_eq (F : C ⥤ D) (hF : ∀ X, P (F.obj X)) :
    FullSubcategory.lift P F hF ⋙ fullSubcategoryInclusion P = F

{C : Type u₁}
[CategoryTheory.Category.{v, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
(P : D → Prop)
(F : CategoryTheory.Functor C D)
(hF : ∀ (X : C), P (F.obj X))

(CategoryTheory.FullSubcategory.lift P F hF).comp (CategoryTheory.fullSubcategoryInclusion P) = F


@[simp]
theorem mapsTo_sUnion {S : Set (Set α)} {t : Set β} {f : α → β} :
    MapsTo f (⋃₀ S) t ↔ ∀ s ∈ S, MapsTo f s t

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

Set.MapsTo f (⋃₀ S) t ↔ ∀ s ∈ S, Set.MapsTo f s t


protected theorem le_of_not_gt : ∀{a b : Nat}, ¬(b > a) → b ≤ a


theorem Colimit.ι_map_apply {F G : J ⥤ Type u} [HasColimitsOfShape J (Type u)] (α : F ⟶ G) (j : J)
    (x : F.obj j) : colim.map α (colimit.ι F j x) = colimit.ι G j (α.app j x)

[CategoryTheory.Limits.HasColimitsOfShape J (Type u)]

CategoryTheory.Limits.colim.map α (CategoryTheory.Limits.colimit.ι F j x) =
  CategoryTheory.Limits.colimit.ι G j (α.app j x)


lemma isInteger_zero : IsInteger f (0 : M')

{R : Type u_1}
[CommSemiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
{M' : Type u_3}
[AddCommMonoid M']
[Module R M']
(f : M →ₗ[R] M')


/--
A topological space `X` is said to be perfect if its universe is a perfect set.
Equivalently, this means that `𝓝[≠] x ≠ ⊥` for every point `x : X`.
-/
@[mk_iff perfectSpace_def]
class PerfectSpace : Prop :=
  univ_preperfect : Preperfect (Set.univ : Set α)

{α : Type u_1}
[TopologicalSpace α]
[self : PerfectSpace α]


@[gcongr]
theorem ball_subset_ball (h : ε₁ ≤ ε₂) : ball x ε₁ ⊆ ball x ε₂

{α : Type u}
[PseudoMetricSpace α]
{x : α}
{ε₁ ε₂ : ℝ}
(h : ε₁ ≤ ε₂)


@[simp]
theorem submodule_span_eq {s : Set α} : Submodule.span α s = Ideal.span s


@[simp]
theorem coe_copy (f : BoundedOrderHom α β) (f' : α → β) (h : f' = f) : ⇑(f.copy f' h) = f'

{α : Type u_2}
{β : Type u_3}
[Preorder α]
[Preorder β]
[BoundedOrder α]
[BoundedOrder β]
(f : BoundedOrderHom α β)
(f' : α → β)
(h : f' = ⇑f)


theorem nnnorm_eq_one_of_pow_eq_one {ζ : ℂ} {n : ℕ} (h : ζ ^ n = 1) (hn : n ≠ 0) : ‖ζ‖₊ = 1


@[to_additive]
lemma unit_of_mem_ofUnits_spec_mem (S : Subgroup Mˣ) {x : M} {h : x ∈ S.ofUnits} :
    S.unit_of_mem_ofUnits h ∈ S

{M : Type u_1}
[Monoid M]
(S : Subgroup Mˣ)
{x : M}
{h : x ∈ S.ofUnits}


theorem one_shiftLeft (n : ℕ) : 1 <<< (n : ℤ) = (2 ^ n : ℕ)


lemma dblXYZ_smul (P : Fin 3 → R) (u : R) : W'.dblXYZ (u • P) = (u ^ 4) • W'.dblXYZ P

{R : Type u}
[CommRing R]
{W' : WeierstrassCurve.Jacobian R}
(P : Fin 3 → R)
(u : R)


lemma l2_opNorm_def (A : Matrix m n 𝕜) :
    ‖A‖ = ‖(toEuclideanLin (𝕜 := 𝕜) (m := m) (n := n)).trans toContinuousLinearMap A‖

{𝕜 : Type u_1}
{m : Type u_2}
{n : Type u_3}
[RCLike 𝕜]
[Fintype m]
[Fintype n]
[DecidableEq n]
(A : Matrix m n 𝕜)

‖A‖ = ‖(Matrix.toEuclideanLin ≪≫ₗ LinearMap.toContinuousLinearMap) A‖


@[simp]
theorem alternatingFaceMapComplex_obj_X (X : SimplicialObject C) (n : ℕ) :
    ((alternatingFaceMapComplex C).obj X).X n = X _[n]

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

((AlgebraicTopology.alternatingFaceMapComplex C).obj X).X n = X _[n]


theorem condexp_ae_eq (hf : Martingale f ℱ μ) {i j : ι} (hij : i ≤ j) : μ[f j|ℱ i] =ᵐ[μ] f i

{Ω : Type u_1}
{E : Type u_2}
{ι : Type u_3}
[Preorder ι]
{m0 : MeasurableSpace Ω}
{μ : MeasureTheory.Measure Ω}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[CompleteSpace E]
{f : ι → Ω → E}
{ℱ : MeasureTheory.Filtration ι m0}
(hf : MeasureTheory.Martingale f ℱ μ)
{i j : ι}
(hij : i ≤ j)


@[simp] theorem not_and : ¬(a ∧ b) ↔ (a → ¬b)


theorem Equiv.toEmbedding_injective : Function.Injective (Equiv.toEmbedding : (α ≃ β) → (α ↪ β))


@[simp]
lemma homOf_ofHom_eq_self (φ : F ⟶ G) : homOf (ofHom φ) = φ

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Preadditive C]
{F G : CochainComplex C ℤ}
(φ : F ⟶ G)

(CochainComplex.HomComplex.Cocycle.ofHom φ).homOf = φ


/-- The length of a hamiltonian path is one less than the number of vertices of the graph. -/
lemma IsHamiltonian.length_eq (hp : p.IsHamiltonian) : p.length = Fintype.card α - 1

{α : Type u_1}
[Fintype α]
[DecidableEq α]
{G : SimpleGraph α}
{a b : α}
{p : G.Walk a b}
(hp : p.IsHamiltonian)


theorem modEq_and_modEq_iff_modEq_mul {a b m n : ℕ} (hmn : m.Coprime n) :
    a ≡ b [MOD m] ∧ a ≡ b [MOD n] ↔ a ≡ b [MOD m * n]


/-- The dimension of a strict submodule is strictly bounded by the dimension of the ambient
space. -/
theorem finrank_lt [FiniteDimensional K V] {s : Submodule K V} (h : s < ⊤) :
    finrank K s < finrank K V

{K : Type u}
{V : Type v}
[DivisionRing K]
[AddCommGroup V]
[Module K V]
[FiniteDimensional K V]
{s : Submodule K V}
(h : s < ⊤)

FiniteDimensional.finrank K ↥s < FiniteDimensional.finrank K V


theorem Ioo_def (a b : α) : { x | a < x ∧ x < b } = Ioo a b


@[to_additive] -- Porting note: was `@[simp]`
theorem integral_div_left_eq_self (f : G → E) (μ : Measure G) [IsInvInvariant μ]
    [IsMulLeftInvariant μ] (x' : G) : (∫ x, f (x' / x) ∂μ) = ∫ x, f x ∂μ

{G : Type u_4}
{E : Type u_5}
[MeasurableSpace G]
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[Group G]
[MeasurableMul G]
[MeasurableInv G]
(f : G → E)
(μ : MeasureTheory.Measure G)
[μ.IsInvInvariant]
[μ.IsMulLeftInvariant]
(x' : G)

∫ (x : G), f (x' / x) ∂μ = ∫ (x : G), f x ∂μ


theorem map_comm (H : ψ ∘ φ = ρ ∘ θ) (F : Filter α) :
    map ψ (map φ F) = map ρ (map θ F)

{α : Type u}
{β : Type v}
{γ : Type w}
{δ : Type u_1}
{φ : α → β}
{θ : α → γ}
{ψ : β → δ}
{ρ : γ → δ}
(H : ψ ∘ φ = ρ ∘ θ)
(F : Filter α)

Filter.map ψ (Filter.map φ F) = Filter.map ρ (Filter.map θ F)


@[simp] lemma neZero_zero_iff_false {α : Type*} [Zero α] : NeZero (0 : α) ↔ False


theorem IsMaximal.isComplete (h : T.IsMaximal) : T.IsComplete

{L : FirstOrder.Language}
{T : L.Theory}
(h : T.IsMaximal)


@[to_additive]
protected theorem isOpen : IsOpen (U : Set G)

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


lemma IsIntegralCurveOn.isIntegralCurveAt (h : IsIntegralCurveOn γ v s) (hs : s ∈ 𝓝 t₀) :
    IsIntegralCurveAt γ v 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}
{s : Set ℝ}
{t₀ : ℝ}
(h : IsIntegralCurveOn γ v s)
(hs : s ∈ 𝓝 t₀)


/-- If three points lie in the affine span of two points, the first four points are collinear. -/
theorem collinear_insert_insert_insert_left_of_mem_affineSpan_pair {p₁ p₂ p₃ p₄ p₅ : P}
    (h₁ : p₁ ∈ line[k, p₄, p₅]) (h₂ : p₂ ∈ line[k, p₄, p₅]) (h₃ : p₃ ∈ line[k, p₄, p₅]) :
    Collinear k ({p₁, p₂, p₃, p₄} : Set P)

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[DivisionRing k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{p₁ p₂ p₃ p₄ p₅ : P}
(h₁ : p₁ ∈ affineSpan k {p₄, p₅})
(h₂ : p₂ ∈ affineSpan k {p₄, p₅})
(h₃ : p₃ ∈ affineSpan k {p₄, p₅})


/--
Equivalent preregular categories give equivalent regular toposes.
-/
@[simps!]
def sheafCongrPreregular : haveI := e.preregular
    Sheaf (regularTopology C) A ≌ Sheaf (regularTopology D) A

(X : CategoryTheory.Sheaf (CategoryTheory.regularTopology D) A)

∀ (X_1 : Dᵒᵖ),
  ((e.sheafCongrPreregular A).counitIso.inv.app X).val.app X_1 = X.val.map (e.counitIso.hom.app (Opposite.unop X_1)).op


/-- If a function is countably sub-multiplicative then it is sub-multiplicative on finite sets -/
@[to_additive "If a function is countably sub-additive then it is sub-additive on finite sets"]
theorem rel_iSup_prod [CompleteLattice α] (m : α → M) (m0 : m ⊥ = 1) (R : M → M → Prop)
    (m_iSup : ∀ s : ℕ → α, R (m (⨆ i, s i)) (∏' i, m (s i))) (s : γ → α) (t : Finset γ) :
    R (m (⨆ d ∈ t, s d)) (∏ d ∈ t, m (s d))

(m_iSup : ∀ (s : ℕ → α), R (m (⨆ i, s i)) (∏' (i : ℕ), m (s i)))


theorem hom_ext' {Z : C} {Δ : SimplexCategoryᵒᵖ} (f g : X.obj Δ ⟶ Z)
    (h : ∀ A : IndexSet Δ, (s.cofan Δ).inj A ≫ f = (s.cofan Δ).inj A ≫ g) : f = g

(h : ∀ (A : SimplicialObject.Splitting.IndexSet Δ), (s.cofan Δ).inj A ≫ f = (s.cofan Δ).inj A ≫ g)


/-- `SMul` version of `comp_mul_left` -/
@[to_additive "`VAdd` version of `comp_add_left`"]
lemma comp_smul_left (a₁ a₂ : M) : (a₁ • ·) ∘ (a₂ • ·) = (((a₁ * a₂) • ·) : α → α)

(M : Type u_1)
{α : Type u_7}
[Monoid M]
[MulAction M α]
(a₁ a₂ : M)

((fun x => a₁ • x) ∘ fun x => a₂ • x) = fun x => (a₁ * a₂) • x


/-- The image of a commutative square by a functor. -/
@[simps]
def map (sq : Square C) (F : C ⥤ D) : Square D

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


@[simp]
theorem zero_compLinearMap (g : M₂ →ₗ[R] M) : (0 : M [⋀^ι]→ₗ[R] N).compLinearMap g = 0

{R : Type u_1}
[Semiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
{N : Type u_3}
[AddCommMonoid N]
[Module R N]
{ι : Type u_7}
{M₂ : Type u_10}
[AddCommMonoid M₂]
[Module R M₂]
(g : M₂ →ₗ[R] M)


theorem Iio_subset_Iic_union_Ico : Iio b ⊆ Iic a ∪ Ico a b

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


theorem shortestPrefixDiff_pos {s : Set (∀ n, E n)} (hs : IsClosed s) (hne : s.Nonempty)
    {x : ∀ n, E n} (hx : x ∉ s) : 0 < shortestPrefixDiff x s

{E : ℕ → Type u_1}
[(n : ℕ) → TopologicalSpace (E n)]
[∀ (n : ℕ), DiscreteTopology (E n)]
{s : Set ((n : ℕ) → E n)}
(hs : IsClosed s)
(hne : s.Nonempty)
{x : (n : ℕ) → E n}
(hx : x ∉ s)


theorem InjOn.mono (h : s₁ ⊆ s₂) (ht : InjOn f s₂) : InjOn f s₁

{α : Type u_1}
{β : Type u_2}
{s₁ s₂ : Set α}
{f : α → β}
(h : s₁ ⊆ s₂)
(ht : Set.InjOn f s₂)


lemma primeFactors_prod (hs : ∀ p ∈ s, p.Prime) : primeFactors (∏ p ∈ s, p) = s

{s : Finset ℕ}
(hs : ∀ p ∈ s, Nat.Prime p)


/-- `LocallyConstant.congrLeft` as an `AlgEquiv`. -/
@[simps!]
def congrLeftₐ (R : Type*) [CommSemiring R] [Semiring Z] [Algebra R Z] (e : X ≃ₜ Y) :
    LocallyConstant X Z ≃ₐ[R] LocallyConstant Y Z

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
{Z : Type u_6}
(R : Type u_7)
[CommSemiring R]
[Semiring Z]
[Algebra R Z]
(e : X ≃ₜ Y)
(g : LocallyConstant X Z)

∀ (a : Y), ((LocallyConstant.congrLeftₐ R e) g) a = g (e.symm a)


theorem two_mul_arctan_inv_3_add_arctan_inv_7 : 2 * arctan 3⁻¹ + arctan 7⁻¹ = π / 4

2 * Real.arctan 3⁻¹ + Real.arctan 7⁻¹ = Real.pi / 4


theorem mem_keys_of_mem {s : Sigma β} {l : List (Sigma β)} : s ∈ l → s.1 ∈ l.keys

{α : Type u}
{β : α → Type v}
{s : Sigma β}
{l : List (Sigma β)}


/-- Congruence relations are symmetric. -/
@[to_additive "Additive congruence relations are symmetric."]
protected theorem symm {x y} : c x y → c y x

{M : Type u_1}
[Mul M]
(c : Con M)
{x y : M}


lemma minpolyDiv_ne_zero [Nontrivial S] : minpolyDiv R x ≠ 0

{R : Type u_2}
{S : Type u_1}
[CommRing R]
[CommRing S]
[Algebra R S]
{x : S}
(hx : IsIntegral R x)
[Nontrivial S]


/-- For a monoid, the units of the center inject into the center of the units. This is not an
equivalence in general; one case when it is is for groups with zero, which is covered in
`centerUnitsEquivUnitsCenter`. -/
@[to_additive (attr := simps! apply_coe_val)
  "For an additive monoid, the units of the center inject into the center of the units."]
def unitsCenterToCenterUnits [Monoid M] : (Submonoid.center M)ˣ →* Submonoid.center (Mˣ)

(M : Type u_1)
[Monoid M]
(n : (↥(Submonoid.center M))ˣ)

↑↑((unitsCenterToCenterUnits M) n) = ↑↑n


theorem countP_pos_of_mem {s a} (h : a ∈ s) (pa : p a) : 0 < countP p s

{α : Type u_1}
{p : α → Prop}
[DecidablePred p]
{s : Multiset α}
{a : α}
(h : a ∈ s)
(pa : p a)


@[simp]
theorem lcm_zero_left (x : R) : lcm 0 x = 0

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


theorem isSimpleOrder_iff_isSimpleOrder_orderDual [LE α] [BoundedOrder α] :
    IsSimpleOrder α ↔ IsSimpleOrder αᵒᵈ


@[simp]
theorem coe_toContinuousLinearMap (f : E →ₗ[𝕜] F') :
    ((LinearMap.toContinuousLinearMap f) : E →ₗ[𝕜] F') = f

{𝕜 : Type u}
[hnorm : NontriviallyNormedField 𝕜]
{E : Type v}
[AddCommGroup E]
[Module 𝕜 E]
[TopologicalSpace E]
[TopologicalAddGroup E]
[ContinuousSMul 𝕜 E]
{F' : Type x}
[AddCommGroup F']
[Module 𝕜 F']
[TopologicalSpace F']
[TopologicalAddGroup F']
[ContinuousSMul 𝕜 F']
[CompleteSpace 𝕜]
[T2Space E]
[FiniteDimensional 𝕜 E]
(f : E →ₗ[𝕜] F')

↑(LinearMap.toContinuousLinearMap f) = f


@[simp, mfld_simps]
theorem ofSet_trans_ofSet {s : Set X} (hs : IsOpen s) {s' : Set X} (hs' : IsOpen s') :
    (ofSet s hs).trans (ofSet s' hs') = ofSet (s ∩ s') (IsOpen.inter hs hs')

{X : Type u_1}
[TopologicalSpace X]
{s : Set X}
(hs : IsOpen s)
{s' : Set X}
(hs' : IsOpen s')

(PartialHomeomorph.ofSet s hs).trans (PartialHomeomorph.ofSet s' hs') = PartialHomeomorph.ofSet (s ∩ s') ⋯


@[simp]
theorem map_top (f : α → β) : map f ⊤ = ⊤

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


@[simp] lemma degree_leadingCoeff_inv {p : K[X]} (hp0 : p ≠ 0) :
    degree (C (leadingCoeff p)⁻¹) = 0

{K : Type u_1}
[DivisionRing K]
{p : K[X]}
(hp0 : p ≠ 0)

(Polynomial.C p.leadingCoeff⁻¹).degree = 0


theorem max_lt_max_left_iff : max a c < max b c ↔ a < b ∧ c < b

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


theorem embDomain_notin_image_support {f : Γ ↪o Γ'} {x : HahnSeries Γ R} {b : Γ'}
    (hb : b ∉ f '' x.support) : (embDomain f x).coeff b = 0

{Γ : Type u_1}
{R : Type u_2}
[PartialOrder Γ]
[Zero R]
{Γ' : Type u_3}
[PartialOrder Γ']
{f : Γ ↪o Γ'}
{x : HahnSeries Γ R}
{b : Γ'}
(hb : b ∉ ⇑f '' x.support)


/-- Note we can only state this when the two functions are indexed by defeq `n`. -/
theorem ofFn_injective {n : ℕ} : Function.Injective (ofFn : (Fin n → α) → List α)


@[to_additive]
theorem setIntegral_eq_tsum' (h : IsFundamentalDomain G s μ) {f : α → E} {t : Set α}
    (hf : IntegrableOn f t μ) : ∫ x in t, f x ∂μ = ∑' g : G, ∫ x in g • t ∩ s, f (g⁻¹ • x) ∂μ

[MeasureTheory.VAddInvariantMeasure G α μ]

(h : MeasureTheory.IsAddFundamentalDomain G s μ)

∫ (x : α) in t, f x ∂μ = ∑' (g : G), ∫ (x : α) in (g +ᵥ t) ∩ s, f (-g +ᵥ x) ∂μ


lemma lookup_graph (f : α → β) {a : α} {as : List α} (h : a ∈ as) :
    lookup a (as.map fun x => (x, f x)) = some (f a)

{α : Type u_2}
{β : Type u_3}
[BEq α]
[LawfulBEq α]
(f : α → β)
{a : α}
{as : List α}
(h : a ∈ as)

List.lookup a (List.map (fun x => (x, f x)) as) = some (f a)


@[simp]
theorem id_f (A : Algebra T) : (𝟙 A : A ⟶ A).f = 𝟙 A.A

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

(CategoryTheory.CategoryStruct.id A).f = CategoryTheory.CategoryStruct.id A.A


theorem closure_neg (s : Set M) : span R (-s) = -span R s

{R : Type u_2}
{M : Type u_3}
[Semiring R]
[AddCommGroup M]
[Module R M]
(s : Set M)

Submodule.span R (-s) = -Submodule.span R s


@[to_additive zsmul_pos] lemma one_lt_zpow' (ha : 1 < a) (hn : 0 < n) : 1 < a ^ n

{α : Type u_1}
[OrderedAddCommGroup α]
{n : ℤ}
{a : α}
(ha : 0 < a)
(hn : 0 < n)


theorem strong_law_aux4 {c : ℝ} (c_one : 1 < c) :
    ∀ᵐ ω, (fun n : ℕ => ∑ i ∈ range ⌊c ^ n⌋₊, truncation (X i) i ω - ⌊c ^ n⌋₊ * 𝔼[X 0]) =o[atTop]
    fun n : ℕ => (⌊c ^ n⌋₊ : ℝ)

(X : ℕ → Ω → ℝ)

(hint : MeasureTheory.Integrable (X 0) ℙ)

(hindep : Pairwise fun i j => ProbabilityTheory.IndepFun (X i) (X j) ℙ)

(hident : ∀ (i : ℕ), ProbabilityTheory.IdentDistrib (X i) (X 0) ℙ ℙ)

(hnonneg : ∀ (i : ℕ) (ω : Ω), 0 ≤ X i ω)

∀ᵐ (ω : Ω),
  (fun n =>
      ∑ i ∈ Finset.range ⌊c ^ n⌋₊, ProbabilityTheory.truncation (X i) (↑i) ω -
        ↑⌊c ^ n⌋₊ * ∫ (a : Ω), X 0 a) =o[Filter.atTop]
    fun n => ↑⌊c ^ n⌋₊


/-- The augmented Čech conerve associated to an arrow. -/
@[simps]
def augmentedCechConerve : CosimplicialObject.Augmented C

[∀ (n : ℕ), CategoryTheory.Limits.HasWidePushout f.left (fun x => f.right) fun x => f.hom]

f.augmentedCechConerve.hom.app i = CategoryTheory.Limits.WidePushout.head fun x => f.hom


theorem inclusion_injective (h : s ⊆ t) : Injective (inclusion h)

{α : Type u_1}
{s t : Set α}
(h : s ⊆ t)


@[to_additive] lemma map_comp_one [OneHomClass F M N] (f : F) : f ∘ (1 : ι → M) = 1

{ι : Type u_1}
{M : Type u_4}
{N : Type u_5}
{F : Type u_9}
[One M]
[One N]
[FunLike F M N]
[OneHomClass F M N]
(f : F)


theorem prefix_refl (l : List α) : l <+: l


theorem rev_ne_iff {i j : Fin n} : rev i ≠ j ↔ i ≠ rev j


@[simp]
theorem trailingDegree_C_mul_X_pow (n : ℕ) (ha : a ≠ 0) : trailingDegree (C a * X ^ n) = n

{R : Type u}
{a : R}
[Semiring R]
(n : ℕ)
(ha : a ≠ 0)

(Polynomial.C a * Polynomial.X ^ n).trailingDegree = ↑n


/-- The residue of the Hurwitz zeta function at `s = 1` is `1`. -/
lemma hurwitzZeta_residue_one (a : UnitAddCircle) :
    Tendsto (fun s ↦ (s - 1) * hurwitzZeta a s) (𝓝[≠] 1) (𝓝 1)

Filter.Tendsto (fun s => (s - 1) * HurwitzZeta.hurwitzZeta a s) (𝓝[≠] 1) (𝓝 1)


theorem stronglyMeasurable_lineDeriv [SecondCountableTopologyEither E F] (hf : Continuous f) :
    StronglyMeasurable (fun x ↦ lineDeriv 𝕜 f x v)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
[LocallyCompactSpace 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[MeasurableSpace E]
[OpensMeasurableSpace E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[CompleteSpace F]
{f : E → F}
{v : E}
[SecondCountableTopologyEither E F]
(hf : Continuous f)

MeasureTheory.StronglyMeasurable fun x => lineDeriv 𝕜 f x v


@[simp]
lemma Scheme.ofRestrict_appLE (V W e) :
    (X.ofRestrict h).appLE V W e = X.presheaf.map
      (homOfLE (show X.ofRestrict h ''ᵁ _ ≤ _ by exact Set.image_subset_iff.mpr e)).op

{f : U ⟶ TopCat.of ↑↑X.toPresheafedSpace}

(e : W ≤ (TopologicalSpace.Opens.map (X.ofRestrict h).val.base).obj V)

AlgebraicGeometry.Scheme.Hom.appLE (X.ofRestrict h) V W e = X.presheaf.map (CategoryTheory.homOfLE ⋯).op


lemma AlgHom.fieldRange_le_normalClosure (f : K →ₐ[F] L) : f.fieldRange ≤ normalClosure F K 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]
(f : K →ₐ[F] L)


theorem image_ennreal_ofReal (h : s.OrdConnected) : (ENNReal.ofReal '' s).OrdConnected


theorem CuspForm.toFun_eq_coe {f : CuspForm Γ k} : f.toFun = (f : ℍ → ℂ)

{Γ : Subgroup SL(2, ℤ)}
{k : ℤ}
{f : CuspForm Γ k}


/-- If `p` is a prime factor of `a` then the power of `p` in `a` is the same that in `a * b`,
for any `b` coprime to `a`. -/
theorem factorization_eq_of_coprime_left {p a b : ℕ} (hab : Coprime a b)
    (hpa : p ∈ a.primeFactorsList) : (a * b).factorization p = a.factorization p

{p a b : ℕ}
(hab : a.Coprime b)
(hpa : p ∈ a.primeFactorsList)


theorem implies_congr_ctx {p₁ p₂ q₁ q₂ : Prop} (h₁ : p₁ = p₂) (h₂ : p₂ → q₁ = q₂) : (p₁ → q₁) = (p₂ → q₂)


/-- If `F i → f` in `L1`, then `∫ x in s, F i x ∂μ → ∫ x in s, f x ∂μ`. -/
lemma tendsto_setIntegral_of_L1' {ι} (f : α → G) (hfi : Integrable f μ) {F : ι → α → G}
    {l : Filter ι}
    (hFi : ∀ᶠ i in l, Integrable (F i) μ) (hF : Tendsto (fun i ↦ eLpNorm (F i - f) 1 μ) l (𝓝 0))
    (s : Set α) :
    Tendsto (fun i ↦ ∫ x in s, F i x ∂μ) l (𝓝 (∫ x in s, f x ∂μ))

(hFi : ∀ᶠ (i : ι) in l, MeasureTheory.Integrable (F i) μ)

(hF : Filter.Tendsto (fun i => MeasureTheory.eLpNorm (F i - f) 1 μ) l (𝓝 0))

Filter.Tendsto (fun i => ∫ (x : α) in s, F i x ∂μ) l (𝓝 (∫ (x : α) in s, f x ∂μ))


@[to_additive (attr := simp)] lemma leOnePart_apply (f : ∀ i, α i) (i : ι) : f⁻ i = (f i)⁻

{ι : Type u_3}
{α : ι → Type u_4}
[(i : ι) → Lattice (α i)]
[(i : ι) → AddCommGroup (α i)]
(f : (i : ι) → α i)
(i : ι)


@[simp]
lemma coe_mk (S : Subsemiring R) (h) : ((⟨S, h⟩ : StarSubsemiring R) : Set R) = S

(h : ∀ {a : R}, a ∈ S.carrier → star a ∈ S.carrier)

↑{ toSubsemiring := S, star_mem' := h } = ↑S


@[simp]
theorem nontrivial_iff [Semiring R] : Nontrivial R[X] ↔ Nontrivial R


theorem integral_eq_setToL1 (f : α →₁[μ] E) :
    integral f = setToL1 (E := E) (dominatedFinMeasAdditive_weightedSMul μ) f

{α : Type u_1}
{E : Type u_2}
[NormedAddCommGroup E]
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[NormedSpace ℝ E]
[CompleteSpace E]
(f : ↥(MeasureTheory.Lp E 1 μ))

MeasureTheory.L1.integral f = (MeasureTheory.L1.setToL1 ⋯) f


@[simp]
theorem lnot_bit (b) : ∀ n, lnot (bit b n) = bit (not b) (lnot n)

(Int.bit b n).lnot = Int.bit (!b) n.lnot


lemma neg'_eq (f : L.obj X ⟶ L.obj Y) (φ : W.LeftFraction X Y)
    (hφ : f = φ.map L (inverts L W)) :
    neg' W f = φ.neg.map L (inverts L W)

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_4, u_1} C]
[CategoryTheory.Category.{u_3, u_2} D]
[CategoryTheory.Preadditive C]
{L : CategoryTheory.Functor C D}
(W : CategoryTheory.MorphismProperty C)
[L.IsLocalization W]
[W.HasLeftCalculusOfFractions]
{X Y : C}
(f : L.obj X ⟶ L.obj Y)
(φ : W.LeftFraction X Y)
(hφ : f = φ.map L ⋯)

CategoryTheory.Localization.Preadditive.neg' W f = φ.neg.map L ⋯


theorem IsMinOn.comp_mono (hf : IsMinOn f s a) {g : β → γ} (hg : Monotone g) :
    IsMinOn (g ∘ f) s a

{α : Type u}
{β : Type v}
{γ : Type w}
[Preorder β]
[Preorder γ]
{f : α → β}
{s : Set α}
{a : α}
(hf : IsMinOn f s a)
{g : β → γ}
(hg : Monotone g)


theorem monic_C_mul_of_mul_leadingCoeff_eq_one {b : R} (hp : b * p.leadingCoeff = 1) :
    Monic (C b * p)

{R : Type u}
[Semiring R]
{p : R[X]}
{b : R}
(hp : b * p.leadingCoeff = 1)


theorem HasBasis.ge_iff (hl' : l'.HasBasis p' s') : l ≤ l' ↔ ∀ i', p' i' → s' i' ∈ l

{α : Type u_1}
{ι' : Sort u_5}
{l l' : Filter α}
{p' : ι' → Prop}
{s' : ι' → Set α}
(hl' : l'.HasBasis p' s')


theorem monomial_one_dvd_iff_modMonomial_eq_zero {i : σ →₀ ℕ} {x : MvPolynomial σ R} :
    monomial i (1 : R) ∣ x ↔ x %ᵐᵒⁿᵒᵐⁱᵃˡ i = 0

{σ : Type u_1}
{R : Type u_2}
[CommSemiring R]
{i : σ →₀ ℕ}
{x : MvPolynomial σ R}

(MvPolynomial.monomial i) 1 ∣ x ↔ x.modMonomial i = 0


/-- This lemma exists only to simplify the proof of
`LieModule.isCompl_weightSpace_zero_posFittingComp`. -/
private lemma isCompl_weightSpace_zero_posFittingComp_aux
    (h : ∀ N < (⊤ : LieSubmodule R L M), IsCompl (weightSpace N 0) (posFittingComp R L N)) :
    IsCompl (weightSpace M 0) (posFittingComp R L M)

(h : ∀ N < ⊤, IsCompl (LieModule.weightSpace (↥↑N) 0) (LieModule.posFittingComp R L ↥↑N))

IsCompl (LieModule.weightSpace M 0) (LieModule.posFittingComp R L M)


theorem injOn_preimage {B : Set (Set β)} (hB : B ⊆ 𝒫 range f) : InjOn (preimage f) B

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{B : Set (Set β)}
(hB : B ⊆ 𝒫 Set.range f)


@[simp] protected lemma map_intCast {S} [Ring S] (f : R →+* S) (n : ℤ) : map f ↑n = ↑n

{R : Type u}
[Ring R]
{S : Type u_1}
[Ring S]
(f : R →+* S)
(n : ℤ)


@[simp]
theorem apply_fdifferential (f : C^∞⟮I, M; I', M'⟯) {x : M} (v : PointDerivation I x)
    (g : C^∞⟮I', M'; 𝕜⟯) : 𝒅 f x v g = v (g.comp 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 : C^⊤⟮I, M; I', M'⟯)
{x : M}
(v : PointDerivation I x)
(g : C^⊤⟮I', M'; 𝓘(𝕜, 𝕜), 𝕜⟯)


theorem exists_mem (q : Semiquot α) : ∃ a, a ∈ q


theorem Bounded.to_nil {t : Ordnode α} : ∀ {o₁ o₂}, Bounded t o₁ o₂ → Bounded nil o₁ o₂

{α : Type u_1}
[Preorder α]
{t : Ordnode α}
{o₁ : WithBot α}
{o₂ : WithTop α}

t.Bounded o₁ o₂ → Ordnode.nil.Bounded o₁ o₂


theorem norm_eq_iSup_norm : ‖f‖ = ⨆ x : α, ‖f x‖

{α : Type u_1}
{E : Type u_3}
[TopologicalSpace α]
[CompactSpace α]
[NormedAddCommGroup E]
(f : C(α, E))


/-- Given two Localization maps `f : M →* N, k : M →* P` for a Submonoid `S ⊆ M`, the hom
from `P` to `N` induced by `f` is left inverse to the hom from `N` to `P` induced by `k`. -/
@[to_additive (attr := simp)
    "Given two Localization maps `f : M →+ N, k : M →+ P` for a Submonoid `S ⊆ M`, the hom
from `P` to `N` induced by `f` is left inverse to the hom from `N` to `P` induced by `k`."]
theorem lift_left_inverse {k : LocalizationMap S P} (z : N) :
    k.lift f.map_units (f.lift k.map_units z) = z

{M : Type u_1}
[CommMonoid M]
{S : Submonoid M}
{N : Type u_2}
[CommMonoid N]
{P : Type u_3}
[CommMonoid P]
(f : S.LocalizationMap N)
{k : S.LocalizationMap P}
(z : N)


/-- The characterization of the unbundled orthogonal projection.  This
lemma is only intended for use in setting up the bundled version
and should not be used once that is defined. -/
theorem orthogonalProjectionFn_inner_eq_zero (v : E) :
    ∀ w ∈ K, ⟪v - orthogonalProjectionFn K v, w⟫ = 0

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{K : Submodule 𝕜 E}
[HasOrthogonalProjection K]
(v w : E)

w ∈ K → ⟪v - orthogonalProjectionFn K v, w⟫_𝕜 = 0


@[simp]
theorem Equiv.Perm.viaFintypeEmbedding_apply_image (a : α) :
    e.viaFintypeEmbedding f (f a) = f (e a)

{α : Type u_1}
{β : Type u_2}
[Fintype α]
[DecidableEq β]
(e : Equiv.Perm α)
(f : α ↪ β)
(a : α)

(e.viaFintypeEmbedding f) (f a) = f (e a)


theorem nnnorm_indicator_eq_indicator_nnnorm :
    ‖indicator s f a‖₊ = indicator s (fun a => ‖f a‖₊) a

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

‖s.indicator f a‖₊ = s.indicator (fun a => ‖f a‖₊) a


@[to_additive]
theorem prod_list_count_of_subset [DecidableEq α] [CommMonoid α] (m : List α) (s : Finset α)
    (hs : m.toFinset ⊆ s) : m.prod = ∏ i ∈ s, i ^ m.count i

{α : Type u_3}
[DecidableEq α]
[AddCommMonoid α]
(m : List α)
(s : Finset α)
(hs : m.toFinset ⊆ s)


/-- If `f : ℝ → ℝ` is strictly convex on `S` and differentiable at `x ∈ S`, then the slope of any
secant line with left endpoint at `x` is strictly greater than the derivative of `f` at `x`. -/
lemma lt_slope_of_hasDerivAt (hfc : StrictConvexOn ℝ S f) (hx : x ∈ S) (hy : y ∈ S) (hxy : x < y)
    (hf' : HasDerivAt f f' x) :
    f' < slope f x y

{S : Set ℝ}
{f : ℝ → ℝ}
{x y f' : ℝ}
(hfc : StrictConvexOn ℝ S f)
(hx : x ∈ S)
(hy : y ∈ S)
(hxy : x < y)
(hf' : HasDerivAt f f' x)


theorem disjoint_cobounded_nhds (x : α) : Disjoint (cobounded α) (𝓝 x)

{α : Type u}
[PseudoMetricSpace α]
(x : α)


lemma toNNReal_le_toNNReal_iff' {r p : ℝ} : r.toNNReal ≤ p.toNNReal ↔ r ≤ p ∨ r ≤ 0


theorem HasFDerivWithinAt.congr_of_eventuallyEq (h : HasFDerivWithinAt f f' s x)
    (h₁ : f₁ =ᶠ[𝓝[s] x] f) (hx : f₁ x = f x) : HasFDerivWithinAt f₁ f' s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f f₁ : E → F}
{f' : E →L[𝕜] F}
{x : E}
{s : Set E}
(h : HasFDerivWithinAt f f' s x)
(h₁ : f₁ =ᶠ[𝓝[s] x] f)
(hx : f₁ x = f x)


theorem dest_corec (g : α → P α) (x : α) : M.dest (M.corec g x) = P.map (M.corec g) (g x)

{P : PFunctor.{u}}
{α : Type u_2}
(g : α → ↑P α)
(x : α)

(PFunctor.M.corec g x).dest = P.map (PFunctor.M.corec g) (g x)


theorem LpAddConst_zero : LpAddConst 0 = 1


@[simp]
theorem quotQuotEquivQuotSupₐ_toRingEquiv :
    (quotQuotEquivQuotSupₐ R I J : _ ⧸ J.map (Quotient.mkₐ R I) ≃+* _) = quotQuotEquivQuotSup I J

(R : Type u)
{A : Type u_1}
[CommSemiring R]
[CommRing A]
[Algebra R A]
(I J : Ideal A)

↑(DoubleQuot.quotQuotEquivQuotSupₐ R I J) = DoubleQuot.quotQuotEquivQuotSup I J


/-- We have that `λ` divides `x * (x - 1) * (x - (η + 1))`. -/
lemma lambda_dvd_mul_sub_one_mul_sub_eta_add_one : λ ∣ x * (x - 1) * (x - (η + 1))

{K : Type u_1}
[Field K]
[NumberField K]
[IsCyclotomicExtension {3} ℚ K]
{ζ : K}
(hζ : IsPrimitiveRoot ζ ↑3)
(x : 𝓞 K)

hζ.toInteger - 1 ∣ x * (x - 1) * (x - (↑⋯.unit + 1))


/-- The lexicographical order of well-founded relations is well-founded. -/
theorem lex_wf (ha : WellFounded r) (hb : ∀ x, WellFounded (s x)) : WellFounded (Lex r s)

{α : Sort u}
{β : α → Sort v}
{r : α → α → Prop}
{s : (a : α) → β a → β a → Prop}
(ha : WellFounded r)
(hb : ∀ (x : α), WellFounded (s x))


theorem closure_preimage_im (s : Set ℝ) : closure (im ⁻¹' s) = im ⁻¹' closure s

closure (Complex.im ⁻¹' s) = Complex.im ⁻¹' closure s


theorem tsum_le_of_sum_range_le {f : ℕ → ℝ≥0∞} {c : ℝ≥0∞}
    (h : ∀ n, ∑ i ∈ Finset.range n, f i ≤ c) : ∑' n, f n ≤ c

{f : ℕ → ℝ≥0∞}

(h : ∀ (n : ℕ), ∑ i ∈ Finset.range n, f i ≤ c)


/-- Given a functor `F : J ⥤ K ⥤ C`, with all needed colimits,
we can construct a diagram consisting of the colimit cocone over each functor `F.obj j`,
and the universal cocone morphisms between these.
-/
@[simps]
noncomputable def DiagramOfCocones.mkOfHasColimits : DiagramOfCocones F

(CategoryTheory.Limits.DiagramOfCocones.mkOfHasColimits F).obj j = CategoryTheory.Limits.colimit.cocone (F.obj j)


lemma surjective_eq_epimorphisms_iff :
    MorphismProperty.surjective C = epimorphisms C ↔ (forget C).PreservesEpimorphisms

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

CategoryTheory.MorphismProperty.surjective C = CategoryTheory.MorphismProperty.epimorphisms C ↔
  (CategoryTheory.forget C).PreservesEpimorphisms


theorem cmp_mul_pos_left [PosMulStrictMono α]
    (ha : 0 < a) (b c : α) : cmp (a * b) (a * c) = cmp b c

{α : Type u}
[Semiring α]
[LinearOrder α]
{a : α}
[PosMulStrictMono α]
(ha : 0 < a)
(b c : α)


@[to_additive]
theorem fromLeftInv_eq_iff (a : S.leftInv) (b : M) :
    (S.fromLeftInv a : M) = b ↔ (a : M) * b = 1

{M : Type u_1}
[CommMonoid M]
(S : Submonoid M)
(a : ↥S.leftInv)
(b : M)


@[simp]
lemma homologyMap_sub : homologyMap (φ - φ') = homologyMap φ - homologyMap φ'

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Preadditive C]
{S₁ S₂ : CategoryTheory.ShortComplex C}
(φ φ' : S₁ ⟶ S₂)
[S₁.HasHomology]
[S₂.HasHomology]

CategoryTheory.ShortComplex.homologyMap (φ - φ') =
  CategoryTheory.ShortComplex.homologyMap φ - CategoryTheory.ShortComplex.homologyMap φ'


theorem InjOn.exists_subset_injOn_subset_range_eq {r : Set α} (hinj : InjOn f r) (hrs : r ⊆ s) :
    ∃ u : Set α, r ⊆ u ∧ u ⊆ s ∧ f '' u = f '' s ∧ InjOn f u

{α : Type u_1}
{β : Type u_2}
{s : Set α}
{f : α → β}
{r : Set α}
(hinj : Set.InjOn f r)
(hrs : r ⊆ s)

∃ u, r ⊆ u ∧ u ⊆ s ∧ f '' u = f '' s ∧ Set.InjOn f u


@[simp]
theorem top_sub_coe (x : ℝ) : (⊤ : EReal) - x = ⊤


theorem IsPiSystem.insert_univ {α} {S : Set (Set α)} (h_pi : IsPiSystem S) :
    IsPiSystem (insert Set.univ S)

{α : Type u_1}
{S : Set (Set α)}
(h_pi : IsPiSystem S)


theorem continuous_congr {g : X → Y} (h : ∀ x, f x = g x) :
    Continuous f ↔ Continuous g

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
{f g : X → Y}
(h : ∀ (x : X), f x = g x)


@[to_additive]
theorem noncommProd_mul_single [Fintype ι] [DecidableEq ι] (x : ∀ i, M i) :
    (univ.noncommProd (fun i => Pi.mulSingle i (x i)) fun i _ j _ _ =>
        Pi.mulSingle_apply_commute x i j) = x

{ι : Type u_2}
{M : ι → Type u_6}
[(i : ι) → Monoid (M i)]
[Fintype ι]
[DecidableEq ι]
(x : (i : ι) → M i)

Finset.univ.noncommProd (fun i => Pi.mulSingle i (x i)) ⋯ = x


theorem injective_untrop : Function.Injective (untrop : Tropical R → R)


@[simp]
theorem monomial_comp (n : ℕ) : (monomial n a).comp p = C a * p ^ n

{R : Type u}
{a : R}
[Semiring R]
{p : R[X]}
(n : ℕ)

((Polynomial.monomial n) a).comp p = Polynomial.C a * p ^ n


theorem le_add_right_of_le {n m k : Nat} (h : n ≤ m) : n ≤ m + k


lemma dist_pi_eq_iff {f g : ∀ b, π b} {r : ℝ} (hr : 0 < r) :
    dist f g = r ↔ (∃ i, dist (f i) (g i) = r) ∧ ∀ b, dist (f b) (g b) ≤ r

{β : Type u_2}
{π : β → Type u_3}
[Fintype β]
[(b : β) → PseudoMetricSpace (π b)]
{f g : (b : β) → π b}
{r : ℝ}
(hr : 0 < r)

dist f g = r ↔ (∃ i, dist (f i) (g i) = r) ∧ ∀ (b : β), dist (f b) (g b) ≤ r


@[simp]
theorem realize_iff : (φ.iff ψ).Realize v xs ↔ (φ.Realize v xs ↔ ψ.Realize v xs)

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]
{α : Type u'}
{l : ℕ}
{φ ψ : L.BoundedFormula α l}
{v : α → M}
{xs : Fin l → M}


protected theorem eq [DecidableEq α] : PrimrecRel (@Eq α)

{α : Type u_1}
[Primcodable α]
[DecidableEq α]


/-- $\#(s \setminus \{a\}) = \#s - 1$ if $a \in s$.
  This result is casted to any additive group with 1,
  so that we don't have to work with `ℕ`-subtraction. -/
@[simp]
theorem cast_card_erase_of_mem {R} [AddGroupWithOne R] {s : Finset α} (hs : a ∈ s) :
    ((s.erase a).card : R) = s.card - 1

{α : Type u_1}
{a : α}
[DecidableEq α]
{R : Type u_4}
[AddGroupWithOne R]
{s : Finset α}
(hs : a ∈ s)


theorem Dense.orderDual [TopologicalSpace α] {s : Set α} (hs : Dense s) :
    Dense (OrderDual.ofDual ⁻¹' s)

{α : Type u}
[TopologicalSpace α]
{s : Set α}
(hs : Dense s)


/-- A category embeds into its `R`-linear completion.
-/
@[simps]
def embedding : C ⥤ Free R C

(R : Type u_1)
[CommRing R]
(C : Type u)
[CategoryTheory.Category.{v, u} C]
(X : C)

(CategoryTheory.Free.embedding R C).obj X = X


theorem surjective_of_injective {f : α → α} (hinj : Injective f) : Surjective f

{α : Type u_1}
[Finite α]
{f : α → α}
(hinj : Function.Injective f)


lemma Set.biInter_finsetSigma_univ (s : Finset ι) (f : Sigma κ → Set α) :
    ⋂ ij ∈ s.sigma fun _ ↦ Finset.univ, f ij = ⋂ i ∈ s, ⋂ j, f ⟨i, j⟩

{ι : Type u_1}
{α : Type u_2}
{κ : ι → Type u_5}
[(i : ι) → Fintype (κ i)]
(s : Finset ι)
(f : Sigma κ → Set α)

⋂ ij ∈ s.sigma fun x => Finset.univ, f ij = ⋂ i ∈ s, ⋂ j, f ⟨i, j⟩


theorem Or.neg_resolve_right (h : Or a (Not b)) (nb : b) : a

{a b : Prop}
(h : Or a (Not b))
(nb : b)


lemma smul_max_of_nonpos (ha : a ≤ 0) (b₁ b₂ : β) : a • max b₁ b₂ = min (a • b₁) (a • b₂)

{α : Type u_1}
{β : Type u_2}
[OrderedRing α]
[LinearOrderedAddCommGroup β]
[Module α β]
[PosSMulMono α β]
{a : α}
(ha : a ≤ 0)
(b₁ b₂ : β)


lemma schnirelmannDensity_congr' {B : Set ℕ} [DecidablePred (· ∈ B)]
    (h : ∀ n > 0, n ∈ A ↔ n ∈ B) : schnirelmannDensity A = schnirelmannDensity B

{A : Set ℕ}
[DecidablePred fun x => x ∈ A]
{B : Set ℕ}
[DecidablePred fun x => x ∈ B]
(h : ∀ n > 0, n ∈ A ↔ n ∈ B)


theorem discreteTopology_iff_singleton_mem_nhds [TopologicalSpace α] :
    DiscreteTopology α ↔ ∀ x : α, {x} ∈ 𝓝 x

DiscreteTopology α ↔ ∀ (x : α), {x} ∈ 𝓝 x


/-- The three points of a cospherical set are affinely independent. -/
theorem Cospherical.affineIndependent_of_ne {p₁ p₂ p₃ : P} (hs : Cospherical ({p₁, p₂, p₃} : Set P))
    (h₁₂ : p₁ ≠ p₂) (h₁₃ : p₁ ≠ p₃) (h₂₃ : p₂ ≠ p₃) : AffineIndependent ℝ ![p₁, p₂, p₃]

(hs : EuclideanGeometry.Cospherical {p₁, p₂, p₃})


protected theorem TendstoUniformly.tendstoUniformlyOn (h : TendstoUniformly F f p) :
    TendstoUniformlyOn F f p s

{α : Type u}
{β : Type v}
{ι : Type x}
[UniformSpace β]
{F : ι → α → β}
{f : α → β}
{s : Set α}
{p : Filter ι}
(h : TendstoUniformly F f p)


theorem mem_algebraMapSubmonoid_of_mem {S : Type*} [Semiring S] [Algebra R S] {M : Submonoid R}
    (x : M) : algebraMap R S x ∈ algebraMapSubmonoid S M

{R : Type u}
[CommSemiring R]
{S : Type u_2}
[Semiring S]
[Algebra R S]
{M : Submonoid R}
(x : ↥M)

(algebraMap R S) ↑x ∈ Algebra.algebraMapSubmonoid S M


@[simp, mfld_simps]
theorem prod_source (e : PartialEquiv α β) (e' : PartialEquiv γ δ) :
    (e.prod e').source = e.source ×ˢ e'.source

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


theorem Ico_ae_eq_Ioc' (ha : μ {a} = 0) (hb : μ {b} = 0) : Ico a b =ᵐ[μ] Ioc a b

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


theorem exists_nnnorm_eq_spectralRadius_of_nonempty [ProperSpace 𝕜] {a : A} (ha : (σ a).Nonempty) :
    ∃ k ∈ σ a, (‖k‖₊ : ℝ≥0∞) = spectralRadius 𝕜 a

{𝕜 : Type u_1}
{A : Type u_2}
[NormedField 𝕜]
[NormedRing A]
[NormedAlgebra 𝕜 A]
[CompleteSpace A]
[ProperSpace 𝕜]
{a : A}
(ha : (spectrum 𝕜 a).Nonempty)

∃ k ∈ spectrum 𝕜 a, ↑‖k‖₊ = spectralRadius 𝕜 a


@[simp] theorem compl_singleton (b : Bool) : ({b}ᶜ : Set Bool) = {!b}


lemma filter_and_not (s : Finset α) (p q : α → Prop) [DecidablePred p] [DecidablePred q] :
    s.filter (fun a ↦ p a ∧ ¬ q a) = s.filter p \ s.filter q

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

Finset.filter (fun a => p a ∧ ¬q a) s = Finset.filter p s \ Finset.filter q s


protected theorem Measure.isTopologicalBasis_isOpen_lt_top [TopologicalSpace α]
    (μ : Measure α) [IsLocallyFiniteMeasure μ] :
    TopologicalSpace.IsTopologicalBasis { s | IsOpen s ∧ μ s < ∞ }

TopologicalSpace.IsTopologicalBasis {s | IsOpen s ∧ μ s < ⊤}


theorem norm_inf_sub_inf_le_norm (x y z : α) : ‖x ⊓ z - y ⊓ z‖ ≤ ‖x - y‖

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


theorem lf_or_equiv_or_gf (x y : PGame) : x ⧏ y ∨ (x ≈ y) ∨ y ⧏ x


theorem wbtw_swap_left_iff [NoZeroSMulDivisors R V] {x y : P} (z : P) :
    Wbtw R x y z ∧ Wbtw R y x z ↔ x = y

(R : Type u_1)
{V : Type u_2}
{P : Type u_4}
[OrderedRing R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
[NoZeroSMulDivisors R V]
{x y : P}
(z : P)


theorem unique_diff_at_image {x : H} : UniqueDiffWithinAt 𝕜 (range I) (I x)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
(I : ModelWithCorners 𝕜 E H)
{x : H}

UniqueDiffWithinAt 𝕜 (Set.range ↑I) (↑I x)


/-- The auxiliary set corresponding to the composition of partial sums asymptotically contains
all possible compositions. -/
theorem compPartialSumTarget_tendsto_atTop :
    Tendsto (fun N => compPartialSumTarget 0 N N) atTop atTop

Filter.Tendsto (fun N => FormalMultilinearSeries.compPartialSumTarget 0 N N) Filter.atTop Filter.atTop


/-- Composition of lax functors. -/
@[simps]
def comp {D : Type u₃} [Bicategory.{w₃, v₃} D] (F : LaxFunctor B C) (G : LaxFunctor C D) :
    LaxFunctor B D

{B : Type u₁}
[CategoryTheory.Bicategory B]
{C : Type u₂}
[CategoryTheory.Bicategory C]
{D : Type u₃}
[CategoryTheory.Bicategory D]
(F : CategoryTheory.LaxFunctor B C)
(G : CategoryTheory.LaxFunctor C D)

(F.comp G).toPrelaxFunctor = F.comp G.toPrelaxFunctor


theorem IsBounded.union (hs : IsBounded s) (ht : IsBounded t) : IsBounded (s ∪ t)

∀ {x : Bornology α} {s t : Set α}, Bornology.IsBounded s → Bornology.IsBounded t → Bornology.IsBounded (s ∪ t)


theorem indep_of_not_dep (hI : ¬ M.Dep I) (hIE : I ⊆ M.E := by aesop_mat) : M.Indep I

{α : Type u_1}
{M : Matroid α}
{I : Set α}
(hI : ¬M.Dep I)
(hIE : I ⊆ M.E := by aesop_mat)


theorem inseparable_of_nhdsWithin_eq (hx : x ∈ s) (hy : y ∈ s) (h : 𝓝[s] x = 𝓝[s] y) : x ~ᵢ y

{X : Type u_1}
[TopologicalSpace X]
{x y : X}
{s : Set X}
(hx : x ∈ s)
(hy : y ∈ s)
(h : 𝓝[s] x = 𝓝[s] y)


theorem toFun_eq_coe (v : Valuation R Γ₀) : v.toFun = v

{R : Type u_3}
{Γ₀ : Type u_4}
[Ring R]
[LinearOrderedCommMonoidWithZero Γ₀]
(v : Valuation R Γ₀)


@[simp]
theorem map_app (f : Q₁.IsometryEquiv Q₂) (m : M₁) : Q₂ (f m) = Q₁ m

{R : Type u_2}
{M₁ : Type u_5}
{M₂ : Type u_6}
{N : Type u_9}
[CommSemiring R]
[AddCommMonoid M₁]
[AddCommMonoid M₂]
[AddCommMonoid N]
[Module R M₁]
[Module R M₂]
[Module R N]
{Q₁ : QuadraticMap R M₁ N}
{Q₂ : QuadraticMap R M₂ N}
(f : Q₁.IsometryEquiv Q₂)
(m : M₁)


@[to_additive]
theorem map_div_rev : f (x / y) = f (y / x)

{F : Type u_2}
{α : Type u_3}
{β : Type u_4}
[FunLike F α β]
[Group α]
[OrderedAddCommMonoid β]
[GroupSeminormClass F α β]
(f : F)
(x y : α)


theorem isUnit_leadingCoeff_mul_left_eq_zero_iff (h : IsUnit p.leadingCoeff) {q : R[X]} :
    q * p = 0 ↔ q = 0

{R : Type u}
[Semiring R]
{p : R[X]}
(h : IsUnit p.leadingCoeff)
{q : R[X]}


lemma sum_boole_mul (s : Finset ι) (f : ι → α) (i : ι) :
    ∑ j ∈ s, ite (i = j) 1 0 * f j = ite (i ∈ s) (f i) 0

{ι : Type u_1}
{α : Type u_2}
[NonAssocSemiring α]
[DecidableEq ι]
(s : Finset ι)
(f : ι → α)
(i : ι)

∑ j ∈ s, (if i = j then 1 else 0) * f j = if i ∈ s then f i else 0


/-- The closure of the open interval `(a, b)` is the closed interval `[a, b]`. -/
@[simp]
theorem closure_Ioo {a b : α} (hab : a ≠ b) : closure (Ioo a b) = Icc a b

{α : Type u_1}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
[DenselyOrdered α]
{a b : α}
(hab : a ≠ b)


@[simp] lemma removeNth_zero (f : ∀ i, α i) : removeNth 0 f = tail f

{n : ℕ}
{α : Fin (n + 1) → Type u}
(f : (i : Fin (n + 1)) → α i)


theorem ContDiff.cos {n} (h : ContDiff ℝ n f) : ContDiff ℝ n fun x => Real.cos (f x)

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : E → ℝ}
{n : ℕ∞}
(h : ContDiff ℝ n f)


@[to_additive]
theorem isMulLeftInvariant_map {H : Type*} [MeasurableSpace H] [Mul H] [MeasurableMul H]
    [IsMulLeftInvariant μ] (f : G →ₙ* H) (hf : Measurable f) (h_surj : Surjective f) :
    IsMulLeftInvariant (Measure.map f μ)

{G : Type u_2}
[MeasurableSpace G]
[Mul G]
{μ : MeasureTheory.Measure G}
[MeasurableMul G]
{H : Type u_4}
[MeasurableSpace H]
[Mul H]
[MeasurableMul H]
[μ.IsMulLeftInvariant]
(f : G →ₙ* H)
(hf : Measurable ⇑f)
(h_surj : Function.Surjective ⇑f)


theorem coe_algebraMap :
    algebraMap (FixedPoints.subfield M F) F = Subfield.subtype (FixedPoints.subfield M F)

(M : Type u)
[Monoid M]
(F : Type v)
[Field F]
[MulSemiringAction M F]

algebraMap (↥(FixedPoints.subfield M F)) F = (FixedPoints.subfield M F).subtype


theorem exists_ne_zero_int_vec_norm_le' (hA : A ≠ 0) : ∃ t : β → ℤ, t ≠ 0 ∧
    A *ᵥ t = 0 ∧ ‖t‖ ≤ (n * ‖A‖) ^ ((m : ℝ) / (n - m))

{α : Type u_1}
{β : Type u_2}
[Fintype α]
[Fintype β]
(A : Matrix α β ℤ)
(hn : Fintype.card α < Fintype.card β)
(hm : 0 < Fintype.card α)
(hA : A ≠ 0)

∃ t,
  t ≠ 0 ∧ A *ᵥ t = 0 ∧ ‖t‖ ≤ (↑(Fintype.card β) * ‖A‖) ^ (↑(Fintype.card α) / (↑(Fintype.card β) - ↑(Fintype.card α)))


lemma greatestFib_ne_zero : greatestFib n ≠ 0 ↔ n ≠ 0


/-- A topological space is called a *preregular* (a.k.a. R₁) space,
if any two topologically distinguishable points have disjoint neighbourhoods. -/
@[mk_iff r1Space_iff_specializes_or_disjoint_nhds]
class R1Space (X : Type*) [TopologicalSpace X] : Prop where
  specializes_or_disjoint_nhds (x y : X) : Specializes x y ∨ Disjoint (𝓝 x) (𝓝 y)

{X : Type u_3}
[TopologicalSpace X]
[self : R1Space X]
(x y : X)


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

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


@[to_additive (attr := simp)]
theorem smul_mem_smul_set_iff : a • x ∈ a • s ↔ x ∈ s

{α : Type u_2}
{β : Type u_3}
[Group α]
[MulAction α β]
{s : Set β}
{a : α}
{x : β}


@[to_additive]
theorem cons_cons_iff (p) : Red (p :: L₁) (p :: L₂) ↔ Red L₁ L₂

{α : Type u}
{L₁ L₂ : List (α × Bool)}
(p : α × Bool)

FreeGroup.Red (p :: L₁) (p :: L₂) ↔ FreeGroup.Red L₁ L₂


/-- Multiplicativity of `Ideal.spanNorm`. simp-normal form is `map_mul (Ideal.relNorm R)`. -/
theorem spanNorm_mul (I J : Ideal S) : spanNorm R (I * J) = spanNorm R I * spanNorm R J

(R : Type u_1)
[CommRing R]
{S : Type u_2}
[CommRing S]
[Algebra R S]
[IsDomain R]
[IsDomain S]
[IsDedekindDomain R]
[IsDedekindDomain S]
[Module.Finite R S]
[Module.Free R S]
(I J : Ideal S)

Ideal.spanNorm R (I * J) = Ideal.spanNorm R I * Ideal.spanNorm R J


lemma Localization.exists_rightFraction {X Y : C} (f : L.obj X ⟶ L.obj Y) :
    ∃ (φ : W.RightFraction X Y), f = φ.map L (Localization.inverts L W)

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_4, u_1} C]
[CategoryTheory.Category.{u_3, u_2} D]
(L : CategoryTheory.Functor C D)
(W : CategoryTheory.MorphismProperty C)
[L.IsLocalization W]
[W.HasRightCalculusOfFractions]
{X Y : C}
(f : L.obj X ⟶ L.obj Y)


/-- The n-ary version of `Set.mem_mul`. -/
@[to_additive " The n-ary version of `Set.mem_add`. "]
theorem mem_finset_prod (t : Finset ι) (f : ι → Set α) (a : α) :
    (a ∈ ∏ i ∈ t, f i) ↔ ∃ (g : ι → α) (_ : ∀ {i}, i ∈ t → g i ∈ f i), ∏ i ∈ t, g i = a

{ι : Type u_1}
{α : Type u_2}
[AddCommMonoid α]
(t : Finset ι)
(f : ι → Set α)
(a : α)

a ∈ ∑ i ∈ t, f i ↔ ∃ g, ∃ (_ : ∀ {i : ι}, i ∈ t → g i ∈ f i), ∑ i ∈ t, g i = a


theorem DirectedOn.exists_mem_subset_of_finset_subset_biUnion {α ι : Type*} {f : ι → Set α}
    {c : Set ι} (hn : c.Nonempty) (hc : DirectedOn (fun i j => f i ⊆ f j) c) {s : Finset α}
    (hs : (s : Set α) ⊆ ⋃ i ∈ c, f i) : ∃ i ∈ c, (s : Set α) ⊆ f i


theorem ClassGroup.mk_eq_mk_of_coe_ideal {I J : (FractionalIdeal R⁰ <| FractionRing R)ˣ}
    {I' J' : Ideal R} (hI : (I : FractionalIdeal R⁰ <| FractionRing R) = I')
    (hJ : (J : FractionalIdeal R⁰ <| FractionRing R) = J') :
    ClassGroup.mk I = ClassGroup.mk J ↔
      ∃ x y : R, x ≠ 0 ∧ y ≠ 0 ∧ Ideal.span {x} * I' = Ideal.span {y} * J'

{I J : (FractionalIdeal R⁰ (FractionRing R))ˣ}

ClassGroup.mk I = ClassGroup.mk J ↔ ∃ x y, x ≠ 0 ∧ y ≠ 0 ∧ Ideal.span {x} * I' = Ideal.span {y} * J'


@[to_additive]
theorem Nonempty.of_mul_left : (s * t).Nonempty → s.Nonempty

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


theorem digits_zero_succ' : ∀ {n : ℕ}, n ≠ 0 → digits 0 n = [n]


/-- Excluded middle commuted.  Added as alias for Decidable.em -/
theorem Decidable.not_or_self (p : Prop) [h : Decidable p] : ¬p ∨ p


/-- $a^{-1}ba$ is a vector. -/
theorem invOf_ι_mul_ι_mul_ι (a b : M) [Invertible (ι Q a)] [Invertible (Q a)] :
    ⅟ (ι Q a) * ι Q b * ι Q a = ι Q ((⅟ (Q a) * QuadraticMap.polar Q a b) • a - b)

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
(Q : QuadraticForm R M)
(a b : M)
[Invertible ((CliffordAlgebra.ι Q) a)]
[Invertible (Q a)]

⅟((CliffordAlgebra.ι Q) a) * (CliffordAlgebra.ι Q) b * (CliffordAlgebra.ι Q) a =
  (CliffordAlgebra.ι Q) ((⅟(Q a) * QuadraticMap.polar (⇑Q) a b) • a - b)


theorem add_le_mul_two_add [ZeroLEOneClass α] [MulPosMono α] [CovariantClass α α (· + ·) (· ≤ ·)]
    (a2 : 2 ≤ a) (b0 : 0 ≤ b) : a + (2 + b) ≤ a * (2 + b)

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


@[simp]
theorem map₂_mk (f : α → β → γ) (hr : ∀ a b₁ b₂, s b₁ b₂ → t (f a b₁) (f a b₂))
    (hs : ∀ a₁ a₂ b, r a₁ a₂ → t (f a₁ b) (f a₂ b)) (a : α) (b : β) :
    Quot.map₂ f hr hs (Quot.mk r a) (Quot.mk s b) = Quot.mk t (f a b)

(f : α → β → γ)

(hr : ∀ (a : α) (b₁ b₂ : β), s b₁ b₂ → t (f a b₁) (f a b₂))

(hs : ∀ (a₁ a₂ : α) (b : β), r a₁ a₂ → t (f a₁ b) (f a₂ b))