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

{α : Type u_2}
[TopologicalSpace α]
(a : α)


/--
Given the commutative diagram
```
A --→ B
↑     ↑
|     |
R --→ S
```
The kernel of the presentation `⊕ₓ B dx ↠ Ω_{B/S}` is spanned by the image of the
kernel of `⊕ₓ A dx ↠ Ω_{A/R}` and all `ds` with `s : S`.
See `kerTotal_map'` for the special case where `R = S`.
-/
theorem KaehlerDifferential.kerTotal_map (h : Function.Surjective (algebraMap A B)) :
    (KaehlerDifferential.kerTotal R A).map finsupp_map ⊔
        Submodule.span A (Set.range fun x : S => .single (algebraMap S B x) (1 : B)) =
      (KaehlerDifferential.kerTotal S B).restrictScalars _

(h : Function.Surjective ⇑(algebraMap A B))

Submodule.map (Finsupp.mapRange.linearMap (Algebra.linearMap A B) ∘ₗ Finsupp.lmapDomain A A ⇑(algebraMap A B))
      (KaehlerDifferential.kerTotal R A) ⊔
    Submodule.span A (Set.range fun x => Finsupp.single ((algebraMap S B) x) 1) =
  Submodule.restrictScalars A (KaehlerDifferential.kerTotal S B)


/-- GCD monoid: a `CancelCommMonoidWithZero` with `gcd` (greatest common divisor) and
`lcm` (least common multiple) operations, determined up to a unit. The type class focuses on `gcd`
and we derive the corresponding `lcm` facts from `gcd`.
-/
class GCDMonoid (α : Type*) [CancelCommMonoidWithZero α] where
  /-- The greatest common divisor between two elements. -/
  gcd : α → α → α
  /-- The least common multiple between two elements. -/
  lcm : α → α → α
  /-- The GCD is a divisor of the first element. -/
  gcd_dvd_left : ∀ a b, gcd a b ∣ a
  /-- The GCD is a divisor of the second element. -/
  gcd_dvd_right : ∀ a b, gcd a b ∣ b
  /-- Any common divisor of both elements is a divisor of the GCD. -/
  dvd_gcd : ∀ {a b c}, a ∣ c → a ∣ b → a ∣ gcd c b
  /-- The product of two elements is `Associated` with the product of their GCD and LCM. -/
  gcd_mul_lcm : ∀ a b, Associated (gcd a b * lcm a b) (a * b)
  /-- `0` is left-absorbing. -/
  lcm_zero_left : ∀ a, lcm 0 a = 0
  /-- `0` is right-absorbing. -/
  lcm_zero_right : ∀ a, lcm a 0 = 0

{α : Type u_2}
[CancelCommMonoidWithZero α]
[self : GCDMonoid α]
(a b : α)


lemma Spec.map_appLE {U V} (e : U ≤ Spec.map f ⁻¹ᵁ V) :
    (Spec.map f).appLE V U e = StructureSheaf.comap f V U e

(e : U ≤ (TopologicalSpace.Opens.map (AlgebraicGeometry.Spec.map f).val.base).obj V)

AlgebraicGeometry.Scheme.Hom.appLE (AlgebraicGeometry.Spec.map f) V U e = AlgebraicGeometry.StructureSheaf.comap f V U e


/-- If `m s ≠ 0`, then for some point `x ∈ s` and any `t ∈ 𝓝[s] x` we have `0 < m t`. -/
@[deprecated exists_mem_forall_mem_nhdsWithin_pos_measure (since := "2024-05-14")]
theorem exists_mem_forall_mem_nhds_within_pos [TopologicalSpace α] [SecondCountableTopology α]
    (m : OuterMeasure α) {s : Set α} (hs : m s ≠ 0) : ∃ x ∈ s, ∀ t ∈ 𝓝[s] x, 0 < m t

{α : Type u_1}
[TopologicalSpace α]
[SecondCountableTopology α]
(m : MeasureTheory.OuterMeasure α)
{s : Set α}
(hs : m s ≠ 0)


theorem HasDerivAt.smul (hc : HasDerivAt c c' x) (hf : HasDerivAt f f' x) :
    HasDerivAt (fun y => c y • f y) (c x • f' + c' • f x) x

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


@[to_additive]
theorem mul_def [∀ i, Mul <| f i] : x * y = fun i => x i * y i

{I : Type u}
{f : I → Type v₁}
(x y : (i : I) → f i)
[(i : I) → Mul (f i)]


theorem BilinForm.toMatrix'_compLeft (B : BilinForm R₂ (n → R₂)) (f : (n → R₂) →ₗ[R₂] n → R₂) :
    BilinForm.toMatrix' (B.compLeft f) = (LinearMap.toMatrix' f)ᵀ * BilinForm.toMatrix' B

{R₂ : Type u_5}
[CommSemiring R₂]
{n : Type u_11}
[Fintype n]
[DecidableEq n]
(B : LinearMap.BilinForm R₂ (n → R₂))
(f : (n → R₂) →ₗ[R₂] n → R₂)

LinearMap.BilinForm.toMatrix' (B.compLeft f) = (LinearMap.toMatrix' f).transpose * LinearMap.BilinForm.toMatrix' B


theorem sum_comp_inl {P Q R : C} (f : (inl P : C ⊕ D) ⟶ inl Q) (g : (inl Q : C ⊕ D) ⟶ inl R) :
    @CategoryStruct.comp _ _ P Q R (f : P ⟶ Q) (g : Q ⟶ R) =
      @CategoryStruct.comp _ _ (inl P) (inl Q) (inl R) (f : P ⟶ Q) (g : Q ⟶ R)

(C : Type u₁)
[CategoryTheory.Category.{v₁, u₁} C]
(D : Type u₁)
[CategoryTheory.Category.{v₁, u₁} D]
{P Q R : C}
(f : Sum.inl P ⟶ Sum.inl Q)
(g : Sum.inl Q ⟶ Sum.inl R)

CategoryTheory.CategoryStruct.comp f g = CategoryTheory.CategoryStruct.comp f g


protected theorem isAtomic_iff [OrderBot α] [OrderBot β] (f : α ≃o β) :
    IsAtomic α ↔ IsAtomic β

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


theorem uIcc_subset_uIcc_iff_mem : [[a₁, b₁]] ⊆ [[a₂, b₂]] ↔ a₁ ∈ [[a₂, b₂]] ∧ b₁ ∈ [[a₂, b₂]]

{α : Type u_2}
[Lattice α]
[LocallyFiniteOrder α]
{a₁ a₂ b₁ b₂ : α}


lemma monotone_smul_left_of_nonneg [PosSMulMono α β] (ha : 0 ≤ a) : Monotone ((a • ·) : β → β)

{α : Type u_1}
{β : Type u_2}
{a : α}
[SMul α β]
[Preorder α]
[Preorder β]
[Zero α]
[PosSMulMono α β]
(ha : 0 ≤ a)


lemma StrictAnti.vecCons (hf : StrictAnti f) (ha : f 0 < a) : StrictAnti (vecCons a f)

{α : Type u_1}
[Preorder α]
{n : ℕ}
{f : Fin (n + 1) → α}
{a : α}
(hf : StrictAnti f)
(ha : f 0 < a)


@[norm_cast]
theorem algebraMap.coe_smul (A B C : Type*) [SMul A B] [CommSemiring B] [Semiring C] [Algebra B C]
    [SMul A C] [IsScalarTower A B C] (a : A) (b : B) : (a • b : B) = a • (b : C)

(A : Type u_1)
(B : Type u_2)
(C : Type u_3)
[SMul A B]
[CommSemiring B]
[Semiring C]
[Algebra B C]
[SMul A C]
[IsScalarTower A B C]
(a : A)
(b : B)


@[simp]
theorem symmDiff_eq_empty : s ∆ t = ∅ ↔ s = t


theorem surjective_iff_hasRightInverse : Surjective f ↔ HasRightInverse f

Function.Surjective f ↔ Function.HasRightInverse f


theorem ordConnected_pi {ι : Type*} {α : ι → Type*} [∀ i, Preorder (α i)] {s : Set ι}
    {t : ∀ i, Set (α i)} (h : ∀ i ∈ s, OrdConnected (t i)) : OrdConnected (s.pi t)

{ι : Type u_3}
{α : ι → Type u_4}
[(i : ι) → Preorder (α i)]
{s : Set ι}
{t : (i : ι) → Set (α i)}
(h : ∀ i ∈ s, (t i).OrdConnected)


theorem aemeasurable_Ioi_of_forall_Ioc {β} {mβ : MeasurableSpace β} [LinearOrder α]
    [(atTop : Filter α).IsCountablyGenerated] {x : α} {g : α → β}
    (g_meas : ∀ t > x, AEMeasurable g (μ.restrict (Ioc x t))) :
    AEMeasurable g (μ.restrict (Ioi x))

(g_meas : ∀ t > x, AEMeasurable g (μ.restrict (Set.Ioc x t)))


@[simp]
theorem bind₂_X_right (f : R →+* MvPolynomial σ S) (i : σ) : bind₂ f (X i) = X i

{σ : Type u_1}
{R : Type u_3}
{S : Type u_4}
[CommSemiring R]
[CommSemiring S]
(f : R →+* MvPolynomial σ S)
(i : σ)

(MvPolynomial.bind₂ f) (MvPolynomial.X i) = MvPolynomial.X i


@[to_additive (attr := simp)]
theorem subgroupOf_self : H.subgroupOf H = ⊤

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


theorem ofMultiset_apply_of_not_mem {a : α} (ha : a ∉ s) : ofMultiset s hs a = 0

{α : Type u_1}
{s : Multiset α}
(hs : s ≠ 0)
{a : α}
(ha : a ∉ s)


lemma ProjectiveResolution.leftDerivedToHomotopyCategory_app_eq
    {F G : C ⥤ D} [F.Additive] [G.Additive] (α : F ⟶ G) {X : C} (P : ProjectiveResolution X) :
    (NatTrans.leftDerivedToHomotopyCategory α).app X =
      (P.isoLeftDerivedToHomotopyCategoryObj F).hom ≫
        (HomotopyCategory.quotient _ _).map
          ((NatTrans.mapHomologicalComplex α _).app P.complex) ≫
          (P.isoLeftDerivedToHomotopyCategoryObj G).inv

(P : CategoryTheory.ProjectiveResolution X)

(CategoryTheory.NatTrans.leftDerivedToHomotopyCategory α).app X =
  CategoryTheory.CategoryStruct.comp (P.isoLeftDerivedToHomotopyCategoryObj F).hom
    (CategoryTheory.CategoryStruct.comp
      ((HomotopyCategory.quotient D (ComplexShape.down ℕ)).map
        ((CategoryTheory.NatTrans.mapHomologicalComplex α (ComplexShape.down ℕ)).app P.complex))
      (P.isoLeftDerivedToHomotopyCategoryObj G).inv)


lemma exact_iff_epi_kernel_lift [S.HasHomology] [HasKernel S.g] :
    S.Exact ↔ Epi (kernel.lift S.g S.f S.zero)

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Preadditive C]
(S : CategoryTheory.ShortComplex C)
[S.HasHomology]
[CategoryTheory.Limits.HasKernel S.g]

S.Exact ↔ CategoryTheory.Epi (CategoryTheory.Limits.kernel.lift S.g S.f ⋯)


lemma exists_leftFraction₃ {X Y : C} (f f' f'' : L.obj X ⟶ L.obj Y) :
    ∃ (φ : W.LeftFraction₃ X Y), f = φ.fst.map L (inverts L W) ∧
      f' = φ.snd.map L (inverts L W) ∧
      f'' = φ.thd.map L (inverts L W)

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_4, u_1} C]
[CategoryTheory.Category.{u_3, u_2} D]
(L : CategoryTheory.Functor C D)
(W : CategoryTheory.MorphismProperty C)
[L.IsLocalization W]
[W.HasLeftCalculusOfFractions]
{X Y : C}
(f f' f'' : L.obj X ⟶ L.obj Y)

∃ φ, f = φ.fst.map L ⋯ ∧ f' = φ.snd.map L ⋯ ∧ f'' = φ.thd.map L ⋯


lemma inv_def (q : ℚ≥0) : q⁻¹ = divNat q.den q.num


lemma map_le_iff (P : MorphismProperty C) {F : C ⥤ D} (Q : MorphismProperty D)
    [RespectsIso Q] :
    P.map F ≤ Q ↔ P ≤ Q.inverseImage F

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{D : Type u_1}
[CategoryTheory.Category.{u_2, u_1} D]
(P : CategoryTheory.MorphismProperty C)
{F : C ⥤ D}
(Q : CategoryTheory.MorphismProperty D)
[Q.RespectsIso]


/-- A prestructure is a first-order structure with a `Setoid` equivalence relation on it,
  such that quotienting by that equivalence relation is still a structure. -/
class Prestructure (s : Setoid M) where
  toStructure : L.Structure M
  fun_equiv : ∀ {n} {f : L.Functions n} (x y : Fin n → M), x ≈ y → funMap f x ≈ funMap f y
  rel_equiv : ∀ {n} {r : L.Relations n} (x y : Fin n → M) (_ : x ≈ y), RelMap r x = RelMap r y

{L : FirstOrder.Language}
{M : Type u_1}
{s : Setoid M}
[self : L.Prestructure s]
{n : ℕ}
{f : L.Functions n}
(x y : Fin n → M)

x ≈ y → FirstOrder.Language.Structure.funMap f x ≈ FirstOrder.Language.Structure.funMap f y


theorem exists_ideal_in_class_of_norm_le (C : ClassGroup (𝓞 K)) :
    ∃ I : (Ideal (𝓞 K))⁰, ClassGroup.mk0 I = C ∧
      Ideal.absNorm (I : Ideal (𝓞 K)) ≤ (4 / π) ^ NrComplexPlaces K *
        ((finrank ℚ K).factorial / (finrank ℚ K) ^ (finrank ℚ K) * Real.sqrt |discr K|)

(C : ClassGroup (NumberField.RingOfIntegers K))

∃ I,
  ClassGroup.mk0 I = C ∧
    ↑(Ideal.absNorm ↑I) ≤
      (4 / Real.pi) ^ NumberField.InfinitePlace.NrComplexPlaces K *
        (↑(FiniteDimensional.finrank ℚ K).factorial / ↑(FiniteDimensional.finrank ℚ K) ^ FiniteDimensional.finrank ℚ K *
          √|↑(NumberField.discr K)|)


theorem HasDerivAtFilter.congr_of_eventuallyEq (h : HasDerivAtFilter f f' x L) (hL : f₁ =ᶠ[L] f)
    (hx : f₁ x = f x) : HasDerivAtFilter f₁ f' x L

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f f₁ : 𝕜 → F}
{f' : F}
{x : 𝕜}
{L : Filter 𝕜}
(h : HasDerivAtFilter f f' x L)
(hL : f₁ =ᶠ[L] f)
(hx : f₁ x = f x)


theorem scaleRoots.isWeaklyEisensteinAt (p : R[X]) {x : R} {P : Ideal R} (hP : x ∈ P) :
    (scaleRoots p x).IsWeaklyEisensteinAt P

{R : Type u}
[CommRing R]
(p : R[X])
{x : R}
{P : Ideal R}
(hP : x ∈ P)


@[simp]
theorem toFinset_some {a : α} [Decidable (some a).Dom] : (some a).toFinset = {a}

{α : Type u_1}
{a : α}
[Decidable (Part.some a).Dom]


theorem integral_exp_neg_Ioi_zero : (∫ x : ℝ in Ioi 0, exp (-x)) = 1


@[to_additive]
theorem period_pos_of_exponent_pos (exp_pos : 0 < Monoid.exponent M) (m : M) (a : α) :
    0 < period m a

{α : Type v}
{M : Type u}
[Monoid M]
[MulAction M α]
(exp_pos : 0 < Monoid.exponent M)
(m : M)
(a : α)


@[norm_cast]
theorem tsum_coe (f : α → ℝ) : (∑' a, (f a : ℍ)) = ↑(∑' a, f a)


@[simp]
theorem eqOn_union : EqOn f₁ f₂ (s₁ ∪ s₂) ↔ EqOn f₁ f₂ s₁ ∧ EqOn f₁ f₂ s₂

{α : Type u_1}
{β : Type u_2}
{s₁ s₂ : Set α}
{f₁ f₂ : α → β}

Set.EqOn f₁ f₂ (s₁ ∪ s₂) ↔ Set.EqOn f₁ f₂ s₁ ∧ Set.EqOn f₁ f₂ s₂


@[simp]
theorem smeval_smul (r : R) : (r • p).smeval x = r • p.smeval x

(R : Type u_1)
[Semiring R]
(p : Polynomial R)
{S : Type u_2}
[AddCommMonoid S]
[Pow S ℕ]
[Module R S]
(x : S)
(r : R)


@[simp]
theorem Ici_diff_left : Ici a \ {a} = Ioi a


@[simp]
theorem coe_trans (e₁ : A₁ ≃ₐ[R] A₂) (e₂ : A₂ ≃ₐ[R] A₃) : ⇑(e₁.trans e₂) = e₂ ∘ e₁

{R : Type uR}
{A₁ : Type uA₁}
{A₂ : Type uA₂}
{A₃ : Type uA₃}
[CommSemiring R]
[Semiring A₁]
[Semiring A₂]
[Semiring A₃]
[Algebra R A₁]
[Algebra R A₂]
[Algebra R A₃]
(e₁ : A₁ ≃ₐ[R] A₂)
(e₂ : A₂ ≃ₐ[R] A₃)


lemma krullDim_eq_iSup_height : krullDim α = ⨆ (a : α), height α a


/-- The variant of `is_left_invariant_chaar` for `haarContent` -/
@[to_additive "The variant of `is_left_invariant_addCHaar` for `addHaarContent`"]
theorem is_left_invariant_haarContent {K₀ : PositiveCompacts G} (g : G) (K : Compacts G) :
    haarContent K₀ (K.map _ <| continuous_mul_left g) = haarContent K₀ K

{K₀ : TopologicalSpace.PositiveCompacts G}

(fun s => ↑((MeasureTheory.Measure.haar.addHaarContent K₀).toFun s))
    (TopologicalSpace.Compacts.map (fun b => g + b) ⋯ K) =
  (fun s => ↑((MeasureTheory.Measure.haar.addHaarContent K₀).toFun s)) K


theorem setPreimage_comp (g : β → γ) (f : α → β) :
    setPreimage (g ∘ f) = (setPreimage f).comp (setPreimage g)

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
(g : β → γ)
(f : α → β)

CompleteLatticeHom.setPreimage (g ∘ f) = (CompleteLatticeHom.setPreimage f).comp (CompleteLatticeHom.setPreimage g)


@[simp]
theorem isTop_top : IsTop (⊤ : α)


@[simp]
theorem iUnion_disjUnion (h : Disjoint π₁.iUnion π₂.iUnion) :
    (π₁.disjUnion π₂ h).iUnion = π₁.iUnion ∪ π₂.iUnion

{ι : Type u_1}
{I : BoxIntegral.Box ι}
{π₁ π₂ : BoxIntegral.Prepartition I}
(h : Disjoint π₁.iUnion π₂.iUnion)


theorem image_coev {y : Y} (s : Set X) : coev X Y y '' s = {y} ×ˢ s

{X : Type u_2}
{Y : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
{y : Y}
(s : Set X)

⇑(ContinuousMap.coev X Y y) '' s = {y} ×ˢ s


theorem cokernel_not_iso_of_nonzero (w : f ≠ 0) : IsIso (cokernel.π f) → False

CategoryTheory.IsIso (CategoryTheory.Limits.cokernel.π f) → False


theorem totalDegree_sub_C_le (p : MvPolynomial σ R) (r : R) :
    totalDegree (p - C r) ≤ totalDegree p

{R : Type u}
{σ : Type u_1}
[CommRing R]
(p : MvPolynomial σ R)
(r : R)

(p - MvPolynomial.C r).totalDegree ≤ p.totalDegree


theorem exists_eq_pow_mul_of_is_compact_of_quasi_separated_space_aux (X : Scheme)
    (S : X.affineOpens) (U₁ U₂ : X.Opens) {n₁ n₂ : ℕ} {y₁ : Γ(X, U₁)}
    {y₂ : Γ(X, U₂)} {f : Γ(X, U₁ ⊔ U₂)}
    {x : Γ(X, X.basicOpen f)} (h₁ : S.1 ≤ U₁) (h₂ : S.1 ≤ U₂)
    (e₁ : y₁ |_ X.basicOpen (f |_ U₁) = ((f |_ U₁ |_ X.basicOpen _) ^ n₁) * x |_ X.basicOpen _)
    (e₂ : y₂ |_ X.basicOpen (f |_ U₂) = ((f |_ U₂ |_ X.basicOpen _) ^ n₂) * x |_ X.basicOpen _) :
    ∃ n : ℕ, ∀ m, n ≤ m →
      ((f |_ U₁) ^ (m + n₂) * y₁) |_ S.1 = ((f |_ U₂) ^ (m + n₁) * y₂) |_ S.1

(e₁ :
  (y₁ |_ X.basicOpen ((f |_ U₁) ⋯)) ⋯ =
    ((f |_ U₁) ⋯ |_ X.basicOpen ((f |_ U₁) ⋯)) ⋯ ^ n₁ * (x |_ X.basicOpen ((f |_ U₁) ⋯)) ⋯)

(e₂ :
  (y₂ |_ X.basicOpen ((f |_ U₂) ⋯)) ⋯ =
    ((f |_ U₂) ⋯ |_ X.basicOpen ((f |_ U₂) ⋯)) ⋯ ^ n₂ * (x |_ X.basicOpen ((f |_ U₂) ⋯)) ⋯)


theorem cos_nat_mul_two_pi (n : ℕ) : cos (n * (2 * π)) = 1


/-- To prove something about polynomials,
it suffices to show the condition is closed under taking sums,
and it holds for monomials.
-/
@[elab_as_elim]
protected theorem induction_on' {M : R[X] → Prop} (p : R[X]) (h_add : ∀ p q, M p → M q → M (p + q))
    (h_monomial : ∀ (n : ℕ) (a : R), M (monomial n a)) : M p

(h_add : ∀ (p q : Polynomial R), M p → M q → M (p + q))

(h_monomial : ∀ (n : ℕ) (a : R), M ((Polynomial.monomial n) a))


@[simp] lemma natDegree_X_mul (hp : p ≠ 0) : natDegree (X * p) = natDegree p + 1

{R : Type u}
[Semiring R]
[Nontrivial R]
{p : R[X]}
(hp : p ≠ 0)

(Polynomial.X * p).natDegree = p.natDegree + 1


/-- The gaussian distribution pdf integrates to 1 when the variance is not zero.  -/
lemma lintegral_gaussianPDFReal_eq_one (μ : ℝ) {v : ℝ≥0} (h : v ≠ 0) :
    ∫⁻ x, ENNReal.ofReal (gaussianPDFReal μ v x) = 1

∫⁻ (x : ℝ), ENNReal.ofReal (ProbabilityTheory.gaussianPDFReal μ v x) = 1


@[to_additive (attr := simp)]
theorem mul_apply [∀ i, Mul <| f i] : (x * y) i = x i * y i

{I : Type u}
{f : I → Type v₁}
(x y : (i : I) → f i)
(i : I)
[(i : I) → Mul (f i)]


@[simp, rclike_simps]
theorem conj_re (z : K) : re (conj z) = re z

RCLike.re ((starRingEnd K) z) = RCLike.re z


theorem add_one_pos (i : Fin (n + 1)) (h : i < Fin.last n) : (0 : Fin (n + 1)) < i + 1

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


/-- `UniqueProd` is preserved under multiplicative equivalences. -/
@[to_additive "`UniqueSums` is preserved under additive equivalences."]
theorem _root_.MulEquiv.uniqueProds_iff (f : G ≃* H) : UniqueProds G ↔ UniqueProds H

{G : Type u}
{H : Type v}
[Add G]
[Add H]
(f : G ≃+ H)


@[to_additive]
theorem isUnit_singleton (a : α) : IsUnit ({a} : Finset α)

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


/-- This typeclass says that all closed intervals in `α` are compact. This is true for all
conditionally complete linear orders with order topology and products (finite or infinite)
of such spaces. -/
class CompactIccSpace (α : Type*) [TopologicalSpace α] [Preorder α] : Prop where
  /-- A closed interval `Set.Icc a b` is a compact set for all `a` and `b`. -/
  isCompact_Icc : ∀ {a b : α}, IsCompact (Icc a b)

{α : Type u_1}
[TopologicalSpace α]
[Preorder α]
[self : CompactIccSpace α]
{a b : α}


@[simp]
theorem k_mul_j : q.k * q.j = c₂ • q.i

{R : Type u_1}
{A : Type u_2}
[CommRing R]
[Ring A]
[Algebra R A]
{c₁ c₂ : R}
(q : QuaternionAlgebra.Basis A c₁ c₂)


@[simp, rclike_simps]
theorem re_to_real {x : ℝ} : reR x = x


@[simp] theorem down_lt [LT α] {a b : ULift α} : down a < down b ↔ a < b

{α : Type u}
[LT α]
{a b : ULift.{u_1, u} α}


theorem row_eq_prod {μ : YoungDiagram} {i : ℕ} : μ.row i = {i} ×ˢ Finset.range (μ.rowLen i)


theorem congr_trans (f₁ : A ≃ₐ[S] B) (f₂ : B ≃ₐ[S] C) (g₁ : D ≃ₐ[R] E) (g₂ : E ≃ₐ[R] F) :
    congr (f₁.trans f₂) (g₁.trans g₂) = (congr f₁ g₁).trans (congr f₂ g₂)

{R : Type uR}
{S : Type uS}
{A : Type uA}
{B : Type uB}
{C : Type uC}
{D : Type uD}
{E : Type uE}
{F : Type uF}
[CommSemiring R]
[CommSemiring S]
[Algebra R S]
[Semiring A]
[Algebra R A]
[Algebra S A]
[IsScalarTower R S A]
[Semiring B]
[Algebra R B]
[Algebra S B]
[IsScalarTower R S B]
[Semiring C]
[Algebra R C]
[Algebra S C]
[IsScalarTower R S C]
[Semiring D]
[Algebra R D]
[Semiring E]
[Algebra R E]
[Semiring F]
[Algebra R F]
(f₁ : A ≃ₐ[S] B)
(f₂ : B ≃ₐ[S] C)
(g₁ : D ≃ₐ[R] E)
(g₂ : E ≃ₐ[R] F)

Algebra.TensorProduct.congr (f₁.trans f₂) (g₁.trans g₂) =
  (Algebra.TensorProduct.congr f₁ g₁).trans (Algebra.TensorProduct.congr f₂ g₂)


lemma _root_.Set.Sized.uvCompression (huv : u.card = v.card) (h𝒜 : (𝒜 : Set (Finset α)).Sized r) :
    (𝓒 u v 𝒜 : Set (Finset α)).Sized r

{α : Type u_1}
[DecidableEq α]
{𝒜 : Finset (Finset α)}
{u v : Finset α}
{r : ℕ}
(huv : u.card = v.card)
(h𝒜 : Set.Sized r ↑𝒜)


theorem rightAdjointMate_comp {X Y Z : C} [HasRightDual X] [HasRightDual Y] {f : X ⟶ Y}
    {g : Xᘁ ⟶ Z} :
    fᘁ ≫ g =
      (ρ_ (Yᘁ)).inv ≫
        _ ◁ η_ X (Xᘁ) ≫ _ ◁ (f ⊗ g) ≫ (α_ (Yᘁ) Y Z).inv ≫ ε_ Y (Yᘁ) ▷ _ ≫ (λ_ Z).hom

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.MonoidalCategory C]
{X Y Z : C}
[CategoryTheory.HasRightDual X]
[CategoryTheory.HasRightDual Y]
{f : X ⟶ Y}
{g : Xᘁ ⟶ Z}

fᘁ ≫ g = (ρ_ Yᘁ).inv ≫ Yᘁ ◁ η_ X Xᘁ ≫ Yᘁ ◁ (f ⊗ g) ≫ (α_ Yᘁ Y Z).inv ≫ ε_ Y Yᘁ ▷ Z ≫ (λ_ Z).hom


@[to_additive]
theorem mul_left_injective (a : G) : Function.Injective (· * a)

{G : Type u_3}
[Mul G]
[IsRightCancelMul G]
(a : G)


theorem map_homCongr {X Y X₁ Y₁ : C} (α : X ≅ X₁) (β : Y ≅ Y₁) (f : X ⟶ Y) :
    F.map (Iso.homCongr α β f) = Iso.homCongr (F.mapIso α) (F.mapIso β) (F.map f)

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{D : Type u₁}
[CategoryTheory.Category.{v₁, u₁} D]
(F : CategoryTheory.Functor C D)
{X Y X₁ Y₁ : C}
(α : X ≅ X₁)
(β : Y ≅ Y₁)
(f : X ⟶ Y)

F.map ((α.homCongr β) f) = ((F.mapIso α).homCongr (F.mapIso β)) (F.map f)


theorem update_comp_eq_of_not_mem_range' {α : Sort*} {β : Type*} {γ : β → Sort*} [DecidableEq β]
    (g : ∀ b, γ b) {f : α → β} {i : β} (a : γ i) (h : i ∉ Set.range f) :
    (fun j => update g i a (f j)) = fun j => g (f j)

{α : Sort u_6}
{β : Type u_7}
{γ : β → Sort u_8}
[DecidableEq β]
(g : (b : β) → γ b)
{f : α → β}
{i : β}
(a : γ i)
(h : i ∉ Set.range f)

(fun j => Function.update g i a (f j)) = fun j => g (f j)


@[fun_prop]
theorem hasFDerivWithinAt_apply (i : ι) (f : ∀ i, F' i) (s' : Set (∀ i, F' i)) :
    HasFDerivWithinAt (𝕜 := 𝕜) (fun f : ∀ i, F' i => f i) (proj i) s' f

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{ι : Type u_6}
[Fintype ι]
{F' : ι → Type u_7}
[(i : ι) → NormedAddCommGroup (F' i)]
[(i : ι) → NormedSpace 𝕜 (F' i)]
(i : ι)
(f : (i : ι) → F' i)
(s' : Set ((i : ι) → F' i))

HasFDerivWithinAt (fun f => f i) (ContinuousLinearMap.proj i) s' f


theorem prod_eq_prod_of_nonempty'
    {eX eX' : PartialHomeomorph X X'} {eY eY' : PartialHomeomorph Y Y'}
    (h : (eX'.prod eY').source.Nonempty) : eX.prod eY = eX'.prod eY' ↔ eX = eX' ∧ eY = eY'

{X : Type u_1}
{X' : Type u_2}
{Y : Type u_3}
{Y' : Type u_4}
[TopologicalSpace X]
[TopologicalSpace X']
[TopologicalSpace Y]
[TopologicalSpace Y']
{eX eX' : PartialHomeomorph X X'}
{eY eY' : PartialHomeomorph Y Y'}
(h : (eX'.prod eY').source.Nonempty)


@[simp]
theorem sum_fintype [Fintype ι] (μ : ι → Measure α) : sum μ = ∑ i, μ i

{α : Type u_1}
{ι : Type u_5}
{m0 : MeasurableSpace α}
[Fintype ι]
(μ : ι → MeasureTheory.Measure α)

MeasureTheory.Measure.sum μ = ∑ i : ι, μ i


/-- Assumes left strict covariance. -/
theorem Left.mul_lt_mul_of_nonneg [PosMulStrictMono α] [MulPosMono α]
    (h₁ : a < b) (h₂ : c < d) (a0 : 0 ≤ a) (c0 : 0 ≤ c) : a * c < b * d

{α : Type u_1}
{a b c d : α}
[MulZeroClass α]
[Preorder α]
[PosMulStrictMono α]
[MulPosMono α]
(h₁ : a < b)
(h₂ : c < d)
(a0 : 0 ≤ a)
(c0 : 0 ≤ c)


/-- Adding a point to a collinear set produces a coplanar set. -/
theorem Collinear.coplanar_insert {s : Set P} (h : Collinear k s) (p : P) :
    Coplanar k (insert p s)

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[DivisionRing k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{s : Set P}
(h : Collinear k s)
(p : P)


@[simp]
theorem mulHead_head {i j : ι} (w : NeWord M i j) (x : M i) (hnotone : x * w.head ≠ 1) :
    (mulHead w x hnotone).head = x * w.head

{ι : Type u_1}
{M : ι → Type u_2}
[(i : ι) → Monoid (M i)]
{i j : ι}
(w : Monoid.CoprodI.NeWord M i j)
(x : M i)
(hnotone : x * w.head ≠ 1)


@[norm_cast]
theorem lt_to_nat {m n : Num} : (m : ℕ) < n ↔ m < n


/-- Given a left exact sequence `0 → M → M' → M''`, if `r` is regular on both
`M` and `M''` it's regular `M'` too. -/
lemma isSMulRegular_of_range_eq_ker {f : M →ₗ[R] M'} {g : M' →ₗ[R] M''}
    (hf : Function.Injective f) (hfg : LinearMap.range f = LinearMap.ker g)
    (h1 : IsSMulRegular M r) (h2 : IsSMulRegular M'' r) :
    IsSMulRegular M' r


@[simp]
theorem derivative_X : derivative (X : R[X]) = 1


/-- We say `C` has strict terminal objects if every terminal object is strict, ie given any morphism
`f : I ⟶ A` where `I` is terminal, then `f` is an isomorphism.

Strictly speaking, this says that *any* terminal object must be strict, rather than that strict
terminal objects exist.
-/
class HasStrictTerminalObjects : Prop where
  out : ∀ {I A : C} (f : I ⟶ A), IsTerminal I → IsIso f

[self : CategoryTheory.Limits.HasStrictTerminalObjects C]

CategoryTheory.Limits.IsTerminal I → CategoryTheory.IsIso f


@[to_additive]
theorem range_eq_map (f : G →* N) : f.range = (⊤ : Subgroup G).map f

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


@[to_additive]
theorem IsLowerSet.div_left (ht : IsLowerSet t) : IsUpperSet (s / t)

{α : Type u_1}
[OrderedCommGroup α]
{s t : Set α}
(ht : IsLowerSet t)


theorem linear_proj_add_linearProjOfIsCompl_eq_self (hpq : IsCompl p q) (x : E) :
    (p.linearProjOfIsCompl q hpq x + q.linearProjOfIsCompl p hpq.symm x : E) = x

{R : Type u_1}
[Ring R]
{E : Type u_2}
[AddCommGroup E]
[Module R E]
{p q : Submodule R E}
(hpq : IsCompl p q)
(x : E)

↑((p.linearProjOfIsCompl q hpq) x) + ↑((q.linearProjOfIsCompl p ⋯) x) = x


theorem size_pos {n : ℕ} : 0 < size n ↔ 0 < n


@[simp] lemma coe_untop : ∀ (x : WithTop α) hx, x.untop hx = x

{α : Type u_1}
(x : WithTop α)
(hx : x ≠ ⊤)


/-- The `Kleisli` category of a `Control.Monad` is equivalent to the `Kleisli` category of its
category-theoretic version, provided the monad is lawful.
-/
@[simps]
def eq : KleisliCat m ≌ Kleisli (ofTypeMonad m)

(m : Type u → Type u)
[Monad m]
[LawfulMonad m]

∀ {X Y : CategoryTheory.KleisliCat m} (f : X ⟶ Y) (a : X), (CategoryTheory.eq m).functor.map f a = f a


theorem lim_eq_zero_iff (f : CauSeq β abv) : lim f = 0 ↔ LimZero f

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


@[to_additive]
lemma mem_stabilizer_set {s : Set α} : a ∈ stabilizer G s ↔ ∀ b, a • b ∈ s ↔ b ∈ s

{G : Type u_1}
{α : Type u_3}
[Group G]
[MulAction G α]
{a : G}
{s : Set α}

a ∈ MulAction.stabilizer G s ↔ ∀ (b : α), a • b ∈ s ↔ b ∈ s


@[simp]
theorem comp_toNatTrans_lax {F G H : LaxMonoidalFunctor C D} {α : F ⟶ G} {β : G ⟶ H} :
    (α ≫ β).toNatTrans = @CategoryStruct.comp (C ⥤ D) _ _ _ _ α.toNatTrans β.toNatTrans

{F G H : CategoryTheory.LaxMonoidalFunctor C D}

(α ≫ β).toNatTrans = α.toNatTrans ≫ β.toNatTrans


/-- A side of a right-angled triangle divided by the cosine of the adjacent angle equals the
hypotenuse, version subtracting vectors. -/
theorem norm_div_cos_angle_sub_of_inner_eq_zero {x y : V} (h : ⟪x, y⟫ = 0) (h0 : x ≠ 0 ∨ y = 0) :
    ‖x‖ / Real.cos (angle x (x - y)) = ‖x - y‖

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

‖x‖ / Real.cos (InnerProductGeometry.angle x (x - y)) = ‖x - y‖


theorem measure_add_measure_compl (h : MeasurableSet s) : μ s + μ sᶜ = μ univ

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s : Set α}
(h : MeasurableSet s)


@[simp] theorem utf8Len_cons (c cs) : utf8Len (c :: cs) = utf8Len cs + c.utf8Size

String.utf8Len (c :: cs) = String.utf8Len cs + c.utf8Size


@[simp]
theorem erase_same {a : α} {f : α →₀ M} : (f.erase a) a = 0

{α : Type u_1}
{M : Type u_5}
[Zero M]
{a : α}
{f : α →₀ M}


theorem IsLocalExtr.comp_continuousOn [TopologicalSpace δ] {s : Set δ} (g : δ → α) {b : δ}
    (hf : IsLocalExtr f (g b)) (hg : ContinuousOn g s) (hb : b ∈ s) : IsLocalExtrOn (f ∘ g) s b

{α : Type u}
{β : Type v}
{δ : Type x}
[TopologicalSpace α]
[Preorder β]
{f : α → β}
[TopologicalSpace δ]
{s : Set δ}
(g : δ → α)
{b : δ}
(hf : IsLocalExtr f (g b))
(hg : ContinuousOn g s)
(hb : b ∈ s)


theorem preVal_eq_zero {x : ModP K v O hv p} : preVal K v O hv p x = 0 ↔ x = 0

{K : Type u₁}
[Field K]
{v : Valuation K ℝ≥0}
{O : Type u₂}
[CommRing O]
[Algebra O K]
{hv : v.Integers O}
{p : ℕ}
{x : ModP K v O hv p}


@[simp]
theorem arg_conj_coe_angle (x : ℂ) : (arg (conj x) : Real.Angle) = -arg x


/-- When `i = j`, projections `Pi.eval C i` and `Pi.eval C j` are related by the equivalence
`Pi.eqToEquivalence C h : C i ≌ C j`. -/
@[simps!]
def Pi.evalCompEqToEquivalenceFunctor {i j : I} (h : i = j) :
    Pi.eval C i ⋙ (Pi.eqToEquivalence C h).functor ≅
      Pi.eval C j

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

(CategoryTheory.Pi.evalCompEqToEquivalenceFunctor C h).inv = CategoryTheory.eqToHom ⋯


theorem map_inf [SemilatticeInf β] (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 α]
[SemilatticeInf β]
(hf : MonotoneOn f s)
(hx : x ∈ s)
(hy : y ∈ s)


protected theorem sum_inner_mul_inner (b : OrthonormalBasis ι 𝕜 E) (x y : E) :
    ∑ i, ⟪x, b i⟫ * ⟪b i, y⟫ = ⟪x, y⟫

{ι : Type u_1}
{𝕜 : Type u_3}
[RCLike 𝕜]
{E : Type u_4}
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[Fintype ι]
(b : OrthonormalBasis ι 𝕜 E)
(x y : E)

∑ i : ι, ⟪x, b i⟫_𝕜 * ⟪b i, y⟫_𝕜 = ⟪x, y⟫_𝕜


/-- A predictable submartingale is a.e. greater equal than its initial state. -/
theorem Submartingale.zero_le_of_predictable [Preorder E] [SigmaFiniteFiltration μ 𝒢]
    {f : ℕ → Ω → E} (hfmgle : Submartingale f 𝒢 μ) (hfadp : Adapted 𝒢 fun n => f (n + 1)) (n : ℕ) :
    f 0 ≤ᵐ[μ] f n

(hfmgle : MeasureTheory.Submartingale f 𝒢 μ)

(hfadp : MeasureTheory.Adapted 𝒢 fun n => f (n + 1))


@[simp]
theorem compl_map (f : α ≃o β) (s : LowerSet α) : (map f s).compl = UpperSet.map f s.compl

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
(f : α ≃o β)
(s : LowerSet α)

((LowerSet.map f) s).compl = (UpperSet.map f) s.compl


@[to_additive]
theorem le_or_le_of_mul_le_mul [CovariantClass α α (· * ·) (· < ·)]
    [CovariantClass α α (Function.swap (· * ·)) (· < ·)] {a₁ a₂ b₁ b₂ : α} :
    a₁ * b₁ ≤ a₂ * b₂ → a₁ ≤ a₂ ∨ b₁ ≤ b₂

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

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

a₁ * b₁ ≤ a₂ * b₂ → a₁ ≤ a₂ ∨ b₁ ≤ b₂


theorem ae_lt_of_essSup_lt (hx : essSup f μ < x)
    (hf : IsBoundedUnder (· ≤ ·) (ae μ) f := by isBoundedDefault) :
    ∀ᵐ y ∂μ, f y < x

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


@[simp]
lemma cocycleOfDegreewiseSplit_triangleRotateShortComplexSplitting_v (p : ℤ) :
    (cocycleOfDegreewiseSplit _ (triangleRotateShortComplexSplitting φ)).1.v p _ rfl =
      -φ.f _

(↑(CochainComplex.cocycleOfDegreewiseSplit (CochainComplex.mappingCone.triangleRotateShortComplex φ)
          (CochainComplex.mappingCone.triangleRotateShortComplexSplitting φ))).v
    p (p + 1) ⋯ =
  -φ.f (p + { as := 1 }.as)


theorem condition (S : J.Cover X) : S.sieve ∈ J X

{J : CategoryTheory.GrothendieckTopology C}


theorem diophPFun_vec (f : Vector3 ℕ n →. ℕ) : DiophPFun f ↔ Dioph {v | f.graph (v ∘ fs, v fz)}

Dioph.DiophPFun f ↔ Dioph {v | f.graph (v ∘ Fin2.fs, v Fin2.fz)}


@[simp]
theorem ofFn_get : ∀ l : List α, (ofFn (get l)) = l


theorem isPiSystem_image_Iio (s : Set α) : IsPiSystem (Iio '' s)

{α : Type u_1}
[LinearOrder α]
(s : Set α)


lemma toMvPolynomial_totalDegree_le (M : Matrix m n R) (i : m) :
    (M.toMvPolynomial i).totalDegree ≤ 1

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


@[simp]
theorem support_mul_X (s : σ) (p : MvPolynomial σ R) :
    (p * X s).support = p.support.map (addRightEmbedding (Finsupp.single s 1))

{R : Type u}
{σ : Type u_1}
[CommSemiring R]
(s : σ)
(p : MvPolynomial σ R)

(p * MvPolynomial.X s).support = Finset.map (addRightEmbedding (Finsupp.single s 1)) p.support


/-- Finite sums of analytic functions are analytic -/
theorem Finset.analyticAt_sum {f : α → E → F} {c : E}
    (N : Finset α) (h : ∀ n ∈ N, AnalyticAt 𝕜 (f n) c) :
    AnalyticAt 𝕜 (fun z ↦ ∑ n ∈ N, f n z) c

{α : Type u_1}
{𝕜 : Type u_2}
[NontriviallyNormedField 𝕜]
{E : Type u_3}
{F : Type u_4}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : α → E → F}
{c : E}
(N : Finset α)
(h : ∀ n ∈ N, AnalyticAt 𝕜 (f n) c)

AnalyticAt 𝕜 (fun z => ∑ n ∈ N, f n z) c


theorem add_sub_sub_add_right (n m k l : Nat) :
    (n + l) - m - (k + l) = n - m - k


@[to_additive]
theorem smulAntidiagonal_mono_right (h : t₁ ⊆ t₂) :
    smulAntidiagonal s t₁ a ⊆ smulAntidiagonal s t₂ a

{G : Type u_1}
{P : Type u_2}
[SMul G P]
{s : Set G}
{t₁ t₂ : Set P}
{a : P}
(h : t₁ ⊆ t₂)

s.smulAntidiagonal t₁ a ⊆ s.smulAntidiagonal t₂ a


theorem dvd_mul_sub_mul {k a b x y : α} (hab : k ∣ a - b) (hxy : k ∣ x - y) :
    k ∣ a * x - b * y

{α : Type u_1}
[NonUnitalCommRing α]
{k a b x y : α}
(hab : k ∣ a - b)
(hxy : k ∣ x - y)


@[simp, norm_cast]
theorem coe_mul (x y : ℝ) : (↑(x * y) : EReal) = x * y


@[simp]
lemma disjoint_partialSups_right [DistribLattice α] [OrderBot α] {f : ℕ → α} {n : ℕ} {x : α} :
    Disjoint x (partialSups f n) ↔ ∀ k ≤ n, Disjoint x (f k)

{α : Type u_1}
[DistribLattice α]
[OrderBot α]
{f : ℕ → α}
{n : ℕ}
{x : α}

Disjoint x ((partialSups f) n) ↔ ∀ k ≤ n, Disjoint x (f k)


theorem LipschitzWith.to_rightInverse [PseudoEMetricSpace α] [PseudoEMetricSpace β] {K : ℝ≥0}
    {f : α → β} (hf : LipschitzWith K f) {g : β → α} (hg : Function.RightInverse g f) :
    AntilipschitzWith K g

{α : Type u_1}
{β : Type u_2}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
{K : ℝ≥0}
{f : α → β}
(hf : LipschitzWith K f)
{g : β → α}
(hg : Function.RightInverse g f)


@[reassoc (attr := simp)]
theorem inl_pushoutLeftPushoutInrIso_inv :
    pushout.inl _ _ ≫ (pushoutLeftPushoutInrIso f g g').inv = pushout.inl _ _ ≫ pushout.inl _ _

[CategoryTheory.Limits.HasPushout (CategoryTheory.Limits.pushout.inr f g) g']

[CategoryTheory.Limits.HasPushout f (g ≫ g')]

CategoryTheory.Limits.pushout.inl f (g ≫ g') ≫ (CategoryTheory.Limits.pushoutLeftPushoutInrIso f g g').inv =
  CategoryTheory.Limits.pushout.inl f g ≫ CategoryTheory.Limits.pushout.inl (CategoryTheory.Limits.pushout.inr f g) g'


@[simp]
theorem map_F (m : α → β) {f : Filter α} (F : f.Realizer) (s) : (F.map m).F s = image m (F.F s)

{α : Type u_1}
{β : Type u_2}
(m : α → β)
{f : Filter α}
(F : f.Realizer)
(s : (Filter.Realizer.map m F).σ)

(Filter.Realizer.map m F).F.f s = m '' F.F.f s


protected theorem add_pos {a b : Int} (ha : 0 < a) (hb : 0 < b) : 0 < a + b


@[reassoc (attr := simp)]
lemma inv_hom_id_hom_app (e : F ≅ G) (n : A) (X : C) :
    (e.inv.hom n).app X ≫ (e.hom.hom n).app X = 𝟙 _

{F G : CategoryTheory.SingleFunctors C D A}

(e.inv.hom n).app X ≫ (e.hom.hom n).app X = 𝟙 ((G.functor n).obj X)


theorem isLeftDescent_inv_iff {w : W} {i : B} :
    cs.IsLeftDescent w⁻¹ i ↔ cs.IsRightDescent w i

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


@[to_additive (attr := simp)]
protected lemma inv_mul_cancel_left (h : IsUnit a) : ∀ b, a⁻¹ * (a * b) = b

{α : Type u}
[SubtractionMonoid α]
{a : α}
(h : IsAddUnit a)
(b : α)


@[to_additive]
theorem mem_torsion (g : G) : g ∈ torsion G ↔ IsOfFinOrder g

g ∈ AddCommGroup.torsion G ↔ IsOfFinAddOrder g


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

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


@[simp]
theorem mapMatrix_id : (AddMonoidHom.id α).mapMatrix = AddMonoidHom.id (Matrix m n α)

{m : Type u_2}
{n : Type u_3}
{α : Type v}
[AddZeroClass α]


/-- Reversing the order of the points passed to `oangle` negates the angle. -/
theorem oangle_rev (p₁ p₂ p₃ : P) : ∡ p₃ p₂ p₁ = -∡ p₁ p₂ p₃

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

∡ p₃ p₂ p₁ = -∡ p₁ p₂ p₃


theorem card_uIcc : (uIcc a b).card = ∏ i, (uIcc (a i) (b i)).card

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

(Finset.uIcc a b).card = ∏ i : ι, (Finset.uIcc (a i) (b i)).card


lemma Odd.pow (ha : Odd a) : ∀ {n : ℕ}, Odd (a ^ n)

{α : Type u_2}
[Semiring α]
{a : α}
(ha : Odd a)
{n : ℕ}


theorem FinitaryExtensive.isVanKampen_finiteCoproducts [FinitaryExtensive C] {ι : Type*}
    [Finite ι] {F : Discrete ι ⥤ C} {c : Cocone F} (hc : IsColimit c) : IsVanKampenColimit c

{F : CategoryTheory.Functor (CategoryTheory.Discrete ι) C}

(hc : CategoryTheory.Limits.IsColimit c)


theorem subset_cons (h : a ∉ s) : s ⊆ s.cons a h

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


/-- The value of the Infimum of a nonempty family of outer measures on a set is not simply
the minimum value of a measure on that set: it is the infimum sum of measures of countable set of
sets that covers that set, where a different measure can be used for each set in the cover. -/
theorem biInf_apply' {ι} (I : Set ι) (m : ι → OuterMeasure α) {s : Set α} (hs : s.Nonempty) :
    (⨅ i ∈ I, m i) s = ⨅ (t : ℕ → Set α) (_ : s ⊆ iUnion t), ∑' n, ⨅ i ∈ I, m i (t n)

{α : Type u_1}
{ι : Type u_2}
(I : Set ι)
(m : ι → MeasureTheory.OuterMeasure α)
{s : Set α}
(hs : s.Nonempty)

(⨅ i ∈ I, m i) s = ⨅ t, ⨅ (_ : s ⊆ Set.iUnion t), ∑' (n : ℕ), ⨅ i ∈ I, (m i) (t n)


@[simp]
theorem factorThru_add_sub_factorThru_left {X Y : C} {P : Subobject Y} (f g : X ⟶ Y)
    (w : P.Factors (f + g)) (wf : P.Factors f) :
    P.factorThru (f + g) w - P.factorThru f wf =
      P.factorThru g (factors_right_of_factors_add f g w wf)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.Preadditive C]
{X Y : C}
{P : CategoryTheory.Subobject Y}
(f g : X ⟶ Y)
(w : P.Factors (f + g))
(wf : P.Factors f)

P.factorThru (f + g) w - P.factorThru f wf = P.factorThru g ⋯


@[reassoc (attr := simp)]
lemma opShiftFunctorEquivalence_unitIso_inv_naturality (n : ℤ) {X Y : Cᵒᵖ} (f : X ⟶ Y) :
    (f⟦n⟧').unop⟦n⟧'.op ≫ (opShiftFunctorEquivalence C n).unitIso.inv.app Y =
      (opShiftFunctorEquivalence C n).unitIso.inv.app X ≫ f

(C : Type u_1)
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.HasShift C ℤ]
(n : ℤ)
{X Y : Cᵒᵖ}
(f : X ⟶ Y)

CategoryTheory.CategoryStruct.comp
    ((CategoryTheory.shiftFunctor C n).map ((CategoryTheory.shiftFunctor Cᵒᵖ n).map f).unop).op
    ((CategoryTheory.Pretriangulated.opShiftFunctorEquivalence C n).unitIso.inv.app Y) =
  CategoryTheory.CategoryStruct.comp ((CategoryTheory.Pretriangulated.opShiftFunctorEquivalence C n).unitIso.inv.app X)
    f


theorem assert_defined {p : Prop} {f : p → Part α} : ∀ h : p, (f h).Dom → (assert p f).Dom

{α : Type u_1}
{p : Prop}
{f : p → Part α}
(h : p)


lemma subst_into_add {α} [AddCommMonoid α] (l r tl tr t)
    (prl : (l : α) = tl) (prr : r = tr) (prt : tl + tr = t) : l + r = t

{α : Type u_1}
[AddCommMonoid α]
(l r tl tr t : α)
(prl : l = tl)
(prr : r = tr)
(prt : tl + tr = t)


theorem const_pos (n : ℕ) (h : Nat.ble 1 n = true) : 0 < (n.rawCast : ℕ)


theorem mem_lieSpan {x : L} : x ∈ lieSpan R L s ↔ ∀ K : LieSubalgebra R L, s ⊆ K → x ∈ K

{R : Type u}
{L : Type v}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
{s : Set L}
{x : L}

x ∈ LieSubalgebra.lieSpan R L s ↔ ∀ (K : LieSubalgebra R L), s ⊆ ↑K → x ∈ K


theorem differentiableWithinAt_dslope_of_ne (h : b ≠ a) :
    DifferentiableWithinAt 𝕜 (dslope f a) s b ↔ DifferentiableWithinAt 𝕜 f s b

{𝕜 : Type u_1}
{E : Type u_2}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{f : 𝕜 → E}
{a b : 𝕜}
{s : Set 𝕜}
(h : b ≠ a)


theorem binomial_succ_succ [DecidableEq α] (h : a ≠ b) :
    multinomial {a, b} (Function.update (Function.update f a (f a).succ) b (f b).succ) =
      multinomial {a, b} (Function.update f a (f a).succ) +
      multinomial {a, b} (Function.update f b (f b).succ)

{α : Type u_1}
{f : α → ℕ}
{a b : α}
[DecidableEq α]
(h : a ≠ b)

Nat.multinomial {a, b} (Function.update (Function.update f a (f a).succ) b (f b).succ) =
  Nat.multinomial {a, b} (Function.update f a (f a).succ) + Nat.multinomial {a, b} (Function.update f b (f b).succ)


@[to_additive (attr := simp)]
protected theorem map_inv : f.map Inv.inv = f⁻¹


theorem and_or_distrib_right : ∀ (x y z : Bool), ((x || y) && z) = (x && z || y && z)


@[to_additive]
theorem Step.sublist (H : Red.Step L₁ L₂) : Sublist L₂ L₁

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


/-- In a semi-`NormedSpace`, a continuous seminorm is zero on elements of norm `0`. -/
lemma map_eq_zero_of_norm_zero (q : Seminorm 𝕜 F)
    (hq : Continuous q) {x : F} (hx : ‖x‖ = 0) : q x = 0

{𝕜 : Type u_1}
{F : Type u_6}
[NontriviallyNormedField 𝕜]
[SeminormedAddCommGroup F]
[NormedSpace 𝕜 F]
(q : Seminorm 𝕜 F)
(hq : Continuous ⇑q)
{x : F}
(hx : ‖x‖ = 0)


theorem leftOp {W : MorphismProperty C} {L : C ⥤ Dᵒᵖ} (h : W.IsInvertedBy L) :
    W.op.IsInvertedBy L.leftOp

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{D : Type u'}
[CategoryTheory.Category.{v', u'} D]
{W : CategoryTheory.MorphismProperty C}
{L : CategoryTheory.Functor C Dᵒᵖ}
(h : W.IsInvertedBy L)


theorem map_commSq (s : CommSq f g h i) : CommSq (F.map f) (F.map g) (F.map h) (F.map i)

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
{D : Type u_2}
[CategoryTheory.Category.{u_4, u_2} D]
(F : CategoryTheory.Functor C D)
{W X Y Z : C}
{f : W ⟶ X}
{g : W ⟶ Y}
{h : X ⟶ Z}
{i : Y ⟶ Z}
(s : CategoryTheory.CommSq f g h i)

CategoryTheory.CommSq (F.map f) (F.map g) (F.map h) (F.map i)


theorem zeta_mul_apply {f : ArithmeticFunction ℕ} {x : ℕ} : (ζ * f) x = ∑ i ∈ divisors x, f i

(ArithmeticFunction.zeta * f) x = ∑ i ∈ x.divisors, f i


@[simp] lemma exp_lt_one_iff {a : EReal} : exp a < 1 ↔ a < 0


@[simp, norm_cast] lemma coe_inf (a b : L) : a ⊓ b = (a : α) ⊓ b

{α : Type u_2}
[Lattice α]
{L : Sublattice α}
(a b : ↥L)


theorem contractRight_eq (x : CliffordAlgebra Q) :
    contractRight (Q := Q) x d = reverse (contractLeft (R := R) (M := M) d <| reverse x)

{R : Type u1}
[CommRing R]
{M : Type u2}
[AddCommGroup M]
[Module R M]
{Q : QuadraticForm R M}
(d : Module.Dual R M)
(x : CliffordAlgebra Q)

(CliffordAlgebra.contractRight x) d =
  CliffordAlgebra.reverse ((CliffordAlgebra.contractLeft d) (CliffordAlgebra.reverse x))


theorem add_singleton_eq_iff {s t : Multiset α} {a : α} : s + {a} = t ↔ a ∈ t ∧ s = t.erase a

{α : Type u_1}
[DecidableEq α]
{s t : Multiset α}
{a : α}


theorem stoppedValue_stoppedValue_leastGE (f : ℕ → Ω → ℝ) (π : Ω → ℕ) (r : ℝ) {n : ℕ}
    (hπn : ∀ ω, π ω ≤ n) : stoppedValue (fun i => stoppedValue f (leastGE f r i)) π =
      stoppedValue (stoppedProcess f (leastGE f r n)) π

{Ω : Type u_1}
(f : ℕ → Ω → ℝ)
(π : Ω → ℕ)
(r : ℝ)
{n : ℕ}
(hπn : ∀ (ω : Ω), π ω ≤ n)

MeasureTheory.stoppedValue (fun i => MeasureTheory.stoppedValue f (MeasureTheory.leastGE f r i)) π =
  MeasureTheory.stoppedValue (MeasureTheory.stoppedProcess f (MeasureTheory.leastGE f r n)) π


@[simp]
protected theorem measure_univ : volume (Set.univ : Set (AddCircle T)) = ENNReal.ofReal T

MeasureTheory.volume Set.univ = ENNReal.ofReal T


/-- **Roth's theorem** for finite abelian groups.

The maximum density of a 3AP-free set in `G` goes to zero as `|G|` tends to infinity. -/
theorem roth_3ap_theorem (ε : ℝ) (hε : 0 < ε) (hG : cornersTheoremBound ε ≤ card G)
    (A : Finset G) (hAε : ε * card G ≤ A.card) : ¬ ThreeAPFree (A : Set G)

(hG : cornersTheoremBound ε ≤ Fintype.card G)


@[reassoc (attr := simp)]
theorem kernelIsoOfEq_inv_comp_ι {f g : X ⟶ Y} [HasKernel f] [HasKernel g] (h : f = g) :
    (kernelIsoOfEq h).inv ≫ kernel.ι _ = kernel.ι _

(CategoryTheory.Limits.kernelIsoOfEq h).inv ≫ CategoryTheory.Limits.kernel.ι f = CategoryTheory.Limits.kernel.ι g


lemma functorPushforward_functor (S : Sieve X) (e : C ≌ D) :
    S.functorPushforward e.functor = (S.pullback (e.unitInv.app X)).functorPullback e.inverse

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{X : C}
(S : CategoryTheory.Sieve X)
(e : C ≌ D)

CategoryTheory.Sieve.functorPushforward e.functor S =
  CategoryTheory.Sieve.functorPullback e.inverse (CategoryTheory.Sieve.pullback (e.unitInv.app X) S)


/-- Forgetting the action of `L`, the spaces `weightSpace M χ` and `shiftedWeightSpace R L M χ` are
equivalent. -/
@[simps!] def shift : weightSpace M χ ≃ₗ[R] shiftedWeightSpace R L M χ

(R : Type u_1)
(L : Type u_2)
(M : Type u_3)
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
[LieAlgebra.IsNilpotent R L]
(χ : L → R)
(a : ↥↑(LieModule.weightSpace M χ))

(LieModule.shiftedWeightSpace.shift R L M χ) a = a


/-- A graded version of `NonUnitalNonAssocSemiring`. -/
class GNonUnitalNonAssocSemiring [Add ι] [∀ i, AddCommMonoid (A i)] extends
  GradedMonoid.GMul A where
  /-- Multiplication from the right with any graded component's zero vanishes. -/
  mul_zero : ∀ {i j} (a : A i), mul a (0 : A j) = 0
  /-- Multiplication from the left with any graded component's zero vanishes. -/
  zero_mul : ∀ {i j} (b : A j), mul (0 : A i) b = 0
  /-- Multiplication from the right between graded components distributes with respect to
  addition. -/
  mul_add : ∀ {i j} (a : A i) (b c : A j), mul a (b + c) = mul a b + mul a c
  /-- Multiplication from the left between graded components distributes with respect to
  addition. -/
  add_mul : ∀ {i j} (a b : A i) (c : A j), mul (a + b) c = mul a c + mul b c

[self : DirectSum.GNonUnitalNonAssocSemiring A]

GradedMonoid.GMul.mul a (b + c) = GradedMonoid.GMul.mul a b + GradedMonoid.GMul.mul a c


@[to_additive]
theorem prod_trunc {M : Type*} [CommMonoid M] {a b : ℕ} (f : Fin (a + b) → M)
    (hf : ∀ j : Fin b, f (natAdd a j) = 1) :
    (∏ i : Fin (a + b), f i) = ∏ i : Fin a, f (castLE (Nat.le.intro rfl) i)

(hf : ∀ (j : Fin b), f (Fin.natAdd a j) = 0)

∑ i : Fin (a + b), f i = ∑ i : Fin a, f (Fin.castLE ⋯ i)


/-- The infimum of a family of invariant submodule of an endomorphism is also an invariant
submodule. -/
theorem _root_.LinearMap.iInf_invariant {σ : R →+* R} [RingHomSurjective σ] {ι : Sort*}
    (f : M →ₛₗ[σ] M) {p : ι → Submodule R M} (hf : ∀ i, ∀ v ∈ p i, f v ∈ p i) :
    ∀ v ∈ iInf p, f v ∈ iInf p

{R : Type u_1}
{M : Type u_5}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{σ : R →+* R}
[RingHomSurjective σ]
{ι : Sort u_10}
(f : M →ₛₗ[σ] M)
{p : ι → Submodule R M}
(hf : ∀ (i : ι), ∀ v ∈ p i, f v ∈ p i)
(v : M)


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

∀ {x : NonAssocSemiring α} {x_1 : NonAssocSemiring β} (f : α →+* β) (f' : α → β) (h : f' = ⇑f), ⇑(f.copy f' h) = f'


theorem toFinmap_cons (a : α) (b : β a) (xs : List (Sigma β)) :
    List.toFinmap (⟨a, b⟩ :: xs) = insert a b xs.toFinmap

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

(⟨a, b⟩ :: xs).toFinmap = Finmap.insert a b xs.toFinmap


protected theorem Nat.lt_trans {n m k : Nat} (h₁ : LT.lt n m) : LT.lt m k → LT.lt n k


@[simp]
theorem coe_smul (r : R) (f : NormedAddGroupHom V₁ V₂) : ⇑(r • f) = r • ⇑f

{V₁ : Type u_2}
{V₂ : Type u_3}
[SeminormedAddCommGroup V₁]
[SeminormedAddCommGroup V₂]
{R : Type u_5}
[MonoidWithZero R]
[DistribMulAction R V₂]
[PseudoMetricSpace R]
[BoundedSMul R V₂]
(r : R)
(f : NormedAddGroupHom V₁ V₂)


@[simp]
theorem map_id (K : PositiveCompacts α) : K.map id continuous_id IsOpenMap.id = K

(K : TopologicalSpace.PositiveCompacts α)

TopologicalSpace.PositiveCompacts.map id ⋯ ⋯ K = K


@[reassoc (attr := simp)]
theorem inr_inl_pushoutLeftPushoutInrIso_hom :
    pushout.inr _ _ ≫ pushout.inl _ _ ≫ (pushoutLeftPushoutInrIso f g g').hom =
      g' ≫ pushout.inr _ _

[CategoryTheory.Limits.HasPushout (CategoryTheory.Limits.pushout.inr f g) g']

[CategoryTheory.Limits.HasPushout f (g ≫ g')]

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


theorem mem_assert {p : Prop} {f : p → Part α} : ∀ {a} (h : p), a ∈ f h → a ∈ assert p f

{α : Type u_1}
{p : Prop}
{f : p → Part α}
{a : α}
(h : p)


@[simp] lemma univ_inter (s : Finset α) : univ ∩ s = s

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


@[simp] lemma primeFactors_one : primeFactors 1 = ∅


/-- The pigeonhole principle for finitely many pigeons counted by heads: there is a pigeonhole with
at most as many pigeons as the floor of the average number of pigeons across all pigeonholes. -/
theorem exists_card_fiber_lt_of_card_lt_nsmul (ht : ↑s.card < t.card • b) :
    ∃ y ∈ t, ↑(s.filter fun x => f x = y).card < b

{α : Type u}
{β : Type v}
{M : Type w}
[DecidableEq β]
{s : Finset α}
{t : Finset β}
{f : α → β}
{b : M}
[LinearOrderedCommSemiring M]
(ht : ↑s.card < t.card • b)

∃ y ∈ t, ↑(Finset.filter (fun x => f x = y) s).card < b


theorem liftP_iff_of_isUniform (h : q.IsUniform) {α : TypeVec n} (x : F α) (p : ∀ i, α i → Prop) :
    LiftP p x ↔ ∀ (i), ∀ u ∈ supp x i, p i u

{n : ℕ}
{F : TypeVec.{u} n → Type u_1}
[q : MvQPF F]
(h : MvQPF.IsUniform)
{α : TypeVec.{u} n}
(x : F α)
(p : (i : Fin2 n) → α i → Prop)

MvFunctor.LiftP p x ↔ ∀ (i : Fin2 n), ∀ u ∈ MvFunctor.supp x i, p i u


/-- A complete lower-modular lattice that is coatomistic is strongly coatomic.
Not an instance to prevent loops. -/
theorem CompleteLattice.isStronglyCoatomic [IsLowerModularLattice α] [IsCoatomistic α] :
    IsStronglyCoatomic α

{α : Type u_2}
[CompleteLattice α]
[IsLowerModularLattice α]
[IsCoatomistic α]


theorem integral_eq (f : α → E) (hf : Integrable f μ) : ∫ a, f a ∂μ = L1.integral (hf.toL1 f)

{α : Type u_1}
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[hE : CompleteSpace E]
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
(f : α → E)
(hf : MeasureTheory.Integrable f μ)

∫ (a : α), f a ∂μ = MeasureTheory.L1.integral (MeasureTheory.Integrable.toL1 f hf)


/-- If `g : M → N` is an additive map and `f` is a box additive map, then `g ∘ f` is a box additive
map. -/
@[simps (config := .asFn)]
def map (f : ι →ᵇᵃ[I₀] M) (g : M →+ N) : ι →ᵇᵃ[I₀] N

{ι : Type u_1}
{M : Type u_2}
{N : Type u_3}
[AddCommMonoid M]
[AddCommMonoid N]
{I₀ : WithTop (BoxIntegral.Box ι)}
(f : BoxIntegral.BoxAdditiveMap ι M I₀)
(g : M →+ N)


/-- The functor `Square C ⥤ Arrow (Arrow C)` which sends a
commutative square `sq` to the obvious arrow from the top morphism of `sq`
to the bottom morphism of `sq`. -/
@[simps!]
def toArrowArrowFunctor' : Square C ⥤ Arrow (Arrow C)

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

∀ {X Y : CategoryTheory.Square C} (φ : X ⟶ Y), (CategoryTheory.Square.toArrowArrowFunctor'.map φ).right.right = φ.τ₄


theorem toFinset_eq (n : Nodup l) : @Finset.mk α l n = l.toFinset

{α : Type u_1}
[DecidableEq α]
{l : List α}
(n : l.Nodup)


@[simp]
theorem not_nonempty_empty : ¬(∅ : Finset α).Nonempty


/-- The data of a localized category with a given universe
for the morphisms.  -/
class HasLocalization where
  /-- the objects of the localized category. -/
  {D : Type u}
  /-- the category structure. -/
  [hD : Category.{w} D]
  /-- the localization functor. -/
  L : C ⥤ D
  [hL : L.IsLocalization W]

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{W : CategoryTheory.MorphismProperty C}
[self : W.HasLocalization]


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

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

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


/-- `comulAlgHom R A` is the comultiplication of the `R`-bialgebra `A`, as an `R`-algebra map. -/
@[simps!]
def comulAlgHom : A →ₐ[R] A ⊗[R] A

(R : Type u)
(A : Type v)
[CommSemiring R]
[Semiring A]
[Bialgebra R A]
(a : A)

(Bialgebra.comulAlgHom R A) a = Coalgebra.comul a


theorem gt_asymm (h : cmp x y = .gt) : cmp y x ≠ .gt

∀ {x : Sort u_1} {cmp : x → x → Ordering} [inst : Batteries.TransCmp cmp] {x_1 y : x},
  cmp x_1 y = Ordering.gt → cmp y x_1 ≠ Ordering.gt


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

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[TopologicalSpace β]
[Zero β]
(f : α →C₀ β)
(f' : α → β)
(h : f' = ⇑f)


/-- The subfunctor of `F` obtained by restricting to the preimages of a set `s ∈ F.obj i`. -/
@[simps]
def toPreimages : J ⥤ Type v

{J : Type u}
[CategoryTheory.Category.{u_1, u} J]
(F : J ⥤ Type v)
{i : J}
(s : Set (F.obj i))
(j : J)

(F.toPreimages s).obj j = ↑(⋂ f, F.map f ⁻¹' s)


theorem toNonUnitalSubalgebra_le_iff {S₁ S₂ : NonUnitalStarSubalgebra R A} :
    S₁.toNonUnitalSubalgebra ≤ S₂.toNonUnitalSubalgebra ↔ S₁ ≤ S₂

{R : Type u}
{A : Type v}
[CommSemiring R]
[NonUnitalNonAssocSemiring A]
[Module R A]
[Star A]
{S₁ S₂ : NonUnitalStarSubalgebra R A}


/-- We say that a type has `MeasurableNeg` if `x ↦ -x` is a measurable function. -/
class MeasurableNeg (G : Type*) [Neg G] [MeasurableSpace G] : Prop where
  measurable_neg : Measurable (Neg.neg : G → G)

{G : Type u_2}
[Neg G]
[MeasurableSpace G]
[self : MeasurableNeg G]


theorem abs_cos_eq_of_two_zsmul_eq {θ ψ : Angle} (h : (2 : ℤ) • θ = (2 : ℤ) • ψ) :
    |cos θ| = |cos ψ|


theorem closure_eq_preimage_closure_image (hf : Inducing f) (s : Set X) :
    closure s = f ⁻¹' closure (f '' s)

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


@[to_additive]
protected theorem Inducing.topologicalGroup {F : Type*} [Group H] [TopologicalSpace H]
    [FunLike F H G] [MonoidHomClass F H G] (f : F) (hf : Inducing f) : TopologicalGroup H

{G : Type w}
{H : Type x}
[TopologicalSpace G]
[AddGroup G]
[TopologicalAddGroup G]
{F : Type u_1}
[AddGroup H]
[TopologicalSpace H]
[FunLike F H G]
[AddMonoidHomClass F H G]
(f : F)
(hf : Inducing ⇑f)


theorem gal_X_isSolvable : IsSolvable (X : F[X]).Gal


/--
If a series `a₀ -r→ a₁ -r→ ...` has positive length, then `a₁ -r→ ...` is another series
-/
@[simps]
def tail (p : RelSeries r) (len_pos : p.length ≠ 0) : RelSeries r

{α : Type u_1}
{r : Rel α α}
(p : RelSeries r)
(len_pos : p.length ≠ 0)

∀ (a : Fin (p.length - 1 + 1)), (p.tail len_pos).toFun a = (Fin.tail p.toFun ∘ Fin.cast ⋯) a


theorem lt.step {n m : Nat} : n < m → n < succ m


lemma finiteCoproduct.ι_injective (a : α) : Function.Injective (finiteCoproduct.ι X a)

{α : Type w}
[Finite α]
(X : α → LightProfinite)
(a : α)

Function.Injective ⇑(LightProfinite.finiteCoproduct.ι X a)


@[to_additive (attr := simp)]
theorem one_apply [One β] (x : α) : (1 : C(α, β)) x = 1

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
[Zero β]
(x : α)


lemma bitwise_eq_binaryRec (f : Bool → Bool → Bool) :
    bitwise f =
    binaryRec (fun n => cond (f false true) n 0) fun a m Ia =>
      binaryRec (cond (f true false) (bit a m) 0) fun b n _ => bit (f a b) (Ia n)

Nat.bitwise f =
  Nat.binaryRec (fun n => bif f false true then n else 0) fun a m Ia =>
    Nat.binaryRec (bif f true false then Nat.bit a m else 0) fun b n x => Nat.bit (f a b) (Ia n)


theorem norm_nonneg (x : L) : 0 ≤ norm x

{L : Type u_2}
[Field L]
{Γ₀ : Type u_3}
[LinearOrderedCommGroupWithZero Γ₀]
[val : Valued L Γ₀]
[hv : Valued.v.RankOne]
(x : L)


@[simp]
theorem sin_add_pi (x : ℝ) : sin (x + π) = -sin x


theorem quotient_map_comp_mkₐ {I : Ideal A} (J : Ideal B) (f : A →ₐ[R₁] B) (H : I ≤ J.comap f) :
    (quotientMapₐ J f H).comp (Quotient.mkₐ R₁ I) = (Quotient.mkₐ R₁ J).comp f

{R₁ : Type u_1}
{A : Type u_3}
{B : Type u_4}
[CommSemiring R₁]
[CommRing A]
[Algebra R₁ A]
[CommRing B]
[Algebra R₁ B]
{I : Ideal A}
(J : Ideal B)
(f : A →ₐ[R₁] B)
(H : I ≤ Ideal.comap f J)

(Ideal.quotientMapₐ J f H).comp (Ideal.Quotient.mkₐ R₁ I) = (Ideal.Quotient.mkₐ R₁ J).comp f


theorem pred_lt_castPred_iff {a b : Fin (n + 1)} (ha : a ≠ 0) (hb : b ≠ last n) :
    pred a ha < castPred b hb ↔ a ≤ b

{n : ℕ}
{a b : Fin (n + 1)}
(ha : a ≠ 0)
(hb : b ≠ Fin.last n)


protected theorem point_finite (x : X) : { i | f i x ≠ 0 }.Finite

{ι : Type u}
{X : Type v}
[TopologicalSpace X]
{s : Set X}
(f : BumpCovering ι X s)
(x : X)


protected lemma le_or_lt (a b : ℤ) : a ≤ b ∨ b < a


theorem let_body_congr {α : Sort u} {β : α → Sort v} {b b' : (a : α) → β a}
    (a : α) (h : ∀ x, b x = b' x) : (let x := a; b x) = (let x := a; b' x)

{α : Sort u}
{β : α → Sort v}
{b b' : (a : α) → β a}
(a : α)
(h : ∀ (x : α), b x = b' x)

(let x := a;
  b x) =
  let x := a;
  b' x


theorem image_smul_setₛₗ :
    h '' (c • s) = σ c • h '' s

{R : Type u_1}
{S : Type u_2}
(M : Type u_3)
(N : Type u_6)
[Monoid R]
[Monoid S]
(σ : R → S)
[MulAction R M]
[MulAction S N]
{F : Type u_7}
(h : F)
[FunLike F M N]
[MulActionSemiHomClass F σ M N]
(c : R)
(s : Set M)


@[simp]
theorem sUnion_diff_singleton_empty (s : Set (Set α)) : ⋃₀(s \ {∅}) = ⋃₀s


theorem transpose_list_prod [CommSemiring α] [Fintype m] [DecidableEq m] (l : List (Matrix m m α)) :
    l.prodᵀ = (l.map transpose).reverse.prod

{m : Type u_2}
{α : Type v}
[CommSemiring α]
[Fintype m]
[DecidableEq m]
(l : List (Matrix m m α))

l.prodᵀ = (List.map Matrix.transpose l).reverse.prod


theorem norm_sum_neg_one_pow_le (n : ℕ) : ‖∑ i ∈ range n, (-1 : ℝ) ^ i‖ ≤ 1


@[simp]
theorem map_bot (f : K →+* L) : (⊥ : Subfield K).map f = ⊥

{K : Type u}
{L : Type v}
[DivisionRing K]
[DivisionRing L]
(f : K →+* L)


@[to_additive]
theorem hausdorffMeasure_smul {α : Type*} [SMul α X] [IsometricSMul α X] {d : ℝ} (c : α)
    (h : 0 ≤ d ∨ Surjective (c • · : X → X)) (s : Set X) : μH[d] (c • s) = μH[d] s

(h : 0 ≤ d ∨ Function.Surjective fun x => c +ᵥ x)


theorem mem_cocountable {s : Set α} :
    s ∈ cocountable ↔ (sᶜ : Set α).Countable


@[simp]
theorem comp_continuous_iff {α : Type*} [TopologicalSpace α] {g : α → E} :
    Continuous (f ∘ g) ↔ Continuous g

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


/-- Every split mono `f` with a cokernel induces a binary bicone with `f` as its `inl` and
the cokernel map as its `snd`.
We will show in `is_bilimit_binary_bicone_of_split_mono_of_cokernel` that this binary bicone is in
fact already a biproduct. -/
@[simps]
def binaryBiconeOfIsSplitMonoOfCokernel {X Y : C} {f : X ⟶ Y} [IsSplitMono f] {c : CokernelCofork f}
    (i : IsColimit c) : BinaryBicone X c.pt

{c : CategoryTheory.Limits.CokernelCofork f}

(CategoryTheory.Limits.binaryBiconeOfIsSplitMonoOfCokernel i).inr =
  let c' := CategoryTheory.Limits.CokernelCofork.ofπ (CategoryTheory.Limits.Cofork.π c) ⋯;
  let i' := CategoryTheory.Limits.isCokernelEpiComp i (CategoryTheory.retraction f) ⋯;
  let i'' := CategoryTheory.Preadditive.isColimitCoforkOfCokernelCofork i';
  (CategoryTheory.Limits.splitEpiOfIdempotentOfIsColimitCofork C ⋯ i'').section_


@[simp]
lemma id' (A : CommMon_ C) : (𝟙 A : A.toMon_ ⟶ A.toMon_) = 𝟙 (A.toMon_)

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


@[to_additive (attr := simp)]
theorem comp_one [MulOneClass M] [MulOneClass N] [MulOneClass P] (f : N →* P) :
    f.comp (1 : M →* N) = 1

{M : Type u_4}
{N : Type u_5}
{P : Type u_6}
[MulOneClass M]
[MulOneClass N]
[MulOneClass P]
(f : N →* P)


theorem BddBelow.finite_of_bddAbove [Preorder α] [LocallyFiniteOrder α]
    {s : Set α} (h₀ : BddBelow s) (h₁ : BddAbove s) :
    s.Finite

{α : Type u_3}
[Preorder α]
[LocallyFiniteOrder α]
{s : Set α}
(h₀ : BddBelow s)
(h₁ : BddAbove s)


@[to_additive]
theorem inl_injective : Injective (inl : M →* M ∗ N)

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


@[reassoc (attr := simp)]
theorem whiskerLeft_inv_hom (f : a ⟶ b) {g h : b ⟶ c} (η : g ≅ h) :
    f ◁ η.inv ≫ f ◁ η.hom = 𝟙 (f ≫ h)

{B : Type u}
[CategoryTheory.Bicategory B]
{a b c : B}
(f : a ⟶ b)
{g h : b ⟶ c}
(η : g ≅ h)

CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.whiskerLeft f η.inv)
    (CategoryTheory.Bicategory.whiskerLeft f η.hom) =
  CategoryTheory.CategoryStruct.id (CategoryTheory.CategoryStruct.comp f h)


/-- Given two subgroups `H' ⊆ H`, there exists a right transversal to `H'` inside `H`. -/
@[to_additive "Given two subgroups `H' ⊆ H`, there exists a transversal to `H'` inside `H`"]
lemma exists_right_transversal_of_le {H' H : Subgroup G} (h : H' ≤ H) :
    ∃ S : Set G, H' * S = H ∧ Nat.card H' * Nat.card S = Nat.card H

{G : Type u_1}
[Group G]
{H' H : Subgroup G}
(h : H' ≤ H)

∃ S, ↑H' * S = ↑H ∧ Nat.card ↥H' * Nat.card ↑S = Nat.card ↥H


theorem step_isSpecial (hs : u.IsSpecial) : u.step.IsSpecial


/--
As `0` is the default value for `Real.sSup` of the empty set or sets which are not bounded above, it
suffices to show that `f i` is nonnegative to show that `0 ≤ ⨆ i, f i`.
-/
protected theorem iSup_nonneg {ι : Sort*} {f : ι → ℝ} (hf : ∀ i, 0 ≤ f i) : 0 ≤ ⨆ i, f i

{ι : Sort u_1}
{f : ι → ℝ}
(hf : ∀ (i : ι), 0 ≤ f i)


theorem le_stable (s : Seq α) {m n} (h : m ≤ n) : s.get? m = none → s.get? n = none

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


/-- Nested intervals lemma: if `[f n, g n]` is an antitone sequence of nonempty
closed intervals, then `⨆ n, f n` belongs to all the intervals `[f n, g n]`. -/
theorem ciSup_mem_iInter_Icc_of_antitone_Icc [SemilatticeSup β] {f g : β → α}
    (h : Antitone fun n => Icc (f n) (g n)) (h' : ∀ n, f n ≤ g n) :
    (⨆ n, f n) ∈ ⋂ n, Icc (f n) (g n)

(h : Antitone fun n => Set.Icc (f n) (g n))


theorem mem_idealOfCofinals : p ∈ idealOfCofinals p 𝒟

{P : Type u_1}
[Preorder P]
(p : P)
{ι : Type u_2}
[Encodable ι]
(𝒟 : ι → Order.Cofinal P)


lemma chromaticNumber_eq_iInf {G : SimpleGraph V} :
    G.chromaticNumber = ⨅ n : {m | G.Colorable m}, (n : ℕ∞)


@[simp]
theorem order_single (h : r ≠ 0) : (single a r).order = a

{Γ : Type u_1}
{R : Type u_2}
[PartialOrder Γ]
[Zero R]
{a : Γ}
{r : R}
[Zero Γ]
(h : r ≠ 0)


@[elab_as_elim]
protected theorem induction_on₂ {δ : Quot r → Quot s → Prop} (q₁ : Quot r) (q₂ : Quot s)
    (h : ∀ a b, δ (Quot.mk r a) (Quot.mk s b)) : δ q₁ q₂

(h : ∀ (a : α) (b : β), δ (Quot.mk r a) (Quot.mk s b))


theorem lt_antisymm' [LT α]
    (lt_antisymm : ∀ {x y : α}, ¬x < y → ¬y < x → x = y)
    {l₁ l₂ : List α} (h₁ : ¬l₁ < l₂) (h₂ : ¬l₂ < l₁) : l₁ = l₂


/-- A real function which is monotone on a set is differentiable Lebesgue-almost everywhere on
this set. This version assumes that `s` is measurable and uses `volume.restrict s`.
For a formulation without measurability assumption,
see `MonotoneOn.ae_differentiableWithinAt_of_mem`. -/
theorem MonotoneOn.ae_differentiableWithinAt {f : ℝ → ℝ} {s : Set ℝ} (hf : MonotoneOn f s)
    (hs : MeasurableSet s) : ∀ᵐ x ∂volume.restrict s, DifferentiableWithinAt ℝ f s x

∀ᵐ (x : ℝ) ∂MeasureTheory.volume.restrict s, DifferentiableWithinAt ℝ f s x


@[simp]
theorem toList_node (s l x r) : toList (@node α s l x r) = toList l ++ x :: toList r

{α : Type u_1}
(s : ℕ)
(l : Ordnode α)
(x : α)
(r : Ordnode α)

(Ordnode.node s l x r).toList = l.toList ++ x :: r.toList


@[simp]
theorem content_X : content (X : R[X]) = 1

{R : Type u_1}
[CommRing R]
[IsDomain R]
[NormalizedGCDMonoid R]


/-- In an R₀ space, the closure of a finite set is a compact set. -/
theorem Set.Finite.isCompact_closure {s : Set X} (hs : s.Finite) : IsCompact (closure s)

{X : Type u_1}
[TopologicalSpace X]
[R0Space X]
{s : Set X}
(hs : s.Finite)


/-- We say that the action of `M` on `α` has `MeasurableVAdd₂` if the map
`(c, x) ↦ c +ᵥ x` is a measurable function. -/
class MeasurableVAdd₂ (M α : Type*) [VAdd M α] [MeasurableSpace M] [MeasurableSpace α] :
    Prop where
  measurable_vadd : Measurable (Function.uncurry (· +ᵥ ·) : M × α → α)

{M : Type u_2}
{α : Type u_3}
[VAdd M α]
[MeasurableSpace M]
[MeasurableSpace α]
[self : MeasurableVAdd₂ M α]

Measurable (Function.uncurry fun x x_1 => x +ᵥ x_1)


theorem ord_compl_dvd (n p : ℕ) : ord_compl[p] n ∣ n


theorem isConj_of_cycleType_eq {σ τ : Perm α} (h : cycleType σ = cycleType τ) : IsConj σ τ

{α : Type u_1}
[Fintype α]
[DecidableEq α]
{σ τ : Equiv.Perm α}
(h : σ.cycleType = τ.cycleType)


@[simp]
theorem id_linear : (id k P1).linear = LinearMap.id

(k : Type u_1)
{V1 : Type u_2}
(P1 : Type u_3)
[Ring k]
[AddCommGroup V1]
[Module k V1]
[AffineSpace V1 P1]

(AffineMap.id k P1).linear = LinearMap.id


/-- A dilation maps closed balls to closed balls and scales the radius by `ratio f`. -/
theorem mapsTo_closedBall (x : α) (r' : ℝ) :
    MapsTo (f : α → β) (Metric.closedBall x r') (Metric.closedBall (f x) (ratio f * r'))

{α : Type u_1}
{β : Type u_2}
{F : Type u_4}
[PseudoMetricSpace α]
[PseudoMetricSpace β]
[FunLike F α β]
[DilationClass F α β]
(f : F)
(x : α)
(r' : ℝ)

Set.MapsTo (⇑f) (Metric.closedBall x r') (Metric.closedBall (f x) (↑(Dilation.ratio f) * r'))


theorem lt_total (f g : CauSeq α abs) : f < g ∨ f ≈ g ∨ g < f

{α : Type u_1}
[LinearOrderedField α]
(f g : CauSeq α abs)


theorem dvd_gcd {a b c : R} : c ∣ a → c ∣ b → c ∣ gcd a b

{R : Type u}
[EuclideanDomain R]
[DecidableEq R]
{a b c : R}

c ∣ a → c ∣ b → c ∣ EuclideanDomain.gcd a b


theorem tendsto_atTop_of_add_bdd_above_right' (C) (hC : ∀ᶠ x in l, g x ≤ C)
    (h : Tendsto (fun x => f x + g x) l atTop) : Tendsto f l atTop

(h : Filter.Tendsto (fun x => f x + g x) l Filter.atTop)


theorem IsClosed.csSup_mem {s : Set α} (hc : IsClosed s) (hs : s.Nonempty) (B : BddAbove s) :
    sSup s ∈ s

{α : Type u_1}
[ConditionallyCompleteLinearOrder α]
[TopologicalSpace α]
[OrderTopology α]
{s : Set α}
(hc : IsClosed s)
(hs : s.Nonempty)
(B : BddAbove s)


theorem Fintype.card_empty : Fintype.card Empty = 0


@[simp]
theorem univ_nonempty : ∀ [Nonempty α], (univ : Set α).Nonempty


theorem map_eq_apply (f : α → β) (s : Stream' α) : map f s = pure f ⊛ s

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


/-- A unit trinomial is irreducible if it has no complex roots in common with its mirror. -/
theorem irreducible_of_coprime' (hp : IsUnitTrinomial p)
    (h : ∀ z : ℂ, ¬(aeval z p = 0 ∧ aeval z (mirror p) = 0)) : Irreducible p

(h : ∀ (z : ℂ), ¬((Polynomial.aeval z) p = 0 ∧ (Polynomial.aeval z) p.mirror = 0))


theorem dist_le_dist_coe_div_sqrt (z w : ℍ) : dist z w ≤ dist (z : ℂ) w / √(z.im * w.im)


@[simp]
theorem iInter_univ : (⋂ _ : ι, univ : Set α) = univ


theorem lt_pow_iff_log_lt {b : ℕ} (hb : 1 < b) {x y : ℕ} (hy : y ≠ 0) : y < b ^ x ↔ log b y < x


@[to_additive]
theorem op_sSup (S : Set (Submonoid M)) : (sSup S).op = sSup (.unop ⁻¹' S)

{M : Type u_2}
[MulOneClass M]
(S : Set (Submonoid M))

(sSup S).op = sSup (Submonoid.unop ⁻¹' S)


@[simp] lemma bot_mul (hb : b ≠ 0) : ⊥ * b = ⊥

{α : Type u_1}
[DecidableEq α]
[MulZeroClass α]
{b : WithBot α}
(hb : b ≠ 0)


protected lemma div_pow (h : a ∣ b) : (b / a) ^ c = b ^ c / a ^ c


@[simp] theorem length_insert_of_not_mem {l : List α} (h : a ∉ l) :
    length (l.insert a) = length l + 1

{α : Type u_1}
[BEq α]
[LawfulBEq α]
{a : α}
{l : List α}
(h : ¬a ∈ l)


/-- Continuous local sections of a local homeomorphism are open embeddings. -/
theorem openEmbedding_of_comp (hf : IsLocalHomeomorph g) (hgf : OpenEmbedding (g ∘ f))
    (cont : Continuous f) : OpenEmbedding f

{X : Type u_1}
{Y : Type u_2}
{Z : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
{g : Y → Z}
{f : X → Y}
(hf : IsLocalHomeomorph g)
(hgf : OpenEmbedding (g ∘ f))
(cont : Continuous f)


@[to_additive]
theorem mem_closure {x : M} : x ∈ closure s ↔ ∀ S : Subsemigroup M, s ⊆ S → x ∈ S

{M : Type u_1}
[Add M]
{s : Set M}
{x : M}

x ∈ AddSubsemigroup.closure s ↔ ∀ (S : AddSubsemigroup M), s ⊆ ↑S → x ∈ S


@[to_additive]
theorem prod_eq_single {s : Finset α} {f : α → β} (a : α) (h₀ : ∀ b ∈ s, b ≠ a → f b = 1)
    (h₁ : a ∉ s → f a = 1) : ∏ x ∈ s, f x = f a

{α : Type u_3}
{β : Type u_4}
[CommMonoid β]
{s : Finset α}
{f : α → β}
(a : α)
(h₀ : ∀ b ∈ s, b ≠ a → f b = 1)
(h₁ : a ∉ s → f a = 1)


/-- `Complex.arg ∘ (↑)` and `expMapCircle` define a partial equivalence between `circle` and `ℝ`
with `source = Set.univ` and `target = Set.Ioc (-π) π`. -/
@[simps (config := .asFn)]
noncomputable def argPartialEquiv : PartialEquiv circle ℝ


theorem iSup_mul (s : ι → Submodule R A) (t : Submodule R A) : (⨆ i, s i) * t = ⨆ i, s i * t

{ι : Sort uι}
{R : Type u}
[CommSemiring R]
{A : Type v}
[Semiring A]
[Algebra R A]
(s : ι → Submodule R A)
(t : Submodule R A)


@[to_additive]
theorem mem_torsion (g : G) : g ∈ torsion G ↔ IsOfFinOrder g

g ∈ CommGroup.torsion G ↔ IsOfFinOrder g


@[to_additive (attr := continuity, fun_prop)]
theorem continuous_mk : Continuous (@mk M)


/-- We don't want the definition of 'simple' to include the zero object, so we check that here. -/
theorem zero_not_simple [Simple (0 : C)] : False


theorem pi_Ici_mem_nhds (ha : ∀ i, a i < x i) : Ici a ∈ 𝓝 x

{ι : Type u_1}
{π : ι → Type u_2}
[Finite ι]
[(i : ι) → LinearOrder (π i)]
[(i : ι) → TopologicalSpace (π i)]
[∀ (i : ι), OrderTopology (π i)]
{a x : (i : ι) → π i}
(ha : ∀ (i : ι), a i < x i)


theorem lintegral_nnnorm_add_right (f : α → β) {g : α → γ} (hg : AEStronglyMeasurable g μ) :
    ∫⁻ a, ‖f a‖₊ + ‖g a‖₊ ∂μ = (∫⁻ a, ‖f a‖₊ ∂μ) + ∫⁻ a, ‖g a‖₊ ∂μ

(hg : MeasureTheory.AEStronglyMeasurable g μ)

∫⁻ (a : α), ↑‖f a‖₊ + ↑‖g a‖₊ ∂μ = ∫⁻ (a : α), ↑‖f a‖₊ ∂μ + ∫⁻ (a : α), ↑‖g a‖₊ ∂μ


theorem Disjoint.eq_bot_of_le (hab : Disjoint a b) (h : a ≤ b) : a = ⊥

{α : Type u_1}
[PartialOrder α]
[OrderBot α]
{a b : α}
(hab : Disjoint a b)
(h : a ≤ b)


/-- The product `x * r`, `r : ℚ`, `r ≠ 0`, is a Liouville number with exponent `p` if and only if
`x` satisfies the same condition. -/
theorem mul_rat_iff (hr : r ≠ 0) : LiouvilleWith p (x * r) ↔ LiouvilleWith p x

LiouvilleWith p (x * ↑r) ↔ LiouvilleWith p x


theorem eq_cyclotomic_iff {R : Type*} [CommRing R] {n : ℕ} (hpos : 0 < n) (P : R[X]) :
    P = cyclotomic n R ↔
    (P * ∏ i ∈ Nat.properDivisors n, Polynomial.cyclotomic i R) = X ^ n - 1

{R : Type u_1}
[CommRing R]
{n : ℕ}
(hpos : 0 < n)
(P : R[X])

P = Polynomial.cyclotomic n R ↔ P * ∏ i ∈ n.properDivisors, Polynomial.cyclotomic i R = Polynomial.X ^ n - 1


@[simp]
theorem toIocDiv_zsmul_sub_toIocMod (a b : α) : toIocDiv hp a b • p + toIocMod hp a b = b

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


{α : Type u_1}
[LinearOrderedRing α]
{a b : α}
(h1 : -b < a)
(h2 : a < b)


theorem range'_1_concat (s n : Nat) : range' s (n + 1) = range' s n ++ [s + n]

List.range' s (n + 1) = List.range' s n ++ [s + n]


@[measurability]
protected theorem indicator [Zero β] (hfm : AEStronglyMeasurable f μ) {s : Set α}
    (hs : MeasurableSet s) : AEStronglyMeasurable (s.indicator f) μ

(hfm : MeasureTheory.AEStronglyMeasurable f μ)

MeasureTheory.AEStronglyMeasurable (s.indicator f) μ


theorem tangentMapWithin_prod_fst {s : Set (M × M')} {p : TangentBundle (I.prod I') (M × M')}
    (hs : UniqueMDiffWithinAt (I.prod I') s p.proj) :
    tangentMapWithin (I.prod I') I Prod.fst s p = ⟨p.proj.1, p.2.1⟩

tangentMapWithin (I.prod I') I Prod.fst s p = { proj := p.proj.1, snd := p.snd.1 }


@[to_additive (attr := simp)]
theorem Units.coe_unop_opEquiv {M} [Monoid M] (u : Mᵐᵒᵖˣ) :
    ((Units.opEquiv u).unop : M) = unop (u : Mᵐᵒᵖ)

{M : Type u_2}
[AddMonoid M]
(u : AddUnits Mᵃᵒᵖ)

↑(AddOpposite.unop (AddUnits.opEquiv u)) = AddOpposite.unop ↑u


/-- If `f : G → H` is an additive homomorphism between two additive monoids, then
`Finsupp.mapDomain f` is a ring homomorphism between their add monoid algebras. -/
@[simps]
def mapDomainRingHom (k : Type*) [Semiring k] {H F : Type*} [AddMonoid G] [AddMonoid H]
    [FunLike F G H] [AddMonoidHomClass F G H] (f : F) : k[G] →+* k[H]

{G : Type u₂}
(k : Type u_3)
[Semiring k]
{H : Type u_4}
{F : Type u_5}
[AddMonoid G]
[AddMonoid H]
[FunLike F G H]
[AddMonoidHomClass F G H]
(f : F)

∀ (a : G →₀ k), (AddMonoidAlgebra.mapDomainRingHom k f) a = (↑(Finsupp.mapDomain.addMonoidHom ⇑f)).toFun a


/-- Note we cannot use `i ∈ s` instead of `i : s` here
as it is simply not true on conditionally complete lattices! -/
theorem Finset.untrop_sum [ConditionallyCompleteLinearOrder R] (s : Finset S)
    (f : S → Tropical (WithTop R)) : untrop (∑ i ∈ s, f i) = ⨅ i : s, untrop (f i)

{R : Type u_1}
{S : Type u_2}
[ConditionallyCompleteLinearOrder R]
(s : Finset S)
(f : S → Tropical (WithTop R))

Tropical.untrop (∑ i ∈ s, f i) = ⨅ i, Tropical.untrop (f ↑i)


@[to_additive (attr := aesop safe 20 apply (rule_sets := [Measurable]))]
protected theorem smul {𝕜} [TopologicalSpace 𝕜] [SMul 𝕜 β] [ContinuousSMul 𝕜 β] {f : α → 𝕜}
    {g : α → β} (hf : AEStronglyMeasurable f μ) (hg : AEStronglyMeasurable g μ) :
    AEStronglyMeasurable (fun x => f x • g x) μ

(hf : MeasureTheory.AEStronglyMeasurable f μ)

MeasureTheory.AEStronglyMeasurable (fun x => f x • g x) μ


/-- Any nonempty complete second countable metric space is the continuous image of the
fundamental space `ℕ → ℕ`. For a version of this theorem in the context of Polish spaces, see
`exists_nat_nat_continuous_surjective_of_polishSpace`. -/
theorem exists_nat_nat_continuous_surjective_of_completeSpace (α : Type*) [MetricSpace α]
    [CompleteSpace α] [SecondCountableTopology α] [Nonempty α] :
    ∃ f : (ℕ → ℕ) → α, Continuous f ∧ Surjective f

(α : Type u_2)
[MetricSpace α]
[CompleteSpace α]
[SecondCountableTopology α]
[Nonempty α]

∃ f, Continuous f ∧ Function.Surjective f


@[to_additive]
lemma subset_mul_closure_one (s : Set G) : s ⊆ s * (closure {1} : Set G)

{G : Type w}
[TopologicalSpace G]
[AddGroup G]
(s : Set G)


theorem mirror_involutive : Function.Involutive (mirror : R[X] → R[X])


theorem nodup_singleton (a : α) : Nodup [a]


/-- The type of `⊥`-preserving functions from `α` to `β`. -/
structure BotHom (α β : Type*) [Bot α] [Bot β] where
  /-- The underlying function. The preferred spelling is `DFunLike.coe`. -/
  toFun : α → β
  /-- The function preserves the bottom element. The preferred spelling is `map_bot`. -/
  map_bot' : toFun ⊥ = ⊥

{α : Type u_6}
{β : Type u_7}
[Bot α]
[Bot β]
(self : BotHom α β)


@[simp]
theorem coe_ndinter (l₁ l₂ : List α) : @ndinter α _ l₁ l₂ = (l₁ ∩ l₂ : List α)

{α : Type u_1}
[DecidableEq α]
(l₁ l₂ : List α)


@[simp]
lemma image_fst_graphOn (f : α → β) (s : Set α) : Prod.fst '' graphOn f s = s

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


@[simp]
theorem toFinsupp_zero [Zero M] [∀ m : M, Decidable (m ≠ 0)] : toFinsupp 0 = (0 : ι →₀ M)

{ι : Type u_1}
{M : Type u_3}
[DecidableEq ι]
[Zero M]
[(m : M) → Decidable (m ≠ 0)]


lemma Affine.CoordinateRing.mk_ψ (n : ℤ) : mk W (W.ψ n) = mk W (W.Ψ n)

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

(WeierstrassCurve.Affine.CoordinateRing.mk W) (W.ψ n) = (WeierstrassCurve.Affine.CoordinateRing.mk W) (W.Ψ n)


/-- This is `Orthonormal.isHilbertSum` in the case of actual inclusions from subspaces. -/
theorem IsHilbertSum.mkInternal [∀ i, CompleteSpace <| F i]
    (hFortho : OrthogonalFamily 𝕜 (fun i => F i) fun i => (F i).subtypeₗᵢ)
    (hFtotal : ⊤ ≤ (⨆ i, F i).topologicalClosure) :
    IsHilbertSum 𝕜 (fun i => F i) fun i => (F i).subtypeₗᵢ

(hFortho : OrthogonalFamily 𝕜 (fun i => ↥(F i)) fun i => (F i).subtypeₗᵢ)

IsHilbertSum 𝕜 (fun i => ↥(F i)) fun i => (F i).subtypeₗᵢ


@[simp] lemma mop_braiding (X Y : C) : (β_ X Y).mop = β_ (mop Y) (mop X)

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

(β_ X Y).mop = β_ { unmop := Y } { unmop := X }


theorem specialLinearGroup_apply {R : Type*} [CommRing R] [Algebra R ℝ] (g : SL(2, R)) (z : ℍ) :
    g • z =
      mk
        (((algebraMap R ℝ (↑ₘ[R] g 0 0) : ℂ) * z + (algebraMap R ℝ (↑ₘ[R] g 0 1) : ℂ)) /
          ((algebraMap R ℝ (↑ₘ[R] g 1 0) : ℂ) * z + (algebraMap R ℝ (↑ₘ[R] g 1 1) : ℂ)))
        (g • z).property

{R : Type u_1}
[CommRing R]
[Algebra R ℝ]
(g : SL(2, R))
(z : ℍ)

g • z =
  UpperHalfPlane.mk
    ((↑((algebraMap R ℝ) (↑↑g 0 0)) * ↑z + ↑((algebraMap R ℝ) (↑↑g 0 1))) /
      (↑((algebraMap R ℝ) (↑↑g 1 0)) * ↑z + ↑((algebraMap R ℝ) (↑↑g 1 1))))
    ⋯


theorem smul_coe : x • (y : ℍ[R,c₁,c₂]) = ↑(x * y)

{R : Type u_3}
[CommRing R]
{c₁ c₂ : R}
(x y : R)


theorem or_inr {a b : Bool} (H : b) : a || b


theorem mk_preimage_prod_right_fn_eq_if [DecidablePred (· ∈ s)] (g : δ → β) :
    (fun b => (a, g b)) ⁻¹' s ×ˢ t = if a ∈ s then g ⁻¹' t else ∅

{α : Type u_1}
{β : Type u_2}
{δ : Type u_4}
{s : Set α}
{t : Set β}
{a : α}
[DecidablePred fun x => x ∈ s]
(g : δ → β)


/-- In an impartial game, either the first player always wins, or the second player always wins. -/
theorem equiv_or_fuzzy_zero : (G ≈ 0) ∨ G ‖ 0


/-- Given an ideal `𝓟` of a commutative semiring `R`, we say that a polynomial `f : R[X]`
is *Eisenstein at `𝓟`* if `f.leadingCoeff ∉ 𝓟`, `∀ n, n < f.natDegree → f.coeff n ∈ 𝓟` and
`f.coeff 0 ∉ 𝓟 ^ 2`. -/
@[mk_iff]
structure IsEisensteinAt [CommSemiring R] (f : R[X]) (𝓟 : Ideal R) : Prop where
  leading : f.leadingCoeff ∉ 𝓟
  mem : ∀ {n}, n < f.natDegree → f.coeff n ∈ 𝓟
  not_mem : f.coeff 0 ∉ 𝓟 ^ 2

{R : Type u}
[CommSemiring R]
(f : R[X])
(𝓟 : Ideal R)

f.IsEisensteinAt 𝓟 ↔ f.leadingCoeff ∉ 𝓟 ∧ (∀ {n : ℕ}, n < f.natDegree → f.coeff n ∈ 𝓟) ∧ f.coeff 0 ∉ 𝓟 ^ 2


@[to_additive]
theorem measure_preimage_smul_of_nullMeasurableSet (hs : NullMeasurableSet s μ) (c : G) :
    μ ((c • ·) ⁻¹' s) = μ s

[MeasureTheory.SMulInvariantMeasure G α μ]

(hs : MeasureTheory.NullMeasurableSet s μ)


theorem minimals_of_symm [IsSymm α r] : minimals r s = s

{α : Type u_1}
{r : α → α → Prop}
{s : Set α}
[IsSymm α r]


/-- If two finite measures `μ` and `ν` are not mutually singular, there exists some `ε > 0` and
a measurable set `E`, such that `ν(E) > 0` and `E` is positive with respect to `μ - εν`.

This lemma is useful for the Lebesgue decomposition theorem. -/
theorem exists_positive_of_not_mutuallySingular (μ ν : Measure α) [IsFiniteMeasure μ]
    [IsFiniteMeasure ν] (h : ¬μ ⟂ₘ ν) :
    ∃ ε : ℝ≥0, 0 < ε ∧
      ∃ E : Set α,
        MeasurableSet E ∧ 0 < ν E ∧ 0 ≤[E] μ.toSignedMeasure - (ε • ν).toSignedMeasure

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

∃ ε,
  0 < ε ∧
    ∃ E,
      MeasurableSet E ∧
        0 < ν E ∧
          MeasureTheory.VectorMeasure.restrict 0 E ≤
            MeasureTheory.VectorMeasure.restrict (μ.toSignedMeasure - (ε • ν).toSignedMeasure) E


/-- The algebra map from `R[X]` to continuous functions `C(X, R)`, for any subset `X` of `R`.
-/
@[simps]
def toContinuousMapOnAlgHom (X : Set R) : R[X] →ₐ[R] C(X, R)

{R : Type u_1}
[CommSemiring R]
[TopologicalSpace R]
[TopologicalSemiring R]
(X : Set R)
(p : R[X])

(Polynomial.toContinuousMapOnAlgHom X) p = p.toContinuousMapOn X


@[to_additive]
lemma prod_map_filter_mul_prod_map_filter_not (p : α → Prop) [DecidablePred p] (f : α → M)
    (l : List α) :
    ((l.filter p).map f).prod * ((l.filter fun x => ¬p x).map f).prod = (l.map f).prod

{α : Type u_2}
{M : Type u_4}
[CommMonoid M]
(p : α → Prop)
[DecidablePred p]
(f : α → M)
(l : List α)

(List.map f (List.filter (fun b => decide (p b)) l)).prod * (List.map f (List.filter (fun x => decide ¬p x) l)).prod =
  (List.map f l).prod


theorem sups_inter_subset_left : (s₁ ∩ s₂) ⊻ t ⊆ s₁ ⊻ t ∩ s₂ ⊻ t

{α : Type u_2}
[SemilatticeSup α]
{s₁ s₂ t : Set α}

(s₁ ∩ s₂) ⊻ t ⊆ s₁ ⊻ t ∩ s₂ ⊻ t


/-- Given an open finite set `S` in a T₀ space, there is some `x ∈ S` such that `{x}` is open. -/
theorem exists_isOpen_singleton_of_isOpen_finite [T0Space X] {s : Set X} (hfin : s.Finite)
    (hne : s.Nonempty) (ho : IsOpen s) : ∃ x ∈ s, IsOpen ({x} : Set X)

{X : Type u_1}
[TopologicalSpace X]
[T0Space X]
{s : Set X}
(hfin : s.Finite)
(hne : s.Nonempty)
(ho : IsOpen s)


theorem ext' (x y : M F) (H : ∀ i : ℕ, x.approx i = y.approx i) : x = y

(H : ∀ (i : ℕ), x.approx i = y.approx i)


theorem xor_right_injective {n : ℕ} : Function.Injective (HXor.hXor n : ℕ → ℕ)


@[simp]
theorem mkOfBound_coe {f} {C} {h} : (mkOfBound f C h : α → β) = (f : α → β)

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[PseudoMetricSpace β]
{f : C(α, β)}
{C : ℝ}
{h : ∀ (x y : α), dist (f x) (f y) ≤ C}

⇑(BoundedContinuousFunction.mkOfBound f C h) = ⇑f


/-- The product of two independent, integrable, real-valued random variables is integrable. -/
theorem IndepFun.integrable_mul {β : Type*} [MeasurableSpace β] {X Y : Ω → β}
    [NormedDivisionRing β] [BorelSpace β] (hXY : IndepFun X Y μ) (hX : Integrable X μ)
    (hY : Integrable Y μ) : Integrable (X * Y) μ

(hXY : ProbabilityTheory.IndepFun X Y μ)


@[to_additive]
theorem ExponentExists.isOfFinOrder (h : ExponentExists G) {g : G} : IsOfFinOrder g

{G : Type u}
[AddMonoid G]
(h : AddMonoid.ExponentExists G)
{g : G}


/-- Factoring through the image is a strong epi-mono factorisation. -/
@[simps]
def imageStrongEpiMonoFactorisation : StrongEpiMonoFactorisation f

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

(CategoryTheory.Abelian.imageStrongEpiMonoFactorisation f).e = CategoryTheory.Abelian.factorThruImage f


lemma eq_zero_of_nilpotencyClass_eq_one (hx : nilpotencyClass x = 1) :
    x = 0

{R : Type u_1}
{x : R}
[MonoidWithZero R]
(hx : nilpotencyClass x = 1)


@[to_additive]
theorem Equiv.tprod_eq (e : γ ≃ β) (f : β → α) : ∏' c, f (e c) = ∏' b, f b

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[CommMonoid α]
[TopologicalSpace α]
(e : γ ≃ β)
(f : β → α)


@[to_additive]
theorem tendsto_const_smul_iff {f : β → α} {l : Filter β} {a : α} (c : G) :
    Tendsto (fun x => c • f x) l (𝓝 <| c • a) ↔ Tendsto f l (𝓝 a)

{α : Type u_2}
{β : Type u_3}
{G : Type u_4}
[TopologicalSpace α]
[AddGroup G]
[AddAction G α]
[ContinuousConstVAdd G α]
{f : β → α}
{l : Filter β}
{a : α}
(c : G)

Filter.Tendsto (fun x => c +ᵥ f x) l (𝓝 (c +ᵥ a)) ↔ Filter.Tendsto f l (𝓝 a)


@[to_additive]
lemma iIndepFun.indepFun_div_div (hf_indep : iIndepFun (fun _ ↦ m) f μ)
    (hf_meas : ∀ i, Measurable (f i))
    (i j k l : ι) (hik : i ≠ k) (hil : i ≠ l) (hjk : j ≠ k) (hjl : j ≠ l) :
    IndepFun (f i / f j) (f k / f l) μ

{f : ι → Ω → β}

(hf_indep : ProbabilityTheory.iIndepFun (fun x => m) f μ)

ProbabilityTheory.IndepFun (f i / f j) (f k / f l) μ


@[symm]
theorem symm' (r : Setoid α) : ∀ {x y}, r.Rel x y → r.Rel y x


/-- If a function tends to infinity along a filter, then this function multiplied by a positive
constant (on the right) also tends to infinity. The archimedean assumption is convenient to get a
statement that works on `ℕ`, `ℤ` and `ℝ`, although not necessary (a version in ordered fields is
given in `Filter.Tendsto.atTop_mul_const`). -/
theorem Tendsto.atTop_mul_const' (hr : 0 < r) (hf : Tendsto f l atTop) :
    Tendsto (fun x => f x * r) l atTop

{α : Type u_1}
{R : Type u_2}
{l : Filter α}
{f : α → R}
{r : R}
[LinearOrderedSemiring R]
[Archimedean R]
(hr : 0 < r)
(hf : Filter.Tendsto f l Filter.atTop)

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


theorem MeasureTheory.volume_sum_rpow_lt [Nonempty ι] {p : ℝ} (hp : 1 ≤ p) (r : ℝ) :
    volume {x : ι → ℝ | (∑ i, |x i| ^ p) ^ (1 / p) < r} = (.ofReal r) ^ card ι *
      .ofReal ((2 * Gamma (1 / p + 1)) ^ card ι / Gamma (card ι / p + 1))

(ι : Type u_1)
[Fintype ι]
[Nonempty ι]
{p : ℝ}
(hp : 1 ≤ p)
(r : ℝ)

MeasureTheory.volume {x | (∑ i : ι, |x i| ^ p) ^ (1 / p) < r} =
  ENNReal.ofReal r ^ Fintype.card ι *
    ENNReal.ofReal ((2 * Real.Gamma (1 / p + 1)) ^ Fintype.card ι / Real.Gamma (↑(Fintype.card ι) / p + 1))


theorem IsRotated.eqv : Equivalence (@IsRotated α)


/-- The functional equation for the derivative of the Jacobi theta function, relating
`jacobiTheta₂' z τ` to `jacobiTheta₂' (z / τ) (-1 / τ)`. This is the key lemma behind the proof of
the functional equation for L-series of odd Dirichlet characters. -/
theorem jacobiTheta₂'_functional_equation (z τ : ℂ) :
    jacobiTheta₂' z τ = 1 / (-I * τ) ^ (1 / 2 : ℂ) * cexp (-π * I * z ^ 2 / τ) / τ *
      (jacobiTheta₂' (z / τ) (-1 / τ) - 2 * π * I * z * jacobiTheta₂ (z / τ) (-1 / τ))

jacobiTheta₂' z τ =
  1 / (-Complex.I * τ) ^ (1 / 2) * cexp (-↑π * Complex.I * z ^ 2 / τ) / τ *
    (jacobiTheta₂' (z / τ) (-1 / τ) - 2 * ↑π * Complex.I * z * jacobiTheta₂ (z / τ) (-1 / τ))


@[reassoc (attr := simp)]
theorem colimit.ι_pre (k : K) : colimit.ι (E ⋙ F) k ≫ colimit.pre F E = colimit.ι F (E.obj k)

[CategoryTheory.Limits.HasColimit (E ⋙ F)]

CategoryTheory.Limits.colimit.ι (E ⋙ F) k ≫ CategoryTheory.Limits.colimit.pre F E =
  CategoryTheory.Limits.colimit.ι F (E.obj k)


@[symm]
theorem IsEquivalent.symm (h : u ~[l] v) : v ~[l] u

{α : Type u_1}
{β : Type u_2}
[NormedAddCommGroup β]
{u v : α → β}
{l : Filter α}
(h : u ~[l] v)


theorem eventually_pi [Finite ι] (hf : ∀ i, ∀ᶠ x in f i, p i x) :
    ∀ᶠ x : ∀ i, α i in pi f, ∀ i, p i (x i)

(hf : ∀ (i : ι), ∀ᶠ (x : α i) in f i, p i x)

∀ᶠ (x : (i : ι) → α i) in Filter.pi f, ∀ (i : ι), p i (x i)


/-- A linear isometry preserves the property of being orthonormal. -/
theorem LinearIsometry.orthonormal_comp_iff {v : ι → E} (f : E →ₗᵢ[𝕜] E') :
    Orthonormal 𝕜 (f ∘ v) ↔ Orthonormal 𝕜 v

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{ι : Type u_4}
{E' : Type u_7}
[NormedAddCommGroup E']
[InnerProductSpace 𝕜 E']
{v : ι → E}
(f : E →ₗᵢ[𝕜] E')

Orthonormal 𝕜 (⇑f ∘ v) ↔ Orthonormal 𝕜 v


/-- A proposition is true on a set neighborhood of `s`
iff it is eventually true near each point in the set. -/
theorem eventually_nhdsSet_iff_forall {p : X → Prop} :
    (∀ᶠ x in 𝓝ˢ s, p x) ↔ ∀ x, x ∈ s → ∀ᶠ y in 𝓝 x, p y

{X : Type u_1}
[TopologicalSpace X]
{s : Set X}
{p : X → Prop}

(∀ᶠ (x : X) in 𝓝ˢ s, p x) ↔ ∀ x ∈ s, ∀ᶠ (y : X) in 𝓝 x, p y


@[simp] theorem not_lt_zero (a : Fin (n + 1)) : ¬a < 0


theorem IsClosedMap.closure_image_eq_of_continuous
    (f_closed : IsClosedMap f) (f_cont : Continuous f) (s : Set X) :
    closure (f '' s) = f '' closure s

{X : Type u_1}
{Y : Type u_2}
{f : X → Y}
[TopologicalSpace X]
[TopologicalSpace Y]
(f_closed : IsClosedMap f)
(f_cont : Continuous f)
(s : Set X)


/-- The angle between two nonzero vectors is `θ` if and only if the second vector is the first
rotated by `θ` and scaled by a positive real. -/
theorem oangle_eq_iff_eq_pos_smul_rotation_of_ne_zero {x y : V} (hx : x ≠ 0) (hy : y ≠ 0)
    (θ : Real.Angle) : o.oangle x y = θ ↔ ∃ r : ℝ, 0 < r ∧ y = r • o.rotation θ x

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

o.oangle x y = θ ↔ ∃ r, 0 < r ∧ y = r • (o.rotation θ) x


/-- An additive functor preserves homotopy equivalences. -/
@[simps]
def Functor.mapHomotopyEquiv (F : V ⥤ W) [F.Additive] (h : HomotopyEquiv C D) :
    HomotopyEquiv ((F.mapHomologicalComplex c).obj C) ((F.mapHomologicalComplex c).obj D)

{ι : Type u_1}
{V : Type u}
[CategoryTheory.Category.{v, u} V]
[CategoryTheory.Preadditive V]
{c : ComplexShape ι}
{C D : HomologicalComplex V c}
{W : Type u_2}
[CategoryTheory.Category.{u_3, u_2} W]
[CategoryTheory.Preadditive W]
(F : V ⥤ W)
[F.Additive]
(h : HomotopyEquiv C D)

(F.mapHomotopyEquiv h).inv = (F.mapHomologicalComplex c).map h.inv


theorem some_inter_some [Inter α] (a b : α) : some a ∩ some b = some (a ∩ b)

Part.some a ∩ Part.some b = Part.some (a ∩ b)


theorem count_tail : ∀ (l : List α) (a : α) (h : l ≠ []),
      l.tail.count a = l.count a - if a = l.head h then 1 else 0

{α : Type u_1}
[DecidableEq α]
(l : List α)
(a : α)
(h : l ≠ [])

List.count a l.tail = List.count a l - if a = l.head h then 1 else 0


theorem le_mul_right {a b : Associates α} : a ≤ a * b

{α : Type u_1}
[CommMonoid α]
{a b : Associates α}


@[simp]
theorem symm_cast {a₁ a₂ b₁ b₂ : X} (γ : Path a₂ b₂) (ha : a₁ = a₂) (hb : b₁ = b₂) :
    (γ.cast ha hb).symm = γ.symm.cast hb ha

{X : Type u_1}
[TopologicalSpace X]
{a₁ a₂ b₁ b₂ : X}
(γ : Path a₂ b₂)
(ha : a₁ = a₂)
(hb : b₁ = b₂)


theorem add_eq_mul_one_add_div [Semiring R] {a : Rˣ} {b : R} : ↑a + b = a * (1 + ↑a⁻¹ * b)

{R : Type x}
[Semiring R]
{a : Rˣ}
{b : R}


theorem mul_add_subset : f * (g + h) ≤ f * g + f * h

{α : Type u_2}
[Distrib α]
{f g h : Filter α}


@[simp]
theorem SimpleGraph.fromRel_adj {V : Type u} (r : V → V → Prop) (v w : V) :
    (SimpleGraph.fromRel r).Adj v w ↔ v ≠ w ∧ (r v w ∨ r w v)


theorem linearIndependent_subtype_range {ι} {f : ι → M} (hf : Injective f) :
    LinearIndependent R ((↑) : range f → M) ↔ LinearIndependent R f

{R : Type u_2}
{M : Type u_4}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{ι : Type u_8}
{f : ι → M}
(hf : Function.Injective f)

LinearIndependent (ι := { x // x ∈ Set.range f }) R Subtype.val ↔ LinearIndependent R f


theorem edist_le (h : HolderWith C r f) (x y : X) :
    edist (f x) (f y) ≤ (C : ℝ≥0∞) * edist x y ^ (r : ℝ)

{X : Type u_1}
{Y : Type u_2}
[PseudoEMetricSpace X]
[PseudoEMetricSpace Y]
{C r : ℝ≥0}
{f : X → Y}
(h : HolderWith C r f)
(x y : X)


@[simp]
theorem keys_singleton (a : α) (b : β a) : (singleton a b).keys = {a}

{α : Type u}
{β : α → Type v}
(a : α)
(b : β a)


@[simp]
theorem monomial_one_dvd_monomial_one [Nontrivial R] {i j : σ →₀ ℕ} :
    monomial i (1 : R) ∣ monomial j 1 ↔ i ≤ j

{σ : Type u_1}
{R : Type u_2}
[CommSemiring R]
[Nontrivial R]
{i j : σ →₀ ℕ}

(MvPolynomial.monomial i) 1 ∣ (MvPolynomial.monomial j) 1 ↔ i ≤ j


@[to_additive]
theorem edist_inv [PseudoEMetricSpace G] [IsometricSMul G G] [IsometricSMul Gᵐᵒᵖ G]
    (x y : G) : edist x⁻¹ y = edist x y⁻¹

{G : Type v}
[AddGroup G]
[PseudoEMetricSpace G]
[IsometricVAdd G G]
[IsometricVAdd Gᵃᵒᵖ G]
(x y : G)


@[to_additive]
theorem toContinuousMap_injective : Injective (toContinuousMap : _ → C(A, B))

{A : Type u_2}
{B : Type u_3}
[AddMonoid A]
[AddMonoid B]
[TopologicalSpace A]
[TopologicalSpace B]


/-- A `DivisionMonoid` is a `DivInvMonoid` with involutive inversion and such that
`(a * b)⁻¹ = b⁻¹ * a⁻¹` and `a * b = 1 → a⁻¹ = b`.

This is the immediate common ancestor of `Group` and `GroupWithZero`. -/
@[to_additive SubtractionMonoid]
class DivisionMonoid (G : Type u) extends DivInvMonoid G, InvolutiveInv G where
  protected mul_inv_rev (a b : G) : (a * b)⁻¹ = b⁻¹ * a⁻¹
  /-- Despite the asymmetry of `inv_eq_of_mul`, the symmetric version is true thanks to the
  involutivity of inversion. -/
  protected inv_eq_of_mul (a b : G) : a * b = 1 → a⁻¹ = b

{G : Type u}
[self : DivisionMonoid G]
(a b : G)


/-- If `IsCyclotomicExtension {5} ℚ K` then `𝓞 K` is a principal ideal domain. -/
theorem five_pid [IsCyclotomicExtension {5} ℚ K] : IsPrincipalIdealRing (𝓞 K)

(K : Type u)
[Field K]
[NumberField K]
[IsCyclotomicExtension {5} ℚ K]


theorem sups_union_left : (s₁ ∪ s₂) ⊻ t = s₁ ⊻ t ∪ s₂ ⊻ t

{α : Type u_2}
[SemilatticeSup α]
{s₁ s₂ t : Set α}


@[simp]
theorem cylinder_eq_empty_iff [h_nonempty : Nonempty (∀ i, α i)] (s : Finset ι)
    (S : Set (∀ i : s, α i)) :
    cylinder s S = ∅ ↔ S = ∅

{ι : Type u_1}
{α : ι → Type u_2}
[h_nonempty : Nonempty ((i : ι) → α i)]
(s : Finset ι)
(S : Set ((i : { x // x ∈ s }) → α ↑i))


theorem compl_toMeasurable_compl_ae_eq (h : NullMeasurableSet s μ) : (toMeasurable μ sᶜ)ᶜ =ᵐ[μ] s

(h : MeasureTheory.NullMeasurableSet s μ)

(MeasureTheory.toMeasurable μ sᶜ)ᶜ =ᵐ[μ] s


/-- The `i`-th element of a list coincides with the `i`-th element of any of its prefixes of
length `> i`. Version designed to rewrite from the big list to the small list. -/
@[deprecated getElem_take (since := "2024-06-12")]
theorem get_take (L : List α) {i j : Nat} (hi : i < L.length) (hj : i < j) :
    get L ⟨i, hi⟩ = get (L.take j) ⟨i, length_take .. ▸ Nat.lt_min.mpr ⟨hj, hi⟩⟩

{α : Type u_1}
(L : List α)
{i j : Nat}
(hi : i < L.length)
(hj : i < j)

L.get ⟨i, hi⟩ = (List.take j L).get ⟨i, ⋯⟩


/-- If a filter has a unique cluster point `y` in a compact topological space,
then the filter is less than or equal to `𝓝 y`. -/
lemma le_nhds_of_unique_clusterPt [CompactSpace X] {l : Filter X} {y : X}
    (h : ∀ x, ClusterPt x l → x = y) : l ≤ 𝓝 y

{X : Type u}
[TopologicalSpace X]
[CompactSpace X]
{l : Filter X}
{y : X}
(h : ∀ (x : X), ClusterPt x l → x = y)


theorem IsUniform.symm : Symmetric (IsUniform G ε)

{α : Type u_1}
{𝕜 : Type u_2}
[LinearOrderedField 𝕜]
{G : SimpleGraph α}
[DecidableRel G.Adj]
{ε : 𝕜}


theorem val_unit' {n : ZMod 0} : IsUnit n ↔ n.val = 1


@[simp] theorem length_replicate (n : Nat) (a : α) : (replicate n a).length = n


/-- Prove equality of bitvectors in terms of nat operations. -/
theorem eq_of_toNat_eq {n} : ∀ {i j : BitVec n}, i.toNat = j.toNat → i = j


theorem infinitePos_add_not_infiniteNeg {x y : ℝ*} :
    InfinitePos x → ¬InfiniteNeg y → InfinitePos (x + y)

x.InfinitePos → ¬y.InfiniteNeg → (x + y).InfinitePos


/-- The functor which sends `S : SnakeInput C` to `S.L₂'` which is
`S.L₀.X₃ ⟶ S.L₃.X₁ ⟶ S.L₃.X₂`. -/
@[simps]
noncomputable def functorL₂' : SnakeInput C ⥤ ShortComplex C

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Abelian C]

∀ {X Y : CategoryTheory.ShortComplex.SnakeInput C} (f : X ⟶ Y),
  (CategoryTheory.ShortComplex.SnakeInput.functorL₂'.map f).τ₃ = f.f₃.τ₂


theorem pi_univ_Iio_subset [Nonempty ι]: (pi univ fun i ↦ Iio (x i)) ⊆ Iio x

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

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


theorem mul_pdf_integrable (hcs : IsCompact s) (huX : IsUniform X s ℙ) :
    Integrable fun x : ℝ => x * (pdf X ℙ volume x).toReal

∀ {x : MeasurableSpace Ω} {ℙ : MeasureTheory.Measure Ω} {X : Ω → ℝ} {s : Set ℝ},
  IsCompact s →
    MeasureTheory.pdf.IsUniform X s ℙ MeasureTheory.volume →
      MeasureTheory.Integrable (fun x_1 => x_1 * (MeasureTheory.pdf X ℙ MeasureTheory.volume x_1).toReal)
        MeasureTheory.volume


/-- Functor composition induces a functor on cosimplicial objects. -/
@[simps!]
def whiskering (D : Type*) [Category D] : (C ⥤ D) ⥤ CosimplicialObject C ⥤ CosimplicialObject D

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

∀ {X Y : C ⥤ D} (τ : X ⟶ Y) (F : SimplexCategory ⥤ C) (c : SimplexCategory),
  (((CategoryTheory.CosimplicialObject.whiskering C D).map τ).app F).app c = τ.app (F.obj c)


theorem mono (hf : LeftOrdContinuous f) : Monotone f

{α : Type u}
{β : Type v}
[Preorder α]
[Preorder β]
{f : α → β}
(hf : LeftOrdContinuous f)


theorem inner_neg_neg (x y : E) : ⟪-x, -y⟫ = ⟪x, y⟫

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
(x y : E)


theorem hasseDeriv_X (hk : 1 < k) : hasseDeriv k (X : R[X]) = 0

{R : Type u_1}
[Semiring R]
(k : ℕ)
(hk : 1 < k)

(Polynomial.hasseDeriv k) Polynomial.X = 0


theorem toReal_mul_top (a : ℝ≥0∞) : ENNReal.toReal (a * ∞) = 0


/-- `LocallyConstant.map` as a `RingHom`. -/
@[simps!]
def mapRingHom [Semiring Y] [Semiring Z] (f : Y →+* Z) :
    LocallyConstant X Y →+* LocallyConstant X Z

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
{Z : Type u_6}
[Semiring Y]
[Semiring Z]
(f : Y →+* Z)
(g : LocallyConstant X Y)

∀ (a : X), ((LocallyConstant.mapRingHom f) g) a = f (g a)


theorem T_natAbs (n : ℤ) : T R n.natAbs = T R n

Polynomial.Chebyshev.T R ↑n.natAbs = Polynomial.Chebyshev.T R n


theorem zsmul_apply [∀ i, AddGroup (β i)] (b : ℤ) (v : Π₀ i, β i) (i : ι) : (b • v) i = b • v i

{ι : Type u}
{β : ι → Type v}
[(i : ι) → AddGroup (β i)]
(b : ℤ)
(v : Π₀ (i : ι), β i)
(i : ι)


/-- Bialgebra equivalences are transitive. -/
@[trans, simps!]
def trans (e₁₂ : A ≃ₐc[R] B) (e₂₃ : B ≃ₐc[R] C) : A ≃ₐc[R] C

{R : Type u}
{A : Type v}
{B : Type w}
{C : Type u₁}
[CommSemiring R]
[Semiring A]
[Semiring B]
[Semiring C]
[Algebra R A]
[Algebra R B]
[Algebra R C]
[CoalgebraStruct R A]
[CoalgebraStruct R B]
[CoalgebraStruct R C]
(e₁₂ : A ≃ₐc[R] B)
(e₂₃ : B ≃ₐc[R] C)

∀ (a : A), (e₁₂.trans e₂₃) a = ↑e₂₃ (↑e₁₂ a)


/-- Reinterpret `Multiplicative α →* β` as `α →+ Additive β`. -/
@[simps!]
def MonoidHom.toAdditive'' [AddZeroClass α] [MulOneClass β] :
    (Multiplicative α →* β) ≃ (α →+ Additive β)

{α : Type u}
{β : Type v}
[AddZeroClass α]
[MulOneClass β]

∀ (a : α →+ Additive β) (a_1 : Multiplicative α),
  (MonoidHom.toAdditive''.symm a) a_1 = Additive.toMul (a (Multiplicative.toAdd a_1))


@[simp]
theorem map_neg (f : M →ₗ⁅R,L⁆ N) (x : M) : f (-x) = -f x

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


theorem quotientToQuotientRangePowQuotSucc_surjective [IsDedekindDomain S]
    (hP0 : P ≠ ⊥) [hP : P.IsPrime] {i : ℕ} (hi : i < e) {a : S} (a_mem : a ∈ P ^ i)
    (a_not_mem : a ∉ P ^ (i + 1)) :
    Function.Surjective (quotientToQuotientRangePowQuotSucc f p P a_mem)

[hfp : NeZero (Ideal.ramificationIdx f p P)]

Function.Surjective ⇑(Ideal.quotientToQuotientRangePowQuotSucc f p P a_mem)


protected theorem iterate (hf : IsPeriodicPt f n x) (m : ℕ) : IsPeriodicPt f^[m] n x

{α : Type u_1}
{f : α → α}
{x : α}
{n : ℕ}
(hf : Function.IsPeriodicPt f n x)
(m : ℕ)


@[simp] lemma greatestFib_eq_zero : greatestFib n = 0 ↔ n = 0


theorem sin_sub_int_mul_pi (x : ℝ) (n : ℤ) : sin (x - n * π) = (-1) ^ n * sin x

Real.sin (x - ↑n * Real.pi) = (-1) ^ n * Real.sin x


/-- The functorial version of `HomologicalComplex.asFunctor`. -/
@[simps]
def complexOfFunctorsToFunctorToComplex {T : Type*} [Category T] :
    HomologicalComplex (T ⥤ V) c ⥤ T ⥤ HomologicalComplex V c

HomologicalComplex.complexOfFunctorsToFunctorToComplex.obj C = C.asFunctor


protected theorem continuousOn {s} : ContinuousOn e s

{𝕜 : Type u_1}
{V : Type u_2}
{V₂ : Type u_5}
{P : Type u_10}
{P₂ : Type u_11}
[NormedField 𝕜]
[SeminormedAddCommGroup V]
[NormedSpace 𝕜 V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]
[SeminormedAddCommGroup V₂]
[NormedSpace 𝕜 V₂]
[PseudoMetricSpace P₂]
[NormedAddTorsor V₂ P₂]
(e : P ≃ᵃⁱ[𝕜] P₂)
{s : Set P}


/-- `(φ i ⋆ g i) (k i)` tends to `z₀` as `i` tends to some filter `l` if
* `φ` is a sequence of nonnegative functions with integral `1` as `i` tends to `l`;
* The support of `φ` tends to small neighborhoods around `(0 : G)` as `i` tends to `l`;
* `g i` is `mu`-a.e. strongly measurable as `i` tends to `l`;
* `g i x` tends to `z₀` as `(i, x)` tends to `l ×ˢ 𝓝 x₀`;
* `k i` tends to `x₀`.

See also `ContDiffBump.convolution_tendsto_right`.
-/
theorem convolution_tendsto_right {ι} {g : ι → G → E'} {l : Filter ι} {x₀ : G} {z₀ : E'}
    {φ : ι → G → ℝ} {k : ι → G} (hnφ : ∀ᶠ i in l, ∀ x, 0 ≤ φ i x)
    (hiφ : ∀ᶠ i in l, ∫ x, φ i x ∂μ = 1)
    -- todo: we could weaken this to "the integral tends to 1"
    (hφ : Tendsto (fun n => support (φ n)) l (𝓝 0).smallSets)
    (hmg : ∀ᶠ i in l, AEStronglyMeasurable (g i) μ) (hcg : Tendsto (uncurry g) (l ×ˢ 𝓝 x₀) (𝓝 z₀))
    (hk : Tendsto k l (𝓝 x₀)) :
    Tendsto (fun i : ι => (φ i ⋆[lsmul ℝ ℝ, μ] g i : G → E') (k i)) l (𝓝 z₀)

{φ : ι → G → ℝ}

(hnφ : ∀ᶠ (i : ι) in l, ∀ (x : G), 0 ≤ φ i x)

(hiφ : ∀ᶠ (i : ι) in l, ∫ (x : G), φ i x ∂μ = 1)

(hφ : Filter.Tendsto (fun n => Function.support (φ n)) l (𝓝 0).smallSets)

(hmg : ∀ᶠ (i : ι) in l, MeasureTheory.AEStronglyMeasurable (g i) μ)

(hcg : Filter.Tendsto (Function.uncurry g) (l ×ˢ 𝓝 x₀) (𝓝 z₀))

Filter.Tendsto (fun i => MeasureTheory.convolution (φ i) (g i) (ContinuousLinearMap.lsmul ℝ ℝ) μ (k i)) l (𝓝 z₀)


lemma differentiableAt_hurwitzZetaEven_sub_one_div (a : UnitAddCircle) :
    DifferentiableAt ℂ (fun s ↦ hurwitzZetaEven a s - 1 / (s - 1) / Gammaℝ s) 1

DifferentiableAt ℂ (fun s => HurwitzZeta.hurwitzZetaEven a s - 1 / (s - 1) / s.Gammaℝ) 1


theorem tendsto_nhds_iff {m : β → α} {f : Filter β} (F : f.Realizer) (R : Realizer α) {a : α} :
    Tendsto m f (𝓝 a) ↔ ∀ t, a ∈ R.F t → ∃ s, ∀ x ∈ F.F s, m x ∈ R.F t

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
{m : β → α}
{f : Filter β}
(F : f.Realizer)
(R : Ctop.Realizer α)
{a : α}

Filter.Tendsto m f (𝓝 a) ↔ ∀ (t : R.σ), a ∈ R.F.f t → ∃ s, ∀ x ∈ F.F.f s, m x ∈ R.F.f t


theorem fst_image_sigma_subset (s : Set ι) (t : ∀ i, Set (α i)) : Sigma.fst '' s.sigma t ⊆ s

{ι : Type u_1}
{α : ι → Type u_3}
(s : Set ι)
(t : (i : ι) → Set (α i))


lemma neg_of_smul_pos_right [PosSMulMono α β] [SMulPosMono α β] (h : 0 < a • b) (ha : a ≤ 0) :
    b < 0

{α : Type u_1}
{β : Type u_2}
{a : α}
{b : β}
[Zero α]
[Zero β]
[SMulWithZero α β]
[LinearOrder α]
[LinearOrder β]
[PosSMulMono α β]
[SMulPosMono α β]
(h : 0 < a • b)
(ha : a ≤ 0)


/-- Two `R`-algebra morphisms from a quaternion algebra are equal if they agree on `i` and `j`. -/
@[ext]
theorem hom_ext ⦃f g : ℍ[R,c₁,c₂] →ₐ[R] A⦄
    (hi : f (Basis.self R).i = g (Basis.self R).i) (hj : f (Basis.self R).j = g (Basis.self R).j) :
    f = g

(hi : f (QuaternionAlgebra.Basis.self R).i = g (QuaternionAlgebra.Basis.self R).i)

(hj : f (QuaternionAlgebra.Basis.self R).j = g (QuaternionAlgebra.Basis.self R).j)


lemma Nat.eventually_pos : ∀ᶠ (k : ℕ) in Filter.atTop, 0 < k


theorem T_sub_two (n : ℤ) : T R (n - 2) = 2 * X * T R (n - 1) - T R n

Polynomial.Chebyshev.T R (n - 2) = 2 * Polynomial.X * Polynomial.Chebyshev.T R (n - 1) - Polynomial.Chebyshev.T R n


@[to_additive]
theorem inv_def [∀ i, Inv <| f i] : x⁻¹ = fun i => (x i)⁻¹

{I : Type u}
{f : I → Type v₁}
(x : (i : I) → f i)
[(i : I) → Inv (f i)]


lemma ltTrichotomy_self {p : P} : ltTrichotomy x y p p p = p

{α : Type u_2}
[LinearOrder α]
{P : Sort u_5}
{x y : α}
{p : P}