/-- The nilpotency class of an n-ary product is the sup of the nilpotency classes of the factors -/
theorem nilpotencyClass_pi [Fintype η] [∀ i, IsNilpotent (Gs i)] :
    Group.nilpotencyClass (∀ i, Gs i) = Finset.univ.sup fun i => Group.nilpotencyClass (Gs i)

{η : Type u_2}
{Gs : η → Type u_3}
[(i : η) → Group (Gs i)]
[Fintype η]
[∀ (i : η), Group.IsNilpotent (Gs i)]

Group.nilpotencyClass ((i : η) → Gs i) = Finset.univ.sup fun i => Group.nilpotencyClass (Gs i)


theorem lift'_mono' (hh : ∀ s ∈ f, h₁ s ⊆ h₂ s) : f.lift' h₁ ≤ f.lift' h₂

{α : Type u_1}
{β : Type u_2}
{f : Filter α}
{h₁ h₂ : Set α → Set β}
(hh : ∀ s ∈ f, h₁ s ⊆ h₂ s)


@[aesop safe 20 apply (rule_sets := [Measurable])]
theorem AEMeasurable.inner {m : MeasurableSpace α} [MeasurableSpace E] [OpensMeasurableSpace E]
    [SecondCountableTopology E] {μ : MeasureTheory.Measure α} {f g : α → E}
    (hf : AEMeasurable f μ) (hg : AEMeasurable g μ) : AEMeasurable (fun x => ⟪f x, g x⟫) μ

{α : Type u_1}
{𝕜 : Type u_2}
{E : Type u_3}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{m : MeasurableSpace α}
[MeasurableSpace E]
[OpensMeasurableSpace E]
[SecondCountableTopology E]
{μ : MeasureTheory.Measure α}
{f g : α → E}
(hf : AEMeasurable f μ)
(hg : AEMeasurable g μ)


theorem rTensor_refl_apply : (refl R N).rTensor M y = y

{R : Type u_1}
[CommSemiring R]
(M : Type u_4)
(N : Type u_5)
[AddCommMonoid M]
[AddCommMonoid N]
[Module R M]
[Module R N]
(y : TensorProduct R N M)

(LinearEquiv.rTensor M (LinearEquiv.refl R N)) y = y


lemma unique_lift {X Y : Type*} [TopologicalSpace X] [TopologicalSpace Y] [T2Space Y]
    {f : X → Y} (hf : Continuous f) {g : t2Quotient X → Y} (hfg : g ∘ mk = f) :
    g = lift hf

{X : Type u_3}
{Y : Type u_4}
[TopologicalSpace X]
[TopologicalSpace Y]
[T2Space Y]
{f : X → Y}
(hf : Continuous f)
{g : t2Quotient X → Y}
(hfg : g ∘ t2Quotient.mk = f)


theorem pullback_self {A B : C} (f : A ⟶ B) [Mono f] : (pullback f).obj (mk f) = ⊤

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.Limits.HasPullbacks C]
{A B : C}
(f : A ⟶ B)
[CategoryTheory.Mono f]

(CategoryTheory.Subobject.pullback f).obj (CategoryTheory.Subobject.mk f) = ⊤


/-- `LocallyBoundedMapClass F α β` states that `F` is a type of bounded maps.

You should extend this class when you extend `LocallyBoundedMap`. -/
class LocallyBoundedMapClass (F : Type*) (α β : outParam Type*) [Bornology α]
    [Bornology β] [FunLike F α β] : Prop where
  /-- The pullback of the `Bornology.cobounded` filter under the function is contained in the
  cobounded filter. Equivalently, the function maps bounded sets to bounded sets. -/
  comap_cobounded_le (f : F) : (cobounded β).comap f ≤ cobounded α

{F : Type u_6}
{α : outParam (Type u_7)}
{β : outParam (Type u_8)}
[Bornology α]
[Bornology β]
[FunLike F α β]
[self : LocallyBoundedMapClass F α β]
(f : F)

Filter.comap (⇑f) (Bornology.cobounded β) ≤ Bornology.cobounded α


@[to_additive sum_nonneg]
lemma one_le_prod_of_one_le [Preorder M] [CovariantClass M M (· * ·) (· ≤ ·)] {l : List M}
    (hl₁ : ∀ x ∈ l, (1 : M) ≤ x) : 1 ≤ l.prod

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


theorem isClosed_cl {X : Compactum} (A : Set X) : IsClosed (cl A)


theorem indep_biSup_limsup (h_le : ∀ n, s n ≤ m0) (h_indep : iIndep s μ) (hf : ∀ t, p t → tᶜ ∈ f)
    {t : Set ι} (ht : p t) :
    Indep (⨆ n ∈ t, s n) (limsup s f) μ

(h_indep : ProbabilityTheory.iIndep s μ)

ProbabilityTheory.Indep (⨆ n ∈ t, s n) (Filter.limsup s f) μ


theorem sup_iSup_nat_succ (u : ℕ → α) : (u 0 ⊔ ⨆ i, u (i + 1)) = ⨆ i, u i

{α : Type u_1}
[CompleteLattice α]
(u : ℕ → α)


/-- If two homomorphism from a group to a monoid are equal at `x`, then they are equal at `x⁻¹`. -/
@[to_additive
    "If two homomorphism from an additive group to an additive monoid are equal at `x`,
    then they are equal at `-x`."]
theorem eq_on_inv {F G M} [Group G] [Monoid M] [FunLike F G M] [MonoidHomClass F G M]
    (f g : F) {x : G} (h : f x = g x) : f x⁻¹ = g x⁻¹

{F : Type u_1}
{G : Type u_2}
{M : Type u_3}
[AddGroup G]
[AddMonoid M]
[FunLike F G M]
[AddMonoidHomClass F G M]
(f g : F)
{x : G}
(h : f x = g x)


theorem eq_pow_of_mul_eq_pow_odd_left {a b c : ℤ} (hab : IsCoprime a b) {k : ℕ} (hk : Odd k)
    (h : a * b = c ^ k) : ∃ d, a = d ^ k


theorem sublistsLenAux_zero (l : List α) (f : List α → β) (r) :
    sublistsLenAux 0 l f r = f [] :: r

{α : Type u}
{β : Type v}
(l : List α)
(f : List α → β)
(r : List β)


theorem uIcc_of_not_le (h : ¬a ≤ b) : [[a, b]] = Icc b a

{α : Type u_2}
[LinearOrder α]
[LocallyFiniteOrder α]
{a b : α}
(h : ¬a ≤ b)


/-- Let `r` be a well-founded relation on `α`, let `f : α → β` be a function,
let `C : β → Prop`, and let `bot : α`.
This induction principle shows that `C (f bot)` holds, given that
* some `a` satisfies `C (f a)`, and
* for each `b` such that `f b ≠ f bot` and `C (f b)` holds, there is `c`
  satisfying `r c b` and `C (f c)`. -/
theorem WellFounded.induction_bot' {α β} {r : α → α → Prop} (hwf : WellFounded r) {a bot : α}
    {C : β → Prop} {f : α → β} (ih : ∀ b, f b ≠ f bot → C (f b) → ∃ c, r c b ∧ C (f c)) :
    C (f a) → C (f bot)

(ih : ∀ (b : α), f b ≠ f bot → C (f b) → ∃ c, r c b ∧ C (f c))


/-- Pointwise, the multiplicative indicators of closed δ-thickenings of a set eventually coincide
with the multiplicative indicator of the set as δ tends to zero. -/
@[to_additive "Pointwise, the indicators of closed δ-thickenings of a set eventually coincide
with the indicator of the set as δ tends to zero."]
lemma mulIndicator_cthickening_eventually_eq_mulIndicator_closure (f : α → β) (E : Set α) (x : α) :
    ∀ᶠ δ in 𝓝 (0 : ℝ),
      (Metric.cthickening δ E).mulIndicator f x = (closure E).mulIndicator f x

{α : Type u_1}
[PseudoEMetricSpace α]
{β : Type u_2}
[Zero β]
(f : α → β)
(E : Set α)
(x : α)

∀ᶠ (δ : ℝ) in 𝓝 0, (Metric.cthickening δ E).indicator f x = (closure E).indicator f x


/-- In a preadditive category, when `p : X ⟶ X` is idempotent,
then `𝟙 X - p` is also idempotent. -/
theorem idem_of_id_sub_idem [Preadditive C] {X : C} (p : X ⟶ X) (hp : p ≫ p = p) :
    (𝟙 _ - p) ≫ (𝟙 _ - p) = 𝟙 _ - p

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Preadditive C]
{X : C}
(p : X ⟶ X)
(hp : p ≫ p = p)


@[simp]
theorem sumEquivOfFintype_symm_apply (x : AdicCompletion I (⨁ j, M j)) :
    (sumEquivOfFintype I M).symm x = sumInv I M x

(x : AdicCompletion I (DirectSum ι fun j => M j))

(AdicCompletion.sumEquivOfFintype I M).symm x = (AdicCompletion.sumInv I M) x


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

(α : Type u_3)
(β : Type u_2)
(γ : Type u_1)
(f : α → Option β → γ)
(acc : Array γ)
(as : List α)
(bs : List β)

List.zipWithLeftTR.go f as bs acc = acc.toList ++ List.zipWithLeft f as bs


/-- The isomorphism between a cone on `F` and an element of the functor `F.cones`. -/
@[simps!]
def equiv (F : J ⥤ C) : Cone F ≅ ΣX, F.cones.obj X

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
(F : J ⥤ C)
(c : (X : Cᵒᵖ) × F.cones.obj X)

((CategoryTheory.Limits.Cone.equiv F).inv c).π = c.snd


lemma not_fermatLastTheoremFor_two : ¬ FermatLastTheoremFor 2


@[to_additive]
theorem map_injective_of_injective : Function.Injective (map f)

{M : Type u_1}
{N : Type u_2}
[MulOneClass M]
[MulOneClass N]
{F : Type u_4}
[FunLike F M N]
[mc : MonoidHomClass F M N]
{f : F}
(hf : Function.Injective ⇑f)


theorem Ioo_union_Ioi (h : c < max a b) : Ioo a b ∪ Ioi c = Ioi (min a c)

{α : Type u_1}
[LinearOrder α]
{a b c : α}
(h : c < max a b)

Set.Ioo a b ∪ Set.Ioi c = Set.Ioi (min a c)


@[simp]
theorem associated_unit_mul_right_iff {β : Type*} [CommMonoid β] {a b : β} {u : Units β} :
    Associated a (↑u * b) ↔ Associated a b

{β : Type u_5}
[CommMonoid β]
{a b : β}
{u : βˣ}


theorem antitone_seq_of_seq (s : ℕ → Set α) :
    ∃ t : ℕ → Set α, Antitone t ∧ ⨅ i, 𝓟 (s i) = ⨅ i, 𝓟 (t i)

∃ t, Antitone t ∧ ⨅ i, 𝓟 (s i) = ⨅ i, 𝓟 (t i)


@[continuity]
theorem continuous_cos : Continuous cos


lemma le_traceDual_mul_iff {I J J' : Submodule B L} :
    I ≤ (J * J')ᵛ ↔ I * J ≤ J'ᵛ

{A : Type u_1}
{K : Type u_2}
{L : Type u}
{B : Type u_3}
[CommRing A]
[Field K]
[CommRing B]
[Field L]
[Algebra A K]
[Algebra B L]
[Algebra A B]
[Algebra K L]
[Algebra A L]
[IsScalarTower A K L]
[IsScalarTower A B L]
{I J J' : Submodule B L}

I ≤ Submodule.traceDual A K (J * J') ↔ I * J ≤ Submodule.traceDual A K J'


@[simps]
def StarAlgEquiv.restrictScalars (f : A ≃⋆ₐ[S] B) : A ≃⋆ₐ[R] B

(R : Type u_1)
{S : Type u_2}
{A : Type u_3}
{B : Type u_4}
[CommSemiring R]
[CommSemiring S]
[Semiring A]
[Semiring B]
[Algebra R S]
[Algebra S A]
[Algebra S B]
[Algebra R A]
[Algebra R B]
[IsScalarTower R S A]
[IsScalarTower R S B]
[Star A]
[Star B]
(f : A ≃⋆ₐ[S] B)
(a : A)

(StarAlgEquiv.restrictScalars R f) a = f a


/-- If a fundamental solution exists, then `d` must be positive. -/
theorem d_pos {a : Solution₁ d} (h : IsFundamental a) : 0 < d

{d : ℤ}
{a : Pell.Solution₁ d}
(h : Pell.IsFundamental a)


theorem mem_bot {x : R} : x ∈ (⊥ : NonUnitalSubring R) ↔ x = 0

{R : Type u}
[NonUnitalNonAssocRing R]
{x : R}


@[simp]
theorem smul_def [DecidableEq ιA] [DecidableEq ιB] [GMonoid A] [Gmodule A M]
    (x : ⨁ i, A i) (y : ⨁ i, M i) :
    x • y = smulAddMonoidHom _ _ x y

{ιA : Type u_1}
{ιB : Type u_2}
(A : ιA → Type u_3)
(M : ιB → Type u_4)
[AddMonoid ιA]
[VAdd ιA ιB]
[(i : ιA) → AddCommMonoid (A i)]
[(i : ιB) → AddCommMonoid (M i)]
[DecidableEq ιA]
[DecidableEq ιB]
[GradedMonoid.GMonoid A]
[DirectSum.Gmodule A M]
(x : ⨁ (i : ιA), A i)
(y : ⨁ (i : ιB), M i)

x • y = ((DirectSum.Gmodule.smulAddMonoidHom A M) x) y


/-- The quotient map from a ring to its quotient, as a homomorphism of rings.
-/
irreducible_def mkRingHom (r : R → R → Prop) : R →+* RingQuot r

{R : Type u_1}
[Semiring R]
(r : R → R → Prop)

RingQuot.mkRingHom r =
  { toFun := fun x => { toQuot := Quot.mk (RingQuot.Rel r) x }, map_one' := ⋯, map_mul' := ⋯, map_zero' := ⋯,
    map_add' := ⋯ }


theorem map_univ_of_surjective [Fintype β] {f : β ↪ α} (hf : Surjective f) : univ.map f = univ

{α : Type u_1}
{β : Type u_2}
[Fintype α]
[Fintype β]
{f : β ↪ α}
(hf : Function.Surjective ⇑f)


@[simp]
theorem coe_sum {α : Type*} (f : α → MultilinearMap R M₁ M₂) (s : Finset α) :
    ⇑(∑ a ∈ s, f a) = ∑ a ∈ s, ⇑(f a)

{R : Type uR}
{ι : Type uι}
{M₁ : ι → Type v₁}
{M₂ : Type v₂}
[Semiring R]
[(i : ι) → AddCommMonoid (M₁ i)]
[AddCommMonoid M₂]
[(i : ι) → Module R (M₁ i)]
[Module R M₂]
{α : Type u_1}
(f : α → MultilinearMap R M₁ M₂)
(s : Finset α)


@[simp]
theorem image₂_insert_left [DecidableEq α] :
    image₂ f (insert a s) t = (t.image fun b => f a b) ∪ image₂ f s t

{α : Type u_1}
{β : Type u_3}
{γ : Type u_5}
[DecidableEq γ]
{f : α → β → γ}
{s : Finset α}
{t : Finset β}
{a : α}
[DecidableEq α]

Finset.image₂ f (insert a s) t = Finset.image (fun b => f a b) t ∪ Finset.image₂ f s t


/-- Any pair of finite measures `μ` and `ν`, `HaveLebesgueDecomposition`. That is to say,
there exist a measure `ξ` and a measurable function `f`, such that `ξ` is mutually singular
with respect to `ν` and `μ = ξ + ν.withDensity f`.

This is not an instance since this is also shown for the more general σ-finite measures with
`MeasureTheory.Measure.haveLebesgueDecomposition_of_sigmaFinite`. -/
theorem haveLebesgueDecomposition_of_finiteMeasure [IsFiniteMeasure μ] [IsFiniteMeasure ν] :
    HaveLebesgueDecomposition μ ν

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


@[simp]
theorem reindex_refl : b.reindex (Equiv.refl ι) = b

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


theorem image_subset_image2_right (ha : a ∈ s) : f a '' t ⊆ image2 f s t

{α : Type u_1}
{β : Type u_3}
{γ : Type u_5}
{f : α → β → γ}
{s : Set α}
{t : Set β}
{a : α}
(ha : a ∈ s)


@[simp]
theorem coe_of (R : Type u) [Ring R] : (RingCat.of R : Type u) = R


@[simp]
theorem zero_re : (0 : ℂ).re = 0


theorem algEquiv_symm_mk' (x : R) (y : M) : (algEquiv M S Q).symm (mk' Q x y) = mk' S x y

{R : Type u_1}
[CommSemiring R]
{M : Submonoid R}
{S : Type u_2}
[CommSemiring S]
[Algebra R S]
[IsLocalization M S]
{Q : Type u_4}
[CommSemiring Q]
[Algebra R Q]
[IsLocalization M Q]
(x : R)
(y : ↥M)

(IsLocalization.algEquiv M S Q).symm (IsLocalization.mk' Q x y) = IsLocalization.mk' S x y


/-- Evaluate a polynomial `p : PolynomialModule R M` at `r : R`. -/
@[simps! (config := .lemmasOnly)]
def eval (r : R) : PolynomialModule R M →ₗ[R] M

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
(r : R)
(p : PolynomialModule R M)

(PolynomialModule.eval r) p = Finsupp.sum p fun i m => r ^ i • m


@[simp]
theorem sum_map_singleton (s : Multiset α) : (s.map fun a => ({a} : Multiset α)).sum = s


theorem toList_ofList (l : List α) : DList.toList (DList.ofList l) = l


theorem pairwiseDisjoint_union :
    (s ∪ t).PairwiseDisjoint f ↔
      s.PairwiseDisjoint f ∧
        t.PairwiseDisjoint f ∧ ∀ ⦃i⦄, i ∈ s → ∀ ⦃j⦄, j ∈ t → i ≠ j → Disjoint (f i) (f j)

{α : Type u_1}
{ι : Type u_4}
[PartialOrder α]
[OrderBot α]
{s t : Set ι}
{f : ι → α}

(s ∪ t).PairwiseDisjoint f ↔
  s.PairwiseDisjoint f ∧ t.PairwiseDisjoint f ∧ ∀ ⦃i : ι⦄, i ∈ s → ∀ ⦃j : ι⦄, j ∈ t → i ≠ j → Disjoint (f i) (f j)


theorem evalAt_apply (x : M) : evalAt x X f = (X f) x

(X : Derivation 𝕜 C^⊤⟮I, M; 𝓘(𝕜, 𝕜), 𝕜⟯ C^⊤⟮I, M; 𝓘(𝕜, 𝕜), 𝕜⟯)


@[to_additive (attr := mono)]
theorem toSubmonoid_mono : Monotone (toSubmonoid : Subgroup G → Submonoid G)


/-- Construct an augmented cosimplicial object in the opposite
category from an augmented simplicial object. -/
@[simps!]
def SimplicialObject.Augmented.rightOp (X : SimplicialObject.Augmented C) :
    CosimplicialObject.Augmented Cᵒᵖ

(X : CategoryTheory.SimplicialObject.Augmented C)


@[simp] lemma closure_ground (M : Matroid α) : M.closure M.E = M.E


theorem head_drop (a : Stream' α) (n : ℕ) : (a.drop n).head = a.get n


/-- The value of the quadratic character at `-2` -/
theorem quadraticChar_neg_two [DecidableEq F] (hF : ringChar F ≠ 2) :
    quadraticChar F (-2) = χ₈' (Fintype.card F)

{F : Type u_1}
[Field F]
[Fintype F]
[DecidableEq F]
(hF : ringChar F ≠ 2)

(quadraticChar F) (-2) = ZMod.χ₈' ↑(Fintype.card F)


/-- Cardinality of a non-empty `Icc` of finsets. -/
theorem card_Icc_finset (h : s ⊆ t) : (Icc s t).card = 2 ^ (t.card - s.card)

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

(Finset.Icc s t).card = 2 ^ (t.card - s.card)


/-- A uniform upper bound for `jacobiTheta₂'_term` on compact subsets. -/
lemma norm_jacobiTheta₂'_term_le {S T : ℝ} (hT : 0 < T) {z τ : ℂ}
    (hz : |im z| ≤ S) (hτ : T ≤ im τ) (n : ℤ) :
    ‖jacobiTheta₂'_term n z τ‖ ≤ 2 * π * |n| * rexp (-π * (T * n ^ 2 - 2 * S * |n|))

{S T : ℝ}
(hT : 0 < T)
{z τ : ℂ}
(hz : |z.im| ≤ S)
(hτ : T ≤ τ.im)
(n : ℤ)

‖jacobiTheta₂'_term n z τ‖ ≤ 2 * π * ↑|n| * rexp (-π * (T * ↑n ^ 2 - 2 * S * ↑|n|))


@[simp]
theorem arcsin_pos {x : ℝ} : 0 < arcsin x ↔ 0 < x


@[elab_as_elim]
protected theorem induction_on {β : Trunc α → Prop} (q : Trunc α) (h : ∀ a, β (mk a)) : β q

{α : Sort u_1}
{β : Trunc α → Prop}
(q : Trunc α)
(h : ∀ (a : α), β (Trunc.mk a))


theorem isNoetherian_of_injective [IsNoetherian R P] (f : M →ₗ[R] P) (hf : Function.Injective f) :
    IsNoetherian R M

{R : Type u_1}
{M : Type u_2}
{P : Type u_3}
[Semiring R]
[AddCommMonoid M]
[AddCommMonoid P]
[Module R M]
[Module R P]
[IsNoetherian R P]
(f : M →ₗ[R] P)
(hf : Function.Injective ⇑f)


theorem embDomain_one [NonAssocSemiring R] (f : Γ ↪o Γ') (hf : f 0 = 0) :
    embDomain f (1 : HahnSeries Γ R) = (1 : HahnSeries Γ' R)

{Γ : Type u_1}
{R : Type u_3}
[OrderedCancelAddCommMonoid Γ]
{Γ' : Type u_5}
[OrderedCancelAddCommMonoid Γ']
[NonAssocSemiring R]
(f : Γ ↪o Γ')
(hf : f 0 = 0)


@[simp]
theorem ofNat_mulVec (x : ℕ) [x.AtLeastTwo] (v : m → α) :
    OfNat.ofNat (no_index x) *ᵥ v = (OfNat.ofNat x : α) • v

{m : Type u_2}
{α : Type v}
[NonAssocSemiring α]
[Fintype m]
[DecidableEq m]
(x : ℕ)
[x.AtLeastTwo]
(v : m → α)


/-- The right homology map data associated to the zero morphism between two short complexes. -/
@[simps]
def zero (h₁ : S₁.RightHomologyData) (h₂ : S₂.RightHomologyData) :
    RightHomologyMapData 0 h₁ h₂

(CategoryTheory.ShortComplex.RightHomologyMapData.zero h₁ h₂).φQ = 0


theorem homotopicTo (i : N) {p q : Ω^ N X x} :
    Homotopic p q → (toLoop i p).Homotopic (toLoop i q)

{N : Type u_1}
{X : Type u_2}
[TopologicalSpace X]
{x : X}
[DecidableEq N]
(i : N)
{p q : ↑(Ω^ N X x)}

GenLoop.Homotopic p q → Path.Homotopic (GenLoop.toLoop i p) (GenLoop.toLoop i q)


theorem testBit_two_pow_add_gt {i j : Nat} (j_lt_i : j < i) (x : Nat) :
    testBit (2^i + x) j = testBit x j


theorem mul_geom_sum [Ring α] (x : α) (n : ℕ) : ((x - 1) * ∑ i ∈ range n, x ^ i) = x ^ n - 1

(x - 1) * ∑ i ∈ Finset.range n, x ^ i = x ^ n - 1


/-- The limit of a functor into a complete lattice is the infimum of the objects in the image.
-/
theorem limit_eq_iInf (F : J ⥤ α) : limit F = iInf F.obj

{α : Type u}
[CompleteLattice α]
{J : Type u}
[CategoryTheory.SmallCategory J]
(F : J ⥤ α)

CategoryTheory.Limits.limit F = iInf F.obj


@[simp]
theorem preimage_basicOpen {X Y : Scheme.{u}} (f : X ⟶ Y) {U : Y.Opens} (r : Γ(Y, U)) :
    f ⁻¹ᵁ (Y.basicOpen r) = X.basicOpen (f.app U r)

{X Y : AlgebraicGeometry.Scheme}
(f : X ⟶ Y)
{U : Y.Opens}
(r : ↑(Y.presheaf.obj (Opposite.op U)))

(TopologicalSpace.Opens.map f.val.base).obj (Y.basicOpen r) = X.basicOpen ((AlgebraicGeometry.Scheme.Hom.app f U) r)


@[simp]
theorem Differentiable.ccosh (hc : Differentiable ℂ f) :
    Differentiable ℂ fun x => Complex.cosh (f x)

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


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

{G : Type u_1}
[AddGroup G]
{S T : AddSubgroup G}
{x : G}


theorem erase_get [DecidableEq ι] {l : List ι} (i : Fin l.length) :
    Perm (l.erase (l.get i)) (l.eraseIdx ↑i)

{ι : Type u_1}
[DecidableEq ι]
{l : List ι}
(i : Fin l.length)

(l.erase (l.get i)).Perm (l.eraseIdx ↑i)


@[simp]
theorem homogeneousComponent_C_mul (n : ℕ) (r : R) :
    homogeneousComponent n (C r * φ) = C r * homogeneousComponent n φ

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

(MvPolynomial.homogeneousComponent n) (MvPolynomial.C r * φ) =
  MvPolynomial.C r * (MvPolynomial.homogeneousComponent n) φ


@[simp]
theorem inclusion_comp_inclusion {α} {s t u : Set α} (hst : s ⊆ t) (htu : t ⊆ u) :
    inclusion htu ∘ inclusion hst = inclusion (hst.trans htu)

{α : Type u_2}
{s t u : Set α}
(hst : s ⊆ t)
(htu : t ⊆ u)

Set.inclusion htu ∘ Set.inclusion hst = Set.inclusion ⋯


/-- If `Fₙ` tends locally uniformly to `f` on a set `s`, and `gₙ` tends to `x` within `s`, then
`Fₙ gₙ` tends to `f x` if `f` is continuous at `x` within `s` and `x ∈ s`. -/
theorem TendstoLocallyUniformlyOn.tendsto_comp (h : TendstoLocallyUniformlyOn F f p s)
    (hf : ContinuousWithinAt f s x) (hx : x ∈ s) (hg : Tendsto g p (𝓝[s] x)) :
    Tendsto (fun n => F n (g n)) p (𝓝 (f x))

{α : Type u}
{β : Type v}
{ι : Type x}
[UniformSpace β]
{F : ι → α → β}
{f : α → β}
{s : Set α}
{x : α}
{p : Filter ι}
{g : ι → α}
[TopologicalSpace α]
(h : TendstoLocallyUniformlyOn F f p s)
(hf : ContinuousWithinAt f s x)
(hx : x ∈ s)
(hg : Filter.Tendsto g p (𝓝[s] x))

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


@[to_additive]
theorem _root_.Equiv.Perm.prod_comp' (σ : Equiv.Perm α) (s : Finset α) (f : α → α → β)
    (hs : { a | σ a ≠ a } ⊆ s) : (∏ x ∈ s, f (σ x) x) = ∏ x ∈ s, f x (σ.symm x)

{α : Type u_3}
{β : Type u_4}
[CommMonoid β]
(σ : Equiv.Perm α)
(s : Finset α)
(f : α → α → β)
(hs : {a | σ a ≠ a} ⊆ ↑s)

∏ x ∈ s, f (σ x) x = ∏ x ∈ s, f x ((Equiv.symm σ) x)


/-- When `S₁.f`, `S₁.g`, `S₂.f` and `S₂.g` are all zero, the action on left homology of a
morphism `φ : S₁ ⟶ S₂` is given by the action `φ.τ₂` on the middle objects. -/
@[simps]
def ofZeros (φ : S₁ ⟶ S₂) (hf₁ : S₁.f = 0) (hg₁ : S₁.g = 0) (hf₂ : S₂.f = 0) (hg₂ : S₂.g = 0) :
    LeftHomologyMapData φ (LeftHomologyData.ofZeros S₁ hf₁ hg₁)
      (LeftHomologyData.ofZeros S₂ hf₂ hg₂)

(CategoryTheory.ShortComplex.LeftHomologyMapData.ofZeros φ hf₁ hg₁ hf₂ hg₂).φH = φ.τ₂


@[simp]
theorem coe_comap (s : Subfield L) : (s.comap f : Set K) = f ⁻¹' s

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


@[csimp] theorem join_eq_joinTR : @join = @joinTR


@[simp]
theorem quotQuotEquivQuotOfLEₐ_symm_toRingEquiv (h : I ≤ J) :
    ((quotQuotEquivQuotOfLEₐ R h).symm : _ ≃+* _ ⧸ J.map (Quotient.mkₐ R I)) =
      (quotQuotEquivQuotOfLE h).symm

(R : Type u)
{A : Type u_1}
[CommSemiring R]
[CommRing A]
[Algebra R A]
{I J : Ideal A}
(h : I ≤ J)

↑(DoubleQuot.quotQuotEquivQuotOfLEₐ R h).symm = (DoubleQuot.quotQuotEquivQuotOfLE h).symm


@[to_additive (attr := simp)]
theorem coe_mul_interval : (↑(s * t) : Interval α) = s * t

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

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


@[to_additive]
lemma Subgroup.ofUnits_mono : Monotone (Subgroup.ofUnits (M := M))


lemma Icc_inr_inr :
    Icc (inrₗ b₁ : α ⊕ₗ β) (inrₗ b₂) = (Icc b₁ b₂).map (Embedding.inr.trans toLex.toEmbedding)

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
[OrderTop α]
[OrderBot β]
[LocallyFiniteOrder α]
[LocallyFiniteOrder β]
(b₁ b₂ : β)

Finset.Icc (Sum.inrₗ b₁) (Sum.inrₗ b₂) = Finset.map (Function.Embedding.inr.trans toLex.toEmbedding) (Finset.Icc b₁ b₂)


@[simp]
protected theorem source : γ 0 = x

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


lemma isIso_ι (hg : S.g = 0) : IsIso h.ι


/-- Integration of (nonnegative bounded continuous) test functions against finite Borel measures
depends continuously on the measure. -/
theorem continuous_testAgainstNN_eval (f : Ω →ᵇ ℝ≥0) :
    Continuous fun μ : FiniteMeasure Ω => μ.testAgainstNN f

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


/-- The `alter` function preserves the balance invariants. -/
protected theorem Balanced.alter {t : RBNode α}
    (h : t.Balanced c n) : ∃ c n, (t.alter cut f).Balanced c n

{α : Type u_1}
{c : Batteries.RBColor}
{n : Nat}
{cut : α → Ordering}
{f : Option α → Option α}
{t : Batteries.RBNode α}
(h : t.Balanced c n)

∃ c n, (Batteries.RBNode.alter cut f t).Balanced c n


theorem Convex.sum_mem (hs : Convex R s) (h₀ : ∀ i ∈ t, 0 ≤ w i) (h₁ : ∑ i ∈ t, w i = 1)
    (hz : ∀ i ∈ t, z i ∈ s) : (∑ i ∈ t, w i • z i) ∈ s

{R : Type u_1}
{E : Type u_3}
{ι : Type u_5}
[LinearOrderedField R]
[AddCommGroup E]
[Module R E]
{s : Set E}
{t : Finset ι}
{w : ι → R}
{z : ι → E}
(hs : Convex R s)
(h₀ : ∀ i ∈ t, 0 ≤ w i)
(h₁ : ∑ i ∈ t, w i = 1)
(hz : ∀ i ∈ t, z i ∈ s)


/-- A product over `powerset s` is equal to the double product over sets of subsets of `s` with
`card s = k`, for `k = 1, ..., card s`. -/
@[to_additive "A sum over `powerset s` is equal to the double sum over sets of subsets of `s` with
  `card s = k`, for `k = 1, ..., card s`"]
lemma prod_powerset (s : Finset α) (f : Finset α → β) :
    ∏ t ∈ powerset s, f t = ∏ j ∈ range (card s + 1), ∏ t ∈ powersetCard j s, f t

{α : Type u_3}
{β : Type u_4}
[CommMonoid β]
(s : Finset α)
(f : Finset α → β)

∏ t ∈ s.powerset, f t = ∏ j ∈ Finset.range (s.card + 1), ∏ t ∈ Finset.powersetCard j s, f t


@[simp] theorem isLeast_univ_iff : IsLeast univ a ↔ IsBot a


theorem rpow_inv_le_iff_of_neg (hx : 0 < x) (hy : 0 < y) (hz : z < 0) :
    x ^ z⁻¹ ≤ y ↔ y ^ z ≤ x


theorem embedding_comp_inv (j : Fin n) : c.embedding (c.index j) (c.invEmbedding j) = j

(c.embedding (c.index j)) (c.invEmbedding j) = j


theorem normalize_eq_of_nonzero (nonzero : μ ≠ 0) (s : Set Ω) : μ.normalize s = μ.mass⁻¹ * μ s

{Ω : Type u_1}
[Nonempty Ω]
{m0 : MeasurableSpace Ω}
(μ : MeasureTheory.FiniteMeasure Ω)
(nonzero : μ ≠ 0)
(s : Set Ω)


@[simp]
theorem sumCongr_trans (e : α₁ ≃ β₁) (f : α₂ ≃ β₂) (g : β₁ ≃ γ₁) (h : β₂ ≃ γ₂) :
    (Equiv.sumCongr e f).trans (Equiv.sumCongr g h) = Equiv.sumCongr (e.trans g) (f.trans h)

{α₁ : Type u_1}
{β₁ : Type u_2}
{α₂ : Type u_3}
{β₂ : Type u_4}
{γ₁ : Type u_5}
{γ₂ : Type u_6}
(e : α₁ ≃ β₁)
(f : α₂ ≃ β₂)
(g : β₁ ≃ γ₁)
(h : β₂ ≃ γ₂)

(e.sumCongr f).trans (g.sumCongr h) = (e.trans g).sumCongr (f.trans h)


lemma toSpec_base_apply_eq {f} (x : Proj| pbo f) :
    (toSpec 𝒜 f).1.base x = ProjIsoSpecTopComponent.toSpec 𝒜 f x

(x : ↑((AlgebraicGeometry.Proj.toLocallyRingedSpace 𝒜).restrict ⋯).toTopCat)

(AlgebraicGeometry.ProjectiveSpectrum.Proj.toSpec 𝒜 f).val.base x =
  (AlgebraicGeometry.ProjIsoSpecTopComponent.toSpec 𝒜 f) x


/-- A function that is complex differentiable on the complex plane is given by evaluating
its Taylor series at any point `c`. -/
lemma taylorSeries_eq_of_entire :
    ∑' n : ℕ, (n ! : ℂ)⁻¹ • (z - c) ^ n • iteratedDeriv n f c = f z

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
[CompleteSpace E]
⦃f : ℂ → E⦄
(hf : Differentiable ℂ f)
(c z : ℂ)

∑' (n : ℕ), (↑n.factorial)⁻¹ • (z - c) ^ n • iteratedDeriv n f c = f z


theorem subset_interior_succ (n : ℕ) : K n ⊆ interior (K (n + 1))

{X : Type u_1}
[TopologicalSpace X]
(K : CompactExhaustion X)
(n : ℕ)


protected theorem eq_zero_iff_of_ge {f : α → E} {s : Set α} (hf : LocallyBoundedVariationOn f s)
    {a b : α} (ha : a ∈ s) (hb : b ∈ s) (ba : b ≤ a) :
    variationOnFromTo f s a b = 0 ↔
      ∀ ⦃x⦄ (_hx : x ∈ s ∩ Icc b a) ⦃y⦄ (_hy : y ∈ s ∩ Icc b a), edist (f x) (f y) = 0

{α : Type u_1}
[LinearOrder α]
{E : Type u_2}
[PseudoEMetricSpace E]
{f : α → E}
{s : Set α}
(hf : LocallyBoundedVariationOn f s)
{a b : α}
(ha : a ∈ s)
(hb : b ∈ s)
(ba : b ≤ a)

variationOnFromTo f s a b = 0 ↔ ∀ ⦃x : α⦄, x ∈ s ∩ Set.Icc b a → ∀ ⦃y : α⦄, y ∈ s ∩ Set.Icc b a → edist (f x) (f y) = 0


/-- This lemma demonstrates the relation between `Equiv.Perm.IsCycle` and `Equiv.Perm.IsCycleOn`
in non-degenerate cases. -/
theorem isCycle_iff_exists_isCycleOn :
    f.IsCycle ↔ ∃ s : Set α, s.Nontrivial ∧ f.IsCycleOn s ∧ ∀ ⦃x⦄, ¬IsFixedPt f x → x ∈ s

f.IsCycle ↔ ∃ s, s.Nontrivial ∧ f.IsCycleOn s ∧ ∀ ⦃x : α⦄, ¬Function.IsFixedPt (⇑f) x → x ∈ s


@[simp]
theorem repr_symm_apply (v) : b.repr.symm v = Finsupp.total ι M R b v

{ι : Type u_1}
{R : Type u_3}
{M : Type u_6}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(b : Basis ι R M)
(v : ι →₀ R)

b.repr.symm v = (Finsupp.total ι M R ⇑b) v


lemma opcyclesMap_comm [S₁.HasRightHomology] [S₂.HasRightHomology] :
    opcyclesMap φ ≫ h₂.opcyclesIso.hom = h₁.opcyclesIso.hom ≫ γ.φQ

(γ : CategoryTheory.ShortComplex.RightHomologyMapData φ h₁ h₂)

CategoryTheory.CategoryStruct.comp (CategoryTheory.ShortComplex.opcyclesMap φ) h₂.opcyclesIso.hom =
  CategoryTheory.CategoryStruct.comp h₁.opcyclesIso.hom γ.φQ


/-- We show that the map `W ×[X] Uᵢ ⟶ Uᵢ ×[Z] Y ⟶ W` is the first projection, where the
first map is given by the lift of `W ×[X] Uᵢ ⟶ Uᵢ` and `W ×[X] Uᵢ ⟶ W ⟶ Y`.

It suffices to show that the two map agrees when restricted onto `Uⱼ ×[Z] Y`. In this case,
both maps factor through `V j i` via `pullback_fst_ι_to_V` -/
theorem lift_comp_ι (i : 𝒰.J) :
    pullback.lift (pullback.snd _ _) (pullback.fst _ _ ≫ p2 𝒰 f g)
          (by rw [← pullback.condition_assoc, Category.assoc, p_comm]) ≫
        (gluing 𝒰 f g).ι i =
      (pullback.fst _ _ : pullback (p1 𝒰 f g) (𝒰.map i) ⟶ _)

[∀ (i : 𝒰.J), CategoryTheory.Limits.HasPullback (𝒰.map i ≫ f) g]

CategoryTheory.Limits.pullback.lift
      (CategoryTheory.Limits.pullback.snd (AlgebraicGeometry.Scheme.Pullback.p1 𝒰 f g) (𝒰.map i))
      (CategoryTheory.Limits.pullback.fst (AlgebraicGeometry.Scheme.Pullback.p1 𝒰 f g) (𝒰.map i) ≫
        AlgebraicGeometry.Scheme.Pullback.p2 𝒰 f g)
      ⋯ ≫
    (AlgebraicGeometry.Scheme.Pullback.gluing 𝒰 f g).ι i =
  CategoryTheory.Limits.pullback.fst (AlgebraicGeometry.Scheme.Pullback.p1 𝒰 f g) (𝒰.map i)


theorem vanishingIdeal_eq_top_iff {s : Set (PrimeSpectrum R)} : vanishingIdeal s = ⊤ ↔ s = ∅

{R : Type u}
[CommSemiring R]
{s : Set (PrimeSpectrum R)}

PrimeSpectrum.vanishingIdeal s = ⊤ ↔ s = ∅


theorem isJacobson_of_isIntegral [Algebra R S] [Algebra.IsIntegral R S] (hR : IsJacobson R) :
    IsJacobson S

{R : Type u_1}
{S : Type u_2}
[CommRing R]
[CommRing S]
[Algebra R S]
[Algebra.IsIntegral R S]
(hR : Ideal.IsJacobson R)


theorem Nonempty.fst : (s ×ˢ t).Nonempty → s.Nonempty

{α : Type u_1}
{β : Type u_2}
{s : Set α}
{t : Set β}


theorem isValidChar_of_isValidCharNat (n : Nat) (h : isValidCharNat n) : isValidChar (UInt32.ofNat' n (isValidUInt32 n h))


@[simp]
lemma toFinset_Iio (a : α) [Fintype (Iio a)] : (Iio a).toFinset = Finset.Iio a

{α : Type u_3}
[Preorder α]
[LocallyFiniteOrderBot α]
(a : α)
[Fintype ↑(Set.Iio a)]


theorem prod_dist_eq_add (hp : 0 < p.toReal) (f g : WithLp p (α × β)) :
    dist f g = (dist f.fst g.fst ^ p.toReal + dist f.snd g.snd ^ p.toReal) ^ (1 / p.toReal)

{p : ℝ≥0∞}
{α : Type u_2}
{β : Type u_3}
[Dist α]
[Dist β]
(hp : 0 < p.toReal)
(f g : WithLp p (α × β))

dist f g = (dist f.1 g.1 ^ p.toReal + dist f.2 g.2 ^ p.toReal) ^ (1 / p.toReal)


theorem comp_eq_of_monotoneOn (f : α → E) {t : Set β} (φ : β → α) (hφ : MonotoneOn φ t) :
    eVariationOn (f ∘ φ) t = eVariationOn f (φ '' t)

{α : Type u_1}
[LinearOrder α]
{E : Type u_2}
[PseudoEMetricSpace E]
{β : Type u_3}
[LinearOrder β]
(f : α → E)
{t : Set β}
(φ : β → α)
(hφ : MonotoneOn φ t)


theorem re_T_zpow_smul (n : ℤ) : (T ^ n • z).re = z.re + n


/-- The preimage of a Lindelöf set under a closed embedding is a Lindelöf set. -/
theorem ClosedEmbedding.isLindelof_preimage {f : X → Y} (hf : ClosedEmbedding f)
    {K : Set Y} (hK : IsLindelof K) : IsLindelof (f ⁻¹' K)

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]
{f : X → Y}
(hf : ClosedEmbedding f)
{K : Set Y}
(hK : IsLindelof K)


protected theorem BddAbove.insert [IsDirected α (· ≤ ·)] {s : Set α} (a : α) :
    BddAbove s → BddAbove (insert a s)

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


theorem ListBlank.map_modifyNth {Γ Γ'} [Inhabited Γ] [Inhabited Γ'] (F : PointedMap Γ Γ')
    (f : Γ → Γ) (f' : Γ' → Γ') (H : ∀ x, F (f x) = f' (F x)) (n) (L : ListBlank Γ) :
    (L.modifyNth f n).map F = (L.map F).modifyNth f' n

{Γ : Type u_1}
{Γ' : Type u_2}
[Inhabited Γ]
[Inhabited Γ']
(F : Turing.PointedMap Γ Γ')
(f : Γ → Γ)
(f' : Γ' → Γ')
(H : ∀ (x : Γ), F.f (f x) = f' (F.f x))
(n : ℕ)
(L : Turing.ListBlank Γ)

Turing.ListBlank.map F (Turing.ListBlank.modifyNth f n L) = Turing.ListBlank.modifyNth f' n (Turing.ListBlank.map F L)


theorem counit_C (n : ℤ) : counit R (C n) = n

(MvPolynomial.counit R) (MvPolynomial.C n) = ↑n


@[simp]
lemma preimage_coe_Ioi_bot : Real.toEReal ⁻¹' Ioi ⊥ = univ


theorem measurableSet_bot_iff {s : Set α} : MeasurableSet[⊥] s ↔ s = ∅ ∨ s = univ


@[simp]
theorem restrict_empty : μ.restrict ∅ = 0

{α : Type u_2}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}


theorem bounds_nonempty {f : ContinuousMultilinearMap 𝕜 E G} :
    ∃ c, c ∈ { c | 0 ≤ c ∧ ∀ m, ‖f m‖ ≤ c * ∏ i, ‖m i‖ }

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

∃ c, c ∈ {c | 0 ≤ c ∧ ∀ (m : (i : ι) → E i), ‖f m‖ ≤ c * ∏ i : ι, ‖m i‖}


/-- Compatibility of `changeFunctor` with identity isomorphisms of functors -/
theorem changeFunctor_refl (e : C ≌ D) : e.changeFunctor (Iso.refl _) = e

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
(e : C ≌ D)

e.changeFunctor (CategoryTheory.Iso.refl e.functor) = e


/-- A Type `R` is a `CompatibleRing` if it is a structure for the language of rings and this
structure is the same as the structure already given on `R` by the classes `Add`, `Mul` etc.

It is recommended to use this type class as a hypothesis to any theorem whose statement
requires a type to have be both a `Ring` (or `Field` etc.) and a
`Language.ring.Structure`  -/
/- This class does not extend `Add` etc, because this way it can be used in
combination with a `Ring`, or `Field` instance without having multiple different
`Add` structures on the Type. -/
class CompatibleRing (R : Type*) [Add R] [Mul R] [Neg R] [One R] [Zero R]
    extends Language.ring.Structure R where
  /-- Addition in the `Language.ring.Structure` is the same as the addition given by the
    `Add` instance -/
  funMap_add : ∀ x, funMap addFunc x = x 0 + x 1
  /-- Multiplication in the `Language.ring.Structure` is the same as the multiplication given by the
    `Mul` instance -/
  funMap_mul : ∀ x, funMap mulFunc x = x 0 * x 1
  /-- Negation in the `Language.ring.Structure` is the same as the negation given by the
    `Neg` instance -/
  funMap_neg : ∀ x, funMap negFunc x = -x 0
  /-- The constant `0` in the `Language.ring.Structure` is the same as the constant given by the
    `Zero` instance -/
  funMap_zero : ∀ x, funMap (zeroFunc : Language.ring.Constants) x = 0
  /-- The constant `1` in the `Language.ring.Structure` is the same as the constant given by the
    `One` instance -/
  funMap_one : ∀ x, funMap (oneFunc : Language.ring.Constants) x = 1

[self : FirstOrder.Ring.CompatibleRing R]

FirstOrder.Language.Structure.funMap FirstOrder.Ring.negFunc x = -x 0


theorem imaginaryPart_smul (z : ℂ) (a : A) : ℑ (z • a) = z.re • ℑ a + z.im • ℜ a

{A : Type u_1}
[AddCommGroup A]
[Module ℂ A]
[StarAddMonoid A]
[StarModule ℂ A]
(z : ℂ)
(a : A)

imaginaryPart (z • a) = z.re • imaginaryPart a + z.im • realPart a


theorem exists_isClopen_upper_of_not_le :
    ¬x ≤ y → ∃ U : Set α, IsClopen U ∧ IsUpperSet U ∧ x ∈ U ∧ y ∉ U

{α : Type u_1}
[TopologicalSpace α]
[Preorder α]
[PriestleySpace α]
{x y : α}

¬x ≤ y → ∃ U, IsClopen U ∧ IsUpperSet U ∧ x ∈ U ∧ y ∉ U


lemma IsUnramifiedAtInfinitePlaces_of_odd_card_aut [IsGalois k K] [FiniteDimensional k K]
    (h : Odd (Fintype.card <| K ≃ₐ[k] K)) : IsUnramifiedAtInfinitePlaces k K

{k : Type u_1}
[Field k]
{K : Type u_2}
[Field K]
[Algebra k K]
[IsGalois k K]
[FiniteDimensional k K]
(h : Odd (Fintype.card (K ≃ₐ[k] K)))


theorem measurable_of_re_im (hre : Measurable fun x => RCLike.re (f x))
    (him : Measurable fun x => RCLike.im (f x)) : Measurable f


protected theorem isCompact (s : NonemptyCompacts α) : IsCompact (s : Set α)

(s : TopologicalSpace.NonemptyCompacts α)


theorem const_add_term {α} [AddCommMonoid α] (k n x a a') (h : k + a = a') :
    k + @term α _ n x a = term n x a'

{α : Type u_1}
[AddCommMonoid α]
(k : α)
(n : ℕ)
(x a a' : α)
(h : k + a = a')

k + Mathlib.Tactic.Abel.term n x a = Mathlib.Tactic.Abel.term n x a'


/-- The functor `ComposableArrows C (n + 1) ⥤ ComposableArrows C n` which forgets
the first arrow. -/
@[simps!]
def δ₀Functor : ComposableArrows C (n + 1) ⥤ ComposableArrows C n

(F : CategoryTheory.ComposableArrows C (n + 1))

(CategoryTheory.ComposableArrows.δ₀Functor.obj F).obj X = F.obj X.succ


theorem coe_linear_eq_coe_contLinear (f : P →ᴬ[R] Q) :
    ((f : P →ᵃ[R] Q).linear : V → W) = (⇑f.contLinear : V → W)

{R : Type u_2}
{V : Type u_3}
{W : Type u_4}
{P : Type u_6}
{Q : Type u_7}
[NormedAddCommGroup V]
[MetricSpace P]
[NormedAddTorsor V P]
[NormedAddCommGroup W]
[MetricSpace Q]
[NormedAddTorsor W Q]
[NormedField R]
[NormedSpace R V]
[NormedSpace R W]
(f : P →ᴬ[R] Q)


@[to_additive (attr := simp)]
theorem MulEquiv.inv_symm (G : Type*) [DivisionCommMonoid G] :
    (MulEquiv.inv G).symm = MulEquiv.inv G


@[to_additive (attr := simp)]
theorem op_le_op_iff {S₁ S₂ : Subgroup G} : S₁.op ≤ S₂.op ↔ S₁ ≤ S₂

{G : Type u_2}
[Group G]
{S₁ S₂ : Subgroup G}


/-- **Fermat's Theorem**: the derivative of a function at a local minimum equals zero. -/
theorem IsLocalMin.hasDerivAt_eq_zero (h : IsLocalMin f a) (hf : HasDerivAt f f' a) : f' = 0

{f : ℝ → ℝ}
{f' a : ℝ}
(h : IsLocalMin f a)
(hf : HasDerivAt f f' a)


theorem injective_id : Injective (@id α)


/-- Subgroups of torsion groups are torsion groups. -/
@[to_additive "Subgroups of additive torsion groups are additive torsion groups."]
theorem IsTorsion.subgroup (tG : IsTorsion G) (H : Subgroup G) : IsTorsion H

{G : Type u_1}
[Group G]
(tG : Monoid.IsTorsion G)
(H : Subgroup G)


lemma isLocallySurjective_presheafToSheaf_map_iff :
    Sheaf.IsLocallySurjective ((presheafToSheaf J A).map φ) ↔ IsLocallySurjective J φ

(J : CategoryTheory.GrothendieckTopology C)

CategoryTheory.Sheaf.IsLocallySurjective ((CategoryTheory.presheafToSheaf J A).map φ) ↔
  CategoryTheory.Presheaf.IsLocallySurjective J φ


theorem lt_sup_of_lt_right (h : c < b) : c < a ⊔ b

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


protected lemma trans (hr : ∀ (a : α) (b : β) (c : γ), r₁₂ a b → r₂₃ b c → r₁₃ a c) :
    RightTotal r₁₂ → RightTotal r₂₃ → RightTotal r₁₃

Relator.RightTotal r₁₂ → Relator.RightTotal r₂₃ → Relator.RightTotal r₁₃


@[simp]
theorem frontier_Ico [NoMinOrder α] {a b : α} (h : a < b) : frontier (Ico a b) = {a, b}

{α : Type u_1}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
[DenselyOrdered α]
[NoMinOrder α]
{a b : α}
(h : a < b)


@[simps]
instance : Category (SheafOfTypes J)

{J : CategoryTheory.GrothendieckTopology C}

∀ {X Y Z : CategoryTheory.SheafOfTypes J} (f : X ⟶ Y) (g : Y ⟶ Z),
  (CategoryTheory.CategoryStruct.comp f g).val = CategoryTheory.CategoryStruct.comp f.val g.val


@[simp]
theorem summable_matrix_conjTranspose [StarAddMonoid R] [ContinuousStar R] {f : X → Matrix m n R} :
    (Summable fun x => (f x)ᴴ) ↔ Summable f

{X : Type u_1}
{m : Type u_4}
{n : Type u_5}
{R : Type u_8}
[AddCommMonoid R]
[TopologicalSpace R]
[StarAddMonoid R]
[ContinuousStar R]
{f : X → Matrix m n R}


@[simp]
theorem coe_prodComm : ⇑(prodComm α β) = Prod.swap

(α : Type u)
(β : Type u_1)
[UniformSpace α]
[UniformSpace β]

⇑(UniformEquiv.prodComm α β) = Prod.swap


@[simp]
theorem _root_.MonoidHom.coe_toAdditive_map {G G₂ : Type*} [Group G] [Group G₂] (f : G →* G₂)
    (s : Subgroup G) :
    s.toAddSubgroup.map (MonoidHom.toAdditive f) = Subgroup.toAddSubgroup (s.map f)

{G : Type u_10}
{G₂ : Type u_11}
[Group G]
[Group G₂]
(f : G →* G₂)
(s : Subgroup G)

AddSubgroup.map (MonoidHom.toAdditive f) (Subgroup.toAddSubgroup s) = Subgroup.toAddSubgroup (Subgroup.map f s)


protected theorem IsLowerSet.closure : IsLowerSet s → IsLowerSet (closure s)

{α : Type u_1}
[TopologicalSpace α]
[Preorder α]
[HasUpperLowerClosure α]
{s : Set α}


@[simp]
lemma stalkMap_hom_inv_apply (e : X ≅ Y) (y : Y) (z) :
    e.inv.stalkMap y (e.hom.stalkMap (e.inv.val.base y) z) =
      Y.presheaf.stalkSpecializes (specializes_of_eq <| by simp) z

(z : ↑(Y.presheaf.stalk (e.hom.val.base (e.inv.val.base y))))

(AlgebraicGeometry.Scheme.Hom.stalkMap e.inv y) ((AlgebraicGeometry.Scheme.Hom.stalkMap e.hom (e.inv.val.base y)) z) =
  (Y.presheaf.stalkSpecializes ⋯) z


@[to_additive (attr := simp) add_lt_iff_neg_left]
theorem mul_lt_iff_lt_one_left' [CovariantClass α α (· * ·) (· < ·)]
    [ContravariantClass α α (· * ·) (· < ·)] {a b : α} :
    a * b < a ↔ b < 1

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

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


theorem imp_iff_or_not {b a : Prop} : b → a ↔ a ∨ ¬b

b → a ↔ a ∨ ¬b


/-- A CHSH tuple in a *-monoid consists of 4 self-adjoint involutions `A₀ A₁ B₀ B₁` such that
the `Aᵢ` commute with the `Bⱼ`.

The physical interpretation is that `A₀` and `A₁` are a pair of boolean observables which
are spacelike separated from another pair `B₀` and `B₁` of boolean observables.
-/
--@[nolint has_nonempty_instance] Porting note(#5171): linter not ported yet
structure IsCHSHTuple {R} [Monoid R] [StarMul R] (A₀ A₁ B₀ B₁ : R) : Prop where
  A₀_inv : A₀ ^ 2 = 1
  A₁_inv : A₁ ^ 2 = 1
  B₀_inv : B₀ ^ 2 = 1
  B₁_inv : B₁ ^ 2 = 1
  A₀_sa : star A₀ = A₀
  A₁_sa : star A₁ = A₁
  B₀_sa : star B₀ = B₀
  B₁_sa : star B₁ = B₁
  A₀B₀_commutes : A₀ * B₀ = B₀ * A₀
  A₀B₁_commutes : A₀ * B₁ = B₁ * A₀
  A₁B₀_commutes : A₁ * B₀ = B₀ * A₁
  A₁B₁_commutes : A₁ * B₁ = B₁ * A₁

{R : Type u_1}
[Monoid R]
[StarMul R]
{A₀ A₁ B₀ B₁ : R}
(self : IsCHSHTuple A₀ A₁ B₀ B₁)


/-- We call a category `NonPreadditiveAbelian` if it has a zero object, kernels, cokernels, binary
    products and coproducts, and every monomorphism and every epimorphism is normal. -/
class NonPreadditiveAbelian extends HasZeroMorphisms C, NormalMonoCategory C,
    NormalEpiCategory C where
  [has_zero_object : HasZeroObject C]
  [has_kernels : HasKernels C]
  [has_cokernels : HasCokernels C]
  [has_finite_products : HasFiniteProducts C]
  [has_finite_coproducts : HasFiniteCoproducts C]

[self : CategoryTheory.NonPreadditiveAbelian C]


theorem front_eq (s : String) : front s = s.1.headD default


/-- The polar coordinates partial homeomorphism in `ℝ^2`, mapping `(r cos θ, r sin θ)` to `(r, θ)`.
It is a homeomorphism between `ℝ^2 - (-∞, 0]` and `(0, +∞) × (-π, π)`. -/
@[simps]
def polarCoord : PartialHomeomorph (ℝ × ℝ) (ℝ × ℝ)

polarCoord.target = Set.Ioi 0 ×ˢ Set.Ioo (-Real.pi) Real.pi


theorem lift_id_apply (x : K) : lift (RingHom.id K) j p x = j x

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

(PerfectRing.lift (RingHom.id K) j p) x = j x


@[simp]
protected theorem isPath {u v : V} (p : G.Path u v) : (p : G.Walk u v).IsPath

{V : Type u}
{G : SimpleGraph V}
{u v : V}
(p : G.Path u v)


theorem preimage_continuous {g : Y → X} (hf : LocallyFinite f) (hg : Continuous g) :
    LocallyFinite (g ⁻¹' f ·)

{ι : Type u_1}
{X : Type u_4}
{Y : Type u_5}
[TopologicalSpace X]
[TopologicalSpace Y]
{f : ι → Set X}
{g : Y → X}
(hf : LocallyFinite f)
(hg : Continuous g)


/-- Show that `toEnvelGroup.mapAux` sends equivalent expressions to equal terms.
-/
theorem well_def {R : Type*} [Rack R] {G : Type*} [Group G] (f : R →◃ Quandle.Conj G) :
    ∀ {a b : PreEnvelGroup R},
      PreEnvelGroupRel' R a b → toEnvelGroup.mapAux f a = toEnvelGroup.mapAux f b

{R : Type u_1}
[Rack R]
{G : Type u_2}
[Group G]
(f : R →◃ Quandle.Conj G)
{a b : Rack.PreEnvelGroup R}

Rack.PreEnvelGroupRel' R a b → Rack.toEnvelGroup.mapAux f a = Rack.toEnvelGroup.mapAux f b


@[simp] theorem decide_and (p q : Prop) [dpq : Decidable (p ∧ q)] [dp : Decidable p] [dq : Decidable q] :
    decide (p ∧ q) = (p && q)


@[simp]
theorem bfamilyOfFamily'_typein {ι} (r : ι → ι → Prop) [IsWellOrder ι r] (f : ι → α) (i) :
    bfamilyOfFamily' r f (typein r i) (typein_lt_type r i) = f i

{α : Type u_1}
{ι : Type u_4}
(r : ι → ι → Prop)
[IsWellOrder ι r]
(f : ι → α)
(i : ι)

Ordinal.bfamilyOfFamily' r f (Ordinal.typein r i) ⋯ = f i


@[to_additive]
lemma orbitRel_r_apply {a b : α} : (orbitRel G _).r a b ↔ a ∈ orbit G b

{G : Type u_1}
{α : Type u_2}
[AddGroup G]
[AddAction G α]
{a b : α}


@[simp]
theorem nhdsWithin_empty (a : α) : 𝓝[∅] a = ⊥

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


theorem zero_of_eval_zero [Infinite R] (p : R[X]) (h : ∀ x, p.eval x = 0) : p = 0

(h : ∀ (x : R), Polynomial.eval x p = 0)


theorem add_eq_iff {x y z : Tropical R} : x + y = z ↔ x = z ∧ x ≤ y ∨ y = z ∧ y ≤ x

{R : Type u}
[LinearOrder R]
{x y z : Tropical R}


theorem foldr_eq_of_comm' : ∀ a b l, foldr f a (b :: l) = foldr f (f b a) l

{f : α → β → β}

(hf : ∀ (a b : α) (c : β), f a (f b c) = f b (f a c))

List.foldr f a (b :: l) = List.foldr f (f b a) l


theorem nat_casesOn {f : α → ℕ} {g : α → β} {h : α → ℕ → β} (hf : Primrec f) (hg : Primrec g)
    (hh : Primrec₂ h) : Primrec fun a => ((f a).casesOn (g a) (h a) : β)

{α : Type u_1}
{β : Type u_2}
[Primcodable α]
[Primcodable β]
{f : α → ℕ}
{g : α → β}
{h : α → ℕ → β}
(hf : Primrec f)
(hg : Primrec g)
(hh : Primrec₂ h)

Primrec fun a => Nat.casesOn (f a) (g a) (h a)


/-- We verify that an enriched functor between `Type v` enriched categories
is just the same thing as an honest functor.
-/
@[simps]
def enrichedFunctorTypeEquivFunctor {C : Type u₁} [𝒞 : EnrichedCategory (Type v) C] {D : Type u₂}
    [𝒟 : EnrichedCategory (Type v) D] : EnrichedFunctor (Type v) C D ≃ C ⥤ D

[𝒞 : CategoryTheory.EnrichedCategory (Type v) C]

[𝒟 : CategoryTheory.EnrichedCategory (Type v) D]

(CategoryTheory.enrichedFunctorTypeEquivFunctor.symm F).obj X = F.obj X


/-- All `DFunLike`s are finite if their domain and codomain are.

Can't be an instance because it can cause infinite loops.
-/
theorem DFunLike.finite [Finite α] [∀ i, Finite (β i)] : Finite F

(F : Sort u_1)
{α : Sort u_3}
{β : α → Sort u_5}
[DFunLike F α β]
[Finite α]
[∀ (i : α), Finite (β i)]


theorem hasDerivAt_arctan (x : ℝ) : HasDerivAt arctan (1 / (1 + x ^ 2)) x

HasDerivAt Real.arctan (1 / (1 + x ^ 2)) x


/-- The canonical linear map `M →ₗ[R] TensorAlgebra R M`.
-/
irreducible_def ι : M →ₗ[R] TensorAlgebra R M

(R : Type u_3)
[CommSemiring R]
{M : Type u_4}
[AddCommMonoid M]
[Module R M]

TensorAlgebra.ι R =
  { toFun := fun m => (RingQuot.mkAlgHom R (TensorAlgebra.Rel R M)) (FreeAlgebra.ι R m), map_add' := ⋯, map_smul' := ⋯ }


/-- If `P` is a sheaf for `S`, and it is iso to `P'`, then `P'` is a sheaf for `S`. This shows that
"being a sheaf for a presieve" is a mathematical or hygienic property.
-/
theorem isSheafFor_iso {P' : Cᵒᵖ ⥤ Type w} (i : P ≅ P') : IsSheafFor P R → IsSheafFor P' R

{P : CategoryTheory.Functor Cᵒᵖ (Type w)}

{P' : CategoryTheory.Functor Cᵒᵖ (Type w)}

CategoryTheory.Presieve.IsSheafFor P R → CategoryTheory.Presieve.IsSheafFor P' R


theorem IsAssociatedPrime.map_of_injective (h : IsAssociatedPrime I M) (hf : Function.Injective f) :
    IsAssociatedPrime I M'

{R : Type u_1}
[CommRing R]
{I : Ideal R}
{M : Type u_2}
[AddCommGroup M]
[Module R M]
{M' : Type u_3}
[AddCommGroup M']
[Module R M']
(f : M →ₗ[R] M')
(h : IsAssociatedPrime I M)
(hf : Function.Injective ⇑f)


theorem val_intCast {n : ℕ} (a : ℤ) [NeZero n] : ↑(a : ZMod n).val = a % n


@[simp]
theorem ι_range_map_map (f : Q₁ →qᵢ Q₂) :
    (ι Q₁).range.map (map f).toLinearMap = f.range.map (ι Q₂)

{R : Type u_1}
[CommRing R]
{M₁ : Type u_4}
{M₂ : Type u_5}
[AddCommGroup M₁]
[AddCommGroup M₂]
[Module R M₁]
[Module R M₂]
{Q₁ : QuadraticForm R M₁}
{Q₂ : QuadraticForm R M₂}
(f : Q₁ →qᵢ Q₂)

Submodule.map (CliffordAlgebra.map f).toLinearMap (LinearMap.range (CliffordAlgebra.ι Q₁)) =
  Submodule.map (CliffordAlgebra.ι Q₂) (LinearMap.range f.toLinearMap)


@[simp]
theorem coe_dualDual : ⇑(dualDual α) = toDual ∘ toDual

⇑(OrderIso.dualDual α) = ⇑OrderDual.toDual ∘ ⇑OrderDual.toDual


@[to_additive (attr := aesop safe 20 apply (rule_sets := [Measurable]))]
theorem Measurable.mul' [MeasurableMul₂ M] (hf : Measurable f) (hg : Measurable g) :
    Measurable (f * g)

{M : Type u_2}
{α : Type u_3}
[MeasurableSpace M]
[Mul M]
{m : MeasurableSpace α}
{f g : α → M}
[MeasurableMul₂ M]
(hf : Measurable f)
(hg : Measurable g)


/-- A composition of natural transformations gives the composition of corresponding functors. -/
-- Porting note: removed @[simps (config := { rhsMd := semireducible })] and replaced with
@[simps!]
def functorOfNatTransComp {F₀ F₁ F₂ : C ⥤ C} (α : F₀ ⟶ F₁) (β : F₁ ⟶ F₂) :
    functorOfNatTrans (α ≫ β) ≅ functorOfNatTrans β ⋙ functorOfNatTrans α

(X : CategoryTheory.Endofunctor.Algebra F₂)

((CategoryTheory.Endofunctor.Algebra.functorOfNatTransComp α β).hom.app X).f = CategoryTheory.CategoryStruct.id X.a


/-- The product of two smooth partial homeomorphisms is smooth. -/
theorem contDiffGroupoid_prod {I : ModelWithCorners 𝕜 E H} {I' : ModelWithCorners 𝕜 E' H'}
    {e : PartialHomeomorph H H} {e' : PartialHomeomorph H' H'} (he : e ∈ contDiffGroupoid ⊤ I)
    (he' : e' ∈ contDiffGroupoid ⊤ I') : e.prod e' ∈ contDiffGroupoid ⊤ (I.prod I')

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{E' : Type u_5}
{H' : Type u_6}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
[TopologicalSpace H']
{I : ModelWithCorners 𝕜 E H}
{I' : ModelWithCorners 𝕜 E' H'}
{e : PartialHomeomorph H H}
{e' : PartialHomeomorph H' H'}
(he : e ∈ contDiffGroupoid ⊤ I)
(he' : e' ∈ contDiffGroupoid ⊤ I')


/-- Morphisms of `Factorisation f` consist of morphism between their midpoints and the obvious
commutativity conditions. -/
@[ext]
protected structure Hom (d e : Factorisation f) : Type (max u v) where
  /-- The morphism between the midpoints of the factorizations. -/
  h : d.mid ⟶ e.mid
  /-- The left commuting triangle of the factorization morphism. -/
  ι_h : d.ι ≫ h = e.ι := by aesop_cat
  /-- The right commuting triangle of the factorization morphism. -/
  h_π : h ≫ e.π = d.π := by aesop_cat

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X Y : C}
{f : X ⟶ Y}
{d e : CategoryTheory.Factorisation f}
(self : d.Hom e)

CategoryTheory.CategoryStruct.comp d.ι self.h = e.ι


@[simp]
lemma id_as (a : LocallyDiscrete C) : (𝟙 a : Discrete (a.as ⟶ a.as)).as = 𝟙 a.as

(CategoryTheory.CategoryStruct.id a).as = CategoryTheory.CategoryStruct.id a.as


@[to_additive (attr := simp)]
theorem toMulHom_eq_coe (f : M ≃* N) : f.toMulHom = ↑f

{M : Type u_6}
{N : Type u_7}
[Mul M]
[Mul N]
(f : M ≃* N)


theorem subset_pointwise_smul_iff {a : M} {S T : Subring R} : S ≤ a • T ↔ a⁻¹ • S ≤ T

{M : Type u_1}
{R : Type u_2}
[Group M]
[Ring R]
[MulSemiringAction M R]
{a : M}
{S T : Subring R}

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


theorem infinite_of_forall_exists_gt (h : ∀ a, ∃ b ∈ s, a < b) : s.Infinite

{α : Type u}
[Preorder α]
[Nonempty α]
{s : Set α}
(h : ∀ (a : α), ∃ b ∈ s, a < b)


@[simp]
theorem blockDiagonal_sub [AddGroup α] (M N : o → Matrix m n α) :
    blockDiagonal (M - N) = blockDiagonal M - blockDiagonal N

{m : Type u_2}
{n : Type u_3}
{o : Type u_4}
{α : Type u_12}
[DecidableEq o]
[AddGroup α]
(M N : o → Matrix m n α)

Matrix.blockDiagonal (M - N) = Matrix.blockDiagonal M - Matrix.blockDiagonal N


/-- A measurable space is a space equipped with a σ-algebra. -/
@[class] structure MeasurableSpace (α : Type*) where
  /-- Predicate saying that a given set is measurable. Use `MeasurableSet` in the root namespace
  instead. -/
  MeasurableSet' : Set α → Prop
  /-- The empty set is a measurable set. Use `MeasurableSet.empty` instead. -/
  measurableSet_empty : MeasurableSet' ∅
  /-- The complement of a measurable set is a measurable set. Use `MeasurableSet.compl` instead. -/
  measurableSet_compl : ∀ s, MeasurableSet' s → MeasurableSet' sᶜ
  /-- The union of a sequence of measurable sets is a measurable set. Use a more general
  `MeasurableSet.iUnion` instead. -/
  measurableSet_iUnion : ∀ f : ℕ → Set α, (∀ i, MeasurableSet' (f i)) → MeasurableSet' (⋃ i, f i)

{α : Type u_7}
(self : MeasurableSpace α)
(f : ℕ → Set α)

(∀ (i : ℕ), self.MeasurableSet' (f i)) → self.MeasurableSet' (⋃ i, f i)


theorem X_sub_C_dvd_nodal (v : ι → R) {i : ι} (hi : i ∈ s) : X - C (v i) ∣ nodal s v

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

Polynomial.X - Polynomial.C (v i) ∣ Lagrange.nodal s v


@[to_additive]
theorem Multipliable.comp_injective {i : γ → β} (hf : Multipliable f) (hi : Injective i) :
    Multipliable (f ∘ i)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[AddCommGroup α]
[UniformSpace α]
[UniformAddGroup α]
{f : β → α}
[CompleteSpace α]
{i : γ → β}
(hf : Summable f)
(hi : Function.Injective i)


theorem Ioi_injective : Injective (Ioi : α → Set α)


/-- Suppose that the topology on `α` is defined by its restrictions to the sets of `𝔖`.

Then the set of continuous functions is closed
in the topology of uniform convergence on the sets of `𝔖`. -/
theorem isClosed_setOf_continuous [TopologicalSpace α] (h : RestrictGenTopology 𝔖) :
    IsClosed {f : α →ᵤ[𝔖] β | Continuous (toFun 𝔖 f)}

{α : Type u_1}
{β : Type u_2}
[UniformSpace β]
{𝔖 : Set (Set α)}
[TopologicalSpace α]
(h : RestrictGenTopology 𝔖)

IsClosed {f | Continuous ((UniformOnFun.toFun 𝔖) f)}


theorem comp_symm_deriv {x : M'} (hx : x ∈ e.target) :
    (mfderiv I I' e (e.symm x)).comp (mfderiv I' I e.symm x) =
      ContinuousLinearMap.id 𝕜 (TangentSpace I' x)

(he : PartialHomeomorph.MDifferentiable I I' e)

(mfderiv I I' (↑e) (↑e.symm x)).comp (mfderiv I' I (↑e.symm) x) = ContinuousLinearMap.id 𝕜 (TangentSpace I' x)


theorem pathToList_listToPath (l : List α) : pathToList (listToPath l) = l

Quiver.SingleObj.pathToList (Quiver.SingleObj.listToPath l) = l


@[simp]
theorem floor_int_add (z : ℤ) (a : α) : ⌊↑z + a⌋ = z + ⌊a⌋

{α : Type u_2}
[LinearOrderedRing α]
[FloorRing α]
(z : ℤ)
(a : α)


theorem trStmts₁_supports {S q} (H₁ : (q : Λ').Supports S) (HS₁ : trStmts₁ q ⊆ S) :
    Supports (trStmts₁ q) S

(H₁ : Turing.PartrecToTM2.Λ'.Supports S q)

(HS₁ : Turing.PartrecToTM2.trStmts₁ q ⊆ S)

Turing.PartrecToTM2.Supports (Turing.PartrecToTM2.trStmts₁ q) S


@[simp]
theorem coe_toSubring (s : Subfield K) : (s.toSubring : Set K) = s

{K : Type u}
[DivisionRing K]
(s : Subfield K)


@[simp]
theorem zero_lt_card {o} : 0 < card o ↔ 0 < o


/-- The type of AddMonoid homomorphisms satisfying the characteristic predicate: if `f : M →+ N`
satisfies this predicate, then `N` is isomorphic to the localization of `M` at `S`. -/
-- Porting note(#5171): this linter isn't ported yet.
-- @[nolint has_nonempty_instance]
structure LocalizationMap extends AddMonoidHom M N where
  map_add_units' : ∀ y : S, IsAddUnit (toFun y)
  surj' : ∀ z : N, ∃ x : M × S, z + toFun x.2 = toFun x.1
  exists_of_eq : ∀ x y, toFun x = toFun y → ∃ c : S, ↑c + x = ↑c + y

{M : Type u_1}
[AddCommMonoid M]
{S : AddSubmonoid M}
{N : Type u_2}
[AddCommMonoid N]
(self : S.LocalizationMap N)
(z : N)

∃ x, z + (↑self.toAddMonoidHom).toFun ↑x.2 = (↑self.toAddMonoidHom).toFun x.1


theorem HasSeparatingCover.mono {s₁ s₂ t₁ t₂ : Set X} (sc_st : HasSeparatingCover s₂ t₂)
    (s_sub : s₁ ⊆ s₂) (t_sub : t₁ ⊆ t₂) : HasSeparatingCover s₁ t₁

{X : Type u_1}
[TopologicalSpace X]
{s₁ s₂ t₁ t₂ : Set X}
(sc_st : HasSeparatingCover s₂ t₂)
(s_sub : s₁ ⊆ s₂)
(t_sub : t₁ ⊆ t₂)


/-- The cosine of the oriented angle between two nonzero vectors is the inner product divided by
the product of the norms. -/
theorem cos_oangle_eq_inner_div_norm_mul_norm {x y : V} (hx : x ≠ 0) (hy : y ≠ 0) :
    Real.Angle.cos (o.oangle x y) = ⟪x, y⟫ / (‖x‖ * ‖y‖)

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

(o.oangle x y).cos = ⟪x, y⟫_ℝ / (‖x‖ * ‖y‖)


private theorem ghostFun_intCast (i : ℤ) : ghostFun (i : 𝕎 R) = i

{p : ℕ}
{R : Type u_1}
[hp : Fact (Nat.Prime p)]
[CommRing R]
(i : ℤ)


@[simp]
theorem disjoint_singleton {l : Multiset α} {a : α} : Disjoint l {a} ↔ a ∉ l


lemma eventually_atTop_ge {b : ℝ} (hb : b ∈ Set.Ioo 0 1) (hf : GrowsPolynomially f) :
    ∃ c > 0, ∀ᶠ x in atTop, ∀ u ∈ Set.Icc (b * x) x, c * f x ≤ f u

(hf : AkraBazziRecurrence.GrowsPolynomially f)

∃ c > 0, ∀ᶠ (x : ℝ) in Filter.atTop, ∀ u ∈ Set.Icc (b * x) x, c * f x ≤ f u


/-- `(G ⋙ lim).obj j` = `limit (G.obj j)` definitionally, so this
is just a variant of `limit_ext'`. -/
@[ext] lemma comp_lim_obj_ext {j : J} {G : J ⥤ K ⥤ Type v} (x y : (G ⋙ lim).obj j)
    (w : ∀ (k : K), limit.π (G.obj j) k x = limit.π (G.obj j) k y) : x = y

(x y : (G ⋙ CategoryTheory.Limits.lim).obj j)

(w : ∀ (k : K), CategoryTheory.Limits.limit.π (G.obj j) k x = CategoryTheory.Limits.limit.π (G.obj j) k y)


@[to_additive Ici_add_Ici_subset]
theorem Ici_mul_Ici_subset' (a b : α) : Ici a * Ici b ⊆ Ici (a * b)

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

[CovariantClass α α (Function.swap HMul.hMul) LE.le]


theorem ofRestrict_top_c (X : PresheafedSpace C) :
    (X.ofRestrict (Opens.openEmbedding ⊤)).c =
      eqToHom
        (by
          rw [restrict_top_presheaf, ← Presheaf.Pushforward.comp_eq]
          erw [Iso.inv_hom_id]
          rw [Presheaf.id_pushforward]
          dsimp)

(X : AlgebraicGeometry.PresheafedSpace C)

(X.ofRestrict ⋯).c = CategoryTheory.eqToHom ⋯


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


theorem combo_eq_smul_add_smul (a : Int) (xs : IntList) (b : Int) (ys : IntList) :
    combo a xs b ys = a * xs + b * ys

(a : Int)
(xs : Lean.Omega.IntList)
(b : Int)
(ys : Lean.Omega.IntList)

Lean.Omega.IntList.combo a xs b ys = a * xs + b * ys


theorem sub (hf : DiffContOnCl 𝕜 f s) (hg : DiffContOnCl 𝕜 g s) : DiffContOnCl 𝕜 (f - g) s

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


lemma measure_compl₀ (h : NullMeasurableSet s μ) (hs : μ s ≠ ∞) :
    μ sᶜ = μ Set.univ - μ s

(h : MeasureTheory.NullMeasurableSet s μ)


@[simp]
theorem zero {p : ℕ} : maxPowDiv p 0 = 0


theorem div_right (h : SemiconjBy a x y) (h' : SemiconjBy a x' y') :
    SemiconjBy a (x / x') (y / y')

{G₀ : Type u_3}
[GroupWithZero G₀]
{a x y x' y' : G₀}
(h : SemiconjBy a x y)
(h' : SemiconjBy a x' y')


theorem ext_cauchy {x y : Real} : x.cauchy = y.cauchy → x = y


/-- The restriction of a `K`-Lipschitz function is `K`-Lipschitz. -/
protected theorem restrict (hf : LipschitzWith K f) (s : Set α) : LipschitzWith K (s.restrict f)

{α : Type u}
{β : Type v}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
{K : ℝ≥0}
{f : α → β}
(hf : LipschitzWith K f)
(s : Set α)


theorem map_invUnitsSub (f : R →+* S) (u : Rˣ) :
    map f (invUnitsSub u) = invUnitsSub (Units.map (f : R →* S) u)

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

(PowerSeries.map f) (PowerSeries.invUnitsSub u) = PowerSeries.invUnitsSub ((Units.map ↑f) u)


theorem rightUnitor_hom_hom {X : Action V G} : Hom.hom (ρ_ X).hom = (ρ_ X.V).hom

{V : Type (u + 1)}
[CategoryTheory.LargeCategory V]
{G : MonCat}
[CategoryTheory.MonoidalCategory V]
{X : Action V G}

(CategoryTheory.MonoidalCategory.rightUnitor X).hom.hom = (CategoryTheory.MonoidalCategory.rightUnitor X.V).hom


@[gcongr]
theorem pow_le_pow_right (ha : 1 ≤ a) (h : n ≤ m) : a ^ n ≤ a ^ m

{R : Type u_3}
[OrderedSemiring R]
{a : R}
{n m : ℕ}
(ha : 1 ≤ a)
(h : n ≤ m)


lemma pow_eq_pow_iff_of_ne_zero (hn : n ≠ 0) : a ^ n = b ^ n ↔ a = b ∨ a = -b ∧ Even n

{R : Type u_2}
[LinearOrderedRing R]
{a b : R}
{n : ℕ}
(hn : n ≠ 0)


theorem trim_eq_iInf' (s : Set α) : m.trim s = ⨅ t : { t // s ⊆ t ∧ MeasurableSet t }, m t

{α : Type u_1}
[MeasurableSpace α]
(m : MeasureTheory.OuterMeasure α)
(s : Set α)


lemma supClosed_range [FunLike F α β] [SupHomClass F α β] (f : F) : SupClosed (Set.range f)

{F : Type u_1}
{α : Type u_2}
{β : Type u_3}
[SemilatticeSup α]
[SemilatticeSup β]
[FunLike F α β]
[SupHomClass F α β]
(f : F)


protected theorem union {s' t'} (h : e.IsImage s t) (h' : e.IsImage s' t') :
    e.IsImage (s ∪ s') (t ∪ t')

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


theorem indep_of_indep_of_le_right {m₁ m₂ m₃ : MeasurableSpace Ω} {_mΩ : MeasurableSpace Ω}
    {κ : Kernel α Ω} {μ : Measure α} (h_indep : Indep m₁ m₂ κ μ) (h32 : m₃ ≤ m₂) :
    Indep m₁ m₃ κ μ

(h_indep : ProbabilityTheory.Kernel.Indep m₁ m₂ κ μ)

ProbabilityTheory.Kernel.Indep m₁ m₃ κ μ


theorem coeff_zero_X_mul (φ : MvPowerSeries σ R) (s : σ) : coeff R (0 : σ →₀ ℕ) (X s * φ) = 0

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

(MvPowerSeries.coeff R 0) (MvPowerSeries.X s * φ) = 0


/-- Restrict a partial homeomorphism to the subsets of the source and target
that consist of points `x ∈ f.source`, `y = f x ∈ f.target`
such that `f` is `C^n` at `x` and `f.symm` is `C^n` at `y`.

Note that `n` is a natural number, not `∞`,
because the set of points of `C^∞`-smoothness of `f` is not guaranteed to be open. -/
@[simps! apply symm_apply source target]
def restrContDiff (f : PartialHomeomorph E F) (n : ℕ) : PartialHomeomorph E F

(𝕜 : Type u_1)
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
(f : PartialHomeomorph E F)
(n : ℕ)

∀ (a : F), ↑(PartialHomeomorph.restrContDiff 𝕜 f n).symm a = ↑f.symm a


lemma addContent_sUnion (h_ss : ↑I ⊆ C)
    (h_dis : PairwiseDisjoint (I : Set (Set α)) id) (h_mem : ⋃₀ ↑I ∈ C) :
    m (⋃₀ I) = ∑ u ∈ I, m u

{α : Type u_1}
{C : Set (Set α)}
{I : Finset (Set α)}
{m : MeasureTheory.AddContent C}
(h_ss : ↑I ⊆ C)
(h_dis : (↑I).PairwiseDisjoint id)
(h_mem : ⋃₀ ↑I ∈ C)


@[simp] theorem succ_mk (n i : Nat) (h : i < n) :
    Fin.succ ⟨i, h⟩ = ⟨i + 1, Nat.succ_lt_succ h⟩


/-- The `MonoidHom` from a subgroup to its image. -/
@[to_additive (attr := simps!) "the `AddMonoidHom` from an additive subgroup to its image"]
def subgroupMap (f : G →* G') (H : Subgroup G) : H →* H.map f

{G : Type u_1}
{G' : Type u_2}
[Group G]
[Group G']
(f : G →* G')
(H : Subgroup G)
(x : ↥H.toSubmonoid)


theorem tendstoLocallyUniformlyOn_biUnion {s : Set γ} {S : γ → Set α} (hS : ∀ i ∈ s, IsOpen (S i))
    (h : ∀ i ∈ s, TendstoLocallyUniformlyOn F f p (S i)) :
    TendstoLocallyUniformlyOn F f p (⋃ i ∈ s, S i)

{F : ι → α → β}


@[simp] lemma tprod_mul_tprod (x y : (i : ι) → A i) :
    tprod R x * tprod R y = tprod R (x * y)

[(i : ι) → NonUnitalNonAssocSemiring (A i)]

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

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

(PiTensorProduct.tprod R) x * (PiTensorProduct.tprod R) y = (PiTensorProduct.tprod R) (x * y)


@[simp] theorem erase_update_eq_erase (f : α →₀ M) (a : α) (b : M) :
    erase a (update f a b) = erase a f

{α : Type u_1}
{M : Type u_5}
[Zero M]
(f : α →₀ M)
(a : α)
(b : M)

Finsupp.erase a (f.update a b) = Finsupp.erase a f


theorem toLp_sub {f g : α → E} (hf : Memℒp f p μ) (hg : Memℒp g p μ) :
    (hf.sub hg).toLp (f - g) = hf.toLp f - hg.toLp g

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup E]
{f g : α → E}
(hf : MeasureTheory.Memℒp f p μ)
(hg : MeasureTheory.Memℒp g p μ)

MeasureTheory.Memℒp.toLp (f - g) ⋯ = MeasureTheory.Memℒp.toLp f hf - MeasureTheory.Memℒp.toLp g hg


theorem zeroLocus_iUnion {ι : Sort*} (s : ι → Set R) :
    zeroLocus (⋃ i, s i) = ⋂ i, zeroLocus (s i)

{R : Type u}
[CommSemiring R]
{ι : Sort u_1}
(s : ι → Set R)

PrimeSpectrum.zeroLocus (⋃ i, s i) = ⋂ i, PrimeSpectrum.zeroLocus (s i)


/-- If the minimal polynomial of `x : K` over `F` is separable, then `x` is integral over `F`,
because the minimal polynomial of a non-integral element is `0`, which is not separable. -/
theorem IsSeparable.isIntegral {x : K} (h : IsSeparable F x) : IsIntegral F x

{F : Type u_1}
{K : Type u_2}
[CommRing F]
[Ring K]
[Algebra F K]
{x : K}
(h : IsSeparable F x)


@[simp] lemma surjective_liftOn' {f : α → φ} (h) :
    Function.Surjective (fun x : Quotient s₁ ↦ x.liftOn' f h) ↔ Function.Surjective f

(h : ∀ (a b : α), Setoid.r a b → f a = f b)

(Function.Surjective fun x => x.liftOn' f h) ↔ Function.Surjective f


/-- We have
`cyclotomic n R = (X ^ k - 1) /ₘ (∏ i ∈ Nat.properDivisors k, cyclotomic i K)`. -/
theorem cyclotomic_eq_X_pow_sub_one_div {R : Type*} [CommRing R] {n : ℕ} (hpos : 0 < n) :
    cyclotomic n R = (X ^ n - 1) /ₘ ∏ i ∈ Nat.properDivisors n, cyclotomic i R

{R : Type u_1}
[CommRing R]
{n : ℕ}
(hpos : 0 < n)

Polynomial.cyclotomic n R = (Polynomial.X ^ n - 1) /ₘ ∏ i ∈ n.properDivisors, Polynomial.cyclotomic i R


theorem mul_add_left_right {x y : R} (h : IsCoprime x y) (z : R) : IsCoprime x (x * z + y)

{R : Type u}
[CommRing R]
{x y : R}
(h : IsCoprime x y)
(z : R)


/-- `HasBinaryBiproducts C` represents the existence of a bicone which is
simultaneously a limit and a colimit of the diagram `pair P Q`, for every `P Q : C`.
-/
class HasBinaryBiproducts : Prop where
  has_binary_biproduct : ∀ P Q : C, HasBinaryBiproduct P Q

[self : CategoryTheory.Limits.HasBinaryBiproducts C]


nonrec theorem IsLocalMin.max (hf : IsLocalMin f a) (hg : IsLocalMin g a) :
    IsLocalMin (fun x => max (f x) (g x)) a

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[LinearOrder β]
{f g : α → β}
{a : α}
(hf : IsLocalMin f a)
(hg : IsLocalMin g a)


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

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


theorem Ico_bot_coe : Ico (⊥ : WithBot α) b = insertNone (Iio b)

(α : Type u_1)
[PartialOrder α]
[OrderBot α]
[LocallyFiniteOrder α]
(b : α)

Finset.Ico ⊥ ↑b = Finset.insertNone (Finset.Iio b)


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

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


@[simp]
theorem emod_add_bmod_congr (x : Int) (n : Nat) : Int.bmod (x%n + y) n = Int.bmod (x + y) n


@[to_additive]
theorem isOpen_mono [ContinuousMul G] {H₁ H₂ : Subgroup G} (h : H₁ ≤ H₂)
    (h₁ : IsOpen (H₁ : Set G)) : IsOpen (H₂ : Set G)

{G : Type u_1}
[Group G]
[TopologicalSpace G]
[ContinuousMul G]
{H₁ H₂ : Subgroup G}
(h : H₁ ≤ H₂)
(h₁ : IsOpen ↑H₁)


@[to_additive (attr := simp)]
theorem symm_symm (f : M ≃* N) : f.symm.symm = f

{M : Type u_6}
{N : Type u_7}
[Mul M]
[Mul N]
(f : M ≃* N)


@[to_additive]
theorem Normal.comap {H : Subgroup N} (hH : H.Normal) (f : G →* N) : (H.comap f).Normal

{G : Type u_1}
[AddGroup G]
{N : Type u_5}
[AddGroup N]
{H : AddSubgroup N}
(hH : H.Normal)
(f : G →+ N)


protected theorem add_left_cancel' (c : ℕ) (h : c + a ≡ c + b [MOD n]) : a ≡ b [MOD n]

{n a b : ℕ}
(c : ℕ)
(h : c + a ≡ c + b [MOD n])


theorem expand_WF.foldl [BEq α] [Hashable α] (rank : α → Nat) {l : List (α × β)} {i : Nat}
    (hl₁ : ∀ [PartialEquivBEq α] [LawfulHashable α], l.Pairwise fun a b => ¬(a.1 == b.1))
    (hl₂ : ∀ x ∈ l, rank x.1 = i)
    {target : Buckets α β} (ht₁ : target.WF)
    (ht₂ : ∀ bucket ∈ target.1.data,
      bucket.All fun k _ => rank k ≤ i ∧
        ∀ [PartialEquivBEq α] [LawfulHashable α], ∀ x ∈ l, ¬(x.1 == k)) :
    (l.foldl (fun d x => reinsertAux d x.1 x.2) target).WF ∧
    ∀ bucket ∈ (l.foldl (fun d x => reinsertAux d x.1 x.2) target).1.data,
      bucket.All fun k _ => rank k ≤ i

(hl₁ :
  ∀ [inst : PartialEquivBEq α] [inst : Batteries.HashMap.LawfulHashable α],
    List.Pairwise (fun a b => ¬(a.fst == b.fst) = true) l)

(hl₂ : ∀ (x : α × β), x ∈ l → rank x.fst = i)

{target : Batteries.HashMap.Imp.Buckets α β}

(ht₂ :
  ∀ (bucket : Batteries.AssocList α β),
    bucket ∈ target.val.data →
      Batteries.AssocList.All
        (fun k x =>
          rank k ≤ i ∧
            ∀ [inst : PartialEquivBEq α] [inst : Batteries.HashMap.LawfulHashable α] (x : α × β),
              x ∈ l → ¬(x.fst == k) = true)
        bucket)

(List.foldl (fun d x => Batteries.HashMap.Imp.reinsertAux d x.fst x.snd) target l).WF ∧
  ∀ (bucket : Batteries.AssocList α β),
    bucket ∈ (List.foldl (fun d x => Batteries.HashMap.Imp.reinsertAux d x.fst x.snd) target l).val.data →
      Batteries.AssocList.All (fun k x => rank k ≤ i) bucket


protected theorem mul_pos {a b : ℝ} : 0 < a → 0 < b → 0 < a * b


lemma mk_comp_mk [HasSmallLocalizedHom.{w} W X Y] [HasSmallLocalizedHom.{w} W Y Z]
    [HasSmallLocalizedHom.{w} W X Z] (f : X ⟶ Y) (g : Y ⟶ Z) :
    (mk W f).comp (mk W g) = mk W (f ≫ g)

[CategoryTheory.Localization.HasSmallLocalizedHom W X Y]

[CategoryTheory.Localization.HasSmallLocalizedHom W Y Z]

[CategoryTheory.Localization.HasSmallLocalizedHom W X Z]

(CategoryTheory.Localization.SmallHom.mk W f).comp (CategoryTheory.Localization.SmallHom.mk W g) =
  CategoryTheory.Localization.SmallHom.mk W (CategoryTheory.CategoryStruct.comp f g)


theorem inj_right (hm : IsHomogeneous φ m) (hn : IsHomogeneous φ n) (hφ : φ ≠ 0) : m = n

{σ : Type u_1}
{R : Type u_3}
[CommSemiring R]
{φ : MvPolynomial σ R}
{m n : ℕ}
(hm : φ.IsHomogeneous m)
(hn : φ.IsHomogeneous n)
(hφ : φ ≠ 0)


theorem exists_mem_empty_iff (p : α → Prop) : (∃ x, x ∈ (∅ : Finset α) ∧ p x) ↔ False


@[simp] theorem filter_filter (q) (l : Array α) :
    filter p (filter q l) = filter (fun a => p a ∧ q a) l

{α : Type u_1}
{p : α → Bool}
(q : α → Bool)
(l : Array α)

Array.filter p (Array.filter q l 0) 0 = Array.filter (fun a => decide (p a = true ∧ q a = true)) l 0


theorem HasFDerivAtFilter.hasDerivAtFilter {f' : 𝕜 →L[𝕜] F} :
    HasFDerivAtFilter f f' x L → HasDerivAtFilter f (f' 1) x L

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


/-- **Dirichlet's test** for antitone sequences. -/
theorem Antitone.cauchySeq_series_mul_of_tendsto_zero_of_bounded (hfa : Antitone f)
    (hf0 : Tendsto f atTop (𝓝 0)) (hzb : ∀ n, ‖∑ i ∈ range n, z i‖ ≤ b) :
    CauchySeq fun n ↦ ∑ i ∈ range n, f i • z i

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

(hzb : ∀ (n : ℕ), ‖∑ i ∈ Finset.range n, z i‖ ≤ b)

CauchySeq fun n => ∑ i ∈ Finset.range n, f i • z i


theorem of_mem_dlookup {a : α} {b : β a} :
    ∀ {l : List (Sigma β)}, b ∈ dlookup a l → Sigma.mk a b ∈ l

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


theorem SetLike.homogeneous_zero_submodule [Zero ι] [Semiring S] [AddCommMonoid R] [Module S R]
    (A : ι → Submodule S R) : SetLike.Homogeneous A (0 : R)

{ι : Type u_1}
{S : Type u_3}
{R : Type u_4}
[Zero ι]
[Semiring S]
[AddCommMonoid R]
[Module S R]
(A : ι → Submodule S R)


theorem Dep.of_restriction (hX : N.Dep X) (hNM : N ≤r M) : M.Dep X

{α : Type u_1}
{M : Matroid α}
{X : Set α}
{N : Matroid α}
(hX : N.Dep X)
(hNM : N.Restriction M)


@[to_additive (attr := simp)] lemma mulEnergy_eq_zero_iff : Eₘ[s, t] = 0 ↔ s = ∅ ∨ t = ∅

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


lemma isOpen_iff_isUpperSet_and_scottHausdorff_open :
    IsOpen s ↔ IsUpperSet s ∧ IsOpen[scottHausdorff α] s

{α : Type u_1}
[Preorder α]
[TopologicalSpace α]
[Topology.IsScott α]
{s : Set α}


theorem AnalyticAt.sub (hf : AnalyticAt 𝕜 f x) (hg : AnalyticAt 𝕜 g x) :
    AnalyticAt 𝕜 (f - g) x

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f g : E → F}
{x : E}
(hf : AnalyticAt 𝕜 f x)
(hg : AnalyticAt 𝕜 g x)


theorem isBigOWith_comp [RingHomIsometric σ₂₃] {α : Type*} (g : F →SL[σ₂₃] G) (f : α → F)
    (l : Filter α) : IsBigOWith ‖g‖ l (fun x' => g (f x')) f

{𝕜₂ : Type u_2}
{𝕜₃ : Type u_3}
{F : Type u_5}
{G : Type u_6}
[SeminormedAddCommGroup F]
[SeminormedAddCommGroup G]
[NontriviallyNormedField 𝕜₂]
[NontriviallyNormedField 𝕜₃]
[NormedSpace 𝕜₂ F]
[NormedSpace 𝕜₃ G]
{σ₂₃ : 𝕜₂ →+* 𝕜₃}
[RingHomIsometric σ₂₃]
{α : Type u_7}
(g : F →SL[σ₂₃] G)
(f : α → F)
(l : Filter α)

Asymptotics.IsBigOWith ‖g‖ l (fun x' => g (f x')) f


@[to_additive (attr := simp 1100)]
theorem singleton_mul_closedBall : {x} * closedBall y δ = closedBall (x * y) δ

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

{x} + Metric.closedBall y δ = Metric.closedBall (x + y) δ


/-- `ZeroMemClass S M` says `S` is a type of subsets `s ≤ M`, such that `0 ∈ s` for all `s`. -/
class ZeroMemClass (S : Type*) (M : Type*) [Zero M] [SetLike S M] : Prop where
  /-- By definition, if we have `ZeroMemClass S M`, we have `0 ∈ s` for all `s : S`. -/
  zero_mem : ∀ s : S, (0 : M) ∈ s

{S : Type u_4}
{M : Type u_5}
[Zero M]
[SetLike S M]
[self : ZeroMemClass S M]
(s : S)


theorem factorMultiset_lcm (m n : ℕ+) :
    factorMultiset (lcm m n) = factorMultiset m ⊔ factorMultiset n

(m.lcm n).factorMultiset = m.factorMultiset ⊔ n.factorMultiset


lemma lt_iff_add_one_le : m < n ↔ m + 1 ≤ n


@[simp] theorem bne_true  : ∀(b : Bool), (b != true)  = !b


theorem continuous_prod_of_discrete_right [DiscreteTopology β] {f : α × β → γ} :
    Continuous f ↔ ∀ b, Continuous (f ⟨·, b⟩)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[TopologicalSpace α]
[TopologicalSpace β]
[TopologicalSpace γ]
[DiscreteTopology β]
{f : α × β → γ}

Continuous f ↔ ∀ (b : β), Continuous fun x => f (x, b)


/-- Restriction of a semigroup hom to a subsemigroup of the codomain. -/
@[to_additive (attr := simps)
  "Restriction of an `AddSemigroup` hom to an `AddSubsemigroup` of the codomain."]
def codRestrict [SetLike σ N] [MulMemClass σ N] (f : M →ₙ* N) (S : σ) (h : ∀ x, f x ∈ S) :
    M →ₙ* S

{M : Type u_1}
{N : Type u_2}
{σ : Type u_4}
[Add M]
[Add N]
[SetLike σ N]
[AddMemClass σ N]
(f : AddHom M N)
(S : σ)
(h : ∀ (x : M), f x ∈ S)
(n : M)


@[simp]
theorem app_add (X : C) (α β : F ⟶ G) : (α + β).app X = α.app X + β.app X

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_4, u_1} C]
[CategoryTheory.Category.{u_3, u_2} D]
[CategoryTheory.Preadditive D]
{F G : CategoryTheory.Functor C D}
(X : C)
(α β : F ⟶ G)


theorem forall_pow_eq_one_iff (i : ℕ) : (∀ x : Kˣ, x ^ i = 1) ↔ q - 1 ∣ i

(K : Type u_1)
[Field K]
[Fintype K]
(i : ℕ)


/-- Eisenstein series are MDifferentiable (i.e. holomorphic functions from `ℍ → ℂ`). -/
theorem eisensteinSeries_SIF_MDifferentiable {k : ℤ} {N : ℕ} (hk : 3 ≤ k) (a : Fin 2 → ZMod N) :
    MDifferentiable 𝓘(ℂ) 𝓘(ℂ) (eisensteinSeries_SIF a k)

MDifferentiable 𝓘(ℂ, ℂ) 𝓘(ℂ, ℂ) ⇑(EisensteinSeries.eisensteinSeries_SIF a k)


private theorem colimitModule.add_smul (r s : R) (x : (M F)) : (r + s) • x = r • x + s • x

{R : Type u}
[Ring R]
{J : Type v}
[CategoryTheory.SmallCategory J]
[CategoryTheory.IsFiltered J]
(F : J ⥤ ModuleCatMax R)
(r s : R)
(x : ↑(ModuleCat.FilteredColimits.M F))


@[simp]
theorem comp_apply (f : sInfHom β γ) (g : sInfHom α β) (a : α) : (f.comp g) a = f (g a)

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[InfSet α]
[InfSet β]
[InfSet γ]
(f : sInfHom β γ)
(g : sInfHom α β)
(a : α)


protected theorem mem_interior {s : Set (Filter α)} {l : Filter α} :
    l ∈ interior s ↔ ∃ t ∈ l, Iic (𝓟 t) ⊆ s

{α : Type u_2}
{s : Set (Filter α)}
{l : Filter α}

l ∈ interior s ↔ ∃ t ∈ l, Set.Iic (𝓟 t) ⊆ s


@[simp]
theorem cancel_right {g₁ g₂ : TopHom β γ} {f : TopHom α β} (hf : Surjective f) :
    g₁.comp f = g₂.comp f ↔ g₁ = g₂

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[Top α]
[Top β]
[Top γ]
{g₁ g₂ : TopHom β γ}
{f : TopHom α β}
(hf : Function.Surjective ⇑f)


@[simp, norm_cast]
theorem coe_filterMap : (s.filterMap f f_inj : Set β) = {b | ∃ a ∈ s, f a = some b}

{f_inj : ∀ (a a' : α), ∀ b ∈ f a, b ∈ f a' → a = a'}

↑(Finset.filterMap f s f_inj) = {b | ∃ a ∈ s, f a = some b}


theorem pb_inv [Invertible (2 : R)] : PB l R * Matrix.fromBlocks 1 0 0 (⅟ (PD l R)) = 1

(l : Type u_4)
(R : Type u₂)
[DecidableEq l]
[CommRing R]
[Fintype l]
[Invertible 2]

LieAlgebra.Orthogonal.PB l R * Matrix.fromBlocks 1 0 0 ⅟(LieAlgebra.Orthogonal.PD l R) = 1


/-- An auxiliary equivalence useful in the proofs about
`FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a
`Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a
`Finset (Fin n)`.

The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to
`(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems
with non-definitional equalities. -/
@[simps]
def changeOriginIndexEquiv :
    (Σ k l : ℕ, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Σ n : ℕ, Finset (Fin n)

(FormalMultilinearSeries.changeOriginIndexEquiv s).snd = ↑s.snd.snd


/-- Cauchy's **Mean Value Theorem**, `HasDerivAt` version. -/
theorem exists_ratio_hasDerivAt_eq_ratio_slope :
    ∃ c ∈ Ioo a b, (g b - g a) * f' c = (f b - f a) * g' c

(hff' : ∀ x ∈ Set.Ioo a b, HasDerivAt f (f' x) x)

(hgg' : ∀ x ∈ Set.Ioo a b, HasDerivAt g (g' x) x)

∃ c ∈ Set.Ioo a b, (g b - g a) * f' c = (f b - f a) * g' c


theorem Poly.mul_denote (ctx : Context) (p₁ p₂ : Poly) : (p₁.mul p₂).denote ctx = p₁.denote ctx * p₂.denote ctx

(ctx : Nat.Linear.Context)
(p₁ p₂ : Nat.SOM.Poly)

Nat.SOM.Poly.denote ctx (p₁.mul p₂) = Nat.SOM.Poly.denote ctx p₁ * Nat.SOM.Poly.denote ctx p₂


@[simp]
theorem transpose_neg [Neg α] (M : Matrix m n α) : (-M)ᵀ = -Mᵀ

{m : Type u_2}
{n : Type u_3}
{α : Type v}
[Neg α]
(M : Matrix m n α)


theorem geom_series_mul_shift (x : R) (h : ‖x‖ < 1) :
    x * ∑' i : ℕ, x ^ i = ∑' i : ℕ, x ^ (i + 1)

{R : Type u_4}
[NormedRing R]
[CompleteSpace R]
(x : R)
(h : ‖x‖ < 1)


theorem transitive_lt [Preorder α] : Transitive (@LT.lt α _)


@[continuity]
theorem continuous_setToFun (hT : DominatedFinMeasAdditive μ T C) :
    Continuous fun f : α →₁[μ] E => setToFun μ T hT f

(hT : MeasureTheory.DominatedFinMeasAdditive μ T C)

Continuous fun f => MeasureTheory.setToFun μ T hT ↑↑f


theorem disjoint_isReal_isComplex :
    Disjoint {(w : InfinitePlace K) | IsReal w} {(w : InfinitePlace K) | IsComplex w}

Disjoint {w | w.IsReal} {w | w.IsComplex}


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


@[to_additive]
theorem inv_mul_lt_iff_lt_mul' : c⁻¹ * a < b ↔ a < b * c

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


/-- If a primitive `f` satisfies `f.IsEisensteinAt 𝓟`, where `𝓟.IsPrime`,
then `f` is irreducible. -/
theorem irreducible (hprime : 𝓟.IsPrime) (hu : f.IsPrimitive) (hfd0 : 0 < f.natDegree) :
    Irreducible f

{R : Type u}
[CommRing R]
[IsDomain R]
{𝓟 : Ideal R}
{f : R[X]}
(hf : f.IsEisensteinAt 𝓟)
(hprime : 𝓟.IsPrime)
(hu : f.IsPrimitive)
(hfd0 : 0 < f.natDegree)


lemma baseChange_pow (f : Module.End R M) (n : ℕ) :
    (f ^ n).baseChange A = f.baseChange A ^ n

(R : Type u_1)
(A : Type u_2)
(M : Type u_4)
[CommSemiring R]
[Semiring A]
[Algebra R A]
[AddCommMonoid M]
[Module R M]
(f : Module.End R M)
(n : ℕ)

LinearMap.baseChange A (f ^ n) = LinearMap.baseChange A f ^ n


theorem disjoint_toFinset_iff_disjoint : _root_.Disjoint l.toFinset l'.toFinset ↔ l.Disjoint l'

{α : Type u_1}
[DecidableEq α]
{l l' : List α}


theorem le_lift_iff {a : Ordinal.{u}} {b : Ordinal.{max u v}} :
    b ≤ lift.{v,u} a ↔ ∃ a', lift.{v,u} a' = b ∧ a' ≤ a

b ≤ Ordinal.lift.{v, u} a ↔ ∃ a', Ordinal.lift.{v, u} a' = b ∧ a' ≤ a


@[to_additive]
nonrec theorem SmoothWithinAt.div_const (hf : SmoothWithinAt I' I f s x) :
  SmoothWithinAt I' I (fun x ↦ f x / c) s x

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

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


/-- The shift functor `Triangle C ⥤ Triangle C` by `n : ℤ` sends a triangle
to the triangle obtained by shifting the objects by `n` in `C` and by
multiplying the three morphisms by `(-1)^n`. -/
@[simps]
noncomputable def Triangle.shiftFunctor (n : ℤ) : Triangle C ⥤ Triangle C

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

∀ {X Y : CategoryTheory.Pretriangulated.Triangle C} (f : X ⟶ Y),
  ((CategoryTheory.Pretriangulated.Triangle.shiftFunctor C n).map f).hom₁ = (CategoryTheory.shiftFunctor C n).map f.hom₁


theorem tr_respects_aux {q v T k} {S : ∀ k, List (Γ k)}
    (hT : ∀ k, ListBlank.map (proj k) T = ListBlank.mk ((S k).map some).reverse) (o : StAct₂ k)
    (IH : ∀ {v : σ} {S : ∀ k : K, List (Γ k)} {T : ListBlank (∀ k, Option (Γ k))},
      (∀ k, ListBlank.map (proj k) T = ListBlank.mk ((S k).map some).reverse) →
      ∃ b, TrCfg (TM2.stepAux q v S) b ∧
        Reaches (TM1.step (tr M)) (TM1.stepAux (trNormal q) v (Tape.mk' ∅ (addBottom T))) b) :
    ∃ b, TrCfg (TM2.stepAux (stRun o q) v S) b ∧ Reaches (TM1.step (tr M))
      (TM1.stepAux (trNormal (stRun o q)) v (Tape.mk' ∅ (addBottom T))) b

{T : Turing.ListBlank ((i : K) → Option (Γ i))}

(hT : ∀ (k : K), Turing.ListBlank.map (Turing.proj k) T = Turing.ListBlank.mk (List.map some (S k)).reverse)

(IH :
  ∀ {v : σ} {S : (k : K) → List (Γ k)} {T : Turing.ListBlank ((k : K) → Option (Γ k))},
    (∀ (k : K), Turing.ListBlank.map (Turing.proj k) T = Turing.ListBlank.mk (List.map some (S k)).reverse) →
      ∃ b,
        Turing.TM2to1.TrCfg (Turing.TM2.stepAux q v S) b ∧
          Turing.Reaches (Turing.TM1.step (Turing.TM2to1.tr M))
            (Turing.TM1.stepAux (Turing.TM2to1.trNormal q) v (Turing.Tape.mk' ∅ (Turing.TM2to1.addBottom T))) b)

∃ b,
  Turing.TM2to1.TrCfg (Turing.TM2.stepAux (Turing.TM2to1.stRun o q) v S) b ∧
    Turing.Reaches (Turing.TM1.step (Turing.TM2to1.tr M))
      (Turing.TM1.stepAux (Turing.TM2to1.trNormal (Turing.TM2to1.stRun o q)) v
        (Turing.Tape.mk' ∅ (Turing.TM2to1.addBottom T)))
      b


/-- A continuous linear operator is self-adjoint iff it is equal to its adjoint. -/
theorem isSelfAdjoint_iff' {A : E →L[𝕜] E} : IsSelfAdjoint A ↔ ContinuousLinearMap.adjoint A = A

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[CompleteSpace E]
{A : E →L[𝕜] E}


theorem einfsep_lt_top :
    s.einfsep < ∞ ↔ ∃ x ∈ s, ∃ y ∈ s, x ≠ y ∧ edist x y < ∞

s.einfsep < ⊤ ↔ ∃ x ∈ s, ∃ y ∈ s, x ≠ y ∧ edist x y < ⊤


@[simp]
theorem sSup_apply [CompleteLattice β] (s : Set (α →o β)) (x : α) :
    sSup s x = ⨆ f ∈ s, (f : _) x

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[CompleteLattice β]
(s : Set (α →o β))
(x : α)


theorem toSignedMeasure_apply_measurable {μ : Measure α} [IsFiniteMeasure μ] {i : Set α}
    (hi : MeasurableSet i) : μ.toSignedMeasure i = (μ i).toReal

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[MeasureTheory.IsFiniteMeasure μ]
{i : Set α}
(hi : MeasurableSet i)


/-- An iso `α ≃* β` can equivalently be viewed as an iso `αᵐᵒᵖ ≃* βᵐᵒᵖ`. -/
@[to_additive (attr := simps)
  "An iso `α ≃+ β` can equivalently be viewed as an iso `αᵃᵒᵖ ≃+ βᵃᵒᵖ`."]
def MulEquiv.op {α β} [Mul α] [Mul β] : α ≃* β ≃ (αᵐᵒᵖ ≃* βᵐᵒᵖ)

{α : Type u_2}
{β : Type u_3}
[Add α]
[Add β]
(f : αᵃᵒᵖ ≃+ βᵃᵒᵖ)

∀ (a : α), (AddEquiv.op.symm f) a = (AddOpposite.unop ∘ ⇑f ∘ AddOpposite.op) a


@[to_additive (attr := measurability)]
theorem Finset.measurable_prod (s : Finset ι) (hf : ∀ i ∈ s, Measurable (f i)) :
    Measurable fun a => ∏ i ∈ s, f i a

{M : Type u_2}
{ι : Type u_3}
{α : Type u_4}
[CommMonoid M]
[MeasurableSpace M]
[MeasurableMul₂ M]
{m : MeasurableSpace α}
{f : ι → α → M}
(s : Finset ι)
(hf : ∀ i ∈ s, Measurable (f i))


/-- The leading coefficient of a product of polynomials is equal to
the product of the leading coefficients.

See `Polynomial.leadingCoeff_prod'` (with a `'`) for a version for commutative semirings,
where additionally, the product of the leading coefficients must be nonzero.
-/
theorem leadingCoeff_prod : (∏ i ∈ s, f i).leadingCoeff = ∏ i ∈ s, (f i).leadingCoeff

{R : Type u}
{ι : Type w}
(s : Finset ι)
[CommSemiring R]
[NoZeroDivisors R]
(f : ι → R[X])


@[simp] lemma Ici_inj : Ici a = Ici b ↔ a = b

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


theorem funMap_equiv_unify {n : ℕ} (F : L.Functions n) (x : Fin n → Σˣ f) (i : ι)
    (hi : i ∈ upperBounds (range (Sigma.fst ∘ x))) :
    funMap F x ≈ .mk f _ (funMap F (unify f x i hi))

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

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

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

FirstOrder.Language.Structure.funMap F x ≈
  FirstOrder.Language.Structure.Sigma.mk f i
    (FirstOrder.Language.Structure.funMap F (FirstOrder.Language.DirectLimit.unify f x i hi))


theorem memberSubfamily_union (a : α) (𝒜 ℬ : Finset (Finset α)) :
    (𝒜 ∪ ℬ).memberSubfamily a = 𝒜.memberSubfamily a ∪ ℬ.memberSubfamily a

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

Finset.memberSubfamily a (𝒜 ∪ ℬ) = Finset.memberSubfamily a 𝒜 ∪ Finset.memberSubfamily a ℬ


theorem Perm.subset {l₁ l₂ : List α} (p : l₁ ~ l₂) : l₁ ⊆ l₂

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


/-- The inverse of a bijective equivariant map is equivariant. -/
@[simps]
def inverse (f : X →[M] Y₁) (g : Y₁ → X)
    (h₁ : Function.LeftInverse g f) (h₂ : Function.RightInverse g f) : Y₁ →[M] X

{M : Type u_2}
{X : Type u_5}
[SMul M X]
{Y₁ : Type u_8}
[SMul M Y₁]
(f : X →ₑ[id] Y₁)
(g : Y₁ → X)
(h₁ : Function.LeftInverse g ⇑f)
(h₂ : Function.RightInverse g ⇑f)


theorem totallyBounded_iff_subset {s : Set α} :
    TotallyBounded s ↔
      ∀ d ∈ 𝓤 α, ∃ t, t ⊆ s ∧ Set.Finite t ∧ s ⊆ ⋃ y ∈ t, { x | (x, y) ∈ d }

{α : Type u}
[uniformSpace : UniformSpace α]
{s : Set α}

TotallyBounded s ↔ ∀ d ∈ 𝓤 α, ∃ t ⊆ s, t.Finite ∧ s ⊆ ⋃ y ∈ t, {x | (x, y) ∈ d}


protected theorem Pairwise.eq (hs : s.Pairwise r) (ha : a ∈ s) (hb : b ∈ s) (h : ¬r a b) : a = b

{α : Type u_1}
{r : α → α → Prop}
{s : Set α}
{a b : α}
(hs : s.Pairwise r)
(ha : a ∈ s)
(hb : b ∈ s)
(h : ¬r a b)


theorem coeff_toPowerSeries_symm {f : PowerSeries R} {n : ℕ} :
    (HahnSeries.toPowerSeries.symm f).coeff n = PowerSeries.coeff R n f

{R : Type u_2}
[Semiring R]
{f : PowerSeries R}
{n : ℕ}

(HahnSeries.toPowerSeries.symm f).coeff n = (PowerSeries.coeff R n) f


theorem toPerm_involutive {f : α → α} (h : Involutive f) : Involutive (h.toPerm f)

{α : Sort u_1}
{f : α → α}
(h : Function.Involutive f)

Function.Involutive ⇑(Function.Involutive.toPerm f h)


theorem toNat_add {m n : ℕ∞} (hm : m ≠ ⊤) (hn : n ≠ ⊤) : toNat (m + n) = toNat m + toNat n


theorem coe_mulHom_injective : Injective fun f : α →ₙ+* β => (f : α →ₙ* β)

{α : Type u_2}
{β : Type u_3}
[NonUnitalNonAssocSemiring α]
[NonUnitalNonAssocSemiring β]


@[simp]
theorem bit_eq_zero {n : ℕ} {b : Bool} : n.bit b = 0 ↔ n = 0 ∧ b = false


/-- `Real.sinh` as an `Equiv`. -/
@[simps]
def sinhEquiv : ℝ ≃ ℝ


theorem disjoint_comm {s t : Multiset α} : Disjoint s t ↔ Disjoint t s


theorem hasGradientWithinAt_congr_set {s t : Set F} (h : s =ᶠ[𝓝 x] t) :
    HasGradientWithinAt f f' s x ↔ HasGradientWithinAt f f' t x

{𝕜 : Type u_1}
{F : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup F]
[InnerProductSpace 𝕜 F]
[CompleteSpace F]
{f : F → 𝕜}
{f' x : F}
{s t : Set F}
(h : s =ᶠ[𝓝 x] t)


/-- For functions on finite sets, they are bijections iff they map universes into universes. -/
@[simp]
theorem bijective_iff_map_univ_eq_univ (f : α → β) :
    f.Bijective ↔ map f (Finset.univ : Finset α).val = univ.val

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

Function.Bijective f ↔ Multiset.map f Finset.univ.val = Finset.univ.val


theorem cast_succ' [AddMonoidWithOne α] (n) : (succ' n : α) = n + 1

{α : Type u_1}
[AddMonoidWithOne α]
(n : Num)


theorem mono_lie (h₁ : I ≤ J) (h₂ : N ≤ N') : ⁅I, N⁆ ≤ ⁅J, N'⁆

{R : Type u}
{L : Type v}
{M : Type w}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
{N N' : LieSubmodule R L M}
{I J : LieIdeal R L}
(h₁ : I ≤ J)
(h₂ : N ≤ N')


@[simp]
lemma inclDesc_inv_app (i : I) (X : C i) : (inclDesc F i).inv.app X = 𝟙 ((F i).obj X)

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

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

(CategoryTheory.Sigma.inclDesc F i).inv.app X = CategoryTheory.CategoryStruct.id ((F i).obj X)


theorem exists_T_pow (f : R[T;T⁻¹]) : ∃ (n : ℕ) (f' : R[X]), toLaurent f' = f * T n

{R : Type u_1}
[Semiring R]
(f : R[T;T⁻¹])

∃ n f', Polynomial.toLaurent f' = f * LaurentPolynomial.T ↑n


/-- The value of the quadratic character at `-1` -/
theorem quadraticChar_neg_one [DecidableEq F] (hF : ringChar F ≠ 2) :
    quadraticChar F (-1) = χ₄ (Fintype.card F)

{F : Type u_1}
[Field F]
[Fintype F]
[DecidableEq F]
(hF : ringChar F ≠ 2)

(quadraticChar F) (-1) = ZMod.χ₄ ↑(Fintype.card F)


@[simp]
theorem walkingParallelPairOpEquiv_unitIso_one :
    walkingParallelPairOpEquiv.unitIso.app one = Iso.refl one

CategoryTheory.Limits.walkingParallelPairOpEquiv.unitIso.app CategoryTheory.Limits.WalkingParallelPair.one =
  CategoryTheory.Iso.refl CategoryTheory.Limits.WalkingParallelPair.one


@[to_additive] lemma isUnit_iff_eq_one [Unique Mˣ] {x : M} : IsUnit x ↔ x = 1

{M : Type u_1}
[AddMonoid M]
[Unique (AddUnits M)]
{x : M}


/-- A variant of `eq_mul_inv_iff_mul_eq₀` that moves the nonzero hypothesis to another variable. -/
lemma mul_eq_of_eq_mul_inv₀ (ha : a ≠ 0) (h : a = c * b⁻¹) : a * b = c

{G₀ : Type u_3}
[GroupWithZero G₀]
{a b c : G₀}
(ha : a ≠ 0)
(h : a = c * b⁻¹)


@[measurability, fun_prop]
theorem Measurable.coe_nnreal_ennreal {f : α → ℝ≥0} (hf : Measurable f) :
    Measurable fun x => (f x : ℝ≥0∞)

{α : Type u_1}
[MeasurableSpace α]
{f : α → ℝ≥0}
(hf : Measurable f)


theorem lt_div_iff {a b r : ℝ≥0} (hr : r ≠ 0) : a < b / r ↔ a * r < b


@[to_additive]
theorem relindex_inf_ne_zero (hH : H.relindex L ≠ 0) (hK : K.relindex L ≠ 0) :
    (H ⊓ K).relindex L ≠ 0

{G : Type u_1}
[Group G]
{H K L : Subgroup G}
(hH : H.relindex L ≠ 0)
(hK : K.relindex L ≠ 0)


@[to_additive (attr := simp)]
theorem bddAbove_inv : BddAbove s⁻¹ ↔ BddBelow s

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

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


@[trans]
protected theorem trans : a ≡ b [MOD n] → b ≡ c [MOD n] → a ≡ c [MOD n]


theorem leval_eq_smeval.linearMap {R : Type*} [Semiring R] (r : R) :
    leval r = smeval.linearMap R r

Polynomial.leval r = Polynomial.smeval.linearMap R r


theorem reindex_relationsSet :
    (M.reindex e).relationsSet =
    FreeGroup.freeGroupCongr e '' M.relationsSet

{B : Type u_1}
{B' : Type u_2}
(M : CoxeterMatrix B)
(e : B ≃ B')

(CoxeterMatrix.reindex e M).relationsSet = ⇑(FreeGroup.freeGroupCongr e) '' M.relationsSet


theorem subset_convexJoin_left (h : t.Nonempty) : s ⊆ convexJoin 𝕜 s t

{𝕜 : Type u_2}
{E : Type u_3}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[Module 𝕜 E]
{s t : Set E}
(h : t.Nonempty)


/-- In a locally compact space, any integrable function can be approximated by compactly supported
continuous functions, version in terms of `∫⁻`. -/
theorem Integrable.exists_hasCompactSupport_lintegral_sub_le
    [WeaklyLocallyCompactSpace α] [μ.Regular]
    {f : α → E} (hf : Integrable f μ) {ε : ℝ≥0∞} (hε : ε ≠ 0) :
    ∃ g : α → E,
      HasCompactSupport g ∧ (∫⁻ x, ‖f x - g x‖₊ ∂μ) ≤ ε ∧ Continuous g ∧ Integrable g μ

{α : Type u_1}
[TopologicalSpace α]
[NormalSpace α]
[R1Space α]
[MeasurableSpace α]
[BorelSpace α]
{E : Type u_2}
[NormedAddCommGroup E]
{μ : MeasureTheory.Measure α}
[NormedSpace ℝ E]
[WeaklyLocallyCompactSpace α]
[μ.Regular]
{f : α → E}
(hf : MeasureTheory.Integrable f μ)
{ε : ℝ≥0∞}
(hε : ε ≠ 0)

∃ g, HasCompactSupport g ∧ ∫⁻ (x : α), ↑‖f x - g x‖₊ ∂μ ≤ ε ∧ Continuous g ∧ MeasureTheory.Integrable g μ


theorem Multiset.untrop_sum [LinearOrder R] [OrderTop R] (s : Multiset (Tropical R)) :
    untrop s.sum = Multiset.inf (s.map untrop)

{R : Type u_1}
[LinearOrder R]
[OrderTop R]
(s : Multiset (Tropical R))

Tropical.untrop s.sum = (Multiset.map Tropical.untrop s).inf


/-- `WeakDual.CharacterSpace.compContinuousMap` sends the identity to the identity. -/
@[simp]
theorem compContinuousMap_id :
    compContinuousMap (StarAlgHom.id 𝕜 A) = ContinuousMap.id (characterSpace 𝕜 A)

(A : Type u_1)
{𝕜 : Type u_4}
[NontriviallyNormedField 𝕜]
[NormedRing A]
[NormedAlgebra 𝕜 A]
[CompleteSpace A]
[StarRing A]

WeakDual.CharacterSpace.compContinuousMap (StarAlgHom.id 𝕜 A) = ContinuousMap.id ↑(WeakDual.characterSpace 𝕜 A)


theorem dvd_of_mem_primeFactorsList {n p : ℕ} (h : p ∈ n.primeFactorsList) : p ∣ n


theorem convexBodyLT'_convex : Convex ℝ (convexBodyLT' K f w₀)

(f : NumberField.InfinitePlace K → NNReal)

Convex ℝ (NumberField.mixedEmbedding.convexBodyLT' K f w₀)


@[simp]
theorem coeff_natCast_ite : (Nat.cast m : R[X]).coeff n = ite (n = 0) m 0

(↑m).coeff n = ↑(if n = 0 then m else 0)


@[simp]
theorem inftyValuation_apply {x : RatFunc Fq} : inftyValuation Fq x = inftyValuationDef Fq x

(Fq : Type)
[Field Fq]
[DecidableEq (RatFunc Fq)]
{x : RatFunc Fq}

(FunctionField.inftyValuation Fq) x = FunctionField.inftyValuationDef Fq x


@[simp]
theorem symm_apply_apply (e : A ≃⋆+* B) : ∀ x, e.symm (e x) = x

{A : Type u_1}
{B : Type u_2}
[Add A]
[Add B]
[Mul A]
[Mul B]
[Star A]
[Star B]
(e : A ≃⋆+* B)
(x : A)


lemma IsRatCondKernelCDF.mono (hf : IsRatCondKernelCDF f κ ν) (a : α) :
    ∀ᵐ b ∂(ν a), Monotone (f (a, b))

{κ : ProbabilityTheory.Kernel α (β × ℝ)}

{f : α × β → ℚ → ℝ}

(hf : ProbabilityTheory.IsRatCondKernelCDF f κ ν)


@[simp]
theorem inr_neg [AddGroup R] [Neg A] (m : A) : (↑(-m) : Unitization R A) = -m

(R : Type u_3)
{A : Type u_4}
[AddGroup R]
[Neg A]
(m : A)


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

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


theorem sum_apply_of_countable [Countable ι] (f : ι → Measure α) (s : Set α) :
    sum f s = ∑' i, f i s

{α : Type u_1}
{ι : Type u_5}
{m0 : MeasurableSpace α}
[Countable ι]
(f : ι → MeasureTheory.Measure α)
(s : Set α)

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


theorem unbounded_le_Ioi [SemilatticeSup α] [NoMaxOrder α] (a : α) :
    Unbounded (· ≤ ·) (Ioi a)

{α : Type u_1}
[SemilatticeSup α]
[NoMaxOrder α]
(a : α)

Set.Unbounded (fun x x_1 => x ≤ x_1) (Set.Ioi a)


/-- The isomorphism `eA.functor ≅ F ⋙ e'.inverse` deduced from the
unit isomorphism of `e'` and the isomorphism `hF : eA.functor ⋙ e'.functor ≅ F`. -/
@[simps!]
def υ : eA.functor ≅ F ⋙ e'.inverse

{A : Type u_1}
{A' : Type u_2}
{B' : Type u_4}
[CategoryTheory.Category.{u_5, u_1} A]
[CategoryTheory.Category.{u_6, u_2} A']
[CategoryTheory.Category.{u_7, u_4} B']
{eA : A ≌ A'}
{e' : A' ≌ B'}
{F : A ⥤ B'}
(hF : eA.functor ⋙ e'.functor ≅ F)
(X : A)

(AlgebraicTopology.DoldKan.Compatibility.υ hF).inv.app X =
  e'.inverse.map (hF.inv.app X) ≫ e'.unitIso.inv.app (eA.functor.obj X)


/-- The addition of two affine points in `W` on a sloped line lies in `W`. -/
lemma equation_add {x₁ x₂ y₁ y₂ : F} (h₁ : W.Equation x₁ y₁) (h₂ : W.Equation x₂ y₂)
    (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
    W.Equation (W.addX x₁ x₂ <| W.slope x₁ x₂ y₁ y₂) (W.addY x₁ x₂ y₁ <| W.slope x₁ x₂ y₁ y₂)

{F : Type u}
[Field F]
{W : WeierstrassCurve.Affine F}
{x₁ x₂ y₁ y₂ : F}
(h₁ : W.Equation x₁ y₁)
(h₂ : W.Equation x₂ y₂)
(hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂)

W.Equation (W.addX x₁ x₂ (W.slope x₁ x₂ y₁ y₂)) (W.addY x₁ x₂ y₁ (W.slope x₁ x₂ y₁ y₂))


theorem contDiff_iff_contDiffAt : ContDiff 𝕜 n f ↔ ∀ x, ContDiffAt 𝕜 n f x

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

ContDiff 𝕜 n f ↔ ∀ (x : E), ContDiffAt 𝕜 n f x


/-- The anti-equivalence between simplicial objects and cosimplicial objects. -/
@[simps!]
def simplicialCosimplicialEquiv : (SimplicialObject C)ᵒᵖ ≌ CosimplicialObject Cᵒᵖ

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

∀ {X Y : SimplexCategory ⥤ Cᵒᵖ} (η : X ⟶ Y),
  (CategoryTheory.simplicialCosimplicialEquiv C).inverse.map η = (CategoryTheory.NatTrans.leftOp η).op


{R : Type x}
[Monoid R]
[HasDistribNeg R]


@[instance]
theorem comap_fst_neBot [Nonempty β] {f : Filter α} [NeBot f] :
    (f.comap (Prod.fst : α × β → α)).NeBot

{α : Type u}
{β : Type v}
[Nonempty β]
{f : Filter α}
[f.NeBot]


theorem algebraMap_image : algebraMap R S '' spectrum R a = spectrum S a

{R : Type u_3}
{S : Type u_4}
{A : Type u_5}
[Semifield R]
[Semifield S]
[Ring A]
[Algebra R S]
[Algebra R A]
[Algebra S A]
{a : A}
{f : S → R}
[IsScalarTower R S A]
(h : SpectrumRestricts a f)

⇑(algebraMap R S) '' spectrum R a = spectrum S a


/-- If `y` is a conjugate of `x` over a field `K`, then it is a conjugate over a subring `R`. -/
theorem aeval_of_isScalarTower (R : Type*) {K T U : Type*} [CommRing R] [Field K] [CommRing T]
    [Algebra R K] [Algebra K T] [Algebra R T] [IsScalarTower R K T] [CommSemiring U] [Algebra K U]
    [Algebra R U] [IsScalarTower R K U] (x : T) (y : U)
    (hy : Polynomial.aeval y (minpoly K x) = 0) : Polynomial.aeval y (minpoly R x) = 0

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


lemma llr_tilted_right [SigmaFinite μ] [SigmaFinite ν]
    (hμν : μ ≪ ν) (hf : Integrable (fun x ↦ exp (f x)) ν) :
    (llr μ (ν.tilted f)) =ᵐ[μ] fun x ↦ - f x + log (∫ z, exp (f z) ∂ν) + llr μ ν x

(hf : MeasureTheory.Integrable (fun x => rexp (f x)) ν)

MeasureTheory.llr μ (ν.tilted f) =ᵐ[μ] fun x => -f x + Real.log (∫ (z : α), rexp (f z) ∂ν) + MeasureTheory.llr μ ν x


theorem connectedComponentMk_eq_of_adj {v w : V} (a : G.Adj v w) :
    G.connectedComponentMk v = G.connectedComponentMk w

{V : Type u}
{G : SimpleGraph V}
{v w : V}
(a : G.Adj v w)


/-- Definition of a fiber functor from a Galois category. Lenstra, Def 3.1, (G4)-(G6) -/
class FiberFunctor {C : Type u₁} [Category.{u₂, u₁} C] [PreGaloisCategory C]
    (F : C ⥤ FintypeCat.{w}) where
  /-- `F` preserves terminal objects (G4). -/
  preservesTerminalObjects : PreservesLimitsOfShape (CategoryTheory.Discrete PEmpty.{1}) F := by
    infer_instance
  /-- `F` preserves pullbacks (G4). -/
  preservesPullbacks : PreservesLimitsOfShape WalkingCospan F := by infer_instance
  /-- `F` preserves finite coproducts (G5). -/
  preservesFiniteCoproducts : PreservesFiniteCoproducts F := by infer_instance
  /-- `F` preserves epimorphisms (G5). -/
  preservesEpis : Functor.PreservesEpimorphisms F := by infer_instance
  /-- `F` preserves quotients by finite groups (G5). -/
  preservesQuotientsByFiniteGroups (G : Type u₂) [Group G] [Finite G] :
    PreservesColimitsOfShape (SingleObj G) F := by infer_instance
  /-- `F` reflects isomorphisms (G6). -/
  reflectsIsos : F.ReflectsIsomorphisms := by infer_instance

{F : CategoryTheory.Functor C FintypeCat}

[self : CategoryTheory.PreGaloisCategory.FiberFunctor F]


theorem divOf_add_modOf (x : k[G]) (g : G) :
    of' k G g * (x /ᵒᶠ g) + x %ᵒᶠ g = x

{k : Type u_1}
{G : Type u_2}
[Semiring k]
[AddCancelCommMonoid G]
(x : AddMonoidAlgebra k G)
(g : G)

AddMonoidAlgebra.of' k G g * x.divOf g + x.modOf g = x


theorem rcons_inj {i} : Function.Injective (rcons : Pair M i → Word M)

{ι : Type u_1}
{M : ι → Type u_2}
[(i : ι) → Monoid (M i)]
[(i : ι) → DecidableEq (M i)]
{i : ι}


@[to_additive]
theorem pi_top (I : Set η) : (pi I fun i => (⊤ : Subgroup (f i))) = ⊤

{η : Type u_7}
{f : η → Type u_8}
[(i : η) → Group (f i)]
(I : Set η)


@[simp]
theorem not_duplicate_nil (x : α) : ¬x ∈+ []


@[simp]
theorem finAddFlip_apply_castAdd (k : Fin m) (n : ℕ) :
    finAddFlip (Fin.castAdd n k) = Fin.natAdd n k


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


/-- The functor `Sigma.map` applied to the identity function is just the identity functor. -/
@[simps!]
def mapId : map C (id : I → I) ≅ 𝟭 (Σi, C i)

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

∀ (x : (i : I) × (fun i => C (id i)) i),
  (CategoryTheory.Sigma.mapId I C).hom.app x = CategoryTheory.CategoryStruct.id ⟨x.fst, x.snd⟩


/-- The data of a functorial factorization of any morphism in `C` as a morphism in `W₁`
followed by a morphism in `W₂`. -/
structure FunctorialFactorizationData where
  /-- the intermediate objects in the factorizations -/
  Z : Arrow C ⥤ C
  /-- the first morphism in the factorizations -/
  i : Arrow.leftFunc ⟶ Z
  /-- the second morphism in the factorizations -/
  p : Z ⟶ Arrow.rightFunc
  fac : i ≫ p = Arrow.leftToRight := by aesop_cat
  hi (f : Arrow C) : W₁ (i.app f)
  hp (f : Arrow C) : W₂ (p.app f)

{W₁ W₂ : CategoryTheory.MorphismProperty C}

(self : W₁.FunctorialFactorizationData W₂)


theorem degrees_map [CommSemiring S] (p : MvPolynomial σ R) (f : R →+* S) :
    (map f p).degrees ⊆ p.degrees

{R : Type u}
{S : Type v}
{σ : Type u_1}
[CommSemiring R]
[CommSemiring S]
(p : MvPolynomial σ R)
(f : R →+* S)

((MvPolynomial.map f) p).degrees ⊆ p.degrees


@[continuity, fun_prop]
theorem Continuous.div_const (hf : Continuous f) (y : G₀) : Continuous fun x => f x / y

{α : Type u_1}
{G₀ : Type u_3}
[DivInvMonoid G₀]
[TopologicalSpace G₀]
[ContinuousMul G₀]
{f : α → G₀}
[TopologicalSpace α]
(hf : Continuous f)
(y : G₀)


lemma ψ₂_sq : W.ψ₂ ^ 2 = C W.Ψ₂Sq + 4 * W.toAffine.polynomial

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

W.ψ₂ ^ 2 = Polynomial.C W.Ψ₂Sq + 4 * W.toAffine.polynomial


/-- All points are in `⊤`. -/
@[simp]
theorem mem_top (p : P) : p ∈ (⊤ : AffineSubspace k P)

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


theorem ncard_univ (α : Type*) : (univ : Set α).ncard = Nat.card α


theorem pow_strictMono : ∀ {n : ℕ}, n ≠ 0 → StrictMono fun x : ℝ≥0∞ => x ^ n


theorem iSup_sup_eq : ⨆ x, f x ⊔ g x = (⨆ x, f x) ⊔ ⨆ x, g x

{α : Type u_1}
{ι : Sort u_5}
[CompleteLattice α]
{f g : ι → α}