@[simp]
theorem coeff_toSubring {n : ℕ} : ↑(coeff (toSubring p T hp) n) = coeff p n

{R : Type u}
[Ring R]
(p : R[X])
(T : Subring R)
(hp : ↑p.coeffs ⊆ ↑T)
{n : ℕ}

↑((p.toSubring T hp).coeff n) = p.coeff n


@[simp]
theorem coeff_one_zero : coeff (1 : R[X]) 0 = 1


theorem pairwise_disjoint_Ioc_add_intCast :
    Pairwise (Disjoint on fun n : ℤ => Ioc (a + n) (a + n + 1))

Pairwise (Disjoint on fun n => Set.Ioc (a + ↑n) (a + ↑n + 1))


lemma sup_iInf_eq (a : α) (f : ι → α) : (a ⊔ ⨅ i, f i) = ⨅ i, a ⊔ f i

{α : Type u}
{ι : Sort w}
(minAx : Order.Coframe.MinimalAxioms α)
(a : α)
(f : ι → α)


theorem ball_prod_same [PseudoEMetricSpace β] (x : α) (y : β) (r : ℝ≥0∞) :
    ball x r ×ˢ ball y r = ball (x, y) r

{α : Type u}
{β : Type v}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
(x : α)
(y : β)
(r : ℝ≥0∞)

EMetric.ball x r ×ˢ EMetric.ball y r = EMetric.ball (x, y) r


@[ext] lemma ext {χ₁ χ₂ : Weight R L M} (h : ∀ x, χ₁ x = χ₂ x) : χ₁ = χ₂

{R : Type u_2}
{L : Type u_3}
{M : Type u_4}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[LieAlgebra.IsNilpotent R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
{χ₁ χ₂ : LieModule.Weight R L M}
(h : ∀ (x : L), χ₁ x = χ₂ x)


@[to_additive (attr := simp)]
theorem coe_map (f : M →* N) (x : Mˣ) : ↑(map f x) = f x

{M : Type u}
{N : Type v}
[AddMonoid M]
[AddMonoid N]
(f : M →+ N)
(x : AddUnits M)


/-- A version of `Quotient.inductionOn₂` taking `{s₁ : Setoid α} {s₂ : Setoid β}` as implicit
arguments instead of instance arguments. -/
@[elab_as_elim]
protected theorem inductionOn₂' {p : Quotient s₁ → Quotient s₂ → Prop} (q₁ : Quotient s₁)
    (q₂ : Quotient s₂)
    (h : ∀ a₁ a₂, p (Quotient.mk'' a₁) (Quotient.mk'' a₂)) : p q₁ q₂

(h : ∀ (a₁ : α) (a₂ : β), p (Quotient.mk'' a₁) (Quotient.mk'' a₂))


protected theorem div_mul_cancel {a b : Int} (H : b ∣ a) : a.div b * b = a


@[simp]
theorem homOfCocone_cooneOfHom {Y : C} (f : X ⟶ Y) : homOfCocone h (coconeOfHom h f) = f

(h : CategoryTheory.coyoneda.obj (Opposite.op X) ⋙ CategoryTheory.uliftFunctor.{u₁, v₃} ≅ F.cocones)

CategoryTheory.Limits.IsColimit.OfNatIso.homOfCocone h (CategoryTheory.Limits.IsColimit.OfNatIso.coconeOfHom h f) = f


theorem rootsOfUnity.coe_injective {n : ℕ+} :
    Function.Injective (fun x : rootsOfUnity n M ↦ x.val.val)


/-- The composition of a partial homeomorphism from `H` to `M` and its inverse belongs to
the analytic groupoid. -/
theorem symm_trans_mem_analyticGroupoid (e : PartialHomeomorph M H) :
    e.symm.trans e ∈ analyticGroupoid I

{𝕜 : 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]
(e : PartialHomeomorph M H)


lemma of_unop (W : MorphismProperty Cᵒᵖ) [W.unop.ContainsIdentities] :
    W.ContainsIdentities

(W : CategoryTheory.MorphismProperty Cᵒᵖ)


lemma Continuous.finset_inf'_apply (hne : s.Nonempty) (hs : ∀ i ∈ s, Continuous (f i)) :
    Continuous (fun a ↦ s.inf' hne (f · a))

{L : Type u_1}
{X : Type u_2}
[TopologicalSpace L]
[TopologicalSpace X]
{ι : Type u_3}
[SemilatticeInf L]
[ContinuousInf L]
{s : Finset ι}
{f : ι → X → L}
(hne : s.Nonempty)
(hs : ∀ i ∈ s, Continuous (f i))

Continuous fun a => s.inf' hne fun x => f x a


lemma le_centralizer_centralizer {s : Subalgebra R A} :
    s ≤ centralizer R (centralizer R (s : Set A))

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

s ≤ Subalgebra.centralizer R ↑(Subalgebra.centralizer R ↑s)


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

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


/-- If `u` is a family of uniform structures on `γ`, then
`𝒰(α, γ, (⨅ i, u i)) = ⨅ i, 𝒰(α, γ, u i)`. -/
protected theorem iInf_eq {u : ι → UniformSpace γ} : 𝒰(α, γ, (⨅ i, u i)) = ⨅ i, 𝒰(α, γ, u i)

{α : Type u_1}
{γ : Type u_3}
{ι : Type u_4}
{u : ι → UniformSpace γ}

UniformFun.uniformSpace α γ = ⨅ i, UniformFun.uniformSpace α γ


@[to_additive]
theorem mul_def (x y : S') : x * y = ⟨x * y, mul_mem x.2 y.2⟩

{M : Type u_1}
{A : Type u_5}
[Mul M]
[SetLike A M]
[hA : MulMemClass A M]
(S' : A)
(x y : ↥S')


theorem csSup_of_not_bdd_above {s : Set ℤ} (h : ¬BddAbove s) : sSup s = 0


theorem cast_zmod_eq_zero_iff_of_le {m n : ℕ} [NeZero m] (h : m ≤ n) (a : ZMod m) :
    (cast a : ZMod n) = 0 ↔ a = 0


/-- **Markov's inequality** also known as **Chebyshev's first inequality**. For a version assuming
`AEMeasurable`, see `mul_meas_ge_le_lintegral₀`. -/
theorem mul_meas_ge_le_lintegral {f : α → ℝ≥0∞} (hf : Measurable f) (ε : ℝ≥0∞) :
    ε * μ { x | ε ≤ f x } ≤ ∫⁻ a, f a ∂μ

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

ε * μ {x | ε ≤ f x} ≤ ∫⁻ (a : α), f a ∂μ


lemma mul_div_cancel_of_imp (h : b = 0 → a = 0) : a * b / b = a

{G₀ : Type u_3}
[GroupWithZero G₀]
{a b : G₀}
(h : b = 0 → a = 0)


@[simp]
theorem image_const_sub_Ioo : (fun x => a - x) '' Ioo b c = Ioo (a - c) (a - b)

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

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


/-- Given `c = lineMap a b r`, `c < b`, the point `(c, f c)` is non-strictly below the
segment `[(a, f a), (b, f b)]` if and only if `slope f a b ≤ slope f c b`. -/
theorem map_le_lineMap_iff_slope_le_slope_right (h : 0 < (1 - r) * (b - a)) :
    f c ≤ lineMap (f a) (f b) r ↔ slope f a b ≤ slope f c b

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

f ((AffineMap.lineMap a b) r) ≤ (AffineMap.lineMap (f a) (f b)) r ↔ slope f a b ≤ slope f ((AffineMap.lineMap a b) r) b


@[simp]
theorem ofDual_le_ofDual [LE α] {a b : αᵒᵈ} : ofDual a ≤ ofDual b ↔ b ≤ a

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


@[to_additive]
theorem tprod_le_of_prod_range_le (hf : Multipliable f) (h : ∀ n, ∏ i ∈ range n, f i ≤ c) :
    ∏' n, f n ≤ c

(h : ∀ (n : ℕ), ∑ i ∈ Finset.range n, f i ≤ c)


theorem map_id : map id = AddMonoidHom.id (FreeAbelianGroup α)

FreeAbelianGroup.map id = AddMonoidHom.id (FreeAbelianGroup α)


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

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

(Function.mulSupport f).mulIndicator (f * g) = f


/-- Diameter of the convex hull of a set `s` equals the emetric diameter of `s`. -/
@[simp]
theorem convexHull_diam (s : Set E) : Metric.diam (convexHull ℝ s) = Metric.diam s

{E : Type u_2}
[SeminormedAddCommGroup E]
[NormedSpace ℝ E]
(s : Set E)

Metric.diam ((convexHull ℝ) s) = Metric.diam s


theorem zeroLocus_sup (I J : Ideal R) :
    zeroLocus ((I ⊔ J : Ideal R) : Set R) = zeroLocus I ∩ zeroLocus J

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

PrimeSpectrum.zeroLocus ↑(I ⊔ J) = PrimeSpectrum.zeroLocus ↑I ∩ PrimeSpectrum.zeroLocus ↑J


theorem Set.OrdConnected.convex [OrderedSemiring 𝕜] [LinearOrderedAddCommMonoid E] [Module 𝕜 E]
    [OrderedSMul 𝕜 E] {s : Set E} (hs : s.OrdConnected) : Convex 𝕜 s

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedSemiring 𝕜]
[LinearOrderedAddCommMonoid E]
[Module 𝕜 E]
[OrderedSMul 𝕜 E]
{s : Set E}
(hs : s.OrdConnected)


/-- Expresses the integral over `Ioi 0` of `t ^ (a - 1) * exp (-(r * t))` in terms of the Gamma
function, for complex `a`. -/
lemma integral_cpow_mul_exp_neg_mul_Ioi {a : ℂ} {r : ℝ} (ha : 0 < a.re) (hr : 0 < r) :
    ∫ (t : ℝ) in Ioi 0, t ^ (a - 1) * exp (-(r * t)) = (1 / r) ^ a * Gamma a

∫ (t : ℝ) in Set.Ioi 0, ↑t ^ (a - 1) * Complex.exp (-(↑r * ↑t)) = (1 / ↑r) ^ a * Complex.Gamma a


theorem differentiableWithinAt_euclidean :
    DifferentiableWithinAt 𝕜 f t y ↔ ∀ i, DifferentiableWithinAt 𝕜 (fun x => f x i) t y

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

DifferentiableWithinAt 𝕜 f t y ↔ ∀ (i : ι), DifferentiableWithinAt 𝕜 (fun x => f x i) t y


/-- The image of a cocone in C under a functor G : C ⥤ D is a cocone in D. -/
@[simps!]
def mapCocone (c : Cocone F) : Cocone (F ⋙ H)

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

(H.mapCocone c).ι.app j = H.map (c.ι.app j)


@[simp]
theorem wbtw_mul_sub_add_iff [NoZeroDivisors R] {x y r : R} :
    Wbtw R x (r * (y - x) + x) y ↔ x = y ∨ r ∈ Set.Icc (0 : R) 1

{R : Type u_1}
[OrderedRing R]
[NoZeroDivisors R]
{x y r : R}

Wbtw R x (r * (y - x) + x) y ↔ x = y ∨ r ∈ Set.Icc 0 1


theorem vert_inv {g : W ≅ Y} {h : X ≅ Z} (p : CommSq f g.hom h.hom i) :
    CommSq i g.inv h.inv f

(p : CategoryTheory.CommSq f g.hom h.hom i)


/-- Sends a topological space to its specialisation order. -/
@[simps]
def topToPreord : TopCat ⥤ Preord

∀ {X Y : TopCat} (f : C(↑X, ↑Y)), topToPreord.map f = Specialization.map f


/-- Orthogonal idempotents lift along nil ideals. -/
theorem exists_isIdempotentElem_mul_eq_zero_of_ker_isNilpotent
    (h : ∀ x ∈ RingHom.ker f, IsNilpotent x)
    (e₁ : S) (he : e₁ ∈ f.range) (he₁ : IsIdempotentElem e₁)
    (e₂ : R) (he₂ : IsIdempotentElem e₂) (he₁e₂ : e₁ * f e₂ = 0) (he₂e₁ : f e₂ * e₁ = 0) :
    ∃ e' : R, IsIdempotentElem e' ∧ f e' = e₁ ∧ e' * e₂ = 0 ∧ e₂ * e' = 0

∃ e', IsIdempotentElem e' ∧ f e' = e₁ ∧ e' * e₂ = 0 ∧ e₂ * e' = 0


/-- If a family of disjoint sets is included in a countable set, then only countably many of
them are nonempty. -/
theorem countable_setOf_nonempty_of_disjoint {f : β → Set α}
    (hf : Pairwise (Disjoint on f)) {s : Set α} (h'f : ∀ t, f t ⊆ s) (hs : s.Countable) :
    Set.Countable {t | (f t).Nonempty}

{α : Type u}
{β : Type v}
{f : β → Set α}
(hf : Pairwise (Disjoint on f))
{s : Set α}
(h'f : ∀ (t : β), f t ⊆ s)
(hs : s.Countable)


@[to_additive]
theorem index_dvd_of_le (h : H ≤ K) : K.index ∣ H.index

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


@[simp] theorem finrank_top' : finrank F (⊤ : IntermediateField F E) = finrank F E

{F : Type u_1}
[Field F]
{E : Type u_2}
[Field E]
[Algebra F E]

FiniteDimensional.finrank F ↥⊤ = FiniteDimensional.finrank F E


@[simp]
theorem right_vsub_midpoint (p₁ p₂ : P) : p₂ -ᵥ midpoint R p₁ p₂ = (⅟ 2 : R) • (p₂ -ᵥ p₁)

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[Ring R]
[Invertible 2]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
(p₁ p₂ : P)

p₂ -ᵥ midpoint R p₁ p₂ = ⅟2 • (p₂ -ᵥ p₁)


/-- A finite group is nilpotent iff the normalizer condition holds, and iff all maximal groups are
normal and iff all Sylow groups are normal and iff the group is the direct product of its Sylow
groups. -/
theorem isNilpotent_of_finite_tfae :
    List.TFAE
      [IsNilpotent G, NormalizerCondition G, ∀ H : Subgroup G, IsCoatom H → H.Normal,
        ∀ (p : ℕ) (_hp : Fact p.Prime) (P : Sylow p G), (↑P : Subgroup G).Normal,
        Nonempty
          ((∀ p : (Nat.card G).primeFactors, ∀ P : Sylow p G, (↑P : Subgroup G)) ≃* G)]

{G : Type u_1}
[hG : Group G]
[Finite G]

[Group.IsNilpotent G, NormalizerCondition G, ∀ (H : Subgroup G), IsCoatom H → H.Normal,
    ∀ (p : ℕ), Fact (Nat.Prime p) → ∀ (P : Sylow p G), (↑P).Normal,
    Nonempty (((p : { x // x ∈ (Nat.card G).primeFactors }) → (P : Sylow (↑p) G) → ↥↑P) ≃* G)].TFAE


/-- Multiplication `y ↦ y * x` as an `IsometryEquiv`. -/
@[to_additive (attr := simps! apply toEquiv) "Addition `y ↦ y + x` as an `IsometryEquiv`."]
def mulRight [IsometricSMul Gᵐᵒᵖ G] (c : G) : G ≃ᵢ G

{G : Type v}
[Group G]
[PseudoEMetricSpace G]
[IsometricSMul Gᵐᵒᵖ G]
(c x : G)


/-- The Yoneda embedding for preadditive categories sends an object `X` to the copresheaf sending an
object `Y` to the group of morphisms `X ⟶ Y`. At each point, we get an additional `End X`-module
structure, see `preadditiveCoyonedaObj`.
-/
@[simps]
def preadditiveCoyoneda : Cᵒᵖ ⥤ C ⥤ AddCommGrp.{v}

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

∀ {X Y : Cᵒᵖ} (f : X ⟶ Y) (Y_1 : C)
  (g :
    ↑(((fun X =>
              (CategoryTheory.preadditiveCoyonedaObj X).comp
                (CategoryTheory.forget₂ (ModuleCat (CategoryTheory.End X)) AddCommGrp))
            X).obj
        Y_1)),
  ((CategoryTheory.preadditiveCoyoneda.map f).app Y_1) g = CategoryTheory.CategoryStruct.comp f.unop g


theorem WOppSide.not_sSameSide {s : AffineSubspace R P} {x y : P} (h : s.WOppSide x y) :
    ¬s.SSameSide 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}
(h : s.WOppSide x y)


/-- A quadratic has roots if and only if its discriminant equals some square.
-/
theorem quadratic_eq_zero_iff_discrim_eq_sq [NeZero (2 : R)] [NoZeroDivisors R]
    (ha : a ≠ 0) (x : R) :
    a * x * x + b * x + c = 0 ↔ discrim a b c = (2 * a * x + b) ^ 2

{R : Type u_1}
[CommRing R]
{a b c : R}
[NeZero 2]
[NoZeroDivisors R]
(ha : a ≠ 0)
(x : R)


@[simp]
theorem mul_mul_invOf_self_cancel' [Monoid α] (a b : α) {_ : Invertible b} : a * b * ⅟ b = a


/-- A tuple is monotone if and only if the list obtained from it is sorted. -/
@[deprecated sorted_le_ofFn_iff (since := "2023-01-10")]
theorem monotone_iff_ofFn_sorted : Monotone f ↔ (ofFn f).Sorted (· ≤ ·)

{n : ℕ}
{α : Type u}
{f : Fin n → α}
[Preorder α]

Monotone f ↔ List.Sorted (fun x x_1 => x ≤ x_1) (List.ofFn f)


theorem isUniform_comm : IsUniform G ε s t ↔ IsUniform G ε t s

{α : Type u_1}
{𝕜 : Type u_2}
[LinearOrderedField 𝕜]
(G : SimpleGraph α)
[DecidableRel G.Adj]
{ε : 𝕜}
{s t : Finset α}


theorem map_le_nonZeroDivisors_of_injective [NoZeroDivisors M'] [MonoidWithZeroHomClass F M M']
    (f : F) (hf : Function.Injective f) {S : Submonoid M} (hS : S ≤ M⁰) : S.map f ≤ M'⁰

{M : Type u_2}
{M' : Type u_3}
{F : Type u_7}
[MonoidWithZero M]
[MonoidWithZero M']
[FunLike F M M']
[NoZeroDivisors M']
[MonoidWithZeroHomClass F M M']
(f : F)
(hf : Function.Injective ⇑f)
{S : Submonoid M}
(hS : S ≤ M⁰)


theorem Filter.HasBasis.prod_nhds {ιX ιY : Type*} {px : ιX → Prop} {py : ιY → Prop}
    {sx : ιX → Set X} {sy : ιY → Set Y} {x : X} {y : Y} (hx : (𝓝 x).HasBasis px sx)
    (hy : (𝓝 y).HasBasis py sy) :
    (𝓝 (x, y)).HasBasis (fun i : ιX × ιY => px i.1 ∧ py i.2) fun i => sx i.1 ×ˢ sy i.2

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]
{ιX : Type u_5}
{ιY : Type u_6}
{px : ιX → Prop}
{py : ιY → Prop}
{sx : ιX → Set X}
{sy : ιY → Set Y}
{x : X}
{y : Y}
(hx : (𝓝 x).HasBasis px sx)
(hy : (𝓝 y).HasBasis py sy)

(𝓝 (x, y)).HasBasis (fun i => px i.1 ∧ py i.2) fun i => sx i.1 ×ˢ sy i.2


theorem Continuous.of_bundled' (f : α →o β) (hf' : Continuous f) : Continuous' f

(hf' : OmegaCompletePartialOrder.Continuous f)


theorem Pairwise.subset_of_biUnion_subset_biUnion (h₀ : Pairwise (Disjoint on f))
    (h₁ : ∀ i ∈ s, (f i).Nonempty) (h : ⋃ i ∈ s, f i ⊆ ⋃ i ∈ t, f i) : s ⊆ t

{α : Type u_1}
{ι : Type u_4}
{f : ι → Set α}
{s t : Set ι}
(h₀ : Pairwise (Disjoint on f))
(h₁ : ∀ i ∈ s, (f i).Nonempty)
(h : ⋃ i ∈ s, f i ⊆ ⋃ i ∈ t, f i)


@[to_additive (attr := simp)]
theorem coe_one {G : Type*} [One G] [TopologicalSpace G] [ChartedSpace H' G] :
    ⇑(1 : C^∞⟮I, N; I', G⟯) = 1

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{E' : Type u_3}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H : Type u_4}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{H' : Type u_5}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{N : Type u_6}
[TopologicalSpace N]
[ChartedSpace H N]
{G : Type u_10}
[Zero G]
[TopologicalSpace G]
[ChartedSpace H' G]


/-- A prestructure is a first-order structure with a `Setoid` equivalence relation on it,
  such that quotienting by that equivalence relation is still a structure. -/
class Prestructure (s : Setoid M) where
  toStructure : L.Structure M
  fun_equiv : ∀ {n} {f : L.Functions n} (x y : Fin n → M), x ≈ y → funMap f x ≈ funMap f y
  rel_equiv : ∀ {n} {r : L.Relations n} (x y : Fin n → M) (_ : x ≈ y), RelMap r x = RelMap r y

{L : FirstOrder.Language}
{M : Type u_1}
{s : Setoid M}
[self : L.Prestructure s]
{n : ℕ}
{r : L.Relations n}
(x y : Fin n → M)

x ≈ y → FirstOrder.Language.Structure.RelMap r x = FirstOrder.Language.Structure.RelMap r y


@[to_additive]
theorem mul_inv_toFun_mem (hS : S ∈ Subgroup.rightTransversals (H : Set G)) (g : G) :
    g * (toFun hS g : G)⁻¹ ∈ H

(hS : S ∈ Subgroup.rightTransversals ↑H)

g * (↑(Subgroup.MemRightTransversals.toFun hS g))⁻¹ ∈ H


theorem isUpperSet_iff_Ici_subset : IsUpperSet s ↔ ∀ ⦃a⦄, a ∈ s → Ici a ⊆ s

IsUpperSet s ↔ ∀ ⦃a : α⦄, a ∈ s → Set.Ici a ⊆ s


@[simp]
theorem centralizer_univ : centralizer R Set.univ = center R A

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

NonUnitalStarSubalgebra.centralizer R Set.univ = NonUnitalStarSubalgebra.center R A


protected theorem rightInvOn : RightInvOn e.symm e e.target

{X : Type u_1}
{Y : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
(e : PartialHomeomorph X Y)


@[to_additive (attr := simp)] lemma leOnePart_one : (1 : α)⁻ᵐ = 1


/-- A space with a `Bornology` is a **bounded space** if `Set.univ : Set α` is bounded. -/
class BoundedSpace (α : Type*) [Bornology α] : Prop where
  /-- The `Set.univ` is bounded. -/
  bounded_univ : Bornology.IsBounded (univ : Set α)

{α : Type u_4}
[Bornology α]
[self : BoundedSpace α]


@[simp]
theorem isClosed_compl_iff {s : Set X} : IsClosed sᶜ ↔ IsOpen s

{X : Type u}
[TopologicalSpace X]
{s : Set X}


@[fun_prop]
theorem Continuous.cexp (h : Continuous f) : Continuous fun y => exp (f y)

{α : Type u_1}
[TopologicalSpace α]
{f : α → ℂ}
(h : Continuous f)


@[simp]
theorem shiftRight_coe_nat (m n : ℕ) : (m : ℤ) >>> (n : ℤ) = m >>> n


@[simp]
theorem map_smul {v : VectorMeasure α M} {f : α → β} (c : R) : (c • v).map f = c • v.map f

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
[MeasurableSpace β]
{M : Type u_3}
[AddCommMonoid M]
[TopologicalSpace M]
{R : Type u_4}
[Semiring R]
[DistribMulAction R M]
[ContinuousConstSMul R M]
{v : MeasureTheory.VectorMeasure α M}
{f : α → β}
(c : R)


@[simp] theorem exists_eq_left' : (∃ a, a' = a ∧ p a) ↔ p a'


/-- If `f : 𝕜 → 𝕜` is strictly convex, then for any point `a` the slope of the secant line of `f`
through `a` and `b` is strictly monotone with respect to `b`. -/
theorem StrictConvexOn.secant_strict_mono (hf : StrictConvexOn 𝕜 s f) {a x y : 𝕜} (ha : a ∈ s)
    (hx : x ∈ s) (hy : y ∈ s) (hxa : x ≠ a) (hya : y ≠ a) (hxy : x < y) :
    (f x - f a) / (x - a) < (f y - f a) / (y - a)

{𝕜 : Type u_1}
[LinearOrderedField 𝕜]
{s : Set 𝕜}
{f : 𝕜 → 𝕜}
(hf : StrictConvexOn 𝕜 s f)
{a x y : 𝕜}
(ha : a ∈ s)
(hx : x ∈ s)
(hy : y ∈ s)
(hxa : x ≠ a)
(hya : y ≠ a)
(hxy : x < y)


theorem lt_aleph0_iff_fintype {α : Type u} : #α < ℵ₀ ↔ Nonempty (Fintype α)

Cardinal.mk α < Cardinal.aleph0 ↔ Nonempty (Fintype α)


theorem reaches_total {σ} {f : σ → Option σ} {a b c} (hab : Reaches f a b) (hac : Reaches f a c) :
    Reaches f b c ∨ Reaches f c b

{σ : Type u_1}
{f : σ → Option σ}
{a b c : σ}
(hab : Turing.Reaches f a b)
(hac : Turing.Reaches f a c)

Turing.Reaches f b c ∨ Turing.Reaches f c b


theorem sum_repr_mul_repr {ι'} [Fintype ι'] (b' : Basis ι' R M) (x : M) (i : ι) :
    (∑ j : ι', b.repr (b' j) i * b'.repr x j) = b.repr x i

{ι : Type u_1}
{R : Type u_3}
{M : Type u_6}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
(b : Basis ι R M)
{ι' : Type u_10}
[Fintype ι']
(b' : Basis ι' R M)
(x : M)
(i : ι)

∑ j : ι', (b.repr (b' j)) i * (b'.repr x) j = (b.repr x) i


theorem rank_map_le (f : M →ₗ[R] M₁) (p : Submodule R M) :
    Module.rank R (p.map f) ≤ Module.rank R p

{R : Type u}
{M M₁ : Type v}
[Ring R]
[AddCommGroup M]
[AddCommGroup M₁]
[Module R M]
[Module R M₁]
(f : M →ₗ[R] M₁)
(p : Submodule R M)

Module.rank R ↥(Submodule.map f p) ≤ Module.rank R ↥p


/-- To show a filter is above the neighborhood filter at `x`, it suffices to show that it is above
the principal filter of some open set `s` containing `x`. -/
theorem nhds_le_of_le {f} (h : x ∈ s) (o : IsOpen s) (sf : 𝓟 s ≤ f) : 𝓝 x ≤ f

{X : Type u}
{x : X}
{s : Set X}
[TopologicalSpace X]
{f : Filter X}
(h : x ∈ s)
(o : IsOpen s)
(sf : 𝓟 s ≤ f)


theorem sqrtTwoAddSeries_nonneg {x : ℝ} (h : 0 ≤ x) : ∀ n : ℕ, 0 ≤ sqrtTwoAddSeries x n


lemma lift_unique' (F₁ F₂ : Quotient r ⥤ D) (h : functor r ⋙ F₁ = functor r ⋙ F₂) :
    F₁ = F₂

(F₁ F₂ : CategoryTheory.Functor (CategoryTheory.Quotient r) D)

(h : (CategoryTheory.Quotient.functor r).comp F₁ = (CategoryTheory.Quotient.functor r).comp F₂)


theorem image₂_right_comm {γ : Type*} {u : Finset γ} {f : δ → γ → ε} {g : α → β → δ}
    {f' : α → γ → δ'} {g' : δ' → β → ε} (h_right_comm : ∀ a b c, f (g a b) c = g' (f' a c) b) :
    image₂ f (image₂ g s t) u = image₂ g' (image₂ f' s u) t

{f : δ → γ → ε}

{g : α → β → δ}

(h_right_comm : ∀ (a : α) (b : β) (c : γ), f (g a b) c = g' (f' a c) b)

Finset.image₂ f (Finset.image₂ g s t) u = Finset.image₂ g' (Finset.image₂ f' s u) t


@[simp, reassoc]
theorem gluedCoverT'_snd_fst (x y z : 𝒰.J) :
    gluedCoverT' 𝒰 x y z ≫ pullback.snd _ _ ≫ pullback.fst _ _ =
      pullback.fst _ _ ≫ pullback.snd _ _

{X : AlgebraicGeometry.Scheme}
(𝒰 : X.OpenCover)
(x y z : 𝒰.J)

𝒰.gluedCoverT' x y z ≫
    CategoryTheory.Limits.pullback.snd (CategoryTheory.Limits.pullback.fst (𝒰.map y) (𝒰.map z))
        (CategoryTheory.Limits.pullback.fst (𝒰.map y) (𝒰.map x)) ≫
      CategoryTheory.Limits.pullback.fst (𝒰.map y) (𝒰.map x) =
  CategoryTheory.Limits.pullback.fst (CategoryTheory.Limits.pullback.fst (𝒰.map x) (𝒰.map y))
      (CategoryTheory.Limits.pullback.fst (𝒰.map x) (𝒰.map z)) ≫
    CategoryTheory.Limits.pullback.snd (𝒰.map x) (𝒰.map y)


/-- Implementation of `SheafConditionPairwiseIntersections.coneEquiv`. -/
@[simps]
def coneEquivInverseObj (c : Limits.Cone (SheafConditionEqualizerProducts.diagram F U)) :
    Limits.Cone ((diagram U).op ⋙ F)

(c : CategoryTheory.Limits.Cone (TopCat.Presheaf.SheafConditionEqualizerProducts.diagram F U))

(TopCat.Presheaf.SheafConditionPairwiseIntersections.coneEquivInverseObj F U c).π.app x =
  Opposite.rec'
    (fun x =>
      CategoryTheory.Pairwise.casesOn x
        (fun i =>
          c.π.app CategoryTheory.Limits.WalkingParallelPair.zero ≫
            CategoryTheory.Limits.Pi.π (fun i => F.obj (Opposite.op (U i))) i)
        fun i j =>
        c.π.app CategoryTheory.Limits.WalkingParallelPair.one ≫
          CategoryTheory.Limits.Pi.π (fun p => F.obj (Opposite.op (U p.1 ⊓ U p.2))) (i, j))
    x


@[to_additive]
theorem image_mul_right' : (· * b⁻¹) '' t = (· * b) ⁻¹' t

{α : Type u_2}
[Group α]
{t : Set α}
{b : α}

(fun x => x * b⁻¹) '' t = (fun x => x * b) ⁻¹' t


theorem normed_def {μ : Measure E} (x : E) : f.normed μ x = f x / ∫ x, f x ∂μ

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[HasContDiffBump E]
[MeasurableSpace E]
{c : E}
(f : ContDiffBump c)
{μ : MeasureTheory.Measure E}
(x : E)

f.normed μ x = ↑f x / ∫ (x : E), ↑f x ∂μ


theorem range_le {m n : ℕ} : range m ≤ range n ↔ m ≤ n

Multiset.range m ≤ Multiset.range n ↔ m ≤ n


private theorem mem_wf_aux : ∀ {x y : PSet.{u}}, Equiv x y → Acc (· ∈ ·) y

x.Equiv y → Acc (fun x x_1 => x ∈ x_1) y


theorem nhds_le (hf : IsOpenMap f) (x : X) : 𝓝 (f x) ≤ (𝓝 x).map f

{X : Type u_1}
{Y : Type u_2}
{f : X → Y}
[TopologicalSpace X]
[TopologicalSpace Y]
(hf : IsOpenMap f)
(x : X)


@[simp]
lemma homEquiv_map (f : X ⟶ Y) : homEquiv W L₁ L₂ (L₁.map f) = L₂.map f

(CategoryTheory.Localization.homEquiv W L₁ L₂) (L₁.map f) = L₂.map f


theorem strictConvex_singleton (c : E) : StrictConvex 𝕜 ({c} : Set E)

{𝕜 : Type u_1}
{E : Type u_3}
[OrderedSemiring 𝕜]
[TopologicalSpace E]
[AddCommMonoid E]
[Module 𝕜 E]
(c : E)


theorem iSup [CompleteLattice β] [Countable ι] (hf : ∀ i, AEMeasurable (f i) μ)
    (hp : ∀ᵐ x ∂μ, p x fun n => f n x) : ⨆ n, aeSeq hf p n =ᵐ[μ] ⨆ n, f n

{f : ι → α → β}

(hp : ∀ᵐ (x : α) ∂μ, p x fun n => f n x)


@[simp]
theorem Set.antitone_mem : Antitone (· ∈ s) ↔ IsLowerSet s

(Antitone fun x => x ∈ s) ↔ IsLowerSet s


@[simp]
theorem antivaryOn_toDual_left : AntivaryOn (toDual ∘ f) g s ↔ MonovaryOn f g s

{ι : Type u_1}
{α : Type u_3}
{β : Type u_4}
[Preorder α]
[Preorder β]
{f : ι → α}
{g : ι → β}
{s : Set ι}

AntivaryOn (⇑OrderDual.toDual ∘ f) g s ↔ MonovaryOn f g s


@[simp]
theorem coe_inv_circle (z : circle) : ↑z⁻¹ = (z : ℂ)⁻¹

↑z⁻¹ = (↑z)⁻¹


@[to_additive]
theorem UniformContinuous.div [UniformSpace β] {f : β → α} {g : β → α} (hf : UniformContinuous f)
    (hg : UniformContinuous g) : UniformContinuous fun x => f x / g x

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


theorem smul_X_eq_monomial {n} : a • X ^ n = monomial n (a : R)

{R : Type u}
{a : R}
[Semiring R]
{n : ℕ}

a • Polynomial.X ^ n = (Polynomial.monomial n) a


theorem eq_rpow_inv_iff {x y : ℝ≥0} {z : ℝ} (hz : z ≠ 0) : x = y ^ z⁻¹ ↔ x ^ z = y


@[to_additive (attr := simp)]
theorem snd_comp_inl : (snd M N).comp (inl M N) = 1

{M : Type u_5}
{N : Type u_6}
[AddZeroClass M]
[AddZeroClass N]

(AddMonoidHom.snd M N).comp (AddMonoidHom.inl M N) = 0


/-- The type of bilinear maps which are accepted by `CliffordAlgebra.even.lift`. -/
@[ext]
structure EvenHom : Type max uA uM where
  bilin : M →ₗ[R] M →ₗ[R] A
  contract (m : M) : bilin m m = algebraMap R A (Q m)
  contract_mid (m₁ m₂ m₃ : M) : bilin m₁ m₂ * bilin m₂ m₃ = Q m₂ • bilin m₁ m₃

{R : Type uR}
{M : Type uM}
[CommRing R]
[AddCommGroup M]
[Module R M]
{Q : QuadraticForm R M}
{A : Type uA}
[Ring A]
[Algebra R A]
(self : CliffordAlgebra.EvenHom Q A)
(m₁ m₂ m₃ : M)

(self.bilin m₁) m₂ * (self.bilin m₂) m₃ = Q m₂ • (self.bilin m₁) m₃


@[simp]
theorem down_zero : down (0 : SetSemiring α) = ∅


@[simp]
theorem affineCombinationLineMapWeights_apply_right [DecidableEq ι] {i j : ι} (h : i ≠ j) (c : k) :
    affineCombinationLineMapWeights i j c j = c

{k : Type u_1}
[Ring k]
{ι : Type u_4}
[DecidableEq ι]
{i j : ι}
(h : i ≠ j)
(c : k)

Finset.affineCombinationLineMapWeights i j c j = c


/-- Matrices over dual numbers and dual numbers over matrices are isomorphic. -/
@[simps]
def Matrix.dualNumberEquiv : Matrix n n (DualNumber R) ≃ₐ[R] DualNumber (Matrix n n R)

{R n : Type}
[CommSemiring R]
[Fintype n]
[DecidableEq n]
(A : Matrix n n (DualNumber R))

Matrix.dualNumberEquiv A =
  (Matrix.of fun i j => TrivSqZeroExt.fst (A i j), Matrix.of fun i j => TrivSqZeroExt.snd (A i j))


lemma succAbove_succ_of_le (p i : Fin n) (h : i ≤ p) : succAbove p.succ i = i.castSucc


theorem norm_iteratedFDeriv_clm_apply_const {f : E → F →L[𝕜] G} {c : F} {x : E} {N : ℕ∞} {n : ℕ}
    (hf : ContDiff 𝕜 N f) (hn : ↑n ≤ N) :
    ‖iteratedFDeriv 𝕜 n (fun y : E => (f y) c) x‖ ≤ ‖c‖ * ‖iteratedFDeriv 𝕜 n f x‖

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type uG}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{f : E → F →L[𝕜] G}
{c : F}
{x : E}
{N : ℕ∞}
{n : ℕ}
(hf : ContDiff 𝕜 N f)
(hn : ↑n ≤ N)

‖iteratedFDeriv 𝕜 n (fun y => (f y) c) x‖ ≤ ‖c‖ * ‖iteratedFDeriv 𝕜 n f x‖


protected theorem not {p : α → Prop} (hp : ComputablePred p) : ComputablePred fun a => ¬p a

{α : Type u_1}
[Primcodable α]
{p : α → Prop}
(hp : ComputablePred p)


@[simp] theorem replicate_succ_ne_nil (n : Nat) (a : α) : replicate (n+1) a ≠ []


theorem mul_apply [Mul R] [BoundedMul R] [ContinuousMul R] (f g : α →ᵇ R) (x : α) :
    (f * g) x = f x * g x

{α : Type u}
[TopologicalSpace α]
{R : Type u_2}
[PseudoMetricSpace R]
[Mul R]
[BoundedMul R]
[ContinuousMul R]
(f g : BoundedContinuousFunction α R)
(x : α)


/--
Given two series of the form `a₀ -r→ ... -r→ X` and `X -r→ b ---> ...`,
then `a₀ -r→ ... -r→ X -r→ b ...` is another series obtained by combining the given two.
-/
@[simps]
def smash (p q : RelSeries r) (connect : p.last = q.head) : RelSeries r

{α : Type u_1}
{r : Rel α α}
(p q : RelSeries r)
(connect : p.last = q.head)
(i : Fin (p.length + q.length + 1))

(p.smash q connect).toFun i = if H : ↑i < p.length then p.toFun ⟨↑i, ⋯⟩ else q.toFun ⟨↑i - p.length, ⋯⟩


theorem bounded_gt_Ioo [Preorder α] (a b : α) : Bounded (· > ·) (Ioo a b)

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


@[higher_order tsnd_comp_tsnd]
theorem comp_tsnd {α β₀ β₁ β₂} (g : β₀ → F β₁) (g' : β₁ → G β₂) (x : t α β₀) :
    Comp.mk (tsnd g' <$> tsnd g x) = tsnd (Comp.mk ∘ map g' ∘ g) x

{t : Type u → Type u → Type u}
[Bitraversable t]
{F G : Type u → Type u}
[Applicative F]
[Applicative G]
[LawfulBitraversable t]
[LawfulApplicative F]
[LawfulApplicative G]
{α β₀ β₁ β₂ : Type u}
(g : β₀ → F β₁)
(g' : β₁ → G β₂)
(x : t α β₀)

Functor.Comp.mk (Bitraversable.tsnd g' <$> Bitraversable.tsnd g x) =
  Bitraversable.tsnd (Functor.Comp.mk ∘ Functor.map g' ∘ g) x


@[simp] lemma sdiff_eq_sdiff_iff : a \ b = b \ a ↔ a = b

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


theorem countable_univ_iff : (univ : Set α).Countable ↔ Countable α


/-- Let `l'` be a measurably generated filter; let `l` be a of filter such that each `s ∈ l'`
eventually includes `Ioc u v` as both `u` and `v` tend to `l`. Let `μ` be a measure finite at `l'`.

Suppose that `f : ℝ → E` has a finite limit at `l' ⊓ ae μ`. Then `f` is interval integrable on
`u..v` provided that both `u` and `v` tend to `l`.

Typeclass instances allow Lean to find `l'` based on `l` but not vice versa, so
`apply Tendsto.eventually_intervalIntegrable_ae` will generate goals `Filter ℝ` and
`TendstoIxxClass Ioc ?m_1 l'`. -/
theorem Filter.Tendsto.eventually_intervalIntegrable_ae {f : ℝ → E} {μ : Measure ℝ}
    {l l' : Filter ℝ} (hfm : StronglyMeasurableAtFilter f l' μ) [TendstoIxxClass Ioc l l']
    [IsMeasurablyGenerated l'] (hμ : μ.FiniteAtFilter l') {c : E} (hf : Tendsto f (l' ⊓ ae μ) (𝓝 c))
    {u v : ι → ℝ} {lt : Filter ι} (hu : Tendsto u lt l) (hv : Tendsto v lt l) :
    ∀ᶠ t in lt, IntervalIntegrable f μ (u t) (v t)

(hf : Filter.Tendsto f (l' ⊓ MeasureTheory.ae μ) (𝓝 c))

∀ᶠ (t : ι) in lt, IntervalIntegrable f μ (u t) (v t)


lemma mul_self_mul_conjTranspose_eq_zero (A : Matrix m n R) (B : Matrix p m R) :
    B * (A * Aᴴ) = 0 ↔ B * A = 0

{m : Type u_1}
{n : Type u_2}
{p : Type u_3}
{R : Type u_4}
[Fintype m]
[Fintype n]
[PartialOrder R]
[NonUnitalRing R]
[StarRing R]
[StarOrderedRing R]
[NoZeroDivisors R]
(A : Matrix m n R)
(B : Matrix p m R)

B * (A * A.conjTranspose) = 0 ↔ B * A = 0


/-- Reinterpret a monoid isomorphism `f : M ≃* N` as an equivalence `SingleObj M ≌ SingleObj N`. -/
@[simps!]
def toSingleObjEquiv (e : M ≃* N) : SingleObj M ≌ SingleObj N

{M : Type u}
{N : Type v}
[Monoid M]
[Monoid N]
(e : M ≃* N)
(a : CategoryTheory.SingleObj M)


@[simp] lemma div_ofReal_im (z : ℂ) (x : ℝ) : (z / x).im = z.im / x


theorem memℒp_two_iff_integrable_sq {f : α → ℝ} (hf : AEStronglyMeasurable f μ) :
    Memℒp f 2 μ ↔ Integrable (fun x => f x ^ 2) μ

(hf : MeasureTheory.AEStronglyMeasurable f μ)

MeasureTheory.Memℒp f 2 μ ↔ MeasureTheory.Integrable (fun x => f x ^ 2) μ


theorem bsup_eq_bsup {ι : Type u} (r r' : ι → ι → Prop) [IsWellOrder ι r] [IsWellOrder ι r']
    (f : ι → Ordinal.{max u v}) :
    bsup.{_, v} _ (bfamilyOfFamily' r f) = bsup.{_, v} _ (bfamilyOfFamily' r' f)

(Ordinal.type r).bsup (Ordinal.bfamilyOfFamily' r f) = (Ordinal.type r').bsup (Ordinal.bfamilyOfFamily' r' f)


lemma Ici_ne_Ici : Ici a ≠ Ici b ↔ a ≠ b

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


@[ext]
theorem hom_ext {M N : Mat_ C} (f g : M ⟶ N) (H : ∀ i j, f i j = g i j) : f = g

(H : ∀ (i : M.ι) (j : N.ι), f i j = g i j)


@[simp]
theorem isBigOWith_map {k : β → α} {l : Filter β} :
    IsBigOWith c (map k l) f g ↔ IsBigOWith c l (f ∘ k) (g ∘ k)

{α : Type u_1}
{β : Type u_2}
{E : Type u_3}
{F : Type u_4}
[Norm E]
[Norm F]
{c : ℝ}
{f : α → E}
{g : α → F}
{k : β → α}
{l : Filter β}

Asymptotics.IsBigOWith c (Filter.map k l) f g ↔ Asymptotics.IsBigOWith c l (f ∘ k) (g ∘ k)


/-- Triangle inequality for the extended distance -/
theorem edist_triangle_left (x y z : α) : edist x y ≤ edist z x + edist z y

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


theorem reindex_apply (i' : ι') : b.reindex e i' = b (e.symm i')

{ι : Type u_1}
{ι' : Type u_2}
{R : Type u_3}
{M : Type u_6}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(b : Basis ι R M)
(e : ι ≃ ι')
(i' : ι')


@[to_additive]
theorem div_union : s / (t₁ ∪ t₂) = s / t₁ ∪ s / t₂

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


theorem prod_int_mod (s : Finset α) (n : ℤ) (f : α → ℤ) :
    (∏ i ∈ s, f i) % n = (∏ i ∈ s, f i % n) % n

{α : Type u_3}
(s : Finset α)
(n : ℤ)
(f : α → ℤ)


lemma ShortExact.ab_surjective_g (hS : S.ShortExact) :
    Function.Surjective S.g

{S : CategoryTheory.ShortComplex Ab}
(hS : S.ShortExact)


@[simp]
theorem map_monomial (s : σ →₀ ℕ) (a : R) : map f (monomial s a) = monomial s (f a)

{R : Type u}
{S₁ : Type v}
{σ : Type u_1}
[CommSemiring R]
[CommSemiring S₁]
(f : R →+* S₁)
(s : σ →₀ ℕ)
(a : R)

(MvPolynomial.map f) ((MvPolynomial.monomial s) a) = (MvPolynomial.monomial s) (f a)


theorem exists_lt_apply_of_lt_opNorm {𝕜 𝕜₂ E F : Type*} [NormedAddCommGroup E]
    [SeminormedAddCommGroup F] [DenselyNormedField 𝕜] [NontriviallyNormedField 𝕜₂] {σ₁₂ : 𝕜 →+* 𝕜₂}
    [NormedSpace 𝕜 E] [NormedSpace 𝕜₂ F] [RingHomIsometric σ₁₂] (f : E →SL[σ₁₂] F) {r : ℝ}
    (hr : r < ‖f‖) : ∃ x : E, ‖x‖ < 1 ∧ r < ‖f x‖

{𝕜 : Type u_11}
{𝕜₂ : Type u_12}
{E : Type u_13}
{F : Type u_14}
[NormedAddCommGroup E]
[SeminormedAddCommGroup F]
[DenselyNormedField 𝕜]
[NontriviallyNormedField 𝕜₂]
{σ₁₂ : 𝕜 →+* 𝕜₂}
[NormedSpace 𝕜 E]
[NormedSpace 𝕜₂ F]
[RingHomIsometric σ₁₂]
(f : E →SL[σ₁₂] F)
{r : ℝ}
(hr : r < ‖f‖)


/-- A functor `G : (C, J) ⥤ (D, K)` between sites is called compatible preserving if for each
compatible family of elements at `C` and valued in `G.op ⋙ ℱ`, and each commuting diagram
`f₁ ≫ G.map g₁ = f₂ ≫ G.map g₂`, `x g₁` and `x g₂` coincide when restricted via `fᵢ`.
This is actually stronger than merely preserving compatible families because of the definition of
`functorPushforward` used.
-/
-- Porting note(#5171): linter not ported yet @[nolint has_nonempty_instance]
structure CompatiblePreserving (K : GrothendieckTopology D) (G : C ⥤ D) : Prop where
  compatible :
    ∀ (ℱ : SheafOfTypes.{w} K) {Z} {T : Presieve Z} {x : FamilyOfElements (G.op ⋙ ℱ.val) T}
      (_ : x.Compatible) {Y₁ Y₂} {X} (f₁ : X ⟶ G.obj Y₁) (f₂ : X ⟶ G.obj Y₂) {g₁ : Y₁ ⟶ Z}
      {g₂ : Y₂ ⟶ Z} (hg₁ : T g₁) (hg₂ : T g₂) (_ : f₁ ≫ G.map g₁ = f₂ ≫ G.map g₂),
      ℱ.val.map f₁.op (x g₁ hg₁) = ℱ.val.map f₂.op (x g₂ hg₂)

{K : CategoryTheory.GrothendieckTopology D}

(self : CategoryTheory.CompatiblePreserving K G)

{x : CategoryTheory.Presieve.FamilyOfElements (G.op ⋙ ℱ.val) T}

x.Compatible →
  ∀ {Y₁ Y₂ : C} {X : D} (f₁ : X ⟶ G.obj Y₁) (f₂ : X ⟶ G.obj Y₂) {g₁ : Y₁ ⟶ Z} {g₂ : Y₂ ⟶ Z} (hg₁ : T g₁) (hg₂ : T g₂),
    f₁ ≫ G.map g₁ = f₂ ≫ G.map g₂ → ℱ.val.map f₁.op (x g₁ hg₁) = ℱ.val.map f₂.op (x g₂ hg₂)


@[reassoc (attr := simp)]
lemma ΓSpecIso_inv_naturality {R S : CommRingCat.{u}} (f : R ⟶ S) :
    f ≫ (ΓSpecIso S).inv = (ΓSpecIso R).inv ≫ (Spec.map f).app ⊤

f ≫ (AlgebraicGeometry.Scheme.ΓSpecIso S).inv =
  (AlgebraicGeometry.Scheme.ΓSpecIso R).inv ≫ AlgebraicGeometry.Scheme.Hom.app (AlgebraicGeometry.Spec.map f) ⊤


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

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

(hinj : ∀ (i : ι), Function.Injective ⇑(ϕ i))

Function.Injective ⇑(AddMonoidHom.noncommPiCoprod ϕ hcomm)


/-- `Fin.castAdd` as an `OrderEmbedding`.

`castAddEmb m i` embeds `i : Fin n` in `Fin (n+m)`. See also `Fin.natAddEmb` and `Fin.addNatEmb`. -/
@[simps! apply toEmbedding]
def castAddOrderEmb (m) : Fin n ↪o Fin (n + m)

(Fin.castAddOrderEmb m).toEmbedding = { toFun := Fin.castAdd m, inj' := ⋯ }


theorem Seminorm.continuous_of_lowerSemicontinuous {𝕜 E : Type*} [AddGroup E] [SMul 𝕜 E]
    [SeminormedRing 𝕜] [TopologicalSpace E] [BarrelledSpace 𝕜 E] (p : Seminorm 𝕜 E)
    (hp : LowerSemicontinuous p) : Continuous p

{𝕜 : Type u_1}
{E : Type u_2}
[AddGroup E]
[SMul 𝕜 E]
[SeminormedRing 𝕜]
[TopologicalSpace E]
[BarrelledSpace 𝕜 E]
(p : Seminorm 𝕜 E)
(hp : LowerSemicontinuous ⇑p)


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

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


@[elab_as_elim]
theorem induction_on {C : AdjoinRoot f → Prop} (x : AdjoinRoot f) (ih : ∀ p : R[X], C (mk f p)) :
    C x

(ih : ∀ (p : R[X]), C ((AdjoinRoot.mk f) p))


theorem copy_eq (f : α →*₀o β) (f' : α → β) (h : f' = f) : f.copy f' h = f

{α : Type u_2}
{β : Type u_3}
[Preorder α]
[Preorder β]
[MulZeroOneClass α]
[MulZeroOneClass β]
(f : α →*₀o β)
(f' : α → β)
(h : f' = ⇑f)


theorem ExtensionOfMaxAdjoin.extendIdealTo_wd (h : Module.Baer R Q) {y : N} (r r' : R)
    (eq1 : r • y = r' • y) : ExtensionOfMaxAdjoin.extendIdealTo i f h y r =
    ExtensionOfMaxAdjoin.extendIdealTo i f h y r'

{R : Type u}
[Ring R]
{Q : Type v}
[AddCommGroup Q]
[Module R Q]
{M : Type u_1}
{N : Type u_2}
[AddCommGroup M]
[AddCommGroup N]
[Module R M]
[Module R N]
(i : M →ₗ[R] N)
(f : M →ₗ[R] Q)
[Fact (Function.Injective ⇑i)]
(h : Module.Baer R Q)
{y : N}
(r r' : R)
(eq1 : r • y = r' • y)

(Module.Baer.ExtensionOfMaxAdjoin.extendIdealTo i f h y) r = (Module.Baer.ExtensionOfMaxAdjoin.extendIdealTo i f h y) r'


protected theorem Nonempty.map2 {α β γ : Sort*} (f : α → β → γ) :
    Nonempty α → Nonempty β → Nonempty γ

{α : Sort u_3}
{β : Sort u_4}
{γ : Sort u_5}
(f : α → β → γ)


@[to_additive]
theorem to_submonoid_inj (c d : Con M) (H : (c : Submonoid (M × M)) = d) : c = d

{M : Type u_1}
[MulOneClass M]
(c d : Con M)
(H : ↑c = ↑d)


theorem head?_lookupAll (a : α) : ∀ l : List (Sigma β), head? (lookupAll a l) = dlookup a l

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

(List.lookupAll a l).head? = List.dlookup a l


@[simp]
theorem zero_disjoint (l : Multiset α) : Disjoint 0 l


/-- Part b of the **L¹ martingale convergence theorem**: if `f` is a uniformly integrable martingale
adapted to the filtration `ℱ`, then for all `n`, `f n` is almost everywhere equal to the conditional
expectation of its limiting process wrt. `ℱ n`. -/
theorem Martingale.ae_eq_condexp_limitProcess (hf : Martingale f ℱ μ)
    (hbdd : UniformIntegrable f 1 μ) (n : ℕ) : f n =ᵐ[μ] μ[ℱ.limitProcess f μ|ℱ n]

{f : ℕ → Ω → ℝ}

(hbdd : MeasureTheory.UniformIntegrable f 1 μ)

f n =ᵐ[μ] μ[MeasureTheory.Filtration.limitProcess f ℱ μ|↑ℱ n]


@[simp]
theorem inv_natCast_den (a : ℕ) : (a : ℚ)⁻¹.den = if a = 0 then 1 else a


/-- For a monoid, the units of the center inject into the center of the units. This is not an
equivalence in general; one case when it is is for groups with zero, which is covered in
`centerUnitsEquivUnitsCenter`. -/
@[to_additive (attr := simps! apply_coe_val)
  "For an additive monoid, the units of the center inject into the center of the units."]
def unitsCenterToCenterUnits [Monoid M] : (Submonoid.center M)ˣ →* Submonoid.center (Mˣ)

(M : Type u_1)
[AddMonoid M]
(n : AddUnits ↥(AddSubmonoid.center M))

↑↑((addUnitsCenterToCenterAddUnits M) n) = ↑↑n


theorem surjOn_range (h : Semiconj f fa fb) (ha : Surjective fa) :
    SurjOn fb (range f) (range f)

{α : Type u_1}
{β : Type u_2}
{fa : α → α}
{fb : β → β}
{f : α → β}
(h : Function.Semiconj f fa fb)
(ha : Function.Surjective fa)

Set.SurjOn fb (Set.range f) (Set.range f)


@[simp]
theorem mem_unitGroup_iff (x : Kˣ) : x ∈ A.unitGroup ↔ A.valuation x = 1

{K : Type u}
[Field K]
(A : ValuationSubring K)
(x : Kˣ)


@[simp, norm_cast]
theorem sub_apply (f g : CauSeq β abv) (i : ℕ) : (f - g) i = f i - g i

{α : Type u_1}
{β : Type u_2}
[LinearOrderedField α]
[Ring β]
{abv : β → α}
[IsAbsoluteValue abv]
(f g : CauSeq β abv)
(i : ℕ)


theorem _root_.Monotone.stieltjesFunction_eq {f : ℝ → ℝ} (hf : Monotone f) (x : ℝ) :
    hf.stieltjesFunction x = rightLim f x

↑hf.stieltjesFunction x = Function.rightLim f x


theorem mk_preimage_prod_left_fn_eq_if [DecidablePred (· ∈ t)] (f : γ → α) :
    (fun a => (f a, b)) ⁻¹' s ×ˢ t = if b ∈ t then f ⁻¹' s else ∅

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{s : Set α}
{t : Set β}
{b : β}
[DecidablePred fun x => x ∈ t]
(f : γ → α)


@[simp]
theorem ringExpChar.eq_one (R : Type*) [NonAssocSemiring R] [CharZero R] : ringExpChar R = 1

(R : Type u_1)
[NonAssocSemiring R]
[CharZero R]


@[to_additive (attr := simp)]
theorem coe_add : ⇑(p + q) = p + q

{E : Type u_4}
[AddGroup E]
(p q : AddGroupSeminorm E)


lemma bijOn' (h₁ : MapsTo e s t) (h₂ : MapsTo e.symm t s) : BijOn e s t

{α : Type u_1}
{β : Type u_2}
(e : α ≃ β)
{s : Set α}
{t : Set β}
(h₁ : Set.MapsTo (⇑e) s t)
(h₂ : Set.MapsTo (⇑e.symm) t s)


@[simp, mfld_simps] theorem invFun_as_coe (e : α ≃ β) : e.invFun = e.symm


/-- An arbitrary choice of factors of `x : M` is exactly the (unique) normalized set of factors,
if `M` has a trivial group of units. -/
@[simp]
theorem factors_eq_normalizedFactors {M : Type*} [CancelCommMonoidWithZero M]
    [UniqueFactorizationMonoid M] [Unique Mˣ] (x : M) : factors x = normalizedFactors x

{M : Type u_2}
[CancelCommMonoidWithZero M]
[UniqueFactorizationMonoid M]
[Unique Mˣ]
(x : M)

UniqueFactorizationMonoid.factors x = UniqueFactorizationMonoid.normalizedFactors x


/-- The `≤` order on subspaces is the same as that on the corresponding sets. -/
theorem le_def (s1 s2 : AffineSubspace k P) : s1 ≤ s2 ↔ (s1 : Set P) ⊆ s2

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


/-- A canonically ordered commutative semiring is an ordered, commutative semiring in which `a ≤ b`
iff there exists `c` with `b = a + c`. This is satisfied by the natural numbers, for example, but
not the integers or other ordered groups. -/
class CanonicallyOrderedCommSemiring (α : Type*) extends CanonicallyOrderedAddCommMonoid α,
    CommSemiring α where
  /-- No zero divisors. -/
  protected eq_zero_or_eq_zero_of_mul_eq_zero : ∀ {a b : α}, a * b = 0 → a = 0 ∨ b = 0

[self : CanonicallyOrderedCommSemiring α]


@[reassoc]
lemma singleObjCyclesSelfIso_hom :
    (singleObjCyclesSelfIso c j A).hom =
      ((single C c j).obj A).iCycles j ≫ (singleObjXSelf c j A).hom

(HomologicalComplex.singleObjCyclesSelfIso c j A).hom =
  ((HomologicalComplex.single C c j).obj A).iCycles j ≫ (HomologicalComplex.singleObjXSelf c j A).hom


theorem range_rec {α : Type*} (x : α) (f : ℕ → α → α) :
    (Set.range fun n => Nat.rec x f n : Set α) =
      {x} ∪ Set.range fun n => Nat.rec (f 0 x) (f ∘ succ) n

(Set.range fun n => Nat.rec x f n) = {x} ∪ Set.range fun n => Nat.rec (f 0 x) (f ∘ Nat.succ) n


theorem symm_bijective : Function.Bijective (PEquiv.symm : (α ≃. β) → β ≃. α)


/-- Calculate the derivative of the Taylor polynomial with respect to `x₀`.

Version for open intervals -/
theorem taylorWithinEval_hasDerivAt_Ioo {f : ℝ → E} {a b t : ℝ} (x : ℝ) {n : ℕ} (hx : a < b)
    (ht : t ∈ Ioo a b) (hf : ContDiffOn ℝ n f (Icc a b))
    (hf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc a b)) (Ioo a b)) :
    HasDerivAt (fun y => taylorWithinEval f n (Icc a b) y x)
      (((n ! : ℝ)⁻¹ * (x - t) ^ n) • iteratedDerivWithin (n + 1) f (Icc a b) t) t

(hf : ContDiffOn ℝ (↑n) f (Set.Icc a b))

(hf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Set.Icc a b)) (Set.Ioo a b))

HasDerivAt (fun y => taylorWithinEval f n (Set.Icc a b) y x)
  (((↑n !)⁻¹ * (x - t) ^ n) • iteratedDerivWithin (n + 1) f (Set.Icc a b) t) t


@[to_additive]
theorem MulAction.dense_orbit [IsMinimal M α] (x : α) : Dense (orbit M x)

(M : Type u_1)
{α : Type u_3}
[AddMonoid M]
[TopologicalSpace α]
[AddAction M α]
[AddAction.IsMinimal M α]
(x : α)


theorem pseudoZero_def {P : C} : (0 : Pseudoelement P) = ⟦↑(0 : P ⟶ P)⟧

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


/-- A nontrivial `ℚ`-algebra has `CharP` equal to zero.

This cannot be a (local) instance because it would immediately form a loop with the
instance `algebraRat`. It's probably easier to go the other way: prove `CharZero R` and
automatically receive an `Algebra ℚ R` instance.
-/
theorem algebraRat.charP_zero [Semiring R] [Algebra ℚ R] : CharP R 0

(R : Type u_1)
[Nontrivial R]
[Semiring R]
[Algebra ℚ R]


@[simp]
lemma integrable_add_const_iff [IsFiniteMeasure μ] {f : α → β} {c : β} :
    Integrable (fun x ↦ f x + c) μ ↔ Integrable f μ

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup β]
[MeasureTheory.IsFiniteMeasure μ]
{f : α → β}
{c : β}

MeasureTheory.Integrable (fun x => f x + c) μ ↔ MeasureTheory.Integrable f μ


theorem extend_mono' ⦃s₁ s₂ : Set α⦄ (h₁ : P s₁) (hs : s₁ ⊆ s₂) : extend m s₁ ≤ extend m s₂

(m_mono : ∀ ⦃s₁ s₂ : Set α⦄ (hs₁ : P s₁) (hs₂ : P s₂), s₁ ⊆ s₂ → m s₁ hs₁ ≤ m s₂ hs₂)

MeasureTheory.extend m s₁ ≤ MeasureTheory.extend m s₂


theorem max'_eq_sorted_last {s : Finset α} {h : s.Nonempty} :
    s.max' h =
      (s.sort (· ≤ ·)).get ⟨(s.sort (· ≤ ·)).length - 1,
        by simpa using Nat.sub_lt (card_pos.mpr h) Nat.zero_lt_one⟩

{α : Type u_1}
[LinearOrder α]
{s : Finset α}
{h : s.Nonempty}

s.max' h = (Finset.sort (fun x x_1 => x ≤ x_1) s).get ⟨(Finset.sort (fun x x_1 => x ≤ x_1) s).length - 1, ⋯⟩


theorem norm_equiv_symm_one {β} [SeminormedAddCommGroup β] (hp : p ≠ ∞) [One β] :
    ‖(WithLp.equiv p (ι → β)).symm 1‖ = (Fintype.card ι : ℝ≥0) ^ (1 / p).toReal * ‖(1 : β)‖

{p : ℝ≥0∞}
{ι : Type u_2}
[Fact (1 ≤ p)]
[Fintype ι]
{β : Type u_5}
[SeminormedAddCommGroup β]
(hp : p ≠ ⊤)
[One β]

‖(WithLp.equiv p (ι → β)).symm 1‖ = ↑↑(Fintype.card ι) ^ (1 / p).toReal * ‖1‖


@[to_additive]
lemma sup_mul (a b c : α) : (a ⊔ b) * c = a * c ⊔ b * c

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


theorem not_nodup_of_get_eq_of_ne (xs : List α) (n m : Fin xs.length)
    (h : xs.get n = xs.get m) (hne : n ≠ m) : ¬Nodup xs

{α : Type u}
(xs : List α)
(n m : Fin xs.length)
(h : xs.get n = xs.get m)
(hne : n ≠ m)


@[to_additive add_const]
theorem Monotone.mul_const' [CovariantClass α α (swap (· * ·)) (· ≤ ·)] (hf : Monotone f) (a : α) :
    Monotone fun x => f x * a


@[simp]
lemma imaginaryPart_realPart {x : A} : ℑ (ℜ x : A) = 0

{A : Type u_1}
[AddCommGroup A]
[Module ℂ A]
[StarAddMonoid A]
[StarModule ℂ A]
{x : A}


/-- If `f` is a right-inverse of `g` then `map f` is a right-inverse of `map g`. -/
theorem map_rightInverse {f : R →+* S₁} {g : S₁ →+* R} (hf : Function.RightInverse f g) :
    Function.RightInverse (map f : MvPolynomial σ R → MvPolynomial σ S₁) (map g)

{R : Type u}
{S₁ : Type v}
{σ : Type u_1}
[CommSemiring R]
[CommSemiring S₁]
{f : R →+* S₁}
{g : S₁ →+* R}
(hf : Function.RightInverse ⇑f ⇑g)

Function.RightInverse ⇑(MvPolynomial.map f) ⇑(MvPolynomial.map g)


/-- Arithmetic progressions of length three are preserved under `2`-Freiman homomorphisms. -/
@[to_additive]
lemma IsMulFreimanHom.threeGPFree (hf : IsMulFreimanHom 2 s t f) (hf' : s.InjOn f)
    (ht : ThreeGPFree t) : ThreeGPFree s

{α : Type u_2}
{β : Type u_3}
[AddCommMonoid α]
[AddCommMonoid β]
{s : Set α}
{t : Set β}
{f : α → β}
(hf : IsAddFreimanHom 2 s t f)
(hf' : Set.InjOn f s)
(ht : ThreeAPFree t)


@[to_additive (attr := simp)]
theorem zpow_add_period_smul (i : ℤ) (g : G) (a : α) :
    g ^ (i + period g a) • a = g ^ i • a

{α : Type v}
{G : Type u}
[AddGroup G]
[AddAction G α]
(i : ℤ)
(g : G)
(a : α)

(i + ↑(AddAction.period g a)) • g +ᵥ a = i • g +ᵥ a


/-- A `Finset` of a subsingleton type has cardinality at most one. -/
theorem card_le_one_of_subsingleton [Subsingleton α] (s : Finset α) : s.card ≤ 1

{α : Type u_1}
[Subsingleton α]
(s : Finset α)


theorem MapsTo.restrict_commutes (f : α → β) (s : Set α) (t : Set β) (h : MapsTo f s t) :
    Subtype.val ∘ h.restrict f s t = f ∘ Subtype.val

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

Subtype.val ∘ Set.MapsTo.restrict f s t h = f ∘ Subtype.val


/-- Constructor for morphisms in the category of elements of a functor to types. -/
@[simps]
def homMk {F : C ⥤ Type w} (x y : F.Elements) (f : x.1 ⟶ y.1) (hf : F.map f x.snd = y.snd) :
    x ⟶ y

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{F : CategoryTheory.Functor C (Type w)}
(x y : F.Elements)
(f : x.fst ⟶ y.fst)
(hf : F.map f x.snd = y.snd)

↑(CategoryTheory.CategoryOfElements.homMk x y f hf) = f


theorem not_nonempty_iff_eq_bot (U : Opens α) : ¬Set.Nonempty (U : Set α) ↔ U = ⊥

{α : Type u_2}
[TopologicalSpace α]
(U : TopologicalSpace.Opens α)


theorem Convex.starConvex_iff (hs : Convex 𝕜 s) (h : s.Nonempty) : StarConvex 𝕜 x s ↔ x ∈ s

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[Module 𝕜 E]
{s : Set E}
{x : E}
(hs : Convex 𝕜 s)
(h : s.Nonempty)


@[mono]
theorem dimH_mono {s t : Set X} (h : s ⊆ t) : dimH s ≤ dimH t

{X : Type u_2}
[EMetricSpace X]
{s t : Set X}
(h : s ⊆ t)


@[simp]
theorem cos_neg : cos (-x) = cos x


protected theorem Nodup.sym2 {xs : List α} (h : xs.Nodup) : xs.sym2.Nodup

{α : Type u_1}
{xs : List α}
(h : xs.Nodup)


/-- A functor `C ⥤ D ⥤ E` computably lowers to a functor
`ThinSkeleton C ⥤ ThinSkeleton D ⥤ ThinSkeleton E` -/
@[simps]
def map₂ (F : C ⥤ D ⥤ E) : ThinSkeleton C ⥤ ThinSkeleton D ⥤ ThinSkeleton E

(F : CategoryTheory.Functor C (CategoryTheory.Functor D E))

∀ (a : CategoryTheory.ThinSkeleton C),
  (CategoryTheory.ThinSkeleton.map₂ F).obj a = CategoryTheory.ThinSkeleton.map₂Functor F a


theorem Antitone.exists {P : β → α → Prop} (hP : ∀ x, Antitone (P x)) :
    Antitone fun y => ∃ x, P x y

{α : Type u}
{β : Type v}
[Preorder α]
{P : β → α → Prop}
(hP : ∀ (x : β), Antitone (P x))


/-- If we can fit a small ball inside a set `sᶜ` intersected with any neighborhood of `x`, then the
density of `s` near `x` is not `1`.

Along with `aux₀`, this proves that `x` is a Lebesgue point of `s`. This will be used to prove that
the frontier of an order-connected set is null. -/
private lemma aux₁
    (h : ∀ δ, 0 < δ →
      ∃ y, closedBall y (δ / 4) ⊆ closedBall x δ ∧ closedBall y (δ / 4) ⊆ interior sᶜ) :
    ¬Tendsto (fun r ↦ volume (closure s ∩ closedBall x r) / volume (closedBall x r)) (𝓝[>] 0)
        (𝓝 1)

(h :
  ∀ (δ : ℝ),
    0 < δ → ∃ y, Metric.closedBall y (δ / 4) ⊆ Metric.closedBall x δ ∧ Metric.closedBall y (δ / 4) ⊆ interior sᶜ)

¬Filter.Tendsto
    (fun r => MeasureTheory.volume (closure s ∩ Metric.closedBall x r) / MeasureTheory.volume (Metric.closedBall x r))
    (𝓝[>] 0) (𝓝 1)


/-- `SameRay.neg` as an `iff`. -/
@[simp]
theorem sameRay_neg_iff : SameRay R (-x) (-y) ↔ SameRay R x y

{R : Type u_1}
[StrictOrderedCommRing R]
{M : Type u_2}
[AddCommGroup M]
[Module R M]
{x y : M}


theorem chain'_isInfix : ∀ l : List α, Chain' (fun x y => [x, y] <:+: l) l

List.Chain' (fun x y => [x, y] <:+: l) l


@[simp]
theorem ret_eq_some (a : α) : (return a : Part α) = some a


theorem exists_of_liftRel_right {R : α → β → Prop} {s t} (H : LiftRel R s t) {b} (h : b ∈ t) :
    ∃ a, a ∈ s ∧ R a b

{α : Type u}
{β : Type v}
{R : α → β → Prop}
{s : Stream'.WSeq α}
{t : Stream'.WSeq β}
(H : Stream'.WSeq.LiftRel R s t)
{b : β}
(h : b ∈ t)


theorem eq_union_left : t ≤ s → s ∪ t = s

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


@[to_additive]
theorem invRev_injective : Function.Injective (@invRev α)


/-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `cyclotomic n K`. -/
theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K)

(n : ℕ+)
(K : Type w)
(L : Type z)
[Field K]
[Field L]
[Algebra K L]
[IsCyclotomicExtension {n} K L]

Polynomial.IsSplittingField K L (Polynomial.cyclotomic (↑n) K)


theorem strictConvex_Ioc (r s : β) : StrictConvex 𝕜 (Ioc r s)

{𝕜 : Type u_1}
{β : Type u_5}
[OrderedSemiring 𝕜]
[TopologicalSpace β]
[LinearOrderedCancelAddCommMonoid β]
[OrderTopology β]
[Module 𝕜 β]
[OrderedSMul 𝕜 β]
(r s : β)


/-- The equivalence induced by `PartialFunToPointed` and `PointedToPartialFun`.
`Part.equivOption` made functorial. -/
@[simps!]
noncomputable def partialFunEquivPointed : PartialFun.{u} ≌ Pointed

∀ {X Y : Pointed} (f : X ⟶ Y) (a : { x // x ≠ X.point }),
  (partialFunEquivPointed.inverse.map f a).Dom = ¬f.toFun ↑a = Y.point


theorem USize.toNat_modn (x : USize) (n) : (x.modn n).toNat = x.toNat % n


/-- A finite group of prime order is cyclic. -/
@[to_additive "A finite group of prime order is cyclic."]
theorem isCyclic_of_prime_card {α : Type u} [Group α] [Fintype α] {p : ℕ} [hp : Fact p.Prime]
    (h : Fintype.card α = p) : IsCyclic α

{α : Type u}
[AddGroup α]
[Fintype α]
{p : ℕ}
[hp : Fact (Nat.Prime p)]
(h : Fintype.card α = p)


theorem IsBoundedUnder.inf [SemilatticeInf α] {f : Filter β} {u v : β → α} :
    f.IsBoundedUnder (· ≥ ·) u →
      f.IsBoundedUnder (· ≥ ·) v → f.IsBoundedUnder (· ≥ ·) fun a => u a ⊓ v a

{α : Type u_1}
{β : Type u_2}
[SemilatticeInf α]
{f : Filter β}
{u v : β → α}

Filter.IsBoundedUnder (fun x x_1 => x ≥ x_1) f u →
  Filter.IsBoundedUnder (fun x x_1 => x ≥ x_1) f v → Filter.IsBoundedUnder (fun x x_1 => x ≥ x_1) f fun a => u a ⊓ v a


theorem norm_eq_pow_val {x : ℚ_[p]} : x ≠ 0 → ‖x‖ = (p : ℝ) ^ (-x.valuation)

{p : ℕ}
[hp : Fact (Nat.Prime p)]
{x : ℚ_[p]}


theorem norm_eq_mul_conj (n : ℤ√d) : (norm n : ℤ√d) = n * star n


/-- Extending a cone by a composition is the same as extending the cone twice. -/
@[simps!]
def extendComp (s : Cone F) {X Y : C} (f : X ⟶ Y) (g : Y ⟶ s.pt) :
    s.extend (f ≫ g) ≅ (s.extend g).extend f

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{F : J ⥤ C}
(s : CategoryTheory.Limits.Cone F)
{X Y : C}
(f : X ⟶ Y)
(g : Y ⟶ s.pt)

(CategoryTheory.Limits.Cones.extendComp s f g).inv.hom = 𝟙 X


/-- The associator as a natural isomorphism between trifunctors `C ⥤ C ⥤ C ⥤ C`. -/
@[simps!]
def curriedAssociatorNatIso :
    bifunctorComp₁₂ (curriedTensor C) (curriedTensor C) ≅
      bifunctorComp₂₃ (curriedTensor C) (curriedTensor C)

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

∀ (X_1 X_2 : C),
  (((CategoryTheory.MonoidalCategory.curriedAssociatorNatIso C).inv.app X).app X_1).app X_2 =
    (CategoryTheory.MonoidalCategory.associator X X_1 X_2).inv


@[simp]
theorem exp_le_exp {x y : ℝ} : exp x ≤ exp y ↔ x ≤ y


theorem le_map_comap : m ≤ (m.comap g).map g

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{g : β → α}

m ≤ MeasurableSpace.map g (MeasurableSpace.comap g m)


theorem union_right (ht : Disjoint s t) (hu : Disjoint s u) : Disjoint s (t ∪ u)

{α : Type u_1}
{s t u : Set α}
(ht : Disjoint s t)
(hu : Disjoint s u)


theorem IsNormal.nfp_fp {f} (H : IsNormal f) : ∀ a, f (nfp f a) = nfp f a

{f : Ordinal.{u_1} → Ordinal.{u_1}}
(H : Ordinal.IsNormal f)
(a : Ordinal.{u_1})


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

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

p ∈ self.source → (↑self.toPartialHomeomorph p).1 = proj p


/-- The linearization of a type `X` on which `G` acts trivially is the trivial `G`-representation
on `k[X]`. -/
@[simps!]
noncomputable def linearizationTrivialIso (X : Type u) :
    (linearization k G).obj (Action.mk X 1) ≅ trivial k G (X →₀ k)

(a : ↑((Rep.linearization k G).obj { V := X, ρ := 1 }).V)

(Rep.linearizationTrivialIso k G X).hom.hom a = a


lemma comp_eq {X Y Z : C} (z₁ : W.LeftFraction X Y) (z₂ : W.LeftFraction Y Z)
    (z₃ : W.LeftFraction z₁.Y' z₂.Y') (h₃ : z₂.f ≫ z₃.s = z₁.s ≫ z₃.f) :
    z₁.comp z₂ = Localization.Hom.mk (z₁.comp₀ z₂ z₃)

(h₃ : CategoryTheory.CategoryStruct.comp z₂.f z₃.s = CategoryTheory.CategoryStruct.comp z₁.s z₃.f)

z₁.comp z₂ = CategoryTheory.MorphismProperty.LeftFraction.Localization.Hom.mk (z₁.comp₀ z₂ z₃)


theorem coe_strictMono : StrictMono Real.toEReal


/-- If an integer `a` and a prime `p` satisfy `gcd a p ≠ 1`, then `a : ZMod p` is zero. -/
theorem eq_zero_of_gcd_ne_one {a : ℤ} {p : ℕ} (pp : p.Prime) (h : a.gcd p ≠ 1) : (a : ZMod p) = 0

{a : ℤ}
{p : ℕ}
(pp : Nat.Prime p)
(h : a.gcd ↑p ≠ 1)


@[simp]
theorem det_id : LinearMap.det (LinearMap.id : M →ₗ[A] M) = 1

{M : Type u_2}
[AddCommGroup M]
{A : Type u_5}
[CommRing A]
[Module A M]


lemma liminf_sub_const (F : Filter ι) [NeBot F] (f : ι → ℝ≥0∞) (c : ℝ≥0∞) :
    Filter.liminf (fun i ↦ f i - c) F = Filter.liminf f F - c

{ι : Type u_4}
(F : Filter ι)
[F.NeBot]
(f : ι → ℝ≥0∞)
(c : ℝ≥0∞)

Filter.liminf (fun i => f i - c) F = Filter.liminf f F - c


@[simp] lemma subset_ker : s ⊆ f.ker ↔ ∀ t ∈ f, s ⊆ t

{α : Type u_2}
{f : Filter α}
{s : Set α}


@[simp]
theorem mem_Icc : x ∈ Icc a b ↔ a ≤ x ∧ x ≤ b

{α : Type u_1}
[Preorder α]
[LocallyFiniteOrder α]
{a b x : α}


theorem map_nhdsWithin_preimage_eq {x} (hx : x ∈ e.source) (s : Set Y) :
    map e (𝓝[e ⁻¹' s] x) = 𝓝[s] e x

{X : Type u_1}
{Y : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
(e : PartialHomeomorph X Y)
{x : X}
(hx : x ∈ e.source)
(s : Set Y)

Filter.map (↑e) (𝓝[↑e ⁻¹' s] x) = 𝓝[s] ↑e x


theorem hasFPowerSeriesOnBall_const {c : F} {e : E} :
    HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries 𝕜 E c) e ⊤

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{c : F}
{e : E}

HasFPowerSeriesOnBall (fun x => c) (constFormalMultilinearSeries 𝕜 E c) e ⊤


theorem mk_embedding_eq_arrow_of_lift_le (lle : lift.{u} #β' ≤ lift.{v} #α) :
    #(β' ↪ α) = #(β' → α)

(lle : Cardinal.lift.{u, v} #β' ≤ Cardinal.lift.{v, u} #α)


lemma sqrt_sq : (hA.pow 2 : PosSemidef (A ^ 2)).sqrt = A

{n : Type u_2}
{𝕜 : Type u_4}
[Fintype n]
[RCLike 𝕜]
[DecidableEq n]
{A : Matrix n n 𝕜}
(hA : A.PosSemidef)


@[simp] theorem UInt64.toUInt8_toNat (x : UInt64) : x.toUInt8.toNat = x.toNat % 2 ^ 8


lemma mapsTo_genEigenspace_of_comm {f g : End R M} (h : Commute f g) (μ : R) (k : ℕ) :
    MapsTo g (f.genEigenspace μ k) (f.genEigenspace μ k)

{R : Type v}
{M : Type w}
[CommRing R]
[AddCommGroup M]
[Module R M]
{f g : Module.End R M}
(h : Commute f g)
(μ : R)
(k : ℕ)

Set.MapsTo ⇑g ↑((f.genEigenspace μ) k) ↑((f.genEigenspace μ) k)


theorem eq_top_iff {S : Subalgebra R A} : S = ⊤ ↔ ∀ x : A, x ∈ S

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


theorem lift_rank_range_of_injective (f : M →ₗ[R] M') (h : Injective f) :
    lift.{v} (Module.rank R (LinearMap.range f)) = lift.{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']
(f : M →ₗ[R] M')
(h : Function.Injective ⇑f)

Cardinal.lift.{v, v'} (Module.rank R ↥(LinearMap.range f)) = Cardinal.lift.{v', v} (Module.rank R M)


/-- A `DivisionRing` is a `Ring` with multiplicative inverses for nonzero elements.

An instance of `DivisionRing K` includes maps `ratCast : ℚ → K` and `qsmul : ℚ → K → K`.
Those two fields are needed to implement the `DivisionRing K → Algebra ℚ K` instance since we need
to control the specific definitions for some special cases of `K` (in particular `K = ℚ` itself).
See also note [forgetful inheritance]. Similarly, there are maps `nnratCast ℚ≥0 → K` and
`nnqsmul : ℚ≥0 → K → K` to implement the `DivisionSemiring K → Algebra ℚ≥0 K` instance.

If the division ring has positive characteristic `p`, our division by zero convention forces
`ratCast (1 / p) = 1 / 0 = 0`. -/
class DivisionRing (α : Type*)
  extends Ring α, DivInvMonoid α, Nontrivial α, NNRatCast α, RatCast α where
  /-- For a nonzero `a`, `a⁻¹` is a right multiplicative inverse. -/
  protected mul_inv_cancel : ∀ (a : α), a ≠ 0 → a * a⁻¹ = 1
  /-- The inverse of `0` is `0` by convention. -/
  protected inv_zero : (0 : α)⁻¹ = 0
  protected nnratCast := NNRat.castRec
  /-- However `NNRat.cast` is defined, it must be equal to `a / b`.

  Do not use this lemma directly. Use `NNRat.cast_def` instead. -/
  protected nnratCast_def (q : ℚ≥0) : (NNRat.cast q : α) = q.num / q.den := by intros; rfl
  /-- Scalar multiplication by a nonnegative rational number.

  Unless there is a risk of a `Module ℚ≥0 _` instance diamond, write `nnqsmul := _`. This will set
  `nnqsmul` to `(NNRat.cast · * ·)` thanks to unification in the default proof of `nnqsmul_def`.

  Do not use directly. Instead use the `•` notation. -/
  protected nnqsmul : ℚ≥0 → α → α
  /-- However `qsmul` is defined, it must be propositionally equal to multiplication by `Rat.cast`.

  Do not use this lemma directly. Use `NNRat.smul_def` instead. -/
  protected nnqsmul_def (q : ℚ≥0) (a : α) : nnqsmul q a = NNRat.cast q * a := by intros; rfl
  protected ratCast := Rat.castRec
  /-- However `Rat.cast q` is defined, it must be propositionally equal to `q.num / q.den`.

  Do not use this lemma directly. Use `Rat.cast_def` instead. -/
  protected ratCast_def (q : ℚ) : (Rat.cast q : α) = q.num / q.den := by intros; rfl
  /-- Scalar multiplication by a rational number.

  Unless there is a risk of a `Module ℚ _` instance diamond, write `qsmul := _`. This will set
  `qsmul` to `(Rat.cast · * ·)` thanks to unification in the default proof of `qsmul_def`.

  Do not use directly. Instead use the `•` notation. -/
  protected qsmul : ℚ → α → α
  /-- However `qsmul` is defined, it must be propositionally equal to multiplication by `Rat.cast`.

  Do not use this lemma directly. Use `Rat.cast_def` instead. -/
  protected qsmul_def (a : ℚ) (x : α) : qsmul a x = Rat.cast a * x := by intros; rfl

{α : Type u_4}
[self : DivisionRing α]
(a : ℚ)
(x : α)


theorem div_mul_cancel_of_mod_eq_zero {a b : Int} (H : a.mod b = 0) : a.div b * b = a


/-- If `f` and `g` agree on the integers then they are equal `φ`. -/
theorem ext_rat' (h : ∀ m : ℤ, f m = g m) : f = g

{F : Type u_1}
{M₀ : Type u_5}
[MonoidWithZero M₀]
[FunLike F ℚ M₀]
[MonoidWithZeroHomClass F ℚ M₀]
{f g : F}
(h : ∀ (m : ℤ), f ↑m = g ↑m)


theorem finsupp_support_eq_support (p : MvPolynomial σ R) : Finsupp.support p = p.support

{R : Type u}
{σ : Type u_1}
[CommSemiring R]
(p : MvPolynomial σ R)


theorem LinearMap.toMatrix_mul (f g : M₁ →ₗ[R] M₁) :
    LinearMap.toMatrix v₁ v₁ (f * g) = LinearMap.toMatrix v₁ v₁ f * LinearMap.toMatrix v₁ v₁ g

{R : Type u_1}
[CommSemiring R]
{n : Type u_4}
[Fintype n]
[DecidableEq n]
{M₁ : Type u_5}
[AddCommMonoid M₁]
[Module R M₁]
(v₁ : Basis n R M₁)
(f g : M₁ →ₗ[R] M₁)

(LinearMap.toMatrix v₁ v₁) (f * g) = (LinearMap.toMatrix v₁ v₁) f * (LinearMap.toMatrix v₁ v₁) g


@[simp]
theorem truncateAugment_inv_f (C : ChainComplex V ℕ) {X : V} (f : C.X 0 ⟶ X) (w : C.d 1 0 ≫ f = 0)
    (i : ℕ) : (truncateAugment C f w).inv.f i = 𝟙 ((truncate.obj (augment C f w)).X i)

(C.truncateAugment f w).inv.f i = 𝟙 ((ChainComplex.truncate.obj (C.augment f w)).X i)


theorem Heap.realSize_tail? {s : Heap α} : s.tail? le = some s' →
    s.realSize = s'.realSize + 1

{s' s : Batteries.BinomialHeap.Imp.Heap α}

Batteries.BinomialHeap.Imp.Heap.tail? le s = some s' → s.realSize = s'.realSize + 1


/-- Auxiliary definition: the cone over the limit category. -/
@[simps]
def limitCone (F : J ⥤ Cat.{v, v}) : Cone F

(F : CategoryTheory.Functor J CategoryTheory.Cat)

∀ (a : CategoryTheory.Limits.limit (F.comp CategoryTheory.Cat.objects)),
  ((CategoryTheory.Cat.HasLimits.limitCone F).π.app j).obj a =
    CategoryTheory.Limits.limit.π (F.comp CategoryTheory.Cat.objects) j a


@[simp] lemma coe_equivNatSum_symm_apply (P : {P : α →₀ ℕ // P.sum (fun _ ↦ id) = n}) :
    ((equivNatSum α n).symm P : Multiset α) = Finsupp.toMultiset P

(α : Type u_1)
[DecidableEq α]
(n : ℕ)
(P : { P // (P.sum fun x => id) = n })

↑((Sym.equivNatSum α n).symm P) = Finsupp.toMultiset ↑P


/-- De Morgan's law for boolean or -/
@[simp] theorem not_or : ∀ (x y : Bool), (!(x || y)) = (!x && !y)


/-- Eta rule for structured arrows. -/
@[simps!]
def eta (f : StructuredArrow S T) : f ≅ mk f.hom

(f : CategoryTheory.StructuredArrow S T)


@[simp]
theorem left_vsub_midpoint (p₁ p₂ : P) : p₁ -ᵥ midpoint R p₁ p₂ = (⅟ 2 : R) • (p₁ -ᵥ p₂)

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[Ring R]
[Invertible 2]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
(p₁ p₂ : P)

p₁ -ᵥ midpoint R p₁ p₂ = ⅟2 • (p₁ -ᵥ p₂)


lemma memPartitionSet_of_mem {f : ℕ → Set α} {n : ℕ} {a : α} {s : Set α}
    (hs : s ∈ memPartition f n) (ha : a ∈ s) :
    memPartitionSet f n a = s

{α : Type u_1}
{f : ℕ → Set α}
{n : ℕ}
{a : α}
{s : Set α}
(hs : s ∈ memPartition f n)
(ha : a ∈ s)


theorem fg_iff_exists_fin_generating_family {N : L.Substructure M} :
    N.FG ↔ ∃ (n : ℕ) (s : Fin n → M), closure L (range s) = N

{L : FirstOrder.Language}
{M : Type u_1}
[L.Structure M]
{N : L.Substructure M}

N.FG ↔ ∃ n s, (FirstOrder.Language.Substructure.closure L).toFun (Set.range s) = N


theorem ContinuousAt.comp₂ {f : Y × Z → W} {g : X → Y} {h : X → Z} {x : X}
    (hf : ContinuousAt f (g x, h x)) (hg : ContinuousAt g x) (hh : ContinuousAt h x) :
    ContinuousAt (fun x ↦ f (g x, h x)) x

{X : Type u}
{Y : Type v}
{Z : Type u_1}
{W : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
[TopologicalSpace W]
{f : Y × Z → W}
{g : X → Y}
{h : X → Z}
{x : X}
(hf : ContinuousAt f (g x, h x))
(hg : ContinuousAt g x)
(hh : ContinuousAt h x)


theorem isCobounded_sInter {S : Set (Set α)} (hs : S.Finite) :
    IsCobounded (⋂₀ S) ↔ ∀ s ∈ S, IsCobounded s

{α : Type u_2}
[Bornology α]
{S : Set (Set α)}
(hs : S.Finite)

Bornology.IsCobounded (⋂₀ S) ↔ ∀ s ∈ S, Bornology.IsCobounded s


@[simp]
theorem t'_iij (i j : D.J) : D.t' i i j = (pullbackSymmetry _ _).hom

{C : Type u₁}
[CategoryTheory.Category.{v, u₁} C]
(D : CategoryTheory.GlueData C)
(i j : D.J)

D.t' i i j = (CategoryTheory.Limits.pullbackSymmetry (D.f i i) (D.f i j)).hom


@[simp]
theorem iSupLift_mk {dir : Directed (· ≤ ·) K} {f : ∀ i, K i →ₐ[R] B}
    {hf : ∀ (i j : ι) (h : K i ≤ K j), f i = (f j).comp (inclusion h)}
    {T : Subalgebra R A} {hT : T = iSup K} {i : ι} (x : K i) (hx : (x : A) ∈ T) :
    iSupLift K dir f hf T hT ⟨x, hx⟩ = f i x

{dir : Directed (fun x x_1 => x ≤ x_1) K}

{hf : ∀ (i j : ι) (h : K i ≤ K j), f i = (f j).comp (Subalgebra.inclusion h)}

(Subalgebra.iSupLift K dir f hf T hT) ⟨↑x, hx⟩ = (f i) x


@[simp]
theorem pi_eq_bot : pi f = ⊥ ↔ ∃ i, f i = ⊥

{ι : Type u_1}
{α : ι → Type u_2}
{f : (i : ι) → Filter (α i)}


theorem exists_of_ssubset {s₁ s₂ : Finset α} (h : s₁ ⊂ s₂) : ∃ x ∈ s₂, x ∉ s₁

{α : Type u_1}
{s₁ s₂ : Finset α}
(h : s₁ ⊂ s₂)

∃ x ∈ s₂, x ∉ s₁


@[simp]
theorem map_coe_Ioi_atBot (a : α) : map ((↑) : Ioi a → α) atBot = 𝓝[>] a

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

Filter.map Subtype.val Filter.atBot = 𝓝[>] a


@[to_additive]
theorem dfinsupp_prod_apply [Monoid R] [CommMonoid S] (f : Π₀ i, β i) (g : ∀ i, β i → R →* S)
    (r : R) : (f.prod g) r = f.prod fun a b => (g a b) r

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

(f.sum g) r = f.sum fun a b => (g a b) r


theorem get_of_mem : ∀ {o : Option α} (h : isSome o), a ∈ o → o.get h = a

{α : Type u_1}
{a : α}
{o : Option α}
(h : o.isSome = true)


@[to_additive]
theorem mem_iInf {ι : Sort*} {S : ι → Subsemigroup M} {x : M} : (x ∈ ⨅ i, S i) ↔ ∀ i, x ∈ S i

{M : Type u_1}
[Add M]
{ι : Sort u_4}
{S : ι → AddSubsemigroup M}
{x : M}


theorem LinearIndependent.image_of_comp {ι ι'} (s : Set ι) (f : ι → ι') (g : ι' → M)
    (hs : LinearIndependent R fun x : s => g (f x)) :
    LinearIndependent R fun x : f '' s => g x

(hs : LinearIndependent R fun (x : ↑s) => g (f ↑x))

LinearIndependent R fun (x : ↑(f '' s)) => g ↑x


lemma π_symm (i₁ : I₁) (i₂ : I₂) :
    π c₂ c₁ c₁₂ ⟨i₂, i₁⟩ = π c₁ c₂ c₁₂ ⟨i₁, i₂⟩

{I₁ : Type u_1}
{I₂ : Type u_2}
{I₁₂ : Type u_3}
(c₁ : ComplexShape I₁)
(c₂ : ComplexShape I₂)
(c₁₂ : ComplexShape I₁₂)
[TotalComplexShape c₁ c₂ c₁₂]
[TotalComplexShape c₂ c₁ c₁₂]
[TotalComplexShapeSymmetry c₁ c₂ c₁₂]
(i₁ : I₁)
(i₂ : I₂)

c₂.π c₁ c₁₂ (i₂, i₁) = c₁.π c₂ c₁₂ (i₁, i₂)


/-- Representable presheaves are (trivially) ind-objects. -/
@[simps]
def yoneda (X : C) : IndObjectPresentation (yoneda.obj X)

(s : CategoryTheory.Discrete PUnit.{v + 1})

(CategoryTheory.Limits.IndObjectPresentation.yoneda X).ι.app s =
  CategoryTheory.CategoryStruct.id (((CategoryTheory.Functor.fromPUnit X).comp CategoryTheory.yoneda).obj s)


theorem _root_.isSelfAdjoint_starHom_apply {F R S : Type*} [Star R] [Star S] [FunLike F R S]
    [StarHomClass F R S] [TrivialStar R] (f : F) (x : R) : IsSelfAdjoint (f x)

{F : Type u_3}
{R : Type u_4}
{S : Type u_5}
[Star R]
[Star S]
[FunLike F R S]
[StarHomClass F R S]
[TrivialStar R]
(f : F)
(x : R)


@[to_additive (attr := simp)]
theorem mul_div_cancel_right (a b : G) : a * b / b = a


theorem exists_upcrossings_of_not_bounded_under {ι : Type*} {l : Filter ι} {x : ι → ℝ}
    (hf : liminf (fun i => (Real.nnabs (x i) : ℝ≥0∞)) l ≠ ∞)
    (hbdd : ¬IsBoundedUnder (· ≤ ·) l fun i => |x i|) :
    ∃ a b : ℚ, a < b ∧ (∃ᶠ i in l, x i < a) ∧ ∃ᶠ i in l, ↑b < x i

(hf : Filter.liminf (fun i => ↑(Real.nnabs (x i))) l ≠ ⊤)

(hbdd : ¬Filter.IsBoundedUnder (fun x x_1 => x ≤ x_1) l fun i => |x i|)

∃ a b, a < b ∧ (∃ᶠ (i : ι) in l, x i < ↑a) ∧ ∃ᶠ (i : ι) in l, ↑b < x i


theorem card_filter_mk_eq [NumberField K] (w : InfinitePlace K) :
    (Finset.univ.filter fun φ => mk φ = w).card = mult w

{K : Type u_2}
[Field K]
[NumberField K]
(w : NumberField.InfinitePlace K)

(Finset.filter (fun φ => NumberField.InfinitePlace.mk φ = w) Finset.univ).card = w.mult


/-- If a function admits a power series expansion `p` on a ball `B (x, r)`, then it also admits a
power series on any subball of this ball (even with a different center), given by `p.changeOrigin`.
-/
theorem HasFPowerSeriesOnBall.changeOrigin (hf : HasFPowerSeriesOnBall f p x r)
    (h : (‖y‖₊ : ℝ≥0∞) < r) : HasFPowerSeriesOnBall f (p.changeOrigin y) (x + y) (r - ‖y‖₊)

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[CompleteSpace F]
{f : E → F}
{p : FormalMultilinearSeries 𝕜 E F}
{x y : E}
{r : ℝ≥0∞}
(hf : HasFPowerSeriesOnBall f p x r)
(h : ↑‖y‖₊ < r)

HasFPowerSeriesOnBall f (p.changeOrigin y) (x + y) (r - ↑‖y‖₊)


theorem le_radius_of_eventually_le (C) (h : ∀ᶠ n in atTop, ‖p n‖ * (r : ℝ) ^ n ≤ C) :
    ↑r ≤ p.radius

(h : ∀ᶠ (n : ℕ) in Filter.atTop, ‖p n‖ * ↑r ^ n ≤ C)


theorem card_le_one_iff : card α ≤ 1 ↔ ∀ a b : α, a = b


@[simp]
theorem functor_obj_eq_as {I : Type u₁} (F : I → C) (X : Discrete I) :
    (Discrete.functor F).obj X = F X.as

{C : Type u₂}
[CategoryTheory.Category.{v₂, u₂} C]
{I : Type u₁}
(F : I → C)
(X : CategoryTheory.Discrete I)

(CategoryTheory.Discrete.functor F).obj X = F X.as


protected lemma _root_.Filter.HasBasis.uniformSpace_eq_bot {ι p} {s : ι → Set (α × α)}
    {u : UniformSpace α} (h : 𝓤[u].HasBasis p s) :
    u = ⊥ ↔ ∃ i, p i ∧ Pairwise fun x y : α ↦ (x, y) ∉ s i

{α : Type ua}
{ι : Sort u_2}
{p : ι → Prop}
{s : ι → Set (α × α)}
{u : UniformSpace α}
(h : (𝓤 α).HasBasis p s)

u = ⊥ ↔ ∃ i, p i ∧ Pairwise fun x y => (x, y) ∉ s i


theorem insert_union_distrib (a : α) (s t : Finset α) :
    insert a (s ∪ t) = insert a s ∪ insert a t

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


/-- In a locally finite partial order, `≤` is the reflexive transitive closure of `⋖`. -/
lemma le_iff_reflTransGen_covBy [PartialOrder α] [LocallyFiniteOrder α] {x y : α} :
    x ≤ y ↔ ReflTransGen (· ⋖ ·) x y

{α : Type u_2}
[PartialOrder α]
[LocallyFiniteOrder α]
{x y : α}

x ≤ y ↔ Relation.ReflTransGen (fun x x_1 => x ⋖ x_1) x y


theorem restrict_eq_zero_iff (μ : FiniteMeasure Ω) (A : Set Ω) : μ.restrict A = 0 ↔ μ A = 0

{Ω : Type u_1}
[MeasurableSpace Ω]
(μ : MeasureTheory.FiniteMeasure Ω)
(A : Set Ω)


@[simp, norm_cast] lemma coe_inf (s t : Clopens α) : ↑(s ⊓ t) = (s ∩ t : Set α)

{α : Type u_2}
[TopologicalSpace α]
(s t : TopologicalSpace.Clopens α)


@[to_additive (attr := simp)]
theorem ediam_smul [SMul M X] [IsometricSMul M X] (c : M) (s : Set X) :
    EMetric.diam (c • s) = EMetric.diam s

{M : Type u}
{X : Type w}
[PseudoEMetricSpace X]
[VAdd M X]
[IsometricVAdd M X]
(c : M)
(s : Set X)


theorem ofReal_alg (x : ℝ) : (x : K) = x • (1 : K)


@[reassoc (attr := simp)]
lemma isoHomologyπ_inv_hom_id :
    (K.isoHomologyπ i j hi h).inv ≫ K.homologyπ j = 𝟙 _

(K.isoHomologyπ i j hi h).inv ≫ K.homologyπ j = 𝟙 (K.homology j)


theorem card_commonNeighbors_le_degree_right [DecidableRel G.Adj] (v w : V) :
    Fintype.card (G.commonNeighbors v w) ≤ G.degree w

{V : Type u_1}
(G : SimpleGraph V)
[Fintype V]
[DecidableRel G.Adj]
(v w : V)

Fintype.card ↑(G.commonNeighbors v w) ≤ G.degree w


@[to_additive]
theorem mul_right_surjective (a : G) : Function.Surjective fun x ↦ x * a


@[simp] lemma tprod_prod {κ : Type*} (s : Finset κ) (x : κ → Π i, A i) :
    tprod R (∏ k ∈ s, x k) = ∏ k ∈ s, tprod R (x k)

{ι : Type u_1}
{R : Type u_3}
{A : ι → Type u_4}
[CommSemiring R]
[(i : ι) → CommSemiring (A i)]
[(i : ι) → Algebra R (A i)]
{κ : Type u_5}
(s : Finset κ)
(x : κ → (i : ι) → A i)

(PiTensorProduct.tprod R) (∏ k ∈ s, x k) = ∏ k ∈ s, (PiTensorProduct.tprod R) (x k)


theorem pairwise_le_finRange (n : ℕ) : Pairwise (· ≤ ·) (finRange n)

List.Pairwise (fun x x_1 => x ≤ x_1) (List.finRange n)


@[simp]
theorem toFinset_ssubset : s.toFinset ⊂ t.toFinset ↔ s ⊂ t

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


/-- `Prod.swap` bundled as a `ContinuousMap`. -/
@[simps!]
def prodSwap : C(α × β, β × α)

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
(x : α × β)


theorem mul_star {x y : ℤ} : (⟨x, y⟩ * star ⟨x, y⟩ : ℤ√d) = x * x - d * y * y

{ re := x, im := y } * star { re := x, im := y } = ↑x * ↑x - ↑d * ↑y * ↑y


@[simp]
theorem coeff_zero_eq_constantCoeff : ⇑(coeff R 0) = constantCoeff R

⇑(PowerSeries.coeff R 0) = ⇑(PowerSeries.constantCoeff R)


theorem Basis.sum_repr [Fintype ι] (b : Basis ι R M) (u : M) : ∑ i, b.repr u i • b i = u

{ι : Type u_1}
{R : Type u_3}
{M : Type u_6}
[Semiring R]
[AddCommMonoid M]
[Module R M]
[Fintype ι]
(b : Basis ι R M)
(u : M)


theorem imageIsoImage_hom_comp_image_ι : (imageIsoImage f).hom ≫ Limits.image.ι _ = kernel.ι _

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

(CategoryTheory.Abelian.imageIsoImage f).hom ≫ CategoryTheory.Limits.image.ι f =
  CategoryTheory.Limits.kernel.ι (CategoryTheory.Limits.cokernel.π f)


theorem cos_add_pi_div_two (x : ℝ) : cos (x + π / 2) = -sin x

Real.cos (x + Real.pi / 2) = -Real.sin x


@[reassoc]
theorem δ_comp_σ_self' {n} {j : Fin (n + 2)} {i : Fin (n + 1)} (H : j = Fin.castSucc i) :
    δ j ≫ σ i = 𝟙 ([n] : SimplexCategory)

{n : ℕ}
{j : Fin (n + 2)}
{i : Fin (n + 1)}
(H : j = i.castSucc)

SimplexCategory.δ j ≫ SimplexCategory.σ i = 𝟙 (SimplexCategory.mk n)


/-- All maps into the `PushoutI`, or amalgamated product of groups are injective,
provided all maps in the diagram are injective.

See also `base_injective` -/
theorem of_injective (hφ : ∀ i, Function.Injective (φ i)) (i : ι) :
    Function.Injective (of (φ := φ) i)

(hφ : ∀ (i : ι), Function.Injective ⇑(φ i))


/-- A version of the global `continuous_mul` suitable for dot notation. -/
@[to_additive "A version of the global `continuous_add` suitable for dot notation."]
theorem continuous_mul' (g : GroupTopology α) :
    haveI := g.toTopologicalSpace
    Continuous fun p : α × α => p.1 * p.2

{α : Type u}
[Group α]
(g : GroupTopology α)


/-- Sections of `F.op ⋙ yoneda.obj X` identify to natural
transformations `F ⟶ (const J).obj X`. -/
@[simps]
def opCompYonedaSectionsEquiv (F : J ⥤ C) (X : C) :
    (F.op ⋙ yoneda.obj X).sections ≃ (F ⟶ (const J).obj X)

(s : ↑(F.op ⋙ CategoryTheory.yoneda.obj X).sections)

((CategoryTheory.Limits.opCompYonedaSectionsEquiv F X) s).app j = ↑s (Opposite.op j)


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

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
{f : E → ℂ}
{f' : E →L[ℂ] ℂ}
{x : E}
(hf : HasFDerivAt f f' x)


@[to_additive (attr := simp)]
theorem commute_op [Mul α] {x y : α} : Commute (op x) (op y) ↔ Commute x y

Commute (MulOpposite.op x) (MulOpposite.op y) ↔ Commute x y


@[parity_simps] lemma odd_add : Odd (m + n) ↔ (Odd m ↔ Even n)


/-- The `takeUntil` and `dropUntil` functions split a walk into two pieces.
The lemma `SimpleGraph.Walk.count_support_takeUntil_eq_one` specifies where this split occurs. -/
@[simp]
theorem take_spec {u v w : V} (p : G.Walk v w) (h : u ∈ p.support) :
    (p.takeUntil u h).append (p.dropUntil u h) = p

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


lemma dvd_sum : (∀ x ∈ s, a ∣ x) → a ∣ s.sum

{α : Type u_2}
[NonUnitalSemiring α]
{s : Multiset α}
{a : α}


@[simp]
theorem toOuterMeasure_map_apply : (p.map f).toOuterMeasure s = p.toOuterMeasure (f ⁻¹' s)

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

(PMF.map f p).toOuterMeasure s = p.toOuterMeasure (f ⁻¹' s)


theorem getElem_rotate (l : List α) (n : ℕ) (k : Nat) (h : k < (l.rotate n).length) :
    (l.rotate n)[k] =
      l[(k + n) % l.length]'(mod_lt _ (length_rotate l n ▸ k.zero_le.trans_lt h))

{α : Type u}
(l : List α)
(n k : ℕ)
(h : k < (l.rotate n).length)


@[to_additive]
theorem smul_ball'' : a • ball b r = ball (a • b) r

{E : Type u_6}
[SeminormedAddCommGroup E]
{a b : E}
{r : ℝ}

a +ᵥ Metric.ball b r = Metric.ball (a +ᵥ b) r


lemma diffs_inter_subset_left : (s₁ ∩ s₂) \\ t ⊆ s₁ \\ t ∩ s₂ \\ t

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

(s₁ ∩ s₂).diffs t ⊆ s₁.diffs t ∩ s₂.diffs t


theorem hammingDist_comp (f : ∀ i, γ i → β i) {x y : ∀ i, γ i} (hf : ∀ i, Injective (f i)) :
    (hammingDist (fun i => f i (x i)) fun i => f i (y i)) = hammingDist x y

(hf : ∀ (i : ι), Function.Injective (f i))


theorem integral_symm (a b) : ∫ x in b..a, f x ∂μ = -∫ x in a..b, f x ∂μ

{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : ℝ → E}
{μ : MeasureTheory.Measure ℝ}
(a b : ℝ)

∫ (x : ℝ) in b..a, f x ∂μ = -∫ (x : ℝ) in a..b, f x ∂μ


/--
Replace a function coercion for a morphism `TopCat.of X ⟶ TopCat.of Y` with the definitionally
equal function coercion for a continuous map `C(X, Y)`.
-/
@[simp] theorem coe_of_of {X Y : Type u} [TopologicalSpace X] [TopologicalSpace Y]
    {f : C(X, Y)} {x} :
    @DFunLike.coe (TopCat.of X ⟶ TopCat.of Y) ((CategoryTheory.forget TopCat).obj (TopCat.of X))
      (fun _ ↦ (CategoryTheory.forget TopCat).obj (TopCat.of Y)) ConcreteCategory.instFunLike
      f x =
    @DFunLike.coe C(X, Y) X
      (fun _ ↦ Y) _
      f x

{x : (CategoryTheory.forget TopCat).obj (TopCat.of X)}


/-- Dedekind's linear independence of characters -/
theorem linearIndependent_monoidHom (G : Type*) [Monoid G] (L : Type*) [CommRing L]
    [NoZeroDivisors L] : LinearIndependent L (M := G → L) (fun f => f : (G →* L) → G → L)

(G : Type u_8)
[Monoid G]
(L : Type u_9)
[CommRing L]
[NoZeroDivisors L]


/-- A bijective isometry sends midpoints to midpoints. -/
theorem map_midpoint (f : PE ≃ᵢ PF) (x y : PE) : f (midpoint ℝ x y) = midpoint ℝ (f x) (f y)

{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)
(x y : PE)


/-- A topological space is quasi-separated if the intersections of any pairs of compact open
subsets are still compact. -/
@[mk_iff]
class QuasiSeparatedSpace (α : Type*) [TopologicalSpace α] : Prop where
  /-- The intersection of two open compact subsets of a quasi-separated space is compact. -/
  inter_isCompact :
    ∀ U V : Set α, IsOpen U → IsCompact U → IsOpen V → IsCompact V → IsCompact (U ∩ V)

{α : Type u_3}
[TopologicalSpace α]
[self : QuasiSeparatedSpace α]
(U V : Set α)


theorem coeSubmodule_isPrincipal {I : Ideal R} (h : M ≤ nonZeroDivisors R) :
    (coeSubmodule S I).IsPrincipal ↔ I.IsPrincipal

{R : Type u_1}
[CommRing R]
{M : Submonoid R}
(S : Type u_2)
[CommRing S]
[Algebra R S]
[IsLocalization M S]
{I : Ideal R}
(h : M ≤ nonZeroDivisors R)

(IsLocalization.coeSubmodule S I).IsPrincipal ↔ Submodule.IsPrincipal I


theorem ssubset_insert (h : a ∉ s) : s ⊂ insert a s

{α : Type u_1}
[DecidableEq α]
{s : Finset α}
{a : α}
(h : a ∉ s)


theorem mem_minCardFinsetOfMemConvexHull :
    x ∈ convexHull 𝕜 (minCardFinsetOfMemConvexHull hx : Set E)

{𝕜 : Type u_1}
{E : Type u}
[LinearOrderedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{s : Set E}
{x : E}
(hx : x ∈ (convexHull 𝕜) s)

x ∈ (convexHull 𝕜) ↑(Caratheodory.minCardFinsetOfMemConvexHull hx)


theorem xor_iff_iff_not : Xor' a b ↔ (a ↔ ¬b)


theorem prime_def_lt'' {p : ℕ} : Prime p ↔ 2 ≤ p ∧ ∀ m, m ∣ p → m = 1 ∨ m = p

Nat.Prime p ↔ 2 ≤ p ∧ ∀ (m : ℕ), m ∣ p → m = 1 ∨ m = p


@[simp] theorem or_zero (x : Nat) : x ||| 0 = x


@[simp]
theorem iUnion_filter_not (π : Prepartition I) (p : Box ι → Prop) :
    (π.filter fun J => ¬p J).iUnion = π.iUnion \ (π.filter p).iUnion

{ι : Type u_1}
{I : BoxIntegral.Box ι}
(π : BoxIntegral.Prepartition I)
(p : BoxIntegral.Box ι → Prop)


/-- Two linear equivs are equal if they are equal on basis vectors. -/
theorem ext' {f₁ f₂ : M ≃ₛₗ[σ] M₁} (h : ∀ i, f₁ (b i) = f₂ (b i)) : f₁ = f₂

{ι : Type u_1}
{R : Type u_3}
{M : Type u_6}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(b : Basis ι R M)
{R₁ : Type u_10}
[Semiring R₁]
{σ : R →+* R₁}
{σ' : R₁ →+* R}
[RingHomInvPair σ σ']
[RingHomInvPair σ' σ]
{M₁ : Type u_11}
[AddCommMonoid M₁]
[Module R₁ M₁]
{f₁ f₂ : M ≃ₛₗ[σ] M₁}
(h : ∀ (i : ι), f₁ (b i) = f₂ (b i))


lemma sum_map_mul_right : (l.map fun b ↦ f b * r).sum = (l.map f).sum * r

{ι : Type u_1}
{R : Type u_5}
[NonUnitalNonAssocSemiring R]
(l : List ι)
(f : ι → R)
(r : R)

(List.map (fun b => f b * r) l).sum = (List.map f l).sum * r


/-- Construct `IsGroupHom` from its only hypothesis. -/
@[to_additive "Construct `IsAddGroupHom` from its only hypothesis."]
theorem IsGroupHom.mk' [Group α] [Group β] {f : α → β} (hf : ∀ x y, f (x * y) = f x * f y) :
    IsGroupHom f

(hf : ∀ (x y : α), f (x * y) = f x * f y)


@[simp]
theorem land_bit (a m b n) : land (bit a m) (bit b n) = bit (a && b) (land m n)

(Int.bit a m).land (Int.bit b n) = Int.bit (a && b) (m.land n)


theorem diagonal_apply_ne' [Zero α] (d : n → α) {i j : n} (h : j ≠ i) : (diagonal d) i j = 0

{n : Type u_3}
{α : Type v}
[DecidableEq n]
[Zero α]
(d : n → α)
{i j : n}
(h : j ≠ i)


theorem norm_pos {x : ℤ[i]} : 0 < norm x ↔ x ≠ 0


@[simp]
theorem offDiag_singleton : ({a} : Finset α).offDiag = ∅


@[simp]
theorem X_pow_mul_monomial (k n : ℕ) (r : R) : X ^ k * monomial n r = monomial (n + k) r

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

Polynomial.X ^ k * (Polynomial.monomial n) r = (Polynomial.monomial (n + k)) r


@[gcongr]
theorem sup_le_sup_right (h₁ : a ≤ b) (c) : a ⊔ c ≤ b ⊔ c

{α : Type u}
[SemilatticeSup α]
{a b : α}
(h₁ : a ≤ b)
(c : α)


@[to_additive]
theorem mul_right_injective (a : G) : Injective (a * ·)

{G : Type u_3}
[Mul G]
[IsLeftCancelMul G]
(a : G)


theorem lineMap_le_lineMap_iff_of_lt (h : r < r') : lineMap a b r ≤ lineMap a b r' ↔ a ≤ b

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

(AffineMap.lineMap a b) r ≤ (AffineMap.lineMap a b) r' ↔ a ≤ b


theorem toAddSubgroup_le : p.toAddSubgroup ≤ p'.toAddSubgroup ↔ p ≤ p'

{R : Type u}
{M : Type v}
[Ring R]
[AddCommGroup M]
{module_M : Module R M}
(p p' : Submodule R M)


theorem t1Space_iff_specializes_imp_eq : T1Space X ↔ ∀ ⦃x y : X⦄, x ⤳ y → x = y


@[to_additive (attr := simp)]
lemma mk_inv [Inv M] (a : M) : mk (a⁻¹) = (mk a)⁻¹


theorem cos_pi_div_two_sub (x : ℂ) : cos (π / 2 - x) = sin x

Complex.cos (↑Real.pi / 2 - x) = Complex.sin x


/-- Formula for `completedHurwitzZetaOdd` as a Dirichlet series in the convergence range. -/
lemma hasSum_int_completedHurwitzZetaOdd (a : ℝ) {s : ℂ} (hs : 1 < re s) :
    HasSum (fun n : ℤ ↦ Gammaℝ (s + 1) * SignType.sign (n + a) / (↑|n + a| : ℂ) ^ s / 2)
    (completedHurwitzZetaOdd a s)

HasSum (fun n => (s + 1).Gammaℝ * ↑(SignType.sign (↑n + a)) / ↑|↑n + a| ^ s / 2)
  (HurwitzZeta.completedHurwitzZetaOdd (↑a) s)


/-- Partial sums of an alternating antitone series with an odd number of terms provide
upper bounds on the limit. -/
theorem Antitone.tendsto_le_alternating_series
    (hfl : Tendsto (fun n ↦ ∑ i ∈ range n, (-1) ^ i * f i) atTop (𝓝 l))
    (hfa : Antitone f) (k : ℕ) : l ≤ ∑ i ∈ range (2 * k + 1), (-1) ^ i * f i

(hfl : Filter.Tendsto (fun n => ∑ i ∈ Finset.range n, (-1) ^ i * f i) Filter.atTop (𝓝 l))

l ≤ ∑ i ∈ Finset.range (2 * k + 1), (-1) ^ i * f i


/-- A seminorm on a module over a normed ring is a function to the reals that is positive
semidefinite, positive homogeneous, and subadditive. -/
structure Seminorm (𝕜 : Type*) (E : Type*) [SeminormedRing 𝕜] [AddGroup E] [SMul 𝕜 E] extends
  AddGroupSeminorm E where
  /-- The seminorm of a scalar multiplication is the product of the absolute value of the scalar
  and the original seminorm. -/
  smul' : ∀ (a : 𝕜) (x : E), toFun (a • x) = ‖a‖ * toFun x

{𝕜 : Type u_13}
{E : Type u_14}
[SeminormedRing 𝕜]
[AddGroup E]
[SMul 𝕜 E]
(self : Seminorm 𝕜 E)
(a : 𝕜)
(x : E)


/-- Note that this is not generally true for `[Semiring R]`; see
`CompleteLattice.Independent.dfinsupp_lsum_injective` for details. -/
theorem isInternal_submodule_of_independent_of_iSup_eq_top {A : ι → Submodule R M}
    (hi : CompleteLattice.Independent A) (hs : iSup A = ⊤) : IsInternal A

{R : Type u}
[Ring R]
{ι : Type v}
[dec_ι : DecidableEq ι]
{M : Type u_1}
[AddCommGroup M]
[Module R M]
{A : ι → Submodule R M}
(hi : CompleteLattice.Independent A)
(hs : iSup A = ⊤)


/--
This structure encodes the data required for a morphism to be an effective epimorphism.
-/
structure EffectiveEpiStruct {X Y : C} (f : Y ⟶ X) where
  /--
  For every `W` with a morphism `e : Y ⟶ W` that coequalizes every pair of morphisms
  `g₁ g₂ : Z ⟶ Y` which `f` coequalizes, `desc e h` is a morphism `X ⟶ W`...
  -/
  desc : ∀ {W : C} (e : Y ⟶ W),
    (∀ {Z : C} (g₁ g₂ : Z ⟶ Y), g₁ ≫ f = g₂ ≫ f → g₁ ≫ e = g₂ ≫ e) → (X ⟶ W)
  /-- ...factorizing `e` through `f`... -/
  fac : ∀ {W : C} (e : Y ⟶ W)
    (h : ∀ {Z : C} (g₁ g₂ : Z ⟶ Y), g₁ ≫ f = g₂ ≫ f → g₁ ≫ e = g₂ ≫ e),
    f ≫ desc e h = e
  /-- ...and as such, unique. -/
  uniq : ∀ {W : C} (e : Y ⟶ W)
    (h : ∀ {Z : C} (g₁ g₂ : Z ⟶ Y), g₁ ≫ f = g₂ ≫ f → g₁ ≫ e = g₂ ≫ e)
    (m : X ⟶ W), f ≫ m = e → m = desc e h

(self : CategoryTheory.EffectiveEpiStruct f)

(h :
  ∀ {Z : C} (g₁ g₂ : Z ⟶ Y),
    CategoryTheory.CategoryStruct.comp g₁ f = CategoryTheory.CategoryStruct.comp g₂ f →
      CategoryTheory.CategoryStruct.comp g₁ e = CategoryTheory.CategoryStruct.comp g₂ e)

CategoryTheory.CategoryStruct.comp f m = e → m = self.desc e ⋯


theorem zipWith_distrib_reverse (h : l.length = l'.length) :
    (zipWith f l l').reverse = zipWith f l.reverse l'.reverse

{α : Type u}
{β : Type u_1}
{γ : Type u_2}
(f : α → β → γ)
(l : List α)
(l' : List β)
(h : l.length = l'.length)

(List.zipWith f l l').reverse = List.zipWith f l.reverse l'.reverse


@[simp]
theorem sdiff_union_self_eq_union : s \ t ∪ t = s ∪ t

{α : Type u_1}
[DecidableEq α]
{s t : Finset α}


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

(D : TopCat.GlueData)
(i j : D.J)
(x : ↑(D.U i))
(y : ↑(D.U j))

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


/-- Uniform converence implies pointwise convergence. -/
theorem TendstoUniformly.tendsto_at (h : TendstoUniformly F f p) (x : α) :
    Tendsto (fun n => F n x) p <| 𝓝 (f x)

{α : Type u}
{β : Type v}
{ι : Type x}
[UniformSpace β]
{F : ι → α → β}
{f : α → β}
{p : Filter ι}
(h : TendstoUniformly F f p)
(x : α)

Filter.Tendsto (fun n => F n x) p (𝓝 (f x))


@[to_additive]
theorem MonoidHom.comp_apply [MulOneClass M] [MulOneClass N] [MulOneClass P]
    (g : N →* P) (f : M →* N) (x : M) : g.comp f x = g (f x)

{M : Type u_4}
{N : Type u_5}
{P : Type u_6}
[AddZeroClass M]
[AddZeroClass N]
[AddZeroClass P]
(g : N →+ P)
(f : M →+ N)
(x : M)


@[to_additive]
nonrec theorem SmoothAt.div {f g : M → G} {x₀ : M} (hf : SmoothAt I' I f x₀)
    (hg : SmoothAt I' I g x₀) : SmoothAt I' I (fun x => f x / g x) x₀

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{H : Type u_2}
[TopologicalSpace H]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{I : ModelWithCorners 𝕜 E H}
{G : Type u_5}
[TopologicalSpace G]
[ChartedSpace H G]
[Group G]
[LieGroup I G]
{E' : Type u_6}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_7}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M : Type u_8}
[TopologicalSpace M]
[ChartedSpace H' M]
{f g : M → G}
{x₀ : M}
(hf : SmoothAt I' I f x₀)
(hg : SmoothAt I' I g x₀)


theorem npow_mul (x : M) (m n : ℕ) : x ^ (m * n) = (x ^ m) ^ n

{M : Type u_1}
[MulOneClass M]
[Pow M ℕ]
[NatPowAssoc M]
(x : M)
(m n : ℕ)


@[simp]
theorem mk_coe {f : A →ₐ[R] B} (h₁ h₂ h₃ h₄ h₅) : (⟨⟨⟨⟨f, h₁⟩, h₂⟩, h₃, h₄⟩, h₅⟩ : A →ₐ[R] B) = f

(h₂ :
  ∀ (x y : A),
    { toFun := ⇑f, map_one' := h₁ }.toFun (x * y) =
      { toFun := ⇑f, map_one' := h₁ }.toFun x * { toFun := ⇑f, map_one' := h₁ }.toFun y)

(h₃ : (↑{ toFun := ⇑f, map_one' := h₁, map_mul' := h₂ }).toFun 0 = 0)

(h₄ :
  ∀ (x y : A),
    (↑{ toFun := ⇑f, map_one' := h₁, map_mul' := h₂ }).toFun (x + y) =
      (↑{ toFun := ⇑f, map_one' := h₁, map_mul' := h₂ }).toFun x +
        (↑{ toFun := ⇑f, map_one' := h₁, map_mul' := h₂ }).toFun y)

(h₅ :
  ∀ (r : R),
    (↑↑{ toFun := ⇑f, map_one' := h₁, map_mul' := h₂, map_zero' := h₃, map_add' := h₄ }).toFun ((algebraMap R A) r) =
      (algebraMap R B) r)

{ toFun := ⇑f, map_one' := h₁, map_mul' := h₂, map_zero' := h₃, map_add' := h₄, commutes' := h₅ } = f


@[to_additive tsum_nonneg]
theorem one_le_tprod (h : ∀ i, 1 ≤ g i) : 1 ≤ ∏' i, g i

{ι : Type u_1}
{α : Type u_3}
[OrderedCommMonoid α]
[TopologicalSpace α]
[OrderClosedTopology α]
{g : ι → α}
(h : ∀ (i : ι), 1 ≤ g i)


theorem Coprime.gcd_mul_right_cancel (m : Nat) (H : Coprime k n) : gcd (m * k) n = gcd m n


theorem distLat_dual_comp_forget_to_Lat :
    DistLat.dual ⋙ forget₂ DistLat Lat = forget₂ DistLat Lat ⋙ Lat.dual

DistLat.dual ⋙ CategoryTheory.forget₂ DistLat Lat = CategoryTheory.forget₂ DistLat Lat ⋙ Lat.dual


theorem natDegree_eq_reverse_natDegree_add_natTrailingDegree (f : R[X]) :
    f.natDegree = f.reverse.natDegree + f.natTrailingDegree

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


/-- Up to rotation, the contractible triangle `X ⟶ X ⟶ 0 ⟶ X⟦1⟧` for `X : Cᵒᵖ` corresponds
to the contractible triangle for `X.unop` in `C`. -/
@[simps!]
noncomputable def contractibleTriangleIso (X : Cᵒᵖ) :
    contractibleTriangle X ≅ (triangleOpEquivalence C).functor.obj
      (Opposite.op (contractibleTriangle X.unop).invRotate)

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

(CategoryTheory.Pretriangulated.Opposite.contractibleTriangleIso X).inv.hom₁ = CategoryTheory.CategoryStruct.id X


@[to_additive]
theorem lt_mul_of_one_lt_of_lt [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 reindex_updateRow [DecidableEq l] [DecidableEq m] (A : Matrix m n α) (i : m) (r : n → α)
    (e : m ≃ l) (f : n ≃ o) :
    reindex e f (A.updateRow i r) = updateRow (reindex e f A) (e i) fun i => r (f.symm i)

{l : Type u_1}
{m : Type u_2}
{n : Type u_3}
{o : Type u_4}
{α : Type v}
[DecidableEq l]
[DecidableEq m]
(A : Matrix m n α)
(i : m)
(r : n → α)
(e : m ≃ l)
(f : n ≃ o)

(Matrix.reindex e f) (A.updateRow i r) = ((Matrix.reindex e f) A).updateRow (e i) fun i => r (f.symm i)


@[to_additive measure_isAddHaarMeasure_eq_smul_of_isEverywherePos]
theorem measure_isHaarMeasure_eq_smul_of_isEverywherePos [LocallyCompactSpace G]
    (μ' μ : Measure G) [IsHaarMeasure μ] [IsHaarMeasure μ']
    {s : Set G} (hs : MeasurableSet s) (h's : IsEverywherePos μ s) :
    μ' s = haarScalarFactor μ' μ • μ s

{G : Type u_1}
[TopologicalSpace G]
[AddGroup G]
[TopologicalAddGroup G]
[MeasurableSpace G]
[BorelSpace G]
[LocallyCompactSpace G]
(μ' μ : MeasureTheory.Measure G)
[μ.IsAddHaarMeasure]
[μ'.IsAddHaarMeasure]
{s : Set G}
(hs : MeasurableSet s)
(h's : μ.IsEverywherePos s)


theorem dickson_one_one_zmod_p (p : ℕ) [Fact p.Prime] : dickson 1 (1 : ZMod p) p = X ^ p

Polynomial.dickson 1 1 p = Polynomial.X ^ p


/--
If the unit and counit of a given adjunction are (pointwise) isomorphisms, then we can upgrade the
adjunction to an equivalence.
-/
@[simps!]
noncomputable def toEquivalence (adj : F ⊣ G) [∀ X, IsIso (adj.unit.app X)]
    [∀ Y, IsIso (adj.counit.app Y)] : C ≌ D

[∀ (X : C), CategoryTheory.IsIso (adj.unit.app X)]

[∀ (Y : D), CategoryTheory.IsIso (adj.counit.app Y)]

adj.toEquivalence.unitIso.hom.app X = adj.unit.app X


@[simp]
theorem Matrix.toBilin'_stdBasis (M : Matrix n n R₂) (i j : n) :
    Matrix.toBilin' M
      (LinearMap.stdBasis R₂ (fun _ => R₂) i 1)
      (LinearMap.stdBasis R₂ (fun _ => R₂) j 1) = M i j

{R₂ : Type u_5}
[CommSemiring R₂]
{n : Type u_11}
[Fintype n]
[DecidableEq n]
(M : Matrix n n R₂)
(i j : n)

((Matrix.toBilin' M) ((LinearMap.stdBasis R₂ (fun x => R₂) i) 1)) ((LinearMap.stdBasis R₂ (fun x => R₂) j) 1) = M i j


theorem ne_zero_of_d_ne_zero (hd : P.d ≠ 0) : P.toPoly ≠ 0

{R : Type u_1}
{P : Cubic R}
[Semiring R]
(hd : P.d ≠ 0)


theorem subset_image_diff (f : α → β) (s t : Set α) : f '' s \ f '' t ⊆ f '' (s \ t)

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


theorem tr_respects : Respects (TM2.step M) (TM1.step (tr M)) TrCfg

{K : Type u_1}
[DecidableEq K]
{Γ : K → Type u_2}
{Λ : Type u_3}
{σ : Type u_4}
(M : Λ → Turing.TM2.Stmt Γ Λ σ)

Turing.Respects (Turing.TM2.step M) (Turing.TM1.step (Turing.TM2to1.tr M)) Turing.TM2to1.TrCfg


@[simp]
theorem dlookup_cons_ne (l) {a} : ∀ s : Sigma β, a ≠ s.1 → dlookup a (s :: l) = dlookup a l

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

a ≠ s.fst → List.dlookup a (s :: l) = List.dlookup a l


@[simp] theorem cases_succ {n} {motive : Fin (n + 1) → Sort _} {zero succ} (i : Fin n) :
    @Fin.cases n motive zero succ i.succ = succ i

{n : Nat}
{motive : Fin (n + 1) → Sort u_1}
{zero : motive 0}
{succ : (i : Fin n) → motive i.succ}
(i : Fin n)


/-- Multiplicative congruence relations preserve division. -/
@[to_additive "Additive congruence relations preserve subtraction."]
protected theorem div : ∀ {w x y z}, c w x → c y z → c (w / y) (x / z)

{M : Type u_1}
[AddGroup M]
(c : AddCon M)
{w x y z : M}


theorem mkContinuousMultilinear_norm_le (f : MultilinearMap 𝕜 E (MultilinearMap 𝕜 E' G)) {C : ℝ}
    (hC : 0 ≤ C) (H : ∀ m₁ m₂, ‖f m₁ m₂‖ ≤ (C * ∏ i, ‖m₁ i‖) * ∏ i, ‖m₂ i‖) :
    ‖mkContinuousMultilinear f C H‖ ≤ C

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

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

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


theorem eq_of_veq : ∀ {s t : Finset α}, s.1 = t.1 → s = t


@[simp, norm_cast] lemma natCast_im (n : ℕ) : (n : ℂ).im = 0


@[simp]
theorem get?_take_of_succ {l : List α} {n : Nat} : (l.take (n + 1))[n]? = l[n]?


theorem lowerSemicontinuousWithinAt_ciSup {f : ι → α → δ'}
    (bdd : ∀ᶠ y in 𝓝[s] x, BddAbove (range fun i => f i y))
    (h : ∀ i, LowerSemicontinuousWithinAt (f i) s x) :
    LowerSemicontinuousWithinAt (fun x' => ⨆ i, f i x') s x

{f : ι → α → δ'}

(bdd : ∀ᶠ (y : α) in 𝓝[s] x, BddAbove (Set.range fun i => f i y))

(h : ∀ (i : ι), LowerSemicontinuousWithinAt (f i) s x)


@[to_additive]
theorem Multipliable.hasProd (ha : Multipliable f) : HasProd f (∏' b, f b)

{α : Type u_1}
{β : Type u_2}
[CommMonoid α]
[TopologicalSpace α]
{f : β → α}
(ha : Multipliable f)


theorem foldl1_eq_foldr1 (hassoc : Associative f) :
    ∀ a b l, foldl f a (l ++ [b]) = foldr f b (a :: l)

{α : Type u}
{f : α → α → α}
(hassoc : Associative f)
(a b : α)
(l : List α)

List.foldl f a (l ++ [b]) = List.foldr f b (a :: l)


lemma seminormFromConst_seq_def (x : R) :
    seminormFromConst_seq c f x = fun n ↦ f (x * c ^ n) / f c ^ n

{R : Type u_1}
[CommRing R]
(c : R)
(f : RingSeminorm R)
(x : R)

seminormFromConst_seq c f x = fun n => f (x * c ^ n) / f c ^ n


theorem Chain.imp {R S : α → α → Prop} (H : ∀ a b, R a b → S a b) {a : α} {l : List α}
    (p : Chain R a l) : Chain S a l

{α : Type u_1}
{R S : α → α → Prop}
(H : ∀ (a b : α), R a b → S a b)
{a : α}
{l : List α}
(p : List.Chain R a l)


theorem uniformContinuous₂_curry (f : α × β → γ) :
    UniformContinuous₂ (Function.curry f) ↔ UniformContinuous f

{α : Type ua}
{β : Type ub}
{γ : Type uc}
[UniformSpace α]
[UniformSpace β]
[UniformSpace γ]
(f : α × β → γ)


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

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

((ContinuousAlternatingMap.ofSubsingleton R M N i) f) x = f (x i)


@[simp]
theorem mk_neg (f : CauSeq β abv) : -mk f = mk (-f)

{α : Type u_1}
[LinearOrderedField α]
{β : Type u_2}
[Ring β]
{abv : β → α}
[IsAbsoluteValue abv]
(f : CauSeq β abv)

-CauSeq.Completion.mk f = CauSeq.Completion.mk (-f)


/-- On non-dependent functions, `Pi.mulSingle` is symmetric in the two indices. -/
@[to_additive "On non-dependent functions, `Pi.single` is symmetric in the two indices."]
theorem mulSingle_comm [One β] (i : I) (x : β) (i' : I) :
    (mulSingle i x : I → β) i' = (mulSingle i' x : I → β) i

{I : Type u}
{β : Type u_2}
[DecidableEq I]
[One β]
(i : I)
(x : β)
(i' : I)

Pi.mulSingle i x i' = Pi.mulSingle i' x i


/-- The cardinality of the reals, as a type. -/
theorem mk_real : #ℝ = 𝔠


@[simp]
theorem degree_X : degree (X : R[X]) = 1

{R : Type u}
[Semiring R]
[Nontrivial R]


/-- See also `Complex.cpow_int_mul'`. -/
lemma cpow_int_mul (x : ℂ) (n : ℤ) (y : ℂ) : x ^ (n * y) = (x ^ y) ^ n


@[to_additive min_sub_sub_left]
theorem min_div_div_left' (a b c : α) : min (a / b) (a / c) = a / max b c

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


theorem eventually_ne_atBot [Preorder α] [NoMinOrder α] (a : α) : ∀ᶠ x in atBot, x ≠ a

{α : Type u_3}
[Preorder α]
[NoMinOrder α]
(a : α)


nonrec theorem ContDiffAt.inv {f : E → 𝕜'} {n} (hf : ContDiffAt 𝕜 n f x) (hx : f x ≠ 0) :
    ContDiffAt 𝕜 n (fun x => (f x)⁻¹) x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{x : E}
{𝕜' : Type u_4}
[NormedField 𝕜']
[NormedAlgebra 𝕜 𝕜']
[CompleteSpace 𝕜']
{f : E → 𝕜'}
{n : ℕ∞}
(hf : ContDiffAt 𝕜 n f x)
(hx : f x ≠ 0)