/-- The Grothendieck construction applied to a functor to `Type`
(thought of as a functor to `Cat` by realising a type as a discrete category)
is the same as the 'category of elements' construction.
-/
-- See porting note on grothendieckTypeToCatInverse.
-- We just want to turn off grothendieckTypeToCat_inverse_map_fiber_down_down,
-- so have to list the complement here for `@[simps]`.
@[simps! functor_obj_fst functor_obj_snd functor_map_coe inverse_obj_base inverse_obj_fiber_as
  inverse_map_base unitIso_hom_app_base unitIso_hom_app_fiber unitIso_inv_app_base
  unitIso_inv_app_fiber counitIso_hom_app_coe counitIso_inv_app_coe]
def grothendieckTypeToCat : Grothendieck (G ⋙ typeToCat) ≌ G.Elements

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
(G : CategoryTheory.Functor C (Type w))
(X : G.Elements)

↑((CategoryTheory.Grothendieck.grothendieckTypeToCat G).counitIso.hom.app X) = CategoryTheory.CategoryStruct.id X.fst


theorem isReduced_drop {ω : List B} (hω : cs.IsReduced ω) (j : ℕ) : cs.IsReduced (ω.drop j)

{B : Type u_1}
{W : Type u_2}
[Group W]
{M : CoxeterMatrix B}
(cs : CoxeterSystem M W)
{ω : List B}
(hω : cs.IsReduced ω)
(j : ℕ)


lemma Ioc_subset_uIoc' : Ioc a b ⊆ Ι b a

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


/-- Value of Riemann zeta at `-ℕ` in terms of `bernoulli'`. -/
theorem riemannZeta_neg_nat_eq_bernoulli' (k : ℕ) :
    riemannZeta (-k) = -bernoulli' (k + 1) / (k + 1)

riemannZeta (-↑k) = -↑(bernoulli' (k + 1)) / (↑k + 1)


theorem lt_nmul_iff₃ :
    d < a ⨳ b ⨳ c ↔
      ∃ a' < a, ∃ b' < b, ∃ c' < c,
        d ♯ a' ⨳ b' ⨳ c ♯ a' ⨳ b ⨳ c' ♯ a ⨳ b' ⨳ c' ≤
          a' ⨳ b ⨳ c ♯ a ⨳ b' ⨳ c ♯ a ⨳ b ⨳ c' ♯ a' ⨳ b' ⨳ c'


/-- If `a` commutes with both `b` and `c`, then it commutes with their product. -/
@[to_additive (attr := simp)
"If `a` commutes with both `b` and `c`, then it commutes with their sum."]
theorem mul_right (hab : Commute a b) (hac : Commute a c) : Commute a (b * c)

{S : Type u_3}
[Semigroup S]
{a b c : S}
(hab : Commute a b)
(hac : Commute a c)


@[simp]
theorem norm_iteratedFDeriv_zero : ‖iteratedFDeriv 𝕜 0 f x‖ = ‖f x‖

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


/-- One can reformulate smoothness as continuity and smoothness in any extended chart. -/
theorem contMDiff_iff :
    ContMDiff I I' n f ↔
      Continuous f ∧
        ∀ (x : M) (y : M'),
          ContDiffOn 𝕜 n (extChartAt I' y ∘ f ∘ (extChartAt I x).symm)
            ((extChartAt I x).target ∩
              (extChartAt I x).symm ⁻¹' (f ⁻¹' (extChartAt I' y).source))

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
[SmoothManifoldWithCorners I M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M' : Type u_7}
[TopologicalSpace M']
[ChartedSpace H' M']
[SmoothManifoldWithCorners I' M']
{f : M → M'}
{n : ℕ∞}

ContMDiff I I' n f ↔
  Continuous f ∧
    ∀ (x : M) (y : M'),
      ContDiffOn 𝕜 n (↑(extChartAt I' y) ∘ f ∘ ↑(extChartAt I x).symm)
        ((extChartAt I x).target ∩ ↑(extChartAt I x).symm ⁻¹' (f ⁻¹' (extChartAt I' y).source))


theorem union_left (hs : AEDisjoint μ s u) (ht : AEDisjoint μ t u) : AEDisjoint μ (s ∪ t) u

{α : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s t u : Set α}
(hs : MeasureTheory.AEDisjoint μ s u)
(ht : MeasureTheory.AEDisjoint μ t u)


/-- A map out of a sum type is continuous if its restriction to each summand is. -/
@[continuity, fun_prop]
theorem continuous_sigma {f : Sigma σ → X} (hf : ∀ i, Continuous fun a => f ⟨i, a⟩) :
    Continuous f

(hf : ∀ (i : ι), Continuous fun a => f ⟨i, a⟩)


theorem IsLocallyInjective_iff_openEmbedding {f : X → Y} :
    IsLocallyInjective f ↔ OpenEmbedding (toPullbackDiag f)

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
{f : X → Y}


@[simp] theorem liminf_bot (f : β → α) : liminf f ⊥ = ⊤

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


@[deprecated inferInstance (since := "2024-01-28")]
theorem T4Space.of_compactSpace_t2Space [CompactSpace X] [T2Space X] :
    T4Space X

{X : Type u_1}
[TopologicalSpace X]
[CompactSpace X]
[T2Space X]


@[to_additive]
theorem div_eq_div_mul_div (a b c : G) : a / b = c / b * (a / c)

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


theorem add_le_add_iff_right {a b : Ordinal} : ∀ n : ℕ, a + n ≤ b + n ↔ a ≤ b


/-- The identity transformation induces the identity endofunctor on the category of coalgebras. -/
-- Porting note: removed @[simps (config := { rhsMd := semireducible })] and replaced with
@[simps!]
def functorOfNatTransId : functorOfNatTrans (𝟙 F) ≅ 𝟭 _

(X : CategoryTheory.Endofunctor.Coalgebra F)

(CategoryTheory.Endofunctor.Coalgebra.functorOfNatTransId.hom.app X).f = CategoryTheory.CategoryStruct.id X.V


theorem card_eq_pow_finrank [Fintype V] : Fintype.card V = q ^ FiniteDimensional.finrank K V

{K : Type u_1}
{V : Type u_3}
[Fintype K]
[DivisionRing K]
[AddCommGroup V]
[Module K V]
[Fintype V]


@[simp] theorem mem_map {b : β} : b ∈ L.map f ↔ ∃ a ∈ L, f a = b

{α : Type u_1}
{β : Type u_2}
[CompleteLattice α]
[CompleteLattice β]
(f : CompleteLatticeHom α β)
{L : CompleteSublattice α}
{b : β}

b ∈ CompleteSublattice.map f L ↔ ∃ a ∈ L, f a = b


theorem odd_card_odd_degree_vertices_ne [Fintype V] [DecidableEq V] [DecidableRel G.Adj] (v : V)
    (h : Odd (G.degree v)) : Odd (univ.filter fun w => w ≠ v ∧ Odd (G.degree w)).card

{V : Type u}
(G : SimpleGraph V)
[Fintype V]
[DecidableEq V]
[DecidableRel G.Adj]
(v : V)
(h : Odd (G.degree v))

Odd (Finset.filter (fun w => w ≠ v ∧ Odd (G.degree w)) Finset.univ).card


@[simp]
theorem mem_iSup {x : Set α} {f : ι → Filter α} : x ∈ iSup f ↔ ∀ i, x ∈ f i

{α : Type u}
{ι : Sort x}
{x : Set α}
{f : ι → Filter α}


theorem le_or_le_of_add_eq_add_pred (h : a + c = b + d - 1) : b ≤ a ∨ d ≤ c


theorem Filter.EventuallyEq.fderiv_eq (h : f₁ =ᶠ[𝓝 x] f) : fderiv 𝕜 f₁ x = fderiv 𝕜 f x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f f₁ : E → F}
{x : E}
(h : f₁ =ᶠ[𝓝 x] f)


theorem mem_nilradical : x ∈ nilradical R ↔ IsNilpotent x


@[simp]
theorem comp_rangeSplitting (f : α → β) : f ∘ rangeSplitting f = Subtype.val


theorem erase_subset_erase (a : α) {s t : Finset α} (h : s ⊆ t) : erase s a ⊆ erase t a

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


theorem map_concat (f : α → β) (a : α) (l : List α) : map f (concat l a) = concat (map f l) (f a)

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

List.map f (l.concat a) = (List.map f l).concat (f a)


lemma isEquivalent_one_add_smoothingFn_one : (fun x => 1 + ε x) ~[atTop] (fun _ => (1 : ℝ))

(fun x => 1 + AkraBazziRecurrence.smoothingFn x) ~[Filter.atTop] fun x => 1


/-- The `Cocone` on `directLimitDiagram` corresponding to
the unbundled `directLimit` of modules.

In `directLimitIsColimit` we show that it is a colimit cocone. -/
@[simps]
def directLimitCocone : Cocone (directLimitDiagram G f)

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

(ModuleCat.directLimitCocone G f).ι.app i = Module.DirectLimit.of R ι G f i


theorem append_subset_of_subset_of_subset {l₁ l₂ l : List α} (l₁subl : l₁ ⊆ l) (l₂subl : l₂ ⊆ l) :
    l₁ ++ l₂ ⊆ l

{α : Type u}
{l₁ l₂ l : List α}
(l₁subl : l₁ ⊆ l)
(l₂subl : l₂ ⊆ l)


@[simp]
theorem ceil_eq_zero_iff : ⌈a⌉ = 0 ↔ a ∈ Ioc (-1 : α) 0

{α : Type u_2}
[LinearOrderedRing α]
[FloorRing α]
{a : α}


theorem IsClosed.mem_of_frequently_of_tendsto {f : α → X} {b : Filter α}
    (hs : IsClosed s) (h : ∃ᶠ x in b, f x ∈ s) (hf : Tendsto f b (𝓝 x)) : x ∈ s

{X : Type u}
{α : Type u_1}
{x : X}
{s : Set X}
[TopologicalSpace X]
{f : α → X}
{b : Filter α}
(hs : IsClosed s)
(h : ∃ᶠ (x : α) in b, f x ∈ s)
(hf : Filter.Tendsto f b (𝓝 x))


@[simp] lemma comap_ground_eq (N : Matroid β) (f : α → β) : (N.comap f).E = f ⁻¹' N.E

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


theorem toNNReal_ne_one : a.toNNReal ≠ 1 ↔ a ≠ 1


theorem disjoint_ball_closedBall_iff (hδ : 0 < δ) (hε : 0 ≤ ε) :
    Disjoint (ball x δ) (closedBall y ε) ↔ δ + ε ≤ dist x y

{E : Type u_2}
[SeminormedAddCommGroup E]
[NormedSpace ℝ E]
{x y : E}
{δ ε : ℝ}
(hδ : 0 < δ)
(hε : 0 ≤ ε)

Disjoint (Metric.ball x δ) (Metric.closedBall y ε) ↔ δ + ε ≤ dist x y


protected theorem eq_of_mul_eq_mul_left {m k n : Nat} (hn : 0 < n) (h : n * m = n * k) : m = k


theorem e_isoExt_hom : F.e ≫ (isoExt hF hF').hom = F'.e

{F F' : CategoryTheory.Limits.MonoFactorisation f}

(hF' : CategoryTheory.Limits.IsImage F')


theorem map_sInf {A : Set (Ideal R)} {f : F} (hf : Function.Surjective f) :
    (∀ J ∈ A, RingHom.ker f ≤ J) → map f (sInf A) = sInf (map f '' A)

{R : Type u_1}
{S : Type u_2}
{F : Type u_3}
[Ring R]
[Ring S]
[FunLike F R S]
[rc : RingHomClass F R S]
{A : Set (Ideal R)}
{f : F}
(hf : Function.Surjective ⇑f)

(∀ J ∈ A, RingHom.ker f ≤ J) → Ideal.map f (sInf A) = sInf (Ideal.map f '' A)


@[simp]
theorem monovaryOn_univ : MonovaryOn f g univ ↔ Monovary f g

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


theorem IsPushout.of_map_of_faithful [ReflectsColimit (span f g) F] [F.Faithful]
    (H : IsPushout (F.map f) (F.map g) (F.map h) (F.map i)) : IsPushout f g h i

[CategoryTheory.Limits.ReflectsColimit (CategoryTheory.Limits.span f g) F]

(H : CategoryTheory.IsPushout (F.map f) (F.map g) (F.map h) (F.map i))


@[simp]
lemma map₂_yonedaEquivFst {Y : C} (f : X ⟶ Y) (p : YonedaCollection F Y) :
    (YonedaCollection.map₂ F f p).yonedaEquivFst = A.map f.op p.yonedaEquivFst

{A : CategoryTheory.Functor Cᵒᵖ (Type v)}

{F : CategoryTheory.Functor (CategoryTheory.CostructuredArrow CategoryTheory.yoneda A)ᵒᵖ (Type v)}

(p : CategoryTheory.OverPresheafAux.YonedaCollection F Y)

(CategoryTheory.OverPresheafAux.YonedaCollection.map₂ F f p).yonedaEquivFst = A.map f.op p.yonedaEquivFst


theorem exp_half_dist (z w : ℍ) :
    exp (dist z w / 2) = (dist (z : ℂ) w + dist (z : ℂ) (conj ↑w)) / (2 * √(z.im * w.im))

rexp (dist z w / 2) = (dist ↑z ↑w + dist (↑z) ((starRingEnd ℂ) ↑w)) / (2 * √(z.im * w.im))


theorem snd_image_prod_subset (s : Set α) (t : Set β) : Prod.snd '' s ×ˢ t ⊆ t

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


theorem QuasiconcaveOn.convex [IsDirected β (· ≥ ·)] (hf : QuasiconcaveOn 𝕜 s f) : Convex 𝕜 s

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_4}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[LE β]
[SMul 𝕜 E]
{s : Set E}
{f : E → β}
[IsDirected β fun x x_1 => x ≥ x_1]
(hf : QuasiconcaveOn 𝕜 s f)


theorem lineCount_eq [Finite P] [Finite L] (p : P) : lineCount L p = order P L + 1

{P : Type u_1}
(L : Type u_2)
[Membership P L]
[Configuration.ProjectivePlane P L]
[Finite P]
[Finite L]
(p : P)

Configuration.lineCount L p = Configuration.ProjectivePlane.order P L + 1


theorem gcd_map [Field k] [DecidableEq R] [DecidableEq k] (f : R →+* k) :
    gcd (p.map f) (q.map f) = (gcd p q).map f

{R : Type u}
{k : Type y}
[Field R]
{p q : R[X]}
[Field k]
[DecidableEq R]
[DecidableEq k]
(f : R →+* k)

EuclideanDomain.gcd (Polynomial.map f p) (Polynomial.map f q) = Polynomial.map f (EuclideanDomain.gcd p q)


@[simp]
theorem sigmaCongrRightHom.card_range {α : Type*} {β : α → Type*}
    [Fintype (sigmaCongrRightHom β).range] [Fintype (∀ a, Perm (β a))] :
    Fintype.card (sigmaCongrRightHom β).range = Fintype.card (∀ a, Perm (β a))

Fintype.card ↥(Equiv.Perm.sigmaCongrRightHom β).range = Fintype.card ((a : α) → Equiv.Perm (β a))


theorem disjoint_span_sum : Disjoint (span R (range (u ∘ Sum.inl)))
    (span R (range (u ∘ Sum.inr)))

{S : CategoryTheory.ShortComplex (ModuleCat R)}

(hw : LinearIndependent R (⇑S.g ∘ u ∘ Sum.inr))

Disjoint (Submodule.span R (Set.range (u ∘ Sum.inl))) (Submodule.span R (Set.range (u ∘ Sum.inr)))


theorem filterMap_le_filterMap (f : α → Option β) {s t : Multiset α} (h : s ≤ t) :
    filterMap f s ≤ filterMap f t

{α : Type u_1}
{β : Type v}
(f : α → Option β)
{s t : Multiset α}
(h : s ≤ t)

Multiset.filterMap f s ≤ Multiset.filterMap f t


theorem finrank_left_dvd_finrank_sup_of_free :
    finrank R A ∣ finrank R ↥(A ⊔ B)

[Module.Free ↥A ↥(Algebra.adjoin ↥A ↑B)]

FiniteDimensional.finrank R ↥A ∣ FiniteDimensional.finrank R ↥(A ⊔ B)


/-- A multiple of a nonzero vector is in the same ray as that vector if and only if that multiple
is positive. -/
theorem sameRay_smul_left_iff_of_ne {v : M} (hv : v ≠ 0) {r : R} (hr : r ≠ 0) :
    SameRay R (r • v) v ↔ 0 < r

{R : Type u_1}
[LinearOrderedCommRing R]
{M : Type u_2}
[AddCommGroup M]
[Module R M]
[NoZeroSMulDivisors R M]
{v : M}
(hv : v ≠ 0)
{r : R}
(hr : r ≠ 0)


@[simp]
theorem comap_onQuot_eq (J : Ideal R) (v : Valuation (R ⧸ J) Γ₀) :
    (v.comap (Ideal.Quotient.mk J)).onQuot (v.self_le_supp_comap J) = v

{R : Type u_1}
{Γ₀ : Type u_2}
[CommRing R]
[LinearOrderedCommMonoidWithZero Γ₀]
(J : Ideal R)
(v : Valuation (R ⧸ J) Γ₀)

(Valuation.comap (Ideal.Quotient.mk J) v).onQuot ⋯ = v


@[simp]
theorem inv_mul_integral_comp_div_add :
    (c⁻¹ * ∫ x in a..b, f (x / c + d)) = ∫ x in a / c + d..b / c + d, f x

c⁻¹ * ∫ (x : ℝ) in a..b, f (x / c + d) = ∫ (x : ℝ) in a / c + d..b / c + d, f x


theorem erase_add_left_pos {a : α} {s : Multiset α} (t) : a ∈ s → (s + t).erase a = s.erase a + t

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


@[simp]
theorem sinh_add_cosh : sinh x + cosh x = exp x

Complex.sinh x + Complex.cosh x = Complex.exp x


/-- See also the strictly more general `final_comp` below. -/
theorem final_equivalence_comp [IsEquivalence F] [Final G] : Final (F ⋙ G)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{E : Type u₃}
[CategoryTheory.Category.{v₃, u₃} E]
(F : CategoryTheory.Functor C D)
(G : CategoryTheory.Functor D E)
[F.IsEquivalence]
[G.Final]


/-- Any isomorphism in `Top` induces a homeomorphism. -/
@[simps]
def homeoOfIso {X Y : TopCat.{u}} (f : X ≅ Y) : X ≃ₜ Y


protected theorem Filter.EventuallyEq.iteratedFDerivWithin (h : f₁ =ᶠ[𝓝[s] x] f) (n : ℕ) :
    iteratedFDerivWithin 𝕜 n f₁ s =ᶠ[𝓝[s] x] iteratedFDerivWithin 𝕜 n f s

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


/-- For almost every point `x`, sufficiently small sets in a Vitali family around `x` have positive
measure. (This is a nontrivial result, following from the covering property of Vitali families). -/
theorem ae_eventually_measure_pos [SecondCountableTopology α] :
    ∀ᵐ x ∂μ, ∀ᶠ a in v.filterAt x, 0 < μ a

{α : Type u_1}
[MetricSpace α]
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
(v : VitaliFamily μ)
[SecondCountableTopology α]

∀ᵐ (x : α) ∂μ, ∀ᶠ (a : Set α) in v.filterAt x, 0 < μ a


@[grind_norm↓] theorem not_exists (p : α → Prop) : (¬∃ x, p x) = ∀ x, ¬p x


/-- The top affine subspace is linearly equivalent to the affine space.

This is the affine version of `Submodule.topEquiv`. -/
@[simps! linear apply symm_apply_coe]
def topEquiv : (⊤ : AffineSubspace k P) ≃ᵃ[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]
(a : P)

↑((AffineSubspace.topEquiv k V P).symm a) = a


theorem image₂_image_left (f : γ → β → δ) (g : α → γ) :
    image₂ f (s.image g) t = image₂ (fun a b => f (g a) b) s t

{α : Type u_1}
{β : Type u_3}
{γ : Type u_5}
{δ : Type u_7}
[DecidableEq γ]
[DecidableEq δ]
{s : Finset α}
{t : Finset β}
(f : γ → β → δ)
(g : α → γ)

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


/-- The `balance1` function preserves the ordering invariants. -/
protected theorem Ordered.balance1 {l : RBNode α} {v : α} {r : RBNode α}
    (lv : l.All (cmpLT cmp · v)) (vr : r.All (cmpLT cmp v ·))
    (hl : l.Ordered cmp) (hr : r.Ordered cmp) : (balance1 l v r).Ordered cmp

(lv : Batteries.RBNode.All (fun x => Batteries.RBNode.cmpLT cmp x v) l)

(vr : Batteries.RBNode.All (fun x => Batteries.RBNode.cmpLT cmp v x) r)

Batteries.RBNode.Ordered cmp (l.balance1 v r)


theorem fg_unit (I : (FractionalIdeal S P)ˣ) : FG (I : Submodule R P)

{R : Type u_1}
[CommRing R]
{S : Submonoid R}
{P : Type u_2}
[CommRing P]
[Algebra R P]
(I : (FractionalIdeal S P)ˣ)


/-- Any mono factorisation of `f` gives a mono factorisation of `f ≫ g` when `g` is a mono. -/
@[simps]
def compMono (F : MonoFactorisation f) {Y' : C} (g : Y ⟶ Y') [Mono g] :
    MonoFactorisation (f ≫ g)

(F : CategoryTheory.Limits.MonoFactorisation f)


@[to_additive]
protected theorem congr_fun {f g : MulEquiv M N} (h : f = g) (x : M) : f x = g x

{M : Type u_6}
{N : Type u_7}
[Add M]
[Add N]
{f g : M ≃+ N}
(h : f = g)
(x : M)


theorem fastGrowingε₀_zero : fastGrowingε₀ 0 = 1


theorem getLast_replicate_succ (m : ℕ) (a : α) :
    (replicate (m + 1) a).getLast (ne_nil_of_length_eq_add_one (length_replicate _ _)) = a

(List.replicate (m + 1) a).getLast ⋯ = a


theorem Lp.norm_const' (hp_zero : p ≠ 0) (hp_top : p ≠ ∞) :
    ‖Lp.const p μ c‖ = ‖c‖ * (μ Set.univ).toReal ^ (1 / p.toReal)

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
(p : ℝ≥0∞)
(μ : MeasureTheory.Measure α)
[NormedAddCommGroup E]
[MeasureTheory.IsFiniteMeasure μ]
(c : E)
(hp_zero : p ≠ 0)
(hp_top : p ≠ ⊤)

‖(MeasureTheory.Lp.const p μ) c‖ = ‖c‖ * (μ Set.univ).toReal ^ (1 / p.toReal)


/-- A version of `Nat.cast_sub` that works for `ℝ≥0` and `ℚ≥0`. Note that this proof doesn't work
for `ℕ∞` and `ℝ≥0∞`, so we use type-specific lemmas for these types. -/
@[simp, norm_cast]
theorem cast_tsub [CanonicallyOrderedCommSemiring α] [Sub α] [OrderedSub α]
    [ContravariantClass α α (· + ·) (· ≤ ·)] (m n : ℕ) : ↑(m - n) = (m - n : α)

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


@[to_additive (attr := simp)]
theorem prod_equivMapDomain [CommMonoid N] (f : α ≃ β) (l : α →₀ M) (g : β → M → N) :
    prod (equivMapDomain f l) g = prod l (fun a m => g (f a) m)

{α : Type u_1}
{β : Type u_2}
{M : Type u_5}
{N : Type u_7}
[Zero M]
[CommMonoid N]
(f : α ≃ β)
(l : α →₀ M)
(g : β → M → N)

(Finsupp.equivMapDomain f l).prod g = l.prod fun a m => g (f a) m


/-- An induction principle for finite types, analogous to `Nat.rec`. It effectively says
that every `Fintype` is either `Empty` or `Option α`, up to an `Equiv`. -/
@[elab_as_elim]
theorem induction_empty_option {P : ∀ (α : Type u) [Fintype α], Prop}
    (of_equiv : ∀ (α β) [Fintype β] (e : α ≃ β), @P α (@Fintype.ofEquiv α β ‹_› e.symm) → @P β ‹_›)
    (h_empty : P PEmpty) (h_option : ∀ (α) [Fintype α], P α → P (Option α)) (α : Type u)
    [h_fintype : Fintype α] : P α

{P : (α : Type u) → [inst : Fintype α] → Prop}

(of_equiv : ∀ (α β : Type u) [inst : Fintype β] (e : α ≃ β), P α → P β)

(h_option : ∀ (α : Type u) [inst : Fintype α], P α → P (Option α))


@[simp]
theorem id_apply (x : X) :
    MulActionHom.id M x = x

{M : Type u_2}
{X : Type u_5}
[SMul M X]
(x : X)


lemma mk₀_comp (m₀ : M) (hm₀ : m₀ = 0) (f : X ⟶ Y) {a : M} (g : ShiftedHom Y Z a) :
    (mk₀ m₀ hm₀ f).comp g (by rw [hm₀, add_zero]) = f ≫ g

{C : Type u_1}
[CategoryTheory.Category.{u_5, u_1} C]
{M : Type u_4}
[AddMonoid M]
[CategoryTheory.HasShift C M]
{X Y Z : C}
(m₀ : M)
(hm₀ : m₀ = 0)
(f : X ⟶ Y)
{a : M}
(g : CategoryTheory.ShiftedHom Y Z a)

(CategoryTheory.ShiftedHom.mk₀ m₀ hm₀ f).comp g ⋯ = CategoryTheory.CategoryStruct.comp f g


theorem IsTheta.eq_zero_iff (h : f'' =Θ[l] g'') : ∀ᶠ x in l, f'' x = 0 ↔ g'' x = 0

{α : Type u_1}
{E'' : Type u_9}
{F'' : Type u_10}
[NormedAddCommGroup E'']
[NormedAddCommGroup F'']
{f'' : α → E''}
{g'' : α → F''}
{l : Filter α}
(h : f'' =Θ[l] g'')


@[simp]
theorem codisjoint_top_left : Codisjoint ⊤ a

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


lemma tilted_eq_withDensity_nnreal (μ : Measure α) (f : α → ℝ) :
    μ.tilted f = μ.withDensity (fun x ↦ ((↑) : ℝ≥0 → ℝ≥0∞)
      (⟨exp (f x) / ∫ x, exp (f x) ∂μ, by positivity⟩ : ℝ≥0))

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

μ.tilted f = μ.withDensity fun x => ↑⟨rexp (f x) / ∫ (x : α), rexp (f x) ∂μ, ⋯⟩


@[simp]
theorem getElem_set_of_ne {l : List α} {i j : ℕ} (h : i ≠ j) (a : α)
    (hj : j < (l.set i a).length) :
    (l.set i a)[j] = l[j]'(by simpa using hj)

{α : Type u}
{l : List α}
{i j : ℕ}
(h : i ≠ j)
(a : α)
(hj : j < (l.set i a).length)


theorem of_not_fintype (h : Fintype α → False) : Infinite α


/-- Multiplicative congruence relations preserve integer powers. -/
@[to_additive "Additive congruence relations preserve integer scaling."]
protected theorem zpow : ∀ (n : ℤ) {w x}, c w x → c (w ^ n) (x ^ n)

{M : Type u_1}
[Group M]
(c : Con M)
(n : ℤ)
{w x : M}


lemma trace_blockDiagonal [DecidableEq p] (M : p → Matrix n n R) :
    trace (blockDiagonal M) = ∑ i, trace (M i)

{n : Type u_3}
{p : Type u_4}
{R : Type u_6}
[Fintype n]
[Fintype p]
[AddCommMonoid R]
[DecidableEq p]
(M : p → Matrix n n R)

(Matrix.blockDiagonal M).trace = ∑ i : p, (M i).trace


/-- A right homology data for a short complex `S` induces a left homology data for `S.op`. -/
@[simps]
def op (h : S.RightHomologyData) : S.op.LeftHomologyData


theorem mul_comm [Mul α] [AddCommSemigroup α] [One α] [OfNat α 2] [Invertible (2 : α)]
    (a b : αˢʸᵐ) :
    a * b = b * a

{α : Type u_1}
[Mul α]
[AddCommSemigroup α]
[One α]
[OfNat α 2]
[Invertible 2]
(a b : αˢʸᵐ)


/-- A `l : List α` is `Sublist l l'` for `l' : List α` iff
there is `f`, an order-preserving embedding of `Fin l.length` into `Fin l'.length` such that
any element of `l` found at index `ix` can be found at index `f ix` in `l'`.
-/
theorem sublist_iff_exists_fin_orderEmbedding_get_eq {l l' : List α} :
    l <+ l' ↔
      ∃ f : Fin l.length ↪o Fin l'.length,
        ∀ ix : Fin l.length, l.get ix = l'.get (f ix)

l.Sublist l' ↔ ∃ f, ∀ (ix : Fin l.length), l.get ix = l'.get (f ix)


@[norm_cast] -- Porting note (#10618): simp can prove this
theorem coe_le_coe : (p : ℚ) ≤ q ↔ p ≤ q

↑p ≤ ↑q ↔ p ≤ q


theorem Convex.lipschitz_gauge (hc : Convex ℝ s) (h₀ : s ∈ 𝓝 (0 : E)) :
    ∃ K, LipschitzWith K (gauge s)

{E : Type u_2}
[SeminormedAddCommGroup E]
[NormedSpace ℝ E]
{s : Set E}
(hc : Convex ℝ s)
(h₀ : s ∈ 𝓝 0)


/-- If `x` and `y` are distinct letters and `w₁ w₂` are words such that `xw₁` reduces to `yw₂`, then
`w₁` reduces to `x⁻¹yw₂`. -/
@[to_additive "If `x` and `y` are distinct letters and `w₁ w₂` are words such that `x + w₁` reduces
  to `y + w₂`, then `w₁` reduces to `-x + y + w₂`."]
theorem inv_of_red_of_ne {x1 b1 x2 b2} (H1 : (x1, b1) ≠ (x2, b2))
    (H2 : Red ((x1, b1) :: L₁) ((x2, b2) :: L₂)) : Red L₁ ((x1, not b1) :: (x2, b2) :: L₂)

FreeGroup.Red L₁ ((x1, !b1) :: (x2, b2) :: L₂)


theorem hasBasis_nhds_zero :
    (𝓝 (0 : R)).HasBasis (fun _ => True) fun γ : Γ₀ˣ => { x | v x < (γ : Γ₀) }

(R : Type u)
[Ring R]
(Γ₀ : Type v)
[LinearOrderedCommGroupWithZero Γ₀]
[_i : Valued R Γ₀]

(𝓝 0).HasBasis (fun x => True) fun γ => {x | Valued.v x < ↑γ}


@[simp] theorem runCatch_bind_throw [Monad m] (e : β) (f : α → ExceptCpsT β m β) : runCatch (throw e >>= f : ExceptCpsT β m β) = pure e

{m : Type u_1 → Type u_2}
{β α : Type u_1}
[Monad m]
(e : β)
(f : α → ExceptCpsT β m β)


@[simp]
lemma map_id :
    CotangentSpace.map (.id P) = LinearMap.id

{R : Type u}
{S : Type v}
[CommRing R]
[CommRing S]
[Algebra R S]
{P : Algebra.Generators R S}

Algebra.Generators.CotangentSpace.map (Algebra.Generators.Hom.id P) = LinearMap.id


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

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


theorem surjective_untrop : Function.Surjective (untrop : Tropical R → R)


@[fun_prop, measurability]
theorem measurable_id' {_ : MeasurableSpace α} : Measurable fun a : α => a

∀ {x : MeasurableSpace α}, Measurable fun a => a


@[to_additive]
theorem zpow_trick_one' {G : Type*} [Group G] (a b : G) (n : ℤ) :
    a * b ^ n * b = a * b ^ (n + 1)

{G : Type u_1}
[AddGroup G]
(a b : G)
(n : ℤ)


@[to_additive single_lt_sum]
theorem single_lt_prod' {i j : ι} (hij : j ≠ i) (hi : i ∈ s) (hj : j ∈ s) (hlt : 1 < f j)
    (hle : ∀ k ∈ s, k ≠ i → 1 ≤ f k) : f i < ∏ k ∈ s, f k

{ι : Type u_1}
{M : Type u_4}
[OrderedCancelCommMonoid M]
{f : ι → M}
{s : Finset ι}
{i j : ι}
(hij : j ≠ i)
(hi : i ∈ s)
(hj : j ∈ s)
(hlt : 1 < f j)
(hle : ∀ k ∈ s, k ≠ i → 1 ≤ f k)


@[simp]
theorem singleton_last {i} (x : M i) (hne_one : x ≠ 1) : (singleton x hne_one).last = x

{ι : Type u_1}
{M : ι → Type u_2}
[(i : ι) → Monoid (M i)]
{i : ι}
(x : M i)
(hne_one : x ≠ 1)

(Monoid.CoprodI.NeWord.singleton x hne_one).last = x


@[simp, norm_cast] lemma coe_posPart (f : α →ᵇ β) : ⇑f⁺ = (⇑f)⁺

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


@[simp]
theorem coe_piecewise {s : Set α} (hs : MeasurableSet s) (f g : α →ₛ β) :
    ⇑(piecewise s hs f g) = s.piecewise f g

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
{s : Set α}
(hs : MeasurableSet s)
(f g : MeasureTheory.SimpleFunc α β)

↑(MeasureTheory.SimpleFunc.piecewise s hs f g) = s.piecewise ↑f ↑g


theorem smul_closedBall_zero {p : Seminorm 𝕜 E} {k : 𝕜} {r : ℝ} (hk : 0 < ‖k‖) :
    k • p.closedBall 0 r = p.closedBall 0 (‖k‖ * r)

{𝕜 : Type u_3}
{E : Type u_7}
[NormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{p : Seminorm 𝕜 E}
{k : 𝕜}
{r : ℝ}
(hk : 0 < ‖k‖)


theorem ContDiffWithinAt.sinh {n} (hf : ContDiffWithinAt ℝ n f s x) :
    ContDiffWithinAt ℝ n (fun x => Real.sinh (f x)) s x

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : E → ℝ}
{x : E}
{s : Set E}
{n : ℕ∞}
(hf : ContDiffWithinAt ℝ n f s x)


/-- A `JordanHolderLattice` is the class for which the Jordan Hölder theorem is proved. A
Jordan Hölder lattice is a lattice equipped with a notion of maximality, `IsMaximal`, and a notion
of isomorphism of pairs `Iso`. In the example of subgroups of a group, `IsMaximal H K` means that
`H` is a maximal normal subgroup of `K`, and `Iso (H₁, K₁) (H₂, K₂)` means that the quotient
`H₁ / K₁` is isomorphic to the quotient `H₂ / K₂`. `Iso` must be symmetric and transitive and must
satisfy the second isomorphism theorem `Iso (H, H ⊔ K) (H ⊓ K, K)`.
Examples include `Subgroup G` if `G` is a group, and `Submodule R M` if `M` is an `R`-module.
-/
class JordanHolderLattice (X : Type u) [Lattice X] where
  IsMaximal : X → X → Prop
  lt_of_isMaximal : ∀ {x y}, IsMaximal x y → x < y
  sup_eq_of_isMaximal : ∀ {x y z}, IsMaximal x z → IsMaximal y z → x ≠ y → x ⊔ y = z
  isMaximal_inf_left_of_isMaximal_sup :
    ∀ {x y}, IsMaximal x (x ⊔ y) → IsMaximal y (x ⊔ y) → IsMaximal (x ⊓ y) x
  Iso : X × X → X × X → Prop
  iso_symm : ∀ {x y}, Iso x y → Iso y x
  iso_trans : ∀ {x y z}, Iso x y → Iso y z → Iso x z
  second_iso : ∀ {x y}, IsMaximal x (x ⊔ y) → Iso (x, x ⊔ y) (x ⊓ y, y)

{X : Type u}
[Lattice X]
[self : JordanHolderLattice X]
{x y : X}

JordanHolderLattice.IsMaximal x y → x < y


theorem IsTopologicalBasis.open_eq_iUnion {B : Set (Set α)} (hB : IsTopologicalBasis B) {u : Set α}
    (ou : IsOpen u) : ∃ (β : Type u) (f : β → Set α), (u = ⋃ i, f i) ∧ ∀ i, f i ∈ B

(hB : TopologicalSpace.IsTopologicalBasis B)

∃ β f, u = ⋃ i, f i ∧ ∀ (i : β), f i ∈ B


/-- Two different points can be separated by open sets. -/
theorem t2_separation [T2Space X] {x y : X} (h : x ≠ y) :
    ∃ u v : Set X, IsOpen u ∧ IsOpen v ∧ x ∈ u ∧ y ∈ v ∧ Disjoint u v

{X : Type u_1}
[TopologicalSpace X]
[T2Space X]
{x y : X}
(h : x ≠ y)

∃ u v, IsOpen u ∧ IsOpen v ∧ x ∈ u ∧ y ∈ v ∧ Disjoint u v


/-- The functor from homological complexes to differential graded objects.
-/
@[simps]
def homologicalComplexToDGO :
    HomologicalComplex V (ComplexShape.up' b) ⥤
      DifferentialObject ℤ (GradedObjectWithShift b V)

(X : HomologicalComplex V (ComplexShape.up' b))

((HomologicalComplex.homologicalComplexToDGO b V).obj X).obj i = X.X i


theorem eq_empty_of_not_terminates {s} (H : ¬Terminates s) : s = empty α

{α : Type u}
{s : Computation α}
(H : ¬s.Terminates)


/-- `algEquivOfAssociated` sends `AdjoinRoot.root p` to `AdjoinRoot.root q`. -/
theorem algEquivOfAssociated_apply_root {p q : K[X]} (hp : p ≠ 0) (hpq : Associated p q) :
    algEquivOfAssociated hp hpq (root p) = root q

{K : Type u_1}
[Field K]
{p q : K[X]}
(hp : p ≠ 0)
(hpq : Associated p q)

(AdjoinRoot.algEquivOfAssociated hp hpq) (AdjoinRoot.root p) = AdjoinRoot.root q


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

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

(CategoryTheory.Square.toArrowArrowFunctor.obj sq).left.hom = sq.f₁₃


/-- Given a predicate on functions `∀ i, Finset (α i)` defined on a finite type, it is true on all
maps provided that it is true on `fun _ ↦ ∅` and for any function `g : ∀ i, Finset (α i)`, an index
`i : ι`, and an element`x : α i` that is strictly greater than all elements of `g i`, `p g` implies
`p (update g i (insert x (g i)))`.

This lemma requires `LinearOrder` instances on all `α i`. See also `Finset.induction_on_pi` for a
version that `x ∉ g i` instead of ` does not need `∀ i, LinearOrder (α i)`. -/
theorem induction_on_pi_max [∀ i, LinearOrder (α i)] {p : (∀ i, Finset (α i)) → Prop}
    (f : ∀ i, Finset (α i)) (h0 : p fun _ ↦ ∅)
    (step :
      ∀ (g : ∀ i, Finset (α i)) (i : ι) (x : α i),
        (∀ y ∈ g i, y < x) → p g → p (update g i (insert x (g i)))) :
    p f

(step :
  ∀ (g : (i : ι) → Finset (α i)) (i : ι) (x : α i), (∀ y ∈ g i, y < x) → p g → p (Function.update g i (insert x (g i))))


@[simp]
theorem cliqueSet_map_of_equiv (G : SimpleGraph α) (e : α ≃ β) (n : ℕ) :
    (G.map e.toEmbedding).cliqueSet n = map e.toEmbedding '' G.cliqueSet n

{α : Type u_1}
{β : Type u_2}
(G : SimpleGraph α)
(e : α ≃ β)
(n : ℕ)

(SimpleGraph.map e.toEmbedding G).cliqueSet n = Finset.map e.toEmbedding '' G.cliqueSet n


@[to_additive]
theorem div_def : s / t = (s ×ˢ t).image fun p : α × α => p.1 / p.2

{α : Type u_2}
[DecidableEq α]
[Div α]
{s t : Finset α}

s / t = Finset.image (fun p => p.1 / p.2) (s ×ˢ t)


@[to_additive (attr := simp)]
theorem lift₂Expand_of {C : Sort*} {P : X → S → X → S → C}
    {hP :
      ∀ (r₁ : X) (t₁ : R) (s₁ : S) (ht₁ : t₁ * s₁ ∈ S) (r₂ : X) (t₂ : R) (s₂ : S)
        (ht₂ : t₂ * s₂ ∈ S),
        P r₁ s₁ r₂ s₂ = P (t₁ • r₁) ⟨t₁ * s₁, ht₁⟩ (t₂ • r₂) ⟨t₂ * s₂, ht₂⟩}
    (r₁ : X) (s₁ : S) (r₂ : X) (s₂ : S) : lift₂Expand P hP (r₁ /ₒ s₁) (r₂ /ₒ s₂) = P r₁ s₁ r₂ s₂

{hP :
  ∀ (r₁ : X) (t₁ : R) (s₁ : ↥S) (ht₁ : t₁ + ↑s₁ ∈ S) (r₂ : X) (t₂ : R) (s₂ : ↥S) (ht₂ : t₂ + ↑s₂ ∈ S),
    P r₁ s₁ r₂ s₂ = P (t₁ +ᵥ r₁) ⟨t₁ + ↑s₁, ht₁⟩ (t₂ +ᵥ r₂) ⟨t₂ + ↑s₂, ht₂⟩}

AddOreLocalization.lift₂Expand P hP (r₁ -ₒ s₁) (r₂ -ₒ s₂) = P r₁ s₁ r₂ s₂


@[continuity]
protected theorem continuous_symm (h : X ≃ₜ Y) : Continuous h.symm

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
(h : X ≃ₜ Y)


/--
If any maximal connected component containing some element j₀ of J is all of J, then J is connected.

The converse of `induct_on_objects`.
-/
theorem IsConnected.of_induct {j₀ : J}
    (h : ∀ p : Set J, j₀ ∈ p → (∀ {j₁ j₂ : J} (_ : j₁ ⟶ j₂), j₁ ∈ p ↔ j₂ ∈ p) → ∀ j : J, j ∈ p) :
    IsConnected J

(h : ∀ (p : Set J), j₀ ∈ p → (∀ {j₁ j₂ : J}, (j₁ ⟶ j₂) → (j₁ ∈ p ↔ j₂ ∈ p)) → ∀ (j : J), j ∈ p)


@[simp]
theorem trans_apply (h₁ : α ≃ᵤ β) (h₂ : β ≃ᵤ γ) (a : α) : h₁.trans h₂ a = h₂ (h₁ a)

{α : Type u}
{β : Type u_1}
{γ : Type u_2}
[UniformSpace α]
[UniformSpace β]
[UniformSpace γ]
(h₁ : α ≃ᵤ β)
(h₂ : β ≃ᵤ γ)
(a : α)


/-- If `g` is surjective, then `rTensor Q g` is surjective -/
theorem LinearMap.rTensor_surjective (hg : Function.Surjective g) :
    Function.Surjective (rTensor Q g)

{R : Type u_1}
[CommSemiring R]
{N : Type u_3}
{P : Type u_4}
(Q : Type u_5)
[AddCommMonoid N]
[AddCommMonoid P]
[AddCommMonoid Q]
[Module R N]
[Module R P]
[Module R Q]
{g : N →ₗ[R] P}
(hg : Function.Surjective ⇑g)

Function.Surjective ⇑(LinearMap.rTensor Q g)


theorem lift_unique [IsDirected ι (· ≤ ·)] (F : DirectLimit G f →+ P) (x) :
    F x = lift G f P (fun i => F.comp (of G f i)) (fun i j hij x => by simp) x

{ι : Type v}
[Preorder ι]
{G : ι → Type w}
[DecidableEq ι]
[(i : ι) → AddCommGroup (G i)]
{f : (i j : ι) → i ≤ j → G i →+ G j}
(P : Type u₁)
[AddCommGroup P]
[IsDirected ι fun x x_1 => x ≤ x_1]
(F : AddCommGroup.DirectLimit G f →+ P)
(x : AddCommGroup.DirectLimit G f)

F x = (AddCommGroup.DirectLimit.lift G f P (fun i => F.comp (AddCommGroup.DirectLimit.of G f i)) ⋯) x


theorem coe_smul [SMul R ℝ] [SMul R ℝ≥0] [IsScalarTower R ℝ≥0 ℝ] (r : R) (p : Seminorm 𝕜 E) :
    ⇑(r • p) = r • ⇑p

{R : Type u_1}
{𝕜 : Type u_3}
{E : Type u_7}
[SeminormedRing 𝕜]
[AddGroup E]
[SMul 𝕜 E]
[SMul R ℝ]
[SMul R ℝ≥0]
[IsScalarTower R ℝ≥0 ℝ]
(r : R)
(p : Seminorm 𝕜 E)


theorem eq_dual_iff_dual_eq {M₁ M₂ : Matroid α} : M₁ = M₂✶ ↔ M₁✶ = M₂

M₁ = M₂✶ ↔ M₁✶ = M₂


/-- The constant factor occurring in the conclusion of `eLpNorm_le_eLpNorm_fderiv_of_le`.
It only depends on `F`, `μ`, `s`, `p` and `q`. -/
irreducible_def eLpNormLESNormFDerivOfLeConst [FiniteDimensional ℝ F] (s : Set E) (p q : ℝ≥0) :
    ℝ≥0

(F : Type u_6)
[NormedAddCommGroup F]
[NormedSpace ℝ F]
{E : Type u_7}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[MeasurableSpace E]
[BorelSpace E]
[FiniteDimensional ℝ E]
(μ : MeasureTheory.Measure E)
[μ.IsAddHaarMeasure]
[FiniteDimensional ℝ F]
(s : Set E)
(p q : ℝ≥0)

MeasureTheory.eLpNormLESNormFDerivOfLeConst F μ s p q =
  let p' := (p⁻¹ - (↑(FiniteDimensional.finrank ℝ E))⁻¹)⁻¹;
  (μ s).toNNReal ^ (1 / ↑q - 1 / ↑p') * MeasureTheory.SNormLESNormFDerivOfEqConst F μ ↑p


@[simp]
theorem eval_C : ∀ a, eval f (C a) = a

{R : Type u}
{σ : Type u_1}
[CommSemiring R]
{f : σ → R}
(a : R)

(MvPolynomial.eval f) (MvPolynomial.C a) = a


theorem coeff_X_pow_mul' (p : R[X]) (n d : ℕ) :
    (X ^ n * p).coeff d = ite (n ≤ d) (p.coeff (d - n)) 0

{R : Type u}
[Semiring R]
(p : R[X])
(n d : ℕ)

(Polynomial.X ^ n * p).coeff d = if n ≤ d then p.coeff (d - n) else 0


theorem inf_split (π : Prepartition I) (i : ι) (x : ℝ) :
    π ⊓ split I i x = π.biUnion fun J => split J i x

{ι : Type u_1}
{I : BoxIntegral.Box ι}
(π : BoxIntegral.Prepartition I)
(i : ι)
(x : ℝ)

π ⊓ BoxIntegral.Prepartition.split I i x = π.biUnion fun J => BoxIntegral.Prepartition.split J i x


theorem _root_.Finset.infsep_zero_iff_subsingleton (s : Finset α) :
    (s : Set α).infsep = 0 ↔ (s : Set α).Subsingleton

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


theorem tendsto_norm_atTop (p : R[X]) (h : 0 < degree p) {l : Filter α} {z : α → R}
    (hz : Tendsto (fun x => ‖z x‖) l atTop) : Tendsto (fun x => ‖p.eval (z x)‖) l atTop

(hz : Filter.Tendsto (fun x => ‖z x‖) l Filter.atTop)

Filter.Tendsto (fun x => ‖Polynomial.eval (z x) p‖) l Filter.atTop


theorem mem_dite_empty_right (p : Prop) [Decidable p] (t : p → Set α) (x : α) :
    (x ∈ if h : p then t h else ∅) ↔ ∃ h : p, x ∈ t h

{α : Type u}
(p : Prop)
[Decidable p]
(t : p → Set α)
(x : α)

(x ∈ if h : p then t h else ∅) ↔ ∃ (h : p), x ∈ t h


@[simp]
theorem dedup_zero : @dedup α _ 0 = 0


lemma krullDim_eq_length_of_finiteDimensionalOrder [FiniteDimensionalOrder α] :
    krullDim α = (LTSeries.longestOf α).length

{α : Type u_1}
[Preorder α]
[FiniteDimensionalOrder α]

krullDim α = ↑(LTSeries.longestOf α).length


@[simp]
theorem add_apply (m : ∀ i, M₁ i) : (f + f') m = f m + f' m

(f f' : ContinuousMultilinearMap R M₁ M₂)


/-- The identity monoidal functor. -/
@[simps]
def id : MonoidalFunctor.{v₁, v₁} C C

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

(CategoryTheory.MonoidalFunctor.id C).μ X Y = 𝟙 (CategoryTheory.MonoidalCategory.tensorObj ((𝟭 C).obj X) ((𝟭 C).obj Y))


@[to_additive (attr := simp low, norm_cast)]
theorem coe_mul (x y : S') : (↑(x * y) : M) = ↑x * ↑y

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


/-- The canonical functor `(C ⥤ D) ⥤ (Karoubi C ⥤ Karoubi D)` -/
@[simps!]
def functorExtension₂ : (C ⥤ D) ⥤ Karoubi C ⥤ Karoubi D

(P : CategoryTheory.Idempotents.Karoubi C)

(((CategoryTheory.Idempotents.functorExtension₂ C D).obj X).obj P).p = X.map P.p


/-- Commutativity of actions is a symmetric relation. This lemma can't be an instance because this
would cause a loop in the instance search graph. -/
@[to_additive]
lemma SMulCommClass.symm (M N α : Type*) [SMul M α] [SMul N α] [SMulCommClass M N α] :
    SMulCommClass N M α

(M : Type u_11)
(N : Type u_12)
(α : Type u_13)
[SMul M α]
[SMul N α]
[SMulCommClass M N α]


@[ext]
lemma hom_ext₅ {f g : ComposableArrows C 5} {φ φ' : f ⟶ g}
    (h₀ : app' φ 0 = app' φ' 0) (h₁ : app' φ 1 = app' φ' 1) (h₂ : app' φ 2 = app' φ' 2)
    (h₃ : app' φ 3 = app' φ' 3) (h₄ : app' φ 4 = app' φ' 4) (h₅ : app' φ 5 = app' φ' 5) :
    φ = φ'

{f g : CategoryTheory.ComposableArrows C 5}

(h₀ : CategoryTheory.ComposableArrows.app' φ 0 ⋯ = CategoryTheory.ComposableArrows.app' φ' 0 ⋯)

(h₁ : CategoryTheory.ComposableArrows.app' φ 1 ⋯ = CategoryTheory.ComposableArrows.app' φ' 1 ⋯)

(h₂ : CategoryTheory.ComposableArrows.app' φ 2 ⋯ = CategoryTheory.ComposableArrows.app' φ' 2 ⋯)

(h₃ : CategoryTheory.ComposableArrows.app' φ 3 ⋯ = CategoryTheory.ComposableArrows.app' φ' 3 ⋯)

(h₄ : CategoryTheory.ComposableArrows.app' φ 4 ⋯ = CategoryTheory.ComposableArrows.app' φ' 4 ⋯)

(h₅ : CategoryTheory.ComposableArrows.app' φ 5 ⋯ = CategoryTheory.ComposableArrows.app' φ' 5 ⋯)


lemma AnalyticAt.meromorphicAt {f : 𝕜 → E} {x : 𝕜} (hf : AnalyticAt 𝕜 f x) :
    MeromorphicAt f x

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


theorem mem_inter_of_mem_of_mem (h₁ : a ∈ l₁) (h₂ : a ∈ l₂) : a ∈ l₁ ∩ l₂

{α : Type u_1}
{l₁ l₂ : List α}
{a : α}
[DecidableEq α]
(h₁ : a ∈ l₁)
(h₂ : a ∈ l₂)


theorem of_apply {i} (m : M i) : of m = Con.mk' _ (FreeMonoid.of <| Sigma.mk i m)

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

Monoid.CoprodI.of m = (conGen (Monoid.CoprodI.Rel M)).mk' (FreeMonoid.of ⟨i, m⟩)


theorem sum_right {α} (t : Finset α) (w : M) (g : α → M) :
    B w (∑ i ∈ t, g i) = ∑ i ∈ t, B w (g i)

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
(B : LinearMap.BilinForm R M)
{α : Type u_7}
(t : Finset α)
(w : M)
(g : α → M)

(B w) (∑ i ∈ t, g i) = ∑ i ∈ t, (B w) (g i)


/-- The inverse rotation of triangles gives an endofunctor on the category of triangles in `C`.
-/
@[simps]
def invRotate : Triangle C ⥤ Triangle C

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

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


protected theorem MonotoneOn.Ioo (hf : MonotoneOn f s) (hg : AntitoneOn g s) :
    AntitoneOn (fun x => Ioo (f x) (g x)) s

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
{f g : α → β}
{s : Set α}
(hf : MonotoneOn f s)
(hg : AntitoneOn g s)

AntitoneOn (fun x => Set.Ioo (f x) (g x)) s


/-- Any category with pullbacks and terminal object has binary products. -/
theorem hasBinaryProducts_of_hasTerminal_and_pullbacks [HasTerminal C] [HasPullbacks C] :
    HasBinaryProducts C

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


@[simp]
theorem dual_apply (g : G) : (dual ρV) g = Module.Dual.transpose (R := k) (ρV g⁻¹)

{k : Type u_1}
{G : Type u_2}
{V : Type u_3}
[CommSemiring k]
[Group G]
[AddCommMonoid V]
[Module k V]
(ρV : Representation k G V)
(g : G)

ρV.dual g = Module.Dual.transpose (ρV g⁻¹)


theorem uniformInducing_toContinuousMap : UniformInducing (@toContinuousMap _ _ _ v)

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{v : PicardLindelof E}


theorem not_mem_Icc_of_gt (hb : b < c) : c ∉ Icc a b

{α : Type u_1}
[Preorder α]
{a b c : α}
(hb : b < c)


@[to_additive]
theorem mem_pow {a : α} {n : ℕ} :
    a ∈ s ^ n ↔ ∃ f : Fin n → s, (List.ofFn fun i ↦ (f i : α)).prod = a

{α : Type u_2}
[Monoid α]
{s : Set α}
{a : α}
{n : ℕ}

a ∈ s ^ n ↔ ∃ f, (List.ofFn fun i => ↑(f i)).prod = a


theorem Coprime.gcd_both (k l : Nat) (hmn : Coprime m n) : Coprime (gcd k m) (gcd l n)

{m n : Nat}
(k l : Nat)
(hmn : m.Coprime n)


/-- `X ⨿ -` has a monad structure. This is sometimes called the either monad. -/
@[simps!]
def coprodMonad : Monad C

(CategoryTheory.coprodMonad X).η.app Y = CategoryTheory.Limits.coprod.inr


@[to_additive]
theorem card_dvd_exponent_pow_rank : Nat.card G ∣ Monoid.exponent G ^ Group.rank G

(G : Type u_1)
[CommGroup G]
[Group.FG G]


theorem derivWithin_pow' (hc : DifferentiableWithinAt 𝕜 c s x) (hxs : UniqueDiffWithinAt 𝕜 s x) :
    derivWithin (fun x => c x ^ n) s x = (n : 𝕜) * c x ^ (n - 1) * derivWithin c s x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{x : 𝕜}
{s : Set 𝕜}
{c : 𝕜 → 𝕜}
(n : ℕ)
(hc : DifferentiableWithinAt 𝕜 c s x)
(hxs : UniqueDiffWithinAt 𝕜 s x)

derivWithin (fun x => c x ^ n) s x = ↑n * c x ^ (n - 1) * derivWithin c s x


theorem not_sqLe_succ (c d y) (h : 0 < c) : ¬SqLe (y + 1) c 0 d


/-- A group `G` is solvable if its derived series is eventually trivial. We use this definition
  because it's the most convenient one to work with. -/
@[mk_iff isSolvable_def]
class IsSolvable : Prop where
  /-- A group `G` is solvable if its derived series is eventually trivial. -/
  solvable : ∃ n : ℕ, derivedSeries G n = ⊥

{G : Type u_1}
[Group G]
[self : IsSolvable G]


theorem SupIndep.image [DecidableEq ι] {s : Finset ι'} {g : ι' → ι} (hs : s.SupIndep (f ∘ g)) :
    (s.image g).SupIndep f

{α : Type u_1}
{ι : Type u_3}
{ι' : Type u_4}
[Lattice α]
[OrderBot α]
{f : ι → α}
[DecidableEq ι]
{s : Finset ι'}
{g : ι' → ι}
(hs : s.SupIndep (f ∘ g))


/-- The following diagram commutes:
```text
          zmod (p^n) ----------------------------> zmod (p^m)
            |                                        |
            |                                        |
            v                                        v
TruncatedWittVector p n (zmod p) ----> TruncatedWittVector p m (zmod p)
```
Here the vertical arrows are `TruncatedWittVector.zmodEquivTrunc`,
the horizontal arrow at the top is `ZMod.castHom`,
and the horizontal arrow at the bottom is `TruncatedWittVector.truncate`.
-/
theorem commutes {m : ℕ} (hm : n ≤ m) :
    (truncate hm).comp (zmodEquivTrunc p m).toRingHom =
      (zmodEquivTrunc p n).toRingHom.comp (ZMod.castHom (pow_dvd_pow p hm) _)

(p : ℕ)
[hp : Fact (Nat.Prime p)]
(n : ℕ)
{m : ℕ}
(hm : n ≤ m)

(TruncatedWittVector.truncate hm).comp (TruncatedWittVector.zmodEquivTrunc p m).toRingHom =
  (TruncatedWittVector.zmodEquivTrunc p n).toRingHom.comp (ZMod.castHom ⋯ (ZMod (p ^ n)))


theorem subset_symmDiff_union_symmDiff_right (h : Disjoint t u) : s ⊆ s ∆ t ∪ s ∆ u

{α : Type u}
{s t u : Set α}
(h : Disjoint t u)


theorem map₂_map_right (f : α → γ → δ) (g : β → γ) :
    map₂ f a (b.map g) = map₂ (fun a b => f a (g b)) a b

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{δ : Type u_4}
{a : Option α}
{b : Option β}
(f : α → γ → δ)
(g : β → γ)

Option.map₂ f a (Option.map g b) = Option.map₂ (fun a b => f a (g b)) a b


theorem irreducible_mul_iff {a b : α} :
    Irreducible (a * b) ↔ Irreducible a ∧ IsUnit b ∨ Irreducible b ∧ IsUnit a


@[to_additive]
theorem comp_lift {P' : Type*} [Monoid P'] (f : P →* P') (g₁ : M →* P) (g₂ : N →* P) :
    f.comp (lift g₁ g₂) = lift (f.comp g₁) (f.comp g₂)

{M : Type u_1}
{N : Type u_2}
{P : Type u_3}
[AddZeroClass M]
[AddZeroClass N]
[AddMonoid P]
{P' : Type u_4}
[AddMonoid P']
(f : P →+ P')
(g₁ : M →+ P)
(g₂ : N →+ P)

f.comp (AddMonoid.Coprod.lift g₁ g₂) = AddMonoid.Coprod.lift (f.comp g₁) (f.comp g₂)


@[simp]
theorem bodd_zero : bodd 0 = false


@[measurability]
theorem Measurable.iSup_Prop {α} [MeasurableSpace α] [ConditionallyCompleteLattice α]
    (p : Prop) {f : δ → α} (hf : Measurable f) : Measurable fun b => ⨆ _ : p, f b

{δ : Type u_4}
[MeasurableSpace δ]
{α : Type u_5}
[MeasurableSpace α]
[ConditionallyCompleteLattice α]
(p : Prop)
{f : δ → α}
(hf : Measurable f)


theorem X_sub_C_dvd_sub_C_eval : X - C a ∣ p - C (p.eval a)

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

Polynomial.X - Polynomial.C a ∣ p - Polynomial.C (Polynomial.eval a p)


@[to_additive (attr := simp)] theorem MonoidHom.id_commGrp_comp
    {G : Type u} [CommGroup G] {H : CommGrp.{u}} (f : G →* H) : MonoidHom.comp (𝟙 H) f = f

{G : Type u}
[AddCommGroup G]
{H : AddCommGrp}
(f : G →+ ↑H)


theorem single_mul_apply_aux [Mul G] (f : MonoidAlgebra k G) {r : k} {x y z : G}
    (H : ∀ a, x * a = y ↔ a = z) : (single x r * f) y = r * f z

{k : Type u₁}
{G : Type u₂}
[Semiring k]
[Mul G]
(f : MonoidAlgebra k G)
{r : k}
{x y z : G}
(H : ∀ (a : G), x * a = y ↔ a = z)

(MonoidAlgebra.single x r * f) y = r * f z


theorem withDensity_apply_eq_zero {f : α → ℝ≥0∞} {s : Set α} (hf : Measurable f) :
    μ.withDensity f s = 0 ↔ μ ({ x | f x ≠ 0 } ∩ s) = 0

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

(μ.withDensity f) s = 0 ↔ μ ({x | f x ≠ 0} ∩ s) = 0


theorem tendsto_nhds_left {f : Filter β} {u : β → α} {a : α} :
    Tendsto u f (𝓝 a) ↔ Tendsto (fun x => (u x, a)) f (𝓤 α)

{α : Type ua}
{β : Type ub}
[UniformSpace α]
{f : Filter β}
{u : β → α}
{a : α}

Filter.Tendsto u f (𝓝 a) ↔ Filter.Tendsto (fun x => (u x, a)) f (𝓤 α)


theorem flip' (n ν : ℕ) (h : ν ≤ n) :
    bernsteinPolynomial R n ν = (bernsteinPolynomial R n (n - ν)).comp (1 - X)

(R : Type u_1)
[CommRing R]
(n ν : ℕ)
(h : ν ≤ n)

bernsteinPolynomial R n ν = (bernsteinPolynomial R n (n - ν)).comp (1 - Polynomial.X)


@[simp]
theorem transpose_le_iff {μ ν : YoungDiagram} : μ.transpose ≤ ν.transpose ↔ μ ≤ ν


lemma PerfectRing.toPerfectField (K : Type*) (p : ℕ)
    [Field K] [ExpChar K p] [PerfectRing K p] : PerfectField K

(K : Type u_1)
(p : ℕ)
[Field K]
[ExpChar K p]
[PerfectRing K p]


theorem isPiSystem_Ici : IsPiSystem (range Ici : Set (Set α))


theorem mem_roots_sub_C {p : R[X]} {a x : R} (hp0 : 0 < degree p) :
    x ∈ (p - C a).roots ↔ p.eval x = a

{R : Type u}
[CommRing R]
[IsDomain R]
{p : Polynomial R}
{a x : R}
(hp0 : 0 < p.degree)

x ∈ (p - Polynomial.C a).roots ↔ Polynomial.eval x p = a


/-- Any locally constant function from a cofiltered limit of profinite sets factors through
one of the components. -/
theorem exists_locallyConstant {α : Type*} (hC : IsLimit C) (f : LocallyConstant C.pt α) :
    ∃ (j : J) (g : LocallyConstant (F.obj j) α), f = g.comap (C.π.app _)

{F : CategoryTheory.Functor J Profinite}

∃ j g, f = LocallyConstant.comap (C.π.app j) g


/-- When `α` is `Finite`, every `f : PreLp E p` satisfies `Memℓp f p`. -/
theorem Memℓp.all (f : ∀ i, E i) : Memℓp f p

{α : Type u_1}
{E : α → Type u_2}
[(i : α) → NormedAddCommGroup (E i)]
{p : ℝ≥0∞}
[Finite α]
(f : (i : α) → E i)


/-- Construct a pseudofunctor from a lax functor whose `mapId` and `mapComp` are isomorphisms. -/
@[simps]
def mkOfLax (F : LaxFunctor B C) (F' : F.PseudoCore) : Pseudofunctor B C

{B : Type u₁}
[CategoryTheory.Bicategory B]
{C : Type u₂}
[CategoryTheory.Bicategory C]
(F : CategoryTheory.LaxFunctor B C)
(F' : F.PseudoCore)

(CategoryTheory.Pseudofunctor.mkOfLax F F').toPrelaxFunctor = F.toPrelaxFunctor


@[to_additive (attr := simp)]
theorem coe_equivMapOfInjective_apply (f : M →ₙ* N) (hf : Function.Injective f) (x : S) :
    (equivMapOfInjective S f hf x : N) = f x

{M : Type u_1}
{N : Type u_2}
[Add M]
[Add N]
(S : AddSubsemigroup M)
(f : AddHom M N)
(hf : Function.Injective ⇑f)
(x : ↥S)

↑((S.equivMapOfInjective f hf) x) = f ↑x


theorem preimage_coe_eq_empty {s t : Set α} : ((↑) : s → α) ⁻¹' t = ∅ ↔ s ∩ t = ∅


/-- The evaluation map on automorphisms is injective for connected objects. -/
lemma evaluation_aut_injective_of_isConnected (A : C) [IsConnected A] (a : F.obj A) :
    Function.Injective (fun f : Aut A ↦ F.map (f.hom) a)

(F : CategoryTheory.Functor C FintypeCat)

Function.Injective fun f => F.map f.hom a


@[continuity]
theorem continuous_transReflReparamAux : Continuous transReflReparamAux


@[simp] theorem coe_toMeasureEquiv : (f.toMeasureEquiv : E → F) = f

{E : Type u_2}
{F : Type u_3}
[NormedAddCommGroup F]
[InnerProductSpace ℝ F]
[MeasurableSpace F]
[BorelSpace F]
[NormedAddCommGroup E]
[InnerProductSpace ℝ E]
[MeasurableSpace E]
[BorelSpace E]
(f : E ≃ₗᵢ[ℝ] F)


@[simp]
theorem isSubordinate_biUnionTagged [Fintype ι] {π : Prepartition I}
    {πi : ∀ J, TaggedPrepartition J} :
    IsSubordinate (π.biUnionTagged πi) r ↔ ∀ J ∈ π, (πi J).IsSubordinate r

{πi : (J : BoxIntegral.Box ι) → BoxIntegral.TaggedPrepartition J}

(π.biUnionTagged πi).IsSubordinate r ↔ ∀ J ∈ π, (πi J).IsSubordinate r


/-- The kernel of `biprod.snd : X ⊞ Y ⟶ Y` is `X`. -/
@[simps!]
def kernelBiprodSndIso : kernel (biprod.snd : X ⊞ Y ⟶ Y) ≅ X

CategoryTheory.Limits.kernelBiprodSndIso.hom =
  (CategoryTheory.Limits.biprod.isKernelSndKernelFork X Y).lift
    (CategoryTheory.Limits.limit.cone (CategoryTheory.Limits.parallelPair CategoryTheory.Limits.biprod.snd 0))


@[simp]
lemma ofNat_lt_ofReal {n : ℕ} [n.AtLeastTwo] {r : ℝ} :
    no_index (OfNat.ofNat n) < ENNReal.ofReal r ↔ OfNat.ofNat n < r

OfNat.ofNat n < ENNReal.ofReal r ↔ OfNat.ofNat n < r


theorem Codisjoint.left_le_of_le_inf_left (h : b ⊓ a ≤ c) (hd : Codisjoint b c) : a ≤ c

{α : Type u_1}
[DistribLattice α]
[OrderTop α]
{a b c : α}
(h : b ⊓ a ≤ c)
(hd : Codisjoint b c)


/-- Extending the domain of Hahn series is a ring homomorphism. -/
@[simps]
def embDomainRingHom [NonAssocSemiring R] (f : Γ →+ Γ') (hfi : Function.Injective f)
    (hf : ∀ g g' : Γ, f g ≤ f g' ↔ g ≤ g') : HahnSeries Γ R →+* HahnSeries Γ' R

(hf : ∀ (g g' : Γ), f g ≤ f g' ↔ g ≤ g')

∀ (a : HahnSeries Γ R),
  (HahnSeries.embDomainRingHom f hfi hf) a = HahnSeries.embDomain { toFun := ⇑f, inj' := hfi, map_rel_iff' := ⋯ } a


@[to_additive]
theorem max_le_mul_of_one_le [CovariantClass α α (· * ·) (· ≤ ·)]
    [CovariantClass α α (Function.swap (· * ·)) (· ≤ ·)] {a b : α} (ha : 1 ≤ a) (hb : 1 ≤ b) :
    max a b ≤ a * b

[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]


lemma map_injective : Function.Injective <| map W f

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

Function.Injective ⇑(WeierstrassCurve.Affine.Point.map W f)


@[simp]
theorem coe_homothetyHom (c : P1) : ⇑(homothetyHom c : k →* _) = homothety c

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

⇑(AffineMap.homothetyHom c) = AffineMap.homothety c


theorem eq_comp_toLinearMap_symm (f : M₂ →ₛₗ[σ₂₃] M₃) (g : M₁ →ₛₗ[σ₁₃] M₃) :
    f = g.comp e₁₂.symm.toLinearMap ↔ f.comp e₁₂.toLinearMap = g

{R₁ : Type u_2}
{R₂ : Type u_3}
{R₃ : Type u_4}
{M₁ : Type u_9}
{M₂ : Type u_10}
{M₃ : Type u_11}
[Semiring R₁]
[Semiring R₂]
[Semiring R₃]
[AddCommMonoid M₁]
[AddCommMonoid M₂]
[AddCommMonoid M₃]
{module_M₁ : Module R₁ M₁}
{module_M₂ : Module R₂ M₂}
{module_M₃ : Module R₃ M₃}
{σ₁₂ : R₁ →+* R₂}
{σ₂₃ : R₂ →+* R₃}
{σ₁₃ : R₁ →+* R₃}
{σ₂₁ : R₂ →+* R₁}
[RingHomCompTriple σ₁₂ σ₂₃ σ₁₃]
{re₁₂ : RingHomInvPair σ₁₂ σ₂₁}
{re₂₁ : RingHomInvPair σ₂₁ σ₁₂}
{e₁₂ : M₁ ≃ₛₗ[σ₁₂] M₂}
[RingHomCompTriple σ₂₁ σ₁₃ σ₂₃]
(f : M₂ →ₛₗ[σ₂₃] M₃)
(g : M₁ →ₛₗ[σ₁₃] M₃)


@[simp] lemma left_eq_inter : s = s ∩ t ↔ s ⊆ t


lemma realContinuousMapOfNNReal_injective :
    Function.Injective (realContinuousMapOfNNReal (X := X) (A := A))

{X : Type u_1}
[TopologicalSpace X]
{A : Type u_2}
[Ring A]
[StarRing A]
[Algebra ℝ A]


theorem mapRange_smul (f : ∀ i, β₁ i → β₂ i) (hf : ∀ i, f i 0 = 0) (r : R)
    (hf' : ∀ i x, f i (r • x) = r • f i x) (g : Π₀ i, β₁ i) :
    mapRange f hf (r • g) = r • mapRange f hf g

(hf' : ∀ (i : ι) (x : β₁ i), f i (r • x) = r • f i x)

DFinsupp.mapRange f hf (r • g) = r • DFinsupp.mapRange f hf g


theorem getD_map {n : ℕ} (f : α → β) : (map f l).getD n (f d) = f (l.getD n d)

{α : Type u}
{β : Type v}
(l : List α)
(d : α)
{n : ℕ}
(f : α → β)

(List.map f l).getD n (f d) = f (l.getD n d)


theorem le_on_closure [TopologicalSpace β] {f g : β → α} {s : Set β} (h : ∀ x ∈ s, f x ≤ g x)
    (hf : ContinuousOn f (closure s)) (hg : ContinuousOn g (closure s)) ⦃x⦄ (hx : x ∈ closure s) :
    f x ≤ g x

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[Preorder α]
[t : OrderClosedTopology α]
[TopologicalSpace β]
{f g : β → α}
{s : Set β}
(h : ∀ x ∈ s, f x ≤ g x)
(hf : ContinuousOn f (closure s))
(hg : ContinuousOn g (closure s))
⦃x : β⦄
(hx : x ∈ closure s)


theorem forget_hom_Type (α β : Type u) (f : α ⟶ β) : DFunLike.coe f = f


@[to_additive (attr := simp, norm_cast)]
theorem coe_set_mk {s : Set M} (h_mul) : (mk s h_mul : Set M) = s

(h_mul : ∀ {a b : M}, a ∈ s → b ∈ s → a * b ∈ s)

↑{ carrier := s, mul_mem' := h_mul } = s


theorem norm_of_cyclotomic_irreducible [IsDomain L] [IsCyclotomicExtension {n} K L]
    (hirr : Irreducible (cyclotomic n K)) : norm K ζ = ite (n = 2) (-1) 1

(hirr : Irreducible (Polynomial.cyclotomic (↑n) K))

(Algebra.norm K) ζ = if n = 2 then -1 else 1


@[to_additive]
theorem mulSupport_subset_comp {g : M → N} (hg : ∀ {x}, g x = 1 → x = 1) (f : α → M) :
    mulSupport f ⊆ mulSupport (g ∘ f)

{α : Type u_1}
{M : Type u_5}
{N : Type u_7}
[Zero M]
[Zero N]
{g : M → N}
(hg : ∀ {x : M}, g x = 0 → x = 0)
(f : α → M)

Function.support f ⊆ Function.support (g ∘ f)


theorem open_image_open (i : D.J) (U : Opens (𝖣.U i)) : IsOpen (𝖣.ι i '' (U : Set (D.U i)))

(D : TopCat.GlueData)
(i : D.J)
(U : TopologicalSpace.Opens ↑(D.U i))


@[simp]
lemma map_ι : (c.map G).ι = G.map c.ι

(c : CategoryTheory.Limits.KernelFork f)

CategoryTheory.Limits.Fork.ι (c.map G) = G.map (CategoryTheory.Limits.Fork.ι c)


theorem pumping_lemma [Fintype σ] {x : List α} (hx : x ∈ M.accepts)
    (hlen : Fintype.card (Set σ) ≤ List.length x) :
    ∃ a b c, x = a ++ b ++ c ∧
      a.length + b.length ≤ Fintype.card (Set σ) ∧ b ≠ [] ∧ {a} * {b}∗ * {c} ≤ M.accepts

(hlen : Fintype.card (Set σ) ≤ x.length)


@[to_additive]
theorem lt_iff_exists_mul [CovariantClass α α (· * ·) (· < ·)] : a < b ↔ ∃ c > 1, b = a * c

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


@[to_additive]
protected lemma IsOfFinOrder.orderOf_pos (h : IsOfFinOrder x) : 0 < orderOf x

{G : Type u_1}
[AddMonoid G]
{x : G}
(h : IsOfFinAddOrder x)


theorem not_disjoint_coe_iff_nonempty_inter :
    ¬Disjoint (I : WithBot (Box ι)) J ↔ (I ∩ J : Set (ι → ℝ)).Nonempty

{ι : Type u_1}
{I J : BoxIntegral.Box ι}


theorem isSuccLimit_aleph0 : IsSuccLimit ℵ₀


theorem compFormalMultilinearSeries_apply' (f : F →L[𝕜] G) (p : FormalMultilinearSeries 𝕜 E F)
    (n : ℕ) (v : Fin n → E) : (f.compFormalMultilinearSeries p) n v = f (p n v)

{𝕜 : Type u}
{E : Type v}
{F : Type w}
{G : Type x}
[Ring 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[TopologicalSpace E]
[TopologicalAddGroup E]
[ContinuousConstSMul 𝕜 E]
[AddCommGroup F]
[Module 𝕜 F]
[TopologicalSpace F]
[TopologicalAddGroup F]
[ContinuousConstSMul 𝕜 F]
[AddCommGroup G]
[Module 𝕜 G]
[TopologicalSpace G]
[TopologicalAddGroup G]
[ContinuousConstSMul 𝕜 G]
(f : F →L[𝕜] G)
(p : FormalMultilinearSeries 𝕜 E F)
(n : ℕ)
(v : Fin n → E)

(f.compFormalMultilinearSeries p n) v = f ((p n) v)


@[simp]
theorem Iic_diff_right : Iic a \ {a} = Iio a


theorem mem_inv_pointwise_smul_iff {a : α} {S : AddSubgroup A} {x : A} : x ∈ a⁻¹ • S ↔ a • x ∈ S

{α : Type u_1}
{A : Type u_3}
[AddGroup A]
[Group α]
[DistribMulAction α A]
{a : α}
{S : AddSubgroup A}
{x : A}

x ∈ a⁻¹ • S ↔ a • x ∈ S


theorem FreeCoequalizer.condition :
    FreeCoequalizer.topMap X ≫ FreeCoequalizer.π X =
      FreeCoequalizer.bottomMap X ≫ FreeCoequalizer.π X

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

CategoryTheory.CategoryStruct.comp (CategoryTheory.Monad.FreeCoequalizer.topMap X)
    (CategoryTheory.Monad.FreeCoequalizer.π X) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.Monad.FreeCoequalizer.bottomMap X)
    (CategoryTheory.Monad.FreeCoequalizer.π X)


@[to_additive]
theorem innerContent_pos_of_is_mul_left_invariant [Group G] [TopologicalGroup G]
    (h3 : ∀ (g : G) {K : Compacts G}, μ (K.map _ <| continuous_mul_left g) = μ K) (K : Compacts G)
    (hK : μ K ≠ 0) (U : Opens G) (hU : (U : Set G).Nonempty) : 0 < μ.innerContent U

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


theorem IsJacobson.out {R} [CommRing R] :
    IsJacobson R → ∀ {I : Ideal R}, I.IsRadical → I.jacobson = I

Ideal.IsJacobson R → ∀ {I : Ideal R}, I.IsRadical → I.jacobson = I


protected theorem isAntichain [IsRefl α r] (h : IsStrongAntichain r s) : IsAntichain r s

{α : Type u_1}
{r : α → α → Prop}
{s : Set α}
[IsRefl α r]
(h : IsStrongAntichain r s)


@[to_additive]
theorem image_multiset_prod (f : F) :
    ∀ m : Multiset (Set α), (f : α → β) '' m.prod = (m.map fun s => f '' s).prod

{α : Type u_2}
{β : Type u_3}
{F : Type u_4}
[FunLike F α β]
[AddCommMonoid α]
[AddCommMonoid β]
[AddMonoidHomClass F α β]
(f : F)
(m : Multiset (Set α))

⇑f '' m.sum = (Multiset.map (fun s => ⇑f '' s) m).sum


@[simp]
theorem map_eq_bot_iff : map m f = ⊥ ↔ f = ⊥

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


/-- The object in the category of `R`-bialgebras associated to an `R`-bialgebra. -/
@[simps]
def of (X : Type v) [Ring X] [Bialgebra R X] :
    BialgebraCat R

(R : Type u)
[CommRing R]
(X : Type v)
[Ring X]
[Bialgebra R X]

(BialgebraCat.of R X).instBialgebra = inferInstance


private lemma cube_of_castHom_ne_zero {n : ZMod 9} :
    castHom (show 3 ∣ 9 by norm_num) (ZMod 3) n ≠ 0 → n ^ 3 = 1 ∨ n ^ 3 = 8

(ZMod.castHom ⋯ (ZMod 3)) n ≠ 0 → n ^ 3 = 1 ∨ n ^ 3 = 8


/-- If `γ` is an invertible element of a linearly ordered group with zero element adjoined, then
`{γ}` is a neighbourhood of `γ`. -/
theorem singleton_mem_nhds_of_units (γ : Γ₀ˣ) : ({↑γ} : Set Γ₀) ∈ 𝓝 (γ : Γ₀)

{Γ₀ : Type u_2}
[LinearOrderedCommGroupWithZero Γ₀]
(γ : Γ₀ˣ)


@[simp]
theorem evalFrom_append_singleton (S : Set σ) (x : List α) (a : α) :
    M.evalFrom S (x ++ [a]) = M.stepSet (M.evalFrom S x) a

{α : Type u}
{σ : Type v}
(M : NFA α σ)
(S : Set σ)
(x : List α)
(a : α)


/-- Two n-simplices among cospherical points in an n-dimensional
subspace have the same circumradius. -/
theorem circumradius_eq_of_cospherical_subset {s : AffineSubspace ℝ P} {ps : Set P} (h : ps ⊆ s)
    [Nonempty s] {n : ℕ} [FiniteDimensional ℝ s.direction] (hd : finrank ℝ s.direction = n)
    (hc : Cospherical ps) {sx₁ sx₂ : Simplex ℝ P n} (hsx₁ : Set.range sx₁.points ⊆ ps)
    (hsx₂ : Set.range sx₂.points ⊆ ps) : sx₁.circumradius = sx₂.circumradius

(hd : FiniteDimensional.finrank ℝ ↥s.direction = n)


@[simp]
theorem ι_ne_one [Nontrivial R] (x : M) : ι R x ≠ 1

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


@[to_additive]
theorem mem_sInf {S : Set (Submonoid M)} {x : M} : x ∈ sInf S ↔ ∀ p ∈ S, x ∈ p

{M : Type u_1}
[MulOneClass M]
{S : Set (Submonoid M)}
{x : M}


theorem le_lfpApprox {a : Ordinal} : x ≤ lfpApprox f x a

{α : Type u}
[CompleteLattice α]
(f : α →o α)
(x : α)
{a : Ordinal.{u}}


theorem preimage_compl [BooleanAlgebra α] (hs : IsAntichain (· ≤ ·) s) :
    IsAntichain (· ≤ ·) (compl ⁻¹' s)

(hs : IsAntichain (fun x x_1 => x ≤ x_1) s)

IsAntichain (fun x x_1 => x ≤ x_1) (compl ⁻¹' s)


theorem ite_ite_distrib_right : ite p (ite q a b) c = ite q (ite p a c) (ite p b c)

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

(if p then if q then a else b else c) = if q then if p then a else c else if p then b else c


@[to_additive]
theorem Finset.univ_prod_mulSingle [Fintype I] (f : ∀ i, Z i) :
    (∏ i, Pi.mulSingle i (f i)) = f

{I : Type u_1}
[DecidableEq I]
{Z : I → Type u_2}
[(i : I) → AddCommMonoid (Z i)]
[Fintype I]
(f : (i : I) → Z i)


/-- If `f` belongs to `lpMeasSubgroup F m p μ`, then the measurable function it is almost
everywhere equal to (given by `AEMeasurable.mk`) belongs to `ℒp` for the measure `μ.trim hm`. -/
theorem memℒp_trim_of_mem_lpMeasSubgroup (hm : m ≤ m0) (f : Lp F p μ)
    (hf_meas : f ∈ lpMeasSubgroup F m p μ) :
    Memℒp (mem_lpMeasSubgroup_iff_aeStronglyMeasurable'.mp hf_meas).choose p (μ.trim hm)

(hf_meas : f ∈ MeasureTheory.lpMeasSubgroup F m p μ)

MeasureTheory.Memℒp (Exists.choose ⋯) p (μ.trim hm)


theorem nhdsSet_Ico (h : a < b) : 𝓝ˢ (Ico a b) = 𝓝 a ⊔ 𝓟 (Ioo a b)

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

𝓝ˢ (Set.Ico a b) = 𝓝 a ⊔ 𝓟 (Set.Ioo a b)


@[simp]
theorem append_nil : append xs nil = xs

{α : Type u_1}
{n : ℕ}
(xs : Mathlib.Vector α n)


theorem neg_vecMul [Fintype m] (v : m → α) (A : Matrix m n α) : (-v) ᵥ* A = - (v ᵥ* A)

{m : Type u_2}
{n : Type u_3}
{α : Type v}
[NonUnitalNonAssocRing α]
[Fintype m]
(v : m → α)
(A : Matrix m n α)


@[to_additive (attr := simp)]
theorem quotientiInfEmbedding_apply_mk {ι : Type*} (f : ι → Subgroup α) (g : α) (i : ι) :
    quotientiInfEmbedding f (QuotientGroup.mk g) i = QuotientGroup.mk g

{α : Type u_1}
[Group α]
{ι : Type u_2}
(f : ι → Subgroup α)
(g : α)
(i : ι)

(Subgroup.quotientiInfEmbedding f) (↑g) i = ↑g


@[simp]
theorem extend_extends {a b : X} (γ : Path a b) {t : ℝ}
    (ht : t ∈ (Icc 0 1 : Set ℝ)) : γ.extend t = γ ⟨t, ht⟩

{X : Type u_1}
[TopologicalSpace X]
{a b : X}
(γ : Path a b)
{t : ℝ}
(ht : t ∈ Set.Icc 0 1)


theorem pos_and_pos_or_neg_and_neg_of_mul_pos [PosMulMono α] [MulPosMono α] (hab : 0 < a * b) :
    0 < a ∧ 0 < b ∨ a < 0 ∧ b < 0

{α : Type u_1}
{a b : α}
[MulZeroClass α]
[LinearOrder α]
[PosMulMono α]
[MulPosMono α]
(hab : 0 < a * b)


theorem zero_mem_measureOfNegatives : (0 : ℝ) ∈ s.measureOfNegatives

{α : Type u_1}
[MeasurableSpace α]
{s : MeasureTheory.SignedMeasure α}


@[simp]
theorem toFun_eq_coe {f : α ≃o β} : f.toFun = f

{α : Type u_2}
{β : Type u_3}
[LE α]
[LE β]
{f : α ≃o β}


@[simp]
theorem toSmoothPartitionOfUnity_toPartitionOfUnity (f : BumpCovering ι M s)
    (hf : ∀ i, Smooth I 𝓘(ℝ) (f i)) :
    (f.toSmoothPartitionOfUnity hf).toPartitionOfUnity = f.toPartitionOfUnity

(hf : ∀ (i : ι), Smooth I 𝓘(ℝ, ℝ) ⇑(f i))


theorem sqLe_mul {d x y z w : ℕ} :
    (SqLe x 1 y d → SqLe z 1 w d → SqLe (x * w + y * z) d (x * z + d * y * w) 1) ∧
      (SqLe x 1 y d → SqLe w d z 1 → SqLe (x * z + d * y * w) 1 (x * w + y * z) d) ∧
        (SqLe y d x 1 → SqLe z 1 w d → SqLe (x * z + d * y * w) 1 (x * w + y * z) d) ∧
          (SqLe y d x 1 → SqLe w d z 1 → SqLe (x * w + y * z) d (x * z + d * y * w) 1)

(Zsqrtd.SqLe x 1 y d → Zsqrtd.SqLe z 1 w d → Zsqrtd.SqLe (x * w + y * z) d (x * z + d * y * w) 1) ∧
  (Zsqrtd.SqLe x 1 y d → Zsqrtd.SqLe w d z 1 → Zsqrtd.SqLe (x * z + d * y * w) 1 (x * w + y * z) d) ∧
    (Zsqrtd.SqLe y d x 1 → Zsqrtd.SqLe z 1 w d → Zsqrtd.SqLe (x * z + d * y * w) 1 (x * w + y * z) d) ∧
      (Zsqrtd.SqLe y d x 1 → Zsqrtd.SqLe w d z 1 → Zsqrtd.SqLe (x * w + y * z) d (x * z + d * y * w) 1)


theorem mem_extChartAt_source_of_eq_one {i : ι} {x : M} (h : fs i x = 1) :
    x ∈ (extChartAt I (fs.c i)).source

{ι : Type uι}
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[FiniteDimensional ℝ E]
{H : Type uH}
[TopologicalSpace H]
{I : ModelWithCorners ℝ E H}
{M : Type uM}
[TopologicalSpace M]
[ChartedSpace H M]
{s : Set M}
(fs : SmoothBumpCovering ι I M s)
{i : ι}
{x : M}
(h : ↑(fs.toFun i) x = 1)


@[simp]
theorem csInf_Ioo [DenselyOrdered α] (h : a < b) : sInf (Ioo a b) = a

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


theorem Ioc_eq_range' : Ioc a b = ⟨List.range' (a + 1) (b - a), List.nodup_range' _ _⟩

Finset.Ioc a b = { val := ↑(List.range' (a + 1) (b - a)), nodup := ⋯ }


/-- If a function has a Taylor series at order at least `1` on a neighborhood of `x`, then the term
of order `1` of this series is a derivative of `f` at `x`. -/
theorem HasFTaylorSeriesUpToOn.hasFDerivAt (h : HasFTaylorSeriesUpToOn n f p s) (hn : 1 ≤ n)
    (hx : s ∈ 𝓝 x) : HasFDerivAt f (continuousMultilinearCurryFin1 𝕜 E F (p x 1)) x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{s : Set E}
{f : E → F}
{x : E}
{n : ℕ∞}
{p : E → FormalMultilinearSeries 𝕜 E F}
(h : HasFTaylorSeriesUpToOn n f p s)
(hn : 1 ≤ n)
(hx : s ∈ 𝓝 x)

HasFDerivAt f ((continuousMultilinearCurryFin1 𝕜 E F) (p x 1)) x


@[simp]
theorem map_id_mk' {Q : Type*} [CommSemiring Q] [Algebra R Q] [IsLocalization M Q] (x) (y : M) :
    map Q (RingHom.id R) (le_refl M) (mk' S x y) = mk' Q 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_5}
[CommSemiring Q]
[Algebra R Q]
[IsLocalization M Q]
(x : R)
(y : ↥M)

(IsLocalization.map Q (RingHom.id R) ⋯) (IsLocalization.mk' S x y) = IsLocalization.mk' Q x y


@[reassoc]
lemma functorObj_comm :
    functorObjTop f πX ≫ ιFunctorObj f πX = functorObjLeft f πX ≫ ρFunctorObj f πX

[CategoryTheory.Limits.HasColimitsOfShape (CategoryTheory.Discrete (CategoryTheory.SmallObject.FunctorObjIndex f πX)) C]

[CategoryTheory.Limits.HasPushout (CategoryTheory.SmallObject.functorObjTop f πX)
    (CategoryTheory.SmallObject.functorObjLeft f πX)]

CategoryTheory.CategoryStruct.comp (CategoryTheory.SmallObject.functorObjTop f πX)
    (CategoryTheory.SmallObject.ιFunctorObj f πX) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.SmallObject.functorObjLeft f πX)
    (CategoryTheory.SmallObject.ρFunctorObj f πX)


/-- The uncurrying functor, taking a functor `C ⥤ (D ⥤ E)` and producing a functor `(C × D) ⥤ E`.
-/
@[simps]
def uncurry : (C ⥤ D ⥤ E) ⥤ C × D ⥤ E

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

∀ {X Y : CategoryTheory.Functor C (CategoryTheory.Functor D E)} (T : X ⟶ Y) (X_1 : C × D),
  (CategoryTheory.uncurry.map T).app X_1 = (T.app X_1.1).app X_1.2


theorem NF.below_of_lt' : ∀ {o b}, repr o < ω ^ b → NF o → NFBelow o b


/-- The normal closure of s is a normal subgroup. -/
theorem normalClosure.is_normal : IsNormalSubgroup (normalClosure s)


@[reassoc (attr := simp)]
lemma Scheme.iso_inv_val_base_hom_val_base {X Y : Scheme.{u}} (e : X ≅ Y) :
    e.inv.val.base ≫ e.hom.val.base = 𝟙 _

{X Y : AlgebraicGeometry.Scheme}
(e : X ≅ Y)

e.inv.val.base ≫ e.hom.val.base = 𝟙 ↑Y.toPresheafedSpace


theorem mem_compl_zeroLocus_iff_not_mem {f : A} {I : ProjectiveSpectrum 𝒜} :
    I ∈ (zeroLocus 𝒜 {f} : Set (ProjectiveSpectrum 𝒜))ᶜ ↔ f ∉ I.asHomogeneousIdeal

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

I ∈ (ProjectiveSpectrum.zeroLocus 𝒜 {f})ᶜ ↔ f ∉ I.asHomogeneousIdeal


@[to_additive]
theorem ContMDiffOn.mul (hf : ContMDiffOn I' I n f s) (hg : ContMDiffOn I' I n g s) :
    ContMDiffOn I' I n (f * g) s

{𝕜 : 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}
[Mul G]
[TopologicalSpace G]
[ChartedSpace H G]
[SmoothMul 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 g : M → G}
{s : Set M}
{n : ℕ∞}
(hf : ContMDiffOn I' I n f s)
(hg : ContMDiffOn I' I n g s)


theorem traverse_map (f : β → F γ) (g : α → β) (x : t α) :
    traverse f (g <$> x) = traverse (f ∘ g) x

{t : Type u → Type u}
[Traversable t]
[LawfulTraversable t]
{F : Type u → Type u}
[Applicative F]
[LawfulApplicative F]
{α β γ : Type u}
(f : β → F γ)
(g : α → β)
(x : t α)


theorem principal_add_iff_add_lt_ne_self {a} :
    Principal (· + ·) a ↔ ∀ ⦃b c⦄, b < a → c < a → b + c ≠ a

Ordinal.Principal (fun x x_1 => x + x_1) a ↔ ∀ ⦃b c : Ordinal.{u_1}⦄, b < a → c < a → b + c ≠ a


/-- The identity monoidal natural transformation. -/
@[simps!]
def id (F : LaxMonoidalFunctor C D) : MonoidalNatTrans F F

(F : CategoryTheory.LaxMonoidalFunctor C D)

(CategoryTheory.MonoidalNatTrans.id F).app X = 𝟙 (F.obj X)


theorem isOpen_uniformity {s : Set α} :
    IsOpen s ↔ ∀ x ∈ s, { p : α × α | p.1 = x → p.2 ∈ s } ∈ 𝓤 α

{α : Type ua}
[UniformSpace α]
{s : Set α}

IsOpen s ↔ ∀ x ∈ s, {p | p.1 = x → p.2 ∈ s} ∈ 𝓤 α


@[simp] theorem Unit.sizeOf (u : Unit) : sizeOf u = 1


lemma isLocalizedModule_iff_isLocalization' (R') [CommSemiring R'] [Algebra R R'] :
    IsLocalizedModule S (Algebra.ofId R R').toLinearMap ↔ IsLocalization S R'

{R : Type u_1}
[CommSemiring R]
(S : Submonoid R)
(R' : Type u_6)
[CommSemiring R']
[Algebra R R']


theorem matPolyEquiv_eval (M : Matrix n n R[X]) (r : R) (i j : n) :
    (matPolyEquiv M).eval (scalar n r) i j = (M i j).eval r

{R : Type u}
[CommRing R]
{n : Type v}
[DecidableEq n]
[Fintype n]
(M : Matrix n n R[X])
(r : R)
(i j : n)

Polynomial.eval ((Matrix.scalar n) r) (matPolyEquiv M) i j = Polynomial.eval r (M i j)


@[csimp] theorem takeWhile_eq_takeWhileTR : @takeWhile = @takeWhileTR


protected theorem equiv_empty (x : PSet) [IsEmpty x.Type] : Equiv x ∅


/--
Equivalent precoherent categories give equivalent coherent toposes.
-/
@[simps!]
def sheafCongrPrecoherent : haveI := e.precoherent
    Sheaf (coherentTopology C) A ≌ Sheaf (coherentTopology D) A

(X : CategoryTheory.Sheaf (CategoryTheory.coherentTopology D) A)

∀ (X_1 : Dᵒᵖ),
  ((e.sheafCongrPrecoherent A).counitIso.hom.app X).val.app X_1 = X.val.map (e.counitIso.inv.app (Opposite.unop X_1)).op


/-- Assumes right covariance. -/
theorem Right.mul_lt_one_of_lt_of_le_of_pos [MulPosStrictMono α] (ha : a < 1) (hb : b ≤ 1)
    (b0 : 0 < b) : a * b < 1

{α : Type u_1}
{a b : α}
[MulOneClass α]
[Zero α]
[Preorder α]
[MulPosStrictMono α]
(ha : a < 1)
(hb : b ≤ 1)
(b0 : 0 < b)


@[reassoc (attr := simp)]
theorem map_lift_pullbackComparison (f : X ⟶ Z) (g : Y ⟶ Z) [HasPullback f g]
    [HasPullback (G.map f) (G.map g)] {W : C} {h : W ⟶ X} {k : W ⟶ Y} (w : h ≫ f = k ≫ g) :
    G.map (pullback.lift _ _ w) ≫ pullbackComparison G f g =
      pullback.lift (G.map h) (G.map k) (by simp only [← G.map_comp, w])

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

G.map (CategoryTheory.Limits.pullback.lift h k w) ≫ CategoryTheory.Limits.pullbackComparison G f g =
  CategoryTheory.Limits.pullback.lift (G.map h) (G.map k) ⋯


protected theorem NeBot.vsub : NeBot f → NeBot g → NeBot (f -ᵥ g)

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


@[measurability]
theorem Finset.measurable_sup' {ι : Type*} {s : Finset ι} (hs : s.Nonempty) {f : ι → δ → α}
    (hf : ∀ n ∈ s, Measurable (f n)) : Measurable (s.sup' hs f)

{α : Type u_2}
{m : MeasurableSpace α}
{δ : Type u_3}
[MeasurableSpace δ]
[SemilatticeSup α]
[MeasurableSup₂ α]
{ι : Type u_4}
{s : Finset ι}
(hs : s.Nonempty)
{f : ι → δ → α}
(hf : ∀ n ∈ s, Measurable (f n))


@[simp, reassoc]
lemma NatTrans.leftDerivedToHomotopyCategory_comp {F G H : C ⥤ D} (α : F ⟶ G) (β : G ⟶ H)
    [F.Additive] [G.Additive] [H.Additive] :
    NatTrans.leftDerivedToHomotopyCategory (α ≫ β) =
      NatTrans.leftDerivedToHomotopyCategory α ≫
        NatTrans.leftDerivedToHomotopyCategory β

CategoryTheory.NatTrans.leftDerivedToHomotopyCategory (CategoryTheory.CategoryStruct.comp α β) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.NatTrans.leftDerivedToHomotopyCategory α)
    (CategoryTheory.NatTrans.leftDerivedToHomotopyCategory β)


@[simp]
theorem testBit_bitwise (f : Bool → Bool → Bool) (m n k) :
    testBit (bitwise f m n) k = f (testBit m k) (testBit n k)

(f : Bool → Bool → Bool)
(m n : ℤ)
(k : ℕ)

(Int.bitwise f m n).testBit k = f (m.testBit k) (n.testBit k)


lemma ofCauchy_intCast (z : ℤ) : (⟨z⟩ : ℝ) = z


theorem dropLast_sublist (l : List α) : l.dropLast <+ l


@[simp]
theorem coe_starAe : ⇑(starAe : ℍ[R,c₁,c₂] ≃ₐ[R] _) = op ∘ star

⇑QuaternionAlgebra.starAe = MulOpposite.op ∘ star


@[to_additive (attr := simp)]
theorem map_of (x) : map f (of x) = of (f x)

{α : Type u}
[Mul α]
{β : Type v}
[Mul β]
(f : α →ₙ* β)
(x : α)

(Magma.AssocQuotient.map f) (Magma.AssocQuotient.of x) = Magma.AssocQuotient.of (f x)


theorem le_toNNReal_of_coe_le {x : ℝ≥0} {y : ℝ} (h : ↑x ≤ y) : x ≤ y.toNNReal


@[to_additive (attr := simp)]
theorem coe_subtype : ⇑S.subtype = Subtype.val

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


@[simp]
theorem id_right : (𝟙 X : CommaMorphism X X).right = 𝟙 X.right

{A : Type u₁}
[CategoryTheory.Category.{v₁, u₁} A]
{B : Type u₂}
[CategoryTheory.Category.{v₂, u₂} B]
{T : Type u₃}
[CategoryTheory.Category.{v₃, u₃} T]
{L : CategoryTheory.Functor A T}
{R : CategoryTheory.Functor B T}
{X : CategoryTheory.Comma L R}

(CategoryTheory.CategoryStruct.id X).right = CategoryTheory.CategoryStruct.id X.right


@[simp]
theorem mem_strictlyPositive {x : E} : x ∈ strictlyPositive 𝕜 E ↔ 0 < x

(𝕜 : Type u_1)
(E : Type u_2)
[OrderedSemiring 𝕜]
[OrderedAddCommGroup E]
[Module 𝕜 E]
[OrderedSMul 𝕜 E]
{x : E}

x ∈ ConvexCone.strictlyPositive 𝕜 E ↔ 0 < x


lemma map_shiftFunctorComm_hom_app [F.CommShift B] (X : C) (a b : B) :
    F.map ((shiftFunctorComm C a b).hom.app X) = (F.commShiftIso b).hom.app (X⟦a⟧) ≫
      ((F.commShiftIso a).hom.app X)⟦b⟧' ≫ (shiftFunctorComm D a b).hom.app (F.obj X) ≫
      ((F.commShiftIso b).inv.app X)⟦a⟧' ≫ (F.commShiftIso a).inv.app (X⟦b⟧)

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_6, u_1} C]
[CategoryTheory.Category.{u_7, u_2} D]
(F : CategoryTheory.Functor C D)
{B : Type u_5}
[AddCommMonoid B]
[CategoryTheory.HasShift C B]
[CategoryTheory.HasShift D B]
[F.CommShift B]
(X : C)
(a b : B)

F.map ((CategoryTheory.shiftFunctorComm C a b).hom.app X) =
  CategoryTheory.CategoryStruct.comp ((F.commShiftIso b).hom.app ((CategoryTheory.shiftFunctor C a).obj X))
    (CategoryTheory.CategoryStruct.comp ((CategoryTheory.shiftFunctor D b).map ((F.commShiftIso a).hom.app X))
      (CategoryTheory.CategoryStruct.comp ((CategoryTheory.shiftFunctorComm D a b).hom.app (F.obj X))
        (CategoryTheory.CategoryStruct.comp ((CategoryTheory.shiftFunctor D a).map ((F.commShiftIso b).inv.app X))
          ((F.commShiftIso a).inv.app ((CategoryTheory.shiftFunctor C b).obj X)))))


theorem support_sum {α : Type*} [DecidableEq σ] {s : Finset α} {f : α → MvPolynomial σ R} :
    (∑ x ∈ s, f x).support ⊆ s.biUnion fun x => (f x).support

{R : Type u}
{σ : Type u_1}
[CommSemiring R]
{α : Type u_2}
[DecidableEq σ]
{s : Finset α}
{f : α → MvPolynomial σ R}


theorem UniformCauchySeqOnFilter.mono_right {p'' : Filter α} (hf : UniformCauchySeqOnFilter F p p')
    (hp : p'' ≤ p') : UniformCauchySeqOnFilter F p p''

{α : Type u}
{β : Type v}
{ι : Type x}
[UniformSpace β]
{F : ι → α → β}
{p : Filter ι}
{p' p'' : Filter α}
(hf : UniformCauchySeqOnFilter F p p')
(hp : p'' ≤ p')


@[reassoc (attr := simp)]
theorem w {s t : RightLift f g} (h : s ⟶ t) :
    h.left ▷ f ≫ t.counit = s.counit

{s t : CategoryTheory.Bicategory.RightLift f g}

CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.whiskerRight h.left f) t.counit = s.counit


theorem isPWO_sup [Preorder α] (s : Finset ι) {f : ι → Set α} :
    (s.sup f).IsPWO ↔ ∀ i ∈ s, (f i).IsPWO

{ι : Type u_1}
{α : Type u_2}
[Preorder α]
(s : Finset ι)
{f : ι → Set α}


theorem mul_right_inj_of_invertible : a * c = b * c ↔ a = b

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


@[to_additive (attr := simp)]
theorem preimage_smul_ball (c : G) (x : X) (r : ℝ) : (c • ·) ⁻¹' ball x r = ball (c⁻¹ • x) r

{G : Type v}
{X : Type w}
[PseudoMetricSpace X]
[Group G]
[MulAction G X]
[IsometricSMul G X]
(c : G)
(x : X)
(r : ℝ)

(fun x => c • x) ⁻¹' Metric.ball x r = Metric.ball (c⁻¹ • x) r


@[to_additive]
theorem disjoint_def' {H₁ H₂ : Subgroup G} :
    Disjoint H₁ H₂ ↔ ∀ {x y : G}, x ∈ H₁ → y ∈ H₂ → x = y → x = 1

{G : Type u_1}
[AddGroup G]
{H₁ H₂ : AddSubgroup G}

Disjoint H₁ H₂ ↔ ∀ {x y : G}, x ∈ H₁ → y ∈ H₂ → x = y → x = 0


/-- If `α` is a nonempty preorder with no minimal or maximal elements, then there exists a strictly
monotone function `f : ℤ → α`. -/
theorem exists_strictMono : ∃ f : ℤ → α, StrictMono f

(α : Type u)
[Preorder α]
[Nonempty α]
[NoMinOrder α]
[NoMaxOrder α]


/-- The image of a bounded set under a Lipschitz map is bounded. -/
theorem isBounded_image (hf : LipschitzWith K f) {s : Set α} (hs : IsBounded s) :
    IsBounded (f '' s)

{α : Type u}
{β : Type v}
[PseudoMetricSpace α]
[PseudoMetricSpace β]
{K : ℝ≥0}
{f : α → β}
(hf : LipschitzWith K f)
{s : Set α}
(hs : Bornology.IsBounded s)


@[reassoc (attr := simp)]
theorem pentagon_hom_inv_inv_inv_inv (f : a ⟶ b) (g : b ⟶ c) (h : c ⟶ d) (i : d ⟶ e) :
    f ◁ (α_ g h i).hom ≫ (α_ f g (h ≫ i)).inv ≫ (α_ (f ≫ g) h i).inv =
      (α_ f (g ≫ h) i).inv ≫ (α_ f g h).inv ▷ i

{B : Type u}
[CategoryTheory.Bicategory B]
{a b c d e : B}
(f : a ⟶ b)
(g : b ⟶ c)
(h : c ⟶ d)
(i : d ⟶ e)

CategoryTheory.CategoryStruct.comp
    (CategoryTheory.Bicategory.whiskerLeft f (CategoryTheory.Bicategory.associator g h i).hom)
    (CategoryTheory.CategoryStruct.comp
      (CategoryTheory.Bicategory.associator f g (CategoryTheory.CategoryStruct.comp h i)).inv
      (CategoryTheory.Bicategory.associator (CategoryTheory.CategoryStruct.comp f g) h i).inv) =
  CategoryTheory.CategoryStruct.comp
    (CategoryTheory.Bicategory.associator f (CategoryTheory.CategoryStruct.comp g h) i).inv
    (CategoryTheory.Bicategory.whiskerRight (CategoryTheory.Bicategory.associator f g h).inv i)


@[simp]
theorem map_subtype_embedding_uIcc : (uIcc a b).map valEmbedding = uIcc ↑a ↑b

Finset.map Fin.valEmbedding (Finset.uIcc a b) = Finset.uIcc ↑a ↑b


/-- Augment a cosimplicial object with an object. -/
@[simps]
def augment (X : CosimplicialObject C) (X₀ : C) (f : X₀ ⟶ X.obj [0])
    (w : ∀ (i : SimplexCategory) (g₁ g₂ : ([0] : SimplexCategory) ⟶ i),
      f ≫ X.map g₁ = f ≫ X.map g₂) : CosimplicialObject.Augmented C

(X : CategoryTheory.CosimplicialObject C)

(w : ∀ (i : SimplexCategory) (g₁ g₂ : SimplexCategory.mk 0 ⟶ i), f ≫ X.map g₁ = f ≫ X.map g₂)


theorem reflexive_reflTransGen : Reflexive (ReflTransGen r)


theorem fourier_norm [Fact (0 < T)] (n : ℤ) : ‖@fourier T n‖ = 1


theorem unop {W : MorphismProperty C} {L : Cᵒᵖ ⥤ Dᵒᵖ} (h : W.op.IsInvertedBy L) :
    W.IsInvertedBy L.unop

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{D : Type u'}
[CategoryTheory.Category.{v', u'} D]
{W : CategoryTheory.MorphismProperty C}
{L : CategoryTheory.Functor Cᵒᵖ Dᵒᵖ}
(h : W.op.IsInvertedBy L)


@[simp]
theorem pure_ne_bot {a : α} : pure a ≠ ⊥


theorem differentiable_cos : Differentiable ℂ cos


/-- If a number is Liouville with exponent `p`, then it is Liouville with any smaller exponent. -/
theorem mono (h : LiouvilleWith p x) (hle : q ≤ p) : LiouvilleWith q x

{p q x : ℝ}
(h : LiouvilleWith p x)
(hle : q ≤ p)


@[simp]
theorem mem_typeOf {φ : L[[α]].Sentence} :
    φ ∈ T.typeOf v ↔ (Formula.equivSentence.symm φ).Realize v

{L : FirstOrder.Language}
{T : L.Theory}
{α : Type w}
{M : Type w'}
[L.Structure M]
[Nonempty M]
[M ⊨ T]
{v : α → M}
{φ : L[[α]].Sentence}

φ ∈ T.typeOf v ↔ (FirstOrder.Language.Formula.equivSentence.symm φ).Realize v


/-- `C(·, Z)` is a functor. -/
theorem continuous_comp_left (f : C(X, Y)) : Continuous (fun g => g.comp f : C(Y, Z) → C(X, Z))

{X : Type u_2}
{Y : Type u_3}
{Z : Type u_4}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
(f : C(X, Y))


theorem gradedComm_gradedMul (x y : DirectSum _ 𝒜 ⊗[R] DirectSum _ ℬ) :
    gradedComm R 𝒜 ℬ (gradedMul R 𝒜 ℬ x y)
      = gradedMul R ℬ 𝒜 (gradedComm R 𝒜 ℬ x) (gradedComm R 𝒜 ℬ y)

(x y : DirectSum ι 𝒜 ⊗[R] DirectSum ι ℬ)

(TensorProduct.gradedComm R 𝒜 ℬ) (((TensorProduct.gradedMul R 𝒜 ℬ) x) y) =
  ((TensorProduct.gradedMul R ℬ 𝒜) ((TensorProduct.gradedComm R 𝒜 ℬ) x)) ((TensorProduct.gradedComm R 𝒜 ℬ) y)


@[simp] theorem UInt16.val_ofNat (n) :
    (no_index (OfNat.ofNat n) : UInt16).val = OfNat.ofNat n


/-- We say that a non-singular (`MeasureTheory.QuasiMeasurePreserving`) self-map is
*conservative* if for any measurable set `s` of positive measure there exists `x ∈ s` such that `x`
returns back to `s` under some iteration of `f`. -/
structure Conservative (f : α → α) (μ : Measure α) extends QuasiMeasurePreserving f μ μ : Prop where
  /-- If `f` is a conservative self-map and `s` is a measurable set of nonzero measure,
  then there exists a point `x ∈ s` that returns to `s` under a non-zero iteration of `f`. -/
  exists_mem_iterate_mem' : ∀ ⦃s⦄, MeasurableSet s → μ s ≠ 0 → ∃ x ∈ s, ∃ m ≠ 0, f^[m] x ∈ s

{α : Type u_2}
[MeasurableSpace α]
{f : α → α}
{μ : MeasureTheory.Measure α}
(self : MeasureTheory.Conservative f μ)
⦃s : Set α⦄

MeasurableSet s → μ s ≠ 0 → ∃ x ∈ s, ∃ m, m ≠ 0 ∧ f^[m] x ∈ s


@[to_additive le_sum_nonempty_of_subadditive_on_pred]
lemma le_prod_nonempty_of_submultiplicative_on_pred (f : α → β) (p : α → Prop)
    (h_mul : ∀ a b, p a → p b → f (a * b) ≤ f a * f b) (hp_mul : ∀ a b, p a → p b → p (a * b))
    (s : Multiset α) (hs_nonempty : s ≠ ∅) (hs : ∀ a, a ∈ s → p a) : f s.prod ≤ (s.map f).prod

(h_mul : ∀ (a b : α), p a → p b → f (a * b) ≤ f a * f b)

(hp_mul : ∀ (a b : α), p a → p b → p (a * b))


theorem IsMinFilter.comp_antitone (hf : IsMinFilter f l a) {g : β → γ} (hg : Antitone g) :
    IsMaxFilter (g ∘ f) l a

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


protected theorem IsOpen.locallyCompactSpace [LocallyCompactSpace X] {s : Set X} (hs : IsOpen s) :
    LocallyCompactSpace s

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


@[to_additive (attr := simp)]
lemma mul_inv_cancel_comm (a b : G) : a * b * a⁻¹ = b


theorem range_subset_range_iff_exists_comp {f : α → γ} {g : β → γ} :
    range f ⊆ range g ↔ ∃ h : α → β, f = g ∘ h

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{f : α → γ}
{g : β → γ}

Set.range f ⊆ Set.range g ↔ ∃ h, f = g ∘ h


theorem LinearMap.toMatrix₂_basisFun :
    LinearMap.toMatrix₂ (Pi.basisFun R n) (Pi.basisFun R m) =
    LinearMap.toMatrix₂' R (N₂ := N₂)

{R : Type u_1}
{N₂ : Type u_11}
{n : Type u_12}
{m : Type u_13}
[CommSemiring R]
[AddCommMonoid N₂]
[Module R N₂]
[DecidableEq n]
[Fintype n]
[DecidableEq m]
[Fintype m]


theorem DirectedOn.mono {s : Set α} (h : DirectedOn r s) (H : ∀ ⦃a b⦄, r a b → r' a b) :
    DirectedOn r' s

{α : Type u}
{r r' : α → α → Prop}
{s : Set α}
(h : DirectedOn r s)
(H : ∀ ⦃a b : α⦄, r a b → r' a b)


/-- Swapping the first and second points in an oriented angle negates the sign of that angle. -/
theorem oangle_swap₁₂_sign (p₁ p₂ p₃ : P) : -(∡ p₁ p₂ p₃).sign = (∡ p₂ p₁ p₃).sign

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


/-- The direction of an affine subspace constructed from a point and a direction. -/
@[simp]
theorem direction_mk' (p : P) (direction : Submodule k V) :
    (mk' p direction).direction = direction

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

(AffineSubspace.mk' p direction).direction = direction


@[simp]
lemma fromColumns_zero : fromColumns (0 : Matrix m n₁ R) (0 : Matrix m n₂ R) = 0

{R : Type u_1}
{m : Type u_2}
{n₁ : Type u_6}
{n₂ : Type u_7}
[Semiring R]


/-- 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)

∀ {X_1 Y : SimplexCategory} (f : X_1 ⟶ Y), X.rightOp.right.map f = (X.left.map f.op).op


theorem intermediate_value_Ioo' {a b : α} (hab : a ≤ b) {f : α → δ}
    (hf : ContinuousOn f (Icc a b)) : Ioo (f b) (f a) ⊆ f '' Ioo a b

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


theorem leftLim_le_rightLim (h : x ≤ y) : leftLim f x ≤ rightLim f y

{α : Type u_1}
{β : Type u_2}
[LinearOrder α]
[ConditionallyCompleteLinearOrder β]
[TopologicalSpace β]
[OrderTopology β]
{f : α → β}
(hf : Monotone f)
{x y : α}
(h : x ≤ y)

Function.leftLim f x ≤ Function.rightLim f y


theorem edist_congr_left {x y z : α} (h : edist x y = 0) : edist z x = edist z y

{α : Type u}
[PseudoEMetricSpace α]
{x y z : α}
(h : edist x y = 0)


lemma Scheme.Hom.stalkMap_surjective {X Y : Scheme} (f : Hom X Y) [IsPreimmersion f] (x) :
    Function.Surjective (f.stalkMap x)

{X Y : AlgebraicGeometry.Scheme}
(f : X.Hom Y)
[AlgebraicGeometry.IsPreimmersion f]
(x : ↑↑X.toPresheafedSpace)


/-- If `E` is a finite dimensional normed real vector space, `x : E`, and `s` is a neighborhood of
`x` that is not equal to the whole space, then there exists a point `y ∈ frontier s` at distance
`Metric.infDist x sᶜ` from `x`. See also
`IsCompact.exists_mem_frontier_infDist_compl_eq_dist`. -/
theorem exists_mem_frontier_infDist_compl_eq_dist {E : Type*} [NormedAddCommGroup E]
    [NormedSpace ℝ E] [FiniteDimensional ℝ E] {x : E} {s : Set E} (hx : x ∈ s) (hs : s ≠ univ) :
    ∃ y ∈ frontier s, Metric.infDist x sᶜ = dist x y

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[FiniteDimensional ℝ E]
{x : E}
{s : Set E}
(hx : x ∈ s)
(hs : s ≠ Set.univ)


theorem re_dotProduct_pos {M : Matrix n n 𝕜} (hM : M.PosDef) {x : n → 𝕜} (hx : x ≠ 0) :
    0 < RCLike.re (dotProduct (star x) (M *ᵥ x))

{n : Type u_2}
{𝕜 : Type u_4}
[Fintype n]
[RCLike 𝕜]
{M : Matrix n n 𝕜}
(hM : M.PosDef)
{x : n → 𝕜}
(hx : x ≠ 0)

0 < RCLike.re (Matrix.dotProduct (star x) (M.mulVec x))


theorem exists_mul_sub_mem_of_sub_one_mem_jacobson {I : Ideal R} (r : R) (h : r - 1 ∈ jacobson I) :
    ∃ s, s * r - 1 ∈ I

{R : Type u}
[Ring R]
{I : Ideal R}
(r : R)
(h : r - 1 ∈ I.jacobson)


theorem not_mem_top {n m : ℕ} : m ∉ Ico n m


lemma isOpen_mk {p h₁ h₂ h₃} : IsOpen[⟨p, h₁, h₂, h₃⟩] s ↔ p s

{h₂ : ∀ (s t : Set X), p s → p t → p (s ∩ t)}

{h₃ : ∀ (s : Set (Set X)), (∀ t ∈ s, p t) → p (⋃₀ s)}


theorem IsLeftRegular.right_of_commute {a : R}
    (ca : ∀ b, Commute a b) (h : IsLeftRegular a) : IsRightRegular a

{R : Type u_1}
[Mul R]
{a : R}
(ca : ∀ (b : R), Commute a b)
(h : IsLeftRegular a)


theorem denseRange_nnnorm : DenseRange (nnnorm : α → ℝ≥0)


lemma r_eq_none (i' : ι') (hi : ∀ i, e.f i ≠ i') :
    e.r i' = none

{ι : Type u_1}
{ι' : Type u_2}
{c : ComplexShape ι}
{c' : ComplexShape ι'}
(e : c.Embedding c')
(i' : ι')
(hi : ∀ (i : ι), e.f i ≠ i')


private theorem add_slash (k : ℤ) (A : GL(2, ℝ)⁺) (f g : ℍ → ℂ) :
    (f + g) ∣[k]A = f ∣[k]A + g ∣[k]A

ModularForm.slash k A (f + g) = ModularForm.slash k A f + ModularForm.slash k A g


@[to_additive]
theorem div_eq_mul_one_div (a b : G) : a / b = a * (1 / b)

{G : Type u_3}
[SubNegMonoid G]
(a b : G)


theorem moveLeft_card {b : Board} {m : ℤ × ℤ} (h : m ∈ left b) :
    Finset.card (moveLeft b m) + 2 = Finset.card b

(h : m ∈ SetTheory.PGame.Domineering.left b)

Finset.card (SetTheory.PGame.Domineering.moveLeft b m) + 2 = Finset.card b


@[simp]
theorem span_empty : lieSpan R L (∅ : Set M) = ⊥

(R : Type u)
(L : Type v)
(M : Type w)
[CommRing R]
[LieRing L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]


@[simp]
theorem range_snd : (snd R S).rangeS = ⊤

{R : Type u}
{S : Type v}
[NonAssocSemiring R]
[NonAssocSemiring S]


theorem cos_add_mul_I (x y : ℂ) : cos (x + y * I) = cos x * cosh y - sin x * sinh y * I

Complex.cos (x + y * Complex.I) = Complex.cos x * Complex.cosh y - Complex.sin x * Complex.sinh y * Complex.I


lemma negY_of_Z_eq_zero {P : Fin 3 → R} (hPz : P z = 0) : W'.negY P = -P y

{R : Type u}
[CommRing R]
{W' : WeierstrassCurve.Jacobian R}
{P : Fin 3 → R}
(hPz : P z = 0)


theorem comp_right_differentiable_iff {f : F → G} :
    Differentiable 𝕜 (f ∘ iso) ↔ Differentiable 𝕜 f

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
(iso : E ≃L[𝕜] F)
{f : F → G}

Differentiable 𝕜 (f ∘ ⇑iso) ↔ Differentiable 𝕜 f


theorem toNNReal_mul_top (a : ℝ≥0∞) : ENNReal.toNNReal (a * ∞) = 0


theorem sup_comm (a b : α) : a ⊔ b = b ⊔ a

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


/-- Given a locally-full and cover-dense functor `G` and a natural transformation of sheaves
`α : ℱ ⟶ ℱ'`, if the pullback of `α` along `G` is iso, then `α` is also iso.
-/
theorem iso_of_restrict_iso {ℱ ℱ' : Sheaf K A} (α : ℱ ⟶ ℱ') (i : IsIso (whiskerLeft G.op α.val)) :
    IsIso α

{K : CategoryTheory.GrothendieckTopology D}

(α : ℱ ⟶ ℱ')

(i : CategoryTheory.IsIso (CategoryTheory.whiskerLeft G.op α.val))


theorem mem_iff (a : α) (b : β a) : b ∈ Part.fix f a ↔ ∃ i, b ∈ approx f i a

(f : ((a : α) → Part (β a)) →o (a : α) → Part (β a))

b ∈ Part.fix (⇑f) a ↔ ∃ i, b ∈ Part.Fix.approx (⇑f) i a


@[simp] lemma coe_recolorOfEquiv (f : α ≃ β) :
    ⇑(G.recolorOfEquiv f) = (Embedding.completeGraph f).toHom.comp

{V : Type u}
(G : SimpleGraph V)
{α : Type u_1}
{β : Type u_2}
(f : α ≃ β)

⇑(G.recolorOfEquiv f) = (SimpleGraph.Embedding.completeGraph f.toEmbedding).toHom.comp


/-- Any structured arrow factors through a universal arrow. -/
@[reassoc (attr := simp)]
theorem fac (h : IsUniversal f) (g : StructuredArrow S T) :
    f.hom ≫ T.map (h.desc g) = g.hom

{f : CategoryTheory.StructuredArrow S T}

(g : CategoryTheory.StructuredArrow S T)

CategoryTheory.CategoryStruct.comp f.hom (T.map (h.desc g)) = g.hom


protected theorem map [BorelSpace α] [MeasurableSpace β] [TopologicalSpace β]
    [BorelSpace β] [Regular μ] (f : α ≃ₜ β) : (Measure.map f μ).Regular

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
[TopologicalSpace α]
{μ : MeasureTheory.Measure α}
[BorelSpace α]
[MeasurableSpace β]
[TopologicalSpace β]
[BorelSpace β]
[μ.Regular]
(f : α ≃ₜ β)


theorem uncurry_curry_continuous (hc : Continuous f) :
    Continuous <| (monotoneUncurry α β γ).comp <| f.comp <| monotoneCurry α β γ

[(x : α) → (y : β x) → OmegaCompletePartialOrder (γ x y)]

{f : ((x : α) → (y : β x) → γ x y) →o (x : α) → (y : β x) → γ x y}

(hc : OmegaCompletePartialOrder.Continuous f)

OmegaCompletePartialOrder.Continuous ((Pi.monotoneUncurry α β γ).comp (f.comp (Pi.monotoneCurry α β γ)))


theorem pairwise_of_forall {l : List α} (H : ∀ x y, R x y) : Pairwise R l

{α : Type u_1}
{R : α → α → Prop}
{l : List α}
(H : ∀ (x y : α), R x y)


@[simp]
theorem uIcc_mk_mk [LocallyFiniteOrder α] [LocallyFiniteOrder β]
    [DecidableRel ((· ≤ ·) : α × β → α × β → Prop)] (a₁ a₂ : α) (b₁ b₂ : β) :
    Finset.uIcc (a₁, b₁) (a₂, b₂) = Finset.uIcc a₁ a₂ ×ˢ Finset.uIcc b₁ b₂

{α : Type u_1}
{β : Type u_2}
[Lattice α]
[Lattice β]
[LocallyFiniteOrder α]
[LocallyFiniteOrder β]
[DecidableRel fun x x_1 => x ≤ x_1]
(a₁ a₂ : α)
(b₁ b₂ : β)


theorem nonTorsionWeight_of [NoZeroSMulDivisors ℕ M] (hw : ∀ i : σ, w i ≠ 0) :
    NonTorsionWeight w

{M : Type u_2}
{σ : Type u_3}
[CanonicallyOrderedAddCommMonoid M]
{w : σ → M}
[NoZeroSMulDivisors ℕ M]
(hw : ∀ (i : σ), w i ≠ 0)


theorem pow_ne_one_of_pos_of_lt (h0 : 0 < l) (hl : l < k) : ζ ^ l ≠ 1

{M : Type u_1}
[CommMonoid M]
{k l : ℕ}
{ζ : M}
(h : IsPrimitiveRoot ζ k)
(h0 : 0 < l)
(hl : l < k)


theorem toSubmodule_injective :
    Function.Injective (toSubmodule : NonUnitalSubalgebra R A → Submodule R A)

{R : Type u}
{A : Type v}
[CommSemiring R]
[NonUnitalNonAssocSemiring A]
[Module R A]


@[reassoc]
lemma pOpcycles_opcyclesToCycles_iCycles :
    K.pOpcycles i ≫ K.opcyclesToCycles i j ≫ K.iCycles j = K.d i j


theorem IsPushout.IsVanKampen.isPullback_of_mono_right [Mono g] {H : IsPushout f g h i}
    (H' : H.IsVanKampen) : IsPullback f g h i

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{W X Y Z : C}
{f : W ⟶ X}
{g : W ⟶ Y}
{h : X ⟶ Z}
{i : Y ⟶ Z}
[CategoryTheory.Mono g]
{H : CategoryTheory.IsPushout f g h i}
(H' : H.IsVanKampen)


lemma NoetherianObject.subobject_gt_wellFounded (X : C) [NoetherianObject X] :
    WellFounded ((· > ·) : Subobject X → Subobject X → Prop)

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
(X : C)
[CategoryTheory.NoetherianObject X]


/-- Multiplication as a multiplicative homomorphism. -/
@[to_additive (attr := simps) "Addition as an additive homomorphism."]
def mulMulHom [CommSemigroup α] :
    α × α →ₙ* α

{α : Type u_8}
[CommSemigroup α]
(a : α × α)


/-- An equivalence between `MonoOver A` and `MonoOver B` gives an equivalence
between `Subobject A` and `Subobject B`. -/
@[simps]
def lowerEquivalence {A : C} {B : D} (e : MonoOver A ≌ MonoOver B) : Subobject A ≌ Subobject B

(e : CategoryTheory.MonoOver A ≌ CategoryTheory.MonoOver B)

(CategoryTheory.Subobject.lowerEquivalence e).functor = CategoryTheory.Subobject.lower e.functor


theorem prod_list_swap_mem_alternatingGroup_iff_even_length {l : List (Perm α)}
    (hl : ∀ g ∈ l, IsSwap g) : l.prod ∈ alternatingGroup α ↔ Even l.length

{α : Type u_1}
[Fintype α]
[DecidableEq α]
{l : List (Equiv.Perm α)}
(hl : ∀ g ∈ l, g.IsSwap)


@[continuity]
theorem Continuous.inner (hf : Continuous f) (hg : Continuous g) : Continuous fun t => ⟪f t, g t⟫

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{α : Type u_4}
[TopologicalSpace α]
{f g : α → E}
(hf : Continuous f)
(hg : Continuous g)


theorem ConvexOn.le_right_of_left_le' (hf : ConvexOn 𝕜 s f) {x y : E} {a b : 𝕜} (hx : x ∈ s)
    (hy : y ∈ s) (ha : 0 ≤ a) (hb : 0 < b) (hab : a + b = 1) (hfx : f x ≤ f (a • x + b • y)) :
    f (a • x + b • y) ≤ f y

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_5}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[LinearOrderedCancelAddCommMonoid β]
[SMul 𝕜 E]
[Module 𝕜 β]
[OrderedSMul 𝕜 β]
{s : Set E}
{f : E → β}
(hf : ConvexOn 𝕜 s f)
{x y : E}
{a b : 𝕜}
(hx : x ∈ s)
(hy : y ∈ s)
(ha : 0 ≤ a)
(hb : 0 < b)
(hab : a + b = 1)
(hfx : f x ≤ f (a • x + b • y))


@[simp] theorem prodLeft_tmul (m₁ : M₁) (m₂ : M₂) (m₃ : M₃) :
    prodLeft R M₁ M₂ M₃ ((m₁, m₂) ⊗ₜ m₃) = (m₁ ⊗ₜ m₃, m₂ ⊗ₜ m₃)

(R : Type uR)
(M₁ : Type uM₁)
(M₂ : Type uM₂)
(M₃ : Type uM₃)
[CommSemiring R]
[AddCommMonoid M₁]
[AddCommMonoid M₂]
[AddCommMonoid M₃]
[Module R M₁]
[Module R M₂]
[Module R M₃]
(m₁ : M₁)
(m₂ : M₂)
(m₃ : M₃)

(TensorProduct.prodLeft R M₁ M₂ M₃) ((m₁, m₂) ⊗ₜ[R] m₃) = (m₁ ⊗ₜ[R] m₃, m₂ ⊗ₜ[R] m₃)


@[to_additive]
theorem orderOf_dvd_of_pow_eq_one (h : x ^ n = 1) : orderOf x ∣ n

{G : Type u_1}
[Monoid G]
{x : G}
{n : ℕ}
(h : x ^ n = 1)


/-- To prove a proposition about an arbitrary `Finset α`,
it suffices to prove it for the empty `Finset`,
and to show that if it holds for some `Finset α`,
then it holds for the `Finset` obtained by inserting a new element.
-/
@[elab_as_elim]
protected theorem induction_on {α : Type*} {p : Finset α → Prop} [DecidableEq α] (s : Finset α)
    (empty : p ∅) (insert : ∀ ⦃a : α⦄ {s : Finset α}, a ∉ s → p s → p (insert a s)) : p s


@[csimp] lemma choose_eq_fast_choose : Nat.choose = fast_choose


theorem elementarilyEquivalent (f : M ↪ₑ[L] N) : M ≅[L] N

{L : FirstOrder.Language}
{M : Type u_1}
{N : Type u_2}
[L.Structure M]
[L.Structure N]
(f : M ↪ₑ[L] N)


theorem superpolynomialDecay_mul_param_pow_iff (hk : Tendsto k l atTop) (n : ℕ) :
    SuperpolynomialDecay l k (f * k ^ n) ↔ SuperpolynomialDecay l k f

{α : Type u_1}
{β : Type u_2}
{l : Filter α}
{k : α → β}
(f : α → β)
[TopologicalSpace β]
[LinearOrderedField β]
[OrderTopology β]
(hk : Filter.Tendsto k l Filter.atTop)
(n : ℕ)

Asymptotics.SuperpolynomialDecay l k (f * k ^ n) ↔ Asymptotics.SuperpolynomialDecay l k f


theorem norm_eq_zero_iff {f : lp E p} : ‖f‖ = 0 ↔ f = 0

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


theorem ofStep_succ (n : ℕ) : (ofStep k (n + 1)).comp (toStepSucc k n) = ofStep k n

(AlgebraicClosureAux.ofStep k (n + 1)).comp (AlgebraicClosure.toStepSucc k n) = AlgebraicClosureAux.ofStep k n


theorem of.zero_exact_aux2 {x : FreeCommRing (Σi, G i)} {s t} [DecidablePred (· ∈ s)]
    [DecidablePred (· ∈ t)] (hxs : IsSupported x s) {j k} (hj : ∀ z : Σi, G i, z ∈ s → z.1 ≤ j)
    (hk : ∀ z : Σi, G i, z ∈ t → z.1 ≤ k) (hjk : j ≤ k) (hst : s ⊆ t) :
    f' j k hjk (lift (fun ix : s => f' ix.1.1 j (hj ix ix.2) ix.1.2) (restriction s x)) =
      lift (fun ix : t => f' ix.1.1 k (hk ix ix.2) ix.1.2) (restriction t x)

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

(f' j k hjk) ((FreeCommRing.lift fun ix => (f' (↑ix).fst j ⋯) (↑ix).snd) ((FreeCommRing.restriction s) x)) =
  (FreeCommRing.lift fun ix => (f' (↑ix).fst k ⋯) (↑ix).snd) ((FreeCommRing.restriction t) x)


theorem convs'Aux_stable_of_terminated {s : Stream'.Seq <| Pair K} (n_le_m : n ≤ m)
    (terminatedAt_n : s.TerminatedAt n) : convs'Aux s m = convs'Aux s n

{K : Type u_1}
{n m : ℕ}
[DivisionRing K]
{s : Stream'.Seq (GenContFract.Pair K)}
(n_le_m : n ≤ m)
(terminatedAt_n : s.TerminatedAt n)

GenContFract.convs'Aux s m = GenContFract.convs'Aux s n


@[simp]
theorem natSepDegree_smul_nonzero {x : F} (hx : x ≠ 0) :
    (x • f).natSepDegree = f.natSepDegree

{F : Type u}
[Field F]
(f : F[X])
{x : F}
(hx : x ≠ 0)


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

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


theorem OrderIso.map_radical (f : α ≃o β) : f (Order.radical α) = Order.radical β

{α : Type u_1}
[CompleteLattice α]
{β : Type u_2}
[CompleteLattice β]
(f : α ≃o β)


theorem mk_iUnion_eq_sum_mk_lift {α : Type u} {ι : Type v} {f : ι → Set α}
    (h : Pairwise fun i j => Disjoint (f i) (f j)) :
    lift.{v} #(⋃ i, f i) = sum fun i => #(f i)

Cardinal.lift.{v, u} (Cardinal.mk ↑(⋃ i, f i)) = Cardinal.sum fun i => Cardinal.mk ↑(f i)


@[simp]
theorem coe_mk (f : MultilinearMap R (fun _ : ι => M) N) (h) :
    ⇑(⟨f, h⟩ : M [⋀^ι]→ₗ[R] N) = f

(h : ∀ (v : ι → M) (i j : ι), v i = v j → i ≠ j → f.toFun v = 0)

⇑{ toMultilinearMap := f, map_eq_zero_of_eq' := h } = ⇑f


/-- A set is a neighborhood of `a` within `(-∞, a)` if and only if it contains an interval `[l, a)`
with `l < a`. -/
theorem mem_nhdsWithin_Iio_iff_exists_Ico_subset [NoMinOrder α] [DenselyOrdered α] {a : α}
    {s : Set α} : s ∈ 𝓝[<] a ↔ ∃ l ∈ Iio a, Ico l a ⊆ s

{α : Type u_1}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
[NoMinOrder α]
[DenselyOrdered α]
{a : α}
{s : Set α}

s ∈ 𝓝[<] a ↔ ∃ l ∈ Set.Iio a, Set.Ico l a ⊆ s


/-- A reformulation of `IsCyclotomicExtension` that uses `⊤`. -/
theorem iff_adjoin_eq_top :
    IsCyclotomicExtension S A B ↔
      (∀ n : ℕ+, n ∈ S → ∃ r : B, IsPrimitiveRoot r n) ∧
        adjoin A {b : B | ∃ n : ℕ+, n ∈ S ∧ b ^ (n : ℕ) = 1} = ⊤

(S : Set ℕ+)
(A : Type u)
(B : Type v)
[CommRing A]
[CommRing B]
[Algebra A B]

IsCyclotomicExtension S A B ↔ (∀ n ∈ S, ∃ r, IsPrimitiveRoot r ↑n) ∧ Algebra.adjoin A {b | ∃ n ∈ S, b ^ ↑n = 1} = ⊤


theorem ceil_eq_iff : ⌈a⌉ = z ↔ ↑z - 1 < a ∧ a ≤ z

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


/-- An isometry from an emetric space is injective -/
protected theorem injective (h : Isometry f) : Injective f

{α : Type u}
{β : Type v}
[EMetricSpace α]
[PseudoEMetricSpace β]
{f : α → β}
(h : Isometry f)


theorem Icc_subset_Ioo_iff (h₁ : a₁ ≤ b₁) : Icc a₁ b₁ ⊆ Ioo a₂ b₂ ↔ a₂ < a₁ ∧ b₁ < b₂

{α : Type u_2}
[Preorder α]
[LocallyFiniteOrder α]
{a₁ a₂ b₁ b₂ : α}
(h₁ : a₁ ≤ b₁)

Finset.Icc a₁ b₁ ⊆ Finset.Ioo a₂ b₂ ↔ a₂ < a₁ ∧ b₁ < b₂


theorem Valid.le_endPos : ∀ {s p}, Valid s p → p ≤ endPos s