/-- The group of `AffineEquiv`s are equivalent to the group of units of `AffineMap`.

This is the affine version of `LinearMap.GeneralLinearGroup.generalLinearEquiv`. -/
@[simps]
def equivUnitsAffineMap : (P₁ ≃ᵃ[k] P₁) ≃* (P₁ →ᵃ[k] P₁)ˣ

{k : Type u_1}
{P₁ : Type u_2}
{V₁ : Type u_6}
[Ring k]
[AddCommGroup V₁]
[Module k V₁]
[AffineSpace V₁ P₁]
(u : (P₁ →ᵃ[k] P₁)ˣ)
(a : P₁)

(AffineEquiv.equivUnitsAffineMap.symm u) a = ↑u a


theorem mul_apply [MulZeroClass β] [ContinuousMul β] (f g : C_c(α, β)) : (f * g) x = f x * g x

{α : Type u_2}
{β : Type u_3}
[TopologicalSpace α]
[TopologicalSpace β]
(x : α)
[MulZeroClass β]
[ContinuousMul β]
(f g : α →C_c β)


theorem mem_toPartialHomeomorph_source {n : ℕ∞} (hf : ContDiffAt 𝕂 n f a)
    (hf' : HasFDerivAt f (f' : E →L[𝕂] F) a) (hn : 1 ≤ n) :
    a ∈ (hf.toPartialHomeomorph f hf' hn).source

{𝕂 : Type u_1}
[RCLike 𝕂]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕂 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕂 F]
[CompleteSpace E]
{f : E → F}
{f' : E ≃L[𝕂] F}
{a : E}
{n : ℕ∞}
(hf : ContDiffAt 𝕂 n f a)
(hf' : HasFDerivAt f (↑f') a)
(hn : 1 ≤ n)

a ∈ (ContDiffAt.toPartialHomeomorph f hf hf' hn).source


theorem ContinuousAt.continuousWithinAt {f : α → β} {s : Set α} {x : α} (h : ContinuousAt f x) :
    ContinuousWithinAt f s x

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
{f : α → β}
{s : Set α}
{x : α}
(h : ContinuousAt f x)


theorem Tendsto.of_tendsto_comp {f : α → β} {g : β → γ} {a : Filter α} {b : Filter β} {c : Filter γ}
    (hfg : Tendsto (g ∘ f) a c) (hg : comap g c ≤ b) : Tendsto f a b

{α : Type u}
{β : Type v}
{γ : Type w}
{f : α → β}
{g : β → γ}
{a : Filter α}
{b : Filter β}
{c : Filter γ}
(hfg : Filter.Tendsto (g ∘ f) a c)
(hg : Filter.comap g c ≤ b)


theorem fderiv_mul' (ha : DifferentiableAt 𝕜 a x) (hb : DifferentiableAt 𝕜 b x) :
    fderiv 𝕜 (fun y => a y * b y) x = a x • fderiv 𝕜 b x + (fderiv 𝕜 a x).smulRight (b x)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{x : E}
{𝔸 : Type u_6}
[NormedRing 𝔸]
[NormedAlgebra 𝕜 𝔸]
{a b : E → 𝔸}
(ha : DifferentiableAt 𝕜 a x)
(hb : DifferentiableAt 𝕜 b x)


/-- **Strong law of large numbers**, Lᵖ version: if `X n` is a sequence of independent
identically distributed random variables in Lᵖ, then `n⁻¹ • ∑ i ∈ range n, X i`
converges in `Lᵖ` to `𝔼[X 0]`. -/
theorem strong_law_Lp {p : ℝ≥0∞} (hp : 1 ≤ p) (hp' : p ≠ ∞) (X : ℕ → Ω → E) (hℒp : Memℒp (X 0) p)
    (hindep : Pairwise fun i j => IndepFun (X i) (X j)) (hident : ∀ i, IdentDistrib (X i) (X 0)) :
    Tendsto (fun (n : ℕ) => eLpNorm (fun ω => (n : ℝ) ⁻¹ • (∑ i ∈ range n, X i ω) - 𝔼[X 0]) p ℙ)
      atTop (𝓝 0)

(hindep : Pairwise fun i j => ProbabilityTheory.IndepFun (X i) (X j) ℙ)

(hident : ∀ (i : ℕ), ProbabilityTheory.IdentDistrib (X i) (X 0) ℙ ℙ)

Filter.Tendsto (fun n => MeasureTheory.eLpNorm (fun ω => (↑n)⁻¹ • ∑ i ∈ Finset.range n, X i ω - ∫ (a : Ω), X 0 a) p ℙ)
  Filter.atTop (𝓝 0)


@[to_additive]
theorem rightRel_apply {x y : α} : @Setoid.r _ (rightRel s) x y ↔ y * x⁻¹ ∈ s

{α : Type u_1}
[AddGroup α]
{s : AddSubgroup α}
{x y : α}


/-- An injective measurable function from a standard Borel space to a
countably separated measurable space is a measurable embedding. -/
theorem _root_.Measurable.measurableEmbedding {f : γ → α}
    [MeasurableSpace.CountablySeparated α]
    [MeasurableSpace γ] [StandardBorelSpace γ]
    (f_meas : Measurable f) (f_inj : Injective f) : MeasurableEmbedding f

{γ : Type u_3}
{α : Type u_4}
[MeasurableSpace α]
{f : γ → α}
[MeasurableSpace.CountablySeparated α]
[MeasurableSpace γ]
[StandardBorelSpace γ]
(f_meas : Measurable f)
(f_inj : Function.Injective f)


@[to_additive]
theorem kerLift_injective : Injective (kerLift φ)

{G : Type u}
[AddGroup G]
{H : Type v}
[AddGroup H]
(φ : G →+ H)


theorem right_mem_cIcc (a b : α) : b ∈ cIcc a b

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


theorem le_limsup_iff {α β} [ConditionallyCompleteLinearOrder β] {f : Filter α} {u : α → β} {x : β}
    (h₁ : f.IsCoboundedUnder (· ≤ ·) u := by isBoundedDefault)
    (h₂ : f.IsBoundedUnder (· ≤ ·) u := by isBoundedDefault) :
    x ≤ limsup u f ↔ ∀ y < x, ∃ᶠ a in f, y < u a

(h₁ : Filter.IsCoboundedUnder (fun x x_1 => x ≤ x_1) f u := by isBoundedDefault)

(h₂ : Filter.IsBoundedUnder (fun x x_1 => x ≤ x_1) f u := by isBoundedDefault)

x ≤ Filter.limsup u f ↔ ∀ y < x, ∃ᶠ (a : α) in f, y < u a


@[simp, norm_cast] lemma coe_sup (f g : α →ᵇ β) : ⇑(f ⊔ g) = ⇑f ⊔ ⇑g

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


@[reassoc]
lemma shiftIso_hom_app_comp (n m mn : M) (hnm : m + n = mn)
    (a a' a'' : M) (ha' : n + a = a') (ha'' : m + a' = a'') (X : C) :
    (shiftIso F n a a' ha').hom.app ((shiftFunctor C m).obj X) ≫
      (shiftIso F m a' a'' ha'').hom.app X =
        (shift F a).map ((shiftFunctorAdd' C m n mn hnm).inv.app X) ≫
          (F.shiftIso mn a a'' (by rw [← hnm, ← ha'', ← ha', add_assoc])).hom.app X

{C : Type u_1}
{A : Type u_2}
[CategoryTheory.Category.{u_6, u_1} C]
[CategoryTheory.Category.{u_5, u_2} A]
(F : C ⥤ A)
{M : Type u_3}
[AddMonoid M]
[CategoryTheory.HasShift C M]
[F.ShiftSequence M]
(n m mn : M)
(hnm : m + n = mn)
(a a' a'' : M)
(ha' : n + a = a')
(ha'' : m + a' = a'')
(X : C)

(F.shiftIso n a a' ha').hom.app ((CategoryTheory.shiftFunctor C m).obj X) ≫ (F.shiftIso m a' a'' ha'').hom.app X =
  (F.shift a).map ((CategoryTheory.shiftFunctorAdd' C m n mn hnm).inv.app X) ≫ (F.shiftIso mn a a'' ⋯).hom.app X


/-- `WithLp.equiv` as a `MeasurableEquiv`. -/
@[simps toEquiv]
protected def measurableEquiv : EuclideanSpace ℝ ι ≃ᵐ (ι → ℝ)

(EuclideanSpace.measurableEquiv ι).toEquiv = WithLp.equiv 2 ((i : ι) → (fun x => ℝ) i)


/-- laws for `MvFunctor` -/
class LawfulMvFunctor {n : ℕ} (F : TypeVec n → Type*) [MvFunctor F] : Prop where
  /-- `map` preserved identities, i.e., maps identity on `α` to identity on `F α` -/
  id_map : ∀ {α : TypeVec n} (x : F α), TypeVec.id <$$> x = x
  /-- `map` preserves compositions -/
  comp_map :
    ∀ {α β γ : TypeVec n} (g : α ⟹ β) (h : β ⟹ γ) (x : F α), (h ⊚ g) <$$> x = h <$$> g <$$> x

{n : ℕ}
{F : TypeVec.{u_2} n → Type u_1}
[MvFunctor F]
[self : LawfulMvFunctor F]
{α β γ : TypeVec.{u_2} n}
(g : α ⟹ β)
(h : β ⟹ γ)
(x : F α)


theorem untop'_eq_untop'_iff {d : α} {x y : WithTop α} :
    untop' d x = untop' d y ↔ x = y ∨ x = d ∧ y = ⊤ ∨ x = ⊤ ∧ y = d

{α : Type u_1}
{d : α}
{x y : WithTop α}

WithTop.untop' d x = WithTop.untop' d y ↔ x = y ∨ x = ↑d ∧ y = ⊤ ∨ x = ⊤ ∧ y = ↑d


@[reassoc (attr := simp)]
lemma d_toCycles [K.HasHomology k] :
    K.d i j ≫ K.toCycles j k = 0


@[simp]
lemma prod_eq_zero_iff : f.prod g = 0 ↔ ∃ i ∈ f.support, g i (f i) = 0

{α : Type u_1}
{ι : Type u_2}
{β : Type u_7}
[Zero α]
[CommMonoidWithZero β]
[Nontrivial β]
[NoZeroDivisors β]
{f : ι →₀ α}
{g : ι → α → β}


@[simp]
theorem map_map_apply {I : Type w} [Group I] {g : H →* I} {x : Abelianization G} :
    map g (map f x) = map (g.comp f) x

{G : Type u}
[Group G]
{H : Type v}
[Group H]
(f : G →* H)
{I : Type w}
[Group I]
{g : H →* I}
{x : Abelianization G}

(Abelianization.map g) ((Abelianization.map f) x) = (Abelianization.map (g.comp f)) x


/-- If the domain of a surjective linear map is finite dimensional, the codomain must be as well. -/
theorem of_surjective (f : V →ₗ[K] V₂) (w : Function.Surjective f) [FiniteDimensional K V] :
    FiniteDimensional K V₂

{K : Type u}
{V : Type v}
[DivisionRing K]
[AddCommGroup V]
[Module K V]
{V₂ : Type v'}
[AddCommGroup V₂]
[Module K V₂]
(f : V →ₗ[K] V₂)
(w : Function.Surjective ⇑f)
[FiniteDimensional K V]


@[simp]
theorem conjTranspose_one [DecidableEq n] [Semiring α] [StarRing α] : (1 : Matrix n n α)ᴴ = 1

{n : Type u_3}
{α : Type v}
[DecidableEq n]
[Semiring α]
[StarRing α]


/-- This lemma is superceded by `MeasureTheory.tendstoInMeasure_of_tendsto_eLpNorm` where we
allow `p = ∞`. -/
theorem tendstoInMeasure_of_tendsto_eLpNorm_of_ne_top (hp_ne_zero : p ≠ 0) (hp_ne_top : p ≠ ∞)
    (hf : ∀ n, AEStronglyMeasurable (f n) μ) (hg : AEStronglyMeasurable g μ) {l : Filter ι}
    (hfg : Tendsto (fun n => eLpNorm (f n - g) p μ) l (𝓝 0)) : TendstoInMeasure μ f l g

(hf : ∀ (n : ι), MeasureTheory.AEStronglyMeasurable (f n) μ)

(hg : MeasureTheory.AEStronglyMeasurable g μ)

(hfg : Filter.Tendsto (fun n => MeasureTheory.eLpNorm (f n - g) p μ) l (𝓝 0))


lemma mono_homologyMap_of_mono_opcyclesMap'
    [S₁.HasHomology] [S₂.HasHomology] (h : Mono (opcyclesMap φ)) :
    Mono (homologyMap φ)

(h : CategoryTheory.Mono (CategoryTheory.ShortComplex.opcyclesMap φ))


@[simp]
theorem zero_eq_one_iff [NeZero n] : (0 : Fin n) = 1 ↔ n = 1


protected theorem continuous (hf : HolderWith C r f) (h0 : 0 < r) : Continuous f

{X : Type u_1}
{Y : Type u_2}
[PseudoEMetricSpace X]
[PseudoEMetricSpace Y]
{C r : ℝ≥0}
{f : X → Y}
(hf : HolderWith C r f)
(h0 : 0 < r)


/-- The functor which sends `S : SnakeInput C` to its third line `S.L₃`. -/
@[simps]
def functorL₃ : SnakeInput C ⥤ ShortComplex C

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

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


theorem induce_spanningCoe {s : Set V} {G : SimpleGraph s} : G.spanningCoe.induce s = G

{V : Type u_1}
{s : Set V}
{G : SimpleGraph ↑s}


@[elab_as_elim]
theorem induction_on {motive : HNNExtension G A B φ → Prop}
    (x : HNNExtension G A B φ) (of : ∀ g, motive (of g))
    (t : motive t) (mul : ∀ x y, motive x → motive y → motive (x * y))
    (inv : ∀ x, motive x → motive x⁻¹) : motive x

(of : ∀ (g : G), motive (HNNExtension.of g))

(mul : ∀ (x y : HNNExtension G A B φ), motive x → motive y → motive (x * y))

(inv : ∀ (x : HNNExtension G A B φ), motive x → motive x⁻¹)


lemma singularPart_eq_self [μ.HaveLebesgueDecomposition ν] : μ.singularPart ν = μ ↔ μ ⟂ₘ ν

{α : Type u_1}
{m : MeasurableSpace α}
{μ ν : MeasureTheory.Measure α}
[μ.HaveLebesgueDecomposition ν]


theorem dist_val_le_dist (x y : CompleteCopy s) : dist x.1 y.1 ≤ dist x y

{α : Type u_1}
[MetricSpace α]
{s : TopologicalSpace.Opens α}
(x y : s.CompleteCopy)


/-- For each object in `C`, there is a triangle of the form `(X,X,0,𝟙 X,0,0)`
-/
@[simps!]
def contractibleTriangle (X : C) : Triangle C

(CategoryTheory.Pretriangulated.contractibleTriangle X).obj₂ = X


@[simp]
theorem sum_apply [Zero M] [AddCommMonoid N] {f : α →₀ M} {g : α → M → β →₀ N} {a₂ : β} :
    (f.sum g) a₂ = f.sum fun a₁ b => g a₁ b a₂

{α : Type u_1}
{β : Type u_7}
{M : Type u_8}
{N : Type u_10}
[Zero M]
[AddCommMonoid N]
{f : α →₀ M}
{g : α → M → β →₀ N}
{a₂ : β}

(f.sum g) a₂ = f.sum fun a₁ b => (g a₁ b) a₂


@[simp]
lemma integralCLM_apply (f : 𝓢(D, V)) : integralCLM 𝕜 μ f = ∫ x, f x ∂μ

(𝕜 : Type u_1)
{D : Type u_3}
{V : Type u_7}
[RCLike 𝕜]
[NormedAddCommGroup D]
[NormedSpace ℝ D]
[NormedAddCommGroup V]
[NormedSpace ℝ V]
[NormedSpace 𝕜 V]
[MeasurableSpace D]
[BorelSpace D]
[SecondCountableTopology D]
{μ : MeasureTheory.Measure D}
[hμ : μ.HasTemperateGrowth]
(f : SchwartzMap D V)

(SchwartzMap.integralCLM 𝕜 μ) f = ∫ (x : D), f x ∂μ


/-- If the inner product of two vectors is equal to the product of their norms (i.e.,
`⟪x, y⟫ = ‖x‖ * ‖y‖`), then the two vectors are nonnegative real multiples of each other. One form
of the equality case for Cauchy-Schwarz.
Compare `norm_inner_eq_norm_iff`, which takes the weaker hypothesis `abs ⟪x, y⟫ = ‖x‖ * ‖y‖`. -/
theorem inner_eq_norm_mul_iff_real {x y : F} : ⟪x, y⟫_ℝ = ‖x‖ * ‖y‖ ↔ ‖y‖ • x = ‖x‖ • y

{F : Type u_3}
[NormedAddCommGroup F]
[InnerProductSpace ℝ F]
{x y : F}


theorem cos_eq_cos_iff {x y : ℂ} : cos x = cos y ↔ ∃ k : ℤ, y = 2 * k * π + x ∨ y = 2 * k * π - x

Complex.cos x = Complex.cos y ↔ ∃ k, y = 2 * ↑k * ↑Real.pi + x ∨ y = 2 * ↑k * ↑Real.pi - x


@[simp]
theorem comp_assoc (f : CocompactMap γ δ) (g : CocompactMap β γ) (h : CocompactMap α β) :
    (f.comp g).comp h = f.comp (g.comp h)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{δ : Type u_4}
[TopologicalSpace α]
[TopologicalSpace β]
[TopologicalSpace γ]
[TopologicalSpace δ]
(f : CocompactMap γ δ)
(g : CocompactMap β γ)
(h : CocompactMap α β)


theorem replicate_le_replicate (a : α) {k n : ℕ} : replicate k a ≤ replicate n a ↔ k ≤ n

Multiset.replicate k a ≤ Multiset.replicate n a ↔ k ≤ n


theorem lt_of_getMsb (x : BitVec w) (i : Nat) : getMsb x i = true → i < w


theorem hnot_hnot_sup_distrib (a b : α) : ￢￢(a ⊔ b) = ￢￢a ⊔ ￢￢b

{α : Type u_2}
[CoheytingAlgebra α]
(a b : α)

￢￢(a ⊔ b) = ￢￢a ⊔ ￢￢b


@[to_additive all_zero_of_le_zero_le_of_sum_eq_zero]
lemma all_one_of_le_one_le_of_prod_eq_one [OrderedCommMonoid M] {l : List M}
    (hl₁ : ∀ x ∈ l, (1 : M) ≤ x) (hl₂ : l.prod = 1) {x : M} (hx : x ∈ l) : x = 1

{M : Type u_3}
[OrderedAddCommMonoid M]
{l : List M}
(hl₁ : ∀ x ∈ l, 0 ≤ x)
(hl₂ : l.sum = 0)
{x : M}
(hx : x ∈ l)


theorem comap_iInf {ι : Sort*} (f : K →+* L) (s : ι → Subfield L) :
    (iInf s).comap f = ⨅ i, (s i).comap f

{K : Type u}
{L : Type v}
[DivisionRing K]
[DivisionRing L]
{ι : Sort u_1}
(f : K →+* L)
(s : ι → Subfield L)

Subfield.comap f (iInf s) = ⨅ i, Subfield.comap f (s i)


@[norm_cast]
lemma singleton_subset_coe : {a} ⊆ (s : Set α) ↔ {a} ⊆ s


@[simp] theorem lt_add_one_iff {n : Nat} {k : Fin (n + 1)} : k < k + 1 ↔ k < last n


theorem toBlock_one_disjoint {p q : m → Prop} (hpq : Disjoint p q) :
    Matrix.toBlock (1 : Matrix m m α) p q = 0

{m : Type u_2}
{α : Type u_12}
[DecidableEq m]
[Zero α]
[One α]
{p q : m → Prop}
(hpq : Disjoint p q)


/-- If `i : K →+* L` and `j : K →+* M` are ring homomorphisms of characteristic `p` rings, such that
`i` is `p`-radical, and `M` is a perfect ring, then `PerfectRing.liftAux` is well-defined. -/
theorem liftAux_apply (x : L) (n : ℕ) (y : K) (h : i y = x ^ p ^ n) :
    liftAux i j p x = (iterateFrobeniusEquiv M p n).symm (j y)

{K : Type u_1}
{L : Type u_2}
{M : Type u_3}
[CommRing K]
[CommRing L]
[CommRing M]
(i : K →+* L)
(j : K →+* M)
(p : ℕ)
[ExpChar K p]
[ExpChar M p]
[PerfectRing M p]
[IsPRadical i p]
(x : L)
(n : ℕ)
(y : K)
(h : i y = x ^ p ^ n)

PerfectRing.liftAux i j p x = (iterateFrobeniusEquiv M p n).symm (j y)


@[simp]
theorem hyperoperation_one : hyperoperation 1 = (· + ·)


lemma ext {F G : ComposableArrows C n} (h : ∀ i, F.obj i = G.obj i)
    (w : ∀ (i : ℕ) (hi : i < n), F.map' i (i + 1) =
      eqToHom (h _) ≫ G.map' i (i + 1) ≫ eqToHom (h _).symm) : F = G

{F G : CategoryTheory.ComposableArrows C n}

(h : ∀ (i : Fin (n + 1)), F.obj i = G.obj i)

(w :
  ∀ (i : ℕ) (hi : i < n),
    F.map' i (i + 1) ⋯ hi =
      CategoryTheory.CategoryStruct.comp (CategoryTheory.eqToHom ⋯)
        (CategoryTheory.CategoryStruct.comp (G.map' i (i + 1) ⋯ hi) (CategoryTheory.eqToHom ⋯)))


/-- Cyclotomic polynomials are always nonnegative on inputs one or more. -/
theorem cyclotomic_nonneg (n : ℕ) {R} [LinearOrderedCommRing R] {x : R} (hx : 1 ≤ x) :
    0 ≤ eval x (cyclotomic n R)

(n : ℕ)
{R : Type u_1}
[LinearOrderedCommRing R]
{x : R}
(hx : 1 ≤ x)

0 ≤ Polynomial.eval x (Polynomial.cyclotomic n R)


theorem Basis.card_le_card_of_linearIndependent {ι : Type*} [Fintype ι] (b : Basis ι R M)
    {ι' : Type*} [Fintype ι'] {v : ι' → M} (hv : LinearIndependent R v) :
    Fintype.card ι' ≤ Fintype.card ι

{R : Type u}
{M : Type v}
[Ring R]
[AddCommGroup M]
[Module R M]
[StrongRankCondition R]
{ι : Type u_1}
[Fintype ι]
(b : Basis ι R M)
{ι' : Type u_2}
[Fintype ι']
{v : ι' → M}
(hv : LinearIndependent R v)


theorem forall_neBot_le_iff {g : Filter α} {p : Filter α → Prop} (hp : Monotone p) :
    (∀ f : Filter α, NeBot f → f ≤ g → p f) ↔ ∀ f : Ultrafilter α, ↑f ≤ g → p f

{α : Type u}
{g : Filter α}
{p : Filter α → Prop}
(hp : Monotone p)

(∀ (f : Filter α), f.NeBot → f ≤ g → p f) ↔ ∀ (f : Ultrafilter α), ↑f ≤ g → p ↑f


@[ext]
lemma mapTrifunctorMapObj_ext {X₁ : GradedObject I₁ C₁} {X₂ : GradedObject I₂ C₂}
    {X₃ : GradedObject I₃ C₃} {Y : C₄} (j : J)
    [HasMap ((((mapTrifunctor F I₁ I₂ I₃).obj X₁).obj X₂).obj X₃) p]
    {φ φ' : mapTrifunctorMapObj F p X₁ X₂ X₃ j ⟶ Y}
    (h : ∀ (i₁ : I₁) (i₂ : I₂) (i₃ : I₃) (h : p ⟨i₁, i₂, i₃⟩ = j),
      ιMapTrifunctorMapObj F p X₁ X₂ X₃ i₁ i₂ i₃ j h ≫ φ =
        ιMapTrifunctorMapObj F p X₁ X₂ X₃ i₁ i₂ i₃ j h ≫ φ') : φ = φ'

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

{X₁ : CategoryTheory.GradedObject I₁ C₁}

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

{X₃ : CategoryTheory.GradedObject I₃ C₃}

[((((CategoryTheory.GradedObject.mapTrifunctor F I₁ I₂ I₃).obj X₁).obj X₂).obj X₃).HasMap p]

{φ φ' : CategoryTheory.GradedObject.mapTrifunctorMapObj F p X₁ X₂ X₃ j ⟶ Y}

(h :
  ∀ (i₁ : I₁) (i₂ : I₂) (i₃ : I₃) (h : p (i₁, i₂, i₃) = j),
    CategoryTheory.CategoryStruct.comp (CategoryTheory.GradedObject.ιMapTrifunctorMapObj F p X₁ X₂ X₃ i₁ i₂ i₃ j h) φ =
      CategoryTheory.CategoryStruct.comp (CategoryTheory.GradedObject.ιMapTrifunctorMapObj F p X₁ X₂ X₃ i₁ i₂ i₃ j h)
        φ')


theorem ne_of_lt {a b : α} (h : a < b) : a ≠ b

{α : Type u}
[Preorder α]
{a b : α}
(h : a < b)


theorem galgebra_toFun_def (r : R) :
    @DirectSum.GAlgebra.toFun ℕ R (fun i => ⨂[R]^i M) _ _ _ _ _ _ _ r = algebraMap₀ r

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

DirectSum.GAlgebra.toFun r = TensorPower.algebraMap₀ r


theorem smul_right {X Y : C} {r : End Y} {f : X ⟶ Y} : r • f = f ≫ r

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X Y : C}
{r : CategoryTheory.End Y}
{f : X ⟶ Y}

r • f = CategoryTheory.CategoryStruct.comp f r


lemma jacobiTheta₂'_add_left' (z τ : ℂ) :
    jacobiTheta₂' (z + τ) τ =
      cexp (-π * I * (τ + 2 * z)) * (jacobiTheta₂' z τ - 2 * π * I * jacobiTheta₂ z τ)

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


/-- Given a normed group hom `f : V₁ → V₂` satisfying `g.comp f = 0` for some `g : V₂ → V₃`,
    the corestriction of `f` to the kernel of `g`. -/
@[simps]
def ker.lift (h : g.comp f = 0) : NormedAddGroupHom V₁ g.ker

{V₁ : Type u_3}
{V₂ : Type u_4}
{V₃ : Type u_5}
[SeminormedAddCommGroup V₁]
[SeminormedAddCommGroup V₂]
[SeminormedAddCommGroup V₃]
(f : NormedAddGroupHom V₁ V₂)
(g : NormedAddGroupHom V₂ V₃)
(h : g.comp f = 0)
(v : V₁)

↑((NormedAddGroupHom.ker.lift f g h) v) = f v


theorem zeroLocus_anti_mono_ideal {s t : Ideal R} (h : s ≤ t) :
    zeroLocus (t : Set R) ⊆ zeroLocus (s : Set R)

{R : Type u}
[CommSemiring R]
{s t : Ideal R}
(h : s ≤ t)

PrimeSpectrum.zeroLocus ↑t ⊆ PrimeSpectrum.zeroLocus ↑s


@[simp, norm_cast] lemma intCast_re (n : ℤ) : (n : ℂ).re = n


@[simp]
theorem mem_comap (S : StarSubalgebra R B) (f : A →⋆ₐ[R] B) (x : A) : x ∈ S.comap f ↔ f x ∈ S

{R : Type u_2}
{A : Type u_3}
{B : Type u_4}
[CommSemiring R]
[StarRing R]
[Semiring A]
[StarRing A]
[Algebra R A]
[StarModule R A]
[Semiring B]
[StarRing B]
[Algebra R B]
[StarModule R B]
(S : StarSubalgebra R B)
(f : A →⋆ₐ[R] B)
(x : A)


theorem liouville_liouvilleNumber {m : ℕ} (hm : 2 ≤ m) : Liouville (liouvilleNumber m)


theorem Basis.smulTower_repr_mk {ι : Type v₁} {ι' : Type w₁} (b : Basis ι R S) (c : Basis ι' S A)
    (x i j) : (b.smulTower c).repr x (i, j) = b.repr (c.repr x j) i

{R : Type u}
{S : Type v}
{A : Type w}
[Semiring R]
[Semiring S]
[AddCommMonoid A]
[Module R S]
[Module S A]
[Module R A]
[IsScalarTower R S A]
{ι : Type v₁}
{ι' : Type w₁}
(b : Basis ι R S)
(c : Basis ι' S A)
(x : A)
(i : ι)
(j : ι')

((b.smulTower c).repr x) (i, j) = (b.repr ((c.repr x) j)) i


@[simp]
theorem coe_toIsometryEquiv : ⇑e.toIsometryEquiv = e

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


@[simp] theorem or_iff_left_iff_imp  : ∀(a b : Bool), ((a || b) = a) ↔ (b → a)


protected theorem antitone [IsFiniteMeasure μ] {p q : ℝ≥0∞} (hpq : p ≤ q) : Lp E q μ ≤ Lp E p μ

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup E]
[MeasureTheory.IsFiniteMeasure μ]
{p q : ℝ≥0∞}
(hpq : p ≤ q)

MeasureTheory.Lp E q μ ≤ MeasureTheory.Lp E p μ


/-- A union of a finite family of sets is totally bounded
if and only if each set of the family is totally bounded. -/
lemma totallyBounded_sUnion {S : Set (Set α)} (hS : S.Finite) :
    TotallyBounded (⋃₀ S) ↔ ∀ s ∈ S, TotallyBounded s

{α : Type u}
[uniformSpace : UniformSpace α]
{S : Set (Set α)}
(hS : S.Finite)


@[simp]
theorem jacobson_idem : jacobson (jacobson I) = jacobson I


lemma Exact.epi_f_iff (hS : S.Exact) : Epi S.f ↔ S.g = 0

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Preadditive C]
{S : CategoryTheory.ShortComplex C}
(hS : S.Exact)


theorem toBlock_diagonal_self (d : m → α) (p : m → Prop) :
    Matrix.toBlock (diagonal d) p p = diagonal fun i : Subtype p => d ↑i

{m : Type u_2}
{α : Type u_12}
[DecidableEq m]
[Zero α]
(d : m → α)
(p : m → Prop)

(Matrix.diagonal d).toBlock p p = Matrix.diagonal fun i => d ↑i


@[simp]
theorem dual_id : InfHom.dual (InfHom.id α) = SupHom.id _

InfHom.dual (InfHom.id α) = SupHom.id αᵒᵈ


theorem radical_inf : radical (I ⊓ J) = radical I ⊓ radical J

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


@[simp]
theorem Quotient.algebraMap_quotient_pow_ramificationIdx (x : R) :
    algebraMap (R ⧸ p) (S ⧸ P ^ e) (Ideal.Quotient.mk p x) = Ideal.Quotient.mk (P ^ e) (f x)

{R : Type u}
[CommRing R]
{S : Type v}
[CommRing S]
(f : R →+* S)
(p : Ideal R)
(P : Ideal S)
(x : R)

(algebraMap (R ⧸ p) (S ⧸ P ^ Ideal.ramificationIdx f p P)) ((Ideal.Quotient.mk p) x) =
  (Ideal.Quotient.mk (P ^ Ideal.ramificationIdx f p P)) (f x)


@[simp 1100] theorem mem_insert_self (a : α) (l : List α) : a ∈ l.insert a

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


theorem exists_ne_zero_int_vec_norm_le : ∃ t : β → ℤ, t ≠ 0 ∧
    A *ᵥ t = 0 ∧ ‖t‖ ≤ (n * max 1 ‖A‖) ^ ((m : ℝ) / (n - m))

{α : Type u_1}
{β : Type u_2}
[Fintype α]
[Fintype β]
(A : Matrix α β ℤ)
(hn : Fintype.card α < Fintype.card β)
(hm : 0 < Fintype.card α)

∃ t,
  t ≠ 0 ∧
    A *ᵥ t = 0 ∧ ‖t‖ ≤ (↑(Fintype.card β) * max 1 ‖A‖) ^ (↑(Fintype.card α) / (↑(Fintype.card β) - ↑(Fintype.card α)))


theorem contDiffAt_rpow_const_of_le {x p : ℝ} {n : ℕ} (h : ↑n ≤ p) :
    ContDiffAt ℝ n (fun x : ℝ => x ^ p) x


/-- Construct an isomorphism `F ⋙ H.inverse ≅ G` from an isomorphism `F ≅ G ⋙ H.functor`. -/
@[simps!]
def compInverseIso {H : D ≌ E} (i : F ≅ G ⋙ H.functor) : F ⋙ H.inverse ≅ G

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{E : Type u₃}
[CategoryTheory.Category.{v₃, u₃} E]
{F : CategoryTheory.Functor C E}
{G : CategoryTheory.Functor C D}
{H : D ≌ E}
(i : F ≅ G.comp H.functor)
(X : C)

i.compInverseIso.hom.app X =
  CategoryTheory.CategoryStruct.comp (H.inverse.map (i.hom.app X)) (H.unitIso.inv.app (G.obj X))


theorem liftr_iff {α : Type u} (r : α → α → Prop) (x y : P α) :
    Liftr r x y ↔ ∃ a f₀ f₁, x = ⟨a, f₀⟩ ∧ y = ⟨a, f₁⟩ ∧ ∀ i, r (f₀ i) (f₁ i)

{P : PFunctor.{u}}
{α : Type u}
(r : α → α → Prop)
(x y : ↑P α)

Functor.Liftr r x y ↔ ∃ a f₀ f₁, x = ⟨a, f₀⟩ ∧ y = ⟨a, f₁⟩ ∧ ∀ (i : P.B a), r (f₀ i) (f₁ i)


@[simp]
theorem default_def (r : α → α → Prop) : default = RelIso.refl r


theorem hasStrictFDerivAt_iff_hasStrictDerivAt {f' : 𝕜 →L[𝕜] F} :
    HasStrictFDerivAt f f' x ↔ HasStrictDerivAt f (f' 1) x

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


@[simp]
theorem codRestrict_apply {α β} (p) (f : α ↪ β) (H a) : codRestrict p f H a = ⟨f a, H a⟩

{α : Sort u_1}
{β : Type u_2}
(p : Set β)
(f : α ↪ β)
(H : ∀ (a : α), f a ∈ p)
(a : α)

(Function.Embedding.codRestrict p f H) a = ⟨f a, ⋯⟩


@[to_additive (attr := simp)]
lemma mk_eq_one {a : M} {ha} : (⟨a, ha⟩ : S) = 1 ↔ a = 1

{M : Type u_1}
[MulOneClass M]
(S : Submonoid M)
{a : M}
{ha : a ∈ S}


/-- When both maps `S.f` and `S.g` of a short complex `S` are zero, this is the left homology map
data (for the identity of `S`) which relates the left homology data
`LeftHomologyData.ofIsLimitKernelFork` and `ofZeros` . -/
@[simps]
def compatibilityOfZerosOfIsLimitKernelFork (hf : S.f = 0) (hg : S.g = 0)
    (c : KernelFork S.g) (hc : IsLimit c) :
    LeftHomologyMapData (𝟙 S) (LeftHomologyData.ofIsLimitKernelFork S hf c hc)
      (LeftHomologyData.ofZeros S hf hg)

(c : CategoryTheory.Limits.KernelFork S.g)

(CategoryTheory.ShortComplex.LeftHomologyMapData.compatibilityOfZerosOfIsLimitKernelFork S hf hg c hc).φK =
  CategoryTheory.Limits.Fork.ι c


/-- `Complex.im` turns `ℂ` into a trivial topological fiber bundle over `ℝ`. -/
theorem isHomeomorphicTrivialFiberBundle_im : IsHomeomorphicTrivialFiberBundle ℝ im


/-- If `s ×ˢ t` is a null measurable set and `ν t ≠ 0`, then `s` is a null measurable set. -/
lemma _root_.MeasureTheory.NullMeasurableSet.left_of_prod {s : Set α} {t : Set β}
    (h : NullMeasurableSet (s ×ˢ t) (μ.prod ν)) (ht : ν t ≠ 0) : NullMeasurableSet s μ

(h : MeasureTheory.NullMeasurableSet (s ×ˢ t) (μ.prod ν))


@[to_additive]
lemma IsMulFreimanIso.prod (h₁ : IsMulFreimanIso n A₁ B₁ f₁) (h₂ : IsMulFreimanIso n A₂ B₂ f₂) :
    IsMulFreimanIso n (A₁ ×ˢ A₂) (B₁ ×ˢ B₂) (Prod.map f₁ f₂)

{α₁ : Type u_5}
{α₂ : Type u_6}
{β₁ : Type u_7}
{β₂ : Type u_8}
[CommMonoid α₁]
[CommMonoid α₂]
[CommMonoid β₁]
[CommMonoid β₂]
{A₁ : Set α₁}
{A₂ : Set α₂}
{B₁ : Set β₁}
{B₂ : Set β₂}
{f₁ : α₁ → β₁}
{f₂ : α₂ → β₂}
{n : ℕ}
(h₁ : IsMulFreimanIso n A₁ B₁ f₁)
(h₂ : IsMulFreimanIso n A₂ B₂ f₂)


private theorem sum_filter_pairs_eq_sum_powersetCard_mem_filter_antidiagonal_sum (k : ℕ) (a : ℕ × ℕ)
    (ha : a ∈ (antidiagonal k).filter (fun a ↦ a.fst < k)) (f : Finset σ × σ → MvPolynomial σ R) :
    (∑ t ∈ filter (fun t ↦ card t.fst = a.fst) (pairs σ k), f t) =
    ∑ A ∈ powersetCard a.fst univ, (∑ j, f (A, j))

(ha : a ∈ Finset.filter (fun a => a.1 < k) (Finset.antidiagonal k))

∑ t ∈ Finset.filter (fun t => t.1.card = a.1) (MvPolynomial.NewtonIdentities.pairs σ k), f t =
  ∑ A ∈ Finset.powersetCard a.1 Finset.univ, ∑ j : σ, f (A, j)


theorem map_smul (a : R) (x : M) : Q (a • x) = (a * a) • Q x

{R : Type u_3}
{M : Type u_4}
{N : Type u_5}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
[AddCommMonoid N]
[Module R N]
(Q : QuadraticMap R M N)
(a : R)
(x : M)


@[to_additive]
lemma isUnit_of_mem_ofUnits (S : Subgroup Mˣ) {x : M} (hx : x ∈ S.ofUnits) : IsUnit x

{M : Type u_1}
[AddMonoid M]
(S : AddSubgroup (AddUnits M))
{x : M}
(hx : x ∈ S.ofAddUnits)


theorem mem_iUnion₂ {x : γ} {s : ∀ i, κ i → Set γ} : (x ∈ ⋃ (i) (j), s i j) ↔ ∃ i j, x ∈ s i j

{γ : Type u_3}
{ι : Sort u_4}
{κ : ι → Sort u_7}
{x : γ}
{s : (i : ι) → κ i → Set γ}


lemma not_isUnramified_iff :
    ¬ IsUnramified k w ↔ IsComplex w ∧ IsReal (w.comap (algebraMap k K))

{k : Type u_1}
[Field k]
{K : Type u_2}
[Field K]
[Algebra k K]
{w : NumberField.InfinitePlace K}

¬NumberField.InfinitePlace.IsUnramified k w ↔ w.IsComplex ∧ (w.comap (algebraMap k K)).IsReal


@[simp]
theorem mul_right_apply_same (a : n) (M : Matrix n n α) :
    (M * stdBasisMatrix i j c) a j = M a i * c

{n : Type u_3}
{α : Type u_5}
[DecidableEq n]
[Semiring α]
(i j : n)
(c : α)
[Fintype n]
(a : n)
(M : Matrix n n α)

(M * Matrix.stdBasisMatrix i j c) a j = M a i * c


@[to_additive]
theorem mul_div_assoc (a b c : G) : a * b / c = a * (b / c)

{G : Type u_3}
[SubNegMonoid G]
(a b c : G)


theorem ENNReal.ofReal_tsum_of_nonneg {f : α → ℝ} (hf_nonneg : ∀ n, 0 ≤ f n) (hf : Summable f) :
    ENNReal.ofReal (∑' n, f n) = ∑' n, ENNReal.ofReal (f n)

{α : Type u_1}
{f : α → ℝ}
(hf_nonneg : ∀ (n : α), 0 ≤ f n)
(hf : Summable f)

ENNReal.ofReal (∑' (n : α), f n) = ∑' (n : α), ENNReal.ofReal (f n)


theorem comp_sub (f g : M →ₛₗ[σ₁₂] N₂) (h : N₂ →ₛₗ[σ₂₃] N₃) :
    h.comp (g - f) = h.comp g - h.comp f

{R₁ : Type u_2}
{R₂ : Type u_3}
{R₃ : Type u_4}
{M : Type u_9}
{N₂ : Type u_14}
{N₃ : Type u_15}
[Semiring R₁]
[Semiring R₂]
[Semiring R₃]
[AddCommMonoid M]
[AddCommGroup N₂]
[AddCommGroup N₃]
[Module R₁ M]
[Module R₂ N₂]
[Module R₃ N₃]
{σ₁₂ : R₁ →+* R₂}
{σ₂₃ : R₂ →+* R₃}
{σ₁₃ : R₁ →+* R₃}
[RingHomCompTriple σ₁₂ σ₂₃ σ₁₃]
(f g : M →ₛₗ[σ₁₂] N₂)
(h : N₂ →ₛₗ[σ₂₃] N₃)


@[to_additive (attr := simp)]
theorem iUnion_inv_smul : ⋃ g : α, g⁻¹ • s = ⋃ g : α, g • s

{α : Type u_2}
{β : Type u_3}
[Group α]
[MulAction α β]
{s : Set β}


theorem Sublist.append_left : l₁ <+ l₂ → ∀ l, l ++ l₁ <+ l ++ l₂

∀ {α : Type u_1} {l₁ l₂ : List α}, l₁ <+ l₂ → ∀ (l : List α), l ++ l₁ <+ l ++ l₂


@[simp] lemma map_comp (g : β →o γ) (f : α →o β) : map (g.comp f) = (map g).comp (map f)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[Preorder α]
[Preorder β]
[Preorder γ]
(g : β →o γ)
(f : α →o β)

Topology.WithLowerSet.map (g.comp f) = (Topology.WithLowerSet.map g).comp (Topology.WithLowerSet.map f)


@[to_additive]
theorem mul_comm_div : a / b * c = a * (c / b)

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


lemma le_comap_sup (L M : Sublattice β) (f : LatticeHom α β) :
    comap f L ⊔ comap f M ≤ comap f (L ⊔ M)

{α : Type u_2}
{β : Type u_3}
[Lattice α]
[Lattice β]
(L M : Sublattice β)
(f : LatticeHom α β)

Sublattice.comap f L ⊔ Sublattice.comap f M ≤ Sublattice.comap f (L ⊔ M)


/-- The open cover of the glued space given by the glue data. -/
@[simps (config := .lemmasOnly)]
def openCover (D : Scheme.GlueData) : OpenCover D.glued


@[simp]
theorem coe_zero : ⇑(0 : CuspForm Γ k) = (0 : ℍ → ℂ)


@[simp]
theorem Equiv.Perm.decomposeFin.symm_sign {n : ℕ} (p : Fin (n + 1)) (e : Perm (Fin n)) :
    Perm.sign (Equiv.Perm.decomposeFin.symm (p, e)) = ite (p = 0) 1 (-1) * Perm.sign e

{n : ℕ}
(p : Fin (n + 1))
(e : Equiv.Perm (Fin n))

Equiv.Perm.sign (Equiv.Perm.decomposeFin.symm (p, e)) = (if p = 0 then 1 else -1) * Equiv.Perm.sign e


theorem coe_trans (ab : α ≃ᵐ β) (bc : β ≃ᵐ γ) : ⇑(ab.trans bc) = bc ∘ ab

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[MeasurableSpace α]
[MeasurableSpace β]
[MeasurableSpace γ]
(ab : α ≃ᵐ β)
(bc : β ≃ᵐ γ)


lemma spectrum_star_mul_self_nonneg {b : A} : ∀ x ∈ spectrum ℝ (star b * b), 0 ≤ x

{A : Type u_1}
[NormedRing A]
[StarRing A]
[CstarRing A]
[CompleteSpace A]
[NormedAlgebra ℂ A]
[StarModule ℂ A]
{b : A}
(x : ℝ)


@[simp, norm_cast]
lemma natCast_log {n : ℕ} : Real.log n = log n


/-- The Lebesgue integral of `g` with respect to the measure `μ.withDensity f` coincides with
the integral of `f * g`. This version assumes that `g` is almost everywhere measurable. For a
version without conditions on `g` but requiring that `f` is almost everywhere finite, see
`lintegral_withDensity_eq_lintegral_mul_non_measurable` -/
theorem lintegral_withDensity_eq_lintegral_mul₀' {μ : Measure α} {f : α → ℝ≥0∞}
    (hf : AEMeasurable f μ) {g : α → ℝ≥0∞} (hg : AEMeasurable g (μ.withDensity f)) :
    ∫⁻ a, g a ∂μ.withDensity f = ∫⁻ a, (f * g) a ∂μ

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f : α → ℝ≥0∞}
(hf : AEMeasurable f μ)
{g : α → ℝ≥0∞}
(hg : AEMeasurable g (μ.withDensity f))

∫⁻ (a : α), g a ∂μ.withDensity f = ∫⁻ (a : α), (f * g) a ∂μ


theorem Scheme.map_PrimeSpectrum_basicOpen_of_affine
    (X : Scheme) [IsAffine X] (f : Scheme.Γ.obj (op X)) :
    X.isoSpec.hom ⁻¹ᵁ PrimeSpectrum.basicOpen f = X.basicOpen f

(f : ↑(AlgebraicGeometry.Scheme.Γ.obj (Opposite.op X)))

(TopologicalSpace.Opens.map X.isoSpec.hom.val.base).obj (PrimeSpectrum.basicOpen f) = X.basicOpen f


@[simp]
theorem mul_iff_right [Mul R] [IsScalarTower R R M] (ha : IsSMulRegular M a) :
    IsSMulRegular M (a * b) ↔ IsSMulRegular M b

{R : Type u_1}
{M : Type u_3}
{a b : R}
[SMul R M]
[Mul R]
[IsScalarTower R R M]
(ha : IsSMulRegular M a)


@[to_additive]
theorem Left.self_le_inv (h : a ≤ 1) : a ≤ a⁻¹

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


theorem exists_ne_of_one_lt_encard (h : 1 < s.encard) (a : α) : ∃ b ∈ s, b ≠ a

{α : Type u_1}
{s : Set α}
(h : 1 < s.encard)
(a : α)


theorem gcd_eq_zero_iff : s.gcd f = 0 ↔ ∀ x : β, x ∈ s → f x = 0

{α : Type u_2}
{β : Type u_3}
[CancelCommMonoidWithZero α]
[NormalizedGCDMonoid α]
{s : Finset β}
{f : β → α}


@[to_additive]
theorem mem_orbit_smul (g : G) (a : α) : a ∈ orbit G (g • a)

{G : Type u_1}
{α : Type u_2}
[Group G]
[MulAction G α]
(g : G)
(a : α)


theorem measure_Iio_pos [NoMinOrder X] (a : X) : 0 < μ (Iio a)

{X : Type u_1}
[TopologicalSpace X]
[LinearOrder X]
[OrderTopology X]
{m : MeasurableSpace X}
(μ : MeasureTheory.Measure X)
[μ.IsOpenPosMeasure]
[NoMinOrder X]
(a : X)


/-- If `‖v‖^n * ‖f v‖` is integrable for all `n ≤ N`, then the Fourier transform of `f` is `C^N`. -/
theorem contDiff_fourierIntegral {N : ℕ∞}
    (hf : ∀ (n : ℕ), n ≤ N → Integrable (fun v ↦ ‖v‖^n * ‖f v‖) μ) :
    ContDiff ℝ N (fourierIntegral 𝐞 μ L.toLinearMap₂ f)

(hf : ∀ (n : ℕ), ↑n ≤ N → MeasureTheory.Integrable (fun v => ‖v‖ ^ n * ‖f v‖) μ)

ContDiff ℝ N (VectorFourier.fourierIntegral 𝐞 μ L.toLinearMap₂ f)


/-- If `F` is a field of exponential characteristic `q`, `F(S) / F` is separable, then
`F(S) = F(S ^ q)`. -/
theorem adjoin_eq_adjoin_pow_expChar_of_isSeparable (S : Set E) [Algebra.IsSeparable F (adjoin F S)]
    (q : ℕ) [ExpChar F q] : adjoin F S = adjoin F ((· ^ q) '' S)

[Algebra.IsSeparable F ↥(IntermediateField.adjoin F S)]

IntermediateField.adjoin F S = IntermediateField.adjoin F ((fun x => x ^ q) '' S)


@[simp]
theorem toCone_π_app_left (c : BinaryBicone P Q) : c.toCone.π.app ⟨WalkingPair.left⟩ = c.fst

(c : CategoryTheory.Limits.BinaryBicone P Q)

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


/-- An isometry between two quadratic spaces `M₁, Q₁` and `M₂, Q₂` over a ring `R`,
is a linear map between `M₁` and `M₂` that commutes with the quadratic forms. -/
structure Isometry (Q₁ : QuadraticMap R M₁ N) (Q₂ : QuadraticMap R M₂ N) extends M₁ →ₗ[R] M₂ where
  /-- The quadratic form agrees across the map. -/
  map_app' : ∀ m, Q₂ (toFun m) = Q₁ m

{R : Type u_2}
{M₁ : Type u_4}
{M₂ : Type u_5}
{N : Type u_8}
[CommSemiring R]
[AddCommMonoid M₁]
[AddCommMonoid M₂]
[AddCommMonoid N]
[Module R M₁]
[Module R M₂]
[Module R N]
{Q₁ : QuadraticMap R M₁ N}
{Q₂ : QuadraticMap R M₂ N}
(self : Q₁ →qᵢ Q₂)
(m : M₁)


protected theorem lt_le_asymm : ∀{a b : Nat}, a < b → ¬(b ≤ a)


@[to_additive]
theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b)

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


theorem eq_empty_of_ssubset_singleton {s : Finset α} {x : α} (hs : s ⊂ {x}) : s = ∅

{α : Type u_1}
{s : Finset α}
{x : α}
(hs : s ⊂ {x})


theorem mem_lookup_union {a} {b : β a} {s₁ s₂ : Finmap β} :
    b ∈ lookup a (s₁ ∪ s₂) ↔ b ∈ lookup a s₁ ∨ a ∉ s₁ ∧ b ∈ lookup a s₂

{α : Type u}
{β : α → Type v}
[DecidableEq α]
{a : α}
{b : β a}
{s₁ s₂ : Finmap β}

b ∈ Finmap.lookup a (s₁ ∪ s₂) ↔ b ∈ Finmap.lookup a s₁ ∨ a ∉ s₁ ∧ b ∈ Finmap.lookup a s₂


theorem copy_eq (f : BoundedOrderHom α β) (f' : α → β) (h : f' = f) : f.copy f' h = f

{α : Type u_2}
{β : Type u_3}
[Preorder α]
[Preorder β]
[BoundedOrder α]
[BoundedOrder β]
(f : BoundedOrderHom α β)
(f' : α → β)
(h : f' = ⇑f)


lemma lt_slope_of_hasDerivWithinAt (hfc : StrictConcaveOn ℝ S f)
    (hx : x ∈ S) (hy : y ∈ S) (hxy : x < y) (hf' : HasDerivWithinAt f f' S y) :
    f' < slope f x y

{S : Set ℝ}
{f : ℝ → ℝ}
{x y f' : ℝ}
(hfc : StrictConcaveOn ℝ S f)
(hx : x ∈ S)
(hy : y ∈ S)
(hxy : x < y)
(hf' : HasDerivWithinAt f f' S y)


theorem range_pullback_to_base_of_left :
    Set.range (pullback.fst f g ≫ f).1.base =
      Set.range f.1.base ∩ Set.range g.1.base

[H : AlgebraicGeometry.IsOpenImmersion f]

Set.range ⇑(CategoryTheory.Limits.pullback.fst f g ≫ f).val.base = Set.range ⇑f.val.base ∩ Set.range ⇑g.val.base


@[simp] lemma not_in₁₁ : ¬ (graph t).Adj (in₁ b) (in₁ b')

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{t : Finset (α × β × γ)}
{b b' : β}

¬(SimpleGraph.TripartiteFromTriangles.graph t).Adj (Sum3.in₁ b) (Sum3.in₁ b')


theorem toSpanSingleton_add [ContinuousAdd M₁] (x y : M₁) :
    toSpanSingleton R₁ (x + y) = toSpanSingleton R₁ x + toSpanSingleton R₁ y

(R₁ : Type u_1)
[Semiring R₁]
{M₁ : Type u_4}
[TopologicalSpace M₁]
[AddCommMonoid M₁]
[Module R₁ M₁]
[TopologicalSpace R₁]
[ContinuousSMul R₁ M₁]
[ContinuousAdd M₁]
(x y : M₁)

ContinuousLinearMap.toSpanSingleton R₁ (x + y) =
  ContinuousLinearMap.toSpanSingleton R₁ x + ContinuousLinearMap.toSpanSingleton R₁ y


theorem min_mem_insert_top_image_coe (s : Finset α) :
    s.min ∈ (insert ⊤ (s.image (↑)) : Finset (WithTop α))

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

s.min ∈ insert ⊤ (Finset.image WithTop.some s)


theorem _root_.NumberField.canonicalEmbedding_injective [NumberField K] :
    Function.Injective (NumberField.canonicalEmbedding K)

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


@[simp]
theorem zeroProdIso_inv_snd (X : C) : (zeroProdIso X).inv ≫ prod.snd = 𝟙 X

(CategoryTheory.Limits.zeroProdIso X).inv ≫ CategoryTheory.Limits.prod.snd = 𝟙 X


/-- Given a MonoidHom `f : M →* N` and Submonoid `S ⊆ M` such that `f(S) ⊆ Nˣ`, for all
`w, z : N` and `y ∈ S`, we have `w * (f y)⁻¹ = z ↔ w = f y * z`. -/
@[to_additive
    "Given an AddMonoidHom `f : M →+ N` and Submonoid `S ⊆ M` such that
`f(S) ⊆ AddUnits N`, for all `w, z : N` and `y ∈ S`, we have `w - f y = z ↔ w = f y + z`."]
theorem mul_inv_left {f : M →* N} (h : ∀ y : S, IsUnit (f y)) (y : S) (w z : N) :
    w * (IsUnit.liftRight (f.restrict S) h y)⁻¹ = z ↔ w = f y * z

{M : Type u_1}
[CommMonoid M]
{S : Submonoid M}
{N : Type u_2}
[CommMonoid N]
{f : M →* N}
(h : ∀ (y : ↥S), IsUnit (f ↑y))
(y : ↥S)
(w z : N)

w * ↑((IsUnit.liftRight (f.restrict S) h) y)⁻¹ = z ↔ w = f ↑y * z


theorem exists_countable_basis [SecondCountableTopology α] :
    ∃ b : Set (Set α), b.Countable ∧ ∅ ∉ b ∧ IsTopologicalBasis b

(α : Type u)
[t : TopologicalSpace α]
[SecondCountableTopology α]

∃ b, b.Countable ∧ ∅ ∉ b ∧ TopologicalSpace.IsTopologicalBasis b


@[to_additive (attr := ext 1100)]
theorem hom_ext {β : Type v} [Mul β] {f g : FreeSemigroup α →ₙ* β} (h : f ∘ of = g ∘ of) : f = g

(h : ⇑f ∘ FreeSemigroup.of = ⇑g ∘ FreeSemigroup.of)


/-- The opposite of a `MonoidAlgebra R I` equivalent as a ring to
the `MonoidAlgebra Rᵐᵒᵖ Iᵐᵒᵖ` over the opposite ring, taking elements to their opposite. -/
@[simps! (config := { simpRhs := true }) apply symm_apply]
protected noncomputable def opRingEquiv [Monoid G] :
    (MonoidAlgebra k G)ᵐᵒᵖ ≃+* MonoidAlgebra kᵐᵒᵖ Gᵐᵒᵖ

{k : Type u₁}
{G : Type u₂}
[Semiring k]
[Monoid G]

∀ (a : Gᵐᵒᵖ →₀ kᵐᵒᵖ),
  MonoidAlgebra.opRingEquiv.symm a =
    MulOpposite.op (Finsupp.mapRange MulOpposite.unop ⋯ (Finsupp.equivMapDomain MulOpposite.opEquiv.symm a))


/-- **Riesz's theorem**: if a closed ball of positive radius is compact in a vector space, then the
space is finite-dimensional. -/
theorem FiniteDimensional.of_isCompact_closedBall {r : ℝ} (rpos : 0 < r) {c : E}
    (h : IsCompact (Metric.closedBall c r)) : FiniteDimensional 𝕜 E

(𝕜 : Type u)
[NontriviallyNormedField 𝕜]
{E : Type v}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[CompleteSpace 𝕜]
{r : ℝ}
(rpos : 0 < r)
{c : E}
(h : IsCompact (Metric.closedBall c r))


theorem RingHom.HoldsForLocalizationAway.of_bijective
    (H : RingHom.HoldsForLocalizationAway P) (hf : Function.Bijective f) :
    P f

(P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop)

(H : RingHom.HoldsForLocalizationAway fun {R S} [CommRing R] [CommRing S] => P)


theorem eLpNorm_one_add_measure (f : α → F) (μ ν : Measure α) :
    eLpNorm f 1 (μ + ν) = eLpNorm f 1 μ + eLpNorm f 1 ν

{α : Type u_1}
{F : Type u_3}
{m0 : MeasurableSpace α}
[NormedAddCommGroup F]
(f : α → F)
(μ ν : MeasureTheory.Measure α)

MeasureTheory.eLpNorm f 1 (μ + ν) = MeasureTheory.eLpNorm f 1 μ + MeasureTheory.eLpNorm f 1 ν


/-- The equivalence `Fin n ≃ {i // i < n}` is an order isomorphism. -/
@[simps! apply symm_apply]
def orderIsoSubtype : Fin n ≃o {i // i < n}


/-- Functor composition induces a functor on augmented cosimplicial objects. -/
@[simps]
def whiskering (D : Type u') [Category.{v'} D] : (C ⥤ D) ⥤ Augmented C ⥤ Augmented D

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

(CategoryTheory.CosimplicialObject.Augmented.whiskering C D).obj F =
  CategoryTheory.CosimplicialObject.Augmented.whiskeringObj C D F


/-- A functor which preserves exactness preserves epimorphisms. -/
theorem preservesEpimorphisms_of_map_exact : L.PreservesEpimorphisms

(hL : ∀ (S : CategoryTheory.ShortComplex A), S.Exact → (S.map L).Exact)


theorem sub_self_div_two (a : α) : a - a / 2 = a / 2

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


theorem lift'_mk [T0Space β] {f : α → β} (h : UniformContinuous f) (a : α) :
    lift' f (mk a) = f a

{α : Type u}
{β : Type v}
[UniformSpace α]
[UniformSpace β]
[T0Space β]
{f : α → β}
(h : UniformContinuous f)
(a : α)

SeparationQuotient.lift' f (SeparationQuotient.mk a) = f a


theorem map_prod {ι : Type*} [CommMonoidWithZero R] (g : ι → ℕ) {f : ArithmeticFunction R}
    (hf : f.IsMultiplicative) (s : Finset ι) (hs : (s : Set ι).Pairwise (Coprime on g)) :
    f (∏ i ∈ s, g i) = ∏ i ∈ s, f (g i)

{R : Type u_1}
{ι : Type u_2}
[CommMonoidWithZero R]
(g : ι → ℕ)
{f : ArithmeticFunction R}
(hf : f.IsMultiplicative)
(s : Finset ι)
(hs : (↑s).Pairwise (Nat.Coprime on g))


@[simp]
theorem coe_top [CompactSpace α] [Nonempty α] : (↑(⊤ : PositiveCompacts α) : Set α) = univ

{α : Type u_1}
[TopologicalSpace α]
[CompactSpace α]
[Nonempty α]


theorem harmonic_le_one_add_log (n : ℕ) :
    harmonic n ≤ 1 + Real.log n


theorem revFind_of_valid (p s) :
    revFind s p = (s.1.reverse.dropWhile (!p ·)).tail?.map (⟨utf8Len ·⟩)

s.revFind p =
  Option.map (fun x => { byteIdx := String.utf8Len x }) (List.dropWhile (fun x => !p x) s.data.reverse).tail?


/-- Given a cocone `c : Cocone K` and a map `f : F.obj c.X ⟶ X`, we can construct a cocone of
    costructured arrows over `X` with `f` as the cone point. -/
@[simps]
def Cocone.toCostructuredArrowCocone {K : J ⥤ C} (c : Cocone K) (F : C ⥤ D) {X : D}
    (f : F.obj c.pt ⟶ X) : Cocone ((F.mapCocone c).toCostructuredArrow ⋙
      CostructuredArrow.map f ⋙ CostructuredArrow.pre _ _ _)

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{D : Type u₄}
[CategoryTheory.Category.{v₄, u₄} D]
{K : CategoryTheory.Functor J C}
(c : CategoryTheory.Limits.Cocone K)
(F : CategoryTheory.Functor C D)
{X : D}
(f : F.obj c.pt ⟶ X)

(c.toCostructuredArrowCocone F f).pt = CategoryTheory.CostructuredArrow.mk f


lemma InjOn.prodMap (h₁ : s₁.InjOn f₁) (h₂ : s₂.InjOn f₂) :
    (s₁ ×ˢ s₂).InjOn fun x ↦ (f₁ x.1, f₂ x.2)

{α₁ : Type u_6}
{α₂ : Type u_7}
{β₁ : Type u_8}
{β₂ : Type u_9}
{s₁ : Set α₁}
{s₂ : Set α₂}
{f₁ : α₁ → β₁}
{f₂ : α₂ → β₂}
(h₁ : Set.InjOn f₁ s₁)
(h₂ : Set.InjOn f₂ s₂)

Set.InjOn (fun x => (f₁ x.1, f₂ x.2)) (s₁ ×ˢ s₂)


/-- If `A` is a non-unital `R`-algebra, then the subgroup of units of `Unitization R A` whose
scalar part is `1 : R` (i.e., `Unitization.unitsFstOne`) is isomorphic to the group of units of
`PreQuasiregular A`. -/
@[simps]
def unitsFstOne_mulEquiv_quasiregular : unitsFstOne R A ≃* (PreQuasiregular A)ˣ

(R : Type u_1)
{A : Type u_2}
[CommSemiring R]
[NonUnitalSemiring A]
[Module R A]
[IsScalarTower R A A]
[SMulCommClass R A A]
(x : (PreQuasiregular A)ˣ)

↑↑((Unitization.unitsFstOne_mulEquiv_quasiregular R).symm x) = 1 + ↑(PreQuasiregular.equiv.symm ↑x)


/-- Let `f : ℝ → ℝ` be a differentiable function. If `C < f'`, then `f` grows faster than
`C * x`, i.e., `C * (y - x) < f y - f x` whenever `x < y`. -/
theorem mul_sub_lt_image_sub_of_lt_deriv {f : ℝ → ℝ} (hf : Differentiable ℝ f) {C}
    (hf'_gt : ∀ x, C < deriv f x) ⦃x y⦄ (hxy : x < y) : C * (y - x) < f y - f x

{f : ℝ → ℝ}
(hf : Differentiable ℝ f)
{C : ℝ}
(hf'_gt : ∀ (x : ℝ), C < deriv f x)
⦃x y : ℝ⦄
(hxy : x < y)


theorem limit.map_pre' [HasLimitsOfShape K C] (F : J ⥤ C) {E₁ E₂ : K ⥤ J} (α : E₁ ⟶ E₂) :
    limit.pre F E₂ = limit.pre F E₁ ≫ lim.map (whiskerRight α F)

CategoryTheory.Limits.limit.pre F E₂ =
  CategoryTheory.Limits.limit.pre F E₁ ≫ CategoryTheory.Limits.lim.map (CategoryTheory.whiskerRight α F)


/-- An oriented angle is unchanged by replacing the first point with the midpoint of the segment
between the second point and that point. -/
@[simp]
theorem oangle_midpoint_rev_left (p₁ p₂ p₃ : P) : ∡ (midpoint ℝ p₂ p₁) p₂ p₃ = ∡ p₁ p₂ p₃

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


/-- The equivalence between a product of two dependent functions types and a single dependent
function type. Basically a symmetric version of `Equiv.sumPiEquivProdPi`. -/
@[simps!]
def prodPiEquivSumPi (π : ι → Type u) (π' : ι' → Type u) :
    ((∀ i, π i) × ∀ i', π' i') ≃ ∀ i, Sum.elim π π' i

{ι : Type u_1}
{ι' : Type u_2}
(π : ι → Type u)
(π' : ι' → Type u)

∀ (a : ((i : ι) → Sum.elim π π' (Sum.inl i)) × ((i' : ι') → Sum.elim π π' (Sum.inr i'))) (i : ι ⊕ ι'),
  (Equiv.prodPiEquivSumPi π π') a i = (Equiv.sumPiEquivProdPi (Sum.elim π π')).symm a i


/-- An element of `L ≃ₐ[K] L` is in `Gal(L/E)` if and only if it fixes every element of `E`-/
theorem IntermediateField.mem_fixingSubgroup_iff {K L : Type*} [Field K] [Field L] [Algebra K L]
    (E : IntermediateField K L) (σ : L ≃ₐ[K] L) : σ ∈ E.fixingSubgroup ↔ ∀ x : L, x ∈ E → σ x = x

{K : Type u_1}
{L : Type u_2}
[Field K]
[Field L]
[Algebra K L]
(E : IntermediateField K L)
(σ : L ≃ₐ[K] L)


/-- Constructing an affine subspace from a point in a subspace and that subspace's direction
yields the original subspace. -/
@[simp]
theorem mk'_eq {s : AffineSubspace k P} {p : P} (hp : p ∈ s) : mk' p s.direction = s

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


@[simp]
theorem add_self (l : Language α) : l + l = l


lemma closure_biUnion_closure_eq_closure_sUnion (M : Matroid α) (Xs : Set (Set α)) :
    M.closure (⋃ X ∈ Xs, M.closure X) = M.closure (⋃₀ Xs)

{α : Type u_2}
(M : Matroid α)
(Xs : Set (Set α))


@[simp]
theorem flatten_think (c : Computation (WSeq α)) : flatten c.think = think (flatten c)

{α : Type u}
(c : Computation (Stream'.WSeq α))

Stream'.WSeq.flatten c.think = (Stream'.WSeq.flatten c).think


@[to_additive (attr := simp)]
theorem liftOn_mk' {p : Sort u} (f : M → S → p) (H) (a : M) (b : S) :
    liftOn ((monoidOf S).mk' a b) f H = f a b

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

((Localization.monoidOf S).mk' a b).liftOn f H = f a b


protected theorem not_le_of_gt {a b : Int} (h : b < a) : ¬a ≤ b


lemma toFun_eq_coe (f : LatticeHom α β) : f.toFun = f

{α : Type u_3}
{β : Type u_4}
[Lattice α]
[Lattice β]
(f : LatticeHom α β)


theorem einfsep_pair_le_right (hxy : x ≠ y) : ({x, y} : Set α).einfsep ≤ edist y x

{α : Type u_1}
[EDist α]
{x y : α}
(hxy : x ≠ y)


@[simp]
theorem coe_ofBijective {f : F} (hf : Function.Bijective f) :
    (StarRingEquiv.ofBijective f hf : A → B) = f

{F : Type u_1}
{A : Type u_3}
{B : Type u_4}
[NonUnitalNonAssocSemiring A]
[Star A]
[NonUnitalNonAssocSemiring B]
[Star B]
[FunLike F A B]
[NonUnitalRingHomClass F A B]
[NonUnitalStarRingHomClass F A B]
{f : F}
(hf : Function.Bijective ⇑f)


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

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

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


@[simp]
theorem cyclicPermutations_rotate (l : List α) (k : ℕ) :
    (l.rotate k).cyclicPermutations = l.cyclicPermutations.rotate k


@[to_additive]
theorem lift_eq_iff {x y : M × S} :
    f.lift hg (f.mk' x.1 x.2) = f.lift hg (f.mk' y.1 y.2) ↔ g (x.1 * y.2) = g (y.1 * x.2)

{M : Type u_1}
[AddCommMonoid M]
{S : AddSubmonoid M}
{N : Type u_2}
[AddCommMonoid N]
{P : Type u_3}
[AddCommMonoid P]
(f : S.LocalizationMap N)
{g : M →+ P}
(hg : ∀ (y : ↥S), IsAddUnit (g ↑y))
{x y : M × ↥S}


/-- If a continuous function `c` realizes its maximum at a unique point `x₀` in a compact set `s`,
then the sequence of functions `(c x) ^ n / ∫ (c x) ^ n` is a sequence of peak functions
concentrating around `x₀`. Therefore, `∫ (c x) ^ n * g / ∫ (c x) ^ n` converges to `g x₀` if `g` is
integrable on `s` and continuous at `x₀`.

Version assuming that `μ` gives positive mass to all open sets.
For a less precise but more usable version, see
`tendsto_setIntegral_pow_smul_of_unique_maximum_of_isCompact_of_continuousOn`.
-/
theorem tendsto_setIntegral_pow_smul_of_unique_maximum_of_isCompact_of_integrableOn
    [MetrizableSpace α] [IsLocallyFiniteMeasure μ] [IsOpenPosMeasure μ] (hs : IsCompact s)
    {c : α → ℝ} (hc : ContinuousOn c s) (h'c : ∀ y ∈ s, y ≠ x₀ → c y < c x₀)
    (hnc : ∀ x ∈ s, 0 ≤ c x) (hnc₀ : 0 < c x₀) (h₀ : x₀ ∈ closure (interior s))
    (hmg : IntegrableOn g s μ) (hcg : ContinuousWithinAt g s x₀) :
    Tendsto (fun n : ℕ => (∫ x in s, c x ^ n ∂μ)⁻¹ • ∫ x in s, c x ^ n • g x ∂μ) atTop
      (𝓝 (g x₀))

(hmg : MeasureTheory.IntegrableOn g s μ)

Filter.Tendsto (fun n => (∫ (x : α) in s, c x ^ n ∂μ)⁻¹ • ∫ (x : α) in s, c x ^ n • g x ∂μ) Filter.atTop (𝓝 (g x₀))


theorem StrictMonoOn.comp_strictAntiOn [Preorder α] [Preorder β] [Preorder γ] {g : β → γ}
    {f : α → β} {s : Set α} {t : Set β} (hg : StrictMonoOn g t) (hf : StrictAntiOn f s)
    (hs : Set.MapsTo f s t) : StrictAntiOn (g ∘ f) s

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[Preorder α]
[Preorder β]
[Preorder γ]
{g : β → γ}
{f : α → β}
{s : Set α}
{t : Set β}
(hg : StrictMonoOn g t)
(hf : StrictAntiOn f s)
(hs : Set.MapsTo f s t)


lemma add_scaleRoots_of_natDegree_eq (p q : R[X]) (r : R) (h : natDegree p = natDegree q) :
    r ^ (natDegree p - natDegree (p + q)) • (p + q).scaleRoots r =
      p.scaleRoots r + q.scaleRoots r

{R : Type u_1}
[CommSemiring R]
(p q : Polynomial R)
(r : R)
(h : p.natDegree = q.natDegree)

r ^ (p.natDegree - (p + q).natDegree) • (p + q).scaleRoots r = p.scaleRoots r + q.scaleRoots r


theorem le_comap_map : N ≤ comap f (map f N)

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

N ≤ LieSubmodule.comap f (LieSubmodule.map f N)


protected theorem map_one (f : R →ₑ+*[φ] S) : f 1 = 1

{M : Type u_1}
[Monoid M]
{N : Type u_2}
[Monoid N]
{φ : M →* N}
{R : Type u_10}
[Semiring R]
[MulSemiringAction M R]
{S : Type u_12}
[Semiring S]
[MulSemiringAction N S]
(f : R →ₑ+*[φ] S)


theorem SuperpolynomialDecay.mul_param (hf : SuperpolynomialDecay l k f) :
    SuperpolynomialDecay l k (f * k)

(hf : Asymptotics.SuperpolynomialDecay l k f)

Asymptotics.SuperpolynomialDecay l k (f * k)


lemma LSeries.term_neg_apply (f : ℕ → ℂ) (s : ℂ) (n : ℕ) : term (-f) s n = -term f s n

LSeries.term (-f) s n = -LSeries.term f s n


theorem reduce_b {u : XgcdType} (h : u.r ≠ 0) : u.reduce = u.step.reduce.flip


theorem disjUnion_singleton (s : Finset α) (a : α) (h : Disjoint s {a}) :
    disjUnion s {a} h = cons a s (disjoint_singleton_right.mp h)

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


/-- A seminormed group is a group endowed with a norm for which `dist x y = ‖x / y‖`
defines a pseudometric space structure. -/
@[to_additive]
class SeminormedCommGroup (E : Type*) extends Norm E, CommGroup E, PseudoMetricSpace E where
  dist := fun x y => ‖x / y‖
  /-- The distance function is induced by the norm. -/
  dist_eq : ∀ x y, dist x y = ‖x / y‖ := by aesop

{E : Type u_9}
[self : SeminormedCommGroup E]
(x y : E)


theorem lcm_assoc' [GCDMonoid α] (m n k : α) : Associated (lcm (lcm m n) k) (lcm m (lcm n k))

{α : Type u_1}
[CancelCommMonoidWithZero α]
[GCDMonoid α]
(m n k : α)


theorem forall_mem_cons {α} {p : α → Prop} {a : α} {l : Thunk (LazyList α)} :
    (∀ x ∈ @LazyList.cons _ a l, p x) ↔ p a ∧ ∀ x ∈ l.get, p x

{α : Type u_1}
{p : α → Prop}
{a : α}
{l : Thunk (LazyList α)}

(∀ (x : α), x ∈ LazyList.cons a l → p x) ↔ p a ∧ ∀ (x : α), x ∈ l.get → p x


theorem Subsingleton.equitableOn {s : Set α} (hs : s.Subsingleton) (f : α → β) : s.EquitableOn f

{α : Type u_1}
{β : Type u_2}
[OrderedSemiring β]
{s : Set α}
(hs : s.Subsingleton)
(f : α → β)


@[to_additive]
theorem dist_inv (x y : E) : dist x⁻¹ y = dist x y⁻¹

{E : Type u_6}
[SeminormedAddCommGroup E]
(x y : E)


@[simp]
theorem idealOfSet_ofIdeal_eq_closure (I : Ideal C(X, 𝕜)) :
    idealOfSet 𝕜 (setOfIdeal I) = I.closure

{X : Type u_1}
{𝕜 : Type u_2}
[RCLike 𝕜]
[TopologicalSpace X]
[CompactSpace X]
[T2Space X]
(I : Ideal C(X, 𝕜))

ContinuousMap.idealOfSet 𝕜 (ContinuousMap.setOfIdeal I) = I.closure


@[simp]
theorem zero_apply (x y : M) : (0 : BilinForm R M) x y = 0

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


@[simp]
theorem coord_toSpanNonzeroSingleton {x : E} (h : x ≠ 0) (c : 𝕜) :
    coord 𝕜 x h (toSpanNonzeroSingleton 𝕜 x h c) = c

(𝕜 : Type u_1)
{E : Type u_2}
[NormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{x : E}
(h : x ≠ 0)
(c : 𝕜)

(ContinuousLinearEquiv.coord 𝕜 x h) ((ContinuousLinearEquiv.toSpanNonzeroSingleton 𝕜 x h) c) = c


@[reassoc (attr := simp)]
theorem whiskerLeft_hom_inv (X : C) {Y Z : C} (f : Y ≅ Z) :
    X ◁ f.hom ≫ X ◁ f.inv = 𝟙 (X ⊗ Y)

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

CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.whiskerLeft X f.hom)
    (CategoryTheory.MonoidalCategory.whiskerLeft X f.inv) =
  CategoryTheory.CategoryStruct.id (CategoryTheory.MonoidalCategory.tensorObj X Y)


theorem agree_iff_agree' {n : ℕ} (x y : M F) :
    Agree (x.approx n) (y.approx <| n + 1) ↔ Agree' n x y

PFunctor.Approx.Agree (x.approx n) (y.approx (n + 1)) ↔ PFunctor.M.Agree' n x y


theorem infinite_of_not_bddAbove : ¬BddAbove s → s.Infinite

{α : Type u}
[Preorder α]
[IsDirected α fun x x_1 => x ≤ x_1]
[Nonempty α]
{s : Set α}


@[simp]
theorem iUnion_compl (π : Prepartition I) : π.compl.iUnion = ↑I \ π.iUnion

{ι : Type u_1}
{I : BoxIntegral.Box ι}
[Finite ι]
(π : BoxIntegral.Prepartition I)


@[simp]
theorem blockDiag'_diagonal [DecidableEq o] [∀ i, DecidableEq (m' i)] (d : (Σi, m' i) → α) (k : o) :
    blockDiag' (diagonal d) k = diagonal fun i => d ⟨k, i⟩

{o : Type u_4}
{m' : o → Type u_7}
{α : Type u_12}
[Zero α]
[DecidableEq o]
[(i : o) → DecidableEq (m' i)]
(d : (i : o) × m' i → α)
(k : o)

(Matrix.diagonal d).blockDiag' k = Matrix.diagonal fun i => d ⟨k, i⟩


lemma Metric.exists_subseq_bounded_of_cauchySeq (u : ℕ → α) (hu : CauchySeq u) (b : ℕ → ℝ)
    (hb : ∀ n, 0 < b n) :
    ∃ f : ℕ → ℕ, StrictMono f ∧ ∀ n, ∀ m ≥ f n, dist (u m) (u (f n)) < b n

{α : Type u}
[PseudoMetricSpace α]
(u : ℕ → α)
(hu : CauchySeq u)
(b : ℕ → ℝ)
(hb : ∀ (n : ℕ), 0 < b n)

∃ f, StrictMono f ∧ ∀ (n m : ℕ), m ≥ f n → dist (u m) (u (f n)) < b n


@[simp]
theorem minFac_zero : minFac 0 = 2


lemma geomSum_ofColex_strictMono (hn : 2 ≤ n) : StrictMono fun s ↦ ∑ k ∈ ofColex s, n ^ k

StrictMono fun s => ∑ k ∈ s.ofColex, n ^ k


lemma unitHomEquiv_comp_apply {M N : SheafOfModules.{u} R}
    (f : unit R ⟶ M) (p : M ⟶ N) :
    N.unitHomEquiv (f ≫ p) = sectionsMap p (M.unitHomEquiv f)

{J : CategoryTheory.GrothendieckTopology C}

[J.HasSheafCompose (CategoryTheory.forget₂ RingCat AddCommGrp)]

N.unitHomEquiv (f ≫ p) = SheafOfModules.sectionsMap p (M.unitHomEquiv f)


theorem modify_of_valid (cs cs' : List Char) :
    modify ⟨cs ++ cs'⟩ ⟨utf8Len cs⟩ f = ⟨cs ++ cs'.modifyHead f⟩

{ data := cs ++ cs' }.modify { byteIdx := String.utf8Len cs } f = { data := cs ++ List.modifyHead f cs' }


theorem inv_map_iInf {ι : Sort*} {x : ι → ℝ≥0∞} : (iInf x)⁻¹ = ⨆ i, (x i)⁻¹


@[simp, mfld_simps]
theorem symm_apply_mk_proj {x : Z} (ex : x ∈ e.source) :
    e.toPartialEquiv.symm (proj x, (e x).2) = x

{B : Type u_2}
{F : Type u_3}
{Z : Type u_5}
[TopologicalSpace B]
[TopologicalSpace F]
{proj : Z → B}
(e : Pretrivialization F proj)
{x : Z}
(ex : x ∈ e.source)


/-- The morphism `triangleh φ₁ ⟶ triangleh φ₂` that is induced by a square that
is commutative up to homotopy. -/
@[simps]
noncomputable def trianglehMapOfHomotopy :
    triangleh φ₁ ⟶ triangleh φ₂

{φ₁ : K₁ ⟶ L₁}

{φ₂ : K₂ ⟶ L₂}

(CochainComplex.mappingCone.trianglehMapOfHomotopy H).hom₁ = (HomotopyCategory.quotient C (ComplexShape.up ℤ)).map a


theorem coeFn_injective : @Function.Injective (HomotopyWith f₀ f₁ P) (I × X → Y) (⇑)

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]
{f₀ f₁ : C(X, Y)}
{P : C(X, Y) → Prop}


@[simp]
theorem disjoint_inv_right_iff : Disjoint f g⁻¹ ↔ Disjoint f g


/-- Constructor for morphisms in `ComposableArrows C 0`. -/
@[simps!]
def homMk₀ {F G : ComposableArrows C 0} (f : F.obj' 0 ⟶ G.obj' 0) : F ⟶ G

{F G : CategoryTheory.ComposableArrows C 0}

(CategoryTheory.ComposableArrows.homMk₀ f).app i =
  match i with
  | ⟨0, isLt⟩ => f


@[to_additive]
theorem inf_relindex_left : (H ⊓ K).relindex H = K.relindex H

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


theorem nhds_induced [T : TopologicalSpace α] (f : β → α) (a : β) :
    @nhds β (TopologicalSpace.induced f T) a = comap f (𝓝 (f a))

{α : Type u}
{β : Type v}
[T : TopologicalSpace α]
(f : β → α)
(a : β)


/-- The "restriction" functor along a monoid homomorphism `f : G ⟶ H`,
taking actions of `H` to actions of `G`.

(This makes sense for any homomorphism, but the name is natural when `f` is a monomorphism.)
-/
@[simps]
def res {G H : MonCat} (f : G ⟶ H) : Action V H ⥤ Action V G

(V : Type (u + 1))
[CategoryTheory.LargeCategory V]
{G H : MonCat}
(f : G ⟶ H)
(M : Action V H)


lemma LocallyLipschitzOn.mono (hf : LocallyLipschitzOn t f) (h : s ⊆ t) : LocallyLipschitzOn s f

{α : Type u}
{β : Type v}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
{s t : Set α}
{f : α → β}
(hf : LocallyLipschitzOn t f)
(h : s ⊆ t)


@[to_additive (attr := simp)]
theorem div_lt_self_iff (a : α) {b : α} : a / b < a ↔ 1 < b

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


/-- The Legendre symbol of `p` and `a` is zero iff `p ∣ a`. -/
theorem eq_zero_iff (a : ℤ) : legendreSym p a = 0 ↔ (a : ZMod p) = 0


@[simp]
theorem coe_punitProd : ⇑(punitProd α) = Prod.snd


theorem expand_contract [CharP R p] [NoZeroDivisors R] {f : R[X]} (hf : Polynomial.derivative f = 0)
    (hp : p ≠ 0) : expand R p (contract p f) = f

{R : Type u}
[CommSemiring R]
(p : ℕ)
[CharP R p]
[NoZeroDivisors R]
{f : R[X]}
(hf : Polynomial.derivative f = 0)
(hp : p ≠ 0)

(Polynomial.expand R p) (Polynomial.contract p f) = f


@[simp, norm_cast]
theorem coe_one_unitSphere [NormedDivisionRing 𝕜] : ((1 : sphere (0 : 𝕜) 1) : 𝕜) = 1


@[simp]
theorem count_eq_zero_iff' (s_mble : MeasurableSet s) : count s = 0 ↔ s = ∅

{α : Type u_1}
[MeasurableSpace α]
{s : Set α}
(s_mble : MeasurableSet s)

MeasureTheory.Measure.count s = 0 ↔ s = ∅


theorem snd_mem_of_mem_enumFrom {x : ℕ × α} {n : ℕ} {l : List α} (h : x ∈ enumFrom n l) : x.2 ∈ l

{α : Type u_1}
{x : ℕ × α}
{n : ℕ}
{l : List α}
(h : x ∈ List.enumFrom n l)


@[simp]
theorem preimage_compl {s : Set β} : f ⁻¹' sᶜ = (f ⁻¹' s)ᶜ

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


@[simp]
theorem orElse_pure (c₁ : Computation α) (a : α) : (think c₁ <|> pure a) = pure a

{α : Type u}
(c₁ : Computation α)
(a : α)

(HOrElse.hOrElse c₁.think fun x => Computation.pure a) = Computation.pure a


@[simp]
theorem ordConnectedComponent_univ : ordConnectedComponent univ x = univ

Set.univ.ordConnectedComponent x = Set.univ


@[simp]
theorem lsub_const {ι} [Nonempty ι] (o : Ordinal) : (lsub fun _ : ι => o) = succ o

{ι : Type u_4}
[Nonempty ι]
(o : Ordinal.{max u_5 u_4})

(Ordinal.lsub fun x => o) = Order.succ o


@[simp]
theorem derivFamily_succ (f : ι → Ordinal → Ordinal) (o) :
    derivFamily.{u, v} f (succ o) = nfpFamily.{u, v} f (succ (derivFamily.{u, v} f o))

(f : ι → Ordinal.{max u v} → Ordinal.{max u v})

Ordinal.derivFamily f (Order.succ o) = Ordinal.nfpFamily f (Order.succ (Ordinal.derivFamily f o))


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

{α : Type u_1}
[TopologicalSpace α]
(K : TopologicalSpace.CompactOpens α)

TopologicalSpace.CompactOpens.map id ⋯ ⋯ K = K


@[to_additive] theorem Units.embedding_val [Group G] [TopologicalSpace G] [ContinuousInv G] :
    Embedding (val : Gˣ → G)

{G : Type w}
[Group G]
[TopologicalSpace G]
[ContinuousInv G]


@[simp, norm_cast]
theorem coe_Iio (a : α) : (Iio a : Set α) = Set.Iio a

{α : Type u_1}
[Preorder α]
[LocallyFiniteOrderBot α]
(a : α)


theorem associator_inv (X Y Z : C) :
    (α_ X Y Z).inv =
      prod.lift (prod.lift prod.fst (prod.snd ≫ prod.fst)) (prod.snd ≫ prod.snd)

(CategoryTheory.MonoidalCategory.associator X Y Z).inv =
  CategoryTheory.Limits.prod.lift
    (CategoryTheory.Limits.prod.lift CategoryTheory.Limits.prod.fst
      (CategoryTheory.CategoryStruct.comp CategoryTheory.Limits.prod.snd CategoryTheory.Limits.prod.fst))
    (CategoryTheory.CategoryStruct.comp CategoryTheory.Limits.prod.snd CategoryTheory.Limits.prod.snd)


lemma div_two_mul_two_of_even : Even n → n / 2 * 2 = n


@[to_additive (attr := simp)]
theorem traverse_eq (x) : FreeMagma.traverse F x = traverse F x

{α β : Type u}
{m : Type u → Type u}
[Applicative m]
(F : α → m β)
(x : FreeMagma α)


@[simp]
theorem sliceLeft_coe [TopologicalSpace Y] {y : Y} (f : X × Y → Z) :
    (↑f : Germ (𝓝 (x, y)) Z).sliceLeft = fun x' ↦ f (x', y)

{X : Type u_3}
{Y : Type u_4}
{Z : Type u_5}
[TopologicalSpace X]
{x : X}
[TopologicalSpace Y]
{y : Y}
(f : X × Y → Z)


theorem image_toFinset [DecidableEq α] {s : Multiset α} :
    s.toFinset.image f = (s.map f).toFinset

{α : Type u_1}
{β : Type u_2}
[DecidableEq β]
{f : α → β}
[DecidableEq α]
{s : Multiset α}

Finset.image f s.toFinset = (Multiset.map f s).toFinset


@[simp]
theorem empty_subset (s : Finset α) : ∅ ⊆ s


theorem Icc_eq :
    Finset.Icc s t = (Finset.Icc (toDFinsupp s) (toDFinsupp t)).map
      Multiset.equivDFinsupp.toEquiv.symm.toEmbedding

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

Finset.Icc s t =
  Finset.map Multiset.equivDFinsupp.symm.toEmbedding (Finset.Icc (Multiset.toDFinsupp s) (Multiset.toDFinsupp t))


@[simp]
theorem singleton_eq_iff_domain (f g : Y ⟶ X) : singleton f g ↔ f = g

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

CategoryTheory.Presieve.singleton f g ↔ f = g


@[to_additive nsmul_lt_nsmul_iff_left]
theorem pow_lt_pow_iff_right' (ha : 1 < a) : a ^ m < a ^ n ↔ m < n

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

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


theorem ae_le_eLpNormEssSup {f : α → F} : ∀ᵐ y ∂μ, ‖f y‖₊ ≤ eLpNormEssSup f μ

{α : Type u_1}
{F : Type u_3}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup F]
{f : α → F}

∀ᵐ (y : α) ∂μ, ↑‖f y‖₊ ≤ MeasureTheory.eLpNormEssSup f μ


@[to_additive]
theorem Finite.toFinset_mul (hs : s.Finite) (ht : t.Finite) (hf := hs.mul ht) :
    hf.toFinset = hs.toFinset * ht.toFinset

{α : Type u_2}
[DecidableEq α]
[Add α]
{s t : Set α}
(hs : s.Finite)
(ht : t.Finite)
(hf : (s + t).Finite := ⋯)

Set.Finite.toFinset hf = hs.toFinset + ht.toFinset


theorem ofNat_le_ofNat {n m : Nat} (h : n ≤ m) : ofNat n ≤ ofNat m


theorem eval_nodal_at_node {i : ι} (hi : i ∈ s) : eval (v i) (nodal s v) = 0

{R : Type u_1}
[CommRing R]
{ι : Type u_2}
{s : Finset ι}
{v : ι → R}
{i : ι}
(hi : i ∈ s)

Polynomial.eval (v i) (Lagrange.nodal s v) = 0


theorem BinaryCofan.mono_inr_of_isVanKampen [HasInitial C] {X Y : C} {c : BinaryCofan X Y}
    (h : IsVanKampenColimit c) : Mono c.inr

{c : CategoryTheory.Limits.BinaryCofan X Y}

(h : CategoryTheory.IsVanKampenColimit c)


theorem quotientQuotientEquivQuotientAux_mk_mk (x : M) :
    quotientQuotientEquivQuotientAux S T h (Quotient.mk (Quotient.mk x)) = Quotient.mk x

{R : Type u_1}
{M : Type u_2}
[Ring R]
[AddCommGroup M]
[Module R M]
(S T : Submodule R M)
(h : S ≤ T)
(x : M)

(S.quotientQuotientEquivQuotientAux T h) (Submodule.Quotient.mk (Submodule.Quotient.mk x)) = Submodule.Quotient.mk x


theorem liftPropAt_chart [HasGroupoid M G] (hG : G.LocalInvariantProp G Q) (hQ : ∀ y, Q id univ y) :
    LiftPropAt Q (chartAt (H := H) x) x

{H : Type u_1}
{M : Type u_2}
[TopologicalSpace H]
[TopologicalSpace M]
[ChartedSpace H M]
{G : StructureGroupoid H}
{x : M}
{Q : (H → H) → Set H → H → Prop}
[HasGroupoid M G]
(hG : G.LocalInvariantProp G Q)
(hQ : ∀ (y : H), Q id Set.univ y)

ChartedSpace.LiftPropAt Q (↑(chartAt H x)) x


lemma ofRat_div (x y : β) : ofRat (x / y) = (ofRat x / ofRat y : Cauchy abv)

{α : Type u_1}
[LinearOrderedField α]
{β : Type u_2}
[DivisionRing β]
{abv : β → α}
[IsAbsoluteValue abv]
(x y : β)

CauSeq.Completion.ofRat (x / y) = CauSeq.Completion.ofRat x / CauSeq.Completion.ofRat y


@[to_additive (attr := norm_cast, simp)]
theorem orderOf_submonoid {H : Submonoid G} (y : H) : orderOf (y : G) = orderOf y

{G : Type u_1}
[Monoid G]
{H : Submonoid G}
(y : ↥H)


@[simp]
theorem map_neg (x : R) : f (-x) = f x

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


@[simp]
theorem lift_comp : (lift i j p).comp i = j

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


/-- A helper lemma to prove that `finsetClopens X` is injective, see `finsetClopens_inj`. -/
lemma comp_finsetClopens [CompactSpace X] :
    (Set.image (fun (t : Clopens X) ↦ t.carrier) ∘ Finset.toSet) ∘
      finsetClopens X = fun ⟨f, _⟩ ↦ f.classes

(X : Type u_2)
[TopologicalSpace X]
[CompactSpace X]

((Set.image fun t => t.carrier) ∘ Finset.toSet) ∘ DiscreteQuotient.finsetClopens X = fun x =>
  match x with
  | { toSetoid := f, isOpen_setOf_rel := isOpen_setOf_rel } => f.classes


theorem pointwise_smul_le_iff₀ {a : α} (ha : a ≠ 0) {S T : Subgroup G} : a • S ≤ T ↔ S ≤ a⁻¹ • T

{α : Type u_1}
{G : Type u_2}
[Group G]
[GroupWithZero α]
[MulDistribMulAction α G]
{a : α}
(ha : a ≠ 0)
{S T : Subgroup G}

a • S ≤ T ↔ S ≤ a⁻¹ • T


@[simp]
theorem nhds_pure (x : α) : 𝓝 (pure x : Filter α) = 𝓟 {⊥, pure x}


theorem evenOdd_isCompl : IsCompl (evenOdd Q 0) (evenOdd Q 1)

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

IsCompl (CliffordAlgebra.evenOdd Q 0) (CliffordAlgebra.evenOdd Q 1)


lemma PosSMulMono.lift [PosSMulMono α γ]
    (hf : ∀ {b₁ b₂}, f b₁ ≤ f b₂ ↔ b₁ ≤ b₂)
    (smul : ∀ (a : α) b, f (a • b) = a • f b) : PosSMulMono α β

(hf : ∀ {b₁ b₂ : β}, f b₁ ≤ f b₂ ↔ b₁ ≤ b₂)

(smul : ∀ (a : α) (b : β), f (a • b) = a • f b)


theorem blockTriangular_blockDiagonal' [DecidableEq α] (d : ∀ i : α, Matrix (m' i) (m' i) R) :
    BlockTriangular (blockDiagonal' d) Sigma.fst

{α : Type u_1}
{m' : α → Type u_6}
{R : Type v}
[CommRing R]
[Preorder α]
[DecidableEq α]
(d : (i : α) → Matrix (m' i) (m' i) R)


@[simp]
theorem length_concat {u v w : V} (p : G.Walk u v) (h : G.Adj v w) :
    (p.concat h).length = p.length + 1

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


theorem gcd_rel_left : (gcdZ a b * a : ℕ) = gcdX a b * b + gcd a b

↑(a.gcdZ b) * ↑a = a.gcdX b * ↑b + ↑(a.gcd b)


/-- Any free group is isomorphic to "the" free group. -/
@[simps!]
def toFreeGroup : G ≃* FreeGroup (Generators G)

(G : Type u_1)
[Group G]
[IsFreeGroup G]

∀ (a : FreeGroup (IsFreeGroup.Generators G)), (IsFreeGroup.toFreeGroup G).symm a = (IsFreeGroup.mulEquiv G) a


/-- If a family of functions `f` has locally-finite multiplicative support, subordinate to a family
of open sets, then for any point we can find a neighbourhood on which only finitely-many members of
`f` are not equal to 1. -/
@[to_additive " If a family of functions `f` has locally-finite support, subordinate to a family of
open sets, then for any point we can find a neighbourhood on which only finitely-many members of `f`
are non-zero. "]
theorem LocallyFinite.exists_finset_nhd_mulSupport_subset {U : ι → Set X} [One R] {f : ι → X → R}
    (hlf : LocallyFinite fun i => mulSupport (f i)) (hso : ∀ i, mulTSupport (f i) ⊆ U i)
    (ho : ∀ i, IsOpen (U i)) (x : X) :
    ∃ (is : Finset ι), ∃ n, n ∈ 𝓝 x ∧ (n ⊆ ⋂ i ∈ is, U i) ∧
      ∀ z ∈ n, (mulSupport fun i => f i z) ⊆ is

(hlf : LocallyFinite fun i => Function.mulSupport (f i))

(hso : ∀ (i : ι), mulTSupport (f i) ⊆ U i)

∃ is, ∃ n ∈ 𝓝 x, n ⊆ ⋂ i ∈ is, U i ∧ ∀ z ∈ n, (Function.mulSupport fun i => f i z) ⊆ ↑is


theorem maximum?_cons [Max α] {xs : List α} : (x :: xs).maximum? = foldl max x xs

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

(x :: xs).maximum? = some (List.foldl max x xs)


/-- The functor `Comma L R₁ ⥤ Comma L R₃` induced by the composition of the natural transformations
    `r : R₁ ⟶ R₂` and `r' : R₂ ⟶ R₃` is naturally isomorphic to the composition of the functors
    induced by these natural transformations. -/
@[simps!]
def mapRightComp (r : R₁ ⟶ R₂) (r' : R₂ ⟶ R₃) :
    mapRight L (r ≫ r') ≅ mapRight L r ⋙ mapRight L r'

{A : Type u₁}
[CategoryTheory.Category.{v₁, u₁} A]
{B : Type u₂}
[CategoryTheory.Category.{v₂, u₂} B]
{T : Type u₃}
[CategoryTheory.Category.{v₃, u₃} T]
(L : CategoryTheory.Functor A T)
{R₁ R₂ R₃ : CategoryTheory.Functor B T}
(r : R₁ ⟶ R₂)
(r' : R₂ ⟶ R₃)
(X : CategoryTheory.Comma L R₁)

((CategoryTheory.Comma.mapRightComp L r r').inv.app X).left = CategoryTheory.CategoryStruct.id X.left


theorem val_add_one {n : Nat} (i : Fin (n + 1)) :
    ((i + 1 : Fin (n + 1)) : Nat) = if i = last _ then (0 : Nat) else i + 1

↑(i + 1) = if i = Fin.last n then 0 else ↑i + 1


theorem infs_subset : s₁ ⊆ s₂ → t₁ ⊆ t₂ → s₁ ⊼ t₁ ⊆ s₂ ⊼ t₂

{α : Type u_2}
[DecidableEq α]
[SemilatticeInf α]
{s₁ s₂ t₁ t₂ : Finset α}

s₁ ⊆ s₂ → t₁ ⊆ t₂ → s₁ ⊼ t₁ ⊆ s₂ ⊼ t₂


theorem mem_range_sub_ne_zero {n x : ℕ} (hx : x ∈ range n) : n - x ≠ 0


@[simp]
theorem sSup_apply {α : Type*} {β : α → Type*} [∀ i, SupSet (β i)] {s : Set (∀ a, β a)} {a : α} :
    (sSup s) a = ⨆ f : s, (f : ∀ a, β a) a

{α : Type u_9}
{β : α → Type u_10}
[(i : α) → SupSet (β i)]
{s : Set ((a : α) → β a)}
{a : α}


@[simp]
theorem zero_convolution : 0 ⋆[L, μ] g = 0

{𝕜 : Type u𝕜}
{G : Type uG}
{E : Type uE}
{E' : Type uE'}
{F : Type uF}
[NormedAddCommGroup E]
[NormedAddCommGroup E']
[NormedAddCommGroup F]
{g : G → E'}
[NontriviallyNormedField 𝕜]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜 E']
[NormedSpace 𝕜 F]
{L : E →L[𝕜] E' →L[𝕜] F}
[MeasurableSpace G]
{μ : MeasureTheory.Measure G}
[NormedSpace ℝ F]
[AddGroup G]


theorem mul_edgeDensity_le_edgeDensity (hs : s₂ ⊆ s₁) (ht : t₂ ⊆ t₁) (hs₂ : s₂.Nonempty)
    (ht₂ : t₂.Nonempty) :
    (s₂.card : ℚ) / s₁.card * (t₂.card / t₁.card) * edgeDensity r s₂ t₂ ≤ edgeDensity r s₁ t₁

{α : Type u_4}
{β : Type u_5}
(r : α → β → Prop)
[(a : α) → DecidablePred (r a)]
{s₁ s₂ : Finset α}
{t₁ t₂ : Finset β}
(hs : s₂ ⊆ s₁)
(ht : t₂ ⊆ t₁)
(hs₂ : s₂.Nonempty)
(ht₂ : t₂.Nonempty)

↑s₂.card / ↑s₁.card * (↑t₂.card / ↑t₁.card) * Rel.edgeDensity r s₂ t₂ ≤ Rel.edgeDensity r s₁ t₁


/-- `algEquivOfEq` sends `AdjoinRoot.root p` to `AdjoinRoot.root q`. -/
theorem algEquivOfEq_apply_root {p q : K[X]} (hp : p ≠ 0) (h_eq : p = q) :
    algEquivOfEq hp h_eq (root p) = root q

{K : Type u_1}
[Field K]
{p q : K[X]}
(hp : p ≠ 0)
(h_eq : p = q)

(AdjoinRoot.algEquivOfEq hp h_eq) (AdjoinRoot.root p) = AdjoinRoot.root q


theorem iso_w {f g : Arrow T} (e : f ≅ g) : g.hom = e.inv.left ≫ f.hom ≫ e.hom.right

{T : Type u}
[CategoryTheory.Category.{v, u} T]
{f g : CategoryTheory.Arrow T}
(e : f ≅ g)

g.hom = CategoryTheory.CategoryStruct.comp e.inv.left (CategoryTheory.CategoryStruct.comp f.hom e.hom.right)


theorem Zigzag.refl (X : J) : Zigzag X X

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


/-- If a measurable space on `α` is countably generated and separates points, there is some
second countable t4 topology on `α` (i.e. a separable metrizable one) for which every
open set is measurable. -/
theorem exists_opensMeasurableSpace_of_countablySeparated (α : Type*)
    [m : MeasurableSpace α] [CountablySeparated α] :
    ∃ τ : TopologicalSpace α, SecondCountableTopology α ∧ T4Space α ∧ OpensMeasurableSpace α

(α : Type u_5)
[m : MeasurableSpace α]
[MeasurableSpace.CountablySeparated α]

∃ τ, SecondCountableTopology α ∧ T4Space α ∧ OpensMeasurableSpace α


/-- `Sum.map` as a relation embedding between `Sum.Lex` relations. -/
@[simps]
def sumLexMap (f : r ↪r s) (g : t ↪r u) : Sum.Lex r t ↪r Sum.Lex s u

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{δ : Type u_4}
{r : α → α → Prop}
{s : β → β → Prop}
{t : γ → γ → Prop}
{u : δ → δ → Prop}
(f : r ↪r s)
(g : t ↪r u)

∀ (a : α ⊕ γ), (f.sumLexMap g) a = Sum.map (⇑f) (⇑g) a


/-- Second case of the inductive step: assuming that
`∃ (s : Finset ι), s ≠ univ → s.card = (s.biUnion t).card`
and that the statement of **Hall's Marriage Theorem** is true for all
`ι'` of cardinality ≤ `n`, then it is true for `ι` of cardinality `n + 1`.
-/
theorem hall_hard_inductive_step_B {n : ℕ} (hn : Fintype.card ι = n + 1)
    (ht : ∀ s : Finset ι, s.card ≤ (s.biUnion t).card)
    (ih :
      ∀ {ι' : Type u} [Fintype ι'] (t' : ι' → Finset α),
        Fintype.card ι' ≤ n →
          (∀ s' : Finset ι', s'.card ≤ (s'.biUnion t').card) →
            ∃ f : ι' → α, Function.Injective f ∧ ∀ x, f x ∈ t' x)
    (s : Finset ι) (hs : s.Nonempty) (hns : s ≠ univ) (hus : s.card = (s.biUnion t).card) :
    ∃ f : ι → α, Function.Injective f ∧ ∀ x, f x ∈ t x

(ht : ∀ (s : Finset ι), s.card ≤ (s.biUnion t).card)

(ih :
  ∀ {ι' : Type u} [inst : Fintype ι'] (t' : ι' → Finset α),
    Fintype.card ι' ≤ n →
      (∀ (s' : Finset ι'), s'.card ≤ (s'.biUnion t').card) → ∃ f, Function.Injective f ∧ ∀ (x : ι'), f x ∈ t' x)

∃ f, Function.Injective f ∧ ∀ (x : ι), f x ∈ t x


/-- 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}
[Add M]
[Add N]
(f : AddHom M N)
(M' : AddSubsemigroup M)
(x : ↥M')


lemma addXYZ_smul (P Q : Fin 3 → R) (u v : R) :
    W'.addXYZ (u • P) (v • Q) = (u * v) ^ 2 • W'.addXYZ P Q

{R : Type u}
[CommRing R]
{W' : WeierstrassCurve.Jacobian R}
(P Q : Fin 3 → R)
(u v : R)


/-- Negating both vectors passed to `oangle` does not change the angle. -/
@[simp]
theorem oangle_neg_neg (x y : V) : o.oangle (-x) (-y) = o.oangle x y

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


lemma isDiscrete_of_iso {F : Sheaf J A} {X : A}
    (i : F ≅ (constantSheaf J A).obj X) : IsDiscrete J ht F

(J : CategoryTheory.GrothendieckTopology C)

(ht : CategoryTheory.Limits.IsTerminal t)

(i : F ≅ (CategoryTheory.constantSheaf J A).obj X)


@[simp]
theorem ι_eq_zero_iff (x : M) : ι R x = 0 ↔ x = 0

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


@[to_additive]
theorem mul_inv_cancel_assoc (h : Commute a b) : a * (b * a⁻¹) = b

{G : Type u_1}
[Group G]
{a b : G}
(h : Commute a b)


@[to_additive]
theorem single_le_finprod {M : Type*} [OrderedCommMonoid M] (i : α) {f : α → M}
    (hf : (mulSupport f).Finite) (h : ∀ j, 1 ≤ f j) : f i ≤ ∏ᶠ j, f j

{α : Type u_1}
{M : Type u_7}
[OrderedCommMonoid M]
(i : α)
{f : α → M}
(hf : (Function.mulSupport f).Finite)
(h : ∀ (j : α), 1 ≤ f j)


theorem isLeast_nth_of_lt_card {n : ℕ} (hf : (setOf p).Finite) (hn : n < hf.toFinset.card) :
    IsLeast {i | p i ∧ ∀ k < n, nth p k < i} (nth p n)

{p : ℕ → Prop}
{n : ℕ}
(hf : (setOf p).Finite)
(hn : n < hf.toFinset.card)

IsLeast {i | p i ∧ ∀ k < n, Nat.nth p k < i} (Nat.nth p n)


theorem const_congr {f₁ f₂ g₁ g₂ : R} {U hu} (hf : f₁ = f₂) (hg : g₁ = g₂) :
    const R f₁ g₁ U hu = const R f₂ g₂ U (hg ▸ hu)

{U : TopologicalSpace.Opens ↑(AlgebraicGeometry.PrimeSpectrum.Top R)}

{hu : ∀ x ∈ U, g₁ ∈ x.asIdeal.primeCompl}

AlgebraicGeometry.StructureSheaf.const R f₁ g₁ U hu = AlgebraicGeometry.StructureSheaf.const R f₂ g₂ U ⋯


lemma nat_repr_len_aux (n b e : Nat) (h_b_pos : 0 < b) :  n < b ^ e.succ → n / b < b ^ e


theorem Kernel.measure_eq_zero_or_one_of_indepSet_self [∀ a, IsFiniteMeasure (κ a)] {t : Set Ω}
    (h_indep : IndepSet t t κ μα) :
    ∀ᵐ a ∂μα, κ a t = 0 ∨ κ a t = 1

[∀ (a : α), MeasureTheory.IsFiniteMeasure (κ a)]

(h_indep : ProbabilityTheory.Kernel.IndepSet t t κ μα)

∀ᵐ (a : α) ∂μα, (κ a) t = 0 ∨ (κ a) t = 1


@[simp] theorem star_re : (star a).re = a.re


theorem right_distrib (x y z : R[S⁻¹]) : (x + y) * z = x * z + y * z

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


theorem flip_injective_iff₁ [FiniteDimensional K V₁] : Injective B.flip ↔ Surjective B

{K : Type uK}
[Field K]
{V₁ : Type uV₁}
{V₂ : Type uV₂}
[AddCommGroup V₁]
[Module K V₁]
[AddCommGroup V₂]
[Module K V₂]
{B : V₁ →ₗ[K] V₂ →ₗ[K] K}
[FiniteDimensional K V₁]

Function.Injective ⇑B.flip ↔ Function.Surjective ⇑B


@[simp]
theorem coe_pointwise_smul (a : α) (S : Subgroup G) : ↑(a • S) = a • (S : Set G)

{α : Type u_1}
{G : Type u_2}
[Group G]
[Monoid α]
[MulDistribMulAction α G]
(a : α)
(S : Subgroup G)


theorem IsDiag.mem_range_diag {z : Sym2 α} : IsDiag z → z ∈ Set.range (@diag α)


@[simp]
theorem cokernelZeroIsoTarget_hom :
    cokernelZeroIsoTarget.hom = cokernel.desc (0 : X ⟶ Y) (𝟙 Y) (by simp)

CategoryTheory.Limits.cokernelZeroIsoTarget.hom = CategoryTheory.Limits.cokernel.desc 0 (𝟙 Y) ⋯


theorem fderiv.fst (h : DifferentiableAt 𝕜 f₂ x) :
    fderiv 𝕜 (fun x => (f₂ x).1) x = (fst 𝕜 F G).comp (fderiv 𝕜 f₂ x)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{x : E}
{f₂ : E → F × G}
(h : DifferentiableAt 𝕜 f₂ x)

fderiv 𝕜 (fun x => (f₂ x).1) x = (ContinuousLinearMap.fst 𝕜 F G).comp (fderiv 𝕜 f₂ x)


theorem congr {f g : X → Y} {x : X} {u : Set X} (hx : x ∈ u) (hu : IsOpen u) (hf : ConformalAt f x)
    (h : ∀ x : X, x ∈ u → g x = f x) : ConformalAt g x

{X : Type u_1}
{Y : Type u_2}
[NormedAddCommGroup X]
[NormedAddCommGroup Y]
[NormedSpace ℝ X]
[NormedSpace ℝ Y]
{f g : X → Y}
{x : X}
{u : Set X}
(hx : x ∈ u)
(hu : IsOpen u)
(hf : ConformalAt f x)
(h : ∀ x ∈ u, g x = f x)


@[fun_prop]
theorem Differentiable.const_mul (ha : Differentiable 𝕜 a) (b : 𝔸) :
    Differentiable 𝕜 fun y => b * a y

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{𝔸 : Type u_6}
[NormedRing 𝔸]
[NormedAlgebra 𝕜 𝔸]
{a : E → 𝔸}
(ha : Differentiable 𝕜 a)
(b : 𝔸)


theorem dite_eq_iff : dite P A B = c ↔ (∃ h, A h = c) ∨ ∃ h, B h = c

{α : Sort u_1}
{P : Prop}
[Decidable P]
{c : α}
{A : P → α}
{B : ¬P → α}


/-- A set of linearly independent vectors in a module `M` over a semiring `S` is also linearly
independent over a subring `R` of `K`. -/
theorem LinearIndependent.restrict_scalars_algebras {R S M ι : Type*} [CommSemiring R] [Semiring S]
    [AddCommMonoid M] [Algebra R S] [Module R M] [Module S M] [IsScalarTower R S M]
    (hinj : Function.Injective (algebraMap R S)) {v : ι → M} (li : LinearIndependent S v) :
    LinearIndependent R v

(hinj : Function.Injective ⇑(algebraMap R S))


theorem adjoinRootEquivAdjoin_apply_root (h : IsIntegral F α) :
    adjoinRootEquivAdjoin F h (AdjoinRoot.root (minpoly F α)) = AdjoinSimple.gen F α

(F : Type u_1)
[Field F]
{E : Type u_2}
[Field E]
[Algebra F E]
{α : E}
(h : IsIntegral F α)

(IntermediateField.adjoinRootEquivAdjoin F h) (AdjoinRoot.root (minpoly F α)) = IntermediateField.AdjoinSimple.gen F α


@[simp]
theorem smul_ofGroup (g₁ g₂ : G) :
    g₁ • (ofGroup g₂ : NormalWord d) = ofGroup (g₁ * g₂)

{d : HNNExtension.NormalWord.TransversalPair G A B}

g₁ • HNNExtension.NormalWord.ofGroup g₂ = HNNExtension.NormalWord.ofGroup (g₁ * g₂)


/-- A specialization of `spectrum.subset_polynomial_aeval` to monic monomials for convenience. -/
theorem pow_image_subset (a : A) (n : ℕ) : (fun x => x ^ n) '' σ a ⊆ σ (a ^ n)

{𝕜 : Type u}
{A : Type v}
[Field 𝕜]
[Ring A]
[Algebra 𝕜 A]
(a : A)
(n : ℕ)

(fun x => x ^ n) '' spectrum 𝕜 a ⊆ spectrum 𝕜 (a ^ n)


@[simp]
theorem beckFork_ι : (beckFork X).ι = X.a

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

(CategoryTheory.Comonad.beckFork X).ι = X.a


/-- Any `CommMagma G` that satisfies `IsRightCancelMul G` also satisfies `IsLeftCancelMul G`. -/
@[to_additive AddCommMagma.IsRightCancelAdd.toIsLeftCancelAdd "Any `AddCommMagma G` that satisfies
`IsRightCancelAdd G` also satisfies `IsLeftCancelAdd G`."]
lemma CommMagma.IsRightCancelMul.toIsLeftCancelMul (G : Type u) [CommMagma G] [IsRightCancelMul G] :
    IsLeftCancelMul G


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

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


@[simp]
theorem results_think_iff {s : Computation α} {a n} : Results (think s) a (n + 1) ↔ Results s a n

{α : Type u}
{s : Computation α}
{a : α}
{n : ℕ}

s.think.Results a (n + 1) ↔ s.Results a n


/-- The topology induced by a strictly monotone function with order-connected range is the preorder
topology. -/
nonrec theorem StrictMono.induced_topology_eq_preorder {α β : Type*} [LinearOrder α]
    [LinearOrder β] [t : TopologicalSpace β] [OrderTopology β] {f : α → β}
    (hf : StrictMono f) (hc : OrdConnected (range f)) : t.induced f = Preorder.topology α

{α : Type u_1}
{β : Type u_2}
[LinearOrder α]
[LinearOrder β]
[t : TopologicalSpace β]
[OrderTopology β]
{f : α → β}
(hf : StrictMono f)
(hc : (Set.range f).OrdConnected)

TopologicalSpace.induced f t = Preorder.topology α


@[simp]
theorem vecCons_const (a : α) : (vecCons a fun _ : Fin n => a) = fun _ => a

(Matrix.vecCons a fun x => a) = fun x => a


theorem lineMap_le_left_iff_le (h : 0 < r) : lineMap a b r ≤ a ↔ b ≤ a

{k : Type u_1}
{E : Type u_2}
[LinearOrderedField k]
[OrderedAddCommGroup E]
[Module k E]
[OrderedSMul k E]
{a b : E}
{r : k}
(h : 0 < r)


/-- The factors of `n` are the prime divisors -/
theorem primeFactors_eq_to_filter_divisors_prime (n : ℕ) :
    n.primeFactors = (divisors n).filter Prime

n.primeFactors = Finset.filter Nat.Prime n.divisors


theorem mk_list_le_max (α : Type u) : #(List α) ≤ max ℵ₀ #α


theorem matrix_mul_apply [Fintype m] [Semiring α] [DecidableEq n] (M : Matrix l m α) (f : m ≃. n)
    (i j) : (M * f.toMatrix :) i j = Option.casesOn (f.symm j) 0 fun fj => M i fj

{l : Type u_2}
{m : Type u_3}
{n : Type u_4}
{α : Type v}
[Fintype m]
[Semiring α]
[DecidableEq n]
(M : Matrix l m α)
(f : m ≃. n)
(i : l)
(j : n)

(M * f.toMatrix) i j = Option.casesOn (f.symm j) 0 fun fj => M i fj


/-- Map `WithInitial` with respect to a functor `F : C ⥤ D`. -/
@[simps]
def map {D : Type*} [Category D] (F : C ⥤ D) : WithInitial C ⥤ WithInitial D

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

(CategoryTheory.WithInitial.map F).obj X =
  match X with
  | CategoryTheory.WithInitial.of x => CategoryTheory.WithInitial.of (F.obj x)
  | CategoryTheory.WithInitial.star => CategoryTheory.WithInitial.star


theorem laverage_union (hd : AEDisjoint μ s t) (ht : NullMeasurableSet t μ) :
    ⨍⁻ x in s ∪ t, f x ∂μ =
      μ s / (μ s + μ t) * ⨍⁻ x in s, f x ∂μ + μ t / (μ s + μ t) * ⨍⁻ x in t, f x ∂μ

{f : α → ℝ≥0∞}

(ht : MeasureTheory.NullMeasurableSet t μ)

⨍⁻ (x : α) in s ∪ t, f x ∂μ = μ s / (μ s + μ t) * ⨍⁻ (x : α) in s, f x ∂μ + μ t / (μ s + μ t) * ⨍⁻ (x : α) in t, f x ∂μ


@[simps]
instance : MonoidalCategoryStruct (FullSubcategory P)

(X Y Z : CategoryTheory.FullSubcategory P)

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


theorem Nat.pred_mul_geom_sum_le (a b n : ℕ) :
    ((b - 1) * ∑ i ∈ range n.succ, a / b ^ i) ≤ a * b - a / b ^ n

(b - 1) * ∑ i ∈ Finset.range n.succ, a / b ^ i ≤ a * b - a / b ^ n


/-- A commutative multiplicative magma is a type with a multiplication which commutes. -/
@[ext]
class CommMagma (G : Type u) extends Mul G where
  /-- Multiplication is commutative in a commutative multiplicative magma. -/
  protected mul_comm : ∀ a b : G, a * b = b * a

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


/-- Given an `A`-algebra `B` and `S : Set ℕ+`, we define `IsCyclotomicExtension S A B` requiring
that there is an `n`-th primitive root of unity in `B` for all `n ∈ S` and that `B` is generated
over `A` by the roots of `X ^ n - 1`. -/

@[mk_iff]
class IsCyclotomicExtension : Prop where
  /-- For all `n ∈ S`, there exists a primitive `n`-th root of unity in `B`. -/
  exists_prim_root {n : ℕ+} (ha : n ∈ S) : ∃ r : B, IsPrimitiveRoot r n
  /-- The `n`-th roots of unity, for `n ∈ S`, generate `B` as an `A`-algebra. -/
  adjoin_roots : ∀ x : B, x ∈ adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1}

{S : Set ℕ+}
(A : Type u)
{B : Type v}
[CommRing A]
[CommRing B]
[Algebra A B]
[self : IsCyclotomicExtension S A B]
{n : ℕ+}
(ha : n ∈ S)


theorem edist_congr_right {x y z : α} (h : edist x y = 0) : edist x z = edist y z

{α : Type u}
[PseudoEMetricSpace α]
{x y z : α}
(h : edist x y = 0)


theorem antidiagonalTuple_zero_right (k : ℕ) : antidiagonalTuple k 0 = {0}

Multiset.Nat.antidiagonalTuple k 0 = {0}


theorem GoodProducts.linearIndependent_iff_union_smaller {o : Ordinal} (ho : o.IsLimit)
    (hsC : contained C o) : LinearIndependent ℤ (GoodProducts.eval C) ↔
    LinearIndependent ℤ (fun (p : ⋃ (e : {o' // o' < o}), (smaller C e.val)) ↦ p.1)

(hsC : Profinite.NobelingProof.contained C o)

LinearIndependent ℤ (Profinite.NobelingProof.GoodProducts.eval C) ↔
  LinearIndependent ℤ fun (p : ↑(⋃ e, Profinite.NobelingProof.GoodProducts.smaller C ↑e)) => ↑p


theorem eq_prod_roots_of_splits_id {p : K[X]} (hsplit : Splits (RingHom.id K) p) :
    p = C p.leadingCoeff * (p.roots.map fun a => X - C a).prod

(hsplit : Polynomial.Splits (RingHom.id K) p)

p = Polynomial.C p.leadingCoeff * (Multiset.map (fun a => Polynomial.X - Polynomial.C a) p.roots).prod


/-- Reindexing both indices along the same equivalence preserves the determinant.

For the `simp` version of this lemma, see `det_submatrix_equiv_self`.
-/
theorem det_reindexLinearEquiv_self [CommRing R] [Fintype m] [DecidableEq m] [Fintype n]
    [DecidableEq n] (e : m ≃ n) (M : Matrix m m R) : det (reindexLinearEquiv R R e e M) = det M

{m : Type u_2}
{n : Type u_3}
(R : Type u_11)
[CommRing R]
[Fintype m]
[DecidableEq m]
[Fintype n]
[DecidableEq n]
(e : m ≃ n)
(M : Matrix m m R)

((Matrix.reindexLinearEquiv R R e e) M).det = M.det


theorem one_lt_rootMultiplicity_iff_isRoot_iterate_derivative
    {p : R[X]} {t : R} (h : p ≠ 0) :
    1 < p.rootMultiplicity t ↔ ∀ m ≤ 1, (derivative^[m] p).IsRoot t

{R : Type u}
[CommRing R]
{p : R[X]}
{t : R}
(h : p ≠ 0)

1 < Polynomial.rootMultiplicity t p ↔ ∀ m ≤ 1, ((⇑Polynomial.derivative)^[m] p).IsRoot t


protected theorem add_le_add_right {a b : Int} (h : a ≤ b) (c : Int) : a + c ≤ b + c


@[simp]
theorem coe_maxTrivLinearMapEquivLieModuleHom_symm (f : M →ₗ⁅R,L⁆ N) :
    (maxTrivLinearMapEquivLieModuleHom.symm f : M → N) = f

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

⇑↑(LieModule.maxTrivLinearMapEquivLieModuleHom.symm f) = ⇑f


/-- Mapping by the composite morphism `f ≫ g` is the same as mapping by `f` then by `g`. -/
theorem mapComp_eq {X Y Z : T} (f : X ⟶ Y) (g : Y ⟶ Z) :
    map (f ≫ g) = (map f) ⋙ (map g)

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

CategoryTheory.Over.map (CategoryTheory.CategoryStruct.comp f g) =
  (CategoryTheory.Over.map f).comp (CategoryTheory.Over.map g)


@[simp]
theorem sin_sub_int_mul_two_pi (x : ℝ) (n : ℤ) : sin (x - n * (2 * π)) = sin x

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


@[to_additive]
theorem leftInverse_mul_right_inv_mul (c : G) :
    Function.LeftInverse (fun x ↦ c * x) fun x ↦ c⁻¹ * x

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


lemma Spec.map_eqToHom {R S : CommRingCat} (e : R = S) :
    Spec.map (eqToHom e) = eqToHom (e ▸ rfl)

AlgebraicGeometry.Spec.map (CategoryTheory.eqToHom e) = CategoryTheory.eqToHom ⋯


theorem dist_triangle4 (x y z w : α) : dist x w ≤ dist x y + dist y z + dist z w

{α : Type u}
[PseudoMetricSpace α]
(x y z w : α)


theorem Finite.infsep_of_nontrivial (hsf : s.Finite) (hs : s.Nontrivial) :
    s.infsep = hsf.offDiag.toFinset.inf' (by simpa) (uncurry dist)

{α : Type u_1}
[PseudoMetricSpace α]
{s : Set α}
(hsf : s.Finite)
(hs : s.Nontrivial)

s.infsep = ⋯.toFinset.inf' ⋯ (Function.uncurry dist)


theorem ne_of_beq_false [BEq α] [LawfulBEq α] {a b : α} (h : (a == b) = false) : a ≠ b

{α : Type u_1}
[BEq α]
[LawfulBEq α]
{a b : α}
(h : (a == b) = false)


@[simp, fun_prop]
theorem differentiableOn_const (c : F) : DifferentiableOn 𝕜 (fun _ => c) s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{s : Set E}
(c : F)


lemma tendsto_defaultRatCDF_atTop : Tendsto defaultRatCDF atTop (𝓝 1)

Filter.Tendsto ProbabilityTheory.defaultRatCDF Filter.atTop (𝓝 1)


@[reassoc (attr := simp)]
lemma unop_inv_hom_id_app : (e.inv.app X).unop ≫ (e.hom.app X).unop = 𝟙 _

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u_1}
[CategoryTheory.Category.{u_2, u_1} D]
{F G : CategoryTheory.Functor C Dᵒᵖ}
(e : F ≅ G)
(X : C)

CategoryTheory.CategoryStruct.comp (e.inv.app X).unop (e.hom.app X).unop =
  CategoryTheory.CategoryStruct.id (Opposite.unop (F.obj X))


@[to_additive]
theorem sInf_div : sInf (s / t) = sInf s / sSup t

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

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


@[simp]
theorem map_top : (⊤ : MeasurableSpace α).map f = ⊤

{α : Type u_1}
{β : Type u_2}
{f : α → β}


@[to_additive]
theorem contMDiff_one [One M'] : ContMDiff I I' n (1 : M → M')

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M' : Type u_7}
[TopologicalSpace M']
[ChartedSpace H' M']
{n : ℕ∞}
[One M']


@[simp]
theorem isTop_toDual_iff : IsTop (toDual a) ↔ IsBot a


@[to_additive]
theorem Subsingleton.pi_mulSingle_eq {α : Type*} [DecidableEq I] [Subsingleton I] [One α]
    (i : I) (x : α) : Pi.mulSingle i x = fun _ => x

{I : Type u}
{α : Type u_4}
[DecidableEq I]
[Subsingleton I]
[One α]
(i : I)
(x : α)


@[to_additive]
lemma prod_sdiff_ne_prod_sdiff_iff :
    ∏ i ∈ s \ t, f i ≠ ∏ i ∈ t \ s, f i ↔ ∏ i ∈ s, f i ≠ ∏ i ∈ t, f i

{ι : Type u_1}
{α : Type u_3}
[DecidableEq ι]
[AddCancelCommMonoid α]
{s t : Finset ι}
{f : ι → α}

∑ i ∈ s \ t, f i ≠ ∑ i ∈ t \ s, f i ↔ ∑ i ∈ s, f i ≠ ∑ i ∈ t, f i


lemma Flat.closure (hF : M.Flat F) : M.closure F = F

{α : Type u_2}
{M : Matroid α}
{F : Set α}
(hF : M.Flat F)


theorem map_modByMonic (h : IsAdjoinRootMonic S f) (g : R[X]) : h.map (g %ₘ f) = h.map g

{R : Type u}
{S : Type v}
[CommRing R]
[Ring S]
{f : R[X]}
[Algebra R S]
(h : IsAdjoinRootMonic S f)
(g : R[X])


/-- Peel off a single integral from a `lmarginal` integral at the end (compare with
`lmarginal_erase`, which peels off an integral at the beginning). -/
theorem lmarginal_erase' (f : (∀ i, π i) → ℝ≥0∞) (hf : Measurable f) {i : δ}
    (hi : i ∈ s) :
    ∫⋯∫⁻_s, f ∂μ = ∫⋯∫⁻_(erase s i), (fun x ↦ ∫⁻ xᵢ, f (Function.update x i xᵢ) ∂μ i) ∂μ

{μ : (i : δ) → MeasureTheory.Measure (π i)}

[∀ (i : δ), MeasureTheory.SigmaFinite (μ i)]

∫⋯∫⁻_s, f ∂μ = ∫⋯∫⁻_s.erase i, fun x => ∫⁻ (xᵢ : π i), f (Function.update x i xᵢ) ∂μ i ∂μ


theorem star_add_self : star a + a = 2 * a.re

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


theorem subset_powerset_iff {s : Set (Set α)} {t : Set α} : s ⊆ 𝒫 t ↔ ⋃₀ s ⊆ t

{α : Type u_1}
{s : Set (Set α)}
{t : Set α}

s ⊆ 𝒫 t ↔ ⋃₀ s ⊆ t


@[elab_as_elim]
lemma Nat.strong_decreasing_induction (base : ∃ n, ∀ m > n, P m) (step : ∀ n, (∀ m > n, P m) → P n)
    (n : ℕ) : P n

(step : ∀ (n : ℕ), (∀ m > n, P m) → P n)


/-- An ideal `I` is prime if its complement is a filter.
-/
@[mk_iff]
class IsPrime [Preorder P] (I : Ideal P) extends IsProper I : Prop where
  compl_filter : IsPFilter (I : Set P)ᶜ

{P : Type u_1}
[Preorder P]
{I : Order.Ideal P}
[self : I.IsPrime]


@[simp]
theorem mapRange.equiv_symm (f : M ≃ N) (hf hf') :
    ((mapRange.equiv f hf hf').symm : (α →₀ _) ≃ _) = mapRange.equiv f.symm hf' hf

{α : Type u_1}
{M : Type u_5}
{N : Type u_7}
[Zero M]
[Zero N]
(f : M ≃ N)
(hf : f 0 = 0)
(hf' : f.symm 0 = 0)

(Finsupp.mapRange.equiv f hf hf').symm = Finsupp.mapRange.equiv f.symm hf' hf


theorem blocksFun_congr {n₁ n₂ : ℕ} (c₁ : Composition n₁) (c₂ : Composition n₂) (i₁ : Fin c₁.length)
    (i₂ : Fin c₂.length) (hn : n₁ = n₂) (hc : c₁.blocks = c₂.blocks) (hi : (i₁ : ℕ) = i₂) :
    c₁.blocksFun i₁ = c₂.blocksFun i₂

{n₁ n₂ : ℕ}
(c₁ : Composition n₁)
(c₂ : Composition n₂)
(i₁ : Fin c₁.length)
(i₂ : Fin c₂.length)
(hn : n₁ = n₂)
(hc : c₁.blocks = c₂.blocks)
(hi : ↑i₁ = ↑i₂)


@[simp]
theorem toSubalgebra_le_toSubalgebra {S S' : IntermediateField K L} :
    S.toSubalgebra ≤ S'.toSubalgebra ↔ S ≤ S'

{K : Type u_1}
{L : Type u_2}
[Field K]
[Field L]
[Algebra K L]
{S S' : IntermediateField K L}


lemma hasCokernel [S.HasRightHomology] : HasCokernel S.f


theorem Nodup.rotate_congr {l : List α} (hl : l.Nodup) (hn : l ≠ []) (i j : ℕ)
    (h : l.rotate i = l.rotate j) : i % l.length = j % l.length

{α : Type u}
{l : List α}
(hl : l.Nodup)
(hn : l ≠ [])
(i j : ℕ)
(h : l.rotate i = l.rotate j)


/-- If `e : C ≌ D` is an equivalence of categories, then `functoriality F e.functor` induces an
equivalence between cones over `F` and cones over `F ⋙ e.functor`.
-/
@[simps]
def functorialityEquivalence (e : C ≌ D) : Cone F ≌ Cone (F ⋙ e.functor)

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{D : Type u₄}
[CategoryTheory.Category.{v₄, u₄} D]
(F : J ⥤ C)
(e : C ≌ D)

(CategoryTheory.Limits.Cones.functorialityEquivalence F e).unitIso =
  CategoryTheory.NatIso.ofComponents
    (fun c => CategoryTheory.Limits.Cones.ext (e.unitIso.app ((𝟭 (CategoryTheory.Limits.Cone F)).obj c).1) ⋯) ⋯


@[simp]
theorem posPart_mk (f : α → γ) (hf) :
    posPart (mk f hf : α →ₘ[μ] γ) =
      mk (fun x => max (f x) 0)
        ((continuous_id.max continuous_const).comp_aestronglyMeasurable hf)

(hf : MeasureTheory.AEStronglyMeasurable f μ)

(MeasureTheory.AEEqFun.mk f hf).posPart = MeasureTheory.AEEqFun.mk (fun x => max (f x) 0) ⋯


@[simp] theorem succ_inj {a b : Fin n} : a.succ = b.succ ↔ a = b


theorem le_of_epi {n m : ℕ} {f : ([n] : SimplexCategory) ⟶ [m]} : Epi f → m ≤ n

{f : SimplexCategory.mk n ⟶ SimplexCategory.mk m}


protected theorem Chain.rel [IsTrans α R] (hl : l.Chain R a) (hb : b ∈ l) : R a b

{α : Type u}
{R : α → α → Prop}
{l : List α}
{a b : α}
[IsTrans α R]
(hl : List.Chain R a l)
(hb : b ∈ l)


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

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

∀ {X Y : C} (f : X ⟶ Y), ((CategoryTheory.Comonad.comparison h).map f).f = L.map f


theorem leibniz_lie : ⁅x, ⁅y, m⁆⁆ = ⁅⁅x, y⁆, m⁆ + ⁅y, ⁅x, m⁆⁆

{L : Type v}
{M : Type w}
[LieRing L]
[AddCommGroup M]
[LieRingModule L M]
(x y : L)
(m : M)


theorem congr_right {a b c : α} : s(a, b) = s(a, c) ↔ b = c


protected theorem ciSup_mul (c : Cardinal.{v}) : (⨆ i, f i) * c = ⨆ i, f i * c

{ι : Type u}
(f : ι → Cardinal.{v})
(c : Cardinal.{v})


@[simp]
theorem congr_apply (e : G ≃* H) (he : G'.map ↑e = H') (x : G) :
    congr G' H' e he x = mk' H' (e x)

{G : Type u}
[Group G]
{H : Type v}
[Group H]
(G' : Subgroup G)
(H' : Subgroup H)
[G'.Normal]
[H'.Normal]
(e : G ≃* H)
(he : Subgroup.map (↑e) G' = H')
(x : G)

(QuotientGroup.congr G' H' e he) ↑x = (QuotientGroup.mk' H') (e x)


theorem hasColimit_op_of_hasLimit (F : J ⥤ C) [HasLimit F] : HasColimit F.op

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


theorem coeff_X_pow_mul' (p : R⟦X⟧) (n d : ℕ) :
    coeff R d (X ^ n * p) = ite (n ≤ d) (coeff R (d - n) p) 0

{R : Type u_1}
[Semiring R]
(p : PowerSeries R)
(n d : ℕ)

(PowerSeries.coeff R d) (PowerSeries.X ^ n * p) = if n ≤ d then (PowerSeries.coeff R (d - n)) p else 0


theorem isLUB_l_image {s : Set α} {a : α} (h : IsLUB s a) : IsLUB (l '' s) (l a)

{α : Type u}
{β : Type v}
[Preorder α]
[Preorder β]
{l : α → β}
{u : β → α}
(gc : GaloisConnection l u)
{s : Set α}
{a : α}
(h : IsLUB s a)


theorem cfcₙHom_comp [UniqueNonUnitalContinuousFunctionalCalculus R A] (f : C(σₙ R a, R)₀)
    (f' : C(σₙ R a, σₙ R (cfcₙHom ha f))₀)
    (hff' : ∀ x, f x = f' x) (g : C(σₙ R (cfcₙHom ha f), R)₀) :
    cfcₙHom ha (g.comp f') = cfcₙHom (cfcₙHom_predicate ha f) g

(f' : C(↑(σₙ R a), ↑(σₙ R ((cfcₙHom ha) f)))₀)

(hff' : ∀ (x : ↑(σₙ R a)), f x = ↑(f' x))

(cfcₙHom ha) (g.comp f') = (cfcₙHom ⋯) g


/-- Build a `AlgEquiv` from an isomorphism in the category `AlgebraCat R`. -/
@[simps]
def toAlgEquiv {X Y : AlgebraCat R} (i : X ≅ Y) : X ≃ₐ[R] Y

{R : Type u}
[CommRing R]
{X Y : AlgebraCat R}
(i : X ≅ Y)
(a : ↑X)


@[simp]
theorem self_comp_symm_toEmbedding (f : M ≃[L] N) :
    f.toEmbedding.comp f.symm.toEmbedding = Embedding.refl L N

{L : FirstOrder.Language}
{M : Type w}
{N : Type w'}
[L.Structure M]
[L.Structure N]
(f : L.Equiv M N)

f.toEmbedding.comp f.symm.toEmbedding = FirstOrder.Language.Embedding.refl L N


lemma map_add_right_Ioo (a b c : α) : ((Ioo a b).map fun x => x + c) = Ioo (a + c) (b + c)

{α : Type u_1}
[OrderedCancelAddCommMonoid α]
[ExistsAddOfLE α]
[LocallyFiniteOrder α]
(a b c : α)

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


theorem subset_pointwise_smul_iff {a : α} {S T : Subgroup G} : S ≤ a • T ↔ a⁻¹ • S ≤ T

{α : Type u_1}
{G : Type u_2}
[Group G]
[Group α]
[MulDistribMulAction α G]
{a : α}
{S T : Subgroup G}

S ≤ a • T ↔ a⁻¹ • S ≤ T


@[simp]
theorem associatesEquivIsPrincipal_map_zero :
    (associatesEquivIsPrincipal R 0 : Ideal R) = 0

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

↑((Ideal.associatesEquivIsPrincipal R) 0) = 0


theorem toRing_subgroups_basis (hB : SubmodulesRingBasis B) :
    RingSubgroupsBasis fun i => (B i).toAddSubgroup

{ι : Type u_1}
{R : Type u_2}
{A : Type u_3}
[CommRing R]
[CommRing A]
[Algebra R A]
{B : ι → Submodule R A}
(hB : SubmodulesRingBasis B)


theorem eLpNorm_norm_rpow (f : α → F) (hq_pos : 0 < q) :
    eLpNorm (fun x => ‖f x‖ ^ q) p μ = eLpNorm f (p * ENNReal.ofReal q) μ ^ q

{α : Type u_1}
{F : Type u_3}
{m0 : MeasurableSpace α}
{p : ℝ≥0∞}
{q : ℝ}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup F]
(f : α → F)
(hq_pos : 0 < q)

MeasureTheory.eLpNorm (fun x => ‖f x‖ ^ q) p μ = MeasureTheory.eLpNorm f (p * ENNReal.ofReal q) μ ^ q