/-- The image of a quotient is torsion iff the group is torsion. -/
@[to_additive AddIsTorsion.quotient_iff
      "The image of a quotient is additively torsion iff the group is torsion."]
theorem IsTorsion.quotient_iff {f : G →* H} (hf : Function.Surjective f) (hN : N = f.ker)
    (tN : IsTorsion N) : IsTorsion H ↔ IsTorsion G

{G : Type u_1}
{H : Type u_2}
[AddGroup G]
{N : AddSubgroup G}
[AddGroup H]
{f : G →+ H}
(hf : Function.Surjective ⇑f)
(hN : N = f.ker)
(tN : AddMonoid.IsTorsion ↥N)

AddMonoid.IsTorsion H ↔ AddMonoid.IsTorsion G


theorem Ico_inter_Ico : Ico a b ∩ Ico c d = Ico (max a c) (min b d)

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

Multiset.Ico a b ∩ Multiset.Ico c d = Multiset.Ico (max a c) (min b d)


@[simp]
theorem map_add (μ ν : Measure α) {f : α → β} (hf : Measurable f) :
    (μ + ν).map f = μ.map f + ν.map f

{α : Type u_1}
{β : Type u_2}
{m0 : MeasurableSpace α}
[MeasurableSpace β]
(μ ν : MeasureTheory.Measure α)
{f : α → β}
(hf : Measurable f)

MeasureTheory.Measure.map f (μ + ν) = MeasureTheory.Measure.map f μ + MeasureTheory.Measure.map f ν


@[simp]
lemma lift_mk {X Y : Type*} [TopologicalSpace X] [TopologicalSpace Y] [T2Space Y]
    {f : X → Y} (hf : Continuous f) (x : X) : lift hf (mk x) = f x

{X : Type u_3}
{Y : Type u_4}
[TopologicalSpace X]
[TopologicalSpace Y]
[T2Space Y]
{f : X → Y}
(hf : Continuous f)
(x : X)

t2Quotient.lift hf (t2Quotient.mk x) = f x


theorem comp' {n m f g} (hf : @Primrec' m f) (hg : @Vec n m g) : Primrec' fun v => f (g v)

{g : Mathlib.Vector ℕ n → Mathlib.Vector ℕ m}


@[to_additive (attr := continuity, fun_prop)]
theorem Continuous.mul {f g : X → M} (hf : Continuous f) (hg : Continuous g) :
    Continuous fun x => f x * g x

{M : Type u_3}
{X : Type u_5}
[TopologicalSpace X]
[TopologicalSpace M]
[Mul M]
[ContinuousMul M]
{f g : X → M}
(hf : Continuous f)
(hg : Continuous g)


theorem eval_ker {ι : Type*} (b : Basis ι R M) :
    LinearMap.ker (Dual.eval R M) = ⊥

{R : Type uR}
{M : Type uM}
[CommRing R]
[AddCommGroup M]
[Module R M]
{ι : Type u_1}
(b : Basis ι R M)

LinearMap.ker (Module.Dual.eval R M) = ⊥


@[simp]
theorem forgetEnrichment_id' (X : C) :
    ForgetEnrichment.homOf W (eId W X) = 𝟙 (ForgetEnrichment.of W X : C)

{C : Type u₁}
(W : Type (v + 1))
[CategoryTheory.Category.{v, v + 1} W]
[CategoryTheory.MonoidalCategory W]
[CategoryTheory.EnrichedCategory W C]
(X : C)

CategoryTheory.ForgetEnrichment.homOf W (CategoryTheory.eId W X) =
  CategoryTheory.CategoryStruct.id (CategoryTheory.ForgetEnrichment.of W X)


@[simp] theorem down_le [LE α] {a b : ULift α} : down a ≤ down b ↔ a ≤ b

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


theorem AssociatePrimes.mem_iff : I ∈ associatedPrimes R M ↔ IsAssociatedPrime I M

{R : Type u_1}
[CommRing R]
{I : Ideal R}
{M : Type u_2}
[AddCommGroup M]
[Module R M]


/-- The restriction of scalars functor `SheafOfModules R' ⥤ SheafOfModules R`
induced by a morphism of sheaves of rings `R ⟶ R'`. -/
@[simps]
noncomputable def restrictScalars :
    SheafOfModules.{v} R' ⥤ SheafOfModules.{v} R

{J : CategoryTheory.GrothendieckTopology C}

∀ {X Y : SheafOfModules R'} (φ : X ⟶ Y),
  ((SheafOfModules.restrictScalars α).map φ).val = (PresheafOfModules.restrictScalars α.val).map φ.val


theorem lt_logb_iff_rpow_lt (hy : 0 < y) : x < logb b y ↔ b ^ x < y


/-- If `z ∈ 𝒟ᵒ`, and `n : ℤ`, then `|z + n| > 1`. -/
theorem one_lt_normSq_T_zpow_smul (hz : z ∈ 𝒟ᵒ) (n : ℤ) : 1 < normSq (T ^ n • z : ℍ)

{z : ℍ}
(hz : z ∈ ModularGroup.fdo)
(n : ℤ)

1 < Complex.normSq ↑(ModularGroup.T ^ n • z)


/-- The left options of `x * y` of the second kind are the left options of `(-x) * (-y)` of the
  first kind, up to equivalence. -/
lemma leftMoves_mul_iff {x y : PGame} (P : Game → Prop) :
    (∀ k, P ⟦(x * y).moveLeft k⟧) ↔
    (∀ i j, P ⟦mulOption x y i j⟧) ∧ (∀ i j, P ⟦mulOption (-x) (-y) i j⟧)

{x y : SetTheory.PGame}
(P : SetTheory.Game → Prop)

(∀ (k : (x * y).LeftMoves), P ⟦(x * y).moveLeft k⟧) ↔
  (∀ (i : x.LeftMoves) (j : y.LeftMoves), P ⟦x.mulOption y i j⟧) ∧
    ∀ (i : (-x).LeftMoves) (j : (-y).LeftMoves), P ⟦(-x).mulOption (-y) i j⟧


@[to_additive]
lemma sup_div_right [SemilatticeSup β] [OrderBot β] (s t : Finset α) (f : α → β) :
    sup (s / t) f = sup t fun y ↦ sup s (f <| · / y)

{α : Type u_2}
{β : Type u_3}
[DecidableEq α]
[Sub α]
[SemilatticeSup β]
[OrderBot β]
(s t : Finset α)
(f : α → β)

(s - t).sup f = t.sup fun y => s.sup fun x => f (x - y)


theorem IsTopologicalBasis.diff_empty {s : Set (Set α)} (h : IsTopologicalBasis s) :
    IsTopologicalBasis (s \ {∅})

(h : TopologicalSpace.IsTopologicalBasis s)

TopologicalSpace.IsTopologicalBasis (s \ {∅})


theorem aeval_bind₁ [Algebra R S] (f : τ → S) (g : σ → MvPolynomial τ R) (φ : MvPolynomial σ R) :
    aeval f (bind₁ g φ) = aeval (fun i => aeval f (g i)) φ

{σ : Type u_1}
{τ : Type u_2}
{R : Type u_3}
{S : Type u_4}
[CommSemiring R]
[CommSemiring S]
[Algebra R S]
(f : τ → S)
(g : σ → MvPolynomial τ R)
(φ : MvPolynomial σ R)

(MvPolynomial.aeval f) ((MvPolynomial.bind₁ g) φ) = (MvPolynomial.aeval fun i => (MvPolynomial.aeval f) (g i)) φ


@[simp] theorem toCoalgebraCatIso_symm (e : X ≃ₗc[R] Y) :
    toCoalgebraCatIso e.symm = (toCoalgebraCatIso e).symm

{R : Type u}
[CommRing R]
{X Y : Type v}
[AddCommGroup X]
[Module R X]
[AddCommGroup Y]
[Module R Y]
[Coalgebra R X]
[Coalgebra R Y]
(e : X ≃ₗc[R] Y)


private theorem list_foldl' {f : α → List β} {g : α → σ} {h : α → σ × β → σ}
    (hf : haveI := prim H; Primrec f) (hg : Primrec g) (hh : haveI := prim H; Primrec₂ h) :
    Primrec fun a => (f a).foldl (fun s b => h a (s, b)) (g a)

(H : Nat.Primrec fun n => Encodable.encode (Encodable.decode n))

{h : α → σ × β → σ}

Primrec fun a => List.foldl (fun s b => h a (s, b)) (g a) (f a)


@[to_additive (attr := simp)]
theorem fst_comp_swap : fst.comp (swap M N) = snd

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

Monoid.Coprod.fst.comp (Monoid.Coprod.swap M N) = Monoid.Coprod.snd


/-- The language map adding constants.  -/
@[simps!] -- Porting note: add `!` to `simps`
def lhomWithConstants : L →ᴸ L[[α]]

(L : FirstOrder.Language)
(α : Type w')
(_n : ℕ)
(val : L.Relations _n)

(L.lhomWithConstants α).onRelation val = Sum.inl val


/-- Let `f` be a measurable function integrable on `a..b`. The function `(u, v) ↦ ∫ x in u..v, f x`
has derivative `(u, v) ↦ v • cb - u • ca` within `s × t` at `(a, b)`, where
`s ∈ {Iic a, {a}, Ici a, univ}` and `t ∈ {Iic b, {b}, Ici b, univ}` provided that `f` tends to `ca`
and `cb` almost surely at the filters `la` and `lb` from the following table.

| `s`     | `la`     | `t`     | `lb`     |
| ------- | ----     | ---     | ----     |
| `Iic a` | `𝓝[≤] a` | `Iic b` | `𝓝[≤] b` |
| `Ici a` | `𝓝[>] a` | `Ici b` | `𝓝[>] b` |
| `{a}`   | `⊥`      | `{b}`   | `⊥`      |
| `univ`  | `𝓝 a`    | `univ`  | `𝓝 b`    |
-/
theorem integral_hasFDerivWithinAt_of_tendsto_ae (hf : IntervalIntegrable f volume a b)
    {s t : Set ℝ} [FTCFilter a (𝓝[s] a) la] [FTCFilter b (𝓝[t] b) lb]
    (hmeas_a : StronglyMeasurableAtFilter f la) (hmeas_b : StronglyMeasurableAtFilter f lb)
    (ha : Tendsto f (la ⊓ ae volume) (𝓝 ca)) (hb : Tendsto f (lb ⊓ ae volume) (𝓝 cb)) :
    HasFDerivWithinAt (fun p : ℝ × ℝ => ∫ x in p.1..p.2, f x)
      ((snd ℝ ℝ ℝ).smulRight cb - (fst ℝ ℝ ℝ).smulRight ca) (s ×ˢ t) (a, b)

(hf : IntervalIntegrable f MeasureTheory.volume a b)

[intervalIntegral.FTCFilter a (𝓝[s] a) la]

[intervalIntegral.FTCFilter b (𝓝[t] b) lb]

(hmeas_a : StronglyMeasurableAtFilter f la MeasureTheory.volume)

(hmeas_b : StronglyMeasurableAtFilter f lb MeasureTheory.volume)

(ha : Filter.Tendsto f (la ⊓ MeasureTheory.ae MeasureTheory.volume) (𝓝 ca))

(hb : Filter.Tendsto f (lb ⊓ MeasureTheory.ae MeasureTheory.volume) (𝓝 cb))

HasFDerivWithinAt (fun p => ∫ (x : ℝ) in p.1 ..p.2, f x)
  ((ContinuousLinearMap.snd ℝ ℝ ℝ).smulRight cb - (ContinuousLinearMap.fst ℝ ℝ ℝ).smulRight ca) (s ×ˢ t) (a, b)


theorem iInf_mk [InfSet α] [InfSet β] (f : ι → α) (g : ι → β) :
    ⨅ i, (f i, g i) = (⨅ i, f i, ⨅ i, g i)

{α : Type u_1}
{β : Type u_2}
{ι : Sort u_5}
[InfSet α]
[InfSet β]
(f : ι → α)
(g : ι → β)


@[simp] theorem map_inl (f : α → α') (g : β → β') (x : α) : (inl x).map f g = inl (f x)

{α : Type u_1}
{α' : Type u_2}
{β : Type u_3}
{β' : Type u_4}
(f : α → α')
(g : β → β')
(x : α)


/-- Linear map sending the matrix [a, b; c, d] to the matrix [ac₀ + bd₀, - ad₀ + bc₀; c, d], for
some fixed `(c₀, d₀)`. -/
@[simps!]
def lcRow0Extend {cd : Fin 2 → ℤ} (hcd : IsCoprime (cd 0) (cd 1)) :
    Matrix (Fin 2) (Fin 2) ℝ ≃ₗ[ℝ] Matrix (Fin 2) (Fin 2) ℝ

(f : (i : Fin 2) → (fun a => Fin 2 → ℝ) i)

∀ (a : Fin 2),
  (ModularGroup.lcRow0Extend hcd) f i a =
    (![(LinearMap.GeneralLinearGroup.generalLinearEquiv ℝ (Fin 2 → ℝ))
            (Matrix.GeneralLinearGroup.toLinear (Matrix.planeConformalMatrix (↑(cd 0)) (-↑(cd 1)) ⋯)),
          LinearEquiv.refl ℝ (Fin 2 → ℝ)]
        i)
      (f i) a


@[continuity]
theorem continuous_totalSpaceMk (b : B) :
    Continuous[_, a.totalSpaceTopology] (TotalSpace.mk b)

{B : Type u_2}
{F : Type u_3}
{E : B → Type u_5}
[TopologicalSpace B]
[TopologicalSpace F]
[(x : B) → TopologicalSpace (E x)]
(a : FiberPrebundle F E)
(b : B)


theorem sInter_lift_sets (hg : Monotone g) :
    ⋂₀ { s | s ∈ f.lift g } = ⋂ s ∈ f, ⋂₀ { t | t ∈ g s }

{α : Type u_1}
{β : Type u_2}
{f : Filter α}
{g : Set α → Filter β}
(hg : Monotone g)

⋂₀ {s | s ∈ f.lift g} = ⋂ s ∈ f, ⋂₀ {t | t ∈ g s}


@[simp] theorem liftOrGet_none_right {f} {a : Option α} : liftOrGet f a none = a

{α : Type u_1}
{f : α → α → α}
{a : Option α}


@[simp]
theorem toEquiv_id (X : Type u) : (Iso.refl X).toEquiv = Equiv.refl X

(CategoryTheory.Iso.refl X).toEquiv = Equiv.refl X


theorem snd_pow_eq_sum [Monoid R] [AddMonoid M] [DistribMulAction R M] [DistribMulAction Rᵐᵒᵖ M]
    (x : tsze R M) (n : ℕ) :
    snd (x ^ n) = ((List.range n).map fun i => x.fst ^ (n.pred - i) •> x.snd <• x.fst ^ i).sum

{R : Type u}
{M : Type v}
[Monoid R]
[AddMonoid M]
[DistribMulAction R M]
[DistribMulAction Rᵐᵒᵖ M]
(x : tsze R M)
(n : ℕ)

(x ^ n).snd = (List.map (fun i => x.fst ^ (n.pred - i) •> x.snd <• x.fst ^ i) (List.range n)).sum


@[simp] theorem twoPowSum_bitIndices (n : ℕ) : (n.bitIndices.map (fun i ↦ 2 ^ i)).sum = n

(List.map (fun i => 2 ^ i) n.bitIndices).sum = n


@[simp, nolint simpNF] -- Porting note: simpNF claims that LHS does not simplify, but it does
theorem support_subtypeDomain {f : Π₀ i, β i} :
    (subtypeDomain p f).support = f.support.subtype p

[(i : ι) → (x : β i) → Decidable (x ≠ 0)]

(DFinsupp.subtypeDomain p f).support = Finset.subtype p f.support


theorem getLsb_eq_getMsb (x : BitVec w) (i : Nat) : x.getLsb i = (decide (i < w) && x.getMsb (w - 1 - i))


@[simp]
theorem getElem_indexOf [DecidableEq α] {a : α} : ∀ {l : List α} (h : indexOf a l < l.length),
    l[indexOf a l] = a

{α : Type u}
[DecidableEq α]
{a : α}
{l : List α}
(h : List.indexOf a l < l.length)


@[simp] lemma one_ne_ofNat (n : ℕ) [n.AtLeastTwo] : (1 : R) ≠ no_index (ofNat n)

{R : Type u_1}
[AddMonoidWithOne R]
[CharZero R]
(n : ℕ)
[n.AtLeastTwo]


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

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[TopologicalSpace α]
[TopologicalSpace β]
[TopologicalSpace γ]
(g : C(β, γ))
(f : C(α, β))

Specialization.map (g.comp f) = (Specialization.map g).comp (Specialization.map f)


theorem trace_gen_eq_zero {x : L} (hx : ¬IsIntegral K x) :
    Algebra.trace K K⟮x⟯ (AdjoinSimple.gen K x) = 0

{K : Type u_4}
{L : Type u_5}
[Field K]
[Field L]
[Algebra K L]
{x : L}
(hx : ¬IsIntegral K x)

(Algebra.trace K ↥K⟮x⟯) (IntermediateField.AdjoinSimple.gen K x) = 0


theorem memℒp_of_cauchy_tendsto (hp : 1 ≤ p) {f : ℕ → α → E} (hf : ∀ n, Memℒp (f n) p μ)
    (f_lim : α → E) (h_lim_meas : AEStronglyMeasurable f_lim μ)
    (h_tendsto : atTop.Tendsto (fun n => eLpNorm (f n - f_lim) p μ) (𝓝 0)) : Memℒp f_lim p μ

(hf : ∀ (n : ℕ), MeasureTheory.Memℒp (f n) p μ)

(h_lim_meas : MeasureTheory.AEStronglyMeasurable f_lim μ)

(h_tendsto : Filter.Tendsto (fun n => MeasureTheory.eLpNorm (f n - f_lim) p μ) Filter.atTop (𝓝 0))


theorem isLowerSet_iff_Iic_subset : IsLowerSet s ↔ ∀ ⦃a⦄, a ∈ s → Iic a ⊆ s

IsLowerSet s ↔ ∀ ⦃a : α⦄, a ∈ s → Set.Iic a ⊆ s


/-- See also `AddMonoid.End.intCast_def`. -/
@[simp]
theorem AddMonoid.End.intCast_apply [AddCommGroup M] (z : ℤ) (m : M) :
    (↑z : AddMonoid.End M) m = z • m

{M : Type uM}
[AddCommGroup M]
(z : ℤ)
(m : M)


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

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


/-- The piecewise multiplication from the `Mul` instance, as a bundled linear homomorphism.

This is the graded version of `LinearMap.mul`, and the linear version of `DirectSum.gMulHom` -/
@[simps]
def gMulLHom {i j} : A i →ₗ[R] A j →ₗ[R] A (i + j)

{ι : Type uι}
(R : Type uR)
(A : ι → Type uA)
[DecidableEq ι]
[CommSemiring R]
[(i : ι) → AddCommMonoid (A i)]
[(i : ι) → Module R (A i)]
[AddMonoid ι]
[DirectSum.GSemiring A]
[DirectSum.GAlgebra R A]
{i j : ι}
(a : A i)
(b : A j)

((DirectSum.gMulLHom R A) a) b = GradedMonoid.GMul.mul a b


@[norm_cast]
lemma cast_mkRat_of_ne_zero (a : ℤ) {b : ℕ} (hb : (b : α) ≠ 0) : (mkRat a b : α) = a / b

{α : Type u_3}
[DivisionRing α]
(a : ℤ)
{b : ℕ}
(hb : ↑b ≠ 0)


theorem expNear_sub (n x r₁ r₂) : expNear n x r₁ -
    expNear n x r₂ = x ^ n / n.factorial * (r₁ - r₂)

Real.expNear n x r₁ - Real.expNear n x r₂ = x ^ n / ↑n.factorial * (r₁ - r₂)


@[simp]
theorem limit_cone_comp_aux (s : Cone (F ⋙ G)) (j : C) :
    s.π.app (lift F (F.obj j)) ≫ G.map (homToLift F (F.obj j)) = s.π.app j

(s : CategoryTheory.Limits.Cone (F.comp G))

CategoryTheory.CategoryStruct.comp (s.π.app (CategoryTheory.Functor.Initial.lift F (F.obj j)))
    (G.map (CategoryTheory.Functor.Initial.homToLift F (F.obj j))) =
  s.π.app j


protected theorem lt_add_of_pos_right (h : 0 < k) : n < n + k


@[simp]
theorem equiv_toEmbedding_trans_symm_toEmbedding {α β : Sort*} (e : α ≃ β) :
    e.toEmbedding.trans e.symm.toEmbedding = Embedding.refl _

{α : Sort u_1}
{β : Sort u_2}
(e : α ≃ β)

e.toEmbedding.trans e.symm.toEmbedding = Function.Embedding.refl α


@[simp]
theorem prodComm_trans_prodEquivOfIsCompl (h : IsCompl p q) :
    LinearEquiv.prodComm R q p ≪≫ₗ prodEquivOfIsCompl p q h = prodEquivOfIsCompl q p h.symm

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

LinearEquiv.prodComm R ↥q ↥p ≪≫ₗ p.prodEquivOfIsCompl q h = q.prodEquivOfIsCompl p ⋯


theorem hasStrictFDerivAt_euclidean :
    HasStrictFDerivAt f f' y ↔
      ∀ i, HasStrictFDerivAt (fun x => f x i) (EuclideanSpace.proj i ∘L f') y

{𝕜 : Type u_1}
{ι : Type u_2}
{H : Type u_3}
[RCLike 𝕜]
[NormedAddCommGroup H]
[NormedSpace 𝕜 H]
[Fintype ι]
{f : H → EuclideanSpace 𝕜 ι}
{f' : H →L[𝕜] EuclideanSpace 𝕜 ι}
{y : H}

HasStrictFDerivAt f f' y ↔ ∀ (i : ι), HasStrictFDerivAt (fun x => f x i) ((EuclideanSpace.proj i).comp f') y


protected theorem toMeasurable {X : Ω → E} {s : Set E} (hu : IsUniform X s ℙ μ) :
    IsUniform X (toMeasurable μ s) ℙ μ

{E : Type u_1}
[MeasurableSpace E]
{μ : MeasureTheory.Measure E}
{Ω : Type u_2}

∀ {x : MeasurableSpace Ω} {ℙ : MeasureTheory.Measure Ω} {X : Ω → E} {s : Set E},
  MeasureTheory.pdf.IsUniform X s ℙ μ → MeasureTheory.pdf.IsUniform X (MeasureTheory.toMeasurable μ s) ℙ μ


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

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

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


@[to_additive]
theorem prod_eq_mul {f : α → M} (a b : α) (h₁ : a ≠ b) (h₂ : ∀ x, x ≠ a ∧ x ≠ b → f x = 1) :
    ∏ x, f x = f a * f b

(h₂ : ∀ (x : α), x ≠ a ∧ x ≠ b → f x = 1)


theorem integrable_comp_smul_iff {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
    [MeasurableSpace E] [BorelSpace E] [FiniteDimensional ℝ E] (μ : Measure E) [IsAddHaarMeasure μ]
    (f : E → F) {R : ℝ} (hR : R ≠ 0) : Integrable (fun x => f (R • x)) μ ↔ Integrable f μ

{F : Type u_1}
[NormedAddCommGroup F]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[MeasurableSpace E]
[BorelSpace E]
[FiniteDimensional ℝ E]
(μ : MeasureTheory.Measure E)
[μ.IsAddHaarMeasure]
(f : E → F)
{R : ℝ}
(hR : R ≠ 0)

MeasureTheory.Integrable (fun x => f (R • x)) μ ↔ MeasureTheory.Integrable f μ


theorem cos_sq_arctan (x : ℝ) : cos (arctan x) ^ 2 = 1 / (1 + x ^ 2)

Real.cos (Real.arctan x) ^ 2 = 1 / (1 + x ^ 2)


theorem right_inv (x : A[X]) : (toFunAlgHom R A) (invFun R A x) = x

(R : Type u_1)
(A : Type u_2)
[CommSemiring R]
[Semiring A]
[Algebra R A]
(x : A[X])

(PolyEquivTensor.toFunAlgHom R A) (PolyEquivTensor.invFun R A x) = x


lemma isUniform_one : P.IsUniform G (1 : 𝕜)

{α : Type u_1}
{𝕜 : Type u_2}
[LinearOrderedField 𝕜]
[DecidableEq α]
{A : Finset α}
(P : Finpartition A)
(G : SimpleGraph α)
[DecidableRel G.Adj]


theorem multichoose_succ_succ (r : R) (k : ℕ) :
    multichoose (r + 1) (k + 1) = multichoose r (k + 1) + multichoose (r + 1) k

{R : Type u_2}
[NonAssocSemiring R]
[Pow R ℕ]
[NatPowAssoc R]
[BinomialRing R]
(r : R)
(k : ℕ)

Ring.multichoose (r + 1) (k + 1) = Ring.multichoose r (k + 1) + Ring.multichoose (r + 1) k


@[to_additive]
lemma iIndepFun.indepFun_prod_range_succ {f : ℕ → Ω → β} (hf_Indep : iIndepFun (fun _ ↦ m) f μ)
    (hf_meas : ∀ i, Measurable (f i)) (n : ℕ) : IndepFun (∏ j ∈ Finset.range n, f j) (f n) μ

{f : ℕ → Ω → β}

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

ProbabilityTheory.IndepFun (∏ j ∈ Finset.range n, f j) (f n) μ


/-- The Clifford algebra over an orthogonal direct sum of quadratic vector spaces is isomorphic
as an algebra to the graded tensor product of the Clifford algebras of each space.

This is `CliffordAlgebra.toProd` and `CliffordAlgebra.ofProd` as an equivalence. -/
@[simps!]
def prodEquiv : CliffordAlgebra (Q₁.prod Q₂) ≃ₐ[R] (evenOdd Q₁ ᵍ⊗[R] evenOdd Q₂)

(a : CliffordAlgebra (QuadraticMap.prod Q₁ Q₂))

(CliffordAlgebra.prodEquiv Q₁ Q₂) a = (CliffordAlgebra.ofProd Q₁ Q₂) a


lemma Finset.centerMass_of_sum_add_sum_eq_zero {s t : Finset ι}
    (hw : ∑ i ∈ s, w i + ∑ i ∈ t, w i = 0) (hz : ∑ i ∈ s, w i • z i + ∑ i ∈ t, w i • z i = 0) :
    s.centerMass w z = t.centerMass w z


theorem mk_quotient_le {α : Type u} {s : Setoid α} : #(Quotient s) ≤ #α

Cardinal.mk (Quotient s) ≤ Cardinal.mk α


@[simp] theorem append_replicate_replicate : replicate n a ++ replicate m a = replicate (n + m) a

∀ {α : Type u_1} {a : α} {m : Nat}, List.replicate n a ++ List.replicate m a = List.replicate (n + m) a


theorem Rel.neg {a b : lib R X} (h : Rel R X a b) : Rel R X (-a) (-b)

{R : Type u}
{X : Type v}
[CommRing R]
{a b : lib R X}
(h : FreeLieAlgebra.Rel R X a b)


theorem annihilator_eq_top_iff : N.annihilator = ⊤ ↔ N = ⊥

{R : Type u}
{M : Type v}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
{N : Submodule R M}


/-- A map `f : X → Y` between two topological spaces is said to be **proper** if it is continuous
and, for all `ℱ : Filter X`, any cluster point of `map f ℱ` is the image by `f` of a cluster point
of `ℱ`. -/
@[mk_iff isProperMap_iff_clusterPt, fun_prop]
structure IsProperMap (f : X → Y) extends Continuous f : Prop where
  /-- By definition, if `f` is a proper map and `ℱ` is any filter on `X`, then any cluster point of
  `map f ℱ` is the image by `f` of some cluster point of `ℱ`. -/
  clusterPt_of_mapClusterPt :
    ∀ ⦃ℱ : Filter X⦄, ∀ ⦃y : Y⦄, MapClusterPt y ℱ f → ∃ x, f x = y ∧ ClusterPt x ℱ

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
{f : X → Y}
(self : IsProperMap f)
⦃ℱ : Filter X⦄
⦃y : Y⦄


@[simp] lemma sum_count_eq_card {s : Finset α} {m : Multiset α} (hms : ∀ a ∈ m, a ∈ s) :
    ∑ a ∈ s, m.count a = card m

{α : Type u_3}
[DecidableEq α]
{s : Finset α}
{m : Multiset α}
(hms : ∀ a ∈ m, a ∈ s)

∑ a ∈ s, Multiset.count a m = Multiset.card m


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

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

∀ {X Y : CategoryTheory.Square C} (φ : X ⟶ Y), ((CategoryTheory.Functor.mapSquare C F).map φ).τ₂ = F.map φ.τ₂


@[simp]
theorem distortion_single (hJ : J ≤ I) (h : x ∈ Box.Icc I) :
    distortion (single I J hJ x h) = J.distortion

{ι : Type u_1}
{I J : BoxIntegral.Box ι}
{x : ι → ℝ}
[Fintype ι]
(hJ : J ≤ I)
(h : x ∈ BoxIntegral.Box.Icc I)

(BoxIntegral.TaggedPrepartition.single I J hJ x h).distortion = J.distortion


theorem AECover.integrable_of_lintegral_nnnorm_bounded' [l.NeBot] [l.IsCountablyGenerated]
    {φ : ι → Set α} (hφ : AECover μ l φ) {f : α → E} (I : ℝ≥0) (hfm : AEStronglyMeasurable f μ)
    (hbounded : ∀ᶠ i in l, (∫⁻ x in φ i, ‖f x‖₊ ∂μ) ≤ I) : Integrable f μ

(hfm : MeasureTheory.AEStronglyMeasurable f μ)

(hbounded : ∀ᶠ (i : ι) in l, ∫⁻ (x : α) in φ i, ↑‖f x‖₊ ∂μ ≤ ↑I)


theorem reduce_isReduced' (u : XgcdType) : u.reduce.IsReduced'


theorem UInt32.toNat_sub (x y : UInt32) :
    (x - y).toNat = (UInt32.size - y.toNat + x.toNat) % UInt32.size


/-- Left whiskering of an oplax natural transformation and a modification. -/
@[simps]
def whiskerLeft (η : F ⟶ G) {θ ι : G ⟶ H} (Γ : θ ⟶ ι) : η ≫ θ ⟶ η ≫ ι

{F G H : CategoryTheory.OplaxFunctor B C}

(CategoryTheory.OplaxNatTrans.whiskerLeft η Γ).app a = CategoryTheory.Bicategory.whiskerLeft (η.app a) (Γ.app a)


@[simp] theorem ble_eq : (Nat.ble x y = true) = (x ≤ y)


@[simp]
theorem add_apply : (x + y) i = x i + y i

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


lemma hom_ext (hP : IsPullback fst snd f g) {W : C} {k l : W ⟶ P}
    (h₀ : k ≫ fst = l ≫ fst) (h₁ : k ≫ snd = l ≫ snd) : k = l

(hP : CategoryTheory.IsPullback fst snd f g)


/-- The Yoneda embedding for `R`-linear categories `C`,
sending an object `X : C` to the `Module R`-valued presheaf on `C`,
with value on `Y : Cᵒᵖ` given by `Module.of R (unop Y ⟶ X)`. -/
@[simps]
def linearYoneda : C ⥤ Cᵒᵖ ⥤ ModuleCat R

(R : Type w)
[Ring R]
(C : Type u)
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Preadditive C]
[CategoryTheory.Linear R C]
(X : C)

∀ {X_1 Y : Cᵒᵖ} (f : X_1 ⟶ Y),
  ((CategoryTheory.linearYoneda R C).obj X).map f = ModuleCat.ofHom (CategoryTheory.Linear.leftComp R X f.unop)


@[simp, norm_cast]
theorem natCast_imI (n : ℕ) : (n : ℍ[R]).imI = 0


theorem inv_le_inv_of_neg (ha : a < 0) (hb : b < 0) : a⁻¹ ≤ b⁻¹ ↔ b ≤ a

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

a⁻¹ ≤ b⁻¹ ↔ b ≤ a


@[simp, nolint simpNF] -- Porting note (#10959): simp cannot prove this
theorem compTendsto'_coe (f : Germ l β) {lc : Filter γ} {g : γ → α} (hg : Tendsto g lc l) :
    f.compTendsto' _ hg.germ_tendsto = f.compTendsto g hg

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{l : Filter α}
(f : l.Germ β)
{lc : Filter γ}
{g : γ → α}
(hg : Filter.Tendsto g lc l)

f.compTendsto' ↑g ⋯ = f.compTendsto g hg


theorem translationNumber_eq_of_dist_bounded {f g : CircleDeg1Lift} (C : ℝ)
    (H : ∀ n : ℕ, dist ((f ^ n) 0) ((g ^ n) 0) ≤ C) : τ f = τ g


@[simp]
theorem y_one : (1 : Solution₁ d).y = 0


@[simp]
theorem not_eventually {p : α → Prop} {f : Filter α} : (¬∀ᶠ x in f, p x) ↔ ∃ᶠ x in f, ¬p x

{α : Type u}
{p : α → Prop}
{f : Filter α}

(¬∀ᶠ (x : α) in f, p x) ↔ ∃ᶠ (x : α) in f, ¬p x


/-- A sum version of Vieta's formula for `MvPolynomial`: viewing `X i` as variables,
the product of linear terms `λ + X i` is equal to a linear combination of
the symmetric polynomials `esymm σ R j`. -/
theorem MvPolynomial.prod_C_add_X_eq_sum_esymm :
    (∏ i : σ, (Polynomial.X + Polynomial.C (MvPolynomial.X i))) =
      ∑ j ∈ range (card σ + 1), Polynomial.C
        (MvPolynomial.esymm σ R j) * Polynomial.X ^ (card σ - j)

(R : Type u_1)
(σ : Type u_2)
[CommSemiring R]
[Fintype σ]

∏ i : σ, (Polynomial.X + Polynomial.C (MvPolynomial.X i)) =
  ∑ j ∈ Finset.range (Fintype.card σ + 1), Polynomial.C (MvPolynomial.esymm σ R j) * Polynomial.X ^ (Fintype.card σ - j)


theorem Continuous.comp_lowerSemicontinuous_antitone {g : γ → δ} {f : α → γ} (hg : Continuous g)
    (hf : LowerSemicontinuous f) (gmon : Antitone g) : UpperSemicontinuous (g ∘ f)

{α : Type u_1}
[TopologicalSpace α]
{γ : Type u_3}
[LinearOrder γ]
[TopologicalSpace γ]
[OrderTopology γ]
{δ : Type u_4}
[LinearOrder δ]
[TopologicalSpace δ]
[OrderTopology δ]
{g : γ → δ}
{f : α → γ}
(hg : Continuous g)
(hf : LowerSemicontinuous f)
(gmon : Antitone g)


lemma OneCocycle.class_eq_iff (γ₁ γ₂ : OneCocycle G U) :
    γ₁.class = γ₂.class ↔ γ₁.IsCohomologous γ₂

(γ₁ γ₂ : CategoryTheory.PresheafOfGroups.OneCocycle G U)


/-- Two real exponents `p, q` are conjugate if they are `> 1` and satisfy the equality
`1/p + 1/q = 1`. This condition shows up in many theorems in analysis, notably related to `L^p`
norms. -/
@[mk_iff]
structure IsConjExponent (p q : ℝ) : Prop where
  one_lt : 1 < p
  inv_add_inv_conj : p⁻¹ + q⁻¹ = 1


theorem mem_vertices : x ∈ K.vertices ↔ {x} ∈ K.faces

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedRing 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{K : Geometry.SimplicialComplex 𝕜 E}
{x : E}


@[to_additive single_le_sum]
theorem single_le_prod' (hf : ∀ i ∈ s, 1 ≤ f i) {a} (h : a ∈ s) : f a ≤ ∏ x ∈ s, f x

{ι : Type u_1}
{N : Type u_5}
[OrderedAddCommMonoid N]
{f : ι → N}
{s : Finset ι}
(hf : ∀ i ∈ s, 0 ≤ f i)
{a : ι}
(h : a ∈ s)


@[measurability]
theorem AEMeasurable.apply_continuousLinearMap {φ : α → F →L[𝕜] E} {μ : Measure α}
    (hφ : AEMeasurable φ μ) (v : F) : AEMeasurable (fun a => φ a v) μ

{α : Type u_1}
[MeasurableSpace α]
{𝕜 : Type u_2}
[NontriviallyNormedField 𝕜]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[MeasurableSpace E]
[BorelSpace E]
{F : Type u_4}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{φ : α → F →L[𝕜] E}
{μ : MeasureTheory.Measure α}
(hφ : AEMeasurable φ μ)
(v : F)


@[simp]
theorem eqLocus_same (f : F) : eqLocus f f = ⊤

{R : Type u_1}
{R₂ : Type u_2}
{M : Type u_3}
{M₂ : Type u_4}
[Semiring R]
[Semiring R₂]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R₂ M₂]
{τ₁₂ : R →+* R₂}
{F : Type u_5}
[FunLike F M M₂]
[SemilinearMapClass F τ₁₂ M M₂]
(f : F)


@[simp]
lemma shiftFunctor_map_f' {K L : CochainComplex C ℤ} (φ : K ⟶ L) (n p : ℤ) :
    ((CategoryTheory.shiftFunctor (CochainComplex C ℤ) n).map φ).f p = φ.f (p + n)

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Preadditive C]
{K L : CochainComplex C ℤ}
(φ : K ⟶ L)
(n p : ℤ)


lemma factorizationLCMLeft_dvd_left : factorizationLCMLeft a b ∣ a


theorem HasStrictDerivAt.csin (hf : HasStrictDerivAt f f' x) :
    HasStrictDerivAt (fun x => Complex.sin (f x)) (Complex.cos (f x) * f') x

{f : ℂ → ℂ}
{f' x : ℂ}
(hf : HasStrictDerivAt f f' x)


protected theorem mul_lt_mul_of_lt_of_le' (hac : a < c) (hbd : b ≤ d) (hb : 0 < b) :
    a * b < c * d

{a c b d : Nat}
(hac : a < c)
(hbd : b ≤ d)
(hb : 0 < b)


theorem padicValInt.mul {a b : ℤ} (ha : a ≠ 0) (hb : b ≠ 0) :
    padicValInt p (a * b) = padicValInt p a + padicValInt p b

{p : ℕ}
[hp : Fact (Nat.Prime p)]
{a b : ℤ}
(ha : a ≠ 0)
(hb : b ≠ 0)


/-- A oplax monoidal functor is a functor `F : C ⥤ D` between monoidal categories,
equipped with morphisms `η : F.obj (𝟙_ C) ⟶ 𝟙 _D` and `δ X Y : F.obj (X ⊗ Y) ⟶ F.obj X ⊗ F.obj Y`,
satisfying the appropriate coherences. -/
structure OplaxMonoidalFunctor extends C ⥤ D where
  /-- counit morphism -/
  η : obj (𝟙_ C) ⟶ 𝟙_ D
  /-- cotensorator -/
  δ : ∀ X Y : C, obj (X ⊗ Y) ⟶ obj X ⊗ obj Y
  δ_natural_left :
    ∀ {X Y : C} (f : X ⟶ Y) (X' : C),
      δ X X' ≫ map f ▷ obj X' = map (f ▷ X') ≫ δ Y X' := by
    aesop_cat
  δ_natural_right :
    ∀ {X Y : C} (X' : C) (f : X ⟶ Y) ,
      δ X' X ≫ obj X' ◁ map f = map (X' ◁ f) ≫ δ X' Y := by
    aesop_cat
  /-- associativity of the tensorator -/
  associativity :
    ∀ X Y Z : C,
      δ (X ⊗ Y) Z ≫ δ X Y ▷ obj Z ≫ (α_ (obj X) (obj Y) (obj Z)).hom =
        map (α_ X Y Z).hom ≫ δ X (Y ⊗ Z) ≫ obj X ◁ δ Y Z := by
    aesop_cat
  -- unitality
  left_unitality : ∀ X : C, (λ_ (obj X)).inv = map (λ_ X).inv ≫ δ (𝟙_ C) X ≫ η ▷ obj X := by
    aesop_cat
  right_unitality : ∀ X : C, (ρ_ (obj X)).inv = map (ρ_ X).inv ≫ δ X (𝟙_ C) ≫ obj X ◁ η := by
    aesop_cat

(self : CategoryTheory.OplaxMonoidalFunctor C D)

self.δ X' X ≫ CategoryTheory.MonoidalCategory.whiskerLeft (self.obj X') (self.map f) =
  self.map (CategoryTheory.MonoidalCategory.whiskerLeft X' f) ≫ self.δ X' Y


/-- When `α` is compact, and `β` is a metric space, the bounded continuous maps `α →ᵇ β` are
isometric to `C(α, β)`.
-/
@[simps! (config := .asFn) toEquiv apply symm_apply]
def isometryEquivBoundedOfCompact : C(α, β) ≃ᵢ (α →ᵇ β)

(α : Type u_1)
(β : Type u_2)
[TopologicalSpace α]
[CompactSpace α]
[MetricSpace β]

⇑(ContinuousMap.isometryEquivBoundedOfCompact α β) = BoundedContinuousFunction.mkOfCompact


theorem le_max_of_le {l : List α} {a x : α} (hx : x ∈ l) (h : a ≤ x) : a ≤ l.foldr max ⊥

{α : Type u_1}
[LinearOrder α]
[OrderBot α]
{l : List α}
{a x : α}
(hx : x ∈ l)
(h : a ≤ x)


/--
An alternative constructor for boolean algebras.

A set of *boolean generators* in a compactly generated complete lattice is a subset `S` such that

* the elements of `S` are all atoms, and
* the set `S` satisfies an atomicity condition:
  any compact element below the supremum of a finite subset `s` of generators
  is equal to the supremum of a subset of `s`.

If the supremum of `S` is the whole lattice,
then the lattice is a boolean algebra
(see `IsCompactlyGenerated.BooleanGenerators.booleanAlgebra_of_sSup_eq_top`).
-/
structure BooleanGenerators (S : Set α) : Prop where
  /-- The elements in a collection of boolean generators are all atoms. -/
  isAtom : ∀ I ∈ S, IsAtom I
  /-- The elements in a collection of boolean generators satisfy an atomicity condition:
  any compact element below the supremum of a finite subset `s` of generators
  is equal to the supremum of a subset of `s`. -/
  finitelyAtomistic : ∀ (s : Finset α) (a : α),
      ↑s ⊆ S → IsCompactElement a → a ≤ s.sup id → ∃ t ⊆ s, a = t.sup id

(self : IsCompactlyGenerated.BooleanGenerators S)


@[to_additive (attr := simp)]
theorem ker_restrict (f : G →* N) : (f.restrict K).ker = f.ker.subgroupOf K

{G : Type u_1}
[Group G]
{N : Type u_5}
[Group N]
(K : Subgroup G)
(f : G →* N)


@[simp]
theorem antidiagonal_succ {n : ℕ} :
    antidiagonal (n + 1) = (0, n + 1) ::ₘ (antidiagonal n).map (Prod.map Nat.succ id)

Multiset.Nat.antidiagonal (n + 1) = (0, n + 1) ::ₘ Multiset.map (Prod.map Nat.succ id) (Multiset.Nat.antidiagonal n)


/-- See `zero_lt_one` for a version with the type implicit. -/
lemma zero_lt_one' : (0 : α) < 1

(α : Type u_1)
[Zero α]
[One α]
[PartialOrder α]
[ZeroLEOneClass α]
[NeZero 1]


theorem Ioc_infinite : (Ioc a b).Infinite

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


theorem IsLeast.isGreatest_image2_of_isGreatest (ha : IsLeast s a) (hb : IsGreatest t b) :
    IsGreatest (Set.image2 f s t) (f a b)

{f : α → β → γ}

(h₀ : ∀ (b : β), Antitone (Function.swap f b))


@[simp]
theorem strictMono_map_iff {f : α → β} :
    StrictMono (WithBot.map f) ↔ StrictMono f

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


theorem isPrimitiveClassified_of_coprime_of_pos (hc : Int.gcd x y = 1) (hzpos : 0 < z) :
    h.IsPrimitiveClassified

{x y z : ℤ}
(h : PythagoreanTriple x y z)
(hc : x.gcd y = 1)
(hzpos : 0 < z)


@[simp]
theorem right_mem_openSegment_iff [DenselyOrdered 𝕜] [NoZeroSMulDivisors 𝕜 E] :
    y ∈ openSegment 𝕜 x y ↔ x = y

{𝕜 : Type u_1}
{E : Type u_2}
[LinearOrderedRing 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{x y : E}
[DenselyOrdered 𝕜]
[NoZeroSMulDivisors 𝕜 E]


theorem linear [AddCommMonoid F] [Module R F] [∀ x, AddCommMonoid (E x)] [∀ x, Module R (E x)]
    [e.IsLinear R] {b : B} (hb : b ∈ e.baseSet) :
    IsLinearMap R fun x : E b => (e ⟨b, x⟩).2

(e : Pretrivialization F Bundle.TotalSpace.proj)

IsLinearMap R fun x => (↑e { proj := b, snd := x }).2


/-- The cosine of an angle in a right-angled triangle multiplied by the hypotenuse equals the
adjacent side. -/
theorem cos_oangle_add_right_mul_norm_of_oangle_eq_pi_div_two {x y : V}
    (h : o.oangle x y = ↑(π / 2)) : Real.Angle.cos (o.oangle x (x + y)) * ‖x + y‖ = ‖x‖

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

(o.oangle x (x + y)).cos * ‖x + y‖ = ‖x‖


theorem memℒp_add_of_disjoint {f g : α → E} (h : Disjoint (support f) (support g))
    (hf : StronglyMeasurable f) (hg : StronglyMeasurable g) :
    Memℒp (f + g) p μ ↔ Memℒp f p μ ∧ Memℒp g p μ

(h : Disjoint (Function.support f) (Function.support g))

(hf : MeasureTheory.StronglyMeasurable f)

(hg : MeasureTheory.StronglyMeasurable g)

MeasureTheory.Memℒp (f + g) p μ ↔ MeasureTheory.Memℒp f p μ ∧ MeasureTheory.Memℒp g p μ


theorem mem_smul_span {s : Set M} {x : M} :
    x ∈ I • Submodule.span R s ↔ x ∈ Submodule.span R (⋃ (a ∈ I) (b ∈ s), ({a • b} : Set M))

{R : Type u}
{M : Type v}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
{I : Ideal R}
{s : Set M}
{x : M}

x ∈ I • Submodule.span R s ↔ x ∈ Submodule.span R (⋃ a ∈ I, ⋃ b ∈ s, {a • b})


@[simp] lemma unop_zero [Zero α] : unop (0 : αᵐᵒᵖ) = 0


/-- Euclid's lemma: if `a ∣ b * c` and `a` and `b` have no common prime factors, `a ∣ c`.
Compare `IsCoprime.dvd_of_dvd_mul_right`. -/
theorem dvd_of_dvd_mul_right_of_no_prime_factors {a b c : R} (ha : a ≠ 0)
    (no_factors : ∀ {d}, d ∣ a → d ∣ b → ¬Prime d) : a ∣ b * c → a ∣ c

(no_factors : ∀ {d : R}, d ∣ a → d ∣ b → ¬Prime d)


theorem lift_mk_compr₂ (f : M ⊗ N →ₗ[R] P) : lift ((mk R M N).compr₂ f) = f

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

TensorProduct.lift ((TensorProduct.mk R M N).compr₂ f) = f


@[to_additive sum_le_sum]
lemma prod_le_prod' [Preorder M] [CovariantClass M M (Function.swap (· * ·)) (· ≤ ·)]
    [CovariantClass M M (· * ·) (· ≤ ·)] {l : List ι} {f g : ι → M} (h : ∀ i ∈ l, f i ≤ g i) :
    (l.map f).prod ≤ (l.map g).prod

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

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

(List.map f l).prod ≤ (List.map g l).prod


theorem intCast_rightInverse : Function.RightInverse (cast : ZMod n → ℤ) ((↑) : ℤ → ZMod n)


theorem map_hcongr {β' : Type v} {m : Multiset α} {f : α → β} {f' : α → β'} (h : β = β')
    (hf : ∀ a ∈ m, HEq (f a) (f' a)) : HEq (map f m) (map f' m)

{α : Type u_1}
{β β' : Type v}
{m : Multiset α}
{f : α → β}
{f' : α → β'}
(h : β = β')
(hf : ∀ a ∈ m, HEq (f a) (f' a))

HEq (Multiset.map f m) (Multiset.map f' m)


@[simp]
theorem foldr_fixed {b : β} : ∀ l : List α, foldr (fun _ b => b) b l = b

{α : Type u}
{β : Type v}
{b : β}
(l : List α)


theorem translationNumber_eq_rat_iff (hf : Continuous f) {m : ℤ} {n : ℕ} (hn : 0 < n) :
    τ f = m / n ↔ ∃ x, (f ^ n) x = x + m

(f : CircleDeg1Lift)
(hf : Continuous ⇑f)
{m : ℤ}
{n : ℕ}
(hn : 0 < n)

f.translationNumber = ↑m / ↑n ↔ ∃ x, (f ^ n) x = x + ↑m


theorem integral_eq_integral_nnrealPart_sub (f : X →ᵇ ℝ) :
    ∫ x, f x ∂μ = (∫ x, (f.nnrealPart x : ℝ) ∂μ) - ∫ x, ((-f).nnrealPart x : ℝ) ∂μ

{X : Type u_1}
[MeasurableSpace X]
[TopologicalSpace X]
[OpensMeasurableSpace X]
(μ : MeasureTheory.Measure X)
[MeasureTheory.IsFiniteMeasure μ]
(f : X →ᵇ ℝ)

∫ (x : X), f x ∂μ = ∫ (x : X), ↑(f.nnrealPart x) ∂μ - ∫ (x : X), ↑((-f).nnrealPart x) ∂μ


theorem lineMap_strict_mono_endpoints (ha : a < a') (hb : b < b') (h₀ : 0 ≤ r) (h₁ : r ≤ 1) :
    lineMap a b r < lineMap a' b' r

{k : Type u_1}
{E : Type u_2}
[OrderedRing k]
[OrderedAddCommGroup E]
[Module k E]
[OrderedSMul k E]
{a a' b b' : E}
{r : k}
(ha : a < a')
(hb : b < b')
(h₀ : 0 ≤ r)
(h₁ : r ≤ 1)

(AffineMap.lineMap a b) r < (AffineMap.lineMap a' b') r


theorem le_toDual [LE α] {a : αᵒᵈ} {b : α} : a ≤ toDual b ↔ b ≤ ofDual a

a ≤ OrderDual.toDual b ↔ b ≤ OrderDual.ofDual a


lemma liminf_neg : liminf (- v) f = - limsup v f

{α : Type u_2}
{f : Filter α}
{v : α → EReal}

Filter.liminf (-v) f = -Filter.limsup v f


@[to_additive]
theorem map [MonoidHomClass F M N] (f : F) {x : M} (h : IsUnit x) : IsUnit (f x)

{F : Type u_1}
{M : Type u_4}
{N : Type u_5}
[FunLike F M N]
[AddMonoid M]
[AddMonoid N]
[AddMonoidHomClass F M N]
(f : F)
{x : M}
(h : IsAddUnit x)


@[simp]
theorem prod_bot : s ×ˢ (⊥ : LowerSet β) = ⊥

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


theorem bounded_le_Ioc [Preorder α] (a b : α) : Bounded (· ≤ ·) (Ioc a b)

Set.Bounded (fun x x_1 => x ≤ x_1) (Set.Ioc a b)


@[to_additive (attr := simp)]
lemma mk_mul [Mul M] (a b : M) : mk (a * b) = mk b * mk a

DomMulAct.mk (a * b) = DomMulAct.mk b * DomMulAct.mk a


theorem term_realize_cast {β : Type*} (x : β → ∀ a, M a) (t : L.Term β) :
    (t.realize fun i => (x i : (u : Filter α).Product M)) =
      (fun a => t.realize fun i => x i a : (u : Filter α).Product M)

{α : Type u_1}
{M : α → Type u_2}
{u : Ultrafilter α}
{L : FirstOrder.Language}
[(a : α) → L.Structure (M a)]
{β : Type u_3}
(x : β → (a : α) → M a)
(t : L.Term β)

FirstOrder.Language.Term.realize (fun i => Quotient.mk' (x i)) t =
  Quotient.mk' fun a => FirstOrder.Language.Term.realize (fun i => x i a) t


theorem unfold_sub {α} [SubtractionMonoid α] (a b c : α) (h : a + -b = c) : a - b = c

{α : Type u_1}
[SubtractionMonoid α]
(a b c : α)
(h : a + -b = c)


/-- The conditional probability measure of any measure on any set of finite positive measure
is a probability measure. -/
theorem cond_isProbabilityMeasure_of_finite (hcs : μ s ≠ 0) (hs : μ s ≠ ∞) :
    IsProbabilityMeasure μ[|s]

{Ω : Type u_1}
{m : MeasurableSpace Ω}
(μ : MeasureTheory.Measure Ω)
{s : Set Ω}
(hcs : μ s ≠ 0)
(hs : μ s ≠ ⊤)

MeasureTheory.IsProbabilityMeasure (ProbabilityTheory.cond μ s)


/-- If `i : D ⥤ C` is reflective, the inverse functor of `i ≌ F.essImage` can be explicitly
defined by the reflector. -/
@[simps]
def equivEssImageOfReflective [Reflective i] : D ≌ i.EssImageSubcategory

{C : Type u₁}
{D : Type u₂}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.Category.{v₂, u₂} D]
{i : CategoryTheory.Functor D C}
[CategoryTheory.Reflective i]

CategoryTheory.equivEssImageOfReflective.inverse = i.essImageInclusion.comp (CategoryTheory.reflector i)


/-- The `i`-th component of an isomorphism of chain complexes. -/
@[simps!]
def isoApp (f : C₁ ≅ C₂) (i : ι) : C₁.X i ≅ C₂.X i

(HomologicalComplex.Hom.isoApp f i).inv = f.inv.f i


/-- An element `p` of `FreeAddMonoid (R × Π i, s i)` lifts an element `x` of `⨂[R] i, s i`
if and only if `x` is equal to to the sum of `a • ⨂ₜ[R] i, m i` over all the entries
`(a, m)` of `p`.
-/
lemma mem_lifts_iff (x : ⨂[R] i, s i) (p : FreeAddMonoid (R × Π i, s i)) :
    p ∈ lifts x ↔ List.sum (List.map (fun x ↦ x.1 • ⨂ₜ[R] i, x.2 i) p) = x

(p : FreeAddMonoid (R × ((i : ι) → s i)))

p ∈ x.lifts ↔ (List.map (fun x => x.1 • ⨂ₜ[R] (i : ι), x.2 i) p).sum = x


/-- The obvious functor `(J ⥤ ShortComplex C) ⥤ ShortComplex (J ⥤ C)`. -/
@[simps]
def inverse : (J ⥤ ShortComplex C) ⥤ ShortComplex (J ⥤ C)

(F : CategoryTheory.Functor J (CategoryTheory.ShortComplex C))

((CategoryTheory.ShortComplex.FunctorEquivalence.inverse J C).obj F).g =
  CategoryTheory.whiskerLeft F CategoryTheory.ShortComplex.π₂Toπ₃


theorem isSpectralMap_id : IsSpectralMap (@id α)


@[simp]
theorem toRatAlgHom_toRingHom [Ring R] [Ring S] [Algebra ℚ R] [Algebra ℚ S] (f : R →+* S) :
    ↑f.toRatAlgHom = f

{R : Type u_1}
{S : Type u_2}
[Ring R]
[Ring S]
[Algebra ℚ R]
[Algebra ℚ S]
(f : R →+* S)


theorem snd_pow_of_smul_comm [Monoid R] [AddMonoid M] [DistribMulAction R M]
    [DistribMulAction Rᵐᵒᵖ M] [SMulCommClass R Rᵐᵒᵖ M] (x : tsze R M) (n : ℕ)
    (h : x.snd <• x.fst = x.fst •> x.snd) : snd (x ^ n) = n • x.fst ^ n.pred •> x.snd

{R : Type u}
{M : Type v}
[Monoid R]
[AddMonoid M]
[DistribMulAction R M]
[DistribMulAction Rᵐᵒᵖ M]
[SMulCommClass R Rᵐᵒᵖ M]
(x : tsze R M)
(h : x.snd <• x.fst = x.fst •> x.snd)
(n : ℕ)


theorem isAntichain_iff_forall_not_lt :
    IsAntichain (· ≤ ·) s ↔ ∀ ⦃a⦄, a ∈ s → ∀ ⦃b⦄, b ∈ s → ¬a < b

{α : Type u_1}
{s : Set α}
[PartialOrder α]

IsAntichain (fun x x_1 => x ≤ x_1) s ↔ ∀ ⦃a : α⦄, a ∈ s → ∀ ⦃b : α⦄, b ∈ s → ¬a < b


theorem piCongrLeft_preimage_pi (f : ι' ≃ ι) (s : Set ι') (t : ∀ i, Set (α i)) :
    f.piCongrLeft α ⁻¹' (f '' s).pi t = s.pi fun i => t (f i)

{ι : Type u_1}
{ι' : Type u_2}
{α : ι → Type u_3}
(f : ι' ≃ ι)
(s : Set ι')
(t : (i : ι) → Set (α i))

⇑(Equiv.piCongrLeft α f) ⁻¹' (⇑f '' s).pi t = s.pi fun i => t (f i)


/-- The multiplicity of `p` in `choose n k` is the number of carries when `k` and `n - k`
  are added in base `p`. The set is expressed by filtering `Ico 1 b` where `b`
  is any bound greater than `log p n`. -/
theorem multiplicity_choose {p n k b : ℕ} (hp : p.Prime) (hkn : k ≤ n) (hnb : log p n < b) :
    multiplicity p (choose n k) =
      ((Ico 1 b).filter fun i => p ^ i ≤ k % p ^ i + (n - k) % p ^ i).card

{p n k b : ℕ}
(hp : Nat.Prime p)
(hkn : k ≤ n)
(hnb : Nat.log p n < b)

multiplicity p (n.choose k) = ↑(Finset.filter (fun i => p ^ i ≤ k % p ^ i + (n - k) % p ^ i) (Finset.Ico 1 b)).card


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


@[simp]
theorem neg_seq (f : FreeAbelianGroup (α → β)) (x : FreeAbelianGroup α) : -f <*> x = -(f <*> x)

{α β : Type u}
(f : FreeAbelianGroup (α → β))
(x : FreeAbelianGroup α)

(Seq.seq (-f) fun x_1 => x) = -Seq.seq f fun x_1 => x


@[simp]
theorem lift_unique (f : X → A) (F : FreeNonUnitalNonAssocAlgebra R X →ₙₐ[R] A) :
    F ∘ of R = f ↔ F = lift R f

⇑F ∘ FreeNonUnitalNonAssocAlgebra.of R = f ↔ F = (FreeNonUnitalNonAssocAlgebra.lift R) f


theorem coe_addMonoidHom_mkRingHomOfMulSelfOfTwoNeZero (h h_two h_one) :
    (f.mkRingHomOfMulSelfOfTwoNeZero h h_two h_one : β →+ α) = f

{α : Type u_2}
{β : Type u_3}
[CommRing α]
[IsDomain α]
[CommRing β]
(f : β →+ α)
(h : ∀ (x : β), f (x * x) = f x * f x)
(h_two : 2 ≠ 0)
(h_one : f 1 = 1)

↑(f.mkRingHomOfMulSelfOfTwoNeZero h h_two h_one) = f


@[symm]
theorem Disjoint.symm (x y : Finmap β) (h : Disjoint x y) : Disjoint y x

{α : Type u}
{β : α → Type v}
(x y : Finmap β)
(h : x.Disjoint y)


theorem abs_re_div_abs_le_one (z : ℂ) : |z.re / Complex.abs z| ≤ 1


@[to_additive]
theorem smul_subset_smul_left : t₁ ⊆ t₂ → s • t₁ ⊆ s • t₂

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

t₁ ⊆ t₂ → s +ᵥ t₁ ⊆ s +ᵥ t₂


@[simp]
theorem minFac_to_nat (n : PosNum) : (minFac n : ℕ) = Nat.minFac n


theorem filter_mono (h : f ≤ g) : μ.FiniteAtFilter g → μ.FiniteAtFilter f

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f g : Filter α}
(h : f ≤ g)


theorem homCongr_trans {X₁ Y₁ X₂ Y₂ X₃ Y₃ : C} (α₁ : X₁ ≅ X₂) (β₁ : Y₁ ≅ Y₂) (α₂ : X₂ ≅ X₃)
    (β₂ : Y₂ ≅ Y₃) (f : X₁ ⟶ Y₁) :
    (α₁ ≪≫ α₂).homCongr (β₁ ≪≫ β₂) f = (α₁.homCongr β₁).trans (α₂.homCongr β₂) f

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

((α₁ ≪≫ α₂).homCongr (β₁ ≪≫ β₂)) f = ((α₁.homCongr β₁).trans (α₂.homCongr β₂)) f


@[simp]
theorem arrowCongr_trans (e₁ : A₁ ≃ₐ[R] A₂) (e₁' : A₁' ≃ₐ[R] A₂')
    (e₂ : A₂ ≃ₐ[R] A₃) (e₂' : A₂' ≃ₐ[R] A₃') :
    arrowCongr (e₁.trans e₂) (e₁'.trans e₂') = (arrowCongr e₁ e₁').trans (arrowCongr e₂ e₂')

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

(e₁.trans e₂).arrowCongr (e₁'.trans e₂') = (e₁.arrowCongr e₁').trans (e₂.arrowCongr e₂')


/-- The composite of two heterogeneous vertex operators, as a heterogeneous vertex operator. -/
@[simps]
def comp : HVertexOperator (Γ' ×ₗ Γ) R U W

{Γ : Type u_5}
{Γ' : Type u_6}
[OrderedCancelAddCommMonoid Γ]
[OrderedCancelAddCommMonoid Γ']
{R : Type u_7}
[CommRing R]
{U : Type u_8}
{V : Type u_9}
{W : Type u_10}
[AddCommGroup U]
[Module R U]
[AddCommGroup V]
[Module R V]
[AddCommGroup W]
[Module R W]
(A : HVertexOperator Γ R V W)
(B : HVertexOperator Γ' R U V)
(u : U)

(A.comp B) u = (HahnModule.of R) (A.compHahnSeries B u).ofIterate


@[simp]
theorem iter_deriv_pow' (n k : ℕ) :
    (deriv^[k] fun x : 𝕜 => x ^ n) =
      fun x => (∏ i ∈ Finset.range k, ((n : 𝕜) - i)) * x ^ (n - k)

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
(n k : ℕ)

(deriv^[k] fun x => x ^ n) = fun x => (∏ i ∈ Finset.range k, (↑n - ↑i)) * x ^ (n - k)


/-- The order of the formal power series `X^n` is `n`. -/
@[simp]
theorem order_X_pow (n : ℕ) : order ((X : R⟦X⟧) ^ n) = n

{R : Type u_1}
[Semiring R]
[Nontrivial R]
(n : ℕ)


@[norm_cast, simp]
theorem coe_zero : ((0 : L₁ →ₗ⁅R⁆ L₂) : L₁ → L₂) = 0

{R : Type u}
{L₁ : Type v}
{L₂ : Type w}
[CommRing R]
[LieRing L₁]
[LieAlgebra R L₁]
[LieRing L₂]
[LieAlgebra R L₂]


@[simp]
theorem snd_comp_coe_prodComm :
    (RingHom.snd S R).comp ↑(prodComm : R × S ≃+* S × R) = RingHom.fst R S

{R : Type u_3}
{S : Type u_5}
[NonAssocSemiring R]
[NonAssocSemiring S]

(RingHom.snd S R).comp ↑RingEquiv.prodComm = RingHom.fst R S


lemma map'_comp (i j k : ℕ) (hij : i ≤ j := by valid)
    (hjk : j ≤ k := by valid) (hk : k ≤ n := by valid) :
    F.map' i k = F.map' i j ≫ F.map' j k

(F : CategoryTheory.ComposableArrows C n)

F.map' i k ⋯ hk = CategoryTheory.CategoryStruct.comp (F.map' i j hij ⋯) (F.map' j k hjk hk)


@[gcongr]
theorem preimage_mono {s t : Set β} (h : s ⊆ t) : f ⁻¹' s ⊆ f ⁻¹' t

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


theorem eventually_iff_seq_eventually {ι : Type*} {l : Filter ι} {p : ι → Prop}
    [l.IsCountablyGenerated] :
    (∀ᶠ n in l, p n) ↔ ∀ x : ℕ → ι, Tendsto x atTop l → ∀ᶠ n : ℕ in atTop, p (x n)

{ι : Type u_6}
{l : Filter ι}
{p : ι → Prop}
[l.IsCountablyGenerated]

(∀ᶠ (n : ι) in l, p n) ↔ ∀ (x : ℕ → ι), Filter.Tendsto x Filter.atTop l → ∀ᶠ (n : ℕ) in Filter.atTop, p (x n)


theorem prod_left (β) [Finite (α × β)] [Nonempty β] : Finite α

{α : Type u_1}
(β : Type u_4)
[Finite (α × β)]
[Nonempty β]


@[refl, simp]
theorem modEq_refl (a : α) : a ≡ a [PMOD p]

{α : Type u_1}
[AddCommGroup α]
{p : α}
(a : α)


@[simp]
theorem cancel_left {g : LocallyBoundedMap β γ} {f₁ f₂ : LocallyBoundedMap α β} (hg : Injective g) :
    g.comp f₁ = g.comp f₂ ↔ f₁ = f₂

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[Bornology α]
[Bornology β]
[Bornology γ]
{g : LocallyBoundedMap β γ}
{f₁ f₂ : LocallyBoundedMap α β}
(hg : Function.Injective ⇑g)


theorem lim_le {f : CauSeq α abs} {x : α} (h : f ≤ CauSeq.const abs x) : lim f ≤ x

{α : Type u_1}
[LinearOrderedField α]
[CauSeq.IsComplete α abs]
{f : CauSeq α abs}
{x : α}
(h : f ≤ CauSeq.const abs x)


/-- The residue of `Λ` at `s = k` is equal to `ε • g₀`. -/
theorem Λ_residue_k :
    Tendsto (fun s : ℂ ↦ (s - P.k) • P.Λ s) (𝓝[≠] P.k) (𝓝 (P.ε • P.g₀))

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

Filter.Tendsto (fun s => (s - ↑P.k) • P.Λ s) (𝓝[≠] ↑P.k) (𝓝 (P.ε • P.g₀))


/-- Any function in `ℒp` can be approximated by bounded continuous functions when `0 < p < ∞`,
version in terms of `∫`. -/
theorem Memℒp.exists_boundedContinuous_integral_rpow_sub_le [μ.WeaklyRegular] {p : ℝ} (hp : 0 < p)
    {f : α → E} (hf : Memℒp f (ENNReal.ofReal p) μ) {ε : ℝ} (hε : 0 < ε) :
    ∃ g : α →ᵇ E, (∫ x, ‖f x - g x‖ ^ p ∂μ) ≤ ε ∧ Memℒp g (ENNReal.ofReal p) μ

(hf : MeasureTheory.Memℒp f (ENNReal.ofReal p) μ)

∃ g, ∫ (x : α), ‖f x - g x‖ ^ p ∂μ ≤ ε ∧ MeasureTheory.Memℒp (⇑g) (ENNReal.ofReal p) μ


@[simp]
theorem vanishingIdeal_univ : vanishingIdeal (∅ : Set (ProjectiveSpectrum 𝒜)) = ⊤

{R : Type u_1}
{A : Type u_2}
[CommSemiring R]
[CommRing A]
[Algebra R A]
(𝒜 : ℕ → Submodule R A)
[GradedAlgebra 𝒜]


theorem get_tail (x : Vector α n) (i) : x.tail.get i = x.get ⟨i.1 + 1, by omega⟩

{n : ℕ}
{α : Type u_1}
(x : Mathlib.Vector α n)
(i : Fin (n - 1))


/-- Two congruence relations are equal iff their underlying binary relations are equal. -/
@[to_additive "Two additive congruence relations are equal iff their underlying binary relations
are equal."]
theorem coe_inj {c d : Con M} : ⇑c = ⇑d ↔ c = d


@[to_additive]
lemma IsOpen.mul_closure_one_eq {U : Set G} (hU : IsOpen U) :
    U * (closure {1} : Set G) = U

{G : Type w}
[TopologicalSpace G]
[Group G]
[TopologicalGroup G]
{U : Set G}
(hU : IsOpen U)


@[simp]
protected theorem not_le {x y : PGame} : ¬x ≤ y ↔ y ⧏ x


theorem g_apply_fromCoset (x : B) (y : Set.range (· • (f.range : Set B) : B → Set B)) :
    g x (fromCoset y) = fromCoset ⟨x • ↑y,
      by obtain ⟨z, hz⟩ := y.2; exact ⟨x * z, by simp [← hz, smul_smul]⟩⟩

(y : ↑(Set.range fun x => x • ↑(MonoidHom.range f)))

((Grp.SurjectiveOfEpiAuxs.g f) x) (Grp.SurjectiveOfEpiAuxs.XWithInfinity.fromCoset y) =
  Grp.SurjectiveOfEpiAuxs.XWithInfinity.fromCoset ⟨x • ↑y, ⋯⟩


theorem im_le_abs (z : ℂ) : z.im ≤ Complex.abs z


@[to_additive]
protected lemma inv [Inv β] (h : EventuallyConst f l) : EventuallyConst (f⁻¹) l

{α : Type u_1}
{β : Type u_2}
{l : Filter α}
{f : α → β}
[Inv β]
(h : Filter.EventuallyConst f l)


@[to_additive (attr := simp)]
theorem nhds_one_mul_nhds {M} [MulOneClass M] [TopologicalSpace M] [ContinuousMul M] (a : M) :
    𝓝 (1 : M) * 𝓝 a = 𝓝 a

{M : Type u_6}
[MulOneClass M]
[TopologicalSpace M]
[ContinuousMul M]
(a : M)


theorem exists_eq_aeval [Nontrivial S] (pb : PowerBasis R S) (y : S) :
    ∃ f : R[X], f.natDegree < pb.dim ∧ y = aeval pb.gen f

{R : Type u_1}
{S : Type u_2}
[CommRing R]
[Ring S]
[Algebra R S]
[Nontrivial S]
(pb : PowerBasis R S)
(y : S)

∃ f, f.natDegree < pb.dim ∧ y = (Polynomial.aeval pb.gen) f


/-- Given a chain complex `X` and an object `Y`, this is the cochain complex
which in degree `i` consists of the module of morphisms `X.X i ⟶ Y`. -/
@[simps! X d]
def ChainComplex.linearYonedaObj {α : Type*} [AddRightCancelSemigroup α] [One α]
    (X : ChainComplex C α) (A : Type*) [Ring A] [Linear A C] (Y : C) :
    CochainComplex (ModuleCat A) α

{C : Type u_2}
[CategoryTheory.Category.{u_5, u_2} C]
[CategoryTheory.Abelian C]
{α : Type u_3}
[AddRightCancelSemigroup α]
[One α]
(X : ChainComplex C α)
(A : Type u_4)
[Ring A]
[CategoryTheory.Linear A C]
(Y : C)
(i : α)

(X.linearYonedaObj A Y).X i = ModuleCat.of A (X.X i ⟶ Y)


/-- `OrderDual` as a functor. -/
@[simps]
def dual : BddOrd ⥤ BddOrd

(a : BoundedOrderHom ↑X.toPartOrd ↑Y.toPartOrd)

BddOrd.dual.map a = BoundedOrderHom.dual a


theorem tan_eq_inv_of_two_nsmul_add_two_nsmul_eq_pi {θ ψ : Angle}
    (h : (2 : ℕ) • θ + (2 : ℕ) • ψ = π) : tan ψ = (tan θ)⁻¹

{θ ψ : Real.Angle}
(h : 2 • θ + 2 • ψ = ↑π)


@[simp]
theorem isGLB_upperBounds : IsGLB (upperBounds s) a ↔ IsLUB s a

{α : Type u}
[Preorder α]
{s : Set α}
{a : α}


@[simp]
theorem inducedMap_one : inducedMap α β 1 = 1


theorem moebius_sq_eq_one_of_squarefree {l : ℕ} (hl : Squarefree l) : μ l ^ 2 = 1


theorem subset_piiUnionInter {π : ι → Set (Set α)} {S : Set ι} {i : ι} (his : i ∈ S) :
    π i ⊆ piiUnionInter π S

{α : Type u_1}
{ι : Type u_2}
{π : ι → Set (Set α)}
{S : Set ι}
{i : ι}
(his : i ∈ S)


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

{G : Type w}
[TopologicalSpace G]
[InvolutiveNeg G]
[ContinuousNeg G]
{s : Set G}
(hs : IsOpen s)


theorem exists_algHom_of_splits_of_aeval : ∃ φ : E →ₐ[F] K, φ x = y

(hK' : ∀ (s : E), IsIntegral F s ∧ Polynomial.Splits (algebraMap F K) (minpoly F s))

(hy : (Polynomial.aeval y) (minpoly F x) = 0)


@[to_additive]
theorem comap_mker (g : N →* P) (f : M →* N) : g.mker.comap f = mker (comp g f)

{M : Type u_1}
{N : Type u_2}
{P : Type u_3}
[AddZeroClass M]
[AddZeroClass N]
[AddZeroClass P]
(g : N →+ P)
(f : M →+ N)

AddSubmonoid.comap f (AddMonoidHom.mker g) = AddMonoidHom.mker (g.comp f)


@[simp]
theorem embDomain_single (f : α ↪ β) (a : α) (m : M) :
    embDomain f (single a m) = single (f a) m

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

Finsupp.embDomain f (Finsupp.single a m) = Finsupp.single (f a) m


@[to_additive]
theorem isClosed_setOf_map_mul [Mul M₁] [Mul M₂] [ContinuousMul M₂] :
    IsClosed { f : M₁ → M₂ | ∀ x y, f (x * y) = f x * f y }

(M₁ : Type u_6)
(M₂ : Type u_7)
[TopologicalSpace M₂]
[T2Space M₂]
[Mul M₁]
[Mul M₂]
[ContinuousMul M₂]

IsClosed {f | ∀ (x y : M₁), f (x * y) = f x * f y}


theorem natDegree_mul_comm (hp : p.Monic) (q : R[X]) : (p * q).natDegree = (q * p).natDegree

{R : Type u}
[Semiring R]
{p : R[X]}
(hp : p.Monic)
(q : R[X])


@[simp]
theorem mem_coe_submodule {x : L} : x ∈ (L' : Submodule R L) ↔ x ∈ L'

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


theorem count_singleton (a : α) : count a [a] = 1


theorem Ico_filter_le_of_le_left {a b c : α} [DecidablePred (c ≤ ·)] (hca : c ≤ a) :
    (Ico a b).filter (c ≤ ·) = Ico a b

{α : Type u_2}
[Preorder α]
[LocallyFiniteOrder α]
{a b c : α}
[DecidablePred fun x => c ≤ x]
(hca : c ≤ a)

Finset.filter (fun x => c ≤ x) (Finset.Ico a b) = Finset.Ico a b


/-- The ring equiv between the top element of `Subring R` and `R`. -/
@[simps!]
def topEquiv : (⊤ : Subring R) ≃+* R


/-- If `x ≠ ∞`, then right multiplication by `x` maps infimum over a nonempty type to infimum. See
also `ENNReal.iInf_mul_of_ne` that assumes `x ≠ 0` but does not require `[Nonempty ι]`. -/
theorem iInf_mul {ι} [Nonempty ι] {f : ι → ℝ≥0∞} {x : ℝ≥0∞} (h : x ≠ ∞) :
    iInf f * x = ⨅ i, f i * x

{ι : Sort u_2}
[Nonempty ι]
{f : ι → ℝ≥0∞}
{x : ℝ≥0∞}
(h : x ≠ ⊤)


@[congr]
theorem blsub_congr {o₁ o₂ : Ordinal.{u}} (f : ∀ a < o₁, Ordinal.{max u v}) (ho : o₁ = o₂) :
    blsub.{_, v} o₁ f = blsub.{_, v} o₂ fun a h => f a (h.trans_eq ho.symm)

(f : (a : Ordinal.{u}) → a < o₁ → Ordinal.{max u v})


/-- The units of the stalk at `x` of the sheaf of smooth functions from `M` to `𝕜`, considered as a
sheaf of commutative rings, are the functions whose values at `x` are nonzero. -/
theorem smoothSheafCommRing.isUnit_stalk_iff {x : M}
    (f : (smoothSheafCommRing IM 𝓘(𝕜) M 𝕜).presheaf.stalk x) :
    IsUnit f ↔ f ∉ RingHom.ker (smoothSheafCommRing.eval IM 𝓘(𝕜) M 𝕜 x)

(f : ↑((smoothSheafCommRing IM 𝓘(𝕜, 𝕜) M 𝕜).presheaf.stalk x))

IsUnit f ↔ f ∉ RingHom.ker (smoothSheafCommRing.eval IM 𝓘(𝕜, 𝕜) M 𝕜 x)


@[simp]
theorem val_pow (x : { x : R // 0 < x }) (n : ℕ) :
    ↑(x ^ n) = (x : R) ^ n

{R : Type u_2}
[StrictOrderedSemiring R]
(x : { x // 0 < x })
(n : ℕ)


@[to_additive]
theorem one_neBot : (1 : Filter α).NeBot


theorem support_mapRange_of_injective {e : M → N} (he0 : e 0 = 0) (f : ι →₀ M)
    (he : Function.Injective e) : (Finsupp.mapRange e he0 f).support = f.support

{ι : Type u_4}
{M : Type u_5}
{N : Type u_7}
[Zero M]
[Zero N]
{e : M → N}
(he0 : e 0 = 0)
(f : ι →₀ M)
(he : Function.Injective e)


@[simp]
theorem liftAddHom_comp_single [AddCommMonoid M] [AddCommMonoid N] (f : α → M →+ N) (a : α) :
    ((liftAddHom (α := α) (M := M) (N := N)) f).comp (singleAddHom a) = f a

{α : Type u_1}
{M : Type u_8}
{N : Type u_10}
[AddCommMonoid M]
[AddCommMonoid N]
(f : α → M →+ N)
(a : α)

(Finsupp.liftAddHom f).comp (Finsupp.singleAddHom a) = f a


theorem image_ι_eq {Δ Δ'' : SimplexCategory} {φ : Δ ⟶ Δ''} {e : Δ ⟶ image φ} [Epi e]
    {i : image φ ⟶ Δ''} [Mono i] (fac : e ≫ i = φ) : image.ι φ = i

{i : CategoryTheory.Limits.image φ ⟶ Δ''}


lemma hasFDerivWithinAt_tangentCoordChange {x y z : M}
    (h : z ∈ (extChartAt I x).source ∩ (extChartAt I y).source) :
    HasFDerivWithinAt ((extChartAt I y) ∘ (extChartAt I x).symm) (tangentCoordChange I x y z)
      (range I) (extChartAt I x z)

HasFDerivWithinAt (↑(extChartAt I y) ∘ ↑(extChartAt I x).symm) (tangentCoordChange I x y z) (Set.range ↑I)
  (↑(extChartAt I x) z)


@[to_additive exponent_nsmul_eq_zero]
theorem pow_exponent_eq_one (g : G) : g ^ exponent G = 1


theorem sum_smul_sum_eq_sum_perm (hσ : σ.IsCycleOn s) (f : ι → α) (g : ι → β) :
    (∑ i ∈ s, f i) • ∑ i ∈ s, g i = ∑ k ∈ range s.card, ∑ i ∈ s, f i • g ((σ ^ k) i)

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[Semiring α]
[AddCommMonoid β]
[Module α β]
{s : Finset ι}
{σ : Equiv.Perm ι}
(hσ : σ.IsCycleOn ↑s)
(f : ι → α)
(g : ι → β)

(∑ i ∈ s, f i) • ∑ i ∈ s, g i = ∑ k ∈ Finset.range s.card, ∑ i ∈ s, f i • g ((σ ^ k) i)


theorem jacobiSymNat.qr₁' (a b : ℕ) (r : ℤ) (ha : a % 2 = 1) (hb : b % 4 = 1)
    (hr : jacobiSymNat b a = r) : jacobiSymNat a b = r

(hr : Mathlib.Meta.NormNum.jacobiSymNat b a = r)

Mathlib.Meta.NormNum.jacobiSymNat a b = r


theorem sum_Ico_reflect {δ : Type*} [AddCommMonoid δ] (f : ℕ → δ) (k : ℕ) {m n : ℕ}
    (h : m ≤ n + 1) : (∑ j ∈ Ico k m, f (n - j)) = ∑ j ∈ Ico (n + 1 - m) (n + 1 - k), f j

{δ : Type u_3}
[AddCommMonoid δ]
(f : ℕ → δ)
(k : ℕ)
{m n : ℕ}
(h : m ≤ n + 1)

∑ j ∈ Finset.Ico k m, f (n - j) = ∑ j ∈ Finset.Ico (n + 1 - m) (n + 1 - k), f j


theorem biUnion_singleton {f : α → β} : (s.biUnion fun a => {f a}) = s.image f

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

(s.biUnion fun a => {f a}) = Finset.image f s


theorem card_unique [Unique α] : Nat.card α = 1


@[simp]
theorem normalize_apply (x : α) : normalize x = x * normUnit x

{α : Type u_1}
[CancelCommMonoidWithZero α]
[NormalizationMonoid α]
(x : α)


/-- Given `s` and `t` signed measures, `s + it` is a complex measure-/
@[simps!]
def _root_.MeasureTheory.SignedMeasure.toComplexMeasure (s t : SignedMeasure α) :
    ComplexMeasure α

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


theorem Nat.le_succ_of_le {n m : Nat} (h : LE.le n m) : LE.le n (succ m)


/-- **Intermediate Value Theorem** for continuous functions on closed intervals, case
`f a ≥ t ≥ f b`. -/
theorem intermediate_value_Icc' {a b : α} (hab : a ≤ b) {f : α → δ}
    (hf : ContinuousOn f (Icc a b)) : Icc (f b) (f a) ⊆ f '' Icc a b

{α : Type u}
[ConditionallyCompleteLinearOrder α]
[TopologicalSpace α]
[OrderTopology α]
[DenselyOrdered α]
{δ : Type u_1}
[LinearOrder δ]
[TopologicalSpace δ]
[OrderClosedTopology δ]
{a b : α}
(hab : a ≤ b)
{f : α → δ}
(hf : ContinuousOn f (Set.Icc a b))


@[simp high]
theorem coe_comp_coe_symm (e : M₁ ≃SL[σ₁₂] M₂) :
    (e : M₁ →SL[σ₁₂] M₂).comp (e.symm : M₂ →SL[σ₂₁] M₁) = ContinuousLinearMap.id R₂ M₂

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

(↑e).comp ↑e.symm = ContinuousLinearMap.id R₂ M₂


/-- A module is Noetherian iff every increasing chain of submodules stabilizes. -/
theorem monotone_stabilizes_iff_noetherian :
    (∀ f : ℕ →o Submodule R M, ∃ n, ∀ m, n ≤ m → f n = f m) ↔ IsNoetherian R M

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

(∀ (f : ℕ →o Submodule R M), ∃ n, ∀ (m : ℕ), n ≤ m → f n = f m) ↔ IsNoetherian R M


theorem mem_support_uniformOfFinset_iff (a : α) : a ∈ (uniformOfFinset s hs).support ↔ a ∈ s

{α : Type u_1}
{s : Finset α}
(hs : s.Nonempty)
(a : α)

a ∈ (PMF.uniformOfFinset s hs).support ↔ a ∈ s


private theorem zero_smul_aux (p : LocalizedModule S M) : (0 : T) • p = 0

{R : Type u}
[CommSemiring R]
{S : Submonoid R}
{M : Type v}
[AddCommMonoid M]
[Module R M]
{T : Type u_1}
[CommSemiring T]
[Algebra R T]
[IsLocalization S T]
(p : LocalizedModule S M)


@[to_additive AntilipschitzWith.le_mul_norm]
theorem AntilipschitzWith.le_mul_norm' {f : E → F} {K : ℝ≥0} (h : AntilipschitzWith K f)
    (hf : f 1 = 1) (x) : ‖x‖ ≤ K * ‖f x‖

{E : Type u_3}
{F : Type u_4}
[SeminormedAddGroup E]
[SeminormedAddGroup F]
{f : E → F}
{K : ℝ≥0}
(h : AntilipschitzWith K f)
(hf : f 0 = 0)
(x : E)

‖x‖ ≤ ↑K * ‖f x‖


protected lemma mul_dvd_mul : a ∣ b → c ∣ d → a * c ∣ b * d


theorem derivWithin.comp_of_eq (hh₂ : DifferentiableWithinAt 𝕜' h₂ s' y)
    (hh : DifferentiableWithinAt 𝕜 h s x) (hs : MapsTo h s s') (hxs : UniqueDiffWithinAt 𝕜 s x)
    (hy : y = h x) :
    derivWithin (h₂ ∘ h) s x = derivWithin h₂ s' (h x) * derivWithin h s x


theorem count_le_length (a : α) (l : List α) : count a l ≤ l.length

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


theorem nth_mem (n : ℕ) (h : ∀ hf : (setOf p).Finite, n < hf.toFinset.card) : p (nth p n)

(h : ∀ (hf : (setOf p).Finite), n < hf.toFinset.card)


theorem coe_range_mem_nhds : range ((↑) : ℝ≥0 → ℝ≥0∞) ∈ 𝓝 (r : ℝ≥0∞)


@[deprecated map_list_prod (since := "2024-06-26")]
protected theorem map_list_prod (s : List A) : φ s.prod = (s.map φ).prod

{R : Type u}
{A : Type v}
{B : Type w}
[CommSemiring R]
[Semiring A]
[Semiring B]
[Algebra R A]
[Algebra R B]
(φ : A →ₐ[R] B)
(s : List A)


/-- For any element `x` of `M ⊗[R] N`, there exists a (finite) multiset `{ (m_i, n_i) }`
of `M × N`, such that `x` is equal to the sum of `m_i ⊗ₜ[R] n_i`. -/
theorem exists_multiset (x : M ⊗[R] N) :
    ∃ S : Multiset (M × N), x = (S.map fun i ↦ i.1 ⊗ₜ[R] i.2).sum

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

∃ S, x = (Multiset.map (fun i => i.1 ⊗ₜ[R] i.2) S).sum


/-- When `g` is a monomorphism, the kernel of `f ≫ g` is isomorphic to the kernel of `f`.
-/
@[simps]
def kernelCompMono {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z) [HasKernel f] [Mono g] :
    kernel (f ≫ g) ≅ kernel f

(CategoryTheory.Limits.kernelCompMono f g).inv =
  CategoryTheory.Limits.kernel.lift (f ≫ g) (CategoryTheory.Limits.kernel.ι f) ⋯


theorem extraction_of_frequently_atTop {P : ℕ → Prop} (h : ∃ᶠ n in atTop, P n) :
    ∃ φ : ℕ → ℕ, StrictMono φ ∧ ∀ n, P (φ n)

{P : ℕ → Prop}
(h : ∃ᶠ (n : ℕ) in Filter.atTop, P n)


lemma hasDerivAt_negMulLog {x : ℝ} (hx : x ≠ 0) : HasDerivAt negMulLog (- log x - 1) x

HasDerivAt Real.negMulLog (-Real.log x - 1) x


@[to_additive]
theorem _root_.HasCompactMulSupport.comp_homeomorph {M} [One M] {f : Y → M}
    (hf : HasCompactMulSupport f) (φ : X ≃ₜ Y) : HasCompactMulSupport (f ∘ φ)

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
{M : Type u_6}
[One M]
{f : Y → M}
(hf : HasCompactMulSupport f)
(φ : X ≃ₜ Y)


@[ext] lemma ext {e₁ e₂ : G ≃+c[a, b] H} (h : ∀ x, e₁ x = e₂ x) : e₁ = e₂

{G : Type u_1}
{H : Type u_2}
[Add G]
[Add H]
{a : G}
{b : H}
{e₁ e₂ : G ≃+c[a, b] H}
(h : ∀ (x : G), e₁ x = e₂ x)


/-- A variant of `intervalIntegral.integral_deriv_eq_sub`, the Fundamental theorem
of calculus, involving integrating over the unit interval. -/
lemma integral_unitInterval_deriv_eq_sub [RCLike 𝕜] [NormedSpace 𝕜 E] [IsScalarTower ℝ 𝕜 E]
    {f f' : 𝕜 → E} {z₀ z₁ : 𝕜}
    (hcont : ContinuousOn (fun t : ℝ ↦ f' (z₀ + t • z₁)) (Set.Icc 0 1))
    (hderiv : ∀ t ∈ Set.Icc (0 : ℝ) 1, HasDerivAt f (f' (z₀ + t • z₁)) (z₀ + t • z₁)) :
    z₁ • ∫ t in (0 : ℝ)..1, f' (z₀ + t • z₁) = f (z₀ + z₁) - f z₀

(hcont : ContinuousOn (fun t => f' (z₀ + t • z₁)) (Set.Icc 0 1))

(hderiv : ∀ t ∈ Set.Icc 0 1, HasDerivAt f (f' (z₀ + t • z₁)) (z₀ + t • z₁))

z₁ • ∫ (t : ℝ) in 0 ..1, f' (z₀ + t • z₁) = f (z₀ + z₁) - f z₀


theorem mem_graph_toLinearPMap {g : Submodule R (E × F)}
    (hg : ∀ (x : E × F) (_hx : x ∈ g) (_hx' : x.fst = 0), x.snd = 0)
    (x : g.map (LinearMap.fst R E F)) : (x.val, g.toLinearPMap x) ∈ g

(x : ↥(Submodule.map (LinearMap.fst R E F) g))


@[simp]
theorem coprime_self_sub_left {m n : ℕ} (h : m ≤ n) : Coprime (n - m) n ↔ Coprime m n


/-- `liminf` over `ℕ` is measurable. See `measurable_liminf'` for a version with a general filter.
-/
@[measurability]
theorem measurable_liminf {f : ℕ → δ → α} (hf : ∀ i, Measurable (f i)) :
    Measurable fun x => liminf (fun i => f i x) atTop

{α : Type u_1}
{δ : Type u_4}
[TopologicalSpace α]
[MeasurableSpace α]
[BorelSpace α]
[MeasurableSpace δ]
[ConditionallyCompleteLinearOrder α]
[OrderTopology α]
[SecondCountableTopology α]
{f : ℕ → δ → α}
(hf : ∀ (i : ℕ), Measurable (f i))

Measurable fun x => Filter.liminf (fun i => f i x) Filter.atTop


theorem T_sub (m n : ℤ) : (T (m - n) : R[T;T⁻¹]) = T m * T (-n)

LaurentPolynomial.T (m - n) = LaurentPolynomial.T m * LaurentPolynomial.T (-n)


theorem symm_bijective : Function.Bijective (symm : (A ≃⋆ₐ[R] B) → B ≃⋆ₐ[R] A)

{R : Type u_2}
{A : Type u_3}
{B : Type u_4}
[Add A]
[Add B]
[Mul A]
[Mul B]
[SMul R A]
[SMul R B]
[Star A]
[Star B]


theorem m_le_card_of_mem_chunk_parts (hs : s ∈ (chunk hP G ε hU).parts) : m ≤ s.card

(hs : s ∈ (SzemerediRegularity.chunk hP G ε hU).parts)

Fintype.card α / SzemerediRegularity.stepBound P.parts.card ≤ s.card


@[simp]
theorem preimage_cast_uIcc (p q : ℚ) : (↑) ⁻¹' uIcc (p : K) q = uIcc p q

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

Rat.cast ⁻¹' Set.uIcc ↑p ↑q = Set.uIcc p q


theorem toLinearEquiv_injective : Injective (toLinearEquiv : (E ≃ₛₗᵢ[σ₁₂] E₂) → E ≃ₛₗ[σ₁₂] E₂)

{R : Type u_1}
{R₂ : Type u_2}
{E : Type u_5}
{E₂ : Type u_6}
[Semiring R]
[Semiring R₂]
{σ₁₂ : R →+* R₂}
{σ₂₁ : R₂ →+* R}
[RingHomInvPair σ₁₂ σ₂₁]
[RingHomInvPair σ₂₁ σ₁₂]
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup E₂]
[Module R E]
[Module R₂ E₂]


theorem separatedNhds_iff_disjoint {s t : Set X} : SeparatedNhds s t ↔ Disjoint (𝓝ˢ s) (𝓝ˢ t)

{X : Type u_1}
[TopologicalSpace X]
{s t : Set X}


@[simp]
theorem Matrix.reindexLieEquiv_symm :
    (Matrix.reindexLieEquiv e : _ ≃ₗ⁅R⁆ _).symm = Matrix.reindexLieEquiv e.symm

{R : Type u}
[CommRing R]
{n : Type w}
[DecidableEq n]
[Fintype n]
{m : Type w₁}
[DecidableEq m]
[Fintype m]
(e : n ≃ m)

(Matrix.reindexLieEquiv e).symm = Matrix.reindexLieEquiv e.symm


@[simp]
theorem count_singleton' {a : α} (ha : MeasurableSet ({a} : Set α)) : count ({a} : Set α) = 1

{α : Type u_1}
[MeasurableSpace α]
{a : α}
(ha : MeasurableSet {a})


@[to_additive]
protected theorem le_mul_iff_one_le_left [MulOneClass α] [i : IsSymmOp α α (· * ·)]
    [CovariantClass α α (· * ·) (· ≤ ·)] {a b : α} (ha : MulLECancellable a) :
    a ≤ b * a ↔ 1 ≤ b

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


lemma ofRootOfUnity_spec {ζ : Rˣ} (hζ : ζ ∈ rootsOfUnity (Monoid.orderUnits M) R)
    {g : Mˣ} (hg : ∀ x, x ∈ Subgroup.zpowers g) :
    ofRootOfUnity hζ hg g = ζ

(hζ : ζ ∈ rootsOfUnity (MulChar.Monoid.orderUnits M) R)

(hg : ∀ (x : Mˣ), x ∈ Subgroup.zpowers g)


@[to_additive (attr := simp)]
theorem zpowers_le {g : G} {H : Subgroup G} : zpowers g ≤ H ↔ g ∈ H

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


@[simp] theorem getLsb_zero_length (x : BitVec 0) : x.getLsb i = false


/-- Promotes a linear `RingEquiv` to an `AlgEquiv`. -/
@[simps apply symm_apply toEquiv] -- Porting note: don't want redundant `toEquiv_symm_apply` simps
def ofRingEquiv {f : A₁ ≃+* A₂} (hf : ∀ x, f (algebraMap R A₁ x) = algebraMap R A₂ x) :
    A₁ ≃ₐ[R] A₂

(hf : ∀ (x : R), f ((algebraMap R A₁) x) = (algebraMap R A₂) x)

↑(AlgEquiv.ofRingEquiv hf) = { toFun := ⇑f, invFun := ⇑f.symm, left_inv := ⋯, right_inv := ⋯ }


/-- When `b < sSup s`, there is an element `a` in `s` with `b < a`, if `s` is nonempty and the order
is a linear order. -/
theorem exists_lt_of_lt_csSup (hs : s.Nonempty) (hb : b < sSup s) : ∃ a ∈ s, b < a

{α : Type u_1}
[ConditionallyCompleteLinearOrder α]
{s : Set α}
{b : α}
(hs : s.Nonempty)
(hb : b < sSup s)


@[reassoc] theorem toΓSpecSheafedSpace_app_spec (r : Γ.obj (op X)) :
    toOpen (Γ.obj (op X)) (basicOpen r) ≫ X.toΓSpecSheafedSpace.c.app (op (basicOpen r)) =
      X.toToΓSpecMapBasicOpen r

(r : ↑(AlgebraicGeometry.LocallyRingedSpace.Γ.obj (Opposite.op X)))

CategoryTheory.CategoryStruct.comp
    (AlgebraicGeometry.StructureSheaf.toOpen (↑(AlgebraicGeometry.LocallyRingedSpace.Γ.obj (Opposite.op X)))
      (PrimeSpectrum.basicOpen r))
    (X.toΓSpecSheafedSpace.c.app (Opposite.op (PrimeSpectrum.basicOpen r))) =
  X.toToΓSpecMapBasicOpen r


@[simp] lemma sigma_keys_lookup (s : Finmap β) :
    s.keys.sigma (fun i => (s.lookup i).toFinset) = ⟨s.entries, s.nodup_entries⟩

{α : Type u}
{β : α → Type v}
[DecidableEq α]
(s : Finmap β)

(s.keys.sigma fun i => (Finmap.lookup i s).toFinset) = { val := s.entries, nodup := ⋯ }


lemma completedCosZeta₀_neg (a : UnitAddCircle) (s : ℂ) :
    completedCosZeta₀ (-a) s = completedCosZeta₀ a s

HurwitzZeta.completedCosZeta₀ (-a) s = HurwitzZeta.completedCosZeta₀ a s


theorem coe_coe_fn' [IsTrans β s] (f : r ≺i s) : ((f : r ≼i s) : α → β) = f

{α : Type u_1}
{β : Type u_2}
{r : α → α → Prop}
{s : β → β → Prop}
[IsTrans β s]
(f : r ≺i s)

⇑{ toRelEmbedding := f.toRelEmbedding, init' := ⋯ } = ⇑f.toRelEmbedding


theorem pointReflection_fixed_iff_of_module [Invertible (2 : k)] {x y : P₁} :
    pointReflection k x y = y ↔ y = x

(k : Type u_1)
{P₁ : Type u_2}
{V₁ : Type u_6}
[Ring k]
[AddCommGroup V₁]
[Module k V₁]
[AffineSpace V₁ P₁]
[Invertible 2]
{x y : P₁}

(AffineEquiv.pointReflection k x) y = y ↔ y = x


/-- If `f` is integrable on `I`, then `fun J ↦ integral J l f vol` is box-additive on subboxes of
`I`: if `π₁`, `π₂` are two prepartitions of `I` covering the same part of `I`, the sum of integrals
of `f` over the boxes of `π₁` is equal to the sum of integrals of `f` over the boxes of `π₂`.

See also `BoxIntegral.Integrable.sum_integral_congr` for an unbundled version. -/
@[simps]
def toBoxAdditive (h : Integrable I l f vol) : ι →ᵇᵃ[I] F

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

h.toBoxAdditive J = BoxIntegral.integral J l f vol


/-- Pre-composition by any function is uniformly continuous for the uniform structures of
uniform convergence.

More precisely, for any `f : γ → α`, the function `(· ∘ f) : (α →ᵤ β) → (γ →ᵤ β)` is uniformly
continuous. -/
protected theorem precomp_uniformContinuous {f : γ → α} :
    UniformContinuous fun g : α →ᵤ β => ofFun (toFun g ∘ f)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[UniformSpace β]
{f : γ → α}

UniformContinuous fun g => UniformFun.ofFun (UniformFun.toFun g ∘ f)


theorem VectorSpace.card_fintype [Fintype K] [Fintype V] : ∃ n : ℕ, card V = card K ^ n

(K : Type u_3)
(V : Type u_4)
[DivisionRing K]
[AddCommGroup V]
[Module K V]
[Fintype K]
[Fintype V]

∃ n, Fintype.card V = Fintype.card K ^ n


@[to_additive (attr := simp)]
theorem map_eq_zero_iff_eq_one : f x = 0 ↔ x = 1

{F : Type u_2}
{α : Type u_3}
{β : Type u_4}
[FunLike F α β]
[AddGroup α]
[OrderedAddCommMonoid β]
[AddGroupNormClass F α β]
(f : F)
{x : α}


lemma pow_eq_one_iff_cases : a ^ n = 1 ↔ n = 0 ∨ a = 1 ∨ a = -1 ∧ Even n

{R : Type u_2}
[LinearOrderedRing R]
{a : R}
{n : ℕ}


@[simp]
theorem boundary_top : ∂ (⊤ : α) = ⊥


theorem darts_nodup_of_support_nodup {u v : V} {p : G.Walk u v} (h : p.support.Nodup) :
    p.darts.Nodup

{V : Type u}
{G : SimpleGraph V}
{u v : V}
{p : G.Walk u v}
(h : p.support.Nodup)


@[to_additive]
lemma IsOfFinOrder.finite_powers (ha : IsOfFinOrder a) : (powers a : Set G).Finite

{G : Type u_1}
[AddMonoid G]
{a : G}
(ha : IsOfFinAddOrder a)


/-- If `f` has finite integral, then `∫ x in s, f x ∂μ` is absolutely continuous in `s`: it tends
to zero as `μ s` tends to zero. -/
theorem HasFiniteIntegral.tendsto_setIntegral_nhds_zero {ι} {f : α → G}
    (hf : HasFiniteIntegral f μ) {l : Filter ι} {s : ι → Set α} (hs : Tendsto (μ ∘ s) l (𝓝 0)) :
    Tendsto (fun i => ∫ x in s i, f x ∂μ) l (𝓝 0)

(hf : MeasureTheory.HasFiniteIntegral f μ)

Filter.Tendsto (fun i => ∫ (x : α) in s i, f x ∂μ) l (𝓝 0)


@[to_additive (attr := simp)]
lemma UniformOnFun.toFun_mul [Mul β] (f g : α →ᵤ[𝔖] β) :
    toFun 𝔖 (f * g) = toFun 𝔖 f * toFun 𝔖 g

{α : Type u_1}
{β : Type u_2}
{𝔖 : Set (Set α)}
[Mul β]
(f g : α →ᵤ[𝔖] β)

(UniformOnFun.toFun 𝔖) (f * g) = (UniformOnFun.toFun 𝔖) f * (UniformOnFun.toFun 𝔖) g


@[to_additive]
theorem mem_centralizer_iff {g : G} {s : Set G} : g ∈ centralizer s ↔ ∀ h ∈ s, h * g = g * h

{G : Type u_1}
[Group G]
{g : G}
{s : Set G}

g ∈ Subgroup.centralizer s ↔ ∀ h ∈ s, h * g = g * h


@[to_additive]
theorem restrict_restrict (h : IsFundamentalDomain G s μ) (g : G) (t : Set α) :
    (μ.restrict t).restrict (g • s) = μ.restrict (g • s ∩ t)

[MeasureTheory.VAddInvariantMeasure G α μ]

(h : MeasureTheory.IsAddFundamentalDomain G s μ)

(μ.restrict t).restrict (g +ᵥ s) = μ.restrict ((g +ᵥ s) ∩ t)


@[to_additive]
theorem embedding_toContinuousMap :
    Embedding (toContinuousMap : ContinuousMonoidHom A B → C(A, B))

(A : Type u_2)
(B : Type u_3)
[AddMonoid A]
[AddMonoid B]
[TopologicalSpace A]
[TopologicalSpace B]


theorem mem_closure_image (hf : ContinuousAt f x)
    (hx : x ∈ closure s) : f x ∈ closure (f '' s)

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
{f : X → Y}
{s : Set X}
{x : X}
(hf : ContinuousAt f x)
(hx : x ∈ closure s)


@[simp] theorem mul_mod_left (a b : Int) : (a * b).mod b = 0


/-- Given Localization maps `f : M →* N, k : P →* Q` for Submonoids `S, T` respectively, if a
`CommMonoid` homomorphism `g : M →* P` induces a `f.map hy k : N →* Q`, then for all `z : N`,
`u : Q`, we have `f.map hy k z = u ↔ k (g x) = k (g y) * u` where `x : M, y ∈ S` are such that
`z * f y = f x`. -/
@[to_additive
    "Given Localization maps `f : M →+ N, k : P →+ Q` for Submonoids `S, T` respectively, if an
`AddCommMonoid` homomorphism `g : M →+ P` induces a `f.map hy k : N →+ Q`, then for all `z : N`,
`u : Q`, we have `f.map hy k z = u ↔ k (g x) = k (g y) + u` where `x : M, y ∈ S` are such that
`z + f y = f x`."]
theorem map_spec (z u) : f.map hy k z = u ↔ k.toMap (g (f.sec z).1) = k.toMap (g (f.sec z).2) * u

{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}
{T : AddSubmonoid P}
(hy : ∀ (y : ↥S), g ↑y ∈ T)
{Q : Type u_4}
[AddCommMonoid Q]
{k : T.LocalizationMap Q}
(z : N)
(u : Q)

(f.map hy k) z = u ↔ k.toMap (g (f.sec z).1) = k.toMap (g ↑(f.sec z).2) + u


@[simp]
theorem range_projIci : range (projIci a) = univ


@[simp] theorem gcd_one_right (n : Nat) : gcd n 1 = 1


theorem ordConnected_sInter {S : Set (Set α)} (hS : ∀ s ∈ S, OrdConnected s) :
    OrdConnected (⋂₀ S)

{α : Type u_1}
[Preorder α]
{S : Set (Set α)}
(hS : ∀ s ∈ S, s.OrdConnected)


theorem tendsto_comap {f : α → β} {x : Filter β} : Tendsto f (comap f x) x

{α : Type u}
{β : Type v}
{f : α → β}
{x : Filter β}


/-- `map_cocone` commutes with `precompose`. In particular, for `F : J ⥤ C`, given a cocone
`c : Cocone F`, a natural transformation `α : F ⟶ G` and a functor `H : C ⥤ D`, we have two obvious
ways of producing a cocone over `G ⋙ H`, and they are both isomorphic.
-/
@[simps!]
def mapCoconePrecompose {α : F ⟶ G} {c} :
    mapCocone H ((Cocones.precompose α).obj c) ≅
      (Cocones.precompose (whiskerRight α H : _)).obj (mapCocone H c)

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{D : Type u₄}
[CategoryTheory.Category.{v₄, u₄} D]
(H : C ⥤ D)
{F G : J ⥤ C}
{α : F ⟶ G}
{c : CategoryTheory.Limits.Cocone G}

H.mapCoconePrecompose.hom.hom = 𝟙 (H.obj c.pt)


protected
lemma OpenEmbedding.coborder_preimage (hf : OpenEmbedding f) (s : Set Y) :
    coborder (f ⁻¹' s) = f ⁻¹' (coborder s)

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


@[to_additive]
theorem div_lt_comm : a / b < c ↔ a / c < b

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


/-- Lebesgue dominated convergence theorem for series. -/
theorem hasSum_integral_of_dominated_convergence {ι} [Countable ι] {F : ι → α → G} {f : α → G}
    (bound : ι → α → ℝ) (hF_meas : ∀ n, AEStronglyMeasurable (F n) μ)
    (h_bound : ∀ n, ∀ᵐ a ∂μ, ‖F n a‖ ≤ bound n a)
    (bound_summable : ∀ᵐ a ∂μ, Summable fun n => bound n a)
    (bound_integrable : Integrable (fun a => ∑' n, bound n a) μ)
    (h_lim : ∀ᵐ a ∂μ, HasSum (fun n => F n a) (f a)) :
    HasSum (fun n => ∫ a, F n a ∂μ) (∫ a, f a ∂μ)

(hF_meas : ∀ (n : ι), MeasureTheory.AEStronglyMeasurable (F n) μ)

(h_bound : ∀ (n : ι), ∀ᵐ (a : α) ∂μ, ‖F n a‖ ≤ bound n a)

(bound_summable : ∀ᵐ (a : α) ∂μ, Summable fun n => bound n a)

(bound_integrable : MeasureTheory.Integrable (fun a => ∑' (n : ι), bound n a) μ)

(h_lim : ∀ᵐ (a : α) ∂μ, HasSum (fun n => F n a) (f a))

HasSum (fun n => ∫ (a : α), F n a ∂μ) (∫ (a : α), f a ∂μ)


theorem isFractionRing_of_isLocalization (S T : Type*) [CommRing S] [CommRing T] [Algebra R S]
    [Algebra R T] [Algebra S T] [IsScalarTower R S T] [IsLocalization M S] [IsFractionRing R T]
    (hM : M ≤ nonZeroDivisors R) : IsFractionRing S T

{R : Type u_1}
[CommRing R]
(M : Submonoid R)
(S : Type u_3)
(T : Type u_4)
[CommRing S]
[CommRing T]
[Algebra R S]
[Algebra R T]
[Algebra S T]
[IsScalarTower R S T]
[IsLocalization M S]
[IsFractionRing R T]
(hM : M ≤ nonZeroDivisors R)


/-- L'Hôpital's rule for approaching +∞, `HasDerivAt` version -/
theorem lhopital_zero_atTop (hff' : ∀ᶠ x in atTop, HasDerivAt f (f' x) x)
    (hgg' : ∀ᶠ x in atTop, HasDerivAt g (g' x) x) (hg' : ∀ᶠ x in atTop, g' x ≠ 0)
    (hftop : Tendsto f atTop (𝓝 0)) (hgtop : Tendsto g atTop (𝓝 0))
    (hdiv : Tendsto (fun x => f' x / g' x) atTop l) : Tendsto (fun x => f x / g x) atTop l

(hff' : ∀ᶠ (x : ℝ) in Filter.atTop, HasDerivAt f (f' x) x)

(hgg' : ∀ᶠ (x : ℝ) in Filter.atTop, HasDerivAt g (g' x) x)

(hg' : ∀ᶠ (x : ℝ) in Filter.atTop, g' x ≠ 0)

(hftop : Filter.Tendsto f Filter.atTop (𝓝 0))

(hgtop : Filter.Tendsto g Filter.atTop (𝓝 0))

(hdiv : Filter.Tendsto (fun x => f' x / g' x) Filter.atTop l)

Filter.Tendsto (fun x => f x / g x) Filter.atTop l


@[simp]
theorem factor_comp_mk (S T : Ideal R) (H : S ≤ T) : (factor S T H).comp (mk S) = mk T

{R : Type u}
[CommRing R]
(S T : Ideal R)
(H : S ≤ T)

(Ideal.Quotient.factor S T H).comp (Ideal.Quotient.mk S) = Ideal.Quotient.mk T


theorem trinomial_trailingCoeff (hkm : k < m) (hmn : m < n) (hu : u ≠ 0) :
    (trinomial k m n u v w).trailingCoeff = u

{R : Type u_1}
[Semiring R]
{k m n : ℕ}
{u v w : R}
(hkm : k < m)
(hmn : m < n)
(hu : u ≠ 0)

(Polynomial.trinomial k m n u v w).trailingCoeff = u


@[mono]
protected theorem toFinset_ssubset_toFinset : hs.toFinset ⊂ ht.toFinset ↔ s ⊂ t

{α : Type u}
{s t : Set α}
{hs : s.Finite}
{ht : t.Finite}


@[simp]
lemma prodMkRight_add (κ η : Kernel α β) :
    prodMkRight γ (κ + η) = prodMkRight γ κ + prodMkRight γ η

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

ProbabilityTheory.Kernel.prodMkRight γ (κ + η) =
  ProbabilityTheory.Kernel.prodMkRight γ κ + ProbabilityTheory.Kernel.prodMkRight γ η


/-- If `s` is a compact set in a topological space `X` and `f : ι → Set X` is a locally finite
family of sets, then `f i ∩ s` is nonempty only for a finitely many `i`. -/
theorem LocallyFinite.finite_nonempty_inter_compact {f : ι → Set X}
    (hf : LocallyFinite f) (hs : IsCompact s) : { i | (f i ∩ s).Nonempty }.Finite

{X : Type u}
{ι : Type u_1}
[TopologicalSpace X]
{s : Set X}
{f : ι → Set X}
(hf : LocallyFinite f)
(hs : IsCompact s)


lemma _root_.CategoryTheory.ShortComplex.Exact.exact_toComposableArrows
    {S : ShortComplex C} (hS : S.Exact) :
    S.toComposableArrows.Exact


theorem EventuallyEq.union {s t s' t' : Set α} {l : Filter α} (h : s =ᶠ[l] t) (h' : s' =ᶠ[l] t') :
    (s ∪ s' : Set α) =ᶠ[l] (t ∪ t' : Set α)

{α : Type u}
{s t s' t' : Set α}
{l : Filter α}
(h : s =ᶠ[l] t)
(h' : s' =ᶠ[l] t')


/-- A version of `CategoryTheory.whiskeringRight` for bifunctors, obtained by uncurrying,
applying `whiskeringRight` and currying back
-/
@[simps!]
def whiskeringRight₂ : (C ⥤ D ⥤ E) ⥤ (B ⥤ C) ⥤ (B ⥤ D) ⥤ B ⥤ E

(B : Type u₁)
[CategoryTheory.Category.{v₁, u₁} B]
(C : Type u₂)
[CategoryTheory.Category.{v₂, u₂} C]
(D : Type u₃)
[CategoryTheory.Category.{v₃, u₃} D]
(E : Type u₄)
[CategoryTheory.Category.{v₄, u₄} E]

∀ {X Y : CategoryTheory.Functor C (CategoryTheory.Functor D E)} (f : X ⟶ Y) (X_1 : CategoryTheory.Functor B C)
  (Y_1 : CategoryTheory.Functor B D) (c : B),
  ((((CategoryTheory.whiskeringRight₂ B C D E).map f).app X_1).app Y_1).app c = (f.app (X_1.obj c)).app (Y_1.obj c)


lemma stableUnderSpecialization_iUnion {ι : Sort*} (S : ι → Set X)
    (H : ∀ i, StableUnderSpecialization (S i)) : StableUnderSpecialization (⋃ i, S i)

(H : ∀ (i : ι), StableUnderSpecialization (S i))


theorem getVert_append {u v w : V} (p : G.Walk u v) (q : G.Walk v w) (i : ℕ) :
    (p.append q).getVert i = if i < p.length then p.getVert i else q.getVert (i - p.length)

{V : Type u}
{G : SimpleGraph V}
{u v w : V}
(p : G.Walk u v)
(q : G.Walk v w)
(i : ℕ)


lemma AnalyticWithinOn.continuousOn {f : E → F} {s : Set E} (h : AnalyticWithinOn 𝕜 f s) :
    ContinuousOn f s

{𝕜 : Type u_2}
[NontriviallyNormedField 𝕜]
{E : Type u_3}
{F : Type u_4}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{s : Set E}
(h : AnalyticWithinOn 𝕜 f s)


theorem pow_one_cast (a : R) : a ^ (nat_lit 1).rawCast = a


/--
A symmetric monoidal category is a braided monoidal category for which the braiding is symmetric.

See <https://stacks.math.columbia.edu/tag/0FFW>.
-/
class SymmetricCategory (C : Type u) [Category.{v} C] [MonoidalCategory.{v} C] extends
    BraidedCategory.{v} C where
  -- braiding symmetric:
  symmetry : ∀ X Y : C, (β_ X Y).hom ≫ (β_ Y X).hom = 𝟙 (X ⊗ Y) := by aesop_cat

[self : CategoryTheory.SymmetricCategory C]


/-- Bijection between a subalgebra `S` and its opposite. -/
@[simps!]
def linearEquivOp (S : Subalgebra R A) : S ≃ₗ[R] S.op

{R : Type u_2}
{A : Type u_3}
[CommSemiring R]
[Semiring A]
[Algebra R A]
(S : Subalgebra R A)

∀ (a : ↥S.op), ↑(S.linearEquivOp.symm a) = MulOpposite.unop ↑a


theorem comap_inducing_of_surjective (hf : Surjective f) : Inducing (comap f)

{R : Type u}
(S : Type v)
[CommSemiring R]
[CommSemiring S]
(f : R →+* S)
(hf : Function.Surjective ⇑f)


theorem nodup_iff_le {s : Multiset α} : Nodup s ↔ ∀ a : α, ¬a ::ₘ a ::ₘ 0 ≤ s


@[to_additive (attr := simp)]
theorem toWord_mk : (mk L₁).toWord = reduce L₁

{α : Type u}
{L₁ : List (α × Bool)}
[DecidableEq α]

(FreeAddGroup.mk L₁).toWord = FreeAddGroup.reduce L₁


/-- If a space is eventually covered by a countable family of sets, all with cardinality `a`,
then the cardinality of the space is also `a`. -/
lemma mk_of_countable_eventually_mem {α : Type u} {ι : Type v} {a : Cardinal}
    [Countable ι] {f : ι → Set α} {l : Filter ι} [NeBot l] (ht : ∀ x, ∀ᶠ i in l, x ∈ f i)
    (h'f : ∀ i, #(f i) = a) : #α = a

(ht : ∀ (x : α), ∀ᶠ (i : ι) in l, x ∈ f i)


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

{α : Type u_1}
{ι : Sort u_2}
[Nonempty ι]
(m : ι → MeasureTheory.OuterMeasure α)
(s : Set α)

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


@[simp] lemma reflTransGen_reflGen : ReflTransGen (ReflGen r) = ReflTransGen r

Relation.ReflTransGen (Relation.ReflGen r) = Relation.ReflTransGen r


@[simp]
theorem unflip_flip {X α β : Type*} [Finite α] [TopologicalSpace X]
    (f : LocallyConstant X (α → β)) : unflip f.flip = f

{X : Type u_5}
{α : Type u_6}
{β : Type u_7}
[Finite α]
[TopologicalSpace X]
(f : LocallyConstant X (α → β))


@[simp]
theorem powerset_univ : 𝒫(univ : Set α) = univ


theorem toAddSubmonoid_injective :
    Function.Injective (toAddSubmonoid : Subsemiring R → AddSubmonoid R)


theorem subtype_mk {p : β → Prop} [DecidablePred p] {hp : PrimrecPred p} {f : α → β}
    {h : ∀ a, p (f a)} (hf : Primrec f) :
    haveI := Primcodable.subtype hp
    Primrec fun a => @Subtype.mk β p (f a) (h a)

{α : Type u_1}
{β : Type u_2}
[Primcodable α]
[Primcodable β]
{p : β → Prop}
[DecidablePred p]
{hp : PrimrecPred p}
{f : α → β}
{h : ∀ (a : α), p (f a)}
(hf : Primrec f)


@[simp, norm_cast] lemma coeFn_zero : ⇑(0 : FiniteMeasure Ω) = 0


theorem lt_iff_lt {a : α} {b : β} : b < l a ↔ u b < a

{α : Type u}
{β : Type v}
[LinearOrder α]
[LinearOrder β]
{l : α → β}
{u : β → α}
(gc : GaloisConnection l u)
{a : α}
{b : β}


/-- A structure designed to hold the hypotheses for the Mellin-functional-equation argument
(most general version: rapid decay at `∞` up to constant terms) -/
structure WeakFEPair where
  /-- The functions whose Mellin transform we study -/
  (f g : ℝ → E)
  /-- Weight (exponent in the functional equation) -/
  (k : ℝ)
  /-- Root number -/
  (ε : ℂ)
  /-- Constant terms at `∞` -/
  (f₀ g₀ : E)
  (hf_int : LocallyIntegrableOn f (Ioi 0))
  (hg_int : LocallyIntegrableOn g (Ioi 0))
  (hk : 0 < k)
  (hε : ε ≠ 0)
  (h_feq : ∀ x ∈ Ioi 0, f (1 / x) = (ε * ↑(x ^ k)) • g x)
  (hf_top (r : ℝ) : (f · - f₀) =O[atTop] (· ^ r))
  (hg_top (r : ℝ) : (g · - g₀) =O[atTop] (· ^ r))

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
(self : WeakFEPair E)
(r : ℝ)

(fun x => self.g x - self.g₀) =O[Filter.atTop] fun x => x ^ r


/-- Pseudoequality is transitive: Just take the pullback. The pullback morphisms will
    be epimorphisms since in an abelian category, pullbacks of epimorphisms are epimorphisms. -/
theorem pseudoEqual_trans {P : C} : Transitive (PseudoEqual P)

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


/-- An induction principle for closure membership. If `p` holds for `1` and all elements of `s`, and
is preserved under multiplication, then `p` holds for all elements of the closure of `s`. -/
@[to_additive (attr := elab_as_elim)
      "An induction principle for additive closure membership. If `p` holds for `0` and all
      elements of `s`, and is preserved under addition, then `p` holds for all elements of the
      additive closure of `s`."]
theorem closure_induction {p : M → Prop} {x} (h : x ∈ closure s) (mem : ∀ x ∈ s, p x) (one : p 1)
    (mul : ∀ x y, p x → p y → p (x * y)) : p x

(mul : ∀ (x y : M), p x → p y → p (x + y))


lemma addX_of_X_eq {P Q : Fin 3 → F} (hP : W.Equation P) (hQ : W.Equation Q) (hPz : P z ≠ 0)
    (hQz : Q z ≠ 0) (hx : P x * Q z ^ 2 = Q x * P z ^ 2) : W.addX P Q = addU P Q ^ 2

{F : Type v}
[Field F]
{W : WeierstrassCurve.Jacobian F}
{P Q : Fin 3 → F}
(hP : W.Equation P)
(hQ : W.Equation Q)
(hPz : P z ≠ 0)
(hQz : Q z ≠ 0)
(hx : P x * Q z ^ 2 = Q x * P z ^ 2)

W.addX P Q = WeierstrassCurve.Jacobian.addU P Q ^ 2


theorem isNilpotent_mul_left (h : IsNilpotent x) : IsNilpotent (x * y)

{R : Type u_1}
{x y : R}
[Semiring R]
(h_comm : Commute x y)
(h : IsNilpotent x)


theorem isFibAux_two_mul_add_one {n a b n' a' b' : ℕ} (H : IsFibAux n a b)
    (hn : 2 * n + 1 = n') (h1 : a * a + b * b = a') (h2 : b * (2 * a + b) = b') :
    IsFibAux n' a' b'

(H : Mathlib.Meta.NormNum.IsFibAux n a b)


theorem cond_toMeasurable_eq :
    μ[|(toMeasurable μ s)] = μ[|s]

{Ω : Type u_1}
{m : MeasurableSpace Ω}
(μ : MeasureTheory.Measure Ω)
{s : Set Ω}

ProbabilityTheory.cond μ (MeasureTheory.toMeasurable μ s) = ProbabilityTheory.cond μ s


theorem exists_le_isAssociatedPrime_of_isNoetherianRing [H : IsNoetherianRing R] (x : M)
    (hx : x ≠ 0) : ∃ P : Ideal R, IsAssociatedPrime P M ∧ (R ∙ x).annihilator ≤ P

(R : Type u_1)
[CommRing R]
{M : Type u_2}
[AddCommGroup M]
[Module R M]
[H : IsNoetherianRing R]
(x : M)
(hx : x ≠ 0)

∃ P, IsAssociatedPrime P M ∧ (Submodule.span R {x}).annihilator ≤ P


theorem le_tsub_iff_le_tsub (h₁ : a ≤ b) (h₂ : c ≤ b) : a ≤ b - c ↔ c ≤ b - a

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

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


lemma induce_connected_of_patches {s : Set V} (u : V) (hu : u ∈ s)
    (patches : ∀ {v}, v ∈ s → ∃ s' ⊆ s, ∃ (hu' : u ∈ s') (hv' : v ∈ s'),
                  (G.induce s').Reachable ⟨u, hu'⟩ ⟨v, hv'⟩) : (G.induce s).Connected

(patches :
  ∀ {v : V}, v ∈ s → ∃ s' ⊆ s, ∃ (hu' : u ∈ s') (hv' : v ∈ s'), (SimpleGraph.induce s' G).Reachable ⟨u, hu'⟩ ⟨v, hv'⟩)


@[simp]
theorem coeff_C_mul (m) (a : R) (p : MvPolynomial σ R) : coeff m (C a * p) = a * coeff m p

{R : Type u}
{σ : Type u_1}
[CommSemiring R]
(m : σ →₀ ℕ)
(a : R)
(p : MvPolynomial σ R)

MvPolynomial.coeff m (MvPolynomial.C a * p) = a * MvPolynomial.coeff m p


theorem IsTheta.mul {f₁ f₂ : α → 𝕜} {g₁ g₂ : α → 𝕜'} (h₁ : f₁ =Θ[l] g₁) (h₂ : f₂ =Θ[l] g₂) :
    (fun x ↦ f₁ x * f₂ x) =Θ[l] fun x ↦ g₁ x * g₂ x

{α : Type u_1}
{𝕜 : Type u_14}
{𝕜' : Type u_15}
[NormedField 𝕜]
[NormedField 𝕜']
{l : Filter α}
{f₁ f₂ : α → 𝕜}
{g₁ g₂ : α → 𝕜'}
(h₁ : f₁ =Θ[l] g₁)
(h₂ : f₂ =Θ[l] g₂)

(fun x => f₁ x * f₂ x) =Θ[l] fun x => g₁ x * g₂ x


theorem nonneg_add_lem {x y z w : ℕ} (xy : Nonneg (⟨x, -y⟩ : ℤ√d)) (zw : Nonneg (⟨-z, w⟩ : ℤ√d)) :
    Nonneg (⟨x, -y⟩ + ⟨-z, w⟩ : ℤ√d)

{d x y z w : ℕ}
(xy : { re := ↑x, im := -↑y }.Nonneg)
(zw : { re := -↑z, im := ↑w }.Nonneg)

({ re := ↑x, im := -↑y } + { re := -↑z, im := ↑w }).Nonneg


@[simp]
theorem toMultilinearMap_zero : (0 : ContinuousMultilinearMap R M₁ M₂).toMultilinearMap = 0

{R : Type u}
{ι : Type v}
{M₁ : ι → Type w₁}
{M₂ : Type w₂}
[Semiring R]
[(i : ι) → AddCommMonoid (M₁ i)]
[AddCommMonoid M₂]
[(i : ι) → Module R (M₁ i)]
[Module R M₂]
[(i : ι) → TopologicalSpace (M₁ i)]
[TopologicalSpace M₂]

ContinuousMultilinearMap.toMultilinearMap 0 = 0


theorem isBounded_range (f : α →ᵇ β) : IsBounded (range f)

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


lemma shiftIso_add' (n m mn : A) (hnm : m + n = mn) (a a' a'' : A)
    (ha' : n + a = a') (ha'' : m + a' = a'') :
    F.shiftIso mn a a'' (by rw [← hnm, ← ha'', ← ha', add_assoc]) =
      isoWhiskerLeft _ (shiftFunctorAdd' D m n mn hnm) ≪≫ (Functor.associator _ _ _).symm ≪≫
        isoWhiskerRight (F.shiftIso m a' a'' ha'') _ ≪≫ F.shiftIso n a a' ha'

(F : CategoryTheory.SingleFunctors C D A)

F.shiftIso mn a a'' ⋯ =
  CategoryTheory.isoWhiskerLeft (F.functor a'') (CategoryTheory.shiftFunctorAdd' D m n mn hnm) ≪≫
    ((F.functor a'').associator (CategoryTheory.shiftFunctor D m) (CategoryTheory.shiftFunctor D n)).symm ≪≫
      CategoryTheory.isoWhiskerRight (F.shiftIso m a' a'' ha'') (CategoryTheory.shiftFunctor D n) ≪≫
        F.shiftIso n a a' ha'


@[simp]
theorem coe_zero : ⇑(0 : LieDerivation R L M) = 0

{R : Type u_1}
{L : Type u_2}
{M : Type u_3}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]


@[norm_cast]
theorem coe_inv (U : unitary R) : ↑U⁻¹ = (U⁻¹ : R)

{R : Type u_1}
[GroupWithZero R]
[StarMul R]
(U : ↥(unitary R))

↑U⁻¹ = (↑U)⁻¹


lemma inrCompHomotopy_hom (i j : ι) (hij : c.Rel j i) :
    (inrCompHomotopy φ hc).hom i j = inlX φ i j hij

(HomologicalComplex.homotopyCofiber.inrCompHomotopy φ hc).hom i j = HomologicalComplex.homotopyCofiber.inlX φ i j hij


theorem bound_of_shell [RingHomIsometric σ₁₂] (f : E →ₛₗ[σ₁₂] F) {ε C : ℝ} (ε_pos : 0 < ε) {c : 𝕜}
    (hc : 1 < ‖c‖) (hf : ∀ x, ε / ‖c‖ ≤ ‖x‖ → ‖x‖ < ε → ‖f x‖ ≤ C * ‖x‖) (x : E) :
    ‖f x‖ ≤ C * ‖x‖

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

(hf : ∀ (x : E), ε / ‖c‖ ≤ ‖x‖ → ‖x‖ < ε → ‖f x‖ ≤ C * ‖x‖)

‖f x‖ ≤ C * ‖x‖


/-- A copy of `mul_mul_invOf_self_cancel` for rectangular matrices. -/
protected theorem mul_mul_invOf_self_cancel (A : Matrix m n α) (B : Matrix n n α) [Invertible B] :
    A * B * ⅟ B = A

{m : Type u_1}
{n : Type u_2}
{α : Type u_3}
[Fintype n]
[DecidableEq n]
[Semiring α]
(A : Matrix m n α)
(B : Matrix n n α)
[Invertible B]


/--
Comonoid objects are contravariantly equivalent to monoid objects in the opposite category.
-/
@[simps]
def Comon_EquivMon_OpOp : Comon_ C ≌ (Mon_ (Cᵒᵖ))ᵒᵖ

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

(Comon_.Comon_EquivMon_OpOp C).counitIso =
  CategoryTheory.NatIso.ofComponents
    (fun x => CategoryTheory.Iso.refl ((Comon_.Mon_OpOpToComon_ C ⋙ Comon_.Comon_ToMon_OpOp C).obj x)) ⋯


theorem isAlgebraic_one [Nontrivial R] : IsAlgebraic R (1 : A)

{R : Type u}
{A : Type v}
[CommRing R]
[Ring A]
[Algebra R A]
[Nontrivial R]


@[nontriviality]
lemma of_subsingleton_right [Subsingleton β] : EventuallyConst f l

{α : Type u_1}
{β : Type u_2}
{l : Filter α}
{f : α → β}
[Subsingleton β]


theorem cardinal_bInter_mem {S : Set ι} (hS : #S < c)
    {s : ∀ i ∈ S, Set α} :
    (⋂ i, ⋂ hi : i ∈ S, s i ‹_›) ∈ l ↔ ∀ i, ∀ hi : i ∈ S, s i ‹_› ∈ l

{ι α : Type u}
{c : Cardinal.{u}}
{l : Filter α}
[CardinalInterFilter l c]
{S : Set ι}
(hS : #↑S < c)
{s : (i : ι) → i ∈ S → Set α}

⋂ i, ⋂ (hi : i ∈ S), s i hi ∈ l ↔ ∀ (i : ι) (hi : i ∈ S), s i hi ∈ l


@[simp]
theorem structure_simpleGraphOfStructure [S : Language.graph.Structure V] [V ⊨ Theory.simpleGraph] :
    (simpleGraphOfStructure V).structure = S

[S : FirstOrder.Language.graph.Structure V]

(FirstOrder.Language.simpleGraphOfStructure V).structure = S


theorem xInTermsOfW_aux [Invertible (p : R)] (n : ℕ) :
    xInTermsOfW p R n * C ((p : R) ^ n) =
      X n - ∑ i ∈ range n, C ((p : R) ^ i) * xInTermsOfW p R i ^ p ^ (n - i)

(p : ℕ)
(R : Type u_1)
[CommRing R]
[Invertible ↑p]
(n : ℕ)

xInTermsOfW p R n * MvPolynomial.C (↑p ^ n) =
  MvPolynomial.X n - ∑ i ∈ Finset.range n, MvPolynomial.C (↑p ^ i) * xInTermsOfW p R i ^ p ^ (n - i)


/-- A class guaranteeing that the non-unital continuous functional calculus is uniquely determined
by the properties that it is a continuous non-unital star algebra homomorphism mapping the
(restriction of) the identity to `a`. This is the necessary tool used to establish `cfcₙHom_comp`
and the more common variant `cfcₙ_comp`.

This class will have instances in each of the common cases `ℂ`, `ℝ` and `ℝ≥0` as a consequence of
the Stone-Weierstrass theorem. -/
class UniqueNonUnitalContinuousFunctionalCalculus (R A : Type*) [CommSemiring R] [StarRing R]
    [MetricSpace R] [TopologicalSemiring R] [ContinuousStar R] [NonUnitalRing A] [StarRing A]
    [TopologicalSpace A] [Module R A] [IsScalarTower R A A] [SMulCommClass R A A] : Prop where
  eq_of_continuous_of_map_id (s : Set R) [CompactSpace s] [Zero s] (h0 : (0 : s) = (0 : R))
    (φ ψ : C(s, R)₀ →⋆ₙₐ[R] A) (hφ : Continuous φ) (hψ : Continuous ψ)
    (h : φ (⟨.restrict s <| .id R, h0⟩) = ψ (⟨.restrict s <| .id R, h0⟩)) :
    φ = ψ
  compactSpace_quasispectrum (a : A) : CompactSpace (σₙ R a)

[self : UniqueNonUnitalContinuousFunctionalCalculus R A]


theorem choose_spec (h : ∃ x, p x) : p (choose h)

{α : Type u_1}
{p : α → Prop}
[Encodable α]
[DecidablePred p]
(h : ∃ x, p x)


/-- Automorphization of a function into an `R`-`Module` distributes, that is, commutes with the
`R`-scalar multiplication. -/
lemma AddAction.automorphize_smul_left [AddGroup α] [AddAction α β]  (f : β → M)
    (g : Quotient (AddAction.orbitRel α β) → R) :
    AddAction.automorphize ((g ∘ (@Quotient.mk' _ (_))) • f)
      = g • (AddAction.automorphize f : Quotient (AddAction.orbitRel α β) → M)

AddAction.automorphize (g ∘ Quotient.mk' • f) = g • AddAction.automorphize f


theorem empty_mem_iff_bot {f : Filter α} : ∅ ∈ f ↔ f = ⊥

∅ ∈ f ↔ f = ⊥


/-- The natural isomorphism `shortComplexFunctor C c j ≅ shortComplexFunctor' C c i j k`
when `c.prev j = i` and `c.next j = k`. -/
@[simps!]
noncomputable def natIsoSc' (i j k : ι) (hi : c.prev j = i) (hk : c.next j = k) :
    shortComplexFunctor C c j ≅ shortComplexFunctor' C c i j k

((HomologicalComplex.natIsoSc' C c i j k hi hk).inv.app X).τ₃ = (X.XIsoOfEq hk).inv


theorem Indep.indepSets {_mΩ : MeasurableSpace Ω}
    {κ : Kernel α Ω} {μ : Measure α} {s1 s2 : Set (Set Ω)}
    (h_indep : Indep (generateFrom s1) (generateFrom s2) κ μ) :
    IndepSets s1 s2 κ μ

(h_indep : ProbabilityTheory.Kernel.Indep (MeasurableSpace.generateFrom s1) (MeasurableSpace.generateFrom s2) κ μ)

ProbabilityTheory.Kernel.IndepSets s1 s2 κ μ


lemma coe_div_le : ↑(p / r) ≤ (p / r : ℝ≥0∞)


theorem commutatorMap_surjective (hφ : FixedPointFree φ) : Function.Surjective (commutatorMap φ)

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


protected theorem IsAsymm.isIrrefl [IsAsymm α r] : IsIrrefl α r

{α : Type u}
{r : α → α → Prop}
[IsAsymm α r]


theorem symm_comp_eq {α β γ} (e : α ≃ β) (f : γ → α) (g : γ → β) : e.symm ∘ g = f ↔ g = e ∘ f

{α : Sort u_1}
{β : Sort u_2}
{γ : Sort u_3}
(e : α ≃ β)
(f : γ → α)
(g : γ → β)


/-- The natural equivalence between continuous linear maps from `M` to `N`
and continuous 1-multilinear alternating maps from `M` to `N`. -/
@[simps! apply_apply symm_apply_apply apply_toContinuousMultilinearMap]
def ofSubsingleton [Subsingleton ι] (i : ι) :
    (M →L[R] N) ≃ M [⋀^ι]→L[R] N

(R : Type u_1)
(M : Type u_2)
(N : Type u_4)
{ι : Type u_6}
[Semiring R]
[AddCommMonoid M]
[Module R M]
[TopologicalSpace M]
[AddCommMonoid N]
[Module R N]
[TopologicalSpace N]
[Subsingleton ι]
(i : ι)
(f : M [⋀^ι]→L[R] N)
(x : M)

((ContinuousAlternatingMap.ofSubsingleton R M N i).symm f) x = f fun x_1 => x


@[elab_as_elim]
theorem iInf_sets_induct {f : ι → Filter α} {s : Set α} (hs : s ∈ iInf f) {p : Set α → Prop}
    (uni : p univ) (ins : ∀ {i s₁ s₂}, s₁ ∈ f i → p s₂ → p (s₁ ∩ s₂)) : p s

(ins : ∀ {i : ι} {s₁ s₂ : Set α}, s₁ ∈ f i → p s₂ → p (s₁ ∩ s₂))


/-- Validity for a substring. -/
structure Valid (s : Substring) : Prop where
  /-- The start position of a valid substring is valid. -/
  startValid : s.startPos.Valid s.str
  /-- The stop position of a valid substring is valid. -/
  stopValid : s.stopPos.Valid s.str
  /-- The stop position of a substring is at least the start. -/
  le : s.startPos ≤ s.stopPos


@[simp]
theorem r_one_pow (k : ℕ) : (r 1 : DihedralGroup n) ^ k = r k

DihedralGroup.r 1 ^ k = DihedralGroup.r ↑k


theorem symm_involutive : Function.Involutive (symm : I → I)


@[simp] theorem Proj.one_apply : (1 : (Proj.structureSheaf 𝒜).1.obj V).1 x = 1

{V : (TopologicalSpace.Opens ↑(ProjectiveSpectrum.top 𝒜))ᵒᵖ}


theorem essSup_add_le (f g : α → ℝ≥0∞) : essSup (f + g) μ ≤ essSup f μ + essSup g μ

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
(f g : α → ℝ≥0∞)


@[to_additive]
theorem prod_eq_single {f : α → M} (a : α) (h : ∀ x ≠ a, f x = 1) : ∏ x, f x = f a

{α : Type u_1}
{M : Type u_4}
[Fintype α]
[AddCommMonoid M]
{f : α → M}
(a : α)
(h : ∀ (x : α), x ≠ a → f x = 0)


@[simp] lemma ofDual_intCast [IntCast R] (n : ℤ) : (ofDual n : R) = n


/-- The forgetful functor from the Eilenberg-Moore category, forgetting the algebraic structure. -/
@[simps]
def forget : Algebra T ⥤ C

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

∀ {X Y : T.Algebra} (f : X ⟶ Y), T.forget.map f = f.f


theorem prod_preimage_right {g : δ → β} :
    s ×ˢ (g ⁻¹' t) = (fun p : α × δ => (p.1, g p.2)) ⁻¹' s ×ˢ t

{α : Type u_1}
{β : Type u_2}
{δ : Type u_4}
{s : Set α}
{t : Set β}
{g : δ → β}

s ×ˢ (g ⁻¹' t) = (fun p => (p.1, g p.2)) ⁻¹' s ×ˢ t


/-- If `a` semiconjugates `x` to `y` and `x'` to `y'`,
then it semiconjugates `x * x'` to `y * y'`. -/
@[to_additive (attr := simp) "If `a` semiconjugates `x` to `y` and `x'` to `y'`,
then it semiconjugates `x + x'` to `y + y'`."]
theorem mul_right (h : SemiconjBy a x y) (h' : SemiconjBy a x' y') :
    SemiconjBy a (x * x') (y * y')

{S : Type u_1}
[Semigroup S]
{a x y x' y' : S}
(h : SemiconjBy a x y)
(h' : SemiconjBy a x' y')


@[to_additive]
theorem prod_cons [CommMonoid β] {n : ℕ} (x : β) (f : Fin n → β) :
    (∏ i : Fin n.succ, (cons x f : Fin n.succ → β) i) = x * ∏ i : Fin n, f i

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

∑ i : Fin n.succ, Fin.cons x f i = x + ∑ i : Fin n, f i


theorem optionCongr_injective : Function.Injective (optionCongr : α ≃ β → Option α ≃ Option β)