lemma shiftFunctor_comp_inverts (a : A) :
    W.IsInvertedBy (shiftFunctor C a ⋙ L)

{C : Type u₁}
{D : Type u₂}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.Category.{v₂, u₂} D]
(L : CategoryTheory.Functor C D)
(W : CategoryTheory.MorphismProperty C)
[L.IsLocalization W]
{A : Type w}
[AddMonoid A]
[CategoryTheory.HasShift C A]
[W.IsCompatibleWithShift A]
(a : A)

W.IsInvertedBy ((CategoryTheory.shiftFunctor C a).comp L)


theorem sub_def {r p : ℝ≥0} : r - p = Real.toNNReal (r - p)


@[simp]
theorem tmul_comp_tensorAssoc
    (Q₁ : QuadraticForm R M₁) (Q₂ : QuadraticForm R M₂) (Q₃ : QuadraticForm R M₃) :
    (Q₁.tmul (Q₂.tmul Q₃)).comp (TensorProduct.assoc R M₁ M₂ M₃) = (Q₁.tmul Q₂).tmul Q₃

{R : Type uR}
{M₁ : Type uM₁}
{M₂ : Type uM₂}
{M₃ : Type uM₃}
[CommRing R]
[AddCommGroup M₁]
[AddCommGroup M₂]
[AddCommGroup M₃]
[Module R M₁]
[Module R M₂]
[Module R M₃]
[Invertible 2]
(Q₁ : QuadraticForm R M₁)
(Q₂ : QuadraticForm R M₂)
(Q₃ : QuadraticForm R M₃)

QuadraticMap.comp (Q₁.tmul (Q₂.tmul Q₃)) ↑(TensorProduct.assoc R M₁ M₂ M₃) = (Q₁.tmul Q₂).tmul Q₃


theorem map_map_permutations'Aux (f : α → β) (t : α) (ts : List α) :
    map (map f) (permutations'Aux t ts) = permutations'Aux (f t) (map f ts)

{α : Type u_1}
{β : Type u_2}
(f : α → β)
(t : α)
(ts : List α)

List.map (List.map f) (List.permutations'Aux t ts) = List.permutations'Aux (f t) (List.map f ts)


@[simp]
theorem adjoin_range_ι : Algebra.adjoin R (Set.range (ι R : X → FreeAlgebra R X)) = ⊤

(R : Type u_1)
[CommSemiring R]
(X : Type u_2)

Algebra.adjoin R (Set.range (FreeAlgebra.ι R)) = ⊤


/-- When we have an adjunction `G ⊣ F`, any commutative square where the left
map is of the form `G.map i` and the right map is `p` has an "adjoint" commutative
square whose left map is `i` and whose right map is `F.map p`. -/
theorem right_adjoint (sq : CommSq u (G.map i) p v) (adj : G ⊣ F) :
    CommSq (adj.homEquiv _ _ u) i (F.map p) (adj.homEquiv _ _ v)

(sq : CategoryTheory.CommSq u (G.map i) p v)

CategoryTheory.CommSq ((adj.homEquiv A X) u) i (F.map p) ((adj.homEquiv B Y) v)


lemma coeff_preΨ_ne_zero {n : ℤ} (h : (n : R) ≠ 0) :
    (W.preΨ n).coeff ((n.natAbs ^ 2 - if Even n then 4 else 1) / 2) ≠ 0

{R : Type u}
[CommRing R]
(W : WeierstrassCurve R)
{n : ℤ}
(h : ↑n ≠ 0)


/-- precompose an equation between morphisms by another morphism -/
theorem whisker_eq (f : X ⟶ Y) {g h : Y ⟶ Z} (w : g = h) : f ≫ g = f ≫ h

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

CategoryTheory.CategoryStruct.comp f g = CategoryTheory.CategoryStruct.comp f h


@[simp]
theorem inv_intCast_num (a : ℤ) : (a : ℚ)⁻¹.num = Int.sign a


@[parity_simps] lemma even_mul : Even (m * n) ↔ Even m ∨ Even n


@[simp] lemma mem_comap {L : Sublattice β} : a ∈ L.comap f ↔ f a ∈ L

{α : Type u_2}
{β : Type u_3}
[Lattice α]
[Lattice β]
{f : LatticeHom α β}
{a : α}
{L : Sublattice β}


/-- Mixin for a `VectorPrebundle` stating smoothness of coordinate changes. -/
class IsSmooth (a : VectorPrebundle 𝕜 F E) : Prop where
  exists_smoothCoordChange :
    ∀ᵉ (e ∈ a.pretrivializationAtlas) (e' ∈ a.pretrivializationAtlas),
      ∃ f : B → F →L[𝕜] F,
        SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) f (e.baseSet ∩ e'.baseSet) ∧
          ∀ (b : B) (_ : b ∈ e.baseSet ∩ e'.baseSet) (v : F),
            f b v = (e' ⟨b, e.symm b v⟩).2

(e : Pretrivialization F Bundle.TotalSpace.proj)

e ∈ a.pretrivializationAtlas →
  ∀ e' ∈ a.pretrivializationAtlas,
    ∃ f,
      SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) f (e.baseSet ∩ e'.baseSet) ∧
        ∀ b ∈ e.baseSet ∩ e'.baseSet, ∀ (v : F), (f b) v = (↑e' { proj := b, snd := e.symm b v }).2


theorem eLpNormEssSup_mono_nnnorm_ae {f g : α → F} (hfg : ∀ᵐ x ∂μ, ‖f x‖₊ ≤ ‖g x‖₊) :
    eLpNormEssSup f μ ≤ eLpNormEssSup g μ

{α : Type u_1}
{F : Type u_3}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup F]
{f g : α → F}
(hfg : ∀ᵐ (x : α) ∂μ, ‖f x‖₊ ≤ ‖g x‖₊)

MeasureTheory.eLpNormEssSup f μ ≤ MeasureTheory.eLpNormEssSup g μ


theorem ContinuousOn.of_dslope (h : ContinuousOn (dslope f a) s) : ContinuousOn f s

{𝕜 : Type u_1}
{E : Type u_2}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{f : 𝕜 → E}
{a : 𝕜}
{s : Set 𝕜}
(h : ContinuousOn (dslope f a) s)


theorem localization_finiteType : RingHom.LocalizationPreserves @RingHom.FiniteType


theorem stopPos : ∀ {s}, ValidFor l m r s → s.stopPos = ⟨utf8Len l + utf8Len m⟩

Substring.ValidFor l m r s → s.stopPos = { byteIdx := String.utf8Len l + String.utf8Len m }


theorem Monic.geom_sum {P : R[X]} (hP : P.Monic) (hdeg : 0 < P.natDegree) {n : ℕ} (hn : n ≠ 0) :
    (∑ i ∈ range n, P ^ i).Monic

{R : Type u}
[Semiring R]
{P : R[X]}
(hP : P.Monic)
(hdeg : 0 < P.natDegree)
{n : ℕ}
(hn : n ≠ 0)


@[simp]
lemma rightHomologyMap'_zero (h₁ : S₁.RightHomologyData) (h₂ : S₂.RightHomologyData) :
    rightHomologyMap' 0 h₁ h₂ = 0

CategoryTheory.ShortComplex.rightHomologyMap' 0 h₁ h₂ = 0


theorem forall_fin_succ' {P : Fin (n + 1) → Prop} :
    (∀ i, P i) ↔ (∀ i : Fin n, P i.castSucc) ∧ P (.last _)

(∀ (i : Fin (n + 1)), P i) ↔ (∀ (i : Fin n), P i.castSucc) ∧ P (Fin.last n)


theorem smul_modByMonic (c : R) (p : R[X]) : c • p %ₘ q = c • (p %ₘ q)

{R : Type u}
[CommRing R]
{q : R[X]}
(c : R)
(p : R[X])


@[simp] lemma bot_ne_natCast (n : ℕ) : (⊥ : WithBot α) ≠ n

{α : Type u}
[AddMonoidWithOne α]
(n : ℕ)


protected theorem zero_mul : ∀ x : EReal, 0 * x = 0


/-- The multicospan associated to a cover `S : J.Cover X` and a presheaf of the form `P ⋙ F`
is isomorphic to the composition of the multicospan associated to `S` and `P`,
composed with `F`. -/
@[simps!]
def multicospanComp : (S.index (P ⋙ F)).multicospan ≅ (S.index P).multicospan ⋙ F

{J : CategoryTheory.GrothendieckTopology C}

∀ (X_1 : CategoryTheory.Limits.WalkingMulticospan (S.index (P.comp F)).fstTo (S.index (P.comp F)).sndTo),
  (CategoryTheory.GrothendieckTopology.Cover.multicospanComp F P S).inv.app X_1 =
    (match X_1 with
      | CategoryTheory.Limits.WalkingMulticospan.left a => CategoryTheory.Iso.refl (F.obj (P.obj (Opposite.op a.Y)))
      | CategoryTheory.Limits.WalkingMulticospan.right b =>
        CategoryTheory.Iso.refl (F.obj (P.obj (Opposite.op b.r.Z)))).inv


@[to_additive]
theorem mul_mul_mul_comm (a b c d : G) : a * b * (c * d) = a * c * (b * d)

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


@[to_additive]
theorem image_mul : m '' (s * t) = m '' s * m '' t

{F : Type u_1}
{α : Type u_2}
{β : Type u_3}
[Add α]
[Add β]
[FunLike F α β]
[AddHomClass F α β]
(m : F)
{s t : Set α}


@[simp]
theorem iSup_apply {α : Type*} {β : α → Type*} {ι : Sort*} [∀ i, SupSet (β i)] {f : ι → ∀ a, β a}
    {a : α} : (⨆ i, f i) a = ⨆ i, f i a

{α : Type u_9}
{β : α → Type u_10}
{ι : Sort u_11}
[(i : α) → SupSet (β i)]
{f : ι → (a : α) → β a}
{a : α}


theorem Complex.cos_eq_tsum (z : ℂ) :
    Complex.cos z = ∑' n : ℕ, (-1) ^ n * z ^ (2 * n) / ↑(2 * n)!


theorem cramerMap_is_linear (i : n) : IsLinearMap α fun b => cramerMap A b i

{n : Type v}
{α : Type w}
[DecidableEq n]
[Fintype n]
[CommRing α]
(A : Matrix n n α)
(i : n)


theorem counitNat_C (n : ℕ) : counitNat A (C n) = n

(MvPolynomial.counitNat A) (MvPolynomial.C n) = ↑n


/--
The equivalence `WalkingParallelPair ⥤ WalkingParallelPairᵒᵖ` sending left to left and right to
right.
-/
@[simps functor inverse]
def walkingParallelPairOpEquiv : WalkingParallelPair ≌ WalkingParallelPairᵒᵖ


lemma centroid_eq_centralizer_mulLeftRight :
    RingHom.rangeS (toEndRingHom α) = Subsemiring.centralizer (Set.range L ∪ Set.range R)

{α : Type u_5}
[NonUnitalNonAssocSemiring α]

(CentroidHom.toEndRingHom α).rangeS =
  Subsemiring.centralizer (Set.range ⇑AddMonoid.End.mulLeft ∪ Set.range ⇑AddMonoid.End.mulRight)


@[simp]
theorem darts_cons {u v w : V} (h : G.Adj u v) (p : G.Walk v w) :
    (cons h p).darts = ⟨(u, v), h⟩ :: p.darts

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

(SimpleGraph.Walk.cons h p).darts = { toProd := (u, v), adj := h } :: p.darts


theorem bit_ne_zero (b) {n} (h : n ≠ 0) : bit b n ≠ 0


theorem subset_sSup_emptyset [Inhabited s] :
    sSup (∅ : Set s) = default

{α : Type u_2}
(s : Set α)
[Preorder α]
[SupSet α]
[Inhabited ↑s]


@[simp] theorem principal_univ : 𝓟 (univ : Set α) = ⊤


theorem measurable_findGreatest' {p : α → ℕ → Prop} [∀ x, DecidablePred (p x)] {N : ℕ}
    (hN : ∀ k ≤ N, MeasurableSet { x | Nat.findGreatest (p x) N = k }) :
    Measurable fun x => Nat.findGreatest (p x) N

(hN : ∀ k ≤ N, MeasurableSet {x | Nat.findGreatest (p x) N = k})


/-- Given an orthogonal basis with respect to a bilinear map, the bilinear map is nondegenerate
if the basis has no elements which are self-orthogonal. -/
theorem IsOrthoᵢ.nondegenerate_of_not_isOrtho_basis_self [NoZeroSMulDivisors R M₁]
    {B : M →ₗ[R] M →ₗ[R] M₁} (v : Basis n R M) (hO : B.IsOrthoᵢ v)
    (h : ∀ i, ¬B.IsOrtho (v i) (v i)) : B.Nondegenerate

{R : Type u_1}
{M : Type u_5}
{M₁ : Type u_6}
{n : Type u_19}
[CommRing R]
[AddCommGroup M]
[Module R M]
[AddCommGroup M₁]
[Module R M₁]
[NoZeroSMulDivisors R M₁]
{B : M →ₗ[R] M →ₗ[R] M₁}
(v : Basis n R M)
(hO : B.IsOrthoᵢ ⇑v)
(h : ∀ (i : n), ¬B.IsOrtho (v i) (v i))


@[simp]
theorem fst_comp_inr [Zero R] : fst ∘ (inr : M → tsze R M) = 0

TrivSqZeroExt.fst ∘ TrivSqZeroExt.inr = 0


@[to_additive]
theorem iUnion_smul (s : ι → Set α) (t : Set β) : (⋃ i, s i) • t = ⋃ i, s i • t

{α : Type u_2}
{β : Type u_3}
{ι : Sort u_5}
[VAdd α β]
(s : ι → Set α)
(t : Set β)


@[simps!]
instance : MonoidalCategoryStruct (Dial C)

(CategoryTheory.MonoidalCategory.leftUnitor X).inv.f =
  CategoryTheory.Limits.prod.lift (CategoryTheory.Limits.terminal.from X.src) (CategoryTheory.CategoryStruct.id X.src)


theorem integrable_rpow_neg_one_add_norm_sq {r : ℝ} (hnr : (finrank ℝ E : ℝ) < r) :
    Integrable (fun x ↦ ((1 : ℝ) + ‖x‖ ^ 2) ^ (-r / 2)) μ

(hnr : ↑(FiniteDimensional.finrank ℝ E) < r)

MeasureTheory.Integrable (fun x => (1 + ‖x‖ ^ 2) ^ (-r / 2)) μ


theorem map' {f : A →ₐ[R] A'} (hf_inj : Injective f) : AlgebraicIndependent R (f ∘ x)

{ι : Type u_1}
{R : Type u_3}
{A : Type u_5}
{A' : Type u_6}
{x : ι → A}
[CommRing R]
[CommRing A]
[CommRing A']
[Algebra R A]
[Algebra R A']
(hx : AlgebraicIndependent R x)
{f : A →ₐ[R] A'}
(hf_inj : Function.Injective ⇑f)


nonrec theorem IsLocalMax.comp_antitone (hf : IsLocalMax f a) {g : β → γ} (hg : Antitone g) :
    IsLocalMin (g ∘ f) a

{α : Type u}
{β : Type v}
{γ : Type w}
[TopologicalSpace α]
[Preorder β]
[Preorder γ]
{f : α → β}
{a : α}
(hf : IsLocalMax f a)
{g : β → γ}
(hg : Antitone g)


/-- Alias for `Equiv.image_eq_preimage` -/
theorem _root_.Set.preimage_equiv_eq_image_symm {α β} (S : Set α) (f : β ≃ α) :
    f ⁻¹' S = f.symm '' S

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


/-- Expansion of `log (1 + a⁻¹)` as a series in powers of `1 / (2 * a + 1)`. -/
theorem hasSum_log_one_add_inv {a : ℝ} (h : 0 < a) :
    HasSum (fun k : ℕ => (2 : ℝ) * (1 / (2 * k + 1)) * (1 / (2 * a + 1)) ^ (2 * k + 1))
      (log (1 + a⁻¹))


theorem lift_sepDegree_bot' : Cardinal.lift.{v} (sepDegree F (⊥ : IntermediateField E K)) =
    Cardinal.lift.{w} (sepDegree F E)

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

Cardinal.lift.{v, w} (Field.sepDegree F ↥⊥) = Cardinal.lift.{w, v} (Field.sepDegree F E)


@[to_additive (attr := simp)]
lemma insertNth_div_same [∀ j, Group (α j)] (i : Fin (n + 1)) (x y : α i)
    (p : ∀ j, α (i.succAbove j)) : i.insertNth x p / i.insertNth y p = Pi.mulSingle i (x / y)

{n : ℕ}
{α : Fin (n + 1) → Type u_1}
[(j : Fin (n + 1)) → AddGroup (α j)]
(i : Fin (n + 1))
(x y : α i)
(p : (j : Fin n) → α (i.succAbove j))

i.insertNth x p - i.insertNth y p = Pi.single i (x - y)


/-- See also `nonempty_encodable`, `nonempty_denumerable`. -/
theorem nonempty_fintype (α : Type*) [Finite α] : Nonempty (Fintype α)


@[to_additive (attr := simp)]
theorem preimage_mul_right_one : preimage 1 (· * b) (mul_left_injective _).injOn = {b⁻¹}

Finset.preimage 0 (fun x => x + b) ⋯ = {-b}


protected lemma one_mul (x : ⨂[R] i, A i) : mul (tprod R 1) x = x

[∀ (i : ι), SMulCommClass R (A i) (A i)]

[∀ (i : ι), IsScalarTower R (A i) (A i)]

(PiTensorProduct.mul ((PiTensorProduct.tprod R) 1)) x = x


theorem indexOf_eq_length {a : α} {l : List α} : indexOf a l = length l ↔ a ∉ l

{α : Type u}
[DecidableEq α]
{a : α}
{l : List α}


/-- The increment partition has a prescribed (very big) size in terms of the original partition. -/
theorem card_increment (hPα : P.parts.card * 16 ^ P.parts.card ≤ card α) (hPG : ¬P.IsUniform G ε) :
    (increment hP G ε).parts.card = stepBound P.parts.card

(hPα : P.parts.card * 16 ^ P.parts.card ≤ Fintype.card α)

(SzemerediRegularity.increment hP G ε).parts.card = SzemerediRegularity.stepBound P.parts.card


theorem mono_iff_injective {X Y : TopCat.{u}} (f : X ⟶ Y) : Mono f ↔ Function.Injective f

CategoryTheory.Mono f ↔ Function.Injective ⇑f


@[to_additive]
theorem conj : ∀ x₀, ∀ {U}, U ∈ B → ∃ V ∈ B, V ⊆ (fun x ↦ x₀ * x * x₀⁻¹) ⁻¹' U

{G : Type u}
[Group G]
{B : GroupFilterBasis G}
(x₀ : G)
{U : Set G}

U ∈ B → ∃ V ∈ B, V ⊆ (fun x => x₀ * x * x₀⁻¹) ⁻¹' U


@[simp]
theorem preimage_coe_Icc : (some : α → WithTop α) ⁻¹' Icc a b = Icc a b

WithTop.some ⁻¹' Set.Icc ↑a ↑b = Set.Icc a b


@[simp]
theorem coeff_divMonomial (s : σ →₀ ℕ) (x : MvPolynomial σ R) (s' : σ →₀ ℕ) :
    coeff s' (x /ᵐᵒⁿᵒᵐⁱᵃˡ s) = coeff (s + s') x

{σ : Type u_1}
{R : Type u_2}
[CommSemiring R]
(s : σ →₀ ℕ)
(x : MvPolynomial σ R)
(s' : σ →₀ ℕ)

MvPolynomial.coeff s' (x.divMonomial s) = MvPolynomial.coeff (s + s') x


@[to_additive (attr := simp)]
lemma comp_div (f : G →* H) (g h : M →* G) : f.comp (g / h) = f.comp g / f.comp h

{M : Type u_3}
{G : Type u_6}
{H : Type u_7}
[MulOneClass M]
[CommGroup G]
[CommGroup H]
(f : G →* H)
(g h : M →* G)


protected theorem injective (f : F) : Function.Injective f

{F : Sort u_1}
{α : Sort u_2}
{β : Sort u_3}
[FunLike F α β]
[i : EmbeddingLike F α β]
(f : F)


@[field_simps]
theorem divp_add (a b : α) (u : αˣ) : a /ₚ u + b = (a + b * u) /ₚ u

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


@[simp] theorem _root_.List.length_toAssocList (l : List (α × β)) :
    l.toAssocList.length = l.length

{α : Type u_1}
{β : Type u_2}
(l : List (α × β))


theorem isSeparator_sigma_of_isSeparator {β : Type w} (f : β → C) [HasCoproduct f] (b : β)
    (hb : IsSeparator (f b)) : IsSeparator (∐ f)


/-- The prelax functor from `Cat` to `Cat` defined with `WithTerminal`. -/
@[simps]
def prelaxfunctor : PrelaxFunctor Cat Cat

∀ {X Y : CategoryTheory.Cat} (F : CategoryTheory.Functor ↑X ↑Y),
  CategoryTheory.WithTerminal.prelaxfunctor.map F = CategoryTheory.WithTerminal.map F


theorem Valid'.balanceL_aux {l} {x : α} {r o₁ o₂} (hl : Valid' o₁ l x) (hr : Valid' x r o₂)
    (H₁ : size l = 0 → size r ≤ 1) (H₂ : 1 ≤ size l → 1 ≤ size r → size r ≤ delta * size l)
    (H₃ : 2 * @size α l ≤ 9 * size r + 5 ∨ size l ≤ 3) : Valid' o₁ (@balanceL α l x r) o₂

(H₂ : 1 ≤ l.size → 1 ≤ r.size → r.size ≤ Ordnode.delta * l.size)

(H₃ : 2 * l.size ≤ 9 * r.size + 5 ∨ l.size ≤ 3)


@[simp] theorem toMultiset_zero : toMultiset (0 : Sym α 0) = 0


/-- The convolution is continuous if one function is locally integrable and the other has compact
support and is continuous. -/
theorem _root_.HasCompactSupport.continuous_convolution_right (hcg : HasCompactSupport g)
    (hf : LocallyIntegrable f μ) (hg : Continuous g) : Continuous (f ⋆[L, μ] g)

(hf : MeasureTheory.LocallyIntegrable f μ)

Continuous (MeasureTheory.convolution f g L μ)


theorem isNat_minFac_2 : {a a' : ℕ} → IsNat a a' → a' % 2 = 0 → IsNat a.minFac 2

Mathlib.Meta.NormNum.IsNat a a' → a' % 2 = 0 → Mathlib.Meta.NormNum.IsNat a.minFac 2


@[to_additive]
lemma iIndepFun.indepFun_mul_mul (hf_indep : iIndepFun (fun _ ↦ m) f μ)
    (hf_meas : ∀ i, Measurable (f i))
    (i j k l : ι) (hik : i ≠ k) (hil : i ≠ l) (hjk : j ≠ k) (hjl : j ≠ l) :
    IndepFun (f i * f j) (f k * f l) μ

{f : ι → Ω → β}

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

ProbabilityTheory.IndepFun (f i + f j) (f k + f l) μ


theorem Ne.intro (h : a = b → False) : a ≠ b

{α : Sort u}
{a b : α}
(h : a = b → False)


theorem HasSum.matrix_blockDiagonal [DecidableEq p] {f : X → p → Matrix m n R}
    {a : p → Matrix m n R} (hf : HasSum f a) :
    HasSum (fun x => blockDiagonal (f x)) (blockDiagonal a)

{X : Type u_1}
{m : Type u_4}
{n : Type u_5}
{p : Type u_6}
{R : Type u_8}
[AddCommMonoid R]
[TopologicalSpace R]
[DecidableEq p]
{f : X → p → Matrix m n R}
{a : p → Matrix m n R}
(hf : HasSum f a)

HasSum (fun x => Matrix.blockDiagonal (f x)) (Matrix.blockDiagonal a)


lemma rnDeriv_add_singularPart (μ ν : Measure α) [HaveLebesgueDecomposition μ ν] :
    ν.withDensity (μ.rnDeriv ν) + μ.singularPart ν = μ

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


@[to_additive (attr := simp)]
theorem prod_image [DecidableEq α] {s : Finset γ} {g : γ → α} :
    (∀ x ∈ s, ∀ y ∈ s, g x = g y → x = y) → ∏ x ∈ s.image g, f x = ∏ x ∈ s, f (g x)

{α : Type u_3}
{β : Type u_4}
{γ : Type u_5}
{f : α → β}
[AddCommMonoid β]
[DecidableEq α]
{s : Finset γ}
{g : γ → α}

(∀ x ∈ s, ∀ y ∈ s, g x = g y → x = y) → ∑ x ∈ Finset.image g s, f x = ∑ x ∈ s, f (g x)


theorem nadd_left_cancel_iff : ∀ {a b c}, a ♯ b = a ♯ c ↔ b = c


/-- The minimal distance to a set (as `ℝ≥0`) is Lipschitz in point with constant 1 -/
theorem lipschitz_infNndist_pt (s : Set α) : LipschitzWith 1 fun x => infNndist x s

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

LipschitzWith 1 fun x => Metric.infNndist x s


theorem PiToModule.fromEnd_injective (hb : Submodule.span R (Set.range b) = ⊤) :
    Function.Injective (PiToModule.fromEnd R b)

Function.Injective ⇑(PiToModule.fromEnd R b)


@[to_additive (attr := simp)]
lemma prod_attach_univ [Fintype ι] (f : {i // i ∈ @univ ι _} → α) :
    ∏ i ∈ univ.attach, f i = ∏ i, f ⟨i, mem_univ _⟩

{ι : Type u_1}
{α : Type u_3}
[AddCommMonoid α]
[Fintype ι]
(f : { i // i ∈ Finset.univ } → α)

∑ i ∈ Finset.univ.attach, f i = ∑ i : ι, f ⟨i, ⋯⟩


@[simp]
theorem piecewise_eq_of_not_mem {i : α} (hi : i ∉ s) : s.piecewise f g i = g i

{α : Type u_1}
{δ : α → Sort u_6}
(s : Set α)
(f g : (i : α) → δ i)
[(j : α) → Decidable (j ∈ s)]
{i : α}
(hi : i ∉ s)


/-- Pull a subgroup back to an opposite subgroup along `MulOpposite.unop`-/
@[to_additive (attr := simps)
"Pull an additive subgroup back to an opposite additive subgroup along `AddOpposite.unop`"]
protected def op (H : Subgroup G) : Subgroup Gᵐᵒᵖ

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


theorem of_heq_true {a : Prop} (h : HEq a True) : a


@[simp, mfld_simps]
theorem tangentMap_id : tangentMap I I (id : M → M) = id

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


@[simp]
theorem cons_inj_right (a : α) : ∀ {s t : Multiset α}, a ::ₘ s = a ::ₘ t ↔ s = t

{α : Type u_1}
(a : α)
{s t : Multiset α}


@[simp]
theorem compQuasiMeasurePreserving_toGerm [MeasurableSpace β] {f : α → β} {ν}
    (g : β →ₘ[ν] γ) (hf : Measure.QuasiMeasurePreserving f μ ν) :
    (g.compQuasiMeasurePreserving f hf).toGerm = g.toGerm.compTendsto f hf.tendsto_ae

(hf : MeasureTheory.Measure.QuasiMeasurePreserving f μ ν)

(g.compQuasiMeasurePreserving f hf).toGerm = g.toGerm.compTendsto f ⋯


theorem splitAtPred_false {α} (L : List α) : splitAtPred (fun _ => false) L = (L, none, [])

Turing.PartrecToTM2.splitAtPred (fun x => false) L = (L, none, [])


/-- An element `a` divides the difference `b - a` if and only if `a` divides `b`. -/
@[simp]
theorem dvd_sub_self_right : a ∣ b - a ↔ a ∣ b


@[to_additive]
theorem eq_bot_iff_forall : S = ⊥ ↔ ∀ x ∈ S, x = (1 : M)

{M : Type u_1}
[AddZeroClass M]
(S : AddSubmonoid M)


@[simp]
theorem map_sub [DecidableEq ι] (m : ∀ i, M₁ i) (i : ι) (x y : M₁ i) :
    f (update m i (x - y)) = f (update m i x) - f (update m i y)

{R : Type u}
{ι : Type v}
{M₁ : ι → Type w₁}
{M₂ : Type w₂}
[Ring R]
[(i : ι) → AddCommGroup (M₁ i)]
[AddCommGroup M₂]
[(i : ι) → Module R (M₁ i)]
[Module R M₂]
[(i : ι) → TopologicalSpace (M₁ i)]
[TopologicalSpace M₂]
(f : ContinuousMultilinearMap R M₁ M₂)
[DecidableEq ι]
(m : (i : ι) → M₁ i)
(i : ι)
(x y : M₁ i)

f (Function.update m i (x - y)) = f (Function.update m i x) - f (Function.update m i y)


@[simp]
theorem rightInv_coeff_zero (p : FormalMultilinearSeries 𝕜 E F) (i : E ≃L[𝕜] F) :
    p.rightInv i 0 = 0

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
(p : FormalMultilinearSeries 𝕜 E F)
(i : E ≃L[𝕜] F)


protected theorem mul_assoc (L : Matrix l m α) (M : Matrix m n α) (N : Matrix n o α) :
    L * M * N = L * (M * N)

{l : Type u_1}
{m : Type u_2}
{n : Type u_3}
{o : Type u_4}
{α : Type v}
[NonUnitalSemiring α]
[Fintype m]
[Fintype n]
(L : Matrix l m α)
(M : Matrix m n α)
(N : Matrix n o α)


theorem sign_of_cycleType (f : Perm α) :
    sign f = (-1 : ℤˣ) ^ (f.cycleType.sum + Multiset.card f.cycleType)

{α : Type u_1}
[Fintype α]
[DecidableEq α]
(f : Equiv.Perm α)

Equiv.Perm.sign f = (-1) ^ (f.cycleType.sum + Multiset.card f.cycleType)


@[to_additive (attr := simp)]
theorem toTopologicalSpace_top : (⊤ : GroupTopology α).toTopologicalSpace = ⊤


@[to_additive (attr := simp, norm_cast)]
theorem coe_mul [Mul M] (f g : α → M) : ↑(f * g) = (f * g : Germ l M)

{α : Type u_1}
{l : Filter α}
{M : Type u_5}
[Mul M]
(f g : α → M)


@[bv_toNat] theorem toNat_eq (x y : BitVec n) : x = y ↔ x.toNat = y.toNat


/-- A property of ring homs is local if it is preserved by localizations and compositions, and for
each `{ r }` that spans `S`, we have `P (R →+* S) ↔ ∀ r, P (R →+* Sᵣ)`. -/
structure RingHom.PropertyIsLocal : Prop where
  LocalizationPreserves : RingHom.LocalizationPreserves @P
  OfLocalizationSpanTarget : RingHom.OfLocalizationSpanTarget @P
  StableUnderComposition : RingHom.StableUnderComposition @P
  HoldsForLocalizationAway : RingHom.HoldsForLocalizationAway @P

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


@[to_additive]
theorem prod_list_count_of_subset [DecidableEq α] [CommMonoid α] (m : List α) (s : Finset α)
    (hs : m.toFinset ⊆ s) : m.prod = ∏ i ∈ s, i ^ m.count i

{α : Type u_3}
[DecidableEq α]
[CommMonoid α]
(m : List α)
(s : Finset α)
(hs : m.toFinset ⊆ s)


theorem toZ_le_iff (i j : ι) : toZ i0 i ≤ toZ i0 j ↔ i ≤ j

{ι : Type u_1}
[LinearOrder ι]
[SuccOrder ι]
[IsSuccArchimedean ι]
[PredOrder ι]
{i0 : ι}
(i j : ι)


theorem Set.image_sSup {f : α → β} (s : Set (Set α)) : f '' sSup s = sSup (image f '' s)

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


@[simp] theorem replicate_zero : replicate 0 a = []

∀ {α : Type u_1} {a : α}, List.replicate 0 a = List.nil


@[to_additive]
theorem is_mul_left_invariant_innerContent [Group G] [TopologicalGroup G]
    (h : ∀ (g : G) {K : Compacts G}, μ (K.map _ <| continuous_mul_left g) = μ K) (g : G)
    (U : Opens G) :
    μ.innerContent (Opens.comap (Homeomorph.mulLeft g).toContinuousMap U) = μ.innerContent U

(h :
  ∀ (g : G) {K : TopologicalSpace.Compacts G},
    (fun s => ↑(μ.toFun s)) (TopologicalSpace.Compacts.map (fun b => g * b) ⋯ K) = (fun s => ↑(μ.toFun s)) K)

μ.innerContent ((TopologicalSpace.Opens.comap (Homeomorph.mulLeft g).toContinuousMap) U) = μ.innerContent U


@[to_additive]
nonrec theorem SmoothWithinAt.inv {f : M → G} {s : Set M} {x₀ : M}
    (hf : SmoothWithinAt I' I f s x₀) : SmoothWithinAt I' I (fun x => (f x)⁻¹) s x₀

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{H : Type u_2}
[TopologicalSpace H]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{I : ModelWithCorners 𝕜 E H}
{G : Type u_5}
[TopologicalSpace G]
[ChartedSpace H G]
[AddGroup G]
[LieAddGroup I G]
{E' : Type u_6}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_7}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M : Type u_8}
[TopologicalSpace M]
[ChartedSpace H' M]
{f : M → G}
{s : Set M}
{x₀ : M}
(hf : SmoothWithinAt I' I f s x₀)

SmoothWithinAt I' I (fun x => -f x) s x₀


@[simp, mfld_simps]
theorem tangentBundleModelSpaceHomeomorph_coe :
    (tangentBundleModelSpaceHomeomorph H I : TangentBundle I H → ModelProd H E) =
      TotalSpace.toProd H E

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

⇑(tangentBundleModelSpaceHomeomorph H I) = ⇑(Bundle.TotalSpace.toProd H E)


theorem _root_.Polynomial.algebraMap_hahnSeries_injective :
    Function.Injective (algebraMap R[X] (HahnSeries Γ R))

(Γ : Type u_1)
{R : Type u_2}
[CommSemiring R]
[StrictOrderedSemiring Γ]

Function.Injective ⇑(algebraMap R[X] (HahnSeries Γ R))


/-- Given `F : C ⥤ D` and `X : D`, to upgrade a functor `G : E ⥤ C` to a functor
    `E ⥤ CostructuredArrow F X`, it suffices to provide maps `F.obj (G.obj Y) ⟶ X` for all `Y`
    making the obvious triangles involving all `F.map (G.map g)` commute.

    This is of course the same as providing a cocone over `F ⋙ G` with cocone point `X`, see
    `Functor.toCostructuredArrowIsoToCostructuredArrow`. -/
@[simps]
def toCostructuredArrow (G : E ⥤ C) (F : C ⥤ D) (X : D) (f : (Y : E) → F.obj (G.obj Y) ⟶ X)
    (h : ∀ {Y Z : E} (g : Y ⟶ Z), F.map (G.map g) ≫ f Z = f Y) : E ⥤ CostructuredArrow F X

(h : ∀ {Y Z : E} (g : Y ⟶ Z), CategoryTheory.CategoryStruct.comp (F.map (G.map g)) (f Z) = f Y)

∀ {X_1 Y : E} (g : X_1 ⟶ Y), (G.toCostructuredArrow F X f h).map g = CategoryTheory.CostructuredArrow.homMk (G.map g) ⋯


/-- The shift functor by `n : ℤ` on `CochainComplex C ℤ` which sends a cochain
complex `K` to the complex which is `K.X (i + n)` in degree `i`, and which
multiplies the differentials by `(-1)^n`. -/
@[simps]
def shiftFunctor (n : ℤ) : CochainComplex C ℤ ⥤ CochainComplex C ℤ

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

((CochainComplex.shiftFunctor C n).obj K).X i = K.X (i + n)


theorem isCompact_diagonal [CompactSpace X] : IsCompact (diagonal X)

{X : Type u}
[TopologicalSpace X]
[CompactSpace X]


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

{G : Type w}
[TopologicalSpace G]
[Group G]
[TopologicalGroup G]
{t : Set G}

tᶜ * closure {1} = tᶜ ↔ t * closure {1} = t


/-- `Part.map` as a continuous function. -/
@[simps! apply] -- Porting note: removed `(config := { rhsMd := reducible })`
noncomputable def map {β γ : Type v} (f : β → γ) (g : α →𝒄 Part β) : α →𝒄 Part γ

{α : Type u}
[OmegaCompletePartialOrder α]
{β γ : Type v}
(f : β → γ)
(g : α →𝒄 Part β)
(x : α)

(OmegaCompletePartialOrder.ContinuousHom.map f g) x = Part.map f (g x)


lemma monotone_div_right_of_nonneg {b : EReal} (h : 0 ≤ b) : Monotone fun a ↦ a / b


/-- If a set of functions is equicontinuous, the same is true for its closure in *any*
topology for which evaluation at any point is continuous. Since this will be applied to
`DFunLike` types, we state it for any topological space whith a map to `X → α` satisfying the right
continuity conditions. See also `Set.Equicontinuous.closure` for a more familiar statement. -/
theorem Equicontinuous.closure' {A : Set Y} {u : Y → X → α}
    (hA : Equicontinuous (u ∘ (↑) : A → X → α)) (hu : Continuous u) :
    Equicontinuous (u ∘ (↑) : closure A → X → α)

{X : Type u_3}
{Y : Type u_5}
{α : Type u_7}
[tX : TopologicalSpace X]
[tY : TopologicalSpace Y]
[uα : UniformSpace α]
{A : Set Y}
{u : Y → X → α}
(hA : Equicontinuous (u ∘ Subtype.val))
(hu : Continuous u)


lemma bodd_add_div2 : ∀ n, cond (bodd n) 1 0 + 2 * div2 n = n

(bif n.bodd then 1 else 0) + 2 * n.div2 = n


/-- The inner product in `L2` of the indicator of a set `indicatorConstLp 2 hs hμs c` and `f` is
equal to the integral of the inner product over `s`: `∫ x in s, ⟪c, f x⟫ ∂μ`. -/
theorem inner_indicatorConstLp_eq_setIntegral_inner (f : Lp E 2 μ) (hs : MeasurableSet s) (c : E)
    (hμs : μ s ≠ ∞) : (⟪indicatorConstLp 2 hs hμs c, f⟫ : 𝕜) = ∫ x in s, ⟪c, f x⟫ ∂μ

{α : Type u_1}
{E : Type u_2}
(𝕜 : Type u_4)
[RCLike 𝕜]
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{s : Set α}
(f : ↥(MeasureTheory.Lp E 2 μ))
(hs : MeasurableSet s)
(c : E)
(hμs : μ s ≠ ⊤)

⟪MeasureTheory.indicatorConstLp 2 hs hμs c, f⟫_𝕜 = ∫ (x : α) in s, ⟪c, ↑↑f x⟫_𝕜 ∂μ


/-- `cyclotomic n R` comes from `cyclotomic n ℤ`. -/
theorem map_cyclotomic_int (n : ℕ) (R : Type*) [Ring R] :
    map (Int.castRingHom R) (cyclotomic n ℤ) = cyclotomic n R

Polynomial.map (Int.castRingHom R) (Polynomial.cyclotomic n ℤ) = Polynomial.cyclotomic n R


/-- A strictly monotone function with a right inverse is an order isomorphism. -/
@[simps (config := .asFn)]
def orderIsoOfRightInverse (g : β → α) (hg : Function.RightInverse g f) : α ≃o β

{α : Type u_2}
{β : Type u_3}
[LinearOrder α]
[Preorder β]
(f : α → β)
(h_mono : StrictMono f)
(g : β → α)
(hg : Function.RightInverse g f)

⇑(StrictMono.orderIsoOfRightInverse f h_mono g hg) = f


theorem Separable.map {p : R[X]} (h : p.Separable) {f : R →+* S} : (p.map f).Separable

{R : Type u}
[CommSemiring R]
{S : Type v}
[CommSemiring S]
{p : R[X]}
(h : p.Separable)
{f : R →+* S}


@[to_additive]
theorem prod_mul_distrib : ∏ x ∈ s, f x * g x = (∏ x ∈ s, f x) * ∏ x ∈ s, g x

{α : Type u_3}
{β : Type u_4}
{s : Finset α}
{f g : α → β}
[AddCommMonoid β]

∑ x ∈ s, (f x + g x) = ∑ x ∈ s, f x + ∑ x ∈ s, g x


theorem exists_const (U) (s : (structureSheaf R).1.obj (op U)) (x : PrimeSpectrum.Top R)
    (hx : x ∈ U) :
    ∃ (V : Opens (PrimeSpectrum.Top R)) (_ : x ∈ V) (i : V ⟶ U) (f g : R) (hg : _),
      const R f g V hg = (structureSheaf R).1.map i.op s

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

(s : ↑((AlgebraicGeometry.Spec.structureSheaf R).val.obj (Opposite.op U)))

(x : ↑(AlgebraicGeometry.PrimeSpectrum.Top R))

∃ V,
  ∃ (_ : x ∈ V),
    ∃ i f g,
      ∃ (hg : ∀ x ∈ V, g ∈ x.asIdeal.primeCompl),
        AlgebraicGeometry.StructureSheaf.const R f g V hg = ((AlgebraicGeometry.Spec.structureSheaf R).val.map i.op) s


@[to_additive]
theorem min_mul_distrib (a b c : α) : min a (b * c) = min a (min a b * min a c)

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


@[simp]
theorem conjTranspose_intCast_smul [Ring R] [AddCommGroup α] [StarAddMonoid α] [Module R α] (c : ℤ)
    (M : Matrix m n α) : ((c : R) • M)ᴴ = (c : R) • Mᴴ

{m : Type u_2}
{n : Type u_3}
{R : Type u_7}
{α : Type v}
[Ring R]
[AddCommGroup α]
[StarAddMonoid α]
[Module R α]
(c : ℤ)
(M : Matrix m n α)


@[simp]
theorem foldlm_map (g : β → γ) (f : α → γ → m α) (a : α) (l : t β) :
    foldlm f a (g <$> l) = foldlm (fun x y => f x (g y)) a l

{α β γ : Type u}
{t : Type u → Type u}
[Traversable t]
[LawfulTraversable t]
{m : Type u → Type u}
[Monad m]
[LawfulMonad m]
(g : β → γ)
(f : α → γ → m α)
(a : α)
(l : t β)

Traversable.foldlm f a (g <$> l) = Traversable.foldlm (fun x y => f x (g y)) a l


@[to_additive (attr := simp, nolint simpNF)]
theorem mulEquivOfMulEquiv_eq {k : LocalizationMap T Q} {j : M ≃* P} (H : S.map j.toMonoidHom = T)
    (x) :
    f.mulEquivOfMulEquiv k H (f.toMap x) = k.toMap (j x)

{M : Type u_1}
[CommMonoid M]
{S : Submonoid M}
{N : Type u_2}
[CommMonoid N]
{P : Type u_3}
[CommMonoid P]
(f : S.LocalizationMap N)
{T : Submonoid P}
{Q : Type u_4}
[CommMonoid Q]
{k : T.LocalizationMap Q}
{j : M ≃* P}
(H : Submonoid.map j.toMonoidHom S = T)
(x : M)

(f.mulEquivOfMulEquiv k H) (f.toMap x) = k.toMap (j x)


/-- Pointwise minimum of two monotone functions is a monotone function. -/
protected theorem min [Preorder α] [LinearOrder β] {f g : α → β} (hf : Antitone f)
    (hg : Antitone g) :
    Antitone fun x => min (f x) (g x)

{α : Type u}
{β : Type v}
[Preorder α]
[LinearOrder β]
{f g : α → β}
(hf : Antitone f)
(hg : Antitone g)


irreducible_def preLift {r : R → R → Prop} {f : R →+* T} (h : ∀ ⦃x y⦄, r x y → f x = f y) :
  RingQuot r →+* T

{R : Type u_1}
[Semiring R]
{T : Type u_2}
[Semiring T]
{r : R → R → Prop}
{f : R →+* T}
(h : ∀ ⦃x y : R⦄, r x y → f x = f y)

RingQuot.preLift h =
  { toFun := fun x => Quot.lift ⇑f ⋯ x.toQuot, map_one' := ⋯, map_mul' := ⋯, map_zero' := ⋯, map_add' := ⋯ }


/-- If `α` is an infinite type, then the cardinality of `α ⊕ β` is the maximum
of the cardinalities of `α` and `β`. -/
theorem add_eq_max {a b : Cardinal} (ha : ℵ₀ ≤ a) : a + b = max a b


@[simp]
theorem ofFinset_apply (a : α) : ofFinset f s h h' a = f a

{α : Type u_1}
{f : α → ENNReal}
{s : Finset α}
(h : ∑ a ∈ s, f a = 1)
(h' : ∀ a ∉ s, f a = 0)
(a : α)


theorem supported_strictMono [Nontrivial R] :
    StrictMono (supported R : Set σ → Subalgebra R (MvPolynomial σ R))

{σ : Type u_1}
{R : Type u}
[CommSemiring R]
[Nontrivial R]


@[simp, mfld_simps]
nonrec theorem range_comp {α} (h : M ≃ₘ^n⟮I, J⟯ N) (f : α → M) :
    range (h ∘ f) = h.symm ⁻¹' range f

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_4}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{H : Type u_5}
[TopologicalSpace H]
{G : Type u_7}
[TopologicalSpace G]
{I : ModelWithCorners 𝕜 E H}
{J : ModelWithCorners 𝕜 F G}
{M : Type u_9}
[TopologicalSpace M]
[ChartedSpace H M]
{N : Type u_11}
[TopologicalSpace N]
[ChartedSpace G N]
{n : ℕ∞}
{α : Sort u_13}
(h : M ≃ₘ^n⟮I, J⟯ N)
(f : α → M)

Set.range (⇑h ∘ f) = ⇑h.symm ⁻¹' Set.range f


{R : Type u_1}
[CommSemiring R]
{a a' b b' c : R}

a = a' → b = b' → a' + b' = c → a + b = c


lemma exists_linearIndependent_of_le_rank {n : ℕ} (hn : n ≤ Module.rank R M) :
    ∃ f : Fin n → M, LinearIndependent R f

{R : Type u}
{M : Type v}
[Ring R]
[AddCommGroup M]
[Module R M]
{n : ℕ}
(hn : ↑n ≤ Module.rank R M)


/--
If `B` is a strict bicategory and `I` is a (1-)category, any functor (of 1-categories) `I ⥤ B` can
be promoted to an oplax functor from `LocallyDiscrete I` to `B`.
-/
@[simps]
def Functor.toOplaxFunctor (F : I ⥤ B) : OplaxFunctor (LocallyDiscrete I) B

{I : Type u₁}
[CategoryTheory.Category.{v₁, u₁} I]
{B : Type u₂}
[CategoryTheory.Bicategory B]
[CategoryTheory.Bicategory.Strict B]
(F : CategoryTheory.Functor I B)

∀ {a b c : CategoryTheory.LocallyDiscrete I} (f : a ⟶ b) (g : b ⟶ c),
  F.toOplaxFunctor.mapComp f g = CategoryTheory.eqToHom ⋯


@[to_additive (attr := simp)]
theorem tprod_ite_eq (b : β) [DecidablePred (· = b)] (a : α) :
    ∏' b', (if b' = b then a else 1) = a

{α : Type u_1}
{β : Type u_2}
[AddCommMonoid α]
[TopologicalSpace α]
(b : β)
[DecidablePred fun x => x = b]
(a : α)

(∑' (b' : β), if b' = b then a else 0) = a


@[simp] lemma shatterer_idem : 𝒜.shatterer.shatterer = 𝒜.shatterer

{α : Type u_1}
[DecidableEq α]
{𝒜 : Finset (Finset α)}


/-- Neighborhoods in the quotient are precisely the map of neighborhoods in the prequotient. -/
@[to_additive
  "Neighborhoods in the quotient are precisely the map of neighborhoods in the prequotient."]
theorem QuotientGroup.nhds_eq (x : G) : 𝓝 (x : G ⧸ N) = Filter.map (↑) (𝓝 x)

{G : Type w}
[TopologicalSpace G]
[Group G]
[TopologicalGroup G]
(N : Subgroup G)
(x : G)

𝓝 ↑x = Filter.map QuotientGroup.mk (𝓝 x)


lemma diffFinset₀_subset (hC : IsSetSemiring C) (hs : s ∈ C) (hI : ↑I ⊆ C) :
    ↑(hC.diffFinset₀ hs hI) ⊆ C

{α : Type u_1}
{C : Set (Set α)}
{s : Set α}
{I : Finset (Set α)}
(hC : MeasureTheory.IsSetSemiring C)
(hs : s ∈ C)
(hI : ↑I ⊆ C)


theorem inf_eq_bot_iff {f g : Filter α} : f ⊓ g = ⊥ ↔ ∃ U ∈ f, ∃ V ∈ g, U ∩ V = ∅


@[simp]
theorem toNonUnitalAlgHom_eq_coe (f : A →ₐ[R] B) : f.toNonUnitalAlgHom = f

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

↑f = NonUnitalAlgHomClass.toNonUnitalAlgHom f


theorem ContDiffOn.of_succ {n : ℕ} (h : ContDiffOn 𝕜 (n + 1) f s) : ContDiffOn 𝕜 n f s

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{s : Set E}
{f : E → F}
{n : ℕ}
(h : ContDiffOn 𝕜 (↑n + 1) f s)


@[fun_prop]
theorem ContinuousAt.star (hf : ContinuousAt f x) : ContinuousAt (fun x => star (f x)) x

{α : Type u_1}
{R : Type u_2}
[TopologicalSpace R]
[Star R]
[ContinuousStar R]
[TopologicalSpace α]
{f : α → R}
{x : α}
(hf : ContinuousAt f x)


lemma isInternal_biSup_submodule_of_independent {A : ι → Submodule R M} (s : Set ι)
    (h : CompleteLattice.Independent <| fun i : s ↦ A i) :
    IsInternal <| fun (i : s) ↦ (A i).comap (⨆ i ∈ s, A i).subtype

(h : CompleteLattice.Independent fun i => A ↑i)

DirectSum.IsInternal fun i => Submodule.comap (⨆ i ∈ s, A i).subtype (A ↑i)


theorem inner_self_ofReal_norm (x : E) : (‖⟪x, x⟫‖ : 𝕜) = ⟪x, x⟫

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

↑‖⟪x, x⟫_𝕜‖ = ⟪x, x⟫_𝕜


@[to_additive]
lemma op_smul_mul (b : β) (a₁ a₂ : α) : b <• (a₁ * a₂) = b <• a₁ <• a₂

{α : Type u_5}
{β : Type u_6}
[Monoid α]
[MulAction αᵐᵒᵖ β]
(b : β)
(a₁ a₂ : α)

MulOpposite.op (a₁ * a₂) • b = MulOpposite.op a₂ • MulOpposite.op a₁ • b


lemma baseChange_slope (x₁ x₂ y₁ y₂ : F) :
    (W.baseChange K).toAffine.slope (f x₁) (f x₂) (f y₁) (f y₂) =
      f ((W.baseChange F).toAffine.slope x₁ x₂ y₁ y₂)

{R : Type r}
[CommRing R]
(W : WeierstrassCurve.Affine R)
{S : Type s}
[CommRing S]
[Algebra R S]
{F : Type u}
[Field F]
[Algebra R F]
[Algebra S F]
[IsScalarTower R S F]
{K : Type v}
[Field K]
[Algebra R K]
[Algebra S K]
[IsScalarTower R S K]
(f : F →ₐ[S] K)
(x₁ x₂ y₁ y₂ : F)

(WeierstrassCurve.baseChange W K).toAffine.slope (f x₁) (f x₂) (f y₁) (f y₂) =
  f ((WeierstrassCurve.baseChange W F).toAffine.slope x₁ x₂ y₁ y₂)


theorem Coprime.gcd_mul_right_cancel_right (m : ℕ+) {n k : ℕ+} :
    k.Coprime m → m.gcd (n * k) = m.gcd n


@[simp]
theorem coe_inclusion {S T : Subalgebra R A} (h : S ≤ T) (s : S) : (inclusion h s : A) = s

{R : Type u}
{A : Type v}
[CommSemiring R]
[Semiring A]
[Algebra R A]
{S T : Subalgebra R A}
(h : S ≤ T)
(s : ↥S)


theorem padicValInt_mul_eq_succ (a : ℤ) (ha : a ≠ 0) :
    padicValInt p (a * p) = padicValInt p a + 1

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

padicValInt p (a * ↑p) = padicValInt p a + 1


/-- A cyclotomic extension splits `X ^ n - 1` if `n ∈ S`. -/
theorem splits_X_pow_sub_one [H : IsCyclotomicExtension S K L] (hS : n ∈ S) :
    Splits (algebraMap K L) (X ^ (n : ℕ) - 1)

{n : ℕ+}
{S : Set ℕ+}
(K : Type w)
(L : Type z)
[Field K]
[Field L]
[Algebra K L]
[H : IsCyclotomicExtension S K L]
(hS : n ∈ S)

Polynomial.Splits (algebraMap K L) (Polynomial.X ^ ↑n - 1)


@[simp]
theorem closure_univ : closure (Set.univ : Set R) = ⊤


@[simp]
theorem map_apply (f : ContinuousMonoidHom A B) (x : PontryaginDual B) (y : A) :
    map f x y = x (f y)

{A : Type u_1}
{B : Type u_2}
[Monoid A]
[Monoid B]
[TopologicalSpace A]
[TopologicalSpace B]
(f : ContinuousMonoidHom A B)
(x : PontryaginDual B)
(y : A)


/-- For vector spaces, `f.dualMap` is surjective if and only if `f` is injective -/
@[simp]
theorem dualMap_surjective_iff {f : V₁ →ₗ[K] V₂} :
    Function.Surjective f.dualMap ↔ Function.Injective f

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

Function.Surjective ⇑f.dualMap ↔ Function.Injective ⇑f


protected theorem fderivWithin (hxs : UniqueDiffWithinAt 𝕜 s x) :
    fderivWithin 𝕜 (fun x => p.eval x) s x = smulRight (1 : 𝕜 →L[𝕜] 𝕜) (p.derivative.eval x)

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{x : 𝕜}
{s : Set 𝕜}
(p : 𝕜[X])
(hxs : UniqueDiffWithinAt 𝕜 s x)

fderivWithin 𝕜 (fun x => Polynomial.eval x p) s x =
  ContinuousLinearMap.smulRight 1 (Polynomial.eval x (Polynomial.derivative p))


/-- `WittVector.init n x` is polynomial in the coefficients of `x`. -/
theorem init_isPoly (n : ℕ) : IsPoly p fun _ _ => init n

WittVector.IsPoly p fun x x_1 => WittVector.init n


/--
If `B` is a strict bicategory and `I` is a (1-)category, any functor (of 1-categories) `I ⥤ B` can
be promoted to an oplax functor from `LocallyDiscrete I` to `B`.
-/
@[simps]
def Functor.toOplaxFunctor (F : I ⥤ B) : OplaxFunctor (LocallyDiscrete I) B

{I : Type u₁}
[CategoryTheory.Category.{v₁, u₁} I]
{B : Type u₂}
[CategoryTheory.Bicategory B]
[CategoryTheory.Bicategory.Strict B]
(F : CategoryTheory.Functor I B)

∀ {X Y : CategoryTheory.LocallyDiscrete I} (f : X ⟶ Y), F.toOplaxFunctor.map f = F.map f.as


theorem hasDerivAt_id' : HasDerivAt (fun x : 𝕜 => x) 1 x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
(x : 𝕜)


@[simp]
lemma leftHomologyMap'_op
    (φ : S₁ ⟶ S₂) (h₁ : S₁.LeftHomologyData) (h₂ : S₂.LeftHomologyData) :
    (leftHomologyMap' φ h₁ h₂).op = rightHomologyMap' (opMap φ) h₂.op h₁.op

(CategoryTheory.ShortComplex.leftHomologyMap' φ h₁ h₂).op =
  CategoryTheory.ShortComplex.rightHomologyMap' (CategoryTheory.ShortComplex.opMap φ) h₂.op h₁.op


/-- The elliptic curve mapped over a ring homomorphism `φ : R →+* A`. -/
@[simps (config := { rhsMd := .default }) a₁ a₂ a₃ a₄ a₆ Δ' toWeierstrassCurve]
def map : EllipticCurve A

{R : Type u}
[CommRing R]
(E : EllipticCurve R)
{A : Type v}
[CommRing A]
(φ : R →+* A)


@[ext] protected theorem eq {n m : ℝ≥0} : (n : ℝ) = (m : ℝ) → n = m


theorem count_nth_of_infinite (hp : (setOf p).Infinite) (n : ℕ) : count p (nth p n) = n

{p : ℕ → Prop}
[DecidablePred p]
(hp : (setOf p).Infinite)
(n : ℕ)


/-- Engel's theorem. -/
theorem LieModule.isNilpotent_iff_forall' [IsNoetherian R M] :
    LieModule.IsNilpotent R L M ↔ ∀ x, _root_.IsNilpotent <| toEnd R L M x

{R : Type u₁}
{L : Type u₂}
{M : Type u₄}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
[IsNoetherian R M]

LieModule.IsNilpotent R L M ↔ ∀ (x : L), IsNilpotent ((LieModule.toEnd R L M) x)


theorem heq_of_eqRec_eq {α β : Sort u} {a : α} {b : β} (h₁ : α = β) (h₂ : Eq.rec (motive := fun α _ => α) a h₁ = b) : HEq a b

{α β : Sort u}
{a : α}
{b : β}
(h₁ : α = β)
(h₂ : Eq.rec a h₁ = b)


theorem mk_mul_mk {x y : α} : Associates.mk x * Associates.mk y = Associates.mk (x * y)


theorem einfsep_zero : s.einfsep = 0 ↔ ∀ C > 0, ∃ x ∈ s, ∃ y ∈ s, x ≠ y ∧ edist x y < C


lemma even_finrank_of_not_isUnramifiedIn
    [IsGalois k K] {w : InfinitePlace k} (hw : ¬ w.IsUnramifiedIn K) :
    Even (finrank k K)

(hw : ¬NumberField.InfinitePlace.IsUnramifiedIn K w)


protected theorem Equiv.iSup_congr {g : ι' → α} (e : ι ≃ ι') (h : ∀ x, g (e x) = f x) :
    ⨆ x, f x = ⨆ y, g y

{α : Type u_1}
{ι : Sort u_5}
{ι' : Sort u_6}
[SupSet α]
{f : ι → α}
{g : ι' → α}
(e : ι ≃ ι')
(h : ∀ (x : ι), g (e x) = f x)


theorem exists_lt_mul_self (a : R) : ∃ x ≥ 0, a < x * x

{R : Type u_6}
[LinearOrderedSemiring R]
(a : R)


theorem sup_factors_of_factors_left {A B : C} {X Y : Subobject B} {f : A ⟶ B} (P : X.Factors f) :
    (X ⊔ Y).Factors f


@[simp] theorem Bool.true_and (b : Bool) : (true && b) = b


theorem prod_le_prod {ι} (f g : ι → Cardinal) (H : ∀ i, f i ≤ g i) : prod f ≤ prod g

{ι : Type u_1}
(f g : ι → Cardinal.{u_2})
(H : ∀ (i : ι), f i ≤ g i)


@[simp]
lemma prod_X_pow_eq_monomial : ∏ x ∈ s.support, X x ^ s x = monomial s (1 : R)

{R : Type u}
{σ : Type u_1}
{s : σ →₀ ℕ}
[CommSemiring R]

∏ x ∈ s.support, MvPolynomial.X x ^ s x = (MvPolynomial.monomial s) 1


@[simp]
theorem compl_singleton_mem_nhds_iff [T1Space X] {x y : X} : {x}ᶜ ∈ 𝓝 y ↔ y ≠ x

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


theorem nhds_generateFrom {g : Set (Set α)} {a : α} :
    @nhds α (generateFrom g) a = ⨅ s ∈ { s | a ∈ s ∧ s ∈ g }, 𝓟 s


@[simp]
theorem grade_bot [OrderBot 𝕆] [OrderBot α] [GradeMinOrder 𝕆 α] : grade 𝕆 (⊥ : α) = ⊥

{𝕆 : Type u_1}
{α : Type u_3}
[PartialOrder 𝕆]
[Preorder α]
[OrderBot 𝕆]
[OrderBot α]
[GradeMinOrder 𝕆 α]


@[simp]
theorem erase_neg (a : α) (f : α →₀ G) : erase a (-f) = -erase a f

{α : Type u_1}
{G : Type u_9}
[AddGroup G]
(a : α)
(f : α →₀ G)

Finsupp.erase a (-f) = -Finsupp.erase a f


@[fun_prop]
theorem continuousAt_const : ContinuousAt (fun _ : X => y) x

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
{x : X}
{y : Y}


theorem Zigzag.of_hom_inv {j₁ j₂ j₃ : J} (f₁₂ : j₁ ⟶ j₂) (f₃₂ : j₃ ⟶ j₂) : Zigzag j₁ j₃

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


private lemma toAffine_slope_of_ne {P Q : Fin 3 → F} (hPz : P z ≠ 0) (hQz : Q z ≠ 0)
    (hx : P x * Q z ^ 2 ≠ Q x * P z ^ 2) :
    W.toAffine.slope (P x / P z ^ 2) (Q x / Q z ^ 2) (P y / P z ^ 3) (Q y / Q z ^ 3) =
      (P y * Q z ^ 3 - Q y * P z ^ 3) / (P z * Q z * addZ P Q)

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

W.toAffine.slope (P x / P z ^ 2) (Q x / Q z ^ 2) (P y / P z ^ 3) (Q y / Q z ^ 3) =
  (P y * Q z ^ 3 - Q y * P z ^ 3) / (P z * Q z * WeierstrassCurve.Jacobian.addZ P Q)


@[to_additive]
theorem pairwise_aedisjoint_of_aedisjoint_forall_ne_one {G α : Type*} [Group G] [MulAction G α]
    [MeasurableSpace α] {μ : Measure α} {s : Set α}
    (h_ae_disjoint : ∀ g ≠ (1 : G), AEDisjoint μ (g • s) s)
    (h_qmp : ∀ g : G, QuasiMeasurePreserving (g • ·) μ μ) :
    Pairwise (AEDisjoint μ on fun g : G => g • s)

(h_ae_disjoint : ∀ (g : G), g ≠ 0 → MeasureTheory.AEDisjoint μ (g +ᵥ s) s)

(h_qmp : ∀ (g : G), MeasureTheory.Measure.QuasiMeasurePreserving (fun x => g +ᵥ x) μ μ)

Pairwise (MeasureTheory.AEDisjoint μ on fun g => g +ᵥ s)


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


theorem symmetrize_mem_uniformity {V : Set (α × α)} (h : V ∈ 𝓤 α) : symmetrizeRel V ∈ 𝓤 α

{α : Type ua}
[UniformSpace α]
{V : Set (α × α)}
(h : V ∈ 𝓤 α)


theorem coe_strictMono : StrictMono (fun (a : α) => (a : WithBot α))


protected theorem injOn (hf : ApproximatesLinearOn f (f' : E →L[𝕜] F) s c)
    (hc : Subsingleton E ∨ c < N⁻¹) : InjOn f s

(hc : Subsingleton E ∨ c < ‖↑f'.symm‖₊⁻¹)


theorem laurentAux_ofFractionRing_mk (q : R[X]⁰) :
    laurentAux r (ofFractionRing (Localization.mk p q)) =
      ofFractionRing (.mk (taylor r p) ⟨taylor r q, taylor_mem_nonZeroDivisors r q q.prop⟩)

{R : Type u}
[CommRing R]
[hdomain : IsDomain R]
(r : R)
(p : Polynomial R)
(q : ↥(nonZeroDivisors (Polynomial R)))

(RatFunc.laurentAux r) { toFractionRing := Localization.mk p q } =
  { toFractionRing := Localization.mk ((Polynomial.taylor r) p) ⟨(Polynomial.taylor r) ↑q, ⋯⟩ }


theorem iff_addMonoid_fg {M : Type*} [AddCommMonoid M] : Module.Finite ℕ M ↔ AddMonoid.FG M


theorem kerase_append_right {a} :
    ∀ {l₁ l₂ : List (Sigma β)}, a ∉ l₁.keys → kerase a (l₁ ++ l₂) = l₁ ++ kerase a l₂

{α : Type u}
{β : α → Type v}
[DecidableEq α]
{a : α}
{l₁ l₂ : List (Sigma β)}

a ∉ l₁.keys → List.kerase a (l₁ ++ l₂) = l₁ ++ List.kerase a l₂


@[simp]
theorem biUnion_self (s : Set α) : ⋃ x ∈ s, s = s


lemma piecewise_le_piecewise (hf : f ≤ f') (hg : g ≤ g') : s.piecewise f g ≤ s.piecewise f' g'

{ι : Type u_1}
(s : Finset ι)
[(j : ι) → Decidable (j ∈ s)]
{π : ι → Type u_3}
{f g f' g' : (i : ι) → π i}
[(i : ι) → Preorder (π i)]
(hf : f ≤ f')
(hg : g ≤ g')


theorem isRotated_comm : l ~r l' ↔ l' ~r l


/-- The preimage is the basic open in `X` defined by the same element `r`. -/
theorem toΓSpecMapBasicOpen_eq : X.toΓSpecMapBasicOpen r = X.toRingedSpace.basicOpen r

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


@[simp, norm_cast]
theorem disjoint_coe : Disjoint (s : Set α) t ↔ Disjoint s t

{α : Type u_1}
[LE α]
{s t : LowerSet α}


theorem equivIccQuot_comp_mk_eq_toIcoMod :
    equivIccQuot p a ∘ Quotient.mk'' = fun x =>
      Quot.mk _ ⟨toIcoMod hp.out a x, Ico_subset_Icc_self <| toIcoMod_mem_Ico _ _ x⟩

{𝕜 : Type u_1}
[LinearOrderedAddCommGroup 𝕜]
[TopologicalSpace 𝕜]
[OrderTopology 𝕜]
(p a : 𝕜)
[hp : Fact (0 < p)]
[Archimedean 𝕜]

⇑(AddCircle.equivIccQuot p a) ∘ Quotient.mk'' = fun x => Quot.mk (AddCircle.EndpointIdent p a) ⟨toIcoMod ⋯ a x, ⋯⟩


@[reassoc (attr := simp)]
theorem HasColimit.isoOfNatIso_ι_hom {F G : J ⥤ C} [HasColimit F] [HasColimit G] (w : F ≅ G)
    (j : J) : colimit.ι F j ≫ (HasColimit.isoOfNatIso w).hom = w.hom.app j ≫ colimit.ι G j

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u}
[CategoryTheory.Category.{v, u} C]
{F G : J ⥤ C}
[CategoryTheory.Limits.HasColimit F]
[CategoryTheory.Limits.HasColimit G]
(w : F ≅ G)
(j : J)

CategoryTheory.Limits.colimit.ι F j ≫ (CategoryTheory.Limits.HasColimit.isoOfNatIso w).hom =
  w.hom.app j ≫ CategoryTheory.Limits.colimit.ι G j


/-- A structure extending partial homeomorphisms, defining a local trivialization of a projection
`proj : Z → B` with fiber `F`, as a partial homeomorphism between `Z` and `B × F` defined between
two sets of the form `proj ⁻¹' baseSet` and `baseSet × F`, acting trivially on the first coordinate.
-/
-- Porting note (#5171): was @[nolint has_nonempty_instance]
structure Trivialization (proj : Z → B) extends PartialHomeomorph Z (B × F) where
  baseSet : Set B
  open_baseSet : IsOpen baseSet
  source_eq : source = proj ⁻¹' baseSet
  target_eq : target = baseSet ×ˢ univ
  proj_toFun : ∀ p ∈ source, (toPartialHomeomorph p).1 = proj p

{B : Type u_2}
{F : Type u_3}
{Z : Type u_5}
[TopologicalSpace B]
[TopologicalSpace F]
[TopologicalSpace Z]
{proj : Z → B}
(self : Trivialization F proj)


theorem essSurj_of_surj (h : Function.Surjective F.obj) : EssSurj F

{C : Type u₁}
{D : Type u₂}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.Category.{v₂, u₂} D]
{F : CategoryTheory.Functor C D}
(h : Function.Surjective F.obj)


theorem map_comp_heq (hx : F.obj X = G.obj X) (hy : F.obj Y = G.obj Y) (hz : F.obj Z = G.obj Z)
    (hf : HEq (F.map f) (G.map f)) (hg : HEq (F.map g) (G.map g)) :
    HEq (F.map (f ≫ g)) (G.map (f ≫ g))

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{F G : CategoryTheory.Functor C D}
{X Y Z : C}
{f : X ⟶ Y}
{g : Y ⟶ Z}
(hx : F.obj X = G.obj X)
(hy : F.obj Y = G.obj Y)
(hz : F.obj Z = G.obj Z)
(hf : HEq (F.map f) (G.map f))
(hg : HEq (F.map g) (G.map g))

HEq (F.map (CategoryTheory.CategoryStruct.comp f g)) (G.map (CategoryTheory.CategoryStruct.comp f g))


/-- The mean value theorem on a convex set in dimension 1: if the derivative of a function is
bounded by `C`, then the function is `C`-Lipschitz. Version with `HasDerivWithinAt`. -/
theorem norm_image_sub_le_of_norm_hasDerivWithin_le {C : ℝ}
    (hf : ∀ x ∈ s, HasDerivWithinAt f (f' x) s x) (bound : ∀ x ∈ s, ‖f' x‖ ≤ C) (hs : Convex ℝ s)
    (xs : x ∈ s) (ys : y ∈ s) : ‖f y - f x‖ ≤ C * ‖y - x‖


@[reassoc (attr := simp)]
lemma rightDerivedZeroIsoSelf_hom_inv_id_app (X : C) :
    F.rightDerivedZeroIsoSelf.hom.app X ≫ F.toRightDerivedZero.app X = 𝟙 _

CategoryTheory.CategoryStruct.comp (F.rightDerivedZeroIsoSelf.hom.app X) (F.toRightDerivedZero.app X) =
  CategoryTheory.CategoryStruct.id ((F.rightDerived 0).obj X)


/-- A function on `[0, 1]` with the norm of the derivative within `[0, 1]`
bounded by `C` satisfies `‖f 1 - f 0‖ ≤ C`, `derivWithin` version. -/
theorem norm_image_sub_le_of_norm_deriv_le_segment_01 {C : ℝ}
    (hf : DifferentiableOn ℝ f (Icc (0 : ℝ) 1))
    (bound : ∀ x ∈ Ico (0 : ℝ) 1, ‖derivWithin f (Icc (0 : ℝ) 1) x‖ ≤ C) : ‖f 1 - f 0‖ ≤ C

(hf : DifferentiableOn ℝ f (Set.Icc 0 1))

(bound : ∀ x ∈ Set.Ico 0 1, ‖derivWithin f (Set.Icc 0 1) x‖ ≤ C)


@[simp]
theorem inv_left (a : N ⋊[φ] G) : a⁻¹.left = φ a.right⁻¹ a.left⁻¹

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


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

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

IsAddFreimanIso n (A₁ ×ˢ A₂) (B₁ ×ˢ B₂) (Prod.map f₁ f₂)


theorem max_bot_right [OrderBot α] (a : α) : max a ⊥ = a

{α : Type u}
[LinearOrder α]
[OrderBot α]
(a : α)


theorem setToSimpleFunc_congr_left (T T' : Set α → E →L[ℝ] F)
    (h : ∀ s, MeasurableSet s → μ s < ∞ → T s = T' s) (f : α →ₛ E) (hf : Integrable f μ) :
    setToSimpleFunc T f = setToSimpleFunc T' f

(h : ∀ (s : Set α), MeasurableSet s → μ s < ⊤ → T s = T' s)

MeasureTheory.SimpleFunc.setToSimpleFunc T f = MeasureTheory.SimpleFunc.setToSimpleFunc T' f


theorem IsBaseChange.iff_lift_unique :
    IsBaseChange S f ↔
      ∀ (Q : Type max v₁ v₂ v₃) [AddCommMonoid Q],
        ∀ [Module R Q] [Module S Q],
          ∀ [IsScalarTower R S Q],
            ∀ g : M →ₗ[R] Q, ∃! g' : N →ₗ[S] Q, (g'.restrictScalars R).comp f = g

{R : Type u_1}
{M : Type v₁}
{N : Type v₂}
{S : Type v₃}
[AddCommMonoid M]
[AddCommMonoid N]
[CommSemiring R]
[CommSemiring S]
[Algebra R S]
[Module R M]
[Module R N]
[Module S N]
[IsScalarTower R S N]
{f : M →ₗ[R] N}

IsBaseChange S f ↔
  ∀ (Q : Type (max v₁ v₂ v₃)) [inst : AddCommMonoid Q] [inst_1 : Module R Q] [inst_2 : Module S Q]
    [inst_3 : IsScalarTower R S Q] (g : M →ₗ[R] Q), ∃! g', ↑R g' ∘ₗ f = g


/-- Let `f : Fin (n + 1) → α` be an `(n + 1)`-tuple `(f₀, …, fₙ)` such that
- `f₀ = ⊥` and `fₙ = ⊤`;
- `fₖ₊₁` weakly covers `fₖ` for all `0 ≤ k < n`;
  this means that `fₖ ≤ fₖ₊₁` and there is no `c` such that `fₖ<c<fₖ₊₁`.
Then the range of `f` is a `Flag α`. -/
@[simps]
def Flag.rangeFin (f : Fin (n + 1) → α) (h0 : f 0 = ⊥) (hlast : f (.last n) = ⊤)
    (hcovBy : ∀ k : Fin n, f k.castSucc ⩿ f k.succ) : Flag α

(hcovBy : ∀ (k : Fin n), f k.castSucc ⩿ f k.succ)

↑(Flag.rangeFin f h0 hlast hcovBy) = Set.range f


@[simp]
lemma baseChange_id : (.id : M →ₗ[R] M).baseChange A = .id

{R : Type u_1}
{A : Type u_2}
{M : Type u_4}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[AddCommMonoid M]
[Module R M]

LinearMap.baseChange A LinearMap.id = LinearMap.id


theorem mem_im_iff (hφ : Function.Injective φ.obj) {c d : D} (f : c ⟶ d) :
    f ∈ (im φ hφ).arrows c d ↔
      ∃ (a b : C) (g : a ⟶ b) (ha : φ.obj a = c) (hb : φ.obj b = d),
        f = eqToHom ha.symm ≫ φ.map g ≫ eqToHom hb

{C : Type u}
[CategoryTheory.Groupoid C]
{D : Type u_1}
[CategoryTheory.Groupoid D]
(φ : CategoryTheory.Functor C D)
(hφ : Function.Injective φ.obj)
{c d : D}
(f : c ⟶ d)

f ∈ (CategoryTheory.Subgroupoid.im φ hφ).arrows c d ↔
  ∃ a b g,
    ∃ (ha : φ.obj a = c) (hb : φ.obj b = d),
      f =
        CategoryTheory.CategoryStruct.comp (CategoryTheory.eqToHom ⋯)
          (CategoryTheory.CategoryStruct.comp (φ.map g) (CategoryTheory.eqToHom hb))


@[simp]
theorem _root_.Polynomial.trunc_toLaurent (f : R[X]) : trunc (toLaurent f) = f

LaurentPolynomial.trunc (Polynomial.toLaurent f) = f


@[simp]
theorem not_nontrivial_iff : ¬s.Nontrivial ↔ s.Subsingleton


protected theorem Nonempty.sups : s.Nonempty → t.Nonempty → (s ⊻ t).Nonempty

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


protected theorem eq_iff_le_and_ge {x y : Int} : x = y ↔ x ≤ y ∧ y ≤ x


theorem copy_eq (Q : QuadraticMap R M N) (Q' : M → N) (h : Q' = ⇑Q) : Q.copy Q' h = Q

{R : Type u_3}
{M : Type u_4}
{N : Type u_5}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
[AddCommMonoid N]
[Module R N]
(Q : QuadraticMap R M N)
(Q' : M → N)
(h : Q' = ⇑Q)


theorem induced_iff_nhds_eq [tα : TopologicalSpace α] [tβ : TopologicalSpace β] (f : β → α) :
    tβ = tα.induced f ↔ ∀ b, 𝓝 b = comap f (𝓝 <| f b)

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

tβ = TopologicalSpace.induced f tα ↔ ∀ (b : β), 𝓝 b = Filter.comap f (𝓝 (f b))


@[to_additive (attr := simp)]
theorem Quotient.smul_coe [QuotientAction β H] (b : β) (a : α) :
    b • (a : α ⧸ H) = (↑(b • a) : α ⧸ H)

{α : Type u}
{β : Type v}
[Group α]
[Monoid β]
[MulAction β α]
(H : Subgroup α)
[MulAction.QuotientAction β H]
(b : β)
(a : α)


theorem HasBasis.tendsto_iff (hla : la.HasBasis pa sa) (hlb : lb.HasBasis pb sb) :
    Tendsto f la lb ↔ ∀ ib, pb ib → ∃ ia, pa ia ∧ ∀ x ∈ sa ia, f x ∈ sb ib

{α : Type u_1}
{β : Type u_2}
{ι : Sort u_4}
{ι' : Sort u_5}
{la : Filter α}
{pa : ι → Prop}
{sa : ι → Set α}
{lb : Filter β}
{pb : ι' → Prop}
{sb : ι' → Set β}
{f : α → β}
(hla : la.HasBasis pa sa)
(hlb : lb.HasBasis pb sb)

Filter.Tendsto f la lb ↔ ∀ (ib : ι'), pb ib → ∃ ia, pa ia ∧ ∀ x ∈ sa ia, f x ∈ sb ib


/-- **Maximum modulus principle**: if `f : E → F` is complex differentiable on a set `s`, the norm
of `f` takes it maximum on `s` at `z`, and `w` is a point such that the closed ball with center `z`
and radius `dist w z` is included in `s`, then `‖f w‖ = ‖f z‖`. -/
theorem norm_eq_norm_of_isMaxOn_of_ball_subset {f : E → F} {s : Set E} {z w : E}
    (hd : DiffContOnCl ℂ f s) (hz : IsMaxOn (norm ∘ f) s z) (hsub : ball z (dist w z) ⊆ s) :
    ‖f w‖ = ‖f z‖

{E : Type u}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace ℂ F]
{f : E → F}
{s : Set E}
{z w : E}
(hd : DiffContOnCl ℂ f s)
(hz : IsMaxOn (norm ∘ f) s z)
(hsub : Metric.ball z (dist w z) ⊆ s)


@[fun_prop]
theorem IsBoundedLinearMap.differentiable (h : IsBoundedLinearMap 𝕜 f) : Differentiable 𝕜 f

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
(h : IsBoundedLinearMap 𝕜 f)


/-- `PProd α β` is equivalent to `α × β` -/
@[simps apply symm_apply]
def pprodEquivProd : PProd α β ≃ α × β

{α : Type u_1}
{β : Type u_2}
(x : PProd α β)


@[to_additive (attr := simp) zero_mem_addCentralizer]
lemma one_mem_centralizer : (1 : M) ∈ centralizer S

{M : Type u_1}
{S : Set M}
[MulOneClass M]


theorem NFBelow.oadd {e n a b} : NF e → NFBelow a (repr e) → repr e < b → NFBelow (oadd e n a) b

{e : ONote}
{n : ℕ+}
{a : ONote}
{b : Ordinal.{0}}

e.NF → a.NFBelow e.repr → e.repr < b → (e.oadd n a).NFBelow b


/-- When proving that a chain of applications is below a bound `z`, it suffices to consider the
functions and values being selected from the same index in the chains.

This lemma is more specific than necessary, i.e. `c₀` only needs to be a
chain of monotone functions, but it is only used with continuous functions. -/
@[simp]
theorem forall_forall_merge (c₀ : Chain (α →𝒄 β)) (c₁ : Chain α) (z : β) :
    (∀ i j : ℕ, (c₀ i) (c₁ j) ≤ z) ↔ ∀ i : ℕ, (c₀ i) (c₁ i) ≤ z

(c₀ : OmegaCompletePartialOrder.Chain (α →𝒄 β))

(c₁ : OmegaCompletePartialOrder.Chain α)

(∀ (i j : ℕ), (c₀ i) (c₁ j) ≤ z) ↔ ∀ (i : ℕ), (c₀ i) (c₁ i) ≤ z


@[to_additive]
theorem prod_sum {α : Type*} {ι : Type*} [CommMonoid α] (f : ι → Multiset α) (s : Finset ι) :
    (∑ x ∈ s, f x).prod = ∏ x ∈ s, (f x).prod

{α : Type u_6}
{ι : Type u_7}
[CommMonoid α]
(f : ι → Multiset α)
(s : Finset ι)


@[to_additive]
theorem innerRegular_inv_iff : μ.inv.InnerRegular ↔ μ.InnerRegular

{G : Type u_2}
[MeasurableSpace G]
[TopologicalSpace G]
[BorelSpace G]
{μ : MeasureTheory.Measure G}
[AddGroup G]
[TopologicalAddGroup G]


@[to_additive]
theorem uniformContinuous_of_tendsto_one {hom : Type*} [UniformSpace β] [Group β] [UniformGroup β]
    [FunLike hom α β] [MonoidHomClass hom α β] {f : hom} (h : Tendsto f (𝓝 1) (𝓝 1)) :
    UniformContinuous f

{α : Type u_1}
{β : Type u_2}
[UniformSpace α]
[AddGroup α]
[UniformAddGroup α]
{hom : Type u_3}
[UniformSpace β]
[AddGroup β]
[UniformAddGroup β]
[FunLike hom α β]
[AddMonoidHomClass hom α β]
{f : hom}
(h : Filter.Tendsto (⇑f) (𝓝 0) (𝓝 0))


/-- Pythagorean theorem, if-and-only-if vector angle form. -/
theorem norm_add_sq_eq_norm_sq_add_norm_sq_iff_angle_eq_pi_div_two (x y : V) :
    ‖x + y‖ * ‖x + y‖ = ‖x‖ * ‖x‖ + ‖y‖ * ‖y‖ ↔ angle x y = π / 2

{V : Type u_1}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
(x y : V)

‖x + y‖ * ‖x + y‖ = ‖x‖ * ‖x‖ + ‖y‖ * ‖y‖ ↔ InnerProductGeometry.angle x y = π / 2


@[to_additive]
theorem prod_subtypeDomain_index [CommMonoid N] {v : α →₀ M} {h : α → M → N}
    (hp : ∀ x ∈ v.support, p x) : (v.subtypeDomain p).prod (fun a b ↦ h a b) = v.prod h

{α : Type u_1}
{M : Type u_5}
{N : Type u_7}
[Zero M]
{p : α → Prop}
[AddCommMonoid N]
{v : α →₀ M}
{h : α → M → N}
(hp : ∀ x ∈ v.support, p x)

((Finsupp.subtypeDomain p v).sum fun a b => h (↑a) b) = v.sum h


protected theorem mdifferentiableAt {x} : MDifferentiableAt I 𝓘(𝕜, E) I x

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


theorem map_injective (hf : Function.Injective f) : Function.Injective (map f)

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


theorem isCoprime_of_dvd (x y : R) (nonzero : ¬(x = 0 ∧ y = 0))
    (H : ∀ z ∈ nonunits R, z ≠ 0 → z ∣ x → ¬z ∣ y) : IsCoprime x y


@[reassoc (attr := simp), elementwise (attr := simp)]
theorem stalkFunctor_map_germ {F G : X.Presheaf C} (U : Opens X) (x : U) (f : F ⟶ G) :
    germ F x ≫ (stalkFunctor C x.1).map f = f.app (op U) ≫ germ G x

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

F.germ x ≫ (TopCat.Presheaf.stalkFunctor C ↑x).map f = f.app (Opposite.op U) ≫ G.germ x


theorem card_le_card_biUnion_add_one {s : Finset ι} {f : ι → Finset α} (hf : Injective f)
    (hs : (s : Set ι).PairwiseDisjoint f) : s.card ≤ (s.biUnion f).card + 1

{ι : Type u_1}
{α : Type u_2}
[DecidableEq α]
{s : Finset ι}
{f : ι → Finset α}
(hf : Function.Injective f)
(hs : (↑s).PairwiseDisjoint f)


theorem Monic.not_irreducible_iff_exists_add_mul_eq_coeff (hm : p.Monic) (hnd : p.natDegree = 2) :
    ¬Irreducible p ↔ ∃ c₁ c₂, p.coeff 0 = c₁ * c₂ ∧ p.coeff 1 = c₁ + c₂

{R : Type u}
[CommSemiring R]
[NoZeroDivisors R]
{p : R[X]}
(hm : p.Monic)
(hnd : p.natDegree = 2)


theorem le_einfsep_iff {d} :
    d ≤ s.einfsep ↔ ∀ x ∈ s, ∀ y ∈ s, x ≠ y → d ≤ edist x y

{α : Type u_1}
[EDist α]
{s : Set α}
{d : ENNReal}


/-- The canonical map to the kernel of the localization of `g` is localizing.
In other words, localization commutes with kernels. -/
lemma LinearMap.toKerLocalized_isLocalizedModule (g : M →ₗ[R] P) :
    IsLocalizedModule p (toKerIsLocalized p f f' g)

{R : Type u}
(S : Type u')
{M : Type v}
{N : Type v'}
[CommRing R]
[CommRing S]
[AddCommGroup M]
[AddCommGroup N]
[Module R M]
[Module R N]
[Algebra R S]
[Module S N]
[IsScalarTower R S N]
(p : Submonoid R)
[IsLocalization p S]
(f : M →ₗ[R] N)
[IsLocalizedModule p f]
{P : Type w}
[AddCommGroup P]
[Module R P]
{Q : Type w'}
[AddCommGroup Q]
[Module R Q]
[Module S Q]
[IsScalarTower R S Q]
(f' : P →ₗ[R] Q)
[IsLocalizedModule p f']
(g : M →ₗ[R] P)

IsLocalizedModule p (LinearMap.toKerIsLocalized p f f' g)


@[to_additive (attr := simp)]
theorem mem_comap {H : OpenSubgroup N} {f : G →* N} {hf : Continuous f} {x : G} :
    x ∈ H.comap f hf ↔ f x ∈ H

{G : Type u_1}
[Group G]
[TopologicalSpace G]
{N : Type u_2}
[Group N]
[TopologicalSpace N]
{H : OpenSubgroup N}
{f : G →* N}
{hf : Continuous ⇑f}
{x : G}


@[to_additive]
theorem mem_sup_right {S T : Submonoid M} : ∀ {x : M}, x ∈ T → x ∈ S ⊔ T

{M : Type u_1}
[AddZeroClass M]
{S T : AddSubmonoid M}
{x : M}


/-- If `sᵢ` is a countable family of (null) measurable pairwise `μ`-a.e. disjoint sets, then there
exists a subordinate family `tᵢ ⊆ sᵢ` of measurable pairwise disjoint sets such that
`tᵢ =ᵐ[μ] sᵢ`. -/
theorem exists_subordinate_pairwise_disjoint [Countable ι] {s : ι → Set α}
    (h : ∀ i, NullMeasurableSet (s i) μ) (hd : Pairwise (AEDisjoint μ on s)) :
    ∃ t : ι → Set α,
      (∀ i, t i ⊆ s i) ∧
        (∀ i, s i =ᵐ[μ] t i) ∧ (∀ i, MeasurableSet (t i)) ∧ Pairwise (Disjoint on t)

(h : ∀ (i : ι), MeasureTheory.NullMeasurableSet (s i) μ)

(hd : Pairwise (MeasureTheory.AEDisjoint μ on s))

∃ t, (∀ (i : ι), t i ⊆ s i) ∧ (∀ (i : ι), s i =ᵐ[μ] t i) ∧ (∀ (i : ι), MeasurableSet (t i)) ∧ Pairwise (Disjoint on t)


@[simp]
lemma desc_map_mk {i : I} (X Y : C i) (f : X ⟶ Y) : (desc F).map (SigmaHom.mk f) = (F i).map f

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

(F : (i : I) → CategoryTheory.Functor (C i) D)

(CategoryTheory.Sigma.desc F).map (CategoryTheory.Sigma.SigmaHom.mk f) = (F i).map f


protected theorem rel_id (X : RelCat) : 𝟙 X = (· = ·)

CategoryTheory.CategoryStruct.id X = fun x x_1 => x = x_1


/-- To prove that a vector space over a linear ordered field is ordered, it suffices to verify only
the first axiom of `OrderedSMul`. -/
theorem OrderedSMul.mk' (h : ∀ ⦃a b : M⦄ ⦃c : 𝕜⦄, a < b → 0 < c → c • a ≤ c • b) :
    OrderedSMul 𝕜 M


theorem AddMonoid.End.intCast_def (z : ℤ) :
    (↑z : AddMonoid.End M) = DistribMulAction.toAddMonoidEnd ℤ M z

↑z = (DistribMulAction.toAddMonoidEnd ℤ M) z


@[to_additive (attr := simp)]
theorem iterate_map_pow {M F : Type*} [Monoid M] [FunLike F M M] [MonoidHomClass F M M]
    (f : F) (n : ℕ) (x : M) (k : ℕ) :
    f^[n] (x ^ k) = f^[n] x ^ k

{M : Type u_5}
{F : Type u_6}
[AddMonoid M]
[FunLike F M M]
[AddMonoidHomClass F M M]
(f : F)
(n : ℕ)
(x : M)
(k : ℕ)


theorem le_bihimp {a b c : α} (hb : a ⊓ b ≤ c) (hc : a ⊓ c ≤ b) : a ≤ b ⇔ c

{α : Type u_2}
[GeneralizedHeytingAlgebra α]
{a b c : α}
(hb : a ⊓ b ≤ c)
(hc : a ⊓ c ≤ b)


@[to_additive (attr := simp)]
theorem compl_inv : sᶜ⁻¹ = s⁻¹ᶜ


/-- `(F ⨯ G).obj a` is in bijection with the product of `F.obj a` and `G.obj a`. -/
@[simps]
noncomputable
def binaryProductEquiv (a : C) : (F ⨯ G).obj a ≃ (F.obj a) × (G.obj a)

(F G : CategoryTheory.Functor C (Type w))

(CategoryTheory.FunctorToTypes.binaryProductEquiv F G a).symm z = CategoryTheory.FunctorToTypes.prodMk z.1 z.2


lemma gaussSum_aux_of_mulShift (χ : DirichletCharacter R N) {d : ℕ}
    (hd : d ∣ N) (he : e.mulShift d = 1) {u : (ZMod N)ˣ} (hu : ZMod.unitsMap hd u = 1) :
    χ u * gaussSum χ e = gaussSum χ e

{N : ℕ}
[NeZero N]
{R : Type u_1}
[CommRing R]
(e : AddChar (ZMod N) R)
(χ : DirichletCharacter R N)
{d : ℕ}
(hd : d ∣ N)
(he : e.mulShift ↑d = 1)
{u : (ZMod N)ˣ}
(hu : (ZMod.unitsMap hd) u = 1)


theorem relMap_equiv_unify {n : ℕ} (R : L.Relations n) (x : Fin n → Σˣ f) (i : ι)
    (hi : i ∈ upperBounds (range (Sigma.fst ∘ x))) :
    RelMap R x = RelMap R (unify f x i hi)

[DirectedSystem G fun i j h => ⇑(f i j h)]

(x : Fin n → FirstOrder.Language.Structure.Sigma f)

(hi : i ∈ upperBounds (Set.range (Sigma.fst ∘ x)))

FirstOrder.Language.Structure.RelMap R x =
  FirstOrder.Language.Structure.RelMap R (FirstOrder.Language.DirectLimit.unify f x i hi)


/-- For every open cover of a Lindelöf set, there exists a countable subcover. -/
theorem IsLindelof.elim_countable_subcover {ι : Type v} (hs : IsLindelof s) (U : ι → Set X)
    (hUo : ∀ i, IsOpen (U i)) (hsU : s ⊆ ⋃ i, U i) :
    ∃ r : Set ι, r.Countable ∧ (s ⊆ ⋃ i ∈ r, U i)

{X : Type u}
[TopologicalSpace X]
{s : Set X}
{ι : Type v}
(hs : IsLindelof s)
(U : ι → Set X)
(hUo : ∀ (i : ι), IsOpen (U i))
(hsU : s ⊆ ⋃ i, U i)


@[to_additive existing (attr := simp)]
theorem snd_div : (s / t).snd = s.snd / t.fst

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

(s / t).toProd.2 = s.toProd.2 / t.toProd.1


@[to_additive]
lemma ne_bot_iff_exists_ne_one {H : Subgroup G} : H ≠ ⊥ ↔ ∃ a : ↥H, a ≠ 1

{G : Type u_1}
[Group G]
{H : Subgroup G}

H ≠ ⊥ ↔ ∃ a, a ≠ 1


@[simp]
theorem natCast_ne_top (x : ℕ) : (x : PartENat) ≠ ⊤


lemma preNormEDS'_even (m : ℕ) : preNormEDS' b c d (2 * (m + 3)) =
    preNormEDS' b c d (m + 2) ^ 2 * preNormEDS' b c d (m + 3) * preNormEDS' b c d (m + 5) -
      preNormEDS' b c d (m + 1) * preNormEDS' b c d (m + 3) * preNormEDS' b c d (m + 4) ^ 2

{R : Type u}
[CommRing R]
(b c d : R)
(m : ℕ)


theorem _root_.IsUnit.integrable_smul_iff [NormedRing 𝕜] [Module 𝕜 β] [BoundedSMul 𝕜 β] {c : 𝕜}
    (hc : IsUnit c) (f : α → β) : Integrable (c • f) μ ↔ Integrable f μ

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup β]
{𝕜 : Type u_5}
[NormedRing 𝕜]
[Module 𝕜 β]
[BoundedSMul 𝕜 β]
{c : 𝕜}
(hc : IsUnit c)
(f : α → β)

MeasureTheory.Integrable (c • f) μ ↔ MeasureTheory.Integrable f μ


lemma of_fac' {R S : 𝒮} {a b : 𝒳} (f : R ⟶ S) (φ : a ⟶ b) (ha : p.obj a = R) (hb : p.obj b = S)
    (h : p.map φ = eqToHom ha ≫ f ≫ eqToHom hb.symm) : p.IsHomLift f φ

(h : p.map φ = CategoryTheory.eqToHom ha ≫ f ≫ CategoryTheory.eqToHom ⋯)


theorem dist_triangle_nonarch (x y z : ∀ n, E n) : dist x z ≤ max (dist x y) (dist y z)

{E : ℕ → Type u_1}
(x y z : (n : ℕ) → E n)


/--
The equivalence `WalkingParallelPair ⥤ WalkingParallelPairᵒᵖ` sending left to left and right to
right.
-/
@[simps functor inverse]
def walkingParallelPairOpEquiv : WalkingParallelPair ≌ WalkingParallelPairᵒᵖ


theorem DirectedSystem.map_map {i j k} (hij hjk x) :
    f j k hjk (f i j hij x) = f i k (le_trans hij hjk) x

{ι : Type v}
[Preorder ι]
{G : ι → Type w}
(f : (i j : ι) → i ≤ j → G i → G j)
[DirectedSystem G fun i j h => f i j h]
{i j k : ι}
(hij : i ≤ j)
(hjk : j ≤ k)
(x : G i)


@[gcongr] protected theorem mul_left (c : ℤ) (h : a ≡ b [ZMOD n]) : c * a ≡ c * b [ZMOD n]

{n a b : ℤ}
(c : ℤ)
(h : a ≡ b [ZMOD n])


theorem exists_forall_closedBall_subset_aux₁ (hK : ∀ i, IsClosed (K i)) (hU : ∀ i, IsOpen (U i))
    (hKU : ∀ i, K i ⊆ U i) (hfin : LocallyFinite K) (x : X) :
    ∃ r : ℝ, ∀ᶠ y in 𝓝 x,
      r ∈ Ioi (0 : ℝ) ∩ ENNReal.ofReal ⁻¹' ⋂ (i) (_ : y ∈ K i), { r | closedBall y r ⊆ U i }

{ι : Type u_1}
{X : Type u_2}
[EMetricSpace X]
{K U : ι → Set X}
(hK : ∀ (i : ι), IsClosed (K i))
(hU : ∀ (i : ι), IsOpen (U i))
(hKU : ∀ (i : ι), K i ⊆ U i)
(hfin : LocallyFinite K)
(x : X)

∃ r, ∀ᶠ (y : X) in 𝓝 x, r ∈ Set.Ioi 0 ∩ ENNReal.ofReal ⁻¹' ⋂ i, ⋂ (_ : y ∈ K i), {r | EMetric.closedBall y r ⊆ U i}


protected theorem le_of_mul_le_mul_left {a b c : Nat} (h : c * a ≤ c * b) (hc : 0 < c) : a ≤ b


@[simp, norm_cast] lemma coe_toMonoidHomEquiv_symm (ψ : Multiplicative A →* M) :
    ⇑(toMonoidHomEquiv.symm ψ) = ψ ∘ Multiplicative.ofAdd

{A : Type u_1}
{M : Type u_3}
[AddMonoid A]
[Monoid M]
(ψ : Multiplicative A →* M)

⇑(AddChar.toMonoidHomEquiv.symm ψ) = ⇑ψ ∘ ⇑Multiplicative.ofAdd


@[to_additive]
protected theorem _root_.IsUnit.filter : IsUnit a → IsUnit (pure a : Filter α)


theorem contDiffWithinAt_congr_nhds {t : Set E} (hst : 𝓝[s] x = 𝓝[t] x) :
    ContDiffWithinAt 𝕜 n f s x ↔ ContDiffWithinAt 𝕜 n f t x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{s : Set E}
{f : E → F}
{x : E}
{n : ℕ∞}
{t : Set E}
(hst : 𝓝[s] x = 𝓝[t] x)


@[simps]
instance hasForgetToFinPartOrd : HasForget₂ FinBoolAlg FinPartOrd

CategoryTheory.HasForget₂.forget₂.obj X = FinPartOrd.of ↑X.toBoolAlg


@[simp]
theorem rothNumberNat_zero : rothNumberNat 0 = 0


/-- The oriented angle between two nonzero vectors is plus or minus the unoriented angle. -/
theorem oangle_eq_angle_or_eq_neg_angle {x y : V} (hx : x ≠ 0) (hy : y ≠ 0) :
    o.oangle x y = InnerProductGeometry.angle x y ∨
      o.oangle x y = -InnerProductGeometry.angle x y

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

o.oangle x y = ↑(InnerProductGeometry.angle x y) ∨ o.oangle x y = -↑(InnerProductGeometry.angle x y)


/-- Units of a `Monoid`, bundled version. Notation: `αˣ`.

An element of a `Monoid` is a unit if it has a two-sided inverse.
This version bundles the inverse element so that it can be computed.
For a predicate see `IsUnit`. -/
structure Units (α : Type u) [Monoid α] where
  /-- The underlying value in the base `Monoid`. -/
  val : α
  /-- The inverse value of `val` in the base `Monoid`. -/
  inv : α
  /-- `inv` is the right inverse of `val` in the base `Monoid`. -/
  val_inv : val * inv = 1
  /-- `inv` is the left inverse of `val` in the base `Monoid`. -/
  inv_val : inv * val = 1


@[to_additive UniformContinuous.const_nsmul]
theorem UniformContinuous.pow_const [UniformSpace β] {f : β → α} (hf : UniformContinuous f) :
    ∀ n : ℕ, UniformContinuous fun x => f x ^ n

{α : Type u_1}
{β : Type u_2}
[UniformSpace α]
[Group α]
[UniformGroup α]
[UniformSpace β]
{f : β → α}
(hf : UniformContinuous f)
(n : ℕ)


theorem rpow_lt_rpow_iff (hx : 0 ≤ x) (hy : 0 ≤ y) (hz : 0 < z) : x ^ z < y ^ z ↔ x < y


@[to_additive]
theorem singleton_div_closedBall_one : {x} / closedBall 1 δ = closedBall x δ

{E : Type u_1}
[SeminormedAddCommGroup E]
(δ : ℝ)
(x : E)

{x} - Metric.closedBall 0 δ = Metric.closedBall x δ


theorem fderivWithin_add (hxs : UniqueDiffWithinAt 𝕜 s x) (hf : DifferentiableWithinAt 𝕜 f s x)
    (hg : DifferentiableWithinAt 𝕜 g s x) :
    fderivWithin 𝕜 (fun y => f y + g y) s x = fderivWithin 𝕜 f s x + fderivWithin 𝕜 g s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f g : E → F}
{x : E}
{s : Set E}
(hxs : UniqueDiffWithinAt 𝕜 s x)
(hf : DifferentiableWithinAt 𝕜 f s x)
(hg : DifferentiableWithinAt 𝕜 g s x)


@[simp, norm_cast]
theorem coe_pow (n : ℕ) :
    ((φ ^ n : MvPolynomial σ R) : MvPowerSeries σ R) = (φ : MvPowerSeries σ R) ^ n

{σ : Type u_1}
{R : Type u_2}
[CommSemiring R]
{φ : MvPolynomial σ R}
(n : ℕ)


/-- The sequential closure of a sequentially closed set is the set itself. -/
theorem IsSeqClosed.seqClosure_eq {s : Set X} (hs : IsSeqClosed s) : seqClosure s = s

{X : Type u_1}
[TopologicalSpace X]
{s : Set X}
(hs : IsSeqClosed s)


/-- The **Schwarz Lemma**: if `f : ℂ → E` sends an open disk with center `c` and radius `R₁` to an
open ball with center `f c` and radius `R₂`, then for any `z` in the former disk we have
`dist (f z) (f c) ≤ (R₂ / R₁) * dist z c`. -/
theorem dist_le_div_mul_dist_of_mapsTo_ball (hd : DifferentiableOn ℂ f (ball c R₁))
    (h_maps : MapsTo f (ball c R₁) (ball (f c) R₂)) (hz : z ∈ ball c R₁) :
    dist (f z) (f c) ≤ R₂ / R₁ * dist z c

(hd : DifferentiableOn ℂ f (Metric.ball c R₁))

(h_maps : Set.MapsTo f (Metric.ball c R₁) (Metric.ball (f c) R₂))


@[to_additive (attr := gcongr)]
theorem mul_lt_mul_of_lt_of_lt [CovariantClass α α (· * ·) (· < ·)]
    [CovariantClass α α (swap (· * ·)) (· < ·)]
    {a b c d : α} (h₁ : a < b) (h₂ : c < d) : a * c < b * d

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

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


@[simp]
lemma apply_lie_eq_sub (D : LieDerivation R L M) (a b : L) :
    D ⁅a, b⁆ = ⁅a, D b⁆ - ⁅b, D a⁆

{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]
(D : LieDerivation R L M)
(a b : L)


@[simp]
theorem nsmul_modEq_nsmul [NoZeroSMulDivisors ℕ α] (hn : n ≠ 0) :
    n • a ≡ n • b [PMOD n • p] ↔ a ≡ b [PMOD p]

{α : Type u_1}
[AddCommGroup α]
{p a b : α}
{n : ℕ}
[NoZeroSMulDivisors ℕ α]
(hn : n ≠ 0)


theorem boolAlg_dual_comp_forget_to_bddDistLat :
    BoolAlg.dual ⋙ forget₂ BoolAlg BddDistLat =
    forget₂ BoolAlg BddDistLat ⋙ BddDistLat.dual

BoolAlg.dual ⋙ CategoryTheory.forget₂ BoolAlg BddDistLat = CategoryTheory.forget₂ BoolAlg BddDistLat ⋙ BddDistLat.dual


@[simp] theorem filter_replicate_of_pos (h : p a) : (replicate n a).filter p = replicate n a

∀ {α : Type u_1} {p : α → Bool} {n : Nat} {a : α}, p a = true → List.filter p (List.replicate n a) = List.replicate n a


lemma log_nonneg_of_isNegNat {n : ℕ} (h : NormNum.IsInt e (.negOfNat n)) :
    0 ≤ Real.log (e : ℝ)

(h : Mathlib.Meta.NormNum.IsInt e (Int.negOfNat n))


lemma unitary_iff_isStarNormal_and_spectrum_subset_circle {u : A} :
    u ∈ unitary A ↔ IsStarNormal u ∧ spectrum ℂ u ⊆ circle

u ∈ unitary A ↔ IsStarNormal u ∧ spectrum ℂ u ⊆ ↑circle


theorem bijective_comp (e : α ≃ β) (f : β → γ) : Bijective (f ∘ e) ↔ Bijective f

{α : Sort u}
{β : Sort v}
{γ : Sort w}
(e : α ≃ β)
(f : β → γ)

Function.Bijective (f ∘ ⇑e) ↔ Function.Bijective f


theorem hasSum_norm (hp : 0 < p.toReal) (f : lp E p) :
    HasSum (fun i => ‖f i‖ ^ p.toReal) (‖f‖ ^ p.toReal)

{α : Type u_1}
{E : α → Type u_2}
{p : ℝ≥0∞}
[(i : α) → NormedAddCommGroup (E i)]
(hp : 0 < p.toReal)
(f : ↥(lp E p))

HasSum (fun i => ‖↑f i‖ ^ p.toReal) (‖f‖ ^ p.toReal)


theorem IsLocallyFull.ext [G.IsLocallyFull K]
    (ℱ : SheafOfTypes K) {X Y : C} (i : G.obj X ⟶ G.obj Y)
    {s t : ℱ.val.obj (op (G.obj X))}
    (h : ∀ ⦃Z : C⦄ (j : Z ⟶ X) (f : Z ⟶ Y), G.map f = G.map j ≫ i →
      ℱ.1.map (G.map j).op s = ℱ.1.map (G.map j).op t) : s = t

{K : CategoryTheory.GrothendieckTopology D}

{s t : ℱ.val.obj (Opposite.op (G.obj X))}

(h :
  ∀ ⦃Z : C⦄ (j : Z ⟶ X) (f : Z ⟶ Y),
    G.map f = CategoryTheory.CategoryStruct.comp (G.map j) i → ℱ.val.map (G.map j).op s = ℱ.val.map (G.map j).op t)


/-- Convenience constructor for a closure operator using the weaker minimality axiom:
`x ≤ f y → f x ≤ f y`, which is sometimes easier to prove in practice. -/
@[simps]
def mk₂ (f : α → α) (hf : ∀ x, x ≤ f x) (hmin : ∀ ⦃x y⦄, x ≤ f y → f x ≤ f y) :
    ClosureOperator α

(hmin : ∀ ⦃x y : α⦄, x ≤ f y → f x ≤ f y)

∀ (a : α), (ClosureOperator.mk₂ f hf hmin) a = f a


/-- An Eilenberg-Moore coalgebra for a comonad `T`. -/
-- Porting note(#5171): linter not ported yet
-- @[nolint has_nonempty_instance]
structure Coalgebra (G : Comonad C) : Type max u₁ v₁ where
  /-- The underlying object associated to a coalgebra. -/
  A : C
  /-- The structure morphism associated to a coalgebra. -/
  a : A ⟶ (G : C ⥤ C).obj A
  /-- The counit axiom associated to a coalgebra. -/
  counit : a ≫ G.ε.app A = 𝟙 A := by aesop_cat
  /-- The coassociativity axiom associated to a coalgebra. -/
  coassoc : a ≫ G.δ.app A = a ≫ G.map a := by aesop_cat

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

CategoryTheory.CategoryStruct.comp self.a (G.ε.app self.A) = CategoryTheory.CategoryStruct.id self.A


@[simp] theorem get_cons_cons_one : (a₁ :: a₂ :: as).get (1 : Fin (as.length + 2)) = a₂

∀ {α : Type u_1} {a₁ a₂ : α} {as : List α}, (a₁ :: a₂ :: as).get 1 = a₂


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

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


theorem AddSubsemigroup.toSubsemigroup'_closure (S : Set (Additive M)) :
    AddSubsemigroup.toSubsemigroup' (AddSubsemigroup.closure S) =
      Subsemigroup.closure (Additive.ofMul ⁻¹' S)

{M : Type u_1}
[Mul M]
(S : Set (Additive M))

AddSubsemigroup.toSubsemigroup' (AddSubsemigroup.closure S) = Subsemigroup.closure (⇑Additive.ofMul ⁻¹' S)


theorem InjOn.leftInvOn_invFunOn [Nonempty α] (h : InjOn f s) : LeftInvOn (invFunOn f s) f s

{α : Type u_1}
{β : Type u_2}
{s : Set α}
{f : α → β}
[Nonempty α]
(h : Set.InjOn f s)

Set.LeftInvOn (Function.invFunOn f s) f s


lemma IsLocalDiffeomorph.isLocalDiffeomorphOn
    {f : M → N} (hf : IsLocalDiffeomorph I J n f) (s : Set M) : IsLocalDiffeomorphOn I J n f s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{H : Type u_4}
[TopologicalSpace H]
{G : Type u_5}
[TopologicalSpace G]
{I : ModelWithCorners 𝕜 E H}
{J : ModelWithCorners 𝕜 F G}
{M : Type u_6}
[TopologicalSpace M]
[ChartedSpace H M]
{N : Type u_7}
[TopologicalSpace N]
[ChartedSpace G N]
{n : ℕ∞}
{f : M → N}
(hf : IsLocalDiffeomorph I J n f)
(s : Set M)


@[measurability, fun_prop]
theorem measurable_rnDeriv (μ ν : Measure α) : Measurable <| μ.rnDeriv ν

{α : Type u_1}
{m : MeasurableSpace α}
(μ ν : MeasureTheory.Measure α)


theorem proof_irrel {a : Prop} (h₁ h₂ : a) : h₁ = h₂


theorem supported_eq_vars_subset : (supported R s : Set (MvPolynomial σ R)) = { p | ↑p.vars ⊆ s }

{σ : Type u_1}
{R : Type u}
[CommSemiring R]
{s : Set σ}

↑(MvPolynomial.supported R s) = {p | ↑p.vars ⊆ s}


/-- Decomposition of an affine map in the special case when the point space and vector space
are the same. -/
theorem decomp (f : V1 →ᵃ[k] V2) : (f : V1 → V2) = ⇑f.linear + fun _ => f 0

{k : Type u_1}
{V1 : Type u_2}
{V2 : Type u_4}
[Ring k]
[AddCommGroup V1]
[Module k V1]
[AddCommGroup V2]
[Module k V2]
(f : V1 →ᵃ[k] V2)


theorem nhds_basis_ball {x : E} : (𝓝 x).HasBasis (fun r : ℝ => 0 < r) (ball x)

{E : Type u_1}
[AddCommGroup E]
[TopologicalSpace E]
[TopologicalAddGroup E]
[T2Space E]
[Module ℝ E]
[ContinuousSMul ℝ E]
[FiniteDimensional ℝ E]
{x : E}

(𝓝 x).HasBasis (fun r => 0 < r) (Euclidean.ball x)


@[to_additive (attr := simp)]
theorem mul_comp {G : Type*} [Mul G] [TopologicalSpace G] [ChartedSpace H' G] [SmoothMul I' G]
    (f g : C^∞⟮I'', N'; I', G⟯) (h : C^∞⟮I, N; I'', N'⟯) : (f * g).comp h = f.comp h * g.comp h

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{E' : Type u_3}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H : Type u_4}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{H' : Type u_5}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{N : Type u_6}
[TopologicalSpace N]
[ChartedSpace H N]
{E'' : Type u_7}
[NormedAddCommGroup E'']
[NormedSpace 𝕜 E'']
{H'' : Type u_8}
[TopologicalSpace H'']
{I'' : ModelWithCorners 𝕜 E'' H''}
{N' : Type u_9}
[TopologicalSpace N']
[ChartedSpace H'' N']
{G : Type u_10}
[Mul G]
[TopologicalSpace G]
[ChartedSpace H' G]
[SmoothMul I' G]
(f g : C^⊤⟮I'', N'; I', G⟯)
(h : C^⊤⟮I, N; I'', N'⟯)


lemma isTheta_smoothingFn_sub_self (i : α) :
    (fun (n : ℕ) => ε (b i * n) - ε n) =Θ[atTop] fun n => 1 / (log n)^2

{α : Type u_1}
[Fintype α]
[Nonempty α]
{T : ℕ → ℝ}
{g : ℝ → ℝ}
{a b : α → ℝ}
{r : α → ℕ → ℕ}
(R : AkraBazziRecurrence T g a b r)
(i : α)

(fun n => AkraBazziRecurrence.smoothingFn (b i * ↑n) - AkraBazziRecurrence.smoothingFn ↑n) =Θ[Filter.atTop] fun n =>
  1 / Real.log ↑n ^ 2


theorem to_local_left_inverse {g : 𝕜 → 𝕜} (hg : ∀ᶠ x in 𝓝 a, g (f x) = x) :
    HasStrictDerivAt g f'⁻¹ (f a)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
[CompleteSpace 𝕜]
{f : 𝕜 → 𝕜}
{f' a : 𝕜}
(hf : HasStrictDerivAt f f' a)
(hf' : f' ≠ 0)
{g : 𝕜 → 𝕜}
(hg : ∀ᶠ (x : 𝕜) in 𝓝 a, g (f x) = x)


/-- The object in the category of `R`-coalgebras associated to an `R`-coalgebra. -/
@[simps]
def of (X : Type v) [AddCommGroup X] [Module R X] [Coalgebra R X] :
    CoalgebraCat R

(R : Type u)
[CommRing R]
(X : Type v)
[AddCommGroup X]
[Module R X]
[Coalgebra R X]


@[simp]
theorem _root_.Function.Involutive.exists_mem_and_apply_eq_iff {f : α → α}
    (hf : Function.Involutive f) (x : α) (l : List α) : (∃ y : α, y ∈ l ∧ f y = x) ↔ f x ∈ l

{α : Type u}
{f : α → α}
(hf : Function.Involutive f)
(x : α)
(l : List α)


@[mono]
theorem Multiset.toEnumFinset_mono {m₁ m₂ : Multiset α} (h : m₁ ≤ m₂) :
    m₁.toEnumFinset ⊆ m₂.toEnumFinset

{α : Type u_1}
[DecidableEq α]
{m₁ m₂ : Multiset α}
(h : m₁ ≤ m₂)


@[to_additive (attr := simp)]
theorem equivQuotientZPowOfEquiv_trans :
    (equivQuotientZPowOfEquiv e n).trans (equivQuotientZPowOfEquiv d n) =
      equivQuotientZPowOfEquiv (e.trans d) n

{A B C : Type u}
[AddCommGroup A]
[AddCommGroup B]
[AddCommGroup C]
(e : A ≃+ B)
(d : B ≃+ C)
(n : ℤ)

(QuotientAddGroup.equivQuotientZSMulOfEquiv e n).trans (QuotientAddGroup.equivQuotientZSMulOfEquiv d n) =
  QuotientAddGroup.equivQuotientZSMulOfEquiv (e.trans d) n


theorem ConvexOn.sub (hf : ConvexOn 𝕜 s f) (hg : ConcaveOn 𝕜 s g) : ConvexOn 𝕜 s (f - g)

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_5}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[OrderedAddCommGroup β]
[SMul 𝕜 E]
[Module 𝕜 β]
{s : Set E}
{f g : E → β}
(hf : ConvexOn 𝕜 s f)
(hg : ConcaveOn 𝕜 s g)


@[to_additive]
lemma prod_map_eq_pow_single [DecidableEq α] {l : List α} (a : α) (f : α → M)
    (hf : ∀ a', a' ≠ a → a' ∈ l → f a' = 1) : (l.map f).prod = f a ^ l.count a

(hf : ∀ (a' : α), a' ≠ a → a' ∈ l → f a' = 1)

(List.map f l).prod = f a ^ List.count a l


@[simp]
theorem neighborSet_sup {H H' : G.Subgraph} (v : V) :
    (H ⊔ H').neighborSet v = H.neighborSet v ∪ H'.neighborSet v

{V : Type u}
{G : SimpleGraph V}
{H H' : G.Subgraph}
(v : V)


theorem of_exists_root (H : ∀ p : k[X], p.Monic → Irreducible p → ∃ x, p.eval x = 0) :
    IsAlgClosed k

(H : ∀ (p : k[X]), p.Monic → Irreducible p → ∃ x, Polynomial.eval x p = 0)


@[to_additive lt_neg]
theorem lt_inv' : a < b⁻¹ ↔ b < a⁻¹

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

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


/-- The `n+1`-th iterated derivative within a set with unique derivatives can be obtained by
taking the `n`-th derivative of the derivative. -/
theorem iteratedDerivWithin_succ' {x : 𝕜} (hxs : UniqueDiffOn 𝕜 s) (hx : x ∈ s) :
    iteratedDerivWithin (n + 1) f s x = (iteratedDerivWithin n (derivWithin f s) s) x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type u_2}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{n : ℕ}
{f : 𝕜 → F}
{s : Set 𝕜}
{x : 𝕜}
(hxs : UniqueDiffOn 𝕜 s)
(hx : x ∈ s)

iteratedDerivWithin (n + 1) f s x = iteratedDerivWithin n (derivWithin f s) s x


/-- The functorial action of `X ⊗ Y` in `Dial C`. -/
@[simps] def tensorHom {X₁ X₂ Y₁ Y₂ : Dial C} (f : X₁ ⟶ X₂) (g : Y₁ ⟶ Y₂) :
    tensorObj X₁ Y₁ ⟶ tensorObj X₂ Y₂

(CategoryTheory.Dial.tensorHom f g).f = CategoryTheory.Limits.prod.map f.f g.f


Cardinal.mk (Set ℕ) = Cardinal.continuum


theorem IndepSets.indep' [IsProbabilityMeasure μ]
    {p1 p2 : Set (Set Ω)} (hp1m : ∀ s ∈ p1, MeasurableSet s) (hp2m : ∀ s ∈ p2, MeasurableSet s)
    (hp1 : IsPiSystem p1) (hp2 : IsPiSystem p2) (hyp : IndepSets p1 p2 μ) :
    Indep (generateFrom p1) (generateFrom p2) μ

(hyp : ProbabilityTheory.IndepSets p1 p2 μ)

ProbabilityTheory.Indep (MeasurableSpace.generateFrom p1) (MeasurableSpace.generateFrom p2) μ


theorem map_eq (s : Stream' α) : map f s = f (head s)::map f (tail s)

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

Stream'.map f s = Stream'.cons (f s.head) (Stream'.map f s.tail)


/-- The natural isomorphism between two functors out of the walking pair, specified by its
components. -/
@[simps!]
def mapPairIso (f : F.obj ⟨left⟩ ≅ G.obj ⟨left⟩) (g : F.obj ⟨right⟩ ≅ G.obj ⟨right⟩) : F ≅ G

{F G : CategoryTheory.Discrete CategoryTheory.Limits.WalkingPair ⥤ C}

(f : F.obj { as := CategoryTheory.Limits.WalkingPair.left } ≅ G.obj { as := CategoryTheory.Limits.WalkingPair.left })

(g : F.obj { as := CategoryTheory.Limits.WalkingPair.right } ≅ G.obj { as := CategoryTheory.Limits.WalkingPair.right })

(X : CategoryTheory.Discrete CategoryTheory.Limits.WalkingPair)

(CategoryTheory.Limits.mapPairIso f g).hom.app X = (CategoryTheory.Limits.WalkingPair.rec f g X.as).hom


@[simp]
theorem piCongrRight_symm {ι : Type*} {β₁ β₂ : ι → Type*} [∀ i, UniformSpace (β₁ i)]
    [∀ i, UniformSpace (β₂ i)] (F : ∀ i, β₁ i ≃ᵤ β₂ i) :
    (piCongrRight F).symm = piCongrRight fun i => (F i).symm

{ι : Type u_4}
{β₁ : ι → Type u_5}
{β₂ : ι → Type u_6}
[(i : ι) → UniformSpace (β₁ i)]
[(i : ι) → UniformSpace (β₂ i)]
(F : (i : ι) → β₁ i ≃ᵤ β₂ i)

(UniformEquiv.piCongrRight F).symm = UniformEquiv.piCongrRight fun i => (F i).symm


/-- An unbundled description of lax monoidal functors. -/
class LaxMonoidal (F : C → D) [Functorial.{v₁, v₂} F] where
  /-- unit morphism -/
  ε : 𝟙_ D ⟶ F (𝟙_ C)
  /-- tensorator -/
  μ : ∀ X Y : C, F X ⊗ F Y ⟶ F (X ⊗ Y)
  μ_natural_left :
    ∀ {X Y : C} (f : X ⟶ Y) (X' : C),
      map F f ▷ F X' ≫ μ Y X' = μ X X' ≫ map F (f ▷ X') := by
    aesop_cat
  μ_natural_right :
    ∀ {X Y : C} (X' : C) (f : X ⟶ Y) ,
      F X' ◁ map F f ≫ μ X' Y = μ X' X ≫ map F (X' ◁ f) := by
    aesop_cat
  /-- associativity of the tensorator -/
  associativity :
    ∀ X Y Z : C,
      μ X Y ▷ F Z ≫ μ (X ⊗ Y) Z ≫ map F (α_ X Y Z).hom =
        (α_ (F X) (F Y) (F Z)).hom ≫ F X ◁ μ Y Z ≫ μ X (Y ⊗ Z) := by
    aesop_cat
  /-- left unitality -/
  left_unitality : ∀ X : C, (λ_ (F X)).hom = ε ▷ F X ≫ μ (𝟙_ C) X ≫ map F (λ_ X).hom := by
    aesop_cat
  /-- right unitality -/
  right_unitality : ∀ X : C, (ρ_ (F X)).hom = F X ◁ ε ≫ μ X (𝟙_ C) ≫ map F (ρ_ X).hom := by
    aesop_cat

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.MonoidalCategory C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
[CategoryTheory.MonoidalCategory D]
{F : C → D}
[CategoryTheory.Functorial F]
[self : CategoryTheory.LaxMonoidal F]
(X : C)

(CategoryTheory.MonoidalCategory.leftUnitor (F X)).hom =
  CategoryTheory.MonoidalCategory.whiskerRight CategoryTheory.LaxMonoidal.ε (F X) ≫
    CategoryTheory.LaxMonoidal.μ (𝟙_ C) X ≫ CategoryTheory.map F (CategoryTheory.MonoidalCategory.leftUnitor X).hom


theorem inducing_subtype_val {t : Set Y} : Inducing ((↑) : t → Y)

{Y : Type v}
[TopologicalSpace Y]
{t : Set Y}


theorem dihedralAct.inv (n : ℕ) (a : ZMod n) : Function.Involutive (dihedralAct n a)

Function.Involutive (Quandle.dihedralAct n a)


@[to_additive]
lemma isClosedMap_mul_left (a : G) : IsClosedMap (a * ·)

{G : Type w}
[TopologicalSpace G]
[Group G]
[ContinuousMul G]
(a : G)


@[simp]
theorem gcdB_zero_right {s : ℕ} (h : s ≠ 0) : gcdB s 0 = 0


@[simp]
theorem apply_symm_apply (x : E₂) : e (e.symm x) = x

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


/-- A convex independent family is injective. -/
protected theorem ConvexIndependent.injective {p : ι → E} (hc : ConvexIndependent 𝕜 p) :
    Function.Injective p

{𝕜 : Type u_1}
{E : Type u_2}
{ι : Type u_3}
[OrderedSemiring 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{p : ι → E}
(hc : ConvexIndependent 𝕜 p)


@[simp, norm_cast]
lemma AddMonoidHom.coe_toMultiplicative [AddZeroClass α] [AddZeroClass β] (f : α →+ β) :
    ⇑(toMultiplicative f) = ofAdd ∘ f ∘ toAdd

{α : Type u}
{β : Type v}
[AddZeroClass α]
[AddZeroClass β]
(f : α →+ β)

⇑(AddMonoidHom.toMultiplicative f) = ⇑Multiplicative.ofAdd ∘ ⇑f ∘ ⇑Multiplicative.toAdd


@[simp]
theorem cancel_natIso_hom_right {X : D} {Y : C} (f f' : X ⟶ F.obj Y) :
    f ≫ α.hom.app Y = f' ≫ α.hom.app Y ↔ f = f'

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{F G : C ⥤ D}
(α : F ≅ G)
{X : D}
{Y : C}
(f f' : X ⟶ F.obj Y)


/-- Twice the product of two Chebyshev `T` polynomials is the sum of two other Chebyshev `T`
polynomials. -/
theorem mul_T (m k : ℤ) : 2 * T R m * T R k = T R (m + k) + T R (m - k)

2 * Polynomial.Chebyshev.T R m * Polynomial.Chebyshev.T R k =
  Polynomial.Chebyshev.T R (m + k) + Polynomial.Chebyshev.T R (m - k)


theorem specializes_iff_mem (h : IsGenericPoint x S) : x ⤳ y ↔ y ∈ S

{α : Type u_1}
[TopologicalSpace α]
{x y : α}
{S : Set α}
(h : IsGenericPoint x S)


theorem hasBasis_nhds_zero [TopologicalSpace F] [TopologicalAddGroup F]
    (𝔖 : Set (Set E)) (h𝔖₁ : 𝔖.Nonempty) (h𝔖₂ : DirectedOn (· ⊆ ·) 𝔖) :
    (𝓝 (0 : UniformConvergenceCLM σ F 𝔖)).HasBasis
      (fun SV : Set E × Set F => SV.1 ∈ 𝔖 ∧ SV.2 ∈ (𝓝 0 : Filter F)) fun SV =>
      { f : UniformConvergenceCLM σ F 𝔖 | ∀ x ∈ SV.1, f x ∈ SV.2 }

(σ : 𝕜₁ →+* 𝕜₂)

(h𝔖₂ : DirectedOn (fun x x_1 => x ⊆ x_1) 𝔖)

(𝓝 0).HasBasis (fun SV => SV.1 ∈ 𝔖 ∧ SV.2 ∈ 𝓝 0) fun SV => {f | ∀ x ∈ SV.1, f x ∈ SV.2}


theorem ae_eq_pi {β : ι → Type*} {f f' : ∀ i, α i → β i} (h : ∀ i, f i =ᵐ[μ i] f' i) :
    (fun (x : ∀ i, α i) i => f i (x i)) =ᵐ[Measure.pi μ] fun x i => f' i (x i)

{μ : (i : ι) → MeasureTheory.Measure (α i)}

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

(fun x i => f i (x i)) =ᵐ[MeasureTheory.Measure.pi μ] fun x i => f' i (x i)


/-- Pointwise infimum of two monotone functions is a monotone function. -/
protected theorem inf [Preorder α] [SemilatticeInf β] {f g : α → β} (hf : Monotone f)
    (hg : Monotone g) :
    Monotone (f ⊓ g)

{α : Type u}
{β : Type v}
[Preorder α]
[SemilatticeInf β]
{f g : α → β}
(hf : Monotone f)
(hg : Monotone g)


theorem map_mem_nonZeroDivisors [Nontrivial M] [NoZeroDivisors M'] [ZeroHomClass F M M'] (g : F)
    (hg : Function.Injective g) {x : M} (h : x ∈ M⁰) : g x ∈ M'⁰

{M : Type u_2}
{M' : Type u_3}
{F : Type u_7}
[MonoidWithZero M]
[MonoidWithZero M']
[FunLike F M M']
[Nontrivial M]
[NoZeroDivisors M']
[ZeroHomClass F M M']
(g : F)
(hg : Function.Injective ⇑g)
{x : M}
(h : x ∈ M⁰)


@[simp] theorem size_nil : size (nil : Ordnode α) = 0


theorem CompHaus.toProfinite_obj' (X : CompHaus) :
    ↥(CompHaus.toProfinite.obj X) = ConnectedComponents X

↑(CompHaus.toProfinite.obj X).toTop = ConnectedComponents ↑X.toTop


/-- The norm, relative to `ℤ`, of `ζ - 1` in a `p`-th cyclotomic extension of `ℚ` is `p` if
`p ≠ 2`. -/
lemma norm_toInteger_sub_one_of_prime_ne_two' [hcycl : IsCyclotomicExtension {p} ℚ K]
    (hζ : IsPrimitiveRoot ζ p) (h : p ≠ 2) : Algebra.norm ℤ (hζ.toInteger - 1) = p

{p : ℕ+}
{K : Type u}
[Field K]
[CharZero K]
{ζ : K}
[hp : Fact (Nat.Prime ↑p)]
[hcycl : IsCyclotomicExtension {p} ℚ K]
(hζ : IsPrimitiveRoot ζ ↑p)
(h : p ≠ 2)

(Algebra.norm ℤ) (hζ.toInteger - 1) = ↑↑p


theorem normSq_pos (z : ℍ) : 0 < Complex.normSq (z : ℂ)


theorem mem_smul_pointwise_iff_exists (m : A) (a : α) (S : AddSubgroup A) :
    m ∈ a • S ↔ ∃ s : A, s ∈ S ∧ a • s = m

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


/-- `LocallyConstant.map` as a `MonoidHom`. -/
@[to_additive (attr := simps) "`LocallyConstant.map` as an `AddMonoidHom`."]
def mapMonoidHom [MulOneClass Y] [MulOneClass Z] (f : Y →* Z) :
    LocallyConstant X Y →* LocallyConstant X Z

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
{Z : Type u_6}
[AddZeroClass Y]
[AddZeroClass Z]
(f : Y →+ Z)
(g : LocallyConstant X Y)

(LocallyConstant.mapAddMonoidHom f) g = LocallyConstant.map (⇑f) g


@[simp] theorem take_length (l : List α) : take l.length l = l


theorem map_topologicalClosure_le [StarModule R B] [TopologicalSemiring B] [ContinuousStar B]
    (s : StarSubalgebra R A) (φ : A →⋆ₐ[R] B) (hφ : Continuous φ) :
    map φ s.topologicalClosure ≤ (map φ s).topologicalClosure

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
[CommSemiring R]
[StarRing R]
[TopologicalSpace A]
[Semiring A]
[Algebra R A]
[StarRing A]
[StarModule R A]
[TopologicalSemiring A]
[ContinuousStar A]
[TopologicalSpace B]
[Semiring B]
[Algebra R B]
[StarRing B]
[StarModule R B]
[TopologicalSemiring B]
[ContinuousStar B]
(s : StarSubalgebra R A)
(φ : A →⋆ₐ[R] B)
(hφ : Continuous ⇑φ)

StarSubalgebra.map φ s.topologicalClosure ≤ (StarSubalgebra.map φ s).topologicalClosure


/-- `N` as a submodule of `M × N` is isomorphic to `N`. -/
@[simps]
def sndEquiv : Submodule.snd R M M₂ ≃ₗ[R] M₂

(R : Type u)
(M : Type v)
(M₂ : Type w)
[Semiring R]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R M₂]
(n : M₂)

↑((Submodule.sndEquiv R M M₂).symm n) = (0, n)


protected theorem lt_of_add_lt_add_right : ∀ {n : Nat}, k + n < m + n → k < m


theorem ExtraDegeneracy.s_comp_π_0 (n : ℕ) :
    ExtraDegeneracy.s f S n ≫ WidePullback.π _ 0 =
      @WidePullback.base _ _ _ f.right (fun _ : Fin (n + 1) => f.left) (fun _ => f.hom) _ ≫
        S.section_

[∀ (n : ℕ), CategoryTheory.Limits.HasWidePullback f.right (fun x => f.left) fun x => f.hom]

CategoryTheory.Arrow.AugmentedCechNerve.ExtraDegeneracy.s f S n ≫
    CategoryTheory.Limits.WidePullback.π (fun x => f.hom) 0 =
  (CategoryTheory.Limits.WidePullback.base fun x => f.hom) ≫ S.section_


@[to_additive]
theorem map_le_iff_le_comap {f : M →ₙ* N} {S : Subsemigroup M} {T : Subsemigroup N} :
    S.map f ≤ T ↔ S ≤ T.comap f

{M : Type u_1}
{N : Type u_2}
[Mul M]
[Mul N]
{f : M →ₙ* N}
{S : Subsemigroup M}
{T : Subsemigroup N}

Subsemigroup.map f S ≤ T ↔ S ≤ Subsemigroup.comap f T


/-- The equivalence between `C` and its monoidal opposite's monoidal opposite. -/
@[simps!] def MonoidalOpposite.mopMopEquivalence : Cᴹᵒᵖᴹᵒᵖ ≌ C

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

((CategoryTheory.MonoidalOpposite.mopMopEquivalence C).unitIso.hom.app X).unmop.unmop = (𝟙 X.unmop).unmop


protected theorem tendsto_nhds_atTop_iff [Preorder β] {l : Filter α} {f : α → Filter β} :
    Tendsto f l (𝓝 atTop) ↔ ∀ y, ∀ᶠ a in l, Ici y ∈ f a

{α : Type u_2}
{β : Type u_3}
[Preorder β]
{l : Filter α}
{f : α → Filter β}

Filter.Tendsto f l (𝓝 Filter.atTop) ↔ ∀ (y : β), ∀ᶠ (a : α) in l, Set.Ici y ∈ f a


@[to_additive sub_le_sub_iff]
theorem div_le_div_iff' : a / b ≤ c / d ↔ a * d ≤ c * b

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


lemma LSeriesHasSum.neg {f : ℕ → ℂ} {s a : ℂ} (hf : LSeriesHasSum f s a) :
    LSeriesHasSum (-f) s (-a)


lemma cfcₙAux_mem_range_inr (f : C(σₙ 𝕜 a, 𝕜)₀) :
    cfcₙAux hp₁ a ha f ∈ NonUnitalStarAlgHom.range (Unitization.inrNonUnitalStarAlgHom 𝕜 A)

(f : ContinuousMapZero (↑(quasispectrum 𝕜 a)) 𝕜)

(cfcₙAux ⋯ a ha) f ∈ NonUnitalStarAlgHom.range (Unitization.inrNonUnitalStarAlgHom 𝕜 A)


/-- Every neighbourhood of the origin is absorbent. -/
theorem absorbent_nhds_zero (hA : A ∈ 𝓝 (0 : E)) : Absorbent 𝕜 A

{𝕜 : Type u_1}
{E : Type u_3}
[NormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{A : Set E}
[TopologicalSpace E]
[ContinuousSMul 𝕜 E]
(hA : A ∈ 𝓝 0)


@[simp]
theorem mem_divisorsAntidiagonal {x : ℕ × ℕ} :
    x ∈ divisorsAntidiagonal n ↔ x.fst * x.snd = n ∧ n ≠ 0

x ∈ n.divisorsAntidiagonal ↔ x.1 * x.2 = n ∧ n ≠ 0


theorem coeff_mul_add_of_le_natDegree_of_eq_ite {d df dg : ℕ} {a b : R} {f g : R[X]}
    (h_mul_left : natDegree f ≤ df) (h_mul_right : natDegree g ≤ dg)
    (h_mul_left : f.coeff df = a) (h_mul_right : g.coeff dg = b) (ddf : df + dg ≤ d) :
    (f * g).coeff d = if d = df + dg then a * b else 0

{R : Type u_1}
[Semiring R]
{d df dg : ℕ}
{a b : R}
{f g : R[X]}
(h_mul_left : f.natDegree ≤ df)
(h_mul_right : g.natDegree ≤ dg)

f.coeff df = a → g.coeff dg = b → df + dg ≤ d → (f * g).coeff d = if d = df + dg then a * b else 0


theorem withDensity_apply' [SFinite μ] (f : α → ℝ≥0∞) (s : Set α) :
    μ.withDensity f s = ∫⁻ a in s, f a ∂μ

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[MeasureTheory.SFinite μ]
(f : α → ℝ≥0∞)
(s : Set α)

(μ.withDensity f) s = ∫⁻ (a : α) in s, f a ∂μ


theorem integral_eq [NormedAddCommGroup γ] [NormedSpace ℝ γ] [BorelSpace γ]
    (h : IdentDistrib f g μ ν) : ∫ x, f x ∂μ = ∫ x, g x ∂ν

(h : ProbabilityTheory.IdentDistrib f g μ ν)


theorem withDensity_pdf_le_map {_ : MeasurableSpace Ω} (X : Ω → E) (ℙ : Measure Ω)
    (μ : Measure E := by volume_tac) : μ.withDensity (pdf X ℙ μ) ≤ map X ℙ

{Ω : Type u_1}
{E : Type u_2}
[MeasurableSpace E]

∀ {x : MeasurableSpace Ω} (X : Ω → E) (ℙ : MeasureTheory.Measure Ω) (μ : autoParam (MeasureTheory.Measure E) _auto✝),
  MeasureTheory.Measure.withDensity μ (MeasureTheory.pdf X ℙ μ) ≤ MeasureTheory.Measure.map X ℙ


theorem map_iSup {ι : Sort*} (f : F) (s : ι → NonUnitalSubring R) :
    (iSup s).map f = ⨆ i, (s i).map f

{F : Type w}
{R : Type u}
{S : Type v}
[NonUnitalNonAssocRing R]
[NonUnitalNonAssocRing S]
[FunLike F R S]
[NonUnitalRingHomClass F R S]
{ι : Sort u_2}
(f : F)
(s : ι → NonUnitalSubring R)

NonUnitalSubring.map f (iSup s) = ⨆ i, NonUnitalSubring.map f (s i)


lemma tendsto_zero_sumCoeffsExp : Tendsto (fun (p : ℝ) => ∑ i, a i * (b i) ^ p) atTop (𝓝 0)

{α : Type u_1}
[Fintype α]
[Nonempty α]
{T : ℕ → ℝ}
{g : ℝ → ℝ}
{a b : α → ℝ}
{r : α → ℕ → ℕ}
(R : AkraBazziRecurrence T g a b r)

Filter.Tendsto (fun p => ∑ i : α, a i * b i ^ p) Filter.atTop (𝓝 0)


theorem sub_mem : x ≡ y [SMOD U] ↔ x - y ∈ U

{R : Type u_1}
[Ring R]
{M : Type u_3}
[AddCommGroup M]
[Module R M]
{U : Submodule R M}
{x y : M}


theorem mem_upperBounds_image_self (Hf : AntitoneOn f t) :
    a ∈ lowerBounds t → a ∈ t → f a ∈ upperBounds (f '' t)

{α : Type u}
{β : Type v}
[Preorder α]
[Preorder β]
{f : α → β}
{t : Set α}
{a : α}
(Hf : AntitoneOn f t)


theorem Decidable.not_iff_not [Decidable a] [Decidable b] : (¬a ↔ ¬b) ↔ (a ↔ b)

{a b : Prop}
[Decidable a]
[Decidable b]


@[simp]
theorem trans_apply [IsTrans γ t] (f : r ≺i s) (g : s ≺i t) (a : α) : (f.trans g) a = g (f a)

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

(f.trans g).toRelEmbedding a = g.toRelEmbedding (f.toRelEmbedding a)