/-- When `S₁.f` and `S₂.f` are zero and we have chosen limit kernel forks `c₁` and `c₂`
for `S₁.g` and `S₂.g` respectively, the action on right homology of a morphism `φ : S₁ ⟶ S₂` of
short complexes is given by the unique morphism `f : c₁.pt ⟶ c₂.pt` such that
`c₁.ι ≫ φ.τ₂ = f ≫ c₂.ι`. -/
@[simps]
def ofIsLimitKernelFork (φ : S₁ ⟶ S₂)
    (hf₁ : S₁.f = 0) (c₁ : KernelFork S₁.g) (hc₁ : IsLimit c₁)
    (hf₂ : S₂.f = 0) (c₂ : KernelFork S₂.g) (hc₂ : IsLimit c₂) (f : c₁.pt ⟶ c₂.pt)
    (comm : c₁.ι ≫ φ.τ₂ = f ≫ c₂.ι) :
    RightHomologyMapData φ (RightHomologyData.ofIsLimitKernelFork S₁ hf₁ c₁ hc₁)
      (RightHomologyData.ofIsLimitKernelFork S₂ hf₂ c₂ hc₂)

(c₁ : CategoryTheory.Limits.KernelFork S₁.g)

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

(c₂ : CategoryTheory.Limits.KernelFork S₂.g)

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

(comm :
  CategoryTheory.CategoryStruct.comp (CategoryTheory.Limits.Fork.ι c₁) φ.τ₂ =
    CategoryTheory.CategoryStruct.comp f (CategoryTheory.Limits.Fork.ι c₂))

(CategoryTheory.ShortComplex.RightHomologyMapData.ofIsLimitKernelFork φ hf₁ c₁ hc₁ hf₂ c₂ hc₂ f comm).φQ = φ.τ₂


protected theorem integrable_normed : Integrable (f.normed μ) μ


private lemma continuousAt_mul_symm1 {a b : EReal}
    (h : ContinuousAt (fun p : EReal × EReal ↦ p.1 * p.2) (a, b)) :
    ContinuousAt (fun p : EReal × EReal ↦ p.1 * p.2) (-a, b)

(h : ContinuousAt (fun p => p.1 * p.2) (a, b))

ContinuousAt (fun p => p.1 * p.2) (-a, b)


theorem inl_apply (x : A) : inl R A B x = (x, 0)

{R : Type u}
[Monoid R]
{A : Type v}
{B : Type w}
[NonUnitalNonAssocSemiring A]
[DistribMulAction R A]
[NonUnitalNonAssocSemiring B]
[DistribMulAction R B]
(x : A)


theorem encard_le_one_iff_eq : s.encard ≤ 1 ↔ s = ∅ ∨ ∃ x, s = {x}


theorem Antiperiodic.odd_nsmul_antiperiodic [AddMonoid α] [InvolutiveNeg β] (h : Antiperiodic f c)
    (n : ℕ) : Antiperiodic f ((2 * n + 1) • c)

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{c : α}
[AddMonoid α]
[InvolutiveNeg β]
(h : Function.Antiperiodic f c)
(n : ℕ)

Function.Antiperiodic f ((2 * n + 1) • c)


@[simp]
theorem domDomCongrₗ_refl :
    (domDomCongrₗ S (Equiv.refl ι) : M [⋀^ι]→ₗ[R] N ≃ₗ[S] M [⋀^ι]→ₗ[R] N) =
      LinearEquiv.refl _ _

{R : Type u_1}
[Semiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
{N : Type u_3}
[AddCommMonoid N]
[Module R N]
{ι : Type u_7}
(S : Type u_12)
[Semiring S]
[Module S N]
[SMulCommClass R S N]

AlternatingMap.domDomCongrₗ S (Equiv.refl ι) = LinearEquiv.refl S (M [⋀^ι]→ₗ[R] N)


theorem le_limsInf_of_le {f : Filter α} {a}
    (hf : f.IsCobounded (· ≥ ·) := by isBoundedDefault)
    (h : ∀ᶠ n in f, a ≤ n) : a ≤ limsInf f

(hf : Filter.IsCobounded (fun x x_1 => x ≥ x_1) f := by isBoundedDefault)


/-- A monotone function is almost everywhere differentiable, with derivative equal to the
Radon-Nikodym derivative of the associated Stieltjes measure with respect to Lebesgue. -/
theorem Monotone.ae_hasDerivAt {f : ℝ → ℝ} (hf : Monotone f) :
    ∀ᵐ x, HasDerivAt f (rnDeriv hf.stieltjesFunction.measure volume x).toReal x

∀ᵐ (x : ℝ), HasDerivAt f (hf.stieltjesFunction.measure.rnDeriv MeasureTheory.volume x).toReal x


theorem RingHom.PropertyIsLocal.respectsIso (hP : RingHom.PropertyIsLocal @P) :
    RingHom.RespectsIso @P

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


/-- The sum of the lower Lebesgue integrals of two functions is less than or equal to the integral
of their sum. The other inequality needs one of these functions to be (a.e.-)measurable. -/
theorem le_lintegral_add (f g : α → ℝ≥0∞) :
    ∫⁻ a, f a ∂μ + ∫⁻ a, g a ∂μ ≤ ∫⁻ a, f a + g a ∂μ

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

∫⁻ (a : α), f a ∂μ + ∫⁻ (a : α), g a ∂μ ≤ ∫⁻ (a : α), f a + g a ∂μ


@[to_additive]
theorem of_mulSupport_subset_isCompact [R1Space α] {K : Set α}
    (hK : IsCompact K) (h : mulSupport f ⊆ K) : HasCompactMulSupport f

{α : Type u_2}
{β : Type u_4}
[TopologicalSpace α]
[One β]
{f : α → β}
[R1Space α]
{K : Set α}
(hK : IsCompact K)
(h : Function.mulSupport f ⊆ K)


/-- The order isomorphism between ℕ and ℕ+ given by `succ`. -/
@[simps! (config := .asFn) apply]
def _root_.OrderIso.pnatIsoNat : ℕ+ ≃o ℕ


@[simp] theorem size_reverse (a : Array α) : a.reverse.size = a.size

{α : Type u_1}
(as : Array α)
(i : Nat)
(j : Fin as.size)

(Array.reverse.loop as i j).size = as.size


theorem Ico_union_Ico (h₁ : min a b ≤ max c d) (h₂ : min c d ≤ max a b) :
    Ico a b ∪ Ico c d = Ico (min a c) (max b d)

{α : Type u_1}
[LinearOrder α]
{a b c d : α}
(h₁ : min a b ≤ max c d)
(h₂ : min c d ≤ max a b)

Set.Ico a b ∪ Set.Ico c d = Set.Ico (min a c) (max b d)


lemma aeval_ofReal (p : ℝ[X]) (x : ℝ) : aeval (RCLike.ofReal x : K) p = eval x p

{K : Type u_1}
[RCLike K]
(p : Polynomial ℝ)
(x : ℝ)

(Polynomial.aeval ↑x) p = ↑(Polynomial.eval x p)


/-- The kernel of the adjoint action on a Lie algebra is equal to its center. -/
lemma ad_ker_eq_center : (ad R L).ker = LieAlgebra.center R L

(R : Type u_1)
(L : Type u_2)
[CommRing R]
[LieRing L]
[LieAlgebra R L]

(LieDerivation.ad R L).ker = LieAlgebra.center R L


lemma wellFounded_lt [LT α] [WellFoundedLT α] : @WellFounded α (· < ·)


theorem Specializes.prod {x₁ x₂ : X} {y₁ y₂ : Y} (hx : x₁ ⤳ x₂) (hy : y₁ ⤳ y₂) :
    (x₁, y₁) ⤳ (x₂, y₂)

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
{x₁ x₂ : X}
{y₁ y₂ : Y}
(hx : x₁ ⤳ x₂)
(hy : y₁ ⤳ y₂)


@[simp]
theorem equivAdjoinSimple_symm_aeval (pb : PowerBasis K L) (f : K[X]) :
    pb.equivAdjoinSimple.symm (aeval pb.gen f) = aeval (AdjoinSimple.gen K pb.gen) f

{K : Type u_1}
{L : Type u_2}
[Field K]
[Field L]
[Algebra K L]
(pb : PowerBasis K L)
(f : K[X])

pb.equivAdjoinSimple.symm ((Polynomial.aeval pb.gen) f) =
  (Polynomial.aeval (IntermediateField.AdjoinSimple.gen K pb.gen)) f


/-- Auxiliary lemma for `rnDeriv_add_right_of_mutuallySingular`. -/
lemma rnDeriv_add_right_of_mutuallySingular' {ν' : Measure α}
    [SigmaFinite μ] [SigmaFinite ν] [SigmaFinite ν']
    (hμν' : μ ⟂ₘ ν') (hνν' : ν ⟂ₘ ν') :
    μ.rnDeriv (ν + ν') =ᵐ[ν] μ.rnDeriv ν

{α : Type u_1}
{m : MeasurableSpace α}
{μ ν ν' : MeasureTheory.Measure α}
[MeasureTheory.SigmaFinite μ]
[MeasureTheory.SigmaFinite ν]
[MeasureTheory.SigmaFinite ν']
(hμν' : μ ⟂ₘ ν')
(hνν' : ν ⟂ₘ ν')


protected theorem map_of_continuous [BorelSpace α] [MeasurableSpace β] [TopologicalSpace β]
    [BorelSpace β] [h : InnerRegularCompactLTTop μ] {f : α → β} (hf : Continuous f) :
    InnerRegularCompactLTTop (Measure.map f μ)

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
[TopologicalSpace α]
{μ : MeasureTheory.Measure α}
[BorelSpace α]
[MeasurableSpace β]
[TopologicalSpace β]
[BorelSpace β]
[h : μ.InnerRegularCompactLTTop]
{f : α → β}
(hf : Continuous f)


theorem mul_inv_le_iff₀ (hc : c ≠ 0) : a * c⁻¹ ≤ b ↔ a ≤ b * c

{α : Type u_1}
[LinearOrderedCommGroupWithZero α]
{a b c : α}
(hc : c ≠ 0)


@[to_additive (attr := simp)]
theorem mul_seq {α β : Type u} {f g : FreeMagma (α → β)} {x : FreeMagma α} :
    f * g <*> x = (f <*> x) * (g <*> x)

{α β : Type u}
{f g : FreeAddMagma (α → β)}
{x : FreeAddMagma α}

(Seq.seq (f + g) fun x_1 => x) = (Seq.seq f fun x_1 => x) + Seq.seq g fun x_1 => x


theorem HasBasis.comp_surjective (h : l.HasBasis p s) {g : ι' → ι} (hg : Function.Surjective g) :
    l.HasBasis (p ∘ g) (s ∘ g)

{α : Type u_1}
{ι : Sort u_4}
{ι' : Sort u_5}
{l : Filter α}
{p : ι → Prop}
{s : ι → Set α}
(h : l.HasBasis p s)
{g : ι' → ι}
(hg : Function.Surjective g)


theorem memℓp_gen {f : ∀ i, E i} (hf : Summable fun i => ‖f i‖ ^ p.toReal) : Memℓp f p


/-- If the `vectorSpan` of a finite subset of an affinely independent
family lies in a submodule with dimension one less than its
cardinality, it equals that submodule. -/
theorem AffineIndependent.vectorSpan_image_finset_eq_of_le_of_card_eq_finrank_add_one
    [DecidableEq P] {p : ι → P}
    (hi : AffineIndependent k p) {s : Finset ι} {sm : Submodule k V} [FiniteDimensional k sm]
    (hle : vectorSpan k (s.image p : Set P) ≤ sm) (hc : Finset.card s = finrank k sm + 1) :
    vectorSpan k (s.image p : Set P) = sm

(hle : vectorSpan k ↑(Finset.image p s) ≤ sm)

(hc : s.card = FiniteDimensional.finrank k ↥sm + 1)


theorem totalize_of_not_le {i j} (h : ¬i ≤ j) : totalize G f i j = 0

{R : Type u}
[Ring R]
{ι : Type v}
[Preorder ι]
{G : ι → Type w}
[(i : ι) → AddCommGroup (G i)]
[(i : ι) → Module R (G i)]
{f : (i j : ι) → i ≤ j → G i →ₗ[R] G j}
{i j : ι}
(h : ¬i ≤ j)


@[simp] theorem utf8Len_nil : utf8Len [] = 0


theorem mem_lowerBounds_image2_of_mem_lowerBounds_of_mem_upperBounds (ha : a ∈ lowerBounds s)
    (hb : b ∈ upperBounds t) : f a b ∈ lowerBounds (image2 f s t)

{f : α → β → γ}

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


protected theorem measurable_comp_iff {f : β → γ} (e : α ≃ᵐ β) :
    Measurable (f ∘ e) ↔ Measurable f

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[MeasurableSpace α]
[MeasurableSpace β]
[MeasurableSpace γ]
{f : β → γ}
(e : α ≃ᵐ β)


@[simp]
theorem sup_apply (m₁ m₂ : OuterMeasure α) (s : Set α) : (m₁ ⊔ m₂) s = m₁ s ⊔ m₂ s

{α : Type u_1}
(m₁ m₂ : MeasureTheory.OuterMeasure α)
(s : Set α)


/-- Useful to use together with `Continuous.comp₂`. -/
theorem IsBoundedBilinearMap.continuous (h : IsBoundedBilinearMap 𝕜 f) : Continuous 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]
{f : E × F → G}
(h : IsBoundedBilinearMap 𝕜 f)


/-- Given a path `p`, we can define a `Homotopy p p` by `F (t, x) = p x`.
-/
@[simps!]
def refl (p : Path x₀ x₁) : Homotopy p p

{X : Type u}
[TopologicalSpace X]
{x₀ x₁ : X}
(p : Path x₀ x₁)
(x : ↑I × ↑I)


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

(X : CategoryTheory.Endofunctor.Algebra F₂)

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


/-- Homotopy between morphisms of short complexes is compatible with composition. -/
@[simps!]
def comp (h : Homotopy φ₁ φ₂) {ψ₁ ψ₂ : S₂ ⟶ S₃} (h' : Homotopy ψ₁ ψ₂) :
    Homotopy (φ₁ ≫ ψ₁) (φ₂ ≫ ψ₂)

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

{φ₁ φ₂ : S₁ ⟶ S₂}

(h : CategoryTheory.ShortComplex.Homotopy φ₁ φ₂)

{ψ₁ ψ₂ : S₂ ⟶ S₃}

(h' : CategoryTheory.ShortComplex.Homotopy ψ₁ ψ₂)

(h.comp h').h₂ = CategoryTheory.CategoryStruct.comp h.h₂ ψ₁.τ₂ + CategoryTheory.CategoryStruct.comp φ₂.τ₃ h'.h₂


theorem condexp_stopping_time_ae_eq_restrict_eq [FirstCountableTopology ι]
    [SigmaFiniteFiltration μ ℱ] (hτ : IsStoppingTime ℱ τ)
    [SigmaFinite (μ.trim hτ.measurableSpace_le)] (i : ι) :
    μ[f|hτ.measurableSpace] =ᵐ[μ.restrict {x | τ x = i}] μ[f|ℱ i]

μ[f|hτ.measurableSpace] =ᵐ[μ.restrict {x | τ x = i}] μ[f|↑ℱ i]


theorem imagePresheaf_comp_le (f₁ : F ⟶ F') (f₂ : F' ⟶ F'') :
    imagePresheaf (f₁ ≫ f₂) ≤ imagePresheaf f₂

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{F F' F'' : Cᵒᵖ ⥤ Type w}
(f₁ : F ⟶ F')
(f₂ : F' ⟶ F'')

CategoryTheory.GrothendieckTopology.imagePresheaf (f₁ ≫ f₂) ≤ CategoryTheory.GrothendieckTopology.imagePresheaf f₂


@[to_additive (attr := simp)]
theorem OrderIso.mulRight_symm (a : α) : (OrderIso.mulRight a).symm = OrderIso.mulRight a⁻¹

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

(OrderIso.addRight a).symm = OrderIso.addRight (-a)


/-- The canonical algebra map from adic cauchy sequences to the adic completion. -/
@[simps!]
def mkₐ : AdicCauchySequence I R →ₐ[R] AdicCompletion I R

(a : AdicCompletion.AdicCauchySequence I R)

↑((AdicCompletion.mkₐ I) a) n = (Ideal.Quotient.mk (I ^ n • ⊤)) (↑a n)


/-- The kernel of a homomorphism to a field is a maximal ideal. -/
theorem ker_isMaximal_of_surjective {R K F : Type*} [Ring R] [Field K]
    [FunLike F R K] [RingHomClass F R K] (f : F)
    (hf : Function.Surjective f) : (ker f).IsMaximal

{R : Type u_1}
{K : Type u_2}
{F : Type u_3}
[Ring R]
[Field K]
[FunLike F R K]
[RingHomClass F R K]
(f : F)
(hf : Function.Surjective ⇑f)


theorem HasImage.uniq (F' : MonoFactorisation f) (l : image f ⟶ F'.I) (w : l ≫ F'.m = image.ι f) :
    l = image.lift F'

(F' : CategoryTheory.Limits.MonoFactorisation f)

(l : CategoryTheory.Limits.image f ⟶ F'.I)

(w : l ≫ F'.m = CategoryTheory.Limits.image.ι f)


@[to_additive (attr := simp)]
theorem coe_map (f : G →* N) (K : Subgroup G) : (K.map f : Set N) = f '' K

{G : Type u_1}
[AddGroup G]
{N : Type u_5}
[AddGroup N]
(f : G →+ N)
(K : AddSubgroup G)


theorem mem_ndinsert_of_mem {a b : α} {s : Multiset α} (h : a ∈ s) : a ∈ ndinsert b s

{α : Type u_1}
[DecidableEq α]
{a b : α}
{s : Multiset α}
(h : a ∈ s)


theorem continuous_id_iff_le {t t' : TopologicalSpace α} : Continuous[t, t'] id ↔ t ≤ t'

{α : Type u}
{t t' : TopologicalSpace α}


/-- A holomorphic function on a compact complex manifold is locally constant. -/
protected theorem isLocallyConstant {f : M → F} (hf : MDifferentiable I 𝓘(ℂ, F) f) :
    IsLocallyConstant f

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
{F : Type u_2}
[NormedAddCommGroup F]
[NormedSpace ℂ F]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners ℂ E H}
[I.Boundaryless]
{M : Type u_4}
[TopologicalSpace M]
[CompactSpace M]
[ChartedSpace H M]
[SmoothManifoldWithCorners I M]
{f : M → F}
(hf : MDifferentiable I 𝓘(ℂ, F) f)


theorem pi_ext'_iff : f = g ↔ ∀ i, f.comp (single i) = g.comp (single i)

{R : Type u}
{M : Type v}
{ι : Type x}
[Semiring R]
{φ : ι → Type i}
[(i : ι) → AddCommMonoid (φ i)]
[(i : ι) → Module R (φ i)]
[Finite ι]
[DecidableEq ι]
[AddCommMonoid M]
[Module R M]
{f g : ((i : ι) → φ i) →ₗ[R] M}

f = g ↔ ∀ (i : ι), f ∘ₗ LinearMap.single i = g ∘ₗ LinearMap.single i


/-- A *trail* is a walk with no repeating edges. -/
@[mk_iff isTrail_def]
structure IsTrail {u v : V} (p : G.Walk u v) : Prop where
  edges_nodup : p.edges.Nodup

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


/-- A category is `EssentiallySmall.{w}` if there exists
an equivalence to some `S : Type w` with `[SmallCategory S]`. -/
@[pp_with_univ]
class EssentiallySmall (C : Type u) [Category.{v} C] : Prop where
  /-- An essentially small category is equivalent to some small category. -/
  equiv_smallCategory : ∃ (S : Type w) (_ : SmallCategory S), Nonempty (C ≌ S)

[self : CategoryTheory.EssentiallySmall.{w, v, u} C]


theorem orderIsoOfSurjective_self_symm_apply (b : β) :
    f ((orderIsoOfSurjective f h_mono h_surj).symm b) = b

{α : Type u_2}
{β : Type u_3}
[LinearOrder α]
[Preorder β]
(f : α → β)
(h_mono : StrictMono f)
(h_surj : Function.Surjective f)
(b : β)

f ((StrictMono.orderIsoOfSurjective f h_mono h_surj).symm b) = b


@[to_additive]
theorem subgroupOf_bot_eq_bot : H.subgroupOf ⊥ = ⊥

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


theorem map_comap_eq (f : R →+* S) (t : Subring S) : (t.comap f).map f = t ⊓ f.range

{R : Type u}
{S : Type v}
[Ring R]
[Ring S]
(f : R →+* S)
(t : Subring S)

Subring.map f (Subring.comap f t) = t ⊓ f.range


@[to_additive]
theorem coe_iSup_of_directed {S : ι → Subsemigroup M} (hS : Directed (· ≤ ·) S) :
    ((⨆ i, S i : Subsemigroup M) : Set M) = ⋃ i, S i

(hS : Directed (fun x x_1 => x ≤ x_1) S)


theorem toFilterDistortioniUnion_neBot (l : IntegrationParams) (I : Box ι) (π₀ : Prepartition I)
    (hc₁ : π₀.distortion ≤ c) (hc₂ : π₀.compl.distortion ≤ c) :
    (l.toFilterDistortioniUnion I c π₀).NeBot

{ι : Type u_1}
[Fintype ι]
{c : ℝ≥0}
(l : BoxIntegral.IntegrationParams)
(I : BoxIntegral.Box ι)
(π₀ : BoxIntegral.Prepartition I)
(hc₁ : π₀.distortion ≤ c)
(hc₂ : π₀.compl.distortion ≤ c)


/-- Functorially precompose a cocone for `F` by a natural transformation `G ⟶ F` to give a cocone
for `G`. -/
@[simps]
def precompose {G : J ⥤ C} (α : G ⟶ F) : Cocone F ⥤ Cocone G

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{F G : J ⥤ C}
(α : G ⟶ F)

∀ {X Y : CategoryTheory.Limits.Cocone F} (f : X ⟶ Y), ((CategoryTheory.Limits.Cocones.precompose α).map f).hom = f.hom


/-- A version of `UniformOnFun.hasBasis_uniformity_of_basis`
with weaker conclusion and weaker assumptions.

We make no assumptions about the set `𝔖`
but conclude only that the uniformity is equal to some indexed infimum. -/
protected theorem uniformity_eq_of_basis {ι : Sort*} {p : ι → Prop} {V : ι → Set (β × β)}
    (h : (𝓤 β).HasBasis p V) :
    𝓤 (α →ᵤ[𝔖] β) = ⨅ s ∈ 𝔖, ⨅ (i) (_ : p i), 𝓟 (UniformOnFun.gen 𝔖 s (V i))

{α : Type u_1}
(β : Type u_2)
[UniformSpace β]
(𝔖 : Set (Set α))
{ι : Sort u_5}
{p : ι → Prop}
{V : ι → Set (β × β)}
(h : (𝓤 β).HasBasis p V)

𝓤 (α →ᵤ[𝔖] β) = ⨅ s ∈ 𝔖, ⨅ i, ⨅ (_ : p i), 𝓟 (UniformOnFun.gen 𝔖 s (V i))


theorem range_pullback_to_base_of_right :
    Set.range (pullback.fst g f ≫ g).1.base =
      Set.range g.1.base ∩ Set.range f.1.base

[H : AlgebraicGeometry.IsOpenImmersion f]

Set.range ⇑(CategoryTheory.Limits.pullback.fst g f ≫ g).val.base = Set.range ⇑g.val.base ∩ Set.range ⇑f.val.base


theorem ContDiffAt.arctan (h : ContDiffAt ℝ n f x) : ContDiffAt ℝ n (fun x => arctan (f x)) x

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : E → ℝ}
{x : E}
{n : ℕ∞}
(h : ContDiffAt ℝ n f x)

ContDiffAt ℝ n (fun x => Real.arctan (f x)) x


theorem bagInter_sublist_left : ∀ l₁ l₂ : List α, l₁.bagInter l₂ <+ l₁

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


@[to_additive]
theorem mul {U : Set G} : U ∈ B → ∃ V ∈ B, V * V ⊆ U

{G : Type u}
[AddGroup G]
{B : AddGroupFilterBasis G}
{U : Set G}


theorem irreducible_or_factor {α} [Monoid α] (x : α) (h : ¬IsUnit x) :
    Irreducible x ∨ ∃ a b, ¬IsUnit a ∧ ¬IsUnit b ∧ a * b = x

{α : Type u_5}
[Monoid α]
(x : α)
(h : ¬IsUnit x)


theorem not_mem_Ioi_self {b : α} : b ∉ Ioi b

{α : Type u_2}
[PartialOrder α]
[LocallyFiniteOrderTop α]
{b : α}


theorem map_comp (g : β → γ) : (p.map f).map g = p.map (g ∘ f)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
(f : α → β)
(p : PMF α)
(g : β → γ)

PMF.map g (PMF.map f p) = PMF.map (g ∘ f) p


nonrec theorem SmoothAt.prod_map (hf : SmoothAt I I' f x) (hg : SmoothAt J J' g y) :
    SmoothAt (I.prod J) (I'.prod J') (Prod.map f g) (x, y)

{𝕜 : 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]
{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 : Type u_11}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type u_12}
[TopologicalSpace G]
{J : ModelWithCorners 𝕜 F G}
{N : Type u_13}
[TopologicalSpace N]
[ChartedSpace G N]
{F' : Type u_14}
[NormedAddCommGroup F']
[NormedSpace 𝕜 F']
{G' : Type u_15}
[TopologicalSpace G']
{J' : ModelWithCorners 𝕜 F' G'}
{N' : Type u_16}
[TopologicalSpace N']
[ChartedSpace G' N']
{f : M → M'}
{x : M}
{g : N → N'}
{y : N}
(hf : SmoothAt I I' f x)
(hg : SmoothAt J J' g y)


theorem bot_eq_top_iff_rank_eq_one [Nontrivial E] [Module.Free F E] :
    (⊥ : Subalgebra F E) = ⊤ ↔ Module.rank F E = 1

{F : Type u_1}
{E : Type u_2}
[CommRing F]
[StrongRankCondition F]
[Ring E]
[Algebra F E]
[Nontrivial E]
[Module.Free F E]


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

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


/-- `γ`-valued functions on `α × β` are equivalent to functions `α → β → γ`. -/
@[simps (config := .asFn)]
def curry (α β γ) : (α × β → γ) ≃ (α → β → γ)

(α : Type u_1)
(β : Type u_2)
(γ : Type u_3)

⇑(Equiv.curry α β γ).symm = Function.uncurry


theorem iInter_Iio_of_not_bddBelow_range (hf : ¬ BddBelow (range f)) : ⋂ i, Iio (f i) = ∅

{ι : Sort u}
{α : Type v}
[LinearOrder α]
{f : ι → α}
(hf : ¬BddBelow (Set.range f))


/-- The category of types has `X × Y`, the usual cartesian product,
as the binary product of `X` and `Y`.
-/
@[simps]
def binaryProductLimitCone (X Y : Type u) : Limits.LimitCone (pair X Y)

(CategoryTheory.Limits.Types.binaryProductLimitCone X Y).cone = CategoryTheory.Limits.Types.binaryProductCone X Y


theorem image_mul_left_Ioo {a : α} (h : 0 < a) (b c : α) :
    (a * ·) '' Ioo b c = Ioo (a * b) (a * c)

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

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


theorem prod_dvd_iff' {u : PrimeMultiset} {n : ℕ+} : u.prod ∣ n ↔ u ≤ n.factorMultiset


theorem pow_sub' (A : M) {m n : ℕ} (ha : IsUnit A.det) (h : n ≤ m) :
    A ^ (m - n) = A ^ m * (A ^ n)⁻¹

{n' : Type u_1}
[DecidableEq n']
[Fintype n']
{R : Type u_2}
[CommRing R]
(A : Matrix n' n' R)
{m n : ℕ}
(ha : IsUnit A.det)
(h : n ≤ m)


/-- Each class in the class group contains an ideal `J`
such that `M := Π m ∈ finsetApprox` is in `J`. -/
theorem exists_mk0_eq_mk0 [IsDedekindDomain S] [Algebra.IsAlgebraic R L] (I : (Ideal S)⁰) :
    ∃ J : (Ideal S)⁰,
      ClassGroup.mk0 I = ClassGroup.mk0 J ∧
        algebraMap _ _ (∏ m ∈ finsetApprox bS adm, m) ∈ (J : Ideal S)

{R : Type u_1}
{S : Type u_2}
(L : Type u_4)
[EuclideanDomain R]
[CommRing S]
[IsDomain S]
[Field L]
[algRL : Algebra R L]
[Algebra R S]
[Algebra S L]
[ist : IsScalarTower R S L]
[iic : IsIntegralClosure S R L]
{abv : AbsoluteValue R ℤ}
{ι : Type u_5}
[DecidableEq ι]
[Fintype ι]
(bS : Basis ι R S)
(adm : abv.IsAdmissible)
[Infinite R]
[DecidableEq R]
[IsDedekindDomain S]
[Algebra.IsAlgebraic R L]
(I : ↥(Ideal S)⁰)

∃ J, ClassGroup.mk0 I = ClassGroup.mk0 J ∧ (algebraMap R S) (∏ m ∈ ClassGroup.finsetApprox bS adm, m) ∈ ↑J


theorem smul_comp (p : Seminorm 𝕜₂ E₂) (f : E →ₛₗ[σ₁₂] E₂) (c : R) :
    (c • p).comp f = c • p.comp f

{R : Type u_1}
{𝕜 : Type u_3}
{𝕜₂ : Type u_4}
{E : Type u_7}
{E₂ : Type u_8}
[SeminormedRing 𝕜]
[SeminormedRing 𝕜₂]
{σ₁₂ : 𝕜 →+* 𝕜₂}
[RingHomIsometric σ₁₂]
[AddCommGroup E]
[AddCommGroup E₂]
[Module 𝕜 E]
[Module 𝕜₂ E₂]
[SMul R ℝ]
[SMul R ℝ≥0]
[IsScalarTower R ℝ≥0 ℝ]
(p : Seminorm 𝕜₂ E₂)
(f : E →ₛₗ[σ₁₂] E₂)
(c : R)


theorem span_mono (h : s ⊆ t) : span R s ≤ span R t

{R : Type u_1}
{M : Type u_4}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{s t : Set M}
(h : s ⊆ t)


@[simp]
theorem bihimp_iff_iff {p q : Prop} : p ⇔ q ↔ (p ↔ q)


theorem factors_prod_eq_basis_of_eq {x y : (π C fun x ↦ x ∈ s)} (h : y = x) :
    (factors C s x).prod y = 1

{x y : ↑(Profinite.NobelingProof.π C fun x => x ∈ s)}

(Profinite.NobelingProof.factors C s x).prod y = 1


/-- The function `fun t ↦ Ring.inverse (x + t) - x⁻¹` is `O(t)` as `t → 0`. -/
theorem inverse_add_norm_diff_first_order (x : Rˣ) :
    (fun t : R => inverse (↑x + t) - ↑x⁻¹) =O[𝓝 0] fun t => ‖t‖

{R : Type u_1}
[NormedRing R]
[CompleteSpace R]
(x : Rˣ)

(fun t => Ring.inverse (↑x + t) - ↑x⁻¹) =O[𝓝 0] fun t => ‖t‖


/-- `M.toNFA` is an `NFA` constructed from a `DFA` `M` by using the same start and accept
  states and a transition function which sends `s` with input `a` to the singleton `M.step s a`. -/
@[simps] def toNFA (M : DFA α σ') : NFA α σ'

{α : Type u}
{σ' : Type v}
(M : DFA α σ')


theorem mem_range_of_degree_eq_one (hx : (minpoly A x).degree = 1) :
    x ∈ (algebraMap A B).range

(A : Type u_1)
{B : Type u_2}
[CommRing A]
[Ring B]
[Algebra A B]
(x : B)
(hx : (minpoly A x).degree = 1)


/-- The negation of an affine point in `W` lies in `W`. -/
lemma equation_neg {x y : R} (h : W.Equation x y) : W.Equation x <| W.negY x y

{R : Type u}
[CommRing R]
{W : WeierstrassCurve.Affine R}
{x y : R}
(h : W.Equation x y)


/--
The category of sheaves on the bottom (trivial) grothendieck topology is equivalent to the category
of presheaves.
-/
@[simps]
def sheafOfTypesBotEquiv : SheafOfTypes (⊥ : GrothendieckTopology C) ≌ Cᵒᵖ ⥤ Type w

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

(CategoryTheory.sheafOfTypesBotEquiv.inverse.obj P).val = P


theorem pairwise_singleton (R) (a : α) : Pairwise R [a]

{α : Type u_1}
(R : α → α → Prop)
(a : α)


theorem Equiv.exists_left {x y : PSet} (h : Equiv x y) : ∀ i, ∃ j, Equiv (x.Func i) (y.Func j)

{x : PSet}
{y : PSet}
(h : x.Equiv y)
(i : x.Type)


theorem tendsto_nhds_true {l : Filter α} {p : α → Prop} :
    Tendsto p l (𝓝 True) ↔ ∀ᶠ x in l, p x

{α : Type u_1}
{l : Filter α}
{p : α → Prop}

Filter.Tendsto p l (𝓝 True) ↔ ∀ᶠ (x : α) in l, p x


theorem aestronglyMeasurable'_condexpL1 {f : α → F'} :
    AEStronglyMeasurable' m (condexpL1 hm μ f) μ

{α : Type u_1}
{F' : Type u_4}
[NormedAddCommGroup F']
[NormedSpace ℝ F']
[CompleteSpace F']
{m m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{hm : m ≤ m0}
[MeasureTheory.SigmaFinite (μ.trim hm)]
{f : α → F'}

MeasureTheory.AEStronglyMeasurable' m (↑↑(MeasureTheory.condexpL1 hm μ f)) μ


@[to_additive (attr := simp, norm_cast)]
lemma op_ratCast [RatCast α] (q : ℚ) : op (q : α) = q


theorem ContinuousOn.clm_apply {X} [TopologicalSpace X] {f : X → (E →L[𝕜] F)} {g : X → E}
    {s : Set X} (hf : ContinuousOn f s) (hg : ContinuousOn g s) :
    ContinuousOn (fun x ↦ f x (g x)) s

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


theorem paste_horiz_iff {X₁₁ X₁₂ X₁₃ X₂₁ X₂₂ X₂₃ : C} {h₁₁ : X₁₁ ⟶ X₁₂} {h₁₂ : X₁₂ ⟶ X₁₃}
    {h₂₁ : X₂₁ ⟶ X₂₂} {h₂₂ : X₂₂ ⟶ X₂₃} {v₁₁ : X₁₁ ⟶ X₂₁} {v₁₂ : X₁₂ ⟶ X₂₂} {v₁₃ : X₁₃ ⟶ X₂₃}
    (s : IsPushout h₁₁ v₁₁ v₁₂ h₂₁) (e : h₁₂ ≫ v₁₃ = v₁₂ ≫ h₂₂) :
    IsPushout (h₁₁ ≫ h₁₂) v₁₁ v₁₃ (h₂₁ ≫ h₂₂) ↔ IsPushout h₁₂ v₁₂ v₁₃ h₂₂

{X₁₁ X₁₂ X₁₃ X₂₁ X₂₂ X₂₃ : C}

{h₁₁ : X₁₁ ⟶ X₁₂}

{h₁₂ : X₁₂ ⟶ X₁₃}

{h₂₁ : X₂₁ ⟶ X₂₂}

{h₂₂ : X₂₂ ⟶ X₂₃}

{v₁₁ : X₁₁ ⟶ X₂₁}

{v₁₂ : X₁₂ ⟶ X₂₂}

{v₁₃ : X₁₃ ⟶ X₂₃}

(s : CategoryTheory.IsPushout h₁₁ v₁₁ v₁₂ h₂₁)

(e : h₁₂ ≫ v₁₃ = v₁₂ ≫ h₂₂)

CategoryTheory.IsPushout (h₁₁ ≫ h₁₂) v₁₁ v₁₃ (h₂₁ ≫ h₂₂) ↔ CategoryTheory.IsPushout h₁₂ v₁₂ v₁₃ h₂₂


@[simp]
theorem comap_top (f : M →[L] N) : (⊤ : L.Substructure N).comap f = ⊤

{L : FirstOrder.Language}
{M : Type w}
{N : Type u_1}
[L.Structure M]
[L.Structure N]
(f : L.Hom M N)

FirstOrder.Language.Substructure.comap f ⊤ = ⊤


@[simp]
theorem changeForm_self :
    changeForm changeForm.zero_proof = (LinearMap.id : CliffordAlgebra Q →ₗ[R] _)

{R : Type u1}
[CommRing R]
{M : Type u2}
[AddCommGroup M]
[Module R M]
{Q : QuadraticForm R M}

CliffordAlgebra.changeForm ⋯ = LinearMap.id


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

(X : CategoryTheory.Endofunctor.Algebra F)

(CategoryTheory.Endofunctor.Algebra.functorOfNatTransId.hom.app X).f = CategoryTheory.CategoryStruct.id X.a


@[simp]
theorem dirac_apply' (a : α) (hs : MeasurableSet s) : dirac a s = s.indicator 1 a

{α : Type u_1}
[MeasurableSpace α]
{s : Set α}
(a : α)
(hs : MeasurableSet s)

(MeasureTheory.Measure.dirac a) s = s.indicator 1 a


@[to_additive]
theorem prod_singleton : [a].prod = a


lemma cauchySeq_comp (hf : LipschitzWith K f) {u : ℕ → α} (hu : CauchySeq u) :
    CauchySeq (f ∘ u)

{α : Type u}
{β : Type v}
[PseudoMetricSpace α]
[PseudoMetricSpace β]
{K : ℝ≥0}
{f : α → β}
(hf : LipschitzWith K f)
{u : ℕ → α}
(hu : CauchySeq u)


lemma smul_lt_smul_iff_of_neg_left (ha : a < 0) : a • b₁ < a • b₂ ↔ b₂ < b₁

{α : Type u_1}
{β : Type u_2}
{a : α}
{b₁ b₂ : β}
[OrderedRing α]
[OrderedAddCommGroup β]
[Module α β]
[PosSMulStrictMono α β]
[PosSMulReflectLT α β]
(ha : a < 0)


@[simp]
theorem bihimp_himp_left : a ⇔ b ⇨ a = a ⊔ b

{α : Type u_2}
[BooleanAlgebra α]
(a b : α)


theorem angle_eq_iff_two_pi_dvd_sub {ψ θ : ℝ} : (θ : Angle) = ψ ↔ ∃ k : ℤ, θ - ψ = 2 * π * k

↑θ = ↑ψ ↔ ∃ k, θ - ψ = 2 * π * ↑k


/-- The recurrence relation for the `convs'` of the continued fraction expansion
of an element `v` of `K` in terms of the convergents of the inverse of its fractional part.
-/
theorem convs'_succ :
    (of v).convs' (n + 1) = ⌊v⌋ + 1 / (of (fract v)⁻¹).convs' n

{K : Type u_1}
[LinearOrderedField K]
[FloorRing K]
(v : K)
(n : ℕ)

(GenContFract.of v).convs' (n + 1) = ↑⌊v⌋ + 1 / (GenContFract.of (Int.fract v)⁻¹).convs' n


lemma lie_eq_killingForm_smul_of_mem_rootSpace_of_mem_rootSpace_neg
    {α : Weight K H L} {e f : L} (heα : e ∈ rootSpace H α) (hfα : f ∈ rootSpace H (-α)) :
    ⁅e, f⁆ = killingForm K L e f • (cartanEquivDual H).symm α

(hfα : f ∈ LieAlgebra.rootSpace H (-⇑α))

⁅e, f⁆ =
  ((killingForm K L) e) f • ↑((LieAlgebra.IsKilling.cartanEquivDual H).symm (LieModule.Weight.toLinear K (↥H) L α))


theorem Lex.mono_right {r : ι → ι → Prop} {s₁ s₂ : ∀ i, α i → α i → Prop}
    (hs : ∀ i a b, s₁ i a b → s₂ i a b) {a b : Σ' i, α i} (h : Lex r s₁ a b) : Lex r s₂ a b

(hs : ∀ (i : ι) (a b : α i), s₁ i a b → s₂ i a b)


@[simp]
theorem image_Ioo (e : α ≃o β) (a b : α) : e '' Ioo a b = Ioo (e a) (e b)

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
(e : α ≃o β)
(a b : α)


theorem withDensity_ofReal_mutuallySingular {f : α → ℝ} (hf : Measurable f) :
    (μ.withDensity fun x => ENNReal.ofReal <| f x) ⟂ₘ
      μ.withDensity fun x => ENNReal.ofReal <| -f x

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

(μ.withDensity fun x => ENNReal.ofReal (f x)).MutuallySingular (μ.withDensity fun x => ENNReal.ofReal (-f x))


/--
For any `RingCon R`, when we view it as an ideal in `Rᵒᵖ`, `subtype` is the injective `Rᵐᵒᵖ`-linear
map `I → Rᵐᵒᵖ`.
-/
@[simps]
def subtypeMop : I →ₗ[Rᵐᵒᵖ] Rᵐᵒᵖ

{R : Type u_1}
[Ring R]
(I : TwoSidedIdeal R)
(x : ↥I)


theorem subperm_cons_erase (a : α) (l : List α) : l <+~ a :: l.erase a

{α : Type u_1}
[DecidableEq α]
(a : α)
(l : List α)


@[simp]
theorem isSymm_zero [Zero α] : (0 : Matrix n n α).IsSymm


@[simp]
theorem degree_of_a_ne_zero (ha : P.a ≠ 0) : P.toPoly.degree = 3

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


@[simp]
theorem stalkToFiberRingHom_toStalk (x : PrimeSpectrum.Top R) (f : R) :
    -- Porting note: now `algebraMap _ _` needs to be explicitly typed
    stalkToFiberRingHom R x (toStalk R x f) = algebraMap R (Localization.AtPrime x.asIdeal) f

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

(AlgebraicGeometry.StructureSheaf.stalkToFiberRingHom R x) ((AlgebraicGeometry.StructureSheaf.toStalk R x) f) =
  (algebraMap R (Localization.AtPrime x.asIdeal)) f


@[rclike_simps, norm_cast]
theorem ofReal_intCast (n : ℤ) : ((n : ℝ) : K) = n


theorem infs_union_left : (s₁ ∪ s₂) ⊼ t = s₁ ⊼ t ∪ s₂ ⊼ t

{α : Type u_2}
[SemilatticeInf α]
{s₁ s₂ t : Set α}


theorem IsMinOn.lineDeriv_eq_zero (h : IsMinOn f s a) (h' : ∀ᶠ t : ℝ in 𝓝 0, a + t • b ∈ s) :
    lineDeriv ℝ f a b = 0

{E : Type u_1}
[AddCommGroup E]
[Module ℝ E]
{f : E → ℝ}
{s : Set E}
{a b : E}
(h : IsMinOn f s a)
(h' : ∀ᶠ (t : ℝ) in 𝓝 0, a + t • b ∈ s)


/-- If `m` and `n` are `Fintype` that lie in the same universe, the rank of `m × n` matrices is
  `(#n * #m).lift`. -/
@[simp high]
theorem rank_matrix' (m n : Type v) [Finite m] [Finite n] :
    Module.rank R (Matrix m n R) = Cardinal.lift.{u} (#m * #n)

(R : Type u)
[Ring R]
[StrongRankCondition R]
(m n : Type v)
[Finite m]
[Finite n]

Module.rank R (Matrix m n R) = Cardinal.lift.{u, v} (#m * #n)


/-- The geometric pmf is positive for all natural numbers -/
lemma geometricPMFReal_pos {n : ℕ} (hp_pos : 0 < p) (hp_lt_one : p < 1) :
    0 < geometricPMFReal p n

0 < ProbabilityTheory.geometricPMFReal p n


@[simp]
theorem eqToIso_trans {X Y Z : C} (p : X = Y) (q : Y = Z) :
    eqToIso p ≪≫ eqToIso q = eqToIso (p.trans q)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{X Y Z : C}
(p : X = Y)
(q : Y = Z)

CategoryTheory.eqToIso p ≪≫ CategoryTheory.eqToIso q = CategoryTheory.eqToIso ⋯


@[simp]
theorem map_π {F₁ F₂ : C ⥤ Type w} (α : F₁ ⟶ F₂) : map α ⋙ π F₂ = π F₁

{F₁ F₂ : CategoryTheory.Functor C (Type w)}

(CategoryTheory.CategoryOfElements.map α).comp (CategoryTheory.CategoryOfElements.π F₂) =
  CategoryTheory.CategoryOfElements.π F₁


@[simp]
lemma dist_prod_same_right {x₁ x₂ : α} {y : β} : dist (x₁, y) (x₂, y) = dist x₁ x₂

{α : Type u_1}
{β : Type u_2}
[PseudoMetricSpace α]
[PseudoMetricSpace β]
{x₁ x₂ : α}
{y : β}


@[measurability]
theorem Measurable.sumElim {_ : MeasurableSpace γ} {f : α → γ} {g : β → γ} (hf : Measurable f)
    (hg : Measurable g) : Measurable (Sum.elim f g)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{m : MeasurableSpace α}
{mβ : MeasurableSpace β}

∀ {x : MeasurableSpace γ} {f : α → γ} {g : β → γ}, Measurable f → Measurable g → Measurable (Sum.elim f g)


/-- A family of additive subgroups over an additive group are independent if and only if
`DFinsupp.sumAddHom` applied with `AddSubgroup.subtype` is injective. -/
theorem independent_iff_dfinsupp_sumAddHom_injective (p : ι → AddSubgroup N) :
    Independent p ↔ Function.Injective (sumAddHom fun i => (p i).subtype)

{ι : Type u_1}
{N : Type u_5}
[DecidableEq ι]
[AddCommGroup N]
(p : ι → AddSubgroup N)

CompleteLattice.Independent p ↔ Function.Injective ⇑(DFinsupp.sumAddHom fun i => (p i).subtype)


theorem append_assoc (as bs cs : Array α) : as ++ bs ++ cs = as ++ (bs ++ cs)


@[simp, norm_cast]
theorem ofENat_zero : ofENat 0 = 0


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

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


theorem monotone_distinctConstantsTheory :
    Monotone (L.distinctConstantsTheory : Set α → L[[α]].Theory)


@[to_additive]
theorem smul_set_iInter₂_subset (a : α) (t : ∀ i, κ i → Set β) :
    (a • ⋂ (i) (j), t i j) ⊆ ⋂ (i) (j), a • t i j

{α : Type u_2}
{β : Type u_3}
{ι : Sort u_5}
{κ : ι → Sort u_6}
[SMul α β]
(a : α)
(t : (i : ι) → κ i → Set β)

a • ⋂ i, ⋂ j, t i j ⊆ ⋂ i, ⋂ j, a • t i j


@[simp]
theorem sinh_sub_cosh : sinh x - cosh x = -exp (-x)

Complex.sinh x - Complex.cosh x = -Complex.exp (-x)


theorem Disjoint.inf_left' (h : Disjoint a b) : Disjoint (c ⊓ a) b

{α : Type u_1}
[SemilatticeInf α]
[OrderBot α]
{a b : α}
(c : α)
(h : Disjoint a b)


@[simp]
theorem volume_preimage_mul_left {a : ℝ} (h : a ≠ 0) (s : Set ℝ) :
    volume ((a * ·) ⁻¹' s) = ENNReal.ofReal (abs a⁻¹) * volume s

MeasureTheory.volume ((fun x => a * x) ⁻¹' s) = ENNReal.ofReal |a⁻¹| * MeasureTheory.volume s


lemma ge_iff_le_forall_real_lt (x y : EReal) : (∀ z : ℝ, z < y → z ≤ x) ↔ y ≤ x


theorem linearIndependent_comp_subtype_disjoint {s : Set ι} :
    LinearIndependent R (v ∘ (↑) : s → M) ↔
      Disjoint (Finsupp.supported R R s) (LinearMap.ker <| Finsupp.total ι M R v)

{ι : Type u'}
{R : Type u_2}
{M : Type u_4}
{v : ι → M}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{s : Set ι}

LinearIndependent (ι := ↑s) R (v ∘ Subtype.val) ↔
  Disjoint (Finsupp.supported R R s) (LinearMap.ker (Finsupp.total ι M R v))


theorem formPerm_apply_lt_get (xs : List α) (h : Nodup xs) (n : ℕ) (hn : n + 1 < xs.length) :
    formPerm xs (xs.get (Fin.mk n ((Nat.lt_succ_self n).trans hn))) =
      xs.get (Fin.mk (n + 1) hn)

{α : Type u_1}
[DecidableEq α]
(xs : List α)
(h : xs.Nodup)
(n : ℕ)
(hn : n + 1 < xs.length)

xs.formPerm (xs.get ⟨n, ⋯⟩) = xs.get ⟨n + 1, hn⟩


@[simp]
theorem pointwise_smul_le_pointwise_smul_iff {a : M} {S T : Subring R} : a • S ≤ a • T ↔ S ≤ T

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


lemma Odd.pow_nonpos_iff (hn : Odd n) : a ^ n ≤ 0 ↔ a ≤ 0

{R : Type u_3}
[LinearOrderedSemiring R]
{a : R}
{n : ℕ}
[ExistsAddOfLE R]
(hn : Odd n)


theorem nhds_basis_clopen (x : X) : (𝓝 x).HasBasis (fun s : Set X => x ∈ s ∧ IsClopen s) id

{X : Type u_1}
[TopologicalSpace X]
[T2Space X]
[CompactSpace X]
[TotallyDisconnectedSpace X]
(x : X)

(𝓝 x).HasBasis (fun s => x ∈ s ∧ IsClopen s) id


theorem natDegree_cubic (ha : a ≠ 0) : natDegree (C a * X ^ 3 + C b * X ^ 2 + C c * X + C d) = 3

{R : Type u}
{a b c d : R}
[Semiring R]
(ha : a ≠ 0)

(Polynomial.C a * Polynomial.X ^ 3 + Polynomial.C b * Polynomial.X ^ 2 + Polynomial.C c * Polynomial.X +
      Polynomial.C d).natDegree =
  3


theorem multiplicity_sub_of_gt {p a b : α} (h : multiplicity p b < multiplicity p a) :
    multiplicity p (a - b) = multiplicity p b


/-- A locally-fully-faithful and cover-dense functor preserves compatible families. -/
lemma compatiblePreserving [G.IsLocallyFaithful K] : CompatiblePreserving K G

(K : CategoryTheory.GrothendieckTopology D)


/-- `Real.exp (f x)` is bounded away from zero along a filter if and only if this filter is bounded
from below under `f`. -/
theorem isBigO_exp_comp_one {f : α → ℝ} :
    (fun x => exp (f x)) =O[l] (fun _ => 1 : α → ℝ) ↔ IsBoundedUnder (· ≤ ·) l f

{α : Type u_1}
{l : Filter α}
{f : α → ℝ}

((fun x => Real.exp (f x)) =O[l] fun x => 1) ↔ Filter.IsBoundedUnder (fun x x_1 => x ≤ x_1) l f


theorem mem_range_mapToFractionRing_iff (B : Type*) [CommRing B] [Algebra A B] [IsLocalization S B]
    (hS : S ≤ A⁰) (x : K) :
    x ∈ (mapToFractionRing K S B hS).range ↔
      ∃ (a s : A) (hs : s ∈ S), x = IsLocalization.mk' K a ⟨s, hS hs⟩

{A : Type u_1}
(K : Type u_2)
[CommRing A]
(S : Submonoid A)
[CommRing K]
[Algebra A K]
[IsFractionRing A K]
(B : Type u_3)
[CommRing B]
[Algebra A B]
[IsLocalization S B]
(hS : S ≤ nonZeroDivisors A)
(x : K)

x ∈ (Localization.mapToFractionRing K S B hS).range ↔ ∃ a s, ∃ (hs : s ∈ S), x = IsLocalization.mk' K a ⟨s, ⋯⟩


theorem argminOn_le (s : Set α) {a : α} (ha : a ∈ s) (hs : s.Nonempty := Set.nonempty_of_mem ha) :
    f (argminOn f h s hs) ≤ f a

{α : Type u_1}
{β : Type u_2}
(f : α → β)
[LinearOrder β]
(h : WellFounded fun x x_1 => x < x_1)
(s : Set α)
{a : α}
(ha : a ∈ s)
(hs : s.Nonempty := ⋯)


theorem mk_zero (p : K[X]) : RatFunc.mk p 0 = ofFractionRing (0 : FractionRing K[X])

{K : Type u}
[CommRing K]
[IsDomain K]
(p : K[X])

RatFunc.mk p 0 = { toFractionRing := 0 }


@[reassoc (attr := simp)]
theorem HasColimit.isoOfNatIso_inv_desc {F G : J ⥤ C} [HasColimit F] [HasColimit G] (t : Cocone F)
    (w : F ≅ G) :
    (HasColimit.isoOfNatIso w).inv ≫ colimit.desc F t =
      colimit.desc G ((Cocones.precompose w.inv).obj _)

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

(CategoryTheory.Limits.HasColimit.isoOfNatIso w).inv ≫ CategoryTheory.Limits.colimit.desc F t =
  CategoryTheory.Limits.colimit.desc G ((CategoryTheory.Limits.Cocones.precompose w.inv).obj t)


@[simp] theorem polarBilin_pi (Q : ∀ i, QuadraticMap R (Mᵢ i) P) :
    (pi Q).polarBilin = ∑ i, (Q i).polarBilin.compl₁₂ (.proj i) (.proj i)

{ι : Type u_1}
{R : Type u_2}
{P : Type u_7}
{Mᵢ : ι → Type u_8}
[CommRing R]
[(i : ι) → AddCommGroup (Mᵢ i)]
[AddCommGroup P]
[(i : ι) → Module R (Mᵢ i)]
[Module R P]
[Fintype ι]
(Q : (i : ι) → QuadraticMap R (Mᵢ i) P)

(QuadraticMap.pi Q).polarBilin = ∑ i : ι, LinearMap.compl₁₂ (Q i).polarBilin (LinearMap.proj i) (LinearMap.proj i)


@[simp]
theorem filterMap_some : s.filterMap some (by simp) = s


/-- The supremum of a set of equivalence relations is the equivalence closure of the
    supremum of the set's image under the map to the underlying binary operation. -/
theorem sSup_def {s : Set (Setoid α)} : sSup s = EqvGen.Setoid (sSup (Rel '' s))

sSup s = EqvGen.Setoid (sSup (Setoid.Rel '' s))


@[simp]
theorem upperClosure_univ : upperClosure (univ : Set α) = ⊥


{α : Type u_2}
[Preorder α]
[LocallyFiniteOrder α]
{a b : α}


theorem Icc_union_Ici (h : c ≤ max a b) : Icc a b ∪ Ici c = Ici (min a c)

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

Set.Icc a b ∪ Set.Ici c = Set.Ici (min a c)


/-- A set is stable under specialization iff it is a union of closed sets. -/
lemma stableUnderSpecialization_iff_exists_sUnion_eq {s : Set X} :
    StableUnderSpecialization s ↔ ∃ (S : Set (Set X)), (∀ s ∈ S, IsClosed s) ∧ ⋃₀ S = s

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

StableUnderSpecialization s ↔ ∃ S, (∀ s ∈ S, IsClosed s) ∧ ⋃₀ S = s


lemma apply_eq_of_mem_genEigenspace_of_comm_of_isSemisimple_of_isNilpotent_sub
    {μ : R} {k : ℕ} {m : M} (hm : m ∈ f.genEigenspace μ k)
    (hfg : Commute f g) (hss : g.IsSemisimple) (hnil : IsNilpotent (f - g)) :
    g m = μ • m

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
{f g : Module.End R M}
{μ : R}
{k : ℕ}
{m : M}
(hm : m ∈ (f.genEigenspace μ) k)
(hfg : Commute f g)
(hss : g.IsSemisimple)
(hnil : IsNilpotent (f - g))


@[simp]
theorem toList_getLast? {i j} (w : NeWord M i j) : w.toList.getLast? = Option.some ⟨j, w.last⟩

{ι : Type u_1}
{M : ι → Type u_2}
[(i : ι) → Monoid (M i)]
{i j : ι}
(w : Monoid.CoprodI.NeWord M i j)


/-- For integrally closed rings, the minimal polynomial divides any polynomial that has the
  integral element as root. See also `minpoly.dvd` which relaxes the assumptions on `S`
  in exchange for stronger assumptions on `R`. -/
theorem isIntegrallyClosed_dvd {s : S} (hs : IsIntegral R s) {p : R[X]}
    (hp : Polynomial.aeval s p = 0) : minpoly R s ∣ p

{R : Type u_1}
{S : Type u_2}
[CommRing R]
[CommRing S]
[IsDomain R]
[Algebra R S]
[IsDomain S]
[NoZeroSMulDivisors R S]
[IsIntegrallyClosed R]
{s : S}
(hs : IsIntegral R s)
{p : R[X]}
(hp : (Polynomial.aeval s) p = 0)


/-- Birkhoff average is "almost invariant" under `f`:
the difference between `birkhoffAverage R f g n (f x)` and `birkhoffAverage R f g n x`
is equal to `(n : R)⁻¹ • (g (f^[n] x) - g x)`. -/
theorem birkhoffAverage_apply_sub_birkhoffAverage {α M : Type*} (R : Type*) [DivisionRing R]
    [AddCommGroup M] [Module R M] (f : α → α) (g : α → M) (n : ℕ) (x : α) :
    birkhoffAverage R f g n (f x) - birkhoffAverage R f g n x =
      (n : R)⁻¹ • (g (f^[n] x) - g x)

{α : Type u_1}
{M : Type u_2}
(R : Type u_3)
[DivisionRing R]
[AddCommGroup M]
[Module R M]
(f : α → α)
(g : α → M)
(n : ℕ)
(x : α)

birkhoffAverage R f g n (f x) - birkhoffAverage R f g n x = (↑n)⁻¹ • (g (f^[n] x) - g x)


/-- The functor `Γ` for the equivalence is `Γ'`. -/
@[simps!, nolint unusedArguments]
def Γ [IsIdempotentComplete C] [HasFiniteCoproducts C] : ChainComplex C ℕ ⥤ SimplicialObject C

(CategoryTheory.Idempotents.DoldKan.Γ.obj X).obj Δ = AlgebraicTopology.DoldKan.Γ₀.Obj.obj₂ X Δ


theorem insert_union : insert a s ∪ t = insert a (s ∪ t)


theorem multiplicity_choose_prime_pow_add_multiplicity (hp : p.Prime) (hkn : k ≤ p ^ n)
    (hk0 : k ≠ 0) : multiplicity p (choose (p ^ n) k) + multiplicity p k = n

{p n k : ℕ}
(hp : Nat.Prime p)
(hkn : k ≤ p ^ n)
(hk0 : k ≠ 0)

multiplicity p ((p ^ n).choose k) + multiplicity p k = ↑n


@[simp, norm_cast]
theorem coe_zero : ⇑(0 : CauSeq β abv) = 0

{α : Type u_1}
{β : Type u_2}
[LinearOrderedField α]
[Ring β]
{abv : β → α}
[IsAbsoluteValue abv]


lemma commShiftIso_comp_inv_app [F.CommShift A] [G.CommShift A] (a : A) (X : C) :
    (commShiftIso (F ⋙ G) a).inv.app X =
      (commShiftIso G a).inv.app (F.obj X) ≫ G.map ((commShiftIso F a).inv.app X)

{C : Type u_1}
{D : Type u_2}
{E : Type u_3}
[CategoryTheory.Category.{u_6, u_1} C]
[CategoryTheory.Category.{u_7, u_2} D]
[CategoryTheory.Category.{u_8, u_3} E]
(F : CategoryTheory.Functor C D)
(G : CategoryTheory.Functor D E)
{A : Type u_4}
[AddMonoid A]
[CategoryTheory.HasShift C A]
[CategoryTheory.HasShift D A]
[CategoryTheory.HasShift E A]
[F.CommShift A]
[G.CommShift A]
(a : A)
(X : C)

((F.comp G).commShiftIso a).inv.app X =
  CategoryTheory.CategoryStruct.comp ((G.commShiftIso a).inv.app (F.obj X)) (G.map ((F.commShiftIso a).inv.app X))


theorem integrable_mul_exp_neg_mul_sq {b : ℝ} (hb : 0 < b) :
    Integrable fun x : ℝ => x * exp (-b * x ^ 2)

MeasureTheory.Integrable (fun x => x * rexp (-b * x ^ 2)) MeasureTheory.volume


theorem range'_subset_right {s m n : Nat} (step0 : 0 < step) :
    range' s m step ⊆ range' s n step ↔ m ≤ n

List.range' s m step ⊆ List.range' s n step ↔ m ≤ n


theorem completion.lift_comp_incl {V W : SemiNormedGrp} [CompleteSpace W] [T0Space W]
    (f : V ⟶ W) : completion.incl ≫ completion.lift f = f

{V W : SemiNormedGrp}
[CompleteSpace ↑W]
[T0Space ↑W]
(f : V ⟶ W)

SemiNormedGrp.completion.incl ≫ SemiNormedGrp.completion.lift f = f


/-- The cardinality of the antidiagonal of `n` is `n + 1`. -/
@[simp]
theorem card_antidiagonal (n : ℕ) : (antidiagonal n).card = n + 1


/-- The equivalence between `DistLat` and itself induced by `OrderDual` both ways. -/
@[simps functor inverse]
def dualEquiv : DistLat ≌ DistLat


private lemma card_T_eq : (T).card = (B + 1) ^ n

{α : Type u_1}
{β : Type u_2}
[Fintype α]
[Fintype β]
(A : Matrix α β ℤ)
[DecidableEq β]

(Finset.Icc 0 fun x =>
      ↑⌊(↑(Fintype.card β) * max 1 ‖A‖) ^ (↑(Fintype.card α) / (↑(Fintype.card β) - ↑(Fintype.card α)))⌋₊).card =
  (⌊(↑(Fintype.card β) * max 1 ‖A‖) ^ (↑(Fintype.card α) / (↑(Fintype.card β) - ↑(Fintype.card α)))⌋₊ + 1) ^
    Fintype.card β


/-- the scalar multiplication of an homotopy -/
@[simps!]
def smul {R : Type*} [Semiring R] [Linear R V] (h : Homotopy f g) (a : R) :
    Homotopy (a • f) (a • g)

{ι : Type u_1}
{V : Type u}
[CategoryTheory.Category.{v, u} V]
[CategoryTheory.Preadditive V]
{c : ComplexShape ι}
{C D : HomologicalComplex V c}
{f g : C ⟶ D}
{R : Type u_2}
[Semiring R]
[CategoryTheory.Linear R V]
(h : Homotopy f g)
(a : R)
(i j : ι)


@[to_additive noncommSum_eq_card_nsmul]
theorem noncommProd_eq_pow_card (s : Finset α) (f : α → β) (comm) (m : β) (h : ∀ x ∈ s, f x = m) :
    s.noncommProd f comm = m ^ s.card

(comm : (↑s).Pairwise fun a b => AddCommute (f a) (f b))


theorem csInf_image2_eq_csSup_csInf (h₁ : ∀ b, GaloisConnection (toDual ∘ l₁ b) (swap u b ∘ ofDual))
    (h₂ : ∀ a, GaloisConnection (l₂ a) (u a)) :
    s.Nonempty → BddAbove s → t.Nonempty → BddBelow t → sInf (image2 u s t) = u (sSup s) (sInf t)

{u : α → β → γ}

{l₁ : β → γ → α}

{l₂ : α → γ → β}

(h₁ : ∀ (b : β), GaloisConnection (⇑OrderDual.toDual ∘ l₁ b) (Function.swap u b ∘ ⇑OrderDual.ofDual))

(h₂ : ∀ (a : α), GaloisConnection (l₂ a) (u a))

s.Nonempty → BddAbove s → t.Nonempty → BddBelow t → sInf (Set.image2 u s t) = u (sSup s) (sInf t)


protected theorem surjective (h : α ≃ᵤ β) : Function.Surjective h

{α : Type u}
{β : Type u_1}
[UniformSpace α]
[UniformSpace β]
(h : α ≃ᵤ β)


@[simp]
theorem coe_basis : ⇑h.basis = e

{R : Type u_1}
{M : Type u_2}
{ι : Type u_3}
[CommRing R]
[AddCommGroup M]
[Module R M]
{e : ι → M}
{ε : ι → Module.Dual R M}
[DecidableEq ι]
(h : Module.DualBases e ε)


@[to_additive]
theorem _root_.measurableEmbedding_const_smul (c : G) : MeasurableEmbedding (c • · : α → α)

{G : Type u_1}
{α : Type u_3}
[MeasurableSpace G]
[MeasurableSpace α]
[Group G]
[MulAction G α]
[MeasurableSMul G α]
(c : G)


lemma shiftFunctorAdd'_op_hom_app (X : Cᵒᵖ) (a₁ a₂ a₃ : ℤ) (h : a₁ + a₂ = a₃)
    (b₁ b₂ b₃ : ℤ) (h₁ : a₁ + b₁ = 0) (h₂ : a₂ + b₂ = 0) (h₃ : a₃ + b₃ = 0) :
    (shiftFunctorAdd' Cᵒᵖ a₁ a₂ a₃ h).hom.app X =
      (shiftFunctorOpIso C _ _ h₃).hom.app X ≫
        ((shiftFunctorAdd' C b₁ b₂ b₃ (by omega)).inv.app X.unop).op ≫
        (shiftFunctorOpIso C _ _ h₂).inv.app _ ≫
        (shiftFunctor Cᵒᵖ a₂).map ((shiftFunctorOpIso C _ _ h₁).inv.app X)

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.HasShift C ℤ]
(X : Cᵒᵖ)
(a₁ a₂ a₃ : ℤ)
(h : a₁ + a₂ = a₃)
(b₁ b₂ b₃ : ℤ)
(h₁ : a₁ + b₁ = 0)
(h₂ : a₂ + b₂ = 0)
(h₃ : a₃ + b₃ = 0)

(CategoryTheory.shiftFunctorAdd' Cᵒᵖ a₁ a₂ a₃ h).hom.app X =
  CategoryTheory.CategoryStruct.comp ((CategoryTheory.Pretriangulated.shiftFunctorOpIso C a₃ b₃ h₃).hom.app X)
    (CategoryTheory.CategoryStruct.comp ((CategoryTheory.shiftFunctorAdd' C b₁ b₂ b₃ ⋯).inv.app (Opposite.unop X)).op
      (CategoryTheory.CategoryStruct.comp
        ((CategoryTheory.Pretriangulated.shiftFunctorOpIso C a₂ b₂ h₂).inv.app
          (Opposite.op ((CategoryTheory.shiftFunctor C b₁).toPrefunctor.1 (Opposite.unop X))))
        ((CategoryTheory.shiftFunctor Cᵒᵖ a₂).map
          ((CategoryTheory.Pretriangulated.shiftFunctorOpIso C a₁ b₁ h₁).inv.app X))))


theorem zorn_nonempty_preorder₀ (s : Set α)
    (ih : ∀ c ⊆ s, IsChain (· ≤ ·) c → ∀ y ∈ c, ∃ ub ∈ s, ∀ z ∈ c, z ≤ ub) (x : α)
    (hxs : x ∈ s) : ∃ m ∈ s, x ≤ m ∧ ∀ z ∈ s, m ≤ z → z ≤ m

(ih : ∀ c ⊆ s, IsChain (fun x x_1 => x ≤ x_1) c → ∀ y ∈ c, ∃ ub ∈ s, ∀ z ∈ c, z ≤ ub)


/-- The main inductive step in the grid-lines lemma for the Gagliardo-Nirenberg-Sobolev inequality.

The grid-lines operation `GridLines.T` on a nonnegative function on a finitary product type is
less than or equal to the grid-lines operation of its partial integral in one co-ordinate
(the latter intuitively considered as a function on a space "one dimension down"). -/
theorem T_insert_le_T_lmarginal_singleton (hp₀ : 0 ≤ p) (s : Finset ι)
    (hp : (s.card : ℝ) * p ≤ 1)
    (i : ι) (hi : i ∉ s) {f : (∀ i, A i) → ℝ≥0∞} (hf : Measurable f) :
    T μ p f (insert i s) ≤ T μ p (∫⋯∫⁻_{i}, f ∂μ) s

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

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

MeasureTheory.GridLines.T μ p f (insert i s) ≤ MeasureTheory.GridLines.T μ p (∫⋯∫⁻_{i}, f ∂μ) s


/-- From a functor `F : J ⥤ C`, given a terminal object of `J`, construct a cocone for `J`.
In `colimitOfDiagramTerminal` we show it is a colimit cocone. -/
@[simps]
def coconeOfDiagramTerminal {X : J} (tX : IsTerminal X) (F : J ⥤ C) : Cocone F

(tX : CategoryTheory.Limits.IsTerminal X)

(CategoryTheory.Limits.coconeOfDiagramTerminal tX F).pt = F.obj X


/-- Given a submartingale `f` and bounded stopping times `τ` and `π` such that `τ ≤ π`, the
expectation of `stoppedValue f τ` is less than or equal to the expectation of `stoppedValue f π`.
This is the forward direction of the optional stopping theorem. -/
theorem Submartingale.expected_stoppedValue_mono [SigmaFiniteFiltration μ 𝒢]
    (hf : Submartingale f 𝒢 μ) (hτ : IsStoppingTime 𝒢 τ) (hπ : IsStoppingTime 𝒢 π) (hle : τ ≤ π)
    {N : ℕ} (hbdd : ∀ ω, π ω ≤ N) : μ[stoppedValue f τ] ≤ μ[stoppedValue f π]

{f : ℕ → Ω → ℝ}

{τ π : Ω → ℕ}

(hf : MeasureTheory.Submartingale f 𝒢 μ)

∫ (x : Ω), MeasureTheory.stoppedValue f τ x ∂μ ≤ ∫ (x : Ω), MeasureTheory.stoppedValue f π x ∂μ


@[to_additive (attr := simp)]
theorem smul_eq_empty : s • t = ∅ ↔ s = ∅ ∨ t = ∅

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


theorem bit_eq_zero_iff {n : ℕ} {b : Bool} : bit b n = 0 ↔ n = 0 ∧ b = false


@[simp]
theorem ofArity_succ (α β : Type u) (n : ℕ) :
    OfArity α β n.succ = (α → OfArity α β n)

Function.OfArity α β n.succ = (α → Function.OfArity α β n)


lemma isAmalgamation_map_localPreimage :
    ((localPreimage φ r').map φ).IsAmalgamation r'

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{R R' : Cᵒᵖ ⥤ Type w}
(φ : R ⟶ R')
{X : Cᵒᵖ}
(r' : R'.obj X)

((CategoryTheory.Presieve.FamilyOfElements.localPreimage φ r').map φ).IsAmalgamation r'


theorem nndist_of_re_eq {z w : ℂ} (h : z.re = w.re) : nndist z w = nndist z.im w.im


/-- Given a category of complexes with objects in `V`, there is a natural equivalence between its
opposite category and a category of complexes with objects in `Vᵒᵖ`. -/
@[simps]
def opEquivalence : (HomologicalComplex V c)ᵒᵖ ≌ HomologicalComplex Vᵒᵖ c.symm

(HomologicalComplex.opEquivalence V c).functor = HomologicalComplex.opFunctor V c


theorem mk_zero (n : ℕ) : mk K p (n, 0) = 0

(K : Type u)
[CommRing K]
(p : ℕ)
[Fact (Nat.Prime p)]
[CharP K p]
(n : ℕ)


theorem mem_unitaryGroup_iff' : A ∈ Matrix.unitaryGroup n α ↔ star A * A = 1

{n : Type u}
[DecidableEq n]
[Fintype n]
{α : Type v}
[CommRing α]
[StarRing α]
{A : Matrix n n α}


@[fun_prop]
theorem DifferentiableAt.mul_const (ha : DifferentiableAt 𝕜 a x) (b : 𝔸) :
    DifferentiableAt 𝕜 (fun y => a y * b) x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{x : E}
{𝔸 : Type u_6}
[NormedRing 𝔸]
[NormedAlgebra 𝕜 𝔸]
{a : E → 𝔸}
(ha : DifferentiableAt 𝕜 a x)
(b : 𝔸)


@[deprecated measure_diff_null (since := "2024-05-14")]
theorem diff_null (m : OuterMeasure α) (s : Set α) {t : Set α} (ht : m t = 0) : m (s \ t) = m s

{α : Type u_1}
(m : MeasureTheory.OuterMeasure α)
(s : Set α)
{t : Set α}
(ht : m t = 0)


theorem span_singleton_sup_orthogonal_eq_top {B : V →ₗ[K] V →ₗ[K] K} {x : V} (hx : ¬B.IsOrtho x x) :
    (K ∙ x) ⊔ Submodule.orthogonalBilin (N := K ∙ x) (B := B) = ⊤

{K : Type u_13}
{V : Type u_16}
[Field K]
[AddCommGroup V]
[Module K V]
{B : V →ₗ[K] V →ₗ[K] K}
{x : V}
(hx : ¬B.IsOrtho x x)

Submodule.span K {x} ⊔ (Submodule.span K {x}).orthogonalBilin B = ⊤


/-- A trident on `f : J → (X ⟶ Y)` is determined by the morphism `ι : P ⟶ X` satisfying
`∀ j₁ j₂, ι ≫ f j₁ = ι ≫ f j₂`.
-/
@[simps]
def Trident.ofι [Nonempty J] {P : C} (ι : P ⟶ X) (w : ∀ j₁ j₂, ι ≫ f j₁ = ι ≫ f j₂) :
    Trident f

(w : ∀ (j₁ j₂ : J), CategoryTheory.CategoryStruct.comp ι (f j₁) = CategoryTheory.CategoryStruct.comp ι (f j₂))

(CategoryTheory.Limits.Trident.ofι ι w).pt = P


@[simp]
theorem WalkingPair.equivBool_symm_apply_false : WalkingPair.equivBool.symm false = right

CategoryTheory.Limits.WalkingPair.equivBool.symm false = CategoryTheory.Limits.WalkingPair.right


lemma iUnion_congr {s t : ι → Set α} (h : ∀ i, s i = t i) : ⋃ i, s i = ⋃ i, t i

{α : Type u_1}
{ι : Sort u_4}
{s t : ι → Set α}
(h : ∀ (i : ι), s i = t i)


lemma iInf_iSup_eq' (f : ∀ a, κ a → α) :
    let _ := minAx.toCompleteLattice
    ⨅ i, ⨆ j, f i j = ⨆ g : ∀ i, κ i, ⨅ i, f i (g i)

(minAx : CompletelyDistribLattice.MinimalAxioms α)

let x := minAx.toCompleteLattice;
⨅ i, ⨆ j, f i j = ⨆ g, ⨅ i, f i (g i)


theorem forall_mem_map {f : α ↪ β} {s : Finset α} {p : ∀ a, a ∈ s.map f → Prop} :
    (∀ y (H : y ∈ s.map f), p y H) ↔ ∀ x (H : x ∈ s), p (f x) (mem_map_of_mem _ H)

{p : (a : β) → a ∈ Finset.map f s → Prop}

(∀ (y : β) (H : y ∈ Finset.map f s), p y H) ↔ ∀ (x : α) (H : x ∈ s), p (f x) ⋯


protected theorem uniformContinuous : UniformContinuous ((↑) : Lp.simpleFunc E p μ → Lp E p μ)

{α : Type u_1}
{E : Type u_4}
[MeasurableSpace α]
[NormedAddCommGroup E]
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
[Fact (1 ≤ p)]


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

{M : Type u_2}
{ι : Type u_3}
{α : Type u_4}
[AddCommMonoid M]
[MeasurableSpace M]
[MeasurableAdd₂ M]
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f : ι → α → M}
(s : Finset ι)
(hf : ∀ i ∈ s, AEMeasurable (f i) μ)

AEMeasurable (fun a => ∑ i ∈ s, f i a) μ


/-- A free group is a free product of copies of the free_group over one generator. -/
@[simps!]
def _root_.freeGroupEquivCoprodI {ι : Type u_1} :
    FreeGroup ι ≃* CoprodI fun _ : ι => FreeGroup Unit

(a : Monoid.CoprodI fun x => FreeGroup Unit)

freeGroupEquivCoprodI.symm a = (Monoid.CoprodI.lift fun i => FreeGroup.lift fun x => FreeGroup.of i) a


/-- If `StructuredArrow d F` is filtered for any `d : D`, then `F : C ⥤ D` is final. This is
    simply because filtered categories are connected. More profoundly, the converse is also true if
    `C` is filtered, see `final_iff_isFiltered_structuredArrow`. -/
theorem Functor.final_of_isFiltered_structuredArrow [∀ d, IsFiltered (StructuredArrow d F)] :
    Final F

[∀ (d : D), CategoryTheory.IsFiltered (CategoryTheory.StructuredArrow d F)]


theorem sup_succ_le_lsub {ι : Type u} (f : ι → Ordinal.{max u v}) :
    succ (sup.{_, v} f) ≤ lsub.{_, v} f ↔ ∃ i, f i = sup.{_, v} f

Order.succ (Ordinal.sup f) ≤ Ordinal.lsub f ↔ ∃ i, f i = Ordinal.sup f


theorem Tendsto.frequently {f : α → β} {l₁ : Filter α} {l₂ : Filter β} {p : β → Prop}
    (hf : Tendsto f l₁ l₂) (h : ∃ᶠ x in l₁, p (f x)) : ∃ᶠ y in l₂, p y

{α : Type u}
{β : Type v}
{f : α → β}
{l₁ : Filter α}
{l₂ : Filter β}
{p : β → Prop}
(hf : Filter.Tendsto f l₁ l₂)
(h : ∃ᶠ (x : α) in l₁, p (f x))


theorem analyticAt_const {v : F} : AnalyticAt 𝕜 (fun _ => v) x

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{x : E}
{v : F}


/-- The `p`-primary component is the subgroup of elements with order prime-power of `p`. -/
@[to_additive (attr := simps!)
      "The `p`-primary component is the subgroup of elements with additive order
      prime-power of `p`."]
def primaryComponent : Subgroup G

(G : Type u_1)
[CommGroup G]
(p : ℕ)
[hp : Fact (Nat.Prime p)]

↑(CommGroup.primaryComponent G p) = {g | ∃ n, orderOf g = p ^ n}


@[reassoc (attr := simp)]
theorem PreservesPushout.inl_iso_inv :
    G.map (pushout.inl _ _) ≫ (PreservesPushout.iso G f g).inv = pushout.inl _ _

[CategoryTheory.Limits.PreservesColimit (CategoryTheory.Limits.span f g) G]

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

G.map (CategoryTheory.Limits.pushout.inl f g) ≫ (CategoryTheory.Limits.PreservesPushout.iso G f g).inv =
  CategoryTheory.Limits.pushout.inl (G.map f) (G.map g)


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

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


theorem neg_sqrt_lt_of_sq_lt (h : x ^ 2 < y) : -√y < x


theorem mem_argmin_iff :
    m ∈ argmin f l ↔
      m ∈ l ∧ (∀ a ∈ l, f m ≤ f a) ∧ ∀ a ∈ l, f a ≤ f m → l.indexOf m ≤ l.indexOf a

{α : Type u_1}
{β : Type u_2}
[LinearOrder β]
{f : α → β}
{l : List α}
{m : α}
[DecidableEq α]

m ∈ List.argmin f l ↔
  m ∈ l ∧ (∀ (a : α), a ∈ l → f m ≤ f a) ∧ ∀ (a : α), a ∈ l → f a ≤ f m → List.indexOf m l ≤ List.indexOf a l


lemma eLpNorm_indicator_const₀ {c : G} (hs : NullMeasurableSet s μ) (hp : p ≠ 0) (hp_top : p ≠ ∞) :
    eLpNorm (s.indicator fun _ => c) p μ = ‖c‖₊ * μ s ^ (1 / p.toReal)

(hs : MeasureTheory.NullMeasurableSet s μ)

MeasureTheory.eLpNorm (s.indicator fun x => c) p μ = ↑‖c‖₊ * μ s ^ (1 / p.toReal)


theorem monadToFunctor_mapIso_monad_iso_mk {M N : Monad C} (f : (M : C ⥤ C) ≅ N) (f_η f_μ) :
    (monadToFunctor _).mapIso (MonadIso.mk f f_η f_μ) = f

(f_η : ∀ (X : C), CategoryTheory.CategoryStruct.comp (M.η.app X) (f.hom.app X) = N.η.app X)

(f_μ :
  ∀ (X : C),
    CategoryTheory.CategoryStruct.comp (M.μ.app X) (f.hom.app X) =
      CategoryTheory.CategoryStruct.comp
        (CategoryTheory.CategoryStruct.comp (M.map (f.hom.app X)) (f.hom.app (N.obj X))) (N.μ.app X))

(CategoryTheory.monadToFunctor C).mapIso (CategoryTheory.MonadIso.mk f f_η f_μ) = f


lemma ker_evalStarAlgHom_eq_closure_adjoin_id (s : Set 𝕜) (h0 : 0 ∈ s) [CompactSpace s] :
    (RingHom.ker (evalStarAlgHom 𝕜 𝕜 (⟨0, h0⟩ : s)) : Set C(s, 𝕜)) =
      closure (adjoin 𝕜 {(restrict s (.id 𝕜))})

{𝕜 : Type u_2}
[RCLike 𝕜]
(s : Set 𝕜)
(h0 : 0 ∈ s)
[CompactSpace ↑s]

↑(RingHom.ker (ContinuousMap.evalStarAlgHom 𝕜 𝕜 ⟨0, h0⟩)) =
  closure ↑(NonUnitalStarAlgebra.adjoin 𝕜 {ContinuousMap.restrict s (ContinuousMap.id 𝕜)})


@[local simp] theorem negSucc_add_negSucc (m n : Nat) : -[m+1] + -[n+1] = -[succ (m + n) +1]

Int.negSucc m + Int.negSucc n = Int.negSucc (m + n).succ


/-- For nonzero `I, I'`, `val_v(I*I') = val_v(I) + val_v(I')`. -/
theorem count_mul {I I' : FractionalIdeal R⁰ K} (hI : I ≠ 0) (hI' : I' ≠ 0) :
    count K v (I * I') = count K v I + count K v I'

(v : IsDedekindDomain.HeightOneSpectrum R)

FractionalIdeal.count K v (I * I') = FractionalIdeal.count K v I + FractionalIdeal.count K v I'


theorem one_apply_ne' {i j} : j ≠ i → (1 : Matrix n n α) i j = 0

{n : Type u_3}
{α : Type v}
[DecidableEq n]
[Zero α]
[One α]
{i j : n}


@[simp, norm_cast]
theorem coe_re : (x : ℍ[R]).re = x


theorem takeWhile_map (f : α → β) (p : β → Bool) (l : List α) :
    (l.map f).takeWhile p = (l.takeWhile (p ∘ f)).map f

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

List.takeWhile p (List.map f l) = List.map f (List.takeWhile (p ∘ f) l)


lemma Prop.exists {f : Prop → Prop} : (∃ p, f p) ↔ f True ∨ f False


theorem algebraMap_apply (r : R) :
    algebraMap R (⨁ i, A i) r = DirectSum.of A 0 (GAlgebra.toFun r)

{ι : Type uι}
(R : Type uR)
(A : ι → Type uA)
[DecidableEq ι]
[CommSemiring R]
[(i : ι) → AddCommMonoid (A i)]
[(i : ι) → Module R (A i)]
[AddMonoid ι]
[DirectSum.GSemiring A]
[DirectSum.GAlgebra R A]
(r : R)

(algebraMap R (DirectSum ι fun i => A i)) r = (DirectSum.of A 0) (DirectSum.GAlgebra.toFun r)


@[simp]
theorem getI_nil : getI ([] : List α) n = default


/-- Suppose we have a square of functors (where the top and bottom are adjunctions `L₁ ⊣ R₁`
and `L₂ ⊣ R₂` respectively).

      C ↔ D
    G ↓   ↓ H
      E ↔ F

Then we have a bijection between natural transformations `G ⋙ L₂ ⟶ L₁ ⋙ H` and
`R₁ ⋙ G ⟶ H ⋙ R₂`. This can be seen as a bijection of the 2-cells:

         L₁                  R₁
      C --→ D             C ←-- D
    G ↓  ↗  ↓ H         G ↓  ↘  ↓ H
      E --→ F             E ←-- F
         L₂                  R₂

Note that if one of the transformations is an iso, it does not imply the other is an iso.
-/
@[simps]
def mateEquiv : (G ⋙ L₂ ⟶ L₁ ⋙ H) ≃ (R₁ ⋙ G ⟶ H ⋙ R₂)

{C : Type u₁}
{D : Type u₂}
{E : Type u₃}
{F : Type u₄}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.Category.{v₂, u₂} D]
[CategoryTheory.Category.{v₃, u₃} E]
[CategoryTheory.Category.{v₄, u₄} F]
{G : CategoryTheory.Functor C E}
{H : CategoryTheory.Functor D F}
{L₁ : CategoryTheory.Functor C D}
{R₁ : CategoryTheory.Functor D C}
{L₂ : CategoryTheory.Functor E F}
{R₂ : CategoryTheory.Functor F E}
(adj₁ : L₁ ⊣ R₁)
(adj₂ : L₂ ⊣ R₂)
(α : G.comp L₂ ⟶ L₁.comp H)

(CategoryTheory.mateEquiv adj₁ adj₂) α =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.whiskerLeft (R₁.comp G) adj₂.unit)
    (CategoryTheory.CategoryStruct.comp (CategoryTheory.whiskerRight (CategoryTheory.whiskerLeft R₁ α) R₂)
      (CategoryTheory.whiskerRight adj₁.counit (H.comp R₂)))


theorem incMatrix_transpose_mul_diag [Fintype α] [Decidable (e ∈ G.edgeSet)] :
    ((G.incMatrix R)ᵀ * G.incMatrix R) e e = if e ∈ G.edgeSet then 2 else 0

{R : Type u_1}
{α : Type u_2}
(G : SimpleGraph α)
[NonAssocSemiring R]
{e : Sym2 α}
[Fintype α]
[Decidable (e ∈ G.edgeSet)]

((SimpleGraph.incMatrix R G)ᵀ * SimpleGraph.incMatrix R G) e e = if e ∈ G.edgeSet then 2 else 0


/--
Given a monad morphism from `T₂` to `T₁`, we get a functor from the algebras of `T₁` to algebras of
`T₂`.
-/
@[simps]
def algebraFunctorOfMonadHom {T₁ T₂ : Monad C} (h : T₂ ⟶ T₁) : Algebra T₁ ⥤ Algebra T₂

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{T₁ T₂ : CategoryTheory.Monad C}
(h : T₂ ⟶ T₁)

∀ {X Y : T₁.Algebra} (f : X ⟶ Y), ((CategoryTheory.Monad.algebraFunctorOfMonadHom h).map f).f = f.f


theorem apply_eq_iff_eq (e : α ≃o β) {x y : α} : e x = e y ↔ x = y

{α : Type u_2}
{β : Type u_3}
[LE α]
[LE β]
(e : α ≃o β)
{x y : α}


@[to_additive]
theorem map_div_left_eq_self (μ : Measure G) [IsInvInvariant μ] [IsMulLeftInvariant μ] (g : G) :
    map (fun t => g / t) μ = μ

{G : Type u_2}
[MeasurableSpace G]
[SubtractionMonoid G]
[MeasurableAdd G]
[MeasurableNeg G]
(μ : MeasureTheory.Measure G)
[μ.IsNegInvariant]
[μ.IsAddLeftInvariant]
(g : G)

MeasureTheory.Measure.map (fun t => g - t) μ = μ


@[simp]
theorem rightUnitor_inv (X : C) : (ρ_ X).inv = Limits.coprod.inl

(CategoryTheory.MonoidalCategory.rightUnitor X).inv = CategoryTheory.Limits.coprod.inl


lemma cfc_nnreal_eq_real {a : A} (f : ℝ≥0 → ℝ≥0) (ha : 0 ≤ a := by cfc_tac)  :
    cfc f a = cfc (fun x ↦ f x.toNNReal : ℝ → ℝ) a

[ContinuousFunctionalCalculus NNReal fun x => 0 ≤ x]

cfc f a = cfc (fun x => ↑(f x.toNNReal)) a


protected theorem natCast_mem (n : ℕ) : (n : A) ∈ S

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


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

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


@[simp]
theorem ofFinsupp_eq_zero {a} : (⟨a⟩ : R[X]) = 0 ↔ a = 0


@[to_additive (attr := simp)]
theorem inv_eq_val_inv : a.inv = ((a⁻¹ : αˣ) : α)

{α : Type u}
[AddMonoid α]
(a : AddUnits α)


theorem prod_top (s : NonUnitalSubring R) :
    s.prod (⊤ : NonUnitalSubring S) = s.comap (NonUnitalRingHom.fst R S)

{R : Type u}
{S : Type v}
[NonUnitalNonAssocRing R]
[NonUnitalNonAssocRing S]
(s : NonUnitalSubring R)

s.prod ⊤ = NonUnitalSubring.comap (NonUnitalRingHom.fst R S) s


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


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

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


@[simp]
theorem descPochhammer_map (f : R →+* T) (n : ℕ) :
    (descPochhammer R n).map f = descPochhammer T n

{R : Type u}
[Ring R]
{T : Type v}
[Ring T]
(f : R →+* T)
(n : ℕ)

Polynomial.map f (descPochhammer R n) = descPochhammer T n


@[simp]
theorem map_one : v 1 = (0 : Γ₀)

{R : Type u_3}
{Γ₀ : Type u_4}
[Ring R]
[LinearOrderedAddCommMonoidWithTop Γ₀]
(v : AddValuation R Γ₀)


/-- The set `antidiagonal n` is equivalent to `Fin (n+1)`, via the first projection. --/
@[simps]
def antidiagonalEquivFin (n : ℕ) : antidiagonal n ≃ Fin (n + 1)

∀ (x : Fin (n + 1)), ↑((Finset.Nat.antidiagonalEquivFin n).symm x) = (↑x, n - ↑x)


protected lemma forall_congr_right : (∀ a, q (e a)) ↔ ∀ b, q b

{α : Sort u}
{β : Sort v}
{q : β → Prop}
(e : α ≃ β)


@[simp] lemma mk_sup_mk (a b : α) (ha hb) : (⟨a, ha⟩ ⊔ ⟨b, hb⟩ : L) = ⟨a ⊔ b, L.supClosed ha hb⟩

{α : Type u_2}
[Lattice α]
{L : Sublattice α}
(a b : α)
(ha : a ∈ L)
(hb : b ∈ L)


@[simp]
lemma coe_himp (s t : Subtype (MeasurableSet : Set α → Prop)) : ↑(s ⇨ t) = (s ⇨ t : Set α)

{α : Type u_1}
[MeasurableSpace α]
(s t : Subtype MeasurableSet)


theorem eq_zero_of_gcd_eq_zero_left {m n : Nat} (H : gcd m n = 0) : m = 0


theorem IsLittleO.add_isBigOWith (h₁ : f₁ =o[l] g) (h₂ : IsBigOWith c₁ l f₂ g) (hc : c₁ < c₂) :
    IsBigOWith c₂ l (fun x => f₁ x + f₂ x) g

{α : Type u_1}
{F : Type u_4}
{E' : Type u_6}
[Norm F]
[SeminormedAddCommGroup E']
{c₁ c₂ : ℝ}
{g : α → F}
{l : Filter α}
{f₁ f₂ : α → E'}
(h₁ : f₁ =o[l] g)
(h₂ : Asymptotics.IsBigOWith c₁ l f₂ g)
(hc : c₁ < c₂)

Asymptotics.IsBigOWith c₂ l (fun x => f₁ x + f₂ x) g


theorem support_mapRange {f : ∀ i, β₁ i → β₂ i} {hf : ∀ i, f i 0 = 0} {g : Π₀ i, β₁ i} :
    (mapRange f hf g).support ⊆ g.support

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

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

(DFinsupp.mapRange f hf g).support ⊆ g.support


/-- The symbol `J(a | 0)` has the value `1`. -/
@[simp]
theorem zero_right (a : ℤ) : J(a | 0) = 1


theorem dualAnnihilator_sup_eq (U V : Submodule R M) :
    (U ⊔ V).dualAnnihilator = U.dualAnnihilator ⊓ V.dualAnnihilator

{R : Type u}
{M : Type v}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
(U V : Submodule R M)


lemma Set.Infinite.exists_accPt_cofinite_inf_principal_of_subset_isCompact
    {K : Set X} (hs : s.Infinite) (hK : IsCompact K) (hsub : s ⊆ K) :
    ∃ x ∈ K, AccPt x (cofinite ⊓ 𝓟 s)

{X : Type u}
[TopologicalSpace X]
{s K : Set X}
(hs : s.Infinite)
(hK : IsCompact K)
(hsub : s ⊆ K)

∃ x ∈ K, AccPt x (Filter.cofinite ⊓ 𝓟 s)


theorem WSameSide.trans_sSameSide {s : AffineSubspace R P} {x y z : P} (hxy : s.WSameSide x y)
    (hyz : s.SSameSide y z) : s.WSameSide x z

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[LinearOrderedField R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
{s : AffineSubspace R P}
{x y z : P}
(hxy : s.WSameSide x y)
(hyz : s.SSameSide y z)


theorem mkPiRing_apply_one_eq_self [Fintype ι] (f : MultilinearMap R (fun _ : ι => R) M₂) :
    MultilinearMap.mkPiRing R ι (f fun _ => 1) = f

{R : Type uR}
{ι : Type uι}
{M₂ : Type v₂}
[CommSemiring R]
[AddCommMonoid M₂]
[Module R M₂]
[Fintype ι]
(f : MultilinearMap R (fun x => R) M₂)

MultilinearMap.mkPiRing R ι (f fun x => 1) = f


theorem closedEmbedding_of_spaced_out {α} [TopologicalSpace α] [DiscreteTopology α]
    [T0Space β] {f : α → β} {s : Set (β × β)} (hs : s ∈ 𝓤 β)
    (hf : Pairwise fun x y => (f x, f y) ∉ s) : ClosedEmbedding f


/-- Let `f` be a function which is sufficiently close (in the Lipschitz sense) to a given linear
map `A`. Then it expands the volume of any set by at least `m` for any `m < det A`. -/
theorem mul_le_addHaar_image_of_lt_det (A : E →L[ℝ] E) {m : ℝ≥0}
    (hm : (m : ℝ≥0∞) < ENNReal.ofReal |A.det|) :
    ∀ᶠ δ in 𝓝[>] (0 : ℝ≥0),
      ∀ (s : Set E) (f : E → E), ApproximatesLinearOn f A s δ → (m : ℝ≥0∞) * μ s ≤ μ (f '' s)

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[FiniteDimensional ℝ E]
[MeasurableSpace E]
[BorelSpace E]
(μ : MeasureTheory.Measure E)
[μ.IsAddHaarMeasure]
(A : E →L[ℝ] E)
{m : ℝ≥0}
(hm : ↑m < ENNReal.ofReal |A.det|)

∀ᶠ (δ : ℝ≥0) in 𝓝[>] 0, ∀ (s : Set E) (f : E → E), ApproximatesLinearOn f A s δ → ↑m * μ s ≤ μ (f '' s)


/-- Build an isomorphism in the category `HopfAlgebraCat R` from a
`BialgEquiv`. -/
@[simps]
def toHopfAlgebraCatIso (e : X ≃ₐc[R] Y) : HopfAlgebraCat.of R X ≅ HopfAlgebraCat.of R Y

{R : Type u}
[CommRing R]
{X Y : Type v}
[Ring X]
[Ring Y]
[HopfAlgebra R X]
[HopfAlgebra R Y]
(e : X ≃ₐc[R] Y)


@[simp, norm_cast]
theorem Nat.cast_npow (R : Type*) [NonAssocSemiring R] [Pow R ℕ] [NatPowAssoc R] (n m : ℕ) :
    (↑(n ^ m) : R) = (↑n : R) ^ m

(R : Type u_2)
[NonAssocSemiring R]
[Pow R ℕ]
[NatPowAssoc R]
(n m : ℕ)


theorem supermartingale [Preorder E] (hf : Martingale f ℱ μ) : Supermartingale f ℱ μ

{Ω : Type u_1}
{E : Type u_2}
{ι : Type u_3}
[Preorder ι]
{m0 : MeasurableSpace Ω}
{μ : MeasureTheory.Measure Ω}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[CompleteSpace E]
{f : ι → Ω → E}
{ℱ : MeasureTheory.Filtration ι m0}
[Preorder E]
(hf : MeasureTheory.Martingale f ℱ μ)


@[simp]
theorem domLCongr_symm (e : M ≃ₗ[R] M₂) : (domLCongr R N ι S e).symm = domLCongr R N ι S e.symm

(R : Type u_1)
[Semiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
(N : Type u_3)
[AddCommMonoid N]
[Module R N]
(ι : Type u_7)
{M₂ : Type u_10}
[AddCommMonoid M₂]
[Module R M₂]
(S : Type u_12)
[Semiring S]
[Module S N]
[SMulCommClass R S N]
(e : M ≃ₗ[R] M₂)

(AlternatingMap.domLCongr R N ι S e).symm = AlternatingMap.domLCongr R N ι S e.symm


theorem union_congr_left (ht : t ⊆ s ∪ u) (hu : u ⊆ s ∪ t) : s ∪ t = s ∪ u

{α : Type u_1}
[DecidableEq α]
{s t u : Finset α}
(ht : t ⊆ s ∪ u)
(hu : u ⊆ s ∪ t)


@[simp]
protected theorem eq_zero {x : R} : abv x = 0 ↔ x = 0

{R : Type u_5}
{S : Type u_6}
[Semiring R]
[OrderedSemiring S]
(abv : AbsoluteValue R S)
{x : R}


theorem ncard_inter_le_ncard_left (s t : Set α) (hs : s.Finite := by toFinite_tac) :
    (s ∩ t).ncard ≤ s.ncard

{α : Type u_1}
(s t : Set α)
(hs : s.Finite := by toFinite_tac)


@[to_additive mul_nsmul] lemma pow_mul (a : M) (m : ℕ) : ∀ n, a ^ (m * n) = (a ^ m) ^ n

{M : Type u_2}
[AddMonoid M]
(a : M)
(m n : ℕ)


theorem measurableSet_pi_of_nonempty {s : Set δ} {t : ∀ i, Set (π i)} (hs : s.Countable)
    (h : (pi s t).Nonempty) : MeasurableSet (pi s t) ↔ ∀ i ∈ s, MeasurableSet (t i)

{δ : Type u_4}
{π : δ → Type u_6}
[(a : δ) → MeasurableSpace (π a)]
{s : Set δ}
{t : (i : δ) → Set (π i)}
(hs : s.Countable)
(h : (s.pi t).Nonempty)

MeasurableSet (s.pi t) ↔ ∀ i ∈ s, MeasurableSet (t i)


@[simp]
theorem preimageSingletonHomeomorph_apply {b : B} (hb : b ∈ e.baseSet) (p : proj ⁻¹' {b}) :
    e.preimageSingletonHomeomorph hb p = (e p).2

{B : Type u_2}
{F : Type u_3}
{Z : Type u_5}
[TopologicalSpace B]
[TopologicalSpace F]
{proj : Z → B}
[TopologicalSpace Z]
(e : Trivialization F proj)
{b : B}
(hb : b ∈ e.baseSet)
(p : ↑(proj ⁻¹' {b}))

(e.preimageSingletonHomeomorph hb) p = (↑e ↑p).2


@[simp]
theorem self_symm_id (α : X ≅ Y) : α ≪≫ α.symm = Iso.refl X

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


theorem kroneckerMap_diagonal_left [Zero α] [Zero γ] [DecidableEq l] (f : α → β → γ)
    (hf : ∀ b, f 0 b = 0) (a : l → α) (B : Matrix m n β) :
    kroneckerMap f (diagonal a) B =
      Matrix.reindex (Equiv.prodComm _ _) (Equiv.prodComm _ _)
        (blockDiagonal fun i => B.map fun b => f (a i) b)

{α : Type u_2}
{β : Type u_4}
{γ : Type u_6}
{l : Type u_8}
{m : Type u_9}
{n : Type u_10}
[Zero α]
[Zero γ]
[DecidableEq l]
(f : α → β → γ)
(hf : ∀ (b : β), f 0 b = 0)
(a : l → α)
(B : Matrix m n β)

Matrix.kroneckerMap f (Matrix.diagonal a) B =
  (Matrix.reindex (Equiv.prodComm m l) (Equiv.prodComm n l)) (Matrix.blockDiagonal fun i => B.map fun b => f (a i) b)


@[simp]
theorem comp_id (f : CompleteLatticeHom α β) : f.comp (CompleteLatticeHom.id α) = f

{α : Type u_2}
{β : Type u_3}
[CompleteLattice α]
[CompleteLattice β]
(f : CompleteLatticeHom α β)


theorem inner_self_nonneg {x : E} : 0 ≤ re ⟪x, x⟫

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


@[to_additive norm_pos_iff']
theorem norm_pos_iff''' [T0Space E] {a : E} : 0 < ‖a‖ ↔ a ≠ 1

{E : Type u_6}
[SeminormedAddGroup E]
[T0Space E]
{a : E}


/-- Evaluate a polynomial `p` given a ring hom `f` from the scalar ring
  to the target and a value `x` for the variable in the target -/
irreducible_def eval₂ (p : R[X]) : S

{R : Type u_1}
{S : Type u_2}
[Semiring R]
[Semiring S]
(f : R →+* S)
(x : S)
(p : R[X])

Polynomial.eval₂ f x p = p.sum fun e a => f a * x ^ e


/-- Shows that `IntFractPair.stream` has the sequence property, that is once we return `none` at
position `n`, we also return `none` at `n + 1`.
-/
theorem stream_isSeq (v : K) : (IntFractPair.stream v).IsSeq

{K : Type u_1}
[LinearOrderedField K]
[FloorRing K]
(v : K)


@[to_additive]
theorem nontrivial_iff_ne_bot (H : Subgroup G) : Nontrivial H ↔ H ≠ ⊥

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


/--
The equivalence between `LocallyConstant X Y` and `LocallyConstant X Z` given an
equivalence `Y ≃ Z`
-/
@[simps]
def congrRight (e : Y ≃ Z) : LocallyConstant X Y ≃ LocallyConstant X Z

{X : Type u_1}
{Y : Type u_2}
{Z : Type u_3}
[TopologicalSpace X]
(e : Y ≃ Z)
(g : LocallyConstant X Z)

(LocallyConstant.congrRight e).symm g = LocallyConstant.map (⇑e.symm) g


nonrec theorem cot_eq_cos_div_sin : cot x = cos x / sin x


theorem ContractibleSpace.hequiv_unit (X : Type*) [TopologicalSpace X] [ContractibleSpace X] :
    Nonempty (X ≃ₕ Unit)

(X : Type u_1)
[TopologicalSpace X]
[ContractibleSpace X]


theorem t1Space_iff_exists_open :
    T1Space X ↔ Pairwise fun x y => ∃ U : Set X, IsOpen U ∧ x ∈ U ∧ y ∉ U

T1Space X ↔ Pairwise fun x y => ∃ U, IsOpen U ∧ x ∈ U ∧ y ∉ U


@[simp]
theorem mem_restrict (p : Prop) (o : Part α) (h : p → o.Dom) (a : α) :
    a ∈ restrict p o h ↔ p ∧ a ∈ o

{α : Type u_1}
(p : Prop)
(o : Part α)
(h : p → o.Dom)
(a : α)


@[simp]
theorem bihimp_eq_right : a ⇔ b = b ↔ a = ⊤

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


protected theorem Fintype.finite {α : Type*} (_inst : Fintype α) : Finite α


theorem rank_transpose_mul_self (A : Matrix m n R) : (Aᵀ * A).rank = A.rank

{m : Type u_2}
{n : Type u_3}
{R : Type u_5}
[Fintype n]
[Fintype m]
[LinearOrderedField R]
(A : Matrix m n R)


@[simp] lemma toNat_bne_one  (b : Bool) : (b.toNat != 1) = !b


theorem image2_swap (s : Set α) (t : Set β) : image2 f s t = image2 (fun a b => f b a) t s

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

Set.image2 f s t = Set.image2 (fun a b => f b a) t s


lemma HasHomology.mk' (h : S.HomologyData) : HasHomology S


@[to_additive]
theorem hasProd_iff_tendsto_nat [T2Space M] {f : ℕ → M} (hf : Multipliable f) :
    HasProd f m ↔ Tendsto (fun n : ℕ ↦ ∏ i ∈ range n, f i) atTop (𝓝 m)

{M : Type u_1}
[AddCommMonoid M]
[TopologicalSpace M]
{m : M}
[T2Space M]
{f : ℕ → M}
(hf : Summable f)

HasSum f m ↔ Filter.Tendsto (fun n => ∑ i ∈ Finset.range n, f i) Filter.atTop (𝓝 m)


@[to_additive]
lemma IsOfFinOrder.mem_zpowers_iff_mem_range_orderOf [DecidableEq G] (hx : IsOfFinOrder x) :
    y ∈ zpowers x ↔ y ∈ (Finset.range (orderOf x)).image (x ^ ·)

{G : Type u_1}
[AddGroup G]
{x y : G}
[DecidableEq G]
(hx : IsOfFinAddOrder x)

y ∈ AddSubgroup.zmultiples x ↔ y ∈ Finset.image (fun x_1 => x_1 • x) (Finset.range (addOrderOf x))


protected theorem Monotone.Ici (hf : Monotone f) : Antitone fun x => Ici (f x)

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
{f : α → β}
(hf : Monotone f)


/-- If `f : X → Z` is a Borel measurable map from a standard Borel space
to a countably separated measurable space,
then for any measurable space `β` and `g : Z → β`, the composition `g ∘ f` is
measurable if and only if the restriction of `g` to the range of `f` is measurable. -/
theorem measurable_comp_iff_restrict {f : X → Z}
    [CountablySeparated (range f)]
    (hf : Measurable f) {g : Z → β} : Measurable (g ∘ f) ↔ Measurable (restrict (range f) g)

Measurable (g ∘ f) ↔ Measurable ((Set.range f).restrict g)


theorem logb_lt_iff_lt_rpow (hx : 0 < x) : logb b x < y ↔ x < b ^ y


theorem union_inter_distrib_right (s t u : Set α) : (s ∪ t) ∩ u = s ∩ u ∪ t ∩ u


theorem lsingle_range_le_ker_lapply (s t : Set α) (h : Disjoint s t) :
    ⨆ a ∈ s, LinearMap.range (lsingle a : M →ₗ[R] α →₀ M) ≤
      ⨅ a ∈ t, ker (lapply a : (α →₀ M) →ₗ[R] M)

{α : Type u_1}
{M : Type u_2}
{R : Type u_5}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(s t : Set α)
(h : Disjoint s t)

⨆ a ∈ s, LinearMap.range (Finsupp.lsingle a) ≤ ⨅ a ∈ t, LinearMap.ker (Finsupp.lapply a)


/-- A category is called preadditive if `P ⟶ Q` is an abelian group such that composition is
    linear in both variables. -/
class Preadditive where
  homGroup : ∀ P Q : C, AddCommGroup (P ⟶ Q) := by infer_instance
  add_comp : ∀ (P Q R : C) (f f' : P ⟶ Q) (g : Q ⟶ R), (f + f') ≫ g = f ≫ g + f' ≫ g := by
    aesop_cat
  comp_add : ∀ (P Q R : C) (f : P ⟶ Q) (g g' : Q ⟶ R), f ≫ (g + g') = f ≫ g + f ≫ g' := by
    aesop_cat

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[self : CategoryTheory.Preadditive C]
(P Q R : C)
(f : P ⟶ Q)
(g g' : Q ⟶ R)


theorem nonempty_hom_of_preconnected_groupoid {G} [Groupoid G] [IsPreconnected G] :
    ∀ x y : G, Nonempty (x ⟶ y)

{G : Type u_1}
[CategoryTheory.Groupoid G]
[CategoryTheory.IsPreconnected G]
(x y : G)


/-- **Uniqueness of left-invariant measures**:
Given two left-invariant measures which are finite
on compacts and inner regular, they coincide up to a multiplicative constant. -/
@[to_additive isAddLeftInvariant_eq_smul_of_innerRegular]
lemma isMulLeftInvariant_eq_smul_of_innerRegular [LocallyCompactSpace G]
    (μ' μ : Measure G) [IsHaarMeasure μ] [IsFiniteMeasureOnCompacts μ'] [IsMulLeftInvariant μ']
    [InnerRegular μ] [InnerRegular μ'] :
    μ' = haarScalarFactor μ' μ • μ


/-- The simple reflections of `W` generate `W` as a monoid. -/
theorem submonoid_closure_range_simple : Submonoid.closure (range cs.simple) = ⊤

{B : Type u_1}
{W : Type u_3}
[Group W]
{M : CoxeterMatrix B}
(cs : CoxeterSystem M W)

Submonoid.closure (Set.range cs.simple) = ⊤


@[to_additive mem_rightAddCoset]
theorem mem_rightCoset {s : Set α} {x : α} (a : α) (hxS : x ∈ s) : x * a ∈ op a • s

{α : Type u_1}
[Add α]
{s : Set α}
{x : α}
(a : α)
(hxS : x ∈ s)


theorem MonotoneOn.quasiconcaveOn (hf : MonotoneOn f s) (hs : Convex 𝕜 s) : QuasiconcaveOn 𝕜 s f

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_4}
[OrderedSemiring 𝕜]
[LinearOrderedAddCommMonoid E]
[OrderedAddCommMonoid β]
[Module 𝕜 E]
[OrderedSMul 𝕜 E]
{s : Set E}
{f : E → β}
(hf : MonotoneOn f s)
(hs : Convex 𝕜 s)


theorem norm_le_of_tsum_le (hp : 0 < p.toReal) {C : ℝ} (hC : 0 ≤ C) {f : lp E p}
    (hf : ∑' i, ‖f i‖ ^ p.toReal ≤ C ^ p.toReal) : ‖f‖ ≤ C

(hf : ∑' (i : α), ‖↑f i‖ ^ p.toReal ≤ C ^ p.toReal)


theorem index_nonempty (b : Basis ι R M) [Nontrivial M] : Nonempty ι

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


/-- The isomorphism between left extensions induced by a right unitor. -/
@[simps! hom_right inv_right]
def whiskerOfCompIdIsoSelf (t : LeftExtension f g) : (t.whisker (𝟙 c)).ofCompId ≅ t

(t : CategoryTheory.Bicategory.LeftExtension f g)

t.whiskerOfCompIdIsoSelf.inv.right = (CategoryTheory.Bicategory.rightUnitor t.extension).inv


@[measurability]
protected theorem Homeomorph.measurable (h : α ≃ₜ γ) : Measurable h

{α : Type u_1}
{γ : Type u_3}
[TopologicalSpace α]
[MeasurableSpace α]
[OpensMeasurableSpace α]
[TopologicalSpace γ]
[MeasurableSpace γ]
[BorelSpace γ]
(h : α ≃ₜ γ)


@[to_additive (attr := simp) MeasureTheory.sdiff_addFundamentalInterior]
theorem sdiff_fundamentalInterior : s \ fundamentalInterior G s = fundamentalFrontier G s

(G : Type u_1)
{α : Type u_3}
[Group G]
[MulAction G α]
(s : Set α)

s \ MeasureTheory.fundamentalInterior G s = MeasureTheory.fundamentalFrontier G s


@[simp]
theorem darts_copy {u v u' v'} (p : G.Walk u v) (hu : u = u') (hv : v = v') :
    (p.copy hu hv).darts = p.darts

{V : Type u}
{G : SimpleGraph V}
{u v u' v' : V}
(p : G.Walk u v)
(hu : u = u')
(hv : v = v')


@[to_additive]
protected theorem Inseparable.inv {x y : G} (h : Inseparable x y) : Inseparable (x⁻¹) (y⁻¹)

{G : Type w}
[TopologicalSpace G]
[Neg G]
[ContinuousNeg G]
{x y : G}
(h : Inseparable x y)


@[simp]
theorem mapRange.linearMap_toAddMonoidHom (f : M →ₗ[R] N) :
    (mapRange.linearMap f).toAddMonoidHom =
      (mapRange.addMonoidHom f.toAddMonoidHom : (α →₀ M) →+ _)

{α : Type u_1}
{M : Type u_2}
{N : Type u_3}
{R : Type u_5}
[Semiring R]
[AddCommMonoid M]
[Module R M]
[AddCommMonoid N]
[Module R N]
(f : M →ₗ[R] N)

(Finsupp.mapRange.linearMap f).toAddMonoidHom = Finsupp.mapRange.addMonoidHom f.toAddMonoidHom


theorem liftPropOn_mono (mono : ∀ ⦃s x t⦄ ⦃f : H → H'⦄, t ⊆ s → P f s x → P f t x)
    (h : LiftPropOn P g t) (hst : s ⊆ t) : LiftPropOn P g s

(mono : ∀ ⦃s : Set H⦄ ⦃x : H⦄ ⦃t : Set H⦄ ⦃f : H → H'⦄, t ⊆ s → P f s x → P f t x)


@[simp]
theorem of_intCast (n : ℤ) : of A 0 n = n

{ι : Type u_1}
[DecidableEq ι]
(A : ι → Type u_2)
[(i : ι) → AddCommGroup (A i)]
[AddMonoid ι]
[DirectSum.GRing A]
(n : ℤ)


@[to_additive]
theorem comp_coprod {Q : Type*} [CommSemigroup Q] (h : P →ₙ* Q) (f : M →ₙ* P) (g : N →ₙ* P) :
    h.comp (f.coprod g) = (h.comp f).coprod (h.comp g)

{M : Type u_5}
{N : Type u_6}
{P : Type u_7}
[Add M]
[Add N]
[AddCommSemigroup P]
{Q : Type u_8}
[AddCommSemigroup Q]
(h : AddHom P Q)
(f : AddHom M P)
(g : AddHom N P)


/--
If there exists a finite set `{ r }` of `R` such that `Mᵣ` is `Rᵣ`-finite for each `r`,
then `M` is a finite `R`-module.

See `of_localizationSpan` for a version without the finite set assumption.
-/
theorem of_localizationSpan_finite (t : Finset R) (ht : Ideal.span (t : Set R) = ⊤)
    (H : ∀ (g : t), Module.Finite (Localization.Away g.val)
      (LocalizedModule (Submonoid.powers g.val) M)) :
    Module.Finite R M

(H : ∀ (g : { x // x ∈ t }), Module.Finite (Localization.Away ↑g) (LocalizedModule (Submonoid.powers ↑g) M))


theorem toList_injective : Function.Injective (@toList α n)


/-- Given a closed set `s`, a point belongs to `s` iff its infimum edistance to this set vanishes -/
theorem mem_iff_infEdist_zero_of_closed (h : IsClosed s) : x ∈ s ↔ infEdist x s = 0

{α : Type u}
[PseudoEMetricSpace α]
{x : α}
{s : Set α}
(h : IsClosed s)


/-- A finset is bounded above. -/
protected theorem bddAbove [SemilatticeSup α] [Nonempty α] (s : Finset α) : BddAbove (↑s : Set α)

{α : Type u}
[SemilatticeSup α]
[Nonempty α]
(s : Finset α)


@[simp] lemma infIrred_Ici (a : α) : InfIrred (Ici a)


@[simp] theorem leftInvSeq_nil : lis [] = []

{B : Type u_1}
{W : Type u_2}
[Group W]
{M : CoxeterMatrix B}
(cs : CoxeterSystem M W)


lemma ιFunctorObj_extension {i : I} (t : A i ⟶ X) (b : B i ⟶ S)
    (sq : CommSq t (f i) πX b) :
    ∃ (l : B i ⟶ functorObj f πX), f i ≫ l = t ≫ ιFunctorObj f πX ∧
      l ≫ πFunctorObj f πX = b

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

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

(sq : CategoryTheory.CommSq t (f i) πX b)

∃ l,
  CategoryTheory.CategoryStruct.comp (f i) l =
      CategoryTheory.CategoryStruct.comp t (CategoryTheory.SmallObject.ιFunctorObj f πX) ∧
    CategoryTheory.CategoryStruct.comp l (CategoryTheory.SmallObject.πFunctorObj f πX) = b


@[to_additive lt_add_of_pos_right]
theorem lt_mul_of_one_lt_right' [CovariantClass α α (· * ·) (· < ·)] (a : α) {b : α} (h : 1 < b) :
    a < a * b

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


@[simp]
theorem extendDomain_mul (e e' : Perm α) :
    e.extendDomain f * e'.extendDomain f = (e * e').extendDomain f

{α : Type u}
{β : Type v}
{p : β → Prop}
[DecidablePred p]
(f : α ≃ Subtype p)
(e e' : Equiv.Perm α)


theorem Prod.continuous_to_fun : ContinuousOn (Prod.toFun' e₁ e₂)
    (π (F₁ × F₂) (E₁ ×ᵇ E₂) ⁻¹' (e₁.baseSet ∩ e₂.baseSet))

[TopologicalSpace (Bundle.TotalSpace F₁ E₁)]

[TopologicalSpace (Bundle.TotalSpace F₂ E₂)]

{e₁ : Trivialization F₁ Bundle.TotalSpace.proj}

{e₂ : Trivialization F₂ Bundle.TotalSpace.proj}

ContinuousOn (Trivialization.Prod.toFun' e₁ e₂) (Bundle.TotalSpace.proj ⁻¹' (e₁.baseSet ∩ e₂.baseSet))


theorem refl_le_uniformity : 𝓟 idRel ≤ 𝓤 α


/-- A continuous function with compact support has a global maximum. -/
@[to_additive "A continuous function with compact support has a global maximum."]
theorem Continuous.exists_forall_ge_of_hasCompactMulSupport [ClosedIciTopology α] [Nonempty β]
    [One α] {f : β → α} (hf : Continuous f) (h : HasCompactMulSupport f) :
    ∃ x : β, ∀ y : β, f y ≤ f x

{α : Type u_2}
{β : Type u_3}
[LinearOrder α]
[TopologicalSpace α]
[TopologicalSpace β]
[ClosedIciTopology α]
[Nonempty β]
[One α]
{f : β → α}
(hf : Continuous f)
(h : HasCompactMulSupport f)


/-- The obvious triangle `X₁ ⟶ X₁ ⨯ X₂ ⟶ X₂ ⟶ X₁⟦1⟧`. -/
@[simps!]
def binaryProductTriangle (X₁ X₂ : C) [HasZeroMorphisms C] [HasBinaryProduct X₁ X₂] :
    Triangle C

(CategoryTheory.Pretriangulated.binaryProductTriangle X₁ X₂).obj₂ = (X₁ ⨯ X₂)


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

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


theorem succ_sub_succ_eq_sub (n m : Nat) : succ n - succ m = n - m


/-- A `Monoid A` is `α`-rootable iff `xⁿ = a` has a solution for all `n ≠ 0 ∈ α` and `a ∈ A`.
Here we adopt a constructive approach where we ask an explicit `root : A → α → A` function such that
* `root a 0 = 1` for all `a ∈ A`
* `(root a n)ⁿ = a` for all `n ≠ 0 ∈ α` and `a ∈ A`.
-/
@[to_additive]
class RootableBy where
  root : A → α → A
  root_zero : ∀ a, root a 0 = 1
  root_cancel : ∀ {n : α} (a : A), n ≠ 0 → root a n ^ n = a

{A : Type u_1}
{α : Type u_2}
[Monoid A]
[Pow A α]
[Zero α]
[self : RootableBy A α]
{n : α}
(a : A)


lemma conj_mul' (z : ℂ) : conj z * z = ‖z‖ ^ 2


lemma tendsto_indicator_const_iff_tendsto_pi_pure [T1Space β] (b : β) [NeZero b] :
    Tendsto (fun i ↦ (As i).indicator (fun (_ : α) ↦ b)) L (𝓝 (A.indicator (fun (_ : α) ↦ b)))
      ↔ (Tendsto As L <| Filter.pi (pure <| · ∈ A))

{α : Type u_1}
{A : Set α}
{β : Type u_2}
[Zero β]
[TopologicalSpace β]
{ι : Type u_3}
(L : Filter ι)
{As : ι → Set α}
[T1Space β]
(b : β)
[NeZero b]

Filter.Tendsto (fun i => (As i).indicator fun x => b) L (𝓝 (A.indicator fun x => b)) ↔
  Filter.Tendsto As L (Filter.pi fun x => pure (x ∈ A))


theorem trTape'_move_left (L R : ListBlank Γ) :
    (Tape.move Dir.left)^[n] (trTape' enc0 L R) = trTape' enc0 L.tail (R.cons L.head)

(enc0 : enc default = Mathlib.Vector.replicate n false)

(Turing.Tape.move Turing.Dir.left)^[n] (Turing.TM1to1.trTape' enc0 L R) =
  Turing.TM1to1.trTape' enc0 L.tail (Turing.ListBlank.cons L.head R)


@[to_additive VAddAntidiagonal.fst_eq_fst_iff_snd_eq_snd]
theorem fst_eq_fst_iff_snd_eq_snd :
    (x : G × P).1 = (y : G × P).1 ↔ (x : G × P).2 = (y : G × P).2

{G : Type u_1}
{P : Type u_2}
{s : Set G}
{t : Set P}
{a : P}
[SMul G P]
[IsCancelSMul G P]
{x y : ↑(s.smulAntidiagonal t a)}


theorem card_fintypeIoo : Fintype.card (Set.Ioo a b) = b - a - 1


theorem image_val_subset : (γ : Set α) ⊆ β


theorem Sum.dist_eq_glueDist {p q : X ⊕ Y} (x : X) (y : Y) :
    Sum.dist p q =
      glueDist (fun _ : Unit => Nonempty.some ⟨x⟩) (fun _ : Unit => Nonempty.some ⟨y⟩) 1 p q

{X : Type u}
{Y : Type v}
[MetricSpace X]
[MetricSpace Y]
{p q : X ⊕ Y}
(x : X)
(y : Y)

Metric.Sum.dist p q = Metric.glueDist (fun x_1 => ⋯.some) (fun x => ⋯.some) 1 p q


theorem zipWith_distrib_take : (zipWith f l l').take n = zipWith f (l.take n) (l'.take n)

∀ {α : Type u_1} {α_1 : Type u_2} {α_2 : Type u_3} {f : α → α_1 → α_2} {l : List α} {l' : List α_1} {n : Nat},
  List.take n (List.zipWith f l l') = List.zipWith f (List.take n l) (List.take n l')


/-- An element is contained in the relative perfect closure if and only if its mininal polynomial
has separable degree one. -/
theorem mem_perfectClosure_iff_natSepDegree_eq_one {x : E} :
    x ∈ perfectClosure F E ↔ (minpoly F x).natSepDegree = 1

{F : Type u}
{E : Type v}
[Field F]
[Field E]
[Algebra F E]
{x : E}


protected theorem Set.EquicontinuousOn.continuousOn_of_mem {H : Set <| X → α} {S : Set X}
    (h : H.EquicontinuousOn S) {f : X → α} (hf : f ∈ H) : ContinuousOn f S

{X : Type u_3}
{α : Type u_7}
[tX : TopologicalSpace X]
[uα : UniformSpace α]
{H : Set (X → α)}
{S : Set X}
(h : H.EquicontinuousOn S)
{f : X → α}
(hf : f ∈ H)


@[to_additive (attr := simp)]
theorem pureMonoidHom_apply (a : α) : pureMonoidHom a = pure a


theorem completion.lift_unique {V W : SemiNormedGrp} [CompleteSpace W] [T0Space W]
    (f : V ⟶ W) (g : completion.obj V ⟶ W) : completion.incl ≫ g = f → g = completion.lift f

(g : SemiNormedGrp.completion.obj V ⟶ W)

SemiNormedGrp.completion.incl ≫ g = f → g = SemiNormedGrp.completion.lift f


@[to_additive (attr := simp)]
theorem preimage_mul_left_closedBall [IsometricSMul G G] (a b : G) (r : ℝ≥0∞) :
    (a * ·) ⁻¹' closedBall b r = closedBall (a⁻¹ * b) r

{G : Type v}
[Group G]
[PseudoEMetricSpace G]
[IsometricSMul G G]
(a b : G)
(r : ℝ≥0∞)

(fun x => a * x) ⁻¹' EMetric.closedBall b r = EMetric.closedBall (a⁻¹ * b) r


nonrec theorem _root_.Irreducible.addVal_pow {ϖ : R} (h : Irreducible ϖ) (n : ℕ) :
    addVal R (ϖ ^ n) = n

{R : Type u_1}
[CommRing R]
[IsDomain R]
[DiscreteValuationRing R]
{ϖ : R}
(h : Irreducible ϖ)
(n : ℕ)

(DiscreteValuationRing.addVal R) (ϖ ^ n) = ↑n


theorem ker_comp_eq_of_commute_of_disjoint_ker [FiniteDimensional K V] {f g : V →ₗ[K] V}
    (h : Commute f g) (h' : Disjoint (ker f) (ker g)) :
    ker (f ∘ₗ g) = ker f ⊔ ker g

(h' : Disjoint (LinearMap.ker f) (LinearMap.ker g))

LinearMap.ker (f ∘ₗ g) = LinearMap.ker f ⊔ LinearMap.ker g


/-- An element is contained in the separable closure of `F` in `E` if and only if
it is a separable element. -/
theorem mem_separableClosure_iff {x : E} :
    x ∈ separableClosure F E ↔ IsSeparable F x


/-- For a nilpotent Lie module `M` of a Lie algebra `L`, the first term in the lower central series
of `M` contains a non-zero element on which `L` acts trivially unless the entire action is trivial.

Taking `M = L`, this provides a useful characterisation of Abelian-ness for nilpotent Lie
algebras. -/
lemma disjoint_lowerCentralSeries_maxTrivSubmodule_iff [IsNilpotent R L M] :
    Disjoint (lowerCentralSeries R L M 1) (maxTrivSubmodule R L M) ↔ IsTrivial L M

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

Disjoint (LieModule.lowerCentralSeries R L M 1) (LieModule.maxTrivSubmodule R L M) ↔ LieModule.IsTrivial L M


@[simp]
theorem toRingHom_toOpposite (f : A →ₐ[R] B) (hf : ∀ x y, Commute (f x) (f y)) :
    (f.toOpposite hf : A →+* Bᵐᵒᵖ) = (f : A →+* B).toOpposite hf

{R : Type u_1}
{A : Type u_3}
{B : Type u_4}
[CommSemiring R]
[Semiring A]
[Semiring B]
[Algebra R A]
[Algebra R B]
(f : A →ₐ[R] B)
(hf : ∀ (x y : A), Commute (f x) (f y))


@[simp]
theorem map_one_add (x : ℝ) : f (1 + x) = 1 + f x


@[simp]
lemma primesBelow_zero : primesBelow 0 = ∅


lemma hasDerivAt_Gamma_one_half : HasDerivAt Gamma (-√π * (γ + 2 * log 2)) (1 / 2)

HasDerivAt Complex.Gamma (-↑√Real.pi * (↑γ + 2 * Complex.log 2)) (1 / 2)


theorem measure_inter_null_of_null_left {S : Set α} (T : Set α) (h : μ S = 0) : μ (S ∩ T) = 0

{α : Type u_1}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
{S : Set α}
(T : Set α)
(h : μ S = 0)


/-- If `c` is a colimiting binary coproduct cocone, and we have an initial object,
then we have `IsPushout 0 0 c.inl c.inr`
(where each `0` is the unique morphism from the initial object). -/
theorem of_is_coproduct {c : BinaryCofan X Y} (h : Limits.IsColimit c) (t : IsInitial Z) :
    IsPushout (t.to _) (t.to _) c.inl c.inr

{c : CategoryTheory.Limits.BinaryCofan X Y}

CategoryTheory.IsPushout (t.to ((CategoryTheory.Limits.pair X Y).obj { as := CategoryTheory.Limits.WalkingPair.left }))
  (t.to ((CategoryTheory.Limits.pair X Y).obj { as := CategoryTheory.Limits.WalkingPair.right })) c.inl c.inr


theorem mem_centralizer_iff {s : Set A} {z : A} :
    z ∈ centralizer R s ↔ ∀ g ∈ s, g * z = z * g ∧ star g * z = z * star g

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

z ∈ StarSubalgebra.centralizer R s ↔ ∀ g ∈ s, g * z = z * g ∧ star g * z = z * star g


/-- A multiplicative analogue of `Equiv.arrowCongr`,
for multiplicative maps from a monoid to a commutative monoid.
-/
@[to_additive (attr := simps apply)
  "An additive analogue of `Equiv.arrowCongr`,
  for additive maps from an additive monoid to a commutative additive monoid."]
-- Porting note: @[simps apply] removed because it was making a lemma which
-- wasn't in simp normal form.
def monoidHomCongr {M N P Q} [MulOneClass M] [MulOneClass N] [CommMonoid P] [CommMonoid Q]
    (f : M ≃* N) (g : P ≃* Q) : (M →* P) ≃* (N →* Q)

{M : Type u_12}
{N : Type u_13}
{P : Type u_14}
{Q : Type u_15}
[MulOneClass M]
[MulOneClass N]
[CommMonoid P]
[CommMonoid Q]
(f : M ≃* N)
(g : P ≃* Q)
(h : M →* P)

(f.monoidHomCongr g) h = g.toMonoidHom.comp (h.comp f.symm.toMonoidHom)


protected theorem isWellFounded (f : r ↪r s) [IsWellFounded β s] : IsWellFounded α r

{α : Type u_1}
{β : Type u_2}
{r : α → α → Prop}
{s : β → β → Prop}
(f : r ↪r s)
[IsWellFounded β s]


@[local simp] theorem ofNat_add_negSucc (m n : Nat) : ↑m + -[n+1] = subNatNat m (succ n)

↑m + Int.negSucc n = Int.subNatNat m n.succ


theorem groupSMul_span_eq_top {G : Type*} [Group G] [DistribMulAction G R] [DistribMulAction G M]
    [IsScalarTower G R M] {v : ι → M} (hv : Submodule.span R (Set.range v) = ⊤) {w : ι → G} :
    Submodule.span R (Set.range (w • v)) = ⊤


@[simp]
theorem bagInter_consecutive (n m l : Nat) :
    @List.bagInter ℕ instBEqOfDecidableEq (Ico n m) (Ico m l) = []

(List.Ico n m).bagInter (List.Ico m l) = []


@[simp]
theorem toDFinsupp_toMultiset (s : Multiset α) : DFinsupp.toMultiset (Multiset.toDFinsupp s) = s

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


@[simp] theorem isPrefixOf_cons₂_self [LawfulBEq α] {a : α} :
    isPrefixOf (a::as) (a::bs) = isPrefixOf as bs

{α : Type u_1}
[BEq α]
{as bs : List α}
[LawfulBEq α]
{a : α}

(a :: as).isPrefixOf (a :: bs) = as.isPrefixOf bs


protected theorem Pairwise.nodup {l : List α} {r : α → α → Prop} [IsIrrefl α r] (h : Pairwise r l) :
    Nodup l

{α : Type u}
{l : List α}
{r : α → α → Prop}
[IsIrrefl α r]
(h : List.Pairwise r l)


@[simp]
theorem bihimp_bihimp_self : a ⇔ b ⇔ a = b

{α : Type u_2}
[BooleanAlgebra α]
(a b : α)


private theorem ne_add_csize_add_self : i ≠ n + Char.utf8Size c + i


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

`addNatOrderEmb m i` adds `m` to `i`, generalizes `Fin.succ`. -/
@[simps! apply toEmbedding]
def addNatOrderEmb (m) : Fin n ↪o Fin (n + m)

∀ (x : Fin n), (Fin.addNatOrderEmb m) x = x.addNat m


theorem reindex_reindex (e : ι ≃ ι₂) (e' : ι₂ ≃ ι₃) (x : ⨂[R] i, s i) :
    reindex R _ e' (reindex R s e x) = reindex R s (e.trans e') x

{ι : Type u_1}
{ι₂ : Type u_2}
{ι₃ : Type u_3}
{R : Type u_4}
[CommSemiring R]
{s : ι → Type u_7}
[(i : ι) → AddCommMonoid (s i)]
[(i : ι) → Module R (s i)]
(e : ι ≃ ι₂)
(e' : ι₂ ≃ ι₃)
(x : PiTensorProduct R fun i => s i)

(PiTensorProduct.reindex R (fun i => s (e.symm i)) e') ((PiTensorProduct.reindex R s e) x) =
  (PiTensorProduct.reindex R s (e.trans e')) x


@[simp] lemma _root_.EReal.expOrderIso_apply (x : EReal) : expOrderIso x = exp x


lemma InjOn.image_diff {t : Set α} (h : s.InjOn f) : f '' (s \ t) = f '' s \ f '' (s ∩ t)

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


/-- The Yoneda embedding for `R`-linear categories `C`,
sending an object `Y : Cᵒᵖ` to the `Module R`-valued copresheaf on `C`,
with value on `X : C` given by `Module.of R (unop Y ⟶ X)`. -/
@[simps]
def linearCoyoneda : Cᵒᵖ ⥤ C ⥤ ModuleCat R

(R : Type w)
[Ring R]
(C : Type u)
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Preadditive C]
[CategoryTheory.Linear R C]
{Y₁ Y₂ : Cᵒᵖ}
(f : Y₁ ⟶ Y₂)
(X : C)

((CategoryTheory.linearCoyoneda R C).map f).app X = ModuleCat.ofHom (CategoryTheory.Linear.leftComp R X f.unop)


/-- An open cover of `X` consists of a family of open immersions into `X`,
and for each `x : X` an open immersion (indexed by `f x`) that covers `x`.

This is merely a coverage in the Zariski pretopology, and it would be optimal
if we could reuse the existing API about pretopologies, However, the definitions of sieves and
grothendieck topologies uses `Prop`s, so that the actual open sets and immersions are hard to
obtain. Also, since such a coverage in the pretopology usually contains a proper class of
immersions, it is quite hard to glue them, reason about finite covers, etc.
-/
structure OpenCover (X : Scheme.{u}) where
  /-- index set of an open cover of a scheme `X` -/
  J : Type v
  /-- the subschemes of an open cover -/
  obj : J → Scheme
  /-- the embedding of subschemes to `X` -/
  map : ∀ j : J, obj j ⟶ X
  /-- given a point of `x : X`, `f x` is the index of the subscheme which contains `x`  -/
  f : X → J
  /-- the subschemes covers `X` -/
  covers : ∀ x, x ∈ Set.range (map (f x)).1.base
  /-- the embedding of subschemes are open immersions -/
  IsOpen : ∀ x, IsOpenImmersion (map x) := by infer_instance

{X : AlgebraicGeometry.Scheme}
(self : X.OpenCover)
(x : self.J)


@[simp]
theorem mapQ_id (h : p ≤ p.comap LinearMap.id := (by rw [comap_id])) :
    p.mapQ p LinearMap.id h = LinearMap.id

(h : p ≤ Submodule.comap LinearMap.id p := ⋯)


@[aesop 5% apply (rule_sets := [SetLike])]
lemma mem_of_subset {s : Set B} (hp : s ⊆ p) {x : B} (hx : x ∈ s) : x ∈ p

{A : Type u_1}
{B : Type u_2}
[i : SetLike A B]
{p : A}
{s : Set B}
(hp : s ⊆ ↑p)
{x : B}
(hx : x ∈ s)


theorem norm_rpow_of_nonneg {x y : ℝ} (hx_nonneg : 0 ≤ x) : ‖x ^ y‖ = ‖x‖ ^ y


@[to_additive]
theorem inv_comp [Inv γ] (x : β → γ) (y : α → β) : x⁻¹ ∘ y = (x ∘ y)⁻¹

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[Neg γ]
(x : β → γ)
(y : α → β)


lemma natTrailingDegree_eq_zero_of_constantCoeff_ne_zero (h : constantCoeff p ≠ 0) :
    p.natTrailingDegree = 0

{R : Type u}
[Semiring R]
{p : R[X]}
(h : Polynomial.constantCoeff p ≠ 0)


theorem IsClosed.sInf_mem {s : Set α} (hs : s.Nonempty) (hc : IsClosed s) : sInf s ∈ s

{α : Type u_1}
[CompleteLinearOrder α]
[TopologicalSpace α]
[OrderTopology α]
{s : Set α}
(hs : s.Nonempty)
(hc : IsClosed s)


lemma isOpen_def (T : Set (WithLower α)) : IsOpen T ↔ (lower α).IsOpen (WithLower.toLower ⁻¹' T)

{α : Type u_1}
[Preorder α]
(T : Set (Topology.WithLower α))

IsOpen T ↔ TopologicalSpace.IsOpen (⇑Topology.WithLower.toLower ⁻¹' T)