@[simp]
theorem blockDiagonal'_smul {R : Type*} [Semiring R] [AddCommMonoid α] [Module R α] (x : R)
    (M : ∀ i, Matrix (m' i) (n' i) α) : blockDiagonal' (x • M) = x • blockDiagonal' M

{o : Type u_4}
{m' : o → Type u_7}
{n' : o → Type u_8}
{α : Type u_12}
[DecidableEq o]
{R : Type u_14}
[Semiring R]
[AddCommMonoid α]
[Module R α]
(x : R)
(M : (i : o) → Matrix (m' i) (n' i) α)

Matrix.blockDiagonal' (x • M) = x • Matrix.blockDiagonal' M


theorem isOpen_singleton_iff_nhds_eq_pure (x : X) : IsOpen ({x} : Set X) ↔ 𝓝 x = pure x

{X : Type u}
[TopologicalSpace X]
(x : X)


@[simp]
theorem mkPiRing_apply [Fintype ι] (z : M₂) (m : ι → R) :
    (MultilinearMap.mkPiRing R ι z : (ι → R) → M₂) m = (∏ i, m i) • z

{R : Type uR}
{ι : Type uι}
{M₂ : Type v₂}
[CommSemiring R]
[AddCommMonoid M₂]
[Module R M₂]
[Fintype ι]
(z : M₂)
(m : ι → R)

(MultilinearMap.mkPiRing R ι z) m = (∏ i : ι, m i) • z


/-- The functor `LightCondSet ⥤ TopCat`  -/
@[simps]
def _root_.lightCondSetToTopCat : LightCondSet.{u} ⥤ TopCat.{u}


theorem isCompactOperator_of_tendsto {ι 𝕜₁ 𝕜₂ : Type*} [NontriviallyNormedField 𝕜₁]
    [NormedField 𝕜₂] {σ₁₂ : 𝕜₁ →+* 𝕜₂} {M₁ M₂ : Type*} [SeminormedAddCommGroup M₁]
    [AddCommGroup M₂] [NormedSpace 𝕜₁ M₁] [Module 𝕜₂ M₂] [UniformSpace M₂] [UniformAddGroup M₂]
    [ContinuousConstSMul 𝕜₂ M₂] [T2Space M₂] [CompleteSpace M₂] {l : Filter ι} [l.NeBot]
    {F : ι → M₁ →SL[σ₁₂] M₂} {f : M₁ →SL[σ₁₂] M₂} (hf : Tendsto F l (𝓝 f))
    (hF : ∀ᶠ i in l, IsCompactOperator (F i)) : IsCompactOperator f

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

(hF : ∀ᶠ (i : ι) in l, IsCompactOperator ⇑(F i))


@[simp]
theorem Injective.of_comp_iff' (f : α → β) {g : γ → α} (hg : Bijective g) :
    Injective (f ∘ g) ↔ Injective f

{α : Sort u_1}
{β : Sort u_2}
{γ : Sort u_3}
(f : α → β)
{g : γ → α}
(hg : Function.Bijective g)

Function.Injective (f ∘ g) ↔ Function.Injective f


/-- Given a diagram `D` of colimit cocones over the `F.obj j`, and a cocone over `uncurry.obj F`,
we can construct a cocone over the diagram consisting of the cocone points from `D`.
-/
@[simps]
def coconeOfCoconeUncurry {D : DiagramOfCocones F} (Q : ∀ j, IsColimit (D.obj j))
    (c : Cocone (uncurry.obj F)) : Cocone D.coconePoints

{D : CategoryTheory.Limits.DiagramOfCocones F}

(Q : (j : J) → CategoryTheory.Limits.IsColimit (D.obj j))

(c : CategoryTheory.Limits.Cocone (CategoryTheory.uncurry.obj F))

(CategoryTheory.Limits.coconeOfCoconeUncurry Q c).ι.app j =
  (Q j).desc { pt := c.pt, ι := { app := fun k => c.ι.app (j, k), naturality := ⋯ } }


theorem mem_union_right (s : Finset α) (h : a ∈ t) : a ∈ s ∪ t

{α : Type u_1}
[DecidableEq α]
{t : Finset α}
{a : α}
(s : Finset α)
(h : a ∈ t)


@[instance]
theorem ordConnected_empty : OrdConnected (∅ : Set α)


@[simp]
theorem padicValNat_self [Fact p.Prime] : padicValNat p p = 1


lemma EffectiveEpiFamily.uniq {B W : C} {α : Type*} (X : α → C) (π : (a : α) → (X a ⟶ B))
    [EffectiveEpiFamily X π] (e : (a : α) → (X a ⟶ W))
    (h : ∀ {Z : C} (a₁ a₂ : α) (g₁ : Z ⟶ X a₁) (g₂ : Z ⟶ X a₂),
      g₁ ≫ π _ = g₂ ≫ π _ → g₁ ≫ e _ = g₂ ≫ e _)
    (m : B ⟶ W) (hm : ∀ a, π a ≫ m = e a) :
    m = EffectiveEpiFamily.desc X π e h

(h :
  ∀ {Z : C} (a₁ a₂ : α) (g₁ : Z ⟶ X a₁) (g₂ : Z ⟶ X a₂),
    CategoryTheory.CategoryStruct.comp g₁ (π a₁) = CategoryTheory.CategoryStruct.comp g₂ (π a₂) →
      CategoryTheory.CategoryStruct.comp g₁ (e a₁) = CategoryTheory.CategoryStruct.comp g₂ (e a₂))

(hm : ∀ (a : α), CategoryTheory.CategoryStruct.comp (π a) m = e a)

m = CategoryTheory.EffectiveEpiFamily.desc X π e ⋯


lemma nonsingularLift_zero' [NoZeroDivisors R] {Y : R} (hy : Y ≠ 0) :
    W.NonsingularLift ⟦![0, Y, 0]⟧

{R : Type u}
[CommRing R]
(W : WeierstrassCurve.Projective R)
[NoZeroDivisors R]
{Y : R}
(hy : Y ≠ 0)


@[simp]
theorem comp₂_mk_mk (g : β → γ → δ) (hg : Continuous (uncurry g)) (f₁ : α → β) (f₂ : α → γ)
    (hf₁ hf₂) :
    comp₂ g hg (mk f₁ hf₁ : α →ₘ[μ] β) (mk f₂ hf₂) =
      mk (fun a => g (f₁ a) (f₂ a)) (hg.comp_aestronglyMeasurable (hf₁.prod_mk hf₂))

(g : β → γ → δ)

(f₁ : α → β)

(f₂ : α → γ)

(hf₁ : MeasureTheory.AEStronglyMeasurable f₁ μ)

(hf₂ : MeasureTheory.AEStronglyMeasurable f₂ μ)

MeasureTheory.AEEqFun.comp₂ g hg (MeasureTheory.AEEqFun.mk f₁ hf₁) (MeasureTheory.AEEqFun.mk f₂ hf₂) =
  MeasureTheory.AEEqFun.mk (fun a => g (f₁ a) (f₂ a)) ⋯


theorem lookmap_of_forall_not {l : List α} (H : ∀ a ∈ l, f a = none) : l.lookmap f = l

{α : Type u}
(f : α → Option α)
{l : List α}
(H : ∀ (a : α), a ∈ l → f a = none)


@[scoped simp]
theorem map_zsmul_const [AddGroup G] [AddGroup H] [AddConstMapClass F G H a b]
    (f : F) (n : ℤ) : f (n • a) = f 0 + n • b

{F : Type u_1}
{G : Type u_2}
{H : Type u_3}
[FunLike F G H]
{a : G}
{b : H}
[AddGroup G]
[AddGroup H]
[AddConstMapClass F G H a b]
(f : F)
(n : ℤ)


lemma withDensity_rnDeriv_mutuallySingularSetSlice (κ η : Kernel α γ) [IsFiniteKernel κ]
    [IsFiniteKernel η] (a : α) :
    withDensity η (rnDeriv κ η) a (mutuallySingularSetSlice κ η a) = 0

[hαγ : MeasurableSpace.CountableOrCountablyGenerated α γ]

((η.withDensity (κ.rnDeriv η)) a) (κ.mutuallySingularSetSlice η a) = 0


@[simp]
theorem functor_obj {I : Type u₁} (F : I → C) (i : I) :
    (Discrete.functor F).obj (Discrete.mk i) = F i

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

(CategoryTheory.Discrete.functor F).obj { as := i } = F i


@[refl]
theorem manyOneReducible_refl {α} [Primcodable α] (p : α → Prop) : p ≤₀ p

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


theorem cos_nonneg_iff_abs_toReal_le_pi_div_two {θ : Angle} : 0 ≤ cos θ ↔ |θ.toReal| ≤ π / 2


theorem toReal_sub {x y : EReal} (hx : x ≠ ⊤) (h'x : x ≠ ⊥) (hy : y ≠ ⊤) (h'y : y ≠ ⊥) :
    toReal (x - y) = toReal x - toReal y


@[simp]
theorem isPrimitive_one : IsPrimitive (1 : R[X])


theorem U_neg (n : ℤ) : U R (-n) = -U R (n - 2)

Polynomial.Chebyshev.U R (-n) = -Polynomial.Chebyshev.U R (n - 2)


/-- If the module action of `R` on `S` is compatible with multiplication on `S`, then
`fun x ↦ x • 1` is a ring homomorphism from `R` to `S`.

This is the `RingHom` version of `MonoidHom.smulOneHom`.

When `R` is commutative, usually `algebraMap` should be preferred. -/
@[simps!] def RingHom.smulOneHom
    [Semiring R] [NonAssocSemiring S] [Module R S] [IsScalarTower R S S] : R →+* S

{R : Type u_2}
{S : Type u_4}
[Semiring R]
[NonAssocSemiring S]
[Module R S]
[IsScalarTower R S S]
(x : R)


theorem down_iInf [InfSet α] (f : ι → ULift.{v} α) : (⨅ i, f i).down = ⨅ i, (f i).down

{α : Type u_1}
{ι : Sort u_5}
[InfSet α]
(f : ι → ULift.{v, u_1} α)


theorem pred_add_one (i : Fin (n + 2)) (h : (i : Nat) < n + 1) :
    pred (i + 1) (Fin.ne_of_gt (add_one_pos _ (lt_def.2 h))) = castLT i h


@[to_additive prod_map_comap_prod']
theorem prod_map_comap_prod' {M' : Type*} {N' : Type*} [Mul M'] [Mul N'] (f : M →ₙ* N)
    (g : M' →ₙ* N') (S : Subsemigroup N) (S' : Subsemigroup N') :
    (S.prod S').comap (prodMap f g) = (S.comap f).prod (S'.comap g)

{M : Type u_1}
{N : Type u_2}
[Add M]
[Add N]
{M' : Type u_5}
{N' : Type u_6}
[Add M']
[Add N']
(f : AddHom M N)
(g : AddHom M' N')
(S : AddSubsemigroup N)
(S' : AddSubsemigroup N')

AddSubsemigroup.comap (f.prodMap g) (S.prod S') = (AddSubsemigroup.comap f S).prod (AddSubsemigroup.comap g S')


@[to_additive]
nonrec theorem ContMDiffAt.mul (hf : ContMDiffAt I' I n f x) (hg : ContMDiffAt I' I n g x) :
    ContMDiffAt I' I n (f * g) x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{H : Type u_2}
[TopologicalSpace H]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{I : ModelWithCorners 𝕜 E H}
{G : Type u_4}
[Add G]
[TopologicalSpace G]
[ChartedSpace H G]
[SmoothAdd I G]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M : Type u_7}
[TopologicalSpace M]
[ChartedSpace H' M]
{f g : M → G}
{x : M}
{n : ℕ∞}
(hf : ContMDiffAt I' I n f x)
(hg : ContMDiffAt I' I n g x)


@[simp]
theorem coe_ne_zero (p : PMF α) : ⇑p ≠ 0


theorem IsPrime.mul_le {I J P : Ideal R} (hp : IsPrime P) : I * J ≤ P ↔ I ≤ P ∨ J ≤ P

{R : Type u}
[CommSemiring R]
{I J P : Ideal R}
(hp : P.IsPrime)


@[simp]
theorem mkPiRing_apply (z : M) (m : ι → R) :
    (ContinuousMultilinearMap.mkPiRing R ι z : (ι → R) → M) m = (∏ i, m i) • z

{R : Type u}
{ι : Type v}
{M : Type u_1}
[Fintype ι]
[CommRing R]
[AddCommMonoid M]
[Module R M]
[TopologicalSpace R]
[TopologicalSpace M]
[ContinuousMul R]
[ContinuousSMul R M]
(z : M)
(m : ι → R)

(ContinuousMultilinearMap.mkPiRing R ι z) m = (∏ i : ι, m i) • z


@[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) → Add (f i)]


theorem to_isSemiringHom (f : α →+* β) : IsSemiringHom f

{α : Type u}
{β : Type v}
{rα : Semiring α}
{rβ : Semiring β}
(f : α →+* β)


theorem natAbs_eq_natAbs_iff {a b : Int} : a.natAbs = b.natAbs ↔ a = b ∨ a = -b


@[simp] theorem set_nil (n : Nat) (a : α) : [].set n a = []


theorem prod_map_map_eq' {α₁ : Type*} {α₂ : Type*} {β₁ : Type*} {β₂ : Type*} (f : α₁ → α₂)
    (g : β₁ → β₂) (F : Filter α₁) (G : Filter β₁) :
    map f F ×ˢ map g G = map (Prod.map f g) (F ×ˢ G)

{α₁ : Type u_6}
{α₂ : Type u_7}
{β₁ : Type u_8}
{β₂ : Type u_9}
(f : α₁ → α₂)
(g : β₁ → β₂)
(F : Filter α₁)
(G : Filter β₁)

Filter.map f F ×ˢ Filter.map g G = Filter.map (Prod.map f g) (F ×ˢ G)


theorem isCoseparating_empty_of_thin [Quiver.IsThin C] : IsCoseparating (∅ : Set C)

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


protected nonrec theorem HasDerivAt.star (h : HasDerivAt f f' x) :
    HasDerivAt (fun x => star (f x)) (star f') x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : 𝕜 → F}
[StarRing 𝕜]
[TrivialStar 𝕜]
[StarAddMonoid F]
[ContinuousStar F]
[StarModule 𝕜 F]
{f' : F}
{x : 𝕜}
(h : HasDerivAt f f' x)


@[simp]
theorem changeFormEquiv_symm :
    (changeFormEquiv h).symm = changeFormEquiv (changeForm.neg_proof h)

(h : LinearMap.BilinMap.toQuadraticMap B = Q' - Q)

(CliffordAlgebra.changeFormEquiv h).symm = CliffordAlgebra.changeFormEquiv ⋯


/-- Variant of `eisensteinSeries_tendstoLocallyUniformly` formulated with maps `ℂ → ℂ`, which is
nice to have for holomorphicity later. -/
lemma eisensteinSeries_tendstoLocallyUniformlyOn {k : ℤ} {N : ℕ} (hk : 3 ≤ k)
    (a : Fin 2 → ZMod N) : TendstoLocallyUniformlyOn (fun (s : Finset (gammaSet N a )) ↦
      ↑ₕ(fun (z : ℍ) ↦ ∑ x in s, eisSummand k x z )) (↑ₕ(eisensteinSeries_SIF a k).toFun)
          Filter.atTop {z : ℂ | 0 < z.im}

TendstoLocallyUniformlyOn
  (fun s => (fun z => ∑ x ∈ s, EisensteinSeries.eisSummand k (↑x) z) ∘ ↑UpperHalfPlane.ofComplex)
  ((EisensteinSeries.eisensteinSeries_SIF a k).toFun ∘ ↑UpperHalfPlane.ofComplex) Filter.atTop {z | 0 < z.im}


/-- If `f` is a partial homeomorphism defined on a neighbourhood of `f.symm a`, and `f` has a
nonzero derivative `f'` at `f.symm a` in the strict sense, then `f.symm` has the derivative `f'⁻¹`
at `a` in the strict sense.

This is one of the easy parts of the inverse function theorem: it assumes that we already have
an inverse function. -/
theorem PartialHomeomorph.hasStrictDerivAt_symm (f : PartialHomeomorph 𝕜 𝕜) {a f' : 𝕜}
    (ha : a ∈ f.target) (hf' : f' ≠ 0) (htff' : HasStrictDerivAt f f' (f.symm a)) :
    HasStrictDerivAt f.symm f'⁻¹ a

(htff' : HasStrictDerivAt (↑f) f' (↑f.symm a))


theorem smul_tprodCoeff_aux [DecidableEq ι] (z : R) (f : Π i, s i) (i : ι) (r : R) :
    tprodCoeff R z (update f i (r • f i)) = tprodCoeff R (r * z) f

{ι : Type u_1}
{R : Type u_4}
[CommSemiring R]
{s : ι → Type u_7}
[(i : ι) → AddCommMonoid (s i)]
[(i : ι) → Module R (s i)]
[DecidableEq ι]
(z : R)
(f : (i : ι) → s i)
(i : ι)
(r : R)

PiTensorProduct.tprodCoeff R z (Function.update f i (r • f i)) = PiTensorProduct.tprodCoeff R (r * z) f


theorem Matrix.ker_toLin'_eq_bot_iff {M : Matrix n n R} :
    LinearMap.ker (Matrix.toLin' M) = ⊥ ↔ ∀ v, M *ᵥ v = 0 → v = 0

{R : Type u_1}
[CommSemiring R]
{n : Type u_5}
[DecidableEq n]
[Fintype n]
{M : Matrix n n R}

LinearMap.ker (Matrix.toLin' M) = ⊥ ↔ ∀ (v : n → R), M *ᵥ v = 0 → v = 0


theorem supIndep_iff_pairwiseDisjoint : s.SupIndep f ↔ (s : Set ι).PairwiseDisjoint f

{α : Type u_1}
{ι : Type u_3}
[DistribLattice α]
[OrderBot α]
{s : Finset ι}
{f : ι → α}


@[simp]
theorem Orientation.reindex_refl : (Orientation.reindex R M <| Equiv.refl ι) = Equiv.refl _

(R : Type u_1)
[StrictOrderedCommSemiring R]
(M : Type u_2)
[AddCommMonoid M]
[Module R M]
{ι : Type u_4}

Orientation.reindex R M (Equiv.refl ι) = Equiv.refl (Orientation R M ι)


lemma pow_eq_one_iff_of_nonneg (ha : 0 ≤ a) (hn : n ≠ 0) : a ^ n = 1 ↔ a = 1

{R : Type u_3}
[LinearOrderedSemiring R]
{a : R}
{n : ℕ}
(ha : 0 ≤ a)
(hn : n ≠ 0)


/-- The natural isomorphism `(K⟦n⟧).sc i ≅ K.sc i'` when `n + i = i'`. -/
@[simps!]
noncomputable def shiftShortComplexFunctorIso (n i i' : ℤ) (hi : n + i = i') :
    shiftFunctor C n ⋙ shortComplexFunctor C _ i ≅ shortComplexFunctor C _ i'

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

((CochainComplex.shiftShortComplexFunctorIso C n i i' hi).hom.app X).τ₁ =
  n.negOnePow • (HomologicalComplex.XIsoOfEq X ⋯).hom


theorem le_log_of_pow_le {b x y : ℕ} (hb : 1 < b) (h : b ^ x ≤ y) : x ≤ log b y


@[simp]
theorem  _root_.WithLp.equiv_symm_pi_apply (x : ∀ i, α i) (i : ι) :
    (WithLp.equiv p _).symm x i = x i

(p : ℝ≥0∞)
{ι : Type u_2}
(α : ι → Type u_3)
(x : (i : ι) → α i)
(i : ι)

(WithLp.equiv p ((i : ι) → α i)).symm x i = x i


theorem and_congr_right (h : a → (b ↔ c)) : a ∧ b ↔ a ∧ c


/-- An iterated coproduct is a coproduct over a sigma type. -/
@[simps]
def sigmaSigmaIso {ι : Type*} (f : ι → Type*) (g : (i : ι) → (f i) → C)
    [∀ i, HasCoproduct (g i)] [HasCoproduct fun i => ∐ g i] :
    (∐ fun i => ∐ g i) ≅ (∐ fun p : Σ i, f i => g p.1 p.2)

[∀ (i : ι), CategoryTheory.Limits.HasCoproduct (g i)]

[CategoryTheory.Limits.HasCoproduct fun i => ∐ g i]

(CategoryTheory.Limits.sigmaSigmaIso f g).inv =
  CategoryTheory.Limits.Sigma.desc fun x =>
    match x with
    | ⟨i, x⟩ => CategoryTheory.Limits.Sigma.ι (g i) x ≫ CategoryTheory.Limits.Sigma.ι (fun i => ∐ g i) i


theorem Measure.smul_finite (μ : Measure α) [IsFiniteMeasure μ] {c : ℝ≥0∞} (hc : c ≠ ∞) :
    IsFiniteMeasure (c • μ)

{α : Type u_1}
{m0 : MeasurableSpace α}
(μ : MeasureTheory.Measure α)
[MeasureTheory.IsFiniteMeasure μ]
{c : ℝ≥0∞}
(hc : c ≠ ⊤)


/-- In a normed ring, the powers of an element x with `‖x‖ < 1` tend to zero. -/
theorem tendsto_pow_atTop_nhds_zero_of_norm_lt_one {R : Type*} [NormedRing R] {x : R}
    (h : ‖x‖ < 1) :
    Tendsto (fun n : ℕ ↦ x ^ n) atTop (𝓝 0)

{R : Type u_4}
[NormedRing R]
{x : R}
(h : ‖x‖ < 1)

Filter.Tendsto (fun n => x ^ n) Filter.atTop (𝓝 0)


theorem le_bmod {x : Int} {m : Nat} (h : 0 < m) : - (m/2) ≤ Int.bmod x m


/-- While in many cases `Fin.castOrderIso` is better than `Equiv.cast`/`cast`, sometimes we want to
apply a generic lemma about `cast`. -/
lemma castOrderIso_toEquiv (h : n = m) : (castOrderIso h).toEquiv = Equiv.cast (h ▸ rfl)

(Fin.castOrderIso h).toEquiv = Equiv.cast ⋯


theorem MonoidalCategory.braiding_inv_apply {A B : Rep k G} (x : A) (y : B) :
    Action.Hom.hom (β_ A B).inv (TensorProduct.tmul k y x) = TensorProduct.tmul k x y

{k G : Type u}
[CommRing k]
[Monoid G]
{A B : Rep k G}
(x : CoeSort.coe A)
(y : CoeSort.coe B)

(β_ A B).inv.hom (y ⊗ₜ[k] x) = x ⊗ₜ[k] y


theorem leftInverse_comap_map (f : V ↪ W) :
    Function.LeftInverse (SimpleGraph.comap f) (SimpleGraph.map f)

{V : Type u_1}
{W : Type u_2}
(f : V ↪ W)

Function.LeftInverse (SimpleGraph.comap ⇑f) (SimpleGraph.map f)


lemma scottHausdorff_le_lawson : scottHausdorff α  ≤ lawson α

Topology.scottHausdorff α ≤ Topology.lawson α


@[simp]
theorem Inv_divided_by_X_pow_order_leftInv {f : k⟦X⟧} (hf : f ≠ 0) :
    (Inv_divided_by_X_pow_order hf) * (divided_by_X_pow_order hf) = 1

{k : Type u_2}
[Field k]
{f : PowerSeries k}
(hf : f ≠ 0)

PowerSeries.Inv_divided_by_X_pow_order hf * PowerSeries.divided_by_X_pow_order hf = 1


theorem IsRefl.nondegenerate_of_separatingLeft {B : M →ₗ[R] M →ₗ[R] M₁} (hB : B.IsRefl)
    (hB' : B.SeparatingLeft) : B.Nondegenerate

{R : Type u_1}
{M : Type u_5}
{M₁ : Type u_6}
[CommRing R]
[AddCommGroup M]
[Module R M]
[AddCommGroup M₁]
[Module R M₁]
{B : M →ₗ[R] M →ₗ[R] M₁}
(hB : B.IsRefl)
(hB' : B.SeparatingLeft)


theorem set_eq_univ {S : Set ℕ} : S = Set.univ ↔ 0 ∈ S ∧ ∀ k : ℕ, k ∈ S → k + 1 ∈ S

S = Set.univ ↔ 0 ∈ S ∧ ∀ k ∈ S, k + 1 ∈ S


lemma StrictAnti.mapsTo_Ioi (h : StrictAnti f) : MapsTo f (Ioi a) (Iio (f a))

{α : Type u_1}
{β : Type u_2}
{f : α → β}
[Preorder α]
[Preorder β]
{a : α}
(h : StrictAnti f)

Set.MapsTo f (Set.Ioi a) (Set.Iio (f a))


theorem Perm.countP_congr {l₁ l₂ : List α} (s : l₁ ~ l₂) {p p' : α → Bool}
    (hp : ∀ x ∈ l₁, p x = p' x) : l₁.countP p = l₂.countP p'

{α : Type u_1}
{l₁ l₂ : List α}
(s : l₁ ~ l₂)
{p p' : α → Bool}
(hp : ∀ (x : α), x ∈ l₁ → p x = p' x)


theorem tendstoLocallyUniformlyOn_iUnion {ι' : Sort*} {S : ι' → Set α} (hS : ∀ i, IsOpen (S i))
    (h : ∀ i, TendstoLocallyUniformlyOn F f p (S i)) :
    TendstoLocallyUniformlyOn F f p (⋃ i, S i)

{F : ι → α → β}

(h : ∀ (i : ι'), TendstoLocallyUniformlyOn F f p (S i))


theorem tendsto_fract_left [OrderClosedTopology α] [TopologicalAddGroup α] (n : ℤ) :
    Tendsto (fract : α → α) (𝓝[<] n) (𝓝[<] 1)

{α : Type u_1}
[LinearOrderedRing α]
[FloorRing α]
[TopologicalSpace α]
[OrderClosedTopology α]
[TopologicalAddGroup α]
(n : ℤ)

Filter.Tendsto Int.fract (𝓝[<] ↑n) (𝓝[<] 1)


theorem _root_.acc_transGen_iff : Acc (TransGen r) a ↔ Acc r a

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


@[simp, norm_cast]
theorem coe_algebraMap (c : RingCon A) (s : S) :
    (algebraMap S A s : c.Quotient) = algebraMap S _ s

{S : Type uS}
[CommSemiring S]
{A : Type uA}
[Semiring A]
[Algebra S A]
(c : RingCon A)
(s : S)

↑((algebraMap S A) s) = (algebraMap S c.Quotient) s


/-- The equivalence `(ULift ℤ →+ α) ≃ α` for any additive group `α`. -/
@[simps!]
def fromULiftIntEquiv (α : Type u) [AddGroup α] : (ULift.{u} ℤ →+ α) ≃ α

∀ (a : ULift.{u, 0} ℤ →+ α), (AddMonoidHom.fromULiftIntEquiv α) a = a (AddEquiv.ulift.symm 1)


@[to_additive (attr := simp)]
theorem coe_of (R : Type u) [CommGroup R] : (CommGrp.of R : Type u) = R


theorem tail_append_of_ne_nil (l l' : List α) (h : l ≠ []) : (l ++ l').tail = l.tail ++ l'

{α : Type u}
(l l' : List α)
(h : l ≠ [])


theorem IsWeightedHomogeneous.weightedHomogeneousComponent_same {m : M} {p : MvPolynomial σ R}
    (hp : IsWeightedHomogeneous w p m) :
    weightedHomogeneousComponent w m p = p

(hp : MvPolynomial.IsWeightedHomogeneous w p m)

(MvPolynomial.weightedHomogeneousComponent w m) p = p


theorem convexJoin_mono_left (hs : s₁ ⊆ s₂) : convexJoin 𝕜 s₁ t ⊆ convexJoin 𝕜 s₂ t

{𝕜 : Type u_2}
{E : Type u_3}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[Module 𝕜 E]
{t s₁ s₂ : Set E}
(hs : s₁ ⊆ s₂)


protected theorem congr_arg {f : R ≃+* S} {x x' : R} : x = x' → f x = f x'

{R : Type u_4}
{S : Type u_5}
[Mul R]
[Mul S]
[Add R]
[Add S]
{f : R ≃+* S}
{x x' : R}


@[simp]
theorem nat_le_lift_iff {n : ℕ} {a : Cardinal.{u}} : n ≤ lift.{v} a ↔ n ≤ a


theorem Multiset.toFinset_card_le : m.toFinset.card ≤ Multiset.card m

{α : Type u_1}
[DecidableEq α]
(m : Multiset α)


theorem isPrime_ideal_prod_top' {I : Ideal S} [h : I.IsPrime] : (prod (⊤ : Ideal R) I).IsPrime

{R : Type u}
{S : Type v}
[Semiring R]
[Semiring S]
{I : Ideal S}
[h : I.IsPrime]


theorem prev_cons_cons_of_ne (y : α) (h : x ∈ y :: x :: l) (hy : x ≠ y) :
    prev (y :: x :: l) x h = y

{α : Type u_1}
[DecidableEq α]
(l : List α)
(x y : α)
(h : x ∈ y :: x :: l)
(hy : x ≠ y)


theorem head?_toList : ∀ v : Vector α n.succ, (toList v).head? = some (head v)

{n : ℕ}
{α : Type u_1}
(v : Mathlib.Vector α n.succ)


theorem hom_cast_eq_of_cons_eq_cons {u v v' w : U} {p : Path u v} {p' : Path u v'} {e : v ⟶ w}
    {e' : v' ⟶ w} (h : p.cons e = p'.cons e') : e.cast (obj_eq_of_cons_eq_cons h) rfl = e'

{U : Type u_1}
[Quiver U]
{u v v' w : U}
{p : Quiver.Path u v}
{p' : Quiver.Path u v'}
{e : v ⟶ w}
{e' : v' ⟶ w}
(h : p.cons e = p'.cons e')


@[simp]
theorem coe_pointwise_smul (g : G) (S : ValuationSubring K) : ↑(g • S) = g • (S : Set K)

{K : Type u}
[Field K]
{G : Type u_1}
[Group G]
[MulSemiringAction G K]
(g : G)
(S : ValuationSubring K)


@[to_additive]
protected theorem mul_eq_one_iff : s * t = 1 ↔ ∃ a b, s = {a} ∧ t = {b} ∧ a * b = 1

{α : Type u_2}
[DivisionMonoid α]
{s t : Set α}


@[simp] lemma inv_smul_set_distrib₀ (a : α) (s : Set α) : (a • s)⁻¹ = op a⁻¹ • s⁻¹

{α : Type u_2}
[GroupWithZero α]
(a : α)
(s : Set α)


@[simp]
theorem vecMul_ofNat (x : ℕ) [x.AtLeastTwo] (v : m → α) :
    v ᵥ* OfNat.ofNat (no_index x) = MulOpposite.op (OfNat.ofNat x : α) • v

{m : Type u_2}
{α : Type v}
[NonAssocSemiring α]
[Fintype m]
[DecidableEq m]
(x : ℕ)
[x.AtLeastTwo]
(v : m → α)

v ᵥ* OfNat.ofNat x = MulOpposite.op (OfNat.ofNat x) • v


/--
A bilinear form is separating left if the quadratic form it is associated with is anisotropic.
-/
theorem separatingLeft_of_anisotropic {B : BilinForm R M} (hB : B.toQuadraticMap.Anisotropic) :
    B.SeparatingLeft

(hB : (LinearMap.BilinMap.toQuadraticMap B).Anisotropic)


/-- The functor `(F ⋙ L, R) ⥤ (L, R)` -/
@[simps]
def preLeft (F : C ⥤ A) (L : A ⥤ T) (R : B ⥤ T) : Comma (F ⋙ L) R ⥤ Comma L R

{A : Type u₁}
[CategoryTheory.Category.{v₁, u₁} A]
{B : Type u₂}
[CategoryTheory.Category.{v₂, u₂} B]
{T : Type u₃}
[CategoryTheory.Category.{v₃, u₃} T]
{C : Type u₄}
[CategoryTheory.Category.{v₄, u₄} C]
(F : CategoryTheory.Functor C A)
(L : CategoryTheory.Functor A T)
(R : CategoryTheory.Functor B T)
(X : CategoryTheory.Comma (F.comp L) R)

((CategoryTheory.Comma.preLeft F L R).obj X).left = F.obj X.left


theorem GaloisConnection.l_limsup_le [ConditionallyCompleteLattice β]
    [ConditionallyCompleteLattice γ] {f : Filter α} {v : α → β} {l : β → γ} {u : γ → β}
    (gc : GaloisConnection l u)
    (hlv : f.IsBoundedUnder (· ≤ ·) fun x => l (v x) := by isBoundedDefault)
    (hv_co : f.IsCoboundedUnder (· ≤ ·) v := by isBoundedDefault) :
    l (limsup v f) ≤ limsup (fun x => l (v x)) f

(hlv : Filter.IsBoundedUnder (fun x x_1 => x ≤ x_1) f fun x => l (v x) := by isBoundedDefault)

(hv_co : Filter.IsCoboundedUnder (fun x x_1 => x ≤ x_1) f v := by isBoundedDefault)

l (Filter.limsup v f) ≤ Filter.limsup (fun x => l (v x)) f


/-- A triangle `(X,Y,Z,f,g,h)` in `C` is defined by the morphisms `f : X ⟶ Y`, `g : Y ⟶ Z`
and `h : Z ⟶ X⟦1⟧`.
-/
@[simps]
def Triangle.mk {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z) (h : Z ⟶ X⟦(1 : ℤ)⟧) : Triangle C

(h : Z ⟶ (CategoryTheory.shiftFunctor C 1).obj X)

(CategoryTheory.Pretriangulated.Triangle.mk f g h).obj₃ = Z


@[to_additive]
theorem fst_mul_snd [MulOneClass M] [MulOneClass N] (p : M × N) : (p.fst, 1) * (1, p.snd) = p

{M : Type u_5}
{N : Type u_6}
[MulOneClass M]
[MulOneClass N]
(p : M × N)


theorem injective (f : α → β) (hf : Injective f) : Injective (mapFun f : 𝕎 α → 𝕎 β)

{p : ℕ}
{α : Type u_4}
{β : Type u_5}
(f : α → β)
(hf : Function.Injective f)


@[simp]
theorem coe_smul {V : Type*} [NormedAddCommGroup V] [NormedSpace 𝕜 V] (r : 𝕜)
    (f : C^∞⟮I, N; 𝓘(𝕜, V), V⟯) : ⇑(r • f) = r • ⇑f

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_4}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{N : Type u_6}
[TopologicalSpace N]
[ChartedSpace H N]
{V : Type u_10}
[NormedAddCommGroup V]
[NormedSpace 𝕜 V]
(r : 𝕜)
(f : C^⊤⟮I, N; 𝓘(𝕜, V), V⟯)


lemma add_one_ediv_two_mul_two_of_odd : Odd n → 1 + n / 2 * 2 = n


theorem toDual_eq_repr (m : M) (i : ι) : b.toDual m (b i) = b.repr m i

{R : Type uR}
{M : Type uM}
{ι : Type uι}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
[DecidableEq ι]
(b : Basis ι R M)
(m : M)
(i : ι)


@[to_additive (attr := simp)]
theorem pure_one : pure (1 : α) = 1


/-- For a preorder `P`, `Cofinal P` is the type of subsets of `P`
  containing arbitrarily large elements. They are the dense sets in
  the topology whose open sets are terminal segments. -/
structure Cofinal (P) [Preorder P] where
  /-- The carrier of a `Cofinal` is the underlying set. -/
  carrier : Set P
  /-- The `Cofinal` contains arbitrarily large elements. -/
  mem_gt : ∀ x : P, ∃ y ∈ carrier, x ≤ y

{P : Type u_2}
[Preorder P]
(self : Order.Cofinal P)
(x : P)


/-- To show a statement about an element of `adicCompletion I M`, it suffices to check it
on Cauchy sequences. -/
theorem induction_on {p : AdicCompletion I M → Prop} (x : AdicCompletion I M)
    (h : ∀ (f : AdicCauchySequence I M), p (mk I M f)) : p x

(h : ∀ (f : AdicCompletion.AdicCauchySequence I M), p ((AdicCompletion.mk I M) f))


theorem encard_diff_add_encard_inter (s t : Set α) :
    (s \ t).encard + (s ∩ t).encard = s.encard


lemma _root_.NonUnitalNonAssocCommSemiring.mem_center_iff (a : α) :
    a ∈ NonUnitalSubsemiring.center α ↔ ∀ b : α, Commute (L b) (L a)

{α : Type u_5}
[NonUnitalNonAssocCommSemiring α]
(a : α)

a ∈ NonUnitalSubsemiring.center α ↔ ∀ (b : α), Commute (AddMonoid.End.mulLeft b) (AddMonoid.End.mulLeft a)


/-- Power asymptotic for `f - f₀` as `x → 0`. -/
lemma hf_zero' (P : WeakFEPair E) :
    (fun x : ℝ ↦ P.f x - P.f₀) =O[𝓝[>] 0] (· ^ (-P.k))

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
(P : WeakFEPair E)


/--
Data showing that the Levenshtein distance from `xs` to `ys`
is bounded below by the minimum Levenshtein distance between some suffix of `xs`
and a particular suffix of `ys`.

This bound is (non-strict) monotone as we take longer suffixes of `ys`.

This is an auxiliary definition for the later `LevenshteinEstimator`:
this variant constructs a lower bound for the pair consisting of
the Levenshtein distance from `xs` to `ys`,
along with the length of `ys`.
-/
structure LevenshteinEstimator' : Type where
  /-- The prefix of `ys` that is not is not involved in the bound, in reverse order. -/
  pre_rev : List β
  /-- The suffix of `ys`, such that the distance from `xs` to `ys` is bounded below
  by the minimum distance from any suffix of `xs` to this suffix. -/
  suff : List β
  /-- Witness that `ys` has been decomposed into a prefix and suffix. -/
  split : pre_rev.reverse ++ suff = ys
  /-- The distances from each suffix of `xs` to `suff`. -/
  distances : {r : List δ // 0 < r.length}
  /-- Witness that `distances` are correct. -/
  distances_eq : distances = suffixLevenshtein C xs suff
  /-- The current bound on the pair (distance from `xs` to `ys`, length of `ys`). -/
  bound : δ × ℕ
  /-- Predicate describing the current bound. -/
  bound_eq : bound = match pre_rev with
    | [] => (distances.1[0]'(distances.2), ys.length)
    | _ => (List.minimum_of_length_pos distances.2, suff.length)


@[simp]
theorem toTensorAlgebra_galgebra_toFun (r : R) :
    TensorPower.toTensorAlgebra (DirectSum.GAlgebra.toFun (R := R) (A := fun n => ⨂[R]^n M) r) =
      algebraMap _ _ r

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

TensorPower.toTensorAlgebra (DirectSum.GAlgebra.toFun r) = (algebraMap R (TensorAlgebra R M)) r


theorem perfect_iff_sum_properDivisors (h : 0 < n) : Perfect n ↔ ∑ i ∈ properDivisors n, i = n

n.Perfect ↔ ∑ i ∈ n.properDivisors, i = n


lemma char_is_prime_of_two_le (p : ℕ) [hc : CharP R p] (hp : 2 ≤ p) : Nat.Prime p

(R : Type u_1)
[NonAssocSemiring R]
[NoZeroDivisors R]
(p : ℕ)
[hc : CharP R p]
(hp : 2 ≤ p)


@[simp]
theorem self_comp_symm : e ∘ e.symm = id

{R : Type u_1}
{R₂ : Type u_2}
{E : Type u_5}
{E₂ : Type u_6}
[Semiring R]
[Semiring R₂]
{σ₁₂ : R →+* R₂}
{σ₂₁ : R₂ →+* R}
[RingHomInvPair σ₁₂ σ₂₁]
[RingHomInvPair σ₂₁ σ₁₂]
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup E₂]
[Module R E]
[Module R₂ E₂]
(e : E ≃ₛₗᵢ[σ₁₂] E₂)


/--
Every comonoid object in a cartesian monoidal category is equivalent to
the canonical comonoid structure on the underlying object.
-/
@[simps] def iso_cartesianComon_ (A : Comon_ C) : A ≅ (cartesianComon_ C).obj A.X


@[simp]
theorem toFun_eq_coe {f : α →ᵈ β} : f.toFun = (f : α → β)

{α : Type u_1}
{β : Type u_2}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
{f : α →ᵈ β}


theorem sin_antiperiodic : Function.Antiperiodic sin π


lemma basis'_iff_basis_closure : M.Basis' I X ↔ M.Basis I (M.closure X) ∧ I ⊆ X

{α : Type u_2}
{M : Matroid α}
{X I : Set α}


private lemma ghostFun_zsmul (m : ℤ) (x : WittVector p R) : ghostFun (m • x) = m • ghostFun x

{p : ℕ}
{R : Type u_1}
[hp : Fact (Nat.Prime p)]
[CommRing R]
(m : ℤ)
(x : 𝕎 R)

WittVector.ghostFun (m • x) = m • WittVector.ghostFun x


@[to_additive]
theorem IsOpen.iUnion_preimage_smul [IsMinimal M α] {U : Set α} (hUo : IsOpen U)
    (hne : U.Nonempty) : ⋃ c : M, (c • ·) ⁻¹' U = univ

(M : Type u_1)
{α : Type u_3}
[Monoid M]
[TopologicalSpace α]
[MulAction M α]
[MulAction.IsMinimal M α]
{U : Set α}
(hUo : IsOpen U)
(hne : U.Nonempty)


lemma insert_lt_insert (ha : a ∉ s) (hb : b ∉ s) :
    toColex (insert a s) < toColex (insert b s) ↔ a < b

{α : Type u_1}
[PartialOrder α]
{s : Finset α}
{a b : α}
[DecidableEq α]
(ha : a ∉ s)
(hb : b ∉ s)

{ ofColex := insert a s } < { ofColex := insert b s } ↔ a < b


@[to_additive]
theorem mul_bot : s * ⊥ = ⊥

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

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


theorem mem_fixingSubgroup_iff_subset_fixedBy {s : Set α} {m : M} :
    m ∈ fixingSubgroup M s ↔ s ⊆ fixedBy α m

(M : Type u_1)
{α : Type u_2}
[Group M]
[MulAction M α]
{s : Set α}
{m : M}

m ∈ fixingSubgroup M s ↔ s ⊆ MulAction.fixedBy α m


/-- Ordinal games are numeric. -/
theorem numeric_toPGame (o : Ordinal) : o.toPGame.Numeric


theorem diff_subset_compl (s t : Set α) : s \ t ⊆ tᶜ


@[simp] theorem find?_nil : ([] : List α).find? p = none


@[simp]
lemma even_toAdd_iff {a : Multiplicative α} : Even (Multiplicative.toAdd a) ↔ IsSquare a

{α : Type u_2}
[Add α]
{a : Multiplicative α}


lemma IsSublattice_range [FunLike F α β] [LatticeHomClass F α β] (f : F) :
    IsSublattice (Set.range f)

{F : Type u_1}
{α : Type u_2}
{β : Type u_3}
[Lattice α]
[Lattice β]
[FunLike F α β]
[LatticeHomClass F α β]
(f : F)


theorem subset_iff {s₁ s₂ : Finset α} : s₁ ⊆ s₂ ↔ ∀ ⦃x⦄, x ∈ s₁ → x ∈ s₂

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


theorem inclusion_refl {S : Subgroupoid C} : inclusion (le_refl S) = 𝟭 S.objs

{C : Type u}
[CategoryTheory.Groupoid C]
{S : CategoryTheory.Subgroupoid C}

CategoryTheory.Subgroupoid.inclusion ⋯ = CategoryTheory.Functor.id ↑S.objs


@[to_additive (attr := simp, norm_cast)]
theorem coe_smul_finset (a : α) (s : Finset β) : ↑(a • s) = a • (↑s : Set β)

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


theorem exists_ne_zero_mem_ideal_of_norm_le_mul_sqrt_discr (I : (FractionalIdeal (𝓞 K)⁰ K)ˣ) :
    ∃ a ∈ (I : FractionalIdeal (𝓞 K)⁰ K), a ≠ 0 ∧
      |Algebra.norm ℚ (a : K)| ≤ FractionalIdeal.absNorm I.1 * (4 / π) ^ NrComplexPlaces K *
        (finrank ℚ K).factorial / (finrank ℚ K) ^ (finrank ℚ K) * Real.sqrt |discr K|

(I : (FractionalIdeal (nonZeroDivisors (NumberField.RingOfIntegers K)) K)ˣ)

∃ a ∈ ↑I,
  a ≠ 0 ∧
    ↑|(Algebra.norm ℚ) a| ≤
      ↑(FractionalIdeal.absNorm ↑I) * (4 / Real.pi) ^ NumberField.InfinitePlace.NrComplexPlaces K *
            ↑(FiniteDimensional.finrank ℚ K).factorial /
          ↑(FiniteDimensional.finrank ℚ K) ^ FiniteDimensional.finrank ℚ K *
        √|↑(NumberField.discr K)|


theorem succ_to_nat (n) : (succ n : ℕ) = n + 1


theorem closedBall_subset_cthickening_singleton {α : Type*} [PseudoMetricSpace α] (x : α) (δ : ℝ) :
    closedBall x δ ⊆ cthickening δ ({x} : Set α)

{α : Type u_2}
[PseudoMetricSpace α]
(x : α)
(δ : ℝ)

Metric.closedBall x δ ⊆ Metric.cthickening δ {x}


@[simp]
theorem isUnit_iff_ne_zero : IsUnit a ↔ a ≠ 0

{G₀ : Type u_3}
[GroupWithZero G₀]
{a : G₀}


theorem sdiff_sdiff_sup_sdiff' : z \ (x \ y ⊔ y \ x) = z ⊓ x ⊓ y ⊔ z \ x ⊓ z \ y

{α : Type u}
{x y z : α}
[GeneralizedBooleanAlgebra α]


theorem tendsto_nhdsWithin_of_tendsto_nhds {f : α → β} {a : α} {s : Set α} {l : Filter β}
    (h : Tendsto f (𝓝 a) l) : Tendsto f (𝓝[s] a) l

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
{f : α → β}
{a : α}
{s : Set α}
{l : Filter β}
(h : Filter.Tendsto f (𝓝 a) l)


@[simp]
theorem ofFn_const : ∀ (n : ℕ) (c : α), (ofFn fun _ : Fin n => c) = replicate n c

(List.ofFn fun x => c) = List.replicate n c


theorem FieldAxiom.toProp_of_model {K : Type*}
    [Add K] [Mul K] [Neg K] [Zero K] [One K] [CompatibleRing K]
    [Theory.field.Model K] (ax : FieldAxiom) : ax.toProp K

{K : Type u_2}
[Add K]
[Mul K]
[Neg K]
[Zero K]
[One K]
[FirstOrder.Ring.CompatibleRing K]
[K ⊨ FirstOrder.Language.Theory.field]
(ax : FirstOrder.Field.FieldAxiom)


theorem getElem_reverse_aux₂ :
    ∀ (l r : List α) (i : Nat) (h1) (h2),
      (reverseAux l r)[length l - 1 - i]'h1 = l[i]'h2

(h1 : l.length - 1 - i < (l.reverseAux r).length)

(l.reverseAux r)[l.length - 1 - i] = l[i]


theorem one_le_pi_div_two : (1 : ℝ) ≤ π / 2


@[simp]
theorem tensorLeftTensor_inv_app (X Y Z : C) :
    (tensorLeftTensor X Y).inv.app Z = (associator X Y Z).inv

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

(CategoryTheory.MonoidalCategory.tensorLeftTensor X Y).inv.app Z =
  (CategoryTheory.MonoidalCategory.associator X Y Z).inv


theorem pos_of_div_pos {n : ℕ+} {a : ℕ} (h : a ∣ n) : 0 < a


theorem norm_deriv_eq_norm_fderiv : ‖deriv f x‖ = ‖fderiv 𝕜 f x‖

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


@[to_additive (attr := simp)]
theorem coprod_unique (f : M × N →* P) : (f.comp (inl M N)).coprod (f.comp (inr M N)) = f

{M : Type u_5}
{N : Type u_6}
{P : Type u_7}
[AddZeroClass M]
[AddZeroClass N]
[AddCommMonoid P]
(f : M × N →+ P)

(f.comp (AddMonoidHom.inl M N)).coprod (f.comp (AddMonoidHom.inr M N)) = f


theorem HasFiniteFPowerSeriesOnBall.cPolynomialOn (hf : HasFiniteFPowerSeriesOnBall f p x n r) :
    CPolynomialOn 𝕜 f (EMetric.ball x r)


private theorem isRoot_cyclotomic_iff' {n : ℕ} {K : Type*} [Field K] {μ : K} [NeZero (n : K)] :
    IsRoot (cyclotomic n K) μ ↔ IsPrimitiveRoot μ n

{n : ℕ}
{K : Type u_2}
[Field K]
{μ : K}
[NeZero ↑n]

(Polynomial.cyclotomic n K).IsRoot μ ↔ IsPrimitiveRoot μ n


@[simp]
theorem lmul'_comp_includeLeft : (lmul' R : _ →ₐ[R] S).comp includeLeft = AlgHom.id R S

{R : Type uR}
{S : Type uS}
[CommSemiring R]
[CommSemiring S]
[Algebra R S]

(Algebra.TensorProduct.lmul' R).comp Algebra.TensorProduct.includeLeft = AlgHom.id R S


/-- A seminorm is uniformly continuous if `p.closedBall 0 r ∈ 𝓝 0` for *all* `r > 0`.
Over a `NontriviallyNormedField` it is actually enough to check that this is true
for *some* `r`, see `Seminorm.uniformContinuous'`. -/
protected theorem uniformContinuous_of_forall' [UniformSpace E] [UniformAddGroup E]
    {p : Seminorm 𝕝 E} (hp : ∀ r > 0, p.closedBall 0 r ∈ (𝓝 0 : Filter E)) :
    UniformContinuous p

{𝕝 : Type u_6}
{E : Type u_7}
[SeminormedRing 𝕝]
[AddCommGroup E]
[Module 𝕝 E]
[UniformSpace E]
[UniformAddGroup E]
{p : Seminorm 𝕝 E}
(hp : ∀ r > 0, p.closedBall 0 r ∈ 𝓝 0)


theorem forall_sigma_iff {p : (Σ i, α i) → Prop} :
    (∀ x ∈ s.sigma t, p x) ↔ ∀ ⦃i⦄, i ∈ s → ∀ ⦃a⦄, a ∈ t i → p ⟨i, a⟩

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

(∀ x ∈ s.sigma t, p x) ↔ ∀ ⦃i : ι⦄, i ∈ s → ∀ ⦃a : α i⦄, a ∈ t i → p ⟨i, a⟩


@[to_additive]
theorem orderOf_eq_zero (h : ¬IsOfFinOrder x) : orderOf x = 0

{G : Type u_1}
[Monoid G]
{x : G}
(h : ¬IsOfFinOrder x)


protected lemma add_nonnneg_iff_neg_le' : 0 ≤ a + b ↔ -a ≤ b


theorem eq_nil_of_map_eq_nil {f : α → β} {l : List α} (h : map f l = []) : l = []

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{l : List α}
(h : List.map f l = [])


/-- If `A` is a topological module over a commutative `R` with compatible actions,
then `star` is a continuous semilinear equivalence. -/
@[simps!]
def starL (R : Type*) {A : Type*} [CommSemiring R] [StarRing R] [AddCommMonoid A]
    [StarAddMonoid A] [Module R A] [StarModule R A] [TopologicalSpace A] [ContinuousStar A] :
    A ≃L⋆[R] A

(R : Type u_1)
{A : Type u_2}
[CommSemiring R]
[StarRing R]
[AddCommMonoid A]
[StarAddMonoid A]
[Module R A]
[StarModule R A]
[TopologicalSpace A]
[ContinuousStar A]

∀ (a : A), (starL R).symm a = starAddEquiv.symm a


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

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


/-- Arithmetic progressions can be pushed forward along bijective 2-Freiman homs. -/
@[to_additive "Arithmetic progressions can be pushed forward along bijective 2-Freiman homs."]
lemma IsMulFreimanHom.mulRothNumber_mono (hf : IsMulFreimanHom 2 A B f) (hf' : Set.BijOn f A B) :
    mulRothNumber B ≤ mulRothNumber A

{α : Type u_2}
{β : Type u_3}
[DecidableEq α]
[AddCommMonoid α]
[AddCommMonoid β]
[DecidableEq β]
{A : Finset α}
{B : Finset β}
{f : α → β}
(hf : IsAddFreimanHom 2 (↑A) (↑B) f)
(hf' : Set.BijOn f ↑A ↑B)


@[simp]
theorem coe_prodUnique [Unique β] : (⇑(prodUnique α β) : α × β → α) = Prod.fst

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


theorem SeparatedNhds.of_singleton_finset [T2Space X] {x : X} {s : Finset X} (h : x ∉ s) :
    SeparatedNhds ({x} : Set X) s

{X : Type u_1}
[TopologicalSpace X]
[T2Space X]
{x : X}
{s : Finset X}
(h : x ∉ s)


theorem integrableOn_Ioi_exp_neg_mul_sq_iff {b : ℝ} :
    IntegrableOn (fun x : ℝ => exp (-b * x ^ 2)) (Ioi 0) ↔ 0 < b

MeasureTheory.IntegrableOn (fun x => rexp (-b * x ^ 2)) (Set.Ioi 0) MeasureTheory.volume ↔ 0 < b


/-- Coercing a subspace to a set then taking the affine span produces the original subspace. -/
@[simp]
theorem affineSpan_coe (s : AffineSubspace k P) : affineSpan k (s : Set P) = s

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[S : AffineSpace V P]
(s : AffineSubspace k P)


theorem abs_eq (hb : 0 ≤ b) : |a| = b ↔ a = b ∨ a = -b

{α : Type u_1}
[LinearOrderedAddCommGroup α]
{a b : α}
(hb : 0 ≤ b)


lemma rdrop_add (i j : ℕ) : (l.rdrop i).rdrop j = l.rdrop (i + j)


theorem isDetector_op_iff (G : C) : IsDetector (op G) ↔ IsCodetector G

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

CategoryTheory.IsDetector (Opposite.op G) ↔ CategoryTheory.IsCodetector G


@[reassoc]
theorem gluedLiftPullbackMap_fst (i j : 𝒰.J) :
    gluedLiftPullbackMap 𝒰 f g s i j ≫ pullback.fst _ _ =
      pullback.fst _ _ ≫
        (pullbackSymmetry _ _).hom ≫
          pullback.map _ _ _ _ (𝟙 _) s.snd f (Category.id_comp _).symm s.condition

[∀ (i : 𝒰.J), CategoryTheory.Limits.HasPullback (𝒰.map i ≫ f) g]

(s : CategoryTheory.Limits.PullbackCone f g)

AlgebraicGeometry.Scheme.Pullback.gluedLiftPullbackMap 𝒰 f g s i j ≫
    CategoryTheory.Limits.pullback.fst (CategoryTheory.Limits.pullback.fst (𝒰.map i ≫ f) g ≫ 𝒰.map i) (𝒰.map j) =
  CategoryTheory.Limits.pullback.fst ((𝒰.pullbackCover s.fst).map i) ((𝒰.pullbackCover s.fst).map j) ≫
    (CategoryTheory.Limits.pullbackSymmetry s.fst (𝒰.map i)).hom ≫
      CategoryTheory.Limits.pullback.map (𝒰.map i) s.fst (𝒰.map i ≫ f) g (𝟙 (𝒰.obj i)) s.snd f ⋯ ⋯


/-- Construct an equivalence from functions that are inverse to each other. -/
@[simps]
def ofLeftInverseOfCardLE (hβα : card β ≤ card α) (f : α → β) (g : β → α) (h : LeftInverse g f) :
    α ≃ β

{α : Type u_1}
{β : Type u_2}
[Fintype α]
[Fintype β]
(hβα : Fintype.card β ≤ Fintype.card α)
(f : α → β)
(g : β → α)
(h : Function.LeftInverse g f)

∀ (a : β), (Equiv.ofLeftInverseOfCardLE hβα f g h).symm a = g a


protected theorem traverse_map {α β γ : Type u} (g : α → β) (f : β → G γ) (x : σ ⊕ α) :
    Sum.traverse f (g <$> x) = Sum.traverse (f ∘ g) x

{σ : Type u}
{G : Type u → Type u}
[Applicative G]
{α β γ : Type u}
(g : α → β)
(f : β → G γ)
(x : σ ⊕ α)


@[to_additive existing (attr := simp)]
lemma equivShrink_symm_one [One α] [Small α] : (equivShrink α).symm 1 = 1

{α : Type u_1}
[One α]
[Small.{u_2, u_1} α]


@[simp]
theorem map₂Left'_nil_right (f : α → Option β → γ) (as) :
    map₂Left' f as [] = (as.map fun a => f a none, [])

{α : Type u}
{β : Type v}
{γ : Type w}
(f : α → Option β → γ)
(as : List α)

List.map₂Left' f as [] = (List.map (fun a => f a none) as, [])


@[to_additive]
theorem eq_bot_of_card_le (h : card S ≤ 1) : S = ⊥

{M : Type u_1}
[AddMonoid M]
{S : AddSubmonoid M}
[Fintype ↥S]
(h : Fintype.card ↥S ≤ 1)


@[reassoc (attr := simp)] lemma f'_π : h.f' ≫ h.π = 0

CategoryTheory.CategoryStruct.comp h.f' h.π = 0


theorem Integrable.neg (hf : Integrable I l f vol) : Integrable I l (-f) vol

{ι : Type u}
{E : Type v}
{F : Type w}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[NormedAddCommGroup F]
[NormedSpace ℝ F]
{I : BoxIntegral.Box ι}
[Fintype ι]
{l : BoxIntegral.IntegrationParams}
{f : (ι → ℝ) → E}
{vol : ι →ᵇᵃ[⊤] E →L[ℝ] F}
(hf : BoxIntegral.Integrable I l f vol)


theorem pt_mem_toPartialHomeomorph_source : φ.pt ∈ φ.toPartialHomeomorph.source

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[CompleteSpace E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[CompleteSpace F]
{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
[CompleteSpace G]
(φ : ImplicitFunctionData 𝕜 E F G)


theorem rtendsto_nhds {r : Rel Y X} {l : Filter Y} {x : X} :
    RTendsto r l (𝓝 x) ↔ ∀ s, IsOpen s → x ∈ s → r.core s ∈ l

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
{r : Rel Y X}
{l : Filter Y}
{x : X}

Filter.RTendsto r l (𝓝 x) ↔ ∀ (s : Set X), IsOpen s → x ∈ s → r.core s ∈ l


@[simp] theorem size_node (sz : ℕ) (l : Ordnode α) (x : α) (r : Ordnode α) :
    size (node sz l x r) = sz

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


@[elab_as_elim]
theorem induction_on_irreducible {P : α → Prop} (a : α) (h0 : P 0) (hu : ∀ u : α, IsUnit u → P u)
    (hi : ∀ a i : α, a ≠ 0 → Irreducible i → P a → P (i * a)) : P a

(hi : ∀ (a i : α), a ≠ 0 → Irreducible i → P a → P (i * a))


/-- The ordered scalar product property is when an ordered additive commutative monoid
with a partial order has a scalar multiplication which is compatible with the order. Note that this
is different from `IsOrderedSMul`, which uses `≤`, has no semiring assumption, and has no positivity
constraint on the defining conditions.
-/
class OrderedSMul (R M : Type*) [OrderedSemiring R] [OrderedAddCommMonoid M] [SMulWithZero R M] :
  Prop where
  /-- Scalar multiplication by positive elements preserves the order. -/
  protected smul_lt_smul_of_pos : ∀ {a b : M}, ∀ {c : R}, a < b → 0 < c → c • a < c • b
  /-- If `c • a < c • b` for some positive `c`, then `a < b`. -/
  protected lt_of_smul_lt_smul_of_pos : ∀ {a b : M}, ∀ {c : R}, c • a < c • b → 0 < c → a < b

{R : Type u_1}
{M : Type u_2}
[OrderedSemiring R]
[OrderedAddCommMonoid M]
[SMulWithZero R M]
[self : OrderedSMul R M]
{a b : M}
{c : R}


@[simp] theorem isSome_none : @isSome α none = false


@[simp]
theorem ediam_image (s : Set P) : EMetric.diam (e '' s) = EMetric.diam 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)


theorem OrderIso.map_sInf [CompleteLattice β] (f : α ≃o β) (s : Set α) :
    f (sInf s) = ⨅ a ∈ s, f a

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


@[simp, reassoc]
theorem t_snd (i j : 𝒰.J) : t 𝒰 f g i j ≫ pullback.snd _ _ =
    pullback.fst _ _ ≫ pullback.fst _ _

AlgebraicGeometry.Scheme.Pullback.t 𝒰 f g i j ≫
    CategoryTheory.Limits.pullback.snd (CategoryTheory.Limits.pullback.fst (𝒰.map j ≫ f) g ≫ 𝒰.map j) (𝒰.map i) =
  CategoryTheory.Limits.pullback.fst (CategoryTheory.Limits.pullback.fst (𝒰.map i ≫ f) g ≫ 𝒰.map i) (𝒰.map j) ≫
    CategoryTheory.Limits.pullback.fst (𝒰.map i ≫ f) g


@[simp] lemma MeasureTheory.Measure.cdf_eq_iff (μ ν : Measure ℝ) [IsProbabilityMeasure μ]
    [IsProbabilityMeasure ν] :
    cdf μ = cdf ν ↔ μ = ν

(μ ν : MeasureTheory.Measure ℝ)
[MeasureTheory.IsProbabilityMeasure μ]
[MeasureTheory.IsProbabilityMeasure ν]

ProbabilityTheory.cdf μ = ProbabilityTheory.cdf ν ↔ μ = ν


theorem restrict_le_self (m : OuterMeasure α) (s : Set α) : restrict s m ≤ m

{α : Type u_1}
(m : MeasureTheory.OuterMeasure α)
(s : Set α)

(MeasureTheory.OuterMeasure.restrict s) m ≤ m


theorem subgroup_on_glpos_smul_apply (s : Γ) (g : GL(2, ℝ)⁺) (z : ℍ) :
    (s • g) • z = ((s : GL(2, ℝ)⁺) * g) • z

(Γ : Subgroup SL(2, ℤ))
(s : ↥Γ)
(g : ↥GL(2, ℝ)⁺)
(z : ℍ)


@[to_additive]
theorem orderOf_dvd_of_pow_eq_one (h : x ^ n = 1) : orderOf x ∣ n

{G : Type u_1}
[AddMonoid G]
{x : G}
{n : ℕ}
(h : n • x = 0)


theorem isInt_lt_false [OrderedRing α] {a b : α} {a' b' : ℤ}
    (ha : IsInt a a') (hb : IsInt b b') (h : decide (b' ≤ a')) : ¬a < b

{α : Type u_1}
[OrderedRing α]
{a b : α}
{a' b' : ℤ}
(ha : Mathlib.Meta.NormNum.IsInt a a')
(hb : Mathlib.Meta.NormNum.IsInt b b')
(h : decide (b' ≤ a') = true)


@[simp]
theorem AddSubgroup.toIntSubmodule_toAddSubgroup (S : AddSubgroup M) :
    S.toIntSubmodule.toAddSubgroup = S

{M : Type u_3}
[AddCommGroup M]
(S : AddSubgroup M)

(AddSubgroup.toIntSubmodule S).toAddSubgroup = S


@[simp]
theorem symm_dual_comp (g : BoundedLatticeHom βᵒᵈ γᵒᵈ) (f : BoundedLatticeHom αᵒᵈ βᵒᵈ) :
    BoundedLatticeHom.dual.symm (g.comp f) =
      (BoundedLatticeHom.dual.symm g).comp (BoundedLatticeHom.dual.symm f)

{α : Type u_3}
{β : Type u_4}
{γ : Type u_5}
[Lattice α]
[BoundedOrder α]
[Lattice β]
[BoundedOrder β]
[Lattice γ]
[BoundedOrder γ]
(g : BoundedLatticeHom βᵒᵈ γᵒᵈ)
(f : BoundedLatticeHom αᵒᵈ βᵒᵈ)


@[to_additive prod_mono]
theorem prod_mono {s₁ s₂ : Submonoid M} {t₁ t₂ : Submonoid N} (hs : s₁ ≤ s₂) (ht : t₁ ≤ t₂) :
    s₁.prod t₁ ≤ s₂.prod t₂

{M : Type u_1}
{N : Type u_2}
[MulOneClass M]
[MulOneClass N]
{s₁ s₂ : Submonoid M}
{t₁ t₂ : Submonoid N}
(hs : s₁ ≤ s₂)
(ht : t₁ ≤ t₂)


theorem minimum_not_lt_of_mem : a ∈ l → (minimum l : WithTop α) = m → ¬a < m

{α : Type u_1}
[Preorder α]
[DecidableRel fun x x_1 => x < x_1]
{l : List α}
{a m : α}


theorem IsSeparating.isDetecting [Balanced C] {𝒢 : Set C} (h𝒢 : IsSeparating 𝒢) :
    IsDetecting 𝒢

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


/-- Constant one function has product `1` -/
@[to_additive "Constant zero function has sum `0`"]
theorem hasProd_one : HasProd (fun _ ↦ 1 : β → α) 1

{α : Type u_1}
{β : Type u_2}
[AddCommMonoid α]
[TopologicalSpace α]


/-- The valuation on the completion agrees with the global valuation on elements of the
integer ring. -/
theorem valuedAdicCompletion_eq_valuation (r : R) :
    Valued.v (r : v.adicCompletion K) = v.valuation (r : K)

(v : IsDedekindDomain.HeightOneSpectrum R)


/-- Together `Matrix.submatrixEquivInvertible` and
`Matrix.invertibleOfSubmatrixEquivInvertible` form an equivalence, although both sides of the
equiv are subsingleton anyway. -/
@[simps]
def submatrixEquivInvertibleEquivInvertible (A : Matrix m m α) (e₁ e₂ : n ≃ m) :
    Invertible (A.submatrix e₁ e₂) ≃ Invertible A

{m : Type u}
{n : Type u'}
{α : Type v}
[Fintype n]
[DecidableEq n]
[CommRing α]
[Fintype m]
[DecidableEq m]
(A : Matrix m m α)
(e₁ e₂ : n ≃ m)

∀ (x : Invertible A), (A.submatrixEquivInvertibleEquivInvertible e₁ e₂).symm x = A.submatrixEquivInvertible e₁ e₂


@[simp]
theorem head_mk (x : F (M F)) : head (M.mk x) = x.1


@[simp]
theorem revzip_map_fst (l : List α) : (revzip l).map Prod.fst = l


theorem natDegree_pos_of_eraseLead_ne_zero (h : f.eraseLead ≠ 0) : 0 < f.natDegree

{R : Type u_1}
[Semiring R]
{f : R[X]}
(h : f.eraseLead ≠ 0)


/-- If `l` is already `List.Sorted` with respect to `r`, then `insertionSort` does not change
it. -/
theorem Sorted.insertionSort_eq : ∀ {l : List α}, Sorted r l → insertionSort r l = l

{α : Type u}
{r : α → α → Prop}
[DecidableRel r]
{l : List α}

List.Sorted r l → List.insertionSort r l = l


theorem setLIntegral_preimage_condDistrib (hX : Measurable X) (hY : AEMeasurable Y μ)
    (hs : MeasurableSet s) (ht : MeasurableSet t) :
    ∫⁻ a in X ⁻¹' t, condDistrib Y X μ (X a) s ∂μ = μ (X ⁻¹' t ∩ Y ⁻¹' s)

{α : Type u_1}
{β : Type u_2}
{Ω : Type u_3}
[MeasurableSpace Ω]
[StandardBorelSpace Ω]
[Nonempty Ω]
{mα : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[MeasureTheory.IsFiniteMeasure μ]
{X : α → β}
{Y : α → Ω}
{mβ : MeasurableSpace β}
{s : Set Ω}
{t : Set β}
(hX : Measurable X)
(hY : AEMeasurable Y μ)
(hs : MeasurableSet s)
(ht : MeasurableSet t)

∫⁻ (a : α) in X ⁻¹' t, ((ProbabilityTheory.condDistrib Y X μ) (X a)) s ∂μ = μ (X ⁻¹' t ∩ Y ⁻¹' s)


/-- See note [partially-applied ext lemmas] -/
theorem monoidHom_ext ⦃j k : S →* P⦄
    (h : j.comp (algebraMap R S : R →* S) = k.comp (algebraMap R S)) : j = k

(h : j.comp ↑(algebraMap R S) = k.comp ↑(algebraMap R S))


theorem additive_of_preservesBinaryBiproducts [HasBinaryBiproducts C] [PreservesZeroMorphisms F]
    [PreservesBinaryBiproducts F] : Additive F


@[simp]
theorem symm_apply_apply (e : P₁ ≃ᵃL[k] P₂) (p : P₁) : e.symm (e p) = p

{k : Type u_1}
{P₁ : Type u_2}
{P₂ : Type u_3}
{V₁ : Type u_6}
{V₂ : Type u_7}
[Ring k]
[AddCommGroup V₁]
[Module k V₁]
[AddTorsor V₁ P₁]
[AddCommGroup V₂]
[Module k V₂]
[AddTorsor V₂ P₂]
[TopologicalSpace P₁]
[TopologicalSpace P₂]
(e : P₁ ≃ᵃL[k] P₂)
(p : P₁)


@[simp]
theorem involute_e0 : involute (e0 Q) = -e0 Q

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

CliffordAlgebra.involute (CliffordAlgebra.EquivEven.e0 Q) = -CliffordAlgebra.EquivEven.e0 Q


lemma quasiIso_of_arrow_mk_iso (φ : S₁ ⟶ S₂) (φ' : S₃ ⟶ S₄) (e : Arrow.mk φ ≅ Arrow.mk φ')
    [hφ : QuasiIso φ] : QuasiIso φ'

{S₁ S₂ S₃ S₄ : CategoryTheory.ShortComplex C}

(e : CategoryTheory.Arrow.mk φ ≅ CategoryTheory.Arrow.mk φ')

[hφ : CategoryTheory.ShortComplex.QuasiIso φ]


@[simp]
theorem singleton_inj {x y : ZFSet} : ({x} : ZFSet) = {y} ↔ x = y


theorem not_tendsto_nhds_of_tendsto_atTop (hf : Tendsto f l atTop) (a : α) : ¬Tendsto f l (𝓝 a)

{α : Type u}
{β : Type v}
[Preorder α]
[NoTopOrder α]
[TopologicalSpace α]
[ClosedIciTopology α]
{l : Filter β}
[l.NeBot]
{f : β → α}
(hf : Filter.Tendsto f l Filter.atTop)
(a : α)


@[to_additive]
protected lemma mul_div_mul_right (h : IsUnit c) (a b : α) : a * c / (b * c) = a / b

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


theorem primPart_dvd (p : R[X]) : p.primPart ∣ p

{R : Type u_1}
[CommRing R]
[IsDomain R]
[NormalizedGCDMonoid R]
(p : Polynomial R)


lemma Indep.mapEmbedding (hI : M.Indep I) (f : α ↪ β) : (M.mapEmbedding f).Indep (f '' I)

{α : Type u_1}
{β : Type u_2}
{I : Set α}
{M : Matroid α}
(hI : M.Indep I)
(f : α ↪ β)


/-- `Terminates s` asserts that the computation `s` eventually terminates with some value. -/
class Terminates (s : Computation α) : Prop where
  /-- assertion that there is some term `a` such that the `Computation` terminates -/
  term : ∃ a, a ∈ s

{α : Type u}
{s : Computation α}
[self : s.Terminates]


@[simp] theorem run_bind_lift [Monad m] (x : m α) (f : α → ExceptCpsT ε m β) : run (ExceptCpsT.lift x >>= f : ExceptCpsT ε m β) = x >>= fun a => run (f a)

{m : Type u_1 → Type u_2}
{α ε β : Type u_1}
[Monad m]
(x : m α)
(f : α → ExceptCpsT ε m β)

(ExceptCpsT.lift x >>= f).run = do
  let a ← x
  (f a).run


theorem geom_sum_pos' [LinearOrderedRing α] (hx : 0 < x + 1) (hn : n ≠ 0) :
    0 < ∑ i ∈ range n, x ^ i

{α : Type u}
{n : ℕ}
{x : α}
[LinearOrderedRing α]
(hx : 0 < x + 1)
(hn : n ≠ 0)


protected theorem lt_add_of_neg_lt_sub_left {a b c : Int} (h : -a < b - c) : c < a + b


@[simps]
instance left (f g : a ⟶ b) [BicategoricalCoherence f g] :
    BicategoricalCoherence (𝟙 a ≫ f) g


theorem wbtw_or_wbtw_smul_vadd_of_nonpos (x : P) (v : V) {r₁ r₂ : R} (hr₁ : r₁ ≤ 0) (hr₂ : r₂ ≤ 0) :
    Wbtw R x (r₁ • v +ᵥ x) (r₂ • v +ᵥ x) ∨ Wbtw R x (r₂ • v +ᵥ x) (r₁ • v +ᵥ x)

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[LinearOrderedField R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
(x : P)
(v : V)
{r₁ r₂ : R}
(hr₁ : r₁ ≤ 0)
(hr₂ : r₂ ≤ 0)


theorem mk_equiv_eq_zero_iff_ne : #(α ≃ β) = 0 ↔ #α ≠ #β

#(α ≃ β) = 0 ↔ #α ≠ #β


@[simp]
theorem edges_transfer (hp) : (p.transfer H hp).edges = p.edges

{V : Type u}
{G : SimpleGraph V}
{u v : V}
(p : G.Walk u v)
{H : SimpleGraph V}
(hp : ∀ e ∈ p.edges, e ∈ H.edgeSet)


@[field_simps]
theorem neg_div' (a b : K) : -(b / a) = -b / a

{K : Type u_3}
[DivisionMonoid K]
[HasDistribNeg K]
(a b : K)


@[to_additive]
theorem oreDiv_mul_oreDiv_comm {r₁ r₂ : R} {s₁ s₂ : S} :
    r₁ /ₒ s₁ * (r₂ /ₒ s₂) = r₁ * r₂ /ₒ (s₁ * s₂)

{R : Type u_1}
[AddCommMonoid R]
{S : AddSubmonoid R}
[AddOreLocalization.AddOreSet S]
{r₁ r₂ : R}
{s₁ s₂ : ↥S}

r₁ -ₒ s₁ + (r₂ -ₒ s₂) = r₁ + r₂ -ₒ (s₁ + s₂)


@[to_additive]
protected theorem one_def : (1 : R[S⁻¹]) = 1 /ₒ 1

{R : Type u_1}
[Monoid R]
{S : Submonoid R}
[OreLocalization.OreSet S]


@[simp, norm_cast]
protected theorem coe_neg_one : ((-1 : αˣ) : α) = -1

{α : Type u}
[Monoid α]
[HasDistribNeg α]


@[simp] theorem eraseP_cons_of_neg {l : List α} (p) (h : ¬p a) :
    (a :: l).eraseP p = a :: l.eraseP p

{α : Type u_1}
{a : α}
{l : List α}
(p : α → Bool)
(h : ¬p a = true)

List.eraseP p (a :: l) = a :: List.eraseP p l


/-- A group `G` is nilpotent if its upper central series is eventually `G`. -/
class Group.IsNilpotent (G : Type*) [Group G] : Prop where
  nilpotent' : ∃ n : ℕ, upperCentralSeries G n = ⊤

{G : Type u_2}
[Group G]
[self : Group.IsNilpotent G]


theorem kroneckerTMul_add (A : Matrix l m α) (B₁ B₂ : Matrix n p α) :
    A ⊗ₖₜ[R] (B₁ + B₂) = A ⊗ₖₜ B₁ + A ⊗ₖₜ B₂

(R : Type u_1)
{α : Type u_2}
{l : Type u_8}
{m : Type u_9}
{n : Type u_10}
{p : Type u_11}
[CommSemiring R]
[AddCommMonoid α]
[Module R α]
(A : Matrix l m α)
(B₁ B₂ : Matrix n p α)

Matrix.kroneckerMap (TensorProduct.tmul R) A (B₁ + B₂) =
  Matrix.kroneckerMap (fun x x_1 => x ⊗ₜ[R] x_1) A B₁ + Matrix.kroneckerMap (fun x x_1 => x ⊗ₜ[R] x_1) A B₂


/-- Construct the Beck cofork in the category of algebras. This cofork is reflexive as well as a
coequalizer.
-/
@[simps!]
def beckAlgebraCofork : Cofork (FreeCoequalizer.topMap X) (FreeCoequalizer.bottomMap X)

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

∀ (X_1 : CategoryTheory.Limits.WalkingParallelPair),
  (CategoryTheory.Monad.beckAlgebraCofork X).ι.app X_1 =
    CategoryTheory.Limits.WalkingParallelPair.rec
      (CategoryTheory.CategoryStruct.comp (CategoryTheory.Monad.FreeCoequalizer.topMap X)
        (CategoryTheory.Monad.FreeCoequalizer.π X))
      (CategoryTheory.Monad.FreeCoequalizer.π X) X_1


theorem Real.mul_iInf_of_nonneg (ha : 0 ≤ r) (f : ι → ℝ) : (r * ⨅ i, f i) = ⨅ i, r * f i

{ι : Sort u_1}
{r : ℝ}
(ha : 0 ≤ r)
(f : ι → ℝ)


theorem induction_on [Semiring k] [Monoid G] {p : MonoidAlgebra k G → Prop} (f : MonoidAlgebra k G)
    (hM : ∀ g, p (of k G g)) (hadd : ∀ f g : MonoidAlgebra k G, p f → p g → p (f + g))
    (hsmul : ∀ (r : k) (f), p f → p (r • f)) : p f

(hM : ∀ (g : G), p ((MonoidAlgebra.of k G) g))

(hadd : ∀ (f g : MonoidAlgebra k G), p f → p g → p (f + g))

(hsmul : ∀ (r : k) (f : MonoidAlgebra k G), p f → p (r • f))


@[to_additive]
theorem mk_self (a : S) : mk (a : M) a = 1

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


theorem restrictScalars_adjoin (K : IntermediateField F E) (S : Set E) :
    restrictScalars F (adjoin K S) = adjoin F (K ∪ S)

(F : Type u_1)
[Field F]
{E : Type u_2}
[Field E]
[Algebra F E]
(K : IntermediateField F E)
(S : Set E)

IntermediateField.restrictScalars F (IntermediateField.adjoin (↥K) S) = IntermediateField.adjoin F (↑K ∪ S)


@[simp]
theorem center_eq_top (R) [CommRing R] : center R = ⊤


@[simp]
theorem iInf_principal_finset {ι : Type w} (s : Finset ι) (f : ι → Set α) :
    ⨅ i ∈ s, 𝓟 (f i) = 𝓟 (⋂ i ∈ s, f i)

{α : Type u}
{ι : Type w}
(s : Finset ι)
(f : ι → Set α)


theorem mergeSort_eq_insertionSort [IsAntisymm α r] (l : List α) :
    mergeSort r l = insertionSort r l

{α : Type u}
(r : α → α → Prop)
[DecidableRel r]
[IsTotal α r]
[IsTrans α r]
[IsAntisymm α r]
(l : List α)

List.mergeSort r l = List.insertionSort r l


theorem tendsto_indicator_ge (f : α → β) (x : α) :
    Tendsto (fun M : ℕ => { x | (M : ℝ) ≤ ‖f x‖₊ }.indicator f x) atTop (𝓝 0)

{α : Type u_1}
{β : Type u_2}
[NormedAddCommGroup β]
(f : α → β)
(x : α)

Filter.Tendsto (fun M => {x | ↑M ≤ ↑‖f x‖₊}.indicator f x) Filter.atTop (𝓝 0)


theorem extend_coe [T2Space β] (hf : UniformContinuous f) (a : α) : (pkg.extend f) (ι a) = f a

{α : Type u_1}
[UniformSpace α]
(pkg : AbstractCompletion α)
{β : Type u_2}
[UniformSpace β]
{f : α → β}
[T2Space β]
(hf : UniformContinuous f)
(a : α)


@[simp, norm_cast] lemma intCast_im (n : ℤ) : (n : ℂ).im = 0


@[to_additive (attr := simp)]
theorem orbitRel.Quotient.orbit_mk (a : α) :
    orbitRel.Quotient.orbit (Quotient.mk'' a : orbitRel.Quotient G α) = MulAction.orbit G a

{G : Type u_1}
{α : Type u_2}
[AddGroup G]
[AddAction G α]
(a : α)

AddAction.orbitRel.Quotient.orbit (Quotient.mk'' a) = AddAction.orbit G a


theorem rpow_neg {x : ℝ} (hx : 0 ≤ x) (y : ℝ) : x ^ (-y) = (x ^ y)⁻¹


@[to_additive]
theorem Nonempty.of_smul_right : (s • t).Nonempty → t.Nonempty

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


/-- A preconnected space is one where there is no non-trivial open partition. -/
class PreconnectedSpace (α : Type u) [TopologicalSpace α] : Prop where
  /-- The universal set `Set.univ` in a preconnected space is a preconnected set. -/
  isPreconnected_univ : IsPreconnected (univ : Set α)

{α : Type u}
[TopologicalSpace α]
[self : PreconnectedSpace α]


@[congr]
theorem biUnion_congr (h : π₁ = π₂) (hi : ∀ J ∈ π₁, πi₁ J = πi₂ J) :
    π₁.biUnion πi₁ = π₂.biUnion πi₂

{πi₁ πi₂ : (J : BoxIntegral.Box ι) → BoxIntegral.Prepartition J}


/-- If a set of functions is equicontinuous at some `x₀` within a set `S`, its closure for the
product topology is also equicontinuous at `x₀` within `S`. This would also be true for the coarser
topology of pointwise convergence on `S ∪ {x₀}`, see `Set.EquicontinuousWithinAt.closure'`. -/
protected theorem Set.EquicontinuousWithinAt.closure {A : Set (X → α)} {S : Set X} {x₀ : X}
    (hA : A.EquicontinuousWithinAt S x₀) :
    (closure A).EquicontinuousWithinAt S x₀

{X : Type u_3}
{α : Type u_7}
[tX : TopologicalSpace X]
[uα : UniformSpace α]
{A : Set (X → α)}
{S : Set X}
{x₀ : X}
(hA : A.EquicontinuousWithinAt S x₀)


@[simp]
theorem length_alternatingWord (i i' : B) (m : ℕ) :
    List.length (alternatingWord i i' m) = m

(CoxeterSystem.alternatingWord i i' m).length = m


theorem coe_lpSubmodule : (lpSubmodule E p 𝕜).toAddSubgroup = lp E p

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


theorem generateFrom_piiUnionInter_measurableSet (m : ι → MeasurableSpace α) (S : Set ι) :
    generateFrom (piiUnionInter (fun n => { s | MeasurableSet[m n] s }) S) = ⨆ i ∈ S, m i

{α : Type u_1}
{ι : Type u_2}
(m : ι → MeasurableSpace α)
(S : Set ι)

MeasurableSpace.generateFrom (piiUnionInter (fun n => {s | MeasurableSet s}) S) = ⨆ i ∈ S, m i


theorem aecover_ball {x : α} {r : ι → ℝ} (hr : Tendsto r l atTop) :
    AECover μ l (fun i ↦ Metric.ball x (r i))

{α : Type u_1}
{ι : Type u_2}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
{l : Filter ι}
[PseudoMetricSpace α]
[OpensMeasurableSpace α]
{x : α}
{r : ι → ℝ}
(hr : Filter.Tendsto r l Filter.atTop)

MeasureTheory.AECover μ l fun i => Metric.ball x (r i)


theorem sum_fin [AddCommMonoid S] (f : ℕ → R → S) (hf : ∀ i, f i 0 = 0) {n : ℕ} {p : R[X]}
    (hn : p.degree < n) : (∑ i : Fin n, f i (p.coeff i)) = p.sum f

{R : Type u}
{S : Type v}
[Semiring R]
[AddCommMonoid S]
(f : ℕ → R → S)
(hf : ∀ (i : ℕ), f i 0 = 0)
{n : ℕ}
{p : R[X]}
(hn : p.degree < ↑n)

∑ i : Fin n, f (↑i) (p.coeff ↑i) = p.sum f


@[to_additive (attr := to_additive) (reorder := 6 7) smul_comp]
theorem pow_comp [Pow γ α] (x : β → γ) (a : α) (y : I → β) : (x ^ a) ∘ y = x ∘ y ^ a

{I : Type u}
{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[Pow γ α]
(x : β → γ)
(a : α)
(y : I → β)


/-- Monotone convergence theorem for nonincreasing sequences of functions -/
theorem lintegral_iInf_ae {f : ℕ → α → ℝ≥0∞} (h_meas : ∀ n, Measurable (f n))
    (h_mono : ∀ n : ℕ, f n.succ ≤ᵐ[μ] f n) (h_fin : ∫⁻ a, f 0 a ∂μ ≠ ∞) :
    ∫⁻ a, ⨅ n, f n a ∂μ = ⨅ n, ∫⁻ a, f n a ∂μ

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

(h_mono : ∀ (n : ℕ), f n.succ ≤ᵐ[μ] f n)

∫⁻ (a : α), ⨅ n, f n a ∂μ = ⨅ n, ∫⁻ (a : α), f n a ∂μ


theorem map_right_cancel {x y} {c : M} (h : algebraMap R S (c * x) = algebraMap R S (c * y)) :
    algebraMap R S x = algebraMap R S y

(h : (algebraMap R S) (↑c * x) = (algebraMap R S) (↑c * y))


theorem desc_c_naturality (F : J ⥤ PresheafedSpace.{_, _, v} C) (s : Cocone F)
    {U V : (Opens s.pt.carrier)ᵒᵖ} (i : U ⟶ V) :
    s.pt.presheaf.map i ≫ descCApp F s V =
      descCApp F s U ≫
        (colimit.desc (F ⋙ forget C) ((forget C).mapCocone s) _* (colimitCocone F).pt.presheaf).map
          i

[∀ (X : TopCat), CategoryTheory.Limits.HasLimitsOfShape Jᵒᵖ (TopCat.Presheaf C X)]

(F : J ⥤ AlgebraicGeometry.PresheafedSpace C)

{U V : (TopologicalSpace.Opens ↑↑s.pt)ᵒᵖ}

s.pt.presheaf.map i ≫ AlgebraicGeometry.PresheafedSpace.ColimitCoconeIsColimit.descCApp F s V =
  AlgebraicGeometry.PresheafedSpace.ColimitCoconeIsColimit.descCApp F s U ≫
    ((TopCat.Presheaf.pushforward C
              (CategoryTheory.Limits.colimit.desc (F ⋙ AlgebraicGeometry.PresheafedSpace.forget C)
                ((AlgebraicGeometry.PresheafedSpace.forget C).mapCocone s))).obj
          (AlgebraicGeometry.PresheafedSpace.colimitCocone F).pt.presheaf).map
      i


/-- The equivalence that is part of the universal property of the pushout. A hom out of
the pushout is just a morphism out of all groups in the pushout that satisfies a commutativity
condition. -/
@[simps]
def homEquiv :
    (PushoutI φ →* K) ≃ { f : (Π i, G i →* K) × (H →* K) // ∀ i, (f.1 i).comp (φ i) = f.2 }

Monoid.PushoutI.homEquiv.symm f = Monoid.PushoutI.lift (↑f).1 (↑f).2 ⋯


theorem SupIrred.ne_bot (ha : SupIrred a) : a ≠ ⊥

{α : Type u_2}
[SemilatticeSup α]
{a : α}
[OrderBot α]
(ha : SupIrred a)


theorem uncurry_bicompl (f : γ → δ → ε) (g : α → γ) (h : β → δ) :
    uncurry (bicompl f g h) = uncurry f ∘ Prod.map g h

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{δ : Type u_4}
{ε : Type u_5}
(f : γ → δ → ε)
(g : α → γ)
(h : β → δ)

Function.uncurry (Function.bicompl f g h) = Function.uncurry f ∘ Prod.map g h


protected theorem mdifferentiable' (f : C^n⟮I, M; I', M'⟯) (hn : 1 ≤ n) : MDifferentiable I I' f

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M' : Type u_7}
[TopologicalSpace M']
[ChartedSpace H' M']
{n : ℕ∞}
(f : C^n⟮I, M; I', M'⟯)
(hn : 1 ≤ n)


@[simp]
theorem target (F : Homotopy p₀ p₁) (t : I) : F (t, 1) = x₁

{X : Type u}
[TopologicalSpace X]
{x₀ x₁ : X}
{p₀ p₁ : Path x₀ x₁}
(F : p₀.Homotopy p₁)
(t : ↑I)


theorem beattySeq'_symmDiff_beattySeq_pos {r s : ℝ} (hrs : r.IsConjExponent s) :
    {beattySeq' r k | k > 0} ∆ {beattySeq s k | k > 0} = {n | 0 < n}

{x | ∃ k > 0, beattySeq' r k = x} ∆ {x | ∃ k > 0, beattySeq s k = x} = {n | 0 < n}


/-- The inductively defined smallest congruence relation containing a binary relation `r` equals
    the infimum of the set of congruence relations containing `r`. -/
theorem ringConGen_eq (r : R → R → Prop) :
    ringConGen r = sInf {s : RingCon R | ∀ x y, r x y → s x y}

{R : Type u_2}
[Add R]
[Mul R]
(r : R → R → Prop)

ringConGen r = sInf {s | ∀ (x y : R), r x y → s x y}


@[reassoc]
lemma stalkMap_congr (f g : X ⟶ Y) (hfg : f = g) (x x' : X)
    (hxx' : x = x') : f.stalkMap x ≫ X.presheaf.stalkSpecializes (specializes_of_eq hxx'.symm) =
      Y.presheaf.stalkSpecializes (specializes_of_eq <| hfg ▸ hxx' ▸ rfl) ≫ g.stalkMap x'

{X Y : AlgebraicGeometry.Scheme}
(f g : X ⟶ Y)
(hfg : f = g)
(x x' : ↑↑X.toPresheafedSpace)
(hxx' : x = x')

AlgebraicGeometry.Scheme.Hom.stalkMap f x ≫ X.presheaf.stalkSpecializes ⋯ =
  Y.presheaf.stalkSpecializes ⋯ ≫ AlgebraicGeometry.Scheme.Hom.stalkMap g x'


@[simp]
lemma endEquivSectionsFibers_π (f : End F) (A : PointedGaloisObject F) :
    (endEquivSectionsFibers F f).val A = f.app A A.pt

(F : CategoryTheory.Functor C FintypeCat)

(A : CategoryTheory.PreGaloisCategory.PointedGaloisObject F)

↑((CategoryTheory.PreGaloisCategory.endEquivSectionsFibers F) f) A = f.app A.obj A.pt


/-- Characterize the equality of points as the vanishing of the nonnegative distance-/
@[simp]
theorem nndist_eq_zero {x y : γ} : nndist x y = 0 ↔ x = y


theorem Nonempty.of_vsub_left : (s -ᵥ t : Finset α).Nonempty → s.Nonempty

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


theorem isIrreducible_zeroLocus_iff (I : Ideal R) :
    IsIrreducible (zeroLocus (I : Set R)) ↔ I.radical.IsPrime

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

IsIrreducible (PrimeSpectrum.zeroLocus ↑I) ↔ I.radical.IsPrime


theorem cprankMax_upper_bound [Ring α] : ∀ {ds}, ∀ x : Holor α ds, CPRankMax ds.prod x

{α : Type}
[Ring α]
{ds : List ℕ}
(x : Holor α ds)


theorem CauchySeq.isCauSeq {f : ℕ → β} (hf : CauchySeq f) : IsCauSeq norm f

{β : Type v}
[NormedField β]
{f : ℕ → β}
(hf : CauchySeq f)


@[simp] theorem succ_pred : ∀ (i : Fin (n + 1)) (h : i ≠ 0), (i.pred h).succ = i


/-- If `a` strictly divides the minimal polynomial of `x`, then `x` cannot be a root for `a`. -/
theorem aeval_ne_zero_of_dvdNotUnit_minpoly {a : A[X]} (hx : IsIntegral A x) (hamonic : a.Monic)
    (hdvd : DvdNotUnit a (minpoly A x)) : Polynomial.aeval x a ≠ 0

{A : Type u_1}
{B : Type u_2}
[CommRing A]
[Ring B]
[Algebra A B]
{x : B}
{a : A[X]}
(hx : IsIntegral A x)
(hamonic : a.Monic)
(hdvd : DvdNotUnit a (minpoly A x))


theorem inl_strictMono : StrictMono (toLex ∘ inl : α → α ⊕ₗ β)

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


theorem roots_normalize {p : R[X]} : (normalize p).roots = p.roots

{R : Type u}
[CommRing R]
[IsDomain R]
[NormalizationMonoid R]
{p : R[X]}


lemma Set.Icc.coe_sSup [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b)
    {S : Set (Set.Icc a b)} (hS : S.Nonempty) : letI := Set.Icc.completeLattice h
    ↑(sSup S) = sSup ((↑) '' S : Set α)

{α : Type u_2}
[ConditionallyCompleteLattice α]
{a b : α}
(h : a ≤ b)
{S : Set ↑(Set.Icc a b)}
(hS : S.Nonempty)


theorem regularSpace_TFAE (X : Type u) [TopologicalSpace X] :
    List.TFAE [RegularSpace X,
      ∀ (s : Set X) x, x ∉ closure s → Disjoint (𝓝ˢ s) (𝓝 x),
      ∀ (x : X) (s : Set X), Disjoint (𝓝ˢ s) (𝓝 x) ↔ x ∉ closure s,
      ∀ (x : X) (s : Set X), s ∈ 𝓝 x → ∃ t ∈ 𝓝 x, IsClosed t ∧ t ⊆ s,
      ∀ x : X, (𝓝 x).lift' closure ≤ 𝓝 x,
      ∀ x : X , (𝓝 x).lift' closure = 𝓝 x]

[RegularSpace X, ∀ (s : Set X), ∀ x ∉ closure s, Disjoint (𝓝ˢ s) (𝓝 x),
    ∀ (x : X) (s : Set X), Disjoint (𝓝ˢ s) (𝓝 x) ↔ x ∉ closure s, ∀ (x : X), ∀ s ∈ 𝓝 x, ∃ t ∈ 𝓝 x, IsClosed t ∧ t ⊆ s,
    ∀ (x : X), (𝓝 x).lift' closure ≤ 𝓝 x, ∀ (x : X), (𝓝 x).lift' closure = 𝓝 x].TFAE


theorem arrowCongrSL_toLinearEquiv_apply (e₁₂ : E ≃SL[σ₁₂] F) (e₄₃ : H ≃SL[σ₄₃] G)
    (L : E →SL[σ₁₄] H) : (e₁₂.arrowCongrSL e₄₃).toLinearEquiv L =
      (e₄₃ : H →SL[σ₄₃] G).comp (L.comp (e₁₂.symm : F →SL[σ₂₁] E))

{𝕜 : Type u_1}
{𝕜₂ : Type u_2}
{𝕜₃ : Type u_3}
{𝕜₄ : Type u_4}
{E : Type u_5}
{F : Type u_6}
{G : Type u_7}
{H : Type u_8}
[AddCommGroup E]
[AddCommGroup F]
[AddCommGroup G]
[AddCommGroup H]
[NontriviallyNormedField 𝕜]
[NontriviallyNormedField 𝕜₂]
[NontriviallyNormedField 𝕜₃]
[NontriviallyNormedField 𝕜₄]
[Module 𝕜 E]
[Module 𝕜₂ F]
[Module 𝕜₃ G]
[Module 𝕜₄ H]
[TopologicalSpace E]
[TopologicalSpace F]
[TopologicalSpace G]
[TopologicalSpace H]
[TopologicalAddGroup G]
[TopologicalAddGroup H]
[ContinuousConstSMul 𝕜₃ G]
[ContinuousConstSMul 𝕜₄ H]
{σ₁₂ : 𝕜 →+* 𝕜₂}
{σ₂₁ : 𝕜₂ →+* 𝕜}
{σ₂₃ : 𝕜₂ →+* 𝕜₃}
{σ₁₃ : 𝕜 →+* 𝕜₃}
{σ₃₄ : 𝕜₃ →+* 𝕜₄}
{σ₄₃ : 𝕜₄ →+* 𝕜₃}
{σ₂₄ : 𝕜₂ →+* 𝕜₄}
{σ₁₄ : 𝕜 →+* 𝕜₄}
[RingHomInvPair σ₁₂ σ₂₁]
[RingHomInvPair σ₂₁ σ₁₂]
[RingHomInvPair σ₃₄ σ₄₃]
[RingHomInvPair σ₄₃ σ₃₄]
[RingHomCompTriple σ₂₁ σ₁₄ σ₂₄]
[RingHomCompTriple σ₂₄ σ₄₃ σ₂₃]
[RingHomCompTriple σ₁₂ σ₂₃ σ₁₃]
[RingHomCompTriple σ₁₃ σ₃₄ σ₁₄]
[RingHomCompTriple σ₂₃ σ₃₄ σ₂₄]
[RingHomCompTriple σ₁₂ σ₂₄ σ₁₄]
[RingHomIsometric σ₁₂]
[RingHomIsometric σ₂₁]
(e₁₂ : E ≃SL[σ₁₂] F)
(e₄₃ : H ≃SL[σ₄₃] G)
(L : E →SL[σ₁₄] H)

(e₁₂.arrowCongrSL e₄₃).toLinearEquiv L = (↑e₄₃).comp (L.comp ↑e₁₂.symm)


@[to_additive]
lemma of_mulIndicator_const (h : EventuallyConst (s.mulIndicator fun _ ↦ c) l) (hc : c ≠ 1) :
    EventuallyConst s l

(h : Filter.EventuallyConst (s.indicator fun x => c) l)


/-- This is the key identity satisfied by `σ`. -/
theorem σ_comp {X Y : C} (f : X ⟶ Y) : σ ≫ f = Limits.prod.map f f ≫ σ

CategoryTheory.NonPreadditiveAbelian.σ ≫ f = CategoryTheory.Limits.prod.map f f ≫ CategoryTheory.NonPreadditiveAbelian.σ


theorem map_eq_map_of_bij_of_nodup (f : α → γ) (g : β → γ) {s : Multiset α} {t : Multiset β}
    (hs : s.Nodup) (ht : t.Nodup) (i : ∀ a ∈ s, β) (hi : ∀ a ha, i a ha ∈ t)
    (i_inj : ∀ a₁ ha₁ a₂ ha₂, i a₁ ha₁ = i a₂ ha₂ → a₁ = a₂)
    (i_surj : ∀ b ∈ t, ∃ a ha, i a ha = b) (h : ∀ a ha, f a = g (i a ha)) : s.map f = t.map g

(hi : ∀ (a : α) (ha : a ∈ s), i a ha ∈ t)

(i_inj : ∀ (a₁ : α) (ha₁ : a₁ ∈ s) (a₂ : α) (ha₂ : a₂ ∈ s), i a₁ ha₁ = i a₂ ha₂ → a₁ = a₂)

(i_surj : ∀ b ∈ t, ∃ a, ∃ (ha : a ∈ s), i a ha = b)

(h : ∀ (a : α) (ha : a ∈ s), f a = g (i a ha))


@[simp]
theorem map_add_range' (a) : ∀ s n step, map (a + ·) (range' s n step) = range' (a + s) n step

List.map (fun x => a + x) (List.range' s n step) = List.range' (a + s) n step


/-- Any continuous ring homomorphism commutes with `exp`. -/
theorem map_exp_of_mem_ball {F} [FunLike F 𝔸 𝔹] [RingHomClass F 𝔸 𝔹] (f : F) (hf : Continuous f)
    (x : 𝔸) (hx : x ∈ EMetric.ball (0 : 𝔸) (expSeries 𝕂 𝔸).radius) :
    f (exp 𝕂 x) = exp 𝕂 (f x)

(hx : x ∈ EMetric.ball 0 (NormedSpace.expSeries 𝕂 𝔸).radius)

f (NormedSpace.exp 𝕂 x) = NormedSpace.exp 𝕂 (f x)


@[simp]
theorem unop_zsmul {X Y : Cᵒᵖ} (k : ℤ) (f : X ⟶ Y) : (k • f).unop = k • f.unop

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


/-- A morphism of comonoid objects. -/
@[ext]
structure Hom (M N : Comon_ C) where
  /-- The underlying morphism of a morphism of comonoid objects. -/
  hom : M.X ⟶ N.X
  hom_counit : hom ≫ N.counit = M.counit := by aesop_cat
  hom_comul : hom ≫ N.comul = M.comul ≫ (hom ⊗ hom) := by aesop_cat

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.MonoidalCategory C]
{M N : Comon_ C}
(self : M.Hom N)


theorem SeparatedNhds.of_isCompact_isCompact [T2Space X] {s t : Set X} (hs : IsCompact s)
    (ht : IsCompact t) (hst : Disjoint s t) : SeparatedNhds s t

{X : Type u_1}
[TopologicalSpace X]
[T2Space X]
{s t : Set X}
(hs : IsCompact s)
(ht : IsCompact t)
(hst : Disjoint s t)


@[simp]
theorem leadingCoeff_of_a_ne_zero' (ha : a ≠ 0) : (toPoly ⟨a, b, c, d⟩).leadingCoeff = a

{R : Type u_1}
{a b c d : R}
[Semiring R]
(ha : a ≠ 0)

{ a := a, b := b, c := c, d := d }.toPoly.leadingCoeff = a


theorem embeddingOfSubset_coe : embeddingOfSubset x a n = dist a (x n) - dist (x 0) (x n)

{α : Type u}
{n : ℕ}
[MetricSpace α]
(x : ℕ → α)
(a : α)

↑(KuratowskiEmbedding.embeddingOfSubset x a) n = dist a (x n) - dist (x 0) (x n)


@[to_additive]
theorem leftCoset_cover_const_iff_surjOn :
    ⋃ i ∈ s, g i • (H : Set G) = Set.univ ↔ Set.SurjOn (g · : ι → G ⧸ H) s Set.univ

{G : Type u_1}
[AddGroup G]
{ι : Type u_2}
{s : Finset ι}
{H : AddSubgroup G}
{g : ι → G}

⋃ i ∈ s, g i +ᵥ ↑H = Set.univ ↔ Set.SurjOn (fun x => ↑(g x)) (↑s) Set.univ


@[to_additive (attr := simp)]
theorem mem_one : a ∈ (1 : Finset α) ↔ a = 1


@[simp]
theorem support_update_zero [DecidableEq α] : support (f.update a 0) = f.support.erase a

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

(f.update a 0).support = f.support.erase a


@[simp] theorem enum_zero : (enum 0) = #[]


/-- Given a family of Lie algebras `L i`, together with a family of morphisms of Lie algebras
`f i : L i →ₗ⁅R⁆ L'` into a fixed Lie algebra `L'`, we have a natural linear map:
`(⨁ i, L i) →ₗ[R] L'`. If in addition `⁅f i x, f j y⁆ = 0` for any `x ∈ L i` and `y ∈ L j` (`i ≠ j`)
then this map is a morphism of Lie algebras. -/
@[simps]
def toLieAlgebra [DecidableEq ι] (L' : Type w₁) [LieRing L'] [LieAlgebra R L']
    (f : ∀ i, L i →ₗ⁅R⁆ L') (hf : Pairwise fun i j => ∀ (x : L i) (y : L j), ⁅f i x, f j y⁆ = 0) :
    (⨁ i, L i) →ₗ⁅R⁆ L'

(hf : Pairwise fun i j => ∀ (x : L i) (y : L j), ⁅(f i) x, (f j) y⁆ = 0)

(DirectSum.toLieAlgebra L' f hf) a = (DirectSum.toModule R ι L' fun i => ↑(f i)) a


@[trans]
theorem EventuallyLE.trans_eq (H₁ : f ≤ᶠ[l] g) (H₂ : g =ᶠ[l] h) : f ≤ᶠ[l] h

{α : Type u}
{β : Type v}
[Preorder β]
{l : Filter α}
{f g h : α → β}
(H₁ : f ≤ᶠ[l] g)
(H₂ : g =ᶠ[l] h)


protected theorem Function.Injective.isRightCancelMulZero
    [IsRightCancelMulZero M₀'] : IsRightCancelMulZero M₀

(mul : ∀ (x y : M₀), f (x * y) = f x * f y)


/-- A predicate for representations that fix every element. -/
class IsTrivial (ρ : Representation k G V) : Prop where
  out : ∀ g x, ρ g x = x := by aesop

{k : Type u_1}
{G : Type u_2}
{V : Type u_3}
[CommSemiring k]
[Monoid G]
[AddCommMonoid V]
[Module k V]
{ρ : Representation k G V}
[self : ρ.IsTrivial]
(g : G)
(x : V)


protected theorem mono (h : DiffContOnCl 𝕜 f s) (ht : t ⊆ s) : DiffContOnCl 𝕜 f t

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜 F]
{f : E → F}
{s t : Set E}
(h : DiffContOnCl 𝕜 f s)
(ht : t ⊆ s)


theorem fg_of_noetherian [IsNoetherian R A] (S : Subalgebra R A) : S.FG

{R : Type u}
{A : Type v}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[IsNoetherian R A]
(S : Subalgebra R A)


theorem NonNeg.elim {a : Int} : NonNeg a → ∃ n : Nat, a = n


/-- An algebra over a Noetherian ring is finitely generated if and only if it is finitely
presented. -/
theorem of_finiteType [IsNoetherianRing R] : FiniteType R A ↔ FinitePresentation R A

{R : Type w₁}
{A : Type w₂}
[CommRing R]
[CommRing A]
[Algebra R A]
[IsNoetherianRing R]

Algebra.FiniteType R A ↔ Algebra.FinitePresentation R A


@[functor_norm]
theorem preserves_pure {α} : ∀ x : α, η (pure x) = pure x

{F : Type u → Type v}
[Applicative F]
{G : Type u → Type w}
[Applicative G]
(η : ApplicativeTransformation F G)
{α : Type u}
(x : α)


theorem Set.Subsingleton.maximals_eq (h : s.Subsingleton) : maximals r s = s

{α : Type u_1}
{r : α → α → Prop}
{s : Set α}
(h : s.Subsingleton)


/-- A version of `iSup_option` useful for rewriting right-to-left. -/
theorem iSup_option_elim (a : α) (f : β → α) : ⨆ o : Option β, o.elim a f = a ⊔ ⨆ b, f b

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


theorem mem_map_submodule (e : L ≃ₗ⁅R⁆ L₂) (x : L₂) :
    x ∈ K.map (e : L →ₗ⁅R⁆ L₂) ↔ x ∈ (K : Submodule R L).map (e : L →ₗ[R] L₂)

{R : Type u}
{L : Type v}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
{L₂ : Type w}
[LieRing L₂]
[LieAlgebra R L₂]
(K : LieSubalgebra R L)
(e : L ≃ₗ⁅R⁆ L₂)
(x : L₂)

x ∈ LieSubalgebra.map e.toLieHom K ↔ x ∈ Submodule.map (↑e.toLinearEquiv) K.toSubmodule


@[simp]
theorem coe_ofTop_symm_apply {h} (x : M) : ((ofTop p h).symm x : M) = x

{R : Type u_1}
{M : Type u_5}
[Semiring R]
[AddCommMonoid M]
{module_M : Module R M}
(p : Submodule R M)
{h : p = ⊤}
(x : M)


/-- Up to rotation, the contractible triangle `X ⟶ X ⟶ 0 ⟶ X⟦1⟧` for `X : Cᵒᵖ` corresponds
to the contractible triangle for `X.unop` in `C`. -/
@[simps!]
noncomputable def contractibleTriangleIso (X : Cᵒᵖ) :
    contractibleTriangle X ≅ (triangleOpEquivalence C).functor.obj
      (Opposite.op (contractibleTriangle X.unop).invRotate)

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

(CategoryTheory.Pretriangulated.Opposite.contractibleTriangleIso X).hom.hom₁ = CategoryTheory.CategoryStruct.id X


@[simp] lemma num_neg {a : ℚ} : a.num < 0 ↔ a < 0


/-- This structure contains the data and axioms in order to
produce a `PresheafOfModules R` from a collection of types
equipped with module structures over the various rings `R.obj X`.
(See the constructor `PresheafOfModules.mk'`.) -/
structure CorePresheafOfModules where
  /-- the datum of a type for each object in `Cᵒᵖ` -/
  obj (X : Cᵒᵖ) : Type v
  /-- the abelian group structure on the types `obj X` -/
  addCommGroup (X : Cᵒᵖ) : AddCommGroup (obj X) := by infer_instance
  /-- the module structure on the types `obj X` over the various rings `R.obj X` -/
  module (X : Cᵒᵖ) : Module (R.obj X) (obj X) := by infer_instance
  /-- the semi-linear restriction maps -/
  map {X Y : Cᵒᵖ} (f : X ⟶ Y) : obj X →ₛₗ[R.map f] obj Y
  /-- `map` is compatible with the identities -/
  map_id (X : Cᵒᵖ) (x : obj X) : map (𝟙 X) x = x := by aesop_cat
  /-- `map` is compatible with the composition -/
  map_comp {X Y Z : Cᵒᵖ} (f : X ⟶ Y) (g : Y ⟶ Z) (x : obj X) :
    map (f ≫ g) x = map g (map f x) := by aesop_cat

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{R : Cᵒᵖ ⥤ RingCat}
(self : CorePresheafOfModules R)
{X Y Z : Cᵒᵖ}
(f : X ⟶ Y)
(g : Y ⟶ Z)
(x : self.obj X)

(self.map (f ≫ g)) x = (self.map g) ((self.map f) x)


lemma finset_sup'_nhds [SemilatticeSup L] [ContinuousSup L]
    (hne : s.Nonempty) (hs : ∀ i ∈ s, Tendsto (f i) l (𝓝 (g i))) :
    Tendsto (s.sup' hne f) l (𝓝 (s.sup' hne g))

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

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


theorem partDen_none_iff_s_none : g.partDens.get? n = none ↔ g.s.get? n = none

{α : Type u_1}
{g : GenContFract α}
{n : ℕ}


@[simp, norm_cast]
theorem star_natCast [NonAssocSemiring R] [StarRing R] (n : ℕ) : star (n : R) = n

{R : Type u}
[NonAssocSemiring R]
[StarRing R]
(n : ℕ)


@[simp]
theorem shiftLeft_neg (m n : ℤ) : m <<< (-n) = m >>> n


theorem val_add_of_le {n : ℕ} [NeZero n] {a b : ZMod n} (h : n ≤ a.val + b.val) :
    (a + b).val = a.val + b.val - n


lemma norm_innerSL_le : ‖innerSL 𝕜 (E := E)‖ ≤ 1

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


@[simp] lemma unmop_rightUnitor (X : Cᴹᵒᵖ) : (ρ_ X).unmop = λ_ (unmop X)

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

(CategoryTheory.MonoidalCategory.rightUnitor X).unmop = CategoryTheory.MonoidalCategory.leftUnitor X.unmop


theorem HasFDerivAtFilter.prod (hf₁ : HasFDerivAtFilter f₁ f₁' x L)
    (hf₂ : HasFDerivAtFilter f₂ f₂' x L) :
    HasFDerivAtFilter (fun x => (f₁ x, f₂ x)) (f₁'.prod f₂') x L

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{f₁ : E → F}
{f₁' : E →L[𝕜] F}
{x : E}
{L : Filter E}
{f₂ : E → G}
{f₂' : E →L[𝕜] G}
(hf₁ : HasFDerivAtFilter f₁ f₁' x L)
(hf₂ : HasFDerivAtFilter f₂ f₂' x L)


@[simp]
theorem some_toOption (a : α) [Decidable (some a).Dom] : (some a).toOption = Option.some a

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


theorem NNReal.summable_geometric {r : ℝ≥0} (hr : r < 1) : Summable fun n : ℕ ↦ r ^ n


lemma differentiableOn_mul_log : DifferentiableOn ℝ (fun x ↦ x * log x) {0}ᶜ

DifferentiableOn ℝ (fun x => x * Real.log x) {0}ᶜ


theorem cmpEq.lt_congr_right (H : cmpEq cmp y z) : cmpLT cmp x y ↔ cmpLT cmp x z

∀ {α : Sort u_1} {cmp : α → α → Ordering} {y z x : α},
  Batteries.RBNode.cmpEq cmp y z → (Batteries.RBNode.cmpLT cmp x y ↔ Batteries.RBNode.cmpLT cmp x z)


@[to_additive]
lemma _root_.Function.const_inv [Inv β] (a : β) : (const α a)⁻¹ = const α a⁻¹

{α : Type u_1}
{β : Type u_2}
[Inv β]
(a : β)

(Function.const α a)⁻¹ = Function.const α a⁻¹


theorem strictConcaveOn_sin_Icc : StrictConcaveOn ℝ (Icc 0 π) sin

StrictConcaveOn ℝ (Set.Icc 0 π) Real.sin


/-- If `p` is a prime natural number and `x` is an integer number, then there exist natural numbers
`a ≤ p / 2` and `b ≤ p / 2` such that `a ^ 2 + b ^ 2 ≡ x [ZMOD p]`. This is a version of
`ZMod.sq_add_sq` with estimates on `a` and `b`. -/
theorem Nat.sq_add_sq_zmodEq (p : ℕ) [Fact p.Prime] (x : ℤ) :
    ∃ a b : ℕ, a ≤ p / 2 ∧ b ≤ p / 2 ∧ (a : ℤ) ^ 2 + (b : ℤ) ^ 2 ≡ x [ZMOD p]

∃ a b, a ≤ p / 2 ∧ b ≤ p / 2 ∧ ↑a ^ 2 + ↑b ^ 2 ≡ x [ZMOD ↑p]


theorem basis_iff (hX : X ⊆ M.E := by aesop_mat) :
    M.Basis I X ↔ (M.Indep I ∧ I ⊆ X ∧ ∀ J, M.Indep J → I ⊆ J → J ⊆ X → I = J)

{α : Type u_1}
{M : Matroid α}
{I X : Set α}
(hX : X ⊆ M.E := by aesop_mat)

M.Basis I X ↔ M.Indep I ∧ I ⊆ X ∧ ∀ (J : Set α), M.Indep J → I ⊆ J → J ⊆ X → I = J


@[simp] theorem forgetMonoidal_ε : (forgetMonoidal C).ε = 𝟙 (𝟙_ C)

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


protected theorem sub_ne_zero_iff_lt : n - m ≠ 0 ↔ m < n


{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
(v : PicardLindelof E)


/-- To test whether `s` is Carathéodory-measurable we only need to check the sets `t` for which
  `P t` holds. See `ofFunction_caratheodory` for another way to show the Carathéodory-measurability
  of `s`.
-/
theorem inducedOuterMeasure_caratheodory (s : Set α) :
    MeasurableSet[(inducedOuterMeasure m P0 m0).caratheodory] s ↔
      ∀ t : Set α,
        P t →
          inducedOuterMeasure m P0 m0 (t ∩ s) + inducedOuterMeasure m P0 m0 (t \ s) ≤
            inducedOuterMeasure m P0 m0 t

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

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

(m_mono : ∀ ⦃s₁ s₂ : Set α⦄ (hs₁ : P s₁) (hs₂ : P s₂), s₁ ⊆ s₂ → m s₁ hs₁ ≤ m s₂ hs₂)

MeasurableSet s ↔
  ∀ (t : Set α),
    P t →
      (MeasureTheory.inducedOuterMeasure m P0 m0) (t ∩ s) + (MeasureTheory.inducedOuterMeasure m P0 m0) (t \ s) ≤
        (MeasureTheory.inducedOuterMeasure m P0 m0) t


protected theorem map_sub (a b : R) : abv (a - b) = abv (b - a)

{R : Type u_3}
{S : Type u_4}
[OrderedCommRing S]
[Ring R]
(abv : AbsoluteValue R S)
[NoZeroDivisors S]
(a b : R)


theorem lt_length_right_of_zipWith {f : α → β → γ} {i : ℕ} {l : List α} {l' : List β}
    (h : i < (zipWith f l l').length) : i < l'.length

{α : Type u}
{β : Type u_1}
{γ : Type u_2}
{f : α → β → γ}
{i : ℕ}
{l : List α}
{l' : List β}
(h : i < (List.zipWith f l l').length)


/-- Controlling the norm of `f.iteratedFDeriv` when `f` is continuous multilinear. For the same
bound on the iterated derivative of `f` in the calculus sense,
see `ContinuousMultilinearMap.norm_iteratedFDeriv_le`. -/
lemma norm_iteratedFDeriv_le' (f : ContinuousMultilinearMap 𝕜 E₁ G) (k : ℕ) (x : (i : ι) → E₁ i) :
    ‖f.iteratedFDeriv k x‖
      ≤ Nat.descFactorial (Fintype.card ι) k * ‖f‖ * ‖x‖ ^ (Fintype.card ι - k)

[(i : ι) → SeminormedAddCommGroup (E₁ i)]

‖f.iteratedFDeriv k x‖ ≤ ↑((Fintype.card ι).descFactorial k) * ‖f‖ * ‖x‖ ^ (Fintype.card ι - k)


@[to_additive]
theorem leftInverse_div_mul_left (c : G) : Function.LeftInverse (fun x ↦ x / c) fun x ↦ x * c

Function.LeftInverse (fun x => x - c) fun x => x + c


theorem rpow_inv_le_iff {x y : ℝ≥0∞} {z : ℝ} (hz : 0 < z) : x ^ z⁻¹ ≤ y ↔ x ≤ y ^ z


lemma compls_subset_iff : sᶜˢ ⊆ t ↔ s ⊆ tᶜˢ

{α : Type u_2}
[BooleanAlgebra α]
{s t : Finset α}


/-- When there is a global maximum, every set is bounded above. -/
@[simp]
protected theorem OrderTop.bddAbove [OrderTop α] (s : Set α) : BddAbove s

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


@[simp]
theorem star_mul_self_of_mem {U : R} (hU : U ∈ unitary R) : star U * U = 1

{R : Type u_1}
[Monoid R]
[StarMul R]
{U : R}
(hU : U ∈ unitary R)


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

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

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


/-- If each prime factor of `orderOf x` has higher multiplicity in `orderOf y`, and `x` commutes
  with `y`, then `x * y` has the same order as `y`. -/
@[to_additive addOrderOf_add_eq_right_of_forall_prime_mul_dvd
  "If each prime factor of
  `addOrderOf x` has higher multiplicity in `addOrderOf y`, and `x` commutes with `y`,
  then `x + y` has the same order as `y`."]
theorem orderOf_mul_eq_right_of_forall_prime_mul_dvd (h : Commute x y) (hy : IsOfFinOrder y)
    (hdvd : ∀ p : ℕ, p.Prime → p ∣ orderOf x → p * orderOf x ∣ orderOf y) :
    orderOf (x * y) = orderOf y

(hdvd : ∀ (p : ℕ), Nat.Prime p → p ∣ orderOf x → p * orderOf x ∣ orderOf y)


protected lemma trans (hr : ∀ (a : α) (b : β) (c : γ), r₁₂ a b → r₂₃ b c → r₁₃ a c) :
    BiTotal r₁₂ → BiTotal r₂₃ → BiTotal r₁₃

Relator.BiTotal r₁₂ → Relator.BiTotal r₂₃ → Relator.BiTotal r₁₃


@[simp] theorem recDiagOn_zero_zero {motive : Nat → Nat → Sort _} (zero_zero : motive 0 0)
    (zero_succ : ∀ n, motive 0 n → motive 0 (n+1)) (succ_zero : ∀ m, motive m 0 → motive (m+1) 0)
    (succ_succ : ∀ m n, motive m n → motive (m+1) (n+1)) :
    Nat.recDiagOn (motive:=motive) 0 0 zero_zero zero_succ succ_zero succ_succ = zero_zero

(zero_succ : (n : Nat) → motive 0 n → motive 0 (n + 1))

(succ_zero : (m : Nat) → motive m 0 → motive (m + 1) 0)

(succ_succ : (m n : Nat) → motive m n → motive (m + 1) (n + 1))

Nat.recDiagOn 0 0 zero_zero zero_succ succ_zero succ_succ = zero_zero


theorem inter_eq_inter_iff_left : s ∩ t = s ∩ u ↔ s ∩ u ⊆ t ∧ s ∩ t ⊆ u

{α : Type u_1}
[DecidableEq α]
{s t u : Finset α}


protected theorem lt_wf : @WellFounded Cardinal.{u} (· < ·)


theorem _root_.Function.Injective.mem_finset_image (hf : Injective f) :
    f a ∈ s.image f ↔ a ∈ s

{α : Type u_1}
{β : Type u_2}
[DecidableEq β]
{f : α → β}
{s : Finset α}
{a : α}
(hf : Function.Injective f)


lemma Indep.mem_closure_iff_of_not_mem (hI : M.Indep I) (heI : e ∉ I) :
    e ∈ M.closure I ↔ M.Dep (insert e I)

{α : Type u_2}
{M : Matroid α}
{e : α}
{I : Set α}
(hI : M.Indep I)
(heI : e ∉ I)


theorem lhopital_zero_left_on_Ioo (hdf : DifferentiableOn ℝ f (Ioo a b))
    (hg' : ∀ x ∈ Ioo a b, (deriv g) x ≠ 0) (hfb : Tendsto f (𝓝[<] b) (𝓝 0))
    (hgb : Tendsto g (𝓝[<] b) (𝓝 0))
    (hdiv : Tendsto (fun x => (deriv f) x / (deriv g) x) (𝓝[<] b) l) :
    Tendsto (fun x => f x / g x) (𝓝[<] b) l

(hdf : DifferentiableOn ℝ f (Set.Ioo a b))

(hg' : ∀ x ∈ Set.Ioo a b, deriv g x ≠ 0)

(hdiv : Filter.Tendsto (fun x => deriv f x / deriv g x) (𝓝[<] b) l)

Filter.Tendsto (fun x => f x / g x) (𝓝[<] b) l


@[norm_cast, simp]
theorem coe_neg (f : P →ᴬ[R] W) : ⇑(-f) = -f

{R : Type u_1}
{V : Type u_2}
{W : Type u_3}
{P : Type u_4}
[Ring R]
[AddCommGroup V]
[Module R V]
[TopologicalSpace P]
[AddTorsor V P]
[AddCommGroup W]
[Module R W]
[TopologicalSpace W]
[TopologicalAddGroup W]
(f : P →ᴬ[R] W)


/-- See `MvPolynomial.IsHomogeneous.funext_of_le_card`
for a version that assumes `n ≤ #R`. -/
lemma funext [Infinite R] {F G : MvPolynomial σ R} {n : ℕ}
    (hF : F.IsHomogeneous n) (hG : G.IsHomogeneous n)
    (h : ∀ r : σ → R, eval r F = eval r G) : F = G

(h : ∀ (r : σ → R), (MvPolynomial.eval r) F = (MvPolynomial.eval r) G)


@[simp]
theorem pushoutCoconeOfLeftIso_inl : (pushoutCoconeOfLeftIso f g).inl = inv f ≫ g

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

(CategoryTheory.Limits.pushoutCoconeOfLeftIso f g).inl = CategoryTheory.inv f ≫ g


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

(hs : MeasureTheory.IsAddFundamentalDomain G s μ)

μ (MeasureTheory.addFundamentalInterior G s) = μ s


@[simp]
theorem coe_inl : (inl R A B : A → A × B) = fun x => (x, 0)

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
[Monoid R]
[NonUnitalNonAssocSemiring A]
[DistribMulAction R A]
[StarAddMonoid A]
[NonUnitalNonAssocSemiring B]
[DistribMulAction R B]
[StarAddMonoid B]

⇑(NonUnitalStarAlgHom.inl R A B) = fun x => (x, 0)


@[reassoc (attr := simp)]
theorem biprodComparison_fst : biprodComparison F X Y ≫ biprod.fst = F.map biprod.fst

[CategoryTheory.Limits.HasBinaryBiproduct (F.obj X) (F.obj Y)]

F.biprodComparison X Y ≫ CategoryTheory.Limits.biprod.fst = F.map CategoryTheory.Limits.biprod.fst


theorem inf_eq_map_pullback {A : C} (f₁ : MonoOver A) (f₂ : Subobject A) :
    (Quotient.mk'' f₁ ⊓ f₂ : Subobject A) = (map f₁.arrow).obj ((pullback f₁.arrow).obj f₂)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.Limits.HasPullbacks C]
{A : C}
(f₁ : CategoryTheory.MonoOver A)
(f₂ : CategoryTheory.Subobject A)

Quotient.mk'' f₁ ⊓ f₂ =
  (CategoryTheory.Subobject.map f₁.arrow).obj ((CategoryTheory.Subobject.pullback f₁.arrow).obj f₂)


@[simp]
theorem embDomain_apply (f : α ↪ β) (v : α →₀ M) (a : α) : embDomain f v (f a) = v a

{α : Type u_1}
{β : Type u_2}
{M : Type u_5}
[Zero M]
(f : α ↪ β)
(v : α →₀ M)
(a : α)


theorem himp_le_himp_right (h : a ≤ b) : b ⇨ c ≤ a ⇨ c

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


/-- Assume that a measure `μ` is `IsMulLeftInvariant`, that the action of `Γ` on `G` has a
measurable fundamental domain `s` with positive finite volume, and that there is a single measurable
set `V ⊆ G ⧸ Γ` along which the pullback of `μ` and `ν` agree (so the scaling is right). Then
`μ` satisfies `QuotientMeasureEqMeasurePreimage`. The main tool of the proof is the uniqueness of
left invariant measures, if normalized by a single positive finite-measured set. -/
@[to_additive
"Assume that a measure `μ` is `IsAddLeftInvariant`, that the action of `Γ` on `G` has a
measurable fundamental domain `s` with positive finite volume, and that there is a single measurable
set `V ⊆ G ⧸ Γ` along which the pullback of `μ` and `ν` agree (so the scaling is right). Then
`μ` satisfies `AddQuotientMeasureEqMeasurePreimage`. The main tool of the proof is the uniqueness of
left invariant measures, if normalized by a single positive finite-measured set."]
theorem MeasureTheory.Measure.IsMulLeftInvariant.quotientMeasureEqMeasurePreimage_of_set {s : Set G}
    (fund_dom_s : IsFundamentalDomain Γ.op s ν) {V : Set (G ⧸ Γ)}
    (meas_V : MeasurableSet V) (neZeroV : μ V ≠ 0) (hV : μ V = ν (π ⁻¹' V ∩ s))
    (neTopV : μ V ≠ ⊤) : QuotientMeasureEqMeasurePreimage ν μ

(fund_dom_s : MeasureTheory.IsAddFundamentalDomain (↥Γ.op) s ν)

(hV : μ V = ν (QuotientAddGroup.mk ⁻¹' V ∩ s))


/-- If `edist (f n) (f (n+1))` is bounded by `C * r^n`, then the distance from
`f 0` to the limit of `f` is bounded above by `C / (1 - r)`. -/
theorem edist_le_of_edist_le_geometric_of_tendsto₀ {a : α} (ha : Tendsto f atTop (𝓝 a)) :
    edist (f 0) a ≤ C / (1 - r)

(hu : ∀ (n : ℕ), edist (f n) (f (n + 1)) ≤ C * r ^ n)

(ha : Filter.Tendsto f Filter.atTop (𝓝 a))


theorem comap_isMaximal_of_surjective (hf : Function.Surjective f) {K : Ideal S} [H : IsMaximal K]:
    IsMaximal (comap f K)

{R : Type u}
{S : Type v}
{F : Type u_1}
[Ring R]
[Ring S]
[FunLike F R S]
[RingHomClass F R S]
(f : F)
(hf : Function.Surjective ⇑f)
{K : Ideal S}
[H : K.IsMaximal]


theorem LanLift.existsUnique [HasLeftKanLift f g] (s : LeftLift f g) :
    ∃! τ, lanLiftUnit f g ≫ τ ▷ f = s.unit

(s : CategoryTheory.Bicategory.LeftLift f g)

∃! τ,
  CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.lanLiftUnit f g)
      (CategoryTheory.Bicategory.whiskerRight τ f) =
    s.unit


/-- A product of a function `f : Fin (n + 1) → β` over all `Fin (n + 1)`
is the product of `f x`, for some `x : Fin (n + 1)` times the remaining product -/
@[to_additive "A sum of a function `f : Fin (n + 1) → β` over all `Fin (n + 1)` is the sum of
`f x`, for some `x : Fin (n + 1)` plus the remaining product"]
theorem prod_univ_succAbove [CommMonoid β] {n : ℕ} (f : Fin (n + 1) → β) (x : Fin (n + 1)) :
    ∏ i, f i = f x * ∏ i : Fin n, f (x.succAbove i)

{β : Type u_2}
[AddCommMonoid β]
{n : ℕ}
(f : Fin (n + 1) → β)
(x : Fin (n + 1))

∑ i : Fin (n + 1), f i = f x + ∑ i : Fin n, f (x.succAbove i)


@[to_additive]
theorem image_smul_product : ((s ×ˢ t).image fun x : α × β => x.fst • x.snd) = s • t

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

Finset.image (fun x => x.1 +ᵥ x.2) (s ×ˢ t) = s +ᵥ t


/-- The functor from the skeleton of `C` to `C`. -/
@[simps!]
noncomputable def fromSkeleton : Skeleton C ⥤ C

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

∀ {X Y : CategoryTheory.InducedCategory C Quotient.out} (f : X ⟶ Y), (CategoryTheory.fromSkeleton C).map f = f


protected lemma int.divByNat_self (n : ℕ) :
    int.divByNat n n = 0


theorem map_toSubsemiring {S : Subalgebra R A} {f : A →ₐ[R] B} :
    (S.map f).toSubsemiring = S.toSubsemiring.map f.toRingHom

{R : Type u}
{A : Type v}
{B : Type w}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[Semiring B]
[Algebra R B]
{S : Subalgebra R A}
{f : A →ₐ[R] B}

(Subalgebra.map f S).toSubsemiring = Subsemiring.map f.toRingHom S.toSubsemiring


@[simp]
theorem coeff_natDegree_succ_eq_zero {p : R[X]} : p.coeff (p.natDegree + 1) = 0


theorem EventuallyLE.sup_le [SemilatticeSup β] {l : Filter α} {f g h : α → β} (hf : f ≤ᶠ[l] h)
    (hg : g ≤ᶠ[l] h) : f ⊔ g ≤ᶠ[l] h

{α : Type u}
{β : Type v}
[SemilatticeSup β]
{l : Filter α}
{f g h : α → β}
(hf : f ≤ᶠ[l] h)
(hg : g ≤ᶠ[l] h)


/-- `exp (-a * x) = o(x ^ s)` as `x → ∞`, for any positive `a` and real `s`. -/
theorem isLittleO_exp_neg_mul_rpow_atTop {a : ℝ} (ha : 0 < a) (b : ℝ) :
    IsLittleO atTop (fun x : ℝ => exp (-a * x)) fun x : ℝ => x ^ b

(fun x => rexp (-a * x)) =o[Filter.atTop] fun x => x ^ b


theorem map₂Right_nil_cons : map₂Right f [] (b :: bs) = f none b :: bs.map (f none)

{α : Type u}
{β : Type v}
{γ : Type w}
(f : Option α → β → γ)
(b : β)
(bs : List β)

List.map₂Right f [] (b :: bs) = f none b :: List.map (f none) bs


theorem models_not_iff (h : T.IsComplete) (φ : L.Sentence) : T ⊨ᵇ φ.not ↔ ¬T ⊨ᵇ φ

{L : FirstOrder.Language}
{T : L.Theory}
(h : T.IsComplete)
(φ : L.Sentence)

T ⊨ᵇ FirstOrder.Language.Formula.not φ ↔ ¬T ⊨ᵇ φ


@[simp]
theorem eval_mk {n f x} :
    (@Resp.eval (n + 1) f : ZFSet → OfArity ZFSet ZFSet n) (mk x) = Resp.eval n (Resp.f f x)

{n : ℕ}
{f : PSet.Resp (n + 1)}
{x : PSet}

PSet.Resp.eval (n + 1) f (ZFSet.mk x) = PSet.Resp.eval n (f.f x)


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

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


theorem sup_pow_eq_top {n : ℕ} (h : I ⊔ J = ⊤) : I ⊔ J ^ n = ⊤

{R : Type u}
[CommSemiring R]
{I J : Ideal R}
{n : ℕ}
(h : I ⊔ J = ⊤)


@[to_additive (attr := simp) const_pos]
theorem one_lt_const : 1 < const β a ↔ 1 < a

{α : Type u_3}
{β : Type u_4}
[Zero α]
[Preorder α]
{a : α}
[Nonempty β]


theorem NormedAddGroupHom.completion_def (f : NormedAddGroupHom G H) (x : Completion G) :
    f.completion x = Completion.map f x

{G : Type u_1}
[SeminormedAddCommGroup G]
{H : Type u_2}
[SeminormedAddCommGroup H]
(f : NormedAddGroupHom G H)
(x : UniformSpace.Completion G)

f.completion x = UniformSpace.Completion.map (⇑f) x


lemma unitBackward_unitForward {F : Cᵒᵖ ⥤ Type v} (η : F ⟶ A) (X : C) :
    unitBackward η X ∘ unitForward η X = id

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

CategoryTheory.OverPresheafAux.unitBackward η X ∘ CategoryTheory.OverPresheafAux.unitForward η X = id


theorem X_pow_sub_C_irreducible_of_prime {p : ℕ} (hp : p.Prime) {a : K} (ha : ∀ b : K, b ^ p ≠ a) :
    Irreducible (X ^ p - C a)

{K : Type u}
[Field K]
{p : ℕ}
(hp : Nat.Prime p)
{a : K}
(ha : ∀ (b : K), b ^ p ≠ a)

Irreducible (Polynomial.X ^ p - Polynomial.C a)


@[simp] lemma compls_infs_eq_diffs (s t : Finset α) : sᶜˢ ⊼ t = t \\ s

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


theorem balanceL_eq_balance' {l x r} (hl : Balanced l) (hr : Balanced r) (sl : Sized l)
    (sr : Sized r)
    (H :
      (∃ l', Raised l' (size l) ∧ BalancedSz l' (size r)) ∨
        ∃ r', Raised (size r) r' ∧ BalancedSz (size l) r') :
    @balanceL α l x r = balance' l x r

(H :
  (∃ l', Ordnode.Raised l' l.size ∧ Ordnode.BalancedSz l' r.size) ∨
    ∃ r', Ordnode.Raised r.size r' ∧ Ordnode.BalancedSz l.size r')


/-- Every chain is contained in a maximal chain. This generalizes Hausdorff's maximality principle.
-/
theorem IsChain.exists_maxChain (hc : IsChain r c) : ∃ M, @IsMaxChain _ r M ∧ c ⊆ M

{α : Type u_1}
{r : α → α → Prop}
{c : Set α}
(hc : IsChain r c)


theorem nonnegg_neg_pos {c d} : ∀ {a b : ℕ}, Nonnegg c d (-a) b ↔ SqLe a d b c

Zsqrtd.Nonnegg c d (-↑a) ↑b ↔ Zsqrtd.SqLe a d b c


/-- Let `s` be a dense set in a topological space `α` with partial order structure. If `s` is a
separable space (e.g., if `α` has a second countable topology), then there exists a countable
dense subset `t ⊆ s` such that `t` contains bottom/top element of `α` when they exist and belong
to `s`. For a dense subset containing neither bot nor top elements, see
`Dense.exists_countable_dense_subset_no_bot_top`. -/
theorem Dense.exists_countable_dense_subset_bot_top {α : Type*} [TopologicalSpace α]
    [PartialOrder α] {s : Set α} [SeparableSpace s] (hs : Dense s) :
    ∃ t ⊆ s, t.Countable ∧ Dense t ∧ (∀ x, IsBot x → x ∈ s → x ∈ t) ∧
      ∀ x, IsTop x → x ∈ s → x ∈ t

{α : Type u_1}
[TopologicalSpace α]
[PartialOrder α]
{s : Set α}
[TopologicalSpace.SeparableSpace ↑s]
(hs : Dense s)

∃ t ⊆ s, t.Countable ∧ Dense t ∧ (∀ (x : α), IsBot x → x ∈ s → x ∈ t) ∧ ∀ (x : α), IsTop x → x ∈ s → x ∈ t


@[to_additive]
theorem inter_mul_singleton : s ∩ t * {a} = s * {a} ∩ (t * {a})

{α : Type u_2}
[Add α]
[IsRightCancelAdd α]
[DecidableEq α]
(s t : Finset α)
(a : α)


lemma mul_sum (s : Finset ι) (f : ι → α) (a : α) :
    a * ∑ i ∈ s, f i = ∑ i ∈ s, a * f i

{ι : Type u_1}
{α : Type u_2}
[NonUnitalNonAssocSemiring α]
(s : Finset ι)
(f : ι → α)
(a : α)


nonrec lemma IsSelfAdjoint.imaginaryPart {x : A} (hx : IsSelfAdjoint x) :
    ℑ x = 0

{A : Type u_1}
[AddCommGroup A]
[Module ℂ A]
[StarAddMonoid A]
[StarModule ℂ A]
{x : A}
(hx : IsSelfAdjoint x)


@[simp]
lemma opcyclesMap'_neg :
    opcyclesMap' (-φ) h₁ h₂ = -opcyclesMap' φ h₁ h₂

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

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


@[simp] lemma scottContinuous_iff_continuous : ScottContinuous f ↔ Continuous f

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[TopologicalSpace α]
[Topology.IsScott α]
[Preorder β]
[TopologicalSpace β]
[Topology.IsScott β]
{f : α → β}


@[to_additive] lemma MulEquivClass.isMulFreimanIso [EquivLike F α β] [MulEquivClass F α β] (f : F)
    (hfAB : BijOn f A B) : IsMulFreimanIso n A B f

{F : Type u_1}
{α : Type u_2}
{β : Type u_3}
[CommMonoid α]
[CommMonoid β]
{A : Set α}
{B : Set β}
{n : ℕ}
[EquivLike F α β]
[MulEquivClass F α β]
(f : F)
(hfAB : Set.BijOn (⇑f) A B)