theorem AlgHom.fieldRange_of_normal [Algebra F K] {E : IntermediateField F K} [Normal F E]
    (f : E →ₐ[F] K) : f.fieldRange = E

{F : Type u_1}
{K : Type u_2}
[Field K]
[Field F]
[Algebra F K]
{E : IntermediateField F K}
[Normal F ↥E]
(f : ↥E →ₐ[F] K)


theorem Ne.lt_sup_or_lt_sup (hab : a ≠ b) : a < a ⊔ b ∨ b < a ⊔ b

{α : Type u}
[SemilatticeSup α]
{a b : α}
(hab : a ≠ b)


@[simp]
theorem bot_lt_affineSpan : ⊥ < affineSpan k s ↔ s.Nonempty

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


theorem aeval_eq_zero_of_mem_rootSet {p : T[X]} [CommRing S] [IsDomain S] [Algebra T S] {a : S}
    (hx : a ∈ p.rootSet S) : aeval a p = 0

{S : Type v}
{T : Type w}
[CommRing T]
{p : Polynomial T}
[CommRing S]
[IsDomain S]
[Algebra T S]
{a : S}
(hx : a ∈ p.rootSet S)


/-- Fundamental theorem of calculus-2: If `f : ℝ → E` has a derivative at `f' x` for all `x` in
  `[a, b]` and `f'` is integrable on `[a, b]`, then `∫ y in a..b, f' y` equals `f b - f a`. -/
theorem integral_eq_sub_of_hasDerivAt (hderiv : ∀ x ∈ uIcc a b, HasDerivAt f (f' x) x)
    (hint : IntervalIntegrable f' volume a b) : ∫ y in a..b, f' y = f b - f a

(hderiv : ∀ x ∈ [[a, b]], HasDerivAt f (f' x) x)

(hint : IntervalIntegrable f' MeasureTheory.volume a b)


theorem IsClosed.upperSemicontinuousOn_indicator (hs : IsClosed s) (hy : 0 ≤ y) :
    UpperSemicontinuousOn (indicator s fun _x => y) t

{α : Type u_1}
[TopologicalSpace α]
{β : Type u_2}
[Preorder β]
{s t : Set α}
{y : β}
[Zero β]
(hs : IsClosed s)
(hy : 0 ≤ y)

UpperSemicontinuousOn (s.indicator fun _x => y) t


theorem Filter.Tendsto.isBoundedUnder_le (h : Tendsto u f (𝓝 a)) : f.IsBoundedUnder (· ≤ ·) u

{ι : Type u_1}
{α : Type u_2}
[Preorder α]
[TopologicalSpace α]
[BoundedLENhdsClass α]
{f : Filter ι}
{u : ι → α}
{a : α}
(h : Filter.Tendsto u f (𝓝 a))

Filter.IsBoundedUnder (fun x x_1 => x ≤ x_1) f u


/-- If `R` and `S` are isomorphic, then so are their polynomial rings. -/
@[simps!]
def mapEquiv (e : R ≃+* S) : R[X] ≃+* S[X]

{R : Type u}
{S : Type v}
[Semiring R]
[Semiring S]
(e : R ≃+* S)
(a : R[X])

(Polynomial.mapEquiv e) a = Polynomial.map (↑e) a


lemma series_ratio_test {f : ℕ → β} (n : ℕ) (r : α) (hr0 : 0 ≤ r) (hr1 : r < 1)
    (h : ∀ m, n ≤ m → abv (f m.succ) ≤ r * abv (f m)) :
    IsCauSeq abv fun m ↦ ∑ n ∈ range m, f n

(h : ∀ (m : ℕ), n ≤ m → abv (f m.succ) ≤ r * abv (f m))

IsCauSeq abv fun m => ∑ n ∈ Finset.range m, f n


@[to_additive]
theorem trivial_ker_of_injective {f : G → H} (hf : IsGroupHom f) (h : Function.Injective f) :
    ker f = trivial G

{G : Type u_1}
{H : Type u_2}
[Group G]
[Group H]
{f : G → H}
(hf : IsGroupHom f)
(h : Function.Injective f)


protected theorem div_def (a b : Int) : a / b = Int.ediv a b


lemma greatestFib_mono : Monotone greatestFib


/-- A diagram `WalkingSpan ⥤ C` is isomorphic to some `PushoutCocone.mk` after composing with
`diagramIsoSpan`. -/
@[simps!]
def PushoutCocone.isoMk {F : WalkingSpan ⥤ C} (t : Cocone F) :
    (Cocones.precompose (diagramIsoSpan.{v} _).inv).obj t ≅
      PushoutCocone.mk (t.ι.app WalkingSpan.left) (t.ι.app WalkingSpan.right)
        ((t.ι.naturality fst).trans (t.ι.naturality snd).symm)

{F : CategoryTheory.Limits.WalkingSpan ⥤ C}

(CategoryTheory.Limits.PushoutCocone.isoMk t).hom.hom = 𝟙 t.pt


theorem _root_.IsPrimitiveRoot.minpoly_eq_cyclotomic_of_irreducible {K : Type*} [Field K]
    {R : Type*} [CommRing R] [IsDomain R] {μ : R} {n : ℕ} [Algebra K R] (hμ : IsPrimitiveRoot μ n)
    (h : Irreducible <| cyclotomic n K) [NeZero (n : K)] : cyclotomic n K = minpoly K μ

(h : Irreducible (Polynomial.cyclotomic n K))


@[reassoc (attr := simp)]
lemma germ_stalkIso_hom' {X : Scheme.{u}} (U : X.Opens)
    {V : TopologicalSpace.Opens U} (x : U) (hx : x ∈ V) :
      U.toScheme.presheaf.germ ⟨x, hx⟩ ≫ (U.stalkIso x).hom =
        X.presheaf.germ ⟨x.1, show x.1 ∈ U.ι ''ᵁ V from ⟨x, hx, rfl⟩⟩

{V : TopologicalSpace.Opens ↑↑(↑U).toPresheafedSpace}

(↑U).presheaf.germ ⟨x, hx⟩ ≫ (U.stalkIso x).hom = X.presheaf.germ ⟨↑x, ⋯⟩


theorem ofNat_succ_pos (n : Nat) : 0 < (succ n : Int)


/-- A congruence lemma for `mfderiv`, (ab)using the fact that `TangentSpace I' (f x)` is
definitionally equal to `E'`. -/
theorem mfderiv_congr_point {x' : M} (h : x = x') :
    @Eq (E →L[𝕜] E') (mfderiv I I' f x) (mfderiv I I' f x')

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


theorem degree_update_le (p : R[X]) (n : ℕ) (a : R) : degree (p.update n a) ≤ max (degree p) n

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


theorem eqRec_heq' {α : Sort*} {a' : α} {motive : (a : α) → a' = a → Sort*}
    (p : motive a' (rfl : a' = a')) {a : α} (t : a' = a) :
    HEq (@Eq.rec α a' motive p a t) p

{α : Sort u_1}
{a' : α}
{motive : (a : α) → a' = a → Sort u_2}
(p : motive a' ⋯)
{a : α}
(t : a' = a)


theorem imp_of_if_pos {c t e : Prop} [Decidable c] (h : ite c t e) (hc : c) : t

{c t e : Prop}
[Decidable c]
(h : if c then t else e)
(hc : c)


/-- If `S` is the localization of `R` away from `r`, we obtain a canonical generator mapping
to the inverse of `r`. -/
@[simps val, simps (config := .lemmasOnly) vars σ]
noncomputable
def localizationAway : Generators R S

{R : Type u}
{S : Type v}
[CommRing R]
[CommRing S]
[Algebra R S]
(r : R)
[IsLocalization.Away r S]
(s : S)

(Algebra.Generators.localizationAway r).σ s =
  MvPolynomial.C (IsLocalization.Away.sec r s).1 * MvPolynomial.X () ^ (IsLocalization.Away.sec r s).2


theorem Zlattice.rank [hs : IsZlattice K L] : finrank ℤ L = finrank K E

(K : Type u_1)
[NormedLinearOrderedField K]
[HasSolidNorm K]
[FloorRing K]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace K E]
[FiniteDimensional K E]
[ProperSpace E]
(L : AddSubgroup E)
[DiscreteTopology ↥L]
[hs : IsZlattice K L]

FiniteDimensional.finrank ℤ ↥L = FiniteDimensional.finrank K E


@[simp]
theorem toOuterMeasure_pure_apply : (pure a).toOuterMeasure s = if a ∈ s then 1 else 0

(PMF.pure a).toOuterMeasure s = if a ∈ s then 1 else 0


theorem isLocallySurjective_iff_whisker_forget {F G : Cᵒᵖ ⥤ A} (f : F ⟶ G) :
    IsLocallySurjective J f ↔ IsLocallySurjective J (whiskerRight f (forget A))

(J : CategoryTheory.GrothendieckTopology C)

CategoryTheory.Presheaf.IsLocallySurjective J f ↔
  CategoryTheory.Presheaf.IsLocallySurjective J (CategoryTheory.whiskerRight f (CategoryTheory.forget A))


/-- The Hausdorff distances between two sets and their closures coincide. -/
-- @[simp] -- Porting note (#10618): simp can prove this
theorem hausdorffDist_closure : hausdorffDist (closure s) (closure t) = hausdorffDist s t

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

Metric.hausdorffDist (closure s) (closure t) = Metric.hausdorffDist s t


@[simp]
theorem map_zero (f : α → β) : (0 : Measure α).map f = 0

{α : Type u_1}
{β : Type u_2}
{m0 : MeasurableSpace α}
[MeasurableSpace β]
(f : α → β)


theorem IsBaseChange.comp {f : M →ₗ[R] N} (hf : IsBaseChange S f) {g : N →ₗ[S] O}
    (hg : IsBaseChange T g) : IsBaseChange T ((g.restrictScalars R).comp f)

{R : Type u_1}
{M : Type v₁}
{N : Type v₂}
{S : Type v₃}
[AddCommMonoid M]
[AddCommMonoid N]
[CommSemiring R]
[CommSemiring S]
[Algebra R S]
[Module R M]
[Module R N]
[Module S N]
[IsScalarTower R S N]
{T : Type u_4}
{O : Type u_5}
[CommSemiring T]
[Algebra R T]
[Algebra S T]
[IsScalarTower R S T]
[AddCommMonoid O]
[Module R O]
[Module S O]
[Module T O]
[IsScalarTower S T O]
[IsScalarTower R S O]
[IsScalarTower R T O]
{f : M →ₗ[R] N}
(hf : IsBaseChange S f)
{g : N →ₗ[S] O}
(hg : IsBaseChange T g)


@[reassoc, simp]
theorem comp_neg : f ≫ (-g) = -f ≫ g

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


@[simp]
theorem degree_linear (ha : a ≠ 0) : degree (C a * X + C b) = 1

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

(Polynomial.C a * Polynomial.X + Polynomial.C b).degree = 1


theorem Perm.merge (s₁ s₂ : α → α → Bool) (hl : l₁ ~ l₂) (hr : r₁ ~ r₂) :
    merge s₁ l₁ r₁ ~ merge s₂ l₂ r₂

{α : Type u_1}
{l₁ l₂ r₁ r₂ : List α}
(s₁ s₂ : α → α → Bool)
(hl : l₁ ~ l₂)
(hr : r₁ ~ r₂)

List.merge s₁ l₁ r₁ ~ List.merge s₂ l₂ r₂


lemma _root_.Equiv.image_eq_iff_bijOn (e : α ≃ β) : e '' s = t ↔ BijOn e s t

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


@[simp]
nonrec theorem zero_mul {α : Type} [Ring α] (x : Holor α ds₂) : (0 : Holor α ds₁) ⊗ x = 0

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


theorem hasDerivAt_fourier_neg (n : ℤ) (x : ℝ) :
    HasDerivAt (fun y : ℝ => fourier (-n) (y : AddCircle T))
      (-2 * π * I * n / T * fourier (-n) (x : AddCircle T)) x

HasDerivAt (fun y => (fourier (-n)) ↑y) (-2 * ↑π * Complex.I * ↑n / ↑T * (fourier (-n)) ↑x) x


theorem eq_zero_iff {m : M} : f m = 0 ↔ ∃ s' : S, s' • m = 0

{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]
{m : M}


theorem lt_def [LT α] [LT β] {a b : α ⊕ₗ β} : a < b ↔ Lex (· < ·) (· < ·) (ofLex a) (ofLex b)

{α : Type u_1}
{β : Type u_2}
[LT α]
[LT β]
{a b : Lex (α ⊕ β)}

a < b ↔ Sum.Lex (fun x x_1 => x < x_1) (fun x x_1 => x < x_1) (ofLex a) (ofLex b)


/-- The **extreme value theorem**: a continuous function realizes its minimum on a compact set. -/
theorem IsCompact.exists_isMinOn [ClosedIicTopology α] {s : Set β} (hs : IsCompact s)
    (ne_s : s.Nonempty) {f : β → α} (hf : ContinuousOn f s) : ∃ x ∈ s, IsMinOn f s x

{α : Type u_2}
{β : Type u_3}
[LinearOrder α]
[TopologicalSpace α]
[TopologicalSpace β]
[ClosedIicTopology α]
{s : Set β}
(hs : IsCompact s)
(ne_s : s.Nonempty)
{f : β → α}
(hf : ContinuousOn f s)


@[to_additive]
theorem mul_right_inj (h : IsUnit a) : a * b = a * c ↔ b = c

{M : Type u_1}
[Monoid M]
{a b c : M}
(h : IsUnit a)


@[simp]
theorem map_coe_Ioo_atTop {a b : α} (h : a < b) : map ((↑) : Ioo a b → α) atTop = 𝓝[<] b

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

Filter.map Subtype.val Filter.atTop = 𝓝[<] b


theorem row_weak_of_le {μ : YoungDiagram} (T : SemistandardYoungTableau μ) {i j1 j2 : ℕ}
    (hj : j1 ≤ j2) (cell : (i, j2) ∈ μ) : T i j1 ≤ T i j2


/-- An element admitting a left inverse is left-regular. -/
@[to_additive "An element admitting a left additive opposite is add-left-regular."]
theorem isLeftRegular_of_mul_eq_one (h : b * a = 1) : IsLeftRegular a

{R : Type u_1}
[AddMonoid R]
{a b : R}
(h : b + a = 0)


theorem exists_measurable_superset_of_trim_eq_zero {m : OuterMeasure α} {s : Set α}
    (h : m.trim s = 0) : ∃ t, s ⊆ t ∧ MeasurableSet t ∧ m t = 0

{α : Type u_1}
[MeasurableSpace α]
{m : MeasureTheory.OuterMeasure α}
{s : Set α}
(h : m.trim s = 0)


/-- If any two points of a set are contained in a preconnected subset,
then the original set is preconnected as well. -/
theorem isPreconnected_of_forall_pair {s : Set α}
    (H : ∀ x ∈ s, ∀ y ∈ s, ∃ t, t ⊆ s ∧ x ∈ t ∧ y ∈ t ∧ IsPreconnected t) :
    IsPreconnected s

(H : ∀ x ∈ s, ∀ y ∈ s, ∃ t ⊆ s, x ∈ t ∧ y ∈ t ∧ IsPreconnected t)


theorem mk_top : (⟨⊤, isComplemented_top⟩ : Complementeds α) = ⊤

{α : Type u_1}
[Lattice α]
[BoundedOrder α]


theorem _root_.NumberField.mixedEmbedding_injective [NumberField K] :
    Function.Injective (NumberField.mixedEmbedding K)

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


@[simp]
theorem toSet_singleton (x : ZFSet) : ({x} : ZFSet).toSet = {x}


theorem contDiffOn_stereoToFun :
    ContDiffOn ℝ ⊤ (stereoToFun v) {x : E | innerSL _ v x ≠ (1 : ℝ)}

{E : Type u_1}
[NormedAddCommGroup E]
[InnerProductSpace ℝ E]
{v : E}

ContDiffOn ℝ ⊤ (stereoToFun v) {x | ((innerSL ℝ) v) x ≠ 1}


/-- Given a nonempty Finset `s` and a function `f` from `s` to `ℕ`, if `d = s.gcd`,
then the `gcd` of `(f i) / d` is equal to `1`. -/
lemma gcd_div_eq_one (his : i ∈ s) (hfi : f i ≠ 0) : s.gcd (fun j ↦ f j / s.gcd f) = 1

{ι : Type u_1}
{α : Type u_2}
[CancelCommMonoidWithZero α]
[NormalizedGCDMonoid α]
[Div α]
[MulDivCancelClass α]
{f : ι → α}
{s : Finset ι}
{i : ι}
(his : i ∈ s)
(hfi : f i ≠ 0)


theorem subset_symmDiff_union_symmDiff_left (h : Disjoint s t) : u ⊆ s ∆ u ∪ t ∆ u

{α : Type u}
{s t u : Set α}
(h : Disjoint s t)


@[to_additive]
theorem mulSupport_mulIndicator_subset : mulSupport (s.mulIndicator f) ⊆ s

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

Function.mulSupport (s.mulIndicator f) ⊆ s


@[simp]
lemma map_add (F : C ⥤ D) (hF : W.IsInvertedBy F) [Preadditive D] [F.Additive] :
    φ.add.map F hF = φ.fst.map F hF + φ.snd.map F hF

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Category.{u_4, u_2} D]
[CategoryTheory.Preadditive C]
{W : CategoryTheory.MorphismProperty C}
{X Y : C}
(φ : W.LeftFraction₂ X Y)
(F : CategoryTheory.Functor C D)
(hF : W.IsInvertedBy F)
[CategoryTheory.Preadditive D]
[F.Additive]


/-- The plus construction, a functor sending `P` to `J.plusObj P`. -/
@[simps]
def plusFunctor : (Cᵒᵖ ⥤ D) ⥤ Cᵒᵖ ⥤ D

(J : CategoryTheory.GrothendieckTopology C)

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

[∀ (P : CategoryTheory.Functor Cᵒᵖ D) (X : C) (S : J.Cover X), CategoryTheory.Limits.HasMultiequalizer (S.index P)]

[∀ (X : C), CategoryTheory.Limits.HasColimitsOfShape (J.Cover X)ᵒᵖ D]

∀ {X Y : CategoryTheory.Functor Cᵒᵖ D} (η : X ⟶ Y), (J.plusFunctor D).map η = J.plusMap η


theorem compl_subset_comm : sᶜ ⊆ t ↔ tᶜ ⊆ s

sᶜ ⊆ t ↔ tᶜ ⊆ s


theorem Module.End.isNilpotent_iff_of_finite {R M : Type*} [CommSemiring R] [AddCommMonoid M]
    [Module R M] [Module.Finite R M] {f : End R M} :
    IsNilpotent f ↔ ∀ m : M, ∃ n : ℕ, (f ^ n) m = 0

{R : Type u_6}
{M : Type u_7}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
[Module.Finite R M]
{f : Module.End R M}

IsNilpotent f ↔ ∀ (m : M), ∃ n, (f ^ n) m = 0


theorem normalize_naturality (n : NormalMonoidalObject C) {X Y : F C} (f : X ⟶ Y) :
    inclusionObj n ◁ f ≫ (normalizeIsoApp' C Y n).hom =
      (normalizeIsoApp' C X n).hom ≫
        inclusion.map (eqToHom (Discrete.ext _ _ (normalizeObj_congr n f)))

(n : CategoryTheory.FreeMonoidalCategory.NormalMonoidalObject C)

{X Y : CategoryTheory.FreeMonoidalCategory C}

CategoryTheory.CategoryStruct.comp
    (CategoryTheory.MonoidalCategory.whiskerLeft (CategoryTheory.FreeMonoidalCategory.inclusionObj n) f)
    (CategoryTheory.FreeMonoidalCategory.normalizeIsoApp' C Y n).hom =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.FreeMonoidalCategory.normalizeIsoApp' C X n).hom
    (CategoryTheory.FreeMonoidalCategory.inclusion.map (CategoryTheory.eqToHom ⋯))


@[simp]
theorem iUnion_eq_empty : ⋃ i, s i = ∅ ↔ ∀ i, s i = ∅

{α : Type u_1}
{ι : Sort u_4}
{s : ι → Set α}


@[simp]
theorem _root_.smul_algebraMap {α : Type*} [Monoid α] [MulDistribMulAction α A]
    [SMulCommClass α R A] (a : α) (r : R) : a • algebraMap R A r = algebraMap R A r

{R : Type u}
{A : Type w}
[CommSemiring R]
[Semiring A]
[Algebra R A]
{α : Type u_2}
[Monoid α]
[MulDistribMulAction α A]
[SMulCommClass α R A]
(a : α)
(r : R)

a • (algebraMap R A) r = (algebraMap R A) r


theorem add_vecMul [Fintype m] (A : Matrix m n α) (x y : m → α) :
    (x + y) ᵥ* A = x ᵥ* A + y ᵥ* A

{m : Type u_2}
{n : Type u_3}
{α : Type v}
[NonUnitalNonAssocSemiring α]
[Fintype m]
(A : Matrix m n α)
(x y : m → α)


theorem card_pair (a b : α) : card {a, b} = 2


/-- The Monge plane associated with vertices `i₁` and `i₂` equals that
associated with `i₂` and `i₁`. -/
theorem mongePlane_comm {n : ℕ} (s : Simplex ℝ P (n + 2)) (i₁ i₂ : Fin (n + 3)) :
    s.mongePlane i₁ i₂ = s.mongePlane i₂ i₁

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{n : ℕ}
(s : Affine.Simplex ℝ P (n + 2))
(i₁ i₂ : Fin (n + 3))


/-- Given a representation of a Lie algebra with distinguished `sl₂` triple, a simultaneous
eigenvector for the action of both `h` and `e` necessarily has eigenvalue zero for `e`. -/
lemma HasPrimitiveVectorWith.mk' [NoZeroSMulDivisors ℤ M] (t : IsSl2Triple h e f) (m : M) (μ ρ : R)
    (hm : m ≠ 0) (hm' : ⁅h, m⁆ = μ • m) (he : ⁅e, m⁆ = ρ • m) :
    HasPrimitiveVectorWith t m μ

{R : Type u_1}
{L : Type u_2}
{M : Type u_3}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
{h e f : L}
[NoZeroSMulDivisors ℤ M]
(t : IsSl2Triple h e f)
(m : M)
(μ ρ : R)
(hm : m ≠ 0)
(hm' : ⁅h, m⁆ = μ • m)
(he : ⁅e, m⁆ = ρ • m)


@[simp]
theorem mem_nsmul {a : α} {s : Multiset α} {n : ℕ} : a ∈ n • s ↔ n ≠ 0 ∧ a ∈ s

{α : Type u_1}
{a : α}
{s : Multiset α}
{n : ℕ}


@[to_additive]
theorem smul_pi [Group K] [∀ i, MulAction K (R i)] (r : K) (S : Set ι) (t : ∀ i, Set (R i)) :
    r • S.pi t = S.pi (r • t)

{K : Type u_1}
{ι : Type u_2}
{R : ι → Type u_3}
[Group K]
[(i : ι) → MulAction K (R i)]
(r : K)
(S : Set ι)
(t : (i : ι) → Set (R i))


@[simp] lemma map₂_coe_left (f : α → β → γ) (a : α) (b) : map₂ f a b = b.map fun b ↦ f a b

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
(f : α → β → γ)
(a : α)
(b : WithBot β)

WithBot.map₂ f (↑a) b = WithBot.map (fun b => f a b) b


@[simp]
theorem mem_supp_iff (C : G.ConnectedComponent) (v : V) :
    v ∈ C.supp ↔ G.connectedComponentMk v = C

{V : Type u}
{G : SimpleGraph V}
(C : G.ConnectedComponent)
(v : V)


@[simp] theorem toIsometryEquiv_refl : toIsometryEquiv (.refl X) = .refl _

{R : Type u}
[CommRing R]
{X : QuadraticModuleCat R}

(CategoryTheory.Iso.refl X).toIsometryEquiv = QuadraticMap.IsometryEquiv.refl X.form


@[simp]
theorem sInf_coe_to_submodule (S : Set (LieSubalgebra R L)) :
    (↑(sInf S) : Submodule R L) = sInf {(s : Submodule R L) | s ∈ S}

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

(sInf S).toSubmodule = sInf {x | ∃ s ∈ S, s.toSubmodule = x}


@[simp]
theorem nhds_F (F : Realizer α) (a : α) (s) : (F.nhds a).F s = F.F s.1

{α : Type u_1}
[TopologicalSpace α]
(F : Ctop.Realizer α)
(a : α)
(s : (F.nhds a).σ)


@[to_additive (attr := mono)]
theorem smul_finset_subset_smul_finset : s ⊆ t → a • s ⊆ a • t

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


/-- The pigeonhole principle for finitely many pigeons counted by heads: given a function `f`, a
finite sets `s` in its domain, a finite set `t` in its codomain, and a natural number `n` such that
`card s ≤ card t * n`, there exists `y ∈ t` such that its preimage in `s` has no more than `n`
elements. See also `Finset.exists_card_fiber_lt_of_card_lt_mul` for a stronger statement. -/
theorem exists_card_fiber_le_of_card_le_mul (ht : t.Nonempty) (hn : s.card ≤ t.card * n) :
    ∃ y ∈ t, (s.filter fun x => f x = y).card ≤ n

{α : Type u}
{β : Type v}
[DecidableEq β]
{s : Finset α}
{t : Finset β}
{f : α → β}
{n : ℕ}
(ht : t.Nonempty)
(hn : s.card ≤ t.card * n)

∃ y ∈ t, (Finset.filter (fun x => f x = y) s).card ≤ n


/-- Consider a nonnegative function `φ` with integral one, decaying quickly enough at infinity.
Then suitable renormalizations of `φ` form a sequence of peak functions around the origin:
`∫ (c ^ d * φ (c • x)) • g x` converges to `g 0` as `c → ∞` if `g` is continuous at `0`
and integrable. -/
theorem tendsto_integral_comp_smul_smul_of_integrable
    {φ : F → ℝ} (hφ : ∀ x, 0 ≤ φ x) (h'φ : ∫ x, φ x ∂μ = 1)
    (h : Tendsto (fun x ↦ ‖x‖ ^ finrank ℝ F * φ x) (cobounded F) (𝓝 0))
    {g : F → E} (hg : Integrable g μ) (h'g : ContinuousAt g 0) :
    Tendsto (fun (c : ℝ) ↦ ∫ x, (c ^ (finrank ℝ F) * φ (c • x)) • g x ∂μ) atTop (𝓝 (g 0))

(h : Filter.Tendsto (fun x => ‖x‖ ^ FiniteDimensional.finrank ℝ F * φ x) (Bornology.cobounded F) (𝓝 0))

Filter.Tendsto (fun c => ∫ (x : F), (c ^ FiniteDimensional.finrank ℝ F * φ (c • x)) • g x ∂μ) Filter.atTop (𝓝 (g 0))


theorem HasFDerivAtFilter.restrictScalars {L} (h : HasFDerivAtFilter f f' x L) :
    HasFDerivAtFilter f (f'.restrictScalars 𝕜) x L

(𝕜 : Type u_1)
[NontriviallyNormedField 𝕜]
{𝕜' : Type u_2}
[NontriviallyNormedField 𝕜']
[NormedAlgebra 𝕜 𝕜']
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜' E]
[IsScalarTower 𝕜 𝕜' E]
{F : Type u_4}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[NormedSpace 𝕜' F]
[IsScalarTower 𝕜 𝕜' F]
{f : E → F}
{f' : E →L[𝕜'] F}
{x : E}
{L : Filter E}
(h : HasFDerivAtFilter f f' x L)

HasFDerivAtFilter f (ContinuousLinearMap.restrictScalars 𝕜 f') x L


@[to_additive (attr := simp)]
theorem tprod_pi_single [DecidableEq β] (b : β) (a : α) : ∏' b', Pi.mulSingle b a b' = a

{α : Type u_1}
{β : Type u_2}
[CommMonoid α]
[TopologicalSpace α]
[DecidableEq β]
(b : β)
(a : α)


theorem isVonNBounded_of_smul_tendsto_zero {ε : ι → 𝕜} {l : Filter ι} [l.NeBot]
    (hε : ∀ᶠ n in l, ε n ≠ 0) {S : Set E}
    (H : ∀ x : ι → E, (∀ n, x n ∈ S) → Tendsto (ε • x) l (𝓝 0)) : IsVonNBounded 𝕜 S

(H : ∀ (x : ι → E), (∀ (n : ι), x n ∈ S) → Filter.Tendsto (ε • x) l (𝓝 0))


theorem integral_comp_polarCoord_symm {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
    (f : ℝ × ℝ → E) :
    (∫ p in polarCoord.target, p.1 • f (polarCoord.symm p)) = ∫ p, f p

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
(f : ℝ × ℝ → E)

∫ (p : ℝ × ℝ) in polarCoord.target, p.1 • f (↑polarCoord.symm p) = ∫ (p : ℝ × ℝ), f p


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

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


theorem mem_of_mem_sInter {x y z : Class} (hy : y ∈ ⋂₀ x) (hz : z ∈ x) : y ∈ z


@[to_additive]
lemma val_mem_of_mem_units (S : Submonoid M) {x : Mˣ} (h : x ∈ S.units) : (x : M) ∈ S

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


/-- One half of the equivalence between `C` and `AsSmall C`. -/
@[simps]
def AsSmall.down : AsSmall C ⥤ C

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

∀ {X Y : CategoryTheory.AsSmall C} (f : X ⟶ Y), CategoryTheory.AsSmall.down.map f = f.down


theorem strictConvexOn_iff_div {f : E → β} :
    StrictConvexOn 𝕜 s f ↔
      Convex 𝕜 s ∧ ∀ ⦃x⦄, x ∈ s → ∀ ⦃y⦄, y ∈ s → x ≠ y → ∀ ⦃a b : 𝕜⦄, 0 < a → 0 < b →
        f ((a / (a + b)) • x + (b / (a + b)) • y) < (a / (a + b)) • f x + (b / (a + b)) • f y

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_5}
[LinearOrderedField 𝕜]
[AddCommMonoid E]
[OrderedAddCommMonoid β]
[SMul 𝕜 E]
[SMul 𝕜 β]
{s : Set E}
{f : E → β}

StrictConvexOn 𝕜 s f ↔
  Convex 𝕜 s ∧
    ∀ ⦃x : E⦄,
      x ∈ s →
        ∀ ⦃y : E⦄,
          y ∈ s →
            x ≠ y →
              ∀ ⦃a b : 𝕜⦄,
                0 < a → 0 < b → f ((a / (a + b)) • x + (b / (a + b)) • y) < (a / (a + b)) • f x + (b / (a + b)) • f y


@[simp] lemma map_map (f : V ↪ W) (g : W ↪ X) : (G.map f).map g = G.map (f.trans g)

{V : Type u_1}
{W : Type u_2}
{X : Type u_3}
(G : SimpleGraph V)
(f : V ↪ W)
(g : W ↪ X)

SimpleGraph.map g (SimpleGraph.map f G) = SimpleGraph.map (f.trans g) G


@[simp]
theorem sumToIter_C (a : R) : sumToIter R S₁ S₂ (C a) = C (C a)

(R : Type u)
(S₁ : Type v)
(S₂ : Type w)
[CommSemiring R]
(a : R)

(MvPolynomial.sumToIter R S₁ S₂) (MvPolynomial.C a) = MvPolynomial.C (MvPolynomial.C a)


theorem MapsTo.inter (h₁ : MapsTo f s t₁) (h₂ : MapsTo f s t₂) : MapsTo f s (t₁ ∩ t₂)

{α : Type u_1}
{β : Type u_2}
{s : Set α}
{t₁ t₂ : Set β}
{f : α → β}
(h₁ : Set.MapsTo f s t₁)
(h₂ : Set.MapsTo f s t₂)


@[simp]
theorem to_ofOption (o : Option α) : toOption (ofOption o) = o


@[simp]
theorem intCast_mulVec (x : ℤ) (v : m → α) : x *ᵥ v = (x : α) • v

{m : Type u_2}
{α : Type v}
[NonAssocRing α]
[Fintype m]
[DecidableEq m]
(x : ℤ)
(v : m → α)


@[simp]
theorem take_eq_take :
    ∀ {l : List α} {m n : Nat}, l.take m = l.take n ↔ min m l.length = min n l.length

List.take m l = List.take n l ↔ min m l.length = min n l.length


@[simp]
theorem Fintype.card_finset_len [Fintype α] (k : ℕ) :
    Fintype.card { s : Finset α // s.card = k } = Nat.choose (Fintype.card α) k

Fintype.card { s // s.card = k } = (Fintype.card α).choose k


theorem isOrderRightAdjoint_csSup [ConditionallyCompleteLattice α] [Preorder β] (f : α → β)
    (hne : ∀ y, ∃ x, f x ≤ y) (hbdd : ∀ y, BddAbove { x | f x ≤ y }) :
    IsOrderRightAdjoint f fun y => sSup { x | f x ≤ y }

(hbdd : ∀ (y : β), BddAbove {x | f x ≤ y})

IsOrderRightAdjoint f fun y => sSup {x | f x ≤ y}


theorem inversion_bijective (c : P) {R : ℝ} (hR : R ≠ 0) : Bijective (inversion c R)

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
(c : P)
{R : ℝ}
(hR : R ≠ 0)

Function.Bijective (EuclideanGeometry.inversion c R)


theorem Valid'.node4L_lemma₃ {b c d : ℕ} (mr₁ : 2 * d ≤ b + c + 1) (mm₁ : b ≤ 3 * c) :
    d ≤ 3 * c


theorem mem_map_equiv {f : R ≃+* S} {K : NonUnitalSubring R} {x : S} :
    x ∈ K.map (f : R →ₙ+* S) ↔ f.symm x ∈ K

{R : Type u}
{S : Type v}
[NonUnitalNonAssocRing R]
[NonUnitalNonAssocRing S]
{f : R ≃+* S}
{K : NonUnitalSubring R}
{x : S}

x ∈ NonUnitalSubring.map (↑f) K ↔ f.symm x ∈ K


theorem associator_hom_hom {X Y Z : Action V G} :
    Hom.hom (α_ X Y Z).hom = (α_ X.V Y.V Z.V).hom

{V : Type (u + 1)}
[CategoryTheory.LargeCategory V]
{G : MonCat}
[CategoryTheory.MonoidalCategory V]
{X Y Z : Action V G}

(CategoryTheory.MonoidalCategory.associator X Y Z).hom.hom =
  (CategoryTheory.MonoidalCategory.associator X.V Y.V Z.V).hom


lemma polynomialZ_eq : W.polynomialZ =
    X 1 ^ 2 + C W.a₁ * X 0 * X 1 + C (2 * W.a₃) * X 1 * X 2
      - (C W.a₂ * X 0 ^ 2 + C (2 * W.a₄) * X 0 * X 2 + C (3 * W.a₆) * X 2 ^ 2)

{R : Type u}
[CommRing R]
(W : WeierstrassCurve.Projective R)

W.polynomialZ =
  MvPolynomial.X 1 ^ 2 + MvPolynomial.C W.a₁ * MvPolynomial.X 0 * MvPolynomial.X 1 +
      MvPolynomial.C (2 * W.a₃) * MvPolynomial.X 1 * MvPolynomial.X 2 -
    (MvPolynomial.C W.a₂ * MvPolynomial.X 0 ^ 2 + MvPolynomial.C (2 * W.a₄) * MvPolynomial.X 0 * MvPolynomial.X 2 +
      MvPolynomial.C (3 * W.a₆) * MvPolynomial.X 2 ^ 2)


@[simp]
theorem sumAssoc_symm_apply_inr_inr : (sumAssoc α β γ).symm (inr (inr c)) = inr c

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[LE α]
[LE β]
[LE γ]
(c : γ)

(OrderIso.sumAssoc α β γ).symm (Sum.inr (Sum.inr c)) = Sum.inr c


@[simp] theorem sub_im : (a - b).im = a.im - b.im

{R : Type u_3}
[CommRing R]
{c₁ c₂ : R}
(a b : ℍ[R,c₁,c₂])


/-- The **Cauchy-Davenport Theorem** for torsion-free groups. The size of `s * t` is lower-bounded
by `|s| + |t| - 1`. -/
@[to_additive "The **Cauchy-Davenport theorem** for torsion-free groups. The size of `s + t` is
lower-bounded by `|s| + |t| - 1`."]
lemma Monoid.IsTorsionFree.card_add_card_sub_one_le_card_mul (h : IsTorsionFree α)
    (hs : s.Nonempty) (ht : t.Nonempty) : s.card + t.card - 1 ≤ (s * t).card

{α : Type u_1}
[AddGroup α]
[DecidableEq α]
{s t : Finset α}
(h : AddMonoid.IsTorsionFree α)
(hs : s.Nonempty)
(ht : t.Nonempty)


@[simp]
theorem preComp_φ : (f.preComp g).φ = g.app (op [n + 1]) ≫ f.φ

{X X' : CategoryTheory.SimplicialObject C}

(f : AlgebraicTopology.DoldKan.MorphComponents X n Z)

(f.preComp g).φ = g.app (Opposite.op [n + 1]) ≫ f.φ


lemma exists_isCartanSubalgebra_engel_of_finrank_le_card (h : finrank K L ≤ #K) :
    ∃ x : L, IsCartanSubalgebra (engel K x)

(h : ↑(FiniteDimensional.finrank K L) ≤ Cardinal.mk K)

∃ x, (LieSubalgebra.engel K x).IsCartanSubalgebra


protected theorem antilipschitz [SemilinearIsometryClass 𝓕 σ₁₂ E E₂] (f : 𝓕) :
    AntilipschitzWith 1 f

{R : Type u_1}
{R₂ : Type u_2}
{E : Type u_5}
{E₂ : Type u_6}
{𝓕 : Type u_10}
[Semiring R]
[Semiring R₂]
{σ₁₂ : R →+* R₂}
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup E₂]
[Module R E]
[Module R₂ E₂]
[FunLike 𝓕 E E₂]
[SemilinearIsometryClass 𝓕 σ₁₂ E E₂]
(f : 𝓕)


theorem liftAux_map_mul (f : X → L) (a b : lib R X) :
    liftAux R f (a * b) = ⁅liftAux R f a, liftAux R f b⁆

(R : Type u)
{X : Type v}
[CommRing R]
{L : Type w}
[LieRing L]
[LieAlgebra R L]
(f : X → L)
(a b : lib R X)

(FreeLieAlgebra.liftAux R f) (a * b) = ⁅(FreeLieAlgebra.liftAux R f) a, (FreeLieAlgebra.liftAux R f) b⁆


/-- An alternative formulation of `contMDiffWithinAt_iff_of_mem_maximalAtlas`
  if the set if `s` lies in `e.source`. -/
theorem contMDiffWithinAt_iff_image {x : M} (he : e ∈ maximalAtlas I M)
    (he' : e' ∈ maximalAtlas I' M') (hs : s ⊆ e.source) (hx : x ∈ e.source) (hy : f x ∈ e'.source) :
    ContMDiffWithinAt I I' n f s x ↔
      ContinuousWithinAt f s x ∧
        ContDiffWithinAt 𝕜 n (e'.extend I' ∘ f ∘ (e.extend I).symm) (e.extend I '' s)
          (e.extend I x)

(he : e ∈ SmoothManifoldWithCorners.maximalAtlas I M)

(he' : e' ∈ SmoothManifoldWithCorners.maximalAtlas I' M')

ContMDiffWithinAt I I' n f s x ↔
  ContinuousWithinAt f s x ∧
    ContDiffWithinAt 𝕜 n (↑(e'.extend I') ∘ f ∘ ↑(e.extend I).symm) (↑(e.extend I) '' s) (↑(e.extend I) x)


lemma nullMeasurable_comp_snd [NeZero μ] {f : β → γ} :
    NullMeasurable (f ∘ Prod.snd) (μ.prod ν) ↔ NullMeasurable f ν

{α : Type u_1}
{β : Type u_3}
{γ : Type u_5}
[MeasurableSpace α]
[MeasurableSpace β]
[MeasurableSpace γ]
{μ : MeasureTheory.Measure α}
{ν : MeasureTheory.Measure β}
[MeasureTheory.SFinite ν]
[NeZero μ]
{f : β → γ}

MeasureTheory.NullMeasurable (f ∘ Prod.snd) (μ.prod ν) ↔ MeasureTheory.NullMeasurable f ν


@[simp] lemma measurableSet_preimage_up {s : Set (ULift α)} :
    MeasurableSet (ULift.up ⁻¹' s) ↔ MeasurableSet s

{α : Type u_1}
[MeasurableSpace α]
{s : Set (ULift.{u_6, u_1} α)}


lemma IsCoprime.intCast {R : Type*} [CommRing R] {a b : ℤ} (h : IsCoprime a b) :
    IsCoprime (a : R) (b : R)

{R : Type u_1}
[CommRing R]
{a b : ℤ}
(h : IsCoprime a b)


protected theorem le_antisymm_iff {x y : Fin n} : x = y ↔ x ≤ y ∧ y ≤ x


theorem IsCoprime.pow_right_iff (hm : 0 < m) : IsCoprime x (y ^ m) ↔ IsCoprime x y

{R : Type u}
[CommSemiring R]
{x y : R}
{m : ℕ}
(hm : 0 < m)


theorem perm_insertNth {α} (x : α) (l : List α) {n} (h : n ≤ l.length) :
    insertNth n x l ~ x :: l

{α : Type u_1}
(x : α)
(l : List α)
{n : Nat}
(h : n ≤ l.length)


/-- No points are in `⊥`. -/
theorem not_mem_bot (p : P) : p ∉ (⊥ : AffineSubspace k P)

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


@[simp]
theorem floor_sub_nat [Sub α] [OrderedSub α] [ExistsAddOfLE α] (a : α) (n : ℕ) :
    ⌊a - n⌋₊ = ⌊a⌋₊ - n

{α : Type u_2}
[LinearOrderedSemiring α]
[FloorSemiring α]
[Sub α]
[OrderedSub α]
[ExistsAddOfLE α]
(a : α)
(n : ℕ)

⌊a - ↑n⌋₊ = ⌊a⌋₊ - n


@[simp] lemma untop'_zero_mul (a b : WithTop α) : (a * b).untop' 0 = a.untop' 0 * b.untop' 0

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

WithTop.untop' 0 (a * b) = WithTop.untop' 0 a * WithTop.untop' 0 b


protected theorem congr_arg {x x'} : x = x' → e x = e x'

{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₂}
{x x' : M}


theorem IsSubfield.div_mem {S : Set F} (hS : IsSubfield S) {x y : F} (hx : x ∈ S) (hy : y ∈ S) :
    x / y ∈ S

{F : Type u_1}
[Field F]
{S : Set F}
(hS : IsSubfield S)
{x y : F}
(hx : x ∈ S)
(hy : y ∈ S)


protected theorem Monotone.Icc (hf : Monotone f) (hg : Antitone g) :
    Antitone fun x => Icc (f x) (g x)

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
{f g : α → β}
(hf : Monotone f)
(hg : Antitone g)


@[simp]
lemma id.toOplax : (id F).toOplax = OplaxNatTrans.id F

{B : Type u₁}
[CategoryTheory.Bicategory B]
{C : Type u₂}
[CategoryTheory.Bicategory C]
(F : CategoryTheory.OplaxFunctor B C)

(CategoryTheory.StrongOplaxNatTrans.id F).toOplax = CategoryTheory.OplaxNatTrans.id F


@[simp]
theorem lTensorHomEquivHomLTensor_toLinearMap :
    (lTensorHomEquivHomLTensor R M P Q).toLinearMap = lTensorHomToHomLTensor R M P Q

(R : Type u)
(M : Type v₁)
(P : Type v₃)
(Q : Type v₄)
[CommRing R]
[AddCommGroup M]
[AddCommGroup P]
[AddCommGroup Q]
[Module R M]
[Module R P]
[Module R Q]
[Module.Free R M]
[Module.Finite R M]

↑(lTensorHomEquivHomLTensor R M P Q) = TensorProduct.lTensorHomToHomLTensor R M P Q


@[to_additive (attr := simp)]
theorem mem_toSubsemigroup {s : Submonoid M} {x : M} : x ∈ s.toSubsemigroup ↔ x ∈ s

{M : Type u_1}
[AddZeroClass M]
{s : AddSubmonoid M}
{x : M}


/-- A functor reflects monomorphisms if morphisms that are mapped to monomorphisms are themselves
    monomorphisms. -/
class ReflectsMonomorphisms (F : C ⥤ D) : Prop where
   /-- A functor reflects monomorphisms if morphisms that are mapped to monomorphisms are themselves
    monomorphisms. -/
  reflects : ∀ {X Y : C} (f : X ⟶ Y), Mono (F.map f) → Mono f

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{F : C ⥤ D}
[self : F.ReflectsMonomorphisms]
{X Y : C}
(f : X ⟶ Y)

CategoryTheory.Mono (F.map f) → CategoryTheory.Mono f


theorem setLIntegral_const_lt_top [IsFiniteMeasure μ] (s : Set α) {c : ℝ≥0∞} (hc : c ≠ ∞) :
    ∫⁻ _ in s, c ∂μ < ∞

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


/-- The ring homomorphism from `R` to `R[S⁻¹]`, mapping `r : R` to the fraction `r /ₒ 1`. -/
@[simps!]
def numeratorRingHom : R →+* R[S⁻¹]

{R : Type u_1}
[Semiring R]
{S : Submonoid R}
[OreLocalization.OreSet S]
(r : R)

OreLocalization.numeratorRingHom r = r /ₒ 1


theorem mfderiv_neg (f : M → E') (x : M) :
    (mfderiv I 𝓘(𝕜, E') (-f) x : TangentSpace I x →L[𝕜] E') =
      (-mfderiv I 𝓘(𝕜, E') f x : TangentSpace I x →L[𝕜] E')

{𝕜 : 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']
(f : M → E')
(x : M)

mfderiv I 𝓘(𝕜, E') (-f) x = -mfderiv I 𝓘(𝕜, E') f x


@[to_additive]
theorem div_eq_inv_mul : a / b = b⁻¹ * a

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


theorem aux_hasSum_of_le_geometric : HasSum (fun n : ℕ ↦ C * r ^ n) (C / (1 - r))

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

HasSum (fun n => C * r ^ n) (C / (1 - r))


@[to_additive (attr := simp,norm_cast)]
theorem coe_mul (s t : UpperSet α) : (↑(s * t) : Set α) = s * t

{α : Type u_1}
[OrderedCommGroup α]
(s t : UpperSet α)


/-- A multiplicative analogue of `Equiv.arrowCongr`,
for multiplicative maps from a monoid to a commutative monoid.
-/
@[to_additive (attr := simps apply)
  "An additive analogue of `Equiv.arrowCongr`,
  for additive maps from an additive monoid to a commutative additive monoid."]
-- Porting note: @[simps apply] removed because it was making a lemma which
-- wasn't in simp normal form.
def monoidHomCongr {M N P Q} [MulOneClass M] [MulOneClass N] [CommMonoid P] [CommMonoid Q]
    (f : M ≃* N) (g : P ≃* Q) : (M →* P) ≃* (N →* Q)

{M : Type u_12}
{N : Type u_13}
{P : Type u_14}
{Q : Type u_15}
[AddZeroClass M]
[AddZeroClass N]
[AddCommMonoid P]
[AddCommMonoid Q]
(f : M ≃+ N)
(g : P ≃+ Q)
(h : M →+ P)

(f.addMonoidHomCongr g) h = g.toAddMonoidHom.comp (h.comp f.symm.toAddMonoidHom)


theorem not_real_of_infinitesimal_ne_zero (x : ℝ*) : Infinitesimal x → x ≠ 0 → ∀ r : ℝ, x ≠ r

x.Infinitesimal → x ≠ 0 → ∀ (r : ℝ), x ≠ ↑r


lemma coverPreserving : haveI := F.reflects_preregular
    CoverPreserving (regularTopology _) (regularTopology _) F

CategoryTheory.CoverPreserving (CategoryTheory.regularTopology C) (CategoryTheory.regularTopology D) F


lemma autEquivZmod_symm_apply_intCast {ζ : K} (hζ : IsPrimitiveRoot ζ n) (m : ℤ) :
    (autEquivZmod H L hζ).symm (Multiplicative.ofAdd (m : ZMod n)) α = ζ ^ m • α

(H : Irreducible (Polynomial.X ^ n - Polynomial.C a))

[Polynomial.IsSplittingField K L (Polynomial.X ^ n - Polynomial.C a)]

((autEquivZmod H L hζ).symm (Multiplicative.ofAdd ↑m)) α = ζ ^ m • α


protected theorem sub_lt_self_iff (ha : a ≠ ∞) : a - b < a ↔ 0 < a ∧ 0 < b


@[to_additive (attr := simp)]
theorem mem_mulSupport {f : α → M} {x : α} : x ∈ mulSupport f ↔ f x ≠ 1

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


theorem val_coe_unit_coprime {n : ℕ} (u : (ZMod n)ˣ) : Nat.Coprime (u : ZMod n).val n


theorem pure_seq_eq_map (f : α → β) (x : Comp F G α) : pure f <*> x = f <$> x

{F : Type u → Type w}
{G : Type v → Type u}
[Applicative F]
[Applicative G]
[LawfulApplicative F]
[LawfulApplicative G]
{α β : Type v}
(f : α → β)
(x : Functor.Comp F G α)

(Seq.seq (pure f) fun x_1 => x) = f <$> x


/-- Given `F : WalkingCospan ⥤ C`, which is really the same as `cospan (F.map inl) (F.map inr)`,
    and a cone on `F`, we get a pullback cone on `F.map inl` and `F.map inr`. -/
@[simps]
def PullbackCone.ofCone {F : WalkingCospan ⥤ C} (t : Cone F) :
    PullbackCone (F.map inl) (F.map inr)

{F : CategoryTheory.Limits.WalkingCospan ⥤ C}

(CategoryTheory.Limits.PullbackCone.ofCone t).pt = t.pt


theorem _root_.Set.Subsingleton.isEquipartition (h : (P.parts : Set (Finset α)).Subsingleton) :
    P.IsEquipartition

{α : Type u_1}
[DecidableEq α]
{s : Finset α}
{P : Finpartition s}
(h : (↑P.parts).Subsingleton)


/-- To match `mul_one_eq_id`. -/
theorem mul_zero_eq_const : (· * (0 : M₀)) = Function.const _ 0


@[reassoc (attr := simp)]
lemma germToPullbackStalk_stalkPullbackHom
    (f : X ⟶ Y) (F : Y.Presheaf C) (U : Opens X) (x : U) :
    germToPullbackStalk C f F U x ≫ stalkPullbackHom C f F x =
      ((pullback C f).obj F).germ x

(C : Type u)
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Limits.HasColimits C]
{X Y : TopCat}
(f : X ⟶ Y)
(F : TopCat.Presheaf C Y)
(U : TopologicalSpace.Opens ↑X)
(x : ↥U)

TopCat.Presheaf.germToPullbackStalk C f F U x ≫ TopCat.Presheaf.stalkPullbackHom C f F ↑x =
  ((TopCat.Presheaf.pullback C f).obj F).germ x


@[simp]
theorem coe_toPrincipalIdeal (x : Kˣ) :
    (toPrincipalIdeal R K x : FractionalIdeal R⁰ K) = spanSingleton _ (x : K)

{R : Type u_1}
{K : Type u_2}
[CommRing R]
[Field K]
[Algebra R K]
[IsFractionRing R K]
(x : Kˣ)

↑((toPrincipalIdeal R K) x) = FractionalIdeal.spanSingleton R⁰ ↑x


@[simp]
lemma map_f' : (h.map F).f' = F.map h.f'


theorem comap_op_pow (n : ℕ) (M : Submodule R Aᵐᵒᵖ) :
    comap (↑(opLinearEquiv R : A ≃ₗ[R] Aᵐᵒᵖ) : A →ₗ[R] Aᵐᵒᵖ) (M ^ n) =
      comap (↑(opLinearEquiv R : A ≃ₗ[R] Aᵐᵒᵖ) : A →ₗ[R] Aᵐᵒᵖ) M ^ n

{R : Type u}
[CommSemiring R]
{A : Type v}
[Semiring A]
[Algebra R A]
(n : ℕ)
(M : Submodule R Aᵐᵒᵖ)

Submodule.comap (↑(MulOpposite.opLinearEquiv R)) (M ^ n) = Submodule.comap (↑(MulOpposite.opLinearEquiv R)) M ^ n


theorem gcd_add_mul_self (m n k : Nat) : gcd m (n + k * m) = gcd m n


@[simp]
theorem equivOfEq_rfl (S : Subalgebra R A) : equivOfEq S S rfl = AlgEquiv.refl

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


theorem rescale_neg_one_X : rescale (-1 : A) X = -X

(PowerSeries.rescale (-1)) PowerSeries.X = -PowerSeries.X


theorem tendsto_atBot_add (hf : Tendsto f l atBot) (hg : Tendsto g l atBot) :
    Tendsto (fun x => f x + g x) l atBot

{α : Type u_3}
{β : Type u_4}
[OrderedAddCommMonoid β]
{l : Filter α}
{f g : α → β}
(hf : Filter.Tendsto f l Filter.atBot)
(hg : Filter.Tendsto g l Filter.atBot)

Filter.Tendsto (fun x => f x + g x) l Filter.atBot


@[simp]
theorem map_up (f : α → β) (a : α) : (PLift.up a).map f = PLift.up (f a)

{α : Sort u}
{β : Sort v}
(f : α → β)
(a : α)

PLift.map f { down := a } = { down := f a }


@[continuity]
protected theorem continuous_symm (h : α ≃ᵤ β) : Continuous h.symm

{α : Type u}
{β : Type u_1}
[UniformSpace α]
[UniformSpace β]
(h : α ≃ᵤ β)


theorem smul_mk [∀ i, SMul α (A i)] {i} (c : α) (a : A i) :
    c • mk i a = mk i (c • a)

{ι : Type u_1}
{α : Type u_3}
{A : ι → Type u_2}
[(i : ι) → SMul α (A i)]
{i : ι}
(c : α)
(a : A i)

c • GradedMonoid.mk i a = GradedMonoid.mk i (c • a)


theorem Eq.cmp_eq_eq' (h : x = y) : cmp y x = Ordering.eq

{α : Type u_1}
[LinearOrder α]
{x y : α}
(h : x = y)


nonrec theorem IsLocalMinOn.bicomp_mono [Preorder δ] {op : β → γ → δ}
    (hop : ((· ≤ ·) ⇒ (· ≤ ·) ⇒ (· ≤ ·)) op op) (hf : IsLocalMinOn f s a) {g : α → γ}
    (hg : IsLocalMinOn g s a) : IsLocalMinOn (fun x => op (f x) (g x)) s 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)


theorem KaehlerDifferential.derivationQuotKerTotal_apply (x) :
    KaehlerDifferential.derivationQuotKerTotal R S x = 1𝖣x

(R : Type u)
(S : Type v)
[CommRing R]
[CommRing S]
[Algebra R S]
(x : S)

(KaehlerDifferential.derivationQuotKerTotal R S) x = (KaehlerDifferential.kerTotal R S).mkQ (Finsupp.single x 1)


/-- A point `x` in a discrete subset `s` of a topological space admits a neighbourhood
that only meets `s` at `x`.  -/
theorem nhds_inter_eq_singleton_of_mem_discrete {s : Set X} [DiscreteTopology s] {x : X}
    (hx : x ∈ s) : ∃ U ∈ 𝓝 x, U ∩ s = {x}

{X : Type u_1}
[TopologicalSpace X]
{s : Set X}
[DiscreteTopology ↑s]
{x : X}
(hx : x ∈ s)


@[simp]
theorem arcsin_nonneg {x : ℝ} : 0 ≤ arcsin x ↔ 0 ≤ x


theorem toPEquiv_apply (f : α ≃ β) (x : α) : f.toPEquiv x = some (f x)

{α : Type u_1}
{β : Type u_2}
(f : α ≃ β)
(x : α)


theorem continuous_insertNth {n : ℕ} {i : Fin (n + 1)} {f : β → α} {g : β → Vector α n}
    (hf : Continuous f) (hg : Continuous g) : Continuous fun b => Vector.insertNth (f b) i (g b)

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
{n : ℕ}
{i : Fin (n + 1)}
{f : β → α}
{g : β → Mathlib.Vector α n}
(hf : Continuous f)
(hg : Continuous g)

Continuous fun b => Mathlib.Vector.insertNth (f b) i (g b)


theorem openSegment_translate_preimage (a b c : E) :
    (fun x => a + x) ⁻¹' openSegment 𝕜 (a + b) (a + c) = openSegment 𝕜 b c

(𝕜 : Type u_1)
{E : Type u_2}
[OrderedRing 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
(a b c : E)


@[simp]
theorem _root_.ContinuousLinearMap.compContinuousAlternatingMap_coe (g : N →L[R] N')
    (f : M [⋀^ι]→L[R] N) : ⇑(g.compContinuousAlternatingMap f) = g ∘ f

{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']
(g : N →L[R] N')
(f : M [⋀^ι]→L[R] N)

⇑(g.compContinuousAlternatingMap f) = ⇑g ∘ ⇑f


@[simp]
theorem id_traverse [DecidableEq α] (s : Finset α) : traverse (pure : α → Id α) s = s

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


@[to_additive]
theorem range_smul_range {ι κ : Type*} [SMul α β] (b : ι → α) (c : κ → β) :
    range b • range c = range fun p : ι × κ ↦ b p.1 • c p.2

{α : Type u_2}
{β : Type u_3}
{ι : Type u_5}
{κ : Type u_6}
[VAdd α β]
(b : ι → α)
(c : κ → β)

Set.range b +ᵥ Set.range c = Set.range fun p => b p.1 +ᵥ c p.2


theorem pointwise_smul_def {a : α} (S : AddSubgroup A) :
    a • S = S.map (DistribMulAction.toAddMonoidEnd _ _ a)

{α : Type u_1}
{A : Type u_3}
[AddGroup A]
[Monoid α]
[DistribMulAction α A]
{a : α}
(S : AddSubgroup A)

a • S = AddSubgroup.map ((DistribMulAction.toAddMonoidEnd α A) a) S


/--
If `M` is a flat module, then `𝟙 M ⊗ f` is injective for all injective linear maps `f`.
-/
theorem lTensor_preserves_injective_linearMap {N' : Type*} [AddCommGroup N'] [Module R N']
    [Flat R M] (L : N →ₗ[R] N') (hL : Function.Injective L) :
    Function.Injective (L.lTensor M)

{R : Type u}
{M : Type v}
[CommRing R]
[AddCommGroup M]
[Module R M]
{N : Type w}
[AddCommGroup N]
[Module R N]
{N' : Type u_1}
[AddCommGroup N']
[Module R N']
[Module.Flat R M]
(L : N →ₗ[R] N')
(hL : Function.Injective ⇑L)

Function.Injective ⇑(LinearMap.lTensor M L)


/-- A linearly ordered commutative group with an additively absorbing `⊤` element.
  Instances should include number systems with an infinite element adjoined. -/
class LinearOrderedAddCommGroupWithTop (α : Type*) extends LinearOrderedAddCommMonoidWithTop α,
  SubNegMonoid α, Nontrivial α where
  protected neg_top : -(⊤ : α) = ⊤
  protected add_neg_cancel : ∀ a : α, a ≠ ⊤ → a + -a = 0

[self : LinearOrderedAddCommGroupWithTop α]


@[to_additive uniformContinuous_const_nsmul]
theorem uniformContinuous_pow_const (n : ℕ) : UniformContinuous fun x : α => x ^ n

{α : Type u_1}
[UniformSpace α]
[AddGroup α]
[UniformAddGroup α]
(n : ℕ)


theorem HasDerivAt.sum (h : ∀ i ∈ u, HasDerivAt (A i) (A' i) x) :
    HasDerivAt (fun y => ∑ i ∈ u, A i y) (∑ i ∈ u, A' i) x


/-- Given a family of opens `U` and an open `Y` equal to the union of opens in `U`, we may
    take the presieve on `Y` associated to `U` and the sieve generated by it, and form the
    full subcategory (subposet) of opens contained in `Y` (`over Y`) consisting of arrows
    in the sieve. This full subcategory is equivalent to `OpensLeCover U`, the (poset)
    category of opens contained in some `U i`. -/
@[simps]
def generateEquivalenceOpensLe_inverse' :
    OpensLeCover U ⥤
    (FullSubcategory fun f : Over Y =>
      (Sieve.generate (presieveOfCoveringAux U Y)).arrows f.hom)

{X : TopCat}
{ι : Type w}
(U : ι → TopologicalSpace.Opens ↑X)
{Y : TopologicalSpace.Opens ↑X}
(hY : Y = iSup U)

∀ {x x_1 : TopCat.Presheaf.SheafCondition.OpensLeCover U} (g : x ⟶ x_1),
  (TopCat.Presheaf.generateEquivalenceOpensLe_inverse' U hY).map g = CategoryTheory.Over.homMk g ⋯


@[simp]
theorem one_lt_top : (1 : PartENat) < ⊤


@[simp]
theorem id_val_base (X : Scheme) : (𝟙 X : _).1.base = 𝟙 _


@[simp]
theorem roots_smul_nonzero (p : R[X]) (ha : a ≠ 0) : (a • p).roots = p.roots

{R : Type u}
{a : R}
[CommRing R]
[IsDomain R]
(p : Polynomial R)
(ha : a ≠ 0)


@[simp]
theorem nndist_toAdd (a b : Multiplicative X) : nndist (toAdd a) (toAdd b) = nndist a b

{X : Type u_1}
[PseudoMetricSpace X]
(a b : Multiplicative X)

nndist (Multiplicative.toAdd a) (Multiplicative.toAdd b) = nndist a b


theorem Ioo_mem_nhdsSet_Ioc (h : a ≤ b) (h' : c < d) : Ioo a d ∈ 𝓝ˢ (Ioc b c)

{α : Type u_1}
[LinearOrder α]
[TopologicalSpace α]
[OrderClosedTopology α]
{a b c d : α}
(h : a ≤ b)
(h' : c < d)


theorem norm_def (x : tsze R M) : ‖x‖ = ‖fst x‖ + ‖snd x‖

{R : Type u_3}
{M : Type u_4}
[SeminormedRing R]
[SeminormedAddCommGroup M]
(x : tsze R M)


@[simp]
theorem coe_of (X : Type u) [MeasurableSpace X] : (of X : Type u) = X


lemma sInf_mem_of_not_isPredLimit (hlim : ¬ IsPredLimit (sInf s)) :
    sInf s ∈ s

{α : Type u_2}
[CompleteLinearOrder α]
{s : Set α}
(hlim : ¬Order.IsPredLimit (sInf s))


@[norm_cast, simp]
theorem Nat.dist_cast_rat (x y : ℕ) : dist (x : ℚ) y = dist x y


theorem isRadical_iff_pow_one_lt [MonoidWithZero R] (k : ℕ) (hk : 1 < k) :
    IsRadical y ↔ ∀ x, y ∣ x ^ k → y ∣ x

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

IsRadical y ↔ ∀ (x : R), y ∣ x ^ k → y ∣ x


/-- If `M` is finite, `finrank M = rank M`. -/
@[simp]
theorem finrank_eq_rank [Module.Finite R M] :
    ↑(FiniteDimensional.finrank R M) = Module.rank R M

(R : Type u)
(M : Type v)
[Ring R]
[AddCommGroup M]
[Module R M]
[StrongRankCondition R]
[Module.Finite R M]


@[simps (config := .lemmasOnly) toSemigroup_toMul_mul toOne_one]
instance End : Monoid (A →ₐc[R] A)

{R : Type u_1}
{A : Type u_2}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[CoalgebraStruct R A]
(φ₁ φ₂ : A →ₐc[R] A)

φ₁ * φ₂ = φ₁.comp φ₂


@[simp]
theorem uncurry_apply (f : M →ₗ[R] N →ₗ[R] P) (m : M) (n : N) :
    uncurry R M N P f (m ⊗ₜ n) = f m n

{R : Type u_1}
[CommSemiring R]
{M : Type u_4}
{N : Type u_5}
{P : Type u_6}
[AddCommMonoid M]
[AddCommMonoid N]
[AddCommMonoid P]
[Module R M]
[Module R N]
[Module R P]
(f : M →ₗ[R] N →ₗ[R] P)
(m : M)
(n : N)

((TensorProduct.uncurry R M N P) f) (m ⊗ₜ[R] n) = (f m) n


@[simp]
theorem coe_frobeniusEquiv : ⇑(frobeniusEquiv R p) = frobenius R p

(R : Type u_1)
(p : ℕ)
[CommSemiring R]
[ExpChar R p]
[PerfectRing R p]

⇑(frobeniusEquiv R p) = ⇑(frobenius R p)


theorem comap_preimage {β} [MeasurableSpace α] {mβ : MeasurableSpace β} (f : α → β) (μ : Measure β)
    {s : Set β} (hf : Injective f) (hf' : Measurable f)
    (h : ∀ t, MeasurableSet t → NullMeasurableSet (f '' t) μ) (hs : MeasurableSet s) :
    μ.comap f (f ⁻¹' s) = μ (s ∩ range f)

(h : ∀ (t : Set α), MeasurableSet t → MeasureTheory.NullMeasurableSet (f '' t) μ)

(MeasureTheory.Measure.comap f μ) (f ⁻¹' s) = μ (s ∩ Set.range f)


theorem PosMulMono.toPosMulStrictMono [PosMulMono α] : PosMulStrictMono α

{α : Type u_1}
[CancelMonoidWithZero α]
[PartialOrder α]
[PosMulMono α]


/-- Alias of `Nat.cast_le`, specialized to `Ordinal` --/
theorem natCast_le {m n : ℕ} : (m : Ordinal) ≤ n ↔ m ≤ n

↑m ≤ ↑n ↔ m ≤ n


theorem Iio_inter_Ioo : Iio a ∩ Ioo b c = Ioo b (min a c)

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

Set.Iio a ∩ Set.Ioo b c = Set.Ioo b (min a c)


@[to_additive (attr := simp)]
theorem coe_comp' {G H K : Type _} [Group G] [Group H] [Group K] (f : G →* H) (g : H →* K) :
    @DFunLike.coe (G →* K) G (fun _ ↦ K) MonoidHom.instFunLike (CategoryStruct.comp
      (X := Grp.of G) (Y := Grp.of H) (Z := Grp.of K) f g) = g ∘ f

{G H K : Type u_1}
[AddGroup G]
[AddGroup H]
[AddGroup K]
(f : G →+ H)
(g : H →+ K)


@[simp]
lemma changeLevel_eq_one_iff {m : ℕ} {χ : DirichletCharacter R n} (hm : n ∣ m) [NeZero m] :
    changeLevel hm χ = 1 ↔ χ = 1

{R : Type u_1}
[CommMonoidWithZero R]
{n m : ℕ}
{χ : DirichletCharacter R n}
(hm : n ∣ m)
[NeZero m]

(DirichletCharacter.changeLevel hm) χ = 1 ↔ χ = 1


/-- If a T2 group acts properly on a topological space, then this topological space is T2. -/
@[to_additive "If a T2 group acts properly on a topological space,
then this topological space is T2."]
theorem t2Space_of_properSMul_of_t2Group [h_proper : ProperSMul G X] [T2Space G] : T2Space X

{G : Type u_1}
{X : Type u_2}
[Group G]
[MulAction G X]
[TopologicalSpace G]
[TopologicalSpace X]
[h_proper : ProperSMul G X]
[T2Space G]


theorem image_preimage_subset (f : α → β) (s : Set β) : f '' (f ⁻¹' s) ⊆ s

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


theorem ofReal_mul' (r : ℝ) (z : ℂ) : ↑r * z = ⟨r * z.re, r * z.im⟩

↑r * z = { re := r * z.re, im := r * z.im }


@[reassoc]
theorem Obj.map_on_summand' {Δ Δ' : SimplexCategoryᵒᵖ} (A : Splitting.IndexSet Δ) (θ : Δ ⟶ Δ') :
    ((splitting K).cofan Δ).inj A ≫ (obj K).map θ =
      Obj.Termwise.mapMono K (image.ι (θ.unop ≫ A.e)) ≫
        ((splitting K).cofan Δ').inj (A.pull θ)

(A : SimplicialObject.Splitting.IndexSet Δ)

(θ : Δ ⟶ Δ')

((AlgebraicTopology.DoldKan.Γ₀.splitting K).cofan Δ).inj A ≫ (AlgebraicTopology.DoldKan.Γ₀.obj K).map θ =
  AlgebraicTopology.DoldKan.Γ₀.Obj.Termwise.mapMono K (CategoryTheory.Limits.image.ι (θ.unop ≫ A.e)) ≫
    ((AlgebraicTopology.DoldKan.Γ₀.splitting K).cofan Δ').inj (A.pull θ)


theorem commutatorMap_injective (hφ : FixedPointFree φ) : Function.Injective (commutatorMap φ)

{G : Type u_1}
[Group G]
{φ : G →* G}
(hφ : MonoidHom.FixedPointFree ⇑φ)


theorem Sized.eq_node' {s l x r} (h : @Sized α (node s l x r)) : node s l x r = .node' l x r

{α : Type u_1}
{s : ℕ}
{l : Ordnode α}
{x : α}
{r : Ordnode α}
(h : (Ordnode.node s l x r).Sized)


theorem continuousAt_add_coe_bot (a : ℝ) :
    ContinuousAt (fun p : EReal × EReal => p.1 + p.2) (a, ⊥)

ContinuousAt (fun p => p.1 + p.2) (↑a, ⊥)


@[simp]
theorem toDirectSum_zero [Semiring M] : (0 : AddMonoidAlgebra M ι).toDirectSum = 0

{ι : Type u_1}
{M : Type u_3}
[Semiring M]


/-- The identity on the whole space as a partial homeomorphism. -/
@[simps! (config := mfld_cfg) apply, simps! (config := .lemmasOnly) source target]
protected def refl (X : Type*) [TopologicalSpace X] : PartialHomeomorph X X

(PartialHomeomorph.refl X).target = Set.univ


@[simp]
theorem Iic_diff_Iio : Iic b \ Iio a = Icc a b

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


@[simp]
theorem minimals_empty : minimals r ∅ = ∅


@[simp]
theorem top_F (u : Unit) : (@Realizer.top α).F u = univ


lemma even_nat_card_aut_of_not_isUnramified [IsGalois k K] (hw : ¬ IsUnramified k w) :
    Even (Nat.card <| K ≃ₐ[k] K)

(hw : ¬NumberField.InfinitePlace.IsUnramified k w)


/-- A map to a group preserving multiplication is a monoid homomorphism. -/
@[to_additive "A map to an additive group preserving addition is an additive monoid
homomorphism."]
theorem IsMulHom.to_isMonoidHom [MulOneClass α] [Group β] {f : α → β} (hf : IsMulHom f) :
    IsMonoidHom f

{α : Type u}
{β : Type v}
[MulOneClass α]
[Group β]
{f : α → β}
(hf : IsMulHom f)


@[simp]
theorem dropn_ofSeq (s : Seq α) : ∀ n, drop (ofSeq s) n = ofSeq (s.drop n)

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


@[simp]
theorem ceil_ofNat (n : ℕ) [n.AtLeastTwo] : ⌈(no_index (OfNat.ofNat n : α))⌉ = n

{α : Type u_2}
[LinearOrderedRing α]
[FloorRing α]
(n : ℕ)
[n.AtLeastTwo]


/-- If `c • x ∈ s`, then `egauge 𝕜 s x` is at most `(‖c‖₊ : ℝ≥0∞)⁻¹.

See also `egauge_le_of_smul_mem_of_ne`. -/
lemma egauge_le_of_smul_mem (h : c • x ∈ s) : egauge 𝕜 s x ≤ (‖c‖₊ : ℝ≥0∞)⁻¹

{𝕜 : Type u_1}
[NormedDivisionRing 𝕜]
{E : Type u_3}
[AddCommGroup E]
[Module 𝕜 E]
{c : 𝕜}
{s : Set E}
{x : E}
(h : c • x ∈ s)


theorem T_derivative_eq_U (n : ℤ) : derivative (T R n) = n * U R (n - 1)

Polynomial.derivative (Polynomial.Chebyshev.T R n) = ↑n * Polynomial.Chebyshev.U R (n - 1)


@[simp] lemma toAddMonoidHomEquiv_apply (ψ : AddChar A M) (a : A) :
    toAddMonoidHomEquiv ψ a = Additive.ofMul (ψ a)

{A : Type u_1}
{M : Type u_3}
[AddMonoid A]
[Monoid M]
(ψ : AddChar A M)
(a : A)

(AddChar.toAddMonoidHomEquiv ψ) a = Additive.ofMul (ψ a)


@[simp]
theorem continuousWithinAt_update_same [DecidableEq α] {f : α → β} {s : Set α} {x : α} {y : β} :
    ContinuousWithinAt (update f x y) s x ↔ Tendsto f (𝓝[s \ {x}] x) (𝓝 y)

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
[DecidableEq α]
{f : α → β}
{s : Set α}
{x : α}
{y : β}

ContinuousWithinAt (Function.update f x y) s x ↔ Filter.Tendsto f (𝓝[s \ {x}] x) (𝓝 y)


lemma mul_mem_right (x y) (hx : x ∈ I) : x * y ∈ I

{R : Type u_1}
[NonUnitalNonAssocRing R]
(I : TwoSidedIdeal R)
(x y : R)
(hx : x ∈ I)


theorem toLin'_symm_to_linearMap (A : SpecialLinearGroup n R) :
    ↑A.toLin'.symm = Matrix.toLin' ↑ₘA⁻¹

{n : Type u}
[DecidableEq n]
[Fintype n]
{R : Type v}
[CommRing R]
(A : Matrix.SpecialLinearGroup n R)

↑(Matrix.SpecialLinearGroup.toLin' A).symm = Matrix.toLin' ↑A⁻¹


theorem dist_eq_sub_of_le {n m : ℕ} (h : n ≤ m) : dist n m = m - n


/-- The constant coefficient of the minimal polynomial of `x` is `0` if and only if `x = 0`. -/
@[simp]
theorem coeff_zero_eq_zero (hx : IsIntegral A x) : coeff (minpoly A x) 0 = 0 ↔ x = 0

{A : Type u_1}
{B : Type u_2}
[Field A]
[Ring B]
[IsDomain B]
[Algebra A B]
{x : B}
(hx : IsIntegral A x)


@[to_additive]
theorem mem_mul : a ∈ s * t ↔ ∃ x ∈ s, ∃ y ∈ t, x * y = a

{α : Type u_2}
[Add α]
{s t : Set α}
{a : α}


theorem normUnit_X : normUnit (X : k⟦X⟧) = 1


theorem measure_eq_zero_or_one_of_indepSet_self [IsFiniteMeasure μ] {t : Set Ω}
    (h_indep : IndepSet t t μ) : μ t = 0 ∨ μ t = 1

(h_indep : ProbabilityTheory.IndepSet t t μ)


theorem jointly_surjective' (k : K) (x : (colimit F).obj k) : ∃ j y, x = (colimit.ι F j).app k y

(F : CategoryTheory.Functor J (CategoryTheory.Functor K TypeMax))

(x : (CategoryTheory.Limits.colimit F).obj k)

∃ j y, x = (CategoryTheory.Limits.colimit.ι F j).app k y


@[to_additive]
theorem map_injective {f : G →* N} (h : Function.Injective f) : Function.Injective (map f)

{G : Type u_1}
[AddGroup G]
{N : Type u_5}
[AddGroup N]
{f : G →+ N}
(h : Function.Injective ⇑f)


theorem nhdsWithin_Ici_eq' [TopologicalSpace α] [Preorder α] [OrderTopology α] {a : α}
    (ha : ∃ u, a < u) : 𝓝[≥] a = ⨅ (u) (_ : a < u), 𝓟 (Ico a u)

{α : Type u}
[TopologicalSpace α]
[Preorder α]
[OrderTopology α]
{a : α}
(ha : ∃ u, a < u)

𝓝[≥] a = ⨅ u, ⨅ (_ : a < u), 𝓟 (Set.Ico a u)


/-- The angle at the apex of an isosceles triangle is `π` minus twice a base angle, oriented
angle-at-point form where the apex is given as the center of a circle. -/
theorem oangle_eq_pi_sub_two_zsmul_oangle_center_left {s : Sphere P} {p₁ p₂ : P} (hp₁ : p₁ ∈ s)
    (hp₂ : p₂ ∈ s) (h : p₁ ≠ p₂) : ∡ p₁ s.center p₂ = π - (2 : ℤ) • ∡ s.center p₂ p₁

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

∡ p₁ s.center p₂ = ↑π - 2 • ∡ s.center p₂ p₁


/-- Composition by continuous linear maps on the right preserves `C^n` functions on domains. -/
theorem ContDiffOn.comp_continuousLinearMap (hf : ContDiffOn 𝕜 n f s) (g : G →L[𝕜] E) :
    ContDiffOn 𝕜 n (f ∘ g) (g ⁻¹' s)

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


theorem disjoint_closure_left (h : SeparatedNhds s t) : Disjoint (closure s) t

{X : Type u_1}
[TopologicalSpace X]
{s t : Set X}
(h : SeparatedNhds s t)


@[simp]
theorem Finsupp.toFreeAbelianGroup_toFinsupp {X} (x : FreeAbelianGroup X) :
    Finsupp.toFreeAbelianGroup (FreeAbelianGroup.toFinsupp x) = x


theorem isNoetherian_iff_wellFounded :
    IsNoetherian R M ↔ WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop)

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

IsNoetherian R M ↔ WellFounded fun x x_1 => x > x_1


/-- If a decreasing sequence of real numbers is summable on one residue class
modulo `m`, then it is also summable on every other residue class mod `m`. -/
lemma summable_indicator_mod_iff_summable_indicator_mod {m : ℕ} [NeZero m] {f : ℕ → ℝ}
    (hf : Antitone f) {k : ZMod m} (l : ZMod m)
    (hs : Summable ({n : ℕ | (n : ZMod m) = k}.indicator f)) :
    Summable ({n : ℕ | (n : ZMod m) = l}.indicator f)

(hs : Summable ({n | ↑n = k}.indicator f))


/-- `mapCommMon` is functorial in the lax braided functor. -/
@[simps]
def mapCommMonFunctor : LaxBraidedFunctor C D ⥤ CommMon_ C ⥤ CommMon_ D

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

∀ {X Y : CategoryTheory.LaxBraidedFunctor C D} (α : X ⟶ Y) (A : CommMon_ C),
  (((CategoryTheory.LaxBraidedFunctor.mapCommMonFunctor C D).map α).app A).hom = α.app A.X


/-- A translate of a block is a block -/
theorem IsBlock.translate {B : Set X} (g : G) (hB : IsBlock G B) :
    IsBlock G (g • B)

{G : Type u_1}
[Group G]
{X : Type u_2}
[MulAction G X]
{B : Set X}
(g : G)
(hB : MulAction.IsBlock G B)


@[simp]
protected theorem union (hs : NullMeasurableSet s μ) (ht : NullMeasurableSet t μ) :
    NullMeasurableSet (s ∪ t) μ

(hs : MeasureTheory.NullMeasurableSet s μ)

(ht : MeasureTheory.NullMeasurableSet t μ)

MeasureTheory.NullMeasurableSet (s ∪ t) μ


lemma comapOn_preimage_eq (N : Matroid β) (f : α → β) : N.comapOn (f ⁻¹' N.E) f = N.comap f

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


@[fun_prop]
theorem DifferentiableWithinAt.clm_apply (hc : DifferentiableWithinAt 𝕜 c s x)
    (hu : DifferentiableWithinAt 𝕜 u s x) : DifferentiableWithinAt 𝕜 (fun y => (c y) (u y)) s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{x : E}
{s : Set E}
{H : Type u_6}
[NormedAddCommGroup H]
[NormedSpace 𝕜 H]
{c : E → G →L[𝕜] H}
{u : E → G}
(hc : DifferentiableWithinAt 𝕜 c s x)
(hu : DifferentiableWithinAt 𝕜 u s x)


theorem cutMap_bddAbove (a : α) : BddAbove (cutMap β a)

{α : Type u_2}
(β : Type u_3)
[LinearOrderedField α]
[LinearOrderedField β]
[Archimedean α]
(a : α)

BddAbove (LinearOrderedField.cutMap β a)


@[simp]
theorem pointwise_smul_le_pointwise_smul_iff {g : G} {S T : ValuationSubring K} :
    g • S ≤ g • T ↔ S ≤ T

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


theorem homothety_eq_lineMap (c : P1) (r : k) (p : P1) : homothety c r p = lineMap c p r

{k : Type u_2}
{V1 : Type u_3}
{P1 : Type u_4}
[CommRing k]
[AddCommGroup V1]
[AffineSpace V1 P1]
[Module k V1]
(c : P1)
(r : k)
(p : P1)

(AffineMap.homothety c r) p = (AffineMap.lineMap c p) r


theorem hasStrictDerivAt_cosh (x : ℝ) : HasStrictDerivAt cosh (sinh x) x

HasStrictDerivAt Real.cosh (Real.sinh x) x


/-- If
```
(f 0)
(0 g)
```
is invertible, then `g` is invertible.
-/
theorem isIso_right_of_isIso_biprod_map {W X Y Z : C} (f : W ⟶ Y) (g : X ⟶ Z)
    [IsIso (biprod.map f g)] : IsIso g

[CategoryTheory.IsIso (CategoryTheory.Limits.biprod.map f g)]


theorem leibniz_invOf [Invertible a] : D (⅟ a) = -⅟ a ^ 2 • D a

{R : Type u_1}
[CommRing R]
{A : Type u_2}
[CommRing A]
[Algebra R A]
{M : Type u_3}
[AddCommGroup M]
[Module A M]
[Module R M]
(D : Derivation R A M)
(a : A)
[Invertible a]


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

(inl_mul : ∀ (m : M) (x : Monoid.Coprod M N), C x → C (Monoid.Coprod.inl m * x))

(inr_mul : ∀ (n : N) (x : Monoid.Coprod M N), C x → C (Monoid.Coprod.inr n * x))


@[to_additive (attr := continuity, fun_prop)]
theorem Continuous.smul (hf : Continuous f) (hg : Continuous g) : Continuous fun x => f x • g x

{M : Type u_1}
{X : Type u_2}
{Y : Type u_3}
[TopologicalSpace M]
[TopologicalSpace X]
[TopologicalSpace Y]
[VAdd M X]
[ContinuousVAdd M X]
{f : Y → M}
{g : Y → X}
(hf : Continuous f)
(hg : Continuous g)


theorem normalizeScaleRoots_degree : (normalizeScaleRoots p).degree = p.degree


@[simp]
theorem coe_copy (S : LieSubmodule R L M) (s : Set M) (hs : s = ↑S) : (S.copy s hs : Set M) = s

{R : Type u}
{L : Type v}
{M : Type w}
[CommRing R]
[LieRing L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
(S : LieSubmodule R L M)
(s : Set M)
(hs : s = ↑S)


theorem zipWith_comm_of_comm (f : α → α → β) (comm : ∀ x y : α, f x y = f y x) (l l' : List α) :
    zipWith f l l' = zipWith f l' l

{α : Type u}
{β : Type u_1}
(f : α → α → β)
(comm : ∀ (x y : α), f x y = f y x)
(l l' : List α)

List.zipWith f l l' = List.zipWith f l' l


protected theorem Dense.exists_lt [NoMinOrder α] {s : Set α} (hs : Dense s) (x : α) :
    ∃ y ∈ s, y < x

{α : Type u}
[TopologicalSpace α]
[LinearOrder α]
[ClosedIciTopology α]
[NoMinOrder α]
{s : Set α}
(hs : Dense s)
(x : α)


/-- The sign extension is the same as zero extending when `msb = false`. -/
theorem signExtend_eq_not_zeroExtend_not_of_msb_false {x : BitVec w} {v : Nat} (hmsb : x.msb = false) :
    x.signExtend v = x.zeroExtend v

{w : Nat}
{x : BitVec w}
{v : Nat}
(hmsb : x.msb = false)

BitVec.signExtend v x = BitVec.zeroExtend v x


theorem map_addHaar_smul {r : ℝ} (hr : r ≠ 0) :
    Measure.map (r • ·) μ = ENNReal.ofReal (abs (r ^ finrank ℝ E)⁻¹) • μ

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[MeasurableSpace E]
[BorelSpace E]
[FiniteDimensional ℝ E]
(μ : MeasureTheory.Measure E)
[μ.IsAddHaarMeasure]
{r : ℝ}
(hr : r ≠ 0)

MeasureTheory.Measure.map (fun x => r • x) μ = ENNReal.ofReal |(r ^ FiniteDimensional.finrank ℝ E)⁻¹| • μ


@[simp]
theorem antidiagonal_cons (a : α) (s) :
    antidiagonal (a ::ₘ s) =
      map (Prod.map id (cons a)) (antidiagonal s) + map (Prod.map (cons a) id) (antidiagonal s)

(a ::ₘ s).antidiagonal =
  Multiset.map (Prod.map id (Multiset.cons a)) s.antidiagonal +
    Multiset.map (Prod.map (Multiset.cons a) id) s.antidiagonal


@[simp]
theorem snd_prod (f : A →⋆ₐ[R] B) (g : A →⋆ₐ[R] C) : (snd R B C).comp (prod f g) = g

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
{C : Type u_4}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[Star A]
[Semiring B]
[Algebra R B]
[Star B]
[Semiring C]
[Algebra R C]
[Star C]
(f : A →⋆ₐ[R] B)
(g : A →⋆ₐ[R] C)

(StarAlgHom.snd R B C).comp (f.prod g) = g


@[simp]
theorem symm_trans_apply (e₁ : A ≃⋆ₐ[R] B) (e₂ : B ≃⋆ₐ[R] C) (x : C) :
    (e₁.trans e₂).symm x = e₁.symm (e₂.symm x)

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


@[simp]
theorem le_inter_iff : s ≤ t ∩ u ↔ s ≤ t ∧ s ≤ u

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


lemma ofReal_cdf [IsProbabilityMeasure μ] (x : ℝ) : ENNReal.ofReal (cdf μ x) = μ (Iic x)

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

ENNReal.ofReal (↑(ProbabilityTheory.cdf μ) x) = μ (Set.Iic x)


@[simp]
theorem forall₂_nil_left_iff {l} : Forall₂ R nil l ↔ l = nil

{α : Type u_1}
{β : Type u_2}
{R : α → β → Prop}
{l : List β}


@[simp] theorem size_extract (as : Array α) (start stop : Nat) :
    (as.extract start stop).size = min stop as.size - start

{α : Type u_1}
(as : Array α)
(start stop : Nat)


theorem mul_left_inj_of_invertible : c * a = c * b ↔ a = b

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


@[simp]
theorem floor_zero : ⌊(0 : α)⌋ = 0

{α : Type u_2}
[LinearOrderedRing α]
[FloorRing α]


@[to_additive]
theorem div (hf : LipschitzWith Kf f) (hg : LipschitzWith Kg g) :
    LipschitzWith (Kf + Kg) fun x => f x / g x

{α : Type u_5}
{E : Type u_6}
[SeminormedAddCommGroup E]
[PseudoEMetricSpace α]
{Kf Kg : ℝ≥0}
{f g : α → E}
(hf : LipschitzWith Kf f)
(hg : LipschitzWith Kg g)

LipschitzWith (Kf + Kg) fun x => f x - g x


/-- A linear isometric equivalence preserves the property of being orthonormal. -/
theorem Orthonormal.comp_linearIsometryEquiv {v : ι → E} (hv : Orthonormal 𝕜 v) (f : E ≃ₗᵢ[𝕜] E') :
    Orthonormal 𝕜 (f ∘ v)

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


/-- The definition of an altitude. -/
theorem altitude_def {n : ℕ} (s : Simplex ℝ P (n + 1)) (i : Fin (n + 2)) :
    s.altitude i =
      mk' (s.points i) (affineSpan ℝ (s.points '' ↑(univ.erase i))).directionᗮ ⊓
        affineSpan ℝ (Set.range s.points)

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

s.altitude i =
  AffineSubspace.mk' (s.points i) (affineSpan ℝ (s.points '' ↑(Finset.univ.erase i))).directionᗮ ⊓
    affineSpan ℝ (Set.range s.points)


/--
`f` is a mono if the pullback cone `(𝟙 X, 𝟙 X)` is a limit for the pair `(f, f)`. The converse is
given in `PullbackCone.is_id_of_mono`.
-/
theorem mono_of_isLimitMkIdId (f : X ⟶ Y) (t : IsLimit (mk (𝟙 X) (𝟙 X) rfl : PullbackCone f f)) :
    Mono f

(t : CategoryTheory.Limits.IsLimit (CategoryTheory.Limits.PullbackCone.mk (𝟙 X) (𝟙 X) ⋯))


@[to_additive (attr := simp)]
theorem toLex_inv [Inv α] (a : α) : toLex a⁻¹ = (toLex a)⁻¹


lemma setLIntegral_eq_of_support_subset {s : Set α} {f : α → ℝ≥0∞} (hsf : f.support ⊆ s) :
    ∫⁻ x in s, f x ∂μ = ∫⁻ x, f x ∂μ

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s : Set α}
{f : α → ℝ≥0∞}
(hsf : Function.support f ⊆ s)

∫⁻ (x : α) in s, f x ∂μ = ∫⁻ (x : α), f x ∂μ


theorem average_char_eq_finrank_invariants (V : FDRep k G) :
    ⅟ (Fintype.card G : k) • ∑ g : G, V.character g = finrank k (invariants V.ρ)

{k : Type u}
[Field k]
{G : Type u}
[Group G]
[Fintype G]
[Invertible ↑(Fintype.card G)]
(V : FDRep k G)

⅟↑(Fintype.card G) • ∑ g : G, V.character g = ↑(FiniteDimensional.finrank k ↥(Representation.invariants V.ρ))


/-- If `f` tends to infinity along a nontrivial filter `l`, then
`fun x ↦ f x * r` tends to infinity if and only if `0 < r. `-/
theorem tendsto_mul_const_atTop_iff_pos [NeBot l] (h : Tendsto f l atTop) :
    Tendsto (fun x => f x * r) l atTop ↔ 0 < r

{α : Type u_3}
{β : Type u_4}
[LinearOrderedSemifield α]
{l : Filter β}
{f : β → α}
{r : α}
[l.NeBot]
(h : Filter.Tendsto f l Filter.atTop)

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


@[simp]
theorem disjoint_nhds_nhds [T2Space X] {x y : X} : Disjoint (𝓝 x) (𝓝 y) ↔ x ≠ y

{X : Type u_1}
[TopologicalSpace X]
[T2Space X]
{x y : X}


lemma specializes_iff_exterior_subset : x ⤳ y ↔ exterior {x} ⊆ exterior {y}

{α : Type u_3}
[TopologicalSpace α]
{x y : α}
[AlexandrovDiscrete α]


theorem lt_succ_of_le {n m : Nat} : n ≤ m → n < succ m


theorem map_smul_right (r : R) (f : M →ₗ[A] P) (g : N →ₗ[R] Q) : map f (r • g) = r • map f g

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

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


/-- The `MulHom` from a subsemigroup to its image.
See `MulEquiv.subsemigroupMap` for a variant for `MulEquiv`s. -/
@[to_additive (attr := simps)
      "the `AddHom` from an additive subsemigroup to its image. See
      `AddEquiv.addSubsemigroupMap` for a variant for `AddEquiv`s."]
def subsemigroupMap (f : M →ₙ* N) (M' : Subsemigroup M) :
    M' →ₙ* M'.map f

{M : Type u_1}
{N : Type u_2}
[Mul M]
[Mul N]
(f : M →ₙ* N)
(M' : Subsemigroup M)
(x : ↥M')


/-- The only divisors of prime powers are prime powers. -/
theorem eq_pow_find_of_dvd_irreducible_pow {a p : Associates α} (hp : Irreducible p)
    [∀ n : ℕ, Decidable (a ∣ p ^ n)] {n : ℕ} (h : a ∣ p ^ n) :
    a = p ^ @Nat.find (fun n => a ∣ p ^ n) _ ⟨n, h⟩

{α : Type u_1}
[CancelCommMonoidWithZero α]
[UniqueFactorizationMonoid α]
{a p : Associates α}
(hp : Irreducible p)
[(n : ℕ) → Decidable (a ∣ p ^ n)]
{n : ℕ}
(h : a ∣ p ^ n)


theorem IsRelPrime.prod_right_iff : IsRelPrime x (∏ i ∈ t, s i) ↔ ∀ i ∈ t, IsRelPrime x (s i)

{α : Type u_1}
{I : Type u_2}
[CommMonoid α]
[DecompositionMonoid α]
{x : α}
{s : I → α}
{t : Finset I}


@[simp]
theorem fun_inv_map (F : C ⥤ D) [IsEquivalence F] (X Y : D) (f : X ⟶ Y) :
    F.map (F.inv.map f) = F.asEquivalence.counit.app X ≫ f ≫ F.asEquivalence.counitInv.app Y

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

F.map (F.inv.map f) =
  CategoryTheory.CategoryStruct.comp (F.asEquivalence.counit.app X)
    (CategoryTheory.CategoryStruct.comp f (F.asEquivalence.counitInv.app Y))


theorem Antitone.quasiconvexOn (hf : Antitone f) : QuasiconvexOn 𝕜 univ f

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_4}
[OrderedSemiring 𝕜]
[LinearOrderedAddCommMonoid E]
[OrderedAddCommMonoid β]
[Module 𝕜 E]
[OrderedSMul 𝕜 E]
{f : E → β}
(hf : Antitone f)


theorem abs_im_div_norm_le_one (z : K) : |im z / ‖z‖| ≤ 1


/-- A closed embedding is proper, ie, inverse images of Lindelöf sets are contained in Lindelöf.
Moreover, the preimage of a Lindelöf set is Lindelöf, see `ClosedEmbedding.isLindelof_preimage`. -/
theorem ClosedEmbedding.tendsto_coLindelof {f : X → Y} (hf : ClosedEmbedding f) :
    Tendsto f (Filter.coLindelof X) (Filter.coLindelof Y)

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]
{f : X → Y}
(hf : ClosedEmbedding f)

Filter.Tendsto f (Filter.coLindelof X) (Filter.coLindelof Y)


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

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

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

[self : CategoryTheory.Pretriangulated C]

(T : CategoryTheory.Pretriangulated.Triangle C)

T ∈ CategoryTheory.Pretriangulated.distinguishedTriangles ↔
  T.rotate ∈ CategoryTheory.Pretriangulated.distinguishedTriangles


@[to_additive (attr := simp)]
theorem trans_apply (e₁ : M ≃* N) (e₂ : N ≃* P) (m : M) : e₁.trans e₂ m = e₂ (e₁ m)

{M : Type u_6}
{N : Type u_7}
{P : Type u_8}
[Mul M]
[Mul N]
[Mul P]
(e₁ : M ≃* N)
(e₂ : N ≃* P)
(m : M)


private theorem prime_C_iff_of_fintype {R : Type u} (σ : Type v) {r : R} [CommRing R] [Fintype σ] :
    Prime (C r : MvPolynomial σ R) ↔ Prime r


theorem taylor_zero (f : R[X]) : taylor 0 f = f

{R : Type u_1}
[Semiring R]
(f : Polynomial R)


@[to_additive]
theorem div_right_injective : Function.Injective fun a ↦ b / a


@[to_additive]
lemma compl_mul_closure_one_eq {t : Set G} (ht : t * (closure {1} : Set G) = t) :
    tᶜ * (closure {1} : Set G) = tᶜ

{G : Type w}
[TopologicalSpace G]
[Group G]
[TopologicalGroup G]
{t : Set G}
(ht : t * closure {1} = t)


/-- Postcompose a partial equivalence with an equivalence.
We modify the source and target to have better definitional behavior. -/
@[simps!]
def transEquiv (e : PartialEquiv α β) (f' : β ≃ γ) : PartialEquiv α γ

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
(e : PartialEquiv α β)
(f' : β ≃ γ)

∀ (a : γ), ↑(e.transEquiv f').symm a = ↑e.symm (f'.symm a)


theorem nonUnitalRingHom_injective {γ : Type w} [Nonempty I]
    [∀ i, NonUnitalNonAssocSemiring (f i)] [NonUnitalNonAssocSemiring γ] (g : ∀ i, γ →ₙ+* f i)
    (hg : ∀ i, Function.Injective (g i)) : Function.Injective (Pi.nonUnitalRingHom g)

[(i : I) → NonUnitalNonAssocSemiring (f i)]

(hg : ∀ (i : I), Function.Injective ⇑(g i))


theorem IsPFilter.of_def [Preorder P] {F : Set P} (nonempty : F.Nonempty)
    (directed : DirectedOn (· ≥ ·) F) (mem_of_le : ∀ {x y : P}, x ≤ y → x ∈ F → y ∈ F) :
    IsPFilter F

(directed : DirectedOn (fun x x_1 => x ≥ x_1) F)


theorem sign (h : IsThreeCycle σ) : sign σ = 1

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


@[simp]
theorem floor_fract (a : α) : ⌊fract a⌋ = 0

{α : Type u_2}
[LinearOrderedRing α]
[FloorRing α]
(a : α)


@[to_additive]
theorem isComplement_singleton_univ {g : G} : IsComplement ({g} : Set G) univ


/-- If a ball in a proper space includes a closed set `s`, then there exists a ball with the same
center and a strictly smaller radius that includes `s`. -/
theorem exists_lt_subset_ball (hs : IsClosed s) (h : s ⊆ ball x r) : ∃ r' < r, s ⊆ ball x r'

{α : Type u_1}
[PseudoMetricSpace α]
[ProperSpace α]
{x : α}
{r : ℝ}
{s : Set α}
(hs : IsClosed s)
(h : s ⊆ Metric.ball x r)


theorem restrictScalars_injective :
    Function.Injective (restrictScalars R : (A ≃ₐ[S] B) → A ≃ₐ[R] B)

(R : Type u)
{S : Type v}
{A : Type w}
{B : Type u₁}
[CommSemiring R]
[CommSemiring S]
[Semiring A]
[Semiring B]
[Algebra R S]
[Algebra S A]
[Algebra S B]
[Algebra R A]
[Algebra R B]
[IsScalarTower R S A]
[IsScalarTower R S B]


@[simp, norm_cast]
theorem coe_prodMap' [Module R₁ M₂] [Module R₁ M₃] [Module R₁ M₄] (f₁ : M₁ →L[R₁] M₂)
    (f₂ : M₃ →L[R₁] M₄) : ⇑(f₁.prodMap f₂) = Prod.map f₁ f₂

{R₁ : Type u_1}
[Semiring R₁]
{M₁ : Type u_4}
[TopologicalSpace M₁]
[AddCommMonoid M₁]
{M₂ : Type u_6}
[TopologicalSpace M₂]
[AddCommMonoid M₂]
{M₃ : Type u_7}
[TopologicalSpace M₃]
[AddCommMonoid M₃]
{M₄ : Type u_8}
[TopologicalSpace M₄]
[AddCommMonoid M₄]
[Module R₁ M₁]
[Module R₁ M₂]
[Module R₁ M₃]
[Module R₁ M₄]
(f₁ : M₁ →L[R₁] M₂)
(f₂ : M₃ →L[R₁] M₄)


theorem ascFactorial_of_sub {n k : ℕ} :
    (n - k) * (n - k + 1).ascFactorial k = (n - k).ascFactorial (k + 1)


@[simp] theorem toFin_cast (h : w = v) (x : BitVec w) :
    (cast h x).toFin = x.toFin.cast (by rw [h])

(BitVec.cast h x).toFin = Fin.cast ⋯ x.toFin


@[to_additive (attr := simp)]
theorem inter_inv : (s ∩ t)⁻¹ = s⁻¹ ∩ t⁻¹

(s ∩ t)⁻¹ = s⁻¹ ∩ t⁻¹


theorem xor_lt_two_pow {x y n : Nat} (left : x < 2^n) (right : y < 2^n) : x ^^^ y < 2^n

{x y n : Nat}
(left : x < 2 ^ n)
(right : y < 2 ^ n)


/-- See note [partially-applied ext lemmas]. -/
@[ext high]
theorem nonUnitalAlgHom_ext' [DistribMulAction k A] {φ₁ φ₂ : MonoidAlgebra k G →ₙₐ[k] A}
    (h : φ₁.toMulHom.comp (ofMagma k G) = φ₂.toMulHom.comp (ofMagma k G)) : φ₁ = φ₂

(h : φ₁.toMulHom.comp (MonoidAlgebra.ofMagma k G) = φ₂.toMulHom.comp (MonoidAlgebra.ofMagma k G))


/-- The functor `Square C ⥤ Square D` induced by a functor `C ⥤ D`. -/
@[simps]
def mapSquare (F : C ⥤ D) : Square C ⥤ Square D

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

(CategoryTheory.Functor.mapSquare C F).obj sq = sq.map F


theorem exp_neg (A : Matrix m m 𝔸) : exp 𝕂 (-A) = (exp 𝕂 A)⁻¹

(𝕂 : Type u_1)
{m : Type u_2}
{𝔸 : Type u_6}
[RCLike 𝕂]
[Fintype m]
[DecidableEq m]
[NormedCommRing 𝔸]
[NormedAlgebra 𝕂 𝔸]
[CompleteSpace 𝔸]
(A : Matrix m m 𝔸)

NormedSpace.exp 𝕂 (-A) = (NormedSpace.exp 𝕂 A)⁻¹


@[simp] lemma mem_singleton [T1Space α] {a b : α} : a ∈ singleton b ↔ a = b

{α : Type u_2}
[TopologicalSpace α]
[T1Space α]
{a b : α}

a ∈ TopologicalSpace.IrreducibleCloseds.singleton b ↔ a = b


theorem glb_Ioi_eq_self_or_Ioi_eq_Ici [PartialOrder γ] {j : γ} (i : γ) (hj : IsGLB (Ioi i) j) :
    j = i ∨ Ioi i = Ici j

{γ : Type w}
[PartialOrder γ]
{j : γ}
(i : γ)
(hj : IsGLB (Set.Ioi i) j)


/-- If the angle between two vectors is 0, the norm of their sum equals
the sum of their norms. -/
theorem norm_add_eq_add_norm_of_angle_eq_zero {x y : V} (h : angle x y = 0) :
    ‖x + y‖ = ‖x‖ + ‖y‖

(h : InnerProductGeometry.angle x y = 0)


/-- The second morphism of triangles given an octahedron. -/
@[simps]
def triangleMorphism₂ : Triangle.mk u₁₃ v₁₃ w₁₃ ⟶ Triangle.mk u₂₃ v₂₃ w₂₃

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

{comm : CategoryTheory.CategoryStruct.comp u₁₂ u₂₃ = u₁₃}

{v₁₂ : X₂ ⟶ Z₁₂}

{w₁₂ : Z₁₂ ⟶ (CategoryTheory.shiftFunctor C 1).obj X₁}

{h₁₂ : CategoryTheory.Pretriangulated.Triangle.mk u₁₂ v₁₂ w₁₂ ∈ CategoryTheory.Pretriangulated.distinguishedTriangles}

{v₂₃ : X₃ ⟶ Z₂₃}

{w₂₃ : Z₂₃ ⟶ (CategoryTheory.shiftFunctor C 1).obj X₂}

{h₂₃ : CategoryTheory.Pretriangulated.Triangle.mk u₂₃ v₂₃ w₂₃ ∈ CategoryTheory.Pretriangulated.distinguishedTriangles}

{v₁₃ : X₃ ⟶ Z₁₃}

{w₁₃ : Z₁₃ ⟶ (CategoryTheory.shiftFunctor C 1).obj X₁}

{h₁₃ : CategoryTheory.Pretriangulated.Triangle.mk u₁₃ v₁₃ w₁₃ ∈ CategoryTheory.Pretriangulated.distinguishedTriangles}

(h : CategoryTheory.Triangulated.Octahedron comm h₁₂ h₂₃ h₁₃)

h.triangleMorphism₂.hom₂ = CategoryTheory.CategoryStruct.id X₃


@[simp]
theorem Quotient.lift₂_mk {α : Sort*} {β : Sort*} {γ : Sort*} [Setoid α] [Setoid β]
    (f : α → β → γ)
    (h : ∀ (a₁ : α) (a₂ : β) (b₁ : α) (b₂ : β), a₁ ≈ b₁ → a₂ ≈ b₂ → f a₁ a₂ = f b₁ b₂)
    (a : α) (b : β) :
    Quotient.lift₂ f h (Quotient.mk _ a) (Quotient.mk _ b) = f a b

(f : α → β → γ)


theorem infiniteNeg_of_tendsto_bot {f : ℕ → ℝ} (hf : Tendsto f atTop atBot) :
    InfiniteNeg (ofSeq f)

(hf : Filter.Tendsto f Filter.atTop Filter.atBot)


theorem opNorm_nonneg (f : E →SL[σ₁₂] F) : 0 ≤ ‖f‖

{𝕜 : Type u_1}
{𝕜₂ : Type u_2}
{E : Type u_4}
{F : Type u_6}
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup F]
[NontriviallyNormedField 𝕜]
[NontriviallyNormedField 𝕜₂]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜₂ F]
{σ₁₂ : 𝕜 →+* 𝕜₂}
(f : E →SL[σ₁₂] F)


theorem IsBigO.congr_left (h : f₁ =O[l] g) (hf : ∀ x, f₁ x = f₂ x) : f₂ =O[l] g

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


@[to_additive]
theorem IsLowerSet.inv (hs : IsLowerSet s) : IsUpperSet s⁻¹

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


theorem hasStrictDerivAt_exp_smul_const_of_mem_ball' (x : 𝔸) (t : 𝕂)
    (htx : t • x ∈ EMetric.ball (0 : 𝔸) (expSeries 𝕂 𝔸).radius) :
    HasStrictDerivAt (fun u : 𝕂 => exp 𝕂 (u • x)) (x * exp 𝕂 (t • x)) t

(htx : t • x ∈ EMetric.ball 0 (NormedSpace.expSeries 𝕂 𝔸).radius)

HasStrictDerivAt (fun u => NormedSpace.exp 𝕂 (u • x)) (x * NormedSpace.exp 𝕂 (t • x)) t


@[simp]
theorem sum_sub [Zero M] [AddCommGroup G] {f : α →₀ M} {h₁ h₂ : α → M → G} :
    (f.sum fun a b => h₁ a b - h₂ a b) = f.sum h₁ - f.sum h₂

{α : Type u_1}
{M : Type u_8}
{G : Type u_12}
[Zero M]
[AddCommGroup G]
{f : α →₀ M}
{h₁ h₂ : α → M → G}


/-- The cosine of the angle between three points is -1 if and only if the angle is π. -/
nonrec theorem cos_eq_neg_one_iff_angle_eq_pi {p₁ p₂ p₃ : P} :
    Real.cos (∠ p₁ p₂ p₃) = -1 ↔ ∠ p₁ p₂ p₃ = π

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{p₁ p₂ p₃ : P}

Real.cos (EuclideanGeometry.angle p₁ p₂ p₃) = -1 ↔ EuclideanGeometry.angle p₁ p₂ p₃ = π


nonrec theorem SmoothWithinAt.prod_mk_space {f : M → E'} {g : M → F'}
    (hf : SmoothWithinAt I 𝓘(𝕜, E') f s x) (hg : SmoothWithinAt I 𝓘(𝕜, F') g s x) :
    SmoothWithinAt I 𝓘(𝕜, E' × F') (fun x => (f x, g x)) s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{F' : Type u_14}
[NormedAddCommGroup F']
[NormedSpace 𝕜 F']
{s : Set M}
{x : M}
{f : M → E'}
{g : M → F'}
(hf : SmoothWithinAt I 𝓘(𝕜, E') f s x)
(hg : SmoothWithinAt I 𝓘(𝕜, F') g s x)


/-- Writing explicitly the `n+1`-th derivative as the composition of a currying linear equiv,
and the derivative of the `n`-th derivative. -/
theorem iteratedFDeriv_succ_eq_comp_left {n : ℕ} :
    iteratedFDeriv 𝕜 (n + 1) f =
      continuousMultilinearCurryLeftEquiv 𝕜 (fun _ : Fin (n + 1) => E) F ∘
        fderiv 𝕜 (iteratedFDeriv 𝕜 n f)

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{n : ℕ}

iteratedFDeriv 𝕜 (n + 1) f = ⇑(continuousMultilinearCurryLeftEquiv 𝕜 (fun x => E) F) ∘ fderiv 𝕜 (iteratedFDeriv 𝕜 n f)


@[to_additive] theorem openEmbedding_mk : OpenEmbedding (@mk M)


theorem continuous_iInf_rng {t₁ : TopologicalSpace α} {t₂ : ι → TopologicalSpace β} :
    Continuous[t₁, iInf t₂] f ↔ ∀ i, Continuous[t₁, t₂ i] f

{α : Type u}
{β : Type v}
{f : α → β}
{ι : Sort u_2}
{t₁ : TopologicalSpace α}
{t₂ : ι → TopologicalSpace β}


@[to_additive]
theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b))

{M : Type u_3}
[TopologicalSpace M]
[Mul M]
[ContinuousMul M]
{a b : M}

Filter.Tendsto (fun p => p.1 * p.2) (𝓝 (a, b)) (𝓝 (a * b))


theorem smoothWithinAt_iff :
    SmoothWithinAt I I' f s x ↔
      ContinuousWithinAt f s x ∧
        ContDiffWithinAt 𝕜 ∞ (extChartAt I' (f x) ∘ f ∘ (extChartAt I x).symm)
          ((extChartAt I x).symm ⁻¹' s ∩ range I) (extChartAt I x x)

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

SmoothWithinAt I I' f s x ↔
  ContinuousWithinAt f s x ∧
    ContDiffWithinAt 𝕜 ⊤ (↑(extChartAt I' (f x)) ∘ f ∘ ↑(extChartAt I x).symm)
      (↑(extChartAt I x).symm ⁻¹' s ∩ Set.range ↑I) (↑(extChartAt I x) x)


@[simp, norm_cast] lemma coe_mk (q : ℚ) (hq) : NNRat.cast ⟨q, hq⟩ = q


@[simp, reassoc, elementwise]
theorem invApp_app (U : Opens X) :
    invApp f U ≫ f.c.app (op (opensFunctor f |>.obj U)) =
      X.presheaf.map (eqToHom (by simp [Opens.map, Set.preimage_image_eq _ H.base_open.inj]))

{X Y : AlgebraicGeometry.PresheafedSpace C}

[H : AlgebraicGeometry.PresheafedSpace.IsOpenImmersion f]

AlgebraicGeometry.PresheafedSpace.IsOpenImmersion.invApp f U ≫
    f.c.app (Opposite.op ((AlgebraicGeometry.PresheafedSpace.IsOpenImmersion.opensFunctor f).obj U)) =
  X.presheaf.map (CategoryTheory.eqToHom ⋯)


@[measurability]
theorem measurable_natCast [NatCast α] (n : ℕ) : Measurable (n : β → α)

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
[MeasurableSpace β]
[NatCast α]
(n : ℕ)


theorem equiv_zero_iff_ge : (G ≈ 0) ↔ 0 ≤ G


theorem sub_tmul (m₁ m₂ : M) (n : N) : (m₁ - m₂) ⊗ₜ n = m₁ ⊗ₜ[R] n - m₂ ⊗ₜ[R] n

{R : Type u_1}
[CommSemiring R]
{M : Type u_2}
{N : Type u_3}
[AddCommGroup M]
[AddCommGroup N]
[Module R M]
[Module R N]
(m₁ m₂ : M)
(n : N)

(m₁ - m₂) ⊗ₜ[R] n = m₁ ⊗ₜ[R] n - m₂ ⊗ₜ[R] n


@[simp]
theorem card_Iio : (Iio b).card = b


/-- If a function has an invertible strict derivative at all points, then it is an open map. -/
theorem isOpenMap_of_hasStrictFDerivAt_equiv [CompleteSpace E] {f : E → F} {f' : E → E ≃L[𝕜] F}
    (hf : ∀ x, HasStrictFDerivAt f (f' x : E →L[𝕜] F) x) : IsOpenMap f

(hf : ∀ (x : E), HasStrictFDerivAt f (↑(f' x)) x)


theorem coe_support_append' [DecidableEq V] {u v w : V} (p : G.Walk u v) (p' : G.Walk v w) :
    ((p.append p').support : Multiset V) = p.support + p'.support - {v}

{V : Type u}
{G : SimpleGraph V}
[DecidableEq V]
{u v w : V}
(p : G.Walk u v)
(p' : G.Walk v w)

↑(p.append p').support = ↑p.support + ↑p'.support - {v}


@[simp]
theorem BinaryFan.π_app_left {X Y : C} (s : BinaryFan X Y) : s.π.app ⟨WalkingPair.left⟩ = s.fst

(s : CategoryTheory.Limits.BinaryFan X Y)

s.π.app { as := CategoryTheory.Limits.WalkingPair.left } = s.fst


theorem contMDiff_inclusion {n : ℕ∞} {U V : Opens M} (h : U ≤ V) :
    ContMDiff I I n (Set.inclusion h : U → V)

{𝕜 : 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]
{n : ℕ∞}
{U V : TopologicalSpace.Opens M}
(h : U ≤ V)


theorem mono_of_epi_of_epi_mono' (hR₁ : R₁.map' 0 2 = 0) (hR₁' : Epi (R₁.map' 1 2))
    (hR₂ : R₂.Exact) (h₀ : Epi (app' φ 0)) (h₁ : Mono (app' φ 1)) :
    Mono (app' φ 2)

{R₁ R₂ : CategoryTheory.ComposableArrows C 2}

(hR₁' : CategoryTheory.Epi (R₁.map' 1 2 ⋯ ⋯))

(h₀ : CategoryTheory.Epi (CategoryTheory.ComposableArrows.app' φ 0 ⋯))

(h₁ : CategoryTheory.Mono (CategoryTheory.ComposableArrows.app' φ 1 ⋯))

CategoryTheory.Mono (CategoryTheory.ComposableArrows.app' φ 2 ⋯)


theorem constantCoeff_one : constantCoeff σ R 1 = 1

{σ : Type u_1}
{R : Type u_2}
[Semiring R]


@[simp]
theorem disjoint_empty_right (s : Finset α) : Disjoint s ∅


@[nontriviality]
theorem linearIndependent_of_subsingleton [Subsingleton R] : LinearIndependent R v

{ι : Type u'}
{R : Type u_2}
{M : Type u_4}
{v : ι → M}
[Semiring R]
[AddCommMonoid M]
[Module R M]
[Subsingleton R]


theorem Pairwise.drop : ∀ {l : List α} {n : Nat}, List.Pairwise R l → List.Pairwise R (l.drop n)

{α : Type u_1}
{R : α → α → Prop}
{l : List α}
{n : Nat}

List.Pairwise R l → List.Pairwise R (List.drop n l)


theorem isTheta_of_norm_eventuallyEq' {g : α → ℝ} (h : (fun x ↦ ‖f' x‖) =ᶠ[l] g) : f' =Θ[l] g

{α : Type u_1}
{E' : Type u_6}
[SeminormedAddCommGroup E']
{f' : α → E'}
{l : Filter α}
{g : α → ℝ}
(h : (fun x => ‖f' x‖) =ᶠ[l] g)


/-- A variant of `prod_range_succ` which pulls off the first term in the product rather than the
last. -/
@[to_additive
"A variant of `sum_range_succ` which pulls off the first term in the sum rather than the last."]
lemma prod_range_succ' (f : ℕ → M) (n : ℕ) :
    ((range n.succ).map f).prod = f 0 * ((range n).map fun i ↦ f i.succ).prod

{M : Type u_4}
[Monoid M]
(f : ℕ → M)
(n : ℕ)

(List.map f (List.range n.succ)).prod = f 0 * (List.map (fun i => f i.succ) (List.range n)).prod


@[simp]
theorem traverse_append :
    ∀ as bs : List α', traverse f (as ++ bs) = (· ++ ·) <$> traverse f as <*> traverse f bs

{F : Type u → Type u}
[Applicative F]
{α' β' : Type u}
(f : α' → F β')
[LawfulApplicative F]
(as bs : List α')

traverse f (as ++ bs) = Seq.seq ((fun x x_1 => x ++ x_1) <$> traverse f as) fun x => traverse f bs


/-- A convex set `s` is strictly convex provided that for any two distinct points `x`, `y` of
`s \ interior s`, the segment with endpoints `x`, `y` has nonempty intersection with
`interior s`. -/
protected theorem Convex.strictConvex {s : Set E} (hs : Convex 𝕜 s)
    (h : (s \ interior s).Pairwise fun x y => ([x -[𝕜] y] \ frontier s).Nonempty) :
    StrictConvex 𝕜 s

(h : (s \ interior s).Pairwise fun x y => ([x-[𝕜]y] \ frontier s).Nonempty)


theorem Indep.indep_restriction (hI : M.Indep I) (hNM : N ≤r M) (hIN : I ⊆ N.E) : N.Indep I

{α : Type u_1}
{M : Matroid α}
{I : Set α}
{N : Matroid α}
(hI : M.Indep I)
(hNM : N.Restriction M)
(hIN : I ⊆ N.E)


theorem IsOrtho.prod {Q₁ : QuadraticMap R M₁ P} {Q₂ : QuadraticMap R M₂ P}
    {v w : M₁ × M₂} (h₁ : Q₁.IsOrtho v.1 w.1) (h₂ : Q₂.IsOrtho v.2 w.2) :
    (Q₁.prod Q₂).IsOrtho v w

{R : Type u_2}
{M₁ : Type u_3}
{M₂ : Type u_4}
{P : Type u_7}
[CommSemiring R]
[AddCommMonoid M₁]
[AddCommMonoid M₂]
[AddCommMonoid P]
[Module R M₁]
[Module R M₂]
[Module R P]
{Q₁ : QuadraticMap R M₁ P}
{Q₂ : QuadraticMap R M₂ P}
{v w : M₁ × M₂}
(h₁ : Q₁.IsOrtho v.1 w.1)
(h₂ : Q₂.IsOrtho v.2 w.2)


@[simp]
theorem coe_flipₗᵢ' : ⇑(flipₗᵢ' E F G σ₂₃ σ₁₃) = flip

{𝕜 : Type u_1}
{𝕜₂ : Type u_2}
{𝕜₃ : Type u_3}
{E : Type u_4}
{F : Type u_6}
{G : Type u_8}
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup F]
[SeminormedAddCommGroup G]
[NontriviallyNormedField 𝕜]
[NontriviallyNormedField 𝕜₂]
[NontriviallyNormedField 𝕜₃]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜₂ F]
[NormedSpace 𝕜₃ G]
{σ₂₃ : 𝕜₂ →+* 𝕜₃}
{σ₁₃ : 𝕜 →+* 𝕜₃}
[RingHomIsometric σ₂₃]
[RingHomIsometric σ₁₃]

⇑(ContinuousLinearMap.flipₗᵢ' E F G σ₂₃ σ₁₃) = ContinuousLinearMap.flip


/-- The image of a 1-pre-hypercover by a functor. -/
@[simps]
def map : PreOneHypercover (F.obj X)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{X : C}
(E : CategoryTheory.PreOneHypercover X)
(F : CategoryTheory.Functor C D)

∀ (x x_1 : E.I₀) (j : E.I₁ x x_1), (E.map F).p₁ j = F.map (E.p₁ j)


protected theorem congr (h_left : ∀ i, f i =ᵐ[μ] f' i) (h_right : g =ᵐ[μ] g')
    (h_tendsto : TendstoInMeasure μ f l g) : TendstoInMeasure μ f' l g'

(h_tendsto : MeasureTheory.TendstoInMeasure μ f l g)

MeasureTheory.TendstoInMeasure μ f' l g'


lemma findGreatest_eq_zero_iff : Nat.findGreatest P k = 0 ↔ ∀ ⦃n⦄, 0 < n → n ≤ k → ¬P n

{k : ℕ}
{P : ℕ → Prop}
[DecidablePred P]

Nat.findGreatest P k = 0 ↔ ∀ ⦃n : ℕ⦄, 0 < n → n ≤ k → ¬P n


theorem setOf_mem_eq_univ_iff (φ : L[[α]].Sentence) :
    { p : T.CompleteType α | φ ∈ p } = Set.univ ↔ (L.lhomWithConstants α).onTheory T ⊨ᵇ φ

{L : FirstOrder.Language}
{T : L.Theory}
{α : Type w}
(φ : L[[α]].Sentence)

{p | φ ∈ p} = Set.univ ↔ (L.lhomWithConstants α).onTheory T ⊨ᵇ φ


theorem Finite.preimage'  (h : s.Finite) (hf : ∀ b ∈ s, (f ⁻¹' {b}).Finite) :
    (f ⁻¹' s).Finite

{α : Type u}
{β : Type v}
{f : α → β}
{s : Set β}
(h : s.Finite)
(hf : ∀ b ∈ s, (f ⁻¹' {b}).Finite)


theorem withTopEquiv_symm_one : withTopEquiv.symm 1 = 1


@[simp]
theorem toIcoMod_sub_zsmul' (a b : α) (m : ℤ) :
    toIcoMod hp (a - m • p) b = toIcoMod hp a b - m • p

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


theorem mul_eq_zero : ∀ {m n}, n * m = 0 ↔ n = 0 ∨ m = 0


/-- The difference `f m₁ - f m₂` is controlled in terms of `‖f‖` and `‖m₁ - m₂‖`, less precise
version. For a more precise but less usable version, see `norm_image_sub_le'`.
The bound is `‖f m - f m'‖ ≤ ‖f‖ * card ι * ‖m - m'‖ * (max ‖m‖ ‖m'‖) ^ (card ι - 1)`. -/
theorem norm_image_sub_le (m₁ m₂ : ∀ i, E i) :
    ‖f m₁ - f m₂‖ ≤ ‖f‖ * Fintype.card ι * max ‖m₁‖ ‖m₂‖ ^ (Fintype.card ι - 1) * ‖m₁ - m₂‖

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

‖f m₁ - f m₂‖ ≤ ‖f‖ * ↑(Fintype.card ι) * max ‖m₁‖ ‖m₂‖ ^ (Fintype.card ι - 1) * ‖m₁ - m₂‖


@[to_additive]
theorem mul_const [Mul γ] [MeasurableMul γ] (h : IdentDistrib f g μ ν) (c : γ) :
    IdentDistrib (fun x => f x * c) (fun x => g x * c) μ ν

(h : ProbabilityTheory.IdentDistrib f g μ ν)

ProbabilityTheory.IdentDistrib (fun x => f x * c) (fun x => g x * c) μ ν


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

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

∀ (a : ↥↑(LieModule.weightSpace M χ)), (LieModule.shiftedWeightSpace.shift R L M χ).symm a = a


theorem mul_injective [NoZeroDivisors A] {x : A} (hx : x ≠ 0) : Function.Injective (mul R A x)

{R : Type u_1}
{A : Type u_2}
[CommSemiring R]
[Ring A]
[Algebra R A]
[NoZeroDivisors A]
{x : A}
(hx : x ≠ 0)

Function.Injective ⇑((LinearMap.mul R A) x)


theorem convexOn_iff_div {f : E → β} :
    ConvexOn 𝕜 s f ↔
      Convex 𝕜 s ∧ ∀ ⦃x⦄, x ∈ s → ∀ ⦃y⦄, y ∈ s → ∀ ⦃a b : 𝕜⦄, 0 ≤ a → 0 ≤ b → 0 < a + b →
        f ((a / (a + b)) • x + (b / (a + b)) • y) ≤ (a / (a + b)) • f x + (b / (a + b)) • f y

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_5}
[LinearOrderedField 𝕜]
[AddCommMonoid E]
[OrderedAddCommMonoid β]
[SMul 𝕜 E]
[SMul 𝕜 β]
{s : Set E}
{f : E → β}

ConvexOn 𝕜 s f ↔
  Convex 𝕜 s ∧
    ∀ ⦃x : E⦄,
      x ∈ s →
        ∀ ⦃y : E⦄,
          y ∈ s →
            ∀ ⦃a b : 𝕜⦄,
              0 ≤ a →
                0 ≤ b →
                  0 < a + b → f ((a / (a + b)) • x + (b / (a + b)) • y) ≤ (a / (a + b)) • f x + (b / (a + b)) • f y


/-- Given three points in weak order on the same line, with the second not equal to the third,
and a fourth point, the angles at the fourth point between the second and third or first and
third points have the same sign. -/
theorem _root_.Wbtw.oangle_sign_eq_of_ne_right {p₁ p₂ p₃ : P} (p₄ : P) (h : Wbtw ℝ p₁ p₂ p₃)
    (hne : p₂ ≠ p₃) : (∡ p₂ p₄ p₃).sign = (∡ p₁ p₄ p₃).sign

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


theorem algebraMap_eq {B} [CommRing B] [Algebra A B] [Algebra B B'] [IsScalarTower A B B']
    (h : Function.Injective (algebraMap B B')) (x : B) :
    minpoly A (algebraMap B B' x) = minpoly A x

(h : Function.Injective ⇑(algebraMap B B'))

minpoly A ((algebraMap B B') x) = minpoly A x


@[simp]
theorem nat_nadd (n : ℕ) : ↑n ♯ a = a + n


theorem isConnected_setOf_wOppSide {s : AffineSubspace ℝ P} (x : P) (h : (s : Set P).Nonempty) :
    IsConnected { y | s.WOppSide x y }

{V : Type u_2}
{P : Type u_4}
[SeminormedAddCommGroup V]
[NormedSpace ℝ V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]
{s : AffineSubspace ℝ P}
(x : P)
(h : (↑s).Nonempty)


@[simp]
theorem sups_nonempty : (s ⊻ t).Nonempty ↔ s.Nonempty ∧ t.Nonempty

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


theorem down_bijective : Bijective (@down α)


/-- The image of a left invariant measure under a left action is left invariant, assuming that
the action preserves multiplication. -/
@[to_additive "The image of a left invariant measure under a left additive action is left invariant,
assuming that the action preserves addition."]
theorem isMulLeftInvariant_map_smul
    {α} [SMul α G] [SMulCommClass α G G] [MeasurableSpace α] [MeasurableSMul α G]
    [IsMulLeftInvariant μ] (a : α) :
    IsMulLeftInvariant (map (a • · : G → G) μ)

{G : Type u_2}
[MeasurableSpace G]
[AddSemigroup G]
[MeasurableAdd G]
{μ : MeasureTheory.Measure G}
{α : Type u_4}
[VAdd α G]
[VAddCommClass α G G]
[MeasurableSpace α]
[MeasurableVAdd α G]
[μ.IsAddLeftInvariant]
(a : α)

(MeasureTheory.Measure.map (fun x => a +ᵥ x) μ).IsAddLeftInvariant


@[simp]
theorem closure_openSegment (x y : E) : closure (openSegment 𝕜 x y) = [x -[𝕜] y]

{𝕜 : Type u_2}
{E : Type u_3}
[LinearOrderedRing 𝕜]
[DenselyOrdered 𝕜]
[PseudoMetricSpace 𝕜]
[OrderTopology 𝕜]
[ProperSpace 𝕜]
[CompactIccSpace 𝕜]
[AddCommGroup E]
[TopologicalSpace E]
[T2Space E]
[ContinuousAdd E]
[Module 𝕜 E]
[ContinuousSMul 𝕜 E]
(x y : E)


theorem term_atomg {α} [AddCommGroup α] (x : α) : x = termg 1 x 0


theorem ext' [FormallyUnramified R A] {C : Type u} [CommRing C] (f : B →+* C)
    (hf : IsNilpotent <| RingHom.ker f) (g₁ g₂ : A →ₐ[R] B) (h : ∀ x, f (g₁ x) = f (g₂ x)) :
    g₁ = g₂

{R : Type u}
[CommSemiring R]
{A : Type u}
[Semiring A]
[Algebra R A]
{B : Type u}
[CommRing B]
[Algebra R B]
[Algebra.FormallyUnramified R A]
{C : Type u}
[CommRing C]
(f : B →+* C)
(hf : IsNilpotent (RingHom.ker f))
(g₁ g₂ : A →ₐ[R] B)
(h : ∀ (x : A), f (g₁ x) = f (g₂ x))


theorem support_formPerm_le [Fintype α] : support (formPerm l) ≤ l.toFinset

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


theorem map_subtype_embedding_Ici : (Ici a).map (Embedding.subtype p) = (Ici a : Finset α)

{α : Type u_1}
[Preorder α]
(p : α → Prop)
[DecidablePred p]
[LocallyFiniteOrderTop α]
(a : Subtype p)
(hp : ∀ ⦃a x : α⦄, a ≤ x → p a → p x)

Finset.map (Function.Embedding.subtype p) (Finset.Ici a) = Finset.Ici ↑a


protected theorem _root_.IsCompact.exists_isOpen_lt_add [InnerRegularCompactLTTop μ]
    [IsLocallyFiniteMeasure μ] [R1Space α] [BorelSpace α]
    {K : Set α} (hK : IsCompact K) {ε : ℝ≥0∞} (hε : ε ≠ 0) :
    ∃ U, K ⊆ U ∧ IsOpen U ∧ μ U < μ K + ε


@[simp] theorem toNat_allOnes : (allOnes v).toNat = 2^v - 1


/-- Legendre's doubling formula for the Gamma function, for positive real arguments. Note that
we shall later prove this for all `s` as `Real.Gamma_mul_Gamma_add_half` (superseding this result)
but this result is needed as an intermediate step. -/
theorem Gamma_mul_Gamma_add_half_of_pos {s : ℝ} (hs : 0 < s) :
    Gamma s * Gamma (s + 1 / 2) = Gamma (2 * s) * 2 ^ (1 - 2 * s) * √π

Real.Gamma s * Real.Gamma (s + 1 / 2) = Real.Gamma (2 * s) * 2 ^ (1 - 2 * s) * √π


@[simp]
theorem at_one : legendreSym p 1 = 1