/-- `yoneda'` induces an equivalence of category between `Type u` and
`SheafOfTypes typesGrothendieckTopology`. -/
@[simps!]
noncomputable def typeEquiv : Type u ≌ SheafOfTypes typesGrothendieckTopology

(X : CategoryTheory.SheafOfTypes CategoryTheory.typesGrothendieckTopology)

∀ (X_1 : Type uᵒᵖ) (a : (CategoryTheory.yoneda.obj (X.val.obj (Opposite.op PUnit.{u + 1}))).obj X_1),
  (CategoryTheory.typeEquiv.counitIso.hom.app X).val.app X_1 a =
    (CategoryTheory.evalEquiv X.val ⋯ (Opposite.unop X_1)).symm a


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

{G : Type w}
[TopologicalSpace G]
[InvolutiveInv G]
[ContinuousInv G]
{s : Set G}
(hs : IsCompact s)


theorem from_eq (h : IsZero X) (f : Y ⟶ X) : h.from_ Y = f

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


/-- A bicategory structure on the oplax functors between bicategories. -/
-- Porting note: verified that projections are correct and changed @[simps] to @[simps!]
@[simps!]
instance OplaxFunctor.bicategory : Bicategory (OplaxFunctor B C)

{F G H : CategoryTheory.OplaxFunctor B C}

∀ (x x_1 : F ⟶ G) (Γ : x ⟶ x_1) (η : G ⟶ H) (a : B),
  (CategoryTheory.Bicategory.whiskerRight Γ η).app a = CategoryTheory.Bicategory.whiskerRight (Γ.app a) (η.app a)


theorem lfp_lfp (h : α →o α →o α) : lfp (lfp.comp h) = lfp h.onDiag

{α : Type u}
[CompleteLattice α]
(h : α →o α →o α)

OrderHom.lfp (OrderHom.lfp.comp h) = OrderHom.lfp h.onDiag


/-- Two isomorphic functors `F₁` and `F₂` induce isomorphic functors
`F₁.mapTriangle` and `F₂.mapTriangle` if the isomorphism `F₁ ≅ F₂` is compatible
with the shifts. -/
@[simps!]
def mapTriangleIso {F₁ F₂ : C ⥤ D} (e : F₁ ≅ F₂) [F₁.CommShift ℤ] [F₂.CommShift ℤ]
    [NatTrans.CommShift e.hom ℤ] : F₁.mapTriangle ≅ F₂.mapTriangle

(X : CategoryTheory.Pretriangulated.Triangle C)

((CategoryTheory.Functor.mapTriangleIso e).hom.app X).hom₂ = e.hom.app X.obj₂


/-- The image of the unit ball under a continuous linear map is bounded. -/
theorem unit_le_opNorm : ‖x‖ ≤ 1 → ‖f x‖ ≤ ‖f‖

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

‖x‖ ≤ 1 → ‖f x‖ ≤ ‖f‖


@[simp]
protected theorem map_add {F} [Add β] [FunLike F α β] [AddHomClass F α β]
    (f : F) (a b : WithBot α) :
    (a + b).map f = a.map f + b.map f

{α : Type u}
{β : Type v}
[Add α]
{F : Type u_1}
[Add β]
[FunLike F α β]
[AddHomClass F α β]
(f : F)
(a b : WithBot α)

WithBot.map (⇑f) (a + b) = WithBot.map (⇑f) a + WithBot.map (⇑f) b


@[to_additive]
theorem disjoint_mulSupport_iff {f : α → M} {s : Set α} :
    Disjoint s (mulSupport f) ↔ EqOn f 1 s

{α : Type u_1}
{M : Type u_5}
[Zero M]
{f : α → M}
{s : Set α}

Disjoint s (Function.support f) ↔ Set.EqOn f 0 s


theorem continuous_coe_iff {α} [TopologicalSpace α] {f : α → ℝ≥0} :
    (Continuous fun a => (f a : ℝ≥0∞)) ↔ Continuous f

{α : Type u_4}
[TopologicalSpace α]
{f : α → ℝ≥0}

(Continuous fun a => ↑(f a)) ↔ Continuous f


/-- Auxiliary lemma, used in proving the more general result `isBigO_cocompact_rpow`. -/
theorem isBigO_cocompact_zpow_neg_nat (k : ℕ) :
    f =O[cocompact E] fun x => ‖x‖ ^ (-k : ℤ)

{E : Type u_4}
{F : Type u_5}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[NormedAddCommGroup F]
[NormedSpace ℝ F]
(f : SchwartzMap E F)
(k : ℕ)

⇑f =O[Filter.cocompact E] fun x => ‖x‖ ^ (-↑k)


theorem mem_cons_iff (v : Vector α n) : a' ∈ (a ::ᵥ v).toList ↔ a' = a ∨ a' ∈ v.toList

{α : Type u_1}
{n : ℕ}
(a a' : α)
(v : Mathlib.Vector α n)


/-- Auxiliary result for the grid-lines lemma.  Given a nonnegative function on a finitary product
type indexed by `ι`, and a set `s` in `ι`, consider partially integrating over the variables in
`sᶜ` and performing the "grid-lines operation" (see `GridLines.T`) to the resulting function in the
variables `s`.  This theorem states that this operation decreases as the number of grid-lines taken
increases. -/
theorem T_lmarginal_antitone (hp₀ : 0 ≤ p) (hp : (#ι - 1 : ℝ) * p ≤ 1)
    {f : (∀ i, A i) → ℝ≥0∞} (hf : Measurable f) :
    Antitone (fun s ↦ T μ p (∫⋯∫⁻_sᶜ, f ∂μ) s)

(μ : (i : ι) → MeasureTheory.Measure (A i))

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

Antitone fun s => MeasureTheory.GridLines.T μ p (∫⋯∫⁻_sᶜ, f ∂μ) s


theorem strictMonoOn_projIic : StrictMonoOn (projIic b) (Iic b)

StrictMonoOn (Set.projIic b) (Set.Iic b)


theorem SuperpolynomialDecay.polynomial_mul [ContinuousAdd β] [ContinuousMul β]
    (hf : SuperpolynomialDecay l k f) (p : β[X]) :
    SuperpolynomialDecay l k fun x => (p.eval <| k x) * f x

(hf : Asymptotics.SuperpolynomialDecay l k f)

Asymptotics.SuperpolynomialDecay l k fun x => Polynomial.eval (k x) p * f x


theorem hasPullback_of_preservesPullback [HasPullback f g] : HasPullback (G.map f) (G.map g)

[CategoryTheory.Limits.PreservesLimit (CategoryTheory.Limits.cospan f g) G]

CategoryTheory.Limits.HasPullback (G.map f) (G.map g)


lemma div_eq_iff_eq_of_dvd_dvd (hn : n ≠ 0) (ha : a ∣ n) (hb : b ∣ n) : n / a = n / b ↔ a = b

{a b n : ℕ}
(hn : n ≠ 0)
(ha : a ∣ n)
(hb : b ∣ n)


/-- The `n`-th iterated derivative can be obtained by iterating `n` times the
differentiation operation. -/
theorem iteratedDeriv_eq_iterate : iteratedDeriv n f = deriv^[n] f

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type u_2}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{n : ℕ}
{f : 𝕜 → F}


@[gcongr] theorem tsub_le_tsub_right (h : a ≤ b) (c : α) : a - c ≤ b - c

{α : Type u_1}
[Preorder α]
[AddCommSemigroup α]
[Sub α]
[OrderedSub α]
{a b : α}
(h : a ≤ b)
(c : α)


@[simp]
theorem map_comp_coe (h : α → β) :
    Functor.map h ∘ Multiset.toFinset = Multiset.toFinset ∘ Functor.map h


/-- Translating a function by left-multiplication does not change its Lebesgue integral
with respect to a left-invariant measure. -/
@[to_additive
      "Translating a function by left-addition does not change its Lebesgue integral with
      respect to a left-invariant measure."]
theorem lintegral_mul_left_eq_self [IsMulLeftInvariant μ] (f : G → ℝ≥0∞) (g : G) :
    (∫⁻ x, f (g * x) ∂μ) = ∫⁻ x, f x ∂μ

{G : Type u_1}
[MeasurableSpace G]
{μ : MeasureTheory.Measure G}
[Group G]
[MeasurableMul G]
[μ.IsMulLeftInvariant]
(f : G → ENNReal)
(g : G)

∫⁻ (x : G), f (g * x) ∂μ = ∫⁻ (x : G), f x ∂μ


theorem setToL1_indicatorConstLp (hT : DominatedFinMeasAdditive μ T C) {s : Set α}
    (hs : MeasurableSet s) (hμs : μ s ≠ ∞) (x : E) :
    setToL1 hT (indicatorConstLp 1 hs hμs x) = T s x

(hT : MeasureTheory.DominatedFinMeasAdditive μ T C)

(MeasureTheory.L1.setToL1 hT) (MeasureTheory.indicatorConstLp 1 hs hμs x) = (T s) x


/-- `mapCone` commutes with `whisker`
-/
@[simps!]
def mapConeWhisker {E : K ⥤ J} {c : Cone F} : mapCone H (c.whisker E) ≅ (mapCone H c).whisker E

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{K : Type u₂}
[CategoryTheory.Category.{v₂, u₂} K]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{D : Type u₄}
[CategoryTheory.Category.{v₄, u₄} D]
(H : C ⥤ D)
{F : J ⥤ C}
{E : K ⥤ J}
{c : CategoryTheory.Limits.Cone F}

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


theorem star_mono : Monotone (star : NonUnitalSubalgebra R A → NonUnitalSubalgebra R A)

{R : Type u}
{A : Type v}
[CommSemiring R]
[StarRing R]
[NonUnitalSemiring A]
[StarRing A]
[Module R A]
[IsScalarTower R A A]
[SMulCommClass R A A]
[StarModule R A]


@[simp]
theorem mem_range (n : N) : n ∈ f.range ↔ ∃ m, f m = n

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


lemma formalMultilinearSeries_geometric_apply_norm (n : ℕ) :
    ‖formalMultilinearSeries_geometric 𝕜 A n‖ = 1

(𝕜 : Type u_9)
(A : Type u_10)
[NontriviallyNormedField 𝕜]
[NormedRing A]
[NormedAlgebra 𝕜 A]
[NormOneClass A]
(n : ℕ)


@[reassoc (attr := simp)]
lemma biprod_inl_snd_f (i : ι) :
    (biprod.inl : K ⟶ K ⊞ L).f i ≫ (biprod.snd : K ⊞ L ⟶ L).f i = 0

[∀ (i : ι), CategoryTheory.Limits.HasBinaryBiproduct (K.X i) (L.X i)]

CategoryTheory.Limits.biprod.inl.f i ≫ CategoryTheory.Limits.biprod.snd.f i = 0


theorem option_some_iff {f : α → β → σ} : (Primrec₂ fun a b => some (f a b)) ↔ Primrec₂ f

{α : Type u_1}
{β : Type u_2}
{σ : Type u_3}
[Primcodable α]
[Primcodable β]
[Primcodable σ]
{f : α → β → σ}


protected theorem order_dual : LeftOrdContinuous f → RightOrdContinuous (toDual ∘ f ∘ ofDual)

{α : Type u}
{β : Type v}
[Preorder α]
[Preorder β]
{f : α → β}

LeftOrdContinuous f → RightOrdContinuous (⇑OrderDual.toDual ∘ f ∘ ⇑OrderDual.ofDual)


@[simp] lemma hasFPowerSeriesWithinOnBall_univ {f : E → F} {p : FormalMultilinearSeries 𝕜 E F}
    {x : E} {r : ℝ≥0∞} :
    HasFPowerSeriesWithinOnBall f p univ x r ↔ HasFPowerSeriesOnBall f p x r

{𝕜 : Type u_2}
[NontriviallyNormedField 𝕜]
{E : Type u_3}
{F : Type u_4}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{p : FormalMultilinearSeries 𝕜 E F}
{x : E}
{r : ℝ≥0∞}

HasFPowerSeriesWithinOnBall f p Set.univ x r ↔ HasFPowerSeriesOnBall f p x r


/-- The tensor product over an empty index type `ι` is isomorphic to the base ring. -/
@[simps symm_apply]
def isEmptyEquiv [IsEmpty ι] : (⨂[R] i : ι, s i) ≃ₗ[R] R

(ι : Type u_1)
{R : Type u_4}
[CommSemiring R]
{s : ι → Type u_7}
[(i : ι) → AddCommMonoid (s i)]
[(i : ι) → Module R (s i)]
[IsEmpty ι]
(r : R)

(PiTensorProduct.isEmptyEquiv ι).symm r = r • (PiTensorProduct.tprod R) isEmptyElim


theorem neg_mul_eq_neg_mul_symm (a b : ℤ) : -a * b = -(a * b)


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

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

(CategoryTheory.Square.toArrowArrowFunctor.obj sq).hom.right = sq.f₃₄


@[to_additive]
theorem Inducing.continuousMul {M N F : Type*} [Mul M] [Mul N] [FunLike F M N] [MulHomClass F M N]
    [TopologicalSpace M] [TopologicalSpace N] [ContinuousMul N] (f : F) (hf : Inducing f) :
    ContinuousMul M

{M : Type u_6}
{N : Type u_7}
{F : Type u_8}
[Add M]
[Add N]
[FunLike F M N]
[AddHomClass F M N]
[TopologicalSpace M]
[TopologicalSpace N]
[ContinuousAdd N]
(f : F)
(hf : Inducing ⇑f)


@[simp]
theorem den_mul (c1 c2 : NumDenSameDeg 𝒜 x) : ((c1 * c2).den : A) = c1.den * c2.den

(c1 c2 : HomogeneousLocalization.NumDenSameDeg 𝒜 x)


theorem dropLast_prefix : ∀ l : List α, l.dropLast <+: l


@[reassoc (attr := simp)]
lemma ι_tensorObjDesc {A : C} {k : I}
    (f : ∀ (i₁ i₂ : I) (_ : i₁ + i₂ = k), X₁ i₁ ⊗ X₂ i₂ ⟶ A) (i₁ i₂ : I) (hi : i₁ + i₂ = k) :
    ιTensorObj X₁ X₂ i₁ i₂ k hi ≫ tensorObjDesc f = f i₁ i₂ hi

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

(f : (i₁ i₂ : I) → i₁ + i₂ = k → (CategoryTheory.MonoidalCategory.tensorObj (X₁ i₁) (X₂ i₂) ⟶ A))

CategoryTheory.CategoryStruct.comp (CategoryTheory.GradedObject.Monoidal.ιTensorObj X₁ X₂ i₁ i₂ k hi)
    (CategoryTheory.GradedObject.Monoidal.tensorObjDesc f) =
  f i₁ i₂ hi


theorem neg (hf : DiffContOnCl 𝕜 f s) : DiffContOnCl 𝕜 (-f) s

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜 F]
{f : E → F}
{s : Set E}
(hf : DiffContOnCl 𝕜 f s)


@[simp, mono]
theorem succ_le_succ (h : a ≤ b) : succ a ≤ succ b

{α : Type u_1}
[Preorder α]
[SuccOrder α]
{a b : α}
(h : a ≤ b)


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

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


@[simp] theorem count_filter {l : List α} (h : p a) : count a (filter p l) = count a l

{α : Type u_1}
[DecidableEq α]
{p : α → Bool}
{a : α}
{l : List α}
(h : p a = true)

List.count a (List.filter p l) = List.count a l


@[simp] lemma sup_apply (f g : C(α, β)) (a : α) : (f ⊔ g) a = f a ⊔ g a

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
[SemilatticeSup β]
[ContinuousSup β]
(f g : C(α, β))
(a : α)


theorem Expr.denote_toPoly (ctx : Context) (e : Expr) : e.toPoly.denote ctx = e.denote ctx

(ctx : Nat.Linear.Context)
(e : Nat.Linear.Expr)

Nat.Linear.Poly.denote ctx e.toPoly = Nat.Linear.Expr.denote ctx e


theorem tan_arcsin (x : ℝ) : tan (arcsin x) = x / √(1 - x ^ 2)

Real.tan (Real.arcsin x) = x / √(1 - x ^ 2)


theorem IsPGroup.sylow_mem_fixedPoints_iff {P : Subgroup G} (hP : IsPGroup p P) {Q : Sylow p G} :
    Q ∈ fixedPoints P (Sylow p G) ↔ P ≤ Q

{p : ℕ}
{G : Type u_1}
[Group G]
{P : Subgroup G}
(hP : IsPGroup p ↥P)
{Q : Sylow p G}

Q ∈ MulAction.fixedPoints (↥P) (Sylow p G) ↔ P ≤ ↑Q


@[simp]
lemma sectionsEquiv_apply_val (s : I.sections) (i : I.L) :
    c.ι i (sectionsEquiv hc s) = s.val i

{I : CategoryTheory.Limits.MulticospanIndex (Type u)}

c.ι i ((CategoryTheory.Limits.Multifork.IsLimit.sectionsEquiv hc) s) = s.val i


theorem measurable_coe_ennreal_comp (f : X →ᵇ ℝ≥0) :
    Measurable fun x ↦ (f x : ℝ≥0∞)

{X : Type u_1}
[MeasurableSpace X]
[TopologicalSpace X]
[OpensMeasurableSpace X]
(f : X →ᵇ ℝ≥0)


theorem ite_add_ite {α} [Add α] (P : Prop) [Decidable P] (a b c d : α) :
    ((if P then a else b) + if P then c else d) = if P then a + c else b + d

{α : Type u_1}
[Add α]
(P : Prop)
[Decidable P]
(a b c d : α)


theorem of_diff_of_diff_eq_zero {A B : Set α} (hA : MeasurableSet A) (hB : MeasurableSet B)
    (h' : v (B \ A) = 0) : v (A \ B) + v B = v A

{α : Type u_1}
{m : MeasurableSpace α}
{M : Type u_3}
[AddCommMonoid M]
[TopologicalSpace M]
[T2Space M]
{v : MeasureTheory.VectorMeasure α M}
{A B : Set α}
(hA : MeasurableSet A)
(hB : MeasurableSet B)
(h' : ↑v (B \ A) = 0)


@[simp]
theorem coe_top [FaithfulSMul M X] :
    -- Porting note: Manual correction of name required here
    ↑(BoundedOrder.toOrderTop.toTop.top : { P : M // IsLprojection X P }) = (1 : M)

{X : Type u_1}
[NormedAddCommGroup X]
{M : Type u_2}
[Ring M]
[Module M X]
[FaithfulSMul M X]


theorem HasFiniteFPowerSeriesOnBall.fderiv_eq (h : HasFiniteFPowerSeriesOnBall f p x n r)
    {y : E} (hy : (‖y‖₊ : ℝ≥0∞) < r) :
    fderiv 𝕜 f (x + y) = continuousMultilinearCurryFin1 𝕜 E F (p.changeOrigin y 1)

fderiv 𝕜 f (x + y) = (continuousMultilinearCurryFin1 𝕜 E F) (p.changeOrigin y 1)


theorem le_sup_inf (a b c : α) : (a ⊔ b) ⊓ (a ⊔ c) ⊔ (a ⊔ b ⊓ c) = a ⊔ b ⊓ c

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


@[simp]
theorem one_apply_ne {x : ℕ} (h : x ≠ 1) : (1 : ArithmeticFunction R) x = 0

{R : Type u_1}
[Zero R]
[One R]
{x : ℕ}
(h : x ≠ 1)


@[simp]
lemma sectionsMap_id {M : SheafOfModules.{v} R} (s : M.sections) :
    sectionsMap (𝟙 M) s = s

{J : CategoryTheory.GrothendieckTopology C}


@[to_additive]
theorem mem_closure {x : G} : x ∈ closure k ↔ ∀ K : Subgroup G, k ⊆ K → x ∈ K

{G : Type u_1}
[Group G]
{k : Set G}
{x : G}

x ∈ Subgroup.closure k ↔ ∀ (K : Subgroup G), k ⊆ ↑K → x ∈ K


theorem toNNReal_add_toNNReal {r p : ℝ} (hr : 0 ≤ r) (hp : 0 ≤ p) :
    Real.toNNReal r + Real.toNNReal p = Real.toNNReal (r + p)

r.toNNReal + p.toNNReal = (r + p).toNNReal


@[simp]
theorem head_ofSeq (s : Seq α) : head (ofSeq s) = Computation.pure s.head


theorem multichoose_zero_right [MulOneClass R] [NatPowAssoc R]
    (r : R) : multichoose r 0 = 1

{R : Type u_1}
[AddCommMonoid R]
[Pow R ℕ]
[BinomialRing R]
[MulOneClass R]
[NatPowAssoc R]
(r : R)


@[simp]
theorem multichoose_one_right (n : ℕ) : multichoose n 1 = n


theorem isUnit_mk {a : α} : IsUnit (Associates.mk a) ↔ IsUnit a


@[simp]
theorem piLp_equiv_toEuclideanLin (A : Matrix m n 𝕜) (x : EuclideanSpace 𝕜 n) :
    WithLp.equiv _ _ (Matrix.toEuclideanLin A x) = Matrix.toLin' A (WithLp.equiv _ _ x)

{𝕜 : Type u_3}
[RCLike 𝕜]
{m : Type u_8}
{n : Type u_9}
[Fintype n]
[DecidableEq n]
(A : Matrix m n 𝕜)
(x : EuclideanSpace 𝕜 n)

(WithLp.equiv 2 ((i : m) → (fun x => 𝕜) i)) ((Matrix.toEuclideanLin A) x) =
  (Matrix.toLin' A) ((WithLp.equiv 2 (n → 𝕜)) x)


@[simp]
theorem coe_toRealAffineIsometryEquiv (f : PE ≃ᵢ PF) :
    f.toRealAffineIsometryEquiv.toIsometryEquiv = f

{E : Type u_1}
{PE : Type u_2}
{F : Type u_3}
{PF : Type u_4}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[MetricSpace PE]
[NormedAddTorsor E PE]
[NormedAddCommGroup F]
[NormedSpace ℝ F]
[MetricSpace PF]
[NormedAddTorsor F PF]
(f : PE ≃ᵢ PF)


@[to_additive (attr := simp)]
theorem mk_le_mk {s t : Set G} (h_one) (h_mul) (h_inv) (h_one') (h_mul') (h_inv') :
    mk ⟨⟨s, h_one⟩, h_mul⟩ h_inv ≤ mk ⟨⟨t, h_one'⟩, h_mul'⟩ h_inv' ↔ s ⊆ t

(h_one : ∀ {a b : G}, a ∈ s → b ∈ s → a * b ∈ s)

(h_inv :
  ∀ {x : G},
    x ∈ { carrier := s, mul_mem' := h_one, one_mem' := h_mul }.carrier →
      x⁻¹ ∈ { carrier := s, mul_mem' := h_one, one_mem' := h_mul }.carrier)

(h_one' : ∀ {a b : G}, a ∈ t → b ∈ t → a * b ∈ t)

(h_inv' :
  ∀ {x : G},
    x ∈ { carrier := t, mul_mem' := h_one', one_mem' := h_mul' }.carrier →
      x⁻¹ ∈ { carrier := t, mul_mem' := h_one', one_mem' := h_mul' }.carrier)

{ carrier := s, mul_mem' := h_one, one_mem' := h_mul, inv_mem' := h_inv } ≤
    { carrier := t, mul_mem' := h_one', one_mem' := h_mul', inv_mem' := h_inv' } ↔
  s ⊆ t


@[simp] theorem id_comp (f : InfHom α β) : (InfHom.id β).comp f = f

{α : Type u_3}
{β : Type u_4}
[Inf α]
[Inf β]
(f : InfHom α β)


/-- If two simple functions are equal a.e., then their `lintegral`s are equal. -/
theorem lintegral_congr {f g : α →ₛ ℝ≥0∞} (h : f =ᵐ[μ] g) : f.lintegral μ = g.lintegral μ

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f g : MeasureTheory.SimpleFunc α ℝ≥0∞}
(h : ↑f =ᵐ[μ] ↑g)


theorem starₗᵢ_apply {x : E} : starₗᵢ 𝕜 x = star x

{𝕜 : Type u_1}
{E : Type u_2}
[CommSemiring 𝕜]
[StarRing 𝕜]
[SeminormedAddCommGroup E]
[StarAddMonoid E]
[NormedStarGroup E]
[Module 𝕜 E]
[StarModule 𝕜 E]
{x : E}


@[simp]
theorem coeff_map (n : ℕ) : coeff (p.map f) n = f (coeff p n)

{R : Type u}
{S : Type v}
[Semiring R]
{p : R[X]}
[Semiring S]
(f : R →+* S)
(n : ℕ)

(Polynomial.map f p).coeff n = f (p.coeff n)


/-- Build an isomorphism in the category `QuadraticModuleCat R` from a
`QuadraticForm.IsometryEquiv`. -/
@[simps]
def ofIso (e : Q₁.IsometryEquiv Q₂) : QuadraticModuleCat.of Q₁ ≅ QuadraticModuleCat.of Q₂

{R : Type u}
[CommRing R]
{X Y : Type v}
[AddCommGroup X]
[Module R X]
[AddCommGroup Y]
[Module R Y]
{Q₁ : QuadraticForm R X}
{Q₂ : QuadraticForm R Y}
(e : QuadraticMap.IsometryEquiv Q₁ Q₂)

(QuadraticModuleCat.ofIso e).inv.toIsometry = e.symm.toIsometry


/-- If `Γ` is linearly ordered and `R` has zero, then `HahnSeries Γ R` consists of
  formal series over `Γ` with coefficients in `R`, whose supports are well-founded. -/
@[ext]
structure HahnSeries (Γ : Type*) (R : Type*) [PartialOrder Γ] [Zero R] where
  /-- The coefficient function of a Hahn Series. -/
  coeff : Γ → R
  isPWO_support' : (Function.support coeff).IsPWO

{Γ : Type u_1}
{R : Type u_2}
[PartialOrder Γ]
[Zero R]
(self : HahnSeries Γ R)


protected theorem tsum_eq_iSup_sum : ∑' a, f a = ⨆ s : Finset α, ∑ a ∈ s, f a


theorem liftRingHom_injective [Nontrivial R] (φ : R[X] →+* L) (hφ : Function.Injective φ)
    (hφ' : R[X]⁰ ≤ L⁰.comap φ := nonZeroDivisors_le_comap_nonZeroDivisors_of_injective _ hφ) :
    Function.Injective (liftRingHom φ hφ')

(hφ' : R[X]⁰ ≤ Submonoid.comap φ L⁰ := ⋯)

Function.Injective ⇑(RatFunc.liftRingHom φ hφ')


@[simp]
theorem adjunctionToTypes_unit_app_val {G : Type max v₁ u₁ ⥤ D} (adj : G ⊣ forget D)
    (Y : SheafOfTypes J) :
    ((adjunctionToTypes J adj).unit.app Y).val =
      (adj.whiskerRight _).unit.app ((sheafOfTypesToPresheaf J).obj Y) ≫
        whiskerRight (toSheafify J _) (forget D)

(J : CategoryTheory.GrothendieckTopology C)

{G : CategoryTheory.Functor (Type (max v₁ u₁)) D}

((CategoryTheory.Sheaf.adjunctionToTypes J adj).unit.app Y).val =
  CategoryTheory.CategoryStruct.comp
    ((CategoryTheory.Adjunction.whiskerRight Cᵒᵖ adj).unit.app ((CategoryTheory.sheafOfTypesToPresheaf J).obj Y))
    (CategoryTheory.whiskerRight
      (CategoryTheory.toSheafify J
        (((CategoryTheory.whiskeringRight Cᵒᵖ (Type (max v₁ u₁)) D).obj G).obj
          ((CategoryTheory.sheafOfTypesToPresheaf J).obj Y)))
      (CategoryTheory.forget D))


protected theorem coe_neg (x : S) : (↑(-x) : L) = -↑x

{K : Type u_1}
{L : Type u_2}
[Field K]
[Field L]
[Algebra K L]
(S : IntermediateField K L)
(x : ↥S)


theorem IsPrefix.eq_of_length (h : l₁ <+: l₂) : l₁.length = l₂.length → l₁ = l₂

∀ {α : Type u_1} {l₁ l₂ : List α}, l₁ <+: l₂ → l₁.length = l₂.length → l₁ = l₂


theorem iInter_union_of_antitone {ι α} [Preorder ι] [IsDirected ι (· ≤ ·)] {s t : ι → Set α}
    (hs : Antitone s) (ht : Antitone t) : ⋂ i, s i ∪ t i = (⋂ i, s i) ∪ ⋂ i, t i

{ι : Type u_11}
{α : Type u_12}
[Preorder ι]
[IsDirected ι fun x x_1 => x ≤ x_1]
{s t : ι → Set α}
(hs : Antitone s)
(ht : Antitone t)


/-- `Matrix.comp` as `RingEquiv` -/
@[simps!]
def compRingEquiv : Matrix I I (Matrix J J R) ≃+* Matrix (I × J) (I × J) R

(I : Type u_1)
(J : Type u_2)
(R : Type u_5)
[Semiring R]
[Fintype I]
[Fintype J]
(m : Matrix I I (Matrix J J R))
(ik jl : I × J)

(Matrix.compRingEquiv I J R) m ik jl = m ik.1 jl.1 ik.2 jl.2


theorem AntitoneOn.map_max (hf : AntitoneOn f s) (ha : a ∈ s) (hb : b ∈ s) : f (max a b) =
    min (f a) (f b)

{α : Type u}
{β : Type v}
[LinearOrder α]
[LinearOrder β]
{f : α → β}
{s : Set α}
{a b : α}
(hf : AntitoneOn f s)
(ha : a ∈ s)
(hb : b ∈ s)


theorem incMatrix_mul_transpose_apply_of_adj (h : G.Adj a b) :
    (G.incMatrix R * (G.incMatrix R)ᵀ) a b = (1 : R)

{R : Type u_1}
{α : Type u_2}
(G : SimpleGraph α)
[Fintype (Sym2 α)]
[Semiring R]
{a b : α}
(h : G.Adj a b)

(SimpleGraph.incMatrix R G * (SimpleGraph.incMatrix R G)ᵀ) a b = 1


/-- (Impl) Construct the lifted cone in `Coalgebra T` which will be limiting. -/
@[simps]
def liftedCone : Cone D

{D : CategoryTheory.Functor J T.Coalgebra}

(c : CategoryTheory.Limits.Cone (D.comp T.forget))

[CategoryTheory.Limits.PreservesLimit (D.comp T.forget) T.toFunctor]

[CategoryTheory.Limits.PreservesLimit ((D.comp T.forget).comp T.toFunctor) T.toFunctor]

(CategoryTheory.Comonad.ForgetCreatesLimits'.liftedCone c t).pt =
  CategoryTheory.Comonad.ForgetCreatesLimits'.conePoint c t


lemma mono_binaryCofanSum_inl [MonoCoprod C] :
    Mono (binaryCofanSum c c₁ c₂ hc₁ hc₂).inl

(c₁ : CategoryTheory.Limits.Cofan (X ∘ Sum.inl))

(c₂ : CategoryTheory.Limits.Cofan (X ∘ Sum.inr))

(hc : CategoryTheory.Limits.IsColimit c)

(hc₁ : CategoryTheory.Limits.IsColimit c₁)

(hc₂ : CategoryTheory.Limits.IsColimit c₂)

CategoryTheory.Mono (CategoryTheory.Limits.MonoCoprod.binaryCofanSum c c₁ c₂ hc₁ hc₂).inl


{α : Type u}
{β : Type v}
[PartialOrder α]
[Preorder β]
{l : α → β}
{u : β → α}
(gc : GaloisConnection l u)


lemma IsUnramifiedAtInfinitePlaces_of_odd_finrank [IsGalois k K]
    (h : Odd (FiniteDimensional.finrank k K)) : IsUnramifiedAtInfinitePlaces k K


/-- If `M` and `M'` are free, then the rank of `M × M'` is
`(Module.rank R M).lift + (Module.rank R M').lift`. -/
@[simp]
theorem rank_prod : Module.rank R (M × M') =
    Cardinal.lift.{v'} (Module.rank R M) + Cardinal.lift.{v, v'} (Module.rank R M')

{R : Type u}
{M : Type v}
{M' : Type v'}
[Ring R]
[AddCommGroup M]
[AddCommGroup M']
[Module R M]
[Module R M']
[StrongRankCondition R]
[Module.Free R M]
[Module.Free R M']

Module.rank R (M × M') = Cardinal.lift.{v', v} (Module.rank R M) + Cardinal.lift.{v, v'} (Module.rank R M')


theorem toLinearMap_injective : Injective (toLinearMap : (M ≃ₛₗ[σ] M₂) → M →ₛₗ[σ] M₂)

{R : Type u_1}
{S : Type u_7}
{M : Type u_8}
{M₂ : Type u_10}
[Semiring R]
[Semiring S]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module S M₂]
{σ : R →+* S}
{σ' : S →+* R}
[RingHomInvPair σ σ']
[RingHomInvPair σ' σ]


theorem contDiffOn_univBall_symm :
    ContDiffOn ℝ n (univBall c r).symm (ball c r)

{n : ℕ∞}
{E : Type u_1}
[NormedAddCommGroup E]
[InnerProductSpace ℝ E]
{c : E}
{r : ℝ}

ContDiffOn ℝ n (↑(PartialHomeomorph.univBall c r).symm) (Metric.ball c r)


theorem getElem?_append {l₁ l₂ : List α} {n : Nat} (hn : n < l₁.length) :
    (l₁ ++ l₂)[n]? = l₁[n]?

{α : Type u_1}
{l₁ l₂ : List α}
{n : Nat}
(hn : n < l₁.length)


theorem rightAngleRotation_map' {F : Type*} [NormedAddCommGroup F] [InnerProductSpace ℝ F]
    [Fact (finrank ℝ F = 2)] (φ : E ≃ₗᵢ[ℝ] F) :
    (Orientation.map (Fin 2) φ.toLinearEquiv o).rightAngleRotation =
      (φ.symm.trans o.rightAngleRotation).trans φ

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

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

((Orientation.map (Fin 2) φ.toLinearEquiv) o).rightAngleRotation = (φ.symm.trans o.rightAngleRotation).trans φ


/-- The property that there exists a universal derivation for
a morphism of presheaves of commutative rings `S ⟶ F.op ⋙ R`. -/
class HasDifferentials : Prop where
  exists_universal_derivation : ∃ (M : PresheafOfModules.{u} (R ⋙ forget₂ _ _))
      (d : M.Derivation φ), Nonempty d.Universal

[self : PresheafOfModules.HasDifferentials φ]


theorem image_mul_right_Ioo (a b : α) {c : α} (h : 0 < c) :
    (fun x => x * c) '' Ioo a b = Ioo (a * c) (b * c)

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

(fun x => x * c) '' Set.Ioo a b = Set.Ioo (a * c) (b * c)


theorem heq_iff_coe_eq (h : ∀ x, p x ↔ q x) {a1 : { x // p x }} {a2 : { x // q x }} :
    HEq a1 a2 ↔ (a1 : α) = (a2 : α)

{α : Sort u_1}
{p q : α → Prop}
(h : ∀ (x : α), p x ↔ q x)
{a1 : { x // p x }}
{a2 : { x // q x }}


@[to_additive]
theorem nontrivial_iff_exists_ne_one (H : Subgroup G) : Nontrivial H ↔ ∃ x ∈ H, x ≠ (1 : G)

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


@[to_additive]
theorem IsCompact.smul {α β} [SMul α β] [TopologicalSpace β] [ContinuousConstSMul α β] (a : α)
    {s : Set β} (hs : IsCompact s) : IsCompact (a • s)

{α : Type u_4}
{β : Type u_5}
[SMul α β]
[TopologicalSpace β]
[ContinuousConstSMul α β]
(a : α)
{s : Set β}
(hs : IsCompact s)


@[simp]
theorem mk_zpow (hx : 0 ≤ x) (n : ℤ) :
    (⟨x, hx⟩ : { x : α // 0 ≤ x }) ^ n = ⟨x ^ n, zpow_nonneg hx n⟩

{α : Type u_1}
[LinearOrderedSemifield α]
{x : α}
(hx : 0 ≤ x)
(n : ℤ)


@[simp] theorem foldr_push' (f : α → β → β) (init : β) (arr : Array α) (a : α) :
    (arr.push a).foldr f init (start := arr.size + 1) = arr.foldr f (f a init)

{α : Type u_1}
{β : Type u_2}
(f : α → β → β)
(init : β)
(arr : Array α)
(a : α)

Array.foldr f init (arr.push a) (arr.size + 1) = Array.foldr f (f a init) arr arr.size


@[simp]
lemma one_ev (i j : I) {T : C} (a : T ⟶ U i) (b : T ⟶ U j) :
    (1 : OneCochain G U).ev i j a b = 1

{C : Type u}
[CategoryTheory.Category.{v, u} C]
(G : CategoryTheory.Functor Cᵒᵖ Grp)
{I : Type w'}
(U : I → C)
(i j : I)
{T : C}
(a : T ⟶ U i)
(b : T ⟶ U j)

CategoryTheory.PresheafOfGroups.OneCochain.ev 1 i j a b = 1


@[to_additive (attr := measurability)]
theorem AEMeasurable.const_mul [MeasurableMul M] (hf : AEMeasurable f μ) (c : M) :
    AEMeasurable (fun x => c * f x) μ

{M : Type u_2}
{α : Type u_3}
[MeasurableSpace M]
[Add M]
{m : MeasurableSpace α}
{f : α → M}
{μ : MeasureTheory.Measure α}
[MeasurableAdd M]
(hf : AEMeasurable f μ)
(c : M)


theorem dense_or_discrete [LinearOrder α] (a₁ a₂ : α) :
    (∃ a, a₁ < a ∧ a < a₂) ∨ (∀ a, a₁ < a → a₂ ≤ a) ∧ ∀ a < a₂, a ≤ a₁

{α : Type u_2}
[LinearOrder α]
(a₁ a₂ : α)

(∃ a, a₁ < a ∧ a < a₂) ∨ (∀ (a : α), a₁ < a → a₂ ≤ a) ∧ ∀ (a : α), a < a₂ → a ≤ a₁


/-- A snake input in an abelian category `C` consists of morphisms
of short complexes `L₀ ⟶ L₁ ⟶ L₂ ⟶ L₃` (which should be visualized vertically) such
that `L₀` and `L₃` are respectively the kernel and the cokernel of `L₁ ⟶ L₂`,
`L₁` and `L₂` are exact, `L₁.g` is epi and `L₂.f` is mono. -/
structure SnakeInput where
  /-- the zeroth row -/
  L₀ : ShortComplex C
  /-- the first row -/
  L₁ : ShortComplex C
  /-- the second row -/
  L₂ : ShortComplex C
  /-- the third row -/
  L₃ : ShortComplex C
  /-- the morphism from the zeroth row to the first row -/
  v₀₁ : L₀ ⟶ L₁
  /-- the morphism from the first row to the second row -/
  v₁₂ : L₁ ⟶ L₂
  /-- the morphism from the second row to the third row -/
  v₂₃ : L₂ ⟶ L₃
  w₀₂ : v₀₁ ≫ v₁₂ = 0 := by aesop_cat
  w₁₃ : v₁₂ ≫ v₂₃ = 0 := by aesop_cat
  /-- `L₀` is the kernel of `v₁₂ : L₁ ⟶ L₂`. -/
  h₀ : IsLimit (KernelFork.ofι _ w₀₂)
  /-- `L₃` is the cokernel of `v₁₂ : L₁ ⟶ L₂`. -/
  h₃ : IsColimit (CokernelCofork.ofπ _ w₁₃)
  L₁_exact : L₁.Exact
  epi_L₁_g : Epi L₁.g
  L₂_exact : L₂.Exact
  mono_L₂_f : Mono L₂.f

(self : CategoryTheory.ShortComplex.SnakeInput C)


@[to_additive]
theorem map_iSup {ι : Sort*} (f : M →ₙ* N) (s : ι → Subsemigroup M) :
    (iSup s).map f = ⨆ i, (s i).map f

{M : Type u_1}
{N : Type u_2}
[Mul M]
[Mul N]
{ι : Sort u_5}
(f : M →ₙ* N)
(s : ι → Subsemigroup M)

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


@[to_additive]
theorem swap_mem_mulAntidiagonal :
    x.swap ∈ Finset.mulAntidiagonal hs ht a ↔ x ∈ Finset.mulAntidiagonal ht hs a

{α : Type u_1}
[OrderedCancelAddCommMonoid α]
{s t : Set α}
{hs : s.IsPWO}
{ht : t.IsPWO}
{a : α}
{x : α × α}

x.swap ∈ Finset.addAntidiagonal hs ht a ↔ x ∈ Finset.addAntidiagonal ht hs a


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

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

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


/-- Each element of the group defines a multiplicative monoid isomorphism.

This is a stronger version of `MulAction.toPermHom`. -/
@[simps]
def MulDistribMulAction.toMulAut : α →* MulAut β

(α : Type u)
(β : Type v)
[Group α]
[Monoid β]
[MulDistribMulAction α β]
(x : α)

(MulDistribMulAction.toMulAut α β) x = MulDistribMulAction.toMulEquiv β x


theorem frontier_preimage_im (s : Set ℝ) : frontier (im ⁻¹' s) = im ⁻¹' frontier s

frontier (Complex.im ⁻¹' s) = Complex.im ⁻¹' frontier s


theorem t0Space_iff_uniformity :
    T0Space α ↔ ∀ x y, (∀ r ∈ 𝓤 α, (x, y) ∈ r) → x = y

T0Space α ↔ ∀ (x y : α), (∀ r ∈ 𝓤 α, (x, y) ∈ r) → x = y


/-- The Landau notation `f =o[l] g` where `f` and `g` are two functions on a type `α` and `l` is
a filter on `α`, means that eventually for `l`, `‖f‖` is bounded by an arbitrarily small constant
multiple of `‖g‖`. In other words, `‖f‖ / ‖g‖` tends to `0` along `l`, modulo division by zero
issues that are avoided by this definition. -/
irreducible_def IsLittleO (l : Filter α) (f : α → E) (g : α → F) : Prop

{α : Type u_17}
{E : Type u_18}
{F : Type u_19}
[Norm E]
[Norm F]
(l : Filter α)
(f : α → E)
(g : α → F)

f =o[l] g = ∀ ⦃c : ℝ⦄, 0 < c → Asymptotics.IsBigOWith c l f g


theorem prod_map_seq_comm (f : Filter α) (g : Filter β) :
    (map Prod.mk f).seq g = seq (map (fun b a => (a, b)) g) f

{α : Type u}
{β : Type v}
(f : Filter α)
(g : Filter β)

(Filter.map Prod.mk f).seq g = (Filter.map (fun b a => (a, b)) g).seq f


theorem u_bot [PartialOrder α] [Preorder β] [OrderBot α] [OrderBot β] (gi : GaloisCoinsertion l u) :
    u ⊥ = ⊥

{α : Type u}
{β : Type v}
{l : α → β}
{u : β → α}
[PartialOrder α]
[Preorder β]
[OrderBot α]
[OrderBot β]
(gi : GaloisCoinsertion l u)


theorem count_finsupp_prod (exps : HeightOneSpectrum R →₀ ℤ) :
    count K v (exps.prod (HeightOneSpectrum.asIdeal · ^ ·)) = exps v

(v : IsDedekindDomain.HeightOneSpectrum R)

(exps : IsDedekindDomain.HeightOneSpectrum R →₀ ℤ)

FractionalIdeal.count K v (exps.prod fun x x_1 => ↑x.asIdeal ^ x_1) = exps v


@[simp]
theorem inclusion_comp_decomposedTo (j : ConnectedComponents J) :
    inclusion j ⋙ decomposedTo J = Component.ι j

(j : CategoryTheory.ConnectedComponents J)

(CategoryTheory.inclusion j).comp (CategoryTheory.decomposedTo J) = CategoryTheory.Component.ι j


@[to_additive (attr := simp)] lemma leOnePart_div_oneLePart (a : α) : a⁻ᵐ / a⁺ᵐ = a⁻¹

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

a⁻ᵐ / a⁺ᵐ = a⁻¹


private theorem bracket_leibniz_lie (x y : A ⊗[R] L) (z : A ⊗[R] M) :
    ⁅x, ⁅y, z⁆⁆ = ⁅⁅x, y⁆, z⁆ + ⁅y, ⁅x, z⁆⁆

(R : Type u_1)
(A : Type u_2)
(L : Type u_3)
(M : Type u_4)
[CommRing R]
[CommRing A]
[Algebra R A]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
(x y : A ⊗[R] L)
(z : A ⊗[R] M)


@[simp] theorem uniqueBaseOn_ground : (uniqueBaseOn I E).E = E


/-- Turn a colimit for `F.leftOp : Jᵒᵖ ⥤ C` into a limit for `F : J ⥤ Cᵒᵖ`. -/
@[simps]
def isLimitConeOfCoconeLeftOp (F : J ⥤ Cᵒᵖ) {c : Cocone F.leftOp} (hc : IsColimit c) :
    IsLimit (coneOfCoconeLeftOp c)

{c : CategoryTheory.Limits.Cocone F.leftOp}

(hc : CategoryTheory.Limits.IsColimit c)

(CategoryTheory.Limits.isLimitConeOfCoconeLeftOp F hc).lift s =
  (hc.desc (CategoryTheory.Limits.coconeLeftOpOfCone s)).op


/-- A Dynkin system is a collection of subsets of a type `α` that contains the empty set,
  is closed under complementation and under countable union of pairwise disjoint sets.
  The disjointness condition is the only difference with `σ`-algebras.

  The main purpose of Dynkin systems is to provide a powerful induction rule for σ-algebras
  generated by a collection of sets which is stable under intersection.

  A Dynkin system is also known as a "λ-system" or a "d-system".
-/
structure DynkinSystem (α : Type*) where
  /-- Predicate saying that a given set is contained in the Dynkin system. -/
  Has : Set α → Prop
  /-- A Dynkin system contains the empty set. -/
  has_empty : Has ∅
  /-- A Dynkin system is closed under complementation. -/
  has_compl : ∀ {a}, Has a → Has aᶜ
  /-- A Dynkin system is closed under countable union of pairwise disjoint sets. Use a more general
  `MeasurableSpace.DynkinSystem.has_iUnion` instead. -/
  has_iUnion_nat : ∀ {f : ℕ → Set α}, Pairwise (Disjoint on f) → (∀ i, Has (f i)) → Has (⋃ i, f i)

{α : Type u_2}
(self : MeasurableSpace.DynkinSystem α)
{f : ℕ → Set α}

Pairwise (Disjoint on f) → (∀ (i : ℕ), self.Has (f i)) → self.Has (⋃ i, f i)


protected theorem unique_diff : UniqueDiffOn 𝕜 (range I)

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


@[continuity, fun_prop]
theorem Continuous.sum_elim {f : X → Z} {g : Y → Z} (hf : Continuous f) (hg : Continuous g) :
    Continuous (Sum.elim f g)

{X : Type u}
{Y : Type v}
{Z : Type u_1}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
{f : X → Z}
{g : Y → Z}
(hf : Continuous f)
(hg : Continuous g)


theorem iInf_eq_dif {p : Prop} [Decidable p] (a : p → α) :
    ⨅ h : p, a h = if h : p then a h else ⊤

{α : Type u_1}
[CompleteLattice α]
{p : Prop}
[Decidable p]
(a : p → α)

⨅ (h : p), a h = if h : p then a h else ⊤


theorem measure_diff_lt_of_lt_add (hs : MeasurableSet s) (hst : s ⊆ t) (hs' : μ s ≠ ∞) {ε : ℝ≥0∞}
    (h : μ t < μ s + ε) : μ (t \ s) < ε

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s t : Set α}
(hs : MeasurableSet s)
(hst : s ⊆ t)
(hs' : μ s ≠ ⊤)
{ε : ENNReal}
(h : μ t < μ s + ε)


theorem _root_.Function.Surjective.filter_map_top {f : α → β} (hf : Surjective f) : map f ⊤ = ⊤

{α : Type u}
{β : Type v}
{f : α → β}
(hf : Function.Surjective f)


/-- If the top-right element of a block matrix is invertible, then the whole matrix is invertible
iff the corresponding schur complement is. -/
theorem isUnit_fromBlocks_iff_of_invertible₁₁ {A : Matrix m m α} {B : Matrix m n α}
    {C : Matrix n m α} {D : Matrix n n α} [Invertible A] :
    IsUnit (fromBlocks A B C D) ↔ IsUnit (D - C * ⅟ A * B)

{m : Type u_2}
{n : Type u_3}
{α : Type u_4}
[Fintype m]
[Fintype n]
[DecidableEq m]
[DecidableEq n]
[CommRing α]
{A : Matrix m m α}
{B : Matrix m n α}
{C : Matrix n m α}
{D : Matrix n n α}
[Invertible A]

IsUnit (Matrix.fromBlocks A B C D) ↔ IsUnit (D - C * ⅟A * B)


@[to_additive]
theorem finprod_eq_dif {p : Prop} [Decidable p] (f : p → M) :
    ∏ᶠ i, f i = if h : p then f h else 1

{M : Type u_2}
[CommMonoid M]
{p : Prop}
[Decidable p]
(f : p → M)

∏ᶠ (i : p), f i = if h : p then f h else 1


theorem lapMatrix_mulVec_const_eq_zero [Ring R] : mulVec (G.lapMatrix R) (fun _ ↦ 1) = 0

{V : Type u_1}
{R : Type u_2}
[Fintype V]
[DecidableEq V]
(G : SimpleGraph V)
[DecidableRel G.Adj]
[Ring R]

(SimpleGraph.lapMatrix R G *ᵥ fun x => 1) = 0


/-- One can reformulate smoothness within a set at a point as continuity within this set at this
point, and smoothness in any chart containing that point. -/
theorem contMDiffWithinAt_iff_of_mem_source {x' : M} {y : M'} (hx : x' ∈ (chartAt H x).source)
    (hy : f x' ∈ (chartAt H' y).source) :
    ContMDiffWithinAt I I' n f s x' ↔
      ContinuousWithinAt f s x' ∧
        ContDiffWithinAt 𝕜 n (extChartAt I' y ∘ f ∘ (extChartAt I x).symm)
          ((extChartAt I x).symm ⁻¹' s ∩ range I) (extChartAt I x x')

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
[SmoothManifoldWithCorners I M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M' : Type u_7}
[TopologicalSpace M']
[ChartedSpace H' M']
[SmoothManifoldWithCorners I' M']
{f : M → M'}
{s : Set M}
{x : M}
{n : ℕ∞}
{x' : M}
{y : M'}
(hx : x' ∈ (chartAt H x).source)
(hy : f x' ∈ (chartAt H' y).source)

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


theorem length_subsingleton_iff {s : Cycle α} : Subsingleton s ↔ length s ≤ 1


@[to_additive]
theorem _root_.Semigroup.mem_center_iff {z : M} :
    z ∈ Set.center M ↔ ∀ g, g * z = z * g

z ∈ Set.center M ↔ ∀ (g : M), g * z = z * g


@[simp]
theorem coe_commutant (S : VonNeumannAlgebra H) :
    ↑S.commutant = Set.centralizer (S : Set (H →L[ℂ] H))

{H : Type u}
[NormedAddCommGroup H]
[InnerProductSpace ℂ H]
[CompleteSpace H]
(S : VonNeumannAlgebra H)


@[simp]
theorem iUnion_restrict : (π.restrict J).iUnion = (J : Set (ι → ℝ)) ∩ (π.iUnion)

{ι : Type u_1}
{I J : BoxIntegral.Box ι}
(π : BoxIntegral.Prepartition I)


@[simp]
theorem isIdealMorphism_def : f.IsIdealMorphism ↔ (f.idealRange : LieSubalgebra R L') = f.range

{R : Type u}
{L : Type v}
{L' : Type w₂}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[LieRing L']
[LieAlgebra R L']
(f : L →ₗ⁅R⁆ L')

f.IsIdealMorphism ↔ lieIdealSubalgebra R L' f.idealRange = f.range


@[simp]
theorem untrop_pow {α : Type*} [SMul α R] (x : Tropical R) (n : α) :
    untrop (x ^ n) = n • untrop x

{R : Type u}
{α : Type u_1}
[SMul α R]
(x : Tropical R)
(n : α)

Tropical.untrop (x ^ n) = n • Tropical.untrop x


theorem coe_def : (φ : PowerSeries R) = PowerSeries.mk (coeff φ)

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


theorem Filter.EventuallyEq.isLocalExtrOn_iff {f g : α → β} {a : α} (heq : f =ᶠ[𝓝[s] a] g)
    (hmem : a ∈ s) : IsLocalExtrOn f s a ↔ IsLocalExtrOn g s a

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[Preorder β]
{s : Set α}
{f g : α → β}
{a : α}
(heq : f =ᶠ[𝓝[s] a] g)
(hmem : a ∈ s)


@[simp]
theorem tmul_comp_tensorMap
    {Q₁ : QuadraticForm R M₁} {Q₂ : QuadraticForm R M₂}
    {Q₃ : QuadraticForm R M₃} {Q₄ : QuadraticForm R M₄}
    (f : Q₁ →qᵢ Q₂) (g : Q₃ →qᵢ Q₄) :
    (Q₂.tmul Q₄).comp (TensorProduct.map f.toLinearMap g.toLinearMap) = Q₁.tmul Q₃

{R : Type uR}
{M₁ : Type uM₁}
{M₂ : Type uM₂}
{M₃ : Type uM₃}
{M₄ : Type uM₄}
[CommRing R]
[AddCommGroup M₁]
[AddCommGroup M₂]
[AddCommGroup M₃]
[AddCommGroup M₄]
[Module R M₁]
[Module R M₂]
[Module R M₃]
[Module R M₄]
[Invertible 2]
{Q₁ : QuadraticForm R M₁}
{Q₂ : QuadraticForm R M₂}
{Q₃ : QuadraticForm R M₃}
{Q₄ : QuadraticForm R M₄}
(f : Q₁ →qᵢ Q₂)
(g : Q₃ →qᵢ Q₄)

QuadraticMap.comp (Q₂.tmul Q₄) (TensorProduct.map f.toLinearMap g.toLinearMap) = Q₁.tmul Q₃


@[simp]
theorem add_im (z w : ℤ√d) : (z + w).im = z.im + w.im


@[to_additive]
lemma smul_left_cancel (g : α) {x y : β} (h : g • x = g • y) : x = y

{α : Type u_1}
{β : Type u_2}
[AddGroup α]
[AddAction α β]
(g : α)
{x y : β}
(h : g +ᵥ x = g +ᵥ y)


@[simp]
lemma negOnePow_mul_self (n : ℤ) : (n * n).negOnePow = n.negOnePow


@[to_additive]
theorem tprod_le_of_prod_le (hf : Multipliable f) (h : ∀ s, ∏ i ∈ s, f i ≤ a₂) : ∏' i, f i ≤ a₂

(h : ∀ (s : Finset ι), ∑ i ∈ s, f i ≤ a₂)


/-- The **Schwarz Lemma**: if `f : ℂ → ℂ` sends an open disk of positive radius to itself and the
center of this disk to itself, then the absolute value of the derivative of `f` at the center of
this disk is at most `1`. -/
theorem abs_deriv_le_one_of_mapsTo_ball (hd : DifferentiableOn ℂ f (ball c R))
    (h_maps : MapsTo f (ball c R) (ball c R)) (hc : f c = c) (h₀ : 0 < R) : abs (deriv f c) ≤ 1

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

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


@[simp]
theorem ofSet_eq_some_iff {s : Set α} {_ : DecidablePred (· ∈ s)} {a b : α} :
    ofSet s b = some a ↔ a = b ∧ a ∈ s

∀ {x : DecidablePred fun x => x ∈ s} {a b : α}, (PEquiv.ofSet s) b = some a ↔ a = b ∧ a ∈ s


@[to_additive]
theorem op_sInf (S : Set (Submonoid M)) : (sInf S).op = sInf (.unop ⁻¹' S)

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

(sInf S).op = sInf (AddSubmonoid.unop ⁻¹' S)


lemma neg_iff_exists_ofReal : z < 0 ↔ ∃ x < (0 : ℝ), x = z


theorem uniformContinuous_neg : UniformContinuous (@Neg.neg ℚ _)


theorem mem_perpBisector_iff_dist_eq' : c ∈ perpBisector p₁ p₂ ↔ dist p₁ c = dist p₂ c

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

c ∈ AffineSubspace.perpBisector p₁ p₂ ↔ dist p₁ c = dist p₂ c


@[simp]
lemma slope_of_X_ne {x₁ x₂ y₁ y₂ : F} (hx : x₁ ≠ x₂) :
    W.slope x₁ x₂ y₁ y₂ = (y₁ - y₂) / (x₁ - x₂)

{F : Type u}
[Field F]
{W : WeierstrassCurve.Affine F}
{x₁ x₂ y₁ y₂ : F}
(hx : x₁ ≠ x₂)


@[to_additive]
protected lemma mul_div_cancel (h : IsUnit a) (b : α) : a * (b / a) = b

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


/--
A `PreSubmersivePresentation` of an `R`-algebra `S` is a `Presentation`
with finitely-many relations equipped with an injective `map : relations → vars`.

This map determines how the differential of `P` is constructed. See
`PreSubmersivePresentation.differential` for details.
-/
@[nolint checkUnivs]
structure PreSubmersivePresentation extends Algebra.Presentation.{t, w} R S where
  /-- A map from the relations type to the variables type. Used to compute the differential. -/
  map : rels → vars
  map_inj : Function.Injective map
  relations_finite : Finite rels

(self : Algebra.PreSubmersivePresentation R S)


lemma erase_sup_Iic (ha : a ∈ s) (has : ∀ b ∈ s, a ≤ b → b = a) : s.erase a ⊔ Iic a = s

{α : Type u_1}
[Preorder α]
{s : LowerSet α}
{a : α}
(ha : a ∈ s)
(has : ∀ b ∈ s, a ≤ b → b = a)


theorem toComplex_add (x y : ℤ[i]) : ((x + y : ℤ[i]) : ℂ) = x + y

GaussianInt.toComplex (x + y) = GaussianInt.toComplex x + GaussianInt.toComplex y


theorem eventually_not : (∀ᶠ x in f, ¬p x) ↔ ¬∀ᶠ x in f, p x

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

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


theorem continuousWithinAt_const {b : β} {s : Set α} {x : α} :
    ContinuousWithinAt (fun _ : α => b) s x

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
{b : β}
{s : Set α}
{x : α}


lemma preimage_val_eq_univ_of_subset (h : A ⊆ B) : A ↓∩ B = univ

{α : Type u_2}
{A B : Set α}
(h : A ⊆ B)


theorem exists_Icc_mem_subset_of_mem_nhdsWithin_Iic [OrderTopology α] {a : α} {s : Set α}
    (hs : s ∈ 𝓝[≤] a) : ∃ b ≤ a, Icc b a ∈ 𝓝[≤] a ∧ Icc b a ⊆ s

{α : Type u}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
{a : α}
{s : Set α}
(hs : s ∈ 𝓝[≤] a)

∃ b ≤ a, Set.Icc b a ∈ 𝓝[≤] a ∧ Set.Icc b a ⊆ s


lemma CompletelyRegularSpace.exists_BCNN {X : Type*} [TopologicalSpace X] [CompletelyRegularSpace X]
    {K : Set X} (K_closed : IsClosed K) {x : X} (x_notin_K : x ∉ K) :
    ∃ (f : X →ᵇ ℝ≥0), f x = 1 ∧ (∀ y ∈ K, f y = 0)

{X : Type u_1}
[TopologicalSpace X]
[CompletelyRegularSpace X]
{K : Set X}
(K_closed : IsClosed K)
{x : X}
(x_notin_K : x ∉ K)


theorem nndist_le_of_le (hf : HolderWith C r f) {x y : X} {d : ℝ≥0} (hd : nndist x y ≤ d) :
    nndist (f x) (f y) ≤ C * d ^ (r : ℝ)

{X : Type u_1}
{Y : Type u_2}
[PseudoMetricSpace X]
[PseudoMetricSpace Y]
{C r : ℝ≥0}
{f : X → Y}
(hf : HolderWith C r f)
{x y : X}
{d : ℝ≥0}
(hd : nndist x y ≤ d)


/-- A `FloorRing` is a linear ordered ring over `α` with a function
`floor : α → ℤ` satisfying `∀ (z : ℤ) (a : α), z ≤ floor a ↔ (z : α) ≤ a)`.
-/
class FloorRing (α) [LinearOrderedRing α] where
  /-- `FloorRing.floor a` computes the greatest integer `z` such that `(z : α) ≤ a`. -/
  floor : α → ℤ
  /-- `FloorRing.ceil a` computes the least integer `z` such that `a ≤ (z : α)`. -/
  ceil : α → ℤ
  /-- `FloorRing.ceil` is the upper adjoint of the coercion `↑ : ℤ → α`. -/
  gc_coe_floor : GaloisConnection (↑) floor
  /-- `FloorRing.ceil` is the lower adjoint of the coercion `↑ : ℤ → α`. -/
  gc_ceil_coe : GaloisConnection ceil (↑)

{α : Type u_4}
[LinearOrderedRing α]
[self : FloorRing α]


@[simp]
lemma N₂Γ₂ToKaroubiIso_inv_app (X : ChainComplex C ℕ) :
    (N₂Γ₂ToKaroubiIso.inv.app X).f = PInfty

(AlgebraicTopology.DoldKan.N₂Γ₂ToKaroubiIso.inv.app X).f = AlgebraicTopology.DoldKan.PInfty


theorem inner_self_conj (x : E) : ⟪x, x⟫† = ⟪x, x⟫

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


@[to_additive (attr := fun_prop, aesop safe 20 apply (rule_sets := [Measurable]))]
theorem Measurable.div [MeasurableDiv₂ G] (hf : Measurable f) (hg : Measurable g) :
    Measurable fun a => f a / g a

{G : Type u_2}
{α : Type u_3}
[MeasurableSpace G]
[Sub G]
{m : MeasurableSpace α}
{f g : α → G}
[MeasurableSub₂ G]
(hf : Measurable f)
(hg : Measurable g)


@[simp]
theorem mop_unmop {X Y : Cᴹᵒᵖ} {f : X ⟶ Y} : f.unmop.mop = f

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{X Y : Cᴹᵒᵖ}
{f : X ⟶ Y}


@[simp]
theorem sin_sub_pi (θ : Angle) : sin (θ - π) = -sin θ


@[simp, norm_cast]
theorem coe_centralizer (s : Set A) : (centralizer R s : Set A) = (s ∪ star s).centralizer

(R : Type u_2)
{A : Type u_3}
[CommSemiring R]
[StarRing R]
[Semiring A]
[StarRing A]
[Algebra R A]
[StarModule R A]
(s : Set A)

↑(StarSubalgebra.centralizer R s) = (s ∪ star s).centralizer


theorem Indep.exists_basis_subset_union_basis (hI : M.Indep I) (hIX : I ⊆ X) (hJ : M.Basis J X) :
    ∃ I', M.Basis I' X ∧ I ⊆ I' ∧ I' ⊆ I ∪ J

{α : Type u_1}
{M : Matroid α}
{I X J : Set α}
(hI : M.Indep I)
(hIX : I ⊆ X)
(hJ : M.Basis J X)


theorem apply_eq_pow_smul_coeff : (p n fun _ => z) = z ^ n • p.coeff n

{𝕜 : Type u}
{E : Type v}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{p : FormalMultilinearSeries 𝕜 𝕜 E}
{n : ℕ}
{z : 𝕜}


private theorem le_mul_iff_eq_zero_of_nonneg_of_neg_of_nonneg {α} [LinearOrderedSemiring α]
    {a b c : α} (ha : 0 ≤ a) (hb : b < 0) (hc : 0 ≤ c) : a ≤ b * c ↔ a = 0 ∧ c = 0

{α : Type u_5}
[LinearOrderedSemiring α]
{a b c : α}
(ha : 0 ≤ a)
(hb : b < 0)
(hc : 0 ≤ c)


theorem inducing_sigma_map {f₁ : ι → κ} {f₂ : ∀ i, σ i → τ (f₁ i)} (h₁ : Injective f₁) :
    Inducing (Sigma.map f₁ f₂) ↔ ∀ i, Inducing (f₂ i)

{ι : Type u_5}
{κ : Type u_6}
{σ : ι → Type u_7}
{τ : κ → Type u_8}
[(i : ι) → TopologicalSpace (σ i)]
[(k : κ) → TopologicalSpace (τ k)]
{f₁ : ι → κ}
{f₂ : (i : ι) → σ i → τ (f₁ i)}
(h₁ : Function.Injective f₁)

Inducing (Sigma.map f₁ f₂) ↔ ∀ (i : ι), Inducing (f₂ i)


theorem Filter.Tendsto.fst_nhds {l : Filter X} {f : X → Y × Z} {p : Y × Z}
    (h : Tendsto f l (𝓝 p)) : Tendsto (fun a ↦ (f a).1) l (𝓝 <| p.1)

{X : Type u}
{Y : Type v}
{Z : Type u_1}
[TopologicalSpace Y]
[TopologicalSpace Z]
{l : Filter X}
{f : X → Y × Z}
{p : Y × Z}
(h : Filter.Tendsto f l (𝓝 p))

Filter.Tendsto (fun a => (f a).1) l (𝓝 p.1)


@[csimp] theorem zipWithLeft_eq_zipWithLeftTR : @zipWithLeft = @zipWithLeftTR


theorem factorial_mul_ascPochhammer (S : Type*) [Semiring S] (r n : ℕ) :
    (r ! : S) * (ascPochhammer S n).eval (r + 1 : S) = (r + n)!

↑r.factorial * Polynomial.eval (↑r + 1) (ascPochhammer S n) = ↑(r + n).factorial


theorem summable_matrix_blockDiagonal [DecidableEq p] {f : X → p → Matrix m n R} :
    (Summable fun x => blockDiagonal (f x)) ↔ Summable f

{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}

(Summable fun x => Matrix.blockDiagonal (f x)) ↔ Summable f


theorem integrable_add_of_disjoint {f g : α → E} (h : Disjoint (support f) (support g))
    (hf : StronglyMeasurable f) (hg : StronglyMeasurable g) :
    Integrable (f + g) μ ↔ Integrable f μ ∧ Integrable g μ

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

(hf : MeasureTheory.StronglyMeasurable f)

(hg : MeasureTheory.StronglyMeasurable g)

MeasureTheory.Integrable (f + g) μ ↔ MeasureTheory.Integrable f μ ∧ MeasureTheory.Integrable g μ


theorem perm_cons_append_cons {l l₁ l₂ : List α} (a : α) (p : l ~ l₁ ++ l₂) :
    a :: l ~ l₁ ++ a :: l₂

{α : Type u_1}
{l l₁ l₂ : List α}
(a : α)
(p : l ~ l₁ ++ l₂)


theorem isBounded_iff_subset_ball (c : α) : IsBounded s ↔ ∃ r, s ⊆ ball c r

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

Bornology.IsBounded s ↔ ∃ r, s ⊆ Metric.ball c r


@[to_additive]
theorem prod_mul_tprod_nat_mul'
    {f : ℕ → M} {k : ℕ} (h : Multipliable (fun n ↦ f (n + k))) :
    ((∏ i ∈ range k, f i) * ∏' i, f (i + k)) = ∏' i, f i

{M : Type u_1}
[CommMonoid M]
[TopologicalSpace M]
[T2Space M]
[ContinuousMul M]
{f : ℕ → M}
{k : ℕ}
(h : Multipliable fun n => f (n + k))

(∏ i ∈ Finset.range k, f i) * ∏' (i : ℕ), f (i + k) = ∏' (i : ℕ), f i


@[to_additive]
theorem lt_mul_of_one_lt_of_le [CovariantClass α α (swap (· * ·)) (· < ·)] {a b c : α} (ha : 1 < a)
    (hbc : b ≤ c) :
    b < a * c

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


theorem geom_sum_Ico_mul_neg [Ring α] (x : α) {m n : ℕ} (hmn : m ≤ n) :
    (∑ i ∈ Finset.Ico m n, x ^ i) * (1 - x) = x ^ m - x ^ n

{α : Type u}
[Ring α]
(x : α)
{m n : ℕ}
(hmn : m ≤ n)


@[simp]
theorem mop_unmop (X : Cᴹᵒᵖ) : mop (unmop X) = X


theorem comp_comp {M'' : Type*} [AddCommMonoid M''] [Module R M''] (B : BilinForm R M'')
    (l r : M →ₗ[R] M') (l' r' : M' →ₗ[R] M'') :
    (B.comp l' r').comp l r = B.comp (l'.comp l) (r'.comp r)

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
{M' : Type w}
[AddCommMonoid M']
[Module R M']
{M'' : Type u_7}
[AddCommMonoid M'']
[Module R M'']
(B : LinearMap.BilinForm R M'')
(l r : M →ₗ[R] M')
(l' r' : M' →ₗ[R] M'')

(B.comp l' r').comp l r = B.comp (l' ∘ₗ l) (r' ∘ₗ r)


@[to_additive (attr := simp)]
theorem _root_.Submonoid.exponent_top :
    Monoid.exponent (⊤ : Submonoid G) = Monoid.exponent G

AddMonoid.exponent ↥⊤ = AddMonoid.exponent G


@[simp]
theorem spanCompIso_hom_app_zero : (spanCompIso F f g).hom.app WalkingSpan.zero = 𝟙 _

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

(CategoryTheory.Limits.spanCompIso F f g).hom.app CategoryTheory.Limits.WalkingSpan.zero =
  𝟙 ((CategoryTheory.Limits.span f g ⋙ F).obj CategoryTheory.Limits.WalkingSpan.zero)


/-- The restriction of an open cover to an open subset. -/
@[simps! J obj map]
noncomputable
def Scheme.OpenCover.restrict {X : Scheme.{u}} (𝒰 : X.OpenCover) (U : Opens X) :
    U.toScheme.OpenCover

{X : AlgebraicGeometry.Scheme}
(𝒰 : X.OpenCover)
(U : X.Opens)

∀ (x : 𝒰.J), (𝒰.restrict U).map x = 𝒰.map x ∣_ U


theorem wbtw_smul_vadd_smul_vadd_of_nonpos_of_le (x : P) (v : V) {r₁ r₂ : R} (hr₁ : r₁ ≤ 0)
    (hr₂ : r₂ ≤ r₁) : Wbtw R x (r₁ • v +ᵥ x) (r₂ • v +ᵥ x)

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[LinearOrderedField R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
(x : P)
(v : V)
{r₁ r₂ : R}
(hr₁ : r₁ ≤ 0)
(hr₂ : r₂ ≤ r₁)


/-- This is the Beck cofork. It is a split coequalizer, in particular a coequalizer. -/
@[simps! pt]
def beckCofork : Cofork (T.map X.a) (T.μ.app _)

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

(CategoryTheory.Monad.beckCofork X).pt = X.A


@[to_additive]
theorem mul_div_right_comm : a * b / c = a / c * b

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


theorem lowerCentralSeriesLast_le_of_not_isTrivial [IsNilpotent R L M] (h : ¬ IsTrivial L M) :
    lowerCentralSeriesLast R L M ≤ lowerCentralSeries R L M 1

(R : Type u)
(L : Type v)
(M : Type w)
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule.IsNilpotent R L M]
(h : ¬LieModule.IsTrivial L M)

LieModule.lowerCentralSeriesLast R L M ≤ LieModule.lowerCentralSeries R L M 1


theorem im_ofReal_mul (r : ℝ) (z : ℂ) : (r * z).im = r * z.im


/-- Every diagram indexing a pushout is naturally isomorphic (actually, equal) to a `span` -/
-- @[simps (config := { rhsMd := semireducible })]  Porting note: no semireducible
@[simps!]
def diagramIsoSpan (F : WalkingSpan ⥤ C) : F ≅ span (F.map fst) (F.map snd)

(F : CategoryTheory.Limits.WalkingSpan ⥤ C)

(CategoryTheory.Limits.diagramIsoSpan F).inv.app X = CategoryTheory.eqToHom ⋯


protected theorem hasBasis_nhds_zero_of_basis [TopologicalSpace F] [TopologicalAddGroup F]
    {ι : Type*} {p : ι → Prop} {b : ι → Set F} (h : (𝓝 0 : Filter F).HasBasis p b) :
    (𝓝 (0 : E →SL[σ] F)).HasBasis (fun Si : Set E × ι => Bornology.IsVonNBounded 𝕜₁ Si.1 ∧ p Si.2)
      fun Si => { f : E →SL[σ] F | ∀ x ∈ Si.1, f x ∈ b Si.2 }

{𝕜₁ : Type u_1}
{𝕜₂ : Type u_2}
[NormedField 𝕜₁]
[NormedField 𝕜₂]
{σ : 𝕜₁ →+* 𝕜₂}
{E : Type u_4}
{F : Type u_5}
[AddCommGroup E]
[Module 𝕜₁ E]
[AddCommGroup F]
[Module 𝕜₂ F]
[TopologicalSpace E]
[TopologicalSpace F]
[TopologicalAddGroup F]
{ι : Type u_7}
{p : ι → Prop}
{b : ι → Set F}
(h : (𝓝 0).HasBasis p b)

(𝓝 0).HasBasis (fun Si => Bornology.IsVonNBounded 𝕜₁ Si.1 ∧ p Si.2) fun Si => {f | ∀ x ∈ Si.1, f x ∈ b Si.2}


/-- Equivalence between `Fin n` and `{ i // i < n }`. -/
@[simps apply symm_apply]
def equivSubtype : Fin n ≃ { i // i < n }


/-- The pseudoelement induced by an arrow is zero precisely when that arrow is zero. -/
theorem pseudoZero_iff {P : C} (a : Over P) : a = (0 : P) ↔ a.hom = 0

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Abelian C]
{P : C}
(a : CategoryTheory.Over P)

Quot.mk (CategoryTheory.Abelian.PseudoEqual P) a = 0 ↔ a.hom = 0


@[simp]
theorem coe_unitOfCoprime {n : ℕ} (x : ℕ) (h : Nat.Coprime x n) :
    (unitOfCoprime x h : ZMod n) = x


theorem liminf_le_of_frequently_le' {α β} [CompleteLattice β] {f : Filter α} {u : α → β} {x : β}
    (h : ∃ᶠ a in f, u a ≤ x) : liminf u f ≤ x

{α : Type u_6}
{β : Type u_7}
[CompleteLattice β]
{f : Filter α}
{u : α → β}
{x : β}
(h : ∃ᶠ (a : α) in f, u a ≤ x)


theorem outerMeasure_le_iff {m : OuterMeasure α} : m ≤ μ.1 ↔ ∀ s, MeasurableSet s → m s ≤ μ s

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

m ≤ μ.toOuterMeasure ↔ ∀ (s : Set α), MeasurableSet s → m s ≤ μ s


theorem derivFamily_limit (f : ι → Ordinal → Ordinal) {o} :
    IsLimit o → derivFamily.{u, v} f o = bsup.{max u v, u} o fun a _ => derivFamily.{u, v} f a

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

o.IsLimit → Ordinal.derivFamily f o = o.bsup fun a x => Ordinal.derivFamily f a


protected nonrec theorem HasDerivAtFilter.star (h : HasDerivAtFilter f f' x L) :
    HasDerivAtFilter (fun x => star (f x)) (star f') x L

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : 𝕜 → F}
[StarRing 𝕜]
[TrivialStar 𝕜]
[StarAddMonoid F]
[ContinuousStar F]
[StarModule 𝕜 F]
{f' : F}
{x : 𝕜}
{L : Filter 𝕜}
(h : HasDerivAtFilter f f' x L)


/-- Nonzero divisors have valuation greater than zero. -/
theorem intValuation_zero_le (x : nonZeroDivisors R) : 0 < v.intValuationDef x

(v : IsDedekindDomain.HeightOneSpectrum R)


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

{E : Type u_4}
[Group E]
{p q : GroupNorm E}


theorem contDiff_top : ContDiff 𝕜 ∞ f ↔ ∀ n : ℕ, ContDiff 𝕜 n f

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

ContDiff 𝕜 ⊤ f ↔ ∀ (n : ℕ), ContDiff 𝕜 (↑n) f


theorem toIcoMod_zero_one (b : α) : toIcoMod (zero_lt_one' α) 0 b = Int.fract b

{α : Type u_1}
[LinearOrderedField α]
[FloorRing α]
(b : α)


/-- A very useful criterion to show that a space is complete is to show that all sequences
which satisfy a bound of the form `edist (u n) (u m) < B N` for all `n m ≥ N` are
converging. This is often applied for `B N = 2^{-N}`, i.e., with a very fast convergence to
`0`, which makes it possible to use arguments of converging series, while this is impossible
to do in general for arbitrary Cauchy sequences. -/
theorem complete_of_convergent_controlled_sequences (B : ℕ → ℝ≥0∞) (hB : ∀ n, 0 < B n)
    (H : ∀ u : ℕ → α, (∀ N n m : ℕ, N ≤ n → N ≤ m → edist (u n) (u m) < B N) →
      ∃ x, Tendsto u atTop (𝓝 x)) :
    CompleteSpace α

(B : ℕ → ℝ≥0∞)

(H : ∀ (u : ℕ → α), (∀ (N n m : ℕ), N ≤ n → N ≤ m → edist (u n) (u m) < B N) → ∃ x, Filter.Tendsto u Filter.atTop (𝓝 x))


@[simp]
lemma addOppositeEquiv_symm_orderTop (x : (HahnSeries Γ R)ᵃᵒᵖ) :
    (addOppositeEquiv.symm x).orderTop = x.unop.orderTop

{Γ : Type u_1}
{R : Type u_2}
[PartialOrder Γ]
[AddMonoid R]
(x : (HahnSeries Γ R)ᵃᵒᵖ)

(HahnSeries.addOppositeEquiv.symm x).orderTop = (AddOpposite.unop x).orderTop


theorem Basis.card_le_card_of_submodule (N : Submodule R M) [Fintype ι] (b : Basis ι R M)
    [Fintype ι'] (b' : Basis ι' R N) : Fintype.card ι' ≤ Fintype.card ι

{R : Type u}
{M : Type v}
[Ring R]
[AddCommGroup M]
[Module R M]
{ι : Type w}
{ι' : Type w'}
[StrongRankCondition R]
(N : Submodule R M)
[Fintype ι]
(b : Basis ι R M)
[Fintype ι']
(b' : Basis ι' R ↥N)


@[simp]
theorem smulRight_one_eq_iff {f f' : M₂} :
    smulRight (1 : R₁ →L[R₁] R₁) f = smulRight (1 : R₁ →L[R₁] R₁) f' ↔ f = f'

{R₁ : Type u_1}
[Semiring R₁]
{M₂ : Type u_6}
[TopologicalSpace M₂]
[AddCommMonoid M₂]
[Module R₁ M₂]
[TopologicalSpace R₁]
[ContinuousSMul R₁ M₂]
{f f' : M₂}

ContinuousLinearMap.smulRight 1 f = ContinuousLinearMap.smulRight 1 f' ↔ f = f'


theorem SetCoe.forall {s : Set α} {p : s → Prop} : (∀ x : s, p x) ↔ ∀ (x) (h : x ∈ s), p ⟨x, h⟩

{α : Type u}
{s : Set α}
{p : ↑s → Prop}

(∀ (x : ↑s), p x) ↔ ∀ (x : α) (h : x ∈ s), p ⟨x, h⟩


@[simp]
theorem span_map_fst {X Y Z : C} (f : X ⟶ Y) (g : X ⟶ Z) : (span f g).map WalkingSpan.Hom.fst = f

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

(CategoryTheory.Limits.span f g).map CategoryTheory.Limits.WalkingSpan.Hom.fst = f


theorem sInter_comap_sets (f : α → β) (F : Filter β) : ⋂₀ (comap f F).sets = ⋂ U ∈ F, f ⁻¹' U

{α : Type u}
{β : Type v}
(f : α → β)
(F : Filter β)

⋂₀ (Filter.comap f F).sets = ⋂ U ∈ F, f ⁻¹' U


theorem lintegral_eq_top_of_measure_eq_top_ne_zero {f : α → ℝ≥0∞} (hf : AEMeasurable f μ)
    (hμf : μ {x | f x = ∞} ≠ 0) : ∫⁻ x, f x ∂μ = ∞

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f : α → ℝ≥0∞}
(hf : AEMeasurable f μ)
(hμf : μ {x | f x = ⊤} ≠ 0)


protected theorem Tendsto.eventually_ne_atTop' [Preorder β] [NoMaxOrder β] {f : α → β}
    {l : Filter α} (hf : Tendsto f l atTop) (c : α) : ∀ᶠ x in l, x ≠ c

{α : Type u_3}
{β : Type u_4}
[Preorder β]
[NoMaxOrder β]
{f : α → β}
{l : Filter α}
(hf : Filter.Tendsto f l Filter.atTop)
(c : α)


/-- Composing two partial equivs if the target of the first coincides with the source of the
second. -/
@[simps]
protected def trans' (e' : PartialEquiv β γ) (h : e.target = e'.source) : PartialEquiv α γ

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
(e : PartialEquiv α β)
(e' : PartialEquiv β γ)
(h : e.target = e'.source)


/--
Given a functor `F` and a collection of colimit cocones for each diagram `X ↦ F X k`, we can stitch
them together to give a cocone for the diagram `F`.
`combinedIsColimit` shows that the new cocone is colimiting, and `evalCombined` shows it is
(essentially) made up of the original cocones.
-/
@[simps]
def combineCocones (F : J ⥤ K ⥤ C) (c : ∀ k : K, ColimitCocone (F.flip.obj k)) : Cocone F

(c : (k : K) → CategoryTheory.Limits.ColimitCocone (F.flip.obj k))

((CategoryTheory.Limits.combineCocones F c).ι.app j).app k = (c k).cocone.ι.app j


/-- Given binary relations `r, s` with `r` contained in `s`, the smallest congruence relation
    containing `s` contains the smallest congruence relation containing `r`. -/
theorem ringConGen_mono {r s : R → R → Prop} (h : ∀ x y, r x y → s x y) :
    ringConGen r ≤ ringConGen s

{R : Type u_2}
[Add R]
[Mul R]
{r s : R → R → Prop}
(h : ∀ (x y : R), r x y → s x y)


@[simp]
theorem map_comp_inlAlgHom (f : M →ₗ[R'] N) :
    (map f).comp (inlAlgHom R' R' M) = inlAlgHom R' R' N

{R' : Type u}
{M : Type v}
[CommSemiring R']
[AddCommMonoid M]
[Module R' M]
[Module R'ᵐᵒᵖ M]
[IsCentralScalar R' M]
{N : Type u_3}
[AddCommMonoid N]
[Module R' N]
[Module R'ᵐᵒᵖ N]
[IsCentralScalar R' N]
(f : M →ₗ[R'] N)

(TrivSqZeroExt.map f).comp (TrivSqZeroExt.inlAlgHom R' R' M) = TrivSqZeroExt.inlAlgHom R' R' N


theorem CountablyGenerated.sup {m₁ m₂ : MeasurableSpace β} (h₁ : @CountablyGenerated β m₁)
    (h₂ : @CountablyGenerated β m₂) : @CountablyGenerated β (m₁ ⊔ m₂)

(h₁ : MeasurableSpace.CountablyGenerated β)

(h₂ : MeasurableSpace.CountablyGenerated β)


@[to_additive apply_single₂]
theorem apply_mulSingle₂ (f' : ∀ i, f i → g i → h i) (hf' : ∀ i, f' i 1 1 = 1) (i : I)
    (x : f i) (y : g i) (j : I) :
    f' j (mulSingle i x j) (mulSingle i y j) = mulSingle i (f' i x y) j

{I : Type u}
{f : I → Type v₁}
{g : I → Type v₂}
{h : I → Type v₃}
[DecidableEq I]
[(i : I) → Zero (f i)]
[(i : I) → Zero (g i)]
[(i : I) → Zero (h i)]
(f' : (i : I) → f i → g i → h i)
(hf' : ∀ (i : I), f' i 0 0 = 0)
(i : I)
(x : f i)
(y : g i)
(j : I)

f' j (Pi.single i x j) (Pi.single i y j) = Pi.single i (f' i x y) j


@[to_additive]
theorem eq_trivial_iff {s : Set G} (hs : IsSubgroup s) : s = trivial G ↔ ∀ x ∈ s, x = (1 : G)

{G : Type u_1}
[AddGroup G]
{s : Set G}
(hs : IsAddSubgroup s)

s = IsAddSubgroup.trivial G ↔ ∀ x ∈ s, x = 0


theorem ext [Fact p.Prime] {f g} (hf : IsPoly p f) (hg : IsPoly p g)
    (h : ∀ (R : Type u) [_Rcr : CommRing R] (x : 𝕎 R) (n : ℕ),
        ghostComponent n (f x) = ghostComponent n (g x)) :
    ∀ (R : Type u) [_Rcr : CommRing R] (x : 𝕎 R), f x = g x

{f g : ⦃R : Type u⦄ → [inst : CommRing R] → WittVector p R → WittVector p R}

(h :
  ∀ (R : Type u) [_Rcr : CommRing R] (x : WittVector p R) (n : ℕ),
    (WittVector.ghostComponent n) (f x) = (WittVector.ghostComponent n) (g x))


theorem biUnion_mono {s s' : Set α} {t t' : α → Set β} (hs : s' ⊆ s) (h : ∀ x ∈ s, t x ⊆ t' x) :
    ⋃ x ∈ s', t x ⊆ ⋃ x ∈ s, t' x

{α : Type u_1}
{β : Type u_2}
{s s' : Set α}
{t t' : α → Set β}
(hs : s' ⊆ s)
(h : ∀ x ∈ s, t x ⊆ t' x)


{M : Type u_1}
[CommMonoid M]
{k : ℕ}
{ζ : M}
(h : IsPrimitiveRoot ζ k)
(hk : 1 < k)


/-- Total probability law using `condexp` as conditional probability. -/
theorem integral_condexp_indicator [mF : MeasurableSpace F] {Y : α → F} (hY : Measurable Y)
    [SigmaFinite (μ.trim hY.comap_le)] {A : Set α} (hA : MeasurableSet A) :
    ∫ x, (μ[(A.indicator fun _ ↦ (1 : ℝ)) | mF.comap Y]) x ∂μ = (μ A).toReal

{α : Type u_1}
{F : Type u_2}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[mF : MeasurableSpace F]
{Y : α → F}
(hY : Measurable Y)
[MeasureTheory.SigmaFinite (μ.trim ⋯)]
{A : Set α}
(hA : MeasurableSet A)

∫ (x : α), (μ[A.indicator fun x => 1|MeasurableSpace.comap Y mF]) x ∂μ = (μ A).toReal


theorem normSq_nonneg (z : K) : 0 ≤ normSq z


@[to_additive]
theorem tendsto_iff_norm_div_tendsto_zero {f : α → E} {a : Filter α} {b : E} :
    Tendsto f a (𝓝 b) ↔ Tendsto (fun e => ‖f e / b‖) a (𝓝 0)

{α : Type u_3}
{E : Type u_6}
[SeminormedGroup E]
{f : α → E}
{a : Filter α}
{b : E}

Filter.Tendsto f a (𝓝 b) ↔ Filter.Tendsto (fun e => ‖f e / b‖) a (𝓝 0)


lemma truncateToReal_eq_toReal {t x : ℝ≥0∞} (t_ne_top : t ≠ ∞) (x_le : x ≤ t) :
    truncateToReal t x = x.toReal

{t x : ℝ≥0∞}
(t_ne_top : t ≠ ⊤)
(x_le : x ≤ t)


theorem isVonNBounded_closedBall (r : ℝ) :
    Bornology.IsVonNBounded 𝕜 (Metric.closedBall (0 : E) r)

(𝕜 : Type u_1)
(E : Type u_3)
[NormedField 𝕜]
[SeminormedAddCommGroup E]
[NormedSpace 𝕜 E]
(r : ℝ)

Bornology.IsVonNBounded 𝕜 (Metric.closedBall 0 r)


theorem sym_inj {a b : α} : sym a = sym b ↔ a = b


theorem le_of_succ_succ_get?_contsAux_b {b : K}
    (nth_partDen_eq : (of v).partDens.get? n = some b) :
    b * ((of v).contsAux <| n + 1).b ≤ ((of v).contsAux <| n + 2).b

(nth_partDen_eq : (GenContFract.of v).partDens.get? n = some b)

b * ((GenContFract.of v).contsAux (n + 1)).b ≤ ((GenContFract.of v).contsAux (n + 2)).b


theorem finite_of_singleton [IsDomain B] [h : IsCyclotomicExtension {n} A B] :
    Module.Finite A B

(n : ℕ+)
(A : Type u)
(B : Type v)
[CommRing A]
[CommRing B]
[Algebra A B]
[IsDomain B]
[h : IsCyclotomicExtension {n} A B]


@[simp] theorem eq_rec_constant {α : Sort _} {a a' : α} {β : Sort _} (y : β) (h : a = a') :
    (@Eq.rec α a (fun α _ => β) y a' h) = y


theorem lintegral_sum {m : MeasurableSpace α} {ι} (f : α →ₛ ℝ≥0∞) (μ : ι → Measure α) :
    f.lintegral (Measure.sum μ) = ∑' i, f.lintegral (μ i)

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

f.lintegral (MeasureTheory.Measure.sum μ) = ∑' (i : ι), f.lintegral (μ i)


theorem toContinuousLinearEquiv_injective :
    Function.Injective (toContinuousLinearEquiv : _ → E ≃SL[σ₁₂] E₂)

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


lemma map_apply_of_aemeasurable (ν : FiniteMeasure Ω) {f : Ω → Ω'} (f_aemble : AEMeasurable f ν)
    {A : Set Ω'} (A_mble : MeasurableSet A) :
    ν.map f A = ν (f ⁻¹' A)

{Ω : Type u_1}
{Ω' : Type u_2}
[MeasurableSpace Ω]
[MeasurableSpace Ω']
(ν : MeasureTheory.FiniteMeasure Ω)
{f : Ω → Ω'}
(f_aemble : AEMeasurable f ↑ν)
{A : Set Ω'}
(A_mble : MeasurableSet A)


@[to_additive tsum_pos]
theorem one_lt_tprod (hsum : Multipliable g) (hg : ∀ i, 1 ≤ g i) (i : ι) (hi : 1 < g i) :
    1 < ∏' i, g i

{ι : Type u_1}
{α : Type u_3}
[OrderedCommGroup α]
[TopologicalSpace α]
[TopologicalGroup α]
[OrderClosedTopology α]
{g : ι → α}
(hsum : Multipliable g)
(hg : ∀ (i : ι), 1 ≤ g i)
(i : ι)
(hi : 1 < g i)


/-- The functor which deletes the point of a pointed type. In return, this makes the maps partial.
This is the computable part of the equivalence `PartialFunEquivPointed`. -/
@[simps obj map]
def pointedToPartialFun : Pointed.{u} ⥤ PartialFun

∀ {X Y : Pointed} (f : X ⟶ Y) (a : { x // x ≠ X.point }),
  pointedToPartialFun.map f a = (PFun.toSubtype (fun x => x ≠ Y.point) f.toFun ∘ Subtype.val) a


@[to_additive]
lemma mulIndicator_le_mulIndicator_of_subset (h : s ⊆ t) (hf : ∀ a, 1 ≤ f a) (a : α) :
    mulIndicator s f a ≤ mulIndicator t f a

{α : Type u_2}
{M : Type u_4}
[Preorder M]
[Zero M]
{s t : Set α}
{f : α → M}
(h : s ⊆ t)
(hf : ∀ (a : α), 0 ≤ f a)
(a : α)


theorem commute_X (φ : MvPowerSeries σ R) (s : σ) : Commute φ (X s)

{σ : Type u_1}
{R : Type u_2}
[Semiring R]
(φ : MvPowerSeries σ R)
(s : σ)


/-- A convex set `s` is strictly convex provided that for any two distinct points of
`s \ interior s`, the line passing through these points has nonempty intersection with
`interior s`. -/
protected theorem Convex.strictConvex' {s : Set E} (hs : Convex 𝕜 s)
    (h : (s \ interior s).Pairwise fun x y => ∃ c : 𝕜, lineMap x y c ∈ interior s) :
    StrictConvex 𝕜 s

(h : (s \ interior s).Pairwise fun x y => ∃ c, (AffineMap.lineMap x y) c ∈ interior s)


theorem infinite_mul_of_infinite_not_infinitesimal {x y : ℝ*} :
    Infinite x → ¬Infinitesimal y → Infinite (x * y)

x.Infinite → ¬y.Infinitesimal → (x * y).Infinite


theorem volume_univ : volume (univ : Set ℝ) = ∞


@[to_additive (attr := simp 1001)]
-- porting note (#10618): increase priority because `simp` can prove this
theorem dist_self_div_right (a b : E) : dist a (a / b) = ‖b‖

{E : Type u_3}
[SeminormedAddCommGroup E]
(a b : E)


theorem RCLike.tendsto_inverse_atTop_nhds_zero_nat :
    Tendsto (fun n : ℕ => (n : 𝕜)⁻¹) atTop (𝓝 0)

Filter.Tendsto (fun n => (↑n)⁻¹) Filter.atTop (𝓝 0)


@[simp] lemma append_cast_right {n m} {α : Type*} (xs : Fin n → α) (ys : Fin m → α) (m' : ℕ)
    (h : m' = m) :
    Fin.append xs (ys ∘ Fin.cast h) = Fin.append xs ys ∘ (Fin.cast <| by rw [h])

{n m : ℕ}
{α : Type u_1}
(xs : Fin n → α)
(ys : Fin m → α)
(m' : ℕ)
(h : m' = m)

Fin.append xs (ys ∘ Fin.cast h) = Fin.append xs ys ∘ Fin.cast ⋯


@[simp, nolint simpNF]
theorem size_shiftLeft {m} (h : m ≠ 0) (n) : size (m <<< n) = size m + n


theorem smul_apply [Zero β] {R : Type*} [SMulZeroClass R β] [ContinuousConstSMul R β] (r : R)
    (f : C_c(α, β)) (x : α) : (r • f) x = r • f x

{α : Type u_2}
{β : Type u_3}
[TopologicalSpace α]
[TopologicalSpace β]
[Zero β]
{R : Type u_5}
[SMulZeroClass R β]
[ContinuousConstSMul R β]
(r : R)
(f : α →C_c β)
(x : α)


/-- If a continuous multilinear map is constructed from a multilinear map via the constructor
`mkContinuous`, then its norm is bounded by the bound given to the constructor if it is
nonnegative. -/
theorem MultilinearMap.mkContinuous_norm_le' (f : MultilinearMap 𝕜 E G) {C : ℝ}
    (H : ∀ m, ‖f m‖ ≤ C * ∏ i, ‖m i‖) : ‖f.mkContinuous C H‖ ≤ max C 0

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

(H : ∀ (m : (i : ι) → E i), ‖f m‖ ≤ C * ∏ i : ι, ‖m i‖)


@[simp]
theorem natDegree_pow_X_add_C [Nontrivial R] (n : ℕ) (r : R) : ((X + C r) ^ n).natDegree = n

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

((Polynomial.X + Polynomial.C r) ^ n).natDegree = n


theorem supp_quot_supp : supp ((Valuation.onQuot v) le_rfl) = 0

{R : Type u_1}
{Γ₀ : Type u_2}
[CommRing R]
[LinearOrderedAddCommMonoidWithTop Γ₀]
(v : AddValuation R Γ₀)

AddValuation.supp (Valuation.onQuot v ⋯) = 0


lemma div_def (p q : ℚ≥0) : p / q = divNat (p.num * q.den) (p.den * q.num)

p / q = NNRat.divNat (p.num * q.den) (p.den * q.num)


@[simp]
theorem Module.Ray.map_refl : (Module.Ray.map <| LinearEquiv.refl R M) = Equiv.refl _

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

Module.Ray.map (LinearEquiv.refl R M) = Equiv.refl (Module.Ray R M)


/-- In a σ-finite space, any measurable set of measure `> r` contains a measurable subset of
finite measure `> r`. -/
theorem exists_subset_measure_lt_top [SigmaFinite μ] {r : ℝ≥0∞} (hs : MeasurableSet s)
    (h's : r < μ s) : ∃ t, MeasurableSet t ∧ t ⊆ s ∧ r < μ t ∧ μ t < ∞

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s : Set α}
[MeasureTheory.SigmaFinite μ]
{r : ℝ≥0∞}
(hs : MeasurableSet s)
(h's : r < μ s)

∃ t, MeasurableSet t ∧ t ⊆ s ∧ r < μ t ∧ μ t < ⊤


@[simp] theorem true_eq_decide_iff {p : Prop} [h : Decidable p] : true = decide p ↔ p


@[simp]
theorem iselect_nil [DecidableEq F.A] [Inhabited (M F)] {a} (f : F.B a → M F) :
    iselect nil (M.mk ⟨a, f⟩) = a

{F : PFunctor.{u}}
[DecidableEq F.A]
[Inhabited F.M]
{a : F.A}
(f : F.B a → F.M)

PFunctor.M.iselect [] (PFunctor.M.mk ⟨a, f⟩) = a


@[simp] lemma aleph0_add_ofENat (m : ℕ∞) : ℵ₀ + m = ℵ₀


/-- The set in the definition of `nmul` is nonempty. -/
theorem nmul_nonempty (a b : Ordinal.{u}) :
    {c : Ordinal.{u} | ∀ a' < a, ∀ b' < b, a' ⨳ b ♯ a ⨳ b' < c ♯ a' ⨳ b'}.Nonempty

{c | ∀ a' < a, ∀ b' < b, a' ⨳ b ♯ a ⨳ b' < c ♯ a' ⨳ b'}.Nonempty


theorem frequently_cofinite_iff_infinite {p : α → Prop} :
    (∃ᶠ x in cofinite, p x) ↔ Set.Infinite { x | p x }

(∃ᶠ (x : α) in Filter.cofinite, p x) ↔ {x | p x}.Infinite


theorem univ_umax : univ.{u, max (u + 1) v} = univ.{u, v}

Cardinal.univ.{u, max (u + 1) v} = Cardinal.univ.{u, v}


theorem uniform_continuity (f : C(α, β)) (ε : ℝ) (h : 0 < ε) :
    ∃ δ > 0, ∀ {x y}, dist x y < δ → dist (f x) (f y) < ε

{α : Type u_1}
{β : Type u_2}
[MetricSpace α]
[CompactSpace α]
[MetricSpace β]
(f : C(α, β))
(ε : ℝ)
(h : 0 < ε)

∃ δ > 0, ∀ {x y : α}, dist x y < δ → dist (f x) (f y) < ε


theorem mdifferentiableWithinAt_const : MDifferentiableWithinAt I I' (fun _ : M => c) s x

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

MDifferentiableWithinAt I I' (fun x => c) s x


@[simp]
theorem ofNat_ne_top (x : ℕ) [x.AtLeastTwo] : (no_index (OfNat.ofNat x : PartENat)) ≠ ⊤


@[simp]
theorem Prod.fst_toSigma {α β} (x : α × β) : (Prod.toSigma x).fst = x.fst

{α : Type u_7}
{β : Type u_8}
(x : α × β)


@[simp] lemma coe_toInfHom (f : InfTopHom α β) : ⇑f.toInfHom = f

{α : Type u_3}
{β : Type u_4}
[Inf α]
[Top α]
[Inf β]
[Top β]
(f : InfTopHom α β)


@[simp] lemma add_apply (f g : StieltjesFunction) (x : ℝ) : (f + g) x = f x + g x


lemma one_le_cfc (f : R → R) (a : A) (h : ∀ x ∈ spectrum R a, 1 ≤ f x)
    (hf : ContinuousOn f (spectrum R a) := by cfc_cont_tac) (ha : p a := by cfc_tac) :
    1 ≤ cfc f a

[∀ (α : Type u_1) [inst : TopologicalSpace α], StarOrderedRing C(α, R)]


/-- Only assumes right strict covariance. -/
@[to_additive "Only assumes right strict covariance"]
theorem Right.mul_lt_mul [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]


/-- **Chebyshev's Sum Inequality**: When `f` and `g` monovary together (eg they are both
monotone/antitone), the product of their sum is less than the size of the set times their scalar
product. -/
theorem Monovary.sum_mul_sum_le_card_mul_sum (hfg : Monovary f g) :
    ((∑ i, f i) * ∑ i, g i) ≤ Fintype.card ι * ∑ i, f i * g i

{ι : Type u_1}
{α : Type u_2}
[LinearOrderedRing α]
{f g : ι → α}
[Fintype ι]
(hfg : Monovary f g)

(∑ i : ι, f i) * ∑ i : ι, g i ≤ ↑(Fintype.card ι) * ∑ i : ι, f i * g i


/-- The algebra isomorphism `adjoin ℤ {ζ} ≃ₐ[ℤ] (𝓞 K)`, where `ζ` is a primitive `p`-th root of
unity and `K` is a `p`-th cyclotomic extension of `ℚ`. -/
@[simps!]
noncomputable def _root_.IsPrimitiveRoot.adjoinEquivRingOfIntegers'
    [hcycl : IsCyclotomicExtension {p} ℚ K] (hζ : IsPrimitiveRoot ζ p) :
    adjoin ℤ ({ζ} : Set K) ≃ₐ[ℤ] 𝓞 K

{p : ℕ+}
{K : Type u}
[Field K]
[CharZero K]
{ζ : K}
[hp : Fact (Nat.Prime ↑p)]
[hcycl : IsCyclotomicExtension {p} ℚ K]
(hζ : IsPrimitiveRoot ζ ↑p)
(a : ↥(Algebra.adjoin ℤ {ζ}))

hζ.adjoinEquivRingOfIntegers' a = (IsIntegralClosure.lift ℤ (𝓞 K) K) a


@[simp]
theorem hasSum_op : HasSum (fun a ↦ op (f a)) (op a) ↔ HasSum f a

{α : Type u_1}
{β : Type u_2}
[AddCommMonoid α]
[TopologicalSpace α]
{f : β → α}
{a : α}

HasSum (fun a => MulOpposite.op (f a)) (MulOpposite.op a) ↔ HasSum f a


theorem dite_dite_distrib_left {a : p → α} {b : ¬p → q → α} {c : ¬p → ¬q → α} :
    (dite p a fun hp ↦ dite q (b hp) (c hp)) =
      dite q (fun hq ↦ (dite p a) fun hp ↦ b hp hq) fun hq ↦ (dite p a) fun hp ↦ c hp hq

{α : Sort u_1}
{p q : Prop}
[Decidable p]
[Decidable q]
{a : p → α}
{b : ¬p → q → α}
{c : ¬p → ¬q → α}

(dite p a fun hp => dite q (b hp) (c hp)) = if hq : q then dite p a fun hp => b hp hq else dite p a fun hp => c hp hq


theorem ι_eq_iff (i j : D.J) (x : (D.U i).carrier) (y : (D.U j).carrier) :
    (𝖣.ι i).1.base x = (𝖣.ι j).1.base y ↔ D.Rel ⟨i, x⟩ ⟨j, y⟩

(D : AlgebraicGeometry.Scheme.GlueData)
(i j : D.J)
(x : ↑↑(D.U i).toPresheafedSpace)
(y : ↑↑(D.U j).toPresheafedSpace)

(D.ι i).val.base x = (D.ι j).val.base y ↔ D.Rel ⟨i, x⟩ ⟨j, y⟩


@[simp]
theorem compl_filter (p : α → Prop) [DecidablePred p] [∀ x, Decidable ¬p x] :
    (univ.filter p)ᶜ = univ.filter fun x => ¬p x

{α : Type u_1}
[Fintype α]
[DecidableEq α]
(p : α → Prop)
[DecidablePred p]
[(x : α) → Decidable ¬p x]

(Finset.filter p Finset.univ)ᶜ = Finset.filter (fun x => ¬p x) Finset.univ


theorem Convex.openSegment_interior_closure_subset_interior {s : Set E} (hs : Convex 𝕜 s) {x y : E}
    (hx : x ∈ interior s) (hy : y ∈ closure s) : openSegment 𝕜 x y ⊆ interior s

{𝕜 : Type u_2}
{E : Type u_3}
[LinearOrderedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[TopologicalSpace E]
[TopologicalAddGroup E]
[ContinuousConstSMul 𝕜 E]
{s : Set E}
(hs : Convex 𝕜 s)
{x y : E}
(hx : x ∈ interior s)
(hy : y ∈ closure s)


theorem pi_def (i : Set α) (s : ∀ a, Set (π a)) : pi i s = ⋂ a ∈ i, eval a ⁻¹' s a

{α : Type u_1}
{π : α → Type u_11}
(i : Set α)
(s : (a : α) → Set (π a))

i.pi s = ⋂ a ∈ i, Function.eval a ⁻¹' s a


theorem splits_of_map_eq_C {f : K[X]} {a : L} (h : f.map i = C a) : Splits i f

(h : Polynomial.map i f = Polynomial.C a)


theorem castSucc_lt_iff_succ_le {n : Nat} {i : Fin n} {j : Fin (n + 1)} :
    Fin.castSucc i < j ↔ i.succ ≤ j


@[simp]
theorem transposeLinearEquiv_symm [Semiring R] [AddCommMonoid α] [Module R α] :
    (transposeLinearEquiv m n R α).symm = transposeLinearEquiv n m R α

(m : Type u_2)
(n : Type u_3)
(R : Type u_7)
(α : Type v)
[Semiring R]
[AddCommMonoid α]
[Module R α]

(Matrix.transposeLinearEquiv m n R α).symm = Matrix.transposeLinearEquiv n m R α


/-- The base function from which one will construct a family of bump functions. One could
add more properties if they are useful and satisfied in the examples of inner product spaces
and finite dimensional vector spaces, notably derivative norm control in terms of `R - 1`.

TODO: do we ever need `f x = 1 ↔ ‖x‖ ≤ 1`? -/
-- Porting note(#5171): linter not yet ported; was @[nolint has_nonempty_instance]
structure ContDiffBumpBase (E : Type*) [NormedAddCommGroup E] [NormedSpace ℝ E] where
  /-- The function underlying this family of bump functions -/
  toFun : ℝ → E → ℝ
  mem_Icc : ∀ (R : ℝ) (x : E), toFun R x ∈ Icc (0 : ℝ) 1
  symmetric : ∀ (R : ℝ) (x : E), toFun R (-x) = toFun R x
  smooth : ContDiffOn ℝ ⊤ (uncurry toFun) (Ioi (1 : ℝ) ×ˢ (univ : Set E))
  eq_one : ∀ R : ℝ, 1 < R → ∀ x : E, ‖x‖ ≤ 1 → toFun R x = 1
  support : ∀ R : ℝ, 1 < R → Function.support (toFun R) = Metric.ball (0 : E) R

{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
(self : ContDiffBumpBase E)
(R : ℝ)
(x : E)


theorem uniformContinuous_compareEquiv_symm : UniformContinuous (pkg.compareEquiv pkg').symm

{α : Type u_1}
[UniformSpace α]
(pkg pkg' : AbstractCompletion α)


theorem image2_lowerBounds_lowerBounds_subset_lowerBounds_image2 :
    image2 f (upperBounds s) (upperBounds t) ⊆ lowerBounds (image2 f s t)

{f : α → β → γ}

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

Set.image2 f (upperBounds s) (upperBounds t) ⊆ lowerBounds (Set.image2 f s t)


@[simp]
theorem dual_id : BotHom.dual (BotHom.id α) = TopHom.id _

BotHom.dual (BotHom.id α) = TopHom.id αᵒᵈ


theorem iUnion₂_eq_univ_iff {s : ∀ i, κ i → Set α} :
    ⋃ (i) (j), s i j = univ ↔ ∀ a, ∃ i j, a ∈ s i j

{α : Type u_1}
{ι : Sort u_4}
{κ : ι → Sort u_7}
{s : (i : ι) → κ i → Set α}

⋃ i, ⋃ j, s i j = Set.univ ↔ ∀ (a : α), ∃ i j, a ∈ s i j


@[to_additive]
theorem mulIndicator_mul_eq_right {f g : α → M} (h : Disjoint (mulSupport f) (mulSupport g)) :
    (mulSupport g).mulIndicator (f * g) = g

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

(Function.support g).indicator (f + g) = g


@[simp]
theorem map_sin : map f (sin A) = sin A'

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

(PowerSeries.map f) (PowerSeries.sin A) = PowerSeries.sin A'


theorem extension_property_addMonoidHom (h : Module.Baer ℤ Q)
    (f : M →+ N) (hf : Function.Injective f) (g : M →+ Q) : ∃ h : N →+ Q, h.comp f = g

{Q : Type v}
[AddCommGroup Q]
{M : Type u_1}
{N : Type u_2}
[AddCommGroup M]
[AddCommGroup N]
(h : Module.Baer ℤ Q)
(f : M →+ N)
(hf : Function.Injective ⇑f)
(g : M →+ Q)


theorem vsub_card_le : (s -ᵥ t : Finset α).card ≤ s.card * t.card

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


theorem equicontinuousWithinAt_finite [Finite ι] {F : ι → X → α} {S : Set X} {x₀ : X} :
    EquicontinuousWithinAt F S x₀ ↔ ∀ i, ContinuousWithinAt (F i) S x₀

{ι : Type u_1}
{X : Type u_3}
{α : Type u_7}
[tX : TopologicalSpace X]
[uα : UniformSpace α]
[Finite ι]
{F : ι → X → α}
{S : Set X}
{x₀ : X}

EquicontinuousWithinAt F S x₀ ↔ ∀ (i : ι), ContinuousWithinAt (F i) S x₀


protected theorem mapsTo (h : e.IsImage s t) : MapsTo e (e.source ∩ s) (e.target ∩ t)

{α : Type u_1}
{β : Type u_2}
{e : PartialEquiv α β}
{s : Set α}
{t : Set β}
(h : e.IsImage s t)

Set.MapsTo (↑e) (e.source ∩ s) (e.target ∩ t)


theorem forall_mem_append {p : α → Prop} {l₁ l₂ : List α} :
    (∀ (x) (_ : x ∈ l₁ ++ l₂), p x) ↔ (∀ (x) (_ : x ∈ l₁), p x) ∧ (∀ (x) (_ : x ∈ l₂), p x)

{α : Type u_1}
{p : α → Prop}
{l₁ l₂ : List α}

(∀ (x : α), x ∈ l₁ ++ l₂ → p x) ↔ (∀ (x : α), x ∈ l₁ → p x) ∧ ∀ (x : α), x ∈ l₂ → p x


protected lemma add_nonnneg_iff_neg_le : 0 ≤ a + b ↔ -b ≤ a


/-- Analogue of `HasFPowerSeriesOnBall` where convergence is required only on a set `s`. -/
structure HasFPowerSeriesWithinOnBall (f : E → F) (p : FormalMultilinearSeries 𝕜 E F) (s : Set E)
    (x : E) (r : ℝ≥0∞) : Prop where
  /-- `p` converges on `ball 0 r` -/
  r_le : r ≤ p.radius
  /-- The radius of convergence is positive -/
  r_pos : 0 < r
  /-- `p converges to f` within `s` -/
  hasSum : ∀ {y}, x + y ∈ s → y ∈ EMetric.ball (0 : E) r →
    HasSum (fun n : ℕ => p n fun _ : Fin n => y) (f (x + y))
  /-- We require `ContinuousWithinAt f s x` to ensure `f x` is nice -/
  continuousWithinAt : ContinuousWithinAt f s x

(self : HasFPowerSeriesWithinOnBall f p s x r)

x + y ∈ s → y ∈ EMetric.ball 0 r → HasSum (fun n => (p n) fun x => y) (f (x + y))


/-- The theorem that $(e^X - 1) * ∑ Bₙ(t)* X^n/n! = Xe^{tX}$ -/
theorem bernoulli_generating_function (t : A) :
    (mk fun n => aeval t ((1 / n ! : ℚ) • bernoulli n)) * (exp A - 1) =
      PowerSeries.X * rescale t (exp A)

{A : Type u_1}
[CommRing A]
[Algebra ℚ A]
(t : A)

(PowerSeries.mk fun n => (Polynomial.aeval t) ((1 / ↑n !) • Polynomial.bernoulli n)) * (PowerSeries.exp A - 1) =
  PowerSeries.X * (PowerSeries.rescale t) (PowerSeries.exp A)


lemma natDegree_eq_one : p.natDegree = 1 ↔ ∃ a ≠ 0, ∃ b, C a * X + C b = p

p.natDegree = 1 ↔ ∃ a, a ≠ 0 ∧ ∃ b, Polynomial.C a * Polynomial.X + Polynomial.C b = p


@[reassoc (attr := simp)]
lemma singleObjHomologySelfIso_inv_naturality :
    (singleObjHomologySelfIso c j A).inv ≫ homologyMap ((single C c j).map f) j =
      f ≫ (singleObjHomologySelfIso c j B).inv

(HomologicalComplex.singleObjHomologySelfIso c j A).inv ≫
    HomologicalComplex.homologyMap ((HomologicalComplex.single C c j).map f) j =
  f ≫ (HomologicalComplex.singleObjHomologySelfIso c j B).inv


protected theorem Finite.isPWO (hs : s.Finite) : IsPWO s

{α : Type u_2}
[Preorder α]
{s : Set α}
(hs : s.Finite)


theorem aefinStronglyMeasurable_zero {α β} {_ : MeasurableSpace α} (μ : Measure α) [Zero β]
    [TopologicalSpace β] : AEFinStronglyMeasurable (0 : α → β) μ

∀ {x : MeasurableSpace α} (μ : MeasureTheory.Measure α) [inst : Zero β] [inst_1 : TopologicalSpace β],
  MeasureTheory.AEFinStronglyMeasurable 0 μ


theorem GradedAlgebra.lift_ι_eq (i' : ZMod 2) (x' : evenOdd Q i') :
    -- Porting note: added a second `by apply`
    lift Q ⟨by apply GradedAlgebra.ι Q, by apply GradedAlgebra.ι_sq_scalar Q⟩ x' =
      DirectSum.of (fun i => evenOdd Q i) i' x'

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
(Q : QuadraticForm R M)
(i' : ZMod 2)
(x' : ↥(CliffordAlgebra.evenOdd Q i'))

((CliffordAlgebra.lift Q) ⟨CliffordAlgebra.GradedAlgebra.ι Q, ⋯⟩) ↑x' =
  (DirectSum.of (fun i => ↥(CliffordAlgebra.evenOdd Q i)) i') x'


@[simp]
theorem tmul_tensorMap_apply
    {Q₁ : QuadraticForm R M₁} {Q₂ : QuadraticForm R M₂}
    {Q₃ : QuadraticForm R M₃} {Q₄ : QuadraticForm R M₄}
    (f : Q₁ →qᵢ Q₂) (g : Q₃ →qᵢ Q₄) (x : M₁ ⊗[R] M₃) :
    Q₂.tmul Q₄ (TensorProduct.map f.toLinearMap g.toLinearMap x) = Q₁.tmul Q₃ x

{R : Type uR}
{M₁ : Type uM₁}
{M₂ : Type uM₂}
{M₃ : Type uM₃}
{M₄ : Type uM₄}
[CommRing R]
[AddCommGroup M₁]
[AddCommGroup M₂]
[AddCommGroup M₃]
[AddCommGroup M₄]
[Module R M₁]
[Module R M₂]
[Module R M₃]
[Module R M₄]
[Invertible 2]
{Q₁ : QuadraticForm R M₁}
{Q₂ : QuadraticForm R M₂}
{Q₃ : QuadraticForm R M₃}
{Q₄ : QuadraticForm R M₄}
(f : Q₁ →qᵢ Q₂)
(g : Q₃ →qᵢ Q₄)
(x : M₁ ⊗[R] M₃)

(Q₂.tmul Q₄) ((TensorProduct.map f.toLinearMap g.toLinearMap) x) = (Q₁.tmul Q₃) x


theorem isSimpleOrder_iff_isCoatom_bot [PartialOrder α] [BoundedOrder α] :
    IsSimpleOrder α ↔ IsCoatom (⊥ : α)

{α : Type u_2}
[PartialOrder α]
[BoundedOrder α]


theorem cliqueFree_iff {n : ℕ} : G.CliqueFree n ↔ IsEmpty ((⊤ : SimpleGraph (Fin n)) ↪g G)

{α : Type u_1}
{G : SimpleGraph α}
{n : ℕ}


/-- A category `IsFilteredOrEmpty` if
1. for every pair of objects there exists another object "to the right", and
2. for every pair of parallel morphisms there exists a morphism to the right so the compositions
   are equal.
-/
class IsFilteredOrEmpty : Prop where
  /-- for every pair of objects there exists another object "to the right" -/
  cocone_objs : ∀ X Y : C, ∃ (Z : _) (_ : X ⟶ Z) (_ : Y ⟶ Z), True
  /-- for every pair of parallel morphisms there exists a morphism to the right
    so the compositions are equal -/
  cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h

[self : CategoryTheory.IsFilteredOrEmpty C]

∃ Z h, CategoryTheory.CategoryStruct.comp f h = CategoryTheory.CategoryStruct.comp g h


/-- A convex set in a finite dimensional real vector space is null measurable with respect to an
additive Haar measure on this space. -/
protected theorem nullMeasurableSet (hs : Convex ℝ s) : NullMeasurableSet s μ

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[MeasurableSpace E]
[BorelSpace E]
[FiniteDimensional ℝ E]
(μ : MeasureTheory.Measure E)
[μ.IsAddHaarMeasure]
{s : Set E}
(hs : Convex ℝ s)


@[to_additive (attr := simp)]
theorem self_eq_mul_right : a = a * b ↔ b = 1

{M : Type u}
[LeftCancelMonoid M]
{a b : M}


theorem dist_ghDist (p q : GHSpace) : dist p q = ghDist p.Rep q.Rep

dist p q = GromovHausdorff.ghDist p.Rep q.Rep


/-- A version of Newton's identities which may be more useful in the case that we know the values of
the elementary symmetric polynomials and would like to calculate the values of the power sums. -/
theorem psum_eq_mul_esymm_sub_sum (k : ℕ) (h : 0 < k) : psum σ R k =
    (-1) ^ (k + 1) * k * esymm σ R k -
    ∑ a ∈ (antidiagonal k).filter (fun a ↦ a.fst ∈ Set.Ioo 0 k),
    (-1) ^ a.fst * esymm σ R a.fst * psum σ R a.snd

(σ : Type u_1)
[Fintype σ]
(R : Type u_2)
[CommRing R]
(k : ℕ)
(h : 0 < k)

MvPolynomial.psum σ R k =
  (-1) ^ (k + 1) * ↑k * MvPolynomial.esymm σ R k -
    ∑ a ∈ Finset.filter (fun a => a.1 ∈ Set.Ioo 0 k) (Finset.antidiagonal k),
      (-1) ^ a.1 * MvPolynomial.esymm σ R a.1 * MvPolynomial.psum σ R a.2


theorem isLittleO_iff_tendsto' {f g : α → 𝕜} (hgf : ∀ᶠ x in l, g x = 0 → f x = 0) :
    f =o[l] g ↔ Tendsto (fun x => f x / g x) l (𝓝 0)

(hgf : ∀ᶠ (x : α) in l, g x = 0 → f x = 0)

f =o[l] g ↔ Filter.Tendsto (fun x => f x / g x) l (𝓝 0)


theorem eq (h : RightInvOn f' f t) {y} (hy : y ∈ t) : f (f' y) = y

{α : Type u_1}
{β : Type u_2}
{t : Set β}
{f : α → β}
{f' : β → α}
(h : Set.RightInvOn f' f t)
{y : β}
(hy : y ∈ t)


@[to_additive (attr := simp)]
theorem zero_comp : (0 : GroupSeminorm E).comp f = 0

{E : Type u_4}
{F : Type u_5}
[Group E]
[Group F]
(f : F →* E)


theorem homothety_mul_apply (c : P1) (r₁ r₂ : k) (p : P1) :
    homothety c (r₁ * r₂) p = homothety c r₁ (homothety c r₂ p)

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

(AffineMap.homothety c (r₁ * r₂)) p = (AffineMap.homothety c r₁) ((AffineMap.homothety c r₂) p)


@[simp]
theorem vsub_eq_bot_iff : f -ᵥ g = ⊥ ↔ f = ⊥ ∨ g = ⊥

{α : Type u_2}
{β : Type u_3}
[VSub α β]
{f g : Filter β}


@[symm]
theorem symm ⦃p₀ p₁ : Path x₀ x₁⦄ (h : p₀.Homotopic p₁) : p₁.Homotopic p₀

{X : Type u}
[TopologicalSpace X]
{x₀ x₁ : X}
⦃p₀ p₁ : Path x₀ x₁⦄
(h : p₀.Homotopic p₁)


@[simp]
theorem DifferentiableAt.ccos (hc : DifferentiableAt ℂ f x) :
    DifferentiableAt ℂ (fun x => Complex.cos (f x)) x

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
{f : E → ℂ}
{x : E}
(hc : DifferentiableAt ℂ f x)


@[to_additive]
theorem injective_noncommPiCoprod_of_independent
    {hcomm : Pairwise fun i j : ι => ∀ x y : G, x ∈ H i → y ∈ H j → Commute x y}
    (hind : CompleteLattice.Independent H) :
    Function.Injective (noncommPiCoprod hcomm)

{hcomm : Pairwise fun i j => ∀ (x y : G), x ∈ H i → y ∈ H j → AddCommute x y}


theorem adjoin_image (f : A →ₐ[R] B) (s : Set A) : adjoin R (f '' s) = (adjoin R s).map f

(R : Type uR)
{A : Type uA}
{B : Type uB}
[CommSemiring R]
[Semiring A]
[Semiring B]
[Algebra R A]
[Algebra R B]
(f : A →ₐ[R] B)
(s : Set A)

Algebra.adjoin R (⇑f '' s) = Subalgebra.map f (Algebra.adjoin R s)


@[simp] theorem foldrM_cons [Monad m] [LawfulMonad m] (a : α) (l) (f : α → β → m β) (b) :
    (a :: l).foldrM f b = l.foldrM f b >>= f a

{m : Type u_1 → Type u_2}
{α : Type u_3}
{β : Type u_1}
[Monad m]
[LawfulMonad m]
(a : α)
(l : List α)
(f : α → β → m β)
(b : β)

List.foldrM f b (a :: l) = List.foldrM f b l >>= f a


protected theorem SemanticallyEquivalent.all {φ ψ : L.BoundedFormula α (n + 1)}
    (h : T.SemanticallyEquivalent φ ψ) : T.SemanticallyEquivalent φ.all ψ.all

{L : FirstOrder.Language}
{T : L.Theory}
{α : Type w}
{n : ℕ}
{φ ψ : L.BoundedFormula α (n + 1)}
(h : T.SemanticallyEquivalent φ ψ)


theorem mk_bijOn (G : Type*) [Group G] :
    Set.BijOn ConjClasses.mk (↑(Subgroup.center G)) (noncenter G)ᶜ

Set.BijOn ConjClasses.mk (↑(Subgroup.center G)) (ConjClasses.noncenter G)ᶜ


/-- The composition of morphisms of short complexes. -/
@[simps]
def Hom.comp (φ₁₂ : Hom S₁ S₂) (φ₂₃ : Hom S₂ S₃) : Hom S₁ S₃

{S₁ S₂ S₃ : CategoryTheory.ShortComplex C}

(φ₁₂.comp φ₂₃).τ₃ = CategoryTheory.CategoryStruct.comp φ₁₂.τ₃ φ₂₃.τ₃


theorem neg_mk_mul_moveRight_inr {xl xr yl yr} {xL xR yL yR} {i j} :
    (-(mk xl xr xL xR * mk yl yr yL yR)).moveRight (Sum.inr (i, j)) =
      -(xR i * mk yl yr yL yR + mk xl xr xL xR * yR j - xR i * yR j)

{xl xr yl yr : Type u_1}
{xL : xl → SetTheory.PGame}
{xR : xr → SetTheory.PGame}
{yL : yl → SetTheory.PGame}
{yR : yr → SetTheory.PGame}
{i : xr}
{j : yr}

(-(SetTheory.PGame.mk xl xr xL xR * SetTheory.PGame.mk yl yr yL yR)).moveRight (Sum.inr (i, j)) =
  -(xR i * SetTheory.PGame.mk yl yr yL yR + SetTheory.PGame.mk xl xr xL xR * yR j - xR i * yR j)


theorem eq_replicate_of_mem {a : α} :
    ∀ {l : List α}, (∀ (b) (_ : b ∈ l), b = a) → l = replicate l.length a

(∀ (b : α), b ∈ l → b = a) → l = List.replicate l.length a


@[simp] lemma bddAbove_preimage_ofDual {s : Set α} : BddAbove (ofDual ⁻¹' s) ↔ BddBelow s

BddAbove (⇑OrderDual.ofDual ⁻¹' s) ↔ BddBelow s


theorem monotoneOn_const [Preorder α] [Preorder β] {c : β} {s : Set α} :
    MonotoneOn (fun _ : α ↦ c) s

{α : Type u}
{β : Type v}
[Preorder α]
[Preorder β]
{c : β}
{s : Set α}


protected theorem iterate {f : α → α} (hf : LocallyLipschitz f) : ∀ n, LocallyLipschitz f^[n]

{α : Type u}
[PseudoEMetricSpace α]
{f : α → α}
(hf : LocallyLipschitz f)
(n : ℕ)


@[gcongr]
theorem exp_le_exp_of_le {x y : ℝ} (h : x ≤ y) : exp x ≤ exp y


/-- `TensorProduct.comm` preserves tensor products of quadratic forms. -/
@[simps toLinearEquiv]
def tensorComm (Q₁ : QuadraticForm R M₁) (Q₂ : QuadraticForm R M₂) :
    (Q₁.tmul Q₂).IsometryEquiv (Q₂.tmul Q₁)

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

(Q₁.tensorComm Q₂).toLinearEquiv = TensorProduct.comm R M₁ M₂


@[simp]
theorem definable_empty : A.Definable L (∅ : Set (α → M))

{M : Type w}
{A : Set M}
{L : FirstOrder.Language}
[L.Structure M]
{α : Type u₁}


lemma F_nat_zero_le {a : ℝ} (ha : 0 ≤ a) {t : ℝ} (ht : 0 < t) :
    ‖F_nat 0 a t‖ ≤ rexp (-π * a ^ 2 * t) / (1 - rexp (-π * t))

‖HurwitzKernelBounds.F_nat 0 a t‖ ≤ rexp (-π * a ^ 2 * t) / (1 - rexp (-π * t))


theorem AECover.integrable_of_integral_bounded_of_nonneg_ae [l.NeBot] [l.IsCountablyGenerated]
    {φ : ι → Set α} (hφ : AECover μ l φ) {f : α → ℝ} (I : ℝ) (hfi : ∀ i, IntegrableOn f (φ i) μ)
    (hnng : ∀ᵐ x ∂μ, 0 ≤ f x) (hbounded : ∀ᶠ i in l, (∫ x in φ i, f x ∂μ) ≤ I) : Integrable f μ

(hfi : ∀ (i : ι), MeasureTheory.IntegrableOn f (φ i) μ)

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


@[simp] lemma ofENat_lt_ofNat {m : ℕ∞} {n : ℕ} [n.AtLeastTwo] :
    ofENat m < no_index (OfNat.ofNat n) ↔ m < OfNat.ofNat n


theorem of_isIso_comp_right {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z) [IsIso g] [IsIso (f ≫ g)] :
    IsIso f

[CategoryTheory.IsIso (CategoryTheory.CategoryStruct.comp f g)]


/-- The quaternion basis vectors within the algebra. -/
@[simps i j k]
def quaternionBasis : QuaternionAlgebra.Basis (CliffordAlgebra (Q c₁ c₂)) c₁ c₂

(CliffordAlgebraQuaternion.quaternionBasis c₁ c₂).k =
  (CliffordAlgebra.ι (CliffordAlgebraQuaternion.Q c₁ c₂)) (1, 0) *
    (CliffordAlgebra.ι (CliffordAlgebraQuaternion.Q c₁ c₂)) (0, 1)


/-- For `n ≠ 1`, the `n`-th coefficient of `id 𝕜 E` is zero, by definition. -/
@[simp]
theorem id_apply_ne_one {n : ℕ} (h : n ≠ 1) : (FormalMultilinearSeries.id 𝕜 E) n = 0

(𝕜 : Type u_1)
(E : Type u_2)
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{n : ℕ}
(h : n ≠ 1)


theorem SupPrime.le_finset_sup (ha : SupPrime a) : a ≤ s.sup f ↔ ∃ i ∈ s, a ≤ f i

{ι : Type u_1}
{α : Type u_2}
[SemilatticeSup α]
{a : α}
[OrderBot α]
{s : Finset ι}
{f : ι → α}
(ha : SupPrime a)


theorem coe_linearEquiv_injective : Injective ((↑) : (L₁ ≃ₗ⁅R⁆ L₂) → L₁ ≃ₗ[R] L₂)

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


@[to_additive (attr := simp)]
theorem mul_left_inv : ∀ a : G, a⁻¹ * a = 1


@[simp] theorem star_imI : (star a).imI = -a.imI


theorem VectorAllP.imp {p q : α → Prop} (h : ∀ x, p x → q x) {v : Vector3 α n}
    (al : VectorAllP p v) : VectorAllP q v

{α : Type u_1}
{n : ℕ}
{p q : α → Prop}
(h : ∀ (x : α), p x → q x)
{v : Vector3 α n}
(al : VectorAllP p v)


@[to_additive leftAddCosetEquivalence_rel]
theorem leftCosetEquivalence_rel (s : Set α) : Equivalence (LeftCosetEquivalence s)


@[continuity]
protected theorem continuous : Continuous γ

{X : Type u_1}
[TopologicalSpace X]
{x y : X}
(γ : Path x y)


@[simp]
theorem joinM_map_pure {α : Type u} (a : m α) : joinM (pure <$> a) = a

{m : Type u → Type u}
[Monad m]
[LawfulMonad m]
{α : Type u}
(a : m α)


@[simp]
theorem linMulLin_comp (f g : M →ₗ[R] A) (h : N' →ₗ[R] M) :
    (linMulLin f g).comp h = linMulLin (f.comp h) (g.comp h)

{R : Type u_3}
{M : Type u_4}
{A : Type u_7}
[CommSemiring R]
[NonUnitalNonAssocSemiring A]
[AddCommMonoid M]
[Module R M]
[Module R A]
[SMulCommClass R A A]
[IsScalarTower R A A]
{N' : Type u_8}
[AddCommMonoid N']
[Module R N']
(f g : M →ₗ[R] A)
(h : N' →ₗ[R] M)

(QuadraticMap.linMulLin f g).comp h = QuadraticMap.linMulLin (f ∘ₗ h) (g ∘ₗ h)


theorem filter_ne_fill [DecidableEq α] (a : α) (m : Σi : Fin (n + 1), Sym α (n - i)) (h : a ∉ m.2) :
    (m.2.fill a m.1).filterNe a = m

(m : (i : Fin (n + 1)) × Sym α (n - ↑i))

Sym.filterNe a (Sym.fill a m.fst m.snd) = m


@[simp]
protected theorem sub_left_inj (i j k : Int) : (k - i = k - j) ↔ i = j


/-- The even terms of `expSeries` are real, and correspond to the series for $\cos ‖q‖$. -/
theorem expSeries_even_of_imaginary {q : Quaternion ℝ} (hq : q.re = 0) (n : ℕ) :
    expSeries ℝ (Quaternion ℝ) (2 * n) (fun _ => q) =
      ↑((-1 : ℝ) ^ n * ‖q‖ ^ (2 * n) / (2 * n)!)

((NormedSpace.expSeries ℝ ℍ (2 * n)) fun x => q) = ↑((-1) ^ n * ‖q‖ ^ (2 * n) / ↑(2 * n)!)


@[simp]
lemma whiskerLeft_app_apply (K : SSet.{u}) {L L' : SSet.{u}} (g : L ⟶ L')
    {Δ : SimplexCategoryᵒᵖ} (x : (K ⊗ L).obj Δ) :
    (K ◁ g).app Δ x = ⟨x.1, g.app Δ x.2⟩

(K : SSet)
{L L' : SSet}
(g : L ⟶ L')
{Δ : SimplexCategoryᵒᵖ}
(x : (K ⊗ L).obj Δ)


theorem isOpenMap_mk : IsOpenMap (mk : X → SeparationQuotient X)


theorem pi_singletons {β : Type*} (s : Finset α) (f : α → β) :
    (s.pi fun a => ({f a} : Finset β)) = {fun a _ => f a}

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

(s.pi fun a => {f a}) = {fun a x => f a}


theorem biInf_comap_proj :
    ⨅ i ∈ I, comap (proj i : ((i : ι) → φ i) →ₗ[R] φ i) (p i) = pi I p

{R : Type u}
{ι : Type x}
[Semiring R]
{φ : ι → Type u_1}
[(i : ι) → AddCommMonoid (φ i)]
[(i : ι) → Module R (φ i)]
{I : Set ι}
{p : (i : ι) → Submodule R (φ i)}

⨅ i ∈ I, Submodule.comap (LinearMap.proj i) (p i) = Submodule.pi I p


theorem take_range (m n : ℕ) : take m (range n) = range (min m n)

List.take m (List.range n) = List.range (min m n)


theorem ContinuousOn.rpow (hf : ContinuousOn f s) (hg : ContinuousOn g s)
    (h : ∀ x ∈ s, f x ≠ 0 ∨ 0 < g x) : ContinuousOn (fun t => f t ^ g t) s

{α : Type u_1}
[TopologicalSpace α]
{f g : α → ℝ}
{s : Set α}
(hf : ContinuousOn f s)
(hg : ContinuousOn g s)
(h : ∀ x ∈ s, f x ≠ 0 ∨ 0 < g x)


theorem ι_basicOpen_preimage (r : Γ(X, ⊤)) :
    IsAffineOpen ((X.basicOpen r).ι ⁻¹ᵁ U)

{X : AlgebraicGeometry.Scheme}
{U : X.Opens}
(hU : AlgebraicGeometry.IsAffineOpen U)
(r : ↑(X.presheaf.obj (Opposite.op ⊤)))

AlgebraicGeometry.IsAffineOpen ((TopologicalSpace.Opens.map (X.basicOpen r).ι.val.base).obj U)


@[simp 1100]
theorem normalize_lcm : normalize (s.lcm f) = s.lcm f

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


@[simp]
theorem C_comp : (C a).comp p = C a

{R : Type u}
{a : R}
[Semiring R]
{p : R[X]}

(Polynomial.C a).comp p = Polynomial.C a


protected theorem eq_of_sub_eq_zero {a b : Int} (h : a - b = 0) : a = b


@[to_additive (attr := simp)]
lemma finEquivPowers_symm_apply (x : G) (hx) (n : ℕ) {hn : ∃ m : ℕ, x ^ m = x ^ n} :
    (finEquivPowers x hx).symm ⟨x ^ n, hn⟩ = ⟨n % orderOf x, Nat.mod_lt _ hx.orderOf_pos⟩

{G : Type u_1}
[AddLeftCancelMonoid G]
(x : G)
(hx : IsOfFinAddOrder x)
(n : ℕ)
{hn : ∃ m, m • x = n • x}

(finEquivMultiples x hx).symm ⟨n • x, hn⟩ = ⟨n % addOrderOf x, ⋯⟩


theorem iUnion_comm (s : ι → ι' → Set α) : ⋃ (i) (i'), s i i' = ⋃ (i') (i), s i i'

{α : Type u_1}
{ι : Sort u_4}
{ι' : Sort u_5}
(s : ι → ι' → Set α)


/-- This is a version of `exists_T_pow` stated as an induction principle. -/
@[elab_as_elim]
theorem induction_on_mul_T {Q : R[T;T⁻¹] → Prop} (f : R[T;T⁻¹])
    (Qf : ∀ {f : R[X]} {n : ℕ}, Q (toLaurent f * T (-n))) : Q f

(Qf : ∀ {f : R[X]} {n : ℕ}, Q (Polynomial.toLaurent f * LaurentPolynomial.T (-↑n)))


@[simp]
lemma prod.lift_fst {F₁ F₂ : C ⥤ Type w} (τ₁ : F ⟶ F₁) (τ₂ : F ⟶ F₂) :
    prod.lift τ₁ τ₂ ≫ prod.fst = τ₁

{F F₁ F₂ : CategoryTheory.Functor C (Type w)}

CategoryTheory.CategoryStruct.comp (CategoryTheory.FunctorToTypes.prod.lift τ₁ τ₂)
    CategoryTheory.FunctorToTypes.prod.fst =
  τ₁


theorem sOppSide_pointReflection {s : AffineSubspace R P} {x y : P} (hx : x ∈ s) (hy : y ∉ s) :
    s.SOppSide y (pointReflection R x y)

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[LinearOrderedField R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
{s : AffineSubspace R P}
{x y : P}
(hx : x ∈ s)
(hy : y ∉ s)

s.SOppSide y ((AffineEquiv.pointReflection R x) y)


theorem natAbs_of_nonneg {a : Int} (H : 0 ≤ a) : (natAbs a : Int) = a