/-- The `atBot` filter for an open interval `Iio a` comes from the `atBot` filter in the ambient
order. -/
@[simp]
theorem map_val_Iio_atBot [SemilatticeInf α] [NoMinOrder α] (a : α) :
    map ((↑) : Iio a → α) atBot = atBot

{α : Type u_3}
[SemilatticeInf α]
[NoMinOrder α]
(a : α)

Filter.map Subtype.val Filter.atBot = Filter.atBot


/-- A semistandard Young tableau is a filling of the cells of a Young diagram by natural
numbers, such that the entries in each row are weakly increasing (left to right), and the entries
in each column are strictly increasing (top to bottom).

Here, a semistandard Young tableau is represented as an unrestricted function `ℕ → ℕ → ℕ` that, for
reasons of extensionality, is required to vanish outside `μ`. -/
structure SemistandardYoungTableau (μ : YoungDiagram) where
  /-- `entry i j` is value of the `(i, j)` entry of the SSYT `μ`. -/
  entry : ℕ → ℕ → ℕ
  /-- The entries in each row are weakly increasing (left to right). -/
  row_weak' : ∀ {i j1 j2 : ℕ}, j1 < j2 → (i, j2) ∈ μ → entry i j1 ≤ entry i j2
  /-- The entries in each column are strictly increasing (top to bottom). -/
  col_strict' : ∀ {i1 i2 j : ℕ}, i1 < i2 → (i2, j) ∈ μ → entry i1 j < entry i2 j
  /-- `entry` is required to be zero for all pairs `(i, j) ∉ μ`. -/
  zeros' : ∀ {i j}, (i, j) ∉ μ → entry i j = 0

{μ : YoungDiagram}
(self : SemistandardYoungTableau μ)
{i1 i2 j : ℕ}

i1 < i2 → (i2, j) ∈ μ → self.entry i1 j < self.entry i2 j


theorem IsCobounded.all (s : Set α) : IsCobounded s

{α : Type u_2}
[Bornology α]
[BoundedSpace α]
(s : Set α)


theorem exists_pos_lt_mul {a : α} (h : 0 < a) (b : α) : ∃ c : α, 0 < c ∧ b < c * a

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


theorem sum_mul_self (s : Finset ι) (f : ι → R) :
    ((∑ i ∈ s, f i) * ∑ i ∈ s, f i) = ∑ i ∈ s, f i * f i

{R : Type u_1}
{ι : Type u_2}
[CommSemiring R]
[CharP R 2]
(s : Finset ι)
(f : ι → R)

(∑ i ∈ s, f i) * ∑ i ∈ s, f i = ∑ i ∈ s, f i * f i


theorem quasispectrumRestricts_iff_spectrumRestricts {R S A : Type*} [Semifield R] [Semifield S]
    [Ring A] [Algebra R S] [Algebra R A] [Algebra S A] {a : A} {f : S → R} :
    QuasispectrumRestricts a f ↔ SpectrumRestricts a f

{R : Type u_3}
{S : Type u_4}
{A : Type u_5}
[Semifield R]
[Semifield S]
[Ring A]
[Algebra R S]
[Algebra R A]
[Algebra S A]
{a : A}
{f : S → R}


theorem expand_char (f : R[X]) : map (frobenius R p) (expand R p f) = f ^ p

{R : Type u}
[CommSemiring R]
(p : ℕ)
[ExpChar R p]
(f : R[X])

Polynomial.map (frobenius R p) ((Polynomial.expand R p) f) = f ^ p


theorem nat_find_mem_find {p : Fin n → Prop} [DecidablePred p]
    (h : ∃ i, ∃ hin : i < n, p ⟨i, hin⟩) :
    (⟨Nat.find h, (Nat.find_spec h).fst⟩ : Fin n) ∈ find p

{n : ℕ}
{p : Fin n → Prop}
[DecidablePred p]
(h : ∃ i, ∃ (hin : i < n), p ⟨i, hin⟩)


@[to_additive (attr := simp)]
theorem mem_inf {p p' : Submonoid M} {x : M} : x ∈ p ⊓ p' ↔ x ∈ p ∧ x ∈ p'

{M : Type u_1}
[AddZeroClass M]
{p p' : AddSubmonoid M}
{x : M}


theorem monomial_mul_monomial (m n : σ →₀ ℕ) (a b : R) :
    monomial R m a * monomial R n b = monomial R (m + n) (a * b)

{σ : Type u_1}
{R : Type u_2}
[Semiring R]
(m n : σ →₀ ℕ)
(a b : R)

(MvPowerSeries.monomial R m) a * (MvPowerSeries.monomial R n) b = (MvPowerSeries.monomial R (m + n)) (a * b)


@[to_additive (attr := simp 1100, norm_cast)]
theorem val_finset_prod {ι G} [CommGroup G] (H : Subgroup G) (f : ι → H) (s : Finset ι) :
    ↑(∏ i ∈ s, f i) = (∏ i ∈ s, f i : G)

{ι : Type u_3}
{G : Type u_4}
[AddCommGroup G]
(H : AddSubgroup G)
(f : ι → ↥H)
(s : Finset ι)


@[to_additive (attr := simp)]
theorem mul_singleton : s * {b} = (· * b) '' s

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


@[simp]
protected theorem zero : smoothTransition 0 = 0


theorem StrictAntiOn.lt_iff_lt (hf : StrictAntiOn f s) {a b : α} (ha : a ∈ s) (hb : b ∈ s) :
    f a < f b ↔ b < a

{α : Type u}
{β : Type v}
[LinearOrder α]
[Preorder β]
{f : α → β}
{s : Set α}
(hf : StrictAntiOn f s)
{a b : α}
(ha : a ∈ s)
(hb : b ∈ s)


theorem uniformContinuous_mk : UniformContinuous (mk : α → SeparationQuotient α)


@[simp]
theorem isHenstock_single_iff (hJ : J ≤ I) (h : x ∈ Box.Icc I) :
    IsHenstock (single I J hJ x h) ↔ x ∈ Box.Icc J

{ι : Type u_1}
{I J : BoxIntegral.Box ι}
{x : ι → ℝ}
(hJ : J ≤ I)
(h : x ∈ BoxIntegral.Box.Icc I)

(BoxIntegral.TaggedPrepartition.single I J hJ x h).IsHenstock ↔ x ∈ BoxIntegral.Box.Icc J


theorem uniformEmbedding_subtypeEmb (p : α → Prop) {e : α → β} (ue : UniformEmbedding e)
    (de : DenseEmbedding e) : UniformEmbedding (DenseEmbedding.subtypeEmb p e)

{α : Type u}
{β : Type v}
[UniformSpace α]
[UniformSpace β]
(p : α → Prop)
{e : α → β}
(ue : UniformEmbedding e)
(de : DenseEmbedding e)


theorem mem_support_bindOnSupport_iff (b : β) :
    b ∈ (p.bindOnSupport f).support ↔ ∃ (a : α) (h : a ∈ p.support), b ∈ (f a h).support

{α : Type u_1}
{β : Type u_2}
{p : PMF α}
(f : (a : α) → a ∈ p.support → PMF β)
(b : β)

b ∈ (p.bindOnSupport f).support ↔ ∃ a, ∃ (h : a ∈ p.support), b ∈ (f a h).support


theorem coe_normUnit_of_ne_zero [DecidableEq R] (hp : p ≠ 0) :
    (normUnit p : R[X]) = C p.leadingCoeff⁻¹

{R : Type u}
[Field R]
{p : R[X]}
[DecidableEq R]
(hp : p ≠ 0)

↑(normUnit p) = Polynomial.C p.leadingCoeff⁻¹


theorem of_rightInvOn (h₁ : Function.LeftInverse f (algebraMap R S))
    (h₂ : (spectrum S a).RightInvOn f (algebraMap R S)) : SpectrumRestricts a f

(h₁ : Function.LeftInverse f ⇑(algebraMap R S))

(h₂ : Set.RightInvOn f (⇑(algebraMap R S)) (spectrum S a))


@[simp]
lemma whiskerRightIso_refl (X W : C) :
    whiskerRightIso (Iso.refl X) W = Iso.refl (X ⊗ W)

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

CategoryTheory.MonoidalCategory.whiskerRightIso (CategoryTheory.Iso.refl X) W =
  CategoryTheory.Iso.refl (CategoryTheory.MonoidalCategory.tensorObj X W)


theorem integrableOn_iUnion_of_summable_integral_norm {f : X → E} {s : ι → Set X}
    (hs : ∀ i : ι, MeasurableSet (s i)) (hi : ∀ i : ι, IntegrableOn f (s i) μ)
    (h : Summable fun i : ι => ∫ x : X in s i, ‖f x‖ ∂μ) : IntegrableOn f (iUnion s) μ

(hi : ∀ (i : ι), MeasureTheory.IntegrableOn f (s i) μ)

(h : Summable fun i => ∫ (x : X) in s i, ‖f x‖ ∂μ)

MeasureTheory.IntegrableOn f (Set.iUnion s) μ


/-- `cyclotomic n R` can be expressed as a product in a fraction field of `R[X]`
  using Möbius inversion. -/
theorem cyclotomic_eq_prod_X_pow_sub_one_pow_moebius {n : ℕ} (R : Type*) [CommRing R]
    [IsDomain R] : algebraMap _ (RatFunc R) (cyclotomic n R) =
      ∏ i ∈ n.divisorsAntidiagonal, algebraMap R[X] _ (X ^ i.snd - 1) ^ μ i.fst

{n : ℕ}
(R : Type u_1)
[CommRing R]
[IsDomain R]

(algebraMap R[X] (RatFunc R)) (Polynomial.cyclotomic n R) =
  ∏ i ∈ n.divisorsAntidiagonal, (algebraMap R[X] (RatFunc R)) (Polynomial.X ^ i.2 - 1) ^ ArithmeticFunction.moebius i.1


@[to_additive]
theorem lift_injective_iff :
    Function.Injective (f.lift hg) ↔ ∀ x y, f.toMap x = f.toMap y ↔ g x = g y

{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)
{g : M →* P}
(hg : ∀ (y : ↥S), IsUnit (g ↑y))

Function.Injective ⇑(f.lift hg) ↔ ∀ (x y : M), f.toMap x = f.toMap y ↔ g x = g y


@[simp]
theorem union_right_iff : AEDisjoint μ s (t ∪ u) ↔ AEDisjoint μ s t ∧ AEDisjoint μ s u

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

MeasureTheory.AEDisjoint μ s (t ∪ u) ↔ MeasureTheory.AEDisjoint μ s t ∧ MeasureTheory.AEDisjoint μ s u


/-- Constructor for isomorphisms in `ComposableArrows C 4`. -/
@[simps]
def isoMk₄ {f g : ComposableArrows C 4}
    (app₀ : f.obj' 0 ≅ g.obj' 0) (app₁ : f.obj' 1 ≅ g.obj' 1) (app₂ : f.obj' 2 ≅ g.obj' 2)
    (app₃ : f.obj' 3 ≅ g.obj' 3) (app₄ : f.obj' 4 ≅ g.obj' 4)
    (w₀ : f.map' 0 1 ≫ app₁.hom = app₀.hom ≫ g.map' 0 1)
    (w₁ : f.map' 1 2 ≫ app₂.hom = app₁.hom ≫ g.map' 1 2)
    (w₂ : f.map' 2 3 ≫ app₃.hom = app₂.hom ≫ g.map' 2 3)
    (w₃ : f.map' 3 4 ≫ app₄.hom = app₃.hom ≫ g.map' 3 4) :
    f ≅ g

{f g : CategoryTheory.ComposableArrows C 4}

(w₀ :
  CategoryTheory.CategoryStruct.comp (f.map' 0 1 ⋯ ⋯) app₁.hom =
    CategoryTheory.CategoryStruct.comp app₀.hom (g.map' 0 1 ⋯ ⋯))

(w₁ :
  CategoryTheory.CategoryStruct.comp (f.map' 1 2 ⋯ ⋯) app₂.hom =
    CategoryTheory.CategoryStruct.comp app₁.hom (g.map' 1 2 ⋯ ⋯))

(w₂ :
  CategoryTheory.CategoryStruct.comp (f.map' 2 3 ⋯ ⋯) app₃.hom =
    CategoryTheory.CategoryStruct.comp app₂.hom (g.map' 2 3 ⋯ ⋯))

(w₃ :
  CategoryTheory.CategoryStruct.comp (f.map' 3 4 ⋯ ⋯) app₄.hom =
    CategoryTheory.CategoryStruct.comp app₃.hom (g.map' 3 4 ⋯ ⋯))

(CategoryTheory.ComposableArrows.isoMk₄ app₀ app₁ app₂ app₃ app₄ w₀ w₁ w₂ w₃).inv =
  CategoryTheory.ComposableArrows.homMk₄ app₀.inv app₁.inv app₂.inv app₃.inv app₄.inv ⋯ ⋯ ⋯ ⋯


theorem integrable_const_mul_iff {c : 𝕜} (hc : IsUnit c) (f : α → 𝕜) :
    Integrable (fun x => c * f x) μ ↔ Integrable f μ

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{𝕜 : Type u_5}
[NormedRing 𝕜]
{c : 𝕜}
(hc : IsUnit c)
(f : α → 𝕜)

MeasureTheory.Integrable (fun x => c * f x) μ ↔ MeasureTheory.Integrable f μ


lemma surjectiveOnStalks_iff_forall_ideal :
    f.SurjectiveOnStalks ↔
      ∀ I : Ideal S, I ≠ ⊤ → ∀ s : S, ∃ x r : R, ∃ c ∉ I, f r ∉ I ∧ c * f r * s = c * f x

{R : Type u_1}
[CommRing R]
{S : Type u_2}
[CommRing S]
{f : R →+* S}

f.SurjectiveOnStalks ↔ ∀ (I : Ideal S), I ≠ ⊤ → ∀ (s : S), ∃ x r, ∃ c ∉ I, f r ∉ I ∧ c * f r * s = c * f x


theorem hyperoperation_ge_three_one (n : ℕ) : ∀ k : ℕ, hyperoperation (n + 3) 1 k = 1


theorem pairwise_insert :
    (insert a s).Pairwise r ↔ s.Pairwise r ∧ ∀ b ∈ s, a ≠ b → r a b ∧ r b a

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


@[simp] lemma left_mem_uIoc : a ∈ Ι a b ↔ b < a

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


lemma exists' {p : ∀ a, β a → Prop} : (∃ a b, p a b) ↔ ∃ x : Σ a, β a, p x.1 x.2

{α : Type u_1}
{β : α → Type u_4}
{p : (a : α) → β a → Prop}


nonrec theorem HasStrictDerivAt.const_smul (c : R) (hf : HasStrictDerivAt f f' x) :
    HasStrictDerivAt (fun y => c • f y) (c • f') x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : 𝕜 → F}
{f' : F}
{x : 𝕜}
{R : Type u_2}
[Semiring R]
[Module R F]
[SMulCommClass 𝕜 R F]
[ContinuousConstSMul R F]
(c : R)
(hf : HasStrictDerivAt f f' x)


lemma piTensorHomMap_tprod_eq_map (f : Π i, s i →ₗ[R] t i) :
    piTensorHomMap (tprod R f) = map f

{ι : Type u_1}
{R : Type u_4}
[CommSemiring R]
{s : ι → Type u_7}
[(i : ι) → AddCommMonoid (s i)]
[(i : ι) → Module R (s i)]
{t : ι → Type u_11}
[(i : ι) → AddCommMonoid (t i)]
[(i : ι) → Module R (t i)]
(f : (i : ι) → s i →ₗ[R] t i)

PiTensorProduct.piTensorHomMap ((PiTensorProduct.tprod R) f) = PiTensorProduct.map f


@[measurability]
theorem measurable_arctan : Measurable arctan


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

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


theorem toSubring_injective : Function.Injective (toSubring : ValuationSubring K → Subring K)


@[to_additive]
theorem singleton_one : ({1} : Set α) = 1


@[to_additive (attr := elab_as_elim)]
theorem induction_on' {C : M ∗ N → Prop} (m : M ∗ N)
    (one : C 1)
    (inl_mul : ∀ m x, C x → C (inl m * x))
    (inr_mul : ∀ n x, C x → C (inr n * x)) : C m

(inl_mul : ∀ (m : M) (x : AddMonoid.Coprod M N), C x → C (AddMonoid.Coprod.inl m + x))

(inr_mul : ∀ (n : N) (x : AddMonoid.Coprod M N), C x → C (AddMonoid.Coprod.inr n + x))


theorem zip_eq_zip_take_min : ∀ (l₁ : List α) (l₂ : List β),
    zip l₁ l₂ = zip (l₁.take (min l₁.length l₂.length)) (l₂.take (min l₁.length l₂.length))

{α : Type u_1}
{β : Type u_2}
(l₁ : List α)
(l₂ : List β)

l₁.zip l₂ = (List.take (min l₁.length l₂.length) l₁).zip (List.take (min l₁.length l₂.length) l₂)


theorem rightInverse_invFun (hf : Surjective f) : RightInverse (invFun f) f

{α : Sort u_1}
{β : Sort u_2}
[Nonempty α]
{f : α → β}
(hf : Function.Surjective f)

Function.RightInverse (Function.invFun f) f


lemma le_inv_smul_iff_of_pos [PosSMulMono α β] [PosSMulReflectLE α β] (ha : 0 < a) :
    b₁ ≤ a⁻¹ • b₂ ↔ a • b₁ ≤ b₂

{α : Type u_1}
{β : Type u_2}
{a : α}
{b₁ b₂ : β}
[GroupWithZero α]
[Preorder α]
[Preorder β]
[MulAction α β]
[PosSMulMono α β]
[PosSMulReflectLE α β]
(ha : 0 < a)

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


theorem xor_true : ∀ (x : Bool), xor x true = !x


theorem pure_bind (f : α → FreeAbelianGroup β) (x) : pure x >>= f = f x

{α β : Type u}
(f : α → FreeAbelianGroup β)
(x : α)


theorem units_pow_eq_pow_mod_two (u : ℤˣ) (n : ℕ) : u ^ n = u ^ (n % 2)


theorem IsNormal.le_set' {f o} (H : IsNormal f) (p : Set α) (p0 : p.Nonempty) (g : α → Ordinal) (b)
    (H₂ : ∀ o, b ≤ o ↔ ∀ a ∈ p, g a ≤ o) : f b ≤ o ↔ ∀ a ∈ p, f (g a) ≤ o

(H₂ : ∀ (o : Ordinal.{u_4}), b ≤ o ↔ ∀ a ∈ p, g a ≤ o)


@[to_additive]
protected theorem _root_.IsUnit.set : IsUnit a → IsUnit ({a} : Set α)


theorem toAffineMap_injective : Injective (toAffineMap : (P →ᵃⁱ[𝕜] P₂) → P →ᵃ[𝕜] P₂)

{𝕜 : Type u_1}
{V : Type u_2}
{V₂ : Type u_5}
{P : Type u_10}
{P₂ : Type u_11}
[NormedField 𝕜]
[SeminormedAddCommGroup V]
[NormedSpace 𝕜 V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]
[SeminormedAddCommGroup V₂]
[NormedSpace 𝕜 V₂]
[PseudoMetricSpace P₂]
[NormedAddTorsor V₂ P₂]


theorem SeparatingLeft.toMatrix₂ {B : M₁ →ₗ[R₁] M₁ →ₗ[R₁] R₁} (h : B.SeparatingLeft)
    (b : Basis ι R₁ M₁) : (toMatrix₂ b b B).Nondegenerate

{R₁ : Type u_2}
{M₁ : Type u_7}
{ι : Type u_16}
[CommRing R₁]
[AddCommMonoid M₁]
[Module R₁ M₁]
[DecidableEq ι]
[Fintype ι]
{B : M₁ →ₗ[R₁] M₁ →ₗ[R₁] R₁}
(h : B.SeparatingLeft)
(b : Basis ι R₁ M₁)

((LinearMap.toMatrix₂ b b) B).Nondegenerate


@[simp]
theorem floor_eq_self_of_mem (m : E) (h : m ∈ span ℤ (Set.range b)) : (floor b m : E) = m

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


theorem comp_tensorRId_eq (Q₁ : QuadraticForm R M₁) :
    Q₁.comp (TensorProduct.rid R M₁) = Q₁.tmul (sq (R := R))

{R : Type uR}
{M₁ : Type uM₁}
[CommRing R]
[AddCommGroup M₁]
[Module R M₁]
[Invertible 2]
(Q₁ : QuadraticForm R M₁)

QuadraticMap.comp Q₁ ↑(TensorProduct.rid R M₁) = Q₁.tmul QuadraticMap.sq


theorem IsProper.not_mem_of_compl_mem (hI : IsProper I) (hxc : xᶜ ∈ I) : x ∉ I

{P : Type u_1}
[BooleanAlgebra P]
{x : P}
{I : Order.Ideal P}
(hI : I.IsProper)
(hxc : xᶜ ∈ I)


@[simp]
theorem limitEquivSections_symm_apply (x : F.sections) (j : J) :
    limit.π F j ((limitEquivSections F).symm x) = (x : ∀ j, F.obj j) j

{J : Type v}
[CategoryTheory.Category.{w, v} J]
(F : J ⥤ Type u)
[CategoryTheory.Limits.HasLimit F]
(x : ↑F.sections)
(j : J)

CategoryTheory.Limits.limit.π F j ((CategoryTheory.Limits.Types.limitEquivSections F).symm x) = ↑x j


theorem cospan_map_id {X Y Z : C} (f : X ⟶ Z) (g : Y ⟶ Z) (w : WalkingCospan) :
    (cospan f g).map (WalkingCospan.Hom.id w) = 𝟙 _

(CategoryTheory.Limits.cospan f g).map (CategoryTheory.Limits.WalkingCospan.Hom.id w) =
  𝟙 ((CategoryTheory.Limits.cospan f g).obj w)


theorem nfp_lt_ord_of_isRegular {f : Ordinal → Ordinal} {c} (hc : IsRegular c) (hc' : c ≠ ℵ₀)
    (hf : ∀ i < c.ord, f i < c.ord) {a} : a < c.ord → nfp f a < c.ord

{f : Ordinal.{u_2} → Ordinal.{u_2}}
{c : Cardinal.{u_2}}
(hc : c.IsRegular)
(hc' : c ≠ ℵ₀)
(hf : ∀ i < c.ord, f i < c.ord)
{a : Ordinal.{u_2}}


theorem image_eq (h : e.IsImage s t) : e '' (e.source ∩ s) = e.target ∩ t

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


@[simp]
theorem indexEquiv_apply_ofIsReal (w : {w : InfinitePlace K // IsReal w}) :
    (indexEquiv K) (Sum.inl w) = w.val.embedding

{K : Type u_1}
[Field K]
[NumberField K]
(w : { w // w.IsReal })

(NumberField.mixedEmbedding.indexEquiv K) (Sum.inl w) = (↑w).embedding


/-- Construct an isomorphism of comonoids by giving an isomorphism between the underlying objects
and checking compatibility with counit and comultiplication only in the forward direction.
-/
@[simps]
def mkIso {M N : Comon_ C} (f : M.X ≅ N.X) (f_counit : f.hom ≫ N.counit = M.counit := by aesop_cat)
    (f_comul : f.hom ≫ N.comul = M.comul ≫ (f.hom ⊗ f.hom) := by aesop_cat) : M ≅ N

(Comon_.mkIso f f_counit f_comul).inv.hom = f.inv


theorem mulPosMono_iff_mulPosReflectLT : MulPosMono α ↔ MulPosReflectLT α

{α : Type u_1}
[Mul α]
[Zero α]
[LinearOrder α]


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

{M : Type u_1}
{N : Type u_2}
{P : Type u_3}
[Add M]
[Add N]
[Add P]
(S : AddSubsemigroup M)
(g : AddHom N P)
(f : AddHom M N)

AddSubsemigroup.map g (AddSubsemigroup.map f S) = AddSubsemigroup.map (g.comp f) S


theorem iff_symm_preimage_eq : e.IsImage s t ↔ e.target ∩ e.symm ⁻¹' s = e.target ∩ t

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

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


/-- If `α` is a linear pred order, `β` is a preorder, and `f : α → β` is a monotone function, then
the intervals `Set.Ioc (f Order.pred n) (f n)` are pairwise disjoint. -/
theorem pairwise_disjoint_on_Ioc_pred [PredOrder α] [Preorder β] {f : α → β} (hf : Monotone f) :
    Pairwise (Disjoint on fun n => Ioc (f (pred n)) (f n))

{α : Type u_1}
{β : Type u_2}
[LinearOrder α]
[PredOrder α]
[Preorder β]
{f : α → β}
(hf : Monotone f)

Pairwise (Disjoint on fun n => Set.Ioc (f (Order.pred n)) (f n))


@[reassoc (attr := simp)]
theorem inr_comp_pushoutSymmetry_hom [HasPushout f g] :
    pushout.inr _ _ ≫ (pushoutSymmetry f g).hom = pushout.inl _ _

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

CategoryTheory.Limits.pushout.inr f g ≫ (CategoryTheory.Limits.pushoutSymmetry f g).hom =
  CategoryTheory.Limits.pushout.inl g f


/-- An order is strongly coatomic if every nontrivial interval `[a, b]`
contains an element covered by `b`. -/
@[mk_iff]
class IsStronglyCoatomic (α : Type*) [Preorder α] : Prop where
  (exists_le_covBy_of_lt : ∀ (a b : α), a < b → ∃ x, a ≤ x ∧ x ⋖ b)

{α : Type u_5}
[Preorder α]
[self : IsStronglyCoatomic α]
(a b : α)


@[simp]
theorem ite_same (t s : Set α) : t.ite s s = s


theorem exists_next_right {x : α} {s : Finset α} (h : ∃ y ∈ s, x < y) :
    ∃ y ∈ s, x < y ∧ ∀ z ∈ s, x < z → y ≤ z

{α : Type u_2}
[LinearOrder α]
{x : α}
{s : Finset α}
(h : ∃ y ∈ s, x < y)


theorem liftPropWithinAt_inter' (ht : t ∈ 𝓝[s] x) :
    LiftPropWithinAt P g (s ∩ t) x ↔ LiftPropWithinAt P g s x

{H : Type u_1}
{M : Type u_2}
{H' : Type u_3}
{M' : Type u_4}
[TopologicalSpace H]
[TopologicalSpace M]
[ChartedSpace H M]
[TopologicalSpace H']
[TopologicalSpace M']
[ChartedSpace H' M']
{G : StructureGroupoid H}
{G' : StructureGroupoid H'}
{P : (H → H') → Set H → H → Prop}
{g : M → M'}
{s t : Set M}
{x : M}
(hG : G.LocalInvariantProp G' P)
(ht : t ∈ 𝓝[s] x)

ChartedSpace.LiftPropWithinAt P g (s ∩ t) x ↔ ChartedSpace.LiftPropWithinAt P g s x


@[to_additive]
theorem one_div_mul_eq_div : 1 / a * b = b / a

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


/-- If a function `f` with a densely ordered codomain is strictly monotone on a left neighborhood of
`a` and the image of this neighborhood under `f` is a left neighborhood of `f a`, then `f` is
continuous at `a` from the left. -/
theorem StrictMonoOn.continuousWithinAt_left_of_image_mem_nhdsWithin [DenselyOrdered β] {f : α → β}
    {s : Set α} {a : α} (h_mono : StrictMonoOn f s) (hs : s ∈ 𝓝[≤] a) (hfs : f '' s ∈ 𝓝[≤] f a) :
    ContinuousWithinAt f (Iic a) a

{α : Type u_1}
{β : Type u_2}
[LinearOrder α]
[TopologicalSpace α]
[OrderTopology α]
[LinearOrder β]
[TopologicalSpace β]
[OrderTopology β]
[DenselyOrdered β]
{f : α → β}
{s : Set α}
{a : α}
(h_mono : StrictMonoOn f s)
(hs : s ∈ 𝓝[≤] a)
(hfs : f '' s ∈ 𝓝[≤] f a)


@[to_additive (attr := push_cast, simp)]
theorem coe_one_interval : ((1 : NonemptyInterval α) : Interval α) = 1


@[to_additive add_lt_of_neg_left]
theorem mul_lt_of_lt_one_left' [CovariantClass α α (swap (· * ·)) (· < ·)] (a : α) {b : α}
    (h : b < 1) :
    b * a < a

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


theorem exists_of_mem_map {f : α → β} {b : β} {s : Computation α} (h : b ∈ map f s) :
    ∃ a, a ∈ s ∧ f a = b

{α : Type u}
{β : Type v}
{f : α → β}
{b : β}
{s : Computation α}
(h : b ∈ Computation.map f s)


theorem hasColimitsOfShape_of_finallySmall (J : Type u) [Category.{v} J] [FinallySmall.{w} J]
    (C : Type u₁) [Category.{v₁} C] [HasColimitsOfSize.{w, w} C] : HasColimitsOfShape J C

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


@[to_additive (attr := simp, norm_cast)]
lemma coe_mul [Mul α] (a b : α) : (↑(a * b) : WithOne α) = a * b


theorem exists_ne_forall_mem_nhds_pos_measure_preimage {β} [TopologicalSpace β] [T1Space β]
    [SecondCountableTopology β] [Nonempty β] {f : α → β} (h : ∀ b, ∃ᵐ x ∂μ, f x ≠ b) :
    ∃ a b : β, a ≠ b ∧ (∀ s ∈ 𝓝 a, 0 < μ (f ⁻¹' s)) ∧ ∀ t ∈ 𝓝 b, 0 < μ (f ⁻¹' t)

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{β : Type u_5}
[TopologicalSpace β]
[T1Space β]
[SecondCountableTopology β]
[Nonempty β]
{f : α → β}
(h : ∀ (b : β), ∃ᵐ (x : α) ∂μ, f x ≠ b)

∃ a b, a ≠ b ∧ (∀ s ∈ 𝓝 a, 0 < μ (f ⁻¹' s)) ∧ ∀ t ∈ 𝓝 b, 0 < μ (f ⁻¹' t)


@[to_additive (attr := simp)]
theorem swap_swap (x : M ∗ N) : swap N M (swap M N x) = x

{M : Type u_1}
{N : Type u_2}
[MulOneClass M]
[MulOneClass N]
(x : Monoid.Coprod M N)

(Monoid.Coprod.swap N M) ((Monoid.Coprod.swap M N) x) = x


/-- A continuous function with compact support on a product space is strongly measurable for the
product sigma-algebra. The subtlety is that we do not assume that the spaces are separable, so the
product of the Borel sigma algebras might not contain all open sets, but still it contains enough
of them to approximate compactly supported continuous functions. -/
lemma _root_.HasCompactSupport.stronglyMeasurable_of_prod {X Y : Type*} [Zero α]
    [TopologicalSpace X] [TopologicalSpace Y] [MeasurableSpace X] [MeasurableSpace Y]
    [OpensMeasurableSpace X] [OpensMeasurableSpace Y] [TopologicalSpace α] [PseudoMetrizableSpace α]
    {f : X × Y → α} (hf : Continuous f) (h'f : HasCompactSupport f) :
    StronglyMeasurable f


theorem countP_filter (l : List α) :
    countP p (filter q l) = countP (fun a => p a ∧ q a) l

{α : Type u_1}
(p q : α → Bool)
(l : List α)

List.countP p (List.filter q l) = List.countP (fun a => decide (p a = true ∧ q a = true)) l


theorem mem_closedBall' : y ∈ closedBall x ε ↔ dist x y ≤ ε

{α : Type u}
[PseudoMetricSpace α]
{x y : α}
{ε : ℝ}

y ∈ Metric.closedBall x ε ↔ dist x y ≤ ε


theorem of_nonneg_disjoint_union_eq_zero {s : SignedMeasure α} {A B : Set α} (h : Disjoint A B)
    (hA₁ : MeasurableSet A) (hB₁ : MeasurableSet B) (hA₂ : 0 ≤ s A) (hB₂ : 0 ≤ s B)
    (hAB : s (A ∪ B) = 0) : s A = 0

{α : Type u_1}
{m : MeasurableSpace α}
{s : MeasureTheory.SignedMeasure α}
{A B : Set α}
(h : Disjoint A B)
(hA₁ : MeasurableSet A)
(hB₁ : MeasurableSet B)
(hA₂ : 0 ≤ ↑s A)
(hB₂ : 0 ≤ ↑s B)
(hAB : ↑s (A ∪ B) = 0)


@[to_additive (attr := measurability)]
theorem _root_.Multiset.stronglyMeasurable_prod (s : Multiset (α → M))
    (hs : ∀ f ∈ s, StronglyMeasurable f) :
    StronglyMeasurable fun x => (s.map fun f : α → M => f x).prod

(hs : ∀ f ∈ s, MeasureTheory.StronglyMeasurable f)

MeasureTheory.StronglyMeasurable fun x => (Multiset.map (fun f => f x) s).sum


@[simp]
theorem liftHom_of {x : R} : liftHom f a hfx (of f x) = algebraMap _ _ x

{R : Type u}
{S : Type v}
[CommRing R]
(f : R[X])
[CommRing S]
{a : S}
[Algebra R S]
(hfx : (Polynomial.aeval a) f = 0)
{x : R}

(AdjoinRoot.liftHom f a hfx) ((AdjoinRoot.of f) x) = (algebraMap R S) x


@[reassoc]
lemma liftCycles_shift_homologyπ
    (K : CochainComplex C ℤ) {A : C} {n i : ℤ} (f : A ⟶ (K⟦n⟧).X i) (j : ℤ)
    (hj : (up ℤ).next i = j) (hf : f ≫ (K⟦n⟧).d i j = 0) (i' : ℤ) (hi' : n + i = i') (j' : ℤ)
    (hj' : (up ℤ).next i' = j') :
    (K⟦n⟧).liftCycles f j hj hf ≫ (K⟦n⟧).homologyπ i =
      K.liftCycles (f ≫ (K.shiftFunctorObjXIso n i i' (by omega)).hom) j' hj' (by
        simp only [next] at hj hj'
        obtain rfl : i' = i + n := by omega
        obtain rfl : j' = j + n := by omega
        dsimp at hf ⊢
        simp only [Linear.comp_units_smul] at hf
        apply (one_smul (M := ℤˣ) _).symm.trans _
        rw [← Int.units_mul_self n.negOnePow, mul_smul, comp_id, hf, smul_zero]) ≫
        K.homologyπ i' ≫
          ((HomologicalComplex.homologyFunctor C (up ℤ) 0).shiftIso n i i' hi').inv.app K

(f : A ⟶ ((CategoryTheory.shiftFunctor (CochainComplex C ℤ) n).obj K).X i)

(hf : f ≫ ((CategoryTheory.shiftFunctor (CochainComplex C ℤ) n).obj K).d i j = 0)

(hj' : (ComplexShape.up ℤ).next i' = j')

HomologicalComplex.liftCycles ((CategoryTheory.shiftFunctor (CochainComplex C ℤ) n).obj K) f j hj hf ≫
    HomologicalComplex.homologyπ ((CategoryTheory.shiftFunctor (CochainComplex C ℤ) n).obj K) i =
  HomologicalComplex.liftCycles K (f ≫ (K.shiftFunctorObjXIso n i i' ⋯).hom) j' hj' ⋯ ≫
    HomologicalComplex.homologyπ K i' ≫
      ((HomologicalComplex.homologyFunctor C (ComplexShape.up ℤ) 0).shiftIso n i i' hi').inv.app K


@[reassoc (attr := simp)]
theorem eqToHom_trans {X Y Z : C} (p : X = Y) (q : Y = Z) :
    eqToHom p ≫ eqToHom q = eqToHom (p.trans q)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{X Y Z : C}
(p : X = Y)
(q : Y = Z)

CategoryTheory.CategoryStruct.comp (CategoryTheory.eqToHom p) (CategoryTheory.eqToHom q) = CategoryTheory.eqToHom ⋯


@[simp]
theorem sInter_empty : ⋂₀ (∅ : ZFSet) = ∅


theorem range_add (a b : ℕ) : range (a + b) = range a + (range b).map (a + ·)

Multiset.range (a + b) = Multiset.range a + Multiset.map (fun x => a + x) (Multiset.range b)


/-- Finite product of finite sets is finite -/
theorem Finite.pi (ht : ∀ i, (t i).Finite) : (pi univ t).Finite

{ι : Type u_1}
[Finite ι]
{κ : ι → Type u_2}
{t : (i : ι) → Set (κ i)}
(ht : ∀ (i : ι), (t i).Finite)


/-- Two nonzero vectors go to the same point in projective space if and only if one is
a scalar multiple of the other. -/
theorem mk_eq_mk_iff' (v w : V) (hv : v ≠ 0) (hw : w ≠ 0) :
    mk K v hv = mk K w hw ↔ ∃ a : K, a • w = v

(K : Type u_1)
{V : Type u_2}
[DivisionRing K]
[AddCommGroup V]
[Module K V]
(v w : V)
(hv : v ≠ 0)
(hw : w ≠ 0)

Projectivization.mk K v hv = Projectivization.mk K w hw ↔ ∃ a, a • w = v


theorem equivRealProd_apply_le (z : ℂ) : ‖equivRealProd z‖ ≤ abs z

‖Complex.equivRealProd z‖ ≤ Complex.abs z


@[simp] lemma card_piDiag (s : Finset α) (ι : Type*) [DecidableEq (ι → α)] [Nonempty ι] :
    (s.piDiag ι).card = s.card

{α : Type u_1}
(s : Finset α)
(ι : Type u_3)
[DecidableEq (ι → α)]
[Nonempty ι]


/-- This lemma is a special case of `rightInvOn_invFunOn.image_image'`; it may make more sense
to use the other lemma directly in an application. -/
theorem SurjOn.image_invFunOn_image_of_subset [Nonempty α] {r : Set β} (hf : SurjOn f s t)
    (hrt : r ⊆ t) : f '' (f.invFunOn s '' r) = r

{α : Type u_1}
{β : Type u_2}
{s : Set α}
{t : Set β}
{f : α → β}
[Nonempty α]
{r : Set β}
(hf : Set.SurjOn f s t)
(hrt : r ⊆ t)


/-- A special case of `Finset.inf_eq_iInf` that omits the useless `x ∈ univ` binder. -/
theorem inf_univ_eq_iInf [CompleteLattice β] (f : α → β) : Finset.univ.inf f = iInf f

{α : Type u_2}
{β : Type u_3}
[Fintype α]
[CompleteLattice β]
(f : α → β)


@[simp]
theorem erase_add (a : α) (f f' : α →₀ M) : erase a (f + f') = erase a f + erase a f'

{α : Type u_1}
{M : Type u_5}
[AddZeroClass M]
(a : α)
(f f' : α →₀ M)

Finsupp.erase a (f + f') = Finsupp.erase a f + Finsupp.erase a f'


@[simp]
theorem abs_dvd (a b : α) : |a| ∣ b ↔ a ∣ b

{α : Type u_1}
[Ring α]
[LinearOrder α]
(a b : α)


theorem prod_map_pre_app_comp_ev (f : B ⟶ A) [Exponentiable B] (X : C) :
    Limits.prod.map (𝟙 B) ((pre f).app X) ≫ (exp.ev B).app X =
      Limits.prod.map f (𝟙 (A ⟹ X)) ≫ (exp.ev A).app X

CategoryTheory.CategoryStruct.comp
    (CategoryTheory.Limits.prod.map (CategoryTheory.CategoryStruct.id B) ((CategoryTheory.pre f).app X))
    ((CategoryTheory.exp.ev B).app X) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.Limits.prod.map f (CategoryTheory.CategoryStruct.id (A ⟹ X)))
    ((CategoryTheory.exp.ev A).app X)


theorem xgcdAux_rec {r s t r' s' t' : R} (h : r ≠ 0) :
    xgcdAux r s t r' s' t' = xgcdAux (r' % r) (s' - r' / r * s) (t' - r' / r * t) r s t

{R : Type u}
[EuclideanDomain R]
[DecidableEq R]
{r s t r' s' t' : R}
(h : r ≠ 0)

EuclideanDomain.xgcdAux r s t r' s' t' = EuclideanDomain.xgcdAux (r' % r) (s' - r' / r * s) (t' - r' / r * t) r s t


theorem lt_dioph : Dioph {v | f v < g v}

{α : Type}
{f g : (α → ℕ) → ℕ}
(df : Dioph.DiophFn f)
(dg : Dioph.DiophFn g)


@[simp]
theorem smul_toNNReal (a : ℝ≥0) (b : ℝ≥0∞) : (a • b).toNNReal = a * b.toNNReal


@[to_additive (attr := simp) abs_pos] lemma one_lt_mabs : 1 < |a|ₘ ↔ a ≠ 1

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


@[to_additive (attr := simp)]
theorem coe_map_inv (f : M →* N) (u : Mˣ) : ↑(map f u)⁻¹ = f ↑u⁻¹

{M : Type u}
{N : Type v}
[Monoid M]
[Monoid N]
(f : M →* N)
(u : Mˣ)


theorem deleteEdges_eq_inter_edgeSet (s : Set (Sym2 V)) :
    G.deleteEdges s = G.deleteEdges (s ∩ G.edgeSet)

{V : Type u}
{G : SimpleGraph V}
(s : Set (Sym2 V))


/-- `CliffordAlgebra.involute` as an `AlgEquiv`. -/
@[simps!]
def involuteEquiv : CliffordAlgebra Q ≃ₐ[R] CliffordAlgebra Q

{R : Type u_1}
[CommRing R]
{M : Type u_2}
[AddCommGroup M]
[Module R M]
{Q : QuadraticForm R M}
(a : CliffordAlgebra Q)

CliffordAlgebra.involuteEquiv.symm a = CliffordAlgebra.involute a


/-- (Impl)
Construct the limiting coalgebra from the map `λ : L ⟶ TL` given by `lambda`. We are required to
show it satisfies the two coalgebra laws, which follow from the coalgebra laws for the image of `D`
and our `commuting` lemma.
-/
@[simps]
def conePoint : Coalgebra T

{D : CategoryTheory.Functor J T.Coalgebra}

(c : CategoryTheory.Limits.Cone (D.comp T.forget))

[CategoryTheory.Limits.PreservesLimit (D.comp T.forget) T.toFunctor]

[CategoryTheory.Limits.PreservesLimit ((D.comp T.forget).comp T.toFunctor) T.toFunctor]

(CategoryTheory.Comonad.ForgetCreatesLimits'.conePoint c t).A = c.pt


/-- See `Infinite.exists_subset_card_eq` for a version that provides an arbitrary
`s : Finset α` for any cardinality. -/
theorem exists_superset_card_eq [Infinite α] (s : Finset α) (n : ℕ) (hn : s.card ≤ n) :
    ∃ t : Finset α, s ⊆ t ∧ t.card = n

{α : Type u_1}
[Infinite α]
(s : Finset α)
(n : ℕ)
(hn : s.card ≤ n)


/-- The discriminant of the power basis given by a primitive root of unity `ζ` is the same as the
discriminant of the power basis given by `ζ - 1`. -/
theorem discr_zeta_eq_discr_zeta_sub_one (hζ : IsPrimitiveRoot ζ n) :
    discr ℚ (hζ.powerBasis ℚ).basis = discr ℚ (hζ.subOnePowerBasis ℚ).basis

{n : ℕ+}
{K : Type u}
[Field K]
[CharZero K]
{ζ : K}
[ce : IsCyclotomicExtension {n} ℚ K]
(hζ : IsPrimitiveRoot ζ ↑n)

Algebra.discr ℚ ⇑(IsPrimitiveRoot.powerBasis ℚ hζ).basis =
  Algebra.discr ℚ ⇑(IsPrimitiveRoot.subOnePowerBasis ℚ hζ).basis


theorem diag_sub_val {n} {α : TypeVec.{u} n} : subtypeVal (repeatEq α) ⊚ diagSub = prod.diag

TypeVec.comp (TypeVec.subtypeVal α.repeatEq) TypeVec.diagSub = TypeVec.prod.diag


/--
If `s ⊆ fixedBy α g`, then `g • s = s`, which means that `s ∈ fixedBy (Set α) g`.

Note that the reverse implication is in general not true, as `s ∈ fixedBy (Set α) g` is a
weaker statement (it allows for points `x ∈ s` for which `g • x ≠ x` and `g • x ∈ s`).
-/
@[to_additive "If `s ⊆ fixedBy α g`, then `g +ᵥ s = s`, which means that `s ∈ fixedBy (Set α) g`.

Note that the reverse implication is in general not true, as `s ∈ fixedBy (Set α) g` is a
weaker statement (it allows for points `x ∈ s` for which `g +ᵥ x ≠ x` and `g +ᵥ x ∈ s`)."]
theorem set_mem_fixedBy_of_subset_fixedBy {s : Set α} {g : G} (s_ss_fixedBy : s ⊆ fixedBy α g) :
    s ∈ fixedBy (Set α) g

(s_ss_fixedBy : s ⊆ AddAction.fixedBy α g)


lemma isOrderBornology_iff_eq_orderBornology [Lattice α] [Nonempty α] :
    IsOrderBornology α ↔ ‹Bornology α› = orderBornology

{α : Type u_1}
[Bornology α]
[Lattice α]
[Nonempty α]

IsOrderBornology α ↔ inst✝ = orderBornology


@[simp]
protected theorem deriv.star' : (deriv fun y => star (f y)) = fun x => star (deriv f x)

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : 𝕜 → F}
[StarRing 𝕜]
[TrivialStar 𝕜]
[StarAddMonoid F]
[ContinuousStar F]
[StarModule 𝕜 F]


@[simp]
theorem biUnion_Ioc_eq_Ioi_self_iff {p : ι → Prop} {f : ∀ i, p i → α} {a : α} :
    ⋃ (i) (hi : p i), Ioc a (f i hi) = Ioi a ↔ ∀ x, a < x → ∃ i hi, x ≤ f i hi

{ι : Sort u}
{α : Type v}
[LinearOrder α]
{p : ι → Prop}
{f : (i : ι) → p i → α}
{a : α}

⋃ i, ⋃ (hi : p i), Set.Ioc a (f i hi) = Set.Ioi a ↔ ∀ (x : α), a < x → ∃ i, ∃ (hi : p i), x ≤ f i hi


@[simp]
theorem subtypeOrEquiv_symm_inl (p q : α → Prop) [DecidablePred p] (h : Disjoint p q)
    (x : { x // p x }) : (subtypeOrEquiv p q h).symm (Sum.inl x) = ⟨x, Or.inl x.prop⟩

{α : Type u_1}
(p q : α → Prop)
[DecidablePred p]
(h : Disjoint p q)
(x : { x // p x })

(subtypeOrEquiv p q h).symm (Sum.inl x) = ⟨↑x, ⋯⟩


/-- The unit `1 - r⁻¹ • a` constructed from `r • 1 - a` when the latter is a unit. -/
@[simps]
noncomputable def IsUnit.subInvSMul {r : Rˣ} {s : R} {a : A} (h : IsUnit <| r • ↑ₐ s - a) : Aˣ

(h : IsUnit (r • (algebraMap R A) s - a))

↑h.subInvSMul = (algebraMap R A) s - r⁻¹ • a


theorem trace_fin_three (A : Matrix (Fin 3) (Fin 3) R) : trace A = A 0 0 + A 1 1 + A 2 2

{R : Type u_6}
[AddCommMonoid R]
(A : Matrix (Fin 3) (Fin 3) R)


@[simp]
theorem equiv_apply {X : C} {P : Cᵒᵖ ⥤ D} {S : J.Cover X} [HasMultiequalizer (S.index P)]
    (x : (multiequalizer (S.index P) : D)) (I : S.Arrow) :
    equiv P S x I = Multiequalizer.ι (S.index P) I x

{J : CategoryTheory.GrothendieckTopology C}

[CategoryTheory.Category.{max v u, w} D]

(x : (CategoryTheory.forget D).obj (CategoryTheory.Limits.multiequalizer (S.index P)))

↑((CategoryTheory.Meq.equiv P S) x) I = (CategoryTheory.Limits.Multiequalizer.ι (S.index P) I) x


/-- Given a bifunctor `F : C₁ ⥤ C₂ ⥤ C₃` and a map `p : I × J → K`, this is the
functor `GradedObject I C₁ ⥤ GradedObject J C₂ ⥤ GradedObject K C₃` sending
`X : GradedObject I C₁` and `Y : GradedObject J C₂` to the `K`-graded object sending
`k` to the coproduct of `(F.obj (X i)).obj (Y j)` for `p ⟨i, j⟩ = k`. -/
@[simps]
noncomputable def mapBifunctorMap [∀ X Y, HasMap (((mapBifunctor F I J).obj X).obj Y) p] :
    GradedObject I C₁ ⥤ GradedObject J C₂ ⥤ GradedObject K C₃

(F : CategoryTheory.Functor C₁ (CategoryTheory.Functor C₂ C₃))

[∀ (X : CategoryTheory.GradedObject I C₁) (Y : CategoryTheory.GradedObject J C₂),
    (((CategoryTheory.GradedObject.mapBifunctor F I J).obj X).obj Y).HasMap p]

∀ {X_1 Y : CategoryTheory.GradedObject J C₂} (ψ : X_1 ⟶ Y) (i : K),
  ((CategoryTheory.GradedObject.mapBifunctorMap F p).obj X).map ψ i =
    CategoryTheory.GradedObject.mapBifunctorMapMap F p (CategoryTheory.CategoryStruct.id X) ψ i


theorem IsInternal.collectedBasis_repr_of_mem (h : IsInternal A) {α : ι → Type*}
    (v : ∀ i, Basis (α i) R (A i)) {x : M} {i : ι} {a : α i} (hx : x ∈ A i) :
    (h.collectedBasis v).repr x ⟨i, a⟩ = (v i).repr ⟨x, hx⟩ a

{R : Type u}
[Semiring R]
{ι : Type v}
[dec_ι : DecidableEq ι]
{M : Type u_1}
[AddCommMonoid M]
[Module R M]
{A : ι → Submodule R M}
(h : DirectSum.IsInternal A)
{α : ι → Type u_2}
(v : (i : ι) → Basis (α i) R ↥(A i))
{x : M}
{i : ι}
{a : α i}
(hx : x ∈ A i)

((h.collectedBasis v).repr x) ⟨i, a⟩ = ((v i).repr ⟨x, hx⟩) a


lemma sq_sub_sq (a b : ℕ) : a ^ 2 - b ^ 2 = (a + b) * (a - b)


theorem Monic.map [Semiring S] (f : R →+* S) (hp : Monic p) : Monic (p.map f)

{R : Type u}
{S : Type v}
[Semiring R]
{p : R[X]}
[Semiring S]
(f : R →+* S)
(hp : p.Monic)


@[to_additive (attr := simp, norm_cast)]
theorem max_val [Monoid α] [LinearOrder α] {a b : αˣ} : (max a b).val = max a.val b.val

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


theorem le_iff_lt_or_eq {a b : α} : a ≤ b ↔ a < b ∨ a = b

{α : Type u}
[PartialOrder α]
[DecidableRel fun x x_1 => x ≤ x_1]
{a b : α}


theorem wcovBy_iff_covBy_or_le_and_le : a ⩿ b ↔ a ⋖ b ∨ a ≤ b ∧ b ≤ a


@[to_additive sum_eq_card_nsmul]
theorem prod_eq_pow_card {b : β} (hf : ∀ a ∈ s, f a = b) : ∏ a ∈ s, f a = b ^ s.card

{α : Type u_3}
{β : Type u_4}
{s : Finset α}
{f : α → β}
[AddCommMonoid β]
{b : β}
(hf : ∀ a ∈ s, f a = b)


/-- For `d ∣ n`, the totient of `n/d` equals the number of values `k < n` such that `gcd n k = d` -/
theorem totient_div_of_dvd {n d : ℕ} (hnd : d ∣ n) :
    φ (n / d) = (filter (fun k : ℕ => n.gcd k = d) (range n)).card

(n / d).totient = (Finset.filter (fun k => n.gcd k = d) (Finset.range n)).card


lemma mem_shadow_iterate_iff_exists_card :
    t ∈ ∂^[k] 𝒜 ↔ ∃ u : Finset α, u.card = k ∧ Disjoint t u ∧ t ∪ u ∈ 𝒜

{α : Type u_1}
[DecidableEq α]
{𝒜 : Finset (Finset α)}
{t : Finset α}
{k : ℕ}

t ∈ Finset.shadow^[k] 𝒜 ↔ ∃ u, u.card = k ∧ Disjoint t u ∧ t ∪ u ∈ 𝒜


/--
The composition of the isomorphism `pullbackSepcIso R S T` (from the pullback of
`Spec S ⟶ Spec R` and `Spec T ⟶ Spec R` to `Spec (S ⊗[R] T)`) with the morphism
`Spec (S ⊗[R] T) ⟶ Spec T` obtained by applying `Spec.map` to the ring morphism `t ↦ 1 ⊗ₜ[R] t`
is the second projection.
-/
@[reassoc (attr := simp)]
lemma pullbackSpecIso_hom_snd :
    (pullbackSpecIso R S T).hom ≫ Spec.map (ofHom (toRingHom includeRight)) = pullback.snd _ _

(R S T : Type u)
[CommRing R]
[CommRing S]
[CommRing T]
[Algebra R S]
[Algebra R T]

(AlgebraicGeometry.pullbackSpecIso R S T).hom ≫
    AlgebraicGeometry.Spec.map (CommRingCat.ofHom ↑Algebra.TensorProduct.includeRight) =
  CategoryTheory.Limits.pullback.snd (AlgebraicGeometry.Spec.map (CommRingCat.ofHom (algebraMap R S)))
    (AlgebraicGeometry.Spec.map (CommRingCat.ofHom (algebraMap R T)))


theorem norm_sub_modPart (h : ‖(r : ℚ_[p])‖ ≤ 1) : ‖(⟨r, h⟩ - modPart p r : ℤ_[p])‖ < 1

{p : ℕ}
[hp_prime : Fact (Nat.Prime p)]
(r : ℚ)
(h : ‖↑r‖ ≤ 1)


@[simp]
theorem leadingCoeffHom_apply (p : R[X]) : leadingCoeffHom p = leadingCoeff p

{R : Type u}
[Semiring R]
[NoZeroDivisors R]
(p : R[X])

Polynomial.leadingCoeffHom p = p.leadingCoeff


theorem Subset.antisymm_iff {a b : Set α} : a = b ↔ a ⊆ b ∧ b ⊆ a


@[simp]
protected theorem eq'' {a b : α} : @Quotient.mk'' α s₁ a = Quotient.mk'' b ↔ @Setoid.r _ s₁ a b

{α : Sort u_1}
{s₁ : Setoid α}
{a b : α}

Quotient.mk'' a = Quotient.mk'' b ↔ Setoid.r a b


protected theorem mapsTo (h : e.IsImage s t) : MapsTo e (e.source ∩ s) (e.target ∩ t)

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

Set.MapsTo (↑e) (e.source ∩ s) (e.target ∩ t)


/-- A closed subset of a σ-compact set is σ-compact. -/
lemma IsSigmaCompact.of_isClosed_subset {s t : Set X} (ht : IsSigmaCompact t)
    (hs : IsClosed s) (h : s ⊆ t) : IsSigmaCompact s

{X : Type u_1}
[TopologicalSpace X]
{s t : Set X}
(ht : IsSigmaCompact t)
(hs : IsClosed s)
(h : s ⊆ t)


/-- The converse is true if `J` is filtered, see `finallySmall_of_small_weakly_terminal_set`. -/
theorem FinallySmall.exists_small_weakly_terminal_set [FinallySmall.{w} J] :
    ∃ (s : Set J) (_ : Small.{w} s), ∀ i, ∃ j ∈ s, Nonempty (i ⟶ j)

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

∃ s, ∃ (_ : Small.{w, u} ↑s), ∀ (i : J), ∃ j ∈ s, Nonempty (i ⟶ j)


theorem exists_vector_succ (f : Vector3 α (succ n) → Prop) : Exists f ↔ ∃ x v, f (x :: v)

{α : Type u_1}
{n : ℕ}
(f : Vector3 α n.succ → Prop)


/-- The distinguished element in `Splitting.IndexSet Δ` which corresponds to the
identity of `Δ`. -/
@[simps]
def id : IndexSet Δ

↑(SimplicialObject.Splitting.IndexSet.id Δ).snd = 𝟙 (Opposite.unop Δ)


theorem mul_self_den (q : ℚ) : (q * q).den = q.den * q.den


theorem separable_map {S} [CommRing S] [Nontrivial S] (f : F →+* S) {p : F[X]} :
    (p.map f).Separable ↔ p.Separable

{F : Type u}
[Field F]
{S : Type u_1}
[CommRing S]
[Nontrivial S]
(f : F →+* S)
{p : F[X]}

(Polynomial.map f p).Separable ↔ p.Separable


@[to_additive]
theorem mul_comp [Mul M] [Mul N] [CommSemigroup P] (g₁ g₂ : N →ₙ* P) (f : M →ₙ* N) :
    (g₁ * g₂).comp f = g₁.comp f * g₂.comp f

{M : Type u_3}
{N : Type u_4}
{P : Type u_5}
[Mul M]
[Mul N]
[CommSemigroup P]
(g₁ g₂ : N →ₙ* P)
(f : M →ₙ* N)


@[simp]
theorem coe_prodComm : ⇑(prodComm X Y) = Prod.swap

(X : Type u_1)
(Y : Type u_2)
[TopologicalSpace X]
[TopologicalSpace Y]


@[simp]
theorem comap_exp_nhds_exp (x : ℝ) : comap exp (𝓝 (exp x)) = 𝓝 x

Filter.comap Real.exp (𝓝 (Real.exp x)) = 𝓝 x


@[reassoc]
theorem inv_prodComparison_map_snd [IsIso (prodComparison F A B)] :
    inv (prodComparison F A B) ≫ F.map prod.snd = prod.snd

[CategoryTheory.Limits.HasBinaryProduct (F.obj A) (F.obj B)]

[CategoryTheory.IsIso (CategoryTheory.Limits.prodComparison F A B)]

CategoryTheory.inv (CategoryTheory.Limits.prodComparison F A B) ≫ F.map CategoryTheory.Limits.prod.snd =
  CategoryTheory.Limits.prod.snd


theorem Subpresheaf.sheafify_isSheaf (hF : Presieve.IsSheaf J F) :
    Presieve.IsSheaf J (G.sheafify J).toPresheaf

{J : CategoryTheory.GrothendieckTopology C}

(G : CategoryTheory.GrothendieckTopology.Subpresheaf F)

(hF : CategoryTheory.Presieve.IsSheaf J F)

CategoryTheory.Presieve.IsSheaf J (CategoryTheory.GrothendieckTopology.Subpresheaf.sheafify J G).toPresheaf


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

(hZ : CategoryTheory.Limits.IsTerminal Z)

(CategoryTheory.WithTerminal.liftToTerminal F hZ).map f =
  match X, Y, f with
  | CategoryTheory.WithTerminal.of x, CategoryTheory.WithTerminal.of y, f => F.map (CategoryTheory.WithTerminal.down f)
  | CategoryTheory.WithTerminal.of x, CategoryTheory.WithTerminal.star, x_1 => hZ.from (F.obj x)
  | CategoryTheory.WithTerminal.star, CategoryTheory.WithTerminal.star, x => CategoryTheory.CategoryStruct.id Z


theorem isUnit_of_associated_mul [CancelCommMonoidWithZero α] {p b : α} (h : Associated (p * b) p)
    (hp : p ≠ 0) : IsUnit b

{α : Type u_1}
[CancelCommMonoidWithZero α]
{p b : α}
(h : p * b ~ᵤ p)
(hp : p ≠ 0)


theorem Nodup.diff_eq_filter [DecidableEq α] :
    ∀ {l₁ l₂ : List α} (_ : l₁.Nodup), l₁.diff l₂ = l₁.filter (· ∉ l₂)

{α : Type u}
[DecidableEq α]
{l₁ l₂ : List α}

l₁.Nodup → l₁.diff l₂ = List.filter (fun x => decide (x ∉ l₂)) l₁


@[simp] theorem headD_eq_head? (l) (a : α) : headD l a = (head? l).getD a


/-- `Prop` structure holding the hypotheses of the Picard-Lindelöf theorem.

The similarly named `PicardLindelof` structure is part of the internal API for convenience, so as
not to constantly invoke choice, but is not intended for public use. -/
structure IsPicardLindelof {E : Type*} [NormedAddCommGroup E] (v : ℝ → E → E) (tMin t₀ tMax : ℝ)
    (x₀ : E) (L : ℝ≥0) (R C : ℝ) : Prop where
  ht₀ : t₀ ∈ Icc tMin tMax
  hR : 0 ≤ R
  lipschitz : ∀ t ∈ Icc tMin tMax, LipschitzOnWith L (v t) (closedBall x₀ R)
  cont : ∀ x ∈ closedBall x₀ R, ContinuousOn (fun t : ℝ => v t x) (Icc tMin tMax)
  norm_le : ∀ t ∈ Icc tMin tMax, ∀ x ∈ closedBall x₀ R, ‖v t x‖ ≤ C
  C_mul_le_R : (C : ℝ) * max (tMax - t₀) (t₀ - tMin) ≤ R

(self : IsPicardLindelof v tMin t₀ tMax x₀ L R C)

t ∈ Set.Icc tMin tMax → LipschitzOnWith L (v t) (Metric.closedBall x₀ R)


/-- Alias of `Nat.cast_eq_zero`, specialized to `Ordinal` --/
theorem natCast_eq_zero {n : ℕ} : (n : Ordinal) = 0 ↔ n = 0


protected theorem TendstoUniformlyOn.tendstoLocallyUniformlyOn (h : TendstoUniformlyOn F f p s) :
    TendstoLocallyUniformlyOn F f p s

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


@[aesop safe apply] lemma T_pos (n : ℕ) : 0 < T n

{α : Type u_1}
[Fintype α]
[Nonempty α]
{T : ℕ → ℝ}
{g : ℝ → ℝ}
{a b : α → ℝ}
{r : α → ℕ → ℕ}
(R : AkraBazziRecurrence T g a b r)
(n : ℕ)


/-- Binary strict **rearrangement inequality**. -/
lemma mul_add_mul_lt_mul_add_mul [ExistsAddOfLE α] [MulPosStrictMono α]
    [CovariantClass α α (· + ·) (· < ·)] [ContravariantClass α α (· + ·) (· < ·)]
    (hab : a < b) (hcd : c < d) : a * d + b * c < a * c + b * d

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

[ContravariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x < x_1]


@[simp]
theorem coe_incl' : ⇑L'.incl' = ((↑) : L' → L)

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


theorem mem_sublistsLen_self {l l' : List α} (h : l' <+ l) :
    l' ∈ sublistsLen (length l') l

{α : Type u}
{l l' : List α}
(h : l'.Sublist l)


theorem HasFDerivAt.hasDerivAt {f' : 𝕜 →L[𝕜] F} : HasFDerivAt f f' x → HasDerivAt f (f' 1) x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : 𝕜 → F}
{x : 𝕜}
{f' : 𝕜 →L[𝕜] F}


@[simp]
theorem foldr_singleton (f : α → β → β) (H b a) : foldr f H b ({a} : Multiset α) = f a b

{α : Type u_1}
{β : Type v}
(f : α → β → β)
(H : LeftCommutative f)
(b : β)
(a : α)


@[simp]
theorem rid_symm_apply (m : M) : (AlgebraTensorModule.rid R A M).symm m = m ⊗ₜ 1

(R : Type uR)
(A : Type uA)
{M : Type uM}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[AddCommMonoid M]
[Module R M]
[Module A M]
[IsScalarTower R A M]
(m : M)

(TensorProduct.AlgebraTensorModule.rid R A M).symm m = m ⊗ₜ[R] 1


theorem isLeast_pair [LinearOrder γ] {a b : γ} : IsLeast {a, b} (min a b)


theorem arg_coe_angle_eq_iff_eq_toReal {z : ℂ} {θ : Real.Angle} :
    (arg z : Real.Angle) = θ ↔ arg z = θ.toReal


@[simp] theorem forIn_cons [Monad m] (f : α → β → m (ForInStep β)) (a : α) (as : List α) (b : β)
    : forIn (a::as) b f = f a b >>= fun | ForInStep.done b => pure b | ForInStep.yield b => forIn as b f

{m : Type u_1 → Type u_2}
{α : Type u_3}
{β : Type u_1}
[Monad m]
(f : α → β → m (ForInStep β))
(a : α)
(as : List α)
(b : β)

forIn (a :: as) b f = do
  let x ← f a b
  match x with
    | ForInStep.done b => pure b
    | ForInStep.yield b => forIn as b f


theorem setOf_pow_dvd_eq_Icc_factorization {n p : ℕ} (pp : p.Prime) (hn : n ≠ 0) :
    { i : ℕ | i ≠ 0 ∧ p ^ i ∣ n } = Set.Icc 1 (n.factorization p)

{n p : ℕ}
(pp : Nat.Prime p)
(hn : n ≠ 0)

{i | i ≠ 0 ∧ p ^ i ∣ n} = Set.Icc 1 (n.factorization p)


@[to_additive]
theorem Step.cons_left_iff {a : α} {b : Bool} :
    Step ((a, b) :: L₁) L₂ ↔ (∃ L, Step L₁ L ∧ L₂ = (a, b) :: L) ∨ L₁ = (a, ! b) :: L₂

{α : Type u}
{L₁ L₂ : List (α × Bool)}
{a : α}
{b : Bool}

FreeAddGroup.Red.Step ((a, b) :: L₁) L₂ ↔ (∃ L, FreeAddGroup.Red.Step L₁ L ∧ L₂ = (a, b) :: L) ∨ L₁ = (a, !b) :: L₂


/--
Consider the contravariant functors between compact Hausdorff spaces and commutative unital
C⋆algebras `F : Cpct → CommCStarAlg := X ↦ C(X, ℂ)` and
`G : CommCStarAlg → Cpct := A → characterSpace ℂ A` whose actions on morphisms are given by
`WeakDual.CharacterSpace.compContinuousMap` and `ContinuousMap.compStarAlgHom'`, respectively.

Then `η : id → F ∘ G := gelfandStarTransform` is a natural isomorphism implementing (half of)
the duality between these categories. That is, for commutative unital C⋆-algebras `A` and `B` and
`φ : A →⋆ₐ[ℂ] B` the following diagram commutes:

```
A  --- η A ---> C(characterSpace ℂ A, ℂ)

|                     |

φ                  (F ∘ G) φ

|                     |
V                     V

B  --- η B ---> C(characterSpace ℂ B, ℂ)
```
-/
theorem gelfandStarTransform_naturality {A B : Type*} [NormedCommRing A] [NormedAlgebra ℂ A]
    [CompleteSpace A] [StarRing A] [CstarRing A] [StarModule ℂ A] [NormedCommRing B]
    [NormedAlgebra ℂ B] [CompleteSpace B] [StarRing B] [CstarRing B] [StarModule ℂ B]
    (φ : A →⋆ₐ[ℂ] B) :
    (gelfandStarTransform B : _ →⋆ₐ[ℂ] _).comp φ =
      (compContinuousMap φ |>.compStarAlgHom' ℂ ℂ).comp (gelfandStarTransform A : _ →⋆ₐ[ℂ] _)

{A : Type u_1}
{B : Type u_2}
[NormedCommRing A]
[NormedAlgebra ℂ A]
[CompleteSpace A]
[StarRing A]
[CstarRing A]
[StarModule ℂ A]
[NormedCommRing B]
[NormedAlgebra ℂ B]
[CompleteSpace B]
[StarRing B]
[CstarRing B]
[StarModule ℂ B]
(φ : A →⋆ₐ[ℂ] B)

(↑(gelfandStarTransform B)).comp φ =
  (ContinuousMap.compStarAlgHom' ℂ ℂ (WeakDual.CharacterSpace.compContinuousMap φ)).comp ↑(gelfandStarTransform A)


@[simp]
theorem lookupFinsupp_support [DecidableEq α] [DecidableEq M] (l : AList fun _x : α => M) :
    l.lookupFinsupp.support = (l.1.filter fun x => Sigma.snd x ≠ 0).keys.toFinset

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

l.lookupFinsupp.support = (List.filter (fun x => decide (x.snd ≠ 0)) l.entries).keys.toFinset


theorem equivalenceUnitIso_eq (hε : υ hF = ε) :
    (equivalence hF hG).unitIso = equivalenceUnitIso hG ε

{hG : eB.functor ⋙ e'.inverse ≅ G ⋙ eA.functor}

(hε : AlgebraicTopology.DoldKan.Compatibility.υ hF = ε)

(AlgebraicTopology.DoldKan.Compatibility.equivalence hF hG).unitIso =
  AlgebraicTopology.DoldKan.Compatibility.equivalenceUnitIso hG ε


theorem Ici_inter_Iio : Ici a ∩ Iio b = Ico a b


lemma Basis.map {X : Set α} (hIX : M.Basis I X) {f : α → β} (hf) :
    (M.map f hf).Basis (f '' I) (f '' X)

{α : Type u_1}
{β : Type u_2}
{I : Set α}
{M : Matroid α}
{X : Set α}
(hIX : M.Basis I X)
{f : α → β}
(hf : Set.InjOn f M.E)


lemma closure_biInter_eq_biInter_closure_of_biUnion_indep {ι : Type*} {A : Set ι} (hA : A.Nonempty)
    {I : ι → Set α} (h : M.Indep (⋃ i ∈ A, I i)) :
    M.closure (⋂ i ∈ A, I i) = ⋂ i ∈ A, M.closure (I i)

{α : Type u_2}
{M : Matroid α}
{ι : Type u_4}
{A : Set ι}
(hA : A.Nonempty)
{I : ι → Set α}
(h : M.Indep (⋃ i ∈ A, I i))


/-- Two affine maps from a Pi-tyoe of modules `(i : ι) → φv i` are equal if they are equal in their
  operation on `Pi.single` and `ι` is nonempty.  Analogous to `LinearMap.pi_ext`. See also
  `pi_ext_zero`, which instead `Nonempty ι` requires agreement at 0.-/
theorem pi_ext_nonempty [Nonempty ι] (h : ∀ i x, f (Pi.single i x) = g (Pi.single i x)) :
    f = g

(h : ∀ (i : ι) (x : φv i), f (Pi.single i x) = g (Pi.single i x))


/-- Given an open cover `{ Xᵢ }` of `X`, then `X ×[Z] Y` is covered by `Xᵢ ×[Z] Y`. -/
@[simps! J obj map]
def openCoverOfLeft (𝒰 : OpenCover X) (f : X ⟶ Z) (g : Y ⟶ Z) : OpenCover (pullback f g)

{X Y Z : AlgebraicGeometry.Scheme}
(𝒰 : X.OpenCover)
(f : X ⟶ Z)
(g : Y ⟶ Z)
(i : 𝒰.J)

(AlgebraicGeometry.Scheme.Pullback.openCoverOfLeft 𝒰 f g).map i =
  CategoryTheory.Limits.pullback.map (𝒰.map i ≫ f) g f g (𝒰.map i) (𝟙 Y) (𝟙 Z) ⋯ ⋯


/-- The difference of two additive group homomorphisms is an additive group
homomorphism if the target is commutative. -/
theorem IsAddGroupHom.sub {α β} [AddGroup α] [AddCommGroup β] {f g : α → β} (hf : IsAddGroupHom f)
    (hg : IsAddGroupHom g) : IsAddGroupHom fun a => f a - g a

{α : Type u_1}
{β : Type u_2}
[AddGroup α]
[AddCommGroup β]
{f g : α → β}
(hf : IsAddGroupHom f)
(hg : IsAddGroupHom g)


@[simp, norm_cast]
theorem coe_sup (a b : Complementeds α) : ↑(a ⊔ b) = (a : α) ⊔ b

{α : Type u_1}
[DistribLattice α]
[BoundedOrder α]
(a b : Complementeds α)


@[simp]
theorem ring_inverse_equiv (e : M ≃L[R] M) : Ring.inverse ↑e = inverse (e : M →L[R] M)

{R : Type u_1}
{M : Type u_2}
[TopologicalSpace M]
[Ring R]
[AddCommGroup M]
[Module R M]
(e : M ≃L[R] M)


theorem iSup_mono' {g : ι' → α} (h : ∀ i, ∃ i', f i ≤ g i') : iSup f ≤ iSup g

{α : Type u_1}
{ι : Sort u_5}
{ι' : Sort u_6}
[CompleteLattice α]
{f : ι → α}
{g : ι' → α}
(h : ∀ (i : ι), ∃ i', f i ≤ g i')


@[simp]
theorem _root_.LinearIsometry.angle_map {E F : Type*} [NormedAddCommGroup E] [NormedAddCommGroup F]
    [InnerProductSpace ℝ E] [InnerProductSpace ℝ F] (f : E →ₗᵢ[ℝ] F) (u v : E) :
    angle (f u) (f v) = angle u v

{E : Type u_2}
{F : Type u_3}
[NormedAddCommGroup E]
[NormedAddCommGroup F]
[InnerProductSpace ℝ E]
[InnerProductSpace ℝ F]
(f : E →ₗᵢ[ℝ] F)
(u v : E)

InnerProductGeometry.angle (f u) (f v) = InnerProductGeometry.angle u v


@[simp]
theorem blockDiag_one [DecidableEq o] [DecidableEq m] [One α] :
    blockDiag (1 : Matrix (m × o) (m × o) α) = 1

{m : Type u_2}
{o : Type u_4}
{α : Type u_12}
[Zero α]
[DecidableEq o]
[DecidableEq m]
[One α]


/-- A oplax monoidal functor takes comonoid objects to comonoid objects.

That is, a oplax monoidal functor `F : C ⥤ D` induces a functor `Comon_ C ⥤ Comon_ D`.
-/
@[simps]
def mapComon (F : OplaxMonoidalFunctor C D) : Comon_ C ⥤ Comon_ D

(F : CategoryTheory.OplaxMonoidalFunctor C D)

(F.mapComon.obj A).comul = F.map A.comul ≫ F.δ A.X A.X


theorem irreducible_X_sub_C (r : R) : Irreducible (X - C r)

{R : Type u}
[CommRing R]
[IsDomain R]
(r : R)

Irreducible (Polynomial.X - Polynomial.C r)


theorem subset_convexJoin_right (h : s.Nonempty) : t ⊆ convexJoin 𝕜 s t

{𝕜 : Type u_2}
{E : Type u_3}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[Module 𝕜 E]
{s t : Set E}
(h : s.Nonempty)


theorem Lattice.ext {α} {A B : Lattice α} (H : ∀ x y : α, (haveI := A; x ≤ y) ↔ x ≤ y) :
    A = B

{α : Type u_1}
{A B : Lattice α}
(H : ∀ (x y : α), x ≤ y ↔ x ≤ y)


/-- The derivative of the L-series of `f` agrees with the negative of the L-series of
`log * f` on the right half-plane of absolute convergence. -/
lemma LSeries_deriv_eqOn {f : ℕ → ℂ} :
    {s | abscissaOfAbsConv f < s.re}.EqOn (deriv (LSeries f)) (- LSeries (logMul f))

Set.EqOn (deriv (LSeries f)) (-LSeries (LSeries.logMul f)) {s | LSeries.abscissaOfAbsConv f < ↑s.re}


/-- If `R` preserves the appropriate limit, then given a cone for `F ⋙ fst L R : J ⥤ L` and a
limit cone for `F ⋙ snd L R : J ⥤ R` we can build a cone for `F` which will turn out to be a limit
cone.
-/
@[simps]
def coneOfPreserves [PreservesLimit (F ⋙ snd L R) R] (c₁ : Cone (F ⋙ fst L R))
    {c₂ : Cone (F ⋙ snd L R)} (t₂ : IsLimit c₂) : Cone F

(F : CategoryTheory.Functor J (CategoryTheory.Comma L R))

[CategoryTheory.Limits.PreservesLimit (F.comp (CategoryTheory.Comma.snd L R)) R]

(c₁ : CategoryTheory.Limits.Cone (F.comp (CategoryTheory.Comma.fst L R)))

{c₂ : CategoryTheory.Limits.Cone (F.comp (CategoryTheory.Comma.snd L R))}

((CategoryTheory.Comma.coneOfPreserves F c₁ t₂).π.app j).left = c₁.π.app j


theorem enum_append (xs ys : List α) : enum (xs ++ ys) = enum xs ++ enumFrom xs.length ys

(xs ++ ys).enum = xs.enum ++ List.enumFrom xs.length ys


theorem subset_zeroLocus_iff_subset_vanishingIdeal (t : Set (ProjectiveSpectrum 𝒜)) (s : Set A) :
    t ⊆ zeroLocus 𝒜 s ↔ s ⊆ vanishingIdeal t

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

t ⊆ ProjectiveSpectrum.zeroLocus 𝒜 s ↔ s ⊆ ↑(ProjectiveSpectrum.vanishingIdeal t)


@[simp] theorem exists_exists_exists_and_eq {α β γ : Type*}
    {f : α → β → γ} {p : γ → Prop} :
    (∃ c, (∃ a, ∃ b, f a b = c) ∧ p c) ↔ ∃ a, ∃ b, p (f a b)

{α : Type u_3}
{β : Type u_4}
{γ : Type u_5}
{f : α → β → γ}
{p : γ → Prop}

(∃ c, (∃ a b, f a b = c) ∧ p c) ↔ ∃ a b, p (f a b)


/-- If the coproducts `W ⨿ X` and `Y ⨿ Z` exist, then every pair of isomorphisms `f : W ≅ Y` and
   `g : W ≅ Z` induces an isomorphism `coprod.mapIso f g : W ⨿ X ≅ Y ⨿ Z`. -/
@[simps]
def coprod.mapIso {W X Y Z : C} [HasBinaryCoproduct W X] [HasBinaryCoproduct Y Z] (f : W ≅ Y)
    (g : X ≅ Z) : W ⨿ X ≅ Y ⨿ Z

(CategoryTheory.Limits.coprod.mapIso f g).inv = CategoryTheory.Limits.coprod.map f.inv g.inv


@[simp]
theorem num_neg_eq_neg_num (q : ℚ) : (-q).num = -q.num


@[simp] theorem testBit_zero (x : Nat) : testBit x 0 = decide (x % 2 = 1)


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

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


lemma Q_map_comp_Qinv {X Y Y' : C} (f : X ⟶ Y') (s : Y ⟶ Y') (hs : W s) :
    (Q W).map f ≫ Qinv s hs = homMk (mk f s hs)

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
{W : CategoryTheory.MorphismProperty C}
[W.HasLeftCalculusOfFractions]
{X Y Y' : C}
(f : X ⟶ Y')
(s : Y ⟶ Y')
(hs : W s)

CategoryTheory.CategoryStruct.comp ((CategoryTheory.MorphismProperty.LeftFraction.Localization.Q W).map f)
    (CategoryTheory.MorphismProperty.LeftFraction.Localization.Qinv s hs) =
  CategoryTheory.MorphismProperty.LeftFraction.Localization.homMk
    (CategoryTheory.MorphismProperty.LeftFraction.mk f s hs)


theorem sub.elim {motive : Nat → Prop}
    (x y : Nat)
    (h₁ : y ≤ x → (k : Nat) → x = y + k → motive k)
    (h₂ : x < y → motive 0)
    : motive (x - y)

(h₁ : y ≤ x → ∀ (k : Nat), x = y + k → motive k)


theorem Prod.associated_iff {M N : Type*} [Monoid M] [Monoid N] {x z : M × N} :
    x ~ᵤ z ↔ x.1 ~ᵤ z.1 ∧ x.2 ~ᵤ z.2

{M : Type u_5}
{N : Type u_6}
[Monoid M]
[Monoid N]
{x z : M × N}


/--
Given any adjunction `L ⊣ R`, there is a comparison functor `CategoryTheory.Comonad.comparison L`
sending objects `X : C` to Eilenberg-Moore coalgebras for `L ⋙ R` with underlying object
`L.obj X`.
-/
@[simps]
def Comonad.comparison (h : L ⊣ R) : C ⥤ h.toComonad.Coalgebra

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{L : CategoryTheory.Functor C D}
{R : CategoryTheory.Functor D C}
(h : L ⊣ R)
(X : C)

((CategoryTheory.Comonad.comparison h).obj X).a = L.map (h.unit.app X)


theorem not_injective_infinite_finite {α β} [Infinite α] [Finite β] (f : α → β) : ¬Injective f

{α : Sort u_4}
{β : Sort u_5}
[Infinite α]
[Finite β]
(f : α → β)


lemma nonsingular_add {P Q : Fin 3 → F} (hP : W.Nonsingular P) (hQ : W.Nonsingular Q) :
    W.Nonsingular <| W.add P Q

{F : Type v}
[Field F]
{W : WeierstrassCurve.Jacobian F}
{P Q : Fin 3 → F}
(hP : W.Nonsingular P)
(hQ : W.Nonsingular Q)


@[simp] lemma ofUpperSet_toUpperSet (a : α) : ofUpperSet (toUpperSet a) = a

Topology.WithUpperSet.ofUpperSet (Topology.WithUpperSet.toUpperSet a) = a


@[to_additive (attr := simp)]
theorem mul_right_iterate : (· * a)^[n] = (· * a ^ n)

{G : Type u_3}
[Monoid G]
(a : G)
(n : ℕ)

(fun x => x * a)^[n] = fun x => x * a ^ n


theorem inv_left₀ (h : Commute a b) : Commute a⁻¹ b

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


theorem Antitone.le_map_iInf [CompleteLattice β] {f : α → β} (hf : Antitone f) :
    ⨆ i, f (s i) ≤ f (iInf s)

{α : Type u_1}
{β : Type u_2}
{ι : Sort u_5}
[CompleteLattice α]
{s : ι → α}
[CompleteLattice β]
{f : α → β}
(hf : Antitone f)


theorem expand_bind₁ (p : ℕ) (f : σ → MvPolynomial τ R) (φ : MvPolynomial σ R) :
    expand p (bind₁ f φ) = bind₁ (fun i ↦ expand p (f i)) φ

{σ : Type u_1}
{τ : Type u_2}
{R : Type u_3}
[CommSemiring R]
(p : ℕ)
(f : σ → MvPolynomial τ R)
(φ : MvPolynomial σ R)

(MvPolynomial.expand p) ((MvPolynomial.bind₁ f) φ) = (MvPolynomial.bind₁ fun i => (MvPolynomial.expand p) (f i)) φ


theorem SatisfiesM_mapM [Monad m] [LawfulMonad m] (as : Array α) (f : α → m β)
    (motive : Nat → Prop) (h0 : motive 0)
    (p : Fin as.size → β → Prop)
    (hs : ∀ i, motive i.1 → SatisfiesM (p i · ∧ motive (i + 1)) (f as[i])) :
    SatisfiesM
      (fun arr => motive as.size ∧ ∃ eq : arr.size = as.size, ∀ i h, p ⟨i, h⟩ arr[i])
      (Array.mapM f as)

(hs : ∀ (i : Fin as.size), motive ↑i → SatisfiesM (fun x => p i x ∧ motive (↑i + 1)) (f as[i]))

SatisfiesM (fun arr => motive as.size ∧ ∃ eq, ∀ (i : Nat) (h : i < as.size), p ⟨i, h⟩ arr[i]) (Array.mapM f as)


@[simp]
theorem linearEquivFunOnFintype_symm_coe [Fintype ι] (f : ⨁ i, M i) :
    (linearEquivFunOnFintype R ι M).symm f = f

(R : Type u)
[Semiring R]
{ι : Type v}
{M : ι → Type w}
[(i : ι) → AddCommMonoid (M i)]
[(i : ι) → Module R (M i)]
[Fintype ι]
(f : DirectSum ι fun i => M i)

(DirectSum.linearEquivFunOnFintype R ι M).symm ⇑f = f


@[simp] protected theorem zero_div (b : Nat) : 0 / b = 0


theorem mem_inter {x : α} {a b : Set α} (ha : x ∈ a) (hb : x ∈ b) : x ∈ a ∩ b

{α : Type u}
{x : α}
{a b : Set α}
(ha : x ∈ a)
(hb : x ∈ b)


protected theorem not_lt {a b : Int} : ¬a < b ↔ b ≤ a


theorem Red.enum.sound (H : L₂ ∈ List.filter (Red L₁) (List.sublists L₁)) : Red L₁ L₂

(H : L₂ ∈ List.filter (fun b => decide (FreeGroup.Red L₁ b)) L₁.sublists)


theorem monotone_iff_map_nonpos : Monotone (f : α → β) ↔ ∀ a ≤ 0, f a ≤ 0

{F : Type u_1}
{α : Type u_2}
{β : Type u_3}
[OrderedAddCommGroup α]
[OrderedAddCommMonoid β]
[i : FunLike F α β]
(f : F)
[iamhc : AddMonoidHomClass F α β]

Monotone ⇑f ↔ ∀ (a : α), a ≤ 0 → f a ≤ 0


theorem Coprime.dvd_mul_right {m n k : ℕ} (H : Coprime k n) : k ∣ m * n ↔ k ∣ m


/-- If `α` is a linear pred order, `β` is a preorder, and `f : α → β` is a monotone function, then
the intervals `Set.Ioo (f Order.pred n) (f n)` are pairwise disjoint. -/
theorem pairwise_disjoint_on_Ioo_pred [PredOrder α] [Preorder β] {f : α → β} (hf : Monotone f) :
    Pairwise (Disjoint on fun n => Ioo (f (pred n)) (f n))

{α : Type u_1}
{β : Type u_2}
[LinearOrder α]
[PredOrder α]
[Preorder β]
{f : α → β}
(hf : Monotone f)

Pairwise (Disjoint on fun n => Set.Ioo (f (Order.pred n)) (f n))


lemma map_equation (hf : Function.Injective f) (x y : R) :
    (W.map f).toAffine.Equation (f x) (f y) ↔ W.Equation x y

{R : Type u}
[CommRing R]
(W : WeierstrassCurve.Affine R)
{S : Type v}
[CommRing S]
{f : R →+* S}
(hf : Function.Injective ⇑f)
(x y : R)

(WeierstrassCurve.map W f).toAffine.Equation (f x) (f y) ↔ W.Equation x y


theorem C_sub : (C (a - a') : MvPolynomial σ R) = C a - C a'

{R : Type u}
(σ : Type u_1)
(a a' : R)
[CommRing R]

MvPolynomial.C (a - a') = MvPolynomial.C a - MvPolynomial.C a'


theorem eq_top_iff_forall_lt (x : EReal) : x = ⊤ ↔ ∀ y : ℝ, (y : EReal) < x


theorem zneg_succ (n : ZNum) : -n.succ = (-n).pred


@[simp]
theorem zmodEquivZPowers_apply_coe_nat (i : ℕ) :
    h.zmodEquivZPowers i = Additive.ofMul (⟨ζ ^ i, i, rfl⟩ : Subgroup.zpowers ζ)

{R : Type u_4}
{k : ℕ}
[CommRing R]
{ζ : Rˣ}
(h : IsPrimitiveRoot ζ k)
(i : ℕ)

h.zmodEquivZPowers ↑i = Additive.ofMul ⟨ζ ^ i, ⋯⟩


/-- If the sequence already terminated at position `n + 1`, nothing gets squashed. -/
theorem squashSeq_eq_self_of_terminated (terminatedAt_succ_n : s.TerminatedAt (n + 1)) :
    squashSeq s n = s


/-- The circumradius is non-negative. -/
theorem circumradius_nonneg {n : ℕ} (s : Simplex ℝ P n) : 0 ≤ s.circumradius

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{n : ℕ}
(s : Affine.Simplex ℝ P n)


theorem hofer {X : Type*} [MetricSpace X] [CompleteSpace X] (x : X) (ε : ℝ) (ε_pos : 0 < ε)
    {ϕ : X → ℝ} (cont : Continuous ϕ) (nonneg : ∀ y, 0 ≤ ϕ y) : ∃ ε' > 0, ∃ x' : X,
    ε' ≤ ε ∧ d x' x ≤ 2 * ε ∧ ε * ϕ x ≤ ε' * ϕ x' ∧ ∀ y, d x' y ≤ ε' → ϕ y ≤ 2 * ϕ x'

{X : Type u_1}
[MetricSpace X]
[CompleteSpace X]
(x : X)
(ε : ℝ)
(ε_pos : 0 < ε)
{ϕ : X → ℝ}
(cont : Continuous ϕ)
(nonneg : ∀ (y : X), 0 ≤ ϕ y)

∃ ε' > 0, ∃ x', ε' ≤ ε ∧ d x' x ≤ 2 * ε ∧ ε * ϕ x ≤ ε' * ϕ x' ∧ ∀ (y : X), d x' y ≤ ε' → ϕ y ≤ 2 * ϕ x'


/-- (Impl)
A cocone for the diagram `(D ⋙ forget T) ⋙ T` found by composing the natural transformation `γ`
with the colimiting cocone for `D ⋙ forget T`.
-/
@[simps]
def newCocone : Cocone ((D ⋙ forget T) ⋙ (T : C ⥤ C))

{D : CategoryTheory.Functor J T.Algebra}

(c : CategoryTheory.Limits.Cocone (D.comp T.forget))

(CategoryTheory.Monad.ForgetCreatesColimits.newCocone c).pt = c.pt


/-- **Bernoulli's inequality** for real exponents, strict version: for `0 < p < 1` and `-1 ≤ s`,
with `s ≠ 0`, we have `(1 + s) ^ p < 1 + p * s`. -/
theorem rpow_one_add_lt_one_add_mul_self {s : ℝ} (hs : -1 ≤ s) (hs' : s ≠ 0) {p : ℝ} (hp1 : 0 < p)
    (hp2 : p < 1) : (1 + s) ^ p < 1 + p * s


theorem mk_biUnion_le_lift {α : Type u} {ι : Type v} (A : ι → Set α) (s : Set ι) :
    lift.{v} #(⋃ x ∈ s, A x) ≤ lift.{u} #s * ⨆ x : s, lift.{v} #(A x.1)

Cardinal.lift.{v, u} (Cardinal.mk ↑(⋃ x ∈ s, A x)) ≤
  Cardinal.lift.{u, v} (Cardinal.mk ↑s) * ⨆ x, Cardinal.lift.{v, u} (Cardinal.mk ↑(A ↑x))


/-- The short complex in `D` obtained by applying a functor `F : C ⥤ D` to a
short complex in `C`, assuming that `F` preserves zero morphisms. -/
@[simps]
def map (F : C ⥤ D) [F.PreservesZeroMorphisms] : ShortComplex D


/-- A characterization of the a.e.-measurability of the indicator function which takes a constant
value `b` on a set `A` and `0` elsewhere. -/
lemma aemeasurable_indicator_const_iff {s} [MeasurableSingletonClass β] (b : β) [NeZero b] :
    AEMeasurable (s.indicator (fun _ ↦ b)) μ ↔ NullMeasurableSet s μ

{α : Type u_2}
{β : Type u_3}
{m0 : MeasurableSpace α}
[MeasurableSpace β]
{μ : MeasureTheory.Measure α}
[Zero β]
{s : Set α}
[MeasurableSingletonClass β]
(b : β)
[NeZero b]

AEMeasurable (s.indicator fun x => b) μ ↔ MeasureTheory.NullMeasurableSet s μ


@[simp]
lemma opcyclesMap'_add :
    opcyclesMap' (φ + φ') h₁ h₂ = opcyclesMap' φ h₁ h₂ +
      opcyclesMap' φ' h₁ h₂

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

CategoryTheory.ShortComplex.opcyclesMap' (φ + φ') h₁ h₂ =
  CategoryTheory.ShortComplex.opcyclesMap' φ h₁ h₂ + CategoryTheory.ShortComplex.opcyclesMap' φ' h₁ h₂


/-- A bicategory is called `Strict` if the left unitors, the right unitors, and the associators are
isomorphisms given by equalities.
-/
class Bicategory.Strict : Prop where
  /-- Identity morphisms are left identities for composition. -/
  id_comp : ∀ {a b : B} (f : a ⟶ b), 𝟙 a ≫ f = f := by aesop_cat
  /-- Identity morphisms are right identities for composition. -/
  comp_id : ∀ {a b : B} (f : a ⟶ b), f ≫ 𝟙 b = f := by aesop_cat
  /-- Composition in a bicategory is associative. -/
  assoc : ∀ {a b c d : B} (f : a ⟶ b) (g : b ⟶ c) (h : c ⟶ d), (f ≫ g) ≫ h = f ≫ g ≫ h := by
    aesop_cat
  /-- The left unitors are given by equalities -/
  leftUnitor_eqToIso : ∀ {a b : B} (f : a ⟶ b), λ_ f = eqToIso (id_comp f) := by aesop_cat
  /-- The right unitors are given by equalities -/
  rightUnitor_eqToIso : ∀ {a b : B} (f : a ⟶ b), ρ_ f = eqToIso (comp_id f) := by aesop_cat
  /-- The associators are given by equalities -/
  associator_eqToIso :
    ∀ {a b c d : B} (f : a ⟶ b) (g : b ⟶ c) (h : c ⟶ d), α_ f g h = eqToIso (assoc f g h) := by
    aesop_cat

[self : CategoryTheory.Bicategory.Strict B]

CategoryTheory.Bicategory.leftUnitor f = CategoryTheory.eqToIso ⋯


theorem map_smul_left (b : B) (f : M →ₗ[A] P) (g : N →ₗ[R] Q) : map (b • f) g = b • map f g

{R : Type uR}
{A : Type uA}
{B : Type uB}
{M : Type uM}
{N : Type uN}
{P : Type uP}
{Q : Type uQ}
[CommSemiring R]
[Semiring A]
[Semiring B]
[Algebra R A]
[Algebra R B]
[AddCommMonoid M]
[Module R M]
[Module A M]
[IsScalarTower R A M]
[AddCommMonoid N]
[Module R N]
[AddCommMonoid P]
[Module R P]
[Module A P]
[Module B P]
[IsScalarTower R A P]
[IsScalarTower R B P]
[SMulCommClass A B P]
[AddCommMonoid Q]
[Module R Q]
(b : B)
(f : M →ₗ[A] P)
(g : N →ₗ[R] Q)

TensorProduct.AlgebraTensorModule.map (b • f) g = b • TensorProduct.AlgebraTensorModule.map f g


@[reassoc (attr := simp)]
theorem LaxMonoidalFunctor.associativity_inv (F : LaxMonoidalFunctor C D) (X Y Z : C) :
    F.obj X ◁ F.μ Y Z ≫ F.μ X (Y ⊗ Z) ≫ F.map (α_ X Y Z).inv =
      (α_ (F.obj X) (F.obj Y) (F.obj Z)).inv ≫ F.μ X Y ▷ F.obj Z ≫ F.μ (X ⊗ Y) Z

(F : CategoryTheory.LaxMonoidalFunctor C D)

CategoryTheory.MonoidalCategory.whiskerLeft (F.obj X) (F.μ Y Z) ≫
    F.μ X (CategoryTheory.MonoidalCategory.tensorObj Y Z) ≫
      F.map (CategoryTheory.MonoidalCategory.associator X Y Z).inv =
  (CategoryTheory.MonoidalCategory.associator (F.obj X) (F.obj Y) (F.obj Z)).inv ≫
    CategoryTheory.MonoidalCategory.whiskerRight (F.μ X Y) (F.obj Z) ≫
      F.μ (CategoryTheory.MonoidalCategory.tensorObj X Y) Z


@[simp]
theorem top_coe : ((⊤ : LieSubmodule R L M) : Set M) = univ

{R : Type u}
{L : Type v}
{M : Type w}
[CommRing R]
[LieRing L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]


theorem coeff_p_pow_eq_zero [CharP R p] {i j : ℕ} (hj : j ≠ i) : ((p : 𝕎 R) ^ i).coeff j = 0

(p : ℕ)
(R : Type u_1)
[hp : Fact (Nat.Prime p)]
[CommRing R]
[CharP R p]
{i j : ℕ}
(hj : j ≠ i)


@[measurability]
protected theorem sub [AddGroup β] [ContinuousSub β] (hf : AEFinStronglyMeasurable f μ)
    (hg : AEFinStronglyMeasurable g μ) : AEFinStronglyMeasurable (f - g) μ

(hf : MeasureTheory.AEFinStronglyMeasurable f μ)

(hg : MeasureTheory.AEFinStronglyMeasurable g μ)

MeasureTheory.AEFinStronglyMeasurable (f - g) μ


theorem IsBigO.symm (h : (fun x => f₁ x - f₂ x) =O[l] g) : (fun x => f₂ x - f₁ x) =O[l] g

{α : Type u_1}
{F : Type u_4}
{E' : Type u_6}
[Norm F]
[SeminormedAddCommGroup E']
{g : α → F}
{l : Filter α}
{f₁ f₂ : α → E'}
(h : (fun x => f₁ x - f₂ x) =O[l] g)


@[simp]
theorem ofNat_mul_continuum {n : ℕ} [Nat.AtLeastTwo n] : no_index (OfNat.ofNat n) * 𝔠 = 𝔠

OfNat.ofNat n * Cardinal.continuum = Cardinal.continuum


theorem exists_maximal_independent' (s : ι → M) :
    ∃ I : Set ι,
      (LinearIndependent R fun x : I => s x) ∧
        ∀ J : Set ι, I ⊆ J → (LinearIndependent R fun x : J => s x) → I = J

{ι : Type u'}
(R : Type u_2)
{M : Type u_4}
[Ring R]
[AddCommGroup M]
[Module R M]
(s : ι → M)

∃ I,
  (LinearIndependent R fun (x : ↑I) => s ↑x) ∧ ∀ (J : Set ι), I ⊆ J → (LinearIndependent R fun (x : ↑J) => s ↑x) → I = J


/-- A family of `AddMonoidHom`s preserving `DirectSum.One.one` and `DirectSum.Mul.mul`
describes a `RingHom`s on `⨁ i, A i`. This is a stronger version of `DirectSum.toMonoid`.

Of particular interest is the case when `A i` are bundled subojects, `f` is the family of
coercions such as `AddSubmonoid.subtype (A i)`, and the `[GSemiring A]` structure originates from
`DirectSum.gsemiring.ofAddSubmonoids`, in which case the proofs about `GOne` and `GMul`
can be discharged by `rfl`. -/
@[simps]
def toSemiring (f : ∀ i, A i →+ R) (hone : f _ GradedMonoid.GOne.one = 1)
    (hmul : ∀ {i j} (ai : A i) (aj : A j), f _ (GradedMonoid.GMul.mul ai aj) = f _ ai * f _ aj) :
    (⨁ i, A i) →+* R

(hone : (f 0) GradedMonoid.GOne.one = 1)

(hmul : ∀ {i j : ι} (ai : A i) (aj : A j), (f (i + j)) (GradedMonoid.GMul.mul ai aj) = (f i) ai * (f j) aj)

(DirectSum.toSemiring f hone hmul) a = (DirectSum.toAddMonoid f) a


@[simp] theorem runK_set (s s' : σ) (k : PUnit → σ → m β) : (set s' : StateCpsT σ m PUnit).runK s k = k ⟨⟩ s'

{σ : Type u}
{m : Type u → Type v}
{β : Type u}
(s s' : σ)
(k : PUnit → σ → m β)


@[to_additive]
theorem div_mul_comm : a / b * c = c / b * a

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


@[to_additive]
protected theorem surjective (e : M ≃* N) : Function.Surjective e

{M : Type u_6}
{N : Type u_7}
[Mul M]
[Mul N]
(e : M ≃* N)


theorem fold_min_le : s.fold min b f ≤ c ↔ b ≤ c ∨ ∃ x ∈ s, f x ≤ c

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{b : β}
{s : Finset α}
[LinearOrder β]
(c : β)

Finset.fold min b f s ≤ c ↔ b ≤ c ∨ ∃ x ∈ s, f x ≤ c


theorem total {s : CompositionSeries X} {x y : X} (hx : x ∈ s) (hy : y ∈ s) : x ≤ y ∨ y ≤ x

{X : Type u}
[Lattice X]
[JordanHolderLattice X]
{s : CompositionSeries X}
{x y : X}
(hx : x ∈ s)
(hy : y ∈ s)


theorem MeasureTheory.Measure.restrict_map_of_aemeasurable {f : α → δ} (hf : AEMeasurable f μ)
    {s : Set δ} (hs : MeasurableSet s) : (μ.map f).restrict s = (μ.restrict <| f ⁻¹' s).map f

{α : Type u_2}
{δ : Type u_5}
{m0 : MeasurableSpace α}
[MeasurableSpace δ]
{μ : MeasureTheory.Measure α}
{f : α → δ}
(hf : AEMeasurable f μ)
{s : Set δ}
(hs : MeasurableSet s)

(MeasureTheory.Measure.map f μ).restrict s = MeasureTheory.Measure.map f (μ.restrict (f ⁻¹' s))


@[simp] lemma mem_biUnion {b : β} : b ∈ s.biUnion t ↔ ∃ a ∈ s, b ∈ t a

{α : Type u_1}
{β : Type u_2}
{s : Finset α}
{t : α → Finset β}
[DecidableEq β]
{b : β}


protected theorem unifIntegrable {f : ι → α → β} {p : ℝ≥0∞} (hf : UniformIntegrable f p μ) :
    UnifIntegrable f p μ

{f : ι → α → β}

(hf : MeasureTheory.UniformIntegrable f p μ)


theorem Fintype.card_compl_set [Fintype α] (s : Set α) [Fintype s] [Fintype (↥sᶜ : Sort _)] :
    Fintype.card (↥sᶜ : Sort _) = Fintype.card α - Fintype.card s

{α : Type u_1}
[Fintype α]
(s : Set α)
[Fintype ↑s]
[Fintype ↑sᶜ]

Fintype.card ↑sᶜ = Fintype.card α - Fintype.card ↑s


theorem injective_πs (o : Ordinal) : Function.Injective (πs C o)

{I : Type u}
[LinearOrder I]
[IsWellOrder I fun x x_1 => x < x_1]
(C : Set (I → Bool))
(o : Ordinal.{u})

Function.Injective ⇑(Profinite.NobelingProof.πs C o)


@[simp]
theorem ofSigmaCofork_ι_app_left (c : Cofork I.fstSigmaMap I.sndSigmaMap) (a) :
    (ofSigmaCofork I c).ι.app (WalkingMultispan.left a) =
      (Sigma.ι I.left a : _) ≫ I.fstSigmaMap ≫ c.π

(I : CategoryTheory.Limits.MultispanIndex C)

(c : CategoryTheory.Limits.Cofork I.fstSigmaMap I.sndSigmaMap)

(CategoryTheory.Limits.Multicofork.ofSigmaCofork I c).ι.app (CategoryTheory.Limits.WalkingMultispan.left a) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.Limits.Sigma.ι I.left a)
    (CategoryTheory.CategoryStruct.comp I.fstSigmaMap c.π)


/-- A subfield is closed under addition. -/
protected theorem add_mem {x y : K} : x ∈ s → y ∈ s → x + y ∈ s

{K : Type u}
[DivisionRing K]
(s : Subfield K)
{x y : K}


theorem WOppSide.trans_wSameSide {s : AffineSubspace R P} {x y z : P} (hxy : s.WOppSide x y)
    (hyz : s.WSameSide y z) (hy : y ∉ s) : s.WOppSide x z

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[LinearOrderedField R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
{s : AffineSubspace R P}
{x y z : P}
(hxy : s.WOppSide x y)
(hyz : s.WSameSide y z)
(hy : y ∉ s)


@[reassoc (attr := simp)]
theorem ofLEMk_comp_ofMkLE {B A : C} (X : Subobject B) (f : A ⟶ B) [Mono f] (Y : Subobject B)
    (h₁ : X ≤ mk f) (h₂ : mk f ≤ Y) : ofLEMk X f h₁ ≫ ofMkLE f Y h₂ = ofLE X Y (h₁.trans h₂)

(h₁ : X ≤ CategoryTheory.Subobject.mk f)

(h₂ : CategoryTheory.Subobject.mk f ≤ Y)

CategoryTheory.CategoryStruct.comp (X.ofLEMk f h₁) (CategoryTheory.Subobject.ofMkLE f Y h₂) = X.ofLE Y ⋯


/-- A version of `Commute.add_pow` that avoids ℕ-subtraction by summing over the antidiagonal and
also with the binomial coefficient applied via scalar action of ℕ. -/
theorem add_pow' (h : Commute x y) (n : ℕ) :
    (x + y) ^ n = ∑ m ∈ antidiagonal n, choose n m.fst • (x ^ m.fst * y ^ m.snd)

{R : Type u_1}
[Semiring R]
{x y : R}
(h : Commute x y)
(n : ℕ)

(x + y) ^ n = ∑ m ∈ Finset.antidiagonal n, n.choose m.1 • (x ^ m.1 * y ^ m.2)


theorem abs_exp (z : ℂ) : abs (exp z) = Real.exp z.re

Complex.abs (Complex.exp z) = Real.exp z.re


theorem localTrivAt_snd (b : B) (p) :
    (Z.localTrivAt b p).2 = Z.coordChange (Z.indexAt p.1) (Z.indexAt b) p.1 p.2

{ι : Type u_1}
{B : Type u_2}
{F : Type u_3}
[TopologicalSpace B]
[TopologicalSpace F]
(Z : FiberBundleCore ι B F)
(b : B)
(p : Bundle.TotalSpace F Z.Fiber)

(↑(Z.localTrivAt b) p).2 = Z.coordChange (Z.indexAt p.proj) (Z.indexAt b) p.proj p.snd


theorem zeroLocus_bot : zeroLocus 𝒜 ((⊥ : Ideal A) : Set A) = Set.univ

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

ProjectiveSpectrum.zeroLocus 𝒜 ↑⊥ = Set.univ


theorem subset_iff {s t : Multiset α} : s ⊆ t ↔ ∀ ⦃x⦄, x ∈ s → x ∈ t

s ⊆ t ↔ ∀ ⦃x : α⦄, x ∈ s → x ∈ t


theorem IndepFun.neg_left {_mβ : MeasurableSpace β} {_mβ' : MeasurableSpace β'} [Neg β]
    [MeasurableNeg β] (hfg : IndepFun f g μ) :
    IndepFun (-f) g μ

(hfg : ProbabilityTheory.IndepFun f g μ)


/-- When `φ` is injective, `defaultExpansion` expands a model of `T` to a model of `φ.onTheory T`
  arbitrarily. -/
@[simps]
noncomputable def defaultExpansion {L' : Language} {φ : L →ᴸ L'} (h : φ.Injective)
    [∀ (n) (f : L'.Functions n), Decidable (f ∈ Set.range fun f : L.Functions n => φ.onFunction f)]
    [∀ (n) (r : L'.Relations n), Decidable (r ∈ Set.range fun r : L.Relations n => φ.onRelation r)]
    (M : T.ModelType) [Inhabited M] : (φ.onTheory T).ModelType

[(n : ℕ) → (f : L'.Functions n) → Decidable (f ∈ Set.range fun f => φ.onFunction f)]

[(n : ℕ) → (r : L'.Relations n) → Decidable (r ∈ Set.range fun r => φ.onRelation r)]

↑(FirstOrder.Language.Theory.ModelType.defaultExpansion h M) = ↑M


theorem log_conj_eq_ite (x : ℂ) : log (conj x) = if x.arg = π then log x else conj (log x)

Complex.log ((starRingEnd ℂ) x) = if x.arg = Real.pi then Complex.log x else (starRingEnd ℂ) (Complex.log x)


theorem card_lines [Finite P] [Fintype L] : Fintype.card L = order P L ^ 2 + order P L + 1

(P : Type u_1)
(L : Type u_2)
[Membership P L]
[Configuration.ProjectivePlane P L]
[Finite P]
[Fintype L]

Fintype.card L = Configuration.ProjectivePlane.order P L ^ 2 + Configuration.ProjectivePlane.order P L + 1


@[to_additive]
lemma isUnit_pow_succ_iff : IsUnit (a ^ (n + 1)) ↔ IsUnit a

{M : Type u_1}
[AddMonoid M]
{n : ℕ}
{a : M}


@[simp, norm_cast]
theorem intCast_imK (z : ℤ) : (z : ℍ[R,c₁,c₂]).imK = 0

{R : Type u_3}
[CommRing R]
{c₁ c₂ : R}
(z : ℤ)


@[simp]
theorem zeroProdIso_hom (X : C) : (zeroProdIso X).hom = prod.snd

(CategoryTheory.Limits.zeroProdIso X).hom = CategoryTheory.Limits.prod.snd


theorem add_num_den (q r : ℚ) :
    q + r = (q.num * r.den + q.den * r.num : ℤ) /. (↑q.den * ↑r.den : ℤ)

q + r = Rat.divInt (q.num * ↑r.den + ↑q.den * r.num) (↑q.den * ↑r.den)


/-- In a group with a left invariant measure `μ` and a right invariant measure `ν`, one can express
integrals with respect to `μ` as integrals with respect to `ν` up to a constant scaling factor
(given in the statement as `∫ x, g x ∂μ` where `g` is a fixed reference function) and an
explicit density `y ↦ 1/∫ z, g (z⁻¹ * y) ∂ν`. -/
@[to_additive]
lemma integral_isMulLeftInvariant_isMulRightInvariant_combo
    {μ ν : Measure G} [IsFiniteMeasureOnCompacts μ] [IsFiniteMeasureOnCompacts ν]
    [IsMulLeftInvariant μ] [IsMulRightInvariant ν] [IsOpenPosMeasure ν]
    {f g : G → ℝ} (hf : Continuous f) (h'f : HasCompactSupport f)
    (hg : Continuous g) (h'g : HasCompactSupport g) (g_nonneg : 0 ≤ g) {x₀ : G} (g_pos : g x₀ ≠ 0) :
    ∫ x, f x ∂μ = (∫ y, f y * (∫ z, g (z⁻¹ * y) ∂ν)⁻¹ ∂ν) * ∫ x, g x ∂μ

∫ (x : G), f x ∂μ = (∫ (y : G), f y * (∫ (z : G), g (z⁻¹ * y) ∂ν)⁻¹ ∂ν) * ∫ (x : G), g x ∂μ


lemma top_induce_pair_connected_of_adj {u v : V} (huv : G.Adj u v) :
    ((⊤ : G.Subgraph).induce {u, v}).Connected

{V : Type u}
{G : SimpleGraph V}
{u v : V}
(huv : G.Adj u v)


theorem charP_of_model_fieldOfChar [Field K] [CompatibleRing K]
    [h : (Theory.fieldOfChar p).Model K] : CharP K p

[h : K ⊨ FirstOrder.Language.Theory.fieldOfChar p]


@[simp]
theorem eventually_mem_set {s : Set α} {l : Filter α} : (∀ᶠ x in l, x ∈ s) ↔ s ∈ l


@[to_additive]
theorem isComplement_singleton_right {g : G} : IsComplement S {g} ↔ S = univ

{G : Type u_1}
[AddGroup G]
{S : Set G}
{g : G}

AddSubgroup.IsComplement S {g} ↔ S = Set.univ


theorem lintegral_tendsto_of_tendsto_of_antitone {f : ℕ → α → ℝ≥0∞} {F : α → ℝ≥0∞}
    (hf : ∀ n, AEMeasurable (f n) μ) (h_anti : ∀ᵐ x ∂μ, Antitone fun n ↦ f n x)
    (h0 : ∫⁻ a, f 0 a ∂μ ≠ ∞)
    (h_tendsto : ∀ᵐ x ∂μ, Tendsto (fun n ↦ f n x) atTop (𝓝 (F x))) :
    Tendsto (fun n ↦ ∫⁻ x, f n x ∂μ) atTop (𝓝 (∫⁻ x, F x ∂μ))

{f : ℕ → α → ℝ≥0∞}

{F : α → ℝ≥0∞}

(h_anti : ∀ᵐ (x : α) ∂μ, Antitone fun n => f n x)

(h_tendsto : ∀ᵐ (x : α) ∂μ, Filter.Tendsto (fun n => f n x) Filter.atTop (𝓝 (F x)))

Filter.Tendsto (fun n => ∫⁻ (x : α), f n x ∂μ) Filter.atTop (𝓝 (∫⁻ (x : α), F x ∂μ))


theorem Ico_mem_nhdsWithin_Ioi' {a b : α} (H : a < b) : Ico a b ∈ 𝓝[>] a

{α : Type u}
[TopologicalSpace α]
[LinearOrder α]
[ClosedIciTopology α]
{a b : α}
(H : a < b)


theorem preimage_closure (h : X ≃ₜ Y) (s : Set Y) : h ⁻¹' closure s = closure (h ⁻¹' s)

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
(h : X ≃ₜ Y)
(s : Set Y)


theorem InvImage.equivalence {α : Sort u} {β : Sort v} (r : β → β → Prop) (f : α → β)
    (h : Equivalence r) : Equivalence (InvImage r f)


theorem dualAnnihilator_dualAnnihilator_eq (W : Subspace K V) :
    W.dualAnnihilator.dualAnnihilator = Module.mapEvalEquiv K V W

{K : Type u}
{V : Type v}
[Field K]
[AddCommGroup V]
[Module K V]
[FiniteDimensional K V]
(W : Subspace K V)

(Submodule.dualAnnihilator W).dualAnnihilator = (Module.mapEvalEquiv K V) W


/-- `Equiv.mulLeft₀` as an order_iso. -/
@[simps! (config := { simpRhs := true })]
def OrderIso.mulLeft₀ (a : α) (ha : 0 < a) : α ≃o α

{α : Type u_2}
[LinearOrderedSemifield α]
(a : α)
(ha : 0 < a)
(x : α)


lemma leibniz_zpow (a : K) (n : ℤ) : D (a ^ n) = n • a ^ (n - 1) • D a

{R : Type u_1}
[CommRing R]
{M : Type u_3}
[AddCommGroup M]
[Module R M]
{K : Type u_4}
[Field K]
[Module K M]
[Algebra R K]
(D : Derivation R K M)
(a : K)
(n : ℤ)


theorem map_sup [SemilatticeSup β] (hf : MonotoneOn f s) (hx : x ∈ s) (hy : y ∈ s) :
    f (x ⊔ y) = f x ⊔ f y

{α : Type u}
{β : Type v}
{f : α → β}
{s : Set α}
{x y : α}
[LinearOrder α]
[SemilatticeSup β]
(hf : MonotoneOn f s)
(hx : x ∈ s)
(hy : y ∈ s)


theorem isBigO_one_nat_atTop_iff {f : ℕ → E''} :
    f =O[atTop] (fun _n => 1 : ℕ → ℝ) ↔ ∃ C, ∀ n, ‖f n‖ ≤ C

{E'' : Type u_9}
[NormedAddCommGroup E'']
{f : ℕ → E''}

(f =O[Filter.atTop] fun _n => 1) ↔ ∃ C, ∀ (n : ℕ), ‖f n‖ ≤ C


theorem fderivWithin_of_mem (st : t ∈ 𝓝[s] x) (ht : UniqueDiffWithinAt 𝕜 s x)
    (h : DifferentiableWithinAt 𝕜 f t x) : fderivWithin 𝕜 f s x = fderivWithin 𝕜 f t x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{x : E}
{s t : Set E}
(st : t ∈ 𝓝[s] x)
(ht : UniqueDiffWithinAt 𝕜 s x)
(h : DifferentiableWithinAt 𝕜 f t x)


/-- If `CommMonoid` homs `g : M →* P, l : P →* A` induce maps of localizations, the composition
of the induced maps equals the map of localizations induced by `l ∘ g`. -/
@[to_additive
    "If `AddCommMonoid` homs `g : M →+ P, l : P →+ A` induce maps of localizations, the composition
of the induced maps equals the map of localizations induced by `l ∘ g`."]
theorem map_map {A : Type*} [CommMonoid A] {U : Submonoid A} {R} [CommMonoid R]
    (j : LocalizationMap U R) {l : P →* A} (hl : ∀ w : T, l w ∈ U) (x) :
    k.map hl j (f.map hy k x) = f.map (fun x ↦ show l.comp g x ∈ U from hl ⟨g x, hy x⟩) j x

{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)
{g : M →* P}
{T : Submonoid P}
(hy : ∀ (y : ↥S), g ↑y ∈ T)
{Q : Type u_4}
[CommMonoid Q]
{k : T.LocalizationMap Q}
{A : Type u_5}
[CommMonoid A]
{U : Submonoid A}
{R : Type u_6}
[CommMonoid R]
(j : U.LocalizationMap R)
{l : P →* A}
(hl : ∀ (w : ↥T), l ↑w ∈ U)
(x : N)

(k.map hl j) ((f.map hy k) x) = (f.map ⋯ j) x


theorem dist_le_iff_le_sinh :
    dist z w ≤ r ↔ dist (z : ℂ) w / (2 * √(z.im * w.im)) ≤ sinh (r / 2)

dist z w ≤ r ↔ dist ↑z ↑w / (2 * √(z.im * w.im)) ≤ Real.sinh (r / 2)


theorem lowerSemicontinuousAt_iff_le_liminf {f : α → γ} :
    LowerSemicontinuousAt f x ↔ f x ≤ liminf f (𝓝 x)

{α : Type u_1}
[TopologicalSpace α]
{x : α}
{γ : Type u_3}
[CompleteLinearOrder γ]
[DenselyOrdered γ]
{f : α → γ}

LowerSemicontinuousAt f x ↔ f x ≤ Filter.liminf f (𝓝 x)


@[to_additive]
theorem multipliable_subtype_and_compl {s : Set β} :
    ((Multipliable fun x : s ↦ f x) ∧ Multipliable fun x : ↑sᶜ ↦ f x) ↔ Multipliable f

{α : Type u_1}
{β : Type u_2}
[AddCommGroup α]
[UniformSpace α]
[UniformAddGroup α]
{f : β → α}
[CompleteSpace α]
{s : Set β}

((Summable fun x => f ↑x) ∧ Summable fun x => f ↑x) ↔ Summable f


/-- Introduction rule to prove that `b` is the supremum of `s`: it suffices to check that
1) `b` is an upper bound
2) every other upper bound `b'` satisfies `b ≤ b'`. -/
theorem csSup_eq_of_is_forall_le_of_forall_le_imp_ge (hs : s.Nonempty) (h_is_ub : ∀ a ∈ s, a ≤ b)
    (h_b_le_ub : ∀ ub, (∀ a ∈ s, a ≤ ub) → b ≤ ub) : sSup s = b

(h_b_le_ub : ∀ (ub : α), (∀ a ∈ s, a ≤ ub) → b ≤ ub)


/-- An affine-independent subset of a finite-dimensional affine space is finite. -/
theorem finite_set_of_fin_dim_affineIndependent [FiniteDimensional k V] {s : Set ι} {f : s → P}
    (hi : AffineIndependent k f) : s.Finite

(k : Type u_1)
{V : Type u_2}
{P : Type u_3}
{ι : Type u_4}
[DivisionRing k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
[FiniteDimensional k V]
{s : Set ι}
{f : ↑s → P}
(hi : AffineIndependent k f)


@[simp]
theorem prod_apply (i) :
    b.prod b' i = Sum.elim (LinearMap.inl R M M' ∘ b) (LinearMap.inr R M M' ∘ b') i

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

(b.prod b') i = Sum.elim (⇑(LinearMap.inl R M M') ∘ ⇑b) (⇑(LinearMap.inr R M M') ∘ ⇑b') i


@[simp]
theorem ε_app_obj (n : M) (X : C) :
    F.ε.app ((F.obj n).obj X) = (F.map (ρ_ n).inv).app X ≫ (F.μIso n (𝟙_ M)).inv.app X

(F : CategoryTheory.MonoidalFunctor M (CategoryTheory.Functor C C))

F.ε.app ((F.obj n).obj X) =
  CategoryTheory.CategoryStruct.comp ((F.map (CategoryTheory.MonoidalCategory.rightUnitor n).inv).app X)
    ((F.μIso n (𝟙_ M)).inv.app X)


@[to_additive]
theorem mul_lt_of_lt_of_lt_one [CovariantClass α α (· * ·) (· < ·)] {a b c : α} (hbc : b < c)
    (ha : a < 1) :
    b * a < c

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


@[to_additive]
theorem bot_prod_bot : (⊥ : Subgroup G).prod (⊥ : Subgroup N) = ⊥

{G : Type u_1}
[Group G]
{N : Type u_5}
[Group N]


/-- Product of two continuous homomorphisms on the same space. -/
@[to_additive (attr := simps!) "Product of two continuous homomorphisms on the same space."]
def prod (f : ContinuousMonoidHom A B) (g : ContinuousMonoidHom A C) :
    ContinuousMonoidHom A (B × C)

{A : Type u_2}
{B : Type u_3}
{C : Type u_4}
[Monoid A]
[Monoid B]
[Monoid C]
[TopologicalSpace A]
[TopologicalSpace B]
[TopologicalSpace C]
(f : ContinuousMonoidHom A B)
(g : ContinuousMonoidHom A C)
(i : A)

(f.prod g) i = (f.toMonoidHom i, g.toMonoidHom i)


theorem LawfulFix.fix_eq' {α} [OmegaCompletePartialOrder α] [LawfulFix α] {f : α → α}
    (hf : Continuous' f) : Fix.fix f = f (Fix.fix f)

(hf : OmegaCompletePartialOrder.Continuous' f)


theorem contsAux_stable_of_terminated (n_lt_m : n < m) (terminatedAt_n : g.TerminatedAt n) :
    g.contsAux m = g.contsAux (n + 1)

{K : Type u_1}
{g : GenContFract K}
{n m : ℕ}
[DivisionRing K]
(n_lt_m : n < m)
(terminatedAt_n : g.TerminatedAt n)


/-- **Triangle Removal Lemma**. If there are not too many triangles (on the order of `(card α)^3`)
then they can all be removed by removing a few edges (on the order of `(card α)^2`). -/
lemma triangle_removal (hG : (G.cliqueFinset 3).card < triangleRemovalBound ε * card α ^ 3) :
    ∃ G' ≤ G, ∃ _ : DecidableRel G'.Adj,
      (G.edgeFinset.card - G'.edgeFinset.card : ℝ) < ε * (card α^2 : ℕ) ∧ G'.CliqueFree 3

(hG : ↑(G.cliqueFinset 3).card < SimpleGraph.triangleRemovalBound ε * ↑(Fintype.card α) ^ 3)

∃ G' ≤ G, ∃ x, ↑G.edgeFinset.card - ↑G'.edgeFinset.card < ε * ↑(Fintype.card α ^ 2) ∧ G'.CliqueFree 3


theorem algebraMap_mem (r : R) : algebraMap R A r ∈ S

{R : Type u_2}
{A : Type u_3}
[CommSemiring R]
[StarRing R]
[Semiring A]
[StarRing A]
[Algebra R A]
[StarModule R A]
(S : StarSubalgebra R A)
(r : R)


theorem extend_target' : (f.extend I).target = I '' f.target

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


/-- Slightly stronger than `OuterMeasure.mono` having an intersection with `p.support`. -/
theorem toOuterMeasure_mono {s t : Set α} (h : s ∩ p.support ⊆ t) :
    p.toOuterMeasure s ≤ p.toOuterMeasure t

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


@[to_additive]
theorem discreteTopology_of_isOpen_singleton_one (h : IsOpen ({1} : Set G)) :
    DiscreteTopology G

{G : Type w}
[TopologicalSpace G]
[Group G]
[ContinuousMul G]
(h : IsOpen {1})


lemma bitwise_of_ne_zero {n m : Nat} (hn : n ≠ 0) (hm : m ≠ 0) :
    bitwise f n m = bit (f (bodd n) (bodd m)) (bitwise f (n / 2) (m / 2))

{f : Bool → Bool → Bool}
{n m : ℕ}
(hn : n ≠ 0)
(hm : m ≠ 0)

Nat.bitwise f n m = Nat.bit (f n.bodd m.bodd) (Nat.bitwise f (n / 2) (m / 2))


theorem groupoid_of_isDetecting_empty (h : IsDetecting (∅ : Set C)) {X Y : C} (f : X ⟶ Y) :
    IsIso f

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


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


theorem num_zero_eq (h_inj : Function.Injective (algebraMap R P)) :
    num (0 : FractionalIdeal S P) = 0

(h_inj : Function.Injective ⇑(algebraMap R P))


@[to_additive]
theorem multipliable_of_finite_mulSupport (h : (mulSupport f).Finite) : Multipliable f

{α : Type u_1}
{β : Type u_2}
[CommMonoid α]
[TopologicalSpace α]
{f : β → α}
(h : (Function.mulSupport f).Finite)


/-- The multiplicative unit of rational functions. -/
protected irreducible_def one : RatFunc K


theorem seqTendstoAeSeq_strictMono (hfg : TendstoInMeasure μ f atTop g) :
    StrictMono (seqTendstoAeSeq hfg)

(hfg : MeasureTheory.TendstoInMeasure μ f Filter.atTop g)


/-- The `p`-adic norm of `p` is `p⁻¹` if `p > 1`.

See also `padicNorm.padicNorm_p_of_prime` for a version assuming `p` is prime. -/
theorem padicNorm_p (hp : 1 < p) : padicNorm p p = (p : ℚ)⁻¹


/-- Distinct elements of a set of sets partitioning α are disjoint. -/
theorem eqv_classes_disjoint {c : Set (Set α)} (H : ∀ a, ∃! b ∈ c, a ∈ b) :
    c.PairwiseDisjoint id

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


theorem incMatrix_mul_transpose_diag [Fintype (neighborSet G a)] :
    (G.incMatrix R * (G.incMatrix R)ᵀ) a a = G.degree a

{R : Type u_1}
{α : Type u_2}
(G : SimpleGraph α)
[Fintype (Sym2 α)]
[NonAssocSemiring R]
{a : α}
[Fintype ↑(G.neighborSet a)]

(SimpleGraph.incMatrix R G * (SimpleGraph.incMatrix R G)ᵀ) a a = ↑(G.degree a)


theorem isClosed_iff' (hf : Inducing f) {s : Set X} :
    IsClosed s ↔ ∀ x, f x ∈ closure (f '' s) → x ∈ s

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

IsClosed s ↔ ∀ (x : X), f x ∈ closure (f '' s) → x ∈ s


theorem IsGalois.tower_top_of_isGalois [IsGalois F E] : IsGalois K E

(F : Type u_1)
(K : Type u_2)
(E : Type u_3)
[Field F]
[Field K]
[Field E]
[Algebra F K]
[Algebra F E]
[Algebra K E]
[IsScalarTower F K E]
[IsGalois F E]


/-- (Impl).
Given a cone for (X × K -), produce a cone for K using the natural transformation `γ₂` -/
@[simps]
def forgetCone {X : C} {K : J ⥤ C} (s : Cone (K ⋙ prod.functor.obj X)) : Cone K

(s : CategoryTheory.Limits.Cone (K ⋙ CategoryTheory.Limits.prod.functor.obj X))

(CategoryTheory.ProdPreservesConnectedLimits.forgetCone s).π = s.π ≫ CategoryTheory.ProdPreservesConnectedLimits.γ₂ X


theorem mem_vanishingIdeal_singleton_iff (x : σ → k) (p : MvPolynomial σ k) :
    p ∈ (vanishingIdeal {x} : Ideal (MvPolynomial σ k)) ↔ eval x p = 0

{k : Type u_1}
[Field k]
{σ : Type u_2}
(x : σ → k)
(p : MvPolynomial σ k)

p ∈ MvPolynomial.vanishingIdeal {x} ↔ (MvPolynomial.eval x) p = 0


/-- Negation of the condition `P : Prop` in a `dite` is the same as swapping the branches. -/
@[simp] theorem dite_not [hn : Decidable (¬p)] [h : Decidable p]  (x : ¬p → α) (y : ¬¬p → α) :
    dite (¬p) x y = dite p (fun h => y (not_not_intro h)) x

{p : Prop}
{α : Sort u_1}
[hn : Decidable ¬p]
[h : Decidable p]
(x : ¬p → α)
(y : ¬¬p → α)


protected theorem add_right_comm (a b c : Int) : a + b + c = a + c + b


protected theorem List.nnnorm_prod (l : List α) : ‖l.prod‖₊ = (l.map nnnorm).prod

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


@[simp]
theorem mk'_algebraMap [Algebra R A] [IsScalarTower R A B] (x : R)
    (h : IsIntegral R (algebraMap R B x) := isIntegral_algebraMap) :
    IsIntegralClosure.mk' A (algebraMap R B x) h = algebraMap R A x

(h : IsIntegral R ((algebraMap R B) x) := ⋯)

IsIntegralClosure.mk' A ((algebraMap R B) x) h = (algebraMap R A) x


theorem Preconnected.map {G : SimpleGraph V} {H : SimpleGraph V'} (f : G →g H) (hf : Surjective f)
    (hG : G.Preconnected) : H.Preconnected

{V : Type u}
{V' : Type v}
{G : SimpleGraph V}
{H : SimpleGraph V'}
(f : G →g H)
(hf : Function.Surjective ⇑f)
(hG : G.Preconnected)


/-- The (identity) equivalence between `Cᴹᵒᵖ` and `C`. -/
@[simps!] def MonoidalOpposite.unmopEquiv : Cᴹᵒᵖ ≌ C

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

∀ {X Y : C} (f : X ⟶ Y), ((CategoryTheory.MonoidalOpposite.unmopEquiv C).inverse.map f).unmop = f


lemma support_mul_subset_left (f g : ι → M₀) : support (fun x ↦ f x * g x) ⊆ support f

{ι : Type u_1}
{M₀ : Type u_4}
[MulZeroClass M₀]
(f g : ι → M₀)

(Function.support fun x => f x * g x) ⊆ Function.support f


@[to_additive]
theorem tprod_eq_mulSingle {f : β → α} (b : β) (hf : ∀ b' ≠ b, f b' = 1) :
    ∏' b, f b = f b

{α : Type u_1}
{β : Type u_2}
[CommMonoid α]
[TopologicalSpace α]
{f : β → α}
(b : β)
(hf : ∀ (b' : β), b' ≠ b → f b' = 1)


@[simp]
theorem Perm.extendDomain_symm : (e.extendDomain f).symm = Perm.extendDomain e.symm f

{α' : Type u_1}
{β' : Type u_2}
(e : Equiv.Perm α')
{p : β' → Prop}
[DecidablePred p]
(f : α' ≃ Subtype p)

Equiv.symm (e.extendDomain f) = Equiv.Perm.extendDomain (Equiv.symm e) f


@[simp]
theorem bind₁_wittMulN_wittPolynomial (n k : ℕ) :
    bind₁ (wittMulN p n) (wittPolynomial p ℤ k) = n * wittPolynomial p ℤ k

(p : ℕ)
[hp : Fact (Nat.Prime p)]
(n k : ℕ)

(MvPolynomial.bind₁ (WittVector.wittMulN p n)) (wittPolynomial p ℤ k) = ↑n * wittPolynomial p ℤ k


/-- Assumes left covariance.
The lemma assuming right covariance is `Right.mul_le_one`. -/
@[to_additive "Assumes left covariance.
The lemma assuming right covariance is `Right.add_nonpos`."]
theorem Left.mul_le_one [CovariantClass α α (· * ·) (· ≤ ·)] {a b : α} (ha : a ≤ 1) (hb : b ≤ 1) :
    a * b ≤ 1

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


/-- The cast of the successor is the successor of the cast. See `Fin.succ_cast_eq` for rewriting in
the reverse direction. -/
@[simp] theorem cast_succ_eq {n' : Nat} (i : Fin n) (h : n.succ = n'.succ) :
    cast h i.succ = (cast (Nat.succ.inj h) i).succ

{n n' : Nat}
(i : Fin n)
(h : n.succ = n'.succ)


theorem ofBijective_apply {f : F} (hf : Function.Bijective f) (a : A) :
    (StarAlgEquiv.ofBijective f hf) a = f a

{F : Type u_1}
{R : Type u_3}
{A : Type u_4}
{B : Type u_5}
[Monoid R]
[NonUnitalNonAssocSemiring A]
[DistribMulAction R A]
[Star A]
[NonUnitalNonAssocSemiring B]
[DistribMulAction R B]
[Star B]
[FunLike F A B]
[NonUnitalAlgHomClass F R A B]
[NonUnitalStarAlgHomClass F R A B]
{f : F}
(hf : Function.Bijective ⇑f)
(a : A)


@[to_additive]
theorem uniformity_eq_comap_nhds_one_swapped :
    𝓤 α = comap (fun x : α × α => x.1 / x.2) (𝓝 (1 : α))

(α : Type u_1)
[UniformSpace α]
[AddGroup α]
[UniformAddGroup α]

𝓤 α = Filter.comap (fun x => x.1 - x.2) (𝓝 0)


@[to_additive (attr := simp)]
theorem empty_smul (t : Finset β) : (∅ : Finset α) • t = ∅

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


protected theorem mul_min_mul_left (a b c : Nat) : min (a * b) (a * c) = a * min b c


theorem Nonempty.not_empty_toList {s : Finset α} (hs : s.Nonempty) : ¬s.toList.isEmpty

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


@[simp]
theorem interior_Ioi : interior (Ioi a) = Ioi a

{α : Type u}
[TopologicalSpace α]
[LinearOrder α]
[ClosedIicTopology α]
{a : α}


theorem condexpIndSMul_nonneg {E} [NormedLatticeAddCommGroup E] [NormedSpace ℝ E] [OrderedSMul ℝ E]
    [SigmaFinite (μ.trim hm)] (hs : MeasurableSet s) (hμs : μ s ≠ ∞) (x : E) (hx : 0 ≤ x) :
    (0 : α → E) ≤ᵐ[μ] condexpIndSMul hm hs hμs x

{α : Type u_1}
{m m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s : Set α}
{hm : m ≤ m0}
{E : Type u_10}
[NormedLatticeAddCommGroup E]
[NormedSpace ℝ E]
[OrderedSMul ℝ E]
[MeasureTheory.SigmaFinite (μ.trim hm)]
(hs : MeasurableSet s)
(hμs : μ s ≠ ⊤)
(x : E)
(hx : 0 ≤ x)

0 ≤ᵐ[μ] ↑↑(MeasureTheory.condexpIndSMul hm hs hμs x)


@[simp]
theorem equiv_comp_equiv_apply (x : L) :
    equiv j k p (equiv i j p x) = equiv i k p x

{K : Type u_1}
{L : Type u_2}
{M : Type u_3}
{N : Type u_4}
[CommRing K]
[CommRing L]
[CommRing M]
[CommRing N]
(i : K →+* L)
(j : K →+* M)
(k : K →+* N)
(p : ℕ)
[ExpChar K p]
[ExpChar L p]
[ExpChar M p]
[ExpChar N p]
[PerfectRing L p]
[IsPerfectClosure i p]
[PerfectRing M p]
[IsPerfectClosure j p]
[PerfectRing N p]
[IsPerfectClosure k p]
(x : L)

(IsPerfectClosure.equiv j k p) ((IsPerfectClosure.equiv i j p) x) = (IsPerfectClosure.equiv i k p) x


/-- an n-digit number in base b is less than b^n if b > 1 -/
theorem ofDigits_lt_base_pow_length {b : ℕ} {l : List ℕ} (hb : 1 < b) (hl : ∀ x ∈ l, x < b) :
    ofDigits b l < b ^ l.length


/-- A Sylow `p`-subgroup is a maximal `p`-subgroup. -/
structure Sylow extends Subgroup G where
  isPGroup' : IsPGroup p toSubgroup
  is_maximal' : ∀ {Q : Subgroup G}, IsPGroup p Q → toSubgroup ≤ Q → Q = toSubgroup

{p : ℕ}
{G : Type u_1}
[Group G]
(self : Sylow p G)


/-- A continuous function with compact support on a product space is measurable for the product
sigma-algebra. The subtlety is that we do not assume that the spaces are separable, so the
product of the Borel sigma algebras might not contain all open sets, but still it contains enough
of them to approximate compactly supported continuous functions. -/
lemma HasCompactSupport.measurable_of_prod
    [TopologicalSpace α] [PseudoMetrizableSpace α] [MeasurableSpace α] [BorelSpace α]
    {f : X × Y → α} (hf : Continuous f) (h'f : HasCompactSupport f) :
    Measurable f


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


@[simp]
theorem reindexRange_apply (x : range b) : b.reindexRange x = x

{ι : Type u_1}
{R : Type u_3}
{M : Type u_6}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(b : Basis ι R M)
(x : ↑(Set.range ⇑b))


/-- Special case of the **Four Functions Theorem** when `s = t = univ`. -/
lemma four_functions_theorem_univ (h₁ : 0 ≤ f₁) (h₂ : 0 ≤ f₂) (h₃ : 0 ≤ f₃) (h₄ : 0 ≤ f₄)
    (h : ∀ a b, f₁ a * f₂ b ≤ f₃ (a ⊓ b) * f₄ (a ⊔ b)) :
    (∑ a, f₁ a) * ∑ a, f₂ a ≤ (∑ a, f₃ a) * ∑ a, f₄ a

(f₁ f₂ f₃ f₄ : α → β)

(h : ∀ (a b : α), f₁ a * f₂ b ≤ f₃ (a ⊓ b) * f₄ (a ⊔ b))

(∑ a : α, f₁ a) * ∑ a : α, f₂ a ≤ (∑ a : α, f₃ a) * ∑ a : α, f₄ a


/--
If `q₁` and `q₂` when restricted to each subcategory `C i` agree, then `q₁` and `q₂` are isomorphic.
-/
@[simps]
def natIso {q₁ q₂ : (Σi, C i) ⥤ D} (h : ∀ i, incl i ⋙ q₁ ≅ incl i ⋙ q₂) : q₁ ≅ q₂

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

{q₁ q₂ : CategoryTheory.Functor ((i : I) × C i) D}

(h : (i : I) → (CategoryTheory.Sigma.incl i).comp q₁ ≅ (CategoryTheory.Sigma.incl i).comp q₂)

(CategoryTheory.Sigma.natIso h).hom = CategoryTheory.Sigma.natTrans fun i => (h i).hom


lemma strictMono_div_right_of_pos (ha : 0 < a) : StrictMono (· / a)

{α : Type u_2}
[LinearOrderedSemifield α]
{a : α}
(ha : 0 < a)


@[to_additive]
theorem map_le_map_iff_of_injective {f : G →* N} (hf : Function.Injective f) {H K : Subgroup G} :
    H.map f ≤ K.map f ↔ H ≤ K

{G : Type u_1}
[Group G]
{N : Type u_5}
[Group N]
{f : G →* N}
(hf : Function.Injective ⇑f)
{H K : Subgroup G}

Subgroup.map f H ≤ Subgroup.map f K ↔ H ≤ K


theorem disjSups_subset_left (ht : t₁ ⊆ t₂) : s ○ t₁ ⊆ s ○ t₂

{α : Type u_2}
[DecidableEq α]
[SemilatticeSup α]
[OrderBot α]
[DecidableRel Disjoint]
{s t₁ t₂ : Finset α}
(ht : t₁ ⊆ t₂)


@[simp]
theorem Matrix.mulVecLin_add [Fintype n] (M N : Matrix m n R) :
    (M + N).mulVecLin = M.mulVecLin + N.mulVecLin

{R : Type u_1}
[CommSemiring R]
{m : Type u_4}
{n : Type u_5}
[Fintype n]
(M N : Matrix m n R)


@[to_additive]
theorem leftInv_le_isUnit : S.leftInv ≤ IsUnit.submonoid M

{M : Type u_1}
[AddCommMonoid M]
(S : AddSubmonoid M)


@[simp]
theorem isCyclic_multiplicative_iff [AddGroup α] : IsCyclic (Multiplicative α) ↔ IsAddCyclic α


theorem isProj_averageMap : LinearMap.IsProj ρ.invariants ρ.averageMap

{k : Type u_1}
{G : Type u_2}
{V : Type u_3}
[CommSemiring k]
[Group G]
[AddCommMonoid V]
[Module k V]
(ρ : Representation k G V)
[Fintype G]
[Invertible ↑(Fintype.card G)]


@[simp] theorem UInt32.toNat_ofNat (n) :
    (no_index (OfNat.ofNat n) : UInt32).toNat = n % UInt32.size