/-- A monotone function `f` sending `top` to `top` and continuous at the infimum of a set sends
this infimum to the infimum of the image of this set. -/
theorem Monotone.map_sInf_of_continuousAt {f : α → β} {s : Set α} (Cf : ContinuousAt f (sInf s))
    (Mf : Monotone f) (ftop : f ⊤ = ⊤) : f (sInf s) = sInf (f '' s)

{α : Type u_1}
{β : Type u_2}
[CompleteLinearOrder α]
[TopologicalSpace α]
[OrderTopology α]
[CompleteLinearOrder β]
[TopologicalSpace β]
[OrderClosedTopology β]
{f : α → β}
{s : Set α}
(Cf : ContinuousAt f (sInf s))
(Mf : Monotone f)
(ftop : f ⊤ = ⊤)


theorem filterAt_basis_closedBall (x : α) :
    (v.filterAt x).HasBasis (0 < ·) ({a ∈ v.setsAt x | a ⊆ closedBall x ·})

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

(v.filterAt x).HasBasis (fun x => 0 < x) fun x_1 => {a | a ∈ v.setsAt x ∧ a ⊆ Metric.closedBall x x_1}


theorem mapAux_lemma (s : String) (i : Pos) (c : Char) (h : ¬s.atEnd i) :
    (s.set i c).endPos.1 - ((s.set i c).next i).1 < s.endPos.1 - i.1

(s : String)
(i : String.Pos)
(c : Char)
(h : ¬s.atEnd i = true)

(s.set i c).endPos.byteIdx - ((s.set i c).next i).byteIdx < s.endPos.byteIdx - i.byteIdx


/-- Implementation of `ShrinkHoms.equivalence`. -/
@[simps]
noncomputable def inverse : ShrinkHoms C ⥤ C

[CategoryTheory.LocallySmall.{w, v, u} C]

(CategoryTheory.ShrinkHoms.inverse C).map f = (equivShrink (X.fromShrinkHoms ⟶ Y.fromShrinkHoms)).symm f


@[to_additive (attr := simp)]
theorem partialProd_zero (f : Fin n → α) : partialProd f 0 = 1

{α : Type u_1}
[Monoid α]
{n : ℕ}
(f : Fin n → α)


@[simp, norm_cast]
theorem coe_iInf {ι : Sort*} {S : ι → StarSubalgebra R A} : (↑(⨅ i, S i) : Set A) = ⋂ i, S i

{R : Type u_2}
{A : Type u_3}
[CommSemiring R]
[StarRing R]
[Semiring A]
[Algebra R A]
[StarRing A]
[StarModule R A]
{ι : Sort u_5}
{S : ι → StarSubalgebra R A}


theorem left_inv' (e : α ≃ β) : Function.LeftInverse e.symm e


@[simp]
theorem AddSubmonoid.toNatSubmodule_toAddSubmonoid (S : AddSubmonoid M) :
    S.toNatSubmodule.toAddSubmonoid = S

{M : Type u_3}
[AddCommMonoid M]
(S : AddSubmonoid M)

(AddSubmonoid.toNatSubmodule S).toAddSubmonoid = S


@[simp]
theorem coe_id : ((id : E →ₗᵢ[R] E) : E → E) = _root_.id

{R : Type u_1}
{E : Type u_5}
[Semiring R]
[SeminormedAddCommGroup E]
[Module R E]


protected theorem continuous_inner :
    Continuous (uncurry inner : Completion E × Completion E → 𝕜)

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


/-- Formulation of reflection formula tailored to functional equations of L-functions of odd
Dirichlet characters. -/
lemma inv_Gammaℝ_two_sub {s : ℂ} (hs : ∀ (n : ℕ), s ≠ -n) :
    (Gammaℝ (2 - s))⁻¹ = Gammaℂ s * sin (π * s / 2) * (Gammaℝ (s + 1))⁻¹

(2 - s).Gammaℝ⁻¹ = s.Gammaℂ * Complex.sin (↑π * s / 2) * (s + 1).Gammaℝ⁻¹


theorem inner_sub_left (x y z : F) : ⟪x - y, z⟫ = ⟪x, z⟫ - ⟪y, z⟫

{𝕜 : Type u_1}
{F : Type u_3}
[RCLike 𝕜]
[AddCommGroup F]
[Module 𝕜 F]
[c : InnerProductSpace.Core 𝕜 F]
(x y z : F)


theorem ofId_apply (r) : ofId R A r = algebraMap R A r

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

(Algebra.ofId R A) r = (algebraMap R A) r


@[simp]
theorem inv_head {i j} (w : NeWord G i j) : w.inv.head = w.last⁻¹

{ι : Type u_1}
{G : ι → Type u_4}
[(i : ι) → Group (G i)]
{i j : ι}
(w : Monoid.CoprodI.NeWord G i j)


theorem withTopEquiv_symm_zero : withTopEquiv.symm 0 = 0


lemma stableUnderBaseChange (hP : RingHom.StableUnderBaseChange Q) : P.StableUnderBaseChange

{P : CategoryTheory.MorphismProperty AlgebraicGeometry.Scheme}

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

(hP : RingHom.StableUnderBaseChange fun {R S} [CommRing R] [CommRing S] => Q)


theorem HasStrictDerivAt.sum (h : ∀ i ∈ u, HasStrictDerivAt (A i) (A' i) x) :
    HasStrictDerivAt (fun y => ∑ i ∈ u, A i y) (∑ i ∈ u, A' i) x


@[simp] theorem append_eq_nil : p ++ q = [] ↔ p = [] ∧ q = []

∀ {α : Type u_1} {p q : List α}, p ++ q = [] ↔ p = [] ∧ q = []


@[to_additive]
theorem measure_ne_zero [Countable G] [SMulInvariantMeasure G α μ]
    (hμ : μ ≠ 0) (h : IsFundamentalDomain G s μ) : μ s ≠ 0

[MeasureTheory.VAddInvariantMeasure G α μ]

(h : MeasureTheory.IsAddFundamentalDomain G s μ)


@[simp]
theorem superpolynomialDecay_zero (l : Filter α) (k : α → β) : SuperpolynomialDecay l k 0

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace β]
[CommSemiring β]
(l : Filter α)
(k : α → β)


/-- A simplicial category is a category `C` that is enriched over the
category of simplicial sets in such a way that morphisms in
`C` identify to the `0`-simplices of the enriched hom. -/
class SimplicialCategory extends EnrichedCategory SSet.{v} C where
  /-- morphisms identify to `0`-simplices of the enriched hom -/
  homEquiv (K L : C) : (K ⟶ L) ≃ (𝟙_ SSet.{v} ⟶ EnrichedCategory.Hom K L)
  homEquiv_id (K : C) : homEquiv K K (𝟙 K) = eId SSet K := by aesop_cat
  homEquiv_comp {K L M : C} (f : K ⟶ L) (g : L ⟶ M) :
    homEquiv K M (f ≫ g) = (λ_ _).inv ≫ (homEquiv K L f ⊗ homEquiv L M g) ≫
      eComp SSet K L M := by aesop_cat

[self : CategoryTheory.SimplicialCategory C]

(CategoryTheory.SimplicialCategory.homEquiv K K) (𝟙 K) = CategoryTheory.eId SSet K


@[reassoc (attr := simp)]
theorem biprodComparison_snd : biprodComparison F X Y ≫ biprod.snd = F.map biprod.snd

[CategoryTheory.Limits.HasBinaryBiproduct (F.obj X) (F.obj Y)]

F.biprodComparison X Y ≫ CategoryTheory.Limits.biprod.snd = F.map CategoryTheory.Limits.biprod.snd


theorem Sorted.rel_of_mem_take_of_mem_drop {l : List α} (h : List.Sorted r l) {k : ℕ} {x y : α}
    (hx : x ∈ List.take k l) (hy : y ∈ List.drop k l) : r x y

{α : Type u}
{r : α → α → Prop}
{l : List α}
(h : List.Sorted r l)
{k : ℕ}
{x y : α}
(hx : x ∈ List.take k l)
(hy : y ∈ List.drop k l)


lemma toSpec_injective {f : A} {m : ℕ} (f_deg : f ∈ 𝒜 m) (hm : 0 < m) :
    Function.Injective (toSpec 𝒜 f)

{R : Type u_1}
{A : Type u_2}
[CommRing R]
[CommRing A]
[Algebra R A]
(𝒜 : ℕ → Submodule R A)
[GradedAlgebra 𝒜]
{f : A}
{m : ℕ}
(f_deg : f ∈ 𝒜 m)
(hm : 0 < m)

Function.Injective ⇑(AlgebraicGeometry.ProjIsoSpecTopComponent.toSpec 𝒜 f)


theorem rel_cons_left {a as bs} :
    Rel r (a ::ₘ as) bs ↔ ∃ b bs', r a b ∧ Rel r as bs' ∧ bs = b ::ₘ bs'

{α : Type u_1}
{β : Type v}
{r : α → β → Prop}
{a : α}
{as : Multiset α}
{bs : Multiset β}

Multiset.Rel r (a ::ₘ as) bs ↔ ∃ b bs', r a b ∧ Multiset.Rel r as bs' ∧ bs = b ::ₘ bs'


@[to_additive (attr := simp)] lemma smul_fst : (a • x).1 = a • x.1

{M : Type u_1}
{α : Type u_5}
{β : Type u_6}
[SMul M α]
[SMul M β]
(a : M)
(x : α × β)


@[simp]
theorem leftComm_symm_tmul (m : M) (n : N) (p : P) :
    (leftComm R M N P).symm (n ⊗ₜ (m ⊗ₜ p)) = m ⊗ₜ (n ⊗ₜ p)

(R : Type u_1)
[CommSemiring R]
{M : Type u_4}
{N : Type u_5}
{P : Type u_6}
[AddCommMonoid M]
[AddCommMonoid N]
[AddCommMonoid P]
[Module R M]
[Module R N]
[Module R P]
(m : M)
(n : N)
(p : P)

(TensorProduct.leftComm R M N P).symm (n ⊗ₜ[R] m ⊗ₜ[R] p) = m ⊗ₜ[R] n ⊗ₜ[R] p


@[to_additive (attr := simp)]
lemma one_of {A : Type*} [Monoid A] : (1 : MonCat.of A) = (1 : A)


@[simp]
theorem cast_toZNumNeg [AddGroup α] [One α] : ∀ n : Num, (n.toZNumNeg : α) = -n

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


/-- In an R₁ space, the filters `coclosedCompact` and `cocompact` are equal. -/
@[simp]
theorem Filter.coclosedCompact_eq_cocompact : coclosedCompact X = cocompact X

{X : Type u_1}
[TopologicalSpace X]
[R1Space X]

Filter.coclosedCompact X = Filter.cocompact X


@[simp]
theorem neg_left_iff : Commute (-a) b ↔ Commute a b

{R : Type x}
[Mul R]
[HasDistribNeg R]
{a b : R}


@[to_additive (attr := simp)]
theorem lift_comp_of : lift f ∘ of = f

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


theorem integrable_withDensity_iff_integrable_smul {f : α → ℝ≥0} (hf : Measurable f) {g : α → E} :
    Integrable g (μ.withDensity fun x => f x) ↔ Integrable (fun x => f x • g x) μ

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{E : Type u_5}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : α → ℝ≥0}
(hf : Measurable f)
{g : α → E}

MeasureTheory.Integrable g (μ.withDensity fun x => ↑(f x)) ↔ MeasureTheory.Integrable (fun x => f x • g x) μ


theorem image₂_inter_subset_left [DecidableEq α] :
    image₂ f (s ∩ s') t ⊆ image₂ f s t ∩ image₂ f s' t

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

Finset.image₂ f (s ∩ s') t ⊆ Finset.image₂ f s t ∩ Finset.image₂ f s' t


theorem sInf_sup_sInf : sInf s ⊔ sInf t = ⨅ p ∈ s ×ˢ t, (p : α × α).1 ⊔ p.2

{α : Type u}
[Order.Coframe α]
{s t : Set α}

sInf s ⊔ sInf t = ⨅ p ∈ s ×ˢ t, p.1 ⊔ p.2


@[to_additive]
protected theorem NeBot.mul : NeBot f → NeBot g → NeBot (f * g)


theorem trans_apply (e₁ : R ≃+* S) (e₂ : S ≃+* S') (a : R) : e₁.trans e₂ a = e₂ (e₁ a)

{R : Type u_4}
{S : Type u_5}
{S' : Type u_6}
[Mul R]
[Mul S]
[Add R]
[Add S]
[Mul S']
[Add S']
(e₁ : R ≃+* S)
(e₂ : S ≃+* S')
(a : R)


theorem mul_def (f g : M₁ →L[R₁] M₁) : f * g = f.comp g

{R₁ : Type u_1}
[Semiring R₁]
{M₁ : Type u_4}
[TopologicalSpace M₁]
[AddCommMonoid M₁]
[Module R₁ M₁]
(f g : M₁ →L[R₁] M₁)


@[simp]
theorem erase_same (p : R[X]) (n : ℕ) : coeff (p.erase n) n = 0

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


theorem lt_isLUB_iff (h : IsLUB s a) : b < a ↔ ∃ c ∈ s, b < c

{α : Type u}
[LinearOrder α]
{s : Set α}
{a b : α}
(h : IsLUB s a)


/-- The functor `Comma L₁ R ⥤ Comma L₃ R` induced by the composition of two natural transformations
    `l : L₁ ⟶ L₂` and `l' : L₂ ⟶ L₃` is naturally isomorphic to the composition of the two functors
    induced by these natural transformations. -/
@[simps!]
def mapLeftComp (l : L₁ ⟶ L₂) (l' : L₂ ⟶ L₃) :
    mapLeft R (l ≫ l') ≅ mapLeft R l' ⋙ mapLeft R l

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

((CategoryTheory.Comma.mapLeftComp R l l').hom.app X).left = CategoryTheory.CategoryStruct.id X.left


theorem lcm_dvd_iff {m n k : ℕ} : lcm m n ∣ k ↔ m ∣ k ∧ n ∣ k


theorem StrictAnti.cmp_map_eq (hf : StrictAnti f) (x y : α) : cmp (f x) (f y) = cmp y x

{α : Type u}
{β : Type v}
[LinearOrder α]
[LinearOrder β]
{f : α → β}
(hf : StrictAnti f)
(x y : α)


@[norm_cast]
theorem integral_ofReal {f : X → ℝ} : ∫ x, (f x : 𝕜) ∂μ = ↑(∫ x, f x ∂μ)

{X : Type u_1}
[MeasurableSpace X]
{μ : MeasureTheory.Measure X}
{𝕜 : Type u_5}
[RCLike 𝕜]
{f : X → ℝ}

∫ (x : X), ↑(f x) ∂μ = ↑(∫ (x : X), f x ∂μ)


/-- A single point is cospherical. -/
theorem cospherical_singleton (p : P) : Cospherical ({p} : Set P)


/-- An Akra-Bazzi recurrence is a function that satisfies the recurrence
`T n = (∑ i, a i * T (r i n)) + g n`. -/
structure AkraBazziRecurrence {α : Type*} [Fintype α] [Nonempty α]
    (T : ℕ → ℝ) (g : ℝ → ℝ) (a : α → ℝ) (b : α → ℝ) (r : α → ℕ → ℕ) where
  /-- Point below which the recurrence is in the base case -/
  n₀ : ℕ
  /-- `n₀` is always `> 0` -/
  n₀_gt_zero : 0 < n₀
  /-- The `a`'s are nonzero -/
  a_pos : ∀ i, 0 < a i
  /-- The `b`'s are nonzero -/
  b_pos : ∀ i, 0 < b i
  /-- The b's are less than 1 -/
  b_lt_one : ∀ i, b i < 1
  /-- `g` is nonnegative -/
  g_nonneg : ∀ x ≥ 0, 0 ≤ g x
  /-- `g` grows polynomially -/
  g_grows_poly : AkraBazziRecurrence.GrowsPolynomially g
  /-- The actual recurrence -/
  h_rec (n : ℕ) (hn₀ : n₀ ≤ n) : T n = (∑ i, a i * T (r i n)) + g n
  /-- Base case: `T(n) > 0` whenever `n < n₀` -/
  T_gt_zero' (n : ℕ) (hn : n < n₀) : 0 < T n
  /-- The `r`'s always reduce `n` -/
  r_lt_n : ∀ i n, n₀ ≤ n → r i n < n
  /-- The `r`'s approximate the `b`'s -/
  dist_r_b : ∀ i, (fun n => (r i n : ℝ) - b i * n) =o[atTop] fun n => n / (log n) ^ 2

{α : Type u_1}
[Fintype α]
[Nonempty α]
{T : ℕ → ℝ}
{g : ℝ → ℝ}
{a b : α → ℝ}
{r : α → ℕ → ℕ}
(self : AkraBazziRecurrence T g a b r)
(i : α)

(fun n => ↑(r i n) - b i * ↑n) =o[Filter.atTop] fun n => ↑n / Real.log ↑n ^ 2


theorem lineMap_injective [NoZeroSMulDivisors k V1] {p₀ p₁ : P1} (h : p₀ ≠ p₁) :
    Function.Injective (lineMap p₀ p₁ : k → P1)

(k : Type u_1)
{V1 : Type u_2}
{P1 : Type u_3}
[Ring k]
[AddCommGroup V1]
[Module k V1]
[AffineSpace V1 P1]
[NoZeroSMulDivisors k V1]
{p₀ p₁ : P1}
(h : p₀ ≠ p₁)

Function.Injective ⇑(AffineMap.lineMap p₀ p₁)


theorem antivary_comm : Antivary f g ↔ Antivary g f

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


theorem hitting_eq_hitting_of_exists {m₁ m₂ : ι} (h : m₁ ≤ m₂)
    (h' : ∃ j ∈ Set.Icc n m₁, u j ω ∈ s) : hitting u s n m₁ ω = hitting u s n m₂ ω

{Ω : Type u_1}
{β : Type u_2}
{ι : Type u_3}
[ConditionallyCompleteLinearOrder ι]
{u : ι → Ω → β}
{s : Set β}
{n : ι}
{ω : Ω}
{m₁ m₂ : ι}
(h : m₁ ≤ m₂)
(h' : ∃ j ∈ Set.Icc n m₁, u j ω ∈ s)

MeasureTheory.hitting u s n m₁ ω = MeasureTheory.hitting u s n m₂ ω


theorem fg_iff_add_subgroup_fg {G : Type*} [AddCommGroup G] (P : Submodule ℤ G) :
    P.FG ↔ P.toAddSubgroup.FG

{G : Type u_3}
[AddCommGroup G]
(P : Submodule ℤ G)


@[to_additive (attr := simp)]
theorem mem_stabilizerSubmonoid_iff {a : α} {m : M} : m ∈ stabilizerSubmonoid M a ↔ m • a = a

{M : Type u}
[Monoid M]
{α : Type v}
[MulAction M α]
{a : α}
{m : M}

m ∈ MulAction.stabilizerSubmonoid M a ↔ m • a = a


/-- The number of times a positive integer `i` appears in the partition `ofSums n l hl` is the same
as the number of times it appears in the multiset `l`.
(For `i = 0`, `Partition.non_zero` combined with `Multiset.count_eq_zero_of_not_mem` gives that
this is `0` instead.)
-/
theorem count_ofSums_of_ne_zero {n : ℕ} {l : Multiset ℕ} (hl : l.sum = n) {i : ℕ} (hi : i ≠ 0) :
    (ofSums n l hl).parts.count i = l.count i

Multiset.count i (Nat.Partition.ofSums n l hl).parts = Multiset.count i l


@[fun_prop]
theorem ContinuousLinearMap.hasFDerivWithinAt_of_bilinear {f : G' → E} {g : G' → F}
    {f' : G' →L[𝕜] E} {g' : G' →L[𝕜] F} {x : G'} {s : Set G'} (hf : HasFDerivWithinAt f f' s x)
    (hg : HasFDerivWithinAt g g' s x) :
    HasFDerivWithinAt (fun y => B (f y) (g y))
      (B.precompR G' (f x) g' + B.precompL G' f' (g x)) s x

{𝕜 : 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]
{G' : Type u_5}
[NormedAddCommGroup G']
[NormedSpace 𝕜 G']
(B : E →L[𝕜] F →L[𝕜] G)
{f : G' → E}
{g : G' → F}
{f' : G' →L[𝕜] E}
{g' : G' →L[𝕜] F}
{x : G'}
{s : Set G'}
(hf : HasFDerivWithinAt f f' s x)
(hg : HasFDerivWithinAt g g' s x)

HasFDerivWithinAt (fun y => (B (f y)) (g y))
  (((ContinuousLinearMap.precompR G' B) (f x)) g' + ((ContinuousLinearMap.precompL G' B) f') (g x)) s x


/-- The product of a strictly monotone function and a monotone function is strictly monotone. -/
@[to_additive add_monotone "The sum of a strictly monotone function and a monotone function is
strictly monotone."]
theorem StrictMono.mul_monotone' (hf : StrictMono f) (hg : Monotone g) :
    StrictMono fun x => f x * g x

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

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


theorem ne_top_iff {x : PartENat} : x ≠ ⊤ ↔ ∃ n : ℕ, x = n


theorem ge_of_tendsto' {x : Filter β} [NeBot x] (lim : Tendsto f x (𝓝 a))
    (h : ∀ c, b ≤ f c) : b ≤ a

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[Preorder α]
[ClosedIciTopology α]
{f : β → α}
{a b : α}
{x : Filter β}
[x.NeBot]
(lim : Filter.Tendsto f x (𝓝 a))
(h : ∀ (c : β), b ≤ f c)


theorem lintegral_withDensity_eq_lintegral_mul_non_measurable (μ : Measure α) {f : α → ℝ≥0∞}
    (f_meas : Measurable f) (hf : ∀ᵐ x ∂μ, f x < ∞) (g : α → ℝ≥0∞) :
    ∫⁻ a, g a ∂μ.withDensity f = ∫⁻ a, (f * g) a ∂μ

{α : Type u_1}
{m0 : MeasurableSpace α}
(μ : MeasureTheory.Measure α)
{f : α → ℝ≥0∞}
(f_meas : Measurable f)
(hf : ∀ᵐ (x : α) ∂μ, f x < ⊤)
(g : α → ℝ≥0∞)

∫⁻ (a : α), g a ∂μ.withDensity f = ∫⁻ (a : α), (f * g) a ∂μ


theorem toNNReal_pos {a : ℝ≥0∞} (ha₀ : a ≠ 0) (ha_top : a ≠ ∞) : 0 < a.toNNReal

{a : ℝ≥0∞}
(ha₀ : a ≠ 0)
(ha_top : a ≠ ⊤)


theorem mk_eq_fun_of_mem_aeSeqSet (hf : ∀ i, AEMeasurable (f i) μ) {x : α} (hx : x ∈ aeSeqSet hf p)
    (i : ι) : (hf i).mk (f i) x = f i x

{ι : Sort u_1}
{α : Type u_2}
{β : Type u_3}
[MeasurableSpace α]
[MeasurableSpace β]
{f : ι → α → β}
{μ : MeasureTheory.Measure α}
{p : α → (ι → β) → Prop}
(hf : ∀ (i : ι), AEMeasurable (f i) μ)
{x : α}
(hx : x ∈ aeSeqSet hf p)
(i : ι)


theorem hasDerivAt_polynomial_eval_inv_mul (p : ℝ[X]) (x : ℝ) :
    HasDerivAt (fun x ↦ p.eval x⁻¹ * expNegInvGlue x)
      ((X ^ 2 * (p - derivative (R := ℝ) p)).eval x⁻¹ * expNegInvGlue x) x

HasDerivAt (fun x => Polynomial.eval x⁻¹ p * expNegInvGlue x)
  (Polynomial.eval x⁻¹ (Polynomial.X ^ 2 * (p - Polynomial.derivative p)) * expNegInvGlue x) x


@[simp]
lemma DifferentiableOn.sub_iff_right (hg : DifferentiableOn 𝕜 f s) :
    DifferentiableOn 𝕜 (fun y => f y - g y) s ↔ DifferentiableOn 𝕜 g s

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


theorem measurableSet_kernel_integrable ⦃f : α → β → E⦄ (hf : StronglyMeasurable (uncurry f)) :
    MeasurableSet {x | Integrable (f x) (κ x)}

⦃f : α → β → E⦄

(hf : MeasureTheory.StronglyMeasurable (Function.uncurry f))

MeasurableSet {x | MeasureTheory.Integrable (f x) (κ x)}


theorem smul_span (a : α) (s : Set M) : a • span R s = span R (a • s)

{α : Type u_1}
{R : Type u_2}
{M : Type u_3}
[Semiring R]
[AddCommMonoid M]
[Module R M]
[Monoid α]
[DistribMulAction α M]
[SMulCommClass α R M]
(a : α)
(s : Set M)

a • Submodule.span R s = Submodule.span R (a • s)


@[simp] lemma unop_inv [Inv α] (a : αᵃᵒᵖ) : unop a⁻¹ = (unop a)⁻¹

AddOpposite.unop a⁻¹ = (AddOpposite.unop a)⁻¹


/-- Eisenstein series are bounded at infinity. -/
theorem isBoundedAtImInfty_eisensteinSeries_SIF {N : ℕ+} (a : Fin 2 → ZMod N) {k : ℤ} (hk : 3 ≤ k)
    (A : SL(2, ℤ)) : IsBoundedAtImInfty ((eisensteinSeries_SIF a k).toFun ∣[k] A)

{N : ℕ+}
(a : Fin 2 → ZMod ↑N)
{k : ℤ}
(hk : 3 ≤ k)
(A : SL(2, ℤ))

UpperHalfPlane.IsBoundedAtImInfty ((EisensteinSeries.eisensteinSeries_SIF a k).toFun ∣[k] A)


/-- Whiskering a 1-morphism is a functor. -/
@[simps]
def whiskering {x : B} (h : x ⟶ c) : LeftLift f g ⥤ LeftLift f (h ≫ g)

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

∀ {X Y : CategoryTheory.Bicategory.LeftLift f g} (η : X ⟶ Y),
  (CategoryTheory.Bicategory.LeftLift.whiskering h).map η =
    CategoryTheory.Bicategory.LeftLift.homMk (CategoryTheory.Bicategory.whiskerLeft h η.right) ⋯


lemma coe_negOnePow (K : Type*) (n : ℤ) [Field K] : n.negOnePow = (-1 : K) ^ n


theorem le_sqrt_log (hN : 4096 ≤ N) : log (2 / (1 - 2 / exp 1)) * (69 / 50) ≤ √(log ↑N)


theorem segment_subset (x y : ∀ i, π i) : segment 𝕜 x y ⊆ s.pi fun i => segment 𝕜 (x i) (y i)

{𝕜 : Type u_1}
{ι : Type u_5}
{π : ι → Type u_6}
[OrderedSemiring 𝕜]
[(i : ι) → AddCommMonoid (π i)]
[(i : ι) → Module 𝕜 (π i)]
{s : Set ι}
(x y : (i : ι) → π i)


theorem subtype_mk {f : α → β} {p : β → Prop} [DecidablePred p] {h : ∀ a, p (f a)}
    (hp : PrimrecPred p) (hf : Computable f) :
    @Computable _ _ _ (Primcodable.subtype hp) fun a => (⟨f a, h a⟩ : Subtype p)

{α : Type u_1}
{β : Type u_2}
[Primcodable α]
[Primcodable β]
{f : α → β}
{p : β → Prop}
[DecidablePred p]
{h : ∀ (a : α), p (f a)}
(hp : PrimrecPred p)
(hf : Computable f)


/-- A `k`-smooth number can be written as a square times a product of distinct primes `< k`. -/
lemma eq_prod_primes_mul_sq_of_mem_smoothNumbers {n k : ℕ} (h : n ∈ smoothNumbers k) :
    ∃ s ∈ k.primesBelow.powerset, ∃ m, n = m ^ 2 * (s.prod id)

∃ s ∈ k.primesBelow.powerset, ∃ m, n = m ^ 2 * s.prod id


@[fun_prop]
theorem HasStrictFDerivAt.continuousMultilinear_apply_const (hc : HasStrictFDerivAt c c' x)
    (u : ∀ i, M i) : HasStrictFDerivAt (fun y ↦ (c y) u) (c'.flipMultilinear u) x

{c : E → ContinuousMultilinearMap 𝕜 M H}

{c' : E →L[𝕜] ContinuousMultilinearMap 𝕜 M H}

HasStrictFDerivAt (fun y => (c y) u) (c'.flipMultilinear u) x


theorem Filter.Tendsto.cons {α : Type*} {f : α → β} {g : α → List β} {a : Filter α} {b : β}
    {l : List β} (hf : Tendsto f a (𝓝 b)) (hg : Tendsto g a (𝓝 l)) :
    Tendsto (fun a => List.cons (f a) (g a)) a (𝓝 (b::l))

{β : Type u_2}
[TopologicalSpace β]
{α : Type u_3}
{f : α → β}
{g : α → List β}
{a : Filter α}
{b : β}
{l : List β}
(hf : Filter.Tendsto f a (𝓝 b))
(hg : Filter.Tendsto g a (𝓝 l))

Filter.Tendsto (fun a => f a :: g a) a (𝓝 (b :: l))


theorem isIntegralCurve_Ioo_eq_of_contMDiff_boundaryless [BoundarylessManifold I M]
    (hv : ContMDiff I I.tangent 1 (fun x ↦ (⟨x, v x⟩ : TangentBundle I M)))
    (hγ : IsIntegralCurve γ v) (hγ' : IsIntegralCurve γ' v) (h : γ t₀ = γ' t₀) : γ = γ'

(hv : ContMDiff I I.tangent 1 fun x => { proj := x, snd := v x })


theorem mem_span_pow_iff_le_valuation (x : ℤ_[p]) (hx : x ≠ 0) (n : ℕ) :
    x ∈ (Ideal.span {(p : ℤ_[p]) ^ n} : Ideal ℤ_[p]) ↔ ↑n ≤ x.valuation

{p : ℕ}
[hp : Fact (Nat.Prime p)]
(x : ℤ_[p])
(hx : x ≠ 0)
(n : ℕ)

x ∈ Ideal.span {↑p ^ n} ↔ ↑n ≤ x.valuation


@[simp]
theorem sumArrowEquivProdArrow_apply_fst (f : α ⊕ β → γ) (a : α) :
    (sumArrowEquivProdArrow α β γ f).1 a = f (inl a)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
(f : α ⊕ β → γ)
(a : α)

((Equiv.sumArrowEquivProdArrow α β γ) f).1 a = f (Sum.inl a)


theorem pred_le {a b} : pred a ≤ b ↔ a ≤ succ b


theorem zero_eq_mul_self : 0 = a * a ↔ a = 0

{M₀ : Type u_1}
[MulZeroClass M₀]
[NoZeroDivisors M₀]
{a : M₀}


@[to_additive]
theorem comap_inf (S T : Submonoid N) (f : F) : (S ⊓ T).comap f = S.comap f ⊓ T.comap f

{M : Type u_1}
{N : Type u_2}
[MulOneClass M]
[MulOneClass N]
{F : Type u_4}
[FunLike F M N]
[mc : MonoidHomClass F M N]
(S T : Submonoid N)
(f : F)

Submonoid.comap f (S ⊓ T) = Submonoid.comap f S ⊓ Submonoid.comap f T


@[trans]
theorem mem_of_eq_of_mem {x y : α} {s : Set α} (hx : x = y) (h : y ∈ s) : x ∈ s

{α : Type u}
{x y : α}
{s : Set α}
(hx : x = y)
(h : y ∈ s)


theorem IsPrenex.liftAt {k m : ℕ} (h : IsPrenex φ) : (φ.liftAt k m).IsPrenex

{L : FirstOrder.Language}
{α : Type u'}
{l : ℕ}
{φ : L.BoundedFormula α l}
{k m : ℕ}
(h : φ.IsPrenex)

(FirstOrder.Language.BoundedFormula.liftAt k m φ).IsPrenex


theorem log_sqrt {x : ℝ} (hx : 0 ≤ x) : log (√x) = log x / 2


@[to_additive (attr := norm_cast, simp)]
theorem coe_list_prod (l : List S) : (l.prod : M) = (l.map (↑)).prod

{M : Type u_1}
{B : Type u_3}
[Monoid M]
[SetLike B M]
[SubmonoidClass B M]
{S : B}
(l : List ↥S)


/-- The distance on `X ⊕ Y` is a candidate -/
private theorem dist_mem_candidates :
    (fun p : (X ⊕ Y) × (X ⊕ Y) => dist p.1 p.2) ∈ candidates X Y

{X : Type u}
{Y : Type v}
[MetricSpace X]
[CompactSpace X]
[Nonempty X]
[MetricSpace Y]
[CompactSpace Y]
[Nonempty Y]

(fun p => dist p.1 p.2) ∈ GromovHausdorff.candidates X Y


protected theorem mul_assoc (a b c : Int) : a * b * c = a * (b * c)


/-- The main techical lemma for `GammaSeq_tendsto_Gamma`, expressing the integral defining the
Gamma function for `0 < re s` as the limit of a sequence of integrals over finite intervals. -/
theorem approx_Gamma_integral_tendsto_Gamma_integral {s : ℂ} (hs : 0 < re s) :
    Tendsto (fun n : ℕ => ∫ x : ℝ in (0)..n, ((1 - x / n) ^ n : ℝ) * (x : ℂ) ^ (s - 1)) atTop
      (𝓝 <| Gamma s)

Filter.Tendsto (fun n => ∫ (x : ℝ) in 0 ..↑n, ↑((1 - x / ↑n) ^ n) * ↑x ^ (s - 1)) Filter.atTop (𝓝 (Complex.Gamma s))


@[simp]
theorem sup_le_iff : a ⊔ b ≤ c ↔ a ≤ c ∧ b ≤ c

{α : Type u}
[SemilatticeSup α]
{a b c : α}


@[fun_prop]
theorem HasFDerivAt.restrictScalars (h : HasFDerivAt f f' x) :
    HasFDerivAt f (f'.restrictScalars 𝕜) x

(𝕜 : Type u_1)
[NontriviallyNormedField 𝕜]
{𝕜' : Type u_2}
[NontriviallyNormedField 𝕜']
[NormedAlgebra 𝕜 𝕜']
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜' E]
[IsScalarTower 𝕜 𝕜' E]
{F : Type u_4}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[NormedSpace 𝕜' F]
[IsScalarTower 𝕜 𝕜' F]
{f : E → F}
{f' : E →L[𝕜'] F}
{x : E}
(h : HasFDerivAt f f' x)

HasFDerivAt f (ContinuousLinearMap.restrictScalars 𝕜 f') x


/-- If a function `g` is bounded,
then the difference between Birkhoff averages of `g`
along the orbit of `f x` and along the orbit of `x`
tends to zero.

See also `tendsto_birkhoffAverage_apply_sub_birkhoffAverage`. -/
theorem tendsto_birkhoffAverage_apply_sub_birkhoffAverage' {g : α → E}
    (h : Bornology.IsBounded (range g)) (f : α → α) (x : α) :
    Tendsto (fun n ↦ birkhoffAverage 𝕜 f g n (f x) - birkhoffAverage 𝕜 f g n x) atTop (𝓝 0)

{α : Type u_1}
{E : Type u_2}
[NormedAddCommGroup E]
(𝕜 : Type u_3)
[RCLike 𝕜]
[Module 𝕜 E]
[BoundedSMul 𝕜 E]
{g : α → E}
(h : Bornology.IsBounded (Set.range g))
(f : α → α)
(x : α)

Filter.Tendsto (fun n => birkhoffAverage 𝕜 f g n (f x) - birkhoffAverage 𝕜 f g n x) Filter.atTop (𝓝 0)


theorem natDegree_pos_of_eval₂_root {p : R[X]} (hp : p ≠ 0) (f : R →+* S) {z : S}
    (hz : eval₂ f z p = 0) (inj : ∀ x : R, f x = 0 → x = 0) : 0 < natDegree p

{R : Type u}
{S : Type v}
[Semiring R]
[Semiring S]
{p : R[X]}
(hp : p ≠ 0)
(f : R →+* S)
{z : S}
(hz : Polynomial.eval₂ f z p = 0)
(inj : ∀ (x : R), f x = 0 → x = 0)


@[simp]
theorem eraseIdx_val {i : Fin n} : ∀ {v : Vector α n}, (eraseIdx i v).val = v.val.eraseIdx i

{n : ℕ}
{α : Type u_1}
{i : Fin n}
{v : Mathlib.Vector α n}

↑(Mathlib.Vector.eraseIdx i v) = (↑v).eraseIdx ↑i


@[simp] theorem castLT_castSucc {n : Nat} (a : Fin n) (h : (a : Nat) < n) :
    castLT (castSucc a) h = a


@[simp]
lemma KaehlerDifferential.kerCotangentToTensor_toCotangent (x) :
    kerCotangentToTensor R A B (Ideal.toCotangent _ x) = 1 ⊗ₜ D _ _ x.1

(R : Type u)
[CommRing R]
(A : Type u_2)
(B : Type u_3)
[CommRing A]
[CommRing B]
[Algebra R A]
[Algebra A B]
(x : ↥(RingHom.ker (algebraMap A B)))

(KaehlerDifferential.kerCotangentToTensor R A B) ((RingHom.ker (algebraMap A B)).toCotangent x) =
  1 ⊗ₜ[A] (KaehlerDifferential.D R A) ↑x


protected theorem HasFDerivAtFilter.fst (h : HasFDerivAtFilter f₂ f₂' x L) :
    HasFDerivAtFilter (fun x => (f₂ x).1) ((fst 𝕜 F G).comp f₂') x L

{𝕜 : 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]
{x : E}
{L : Filter E}
{f₂ : E → F × G}
{f₂' : E →L[𝕜] F × G}
(h : HasFDerivAtFilter f₂ f₂' x L)

HasFDerivAtFilter (fun x => (f₂ x).1) ((ContinuousLinearMap.fst 𝕜 F G).comp f₂') x L


theorem nhds_subtype (s : Set X) (x : { x // x ∈ s }) : 𝓝 x = comap (↑) (𝓝 (x : X))

{X : Type u}
[TopologicalSpace X]
(s : Set X)
(x : { x // x ∈ s })


@[to_additive exists_zero_lt]
theorem exists_one_lt' [Nontrivial α] : ∃ a : α, 1 < a

{α : Type u}
[LinearOrderedAddCommGroup α]
[Nontrivial α]


theorem Periodic.sub_int_mul_eq [Ring α] (h : Periodic f c) (n : ℤ) : f (x - n * c) = f x

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{c x : α}
[Ring α]
(h : Function.Periodic f c)
(n : ℤ)


theorem set_biInter_insert (a : α) (s : Finset α) (t : α → Set β) :
    ⋂ x ∈ insert a s, t x = t a ∩ ⋂ x ∈ s, t x

{α : Type u_2}
{β : Type u_3}
[DecidableEq α]
(a : α)
(s : Finset α)
(t : α → Set β)


@[reassoc (attr := simp)]
theorem isoPullback_hom_fst (h : IsPullback fst snd f g) [HasPullback f g] :
    h.isoPullback.hom ≫ pullback.fst _ _ = fst

(h : CategoryTheory.IsPullback fst snd f g)

h.isoPullback.hom ≫ CategoryTheory.Limits.pullback.fst f g = fst


theorem withDensityᵥ_apply (hf : Integrable f μ) {s : Set α} (hs : MeasurableSet s) :
    μ.withDensityᵥ f s = ∫ x in s, f x ∂μ

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : α → E}
(hf : MeasureTheory.Integrable f μ)
{s : Set α}
(hs : MeasurableSet s)

↑(μ.withDensityᵥ f) s = ∫ (x : α) in s, f x ∂μ


@[simp]
theorem group_smul_head (g : G) (w : NormalWord d) : (g • w).head = g * w.head

{d : HNNExtension.NormalWord.TransversalPair G A B}


@[to_additive]
lemma prod_fiberwise (s : Finset ι) (g : ι → κ) (f : ι → α) :
    ∏ j, ∏ i ∈ s.filter fun i ↦ g i = j, f i = ∏ i ∈ s, f i

{ι : Type u_6}
{κ : Type u_7}
{α : Type u_8}
[AddCommMonoid α]
[DecidableEq κ]
[Fintype κ]
(s : Finset ι)
(g : ι → κ)
(f : ι → α)

∑ j : κ, ∑ i ∈ Finset.filter (fun i => g i = j) s, f i = ∑ i ∈ s, f i


theorem IsNormal.apply_omega {f : Ordinal.{u} → Ordinal.{u}} (hf : IsNormal f) :
    Ordinal.sup.{0, u} (f ∘ Nat.cast) = f ω

{f : Ordinal.{u} → Ordinal.{u}}
(hf : Ordinal.IsNormal f)


@[simp]
theorem coe_smulc [Zero β] [TopologicalSpace γ] [SMulZeroClass γ β] [ContinuousSMul γ β]
    {F : Type*} [FunLike F α γ] [ContinuousMapClass F α γ] (f : F) (g : C_c(α, β)) :
    ⇑(f • g) = fun x => f x • g x

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[TopologicalSpace α]
[TopologicalSpace β]
[Zero β]
[TopologicalSpace γ]
[SMulZeroClass γ β]
[ContinuousSMul γ β]
{F : Type u_5}
[FunLike F α γ]
[ContinuousMapClass F α γ]
(f : F)
(g : α →C_c β)


@[to_additive (attr := simp)]
theorem coe_orderHom (f : α →*o β) : ((f : α →o β) : α → β) = f

{α : Type u_2}
{β : Type u_3}
[Preorder α]
[Preorder β]
[AddZeroClass α]
[AddZeroClass β]
(f : α →+o β)


lemma lie_ad (x : L) (D : LieDerivation R L L) : ⁅ad R L x, D⁆ = ⁅x, D⁆

{R : Type u_1}
{L : Type u_2}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
(x : L)
(D : LieDerivation R L L)


theorem mapsTo_iff_exists_map_subtype : MapsTo f s t ↔ ∃ g : s → t, ∀ x : s, f x = g x

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

Set.MapsTo f s t ↔ ∃ g, ∀ (x : ↑s), f ↑x = ↑(g x)


/-- A non-unital star subsemiring is a non-unital subsemiring which also is closed under the
`star` operation. -/
structure NonUnitalStarSubsemiring (R : Type v) [NonUnitalNonAssocSemiring R] [Star R]
    extends NonUnitalSubsemiring R : Type v where
  /-- The `carrier` of a `NonUnitalStarSubsemiring` is closed under the `star` operation. -/
  star_mem' : ∀ {a : R} (_ha : a ∈ carrier), star a ∈ carrier

{R : Type v}
[NonUnitalNonAssocSemiring R]
[Star R]
(self : NonUnitalStarSubsemiring R)
{a : R}
(_ha : a ∈ self.carrier)


theorem HasLineDerivWithinAt.congr_mono (h : HasLineDerivWithinAt 𝕜 f f' s x v) (ht : EqOn f₁ f t)
    (hx : f₁ x = f x) (h₁ : t ⊆ s) : HasLineDerivWithinAt 𝕜 f₁ f' t x v

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type u_2}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{E : Type u_3}
[AddCommGroup E]
[Module 𝕜 E]
{f f₁ : E → F}
{f' : F}
{s t : Set E}
{x v : E}
(h : HasLineDerivWithinAt 𝕜 f f' s x v)
(ht : Set.EqOn f₁ f t)
(hx : f₁ x = f x)
(h₁ : t ⊆ s)


theorem Disjoint.mono_right : b ≤ c → Disjoint a c → Disjoint a b

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


theorem symmetric (h : Symmetric r) : Symmetric (ReflTransGen r)

{α : Type u_1}
{r : α → α → Prop}
(h : Symmetric r)


theorem inv_smul_integral_comp_add_div (c d) :
    (c⁻¹ • ∫ x in a..b, f (d + x / c)) = ∫ x in d + a / c..d + b / c, f x

{E : Type u_3}
[NormedAddCommGroup E]
[CompleteSpace E]
[NormedSpace ℝ E]
{a b : ℝ}
(f : ℝ → E)
(c d : ℝ)

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


theorem lt_one_div_of_neg (ha : a < 0) (hb : b < 0) : a < 1 / b ↔ b < 1 / a

{α : Type u_2}
[LinearOrderedField α]
{a b : α}
(ha : a < 0)
(hb : b < 0)


@[simp]
theorem conjTranspose_mul [Fintype n] [NonUnitalSemiring α] [StarRing α] (M : Matrix m n α)
    (N : Matrix n l α) : (M * N)ᴴ = Nᴴ * Mᴴ

{l : Type u_1}
{m : Type u_2}
{n : Type u_3}
{α : Type v}
[Fintype n]
[NonUnitalSemiring α]
[StarRing α]
(M : Matrix m n α)
(N : Matrix n l α)


theorem disjSum_strictMono_left (t : Multiset β) : StrictMono fun s : Multiset α => s.disjSum t

{α : Type u_1}
{β : Type u_2}
(t : Multiset β)


theorem span_eq : span R (p : Set M) = p

{R : Type u_1}
{M : Type u_4}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(p : Submodule R M)


/-- The commutative square associated to a commutative square in the opposite category. -/
theorem unop {W X Y Z : Cᵒᵖ} {f : W ⟶ X} {g : W ⟶ Y} {h : X ⟶ Z} {i : Y ⟶ Z} (p : CommSq f g h i) :
    CommSq i.unop h.unop g.unop f.unop

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
{W X Y Z : Cᵒᵖ}
{f : W ⟶ X}
{g : W ⟶ Y}
{h : X ⟶ Z}
{i : Y ⟶ Z}
(p : CategoryTheory.CommSq f g h i)

CategoryTheory.CommSq i.unop h.unop g.unop f.unop


@[simp]
theorem blockDiag_diagonal [DecidableEq o] [DecidableEq m] (d : m × o → α) (k : o) :
    blockDiag (diagonal d) k = diagonal fun i => d (i, k)

{m : Type u_2}
{o : Type u_4}
{α : Type u_12}
[Zero α]
[DecidableEq o]
[DecidableEq m]
(d : m × o → α)
(k : o)

(Matrix.diagonal d).blockDiag k = Matrix.diagonal fun i => d (i, k)


theorem vars_monomial_single (i : σ) {e : ℕ} {r : R} (he : e ≠ 0) (hr : r ≠ 0) :
    (monomial (Finsupp.single i e) r).vars = {i}

{R : Type u}
{σ : Type u_1}
[CommSemiring R]
(i : σ)
{e : ℕ}
{r : R}
(he : e ≠ 0)
(hr : r ≠ 0)

((MvPolynomial.monomial (Finsupp.single i e)) r).vars = {i}


theorem map_single_le_powerset (s : Multiset α) : s.map singleton ≤ powerset s


@[simp]
theorem lcm_zero_left (i : ℤ) : lcm 0 i = 0


@[simp]
lemma comp_assoc_of_first_is_zero_cochain {n₂ n₃ n₂₃ : ℤ}
    (z₁ : Cochain F G 0) (z₂ : Cochain G K n₂) (z₃ : Cochain K L n₃)
    (h₂₃ : n₂ + n₃ = n₂₃) :
    (z₁.comp z₂ (zero_add n₂)).comp z₃ h₂₃ = z₁.comp (z₂.comp z₃ h₂₃) (zero_add n₂₃)

(z₁ : CochainComplex.HomComplex.Cochain F G 0)

(z₂ : CochainComplex.HomComplex.Cochain G K n₂)

(z₃ : CochainComplex.HomComplex.Cochain K L n₃)

(z₁.comp z₂ ⋯).comp z₃ h₂₃ = z₁.comp (z₂.comp z₃ h₂₃) ⋯


@[simp]
theorem colon_top {I : Ideal R} : I.colon ⊤ = I

{R : Type u_1}
[CommRing R]
{I : Ideal R}


@[simp]
theorem supIrred_toDual {a : α} : SupIrred (toDual a) ↔ InfIrred a

{α : Type u_2}
[SemilatticeInf α]
{a : α}

SupIrred (OrderDual.toDual a) ↔ InfIrred a


/-- The category of differential graded objects in `V` is equivalent
to the category of homological complexes in `V`.
-/
@[simps]
def dgoEquivHomologicalComplex :
    DifferentialObject ℤ (GradedObjectWithShift b V) ≌
      HomologicalComplex V (ComplexShape.up' b)

(HomologicalComplex.dgoEquivHomologicalComplex b V).functor = HomologicalComplex.dgoToHomologicalComplex b V


theorem isPreconnected_Icc_aux (x y : α) (s t : Set α) (hxy : x ≤ y) (hs : IsClosed s)
    (ht : IsClosed t) (hab : Icc a b ⊆ s ∪ t) (hx : x ∈ Icc a b ∩ s) (hy : y ∈ Icc a b ∩ t) :
    (Icc a b ∩ (s ∩ t)).Nonempty

{α : Type u}
[ConditionallyCompleteLinearOrder α]
[TopologicalSpace α]
[OrderTopology α]
[DenselyOrdered α]
{a b : α}
(x y : α)
(s t : Set α)
(hxy : x ≤ y)
(hs : IsClosed s)
(ht : IsClosed t)
(hab : Set.Icc a b ⊆ s ∪ t)
(hx : x ∈ Set.Icc a b ∩ s)
(hy : y ∈ Set.Icc a b ∩ t)


/-- A hamiltonian path visits every vertex. -/
@[simp] lemma IsHamiltonian.mem_support (hp : p.IsHamiltonian) (c : α) : c ∈ p.support

{α : Type u_1}
[DecidableEq α]
{G : SimpleGraph α}
{a b : α}
{p : G.Walk a b}
(hp : p.IsHamiltonian)
(c : α)


@[to_additive (attr := simp)]
theorem uncurry_inv [∀ a b, Inv (γ a b)] (x : ∀ a b, γ a b) :
    Sigma.uncurry (x⁻¹) = (Sigma.uncurry x)⁻¹

{α : Type u_3}
{β : α → Type u_4}
{γ : (a : α) → β a → Type u_5}
[(a : α) → (b : β a) → Inv (γ a b)]
(x : (a : α) → (b : β a) → γ a b)


/-- The "clifford algebra" functor, sending a quadratic `R`-module `V` to the clifford algebra on
`V`.

This is `CliffordAlgebra.map` through the lens of category theory. -/
@[simps]
def QuadraticModuleCat.cliffordAlgebra : QuadraticModuleCat.{u} R ⥤ AlgebraCat.{u} R

{R : Type u}
[CommRing R]
{_M _N : QuadraticModuleCat R}
(f : _M ⟶ _N)

QuadraticModuleCat.cliffordAlgebra.map f = CliffordAlgebra.map f.toIsometry


/-- The composition of `C^∞` functions at points is `C^∞`. -/
nonrec theorem SmoothAt.comp {g : M' → M''} (x : M) (hg : SmoothAt I' I'' g (f x))
    (hf : SmoothAt I I' f x) : SmoothAt I I'' (g ∘ f) x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{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']
{E'' : Type u_8}
[NormedAddCommGroup E'']
[NormedSpace 𝕜 E'']
{H'' : Type u_9}
[TopologicalSpace H'']
{I'' : ModelWithCorners 𝕜 E'' H''}
{M'' : Type u_10}
[TopologicalSpace M'']
[ChartedSpace H'' M'']
{f : M → M'}
{g : M' → M''}
(x : M)
(hg : SmoothAt I' I'' g (f x))
(hf : SmoothAt I I' f x)


theorem smul_Iio : r • Iio a = Iio (r • a)

{K : Type u_2}
[LinearOrderedField K]
{a r : K}
(hr : 0 < r)


theorem continuous_iff_continuousAt : Continuous f ↔ ∀ x, ContinuousAt f x

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

Continuous f ↔ ∀ (x : X), ContinuousAt f x


theorem _root_.closedEmbedding_of_embedding_closed (h₁ : Embedding f) (h₂ : IsClosedMap f) :
    ClosedEmbedding f

{X : Type u_1}
{Y : Type u_2}
{f : X → Y}
[TopologicalSpace X]
[TopologicalSpace Y]
(h₁ : Embedding f)
(h₂ : IsClosedMap f)


/-- Lebesgue dominated convergence theorem provides sufficient conditions under which almost
  everywhere convergence of a sequence of functions implies the convergence of their image by
  `setToFun`.
  We could weaken the condition `bound_integrable` to require `HasFiniteIntegral bound μ` instead
  (i.e. not requiring that `bound` is measurable), but in all applications proving integrability
  is easier. -/
theorem tendsto_setToFun_of_dominated_convergence (hT : DominatedFinMeasAdditive μ T C)
    {fs : ℕ → α → E} {f : α → E} (bound : α → ℝ)
    (fs_measurable : ∀ n, AEStronglyMeasurable (fs n) μ) (bound_integrable : Integrable bound μ)
    (h_bound : ∀ n, ∀ᵐ a ∂μ, ‖fs n a‖ ≤ bound a)
    (h_lim : ∀ᵐ a ∂μ, Tendsto (fun n => fs n a) atTop (𝓝 (f a))) :
    Tendsto (fun n => setToFun μ T hT (fs n)) atTop (𝓝 <| setToFun μ T hT f)

(hT : MeasureTheory.DominatedFinMeasAdditive μ T C)

(fs_measurable : ∀ (n : ℕ), MeasureTheory.AEStronglyMeasurable (fs n) μ)

(bound_integrable : MeasureTheory.Integrable bound μ)

(h_bound : ∀ (n : ℕ), ∀ᵐ (a : α) ∂μ, ‖fs n a‖ ≤ bound a)

(h_lim : ∀ᵐ (a : α) ∂μ, Filter.Tendsto (fun n => fs n a) Filter.atTop (𝓝 (f a)))

Filter.Tendsto (fun n => MeasureTheory.setToFun μ T hT (fs n)) Filter.atTop (𝓝 (MeasureTheory.setToFun μ T hT f))


/-- Multiplication of circulant matrices commutes when the elements do. -/
theorem circulant_mul_comm [CommSemigroup α] [AddCommMonoid α] [Fintype n] [AddCommGroup n]
    (v w : n → α) : circulant v * circulant w = circulant w * circulant v

{α : Type u_1}
{n : Type u_4}
[CommSemigroup α]
[AddCommMonoid α]
[Fintype n]
[AddCommGroup n]
(v w : n → α)

Matrix.circulant v * Matrix.circulant w = Matrix.circulant w * Matrix.circulant v


lemma in₁₀_iff' :
    (graph t).Adj (in₁ b) (in₀ a) ↔ ∃ x : α × β × γ, x ∈ t ∧ x.2.1 = b ∧ x.1 = a

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{t : Finset (α × β × γ)}
{a : α}
{b : β}

(SimpleGraph.TripartiteFromTriangles.graph t).Adj (Sum3.in₁ b) (Sum3.in₀ a) ↔ ∃ x ∈ t, x.2.1 = b ∧ x.1 = a


lemma _root_.Continuous.compCM (hg : Continuous g) (hf : Continuous f) :
    Continuous fun x => (g x).comp (f x)

{X : Type u_2}
{Y : Type u_3}
{Z : Type u_4}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
[LocallyCompactPair Y Z]
{X' : Type u_6}
[TopologicalSpace X']
{g : X' → C(Y, Z)}
{f : X' → C(X, Y)}
(hg : Continuous g)
(hf : Continuous f)


/-- Composing an alternating map with the identity linear map in each argument. -/
@[simp]
theorem compLinearMap_id (f : M [⋀^ι]→ₗ[R] N) : f.compLinearMap LinearMap.id = f

{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}
(f : M [⋀^ι]→ₗ[R] N)


@[simp] lemma flip_inr : t.flip.inr = t.inl

(t : CategoryTheory.Limits.PushoutCocone f g)


@[to_additive] lemma MonoidHomClass.isMulFreimanHom [FunLike F α β] [MonoidHomClass F α β] (f : F)
    (hfAB : MapsTo f A B) : IsMulFreimanHom n A B f

{F : Type u_1}
{α : Type u_2}
{β : Type u_3}
[CommMonoid α]
[CommMonoid β]
{A : Set α}
{B : Set β}
{n : ℕ}
[FunLike F α β]
[MonoidHomClass F α β]
(f : F)
(hfAB : Set.MapsTo (⇑f) A B)


/-- The monoidal functor from the endomorphisms of the single object
when we promote a monoidal category to a single object bicategory,
to the original monoidal category.

We subsequently show this is an equivalence.
-/
@[simps]
def endMonoidalStarFunctor : MonoidalFunctor (EndMonoidal (MonoidalSingleObj.star C)) C

(X Y : CategoryTheory.EndMonoidal (CategoryTheory.MonoidalSingleObj.star C))

(CategoryTheory.MonoidalSingleObj.endMonoidalStarFunctor C).μ X Y =
  CategoryTheory.CategoryStruct.id
    (CategoryTheory.MonoidalCategory.tensorObj
      ({ obj := fun X => X, map := fun {X Y} f => f, map_id := ⋯, map_comp := ⋯ }.obj X)
      ({ obj := fun X => X, map := fun {X Y} f => f, map_id := ⋯, map_comp := ⋯ }.obj Y))


theorem nhdsBasis_Ioc (h : a ≠ 0) : (𝓝 a).HasBasis (· < a) (Set.Ioc · a)

(𝓝 a).HasBasis (fun x => x < a) fun x => Set.Ioc x a


theorem coe_comp_monoidWithZeroHom (f : β →*₀o γ) (g : α →*₀o β) :
    (f.comp g : α →*₀ γ) = (f : β →*₀ γ).comp g

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[Preorder α]
[Preorder β]
[Preorder γ]
[MulZeroOneClass α]
[MulZeroOneClass β]
[MulZeroOneClass γ]
(f : β →*₀o γ)
(g : α →*₀o β)


@[simp]
lemma ofHoms_zero : ofHoms (fun p => (0 : F.X p ⟶ G.X p)) = 0

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Preadditive C]
{F G : CochainComplex C ℤ}

(CochainComplex.HomComplex.Cochain.ofHoms fun p => 0) = 0


theorem mem_right_iff_eq_zero_of_disjoint {p p' : Submodule R M} (h : Disjoint p p') {x : p} :
    (x : M) ∈ p' ↔ x = 0

{R : Type u_1}
{M : Type u_3}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{p p' : Submodule R M}
(h : Disjoint p p')
{x : ↥p}


theorem BddAbove.wellFoundedOn_gt : BddAbove s → s.WellFoundedOn (· > ·)

{α : Type u_2}
{s : Set α}
[Preorder α]
[LocallyFiniteOrder α]

BddAbove s → s.WellFoundedOn fun x x_1 => x > x_1


theorem map_comap_of_surjective {f : α → β} (hf : Surjective f) (l : Filter β) :
    map f (comap f l) = l

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


theorem nonnegg_pos_neg {c d} {a b : ℕ} : Nonnegg c d a (-b) ↔ SqLe b c a d

Zsqrtd.Nonnegg c d (↑a) (-↑b) ↔ Zsqrtd.SqLe b c a d


protected theorem min_comm (a b : Nat) : min a b = min b a


/-- The product map of two `C^n` functions on a set is `C^n` on the product set. -/
theorem ContDiffOn.prod_map {E' : Type*} [NormedAddCommGroup E'] [NormedSpace 𝕜 E'] {F' : Type*}
    [NormedAddCommGroup F'] [NormedSpace 𝕜 F'] {s : Set E} {t : Set E'} {f : E → F} {g : E' → F'}
    (hf : ContDiffOn 𝕜 n f s) (hg : ContDiffOn 𝕜 n g t) : ContDiffOn 𝕜 n (Prod.map f g) (s ×ˢ t)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{n : ℕ∞}
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{F' : Type u_6}
[NormedAddCommGroup F']
[NormedSpace 𝕜 F']
{s : Set E}
{t : Set E'}
{f : E → F}
{g : E' → F'}
(hf : ContDiffOn 𝕜 n f s)
(hg : ContDiffOn 𝕜 n g t)


theorem IsTheta.isLittleO_congr_right (h : g' =Θ[l] k') : f =o[l] g' ↔ f =o[l] k'

{α : Type u_1}
{E : Type u_3}
{F' : Type u_7}
{G' : Type u_8}
[Norm E]
[SeminormedAddCommGroup F']
[SeminormedAddCommGroup G']
{f : α → E}
{g' : α → F'}
{k' : α → G'}
{l : Filter α}
(h : g' =Θ[l] k')


theorem IsRegular.nat_lt {c : Cardinal} (H : c.IsRegular) (n : ℕ) : n < c

{c : Cardinal.{u_2}}
(H : c.IsRegular)
(n : ℕ)


@[to_additive]
theorem HasProd.mul_isCompl {s t : Set β} (hs : IsCompl s t) (ha : HasProd (f ∘ (↑) : s → α) a)
    (hb : HasProd (f ∘ (↑) : t → α) b) : HasProd f (a * b)

{α : Type u_1}
{β : Type u_2}
[AddCommMonoid α]
[TopologicalSpace α]
{f : β → α}
{a b : α}
[ContinuousAdd α]
{s t : Set β}
(hs : IsCompl s t)
(ha : HasSum (f ∘ Subtype.val) a)
(hb : HasSum (f ∘ Subtype.val) b)


theorem tendsto_atBot' [Nonempty α] [SemilatticeInf α] {f : α → β} {l : Filter β} :
    Tendsto f atBot l ↔ ∀ s ∈ l, ∃ a, ∀ b ≤ a, f b ∈ s

{α : Type u_3}
{β : Type u_4}
[Nonempty α]
[SemilatticeInf α]
{f : α → β}
{l : Filter β}

Filter.Tendsto f Filter.atBot l ↔ ∀ s ∈ l, ∃ a, ∀ b ≤ a, f b ∈ s


theorem coe_le_iff : ∀ {x : WithBot α}, (a : WithBot α) ≤ x ↔ ∃ b : α, x = b ∧ a ≤ b

{α : Type u_1}
{a : α}
[LE α]
{x : WithBot α}


lemma uIcc_subset_uIcc_iff_le :
    [[a₁, b₁]] ⊆ [[a₂, b₂]] ↔ min a₂ b₂ ≤ min a₁ b₁ ∧ max a₁ b₁ ≤ max a₂ b₂

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

Set.uIcc a₁ b₁ ⊆ Set.uIcc a₂ b₂ ↔ min a₂ b₂ ≤ min a₁ b₁ ∧ max a₁ b₁ ≤ max a₂ b₂


/-- Given `(v : K), (q : ℚ), and v = q`, we have that `of q = of v` -/
theorem coe_of_rat_eq :
    (⟨(of q).h, (of q).s.map (Pair.map (↑))⟩ : GenContFract K) = of v

{K : Type u_1}
[LinearOrderedField K]
[FloorRing K]
{v : K}
{q : ℚ}
(v_eq_q : v = ↑q)

{ h := ↑(GenContFract.of q).h, s := Stream'.Seq.map (GenContFract.Pair.map Rat.cast) (GenContFract.of q).s } =
  GenContFract.of v


protected theorem add_mem {x y : A} (hx : x ∈ S) (hy : y ∈ S) : x + y ∈ S

{R : Type u}
{A : Type v}
[CommSemiring R]
[Semiring A]
[Algebra R A]
(S : Subalgebra R A)
{x y : A}
(hx : x ∈ S)
(hy : y ∈ S)


@[simp]
theorem preimage_cast_uIcc (p q : ℚ≥0) : (↑) ⁻¹' uIcc (p : K) q = uIcc p q

{K : Type u_5}
[LinearOrderedSemifield K]
(p q : ℚ≥0)

NNRat.cast ⁻¹' Set.uIcc ↑p ↑q = Set.uIcc p q


@[to_additive]
theorem tprod_eq_finprod (hf : (mulSupport f).Finite) :
    ∏' b, f b = ∏ᶠ b, f b

{α : Type u_1}
{β : Type u_2}
[AddCommMonoid α]
[TopologicalSpace α]
{f : β → α}
(hf : (Function.support f).Finite)


theorem ae_restrict_uIoc_eq [LinearOrder α] (a b : α) :
    ae (μ.restrict (Ι a b)) = ae (μ.restrict (Ioc a b)) ⊔ ae (μ.restrict (Ioc b a))

{α : Type u_2}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[LinearOrder α]
(a b : α)

MeasureTheory.ae (μ.restrict (Ι a b)) =
  MeasureTheory.ae (μ.restrict (Set.Ioc a b)) ⊔ MeasureTheory.ae (μ.restrict (Set.Ioc b a))


/-- Composing on the right by a function preserves uniform Cauchy sequences -/
theorem UniformCauchySeqOn.comp {γ : Type*} (hf : UniformCauchySeqOn F p s) (g : γ → α) :
    UniformCauchySeqOn (fun n => F n ∘ g) p (g ⁻¹' s)

{α : Type u}
{β : Type v}
{ι : Type x}
[UniformSpace β]
{F : ι → α → β}
{s : Set α}
{p : Filter ι}
{γ : Type u_1}
(hf : UniformCauchySeqOn F p s)
(g : γ → α)


@[to_additive]
theorem index_ne_zero_of_finite [hH : Finite (G ⧸ H)] : H.index ≠ 0

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


theorem forall_mem_inter_of_forall_right (l₁ : List α) (h : ∀ x ∈ l₂, p x) :
    ∀ x, x ∈ l₁ ∩ l₂ → p x

{α : Type u_1}
{l₂ : List α}
{p : α → Prop}
[DecidableEq α]
(l₁ : List α)
(h : ∀ (x : α), x ∈ l₂ → p x)
(x : α)

x ∈ l₁ ∩ l₂ → p x


lemma toUnitHom_eq_char' {a : ZMod n} (ha : IsUnit a) : χ a = χ.toUnitHom ha.unit

{R : Type u_1}
[CommMonoidWithZero R]
{n : ℕ}
(χ : DirichletCharacter R n)
{a : ZMod n}
(ha : IsUnit a)


theorem indexOf_cons_eq {a b : α} (l : List α) : b = a → indexOf a (b :: l) = 0

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


theorem IsPreconnected.infinite_of_nontrivial [T1Space X] {s : Set X} (h : IsPreconnected s)
    (hs : s.Nontrivial) : s.Infinite

{X : Type u_1}
[TopologicalSpace X]
[T1Space X]
{s : Set X}
(h : IsPreconnected s)
(hs : s.Nontrivial)


theorem injective_codRestrict (f : A →⋆ₐ[R] B) (S : StarSubalgebra R B) (hf : ∀ x : A, f x ∈ S) :
    Function.Injective (StarAlgHom.codRestrict f S hf) ↔ Function.Injective f

{R : Type u_2}
{A : Type u_3}
{B : Type u_4}
[CommSemiring R]
[StarRing R]
[Semiring A]
[Algebra R A]
[StarRing A]
[Semiring B]
[Algebra R B]
[StarRing B]
[StarModule R B]
(f : A →⋆ₐ[R] B)
(S : StarSubalgebra R B)
(hf : ∀ (x : A), f x ∈ S)

Function.Injective ⇑(f.codRestrict S hf) ↔ Function.Injective ⇑f


/-- The `atTop` filter for an open interval `Ioo a b` comes from the left-neighbourhoods filter at
the right endpoint in the ambient order. -/
theorem comap_coe_Ioo_nhdsWithin_Iio (a b : α) : comap ((↑) : Ioo a b → α) (𝓝[<] b) = atTop

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

Filter.comap Subtype.val (𝓝[<] b) = Filter.atTop


theorem HasFPowerSeriesAt.congr (hf : HasFPowerSeriesAt f p x) (hg : f =ᶠ[𝓝 x] g) :
    HasFPowerSeriesAt g p x

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f g : E → F}
{p : FormalMultilinearSeries 𝕜 E F}
{x : E}
(hf : HasFPowerSeriesAt f p x)
(hg : f =ᶠ[𝓝 x] g)


@[to_additive]
lemma prod_union_eq_right [DecidableEq α] (hs : ∀ a ∈ s₁, a ∉ s₂ → f a = 1) :
    ∏ a ∈ s₁ ∪ s₂, f a = ∏ a ∈ s₂, f a

{α : Type u_3}
{β : Type u_4}
{s₁ s₂ : Finset α}
{f : α → β}
[CommMonoid β]
[DecidableEq α]
(hs : ∀ a ∈ s₁, a ∉ s₂ → f a = 1)


@[simp, norm_cast] theorem ofNat_le {m n : Nat} : (↑m : Int) ≤ ↑n ↔ m ≤ n

↑m ≤ ↑n ↔ m ≤ n


theorem isOpen_gt' [OrderTopology α] (a : α) : IsOpen { b : α | b < a }

{α : Type u}
[TopologicalSpace α]
[Preorder α]
[OrderTopology α]
(a : α)


/-- The integral closure of `ℤ` inside `CyclotomicField (p ^ k) ℚ` is
`CyclotomicRing (p ^ k) ℤ ℚ`. -/
theorem cyclotomicRing_isIntegralClosure_of_prime_pow :
    IsIntegralClosure (CyclotomicRing (p ^ k) ℤ ℚ) ℤ (CyclotomicField (p ^ k) ℚ)

{p : ℕ+}
{k : ℕ}
[hp : Fact (Nat.Prime ↑p)]


@[simp, aesop safe apply (rule_sets := [finsetNonempty])]
lemma powersetCard_nonempty : (powersetCard n s).Nonempty ↔ n ≤ s.card

(Finset.powersetCard n s).Nonempty ↔ n ≤ s.card


theorem uniformContinuous_dom₂ {f : SeparationQuotient α × SeparationQuotient β → γ} :
    UniformContinuous f ↔ UniformContinuous fun p : α × β ↦ f (mk p.1, mk p.2)

UniformContinuous f ↔ UniformContinuous fun p => f (SeparationQuotient.mk p.1, SeparationQuotient.mk p.2)


@[simp]
theorem liftOfDerivationToSquareZero_mk_apply' (d : Derivation R A I) (x : A) :
    (Ideal.Quotient.mk I) (d x) + (algebraMap A (B ⧸ I)) x = algebraMap A (B ⧸ I) x

{R : Type u}
{A : Type v}
{B : Type w}
[CommSemiring R]
[CommSemiring A]
[CommRing B]
[Algebra R A]
[Algebra R B]
(I : Ideal B)
[Algebra A B]
(d : Derivation R A ↥I)
(x : A)

(Ideal.Quotient.mk I) ↑(d x) + (algebraMap A (B ⧸ I)) x = (algebraMap A (B ⧸ I)) x


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

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

(FreeMagma.map f) (FreeMagma.of x) = FreeMagma.of (f x)


theorem sign_mul_natAbs : ∀ a : Int, sign a * natAbs a = a


/-- Construct an isomorphism in the over category given isomorphisms of the objects whose forward
direction gives a commutative triangle.
-/
@[simps!]
def isoMk {f g : Over X} (hl : f.left ≅ g.left) (hw : hl.hom ≫ g.hom = f.hom := by aesop_cat) :
    f ≅ g

(hw : CategoryTheory.CategoryStruct.comp hl.hom g.hom = f.hom := by aesop_cat)


theorem abs_dist_sub_le (x y z : α) : |dist x z - dist y z| ≤ dist x y

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


@[simp]
theorem aevalTower_X (i : σ) : aevalTower g y (X i) = y i

{R : Type u}
{σ : Type u_1}
[CommSemiring R]
{S : Type u_2}
{A : Type u_3}
[CommSemiring S]
[CommSemiring A]
[Algebra S R]
[Algebra S A]
(g : R →ₐ[S] A)
(y : σ → A)
(i : σ)

(MvPolynomial.aevalTower g y) (MvPolynomial.X i) = y i


protected theorem isOpen (s : CompactOpens α) : IsOpen (s : Set α)

{α : Type u_1}
[TopologicalSpace α]
(s : TopologicalSpace.CompactOpens α)


theorem HasFiniteFPowerSeriesOnBall.add (hf : HasFiniteFPowerSeriesOnBall f pf x n r)
    (hg : HasFiniteFPowerSeriesOnBall g pg x m r) :
    HasFiniteFPowerSeriesOnBall (f + g) (pf + pg) x (max n m) r


/-- A limit (over a general filter) of measurable `ℝ≥0` valued functions is measurable. -/
theorem measurable_of_tendsto' {ι} {f : ι → α → ℝ≥0} {g : α → ℝ≥0} (u : Filter ι) [NeBot u]
    [IsCountablyGenerated u] (hf : ∀ i, Measurable (f i)) (lim : Tendsto f u (𝓝 g)) :
    Measurable g

{α : Type u_1}
[MeasurableSpace α]
{ι : Type u_5}
{f : ι → α → ℝ≥0}
{g : α → ℝ≥0}
(u : Filter ι)
[u.NeBot]
[u.IsCountablyGenerated]
(hf : ∀ (i : ι), Measurable (f i))
(lim : Filter.Tendsto f u (𝓝 g))


/-- **First moment method**. The maximum of a measurable function is greater than its mean. -/
theorem exists_laverage_le (hμ : μ ≠ 0) (hint : ∫⁻ a, f a ∂μ ≠ ∞) : ∃ x, ⨍⁻ a, f a ∂μ ≤ f x

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f : α → ℝ≥0∞}
(hμ : μ ≠ 0)
(hint : ∫⁻ (a : α), f a ∂μ ≠ ⊤)


@[simp] lemma zero_eq_ofENat {m : ℕ∞} : 0 = (m : Cardinal) ↔ m = 0


theorem wittMul_vars (n : ℕ) : (wittMul p n).vars ⊆ Finset.univ ×ˢ Finset.range (n + 1)

(p : ℕ)
[hp : Fact (Nat.Prime p)]
(n : ℕ)

(WittVector.wittMul p n).vars ⊆ Finset.univ ×ˢ Finset.range (n + 1)


lemma ContinuousWithinAt.sup (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) :
    ContinuousWithinAt (fun a ↦ f a ⊔ g a) s x

{L : Type u_1}
{X : Type u_2}
[TopologicalSpace L]
[TopologicalSpace X]
[Sup L]
[ContinuousSup L]
{f g : X → L}
{s : Set X}
{x : X}
(hf : ContinuousWithinAt f s x)
(hg : ContinuousWithinAt g s x)

ContinuousWithinAt (fun a => f a ⊔ g a) s x


lemma finite_of_free_aux (I) [DecidableEq I] (b : Basis I R S)
    (f : I →₀ S) (x : S) (a : I → I →₀ R) (ha : a = fun i ↦ b.repr (b i * x)) :
    (1 ⊗ₜ[R] x * Finsupp.sum f fun i y ↦ y ⊗ₜ[R] b i) =
      Finset.sum (f.support.biUnion fun i ↦ (a i).support) fun k ↦
    Finsupp.sum (b.repr (f.sum fun i y ↦ a i k • y)) fun j c ↦ c • b j ⊗ₜ[R] b k

{R S : Type u_3}
[CommRing R]
[CommRing S]
[Algebra R S]
(I : Type u_2)
[DecidableEq I]
(b : Basis I R S)
(f : I →₀ S)
(x : S)
(a : I → I →₀ R)
(ha : a = fun i => b.repr (b i * x))

(1 ⊗ₜ[R] x * f.sum fun i y => y ⊗ₜ[R] b i) =
  ∑ k ∈ f.support.biUnion fun i => (a i).support,
    (b.repr (f.sum fun i y => (a i) k • y)).sum fun j c => c • b j ⊗ₜ[R] b k


@[simp]
theorem inv_ofNat_den (a : ℕ) [a.AtLeastTwo] :
    (no_index (OfNat.ofNat a : ℚ))⁻¹.den = OfNat.ofNat a


@[simp, norm_cast]
theorem coe_eq_zero [Nontrivial α] {x : Ico (0 : α) 1} : (x : α) = 0 ↔ x = 0

{α : Type u_1}
[OrderedSemiring α]
[Nontrivial α]
{x : ↑(Set.Ico 0 1)}


/-- The category of differential graded objects in `V` is equivalent
to the category of homological complexes in `V`.
-/
@[simps]
def dgoEquivHomologicalComplex :
    DifferentialObject ℤ (GradedObjectWithShift b V) ≌
      HomologicalComplex V (ComplexShape.up' b)

(HomologicalComplex.dgoEquivHomologicalComplex b V).unitIso = HomologicalComplex.dgoEquivHomologicalComplexUnitIso b V


@[simp]
theorem prodEquivOfIsCompl_symm_apply_left (h : IsCompl p q) (x : p) :
    (prodEquivOfIsCompl p q h).symm x = (x, 0)

{R : Type u_1}
[Ring R]
{E : Type u_2}
[AddCommGroup E]
[Module R E]
(p q : Submodule R E)
(h : IsCompl p q)
(x : ↥p)

(p.prodEquivOfIsCompl q h).symm ↑x = (x, 0)


/-- The homology data on a short complex equipped with a splitting. -/
@[simps]
noncomputable def homologyData [HasZeroObject C] (s : S.Splitting) : S.HomologyData

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Preadditive C]
{S : CategoryTheory.ShortComplex C}
[CategoryTheory.Limits.HasZeroObject C]
(s : S.Splitting)

s.homologyData.iso = CategoryTheory.Iso.refl 0


/-- The coercions are respectively `Int.cast`, `ZMod.cast`, and `ZMod.cast`. -/
@[simp]
theorem intCast_comp_cast : ((↑) : ℤ → R) ∘ (cast : ZMod n → ℤ) = cast


@[to_additive (attr := measurability)]
theorem Multiset.measurable_prod (s : Multiset (α → M)) (hs : ∀ f ∈ s, Measurable f) :
    Measurable fun x => (s.map fun f : α → M => f x).prod

{M : Type u_2}
{α : Type u_4}
[AddCommMonoid M]
[MeasurableSpace M]
[MeasurableAdd₂ M]
{m : MeasurableSpace α}
(s : Multiset (α → M))
(hs : ∀ f ∈ s, Measurable f)

Measurable fun x => (Multiset.map (fun f => f x) s).sum


/-- Proper group action in the sense of Bourbaki:
the map `G × X → X × X` is a proper map (see `IsProperMap`). -/
@[to_additive existing (attr := mk_iff)]
class ProperSMul (G X : Type*) [TopologicalSpace G] [TopologicalSpace X] [Group G]
    [MulAction G X] : Prop where
  /-- Proper group action in the sense of Bourbaki:
  the map `G × X → X × X` is a proper map (see `IsProperMap`). -/
  isProperMap_smul_pair : IsProperMap (fun gx ↦ (gx.1 • gx.2, gx.2) : G × X → X × X)

(G : Type u_1)
(X : Type u_2)
[TopologicalSpace G]
[TopologicalSpace X]
[Group G]
[MulAction G X]

ProperSMul G X ↔ IsProperMap fun gx => (gx.1 • gx.2, gx.2)


protected theorem map_sub (f : M →SL[σ₁₂] M₂) (x y : M) : f (x - y) = f x - f y

{R : Type u_1}
[Ring R]
{R₂ : Type u_2}
[Ring R₂]
{M : Type u_4}
[TopologicalSpace M]
[AddCommGroup M]
{M₂ : Type u_5}
[TopologicalSpace M₂]
[AddCommGroup M₂]
[Module R M]
[Module R₂ M₂]
{σ₁₂ : R →+* R₂}
(f : M →SL[σ₁₂] M₂)
(x y : M)


@[to_additive]
theorem coe_mul_self_eq (s : Submonoid M) : (s : Set M) * s = s

{M : Type u_3}
[Monoid M]
(s : Submonoid M)


theorem ConcaveOn.comp (hg : ConcaveOn 𝕜 (f '' s) g) (hf : ConcaveOn 𝕜 s f)
    (hg' : MonotoneOn g (f '' s)) : ConcaveOn 𝕜 s (g ∘ f)

{𝕜 : Type u_1}
{E : Type u_2}
{α : Type u_4}
{β : Type u_5}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[OrderedAddCommMonoid α]
[OrderedAddCommMonoid β]
[SMul 𝕜 E]
[SMul 𝕜 α]
[SMul 𝕜 β]
{s : Set E}
{f : E → β}
{g : β → α}
(hg : ConcaveOn 𝕜 (f '' s) g)
(hf : ConcaveOn 𝕜 s f)
(hg' : MonotoneOn g (f '' s))


theorem posDef_toMatrix' [DecidableEq n] {Q : QuadraticForm ℝ (n → ℝ)} (hQ : Q.PosDef) :
    Q.toMatrix'.PosDef

{n : Type u_1}
[Fintype n]
[DecidableEq n]
{Q : QuadraticForm ℝ (n → ℝ)}
(hQ : QuadraticMap.PosDef Q)


protected theorem isSeparatedMap : IsSeparatedMap f

{E : Type u_1}
{X : Type u_2}
[TopologicalSpace E]
[TopologicalSpace X]
{f : E → X}
(hf : IsCoveringMap f)


private theorem coevaluation_evaluation :
    letI V' : FGModuleCat K := FGModuleCatDual K V
    V' ◁ FGModuleCatCoevaluation K V ≫ (α_ V' V V').inv ≫ FGModuleCatEvaluation K V ▷ V' =
      (ρ_ V').hom ≫ (λ_ V').inv

(K : Type u)
[Field K]
(V : FGModuleCat K)

CategoryTheory.MonoidalCategory.whiskerLeft (FGModuleCat.FGModuleCatDual K V)
      (FGModuleCat.FGModuleCatCoevaluation K V) ≫
    (CategoryTheory.MonoidalCategory.associator (FGModuleCat.FGModuleCatDual K V) V
          (FGModuleCat.FGModuleCatDual K V)).inv ≫
      CategoryTheory.MonoidalCategory.whiskerRight (FGModuleCat.FGModuleCatEvaluation K V)
        (FGModuleCat.FGModuleCatDual K V) =
  (CategoryTheory.MonoidalCategory.rightUnitor (FGModuleCat.FGModuleCatDual K V)).hom ≫
    (CategoryTheory.MonoidalCategory.leftUnitor (FGModuleCat.FGModuleCatDual K V)).inv


theorem adicValued_apply {x : K} : (v.adicValued.v : _) x = v.valuation x

(v : IsDedekindDomain.HeightOneSpectrum R)


@[simp]
theorem Prop.disjoint_iff {P Q : Prop} : Disjoint P Q ↔ ¬(P ∧ Q)


theorem Restriction.strictRestriction_of_ground_ne (h : N ≤r M) (hne : N.E ≠ M.E) : N <r M

{α : Type u_1}
{M N : Matroid α}
(h : N.Restriction M)
(hne : N.E ≠ M.E)


@[simp]
theorem lift_lift : lift g (lift i j p) p = lift (g.comp i) j p

{K : Type u_1}
{L : Type u_2}
{M : Type u_3}
{N : Type u_4}
[CommRing K]
[CommRing L]
[CommRing M]
[CommRing N]
(i : K →+* L)
(j : K →+* M)
(g : L →+* N)
(p : ℕ)
[ExpChar K p]
[ExpChar L p]
[ExpChar M p]
[ExpChar N p]
[PerfectRing M p]
[IsPRadical i p]
[IsPRadical g p]
[IsPRadical (g.comp i) p]

PerfectRing.lift g (PerfectRing.lift i j p) p = PerfectRing.lift (g.comp i) j p


@[to_additive]
theorem card_le_card_mul_right {t : Finset α} (ht : t.Nonempty) : s.card ≤ (s * t).card

{α : Type u_2}
[Add α]
[IsRightCancelAdd α]
[DecidableEq α]
(s : Finset α)
{t : Finset α}
(ht : t.Nonempty)


@[to_additive]
theorem tendsto_multiset_prod {f : ι → α → M} {x : Filter α} {a : ι → M} (s : Multiset ι) :
    (∀ i ∈ s, Tendsto (f i) x (𝓝 (a i))) →
      Tendsto (fun b => (s.map fun c => f c b).prod) x (𝓝 (s.map a).prod)

{ι : Type u_1}
{α : Type u_2}
{M : Type u_3}
[TopologicalSpace M]
[AddCommMonoid M]
[ContinuousAdd M]
{f : ι → α → M}
{x : Filter α}
{a : ι → M}
(s : Multiset ι)

(∀ i ∈ s, Filter.Tendsto (f i) x (𝓝 (a i))) →
  Filter.Tendsto (fun b => (Multiset.map (fun c => f c b) s).sum) x (𝓝 (Multiset.map a s).sum)


theorem EventuallyEq.le (h : f =ᶠ[l] g) : f ≤ᶠ[l] g

{α : Type u}
{β : Type v}
[Preorder β]
{l : Filter α}
{f g : α → β}
(h : f =ᶠ[l] g)


@[simp] theorem bitIndices_two_pow (k : ℕ) : bitIndices (2^k) = [k]


@[simp]
theorem liftOfSurjective_apply [FormallySmooth R A] (f : A →ₐ[R] C) (g : B →ₐ[R] C)
    (hg : Function.Surjective g) (hg' : IsNilpotent <| RingHom.ker (g : B →+* C)) (x : A) :
    g (FormallySmooth.liftOfSurjective f g hg hg' x) = f x

{R : Type u}
[CommSemiring R]
{A : Type u}
[Semiring A]
[Algebra R A]
{B : Type u}
[CommRing B]
[Algebra R B]
{C : Type u}
[CommRing C]
[Algebra R C]
[Algebra.FormallySmooth R A]
(f : A →ₐ[R] C)
(g : B →ₐ[R] C)
(hg : Function.Surjective ⇑g)
(hg' : IsNilpotent (RingHom.ker ↑g))
(x : A)

g ((Algebra.FormallySmooth.liftOfSurjective f g hg hg') x) = f x


/-- If a vector space has a finite dimension, the index set of `Basis.ofVectorSpace` is finite. -/
theorem Basis.finite_ofVectorSpaceIndex_of_rank_lt_aleph0 (h : Module.rank K V < ℵ₀) :
    (Basis.ofVectorSpaceIndex K V).Finite

{K : Type u}
{V : Type v}
[DivisionRing K]
[AddCommGroup V]
[Module K V]
(h : Module.rank K V < ℵ₀)


@[simp]
theorem coe_pointwise_smul (a : α) (S : Submodule R M) : ↑(a • S) = a • (S : Set M)

{α : Type u_1}
{R : Type u_2}
{M : Type u_3}
[Semiring R]
[AddCommMonoid M]
[Module R M]
[Monoid α]
[DistribMulAction α M]
[SMulCommClass α R M]
(a : α)
(S : Submodule R M)


@[simp]
theorem map_neg [DecidableEq ι] (m : ∀ i, M₁ i) (i : ι) (x : M₁ i) :
    f (update m i (-x)) = -f (update m i x)

{R : Type uR}
{ι : Type uι}
{M₁ : ι → Type v₁}
{M₂ : Type v₂}
[Semiring R]
[(i : ι) → AddCommGroup (M₁ i)]
[AddCommGroup M₂]
[(i : ι) → Module R (M₁ i)]
[Module R M₂]
(f : MultilinearMap R M₁ M₂)
[DecidableEq ι]
(m : (i : ι) → M₁ i)
(i : ι)
(x : M₁ i)

f (Function.update m i (-x)) = -f (Function.update m i x)


lemma isoClosure_le_iff [ClosedUnderIsomorphisms Q] : isoClosure P ≤ Q ↔ P ≤ Q


theorem sourceAffineLocally_isLocal (h₁ : RingHom.RespectsIso P)
    (h₂ : RingHom.LocalizationPreserves P) (h₃ : RingHom.OfLocalizationSpan P) :
    (sourceAffineLocally P).IsLocal

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

(h₁ : RingHom.RespectsIso fun {R S} [CommRing R] [CommRing S] => P)

(h₂ : RingHom.LocalizationPreserves fun {R S} [CommRing R] [CommRing S] => P)

(h₃ : RingHom.OfLocalizationSpan fun {R S} [CommRing R] [CommRing S] => P)

(AlgebraicGeometry.sourceAffineLocally fun {R S} [CommRing R] [CommRing S] => P).IsLocal


@[simp]
theorem differentiableAt_add_const_iff (c : F) :
    DifferentiableAt 𝕜 (fun y => f y + c) x ↔ DifferentiableAt 𝕜 f x

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


theorem supermartingale_nat [IsFiniteMeasure μ] {f : ℕ → Ω → ℝ} (hadp : Adapted 𝒢 f)
    (hint : ∀ i, Integrable (f i) μ) (hf : ∀ i, μ[f (i + 1)|𝒢 i] ≤ᵐ[μ] f i) :
    Supermartingale f 𝒢 μ

{f : ℕ → Ω → ℝ}

(hint : ∀ (i : ℕ), MeasureTheory.Integrable (f i) μ)

(hf : ∀ (i : ℕ), μ[f (i + 1)|↑𝒢 i] ≤ᵐ[μ] f i)


/-- For the outer measure coming from a content, all Borel sets are measurable. -/
theorem borel_le_caratheodory : S ≤ μ.outerMeasure.caratheodory

{G : Type w}
[TopologicalSpace G]
(μ : MeasureTheory.Content G)
[R1Space G]
[S : MeasurableSpace G]
[BorelSpace G]


/-- The L-series of the twist of `f` by a Dirichlet character converges at `s` if the L-series
of `f` does. -/
lemma LSeriesSummable_mul {N : ℕ} (χ : DirichletCharacter ℂ N) {f : ℕ → ℂ} {s : ℂ}
    (h : LSeriesSummable f s) :
    LSeriesSummable (↗χ * f) s


/-- The oplax functor associated with a pseudofunctor. -/
@[simps]
def toOplax : OplaxFunctor B C

{B : Type u₁}
[CategoryTheory.Bicategory B]
{C : Type u₂}
[CategoryTheory.Bicategory C]
(F : CategoryTheory.Pseudofunctor B C)
(a : B)


@[to_additive (attr := simp)]
theorem coe_equivMapOfInjective_apply (H : Subgroup G) (f : G →* N) (hf : Function.Injective f)
    (h : H) : (equivMapOfInjective H f hf h : N) = f h

{G : Type u_1}
[Group G]
{N : Type u_5}
[Group N]
(H : Subgroup G)
(f : G →* N)
(hf : Function.Injective ⇑f)
(h : ↥H)

↑((H.equivMapOfInjective f hf) h) = f ↑h


@[simp]
theorem val_codRestrict_apply (f : ι → α) (s : Set α) (h : ∀ x, f x ∈ s) (x : ι) :
    (codRestrict f s h x : α) = f x

{α : Type u_1}
{ι : Sort u_4}
(f : ι → α)
(s : Set α)
(h : ∀ (x : ι), f x ∈ s)
(x : ι)


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

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

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


@[to_additive (attr := simp, norm_cast)]
theorem coe_pow [Pow G M] (f : α → G) (n : M) : ↑(f ^ n) = (f : Germ l G) ^ n

{α : Type u_1}
{l : Filter α}
{M : Type u_5}
{G : Type u_6}
[SMul M G]
(f : α → G)
(n : M)


theorem StrictMono.cmp_map_eq (hf : StrictMono f) (x y : α) : cmp (f x) (f y) = cmp x y

{α : Type u}
{β : Type v}
[LinearOrder α]
[LinearOrder β]
{f : α → β}
(hf : StrictMono f)
(x y : α)


/-- Let `R : α → ℝ` be a (possibly discontinuous) function on a proper metric space.
Let `s` be a closed set in `α` such that `R` is positive on `s`. Then there exists a collection of
pairs of balls `Metric.ball (c i) (r i)`, `Metric.ball (c i) (r' i)` such that

* all centers belong to `s`;
* for all `i` we have `0 < r i < r' i < R (c i)`;
* the family of balls `Metric.ball (c i) (r' i)` is locally finite;
* the balls `Metric.ball (c i) (r i)` cover `s`.

This is a simple corollary of `refinement_of_locallyCompact_sigmaCompact_of_nhds_basis_set`
and `exists_subset_iUnion_ball_radius_pos_lt`. -/
theorem exists_locallyFinite_subset_iUnion_ball_radius_lt (hs : IsClosed s) {R : α → ℝ}
    (hR : ∀ x ∈ s, 0 < R x) :
    ∃ (ι : Type u) (c : ι → α) (r r' : ι → ℝ),
      (∀ i, c i ∈ s ∧ 0 < r i ∧ r i < r' i ∧ r' i < R (c i)) ∧
        (LocallyFinite fun i => ball (c i) (r' i)) ∧ s ⊆ ⋃ i, ball (c i) (r i)

{α : Type u}
[MetricSpace α]
[ProperSpace α]
{s : Set α}
(hs : IsClosed s)
{R : α → ℝ}
(hR : ∀ x ∈ s, 0 < R x)

∃ ι c r r',
  (∀ (i : ι), c i ∈ s ∧ 0 < r i ∧ r i < r' i ∧ r' i < R (c i)) ∧
    (LocallyFinite fun i => Metric.ball (c i) (r' i)) ∧ s ⊆ ⋃ i, Metric.ball (c i) (r i)


theorem smul_toSimpleFunc (k : 𝕜) (f : Lp.simpleFunc E p μ) :
    toSimpleFunc (k • f) =ᵐ[μ] k • ⇑(toSimpleFunc f)

(f : ↥(MeasureTheory.Lp.simpleFunc E p μ))

↑(MeasureTheory.Lp.simpleFunc.toSimpleFunc (k • f)) =ᵐ[μ] k • ↑(MeasureTheory.Lp.simpleFunc.toSimpleFunc f)


/-- Given a functor `F : J ⥤ K ⥤ C`, with all needed limits,
we can construct a diagram consisting of the limit cone over each functor `F.obj j`,
and the universal cone morphisms between these.
-/
@[simps]
noncomputable def DiagramOfCones.mkOfHasLimits : DiagramOfCones F

∀ {j j' : J} (f : j ⟶ j'),
  ((CategoryTheory.Limits.DiagramOfCones.mkOfHasLimits F).map f).hom = CategoryTheory.Limits.lim.map (F.map f)


/--
A `PreSubmersivePresentation` is submersive if its jacobian is a unit in `S`
and the presentation is finite.
-/
@[nolint checkUnivs]
structure SubmersivePresentation extends PreSubmersivePresentation.{t, w} R S where
  jacobian_isUnit : IsUnit toPreSubmersivePresentation.jacobian
  isFinite : toPreSubmersivePresentation.IsFinite := by infer_instance

(self : Algebra.SubmersivePresentation R S)


/-- The equivalence between `Bipointed` and itself induced by `Prod.swap` both ways. -/
@[simps!]
def swapEquiv : Bipointed ≌ Bipointed

∀ (a : ((Bipointed.swap ⋙ Bipointed.swap).obj X).X),
  (Bipointed.swapEquiv.unitIso.inv.app X).toFun a =
    (Bipointed.swap.map (Bipointed.swap.map { toFun := id, map_fst := ⋯, map_snd := ⋯ }) ≫
          Bipointed.swap.map { toFun := id, map_fst := ⋯, map_snd := ⋯ } ≫
            { toFun := id, map_fst := ⋯, map_snd := ⋯ }).toFun
      ((𝟙 (Bipointed.swap.obj (Bipointed.swap.obj X))).toFun a)


@[to_additive]
theorem map_comap_eq_of_surjective (S : Subsemigroup N) : (S.comap f).map f = S

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

AddSubsemigroup.map f (AddSubsemigroup.comap f S) = S


/-- The equivalence `Karoubi (HomologicalComplex C c) ≌ HomologicalComplex (Karoubi C) c`. -/
@[simps]
def karoubiHomologicalComplexEquivalence :
    Karoubi (HomologicalComplex C c) ≌ HomologicalComplex (Karoubi C) c

(C : Type u_1)
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Preadditive C]
{ι : Type u_2}
(c : ComplexShape ι)

(CategoryTheory.Idempotents.karoubiHomologicalComplexEquivalence C c).functor =
  CategoryTheory.Idempotents.KaroubiHomologicalComplexEquivalence.functor


@[simp]
theorem GLPos.coe_neg (g : GLPos n R) : (↑(-g) : GL n R) = -((g : GL n R) : Matrix n n R)

{n : Type u}
{R : Type v}
[DecidableEq n]
[Fintype n]
[LinearOrderedCommRing R]
[Fact (Even (Fintype.card n))]
(g : ↥(Matrix.GLPos n R))


theorem disjoint_inf_sdiff : Disjoint (x ⊓ y) (x \ y)

{α : Type u}
{x y : α}
[GeneralizedBooleanAlgebra α]


@[simp]
theorem zipRight_nil_left : zipRight ([] : List α) bs = bs.map fun b => (none, b)

[].zipRight bs = List.map (fun b => (none, b)) bs


theorem nmul_nadd_lt₃ {a' b' c' : Ordinal} (ha : a' < a) (hb : b' < b) (hc : c' < c) :
    a' ⨳ b ⨳ c ♯ a ⨳ b' ⨳ c ♯ a ⨳ b ⨳ c' ♯ a' ⨳ b' ⨳ c' <
      a ⨳ b ⨳ c ♯ a' ⨳ b' ⨳ c ♯ a' ⨳ b ⨳ c' ♯ a ⨳ b' ⨳ c'

{a b c a' b' c' : Ordinal.{u}}
(ha : a' < a)
(hb : b' < b)
(hc : c' < c)


@[simp]
theorem lsingle_apply (i : ι) (x : M i) : (lsingle i : (M i) →ₗ[R] _) x = single i x

{ι : Type u_1}
{R : Type u_2}
{M : ι → Type u_4}
[Semiring R]
[(i : ι) → AddCommMonoid (M i)]
[(i : ι) → Module R (M i)]
[DecidableEq ι]
(i : ι)
(x : M i)

(DFinsupp.lsingle i) x = DFinsupp.single i x


@[simp]
theorem rtakeWhile_eq_nil_iff : rtakeWhile p l = [] ↔ ∀ hl : l ≠ [], ¬p (l.getLast hl)

{α : Type u_1}
{p : α → Bool}
{l : List α}

List.rtakeWhile p l = [] ↔ ∀ (hl : l ≠ []), ¬p (l.getLast hl) = true


theorem xor_left_inj : ∀ (x y z : Bool), xor x y = xor x z ↔ y = z


@[measurability]
theorem measurable_im : Measurable im


@[reassoc (attr := simp)]
theorem toSheafify_naturality {P Q : Cᵒᵖ ⥤ D} (η : P ⟶ Q) :
    η ≫ toSheafify J _ = toSheafify J _ ≫ sheafifyMap J η

(J : CategoryTheory.GrothendieckTopology C)

CategoryTheory.CategoryStruct.comp η (CategoryTheory.toSheafify J Q) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.toSheafify J P) (CategoryTheory.sheafifyMap J η)


theorem Iic_inter_Ici : Iic a ∩ Ici b = Icc b a


@[simp]
theorem bot_coeSubmodule : ((⊥ : LieSubmodule R L M) : Submodule R M) = ⊥

{R : Type u}
{L : Type v}
{M : Type w}
[CommRing R]
[LieRing L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]


/-- `toSpecΓ _` is an isomorphism so these are mutually two-sided inverses. -/
theorem Γ_Spec_left_triangle : toSpecΓ (Γ.obj (op X)) ≫ X.toΓSpec.1.c.app (op ⊤) = 𝟙 _

CategoryTheory.CategoryStruct.comp
    (AlgebraicGeometry.toSpecΓ (AlgebraicGeometry.LocallyRingedSpace.Γ.obj (Opposite.op X)))
    (X.toΓSpec.val.c.app (Opposite.op ⊤)) =
  CategoryTheory.CategoryStruct.id (AlgebraicGeometry.LocallyRingedSpace.Γ.obj (Opposite.op X))


@[simp]
theorem edist_map (x y : P) : edist (e x) (e y) = edist x y

{𝕜 : Type u_1}
{V : Type u_2}
{V₂ : Type u_5}
{P : Type u_10}
{P₂ : Type u_11}
[NormedField 𝕜]
[SeminormedAddCommGroup V]
[NormedSpace 𝕜 V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]
[SeminormedAddCommGroup V₂]
[NormedSpace 𝕜 V₂]
[PseudoMetricSpace P₂]
[NormedAddTorsor V₂ P₂]
(e : P ≃ᵃⁱ[𝕜] P₂)
(x y : P)


/-- A homeomorphism is proper. -/
@[simp] lemma Homeomorph.isProperMap (e : X ≃ₜ Y) : IsProperMap e

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


@[simp, norm_cast]
theorem measurable_coe_nnreal_ennreal_iff {f : α → ℝ≥0} :
    (Measurable fun x => (f x : ℝ≥0∞)) ↔ Measurable f

{α : Type u_1}
[MeasurableSpace α]
{f : α → ℝ≥0}

(Measurable fun x => ↑(f x)) ↔ Measurable f


@[simp]
theorem init_add_tail (x : 𝕎 R) (n : ℕ) : init n x + tail n x = x

{p : ℕ}
[hp : Fact (Nat.Prime p)]
{R : Type u_1}
[CommRing R]
(x : 𝕎 R)
(n : ℕ)

WittVector.init n x + WittVector.tail n x = x


/-- A continuous additive map between two vector spaces over `ℝ` is `ℝ`-linear. -/
theorem map_real_smul {G} [FunLike G E F] [AddMonoidHomClass G E F] (f : G) (hf : Continuous f)
    (c : ℝ) (x : E) :
    f (c • x) = c • f x

{E : Type u_1}
[AddCommGroup E]
[Module ℝ E]
[TopologicalSpace E]
[ContinuousSMul ℝ E]
{F : Type u_2}
[AddCommGroup F]
[Module ℝ F]
[TopologicalSpace F]
[ContinuousSMul ℝ F]
[T2Space F]
{G : Type u_3}
[FunLike G E F]
[AddMonoidHomClass G E F]
(f : G)
(hf : Continuous ⇑f)
(c : ℝ)
(x : E)


theorem differentiableAt_euclidean :
    DifferentiableAt 𝕜 f y ↔ ∀ i, DifferentiableAt 𝕜 (fun x => f x i) y

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

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


theorem ratio_of_trivial [DilationClass F α β] (f : F)
    (h : ∀ x y : α, edist x y = 0 ∨ edist x y = ∞) : ratio f = 1

(h : ∀ (x y : α), edist x y = 0 ∨ edist x y = ⊤)


theorem comap_le_iff_le_kernMap : comap m g ≤ f ↔ g ≤ kernMap m f

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

Filter.comap m g ≤ f ↔ g ≤ Filter.kernMap m f


theorem sq_eq_one_of_sq_lt_four {x : ℤ} (h1 : x ^ 2 < 4) (h2 : x ≠ 0) : x ^ 2 = 1


@[to_additive]
theorem Ultrafilter.eventually_mul {M} [Mul M] (U V : Ultrafilter M) (p : M → Prop) :
    (∀ᶠ m in ↑(U * V), p m) ↔ ∀ᶠ m in U, ∀ᶠ m' in V, p (m * m')

{M : Type u_1}
[Add M]
(U V : Ultrafilter M)
(p : M → Prop)

(∀ᶠ (m : M) in ↑(U + V), p m) ↔ ∀ᶠ (m : M) in ↑U, ∀ᶠ (m' : M) in ↑V, p (m + m')


protected theorem HasAntitoneBasis.mem_iff [Preorder ι] {l : Filter α} {s : ι → Set α}
    (hs : l.HasAntitoneBasis s) {t : Set α} : t ∈ l ↔ ∃ i, s i ⊆ t

{α : Type u_1}
{ι : Type u_4}
[Preorder ι]
{l : Filter α}
{s : ι → Set α}
(hs : l.HasAntitoneBasis s)
{t : Set α}


/-- If `i : K →+* L` is a ring homomorphism of characteristic `p` rings, then it is called
`p`-radical if the following conditions are satisfied:

- For any element `x` of `L` there is `n : ℕ` such that `x ^ (p ^ n)` is contained in `K`.
- The kernel of `i` is contained in the `p`-nilradical of `K`.

It is a generalization of purely inseparable extension for fields. -/
@[mk_iff]
class IsPRadical : Prop where
  pow_mem' : ∀ x : L, ∃ (n : ℕ) (y : K), i y = x ^ p ^ n
  ker_le' : RingHom.ker i ≤ pNilradical K p

{K : Type u_1}
{L : Type u_2}
[CommSemiring K]
[CommSemiring L]
{i : K →+* L}
{p : ℕ}
[self : IsPRadical i p]


theorem frequently_zero_iff_eventually_zero {f : 𝕜 → E} {w : 𝕜} (hf : AnalyticAt 𝕜 f w) :
    (∃ᶠ z in 𝓝[≠] w, f z = 0) ↔ ∀ᶠ z in 𝓝 w, f z = 0

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

(∃ᶠ (z : 𝕜) in 𝓝[≠] w, f z = 0) ↔ ∀ᶠ (z : 𝕜) in 𝓝 w, f z = 0


/-- The equivalence `(ULift (Multiplicative ℤ) →* α) ≃ α` for any group `α`. -/
@[simps!]
def fromULiftMultiplicativeIntEquiv (α : Type u) [Group α] :
    (ULift.{u} (Multiplicative ℤ) →* α) ≃ α

∀ (a : ULift.{u, 0} (Multiplicative ℤ) →* α),
  (MonoidHom.fromULiftMultiplicativeIntEquiv α) a = a (MulEquiv.ulift.symm (Multiplicative.ofAdd 1))


theorem einfsep_pair_le_left (hxy : x ≠ y) : ({x, y} : Set α).einfsep ≤ edist x y

{α : Type u_1}
[EDist α]
{x y : α}
(hxy : x ≠ y)


@[simp]
theorem get_zero_cons (a : α) (s : Stream' α) : get (a::s) 0 = a


@[simp] theorem Function.comp_apply {f : β → δ} {g : α → β} {x : α} : comp f g x = f (g x)

{β : Sort u_1}
{δ : Sort u_2}
{α : Sort u_3}
{f : β → δ}
{g : α → β}
{x : α}


@[ext]
theorem ext (H : ∀ x, f x = g x) : f = g

{V₁ : Type u_2}
{V₂ : Type u_3}
[SeminormedAddCommGroup V₁]
[SeminormedAddCommGroup V₂]
{f g : NormedAddGroupHom V₁ V₂}
(H : ∀ (x : V₁), f x = g x)


/-- A vector is in the `vectorSpan` of an indexed family if and only
if it is a `weightedVSub` with sum of weights 0. -/
theorem mem_vectorSpan_iff_eq_weightedVSub {v : V} {p : ι → P} :
    v ∈ vectorSpan k (Set.range p) ↔
      ∃ (s : Finset ι) (w : ι → k), ∑ i ∈ s, w i = 0 ∧ v = s.weightedVSub p w

{ι : Type u_1}
(k : Type u_2)
{V : Type u_3}
{P : Type u_4}
[Ring k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{v : V}
{p : ι → P}

v ∈ vectorSpan k (Set.range p) ↔ ∃ s w, ∑ i ∈ s, w i = 0 ∧ v = (s.weightedVSub p) w


@[to_additive]
theorem measurable_const_smul_iff (c : G) : (Measurable fun x => c • f x) ↔ Measurable f

{β : Type u_3}
{α : Type u_4}
[MeasurableSpace β]
[MeasurableSpace α]
{f : α → β}
{G : Type u_5}
[Group G]
[MeasurableSpace G]
[MulAction G β]
[MeasurableSMul G β]
(c : G)


theorem contained_eq_proj (o : Ordinal) (h : contained C o) :
    C = π C (ord I · < o)

(h : Profinite.NobelingProof.contained C o)

C = Profinite.NobelingProof.π C fun x => Profinite.NobelingProof.ord I x < o


theorem RingHom.star_def {S : Type*} [NonAssocSemiring S] (f : S →+* R) :
    Star.star f = RingHom.comp (starRingEnd R) f

{R : Type u}
[CommSemiring R]
[StarRing R]
{S : Type u_1}
[NonAssocSemiring S]
(f : S →+* R)


nonrec theorem IsLocalMax.neg (hf : IsLocalMax f a) : IsLocalMin (fun x => -f x) a

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[OrderedAddCommGroup β]
{f : α → β}
{a : α}
(hf : IsLocalMax f a)


theorem sub_le {a b c : Ordinal} : a - b ≤ c ↔ a ≤ b + c


@[simp, norm_cast]
theorem coe_finset_sup {s : Finset α} {f : α → ℝ≥0} : ↑(s.sup f) = s.sup fun x => (f x : ℝ≥0∞)

{α : Type u_1}
{s : Finset α}
{f : α → ℝ≥0}


/-- Each element of the group defines a linear equivalence.

This is a stronger version of `DistribMulAction.toAddEquiv`. -/
@[simps!]
def toLinearEquiv (s : S) : M ≃ₗ[R] M

(R : Type u_1)
{S : Type u_7}
(M : Type u_8)
[Semiring R]
[AddCommMonoid M]
[Module R M]
[Group S]
[DistribMulAction S M]
[SMulCommClass S R M]
(s : S)

∀ (a : M), (DistribMulAction.toLinearEquiv R M s) a = s • a


@[simp]
theorem coe_toContinuousLinearMap_symm :
    ⇑(toContinuousLinearMap : (E →ₗ[𝕜] F') ≃ₗ[𝕜] E →L[𝕜] F').symm =
      ((↑) : (E →L[𝕜] F') → E →ₗ[𝕜] F')

{𝕜 : Type u}
[hnorm : NontriviallyNormedField 𝕜]
{E : Type v}
[AddCommGroup E]
[Module 𝕜 E]
[TopologicalSpace E]
[TopologicalAddGroup E]
[ContinuousSMul 𝕜 E]
{F' : Type x}
[AddCommGroup F']
[Module 𝕜 F']
[TopologicalSpace F']
[TopologicalAddGroup F']
[ContinuousSMul 𝕜 F']
[CompleteSpace 𝕜]
[T2Space E]
[FiniteDimensional 𝕜 E]


@[to_additive norm_nsmul_le]
theorem norm_pow_le_mul_norm (n : ℕ) (a : E) : ‖a ^ n‖ ≤ n * ‖a‖

{E : Type u_6}
[SeminormedCommGroup E]
(n : ℕ)
(a : E)

‖a ^ n‖ ≤ ↑n * ‖a‖


theorem of_injective (i : ι) : Function.Injective (of β i)

{ι : Type v}
{β : ι → Type w}
[(i : ι) → AddCommMonoid (β i)]
[DecidableEq ι]
(i : ι)


@[simp]
theorem mk_psum (α : Type u) (β : Type v) : #(α ⊕' β) = lift.{v} #α + lift.{u} #β

Cardinal.mk (α ⊕' β) = Cardinal.lift.{v, u} (Cardinal.mk α) + Cardinal.lift.{u, v} (Cardinal.mk β)


@[to_additive]
lemma not_mulDissociated_iff_exists_disjoint :
    ¬ MulDissociated s ↔
      ∃ t u : Finset α, ↑t ⊆ s ∧ ↑u ⊆ s ∧ Disjoint t u ∧ t ≠ u ∧ ∏ a in t, a = ∏ a in u, a

{α : Type u_1}
[CommGroup α]
{s : Set α}

¬MulDissociated s ↔ ∃ t u, ↑t ⊆ s ∧ ↑u ⊆ s ∧ Disjoint t u ∧ t ≠ u ∧ ∏ a ∈ t, a = ∏ a ∈ u, a


/-- The associator functor `(C × D) × E ⥤ C × (D × E)`.
-/
@[simps]
def associator : (C × D) × E ⥤ C × D × E

(C : Type u₁)
[CategoryTheory.Category.{v₁, u₁} C]
(D : Type u₂)
[CategoryTheory.Category.{v₂, u₂} D]
(E : Type u₃)
[CategoryTheory.Category.{v₃, u₃} E]
(X : (C × D) × E)

(CategoryTheory.prod.associator C D E).obj X = (X.1.1, X.1.2, X.2)


theorem pullback_snd_eq :
    Profinite.pullback.snd f g = (pullbackIsoPullback f g).hom ≫ Limits.pullback.snd f g

{X Y B : Profinite}
(f : X ⟶ B)
(g : Y ⟶ B)

Profinite.pullback.snd f g =
  CategoryTheory.CategoryStruct.comp (Profinite.pullbackIsoPullback f g).hom (CategoryTheory.Limits.pullback.snd f g)


theorem Context.eval_toList (ctx : Context α) (e : Expr) : evalList α ctx e.toList = eval α ctx e

{α : Sort u_1}
(ctx : Lean.Data.AC.Context α)
(e : Lean.Data.AC.Expr)

Lean.Data.AC.evalList α ctx e.toList = Lean.Data.AC.eval α ctx e


theorem Ici_injective : Injective (Ici : α → Set α)


@[gcongr] theorem lintegral_mono_fn' ⦃f g : α → ℝ≥0∞⦄ (hfg : ∀ x, f x ≤ g x) (h2 : μ ≤ ν) :
    lintegral μ f ≤ lintegral ν g

{α : Type u_1}
{m : MeasurableSpace α}
{μ ν : MeasureTheory.Measure α}
⦃f g : α → ℝ≥0∞⦄
(hfg : ∀ (x : α), f x ≤ g x)
(h2 : μ ≤ ν)

MeasureTheory.lintegral μ f ≤ MeasureTheory.lintegral ν g


@[to_additive]
theorem mulSingle_mono : Monotone (Pi.mulSingle i : f i → ∀ i, f i)

{I : Type u}
{f : I → Type v}
(i : I)
[DecidableEq I]
[(i : I) → Preorder (f i)]
[(i : I) → One (f i)]


theorem Certificate.of_combine (ctx : Context) (cs : Certificate) (h : cs.combine.denote ctx → False) : cs.denote ctx

(h : Nat.Linear.PolyCnstr.denote ctx cs.combine → False)


/-- `t` is in the upper shadow of `𝒜` iff `t` is exactly one element more than something from `𝒜`.

See also `Finset.mem_upShadow_iff_exists_mem_card_add_one`. -/
lemma mem_upShadow_iff_exists_sdiff : t ∈ ∂⁺ 𝒜 ↔ ∃ s ∈ 𝒜, s ⊆ t ∧ (t \ s).card = 1

{α : Type u_1}
[DecidableEq α]
[Fintype α]
{𝒜 : Finset (Finset α)}
{t : Finset α}

t ∈ 𝒜.upShadow ↔ ∃ s ∈ 𝒜, s ⊆ t ∧ (t \ s).card = 1


theorem AnalyticOn.eval_continuousLinearMap' (f : σ → E →L[𝕜] B) (p : MvPolynomial σ B) :
    AnalyticOn 𝕜 (fun x ↦ eval (f · x) p) Set.univ

{𝕜 : Type u_1}
{E : Type u_2}
{B : Type u_4}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedCommRing B]
[NormedAlgebra 𝕜 B]
{σ : Type u_5}
(f : σ → E →L[𝕜] B)
(p : MvPolynomial σ B)

AnalyticOn 𝕜 (fun x => (MvPolynomial.eval fun x_1 => (f x_1) x) p) Set.univ


theorem mk_proj_snd (ex : x ∈ e.source) : (proj x, (e x).2) = e x

{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)
{x : Z}
(ex : x ∈ e.source)


/-- Given $k$-modules $V, W$, there is a homomorphism $φ : V^* ⊗ W → Hom_k(V, W)$
(implemented by `LinearAlgebra.Contraction.dualTensorHom`).
Given representations of $G$ on $V$ and $W$,there are representations of $G$ on $V^* ⊗ W$ and on
$Hom_k(V, W)$.
This lemma says that $φ$ is $G$-linear.
-/
theorem dualTensorHom_comm (g : G) :
    dualTensorHom k V W ∘ₗ TensorProduct.map (ρV.dual g) (ρW g) =
      (linHom ρV ρW) g ∘ₗ dualTensorHom k V W

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

dualTensorHom k V W ∘ₗ TensorProduct.map (ρV.dual g) (ρW g) = (ρV.linHom ρW) g ∘ₗ dualTensorHom k V W


@[to_additive]
theorem map_map (g : N →ₙ* P) (f : M →ₙ* N) : (S.map f).map g = S.map (g.comp f)

{M : Type u_1}
{N : Type u_2}
{P : Type u_3}
[Mul M]
[Mul N]
[Mul P]
(S : Subsemigroup M)
(g : N →ₙ* P)
(f : M →ₙ* N)

Subsemigroup.map g (Subsemigroup.map f S) = Subsemigroup.map (g.comp f) S


@[to_additive (attr := simp, norm_cast)]
theorem coe_smul [SMul M G] (n : M) (f : α → G) : ↑(n • f) = n • (f : Germ l G)

{α : Type u_1}
{l : Filter α}
{M : Type u_5}
{G : Type u_6}
[SMul M G]
(n : M)
(f : α → G)


theorem findGreatest_is_greatest (hk : Nat.findGreatest P n < k) (hkb : k ≤ n) : ¬P k

{k : ℕ}
{P : ℕ → Prop}
[DecidablePred P]
{n : ℕ}
(hk : Nat.findGreatest P n < k)
(hkb : k ≤ n)


@[aesop safe apply]
theorem neg {x : R} (hx : IsSelfAdjoint x) : IsSelfAdjoint (-x)

{R : Type u_1}
[AddGroup R]
[StarAddMonoid R]
{x : R}
(hx : IsSelfAdjoint x)


@[simp]
theorem prod_sup_prod : prod p q₁ ⊔ prod p' q₁' = prod (p ⊔ p') (q₁ ⊔ q₁')

{R : Type u_1}
{M : Type u_4}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(p p' : Submodule R M)
{M' : Type u_9}
[AddCommMonoid M']
[Module R M']
(q₁ q₁' : Submodule R M')

p.prod q₁ ⊔ p'.prod q₁' = (p ⊔ p').prod (q₁ ⊔ q₁')


theorem skeletal : Skeletal (ThinSkeleton C)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[Quiver.IsThin C]


theorem invOf_eq_left_inv [Monoid α] {a b : α} [Invertible a] (hac : b * a = 1) : ⅟ a = b

{α : Type u}
[Monoid α]
{a b : α}
[Invertible a]
(hac : b * a = 1)


theorem inv_pos_le_iff_one_le_mul (ha : 0 < a) : a⁻¹ ≤ b ↔ 1 ≤ b * a

{α : Type u_2}
[LinearOrderedSemifield α]
{a b : α}
(ha : 0 < a)


theorem _root_.Filter.Tendsto.isBigO_one {c : E'} (h : Tendsto f' l (𝓝 c)) :
    f' =O[l] (fun _x => 1 : α → F)

{α : Type u_1}
(F : Type u_4)
{E' : Type u_6}
[Norm F]
[SeminormedAddCommGroup E']
{f' : α → E'}
{l : Filter α}
[One F]
[NormOneClass F]
{c : E'}
(h : Filter.Tendsto f' l (𝓝 c))


theorem fderiv_multiset_prod [DecidableEq ι] {u : Multiset ι} {x : E}
    (h : ∀ i ∈ u, DifferentiableAt 𝕜 (g i ·) x) :
    fderiv 𝕜 (fun x ↦ (u.map (g · x)).prod) x =
      (u.map fun i ↦ ((u.erase i).map (g · x)).prod • fderiv 𝕜 (g i) x).sum

(h : ∀ i ∈ u, DifferentiableAt 𝕜 (fun x => g i x) x)

fderiv 𝕜 (fun x => (Multiset.map (fun x_1 => g x_1 x) u).prod) x =
  (Multiset.map (fun i => (Multiset.map (fun x_1 => g x_1 x) (u.erase i)).prod • fderiv 𝕜 (g i) x) u).sum


theorem LinearMap.toMatrix₂'_comp (B : (n → R) →ₗ[R] (m → R) →ₗ[R] R) (f : (n' → R) →ₗ[R] n → R) :
    toMatrix₂' R (B.comp f) = (toMatrix' f)ᵀ * toMatrix₂' R B

{n : Type u_12}
{m : Type u_13}
{n' : Type u_14}
{R : Type u_17}
[CommSemiring R]
[Fintype n]
[Fintype m]
[DecidableEq n]
[DecidableEq m]
[Fintype n']
[DecidableEq n']
(B : (n → R) →ₗ[R] (m → R) →ₗ[R] R)
(f : (n' → R) →ₗ[R] n → R)

(LinearMap.toMatrix₂' R) (B ∘ₗ f) = (LinearMap.toMatrix' f)ᵀ * (LinearMap.toMatrix₂' R) B


/-- The Yoneda lemma yields a natural transformation `yonedaCollectionPresheaf A F ⟶ A`. -/
@[simps]
def yonedaCollectionPresheafToA (F : (CostructuredArrow yoneda A)ᵒᵖ ⥤ Type v) :
    yonedaCollectionPresheaf A F ⟶ A

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

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

(p : CategoryTheory.OverPresheafAux.YonedaCollection F (Opposite.unop X))

(CategoryTheory.OverPresheafAux.yonedaCollectionPresheafToA F).app X p = p.yonedaEquivFst


theorem funLeft_surjective_of_injective (f : m → n) (hf : Injective f) :
    Surjective (funLeft R M f)

(R : Type u_1)
(M : Type u_8)
[Semiring R]
[AddCommMonoid M]
[Module R M]
{m : Type u_17}
{n : Type u_18}
(f : m → n)
(hf : Function.Injective f)

Function.Surjective ⇑(LinearMap.funLeft R M f)


@[simp]
theorem compl_union (s t : Set α) : (s ∪ t)ᶜ = sᶜ ∩ tᶜ


/-- Stabilizers in monoid SubMulAction coincide with stabilizers in the ambient space -/
theorem stabilizer_of_subMul.submonoid {p : SubMulAction R M} (m : p) :
    MulAction.stabilizerSubmonoid R m = MulAction.stabilizerSubmonoid R (m : M)

{R : Type u}
{M : Type v}
[Monoid R]
[MulAction R M]
{p : SubMulAction R M}
(m : ↥p)

MulAction.stabilizerSubmonoid R m = MulAction.stabilizerSubmonoid R ↑m


@[simp]
lemma prodMkLeft_zero : Kernel.prodMkLeft α (0 : Kernel β γ) = 0

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

ProbabilityTheory.Kernel.prodMkLeft α 0 = 0


@[simp]
theorem biUnion_slice [DecidableEq α] : (Iic <| Fintype.card α).biUnion 𝒜.slice = 𝒜

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

(Finset.Iic (Fintype.card α)).biUnion 𝒜.slice = 𝒜


theorem sum_lt_sum_of_nonempty {s : Finset α} (hs : s.Nonempty) {f g : α → ℝ≥0∞}
    (Hlt : ∀ i ∈ s, f i < g i) : ∑ i ∈ s, f i < ∑ i ∈ s, g i

{α : Type u_1}
{s : Finset α}
(hs : s.Nonempty)
{f g : α → ℝ≥0∞}
(Hlt : ∀ i ∈ s, f i < g i)


@[simp] lemma reindex_apply (l : Subspace η α ι) (eη : η ≃ η') (eα : α ≃ α') (eι : ι ≃ ι') (x i) :
    l.reindex eη eα eι x i = eα (l (eα.symm ∘ x ∘ eη) <| eι.symm i)

{η : Type u_5}
{α : Type u_6}
{ι : Type u_7}
{η' : Type u_9}
{α' : Type u_10}
{ι' : Type u_11}
(l : Combinatorics.Subspace η α ι)
(eη : η ≃ η')
(eα : α ≃ α')
(eι : ι ≃ ι')
(x : η' → α')
(i : ι')

↑(l.reindex eη eα eι) x i = eα (↑l (⇑eα.symm ∘ x ∘ ⇑eη) (eι.symm i))


lemma add_sub_one_le_mul (ha : a ≠ 0) (hb : b ≠ 0) : a + b - 1 ≤ a * b


/-- `Measure.pi μ` is the finite product of the measures `{μ i | i : ι}`.
  It is defined to be measure corresponding to `MeasureTheory.OuterMeasure.pi`. -/
protected irreducible_def pi : Measure (∀ i, α i)

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

MeasureTheory.Measure.pi μ = (MeasureTheory.OuterMeasure.pi fun i => (μ i).toOuterMeasure).toMeasure ⋯


@[simp]
theorem comapDomain_smul [Monoid γ] [∀ i, AddMonoid (β i)] [∀ i, DistribMulAction γ (β i)]
    (h : κ → ι) (hh : Function.Injective h) (r : γ) (f : Π₀ i, β i) :
    comapDomain h hh (r • f) = r • comapDomain h hh f

{ι : Type u}
{γ : Type w}
{β : ι → Type v}
{κ : Type u_1}
[Monoid γ]
[(i : ι) → AddMonoid (β i)]
[(i : ι) → DistribMulAction γ (β i)]
(h : κ → ι)
(hh : Function.Injective h)
(r : γ)
(f : Π₀ (i : ι), β i)

DFinsupp.comapDomain h hh (r • f) = r • DFinsupp.comapDomain h hh f


@[simp]
theorem dense_univ : Dense (univ : Set X)


lemma smul_lt_smul_of_le_of_lt [PosSMulStrictMono α β] [SMulPosMono α β] (ha : a₁ ≤ a₂)
    (hb : b₁ < b₂) (h₁ : 0 < a₁) (h₂ : 0 ≤ b₂) : a₁ • b₁ < a₂ • b₂

{α : Type u_1}
{β : Type u_2}
{a₁ a₂ : α}
{b₁ b₂ : β}
[SMul α β]
[Preorder α]
[Preorder β]
[Zero α]
[Zero β]
[PosSMulStrictMono α β]
[SMulPosMono α β]
(ha : a₁ ≤ a₂)
(hb : b₁ < b₂)
(h₁ : 0 < a₁)
(h₂ : 0 ≤ b₂)

a₁ • b₁ < a₂ • b₂


/-- Taking complements as an order isomorphism to the order dual. -/
@[simps!]
def OrderIso.compl : α ≃o αᵒᵈ

∀ (a : α), (OrderIso.compl α) a = (OrderDual.toDual a)ᶜ


@[simp]
theorem comp_id (f : M →[L] N) : f.comp (id L M) = f

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

f.comp (FirstOrder.Language.Hom.id L M) = f


theorem norm_eq_prod_roots [Algebra.IsSeparable K L] [FiniteDimensional K L] {x : L}
    (hF : (minpoly K x).Splits (algebraMap K F)) :
    algebraMap K F (norm K x) =
      ((minpoly K x).aroots F).prod ^ finrank K⟮x⟯ L

(hF : Polynomial.Splits (algebraMap K F) (minpoly K x))

(algebraMap K F) ((Algebra.norm K) x) = ((minpoly K x).aroots F).prod ^ FiniteDimensional.finrank (↥K⟮x⟯) L


@[simp] theorem merge_nil (s : α → α → Bool) (l) : merge s l [] = l

{α : Type u_1}
(s : α → α → Bool)
(l : List α)


@[norm_cast]
lemma cast_add_of_ne_zero {q r : ℚ} (hq : (q.den : α) ≠ 0) (hr : (r.den : α) ≠ 0) :
    (q + r : ℚ) = (q + r : α)

{α : Type u_3}
[DivisionRing α]
{q r : ℚ}
(hq : ↑q.den ≠ 0)
(hr : ↑r.den ≠ 0)


/-- Lift two monoid equivalences `e : M ≃* N` and `e' : M' ≃* N'` to a monoid equivalence
`(M ∗ M') ≃* (N ∗ N')`. -/
@[to_additive (attr := simps! (config := .asFn)) "Lift two additive monoid
equivalences `e : M ≃+ N` and `e' : M' ≃+ N'` to an additive monoid equivalence
`(AddMonoid.Coprod M M') ≃+ (AddMonoid.Coprod N N')`."]
def coprodCongr (e : M ≃* N) (e' : M' ≃* N') : (M ∗ M') ≃* (N ∗ N')

{M : Type u_1}
{N : Type u_2}
{M' : Type u_3}
{N' : Type u_4}
[MulOneClass M]
[MulOneClass N]
[MulOneClass M']
[MulOneClass N']
(e : M ≃* N)
(e' : M' ≃* N')

⇑(Monoid.MulEquiv.coprodCongr e e').symm = ⇑(Monoid.Coprod.map ↑e.symm ↑e'.symm)


theorem toList_get_zero (h : x ∈ p.support) :
    (toList p x).get ⟨0, (length_toList_pos_of_mem_support _ _ h)⟩ = x

{α : Type u_1}
[Fintype α]
[DecidableEq α]
(p : Equiv.Perm α)
(x : α)
(h : x ∈ p.support)


theorem ennrealToMeasure_apply {m : MeasurableSpace α} {v : VectorMeasure α ℝ≥0∞} {s : Set α}
    (hs : MeasurableSet s) : ennrealToMeasure v s = v s

{v : MeasureTheory.VectorMeasure α ℝ≥0∞}


@[simp]
theorem op_unop (s : Set α) : s.op.unop = s


theorem denseRange_coe₃ :
    DenseRange fun x : α × β × γ =>
      ((x.1 : Completion α), ((x.2.1 : Completion β), (x.2.2 : Completion γ)))

{α : Type u_1}
[UniformSpace α]
{β : Type u_2}
[UniformSpace β]
{γ : Type u_3}
[UniformSpace γ]

DenseRange fun x => (↑α x.1, ↑β x.2.1, ↑γ x.2.2)


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

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


/-- `f.dualMap` is bijective if and only if `f` is -/
@[simp]
theorem dualMap_bijective_iff {f : V₁ →ₗ[K] V₂} :
    Function.Bijective f.dualMap ↔ Function.Bijective f

{K : Type uK}
[Field K]
{V₁ : Type uV₁}
{V₂ : Type uV₂}
[AddCommGroup V₁]
[Module K V₁]
[AddCommGroup V₂]
[Module K V₂]
{f : V₁ →ₗ[K] V₂}

Function.Bijective ⇑f.dualMap ↔ Function.Bijective ⇑f


theorem lex_acc_inr (aca : ∀ a, Acc (Lex r s) (inl a)) {b} (acb : Acc s b) :
    Acc (Lex r s) (inr b)

∀ {α : Type u_1} {r : α → α → Prop} {β : Type u_2} {s : β → β → Prop},
  (∀ (a : α), Acc (Sum.Lex r s) (Sum.inl a)) → ∀ {b : β}, Acc s b → Acc (Sum.Lex r s) (Sum.inr b)


@[simp]
theorem enum_le_enum' (a : Ordinal) {o o' : Ordinal} (ho : o < type (· < ·))
    (ho' : o' < type (· < ·)) : enum (· < ·) o ho ≤ @enum a.out.α (· < ·) _ o' ho' ↔ o ≤ o'

(ho : o < Ordinal.type fun x x_1 => x < x_1)

(ho' : o' < Ordinal.type fun x x_1 => x < x_1)

Ordinal.enum (fun x x_1 => x < x_1) o ho ≤ Ordinal.enum (fun x x_1 => x < x_1) o' ho' ↔ o ≤ o'


theorem comap_span (f : P₁ ≃ᵃ[k] P₂) (s : Set P₂) :
    (affineSpan k s).comap (f : P₁ →ᵃ[k] P₂) = affineSpan k (f ⁻¹' s)

{k : Type u_1}
{V₁ : Type u_2}
{P₁ : Type u_3}
{V₂ : Type u_4}
{P₂ : Type u_5}
[Ring k]
[AddCommGroup V₁]
[Module k V₁]
[AffineSpace V₁ P₁]
[AddCommGroup V₂]
[Module k V₂]
[AffineSpace V₂ P₂]
(f : P₁ ≃ᵃ[k] P₂)
(s : Set P₂)

AffineSubspace.comap (↑f) (affineSpan k s) = affineSpan k (⇑f ⁻¹' s)


lemma IsUnramified.comap {w : InfinitePlace F} (h : IsUnramified k w) :
    IsUnramified k (w.comap (algebraMap K F))

(h : NumberField.InfinitePlace.IsUnramified k w)

NumberField.InfinitePlace.IsUnramified k (w.comap (algebraMap K F))


protected theorem uniformContinuous {E₁ E₂ : Type*} [UniformSpace E₁] [UniformSpace E₂]
    [Ring E₁] [Ring E₂] [Algebra R E₁] [Algebra R E₂] [UniformAddGroup E₁]
    [UniformAddGroup E₂] (f : E₁ →A[R] E₂) : UniformContinuous f

{R : Type u_1}
[CommSemiring R]
{E₁ : Type u_4}
{E₂ : Type u_5}
[UniformSpace E₁]
[UniformSpace E₂]
[Ring E₁]
[Ring E₂]
[Algebra R E₁]
[Algebra R E₂]
[UniformAddGroup E₁]
[UniformAddGroup E₂]
(f : E₁ →A[R] E₂)


theorem ContDiffOn.div' [CompleteSpace K] {f g : E → K} {n} (hf : ContDiffOn K n f s)
    (hg : ContDiffOn K n g s) (h₀ : ∀ x ∈ s, g x ≠ 0) : ContDiffOn K n (fun x => f x / g x) s

{K : Type u_1}
[NontriviallyNormedField K]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace K E]
{s : Set E}
[CompleteSpace K]
{f g : E → K}
{n : ℕ∞}
(hf : ContDiffOn K n f s)
(hg : ContDiffOn K n g s)
(h₀ : ∀ x ∈ s, g x ≠ 0)


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

{α : Type u_1}
[OrderedAddCommGroup α]
{s : Set α}
(hs : IsUpperSet s)


@[to_additive]
theorem mem_normalizer_iff {g : G} : g ∈ H.normalizer ↔ ∀ h, h ∈ H ↔ g * h * g⁻¹ ∈ H

{G : Type u_1}
[Group G]
{H : Subgroup G}
{g : G}

g ∈ H.normalizer ↔ ∀ (h : G), h ∈ H ↔ g * h * g⁻¹ ∈ H


theorem ae_ball_iff {ι : Type*} {S : Set ι} (hS : S.Countable) {p : α → ∀ i ∈ S, Prop} :
    (∀ᵐ x ∂μ, ∀ i (hi : i ∈ S), p x i hi) ↔ ∀ i (hi : i ∈ S), ∀ᵐ x ∂μ, p x i hi

{α : Type u_1}
{F : Type u_3}
[FunLike F (Set α) ℝ≥0∞]
[MeasureTheory.OuterMeasureClass F α]
{μ : F}
{ι : Type u_4}
{S : Set ι}
(hS : S.Countable)
{p : α → (i : ι) → i ∈ S → Prop}

(∀ᵐ (x : α) ∂μ, ∀ (i : ι) (hi : i ∈ S), p x i hi) ↔ ∀ (i : ι) (hi : i ∈ S), ∀ᵐ (x : α) ∂μ, p x i hi


theorem IsCycleOn.conj (h : f.IsCycleOn s) : (g * f * g⁻¹).IsCycleOn ((g : Perm α) '' s)

{α : Type u_2}
{f g : Equiv.Perm α}
{s : Set α}
(h : f.IsCycleOn s)


theorem coeff_divByMonic_X_sub_C (p : R[X]) (a : R) (n : ℕ) :
    (p /ₘ (X - C a)).coeff n = ∑ i ∈ Icc (n + 1) p.natDegree, a ^ (i - (n + 1)) * p.coeff i

{R : Type u}
[Ring R]
(p : R[X])
(a : R)
(n : ℕ)

(p /ₘ (Polynomial.X - Polynomial.C a)).coeff n = ∑ i ∈ Finset.Icc (n + 1) p.natDegree, a ^ (i - (n + 1)) * p.coeff i


theorem equivSentence_not (φ : L.Formula α) : equivSentence φ.not = (equivSentence φ).not

{L : FirstOrder.Language}
{α : Type u'}
(φ : L.Formula α)

FirstOrder.Language.Formula.equivSentence φ.not =
  FirstOrder.Language.Formula.not (FirstOrder.Language.Formula.equivSentence φ)


theorem Dense.exists_le' {s : Set α} (hs : Dense s) (hbot : ∀ x, IsBot x → x ∈ s) (x : α) :
    ∃ y ∈ s, y ≤ x

{α : Type u}
[TopologicalSpace α]
[LinearOrder α]
[ClosedIciTopology α]
{s : Set α}
(hs : Dense s)
(hbot : ∀ (x : α), IsBot x → x ∈ s)
(x : α)


theorem of_coe (f : Ultrafilter α) : of ↑f = f


theorem submatrix_mulVec_equiv [Fintype n] [Fintype o] [NonUnitalNonAssocSemiring α]
    (M : Matrix m n α) (v : o → α) (e₁ : l → m) (e₂ : o ≃ n) :
    M.submatrix e₁ e₂ *ᵥ v = (M *ᵥ (v ∘ e₂.symm)) ∘ e₁

{l : Type u_1}
{m : Type u_2}
{n : Type u_3}
{o : Type u_4}
{α : Type v}
[Fintype n]
[Fintype o]
[NonUnitalNonAssocSemiring α]
(M : Matrix m n α)
(v : o → α)
(e₁ : l → m)
(e₂ : o ≃ n)

M.submatrix e₁ ⇑e₂ *ᵥ v = (M *ᵥ v ∘ ⇑e₂.symm) ∘ e₁


theorem pullbackConeOfLeftIso_π_app_none : (pullbackConeOfLeftIso f g).π.app none = g

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

(CategoryTheory.Limits.pullbackConeOfLeftIso f g).π.app none = g


theorem DifferentiableWithinAt.sin (hf : DifferentiableWithinAt ℝ f s x) :
    DifferentiableWithinAt ℝ (fun x => Real.sin (f x)) s x

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : E → ℝ}
{x : E}
{s : Set E}
(hf : DifferentiableWithinAt ℝ f s x)


theorem coeIdeal_eq_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
    (I : FractionalIdeal S P) = 0 ↔ I = (⊥ : Ideal R)

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


@[norm_cast]
theorem coe_iInf {ι : Sort*} [Nonempty ι] (f : ι → ℝ≥0) : (↑(iInf f) : ℝ≥0∞) = ⨅ a, ↑(f a)

{ι : Sort u_3}
[Nonempty ι]
(f : ι → ℝ≥0)


theorem conj_eq_iff_re {z : K} : conj z = z ↔ (re z : K) = z

(starRingEnd K) z = z ↔ ↑(RCLike.re z) = z


theorem fg_adjoin_finset (s : Finset A) : (Algebra.adjoin R (↑s : Set A)).FG

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


@[to_additive]
theorem pow_eq_one_iff_modEq : x ^ n = 1 ↔ n ≡ 0 [MOD orderOf x]

{G : Type u_1}
[AddMonoid G]
{x : G}
{n : ℕ}


/-- The topology induced by a family of seminorms is exactly the infimum of the ones induced by
each seminorm individually. We express this as a characterization of `WithSeminorms p`. -/
theorem SeminormFamily.withSeminorms_iff_topologicalSpace_eq_iInf [TopologicalAddGroup E]
    (p : SeminormFamily 𝕜 E ι) :
    WithSeminorms p ↔
      t = ⨅ i, (p i).toSeminormedAddCommGroup.toUniformSpace.toTopologicalSpace

{𝕜 : Type u_1}
{E : Type u_5}
{ι : Type u_8}
[NormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[Nonempty ι]
[t : TopologicalSpace E]
[TopologicalAddGroup E]
(p : SeminormFamily 𝕜 E ι)

WithSeminorms p ↔ t = ⨅ i, UniformSpace.toTopologicalSpace


lemma precomp_iff {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z) (hf : W f) :
    W (f ≫ g) ↔ W g

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

W (CategoryTheory.CategoryStruct.comp f g) ↔ W g


theorem encard_diff_add_encard (s t : Set α) : (s \ t).encard + t.encard = (s ∪ t).encard