/-- If twice the oriented angles between two triples of points are equal, one triple is collinear
if and only if the other is. -/
theorem collinear_iff_of_two_zsmul_oangle_eq {p₁ p₂ p₃ p₄ p₅ p₆ : P}
    (h : (2 : ℤ) • ∡ p₁ p₂ p₃ = (2 : ℤ) • ∡ p₄ p₅ p₆) :
    Collinear ℝ ({p₁, p₂, p₃} : Set P) ↔ Collinear ℝ ({p₄, p₅, p₆} : Set P)

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

Collinear ℝ {p₁, p₂, p₃} ↔ Collinear ℝ {p₄, p₅, p₆}


@[simp]
theorem invFun_eq_symm : e.invFun = e.symm

{R : Type u_1}
{S : Type u_7}
{M : Type u_8}
{M₂ : Type u_10}
[Semiring R]
[Semiring S]
[AddCommMonoid M]
[AddCommMonoid M₂]
{module_M : Module R M}
{module_S_M₂ : Module S M₂}
{σ : R →+* S}
{σ' : S →+* R}
{re₁ : RingHomInvPair σ σ'}
{re₂ : RingHomInvPair σ' σ}
(e : M ≃ₛₗ[σ] M₂)


theorem tendsto_log_div_rpow_nhds_zero {r : ℝ} (hr : r < 0) :
    Tendsto (fun x => log x / x ^ r) (𝓝[>] 0) (𝓝 0)

Filter.Tendsto (fun x => Real.log x / x ^ r) (𝓝[>] 0) (𝓝 0)


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

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

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


/-- When a left homology data `h` of a short complex `S` is preserved by a functor `F`,
this is the induced left homology data `h.map F` for the short complex `S.map F`. -/
@[simps]
noncomputable def map : (S.map F).LeftHomologyData


theorem StrictAnti.comp_strictMono (hg : StrictAnti g) (hf : StrictMono f) : StrictAnti (g ∘ f)

{α : Type u}
{β : Type v}
{γ : Type w}
[Preorder α]
[Preorder β]
[Preorder γ]
{g : β → γ}
{f : α → β}
(hg : StrictAnti g)
(hf : StrictMono f)


/-- The **sum of the angles of a triangle** (possibly degenerate, where the triangle is a line),
oriented angles at point. -/
theorem oangle_add_oangle_add_oangle_eq_pi [Module.Oriented ℝ V (Fin 2)]
    [Fact (FiniteDimensional.finrank ℝ V = 2)] {p1 p2 p3 : P} (h21 : p2 ≠ p1) (h32 : p3 ≠ p2)
    (h13 : p1 ≠ p3) : ∡ p1 p2 p3 + ∡ p2 p3 p1 + ∡ p3 p1 p2 = π

EuclideanGeometry.oangle p1 p2 p3 + EuclideanGeometry.oangle p2 p3 p1 + EuclideanGeometry.oangle p3 p1 p2 = ↑π


/-- The image of a finitely generated ideal is finitely generated.

This is the `Ideal` version of `Submodule.FG.map`. -/
theorem FG.map {R S : Type*} [Semiring R] [Semiring S] {I : Ideal R} (h : I.FG) (f : R →+* S) :
    (I.map f).FG

{R : Type u_3}
{S : Type u_4}
[Semiring R]
[Semiring S]
{I : Ideal R}
(h : I.FG)
(f : R →+* S)


/-- The canonical isomorphism `G/(ker φ) ≃* H` induced by a homomorphism `φ : G →* H`
with a right inverse `ψ : H → G`. -/
@[to_additive (attr := simps) "The canonical isomorphism `G/(ker φ) ≃+ H` induced by a homomorphism
`φ : G →+ H` with a right inverse `ψ : H → G`."]
def quotientKerEquivOfRightInverse (ψ : H → G) (hφ : RightInverse ψ φ) : G ⧸ ker φ ≃* H

{G : Type u}
[AddGroup G]
{H : Type v}
[AddGroup H]
(φ : G →+ H)
(ψ : H → G)
(hφ : Function.RightInverse ψ ⇑φ)

∀ (a : H), (QuotientAddGroup.quotientKerEquivOfRightInverse φ ψ hφ).symm a = (QuotientAddGroup.mk ∘ ψ) a


lemma MonotoneOn.image_Ici_subset (h : MonotoneOn f (Ici a)) : f '' Ici a ⊆ Ici (f a)

{α : Type u_1}
{β : Type u_2}
{f : α → β}
[Preorder α]
[Preorder β]
{a : α}
(h : MonotoneOn f (Set.Ici a))


@[simp]
theorem counit_X (r : R) : counit R (X r) = r

(MvPolynomial.counit R) (MvPolynomial.X r) = r


/-- The sets of factors of coprime `a` and `b` are disjoint -/
theorem coprime_primeFactorsList_disjoint {a b : ℕ} (hab : a.Coprime b) :
    List.Disjoint a.primeFactorsList b.primeFactorsList


/-- **Fermat's Little Theorem**: for every unit `a` of `ZMod p`, we have `a ^ (p - 1) = 1`. -/
theorem units_pow_card_sub_one_eq_one (p : ℕ) [Fact p.Prime] (a : (ZMod p)ˣ) : a ^ (p - 1) = 1

(p : ℕ)
[Fact (Nat.Prime p)]
(a : (ZMod p)ˣ)


@[simp]
lemma coreflection_same (x : N) :
    P.coreflection i (P.coreflection i x) = x

{ι : Type u_1}
{R : Type u_2}
{M : Type u_3}
{N : Type u_4}
[CommRing R]
[AddCommGroup M]
[Module R M]
[AddCommGroup N]
[Module R N]
(P : RootPairing ι R M N)
(i : ι)
(x : N)

(P.coreflection i) ((P.coreflection i) x) = x


lemma measurableSet_bddBelow_range {ι} [Countable ι] {f : ι → δ → α} (hf : ∀ i, Measurable (f i)) :
    MeasurableSet {b | BddBelow (range (fun i ↦ f i b))}

{α : Type u_1}
{δ : Type u_4}
[TopologicalSpace α]
[MeasurableSpace α]
[BorelSpace α]
[MeasurableSpace δ]
[LinearOrder α]
[OrderTopology α]
[SecondCountableTopology α]
{ι : Sort u_5}
[Countable ι]
{f : ι → δ → α}
(hf : ∀ (i : ι), Measurable (f i))

MeasurableSet {b | BddBelow (Set.range fun i => f i b)}


/-- The `S`-linear maps from `Ω[S⁄R]` to `M` are (`S`-linearly) equivalent to `R`-derivations
from `S` to `M`.  -/
@[simps! symm_apply apply_apply]
def KaehlerDifferential.linearMapEquivDerivation : (Ω[S⁄R] →ₗ[S] M) ≃ₗ[S] Derivation R S M

(R : Type u)
(S : Type v)
[CommRing R]
[CommRing S]
[Algebra R S]
{M : Type u_1}
[AddCommGroup M]
[Module R M]
[Module S M]
[IsScalarTower R S M]
(D : Derivation R S M)

(KaehlerDifferential.linearMapEquivDerivation R S).symm D = D.liftKaehlerDifferential


@[simp]
theorem neg_im (z : ℤ√d) : (-z).im = -z.im


/-- Everything in the `r`-th slice of `𝒜` has size `r`. -/
theorem sized_slice : (𝒜 # r : Set (Finset α)).Sized r

{α : Type u_1}
{𝒜 : Finset (Finset α)}
{r : ℕ}


theorem copy_eq {μ : YoungDiagram} (T : SemistandardYoungTableau μ) (entry' : ℕ → ℕ → ℕ)
    (h : entry' = T) : T.copy entry' h = T

{μ : YoungDiagram}
(T : SemistandardYoungTableau μ)
(entry' : ℕ → ℕ → ℕ)
(h : entry' = ⇑T)


@[simp]
theorem sup_map (s : Finset γ) (f : γ ↪ β) (g : β → α) : (s.map f).sup g = s.sup (g ∘ f)

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[SemilatticeSup α]
[OrderBot α]
(s : Finset γ)
(f : γ ↪ β)
(g : β → α)


@[simp]
theorem smul_eq_mul (x y : R) : x • y = x * y


/-- Given a Localization map `f : M →* N` for a Submonoid `S ⊆ M`, for all `x₁ : M` and `y₁ ∈ S`,
if `x₂ : M, y₂ ∈ S` are such that `f x₁ * (f y₁)⁻¹ * f y₂ = f x₂`, then there exists `c ∈ S`
such that `x₁ * y₂ * c = x₂ * y₁ * c`. -/
@[to_additive
    "Given a Localization map `f : M →+ N` for a Submonoid `S ⊆ M`, for all `x₁ : M`
and `y₁ ∈ S`, if `x₂ : M, y₂ ∈ S` are such that `(f x₁ - f y₁) + f y₂ = f x₂`, then there exists
`c ∈ S` such that `x₁ + y₂ + c = x₂ + y₁ + c`."]
theorem exists_of_sec_mk' (x) (y : S) :
    ∃ c : S, ↑c * (↑(f.sec <| f.mk' x y).2 * x) = c * (y * (f.sec <| f.mk' x y).1)

{M : Type u_1}
[CommMonoid M]
{S : Submonoid M}
{N : Type u_2}
[CommMonoid N]
(f : S.LocalizationMap N)
(x : M)
(y : ↥S)

∃ c, ↑c * (↑(f.sec (f.mk' x y)).2 * x) = ↑c * (↑y * (f.sec (f.mk' x y)).1)


theorem antivaryOn_const_right (f : ι → α) (b : β) (s : Set ι) : AntivaryOn f (const ι b) s

{ι : Type u_1}
{α : Type u_3}
{β : Type u_4}
[Preorder α]
[Preorder β]
(f : ι → α)
(b : β)
(s : Set ι)


/-- The predicate expressing that, up to equivalence, a functor `L : C ⥤ D`
identifies the category `D` with the localized category of `C` with respect
to `W : MorphismProperty C`. -/
class IsLocalization : Prop where
  /-- the functor inverts the given `MorphismProperty` -/
  inverts : W.IsInvertedBy L
  /-- the induced functor from the constructed localized category is an equivalence -/
  isEquivalence : IsEquivalence (Localization.Construction.lift L inverts)

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_4, u_1} C]
[CategoryTheory.Category.{u_5, u_2} D]
{L : CategoryTheory.Functor C D}
{W : CategoryTheory.MorphismProperty C}
[self : L.IsLocalization W]


@[to_additive] lemma AntivaryOn.pow_left (hfg : AntivaryOn f g s) (n : ℕ) :
    AntivaryOn (f ^ n) g s

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[OrderedAddCommGroup α]
[OrderedAddCommGroup β]
{s : Set ι}
{f : ι → α}
{g : ι → β}
(hfg : AntivaryOn f g s)
(n : ℕ)


/-- Two `RingHom`s out of a direct sum are equal if they agree on the generators. -/
theorem ringHom_ext ⦃f g : (⨁ i, A i) →+* R⦄ (h : ∀ i x, f (of A i x) = g (of A i x)) : f = g

⦃f g : (DirectSum ι fun i => A i) →+* R⦄

(h : ∀ (i : ι) (x : A i), f ((DirectSum.of A i) x) = g ((DirectSum.of A i) x))


@[to_additive (attr := simp)]
theorem mulIndicator_mulSupport : mulIndicator (mulSupport f) f = f

{α : Type u_1}
{M : Type u_4}
[One M]
{f : α → M}

(Function.mulSupport f).mulIndicator f = f


lemma dens_le_dens_sdiff_add_dens : dens s ≤ dens (s \ t) + dens t

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


theorem zero : IsIdempotentElem (0 : M₀)


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

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

CliffordAlgebra.involuteEquiv a = CliffordAlgebra.involute a


@[to_additive HasSum.of_add_one_of_neg_add_one]
theorem HasProd.of_add_one_of_neg_add_one {f : ℤ → M}
    (hf₁ : HasProd (fun n : ℕ ↦ f (n + 1)) m) (hf₂ : HasProd (fun n : ℕ ↦ f (-(n + 1))) m') :
    HasProd f (m * f 0 * m')

(hf₂ : HasSum (fun n => f (-(↑n + 1))) m')


theorem up_sSup [SupSet α] (s : Set α) : up (sSup s) = sSup (ULift.down ⁻¹' s)

{ down := sSup s } = sSup (ULift.down ⁻¹' s)


theorem integral_bilinear_hasDerivAt_eq_sub [CompleteSpace G]
    (hu : ∀ x, HasDerivAt u (u' x) x) (hv : ∀ x, HasDerivAt v (v' x) x)
    (huv : Integrable (fun x ↦ L (u x) (v' x) + L (u' x) (v x)))
    (h_bot : Tendsto (fun x ↦ L (u x) (v x)) atBot (𝓝 m))
    (h_top : Tendsto (fun x ↦ L (u x) (v x)) atTop (𝓝 n)) :
    ∫ (x : ℝ), L (u x) (v' x) + L (u' x) (v x) = n - m

(huv : MeasureTheory.Integrable (fun x => (L (u x)) (v' x) + (L (u' x)) (v x)) MeasureTheory.volume)

(h_bot : Filter.Tendsto (fun x => (L (u x)) (v x)) Filter.atBot (𝓝 m))

(h_top : Filter.Tendsto (fun x => (L (u x)) (v x)) Filter.atTop (𝓝 n))


theorem contDiff_sinh {n} : ContDiff ℝ n sinh


@[simp]
theorem symm_to_ringEquiv (e : A ≃⋆ₐ[R] B) : (e.symm : B ≃+* A) = (e : A ≃+* B).symm

{R : Type u_2}
{A : Type u_3}
{B : Type u_4}
[Add A]
[Add B]
[Mul A]
[Mul B]
[SMul R A]
[SMul R B]
[Star A]
[Star B]
(e : A ≃⋆ₐ[R] B)


@[to_additive]
theorem rank_congr {H K : Subgroup G} [Group.FG H] [Group.FG K] (h : H = K) :
    Group.rank H = Group.rank K

{G : Type u_3}
[AddGroup G]
{H K : AddSubgroup G}
[AddGroup.FG ↥H]
[AddGroup.FG ↥K]
(h : H = K)


protected theorem contDiffWithinAt {s : Set E} : ContDiffWithinAt ℝ n f s x

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[HasContDiffBump E]
{c : E}
(f : ContDiffBump c)
{x : E}
{n : ℕ∞}
{s : Set E}


@[to_additive]
theorem isClopen [ContinuousMul G] (U : OpenSubgroup G) : IsClopen (U : Set G)

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


theorem ite {c : α → Prop} [DecidablePred c] {f : α → σ} {g : α → σ} (hc : PrimrecPred c)
    (hf : Primrec f) (hg : Primrec g) : Primrec fun a => if c a then f a else g a

{α : Type u_1}
{σ : Type u_5}
[Primcodable α]
[Primcodable σ]
{c : α → Prop}
[DecidablePred c]
{f g : α → σ}
(hc : PrimrecPred c)
(hf : Primrec f)
(hg : Primrec g)


theorem lift_map_functor_map {X Y : C} (f : X ⟶ Y) :
    (lift r F H).map ((functor r).map f) = F.map f

(H : ∀ (x y : C) (f₁ f₂ : x ⟶ y), r f₁ f₂ → F.map f₁ = F.map f₂)

(CategoryTheory.Quotient.lift r F H).map ((CategoryTheory.Quotient.functor r).map f) = F.map f


theorem first_cont_eq {gp : Pair K} (zeroth_s_eq : g.s.get? 0 = some gp) :
    g.conts 1 = ⟨gp.b * g.h + gp.a, gp.b⟩

{K : Type u_1}
{g : GenContFract K}
[DivisionRing K]
{gp : GenContFract.Pair K}
(zeroth_s_eq : g.s.get? 0 = some gp)

g.conts 1 = { a := gp.b * g.h + gp.a, b := gp.b }


theorem countable_leftLim_ne (f : StieltjesFunction) : Set.Countable { x | leftLim f x ≠ f x }

{x | Function.leftLim (↑f) x ≠ ↑f x}.Countable


theorem toMatrix_reindexEquiv (e : n ≃ p) (t : TransvectionStruct n R) :
    (t.reindexEquiv e).toMatrix = reindexAlgEquiv R _ e t.toMatrix

{n : Type u_1}
{p : Type u_2}
{R : Type u₂}
[DecidableEq n]
[DecidableEq p]
[CommRing R]
[Fintype n]
[Fintype p]
(e : n ≃ p)
(t : Matrix.TransvectionStruct n R)

(Matrix.TransvectionStruct.reindexEquiv e t).toMatrix = (Matrix.reindexAlgEquiv R R e) t.toMatrix


/-- A subtype of a subtype is equivalent to the subtype of elements satisfying both predicates. This
version allows the “inner” predicate to depend on `h : p a`. -/
@[simps]
def subtypeSubtypeEquivSubtypeExists (p : α → Prop) (q : Subtype p → Prop) :
    Subtype q ≃ { a : α // ∃ h : p a, q ⟨a, h⟩ }

{α : Sort u_1}
(p : α → Prop)
(q : Subtype p → Prop)
(a : { a // ∃ h, q ⟨a, h⟩ })

↑↑((Equiv.subtypeSubtypeEquivSubtypeExists p q).symm a) = ↑a


/-- The lemma below essentially says that `idealPowersToSelfLERadical I` is initial in
`selfLERadicalDiagram I`.

Porting note: This lemma should probably be moved to `Mathlib/RingTheory/Finiteness`
to be near `Ideal.exists_radical_pow_le_of_fg`, which it generalizes. -/
theorem Ideal.exists_pow_le_of_le_radical_of_fG (hIJ : I ≤ J.radical) (hJ : J.radical.FG) :
    ∃ k : ℕ, I ^ k ≤ J

{R : Type u}
[CommRing R]
{I J : Ideal R}
(hIJ : I ≤ J.radical)
(hJ : J.radical.FG)


theorem IsMinFilter.bicomp_mono [Preorder δ] {op : β → γ → δ}
    (hop : ((· ≤ ·) ⇒ (· ≤ ·) ⇒ (· ≤ ·)) op op) (hf : IsMinFilter f l a) {g : α → γ}
    (hg : IsMinFilter g l a) : IsMinFilter (fun x => op (f x) (g x)) l a

{op : β → γ → δ}

(hop : ((fun x x_1 => x ≤ x_1) ⇒ (fun x x_1 => x ≤ x_1) ⇒ fun x x_1 => x ≤ x_1) op op)


@[to_additive]
theorem smul_opposite_image_mul_preimage {H : Subgroup G} (g : G) (h : H.op) (s : Set G) :
    (fun y => h • y) '' ((g * ·) ⁻¹' s) = (g * ·) ⁻¹' ((fun y => h • y) '' s)

{G : Type u_2}
[AddGroup G]
{H : AddSubgroup G}
(g : G)
(h : ↥H.op)
(s : Set G)

(fun y => h +ᵥ y) '' ((fun x => g + x) ⁻¹' s) = (fun x => g + x) ⁻¹' ((fun y => h +ᵥ y) '' s)


@[deprecated getElem_set_eq (since := "2024-06-12")]
theorem get_set_eq {l : List α} {i : Nat} {a : α} (h : i < (l.set i a).length) :
    (l.set i a).get ⟨i, h⟩ = a

{α : Type u_1}
{l : List α}
{i : Nat}
{a : α}
(h : i < (l.set i a).length)


/--
Fermat's Last Theorem for $n=4$: if `a b c : ℕ` are all non-zero
then `a ^ 4 + b ^ 4 ≠ c ^ 4`.
-/
theorem fermatLastTheoremFour : FermatLastTheoremFor 4


theorem summable_geometric_of_norm_lt_one (h : ‖ξ‖ < 1) : Summable fun n : ℕ ↦ ξ ^ n

{K : Type u_4}
[NormedDivisionRing K]
{ξ : K}
(h : ‖ξ‖ < 1)


theorem integer_valuation_le_one (x : S.integer K) {v : HeightOneSpectrum R} (hv : v ∉ S) :
    v.valuation (x : K) ≤ 1

(S : Set (IsDedekindDomain.HeightOneSpectrum R))

{v : IsDedekindDomain.HeightOneSpectrum R}


@[simp, nolint simpNF]
theorem homEquiv_apply_eq (f : A ⨯ Y ⟶ X) : (exp.adjunction A).homEquiv _ _ f = curry f

((CategoryTheory.exp.adjunction A).homEquiv Y X) f = CategoryTheory.CartesianClosed.curry f


theorem comp_continuousOn_iff {γ} [TopologicalSpace γ] {g : γ → α} {s : Set γ} :
    ContinuousOn ((f : α → β) ∘ g) s ↔ ContinuousOn g s

{α : Type u_1}
{β : Type u_2}
{F : Type u_4}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
[FunLike F α β]
[DilationClass F α β]
(f : F)
{γ : Type u_6}
[TopologicalSpace γ]
{g : γ → α}
{s : Set γ}

ContinuousOn (⇑f ∘ g) s ↔ ContinuousOn g s


theorem tendsto_atBot_pure [PartialOrder α] [OrderBot α] (f : α → β) :
    Tendsto f atBot (pure <| f ⊥)

{α : Type u_3}
{β : Type u_4}
[PartialOrder α]
[OrderBot α]
(f : α → β)

Filter.Tendsto f Filter.atBot (pure (f ⊥))


theorem equivRealProdCLM_symm_apply (p : ℝ × ℝ) :
    Complex.equivRealProdCLM.symm p = p.1 + p.2 * Complex.I

Complex.equivRealProdCLM.symm p = ↑p.1 + ↑p.2 * Complex.I


/-- A right homology data for a short complex `S` induces a left homology data for `S.op`. -/
@[simps]
def op (h : S.RightHomologyData) : S.op.LeftHomologyData


/-- If a function admits a finite power series expansion `p` on an open ball `B (x, r)`, then
it is continuously polynomial at every point of this ball. -/
theorem HasFiniteFPowerSeriesOnBall.cPolynomialAt_of_mem
    (hf : HasFiniteFPowerSeriesOnBall f p x n r) (h : y ∈ EMetric.ball x r) :
    CPolynomialAt 𝕜 f y


lemma pullbackShiftFunctorZero_inv_app :
    (shiftFunctorZero _ A).inv.app X =
      (shiftFunctorZero C B).inv.app X ≫ (pullbackShiftIso C φ 0 0 (by simp)).inv.app X

{C : Type u_1}
[CategoryTheory.Category.{u_4, u_1} C]
{A : Type u_2}
{B : Type u_3}
[AddMonoid A]
[AddMonoid B]
(φ : A →+ B)
[CategoryTheory.HasShift C B]
(X : CategoryTheory.PullbackShift C φ)

(CategoryTheory.shiftFunctorZero (CategoryTheory.PullbackShift C φ) A).inv.app X =
  CategoryTheory.CategoryStruct.comp ((CategoryTheory.shiftFunctorZero C B).inv.app X)
    ((CategoryTheory.pullbackShiftIso C φ 0 0 ⋯).inv.app X)


theorem Int.two_pow_two_pow_add_two_pow_two_pow {x y : ℤ} (hx : ¬2 ∣ x) (hxy : 4 ∣ x - y) (i : ℕ) :
    multiplicity 2 (x ^ 2 ^ i + y ^ 2 ^ i) = ↑(1 : ℕ)

multiplicity 2 (x ^ 2 ^ i + y ^ 2 ^ i) = ↑1


@[simp]
theorem coeff_X_pow_mul (p : R[X]) (n d : ℕ) :
    coeff (Polynomial.X ^ n * p) (d + n) = coeff p d

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

(Polynomial.X ^ n * p).coeff (d + n) = p.coeff d


lemma IsCondKernelCDF.lintegral [IsFiniteKernel κ]
    {f : α × β → StieltjesFunction} (hf : IsCondKernelCDF f κ ν) (a : α) (x : ℝ) :
    ∫⁻ b, ENNReal.ofReal (f (a, b) x) ∂(ν a) = κ a (univ ×ˢ Iic x)

{κ : ProbabilityTheory.Kernel α (β × ℝ)}

(hf : ProbabilityTheory.IsCondKernelCDF f κ ν)

∫⁻ (b : β), ENNReal.ofReal (↑(f (a, b)) x) ∂ν a = (κ a) (Set.univ ×ˢ Set.Iic x)


theorem SameCycle.conj : SameCycle f x y → SameCycle (g * f * g⁻¹) (g x) (g y)

{α : Type u_2}
{f g : Equiv.Perm α}
{x y : α}

f.SameCycle x y → (g * f * g⁻¹).SameCycle (g x) (g y)


@[simp, norm_cast]
lemma cast_max (p q : ℚ) : (↑(max p q) : K) = max (p : K) (q : K)

{K : Type u_5}
[LinearOrderedField K]
(p q : ℚ)


/-- An `OrderedRing` is a ring with a partial order such that addition is monotone and
multiplication by a nonnegative number is monotone. -/
class OrderedRing (α : Type u) extends Ring α, OrderedAddCommGroup α where
  /-- `0 ≤ 1` in any ordered ring. -/
  protected zero_le_one : 0 ≤ (1 : α)
  /-- The product of non-negative elements is non-negative. -/
  protected mul_nonneg : ∀ a b : α, 0 ≤ a → 0 ≤ b → 0 ≤ a * b


@[simp] lemma disjoint_edgeSet : Disjoint G₁.edgeSet G₂.edgeSet ↔ Disjoint G₁ G₂


theorem diophFn_compn :
    ∀ {n} {S : Set (α ⊕ (Fin2 n) → ℕ)} (_ : Dioph S) {f : Vector3 ((α → ℕ) → ℕ) n}
      (_ : VectorAllP DiophFn f), Dioph {v : α → ℕ | (v ⊗ fun i => f i v) ∈ S}

{α : Type}
{n : ℕ}
{S : Set (α ⊕ Fin2 n → ℕ)}

Dioph S → ∀ {f : Vector3 ((α → ℕ) → ℕ) n}, VectorAllP Dioph.DiophFn f → Dioph {v | (v ⊗ fun i => f i v) ∈ S}


@[to_additive]
protected theorem integrableOn_iff (hs : IsFundamentalDomain G s μ) (ht : IsFundamentalDomain G t μ)
    {f : α → E} (hf : ∀ (g : G) (x), f (g • x) = f x) : IntegrableOn f s μ ↔ IntegrableOn f t μ

[MeasureTheory.VAddInvariantMeasure G α μ]

(hs : MeasureTheory.IsAddFundamentalDomain G s μ)

(ht : MeasureTheory.IsAddFundamentalDomain G t μ)

MeasureTheory.IntegrableOn f s μ ↔ MeasureTheory.IntegrableOn f t μ


theorem finite_of_finite_mul_left {a b c : α} : Finite a (b * c) → Finite a c

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

multiplicity.Finite a (b * c) → multiplicity.Finite a c


theorem lt_iff_le_not_le : ∀ {a b : α}, a < b ↔ a ≤ b ∧ ¬b ≤ a


/-- The inner product as a sesquilinear form.

Note that in the case `𝕜 = ℝ` this is a bilinear form. -/
@[simps!]
def sesqFormOfInner : E →ₗ[𝕜] E →ₗ⋆[𝕜] 𝕜

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


@[simp, norm_cast]
theorem toENNReal_ofNat (n : ℕ) [n.AtLeastTwo] :
    ((no_index (OfNat.ofNat n : ℕ∞)) : ℝ≥0∞) = OfNat.ofNat n


theorem _root_.aestronglyMeasurable_congr (h : f =ᵐ[μ] g) :
    AEStronglyMeasurable f μ ↔ AEStronglyMeasurable g μ

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

MeasureTheory.AEStronglyMeasurable f μ ↔ MeasureTheory.AEStronglyMeasurable g μ


protected theorem tsum_mul_left : ∑' i, a * f i = a * ∑' i, f i

{α : Type u_1}
{a : ℝ≥0∞}
{f : α → ℝ≥0∞}


theorem u_biSup_of_lu_eq_self [CompleteLattice α] [CompleteLattice β] (gi : GaloisCoinsertion l u)
    {ι : Sort x} {p : ι → Prop} (f : ∀ (i) (_ : p i), β) (hf : ∀ i hi, l (u (f i hi)) = f i hi) :
    u (⨆ (i) (hi), f i hi) = ⨆ (i) (hi), u (f i hi)

(hf : ∀ (i : ι) (hi : p i), l (u (f i hi)) = f i hi)

u (⨆ i, ⨆ (hi : p i), f i hi) = ⨆ i, ⨆ (hi : p i), u (f i hi)


theorem ssubset_iff_subset_ne [IsAntisymm α (· ⊆ ·)] : a ⊂ b ↔ a ⊆ b ∧ a ≠ b

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


lemma isRegular_iff_isWeaklyRegular_of_subset_jacobson_annihilator
    [Nontrivial M] [Module.Finite R M] {rs : List R}
    (h : ∀ r ∈ rs, r ∈ Ideal.jacobson (Module.annihilator R M)) :
    IsRegular M rs ↔ IsWeaklyRegular M rs

(h : ∀ r ∈ rs, r ∈ (Module.annihilator R M).jacobson)

RingTheory.Sequence.IsRegular M rs ↔ RingTheory.Sequence.IsWeaklyRegular M rs


@[simp]
theorem tensorRightHomEquiv_symm_coevaluation_comp_whiskerLeft {X Y : C} [HasLeftDual X]
    [HasLeftDual Y] (f : X ⟶ Y) :
    (tensorRightHomEquiv _ (ᘁY) _ _).symm (η_ (ᘁX) X ≫ (ᘁX) ◁ f) = (λ_ _).hom ≫ ᘁf

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

(CategoryTheory.tensorRightHomEquiv (𝟙_ C) (ᘁY) Y ᘁX).symm (η_ (ᘁX) X ≫ ᘁX ◁ f) = (λ_ ᘁY).hom ≫ ᘁf


@[to_additive prod_eq_top_iff]
theorem prod_eq_top_iff [Nonempty M] [Nonempty N] {s : Subsemigroup M} {t : Subsemigroup N} :
    s.prod t = ⊤ ↔ s = ⊤ ∧ t = ⊤

{M : Type u_1}
{N : Type u_2}
[Add M]
[Add N]
[Nonempty M]
[Nonempty N]
{s : AddSubsemigroup M}
{t : AddSubsemigroup N}


/-- A lax monoidal functor induces a lax monoidal functor between
the categories of `G`-actions within those categories. -/
@[simps!]
def mapActionLax (F : LaxMonoidalFunctor V W) (G : MonCat.{u}) :
    LaxMonoidalFunctor (Action V G) (Action W G)

(F : CategoryTheory.LaxMonoidalFunctor V W)

∀ (a : Action V G), ((CategoryTheory.MonoidalFunctor.mapActionLax F G).obj a).V = F.obj a.V


/-- An element of a monoid is in the set of that element's natural number powers. -/
@[to_additive
      "An element of an `AddMonoid` is in the set of that element's natural number multiples."]
theorem powers.self_mem {x : M} : x ∈ powers x


@[to_additive (attr := simp)]
theorem quotient_liftOn_mk {β} (f : α → β) (h) (x : α) : Quotient.liftOn' (x : α ⧸ s) f h = f x

(h : ∀ (a b : α), Setoid.r a b → f a = f b)


/-- Mapping with respect to a semilinear map over an isomorphism of fields yields
an injective map on projective spaces. -/
theorem map_injective {σ : K →+* L} {τ : L →+* K} [RingHomInvPair σ τ] (f : V →ₛₗ[σ] W)
    (hf : Function.Injective f) : Function.Injective (map f hf)

{K : Type u_1}
{V : Type u_2}
[DivisionRing K]
[AddCommGroup V]
[Module K V]
{L : Type u_3}
{W : Type u_4}
[DivisionRing L]
[AddCommGroup W]
[Module L W]
{σ : K →+* L}
{τ : L →+* K}
[RingHomInvPair σ τ]
(f : V →ₛₗ[σ] W)
(hf : Function.Injective ⇑f)

Function.Injective (Projectivization.map f hf)


@[to_additive] lemma oneLePart_def (f : ∀ i, α i) : f⁺ = fun i ↦ (f i)⁺

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


/-- Build an isomorphism in the category `CommGrp` from a `MulEquiv`
between `CommGroup`s. -/
@[to_additive (attr := simps)]
def MulEquiv.toCommGrpIso {X Y : CommGrp} (e : X ≃* Y) : X ≅ Y


lemma eq_of_germ_isConstant_on {s : Set X} (h : ∀ x ∈ s, (f : Germ (𝓝 x) Y).IsConstant)
    (hs : IsPreconnected s) {x' : X} (x_in : x ∈ s) (x'_in : x' ∈ s) : f x = f x'

{X : Type u_3}
{Y : Type u_4}
[TopologicalSpace X]
{f : X → Y}
{x : X}
{s : Set X}
(h : ∀ x ∈ s, (↑f).IsConstant)
(hs : IsPreconnected s)
{x' : X}
(x_in : x ∈ s)
(x'_in : x' ∈ s)


@[simp] theorem loopyOn_dual_eq : (loopyOn E)✶ = freeOn E


theorem Char.eq_of_val_eq : ∀ {c d : Char}, Eq c.val d.val → Eq c d


@[simp]
theorem mk_le_mk [LE α] [LE β] {x₁ x₂ : α} {y₁ y₂ : β} : (x₁, y₁) ≤ (x₂, y₂) ↔ x₁ ≤ x₂ ∧ y₁ ≤ y₂

{α : Type u_2}
{β : Type u_3}
[LE α]
[LE β]
{x₁ x₂ : α}
{y₁ y₂ : β}


@[simp, norm_cast]
theorem coe_add (f g : M₁ →SL[σ₁₂] M₂) : (↑(f + g) : M₁ →ₛₗ[σ₁₂] M₂) = f + g

{R₁ : Type u_1}
{R₂ : Type u_2}
[Semiring R₁]
[Semiring R₂]
{σ₁₂ : R₁ →+* R₂}
{M₁ : Type u_4}
[TopologicalSpace M₁]
[AddCommMonoid M₁]
{M₂ : Type u_6}
[TopologicalSpace M₂]
[AddCommMonoid M₂]
[Module R₁ M₁]
[Module R₂ M₂]
[ContinuousAdd M₂]
(f g : M₁ →SL[σ₁₂] M₂)


theorem LinearIndependent.not_mem_span_image [Nontrivial R] (hv : LinearIndependent R v) {s : Set ι}
    {x : ι} (h : x ∉ s) : v x ∉ Submodule.span R (v '' s)

{ι : Type u'}
{R : Type u_2}
{M : Type u_4}
{v : ι → M}
[Ring R]
[AddCommGroup M]
[Module R M]
[Nontrivial R]
(hv : LinearIndependent R v)
{s : Set ι}
{x : ι}
(h : x ∉ s)


theorem algebraMap_eq_inlRingHom : algebraMap R (Unitization R A) = inlRingHom R A

(R : Type u_2)
(A : Type u_3)
[CommSemiring R]
[NonUnitalSemiring A]
[Module R A]
[IsScalarTower R A A]
[SMulCommClass R A A]

algebraMap R (Unitization R A) = Unitization.inlRingHom R A


@[to_additive]
theorem orderOf_le_card_univ [Fintype G] : orderOf x ≤ Fintype.card G

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


@[simp]
theorem partialSups_disjointed (f : ℕ → α) : partialSups (disjointed f) = partialSups f

{α : Type u_1}
[GeneralizedBooleanAlgebra α]
(f : ℕ → α)


theorem iInter_setOf (P : ι → α → Prop) : ⋂ i, { x : α | P i x } = { x : α | ∀ i, P i x }

{α : Type u_1}
{ι : Sort u_4}
(P : ι → α → Prop)

⋂ i, {x | P i x} = {x | ∀ (i : ι), P i x}


/-- Given an exact short complex `S` and a colimit cokernel cofork `cc` for `S.f`, this is the
right homology data for `S` with `Q := cc.pt` and `H := 0`. -/
@[simps]
noncomputable def Exact.rightHomologyDataOfIsColimitCokernelCofork
    (hS : S.Exact) [HasZeroObject C] (cc : CokernelCofork S.f) (hcc : IsColimit cc) :
    S.RightHomologyData

(cc : CategoryTheory.Limits.CokernelCofork S.f)

(hcc : CategoryTheory.Limits.IsColimit cc)

(hS.rightHomologyDataOfIsColimitCokernelCofork cc hcc).Q = cc.pt


@[simp, norm_cast]
theorem natCast_mod (m n : ℕ) : ((m % n : ℕ) : Ordinal) = m % n


@[simp] theorem Bool.true_or (b : Bool) : (true || b) = true


@[to_additive] lemma monovaryOn_inv : MonovaryOn f⁻¹ g⁻¹ s ↔ MonovaryOn f g s

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

MonovaryOn (-f) (-g) s ↔ MonovaryOn f g s


@[simp] theorem coe_mk (f₁ : α → Option β) (f₂ h) : (mk f₁ f₂ h : α → Option β) = f₁

(h : ∀ (a : α) (b : β), a ∈ f₂ b ↔ b ∈ f₁ a)

⇑{ toFun := f₁, invFun := f₂, inv := h } = f₁


theorem not_covBy_of_lt_of_lt (h₁ : a < b) (h₂ : b < c) : ¬a ⋖ c

{α : Type u_1}
[Preorder α]
{a b c : α}
(h₁ : a < b)
(h₂ : b < c)


theorem isEquivalent_iff_exists_eq_mul :
    u ~[l] v ↔ ∃ (φ : α → β) (_ : Tendsto φ l (𝓝 1)), u =ᶠ[l] φ * v

{α : Type u_1}
{β : Type u_2}
[NormedField β]
{u v : α → β}
{l : Filter α}

u ~[l] v ↔ ∃ φ, ∃ (_ : Filter.Tendsto φ l (nhds 1)), u =ᶠ[l] φ * v


@[simp] lemma ad_apply_eq_zero_iff (x : L) : ad R L x = 0 ↔ x = 0

(R : Type u_1)
(L : Type u_2)
[Field R]
[LieRing L]
[LieAlgebra R L]
[Module.Finite R L]
[LieAlgebra.IsKilling R L]
(x : L)


lemma some_ne_zero {x y : R} (h : W.Nonsingular x y) : some h ≠ 0

{R : Type u}
[CommRing R]
{W : WeierstrassCurve.Affine R}
{x y : R}
(h : W.Nonsingular x y)

WeierstrassCurve.Affine.Point.some h ≠ 0


@[to_additive (attr := simp)]
theorem inv_inf (S T : Submonoid G) : (S ⊓ T)⁻¹ = S⁻¹ ⊓ T⁻¹

{G : Type u_2}
[AddGroup G]
(S T : AddSubmonoid G)


theorem Set.Subsingleton.minimals_eq (h : s.Subsingleton) : minimals r s = s

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


@[simp]
theorem Nat.floor_int : (Nat.floor : ℤ → ℕ) = Int.toNat


@[simp]
theorem dedup_singleton {a : α} : dedup ({a} : Multiset α) = {a}


theorem mem_Icc_Ico_Ioc_Ioo_of_subset_of_subset {s : Set α} (ho : Ioo a b ⊆ s) (hc : s ⊆ Icc a b) :
    s ∈ ({Icc a b, Ico a b, Ioc a b, Ioo a b} : Set (Set α))

{α : Type u_1}
[PartialOrder α]
{a b : α}
{s : Set α}
(ho : Set.Ioo a b ⊆ s)
(hc : s ⊆ Set.Icc a b)

s ∈ {Set.Icc a b, Set.Ico a b, Set.Ioc a b, Set.Ioo a b}


@[to_additive]
theorem eq_one_of_mul_right (h : a * b = 1) : a = 1

{α : Type u}
[CommMonoid α]
[Subsingleton αˣ]
{a b : α}
(h : a * b = 1)


theorem preimage_metric_ball {r : ℝ} : p ⁻¹' Metric.ball 0 r = { x | p x < r }

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


@[simp]
theorem grundyValue_neg (G : PGame) [G.Impartial] : grundyValue (-G) = grundyValue G


theorem of_isPullback_isPushout (p₁ : IsPullback f g h i) (p₂ : IsPushout f g h i) :
    BicartesianSq f g h i

(p₁ : CategoryTheory.IsPullback f g h i)


theorem exists_associated_pow_of_mul_eq_pow' {a b c : R} (hab : IsCoprime a b) {k : ℕ}
    (h : a * b = c ^ k) : ∃ d : R, Associated (d ^ k) a

{R : Type u}
[CommRing R]
[IsDomain R]
[IsBezout R]
{a b c : R}
(hab : IsCoprime a b)
{k : ℕ}
(h : a * b = c ^ k)


@[simp]
theorem Basis.addHaar_reindex (b : Basis ι ℝ E) (e : ι ≃ ι') :
    (b.reindex e).addHaar = b.addHaar

{ι : Type u_1}
{ι' : Type u_2}
{E : Type u_3}
[Fintype ι]
[Fintype ι']
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[MeasurableSpace E]
[BorelSpace E]
(b : Basis ι ℝ E)
(e : ι ≃ ι')


theorem filter_map (f : β → α) (s : Multiset β) : filter p (map f s) = map f (filter (p ∘ f) s)

{α : Type u_1}
{β : Type v}
(p : α → Prop)
[DecidablePred p]
(f : β → α)
(s : Multiset β)

Multiset.filter p (Multiset.map f s) = Multiset.map f (Multiset.filter (p ∘ f) s)


/-- The obvious functor `WidePullbackShape J ⥤ (WidePushoutShape J)ᵒᵖ` -/
@[simps]
def widePullbackShapeOp : WidePullbackShape J ⥤ (WidePushoutShape J)ᵒᵖ

(X : CategoryTheory.Limits.WidePullbackShape J)

(CategoryTheory.Limits.widePullbackShapeOp J).obj X = Opposite.op X


/-- Suppose we have a monoidal equivalence `F : C ≌ D`, with `D` monoidal closed. We can pull the
monoidal closed instance back along the equivalence. For `X, Y, Z : C`, this lemma describes the
resulting currying map `Hom(X ⊗ Y, Z) → Hom(Y, (X ⟶[C] Z))`. (`X ⟶[C] Z` is defined to be
`F⁻¹(F(X) ⟶[D] F(Z))`, so currying in `C` is given by essentially conjugating currying in
`D` by `F.`) -/
theorem ofEquiv_curry_def {X Y Z : C} (f : X ⊗ Y ⟶ Z) :
    letI := ofEquiv F adj
    MonoidalClosed.curry f =
      adj.homEquiv Y ((ihom (F.obj X)).obj (F.obj Z))
        (MonoidalClosed.curry (adj.toEquivalence.symm.toAdjunction.homEquiv (F.obj X ⊗ F.obj Y) Z
        ((Iso.compInverseIso (H := adj.toEquivalence)
          (MonoidalFunctor.commTensorLeft F X)).hom.app Y ≫ f)))

(F : CategoryTheory.MonoidalFunctor C D)

(f : CategoryTheory.MonoidalCategory.tensorObj X Y ⟶ Z)

CategoryTheory.MonoidalClosed.curry f =
  (adj.homEquiv Y ((CategoryTheory.ihom (F.obj X)).obj (F.obj Z)))
    (CategoryTheory.MonoidalClosed.curry
      ((adj.toEquivalence.symm.toAdjunction.homEquiv (CategoryTheory.MonoidalCategory.tensorObj (F.obj X) (F.obj Y)) Z)
        (CategoryTheory.CategoryStruct.comp ((F.commTensorLeft X).compInverseIso.hom.app Y) f)))


@[to_additive]
theorem liftOn₂_mk {p : Sort*} (f : M → S → M → S → p) (H) (a c : M) (b d : S) :
    liftOn₂ (mk a b) (mk c d) f H = f a b c d

(H :
  ∀ {a a' : M} {b b' : ↥S} {c c' : M} {d d' : ↥S},
    (Localization.r S) (a, b) (a', b') → (Localization.r S) (c, d) (c', d') → f a b c d = f a' b' c' d')

(Localization.mk a b).liftOn₂ (Localization.mk c d) f H = f a b c d


/-- `f x / g x` is analytic away from `g x = 0` -/
theorem AnalyticAt.div {f g : E → 𝕝} {x : E}
    (fa : AnalyticAt 𝕜 f x) (ga : AnalyticAt 𝕜 g x) (g0 : g x ≠ 0) :
    AnalyticAt 𝕜 (fun x ↦ f x / g x) x

{𝕜 : Type u_2}
[NontriviallyNormedField 𝕜]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{𝕝 : Type u_7}
[NontriviallyNormedField 𝕝]
[NormedAlgebra 𝕜 𝕝]
{f g : E → 𝕝}
{x : E}
(fa : AnalyticAt 𝕜 f x)
(ga : AnalyticAt 𝕜 g x)
(g0 : g x ≠ 0)


theorem isVanKampenColimit_extendCofan {n : ℕ} (f : Fin (n + 1) → C)
    {c₁ : Cofan fun i : Fin n ↦ f i.succ} {c₂ : BinaryCofan (f 0) c₁.pt}
    (t₁ : IsVanKampenColimit c₁) (t₂ : IsVanKampenColimit c₂)
    [∀ {Z} (i : Z ⟶ c₂.pt), HasPullback c₂.inr i]
    [HasFiniteCoproducts C] :
    IsVanKampenColimit (extendCofan c₁ c₂)

{c₁ : CategoryTheory.Limits.Cofan fun i => f i.succ}

{c₂ : CategoryTheory.Limits.BinaryCofan (f 0) c₁.pt}

(t₁ : CategoryTheory.IsVanKampenColimit c₁)

(t₂ : CategoryTheory.IsVanKampenColimit c₂)

[∀ {Z : C} (i : Z ⟶ c₂.pt), CategoryTheory.Limits.HasPullback c₂.inr i]

CategoryTheory.IsVanKampenColimit (CategoryTheory.extendCofan c₁ c₂)


/-- A more explicit version of `convexHull_eq_union`. -/
theorem eq_pos_convex_span_of_mem_convexHull {x : E} (hx : x ∈ convexHull 𝕜 s) :
    ∃ (ι : Sort (u + 1)) (_ : Fintype ι),
      ∃ (z : ι → E) (w : ι → 𝕜), Set.range z ⊆ s ∧ AffineIndependent 𝕜 z ∧ (∀ i, 0 < w i) ∧
        ∑ i, w i = 1 ∧ ∑ i, w i • z i = x

{𝕜 : Type u_1}
{E : Type u}
[LinearOrderedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{s : Set E}
{x : E}
(hx : x ∈ (convexHull 𝕜) s)

∃ ι x_1 z w, Set.range z ⊆ s ∧ AffineIndependent 𝕜 z ∧ (∀ (i : ι), 0 < w i) ∧ ∑ i : ι, w i = 1 ∧ ∑ i : ι, w i • z i = x


@[simp] lemma compls_compls (s : Finset α) : sᶜˢᶜˢ = s

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


@[to_additive Bornology.IsBounded.exists_pos_norm_lt]
lemma Bornology.IsBounded.exists_pos_norm_lt' (hs : IsBounded s) : ∃ R > 0, ∀ x ∈ s, ‖x‖ < R

{E : Type u_3}
[SeminormedAddGroup E]
{s : Set E}
(hs : Bornology.IsBounded s)


@[to_additive]
theorem eq_one_div_of_mul_eq_one_right (h : a * b = 1) : b = 1 / a

{α : Type u_1}
[DivisionMonoid α]
{a b : α}
(h : a * b = 1)


lemma restrict_orthogonal_nondegenerate (I : LieIdeal K L) (hI : IsAtom I) :
    (Φ.restrict (orthogonal Φ hΦ_inv I)).Nondegenerate

(hΦ_inv : LinearMap.BilinForm.lieInvariant L Φ)

(hL : ∀ (I : LieIdeal K L), IsAtom I → ¬IsLieAbelian ↥↑I)

(Φ.restrict (lieIdealSubalgebra K L (LieAlgebra.InvariantForm.orthogonal Φ hΦ_inv I)).toSubmodule).Nondegenerate


@[higher_order snd_comp_fst]
theorem snd_fst {α₀ α₁ β₀ β₁} (f : α₀ → α₁) (f' : β₀ → β₁) (x : F α₀ β₀) :
    snd f' (fst f x) = bimap f f' x

{F : Type u₀ → Type u₁ → Type u₂}
[Bifunctor F]
[LawfulBifunctor F]
{α₀ α₁ : Type u₀}
{β₀ β₁ : Type u₁}
(f : α₀ → α₁)
(f' : β₀ → β₁)

Bifunctor.snd f' ∘ Bifunctor.fst f = bimap f f'


@[to_additive]
theorem lift_comp_of (f : α → M) : lift f ∘ of = f

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

⇑(FreeMonoid.lift f) ∘ FreeMonoid.of = f


theorem coeff_iterate_frobenius (f : Ring.Perfection R p) (n m : ℕ) :
    coeff R p (n + m) ((frobenius _ p)^[m] f) = coeff R p n f

{R : Type u₁}
[CommSemiring R]
{p : ℕ}
[hp : Fact (Nat.Prime p)]
[CharP R p]
(f : Ring.Perfection R p)
(n m : ℕ)

(Perfection.coeff R p (n + m)) ((⇑(frobenius (Ring.Perfection R p) p))^[m] f) = (Perfection.coeff R p n) f


@[simp]
theorem map_dfinsupp_sumAddHom (f : M →ₛₗ[σ₁₂] M₂) {t : Π₀ i, γ i} {g : ∀ i, γ i →+ M} :
    f (sumAddHom g t) = sumAddHom (fun i => f.toAddMonoidHom.comp (g i)) t

{R : Type u_6}
{R₂ : Type u_8}
{M : Type u_14}
{M₂ : Type u_17}
{ι : Type u_22}
[Semiring R]
[Semiring R₂]
[AddCommMonoid M]
[AddCommMonoid M₂]
{σ₁₂ : R →+* R₂}
[Module R M]
[Module R₂ M₂]
{γ : ι → Type u_25}
[DecidableEq ι]
[(i : ι) → AddZeroClass (γ i)]
(f : M →ₛₗ[σ₁₂] M₂)
{t : Π₀ (i : ι), γ i}
{g : (i : ι) → γ i →+ M}

f ((DFinsupp.sumAddHom g) t) = (DFinsupp.sumAddHom fun i => f.toAddMonoidHom.comp (g i)) t


theorem isSheaf_iff_isLimit_coverage (K : Coverage C) (P : Cᵒᵖ ⥤ D) :
    Presheaf.IsSheaf (toGrothendieck _ K) P ↔ ∀ ⦃X : C⦄ (R : Presieve X),
      R ∈ K.covering X →
        Nonempty (IsLimit (P.mapCone (Sieve.generate R).arrows.cocone.op))

{C : Type u_1}
{D : Type u_4}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Category.{u_3, u_4} D]
(K : CategoryTheory.Coverage C)
(P : CategoryTheory.Functor Cᵒᵖ D)

CategoryTheory.Presheaf.IsSheaf (CategoryTheory.Coverage.toGrothendieck C K) P ↔
  ∀ ⦃X : C⦄,
    ∀ R ∈ K.covering X,
      Nonempty (CategoryTheory.Limits.IsLimit (P.mapCone (CategoryTheory.Sieve.generate R).arrows.cocone.op))


lemma indicator_nonpos_le_indicator (s : Set α) (f : α → M) :
    {a | f a ≤ 0}.indicator f ≤ s.indicator f

{α : Type u_2}
{M : Type u_4}
[Zero M]
[LinearOrder M]
(s : Set α)
(f : α → M)


@[simp, norm_cast]
protected theorem coe_natCast (n : ℕ) : ((↑n : { x : α // 0 ≤ x }) : α) = n

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


/-- If `g` maps a second argument of 0 to 1, then multiplying it over the
result of `onFinset` is the same as multiplying it over the original `Finset`. -/
@[to_additive
      "If `g` maps a second argument of 0 to 0, summing it over the
      result of `onFinset` is the same as summing it over the original `Finset`."]
theorem onFinset_prod {s : Finset α} {f : α → M} {g : α → M → N} (hf : ∀ a, f a ≠ 0 → a ∈ s)
    (hg : ∀ a, g a 0 = 1) : (onFinset s f hf).prod g = ∏ a ∈ s, g a (f a)

{α : Type u_1}
{M : Type u_8}
{N : Type u_10}
[Zero M]
[CommMonoid N]
{s : Finset α}
{f : α → M}
{g : α → M → N}
(hf : ∀ (a : α), f a ≠ 0 → a ∈ s)
(hg : ∀ (a : α), g a 0 = 1)

(Finsupp.onFinset s f hf).prod g = ∏ a ∈ s, g a (f a)


@[to_additive (attr := simp)]
theorem map_prod [CommMonoid β] [CommMonoid γ] {G : Type*} [FunLike G β γ] [MonoidHomClass G β γ]
    (g : G) (f : α → β) (s : Finset α) : g (∏ x ∈ s, f x) = ∏ x ∈ s, g (f x)

{α : Type u_3}
{β : Type u_4}
{γ : Type u_5}
[CommMonoid β]
[CommMonoid γ]
{G : Type u_6}
[FunLike G β γ]
[MonoidHomClass G β γ]
(g : G)
(f : α → β)
(s : Finset α)


/-- Let `F` and `G` be sheaves valued in a concrete category, whose forgetful functor reflects
isomorphisms, preserves limits and filtered colimits. Then if the stalk maps of a morphism
`f : F ⟶ G` are all isomorphisms, `f` must be an isomorphism.
-/
theorem isIso_of_stalkFunctor_map_iso {F G : Sheaf C X} (f : F ⟶ G)
    [∀ x : X, IsIso ((stalkFunctor C x).map f.1)] : IsIso f

[∀ (x : ↑X), CategoryTheory.IsIso ((TopCat.Presheaf.stalkFunctor C x).map f.val)]


theorem abs_diff_coe_le_dist : ‖f x - g x‖ ≤ dist f g

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[SeminormedAddCommGroup β]
(f g : BoundedContinuousFunction α β)
{x : α}


theorem Prime.two_le : ∀ {p : ℕ}, Prime p → 2 ≤ p


@[simp]
theorem Quotient.mk_algebraMap (I : Ideal A) (x : R₁) :
    Quotient.mk I (algebraMap R₁ A x) = algebraMap R₁ (A ⧸ I) x

(R₁ : Type u_1)
{A : Type u_3}
[CommSemiring R₁]
[CommRing A]
[Algebra R₁ A]
(I : Ideal A)
(x : R₁)

(Ideal.Quotient.mk I) ((algebraMap R₁ A) x) = (algebraMap R₁ (A ⧸ I)) x


theorem Nodup.perm_iff_eq_of_sublist {l₁ l₂ l : List α} (d : Nodup l)
    (s₁ : l₁ <+ l) (s₂ : l₂ <+ l) : l₁ ~ l₂ ↔ l₁ = l₂

{α : Type u_1}
{l₁ l₂ l : List α}
(d : l.Nodup)
(s₁ : l₁ <+ l)
(s₂ : l₂ <+ l)


lemma bot_isUniform (hε : 0 < ε) : (⊥ : Finpartition A).IsUniform G ε

{α : Type u_1}
{𝕜 : Type u_2}
[LinearOrderedField 𝕜]
[DecidableEq α]
{A : Finset α}
(G : SimpleGraph α)
[DecidableRel G.Adj]
{ε : 𝕜}
(hε : 0 < ε)


/-- The bijection `(Z ⟶ X) ≃ (Z ⟶ Y)` induced by `α : X ≅ Y`. -/
@[simps]
def homToEquiv (α : X ≅ Y) {Z : C} : (Z ⟶ X) ≃ (Z ⟶ Y)

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

α.homToEquiv.symm g = CategoryTheory.CategoryStruct.comp g α.inv


theorem IsCoatom.sup_eq_top_of_ne [SemilatticeSup α] [OrderTop α] {a b : α} (ha : IsCoatom a)
    (hb : IsCoatom b) (hab : a ≠ b) : a ⊔ b = ⊤

{α : Type u_2}
[SemilatticeSup α]
[OrderTop α]
{a b : α}
(ha : IsCoatom a)
(hb : IsCoatom b)
(hab : a ≠ b)


@[simp]
theorem integralSum_disjUnion (f : ℝⁿ → E) (vol : ι →ᵇᵃ E →L[ℝ] F) {π₁ π₂ : TaggedPrepartition I}
    (h : Disjoint π₁.iUnion π₂.iUnion) :
    integralSum f vol (π₁.disjUnion π₂ h) = integralSum f vol π₁ + integralSum f vol π₂

{π₁ π₂ : BoxIntegral.TaggedPrepartition I}

BoxIntegral.integralSum f vol (π₁.disjUnion π₂ h) = BoxIntegral.integralSum f vol π₁ + BoxIntegral.integralSum f vol π₂


theorem map_le_of_mem_box (hx : x ∈ box n d) :
    map (2 * d - 1) x ≤ ∑ i : Fin n, (d - 1) * (2 * d - 1) ^ (i : ℕ)

{n d : ℕ}
{x : Fin n → ℕ}
(hx : x ∈ Behrend.box n d)

(Behrend.map (2 * d - 1)) x ≤ ∑ i : Fin n, (d - 1) * (2 * d - 1) ^ ↑i


@[simp]
theorem inl_left_mul_inr_right (x : N ⋊[φ] G) : inl x.left * inr x.right = x

{N : Type u_1}
{G : Type u_2}
[Group N]
[Group G]
{φ : G →* MulAut N}
(x : N ⋊[φ] G)

SemidirectProduct.inl x.left * SemidirectProduct.inr x.right = x


@[reassoc (attr := simp), elementwise]
theorem prodIsoProd_inv_snd (X Y : TopCat.{u}) :
    (prodIsoProd X Y).inv ≫ Limits.prod.snd = prodSnd

(X.prodIsoProd Y).inv ≫ CategoryTheory.Limits.prod.snd = TopCat.prodSnd


@[simp]
theorem id_toFunctor : (id M).toFunctor = 𝟭 _

(MonoidHom.id M).toFunctor = 𝟭 (CategoryTheory.SingleObj M)


theorem IsStronglyCoatomic.of_wellFounded_gt (h : WellFounded ((· > ·) : α → α → Prop)) :
    IsStronglyCoatomic α

{α : Type u_2}
[PartialOrder α]
(h : WellFounded fun x x_1 => x > x_1)


lemma isNonZero_iff_ne_zero [Nontrivial (weightSpace M (0 : L → R))] {χ : Weight R L M} :
    χ.IsNonZero ↔ χ ≠ 0

[Nontrivial ↥↑(LieModule.weightSpace M 0)]


@[simp]
theorem lift_reindex_symm
    (e : ι ≃ ι₂) (φ : MultilinearMap R s E) (x : ⨂[R] i, s (e.symm i)) :
    lift φ (reindex R s e |>.symm x) = lift (domDomCongrLinearEquiv' R R s _ e φ) x

(e : ι ≃ ι₂)

(x : PiTensorProduct R fun i => s (e.symm i))

(PiTensorProduct.lift φ) ((PiTensorProduct.reindex R s e).symm x) =
  (PiTensorProduct.lift ((MultilinearMap.domDomCongrLinearEquiv' R R s E e) φ)) x


protected theorem smoothAt {x} : SmoothAt I 𝓘(ℝ) f x

{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[FiniteDimensional ℝ E]
{H : Type uH}
[TopologicalSpace H]
{I : ModelWithCorners ℝ E H}
{M : Type uM}
[TopologicalSpace M]
[ChartedSpace H M]
{c : M}
(f : SmoothBumpFunction I c)
[T2Space M]
[SmoothManifoldWithCorners I M]
{x : M}


/-- A function `f : α × β → StieltjesFunction` is called a conditional kernel CDF of `κ` with
respect to `ν` if it is measurable, tends to to 0 at -∞ and to 1 at +∞ for all `p : α × β`,
`fun b ↦ f (a, b) x` is `(ν a)`-integrable for all `a : α` and `x : ℝ` and for all
measurable sets `s : Set β`, `∫ b in s, f (a, b) x ∂(ν a) = (κ a (s ×ˢ Iic x)).toReal`. -/
structure IsCondKernelCDF (f : α × β → StieltjesFunction) (κ : Kernel α (β × ℝ)) (ν : Kernel α β) :
    Prop :=
  measurable (x : ℝ) : Measurable fun p ↦ f p x
  integrable (a : α) (x : ℝ) : Integrable (fun b ↦ f (a, b) x) (ν a)
  tendsto_atTop_one (p : α × β) : Tendsto (f p) atTop (𝓝 1)
  tendsto_atBot_zero (p : α × β) : Tendsto (f p) atBot (𝓝 0)
  setIntegral (a : α) {s : Set β} (_hs : MeasurableSet s) (x : ℝ) :
    ∫ b in s, f (a, b) x ∂(ν a) = (κ a (s ×ˢ Iic x)).toReal

{κ : ProbabilityTheory.Kernel α (β × ℝ)}

(self : ProbabilityTheory.IsCondKernelCDF f κ ν)

Filter.Tendsto (↑(f p)) Filter.atTop (𝓝 1)


theorem add_eq (p₁ p₂ : Pos) : p₁ + p₂ = ⟨p₁.byteIdx + p₂.byteIdx⟩

p₁ + p₂ = { byteIdx := p₁.byteIdx + p₂.byteIdx }


@[simp]
theorem zero_eq_inv {a : G₀} : 0 = a⁻¹ ↔ 0 = a

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


protected theorem le_min {m : WithTop α} {s : Finset α} (st : ∀ a : α, a ∈ s → m ≤ a) : m ≤ s.min

{α : Type u_2}
[LinearOrder α]
{m : WithTop α}
{s : Finset α}
(st : ∀ a ∈ s, m ≤ ↑a)


protected theorem finset_sups {p : SeminormFamily 𝕜 E ι} [TopologicalSpace E]
    (hp : WithSeminorms p) : WithSeminorms (fun s : Finset ι ↦ s.sup p)

{𝕜 : Type u_1}
{E : Type u_5}
{ι : Type u_8}
[Nonempty ι]
[NormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{p : SeminormFamily 𝕜 E ι}
[TopologicalSpace E]
(hp : WithSeminorms p)


@[simp]
theorem trace_eq_contract_apply (x : Module.Dual R M ⊗[R] M) :
    (LinearMap.trace R M) ((dualTensorHom R M M) x) = contractLeft R M x

(x : TensorProduct R (Module.Dual R M) M)

(LinearMap.trace R M) ((dualTensorHom R M M) x) = (contractLeft R M) x


theorem map_lt_map_iff (f : F) {a b : α} : f a < f b ↔ a < b

{F : Type u_1}
{α : Type u_2}
{β : Type u_3}
[Preorder α]
[Preorder β]
[EquivLike F α β]
[OrderIsoClass F α β]
(f : F)
{a b : α}


/-- `Equiv.piCongrLeft` as a uniform isomorphism: this is the natural isomorphism
`Π i, β (e i) ≃ᵤ Π j, β j` obtained from a bijection `ι ≃ ι'`. -/
@[simps! apply toEquiv]
def piCongrLeft {ι ι' : Type*} {β : ι' → Type*} [∀ j, UniformSpace (β j)]
    (e : ι ≃ ι') : (∀ i, β (e i)) ≃ᵤ ∀ j, β j

{ι : Type u_4}
{ι' : Type u_5}
{β : ι' → Type u_6}
[(j : ι') → UniformSpace (β j)]
(e : ι ≃ ι')

∀ (a : (b : ι) → β (e.symm.symm b)) (a_1 : ι'),
  (UniformEquiv.piCongrLeft e) a a_1 = (Equiv.piCongrLeft' β e.symm).symm a a_1


@[to_additive (attr := simp)]
lemma stabilizer_op_subgroup (s : Subgroup G) : stabilizer Gᵐᵒᵖ (s : Set G) = s.op

{G : Type u_1}
[Group G]
(s : Subgroup G)


@[continuity]
theorem continuous_imK : Continuous fun q : ℍ => q.imK


@[reassoc (attr := simp)]
lemma lift_commutes_zero {Y Z : C} (f : Y ⟶ Z)
    (P : ProjectiveResolution Y) (Q : ProjectiveResolution Z) :
    (lift f P Q).f 0 ≫ Q.π.f 0 = P.π.f 0 ≫ f

(P : CategoryTheory.ProjectiveResolution Y)

(Q : CategoryTheory.ProjectiveResolution Z)

CategoryTheory.CategoryStruct.comp ((CategoryTheory.ProjectiveResolution.lift f P Q).f 0) (Q.π.f 0) =
  CategoryTheory.CategoryStruct.comp (P.π.f 0) f


@[to_additive]
theorem smul_ae_eq_self_of_mem_zpowers (hs : (x • s : Set α) =ᵐ[μ] s)
    (hy : y ∈ Subgroup.zpowers x) : (y • s : Set α) =ᵐ[μ] s

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

∀ {x : MeasurableSpace α} {μ : MeasureTheory.Measure α} [inst : MeasureTheory.VAddInvariantMeasure G α μ] {x_1 y : G}
  {s : Set α}, x_1 +ᵥ s =ᵐ[μ] s → y ∈ AddSubgroup.zmultiples x_1 → y +ᵥ s =ᵐ[μ] s


lemma AntivaryOn.pow_right₀ (hg : ∀ i ∈ s, 0 ≤ g i) (hfg : AntivaryOn f g s) (n : ℕ) :
    AntivaryOn f (g ^ n) s

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[LinearOrderedSemiring α]
[LinearOrderedSemiring β]
{s : Set ι}
{f : ι → α}
{g : ι → β}
(hg : ∀ i ∈ s, 0 ≤ g i)
(hfg : AntivaryOn f g s)
(n : ℕ)


@[simp] theorem coe_lt_top : (r : ℝ≥0∞) < ∞


@[simp] theorem getMsb_ofBoolListBE : (ofBoolListBE bs).getMsb i = bs.getD i false

(BitVec.ofBoolListBE bs).getMsb i = bs.getD i false


/-- A limit cone for `X : Discrete α ⥤ C` that is given
by `∏ᶜ (fun j => X.obj (Discrete.mk j))`. -/
@[simps]
def Pi.cone : Cone X

[CategoryTheory.Limits.HasProduct fun j => X.obj { as := j }]

(CategoryTheory.Limits.Pi.cone X).pt = ∏ᶜ fun j => X.obj { as := j }


theorem smeval_mul_X : (p * X).smeval x = p.smeval x * x

(R : Type u_1)
[Semiring R]
(p : Polynomial R)
{S : Type u_2}
[NonAssocSemiring S]
[Module R S]
[IsScalarTower R S S]
[Pow S ℕ]
[NatPowAssoc S]
(x : S)

(p * Polynomial.X).smeval x = p.smeval x * x


@[to_additive]
theorem lt_def : p < q ↔ (p : E → ℝ) < q

{E : Type u_4}
[AddGroup E]
{p q : AddGroupNorm E}


theorem exists_zigzag' [IsConnected J] (j₁ j₂ : J) :
    ∃ l, List.Chain Zag j₁ l ∧ List.getLast (j₁ :: l) (List.cons_ne_nil _ _) = j₂

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
[CategoryTheory.IsConnected J]
(j₁ j₂ : J)

∃ l, List.Chain CategoryTheory.Zag j₁ l ∧ (j₁ :: l).getLast ⋯ = j₂


theorem Algebra.IsSeparable.of_algHom (E' : Type*) [Field E'] [Algebra F E'] (f : E →ₐ[F] E')
    [Algebra.IsSeparable F E'] : Algebra.IsSeparable F E

(F : Type u_1)
{E : Type u_3}
[Field F]
[Field E]
[Algebra F E]
(E' : Type u_4)
[Field E']
[Algebra F E']
(f : E →ₐ[F] E')
[Algebra.IsSeparable F E']


@[reassoc]
lemma InjectiveResolution.isoRightDerivedToHomotopyCategoryObj_inv_naturality
    {X Y : C} (f : X ⟶ Y) (I : InjectiveResolution X) (J : InjectiveResolution Y)
    (φ : I.cocomplex ⟶ J.cocomplex) (comm : I.ι.f 0 ≫ φ.f 0 = f ≫ J.ι.f 0)
    (F : C ⥤ D) [F.Additive] :
    (I.isoRightDerivedToHomotopyCategoryObj F).inv ≫ F.rightDerivedToHomotopyCategory.map f =
      (F.mapHomologicalComplex _ ⋙ HomotopyCategory.quotient _ _).map φ ≫
        (J.isoRightDerivedToHomotopyCategoryObj F).inv

(I : CategoryTheory.InjectiveResolution X)

(J : CategoryTheory.InjectiveResolution Y)

(comm : CategoryTheory.CategoryStruct.comp (I.ι.f 0) (φ.f 0) = CategoryTheory.CategoryStruct.comp f (J.ι.f 0))

CategoryTheory.CategoryStruct.comp (I.isoRightDerivedToHomotopyCategoryObj F).inv
    (F.rightDerivedToHomotopyCategory.map f) =
  CategoryTheory.CategoryStruct.comp
    (((F.mapHomologicalComplex (ComplexShape.up ℕ)).comp (HomotopyCategory.quotient D (ComplexShape.up ℕ))).map φ)
    (J.isoRightDerivedToHomotopyCategoryObj F).inv


@[to_additive (attr := simp)]
theorem inv_mul_cancel_right (a : α) (b : αˣ) : a * ↑b⁻¹ * b = a

{α : Type u}
[Monoid α]
(a : α)
(b : αˣ)


theorem mem_bot {x : R} : x ∈ (⊥ : Subsemiring R) ↔ ∃ n : ℕ, ↑n = x

{R : Type u}
[NonAssocSemiring R]
{x : R}


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

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


/-- An `M : IndepMatroid α` gives a `Matroid α` whose bases are the maximal `M`-independent sets. -/
@[simps] protected def matroid (M : IndepMatroid α) : Matroid α

∀ (a : Set α), M.matroid.Indep a = M.Indep a


theorem divisors_filter_squarefree {n : ℕ} (h0 : n ≠ 0) :
    (n.divisors.filter Squarefree).val =
      (UniqueFactorizationMonoid.normalizedFactors n).toFinset.powerset.val.map fun x =>
        x.val.prod

(Finset.filter Squarefree n.divisors).val =
  Multiset.map (fun x => x.val.prod) (UniqueFactorizationMonoid.normalizedFactors n).toFinset.powerset.val


theorem charpoly_coeff_eq_prod_coeff_of_le {k : ℕ} (h : Fintype.card n - 1 ≤ k) :
    M.charpoly.coeff k = (∏ i : n, (X - C (M i i))).coeff k

{R : Type u}
[CommRing R]
{n : Type v}
[DecidableEq n]
[Fintype n]
(M : Matrix n n R)
{k : ℕ}
(h : Fintype.card n - 1 ≤ k)

M.charpoly.coeff k = (∏ i : n, (Polynomial.X - Polynomial.C (M i i))).coeff k


@[simp, norm_cast]
theorem coe_mul : ((φ * ψ : R[X]) : PowerSeries R) = φ * ψ

{R : Type u_2}
[CommSemiring R]
(φ ψ : Polynomial R)

↑(φ * ψ) = ↑φ * ↑ψ


theorem symm_coordChangeL (e e' : Trivialization F (π F E)) [e.IsLinear R] [e'.IsLinear R] {b : B}
    (hb : b ∈ e'.baseSet ∩ e.baseSet) : (e.coordChangeL R e' b).symm = e'.coordChangeL R e b

[TopologicalSpace (Bundle.TotalSpace F E)]

(e e' : Trivialization F Bundle.TotalSpace.proj)

(Trivialization.coordChangeL R e e' b).symm = Trivialization.coordChangeL R e' e b


@[reassoc (attr := simp)]
theorem inr_isoPushout_inv (h : IsPushout f g inl inr) [HasPushout f g] :
    pushout.inr _ _ ≫ h.isoPushout.inv = inr

(h : CategoryTheory.IsPushout f g inl inr)

CategoryTheory.Limits.pushout.inr f g ≫ h.isoPushout.inv = inr


@[simp]
theorem add_right_iff : μ ⟂ₘ ν₁ + ν₂ ↔ μ ⟂ₘ ν₁ ∧ μ ⟂ₘ ν₂

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ ν₁ ν₂ : MeasureTheory.Measure α}

μ ⟂ₘ ν₁ + ν₂ ↔ μ ⟂ₘ ν₁ ∧ μ ⟂ₘ ν₂


theorem IsIntegral.mem_range_algebraMap_of_minpoly_splits [Algebra K L] [IsScalarTower R K L] :
    x ∈ (algebraMap K L).range

(h : Polynomial.Splits (algebraMap R K) (minpoly R x))


/-- The right unitor isomorphism for binary coproducts with the initial object. -/
@[simps]
def coprod.rightUnitor (P : C) : P ⨿ ⊥_ C ≅ P

(CategoryTheory.Limits.coprod.rightUnitor P).inv = CategoryTheory.Limits.coprod.inl


theorem aemeasurable_smul_const {f : α → 𝕜} {μ : Measure α} {c : E} (hc : c ≠ 0) :
    AEMeasurable (fun x => f x • c) μ ↔ AEMeasurable f μ

{α : Type u_1}
[MeasurableSpace α]
{𝕜 : Type u_2}
[NontriviallyNormedField 𝕜]
[CompleteSpace 𝕜]
[MeasurableSpace 𝕜]
[BorelSpace 𝕜]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[MeasurableSpace E]
[BorelSpace E]
{f : α → 𝕜}
{μ : MeasureTheory.Measure α}
{c : E}
(hc : c ≠ 0)


protected theorem CompactT2.Projective.extremallyDisconnected [CompactSpace X] [T2Space X]
    (h : CompactT2.Projective X) : ExtremallyDisconnected X

{X : Type u}
[TopologicalSpace X]
[CompactSpace X]
[T2Space X]
(h : CompactT2.Projective X)


@[simp]
theorem torsionBySet_torsionBySet_eq_top : torsionBySet R (torsionBySet R M s) s = ⊤

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

Submodule.torsionBySet R (↥(Submodule.torsionBySet R M s)) s = ⊤


theorem exists_cycleOn (s : Finset α) :
    ∃ f : Perm α, f.IsCycleOn s ∧ f.support ⊆ s

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


theorem self_distrib_inv {x y z : R} : x ◃⁻¹ y ◃⁻¹ z = (x ◃⁻¹ y) ◃⁻¹ x ◃⁻¹ z

x ◃⁻¹ y ◃⁻¹ z = (x ◃⁻¹ y) ◃⁻¹ x ◃⁻¹ z


theorem Univ.isSubfield : IsSubfield (@Set.univ F)


theorem Algebra.isIntegral_sup {S T : Subalgebra R A} :
    Algebra.IsIntegral R (S ⊔ T : Subalgebra R A) ↔
      Algebra.IsIntegral R S ∧ Algebra.IsIntegral R T

{R : Type u_1}
{A : Type u_2}
[CommRing R]
[CommRing A]
[Algebra R A]
{S T : Subalgebra R A}

Algebra.IsIntegral R ↥(S ⊔ T) ↔ Algebra.IsIntegral R ↥S ∧ Algebra.IsIntegral R ↥T


theorem s_as_blocks : S l R = Matrix.fromBlocks 1 0 0 (-1)

(l : Type u_4)
(R : Type u₂)
[DecidableEq l]
[CommRing R]

LieAlgebra.Orthogonal.S l R = Matrix.fromBlocks 1 0 0 (-1)


/-- The triangle in `CochainComplex C ℤ` attached to a degreewise split short exact sequence
of cochain complexes. -/
@[simps! obj₁ obj₂ obj₃ mor₁ mor₂ mor₃]
def triangleOfDegreewiseSplit : Triangle (CochainComplex C ℤ)

(S : CategoryTheory.ShortComplex (CochainComplex C ℤ))

(σ : (n : ℤ) → (S.map (HomologicalComplex.eval C (ComplexShape.up ℤ) n)).Splitting)

(CochainComplex.triangleOfDegreewiseSplit S σ).obj₂ = S.X₂


lemma conj_pow' (u : Mˣ) (x : M) (n : ℕ) :
    ((↑u⁻¹ : M) * x * (u : M)) ^ n = (↑u⁻¹ : M) * x ^ n * (u : M)

{M : Type u_1}
[Monoid M]
(u : Mˣ)
(x : M)
(n : ℕ)


/-- The identity functor on `C`, viewed as a functor from `C` to its
monoidal opposite, upgraded to a braided functor. -/
@[simps!] def mopBraidedFunctor : BraidedFunctor C Cᴹᵒᵖ

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

((CategoryTheory.MonoidalOpposite.mopBraidedFunctor C).μ X Y).unmop = (β_ Y X).hom


theorem Associated.isUnit_iff [Monoid α] {a b : α} (h : a ~ᵤ b) : IsUnit a ↔ IsUnit b

{α : Type u_1}
[Monoid α]
{a b : α}
(h : a ~ᵤ b)


theorem minimum?_cons [Min α] {xs : List α} : (x :: xs).minimum? = foldl min x xs

{α : Type u_1}
{x : α}
[Min α]
{xs : List α}

(x :: xs).minimum? = some (List.foldl min x xs)


theorem natCast_mul (n : ℕ) (p : R[X]) : (n : R[X]) * p = n • p

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


theorem source_inter_preimage_inv_preimage (s : Set α) :
    e.source ∩ e ⁻¹' (e.symm ⁻¹' s) = e.source ∩ s

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

e.source ∩ ↑e ⁻¹' (↑e.symm ⁻¹' s) = e.source ∩ s


theorem toLp_neg {f : α → E} (hf : Memℒp f p μ) : hf.neg.toLp (-f) = -hf.toLp f

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup E]
{f : α → E}
(hf : MeasureTheory.Memℒp f p μ)

MeasureTheory.Memℒp.toLp (-f) ⋯ = -MeasureTheory.Memℒp.toLp f hf


theorem nonempty_of_nonempty_type (x : PSet) [h : Nonempty x.Type] : PSet.Nonempty x


/-- If two ring homomorphisms from `⨁ i, A i` are equal on each `of A i y`,
then they are equal.

See note [partially-applied ext lemmas]. -/
@[ext]
theorem ringHom_ext' ⦃F G : (⨁ i, A i) →+* R⦄
    (h : ∀ i, (↑F : _ →+ R).comp (of A i) = (↑G : _ →+ R).comp (of A i)) : F = G

⦃F G : (DirectSum ι fun i => A i) →+* R⦄

(h : ∀ (i : ι), (↑F).comp (DirectSum.of A i) = (↑G).comp (DirectSum.of A i))


@[to_additive]
theorem right_dom_of_div_dom [Div α] {a b : Part α} (hab : Dom (a / b)) : b.Dom

{α : Type u_1}
[Sub α]
{a b : Part α}
(hab : (a - b).Dom)


theorem map_iInf_comap_of_surjective (K : ι → Ideal S) : (⨅ i, (K i).comap f).map f = iInf K

{R : Type u}
{S : Type v}
{F : Type u_1}
[Semiring R]
[Semiring S]
[FunLike F R S]
[rc : RingHomClass F R S]
(f : F)
{ι : Sort u_3}
(hf : Function.Surjective ⇑f)
(K : ι → Ideal S)

Ideal.map f (⨅ i, Ideal.comap f (K i)) = iInf K


/-- A generalization of the theorem that if `N` is a submodule of `M` and
  `N` and `M / N` are both Noetherian, then `M` is Noetherian.  -/
theorem wellFounded_gt_exact_sequence {β γ : Type*} [Preorder β] [PartialOrder γ]
    (h₁ : WellFounded ((· > ·) : β → β → Prop)) (h₂ : WellFounded ((· > ·) : γ → γ → Prop)) (K : α)
    (f₁ : β → α) (f₂ : α → β) (g₁ : γ → α) (g₂ : α → γ) (gci : GaloisCoinsertion f₁ f₂)
    (gi : GaloisInsertion g₂ g₁) (hf : ∀ a, f₁ (f₂ a) = a ⊓ K) (hg : ∀ a, g₁ (g₂ a) = a ⊔ K) :
    WellFounded ((· > ·) : α → α → Prop)

{α : Type u_1}
[Lattice α]
[IsModularLattice α]
{β : Type u_2}
{γ : Type u_3}
[Preorder β]
[PartialOrder γ]
(h₁ : WellFounded fun x x_1 => x > x_1)
(h₂ : WellFounded fun x x_1 => x > x_1)
(K : α)
(f₁ : β → α)
(f₂ : α → β)
(g₁ : γ → α)
(g₂ : α → γ)
(gci : GaloisCoinsertion f₁ f₂)
(gi : GaloisInsertion g₂ g₁)
(hf : ∀ (a : α), f₁ (f₂ a) = a ⊓ K)
(hg : ∀ (a : α), g₁ (g₂ a) = a ⊔ K)


theorem imp_not_comm : (a → ¬b) ↔ (b → ¬a)

a → ¬b ↔ b → ¬a


/-- The separable closure of `F` in `E` is equal to `E` if and only if `E / F` is
separable. -/
theorem separableClosure.eq_top_iff : separableClosure F E = ⊤ ↔ Algebra.IsSeparable F E

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


private lemma filter_collapse_eq (ha : a ∉ s) (𝒜 : Finset (Finset α)) :
    (𝒜.filter fun t ↦ t.erase a = s) =
      if s ∈ 𝒜 then
        (if insert a s ∈ 𝒜 then {s, insert a s} else {s})
      else
        (if insert a s ∈ 𝒜 then {insert a s} else ∅)

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

Finset.filter (fun t => t.erase a = s) 𝒜 =
  if s ∈ 𝒜 then if insert a s ∈ 𝒜 then {s, insert a s} else {s} else if insert a s ∈ 𝒜 then {insert a s} else ∅


@[simp, nolint simpNF]
lemma mkOfSMul_smul (r : R) : (mkOfSMul φ).smul r = φ r

{R : Type u}
[Ring R]
{A : AddCommGrp}
(φ : R →+* CategoryTheory.End A)
(r : R)


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

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

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


@[simp]
theorem pushout.congrHom_inv {X Y Z : C} {f₁ f₂ : X ⟶ Y} {g₁ g₂ : X ⟶ Z} (h₁ : f₁ = f₂)
    (h₂ : g₁ = g₂) [HasPushout f₁ g₁] [HasPushout f₂ g₂] :
    (pushout.congrHom h₁ h₂).inv =
      pushout.map _ _ _ _ (𝟙 _) (𝟙 _) (𝟙 _) (by simp [h₁]) (by simp [h₂])

(CategoryTheory.Limits.pushout.congrHom h₁ h₂).inv = CategoryTheory.Limits.pushout.map f₂ g₂ f₁ g₁ (𝟙 Y) (𝟙 Z) (𝟙 X) ⋯ ⋯


lemma XClass_ne_zero [Nontrivial R] (x : R) : XClass W x ≠ 0

{R : Type u}
[CommRing R]
(W : WeierstrassCurve.Affine R)
[Nontrivial R]
(x : R)

WeierstrassCurve.Affine.CoordinateRing.XClass W x ≠ 0


/-- If a function is the greatest lower bound of countably many measurable functions,
then it is measurable. -/
theorem Measurable.isGLB {ι} [Countable ι] {f : ι → δ → α} {g : δ → α} (hf : ∀ i, Measurable (f i))
    (hg : ∀ b, IsGLB { a | ∃ i, f i b = a } (g b)) : Measurable g

{f : ι → δ → α}

(hg : ∀ (b : δ), IsGLB {a | ∃ i, f i b = a} (g b))


theorem isFiniteMeasure_of_le (μ : Measure α) [IsFiniteMeasure μ] (h : ν ≤ μ) : IsFiniteMeasure ν

{α : Type u_1}
{m0 : MeasurableSpace α}
{ν : MeasureTheory.Measure α}
(μ : MeasureTheory.Measure α)
[MeasureTheory.IsFiniteMeasure μ]
(h : ν ≤ μ)


/-- Given an indexed family `f : ι → E` of vectors in an inner product space `E`, for which the
size of the index set is the dimension of `E`, the matrix of coefficients of `f` with respect to the
orthonormal basis `gramSchmidtOrthonormalBasis` constructed from `f` is upper-triangular. -/
theorem gramSchmidtOrthonormalBasis_inv_blockTriangular :
    ((gramSchmidtOrthonormalBasis h f).toBasis.toMatrix f).BlockTriangular id

(h : FiniteDimensional.finrank 𝕜 E = Fintype.card ι)


@[to_additive] lemma mabs_eq_mabs : |a|ₘ = |b|ₘ ↔ a = b ∨ a = b⁻¹

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


theorem mfderiv_comp_of_eq {x : M} {y : M'} (hg : MDifferentiableAt I' I'' g y)
    (hf : MDifferentiableAt I I' f x) (hy : f x = y) :
    mfderiv I I'' (g ∘ f) x = (mfderiv I' I'' g (f x)).comp (mfderiv I I' f x)

[I''s : SmoothManifoldWithCorners I'' M'']


protected theorem coe_sub {R : Type u} {A : Type v} [CommRing R] [NonUnitalRing A] [Module R A]
    [Star A] {S : NonUnitalStarSubalgebra R A} (x y : S) : (↑(x - y) : A) = ↑x - ↑y

{R : Type u}
{A : Type v}
[CommRing R]
[NonUnitalRing A]
[Module R A]
[Star A]
{S : NonUnitalStarSubalgebra R A}
(x y : ↥S)


/-- On non-dependent functions, `Pi.mulSingle` can be expressed as an `ite` -/
@[to_additive "On non-dependent functions, `Pi.single` can be expressed as an `ite`"]
theorem mulSingle_apply [One β] (i : I) (x : β) (i' : I) :
    (mulSingle i x : I → β) i' = if i' = i then x else 1

{I : Type u}
{β : Type u_2}
[DecidableEq I]
[Zero β]
(i : I)
(x : β)
(i' : I)

Pi.single i x i' = if i' = i then x else 0


@[simp]
theorem refl_symm [Module R M] : (refl R M).symm = LinearEquiv.refl R M

{R : Type u_1}
{M : Type u_8}
[Semiring R]
[AddCommMonoid M]
[Module R M]

(LinearEquiv.refl R M).symm = LinearEquiv.refl R M


@[to_additive (attr := simp)]
theorem coe_subgroupMap_apply (e : G ≃* G') (H : Subgroup G) (g : H) :
    ((subgroupMap e H g : H.map (e : G →* G')) : G') = e g

{G : Type u_1}
{G' : Type u_2}
[AddGroup G]
[AddGroup G']
(e : G ≃+ G')
(H : AddSubgroup G)
(g : ↥H)


/-- The cartesian product of two continuous alternating maps, as a continuous alternating map. -/
@[simps!]
def prod (f : M [⋀^ι]→L[R] N) (g : M [⋀^ι]→L[R] N') : M [⋀^ι]→L[R] (N × N')

{R : Type u_1}
{M : Type u_2}
{N : Type u_4}
{N' : Type u_5}
{ι : Type u_6}
[Semiring R]
[AddCommMonoid M]
[Module R M]
[TopologicalSpace M]
[AddCommMonoid N]
[Module R N]
[TopologicalSpace N]
[AddCommMonoid N']
[Module R N']
[TopologicalSpace N']
(f : M [⋀^ι]→L[R] N)
(g : M [⋀^ι]→L[R] N')
(m : (i : ι) → (fun x => M) i)


@[simp]
theorem explicitCokernelπ_apply_dom_eq_zero {X Y : SemiNormedGrp.{u}} {f : X ⟶ Y} (x : X) :
    (explicitCokernelπ f) (f x) = 0

{X Y : SemiNormedGrp}
{f : X ⟶ Y}
(x : ↑X)

(SemiNormedGrp.explicitCokernelπ f) (f x) = 0


@[to_additive]
theorem closure_preimage_eq_top (s : Set G) : closure ((closure s).subtype ⁻¹' s) = ⊤

AddSubgroup.closure (⇑(AddSubgroup.closure s).subtype ⁻¹' s) = ⊤


theorem and_iff_right (ha : a) : a ∧ b ↔ b


theorem wellFounded_of_isArtinian [IsArtinian R M] :
    WellFounded ((· < ·) : LieSubmodule R L M → LieSubmodule R L M → Prop)

(R : Type u)
(L : Type v)
(M : Type w)
[CommRing R]
[LieRing L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[IsArtinian R M]


/-- We say a measurable space is countably generated
if it can be generated by a countable set of sets. -/
class CountablyGenerated (α : Type*) [m : MeasurableSpace α] : Prop where
  isCountablyGenerated : ∃ b : Set (Set α), b.Countable ∧ m = generateFrom b

[self : MeasurableSpace.CountablyGenerated α]

∃ b, b.Countable ∧ m = MeasurableSpace.generateFrom b


theorem map_involutive {p : α → Prop} {f : α → α} (h : ∀ a, p a → p (f a))
    (hf : Involutive f) : Involutive (map f h)

{α : Sort u_1}
{p : α → Prop}
{f : α → α}
(h : ∀ (a : α), p a → p (f a))
(hf : Function.Involutive f)


@[to_additive]
theorem HasProd.one_le (h : ∀ i, 1 ≤ g i) (ha : HasProd g a) : 1 ≤ a

{ι : Type u_1}
{α : Type u_3}
[OrderedCommMonoid α]
[TopologicalSpace α]
[OrderClosedTopology α]
{g : ι → α}
{a : α}
(h : ∀ (i : ι), 1 ≤ g i)
(ha : HasProd g a)


lemma natDegree_eq_zero {p : R[X]} : p.natDegree = 0 ↔ ∃ x, C x = p

p.natDegree = 0 ↔ ∃ x, Polynomial.C x = p


theorem degreeLTEquiv_eq_zero_iff_eq_zero {n : ℕ} {p : R[X]} (hp : p ∈ degreeLT R n) :
    degreeLTEquiv _ _ ⟨p, hp⟩ = 0 ↔ p = 0

{R : Type u}
[Semiring R]
{n : ℕ}
{p : R[X]}
(hp : p ∈ Polynomial.degreeLT R n)

(Polynomial.degreeLTEquiv R n) ⟨p, hp⟩ = 0 ↔ p = 0


theorem Arrow.middle_spec {X : C} {S : J.Cover X} {T : ∀ I : S.Arrow, J.Cover I.Y}
    (I : (S.bind T).Arrow) : I.toMiddleHom ≫ I.fromMiddleHom = I.f

{J : CategoryTheory.GrothendieckTopology C}

CategoryTheory.CategoryStruct.comp I.toMiddleHom I.fromMiddleHom = I.f


theorem coeq₃_condition₁ {j₁ j₂ : C} (f g h : j₁ ⟶ j₂) :
    f ≫ coeq₃Hom f g h = g ≫ coeq₃Hom f g h

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.IsFilteredOrEmpty C]
{j₁ j₂ : C}
(f g h : j₁ ⟶ j₂)

CategoryTheory.CategoryStruct.comp f (CategoryTheory.IsFiltered.coeq₃Hom f g h) =
  CategoryTheory.CategoryStruct.comp g (CategoryTheory.IsFiltered.coeq₃Hom f g h)


@[simp]
theorem preimage_const_mul_Ioc_of_neg (a b : α) {c : α} (h : c < 0) :
    (c * ·) ⁻¹' Ioc a b = Ico (b / c) (a / c)

{α : Type u_1}
[LinearOrderedField α]
(a b : α)
{c : α}
(h : c < 0)

(fun x => c * x) ⁻¹' Set.Ioc a b = Set.Ico (b / c) (a / c)


lemma exists_eq_graphOn [Nonempty β] {s : Set (α × β)} :
    (∃ f t, s = graphOn f t) ↔ InjOn Prod.fst s

{α : Type u_1}
{β : Type u_2}
[Nonempty β]
{s : Set (α × β)}

(∃ f t, s = Set.graphOn f t) ↔ Set.InjOn Prod.fst s


theorem QuotientMap.sequentialSpace [SequentialSpace X] {f : X → Y} (hf : QuotientMap f) :
    SequentialSpace Y

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


@[simp]
theorem subsingleton_singleton {a} : ({a} : Set α).Subsingleton


theorem mk_mem_sigma (hi : i ∈ s) (ha : a ∈ t i) : (⟨i, a⟩ : Σ i, α i) ∈ s.sigma t

{ι : Type u_1}
{α : ι → Type u_3}
{s : Set ι}
{t : (i : ι) → Set (α i)}
{i : ι}
{a : α i}
(hi : i ∈ s)
(ha : a ∈ t i)


@[to_additive max_add_add_le_max_add_max]
theorem max_mul_mul_le_max_mul_max' : max (a * b) (c * d) ≤ max a c * max b d

[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 roots_expand : (expand R p f).roots = p • f.roots.map (frobeniusEquiv R p).symm

{R : Type u_1}
[CommRing R]
[IsDomain R]
{p : ℕ}
[ExpChar R p]
{f : R[X]}
[PerfectRing R p]

((Polynomial.expand R p) f).roots = p • Multiset.map (⇑(frobeniusEquiv R p).symm) f.roots


@[simp]
theorem sub_re (z w : ℤ√d) : (z - w).re = z.re - w.re


@[simp]
theorem single_zero_mul_eq_smul [Semiring R] {r : R} {x : HahnSeries Γ R} :
    single 0 r * x = r • x

{Γ : Type u_1}
{R : Type u_3}
[OrderedCancelAddCommMonoid Γ]
[Semiring R]
{r : R}
{x : HahnSeries Γ R}


theorem _root_.MeasureTheory.SignedMeasure.im_toComplexMeasure (s t : SignedMeasure α) :
    ComplexMeasure.im (SignedMeasure.toComplexMeasure s t) = t

{α : Type u_1}
{m : MeasurableSpace α}
(s t : MeasureTheory.SignedMeasure α)

MeasureTheory.ComplexMeasure.im (s.toComplexMeasure t) = t


lemma logDeriv_eq_zero_of_not_differentiableAt (f : 𝕜 → 𝕜') (x : 𝕜) (h : ¬DifferentiableAt 𝕜 f x) :
    logDeriv f x = 0

{𝕜 : Type u_1}
{𝕜' : Type u_2}
[NontriviallyNormedField 𝕜]
[NontriviallyNormedField 𝕜']
[NormedAlgebra 𝕜 𝕜']
(f : 𝕜 → 𝕜')
(x : 𝕜)
(h : ¬DifferentiableAt 𝕜 f x)


@[simp, norm_cast]
protected theorem coe_nonneg {x : ℝ} : (0 : EReal) ≤ x ↔ 0 ≤ x

0 ≤ ↑x ↔ 0 ≤ x


theorem one_le_convexBodyLT'Factor : 1 ≤ convexBodyLT'Factor K

(K : Type u_1)
[Field K]
[NumberField K]

1 ≤ NumberField.mixedEmbedding.convexBodyLT'Factor K


lemma P3_of_ih (hy : Numeric y) (ihyx : IH1 y x) (i k l) :
    P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l)

{x y : SetTheory.PGame}
(hy : y.Numeric)
(ihyx : Surreal.Multiplication.IH1 y x)
(i : x.LeftMoves)
(k : y.LeftMoves)
(l : (-y).LeftMoves)

Surreal.Multiplication.P3 (x.moveLeft i) x (y.moveLeft k) (-(-y).moveLeft l)


theorem continuousOn_open_iff {f : α → β} {s : Set α} (hs : IsOpen s) :
    ContinuousOn f s ↔ ∀ t, IsOpen t → IsOpen (s ∩ f ⁻¹' t)

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
{f : α → β}
{s : Set α}
(hs : IsOpen s)

ContinuousOn f s ↔ ∀ (t : Set β), IsOpen t → IsOpen (s ∩ f ⁻¹' t)


theorem natSepDegree_X_pow_char_pow_sub_C (q : ℕ) [ExpChar F q] (n : ℕ) (y : F) :
    (X ^ q ^ n - C y).natSepDegree = 1

{F : Type u}
[Field F]
(q : ℕ)
[ExpChar F q]
(n : ℕ)
(y : F)

(Polynomial.X ^ q ^ n - Polynomial.C y).natSepDegree = 1


/-- The equivalence of categories `(J → C) ≌ (Discrete J ⥤ C)`. -/
@[simps]
def piEquivalenceFunctorDiscrete (J : Type u₂) (C : Type u₁) [Category.{v₁} C] :
    (J → C) ≌ (Discrete J ⥤ C)

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

∀ {X Y : J → C} (f : X ⟶ Y),
  (CategoryTheory.piEquivalenceFunctorDiscrete J C).functor.map f = CategoryTheory.Discrete.natTrans fun j => f j.as


theorem small_of_injective {α : Type v} {β : Type w} [Small.{u} β] {f : α → β}
    (hf : Function.Injective f) : Small.{u} α

{α : Type v}
{β : Type w}
[Small.{u, w} β]
{f : α → β}
(hf : Function.Injective f)


theorem pow_mul_meas_ge_le_eLpNorm (hp_ne_zero : p ≠ 0) (hp_ne_top : p ≠ ∞)
    (hf : AEStronglyMeasurable f μ) (ε : ℝ≥0∞) :
    (ε * μ { x | ε ≤ (‖f x‖₊ : ℝ≥0∞) ^ p.toReal }) ^ (1 / p.toReal) ≤ eLpNorm f p μ

(hf : MeasureTheory.AEStronglyMeasurable f μ)

(ε * μ {x | ε ≤ ↑‖f x‖₊ ^ p.toReal}) ^ (1 / p.toReal) ≤ MeasureTheory.eLpNorm f p μ


@[simp]
lemma Hom.algebraMap_toAlgHom (f : Hom P P') (x) : MvPolynomial.aeval P'.val (f.toAlgHom x) =
    algebraMap S S' (MvPolynomial.aeval P.val x)

{R : Type u}
{S : Type v}
[CommRing R]
[CommRing S]
[Algebra R S]
{P : Algebra.Generators R S}
{R' : Type u_1}
{S' : Type u_2}
[CommRing R']
[CommRing S']
[Algebra R' S']
{P' : Algebra.Generators R' S'}
[Algebra R R']
[Algebra S S']
[Algebra R S']
[IsScalarTower R R' S']
[IsScalarTower R S S']
(f : P.Hom P')
(x : P.Ring)

(MvPolynomial.aeval P'.val) (f.toAlgHom x) = (algebraMap S S') ((MvPolynomial.aeval P.val) x)


@[to_additive (attr := simp) cmp_sub_zero]
theorem cmp_div_one' [CovariantClass α α (swap (· * ·)) (· ≤ ·)] (a b : α) :
    cmp (a / b) 1 = cmp a b


/-- The downward **local LYM inequality**, with cancelled denominators. `𝒜` takes up less of `α^(r)`
(the finsets of card `r`) than `∂𝒜` takes up of `α^(r - 1)`. -/
theorem card_mul_le_card_shadow_mul (h𝒜 : (𝒜 : Set (Finset α)).Sized r) :
    𝒜.card * r ≤ (∂ 𝒜).card * (Fintype.card α - r + 1)

{α : Type u_2}
[DecidableEq α]
[Fintype α]
{𝒜 : Finset (Finset α)}
{r : ℕ}
(h𝒜 : Set.Sized r ↑𝒜)


theorem prod.triangle [HasBinaryProducts C] (X Y : C) :
    (prod.associator X (⊤_ C) Y).hom ≫ prod.map (𝟙 X) (prod.leftUnitor Y).hom =
      prod.map (prod.rightUnitor X).hom (𝟙 Y)

(CategoryTheory.Limits.prod.associator X (⊤_ C) Y).hom ≫
    CategoryTheory.Limits.prod.map (𝟙 X) (CategoryTheory.Limits.prod.leftUnitor Y).hom =
  CategoryTheory.Limits.prod.map (CategoryTheory.Limits.prod.rightUnitor X).hom (𝟙 Y)


@[to_additive sum_le_sum]
lemma SublistForall₂.prod_le_prod' [Preorder M]
    [CovariantClass M M (Function.swap (· * ·)) (· ≤ ·)] [CovariantClass M M (· * ·) (· ≤ ·)]
    {l₁ l₂ : List M} (h : SublistForall₂ (· ≤ ·) l₁ l₂) (h₁ : ∀ a ∈ l₂, (1 : M) ≤ a) :
    l₁.prod ≤ l₂.prod

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

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

(h : List.SublistForall₂ (fun x x_1 => x ≤ x_1) l₁ l₂)


@[to_additive, deprecated pow_natAbs_eq_one (since := "2024-02-14")]
lemma exists_pow_eq_one_of_zpow_eq_one (hn : n ≠ 0) (h : a ^ n = 1) :
    ∃ n : ℕ, 0 < n ∧ a ^ n = 1

{G : Type u_3}
[Group G]
{a : G}
{n : ℤ}
(hn : n ≠ 0)
(h : a ^ n = 1)


@[simp]
theorem casesOn_mk {r : M F → Sort*} (x : F (M F)) (f : ∀ x : F (M F), r (M.mk x)) :
    PFunctor.M.casesOn (M.mk x) f = f x

(f : (x : ↑F F.M) → r (PFunctor.M.mk x))


@[to_additive]
theorem orderOf_eq_iff {n} (h : 0 < n) :
    orderOf x = n ↔ x ^ n = 1 ∧ ∀ m, m < n → 0 < m → x ^ m ≠ 1

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

addOrderOf x = n ↔ n • x = 0 ∧ ∀ m < n, 0 < m → m • x ≠ 0


theorem coeSubmodule_injective :
    Function.Injective (toSubmodule : LieSubmodule R L M → Submodule R M)

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


theorem le_of_dvd {a b : Int} (bpos : 0 < b) (H : a ∣ b) : a ≤ b


@[to_additive (attr := simp)]
theorem mulSupport_mulSingle_of_ne (h : b ≠ 1) : mulSupport (mulSingle a b) = {a}

{A : Type u_1}
{B : Type u_2}
[DecidableEq A]
[One B]
{a : A}
{b : B}
(h : b ≠ 1)

Function.mulSupport (Pi.mulSingle a b) = {a}


@[simp]
theorem toFinset_eq_empty [Fintype s] : s.toFinset = ∅ ↔ s = ∅


theorem ContinuousOn.comp_continuous {g : β → γ} {f : α → β} {s : Set β} (hg : ContinuousOn g s)
    (hf : Continuous f) (hs : ∀ x, f x ∈ s) : Continuous (g ∘ f)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[TopologicalSpace α]
[TopologicalSpace β]
[TopologicalSpace γ]
{g : β → γ}
{f : α → β}
{s : Set β}
(hg : ContinuousOn g s)
(hf : Continuous f)
(hs : ∀ (x : α), f x ∈ s)


theorem IsMaxChain.isChain (h : IsMaxChain r s) : IsChain r s

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


protected theorem secondCountableTopology [SecondCountableTopology E] (I : ModelWithCorners 𝕜 E H) :
    SecondCountableTopology H

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


theorem toNonUnitalNonAssocring_injective :
    Function.Injective (@toNonUnitalNonAssocRing R)


@[simp]
theorem nndist_vsub_cancel_left (x y z : P) : nndist (x -ᵥ y) (x -ᵥ z) = nndist y z

{V : Type u_2}
{P : Type u_3}
[SeminormedAddCommGroup V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]
(x y z : P)


theorem lt_blsub₂ {o₁ o₂ : Ordinal}
    (op : {a : Ordinal} → (a < o₁) → {b : Ordinal} → (b < o₂) → Ordinal) {a b : Ordinal}
    (ha : a < o₁) (hb : b < o₂) : op ha hb < blsub₂ o₁ o₂ op

(op : {a : Ordinal.{u_4}} → a < o₁ → {b : Ordinal.{u_5}} → b < o₂ → Ordinal.{max (max u_4 u_5) u_6})


/-- Suppose all distances from `p₁` and `p₂` to the points of a
simplex are equal, and that `p₁` and `p₂` lie in the affine span of
`p` with the vertices of that simplex.  Then `p₁` and `p₂` are equal
or reflections of each other in the affine span of the vertices of the
simplex. -/
theorem eq_or_eq_reflection_of_dist_eq {n : ℕ} {s : Simplex ℝ P n} {p p₁ p₂ : P} {r : ℝ}
    (hp₁ : p₁ ∈ affineSpan ℝ (insert p (Set.range s.points)))
    (hp₂ : p₂ ∈ affineSpan ℝ (insert p (Set.range s.points))) (h₁ : ∀ i, dist (s.points i) p₁ = r)
    (h₂ : ∀ i, dist (s.points i) p₂ = r) :
    p₁ = p₂ ∨ p₁ = reflection (affineSpan ℝ (Set.range s.points)) p₂

(h₁ : ∀ (i : Fin (n + 1)), dist (s.points i) p₁ = r)

(h₂ : ∀ (i : Fin (n + 1)), dist (s.points i) p₂ = r)

p₁ = p₂ ∨ p₁ = (EuclideanGeometry.reflection (affineSpan ℝ (Set.range s.points))) p₂


/-- Provided we have the appropriate coequalizers, we have an adjunction to the comparison functor.
-/
@[simps! counit]
def comparisonAdjunction
    [∀ A : adj.toMonad.Algebra, HasCoequalizer (F.map A.a)
      (adj.counit.app (F.obj A.A))] :
    leftAdjointComparison adj ⊣ comparison adj

[∀ (A : adj.toMonad.Algebra), CategoryTheory.Limits.HasCoequalizer (F.map A.a) (adj.counit.app (F.obj A.A))]

(CategoryTheory.Monad.MonadicityInternal.comparisonAdjunction adj).counit =
  {
    app := fun Y =>
      (CategoryTheory.Limits.Cofork.IsColimit.homIso
            (CategoryTheory.Limits.colimit.isColimit
              (CategoryTheory.Limits.parallelPair (F.map (G.map (adj.counit.app Y)))
                (adj.counit.app (F.obj (G.obj Y)))))
            Y).symm
        ⟨adj.counit.app Y, ⋯⟩,
    naturality := ⋯ }


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

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{B A : C}
(f : A ⟶ B)
[CategoryTheory.Mono f]
(X : CategoryTheory.Subobject B)
(h : CategoryTheory.Subobject.mk f = X)

(CategoryTheory.Subobject.isoOfMkEq f X h).hom = CategoryTheory.Subobject.ofMkLE f X ⋯


theorem comap_comap {m : γ → β} {n : β → α} : comap m (comap n f) = comap (n ∘ m) f

{α : Type u}
{β : Type v}
{γ : Type w}
{f : Filter α}
{m : γ → β}
{n : β → α}

Filter.comap m (Filter.comap n f) = Filter.comap (n ∘ m) f


@[simp]
theorem quotQuotEquivQuotSup_quot_quot_algebraMap (x : R) :
    DoubleQuot.quotQuotEquivQuotSup I J (algebraMap R _ x) = algebraMap _ _ x

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

(DoubleQuot.quotQuotEquivQuotSup I J) ((algebraMap R ((A ⧸ I) ⧸ Ideal.map (Ideal.Quotient.mk I) J)) x) =
  (algebraMap R (A ⧸ I ⊔ J)) x


/-- Sometimes, one may want to construct a charted space structure on a space which does not yet
have a topological structure, where the topology would come from the charts. For this, one needs
charts that are only partial equivalences, and continuity properties for their composition.
This is formalised in `ChartedSpaceCore`. -/
-- Porting note(#5171): this linter isn't ported yet.
-- @[nolint has_nonempty_instance]
structure ChartedSpaceCore (H : Type*) [TopologicalSpace H] (M : Type*) where
  /-- An atlas of charts, which are only `PartialEquiv`s -/
  atlas : Set (PartialEquiv M H)
  /-- The preferred chart at each point -/
  chartAt : M → PartialEquiv M H
  mem_chart_source : ∀ x, x ∈ (chartAt x).source
  chart_mem_atlas : ∀ x, chartAt x ∈ atlas
  open_source : ∀ e e' : PartialEquiv M H, e ∈ atlas → e' ∈ atlas → IsOpen (e.symm.trans e').source
  continuousOn_toFun : ∀ e e' : PartialEquiv M H, e ∈ atlas → e' ∈ atlas →
    ContinuousOn (e.symm.trans e') (e.symm.trans e').source

{H : Type u_5}
[TopologicalSpace H]
{M : Type u_6}
(self : ChartedSpaceCore H M)
(x : M)


/-- Power series expansion of `log(1 + x) - log(1 - x)` for `|x| < 1`. -/
theorem hasSum_log_sub_log_of_abs_lt_one {x : ℝ} (h : |x| < 1) :
    HasSum (fun k : ℕ => (2 : ℝ) * (1 / (2 * k + 1)) * x ^ (2 * k + 1))
      (log (1 + x) - log (1 - x))


/-- Together `Matrix.diagonalInvertible` and `Matrix.invertibleOfDiagonalInvertible` form an
equivalence, although both sides of the equiv are subsingleton anyway. -/
@[simps]
def diagonalInvertibleEquivInvertible (v : n → α) : Invertible (diagonal v) ≃ Invertible v

{n : Type u'}
{α : Type v}
[Fintype n]
[DecidableEq n]
[CommRing α]
(v : n → α)
[Invertible (Matrix.diagonal v)]

(Matrix.diagonalInvertibleEquivInvertible v) inst✝ = Matrix.invertibleOfDiagonalInvertible v


theorem ne_zero_iff {p : RingSeminorm R} : p ≠ 0 ↔ ∃ x, p x ≠ 0

{R : Type u_2}
[NonUnitalRing R]
{p : RingSeminorm R}


/-- Given that `α` is a countable, measurable space with all singleton sets measurable,
write the measure of a set `s` as the sum of the measure of `{x}` for all `x ∈ s`. -/
theorem tsum_indicator_apply_singleton [Countable α] [MeasurableSingletonClass α] (μ : Measure α)
    (s : Set α) (hs : MeasurableSet s) : (∑' x : α, s.indicator (fun x => μ {x}) x) = μ s

{α : Type u_1}
[MeasurableSpace α]
[Countable α]
[MeasurableSingletonClass α]
(μ : MeasureTheory.Measure α)
(s : Set α)
(hs : MeasurableSet s)

∑' (x : α), s.indicator (fun x => μ {x}) x = μ s


@[simp]
lemma map_id' (κ : Kernel α β) : map κ (fun a ↦ a) measurable_id = κ

{α : Type u_1}
{β : Type u_2}
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}
(κ : ProbabilityTheory.Kernel α β)


@[simp]
theorem erase_lt {a : α} {s : Multiset α} : s.erase a < s ↔ a ∈ s

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


@[to_additive tsum_prod]
theorem tprod_prod {f : β × γ → α} (h : Multipliable f) :
    ∏' p, f p = ∏' (b) (c), f ⟨b, c⟩

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[CommGroup α]
[UniformSpace α]
[UniformGroup α]
[CompleteSpace α]
[T0Space α]
{f : β × γ → α}
(h : Multipliable f)


/-- Typeclass for expressing that `1⁻¹ = 1`. -/
@[to_additive]
class InvOneClass (G : Type*) extends One G, Inv G where
  protected inv_one : (1 : G)⁻¹ = 1


@[to_additive (attr := simp)] lemma op_mul [Mul α] (x y : α) : op (x * y) = op y * op x

AddOpposite.op (x + y) = AddOpposite.op y + AddOpposite.op x


theorem Faithful.of_iso [F.Faithful] (α : F ≅ F') : F'.Faithful

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{F F' : CategoryTheory.Functor C D}
[F.Faithful]
(α : F ≅ F')


@[to_additive (attr := simp)]
theorem upperClosure_smul : upperClosure (a • s) = a • upperClosure s

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

upperClosure (a +ᵥ s) = a +ᵥ upperClosure s


@[simp]
theorem gradedCommAux_lof_tmul (i j : ι) (a : 𝒜 i) (b : ℬ j) :
    gradedCommAux R 𝒜 ℬ (lof R _ 𝒜ℬ (i, j) (a ⊗ₜ b)) =
      (-1 : ℤˣ)^(j * i) • lof R _ ℬ𝒜 (j, i) (b ⊗ₜ a)

(R : Type u_1)
{ι : Type u_2}
[CommSemiring ι]
[Module ι (Additive ℤˣ)]
[DecidableEq ι]
(𝒜 : ι → Type u_5)
(ℬ : ι → Type u_6)
[CommRing R]
[(i : ι) → AddCommGroup (𝒜 i)]
[(i : ι) → AddCommGroup (ℬ i)]
[(i : ι) → Module R (𝒜 i)]
[(i : ι) → Module R (ℬ i)]
(i j : ι)
(a : 𝒜 i)
(b : ℬ j)

(TensorProduct.gradedCommAux R 𝒜 ℬ) ((DirectSum.lof R (ι × ι) (fun i => 𝒜 i.1 ⊗[R] ℬ i.2) (i, j)) (a ⊗ₜ[R] b)) =
  (-1) ^ (j * i) • (DirectSum.lof R (ι × ι) (fun i => ℬ i.1 ⊗[R] 𝒜 i.2) (j, i)) (b ⊗ₜ[R] a)


theorem SemanticallyEquivalent.realize_bd_iff {φ ψ : L.BoundedFormula α n} {M : Type max u v}
    [Nonempty M] [L.Structure M] [T.Model M] (h : T.SemanticallyEquivalent φ ψ)
    {v : α → M} {xs : Fin n → M} : φ.Realize v xs ↔ ψ.Realize v xs

{L : FirstOrder.Language}
{T : L.Theory}
{α : Type w}
{n : ℕ}
{φ ψ : L.BoundedFormula α n}
{M : Type (max u v)}
[Nonempty M]
[L.Structure M]
[M ⊨ T]
(h : T.SemanticallyEquivalent φ ψ)
{v : α → M}
{xs : Fin n → M}


/-- Auxiliary definition for `mapTrifunctor`. -/
@[simps]
def mapTrifunctorObj {I₁ : Type*} (X₁ : GradedObject I₁ C₁) (I₂ I₃ : Type*) :
    GradedObject I₂ C₂ ⥤ GradedObject I₃ C₃ ⥤ GradedObject (I₁ × I₂ × I₃) C₄

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

(X₁ : CategoryTheory.GradedObject I₁ C₁)

{X₂ Y₂ : CategoryTheory.GradedObject I₂ C₂}

(X₃ : CategoryTheory.GradedObject I₃ C₃)

((CategoryTheory.GradedObject.mapTrifunctorObj F X₁ I₂ I₃).map φ).app X₃ x =
  ((F.obj (X₁ x.1)).map (φ x.2.1)).app (X₃ x.2.2)


/-- If `{ m_i }` is an `R`-basis of `M`, which is also `N`-linearly independent,
then `M` and `N` are linearly disjoint. -/
theorem of_basis_left {ι : Type*} (m : Basis ι R M)
    (H : LinearMap.ker (mulLeftMap N m) = ⊥) : M.LinearDisjoint N

(H : LinearMap.ker (Submodule.mulLeftMap N ⇑m) = ⊥)


theorem beq_comm {α} [BEq α] [LawfulBEq α] {a b : α} : (a == b) = (b == a)

{α : Type u_1}
[BEq α]
[LawfulBEq α]
{a b : α}


/-- The map is always nonempty. This lemma is needed to apply `SubMulAction.zero_mem`. -/
theorem map_nonempty [Nonempty ι] (f : MultilinearMap R M₁ M₂) (p : ∀ i, Submodule R (M₁ i)) :
    (map f p : Set M₂).Nonempty

{R : Type uR}
{ι : Type uι}
{M₁ : ι → Type v₁}
{M₂ : Type v₂}
[Ring R]
[(i : ι) → AddCommMonoid (M₁ i)]
[AddCommMonoid M₂]
[(i : ι) → Module R (M₁ i)]
[Module R M₂]
[Nonempty ι]
(f : MultilinearMap R M₁ M₂)
(p : (i : ι) → Submodule R (M₁ i))


theorem minimalPeriod_iterate_eq_div_gcd (h : n ≠ 0) :
    minimalPeriod f^[n] x = minimalPeriod f x / Nat.gcd (minimalPeriod f x) n

Function.minimalPeriod f^[n] x = Function.minimalPeriod f x / (Function.minimalPeriod f x).gcd n


/-- Uses `right` co(ntra)variant. -/
@[to_additive (attr := simp) Right.neg_pos_iff "Uses `right` co(ntra)variant."]
theorem Right.one_lt_inv_iff : 1 < a⁻¹ ↔ a < 1

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


@[simp]
theorem quotKerEquivRange_symm_apply_image (x : M) (h : f x ∈ LinearMap.range f) :
    f.quotKerEquivRange.symm ⟨f x, h⟩ = f.ker.mkQ x

{R : Type u_1}
{M : Type u_2}
{M₂ : Type u_3}
[Ring R]
[AddCommGroup M]
[AddCommGroup M₂]
[Module R M]
[Module R M₂]
(f : M →ₗ[R] M₂)
(x : M)
(h : f x ∈ LinearMap.range f)

f.quotKerEquivRange.symm ⟨f x, h⟩ = (LinearMap.ker f).mkQ x


@[simp]
lemma hom_naturality_apply {X Y : CondensedSet.{u}} (f : X ⟶ Y)  {S T : CompHausᵒᵖ} (g : S ⟶ T)
    (x : X.val.obj S) : f.val.app T (X.val.map g x) = Y.val.map g (f.val.app S x)

{X Y : CondensedSet}
(f : X ⟶ Y)
{S T : CompHausᵒᵖ}
(g : S ⟶ T)
(x : X.val.obj S)


theorem mem_sphere_comm : x ∈ sphere y ε ↔ y ∈ sphere x ε

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

x ∈ Metric.sphere y ε ↔ y ∈ Metric.sphere x ε


@[to_additive (attr := simp) card_eq_one]
theorem card_eq_one : Nat.card H = 1 ↔ H = ⊥

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


/-- If `f` is a periodic function with period `T`, then its integral over `[t, t + T]` does not
depend on `t`. -/
theorem intervalIntegral_add_eq (hf : Periodic f T) (t s : ℝ) :
    ∫ x in t..t + T, f x = ∫ x in s..s + T, f x

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : ℝ → E}
{T : ℝ}
(hf : Function.Periodic f T)
(t s : ℝ)

∫ (x : ℝ) in t..t + T, f x = ∫ (x : ℝ) in s..s + T, f x


lemma IsMeasurableRatCDF.stieltjesFunctionAux_eq (a : α) (r : ℚ) :
    IsMeasurableRatCDF.stieltjesFunctionAux f a r = f a r

{f : α → ℚ → ℝ}

(hf : ProbabilityTheory.IsMeasurableRatCDF f)

ProbabilityTheory.IsMeasurableRatCDF.stieltjesFunctionAux f a ↑r = f a r


/-- Constructs an equivalence between nonempty finite linear orders from an order isomorphism
between them. -/
@[simps]
def Iso.mk {α β : NonemptyFinLinOrd.{u}} (e : α ≃o β) : α ≅ β

{α β : NonemptyFinLinOrd}
(e : ↑α ≃o ↑β)

(NonemptyFinLinOrd.Iso.mk e).inv = ↑e.symm


theorem colimit_eq_iff_aux {i j : J} {xi : F.obj i} {xj : F.obj j} :
    (colimitCocone F).ι.app i xi = (colimitCocone F).ι.app j xj ↔
      FilteredColimit.Rel.{v, u} F ⟨i, xi⟩ ⟨j, xj⟩

{J : Type v}
[CategoryTheory.Category.{w, v} J]
(F : J ⥤ Type u)
[CategoryTheory.IsFilteredOrEmpty J]
[CategoryTheory.Limits.HasColimit F]
{i j : J}
{xi : F.obj i}
{xj : F.obj j}

(CategoryTheory.Limits.Types.colimitCocone F).ι.app i xi = (CategoryTheory.Limits.Types.colimitCocone F).ι.app j xj ↔
  CategoryTheory.Limits.Types.FilteredColimit.Rel F ⟨i, xi⟩ ⟨j, xj⟩


/-- A discrete hitting time is a stopping time. -/
theorem hitting_isStoppingTime [ConditionallyCompleteLinearOrder ι] [IsWellOrder ι (· < ·)]
    [Countable ι] [TopologicalSpace β] [PseudoMetrizableSpace β] [MeasurableSpace β] [BorelSpace β]
    {f : Filtration ι m} {u : ι → Ω → β} {s : Set β} {n n' : ι} (hu : Adapted f u)
    (hs : MeasurableSet s) : IsStoppingTime f (hitting u s n n')

{u : ι → Ω → β}

MeasureTheory.IsStoppingTime f (MeasureTheory.hitting u s n n')


theorem adjoin_iUnion {α : Type*} (s : α → Set A) :
    adjoin R (Set.iUnion s) = ⨆ i : α, adjoin R (s i)

{R : Type uR}
{A : Type uA}
[CommSemiring R]
[Semiring A]
[Algebra R A]
{α : Type u_1}
(s : α → Set A)

Algebra.adjoin R (Set.iUnion s) = ⨆ i, Algebra.adjoin R (s i)


@[simp]
theorem quotQuotEquivComm_algebraMap (x : R) :
    quotQuotEquivComm I J (algebraMap R _ x) = algebraMap _ _ x

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

(DoubleQuot.quotQuotEquivComm I J) ((algebraMap R ((A ⧸ I) ⧸ Ideal.map (Ideal.Quotient.mk I) J)) x) =
  (algebraMap R ((A ⧸ J) ⧸ Ideal.map (Ideal.Quotient.mk J) I)) x


lemma mulSupport_one_sub' [AddGroup R] (f : ι → R) : mulSupport (1 - f) = support f

{ι : Type u_1}
{R : Type u_5}
[One R]
[AddGroup R]
(f : ι → R)

Function.mulSupport (1 - f) = Function.support f


/-- Universe lift functor for monoids. -/
@[to_additive (attr := simps)
  "Universe lift functor for additive monoids."]
def uliftFunctor : MonCat.{u} ⥤ MonCat.{max u v}

MonCat.uliftFunctor.map f =
  MonCat.ofHom (MulEquiv.ulift.symm.toMonoidHom.comp (MonoidHom.comp f MulEquiv.ulift.toMonoidHom))


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

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


theorem HasMFDerivAt.const_smul (hf : HasMFDerivAt I 𝓘(𝕜, E') f z f') (s : 𝕜) :
    HasMFDerivAt I 𝓘(𝕜, E') (s • f) z (s • f')

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


theorem coe_preimage (f : α → β) (s : Set β) : (f : α →. β).preimage s = f ⁻¹' s

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


theorem ae_eq_of_ae_eq_trim {E} {hm : m ≤ m0} {f₁ f₂ : α → E}
    (h12 : f₁ =ᵐ[μ.trim hm] f₂) : f₁ =ᵐ[μ] f₂

{α : Type u_1}
{m m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{E : Type u_2}
{hm : m ≤ m0}
{f₁ f₂ : α → E}
(h12 : f₁ =ᵐ[μ.trim hm] f₂)


/-- Every nonempty `Word M` can be constructed as a `NeWord M i j` -/
theorem of_word (w : Word M) (h : w ≠ empty) : ∃ (i j : _) (w' : NeWord M i j), w'.toWord = w

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


theorem toNNReal_lt_toNNReal_iff_of_nonneg {r p : ℝ} (hr : 0 ≤ r) :
    Real.toNNReal r < Real.toNNReal p ↔ r < p


theorem UInt64.toNat_mul (x y : UInt64) : (x * y).toNat = (x.toNat * y.toNat) % UInt64.size

(x * y).toNat = x.toNat * y.toNat % UInt64.size


theorem traceForm_toMatrix [DecidableEq ι] (i j) :
    BilinForm.toMatrix b (traceForm R S) i j = trace R S (b i * b j)

(R : Type u_1)
{S : Type u_2}
[CommRing R]
[CommRing S]
[Algebra R S]
{ι : Type w}
[Fintype ι]
(b : Basis ι R S)
[DecidableEq ι]
(i j : ι)

(BilinForm.toMatrix b) (Algebra.traceForm R S) i j = (Algebra.trace R S) (b i * b j)


theorem Base.compl_inter_basis_of_inter_basis (hB : M.Base B) (hBX : M.Basis (B ∩ X) X) :
    M✶.Basis ((M.E \ B) ∩ (M.E \ X)) (M.E \ X)

{α : Type u_1}
{M : Matroid α}
{B X : Set α}
(hB : M.Base B)
(hBX : M.Basis (B ∩ X) X)

M✶.Basis (M.E \ B ∩ (M.E \ X)) (M.E \ X)


theorem pair_preimage (f : α →ₛ β) (g : α →ₛ γ) (s : Set β) (t : Set γ) :
    pair f g ⁻¹' s ×ˢ t = f ⁻¹' s ∩ g ⁻¹' t

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[MeasurableSpace α]
(f : MeasureTheory.SimpleFunc α β)
(g : MeasureTheory.SimpleFunc α γ)
(s : Set β)
(t : Set γ)

↑(f.pair g) ⁻¹' s ×ˢ t = ↑f ⁻¹' s ∩ ↑g ⁻¹' t


@[simp]
theorem bind_ret (f : α → β) : ∀ s, bind s (ret ∘ f) = map f s

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

s.bind (Stream'.Seq1.ret ∘ f) = Stream'.Seq1.map f s


@[mono]
theorem comap_mono {β} (f : α → β) : Monotone (comap f)

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


lemma ZMod.smul_units_def (z : ZMod 2) (au : Additive ℤˣ) :
    z • au = z.val • au


theorem sdiff_le_iff' : a \ b ≤ c ↔ a ≤ c ⊔ b

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


theorem derivedSeries_succ_eq_top_iff (n : ℕ) :
    derivedSeries R L (n + 1) = ⊤ ↔ derivedSeries R L 1 = ⊤

{R : Type u}
{L : Type v}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
(n : ℕ)

LieAlgebra.derivedSeries R L (n + 1) = ⊤ ↔ LieAlgebra.derivedSeries R L 1 = ⊤


@[to_additive]
lemma ite_le_one [LE α] (ha : a ≤ 1) (hb : b ≤ 1) : ite p a b ≤ 1

{α : Type u_2}
[Zero α]
{p : Prop}
[Decidable p]
{a b : α}
[LE α]
(ha : a ≤ 0)
(hb : b ≤ 0)


theorem support_congr (h : f.support ⊆ g.support) (h' : ∀ x ∈ g.support, f x = g x) : f = g

{α : Type u_1}
[DecidableEq α]
[Fintype α]
{f g : Equiv.Perm α}
(h : f.support ⊆ g.support)
(h' : ∀ x ∈ g.support, f x = g x)


/-- The Hausdorff distance to the empty set vanishes (if you want to have the more reasonable
value `∞` instead, use `EMetric.hausdorffEdist`, which takes values in `ℝ≥0∞`). -/
@[simp]
theorem hausdorffDist_empty' : hausdorffDist ∅ s = 0

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


/-- The **class equation** for finite groups. The cardinality of a group is equal to the size
of its center plus the sum of the size of all its nontrivial conjugacy classes. -/
theorem Group.nat_card_center_add_sum_card_noncenter_eq_card [Finite G] :
    Nat.card (Subgroup.center G) + ∑ᶠ x ∈ noncenter G, Nat.card x.carrier = Nat.card G

Nat.card ↥(Subgroup.center G) + ∑ᶠ (x : ConjClasses G) (_ : x ∈ ConjClasses.noncenter G), Nat.card ↑x.carrier =
  Nat.card G


@[simp]
theorem mem_finsetApprox {x : R} :
    x ∈ finsetApprox bS adm ↔ ∃ i j, i ≠ j ∧ distinctElems bS adm i - distinctElems bS adm j =
    x

{R : Type u_1}
{S : Type u_2}
[EuclideanDomain R]
[CommRing S]
[IsDomain S]
[Algebra R S]
{abv : AbsoluteValue R ℤ}
{ι : Type u_5}
[DecidableEq ι]
[Fintype ι]
(bS : Basis ι R S)
(adm : abv.IsAdmissible)
[Infinite R]
[DecidableEq R]
{x : R}

x ∈ ClassGroup.finsetApprox bS adm ↔
  ∃ i j, i ≠ j ∧ (ClassGroup.distinctElems bS adm) i - (ClassGroup.distinctElems bS adm) j = x


@[simp]
theorem toOrdinal_zero : toOrdinal 0 = 0


/-- Any linear isometric equivalence in `V` with positive determinant is `rotation`. -/
theorem exists_linearIsometryEquiv_eq_of_det_pos {f : V ≃ₗᵢ[ℝ] V}
    (hd : 0 < LinearMap.det (f.toLinearEquiv : V →ₗ[ℝ] V)) :
    ∃ θ : Real.Angle, f = o.rotation θ

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

(hd : 0 < LinearMap.det ↑f.toLinearEquiv)


/-- The functor `CostructuredArrow S T ⥤ CostructuredArrow U V` that is deduced from
a natural transformation `F ⋙ U ⟶ S ⋙ G` and a morphism `G.obj T ⟶ V` -/
@[simps!]
def map₂ : CostructuredArrow S T ⥤ CostructuredArrow U V

{X Y : CategoryTheory.Comma S (CategoryTheory.Functor.fromPUnit T)}

((CategoryTheory.CostructuredArrow.map₂ α β).map φ).left = F.map φ.left


lemma exact_iff_i_p_zero [S.HasHomology] (h₁ : S.LeftHomologyData)
    (h₂ : S.RightHomologyData) :
    S.Exact ↔ h₁.i ≫ h₂.p = 0

S.Exact ↔ CategoryTheory.CategoryStruct.comp h₁.i h₂.p = 0


@[simp]
theorem WalkingPair.equivBool_symm_apply_true : WalkingPair.equivBool.symm true = left

CategoryTheory.Limits.WalkingPair.equivBool.symm true = CategoryTheory.Limits.WalkingPair.left


theorem comap_sup_map_of_injective (S T : L.Substructure M) : (S.map f ⊔ T.map f).comap f = S ⊔ T

{L : FirstOrder.Language}
{M : Type w}
{N : Type u_1}
[L.Structure M]
[L.Structure N]
{f : L.Hom M N}
(hf : Function.Injective ⇑f)
(S T : L.Substructure M)

FirstOrder.Language.Substructure.comap f
    (FirstOrder.Language.Substructure.map f S ⊔ FirstOrder.Language.Substructure.map f T) =
  S ⊔ T


theorem geom_sum_succ {x : α} {n : ℕ} :
    ∑ i ∈ range (n + 1), x ^ i = (x * ∑ i ∈ range n, x ^ i) + 1

{α : Type u}
[Semiring α]
{x : α}
{n : ℕ}

∑ i ∈ Finset.range (n + 1), x ^ i = x * ∑ i ∈ Finset.range n, x ^ i + 1


theorem foldl_hom₂ (l : List ι) (f : α → β → γ) (op₁ : α → ι → α) (op₂ : β → ι → β)
    (op₃ : γ → ι → γ) (a : α) (b : β) (h : ∀ a b i, f (op₁ a i) (op₂ b i) = op₃ (f a b) i) :
    foldl op₃ (f a b) l = f (foldl op₁ a l) (foldl op₂ b l)

(f : α → β → γ)

(op₁ : α → ι → α)

(op₂ : β → ι → β)

(op₃ : γ → ι → γ)

(h : ∀ (a : α) (b : β) (i : ι), f (op₁ a i) (op₂ b i) = op₃ (f a b) i)

List.foldl op₃ (f a b) l = f (List.foldl op₁ a l) (List.foldl op₂ b l)


@[deprecated map_sub (since := "2024-06-20")]
protected theorem map_sub (x y) : e (x - y) = e x - e y

{R : Type uR}
{A₁ : Type uA₁}
{A₂ : Type uA₂}
[CommSemiring R]
[Ring A₁]
[Ring A₂]
[Algebra R A₁]
[Algebra R A₂]
(e : A₁ ≃ₐ[R] A₂)
(x y : A₁)


theorem eq_of_tgt (hX : IsZero X) (f g : Y ⟶ X) : f = g

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


theorem not_isUnit_of_not_isUnit_dvd {a b : α} (ha : ¬IsUnit a) (hb : a ∣ b) : ¬IsUnit b

{α : Type u_1}
[CommMonoid α]
{a b : α}
(ha : ¬IsUnit a)
(hb : a ∣ b)


@[simp]
theorem sups_subset_iff : s ⊻ t ⊆ u ↔ ∀ a ∈ s, ∀ b ∈ t, a ⊔ b ∈ u

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


@[simp] theorem subset_append_left (l₁ l₂ : List α) : l₁ ⊆ l₁ ++ l₂


theorem constr_apply (f : ι → M') (x : M) :
    constr (M' := M') b S f x = (b.repr x).sum fun b a => a • f b

{ι : Type u_1}
{R : Type u_3}
{M : Type u_6}
{M' : Type u_7}
[Semiring R]
[AddCommMonoid M]
[Module R M]
[AddCommMonoid M']
[Module R M']
(b : Basis ι R M)
(S : Type u_10)
[Semiring S]
[Module S M']
[SMulCommClass R S M']
(f : ι → M')
(x : M)

((b.constr S) f) x = (b.repr x).sum fun b a => a • f b


theorem congr {s : Set H} {x : H} {f g : H → H'} (h : f =ᶠ[𝓝 x] g) (hP : P f s x) : P g s x

{H : Type u_1}
{H' : Type u_3}
[TopologicalSpace H]
[TopologicalSpace H']
{G : StructureGroupoid H}
{G' : StructureGroupoid H'}
{P : (H → H') → Set H → H → Prop}
(hG : G.LocalInvariantProp G' P)
{s : Set H}
{x : H}
{f g : H → H'}
(h : f =ᶠ[𝓝 x] g)
(hP : P f s x)


@[simp]
theorem card_singleton (a : α) : card ({a} : Multiset α) = 1


theorem leftInverse_bijInv (f_bij : Bijective f) : LeftInverse (bijInv f_bij) f

{α : Type u_1}
{β : Type u_2}
[Fintype α]
[DecidableEq β]
{f : α → β}
(f_bij : Function.Bijective f)

Function.LeftInverse (Fintype.bijInv f_bij) f


/-- In a topological vector space, the closure of a convex set is convex. -/
protected theorem Convex.closure {s : Set E} (hs : Convex 𝕜 s) : Convex 𝕜 (closure s)

{𝕜 : Type u_2}
{E : Type u_3}
[LinearOrderedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[TopologicalSpace E]
[TopologicalAddGroup E]
[ContinuousConstSMul 𝕜 E]
{s : Set E}
(hs : Convex 𝕜 s)


@[simp]
theorem nhdsWithin_Icc_eq_nhdsWithin_Iic (h : a < b) : 𝓝[Icc a b] b = 𝓝[≤] b

{α : Type u}
[TopologicalSpace α]
[LinearOrder α]
[ClosedIicTopology α]
{a b : α}
(h : a < b)


/-- All n-simplices among cospherical points in an n-dimensional
subspace have the same circumsphere. -/
theorem exists_circumsphere_eq_of_cospherical_subset {s : AffineSubspace ℝ P} {ps : Set P}
    (h : ps ⊆ s) [Nonempty s] {n : ℕ} [FiniteDimensional ℝ s.direction]
    (hd : finrank ℝ s.direction = n) (hc : Cospherical ps) :
    ∃ c : Sphere P, ∀ sx : Simplex ℝ P n, Set.range sx.points ⊆ ps → sx.circumsphere = c

(hd : FiniteDimensional.finrank ℝ ↥s.direction = n)

∃ c, ∀ (sx : Affine.Simplex ℝ P n), Set.range sx.points ⊆ ps → sx.circumsphere = c


theorem Injective.compl_image_eq (hf : Injective f) (s : Set α) :
    (f '' s)ᶜ = f '' sᶜ ∪ (range f)ᶜ

{α : Type u_1}
{β : Type u_2}
{f : α → β}
(hf : Function.Injective f)
(s : Set α)


lemma map_id (P : MorphismProperty C) [RespectsIso P] :
    P.map (𝟭 _) = P

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


/-- The map `Square Cᵒᵖ → Square C` which switches `X₁` and `X₃`, but
does not move `X₂` and `X₃`. -/
@[simps]
protected def unop (sq : Square Cᵒᵖ) : Square C

{C : Type u}
[CategoryTheory.Category.{v, u} C]
(sq : CategoryTheory.Square Cᵒᵖ)


theorem fromLocalizedModule'_add (x y : LocalizedModule S M) :
    fromLocalizedModule' S f (x + y) = fromLocalizedModule' S f x + fromLocalizedModule' S f y

{R : Type u_1}
[CommSemiring R]
(S : Submonoid R)
{M : Type u_2}
{M' : Type u_3}
[AddCommMonoid M]
[AddCommMonoid M']
[Module R M]
[Module R M']
(f : M →ₗ[R] M')
[IsLocalizedModule S f]
(x y : LocalizedModule S M)

IsLocalizedModule.fromLocalizedModule' S f (x + y) =
  IsLocalizedModule.fromLocalizedModule' S f x + IsLocalizedModule.fromLocalizedModule' S f y


theorem IsBigOWith.congr_left (h : IsBigOWith c l f₁ g) (hf : ∀ x, f₁ x = f₂ x) :
    IsBigOWith c l f₂ g

{α : Type u_1}
{E : Type u_3}
{F : Type u_4}
[Norm E]
[Norm F]
{c : ℝ}
{g : α → F}
{l : Filter α}
{f₁ f₂ : α → E}
(h : Asymptotics.IsBigOWith c l f₁ g)
(hf : ∀ (x : α), f₁ x = f₂ x)


/-- A measure `μ` is called finite if `μ univ < ∞`. -/
class IsFiniteMeasure (μ : Measure α) : Prop where
  measure_univ_lt_top : μ univ < ∞

[self : MeasureTheory.IsFiniteMeasure μ]


theorem mem_balancedCore_iff : x ∈ balancedCore 𝕜 s ↔ ∃ t, Balanced 𝕜 t ∧ t ⊆ s ∧ x ∈ t

{𝕜 : Type u_1}
{E : Type u_2}
[SeminormedRing 𝕜]
[SMul 𝕜 E]
{s : Set E}
{x : E}


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

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


/-- If a star subalgebra of `C(X, 𝕜)` separates points, then the real subalgebra
of its purely real-valued elements also separates points. -/
theorem Subalgebra.SeparatesPoints.rclike_to_real {A : StarSubalgebra 𝕜 C(X, 𝕜)}
    (hA : A.SeparatesPoints) :
      ((A.restrictScalars ℝ).comap
        (ofRealAm.compLeftContinuous ℝ continuous_ofReal)).SeparatesPoints

{𝕜 : Type u_1}
{X : Type u_2}
[RCLike 𝕜]
[TopologicalSpace X]
{A : StarSubalgebra 𝕜 C(X, 𝕜)}
(hA : A.SeparatesPoints)

(Subalgebra.comap (AlgHom.compLeftContinuous ℝ RCLike.ofRealAm ⋯)
    (Subalgebra.restrictScalars ℝ A.toSubalgebra)).SeparatesPoints