/-- `SatisfiesM` distributes over `pure`, general version / weakest precondition version. -/
protected theorem pure [Applicative m] [LawfulApplicative m]
    (h : p a) : SatisfiesM (m := m) p (pure a)

∀ {α : Type u_1} {p : α → Prop} {a : α} [inst : Applicative m] [inst_1 : LawfulApplicative m],
  p a → SatisfiesM p (pure a)


theorem cos_add_int_mul_pi (x : ℝ) (n : ℤ) : cos (x + n * π) = (-1) ^ n * cos x

Real.cos (x + ↑n * Real.pi) = (-1) ^ n * Real.cos x


/-- The 1-morphism in `LocallyDiscrete C` associated to a given morphism `f : a ⟶ b` in `C` -/
@[simps]
def toLoc {a b : C} (f : a ⟶ b) : LocallyDiscrete.mk a ⟶ LocallyDiscrete.mk b


@[norm_cast]
theorem coe_neg (U : unitary R) : ↑(-U) = (-U : R)

{R : Type u_1}
[Ring R]
[StarRing R]
(U : ↥(unitary R))


@[to_additive]
theorem isUnit_of_mul_eq_one [CommMonoid M] (a b : M) (h : a * b = 1) : IsUnit a

{M : Type u_1}
[AddCommMonoid M]
(a b : M)
(h : a + b = 0)


@[simp]
theorem iSupLift_inclusion {i : ι} (x : K i) (h : K i ≤ T) :
    iSupLift K dir f hf T hT (inclusion h x) = f i x

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

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

(NonUnitalSubalgebra.iSupLift K dir f hf T hT) ((NonUnitalSubalgebra.inclusion h) x) = (f i) x


@[simp]
theorem BinaryFan.assocInv_snd {X Y Z : C} {sXY : BinaryFan X Y} (P : IsLimit sXY)
    {sYZ : BinaryFan Y Z} (s : BinaryFan X sYZ.pt) :
    (BinaryFan.assocInv P s).snd = s.snd ≫ sYZ.snd

{sXY : CategoryTheory.Limits.BinaryFan X Y}

{sYZ : CategoryTheory.Limits.BinaryFan Y Z}

(s : CategoryTheory.Limits.BinaryFan X sYZ.pt)

(CategoryTheory.Limits.BinaryFan.assocInv P s).snd = CategoryTheory.CategoryStruct.comp s.snd sYZ.snd


theorem UpperSemicontinuousOn.mono (h : UpperSemicontinuousOn f s) (hst : t ⊆ s) :
    UpperSemicontinuousOn f t

{α : Type u_1}
[TopologicalSpace α]
{β : Type u_2}
[Preorder β]
{f : α → β}
{s t : Set α}
(h : UpperSemicontinuousOn f s)
(hst : t ⊆ s)


theorem update_eq_erase_add_single (f : α →₀ M) (a : α) (b : M) :
    f.update a b = f.erase a + single a b

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

f.update a b = Finsupp.erase a f + Finsupp.single a b


@[simp]
theorem innerₛₗ_apply (v w : E) : innerₛₗ 𝕜 v w = ⟪v, w⟫

(𝕜 : Type u_1)
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
(v w : E)


@[simp]
theorem union_star [Star α] : (s ∪ t)⋆ = s⋆ ∪ t⋆


/-- The bilinear map `kahler` is invariant under pullback by a positively-oriented isometric
automorphism. -/
theorem kahler_comp_linearIsometryEquiv (φ : E ≃ₗᵢ[ℝ] E)
    (hφ : 0 < LinearMap.det (φ.toLinearEquiv : E →ₗ[ℝ] E)) (x y : E) :
    o.kahler (φ x) (φ y) = o.kahler x y

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

(hφ : 0 < LinearMap.det ↑φ.toLinearEquiv)


@[simp]
theorem mkMetric_top : (mkMetric (fun _ => ∞ : ℝ≥0∞ → ℝ≥0∞) : OuterMeasure X) = ⊤

(MeasureTheory.OuterMeasure.mkMetric fun x => ⊤) = ⊤


theorem IsCoprime.map (H : IsCoprime x y) {S : Type v} [CommSemiring S] (f : R →+* S) :
    IsCoprime (f x) (f y)

{R : Type u}
[CommSemiring R]
{x y : R}
(H : IsCoprime x y)
{S : Type v}
[CommSemiring S]
(f : R →+* S)


theorem last_eq_of_concat_eq {a b : α} {l₁ l₂ : List α} : concat l₁ a = concat l₂ b → a = b

{α : Type u_1}
{a b : α}
{l₁ l₂ : List α}


@[to_additive min_lt_of_add_lt_two_nsmul]
theorem min_lt_of_mul_lt_sq {a b c : M} (h : a * b < c ^ 2) : min a b < c

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

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


lemma IsSemisimple.restrict {p : Submodule R M} {hp : MapsTo f p p} (hf : f.IsSemisimple) :
    IsSemisimple (f.restrict hp)

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
{f : Module.End R M}
{p : Submodule R M}
{hp : Set.MapsTo ⇑f ↑p ↑p}
(hf : f.IsSemisimple)

Module.End.IsSemisimple (LinearMap.restrict f hp)


theorem to_continuousMap_injective {f g : P →ᴬ[R] Q} (h : (f : C(P, Q)) = (g : C(P, Q))) :
    f = g

{R : Type u_1}
{V : Type u_2}
{W : Type u_3}
{P : Type u_4}
{Q : Type u_5}
[Ring R]
[AddCommGroup V]
[Module R V]
[TopologicalSpace P]
[AddTorsor V P]
[AddCommGroup W]
[Module R W]
[TopologicalSpace Q]
[AddTorsor W Q]
{f g : P →ᴬ[R] Q}
(h : ↑f = ↑g)


@[reassoc]
lemma InjectiveResolution.isoRightDerivedToHomotopyCategoryObj_hom_naturality
    {X Y : C} (f : X ⟶ Y) (I : InjectiveResolution X) (J : InjectiveResolution Y)
    (φ : I.cocomplex ⟶ J.cocomplex) (comm : I.ι.f 0 ≫ φ.f 0 = f ≫ J.ι.f 0)
    (F : C ⥤ D) [F.Additive] :
    F.rightDerivedToHomotopyCategory.map f ≫ (J.isoRightDerivedToHomotopyCategoryObj F).hom =
      (I.isoRightDerivedToHomotopyCategoryObj F).hom ≫
        (F.mapHomologicalComplex _ ⋙ HomotopyCategory.quotient _ _).map φ

(I : CategoryTheory.InjectiveResolution X)

(J : CategoryTheory.InjectiveResolution Y)

(comm : CategoryTheory.CategoryStruct.comp (I.ι.f 0) (φ.f 0) = CategoryTheory.CategoryStruct.comp f (J.ι.f 0))

CategoryTheory.CategoryStruct.comp (F.rightDerivedToHomotopyCategory.map f)
    (J.isoRightDerivedToHomotopyCategoryObj F).hom =
  CategoryTheory.CategoryStruct.comp (I.isoRightDerivedToHomotopyCategoryObj F).hom
    (((F.mapHomologicalComplex (ComplexShape.up ℕ)).comp (HomotopyCategory.quotient D (ComplexShape.up ℕ))).map φ)


/--
Unlike `HasFDerivAt.finset_prod`, supports non-commutative multiply and duplicate elements.
-/
@[fun_prop]
theorem HasFDerivAt.list_prod' {l : List ι} {x : E}
    (h : ∀ i ∈ l, HasFDerivAt (f i ·) (f' i) x) :
    HasFDerivAt (fun x ↦ (l.map (f · x)).prod)
      (∑ i : Fin l.length, ((l.take i).map (f · x)).prod •
        smulRight (f' (l.get i)) ((l.drop (.succ i)).map (f · x)).prod) x

(h : ∀ i ∈ l, HasFDerivAt (fun x => f i x) (f' i) x)

HasFDerivAt (fun x => (List.map (fun x_1 => f x_1 x) l).prod)
  (∑ i : Fin l.length,
    (List.map (fun x_1 => f x_1 x) (List.take (↑i) l)).prod •
      (f' (l.get i)).smulRight (List.map (fun x_1 => f x_1 x) (List.drop (↑i).succ l)).prod)
  x


theorem isUnit_one_sub_self_of_mem_nonunits (a : R) (h : a ∈ nonunits R) : IsUnit (1 - a)

{R : Type u_1}
[CommRing R]
[LocalRing R]
(a : R)
(h : a ∈ nonunits R)


/-- Reinterpret a `⨆`-homomorphism as an `⨅`-homomorphism between the dual orders. -/
@[simps]
protected def dual : sSupHom α β ≃ sInfHom αᵒᵈ βᵒᵈ

{α : Type u_2}
{β : Type u_3}
[SupSet α]
[SupSet β]
(f : sSupHom α β)

∀ (a : αᵒᵈ), (sSupHom.dual f).toFun a = (⇑OrderDual.toDual ∘ ⇑f ∘ ⇑OrderDual.ofDual) a


theorem pow_sub_one_dvd_derivative_of_pow_dvd {p q : R[X]} {n : ℕ}
    (dvd : q ^ n ∣ p) : q ^ (n - 1) ∣ derivative p

{R : Type u}
[CommSemiring R]
{p q : R[X]}
{n : ℕ}
(dvd : q ^ n ∣ p)


theorem decompId_p_naturality {P Q : Karoubi C} (f : P ⟶ Q) :
    decompId_p P ≫ f = (by exact Hom.mk f.f (by simp)) ≫ decompId_p Q

{P Q : CategoryTheory.Idempotents.Karoubi C}

CategoryTheory.CategoryStruct.comp P.decompId_p f =
  CategoryTheory.CategoryStruct.comp { f := f.f, comm := ⋯ } Q.decompId_p


@[to_additive]
theorem disjoint_def {p₁ p₂ : Submonoid M} :
    Disjoint p₁ p₂ ↔ ∀ {x : M}, x ∈ p₁ → x ∈ p₂ → x = 1

{M : Type u_1}
[AddZeroClass M]
{p₁ p₂ : AddSubmonoid M}

Disjoint p₁ p₂ ↔ ∀ {x : M}, x ∈ p₁ → x ∈ p₂ → x = 0


@[to_additive (attr := simp)]
theorem mul_le_mul_iff_right [CovariantClass α α (swap (· * ·)) (· ≤ ·)]
    [ContravariantClass α α (swap (· * ·)) (· ≤ ·)] (a : α) {b c : α} :
    b * a ≤ c * a ↔ b ≤ c

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

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


theorem withDensity_mul₀ {μ : Measure α} {f g : α → ℝ≥0∞}
    (hf : AEMeasurable f μ) (hg : AEMeasurable g μ) :
    μ.withDensity (f * g) = (μ.withDensity f).withDensity g

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


theorem mem_support_normalize_iff (a : α) : a ∈ (normalize f hf0 hf).support ↔ f a ≠ 0

{α : Type u_1}
{f : α → ENNReal}
(hf0 : tsum f ≠ 0)
(hf : tsum f ≠ ⊤)
(a : α)

a ∈ (PMF.normalize f hf0 hf).support ↔ f a ≠ 0


theorem gcd_one_right' [GCDMonoid α] (a : α) : Associated (gcd a 1) 1

{α : Type u_1}
[CancelCommMonoidWithZero α]
[GCDMonoid α]
(a : α)


/-- We can shrink a set to any smaller size. -/
lemma exists_subset_card_eq (hns : n ≤ s.card) : ∃ t ⊆ s, t.card = n

{α : Type u_1}
{s : Finset α}
{n : ℕ}
(hns : n ≤ s.card)


@[simp]
theorem neLocus_self_sub_right : neLocus f (f - g) = g.support

{α : Type u_1}
{N : Type u_3}
[DecidableEq α]
[DecidableEq N]
[AddGroup N]
(f g : α →₀ N)


theorem lintegral_indicator_const₀ {s : Set α} (hs : NullMeasurableSet s μ) (c : ℝ≥0∞) :
    ∫⁻ a, s.indicator (fun _ => c) a ∂μ = c * μ s

(hs : MeasureTheory.NullMeasurableSet s μ)

∫⁻ (a : α), s.indicator (fun x => c) a ∂μ = c * μ s


theorem FiberBundle.chartedSpace_chartAt (x : TotalSpace F E) :
    chartAt (ModelProd HB F) x =
      (trivializationAt F E x.proj).toPartialHomeomorph ≫ₕ
        (chartAt HB x.proj).prod (PartialHomeomorph.refl F)

[TopologicalSpace (Bundle.TotalSpace F E)]


@[to_additive]
theorem numeratorHom_apply {r : R} : numeratorHom r = r /ₒ (1 : S)

{R : Type u_1}
[Monoid R]
{S : Submonoid R}
[OreLocalization.OreSet S]
{r : R}


theorem evalWhiskerRight_comp
    {η : f ⟶ f'} {η₁ : f ⊗ g ⟶ f' ⊗ g} {η₂ : (f ⊗ g) ⊗ h ⟶ (f' ⊗ g) ⊗ h}
    {η₃ : (f ⊗ g) ⊗ h ⟶ f' ⊗ (g ⊗ h)} {η₄ : f ⊗ (g ⊗ h) ⟶ f' ⊗ (g ⊗ h)}
    (pf_η₁ : η ▷ g = η₁) (pf_η₂ : η₁ ▷ h = η₂)
    (pf_η₃ : η₂ ≫ (α_ _ _ _).hom = η₃) (pf_η₄ : (α_ _ _ _).inv ≫ η₃ = η₄) :
    η ▷ (g ⊗ h) = η₄

{η₁ : CategoryTheory.MonoidalCategory.tensorObj f g ⟶ CategoryTheory.MonoidalCategory.tensorObj f' g}

{η₂ :
  CategoryTheory.MonoidalCategory.tensorObj (CategoryTheory.MonoidalCategory.tensorObj f g) h ⟶
    CategoryTheory.MonoidalCategory.tensorObj (CategoryTheory.MonoidalCategory.tensorObj f' g) h}

{η₃ :
  CategoryTheory.MonoidalCategory.tensorObj (CategoryTheory.MonoidalCategory.tensorObj f g) h ⟶
    CategoryTheory.MonoidalCategory.tensorObj f' (CategoryTheory.MonoidalCategory.tensorObj g h)}

{η₄ :
  CategoryTheory.MonoidalCategory.tensorObj f (CategoryTheory.MonoidalCategory.tensorObj g h) ⟶
    CategoryTheory.MonoidalCategory.tensorObj f' (CategoryTheory.MonoidalCategory.tensorObj g h)}

(pf_η₁ : CategoryTheory.MonoidalCategory.whiskerRight η g = η₁)

(pf_η₂ : CategoryTheory.MonoidalCategory.whiskerRight η₁ h = η₂)

(pf_η₃ : CategoryTheory.CategoryStruct.comp η₂ (CategoryTheory.MonoidalCategory.associator f' g h).hom = η₃)

(pf_η₄ : CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.associator f g h).inv η₃ = η₄)

CategoryTheory.MonoidalCategory.whiskerRight η (CategoryTheory.MonoidalCategory.tensorObj g h) = η₄


@[simp]
theorem antidiagonalTuple_one (n : ℕ) : antidiagonalTuple 1 n = [![n]]


theorem frobeniusEquiv_def (x : R) : frobeniusEquiv R p x = x ^ p

(R : Type u_1)
(p : ℕ)
[CommSemiring R]
[ExpChar R p]
[PerfectRing R p]
(x : R)


theorem top_map {x : V} (hx : x ≠ 0) : (⊤ : ENorm 𝕜 V) x = ⊤

{𝕜 : Type u_1}
{V : Type u_2}
[NormedField 𝕜]
[AddCommGroup V]
[Module 𝕜 V]
{x : V}
(hx : x ≠ 0)


@[simp]
protected theorem inv_lt_one : a⁻¹ < 1 ↔ 1 < a


/-- We shorten this from `measure_preimage_mul_left`, since left invariant is the preferred option
  for measures in this formalization. -/
@[to_additive (attr := simp)
"We shorten this from `measure_preimage_add_left`, since left invariant is the preferred option for
measures in this formalization."]
theorem measure_preimage_mul (μ : Measure G) [IsMulLeftInvariant μ] (g : G) (A : Set G) :
    μ ((fun h => g * h) ⁻¹' A) = μ A

{G : Type u_2}
[MeasurableSpace G]
[AddGroup G]
[MeasurableAdd G]
(μ : MeasureTheory.Measure G)
[μ.IsAddLeftInvariant]
(g : G)
(A : Set G)


theorem iIndepSet.indep_generateFrom_of_disjoint [IsProbabilityMeasure μ] {s : ι → Set Ω}
    (hsm : ∀ n, MeasurableSet (s n)) (hs : iIndepSet s μ) (S T : Set ι) (hST : Disjoint S T) :
    Indep (generateFrom { t | ∃ n ∈ S, s n = t }) (generateFrom { t | ∃ k ∈ T, s k = t }) μ

{Ω : Type u_1}
{ι : Type u_2}
{_mΩ : MeasurableSpace Ω}
{μ : MeasureTheory.Measure Ω}
[MeasureTheory.IsProbabilityMeasure μ]
{s : ι → Set Ω}
(hsm : ∀ (n : ι), MeasurableSet (s n))
(hs : ProbabilityTheory.iIndepSet s μ)
(S T : Set ι)
(hST : Disjoint S T)

ProbabilityTheory.Indep (MeasurableSpace.generateFrom {t | ∃ n ∈ S, s n = t})
  (MeasurableSpace.generateFrom {t | ∃ k ∈ T, s k = t}) μ


theorem eq_second_of_chain_of_prime_dvd {p q r : Associates M} {n : ℕ} (hn : n ≠ 0)
    {c : Fin (n + 1) → Associates M} (h₁ : StrictMono c)
    (h₂ : ∀ {r : Associates M}, r ≤ q ↔ ∃ i, r = c i) (hp : Prime p) (hr : r ∣ q) (hp' : p ∣ r) :
    p = c 1


@[simp] lemma isSublattice_empty : IsSublattice (∅ : Set α)


lemma ball_eq_or_disjoint :
    ball x r = ball y r ∨ Disjoint (ball x r) (ball y r)

{X : Type u_1}
[PseudoMetricSpace X]
[IsUltrametricDist X]
(x y : X)
(r : ℝ)

Metric.ball x r = Metric.ball y r ∨ Disjoint (Metric.ball x r) (Metric.ball y r)


/-- We say that a type `α` has a *countable separating family of sets* satisfying a predicate
`p : Set α → Prop` on a set `t` if there exists a countable family of sets `S : Set (Set α)` such
that all sets `s ∈ S` satisfy `p` and any two distinct points `x y ∈ t`, `x ≠ y`, can be separated
by `s ∈ S`: there exists `s ∈ S` such that exactly one of `x` and `y` belongs to `s`.

E.g., if `α` is a `T₀` topological space with second countable topology, then it has a countable
separating family of open sets and a countable separating family of closed sets.
-/
class HasCountableSeparatingOn (α : Type*) (p : Set α → Prop) (t : Set α) : Prop where
  exists_countable_separating : ∃ S : Set (Set α), S.Countable ∧ (∀ s ∈ S, p s) ∧
    ∀ x ∈ t, ∀ y ∈ t, (∀ s ∈ S, x ∈ s ↔ y ∈ s) → x = y

{α : Type u_1}
{p : Set α → Prop}
{t : Set α}
[self : HasCountableSeparatingOn α p t]

∃ S, S.Countable ∧ (∀ s ∈ S, p s) ∧ ∀ x ∈ t, ∀ y ∈ t, (∀ s ∈ S, x ∈ s ↔ y ∈ s) → x = y


theorem mem_nhds_top_iff {s : Set EReal} : s ∈ 𝓝 (⊤ : EReal) ↔ ∃ y : ℝ, Ioi (y : EReal) ⊆ s


@[simp]
theorem coe_comap (f : E →ₗ[𝕜] F) (S : ConvexCone 𝕜 F) : (S.comap f : Set E) = f ⁻¹' S

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[AddCommMonoid F]
[Module 𝕜 E]
[Module 𝕜 F]
(f : E →ₗ[𝕜] F)
(S : ConvexCone 𝕜 F)


/-- The `IndepMatroid` whose independent sets are the independent subsets of `R`. -/
@[simps] def restrictIndepMatroid (M : Matroid α) (R : Set α) : IndepMatroid α

{α : Type u_1}
(M : Matroid α)
(R : Set α)


lemma IsHereditarilyLindelof.isLindelof (hs : IsHereditarilyLindelof s) :
    IsLindelof s

{X : Type u}
[TopologicalSpace X]
{s : Set X}
(hs : IsHereditarilyLindelof s)


/-- If `𝕝` is a normed field extension of `𝕜`, then the inverse map `𝕝 → 𝕝` is `𝕜`-analytic
away from 0. -/
lemma analyticAt_inv {z : 𝕝} (hz : z ≠ 0) : AnalyticAt 𝕜 Inv.inv z

{𝕜 : Type u_2}
[NontriviallyNormedField 𝕜]
{𝕝 : Type u_7}
[NontriviallyNormedField 𝕝]
[NormedAlgebra 𝕜 𝕝]
{z : 𝕝}
(hz : z ≠ 0)


@[reassoc (attr := simp)]
lemma biprod_inr_snd_f (i : ι) :
    (biprod.inr : L ⟶ K ⊞ L).f i ≫ (biprod.snd : K ⊞ L ⟶ L).f i = 𝟙 _

[∀ (i : ι), CategoryTheory.Limits.HasBinaryBiproduct (K.X i) (L.X i)]

CategoryTheory.Limits.biprod.inr.f i ≫ CategoryTheory.Limits.biprod.snd.f i = 𝟙 (L.X i)


@[to_additive mem_addCenter_iff]
theorem mem_center_iff {z : M} : z ∈ center M ↔ IsMulCentral z


theorem smul_finset_symmDiff₀ (ha : a ≠ 0) : a • s ∆ t = (a • s) ∆ (a • t)

{α : Type u_2}
{β : Type u_3}
[DecidableEq β]
[GroupWithZero α]
[MulAction α β]
{s t : Finset β}
{a : α}
(ha : a ≠ 0)

a • symmDiff s t = symmDiff (a • s) (a • t)


theorem cons_right_injective (x₀ : α 0) : Function.Injective (cons x₀)

{n : ℕ}
{α : Fin (n + 1) → Type u}
(x₀ : α 0)


@[simp] theorem ite_self {α : Sort u} {c : Prop} {d : Decidable c} (a : α) : ite c a a = a


/-- If a function applied at a point is 1, a product is unchanged by
removing that point, if present, from a `Finset`. -/
@[to_additive "If a function applied at a point is 0, a sum is unchanged by
removing that point, if present, from a `Finset`."]
theorem prod_erase [DecidableEq α] (s : Finset α) {f : α → β} {a : α} (h : f a = 1) :
    ∏ x ∈ s.erase a, f x = ∏ x ∈ s, f x

{α : Type u_3}
{β : Type u_4}
[AddCommMonoid β]
[DecidableEq α]
(s : Finset α)
{f : α → β}
{a : α}
(h : f a = 0)


protected theorem le_of_lt {a b : Fin n} (h : a < b) : a ≤ b


theorem lintegral_ofReal_le_lintegral_nnnorm (f : α → ℝ) :
    ∫⁻ x, ENNReal.ofReal (f x) ∂μ ≤ ∫⁻ x, ‖f x‖₊ ∂μ

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

∫⁻ (x : α), ENNReal.ofReal (f x) ∂μ ≤ ∫⁻ (x : α), ↑‖f x‖₊ ∂μ


@[to_additive]
theorem Multipliable.countable_mulSupport [FirstCountableTopology G] [T1Space G]
    (hf : Multipliable f) : f.mulSupport.Countable

{α : Type u_1}
{G : Type u_5}
[TopologicalSpace G]
[AddCommGroup G]
[TopologicalAddGroup G]
{f : α → G}
[FirstCountableTopology G]
[T1Space G]
(hf : Summable f)


@[simp] theorem snd_zero : snd (0 : Measure (α × β)) = 0

{α : Type u_1}
{β : Type u_3}
[MeasurableSpace α]
[MeasurableSpace β]


theorem toList_append (l₁ l₂ : DList α) : toList (l₁ ++ l₂) = toList l₁ ++ toList l₂

{α : Type u}
(l₁ l₂ : Batteries.DList α)

(l₁ ++ l₂).toList = l₁.toList ++ l₂.toList


theorem of_prim {n} {f : Vector ℕ n → ℕ} (hf : Primrec f) : @Partrec' n f

{n : ℕ}
{f : Mathlib.Vector ℕ n → ℕ}
(hf : Primrec f)


/-- Sum with `IsEmpty` is equivalent to the original type. -/
@[simps symm_apply]
def sumEmpty (α β) [IsEmpty β] : α ⊕ β ≃ α

(α : Type u_1)
(β : Type u_2)
[IsEmpty β]
(val : α)

(Equiv.sumEmpty α β).symm val = Sum.inl val


theorem finite_option {s : Set (Option α)} : s.Finite ↔ { x : α | some x ∈ s }.Finite


/--
A linear endomorphism of a module `E` is a projection onto a submodule `p` if it sends every element
of `E` to `p` and fixes every element of `p`.
The definition allow more generally any `FunLike` type and not just linear maps, so that it can be
used for example with `ContinuousLinearMap` or `Matrix`.
-/
structure IsProj {F : Type*} [FunLike F M M] (f : F) : Prop where
  map_mem : ∀ x, f x ∈ m
  map_id : ∀ x ∈ m, f x = x

{S : Type u_5}
[Semiring S]
{M : Type u_6}
[AddCommMonoid M]
[Module S M]
{m : Submodule S M}
{F : Type u_7}
[FunLike F M M]
{f : F}
(self : LinearMap.IsProj m f)
(x : M)


@[simp]
theorem toFun_eq_coe (f : A →ₑ+[φ] B) : f.toFun = f

{M : Type u_1}
[Monoid M]
{N : Type u_2}
[Monoid N]
{φ : M →* N}
{A : Type u_4}
[AddMonoid A]
[DistribMulAction M A]
{B : Type u_5}
[AddMonoid B]
[DistribMulAction N B]
(f : A →ₑ+[φ] B)


theorem norm_natCast (n : ℕ) : ‖(n : ℝ)‖ = n


/-- Lagrange multipliers theorem: if `φ : E → ℝ` has a local extremum on the set `{x | f x = f x₀}`
at `x₀`, both `f : E → F` and `φ` are strictly differentiable at `x₀`, and the codomain of `f` is
a complete space, then the linear map `x ↦ (f' x, φ' x)` is not surjective. -/
theorem IsLocalExtrOn.range_ne_top_of_hasStrictFDerivAt
    (hextr : IsLocalExtrOn φ {x | f x = f x₀} x₀) (hf' : HasStrictFDerivAt f f' x₀)
    (hφ' : HasStrictFDerivAt φ φ' x₀) : LinearMap.range (f'.prod φ') ≠ ⊤


theorem round_le_add_half (x : α) : round x ≤ x + 1 / 2

{α : Type u_2}
[LinearOrderedField α]
[FloorRing α]
(x : α)


theorem coe_ae_eq_Icc : (I : Set (ι → ℝ)) =ᵐ[volume] Box.Icc I

{ι : Type u_1}
(I : BoxIntegral.Box ι)
[Fintype ι]

↑I =ᵐ[MeasureTheory.volume] BoxIntegral.Box.Icc I


theorem reverseAux_reverseAux (as bs cs : List α) : reverseAux (reverseAux as bs) cs = reverseAux bs (reverseAux (reverseAux as []) cs)

(as.reverseAux bs).reverseAux cs = bs.reverseAux ((as.reverseAux List.nil).reverseAux cs)


@[simp]
theorem cosh_neg : cosh (-x) = cosh x


/-- **First moment method**. The minimum of a measurable function is smaller than its mean. -/
theorem exists_le_setLaverage (hμ : μ s ≠ 0) (hμ₁ : μ s ≠ ∞) (hf : AEMeasurable f (μ.restrict s)) :
    ∃ x ∈ s, f x ≤ ⨍⁻ a in s, f a ∂μ

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s : Set α}
{f : α → ℝ≥0∞}
(hμ : μ s ≠ 0)
(hμ₁ : μ s ≠ ⊤)
(hf : AEMeasurable f (μ.restrict s))


theorem rnDeriv_smul (s : SignedMeasure α) (μ : Measure α) [s.HaveLebesgueDecomposition μ] (r : ℝ) :
    (r • s).rnDeriv μ =ᵐ[μ] r • s.rnDeriv μ

{α : Type u_1}
{m : MeasurableSpace α}
(s : MeasureTheory.SignedMeasure α)
(μ : MeasureTheory.Measure α)
[s.HaveLebesgueDecomposition μ]
(r : ℝ)


/-- Given a "tulip" of morphisms
```
 j₁    j₂    j₃
 |\   / \   / |
 | \ /   \ /  |
 |  vv    vv  |
 \  k₁    k₂ /
  \         /
   \       /
    \     /
     \   /
      v v
       l
```
in a filtered category, we can construct an object `s` and three morphisms from `k₁`, `k₂` and `l`
to `s`, making the resulting squares commute.
-/
theorem tulip {j₁ j₂ j₃ k₁ k₂ l : C} (f₁ : j₁ ⟶ k₁) (f₂ : j₂ ⟶ k₁) (f₃ : j₂ ⟶ k₂) (f₄ : j₃ ⟶ k₂)
    (g₁ : j₁ ⟶ l) (g₂ : j₃ ⟶ l) :
    ∃ (s : C) (α : k₁ ⟶ s) (β : l ⟶ s) (γ : k₂ ⟶ s),
      f₁ ≫ α = g₁ ≫ β ∧ f₂ ≫ α = f₃ ≫ γ ∧ f₄ ≫ γ = g₂ ≫ β

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.IsFilteredOrEmpty C]
{j₁ j₂ j₃ k₁ k₂ l : C}
(f₁ : j₁ ⟶ k₁)
(f₂ : j₂ ⟶ k₁)
(f₃ : j₂ ⟶ k₂)
(f₄ : j₃ ⟶ k₂)
(g₁ : j₁ ⟶ l)
(g₂ : j₃ ⟶ l)

∃ s α β γ,
  CategoryTheory.CategoryStruct.comp f₁ α = CategoryTheory.CategoryStruct.comp g₁ β ∧
    CategoryTheory.CategoryStruct.comp f₂ α = CategoryTheory.CategoryStruct.comp f₃ γ ∧
      CategoryTheory.CategoryStruct.comp f₄ γ = CategoryTheory.CategoryStruct.comp g₂ β


theorem nfpBFamily_le_iff {o : Ordinal} {f : ∀ b < o, Ordinal → Ordinal} {a b} :
    nfpBFamily.{u, v} o f a ≤ b ↔ ∀ l, List.foldr (familyOfBFamily o f) a l ≤ b

{f : (b : Ordinal.{u}) → b < o → Ordinal.{max u v} → Ordinal.{max u v}}

o.nfpBFamily f a ≤ b ↔ ∀ (l : List (Quotient.out o).α), List.foldr (o.familyOfBFamily f) a l ≤ b


theorem inseparable_iff_forall_open : (x ~ᵢ y) ↔ ∀ s : Set X, IsOpen s → (x ∈ s ↔ y ∈ s)

{X : Type u_1}
[TopologicalSpace X]
{x y : X}

(x ~ᵢ y) ↔ ∀ (s : Set X), IsOpen s → (x ∈ s ↔ y ∈ s)


/-- A homeomorphism induces an equivalence on compact sets, by taking the image. -/
@[simps]
protected def equiv (f : α ≃ₜ β) : Compacts α ≃ Compacts β

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
(f : α ≃ₜ β)
(K : TopologicalSpace.Compacts α)

(TopologicalSpace.Compacts.equiv f) K = TopologicalSpace.Compacts.map ⇑f ⋯ K


/-- `WithLp.equiv` bundled as an algebra isomorphism with `Unitization 𝕜 A`. -/
@[simps!]
def unitizationAlgEquiv (R : Type*) [CommSemiring R] [Algebra R 𝕜] [DistribMulAction R A]
    [IsScalarTower R 𝕜 A] : WithLp 1 (Unitization 𝕜 A) ≃ₐ[R] Unitization 𝕜 A

{𝕜 : Type u_1}
{A : Type u_2}
[NormedField 𝕜]
[NonUnitalNormedRing A]
[NormedSpace 𝕜 A]
[IsScalarTower 𝕜 A A]
[SMulCommClass 𝕜 A A]
(R : Type u_3)
[CommSemiring R]
[Algebra R 𝕜]
[DistribMulAction R A]
[IsScalarTower R 𝕜 A]
(a : WithLp 1 (Unitization 𝕜 A))


theorem toPartENat_mono {c c' : Cardinal} (h : c ≤ c') :
    toPartENat c ≤ toPartENat c'

Cardinal.toPartENat c ≤ Cardinal.toPartENat c'


protected theorem add_lt_add_iff_left {x y z : PartENat} (hz : z ≠ ⊤) : z + x < z + y ↔ x < y


lemma commSq (sq : Square C) : CommSq sq.f₁₂ sq.f₁₃ sq.f₂₄ sq.f₃₄

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

CategoryTheory.CommSq sq.f₁₂ sq.f₁₃ sq.f₂₄ sq.f₃₄


@[to_additive]
theorem prod_eq_prod_iff_of_le {f g : ι → M} (h : ∀ i ∈ s, f i ≤ g i) :
    ((∏ i ∈ s, f i) = ∏ i ∈ s, g i) ↔ ∀ i ∈ s, f i = g i

{ι : Type u_1}
{M : Type u_4}
[OrderedCancelAddCommMonoid M]
{s : Finset ι}
{f g : ι → M}
(h : ∀ i ∈ s, f i ≤ g i)

∑ i ∈ s, f i = ∑ i ∈ s, g i ↔ ∀ i ∈ s, f i = g i


/-- Left unitor as a natural isomorphism. -/
@[simps!]
def leftUnitorNatIso (a b : B) : (precomposing _ _ b).obj (𝟙 a) ≅ 𝟭 (a ⟶ b)

{B : Type u}
[CategoryTheory.Bicategory B]
(a b : B)
(X : a ⟶ b)

(CategoryTheory.Bicategory.leftUnitorNatIso a b).inv.app X = (CategoryTheory.Bicategory.leftUnitor X).inv


theorem toTopologicalSpace_injective :
    Injective (toTopologicalSpace : RingTopology α → TopologicalSpace α)


/-- **Hölder inequality**: the scalar product of two functions is bounded by the product of their
`L^p` and `L^q` norms when `p` and `q` are conjugate exponents. A version for `ℝ`-valued functions.
For an alternative version, convenient if the infinite sums are already expressed as `p`-th powers,
see `inner_le_Lp_mul_Lq_hasSum_of_nonneg`. -/
theorem inner_le_Lp_mul_Lq_tsum_of_nonneg (hpq : p.IsConjExponent q) (hf : ∀ i, 0 ≤ f i)
    (hg : ∀ i, 0 ≤ g i) (hf_sum : Summable fun i => f i ^ p) (hg_sum : Summable fun i => g i ^ q) :
    (Summable fun i => f i * g i) ∧
      ∑' i, f i * g i ≤ (∑' i, f i ^ p) ^ (1 / p) * (∑' i, g i ^ q) ^ (1 / q)

{ι : Type u}
{f g : ι → ℝ}
{p q : ℝ}
(hpq : p.IsConjExponent q)
(hf : ∀ (i : ι), 0 ≤ f i)
(hg : ∀ (i : ι), 0 ≤ g i)
(hf_sum : Summable fun i => f i ^ p)
(hg_sum : Summable fun i => g i ^ q)

(Summable fun i => f i * g i) ∧
  ∑' (i : ι), f i * g i ≤ (∑' (i : ι), f i ^ p) ^ (1 / p) * (∑' (i : ι), g i ^ q) ^ (1 / q)


lemma CompleteOrthogonalIdempotents.map :
    CompleteOrthogonalIdempotents (f ∘ e)

{R : Type u_1}
{S : Type u_2}
[Ring R]
[Ring S]
(f : R →+* S)
{I : Type u_3}
{e : I → R}
[Fintype I]
(he : CompleteOrthogonalIdempotents e)


theorem rank_zero_iff_forall_zero :
    Module.rank R M = 0 ↔ ∀ x : M, x = 0

{R : Type u}
{M : Type v}
[Ring R]
[AddCommGroup M]
[Module R M]
[Nontrivial R]
[NoZeroSMulDivisors R M]


@[to_additive (attr := simp)]
theorem OneHom.comp_id [One M] [One N] (f : OneHom M N) : f.comp (OneHom.id M) = f

{M : Type u_4}
{N : Type u_5}
[Zero M]
[Zero N]
(f : ZeroHom M N)


theorem nextCoeff_mul (hp : Monic p) (hq : Monic q) :
    nextCoeff (p * q) = nextCoeff p + nextCoeff q

{R : Type u}
[Semiring R]
{p q : R[X]}
(hp : p.Monic)
(hq : q.Monic)

(p * q).nextCoeff = p.nextCoeff + q.nextCoeff


theorem nodup_bind {l₁ : List α} {f : α → List β} :
    Nodup (l₁.bind f) ↔
      (∀ x ∈ l₁, Nodup (f x)) ∧ Pairwise (fun a b : α => Disjoint (f a) (f b)) l₁

{α : Type u}
{β : Type v}
{l₁ : List α}
{f : α → List β}

(l₁.bind f).Nodup ↔ (∀ x ∈ l₁, (f x).Nodup) ∧ List.Pairwise (fun a b => (f a).Disjoint (f b)) l₁


theorem prefix_concat (a : α) (l) : l <+: concat l a


theorem inter_eq_self_of_subset_right {s t : Set α} : t ⊆ s → s ∩ t = t


@[to_additive (attr := simp)]
theorem one_bind (f : α → FreeGroup β) : 1 >>= f = 1


@[simp]
theorem basicOpen_pow (f : A) (n : ℕ) (hn : 0 < n) : basicOpen 𝒜 (f ^ n) = basicOpen 𝒜 f

{R : Type u_1}
{A : Type u_2}
[CommSemiring R]
[CommRing A]
[Algebra R A]
(𝒜 : ℕ → Submodule R A)
[GradedAlgebra 𝒜]
(f : A)
(n : ℕ)
(hn : 0 < n)

ProjectiveSpectrum.basicOpen 𝒜 (f ^ n) = ProjectiveSpectrum.basicOpen 𝒜 f


@[simp] lemma snocCases_snoc
    {P : (∀ i : Fin (n+1), α i) → Sort*} (h : ∀ x x₀, P (Fin.snoc x x₀))
    (x : ∀ i : Fin n, (Fin.init α) i) (x₀ : α (Fin.last _)) :
    snocCases h (Fin.snoc x x₀) = h x x₀

{P : ((i : Fin (n + 1)) → α i) → Sort u_1}

(h : (x : (i : Fin n) → α i.castSucc) → (x₀ : α (Fin.last n)) → P (Fin.snoc x x₀))

Fin.snocCases h (Fin.snoc x x₀) = h x x₀


/-- The tangent of an angle in a right-angled triangle as a ratio of sides. -/
theorem tan_oangle_add_left_of_oangle_eq_pi_div_two {x y : V} (h : o.oangle x y = ↑(π / 2)) :
    Real.Angle.tan (o.oangle (x + y) y) = ‖x‖ / ‖y‖

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


@[simp]
lemma Ψ_four : W.Ψ 4 = C W.preΨ₄ * W.ψ₂

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


theorem powerset_card_disjiUnion (s : Finset α) :
    Finset.powerset s =
      (range (s.card + 1)).disjiUnion (fun i => powersetCard i s)
        (s.pairwise_disjoint_powersetCard.set_pairwise _)

s.powerset = (Finset.range (s.card + 1)).disjiUnion (fun i => Finset.powersetCard i s) ⋯


@[to_additive]
theorem mulIndicator_of_mem (hU : IsClopen U) (h : a ∈ U) : f.mulIndicator hU a = f a

{X : Type u_1}
[TopologicalSpace X]
{R : Type u_5}
[One R]
{U : Set X}
(f : LocallyConstant X R)
{a : X}
(hU : IsClopen U)
(h : a ∈ U)


@[to_additive]
theorem Submonoid.isClosed_topologicalClosure (s : Submonoid M) :
    IsClosed (s.topologicalClosure : Set M)

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


/-- A natural isomorphism `L₁ ≅ L₂` induces an equivalence of categories
    `Comma L₁ R ≌ Comma L₂ R`. -/
@[simps!]
def mapLeftIso (i : L₁ ≅ L₂) : Comma L₁ R ≌ Comma L₂ R

{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₂ : CategoryTheory.Functor A T}
(i : L₁ ≅ L₂)
(X : CategoryTheory.Comma L₂ R)

((CategoryTheory.Comma.mapLeftIso R i).inverse.obj X).hom = CategoryTheory.CategoryStruct.comp (i.hom.app X.left) X.hom


theorem inf_sdiff_distrib_left (a b c : α) : a ⊓ b \ c = (a ⊓ b) \ (a ⊓ c)

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


theorem bihimp_eq : a ⇔ b = (a ⊔ bᶜ) ⊓ (b ⊔ aᶜ)

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


theorem aecover_Icc_of_Ioc (ha : Tendsto a l (𝓝 A)) (hb : Tendsto b l (𝓝 B)) :
    AECover (μ.restrict <| Icc A B) l fun i => Ioc (a i) (b i)

{α : Type u_1}
{ι : Type u_2}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
{l : Filter ι}
[LinearOrder α]
[TopologicalSpace α]
[OrderClosedTopology α]
[OpensMeasurableSpace α]
{a b : ι → α}
{A B : α}
[MeasureTheory.NoAtoms μ]
(ha : Filter.Tendsto a l (𝓝 A))
(hb : Filter.Tendsto b l (𝓝 B))

MeasureTheory.AECover (μ.restrict (Set.Icc A B)) l fun i => Set.Ioc (a i) (b i)


protected theorem continuousAt : ContinuousAt smoothTransition x


theorem surjOn_iUnion_iUnion {s : ι → Set α} {t : ι → Set β} {f : α → β}
    (H : ∀ i, SurjOn f (s i) (t i)) : SurjOn f (⋃ i, s i) (⋃ i, t i)

(H : ∀ (i : ι), Set.SurjOn f (s i) (t i))


theorem sub_mem_ball (p : Seminorm 𝕜 E) (x₁ x₂ y : E) (r : ℝ) :
    x₁ - x₂ ∈ p.ball y r ↔ x₁ ∈ p.ball (x₂ + y) r

{𝕜 : Type u_3}
{E : Type u_7}
[SeminormedRing 𝕜]
[AddCommGroup E]
[SMul 𝕜 E]
(p : Seminorm 𝕜 E)
(x₁ x₂ y : E)
(r : ℝ)


@[simp] theorem rotateRight_replicate (n) (a : α) : rotateRight (replicate m a) n = replicate m a

{α : Type u_1}
{m : Nat}
(n : Nat)
(a : α)

(List.replicate m a).rotateRight n = List.replicate m a


theorem lapMatrix_mulVec_apply [NonAssocRing R] (v : V) (vec : V → R) :
    (G.lapMatrix R *ᵥ vec) v = G.degree v * vec v - ∑ u ∈ G.neighborFinset v, vec u

{V : Type u_1}
{R : Type u_2}
[Fintype V]
[DecidableEq V]
(G : SimpleGraph V)
[DecidableRel G.Adj]
[NonAssocRing R]
(v : V)
(vec : V → R)

(SimpleGraph.lapMatrix R G *ᵥ vec) v = ↑(G.degree v) * vec v - ∑ u ∈ G.neighborFinset v, vec u


/-- **Harris-Kleitman inequality**: Lower sets and upper sets of finsets anticorrelate. -/
theorem IsLowerSet.card_inter_le_finset (h𝒜 : IsLowerSet (𝒜 : Set (Finset α)))
    (hℬ : IsUpperSet (ℬ : Set (Finset α))) :
    2 ^ Fintype.card α * (𝒜 ∩ ℬ).card ≤ 𝒜.card * ℬ.card

{α : Type u_1}
[DecidableEq α]
{𝒜 ℬ : Finset (Finset α)}
[Fintype α]
(h𝒜 : IsLowerSet ↑𝒜)
(hℬ : IsUpperSet ↑ℬ)


theorem mk₂ (h: ∀ ⦃s⦄, s ∈ S → ∀ ⦃t⦄, t ∈ S → s ∩ t ∈ S) :
    FiniteInter (insert (univ : Set α) S)

(h : ∀ ⦃s : Set α⦄, s ∈ S → ∀ ⦃t : Set α⦄, t ∈ S → s ∩ t ∈ S)


theorem fastGrowing_succ (o) {a} (h : fundamentalSequence o = Sum.inl (some a)) :
    fastGrowing o = fun i => (fastGrowing a)^[i] i

(h : o.fundamentalSequence = Sum.inl (some a))

o.fastGrowing = fun i => a.fastGrowing^[i] i


protected theorem le_of_add_le_add_left {a b c : Int} (h : a + b ≤ a + c) : b ≤ c


theorem aeval_endomorphism {M : Type*} [CommRing R] [AddCommGroup M] [Module R M] (f : M →ₗ[R] M)
    (v : M) (p : R[X]) : aeval f p v = p.sum fun n b => b • (f ^ n) v

{R : Type u}
{M : Type u_3}
[CommRing R]
[AddCommGroup M]
[Module R M]
(f : M →ₗ[R] M)
(v : M)
(p : R[X])

((Polynomial.aeval f) p) v = p.sum fun n b => b • (f ^ n) v


theorem isOrtho_zero_left (B : M₁ →ₛₗ[I₁] M₂ →ₛₗ[I₂] M) (x) : IsOrtho B (0 : M₁) x

{R : Type u_1}
{R₁ : Type u_2}
{R₂ : Type u_3}
{M : Type u_5}
{M₁ : Type u_6}
{M₂ : Type u_7}
[CommSemiring R]
[CommSemiring R₁]
[AddCommMonoid M₁]
[Module R₁ M₁]
[CommSemiring R₂]
[AddCommMonoid M₂]
[Module R₂ M₂]
[AddCommMonoid M]
[Module R M]
{I₁ : R₁ →+* R}
{I₂ : R₂ →+* R}
(B : M₁ →ₛₗ[I₁] M₂ →ₛₗ[I₂] M)
(x : M₂)


theorem isMulOneCoboundary_of_oneCoboundaries
    (f : oneCoboundaries (Rep.ofMulDistribMulAction G M)) :
    IsMulOneCoboundary (M := M) (Additive.ofMul ∘ f.1.1)

(f : ↥(groupCohomology.oneCoboundaries (Rep.ofMulDistribMulAction G M)))

groupCohomology.IsMulOneCoboundary (⇑Additive.ofMul ∘ ↑↑f)


/-- An intermediate field is closed under subtraction -/
protected theorem sub_mem {x y : L} : x ∈ S → y ∈ S → x - y ∈ S

{K : Type u_1}
{L : Type u_2}
[Field K]
[Field L]
[Algebra K L]
(S : IntermediateField K L)
{x y : L}


/-- The functor `C ⥤ Triangle C` which sends `X` to `contractibleTriangle X`. -/
@[simps]
def contractibleTriangleFunctor [HasZeroObject C] [HasZeroMorphisms C] : C ⥤ Triangle C

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


theorem principal_mul_omega : Principal (· * ·) omega

Ordinal.Principal (fun x x_1 => x * x_1) Ordinal.omega


theorem equivalence₁UnitIso_eq : (equivalence₁ hF).unitIso = equivalence₁UnitIso hF

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

(AlgebraicTopology.DoldKan.Compatibility.equivalence₁ hF).unitIso =
  AlgebraicTopology.DoldKan.Compatibility.equivalence₁UnitIso hF


@[reassoc]
lemma ιMapBifunctor₁₂BifunctorMapObj_eq (i₁ : I₁) (i₂ : I₂) (i₃ : I₃) (j : J)
    (h : r (i₁, i₂, i₃) = j) (i₁₂ : ρ₁₂.I₁₂) (h₁₂ : ρ₁₂.p ⟨i₁, i₂⟩ = i₁₂) :
    ιMapBifunctor₁₂BifunctorMapObj F₁₂ G ρ₁₂ X₁ X₂ X₃ i₁ i₂ i₃ j h =
      (G.map (ιMapBifunctorMapObj F₁₂ ρ₁₂.p X₁ X₂ i₁ i₂ i₁₂ h₁₂)).app (X₃ i₃) ≫
    ιMapBifunctorMapObj G ρ₁₂.q (mapBifunctorMapObj F₁₂ ρ₁₂.p X₁ X₂) X₃ i₁₂ i₃ j
      (by rw [← h₁₂, ← h, ← ρ₁₂.hpq])

(F₁₂ : CategoryTheory.Functor C₁ (CategoryTheory.Functor C₂ C₁₂))

(G : CategoryTheory.Functor C₁₂ (CategoryTheory.Functor C₃ C₄))

(ρ₁₂ : CategoryTheory.GradedObject.BifunctorComp₁₂IndexData r)

(X₁ : CategoryTheory.GradedObject I₁ C₁)

(X₂ : CategoryTheory.GradedObject I₂ C₂)

(X₃ : CategoryTheory.GradedObject I₃ C₃)

[(((CategoryTheory.GradedObject.mapBifunctor F₁₂ I₁ I₂).obj X₁).obj X₂).HasMap ρ₁₂.p]

[(((CategoryTheory.GradedObject.mapBifunctor G ρ₁₂.I₁₂ I₃).obj
            (CategoryTheory.GradedObject.mapBifunctorMapObj F₁₂ ρ₁₂.p X₁ X₂)).obj
        X₃).HasMap
    ρ₁₂.q]

(i₁₂ : ρ₁₂.I₁₂)

CategoryTheory.GradedObject.ιMapBifunctor₁₂BifunctorMapObj F₁₂ G ρ₁₂ X₁ X₂ X₃ i₁ i₂ i₃ j h =
  CategoryTheory.CategoryStruct.comp
    ((G.map (CategoryTheory.GradedObject.ιMapBifunctorMapObj F₁₂ ρ₁₂.p X₁ X₂ i₁ i₂ i₁₂ h₁₂)).app (X₃ i₃))
    (CategoryTheory.GradedObject.ιMapBifunctorMapObj G ρ₁₂.q
      (CategoryTheory.GradedObject.mapBifunctorMapObj F₁₂ ρ₁₂.p X₁ X₂) X₃ i₁₂ i₃ j ⋯)


@[instance]
theorem ordConnected_uIoc {a b : α} : OrdConnected (Ι a b)

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


@[simp]
theorem toRingHom_refl : (RingEquiv.refl R).toRingHom = RingHom.id R


/-- Normalization monoid: multiplying with `normUnit` gives a normal form for associated
elements. -/
class NormalizationMonoid (α : Type*) [CancelCommMonoidWithZero α] where
  /-- `normUnit` assigns to each element of the monoid a unit of the monoid. -/
  normUnit : α → αˣ
  /-- The proposition that `normUnit` maps `0` to the identity. -/
  normUnit_zero : normUnit 0 = 1
  /-- The proposition that `normUnit` respects multiplication of non-zero elements. -/
  normUnit_mul : ∀ {a b}, a ≠ 0 → b ≠ 0 → normUnit (a * b) = normUnit a * normUnit b
  /-- The proposition that `normUnit` maps units to their inverses. -/
  normUnit_coe_units : ∀ u : αˣ, normUnit u = u⁻¹

{α : Type u_2}
[CancelCommMonoidWithZero α]
[self : NormalizationMonoid α]


theorem measurable_swap_iff {_ : MeasurableSpace γ} {f : α × β → γ} :
    Measurable (f ∘ Prod.swap) ↔ Measurable f

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

∀ {x : MeasurableSpace γ} {f : α × β → γ}, Measurable (f ∘ Prod.swap) ↔ Measurable f


lemma snd_prodMkLeft (δ : Type*) [MeasurableSpace δ] (κ : Kernel α (β × γ)) :
    snd (prodMkLeft δ κ) = prodMkLeft δ (snd κ)

(κ : ProbabilityTheory.Kernel α (β × γ))

(ProbabilityTheory.Kernel.prodMkLeft δ κ).snd = ProbabilityTheory.Kernel.prodMkLeft δ κ.snd


@[simp]
lemma coe_toLinearMap_one : (↑(1 : M ≃ₗ[R] M) : M →ₗ[R] M) = LinearMap.id

{R : Type u_1}
{M : Type u_8}
[Semiring R]
[AddCommMonoid M]
[Module R M]


/--
A finite product preserving presheaf is a sheaf for the extensive topology on a category which is
`FinitaryPreExtensive`.
-/
theorem isSheafFor_extensive_of_preservesFiniteProducts {X : C} (S : Presieve X) [S.Extensive]
    (F : Cᵒᵖ ⥤ Type w) [PreservesFiniteProducts F] : S.IsSheafFor F

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


@[to_additive]
protected lemma div_mul_left (h : IsUnit b) : b / (a * b) = 1 / a

{α : Type u}
[SubtractionMonoid α]
{a b : α}
(h : IsAddUnit b)


theorem lintegral_biUnion_finset₀ {s : Finset β} {t : β → Set α}
    (hd : Set.Pairwise (↑s) (AEDisjoint μ on t)) (hm : ∀ b ∈ s, NullMeasurableSet (t b) μ)
    (f : α → ℝ≥0∞) : ∫⁻ a in ⋃ b ∈ s, t b, f a ∂μ = ∑ b ∈ s, ∫⁻ a in t b, f a ∂μ

(hd : (↑s).Pairwise (MeasureTheory.AEDisjoint μ on t))

(hm : ∀ b ∈ s, MeasureTheory.NullMeasurableSet (t b) μ)

(f : α → ℝ≥0∞)

∫⁻ (a : α) in ⋃ b ∈ s, t b, f a ∂μ = ∑ b ∈ s, ∫⁻ (a : α) in t b, f a ∂μ


/-- The restriction natural transformation on presheaves of modules, considered as linear maps
to restriction of scalars. -/
@[simps]
noncomputable def restriction {X Y : Cᵒᵖ} (f : X ⟶ Y) :
    evaluation R X ⟶ evaluation R Y ⋙ ModuleCat.restrictScalars (R.map f)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
(R : Cᵒᵖ ⥤ RingCat)
{X Y : Cᵒᵖ}
(f : X ⟶ Y)
(M : PresheafOfModules R)

(PresheafOfModules.restriction R f).app M = PresheafOfModules.restrictionApp f M


@[simp, reassoc]
theorem comp_explicitCokernelπ {X Y : SemiNormedGrp.{u}} (f : X ⟶ Y) :
    f ≫ explicitCokernelπ f = 0

f ≫ SemiNormedGrp.explicitCokernelπ f = 0


theorem inter_subset_right {l₁ l₂ : List α} : l₁ ∩ l₂ ⊆ l₂

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

l₁ ∩ l₂ ⊆ l₂


theorem lintegral_nnnorm_condexpL2_le (hs : MeasurableSet[m] s) (hμs : μ s ≠ ∞) (f : Lp ℝ 2 μ) :
    ∫⁻ x in s, ‖(condexpL2 ℝ ℝ hm f : α → ℝ) x‖₊ ∂μ ≤ ∫⁻ x in s, ‖f x‖₊ ∂μ

{α : Type u_1}
{m m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s : Set α}
{hm : m ≤ m0}
(hs : MeasurableSet s)
(hμs : μ s ≠ ⊤)
(f : ↥(MeasureTheory.Lp ℝ 2 μ))

∫⁻ (x : α) in s, ↑‖↑↑↑((MeasureTheory.condexpL2 ℝ ℝ hm) f) x‖₊ ∂μ ≤ ∫⁻ (x : α) in s, ↑‖↑↑f x‖₊ ∂μ


lemma Scheme.map_basicOpen_map (r : Γ(X, U)) :
    U.ι ''ᵁ (U.toScheme.basicOpen <| U.topIso.inv r) = X.basicOpen r

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

(AlgebraicGeometry.Scheme.Hom.opensFunctor U.ι).obj ((↑U).basicOpen (U.topIso.inv r)) = X.basicOpen r


theorem _root_.Set.LeftInvOn.rightInvOn_image (h : LeftInvOn f' f s) : RightInvOn f' f (f '' s)

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


@[simp, norm_cast]
theorem coe_sdiff (a b : Regular α) : (↑(a \ b) : α) = (a : α) ⊓ bᶜ

{α : Type u_1}
[HeytingAlgebra α]
(a b : Heyting.Regular α)


/-- The Bochner integral is a.e.-measurable.
  This shows that the integrand of (the right-hand-side of) Fubini's theorem is a.e.-measurable. -/
theorem MeasureTheory.AEStronglyMeasurable.integral_prod_right' [SFinite ν] [NormedSpace ℝ E]
    ⦃f : α × β → E⦄ (hf : AEStronglyMeasurable f (μ.prod ν)) :
    AEStronglyMeasurable (fun x => ∫ y, f (x, y) ∂ν) μ

⦃f : α × β → E⦄

(hf : MeasureTheory.AEStronglyMeasurable f (μ.prod ν))

MeasureTheory.AEStronglyMeasurable (fun x => ∫ (y : β), f (x, y) ∂ν) μ


@[simp]
theorem coyonedaPairing_map (P Q : C × (C ⥤ Type v₁)) (α : P ⟶ Q) (β : (coyonedaPairing C).obj P) :
    (coyonedaPairing C).map α β = coyoneda.map α.1.op ≫ β ≫ α.2

(P Q : C × CategoryTheory.Functor C (Type v₁))

(β : (CategoryTheory.coyonedaPairing C).obj P)

(CategoryTheory.coyonedaPairing C).map α β =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.coyoneda.map α.1.op) (CategoryTheory.CategoryStruct.comp β α.2)


/-- Every functor out of the walking pair is naturally isomorphic (actually, equal) to a `pair` -/
@[simps!]
def diagramIsoPair (F : Discrete WalkingPair ⥤ C) :
    F ≅ pair (F.obj ⟨WalkingPair.left⟩) (F.obj ⟨WalkingPair.right⟩)

(F : CategoryTheory.Discrete CategoryTheory.Limits.WalkingPair ⥤ C)

(X : CategoryTheory.Discrete CategoryTheory.Limits.WalkingPair)

(CategoryTheory.Limits.diagramIsoPair F).hom.app X =
  (CategoryTheory.Limits.WalkingPair.rec
      (CategoryTheory.Iso.refl (F.obj { as := CategoryTheory.Limits.WalkingPair.left }))
      (CategoryTheory.Iso.refl (F.obj { as := CategoryTheory.Limits.WalkingPair.right })) X.as).hom


theorem span_singleton_mul_left_mono [IsDomain R] {x : R} (hx : x ≠ 0) :
    I * span {x} ≤ J * span {x} ↔ I ≤ J

{R : Type u}
[CommSemiring R]
{I J : Ideal R}
[IsDomain R]
{x : R}
(hx : x ≠ 0)

I * Ideal.span {x} ≤ J * Ideal.span {x} ↔ I ≤ J


@[simp]
theorem div_self_of_invertible (a : α) [Invertible a] : a / a = 1

{α : Type u}
[GroupWithZero α]
(a : α)
[Invertible a]


@[to_additive (attr := simp)]
theorem units_val_iff {a x y : Mˣ} : SemiconjBy (a : M) x y ↔ SemiconjBy a x y

{M : Type u_1}
[AddMonoid M]
{a x y : AddUnits M}

AddSemiconjBy ↑a ↑x ↑y ↔ AddSemiconjBy a x y


theorem nodup_iff_count_le_one [DecidableEq α] {l : List α} : Nodup l ↔ ∀ a, count a l ≤ 1

{α : Type u}
[DecidableEq α]
{l : List α}


theorem Wbtw.dist_add_dist {x y z : P} (h : Wbtw ℝ x y z) :
    dist x y + dist y z = dist x z

{E : Type u_2}
{P : Type u_3}
[SeminormedAddCommGroup E]
[NormedSpace ℝ E]
[PseudoMetricSpace P]
[NormedAddTorsor E P]
{x y z : P}
(h : Wbtw ℝ x y z)


@[to_additive]
theorem copy_eq {s : Set M} (hs : s = S) : S.copy s hs = S

{M : Type u_1}
[Mul M]
{S : Subsemigroup M}
{s : Set M}
(hs : s = ↑S)


/-- A graded version of `DistribMulAction`. -/
class GdistribMulAction [AddMonoid ιA] [VAdd ιA ιB] [GMonoid A] [∀ i, AddMonoid (M i)]
    extends GMulAction A M where
  smul_add {i j} (a : A i) (b c : M j) : smul a (b + c) = smul a b + smul a c
  smul_zero {i j} (a : A i) : smul a (0 : M j) = 0

[self : DirectSum.GdistribMulAction A M]


theorem Sum.one_le_dist_inl_inr {x : X} {y : Y} : 1 ≤ Sum.dist (.inl x) (.inr y)

{X : Type u}
{Y : Type v}
[MetricSpace X]
[MetricSpace Y]
{x : X}
{y : Y}

1 ≤ Metric.Sum.dist (Sum.inl x) (Sum.inr y)


theorem fineSubfamilyOn_of_frequently (v : VitaliFamily μ) (f : α → Set (Set α)) (s : Set α)
    (h : ∀ x ∈ s, ∃ᶠ a in v.filterAt x, a ∈ f x) : v.FineSubfamilyOn f s

(h : ∀ x ∈ s, ∃ᶠ (a : Set α) in v.filterAt x, a ∈ f x)


theorem eventually_forall_le_dist_cast_div_of_denom_le (hx : Irrational x) (n : ℕ) :
    ∀ᶠ ε : ℝ in 𝓝 0, ∀ k ≤ n, ∀ (m : ℤ), ε ≤ dist x (m / k)

∀ᶠ (ε : ℝ) in 𝓝 0, ∀ k ≤ n, ∀ (m : ℤ), ε ≤ dist x (↑m / ↑k)


theorem toPrenex_isPrenex (φ : L.BoundedFormula α n) : φ.toPrenex.IsPrenex

{L : FirstOrder.Language}
{α : Type u'}
{n : ℕ}
(φ : L.BoundedFormula α n)


/-- The slit plane is star-shaped at `1`. -/
lemma starConvex_one_slitPlane : StarConvex ℝ 1 slitPlane


/-- The complement to a compact set belongs to a filter `f` if each `x ∈ s` has a neighborhood `t`
within `s` such that `tᶜ` belongs to `f`. -/
theorem IsCompact.compl_mem_sets_of_nhdsWithin (hs : IsCompact s) {f : Filter X}
    (hf : ∀ x ∈ s, ∃ t ∈ 𝓝[s] x, tᶜ ∈ f) : sᶜ ∈ f

{X : Type u}
[TopologicalSpace X]
{s : Set X}
(hs : IsCompact s)
{f : Filter X}
(hf : ∀ x ∈ s, ∃ t ∈ 𝓝[s] x, tᶜ ∈ f)


@[to_additive]
theorem relindex_le_of_le_left (hHK : H ≤ K) (hHL : H.relindex L ≠ 0) :
    K.relindex L ≤ H.relindex L

{G : Type u_1}
[AddGroup G]
{H K L : AddSubgroup G}
(hHK : H ≤ K)
(hHL : H.relindex L ≠ 0)


/-- If the images by an order embedding of two elements are disjoint,
then they are themselves disjoint. -/
lemma Disjoint.of_orderEmbedding [OrderBot α] [OrderBot β] {a₁ a₂ : α} :
    Disjoint (f a₁) (f a₂) → Disjoint a₁ a₂

{α : Type u_2}
{β : Type u_3}
[PartialOrder α]
[PartialOrder β]
(f : α ↪o β)
[OrderBot α]
[OrderBot β]
{a₁ a₂ : α}


@[simp]
theorem sigmaLcurry_apply (f : ⨁ i : Σ_, _, δ i.1 i.2) (i : ι) (j : α i) :
    sigmaLcurry R f i j = f ⟨i, j⟩

[(i : ι) → (j : α i) → AddCommMonoid (δ i j)]

[(i : ι) → (j : α i) → Module R (δ i j)]

(f : DirectSum ((x : ι) × α x) fun i => δ i.fst i.snd)

(((DirectSum.sigmaLcurry R) f) i) j = f ⟨i, j⟩


/-- Submonoid closure of a set is monotone in its argument: if `s ⊆ t`,
then `closure s ≤ closure t`. -/
@[to_additive
      "Additive submonoid closure of a set is monotone in its argument: if `s ⊆ t`,
      then `closure s ≤ closure t`"]
theorem closure_mono ⦃s t : Set M⦄ (h : s ⊆ t) : closure s ≤ closure t

{M : Type u_1}
[MulOneClass M]
⦃s t : Set M⦄
(h : s ⊆ t)

Submonoid.closure s ≤ Submonoid.closure t


@[simp]
theorem preimage_bot (s : Set β) : (⊥ : Rel α β).preimage s = ∅

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


/-- Convert a `BinaryBicone` into a `Bicone` over a pair. -/
@[simps]
def toBiconeFunctor {X Y : C} : BinaryBicone X Y ⥤ Bicone (pairFunction X Y)

∀ {X_1 Y_1 : CategoryTheory.Limits.BinaryBicone X Y} (f : X_1 ⟶ Y_1),
  (CategoryTheory.Limits.BinaryBicone.toBiconeFunctor.map f).hom = f.hom


@[to_additive (attr := gcongr) nsmul_le_nsmul_left]
theorem pow_le_pow_right' {a : M} {n m : ℕ} (ha : 1 ≤ a) (h : n ≤ m) : a ^ n ≤ a ^ m

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


/-- A (non-commutative) Jordan multiplication. -/
class IsJordan [Mul A] : Prop where
  lmul_comm_rmul : ∀ a b : A, a * b * a = a * (b * a)
  lmul_lmul_comm_lmul : ∀ a b : A, a * a * (a * b) = a * (a * a * b)
  lmul_lmul_comm_rmul : ∀ a b : A, a * a * (b * a) = a * a * b * a
  lmul_comm_rmul_rmul : ∀ a b : A, a * b * (a * a) = a * (b * (a * a))
  rmul_comm_rmul_rmul : ∀ a b : A, b * a * (a * a) = b * (a * a) * a

{A : Type u_1}
[Mul A]
[self : IsJordan A]
(a b : A)


@[simp]
theorem lift₂_mk (f : α → β → γ) (hr : ∀ a b₁ b₂, s b₁ b₂ → f a b₁ = f a b₂)
    (hs : ∀ a₁ a₂ b, r a₁ a₂ → f a₁ b = f a₂ b)
    (a : α) (b : β) : Quot.lift₂ f hr hs (Quot.mk r a) (Quot.mk s b) = f a b

(f : α → β → γ)

(hr : ∀ (a : α) (b₁ b₂ : β), s b₁ b₂ → f a b₁ = f a b₂)

(hs : ∀ (a₁ a₂ : α) (b : β), r a₁ a₂ → f a₁ b = f a₂ b)


theorem not_lt_iff_eq (h : a ≤ b) : ¬a < b ↔ a = b

{α : Type u_2}
[PartialOrder α]
{a b : α}
(h : a ≤ b)


@[simp]
theorem distortion_toSubordinate (π : Prepartition I) (r : (ι → ℝ) → Ioi (0 : ℝ)) :
    (π.toSubordinate r).distortion = π.distortion

{ι : Type u_1}
[Fintype ι]
{I : BoxIntegral.Box ι}
(π : BoxIntegral.Prepartition I)
(r : (ι → ℝ) → ↑(Set.Ioi 0))


theorem _root_.Continuous.prod_map_equivL {f : X → M₁ ≃L[𝕜] M₂} {g : X → M₃ ≃L[𝕜] M₄}
    (hf : Continuous fun x => (f x : M₁ →L[𝕜] M₂)) (hg : Continuous fun x => (g x : M₃ →L[𝕜] M₄)) :
    Continuous fun x => ((f x).prod (g x) : M₁ × M₃ →L[𝕜] M₂ × M₄)

(𝕜 : Type u_1)
[NontriviallyNormedField 𝕜]
{M₁ : Type u_5}
{M₂ : Type u_6}
{M₃ : Type u_7}
{M₄ : Type u_8}
[SeminormedAddCommGroup M₁]
[NormedSpace 𝕜 M₁]
[SeminormedAddCommGroup M₂]
[NormedSpace 𝕜 M₂]
[SeminormedAddCommGroup M₃]
[NormedSpace 𝕜 M₃]
[SeminormedAddCommGroup M₄]
[NormedSpace 𝕜 M₄]
{X : Type u_9}
[TopologicalSpace X]
{f : X → M₁ ≃L[𝕜] M₂}
{g : X → M₃ ≃L[𝕜] M₄}
(hf : Continuous fun x => ↑(f x))
(hg : Continuous fun x => ↑(g x))


/-- Picard-Lindelöf (Cauchy-Lipschitz) theorem. Use
`IsPicardLindelof.exists_forall_hasDerivWithinAt_Icc_eq` instead for the public API. -/
theorem exists_solution :
    ∃ f : ℝ → E, f v.t₀ = v.x₀ ∧ ∀ t ∈ Icc v.tMin v.tMax,
      HasDerivWithinAt f (v t (f t)) (Icc v.tMin v.tMax) t

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

∃ f, f ↑v.t₀ = v.x₀ ∧ ∀ t ∈ Set.Icc v.tMin v.tMax, HasDerivWithinAt f (v.toFun t (f t)) (Set.Icc v.tMin v.tMax) t


theorem rpow_div_two_eq_sqrt {x : ℝ} (r : ℝ) (hx : 0 ≤ x) : x ^ (r / 2) = √x ^ r


theorem IsPreconnected.intermediate_value_Iio {s : Set X} (hs : IsPreconnected s) {l₁ l₂ : Filter X}
    [NeBot l₁] [NeBot l₂] (hl₁ : l₁ ≤ 𝓟 s) (hl₂ : l₂ ≤ 𝓟 s) {f : X → α} (hf : ContinuousOn f s)
    {v : α} (ht₁ : Tendsto f l₁ atBot) (ht₂ : Tendsto f l₂ (𝓝 v)) : Iio v ⊆ f '' s

(ht₁ : Filter.Tendsto f l₁ Filter.atBot)


theorem gc_map_comap : GaloisConnection (Ideal.map f) (Ideal.comap f)

{R : Type u}
{S : Type v}
{F : Type u_1}
[Semiring R]
[Semiring S]
[FunLike F R S]
[rc : RingHomClass F R S]
(f : F)


theorem eq_zero_of_ne_zero_of_mul_left_eq_zero [NoZeroDivisors M] {x y : M} (hnx : x ≠ 0)
    (hxy : x * y = 0) : y = 0

{M : Type u_2}
[MonoidWithZero M]
[NoZeroDivisors M]
{x y : M}
(hnx : x ≠ 0)
(hxy : x * y = 0)


@[simp]
theorem closure_diff_intrinsicFrontier (s : Set P) :
    closure s \ intrinsicFrontier 𝕜 s = intrinsicInterior 𝕜 s

{𝕜 : Type u_1}
{V : Type u_2}
{P : Type u_5}
[NontriviallyNormedField 𝕜]
[CompleteSpace 𝕜]
[NormedAddCommGroup V]
[NormedSpace 𝕜 V]
[FiniteDimensional 𝕜 V]
[MetricSpace P]
[NormedAddTorsor V P]
(s : Set P)


theorem mem_map_objs_iff (hφ : Function.Injective φ.obj) (d : D) :
    d ∈ (map φ hφ S).objs ↔ ∃ c ∈ S.objs, φ.obj c = d

{C : Type u}
[CategoryTheory.Groupoid C]
(S : CategoryTheory.Subgroupoid C)
{D : Type u_1}
[CategoryTheory.Groupoid D]
(φ : CategoryTheory.Functor C D)
(hφ : Function.Injective φ.obj)
(d : D)

d ∈ (CategoryTheory.Subgroupoid.map φ hφ S).objs ↔ ∃ c ∈ S.objs, φ.obj c = d


/-- The L-series of the von Mangoldt function `Λ` equals the negative logarithmic derivative
of the Riemann zeta function on its domain of convergence `re s > 1`. -/
lemma LSeries_vonMangoldt_eq_deriv_riemannZeta_div {s : ℂ} (hs : 1 < s.re) :
    L ↗Λ s = - deriv riemannZeta s / riemannZeta s

L (fun n => ↑(ArithmeticFunction.vonMangoldt n)) s = -deriv riemannZeta s / riemannZeta s


/-- Each function of a uniformly equicontinuous family is uniformly continuous. -/
theorem UniformEquicontinuous.uniformContinuous {F : ι → β → α} (h : UniformEquicontinuous F)
    (i : ι) : UniformContinuous (F i)

{ι : Type u_1}
{α : Type u_7}
{β : Type u_9}
[uα : UniformSpace α]
[uβ : UniformSpace β]
{F : ι → β → α}
(h : UniformEquicontinuous F)
(i : ι)


theorem lift_mk {N : Type*} [SeminormedAddCommGroup N] (S : AddSubgroup M)
    (f : NormedAddGroupHom M N) (hf : ∀ s ∈ S, f s = 0) (m : M) :
    lift S f hf (S.normedMk m) = f m

{M : Type u_1}
[SeminormedAddCommGroup M]
{N : Type u_3}
[SeminormedAddCommGroup N]
(S : AddSubgroup M)
(f : NormedAddGroupHom M N)
(hf : ∀ s ∈ S, f s = 0)
(m : M)

(NormedAddGroupHom.lift S f hf) (S.normedMk m) = f m


@[simp]
theorem mul_pos_iff_of_pos_left [PosMulStrictMono α] [PosMulReflectLT α] (h : 0 < a) :
    0 < a * b ↔ 0 < b

{α : Type u_1}
{a b : α}
[MulZeroClass α]
[Preorder α]
[PosMulStrictMono α]
[PosMulReflectLT α]
(h : 0 < a)


@[simp]
theorem sSup_eq_sup {ι : Type u} (f : ι → Ordinal.{max u v}) : sSup (Set.range f) = sup.{_, v} f


@[simp]
theorem coe_optionSubtype_apply_apply
    [DecidableEq β] (x : β)
    (e : { e : Option α ≃ β // e none = x })
    (a : α) : ↑(optionSubtype x e a) = (e : Option α ≃ β) a

{α : Type u_1}
{β : Type u_2}
[DecidableEq β]
(x : β)
(e : { e // e none = x })
(a : α)

↑(((Equiv.optionSubtype x) e) a) = ↑e (some a)


@[to_additive (attr := simp)]
theorem MonoidHom.coe_mk [MulOneClass M] [MulOneClass N] (f hmul) :
    (MonoidHom.mk f hmul : M → N) = f

(hmul : ∀ (x y : M), f.toFun (x + y) = f.toFun x + f.toFun y)

⇑{ toZeroHom := f, map_add' := hmul } = ⇑f


@[simp]
theorem map_smul {X Y : C} (r : R) (f : X ⟶ Y) : F.map (r • f) = r • F.map f

{R : Type u_1}
[Semiring R]
{C : Type u_2}
{D : Type u_3}
[CategoryTheory.Category.{u_4, u_2} C]
[CategoryTheory.Category.{u_5, u_3} D]
[CategoryTheory.Preadditive C]
[CategoryTheory.Preadditive D]
[CategoryTheory.Linear R C]
[CategoryTheory.Linear R D]
(F : CategoryTheory.Functor C D)
[F.Additive]
[CategoryTheory.Functor.Linear R F]
{X Y : C}
(r : R)
(f : X ⟶ Y)


/-- Assumes left covariance.
The lemma assuming right covariance is `Right.mul_lt_one_of_le_of_lt`. -/
@[to_additive Left.add_neg_of_nonpos_of_neg
      "Assumes left covariance.
      The lemma assuming right covariance is `Right.add_neg_of_nonpos_of_neg`."]
theorem Left.mul_lt_one_of_le_of_lt [CovariantClass α α (· * ·) (· < ·)] {a b : α} (ha : a ≤ 1)
    (hb : b < 1) :
    a * b < 1

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


theorem Monic.irreducible_of_degree_eq_one (hp1 : degree p = 1) (hm : Monic p) : Irreducible p

{R : Type u}
[CommRing R]
[IsDomain R]
{p : R[X]}
(hp1 : p.degree = 1)
(hm : p.Monic)


@[simp]
theorem ofEquiv_val (E : σ ≃ τ) (F : Ctop α σ) (a : τ) : F.ofEquiv E a = F (E.symm a)

{α : Type u_1}
{σ : Type u_3}
{τ : Type u_4}
(E : σ ≃ τ)
(F : Ctop α σ)
(a : τ)


/-- Assume `k = l`. If two functions defined on `Fin k` and `Fin l` are equal on each element,
then they coincide (in the heq sense). -/
protected theorem heq_fun_iff {α : Sort*} {k l : ℕ} (h : k = l) {f : Fin k → α} {g : Fin l → α} :
    HEq f g ↔ ∀ i : Fin k, f i = g ⟨(i : ℕ), h ▸ i.2⟩

{α : Sort u_1}
{k l : ℕ}
(h : k = l)
{f : Fin k → α}
{g : Fin l → α}

HEq f g ↔ ∀ (i : Fin k), f i = g ⟨↑i, ⋯⟩


theorem powerlt_aleph0 {c : Cardinal} (h : ℵ₀ ≤ c) : c ^< ℵ₀ = c


/-- Given a family of Hilbert spaces `G : ι → Type*`, a Hilbert sum of `G` consists of a Hilbert
space `E` and an orthogonal family `V : Π i, G i →ₗᵢ[𝕜] E` such that the induced isometry
`Φ : lp G 2 → E` is surjective.

Keeping in mind that `lp G 2` is "the" external Hilbert sum of `G : ι → Type*`, this is analogous
to `DirectSum.IsInternal`, except that we don't express it in terms of actual submodules. -/
structure IsHilbertSum : Prop where
  ofSurjective ::
  /-- The orthogonal family constituting the summands in the Hilbert sum. -/
  protected OrthogonalFamily : OrthogonalFamily 𝕜 G V
  /-- The isometry `lp G 2 → E` induced by the orthogonal family is surjective. -/
  protected surjective_isometry : Function.Surjective OrthogonalFamily.linearIsometry

{ι : Type u_1}
{𝕜 : Type u_2}
[RCLike 𝕜]
{E : Type u_3}
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[cplt : CompleteSpace E]
{G : ι → Type u_4}
[(i : ι) → NormedAddCommGroup (G i)]
[(i : ι) → InnerProductSpace 𝕜 (G i)]
{V : (i : ι) → G i →ₗᵢ[𝕜] E}
(self : IsHilbertSum 𝕜 G V)


theorem smul_kronecker [Monoid R] [Monoid α] [MulAction R α] [IsScalarTower R α α] (r : R)
    (A : Matrix l m α) (B : Matrix n p α) : (r • A) ⊗ₖ B = r • A ⊗ₖ B

{R : Type u_1}
{α : Type u_2}
{l : Type u_8}
{m : Type u_9}
{n : Type u_10}
{p : Type u_11}
[Monoid R]
[Monoid α]
[MulAction R α]
[IsScalarTower R α α]
(r : R)
(A : Matrix l m α)
(B : Matrix n p α)

Matrix.kroneckerMap (fun x x_1 => x * x_1) (r • A) B = r • Matrix.kroneckerMap (fun x x_1 => x * x_1) A B


lemma vanishingIdeal_mem_minimalPrimes {s : Set (PrimeSpectrum R)} :
    vanishingIdeal s ∈ minimalPrimes R ↔ closure s ∈ irreducibleComponents (PrimeSpectrum R)

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

PrimeSpectrum.vanishingIdeal s ∈ minimalPrimes R ↔ closure s ∈ irreducibleComponents (PrimeSpectrum R)


@[to_additive (attr := simp)]
theorem image_one [DecidableEq β] {f : α → β} : image f 1 = {f 1}

{α : Type u_2}
{β : Type u_3}
[One α]
[DecidableEq β]
{f : α → β}


theorem segment_subset (x y : E × F) : segment 𝕜 x y ⊆ segment 𝕜 x.1 y.1 ×ˢ segment 𝕜 x.2 y.2

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[AddCommMonoid F]
[Module 𝕜 E]
[Module 𝕜 F]
(x y : E × F)


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

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

(SimpleGraph.TripartiteFromTriangles.graph t).Adj (Sum3.in₂ c) (Sum3.in₁ b) ↔ ∃ x ∈ t, x.2.2 = c ∧ x.2.1 = b


theorem frequently_lt_of_lt_limsSup {f : Filter α} [ConditionallyCompleteLinearOrder α] {a : α}
    (hf : f.IsCobounded (· ≤ ·) := by isBoundedDefault)
    (h : a < limsSup f) : ∃ᶠ n in f, a < n

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


theorem nfpBFamily_eq_self {a} (h : ∀ i hi, f i hi a = a) : nfpBFamily.{u, v} o f a = a

{f : (b : Ordinal.{u}) → b < o → Ordinal.{max u v} → Ordinal.{max u v}}

(h : ∀ (i : Ordinal.{u}) (hi : i < o), f i hi a = a)


/-- Converse to the mean value inequality: if `f` is `C`-lipschitz then
its derivative at `x₀` has norm bounded by `C`.
Version using `deriv`. -/
theorem norm_deriv_le_of_lipschitz {f : 𝕜 → F} {x₀ : 𝕜}
    {C : ℝ≥0} (hlip : LipschitzWith C f) : ‖deriv f x₀‖ ≤ C

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : 𝕜 → F}
{x₀ : 𝕜}
{C : ℝ≥0}
(hlip : LipschitzWith C f)


@[deprecated formPerm_pow_apply_get (since := "2024-04-23")]
theorem formPerm_pow_apply_nthLe (l : List α) (h : Nodup l) (n k : ℕ) (hk : k < l.length) :
    (formPerm l ^ n) (l.nthLe k hk) =
      l.nthLe ((k + n) % l.length) (Nat.mod_lt _ (k.zero_le.trans_lt hk))

{α : Type u_1}
[DecidableEq α]
(l : List α)
(h : l.Nodup)
(n k : ℕ)
(hk : k < l.length)

(l.formPerm ^ n) (l.nthLe k hk) = l.nthLe ((k + n) % l.length) ⋯


@[simp] theorem take_append_drop : ∀ (n : Nat) (l : List α), take n l ++ drop n l = l


@[norm_cast] -- @[simp] -- Porting note (#10618): simp can prove this
theorem natCast_inj {m n : ℕ} {R : Type*} [Semiring R] [CharZero R] :
    (↑m : R[X]) = ↑n ↔ m = n

{m n : ℕ}
{R : Type u_1}
[Semiring R]
[CharZero R]


/-- The determinant of a basis constructed by `isUnitSMul` is the product of the given units. -/
@[simp]
theorem Basis.det_isUnitSMul {w : ι → R} (hw : ∀ i, IsUnit (w i)) :
    e.det (e.isUnitSMul hw) = ∏ i, w i

{R : Type u_1}
[CommRing R]
{M : Type u_2}
[AddCommGroup M]
[Module R M]
{ι : Type u_4}
[DecidableEq ι]
[Fintype ι]
(e : Basis ι R M)
{w : ι → R}
(hw : ∀ (i : ι), IsUnit (w i))


@[to_additive]
theorem mul_subset_iff_left : s * t ⊆ u ↔ ∀ a ∈ s, a • t ⊆ u

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


protected theorem map_sum {ι : Type*} (f : A →A[R] B) (s : Finset ι) (g : ι → A) :
    f (∑ i in s, g i) = ∑ i in s, f (g i)

{R : Type u_1}
[CommSemiring R]
{A : Type u_2}
[Semiring A]
[TopologicalSpace A]
{B : Type u_3}
[Semiring B]
[TopologicalSpace B]
[Algebra R A]
[Algebra R B]
{ι : Type u_4}
(f : A →A[R] B)
(s : Finset ι)
(g : ι → A)


@[simp]
theorem BinaryBicone.inrCokernelCofork_π : (BinaryBicone.inrCokernelCofork c).π = c.fst

(c : CategoryTheory.Limits.BinaryBicone X Y)

CategoryTheory.Limits.Cofork.π c.inrCokernelCofork = c.fst


theorem Dense.Iio_eq_biUnion [DenselyOrdered α] {s : Set α} (hs : Dense s) (x : α) :
    Iio x = ⋃ y ∈ s ∩ Iio x, Iio y

{α : Type u}
[TopologicalSpace α]
[LinearOrder α]
[OrderClosedTopology α]
[DenselyOrdered α]
{s : Set α}
(hs : Dense s)
(x : α)

Set.Iio x = ⋃ y ∈ s ∩ Set.Iio x, Set.Iio y


theorem geom_sum_inv [DivisionRing α] {x : α} (hx1 : x ≠ 1) (hx0 : x ≠ 0) (n : ℕ) :
    ∑ i ∈ range n, x⁻¹ ^ i = (x - 1)⁻¹ * (x - x⁻¹ ^ n * x)

{α : Type u}
[DivisionRing α]
{x : α}
(hx1 : x ≠ 1)
(hx0 : x ≠ 0)
(n : ℕ)

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


theorem tendsto_atTop_add_nonneg_right' (hf : Tendsto f l atTop) (hg : ∀ᶠ x in l, 0 ≤ g x) :
    Tendsto (fun x => f x + g x) l atTop

{α : Type u_3}
{β : Type u_4}
[OrderedAddCommMonoid β]
{l : Filter α}
{f g : α → β}
(hf : Filter.Tendsto f l Filter.atTop)
(hg : ∀ᶠ (x : α) in l, 0 ≤ g x)

Filter.Tendsto (fun x => f x + g x) l Filter.atTop


@[simp]
theorem continuous_proj :
    Continuous (Proj J : (I → Bool) → (I → Bool))

{I : Type u}
(J : I → Prop)
[(i : I) → Decidable (J i)]


theorem Normal.of_isSplittingField (p : F[X]) [hFEp : IsSplittingField F E p] : Normal F E

[hFEp : Polynomial.IsSplittingField F E p]


/-- The functor in the equivalence of sheaf categories. -/
@[simps!]
def sheafCongr.functor : Sheaf J A ⥤ Sheaf K A

(J : CategoryTheory.GrothendieckTopology C)

(K : CategoryTheory.GrothendieckTopology D)

[CategoryTheory.Equivalence.TransportsGrothendieckTopology J K e]

∀ {X Y : Dᵒᵖ} (f : X ⟶ Y),
  ((CategoryTheory.Equivalence.sheafCongr.functor J K e A).obj F).val.map f = F.val.map (e.inverse.map f.unop).op


/-- The natural isomorphism between `𝕜` satisfying `RCLike 𝕜` and `ℝ` when `RCLike.I = 0`. -/
@[simps]
def realRingEquiv (h : I = (0 : K)) : K ≃+* ℝ

{K : Type u_1}
[RCLike K]
(h : RCLike.I = 0)

∀ (a : ℝ), (RCLike.realRingEquiv h).symm a = ↑a


@[to_additive (attr := simp)]
theorem _root_.MulOpposite.exponent : exponent (MulOpposite G) = exponent G

Monoid.exponent Gᵐᵒᵖ = Monoid.exponent G


theorem ordConnected_iff_uIcc_subset_left (hx : x ∈ s) :
    OrdConnected s ↔ ∀ ⦃y⦄, y ∈ s → [[x, y]] ⊆ s

{α : Type u_1}
[LinearOrder α]
{s : Set α}
{x : α}
(hx : x ∈ s)

s.OrdConnected ↔ ∀ ⦃y : α⦄, y ∈ s → [[x, y]] ⊆ s


lemma toCircle_intCast (j : ℤ) :
    toCircle (j : ZMod N) = exp (2 * π * I * j / N)

↑(ZMod.toCircle ↑j) = cexp (2 * ↑π * Complex.I * ↑j / ↑N)


/-- Binary **rearrangement inequality**. -/
lemma smul_add_smul_le_smul_add_smul' [PosSMulMono α β]
    {b₁ b₂ : α} {a d : β} (hba : b₂ ≤ b₁) (hdc : d ≤ a) : b₁ • d + b₂ • a ≤ b₁ • a + b₂ • d

{α : Type u_1}
{β : Type u_2}
[OrderedRing α]
[OrderedAddCommGroup β]
[Module α β]
[PosSMulMono α β]
{b₁ b₂ : α}
{a d : β}
(hba : b₂ ≤ b₁)
(hdc : d ≤ a)


@[to_additive]
theorem inter_mul_union_subset : s ∩ t * (s ∪ t) ⊆ s * t

{α : Type u_2}
[AddCommSemigroup α]
{s t : Set α}


@[simp, norm_cast] lemma coe_zero : ⇑(0 : Π₀ i, β i) = 0

{ι : Type u}
{β : ι → Type v}
[(i : ι) → Zero (β i)]


/-- An element `a` is right-regular if and only if a positive power of `a` is right-regular. -/
theorem IsRightRegular.pow_iff {n : ℕ} (n0 : 0 < n) :
    IsRightRegular (a ^ n) ↔ IsRightRegular a

{R : Type u_1}
{a : R}
[Monoid R]
{n : ℕ}
(n0 : 0 < n)


@[simp]
theorem ceil_ofNat (n : ℕ) [n.AtLeastTwo] : ⌈no_index (OfNat.ofNat n : α)⌉₊ = n

{α : Type u_2}
[LinearOrderedSemiring α]
[FloorSemiring α]
(n : ℕ)
[n.AtLeastTwo]


@[mono]
theorem fromEdgeSet_mono {s t : Set (Sym2 V)} (h : s ⊆ t) : fromEdgeSet s ≤ fromEdgeSet t

{V : Type u}
{s t : Set (Sym2 V)}
(h : s ⊆ t)

SimpleGraph.fromEdgeSet s ≤ SimpleGraph.fromEdgeSet t


theorem ne_zero_of_finite (e : B) [FiniteDimensional A B] : minpoly A e ≠ 0

(A : Type u_1)
{B : Type u_2}
[Field A]
[Ring B]
[Algebra A B]
(e : B)
[FiniteDimensional A B]


theorem hasDerivWithinAt_iff_tendsto_slope' (hs : x ∉ s) :
    HasDerivWithinAt f f' s x ↔ Tendsto (slope f x) (𝓝[s] x) (𝓝 f')

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : 𝕜 → F}
{f' : F}
{x : 𝕜}
{s : Set 𝕜}
(hs : x ∉ s)

HasDerivWithinAt f f' s x ↔ Filter.Tendsto (slope f x) (𝓝[s] x) (𝓝 f')


@[to_additive]
theorem inv_mem_inv [Inv α] (a : Part α) (ma : α) (ha : ma ∈ a) : ma⁻¹ ∈ a⁻¹

{α : Type u_1}
[Neg α]
(a : Part α)
(ma : α)
(ha : ma ∈ a)


@[simp]
lemma zmod_val_inv_nsmul_nsmul (hn : (Nat.card α).Coprime n) (a : α) :
    (n⁻¹ : ZMod (Nat.card α)).val • n • a = a

{α : Type u_1}
[AddGroup α]
{n : ℕ}
(hn : (Nat.card α).Coprime n)
(a : α)


lemma isIso_i (hg : S.g = 0) : IsIso h.i


lemma isPushout_iff :
    sq.IsPushout ↔ Nonempty (IsColimit sq.pushoutCocone)

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

sq.IsPushout ↔ Nonempty (CategoryTheory.Limits.IsColimit sq.pushoutCocone)


@[simp]
theorem integral_log (h : (0 : ℝ) ∉ [[a, b]]) :
    ∫ x in a..b, log x = b * log b - a * log a - b + a

∫ (x : ℝ) in a..b, Real.log x = b * Real.log b - a * Real.log a - b + a


theorem restrict_coeSubgraph {G' : G.Subgraph} (G'' : G'.coe.Subgraph) :
    Subgraph.restrict (Subgraph.coeSubgraph G'') = G''

{V : Type u}
{G : SimpleGraph V}
{G' : G.Subgraph}
(G'' : G'.coe.Subgraph)

SimpleGraph.Subgraph.restrict (SimpleGraph.Subgraph.coeSubgraph G'') = G''


/--`lof R A i 1 = 1` for all `i`.-/
theorem lof_map_one (i : I) : lof R A i 1 = 1

{I : Type u}
[DecidableEq I]
(R : Type v)
[CommSemiring R]
(A : I → Type w)
[(i : I) → Semiring (A i)]
[(i : I) → Algebra R (A i)]
(i : I)

(LinearAlgebra.FreeProduct.lof R A i) 1 = 1


/-- If a function `f` is `Periodic` with positive period `c`, then for all `x` there exists some
  `y ∈ Ioc a (a + c)` such that `f x = f y`. -/
theorem Periodic.exists_mem_Ioc [LinearOrderedAddCommGroup α] [Archimedean α] (h : Periodic f c)
    (hc : 0 < c) (x a) : ∃ y ∈ Ioc a (a + c), f x = f y

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{c : α}
[LinearOrderedAddCommGroup α]
[Archimedean α]
(h : Function.Periodic f c)
(hc : 0 < c)
(x a : α)


@[simp]
theorem toReal_ofReal {r : ℝ} (h : 0 ≤ r) : (ENNReal.ofReal r).toReal = r


@[gcongr]
theorem iUnion_mono'' {s t : ι → Set α} (h : ∀ i, s i ⊆ t i) : iUnion s ⊆ iUnion t

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


theorem of_add_of_diff {A B : Set α} (hA : MeasurableSet A) (hB : MeasurableSet B) (h : A ⊆ B) :
    v A + v (B \ A) = v B

{α : Type u_1}
{m : MeasurableSpace α}
{M : Type u_3}
[AddCommMonoid M]
[TopologicalSpace M]
[T2Space M]
{v : MeasureTheory.VectorMeasure α M}
{A B : Set α}
(hA : MeasurableSet A)
(hB : MeasurableSet B)
(h : A ⊆ B)


theorem contDiffOn_log {n : ℕ∞} : ContDiffOn ℝ n log {0}ᶜ


theorem coe_ne_zero : (q : ℚ) ≠ 0 ↔ q ≠ 0

↑q ≠ 0 ↔ q ≠ 0


/-- Let `E` be a topological vector space (over a `NontriviallyNormedField`) whose topology is
generated by some family of seminorms `p`, and let `q` be a seminorm on `E`. If `q` is continuous,
then it is uniformly controlled by *finitely many* seminorms of `p`, that is there
is some finset `s` of the index set and some `C > 0` such that `q ≤ C • s.sup p`. -/
lemma bound_of_continuous [Nonempty ι] [t : TopologicalSpace E] (hp : WithSeminorms p)
    (q : Seminorm 𝕜 E) (hq : Continuous q) :
    ∃ s : Finset ι, ∃ C : ℝ≥0, C ≠ 0 ∧ q ≤ C • s.sup p

{𝕜 : Type u_1}
{E : Type u_5}
{ι : Type u_8}
[NontriviallyNormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{p : SeminormFamily 𝕜 E ι}
[Nonempty ι]
[t : TopologicalSpace E]
(hp : WithSeminorms p)
(q : Seminorm 𝕜 E)
(hq : Continuous ⇑q)


theorem natCast_strictMono : StrictMono (· : ℕ → ℤ)


@[simp 1100]
theorem mem_map' (f : α ↪ β) {a} {s : Finset α} : f a ∈ s.map f ↔ a ∈ s

{α : Type u_1}
{β : Type u_2}
(f : α ↪ β)
{a : α}
{s : Finset α}


@[simp]
theorem intCast_complex_norm (x : ℤ[i]) : (x.norm : ℂ) = Complex.normSq (x : ℂ)

↑(Zsqrtd.norm x) = ↑(Complex.normSq (GaussianInt.toComplex x))


@[simp]
theorem center.coe_inv (a : center K) : ((a⁻¹ : center K) : K) = (a : K)⁻¹

{K : Type u}
[DivisionRing K]
(a : ↥(Subring.center K))

↑a⁻¹ = (↑a)⁻¹


@[simp]
theorem coeFn_comp_toFiniteMeasure_eq_coeFn (ν : ProbabilityMeasure Ω) :
    (ν.toFiniteMeasure : Set Ω → ℝ≥0) = (ν : Set Ω → ℝ≥0)

(ν : MeasureTheory.ProbabilityMeasure Ω)


theorem DenomsClearable.add {N : ℕ} {f g : R[X]} :
    DenomsClearable a b N f i → DenomsClearable a b N g i → DenomsClearable a b N (f + g) i

{R : Type u_1}
{K : Type u_2}
[Semiring R]
[CommSemiring K]
{i : R →+* K}
{a b : R}
{N : ℕ}
{f g : R[X]}


theorem lt_pred_of_succ_lt : succ n < m → n < pred m


theorem upperBounds_Iic : upperBounds (Iic a) = Ici a


@[simp]
theorem eval₂Hom_zero' (f : R →+* S₂) : eval₂Hom f (fun _ => 0 : σ → S₂) = f.comp constantCoeff

{R : Type u}
{S₂ : Type w}
{σ : Type u_1}
[CommSemiring R]
[CommSemiring S₂]
(f : R →+* S₂)

(MvPolynomial.eval₂Hom f fun x => 0) = f.comp MvPolynomial.constantCoeff


theorem isGLB_of_l_image [Preorder α] [Preorder β] (gi : GaloisCoinsertion l u) {s : Set α} {a : β}
    (hs : IsGLB (l '' s) a) : IsGLB s (u a)

{α : Type u}
{β : Type v}
{l : α → β}
{u : β → α}
[Preorder α]
[Preorder β]
(gi : GaloisCoinsertion l u)
{s : Set α}
{a : β}
(hs : IsGLB (l '' s) a)


theorem top_isNormal : IsNormal (⊤ : Subgroupoid C)

{C : Type u}
[CategoryTheory.Groupoid C]


theorem Ico_pred_right_eq_insert (h : a ≤ b) : Ioc (pred a) b = insert a (Ioc a b)

{α : Type u_1}
[PartialOrder α]
[PredOrder α]
{a b : α}
[NoMinOrder α]
(h : a ≤ b)

Set.Ioc (Order.pred a) b = insert a (Set.Ioc a b)


@[simp]
theorem op_pow {β} [Pow α β] (a : α) (b : β) : op (a ^ b) = op a ^ b

{α : Type u_1}
{β : Type u_2}
[Pow α β]
(a : α)
(b : β)

AddOpposite.op (a ^ b) = AddOpposite.op a ^ b


@[simp]
theorem span_univ : span (Set.univ : Set α) = ⊤


/-- A ring `R` is *Henselian* at an ideal `I` if the following condition holds:
for every polynomial `f` over `R`, with a *simple* root `a₀` over the quotient ring `R/I`,
there exists a lift `a : R` of `a₀` that is a root of `f`.

(Here, saying that a root `b` of a polynomial `g` is *simple* means that `g.derivative.eval b` is a
unit. Warning: if `R/I` is not a field then it is not enough to assume that `g` has a factorization
into monic linear factors in which `X - b` shows up only once; for example `1` is not a simple root
of `X^2-1` over `ℤ/4ℤ`.) -/
class HenselianRing (R : Type*) [CommRing R] (I : Ideal R) : Prop where
  jac : I ≤ Ideal.jacobson ⊥
  is_henselian :
    ∀ (f : R[X]) (_ : f.Monic) (a₀ : R) (_ : f.eval a₀ ∈ I)
      (_ : IsUnit (Ideal.Quotient.mk I (f.derivative.eval a₀))), ∃ a : R, f.IsRoot a ∧ a - a₀ ∈ I

{R : Type u_1}
[CommRing R]
{I : Ideal R}
[self : HenselianRing R I]
(f : R[X])

f.Monic →
  ∀ (a₀ : R),
    Polynomial.eval a₀ f ∈ I →
      IsUnit ((Ideal.Quotient.mk I) (Polynomial.eval a₀ (Polynomial.derivative f))) → ∃ a, f.IsRoot a ∧ a - a₀ ∈ I


@[simp]
theorem mkSpanSingleton'_apply_self (x : E) (y : F) (H : ∀ c : R, c • x = 0 → c • y = 0) (h) :
    mkSpanSingleton' x y H ⟨x, h⟩ = y

(h : x ∈ (LinearPMap.mkSpanSingleton' x y H).domain)

↑(LinearPMap.mkSpanSingleton' x y H) ⟨x, h⟩ = y


/-- Elements of the unit group of a monoid represented as elements of the monoid
    divide any element of the monoid. -/
theorem coe_dvd : ↑u ∣ a

{α : Type u_1}
[Monoid α]
{a : α}
{u : αˣ}


@[simp]
theorem irrational_div_int_iff : Irrational (x / m) ↔ m ≠ 0 ∧ Irrational x

Irrational (x / ↑m) ↔ m ≠ 0 ∧ Irrational x


/-- The group of `AffineEquiv`s are equivalent to the group of units of `AffineMap`.

This is the affine version of `LinearMap.GeneralLinearGroup.generalLinearEquiv`. -/
@[simps]
def equivUnitsAffineMap : (P₁ ≃ᵃ[k] P₁) ≃* (P₁ →ᵃ[k] P₁)ˣ

{k : Type u_1}
{P₁ : Type u_2}
{V₁ : Type u_6}
[Ring k]
[AddCommGroup V₁]
[Module k V₁]
[AffineSpace V₁ P₁]
(u : (P₁ →ᵃ[k] P₁)ˣ)
(a : P₁)

(AffineEquiv.equivUnitsAffineMap.symm u).symm a = ↑u⁻¹ a


@[to_additive]
theorem coe_sSup_of_directed_on {S : Set (Subsemigroup M)} (hS : DirectedOn (· ≤ ·) S) :
    (↑(sSup S) : Set M) = ⋃ s ∈ S, ↑s

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


/-- `ZeroHom M N` is the type of functions `M → N` that preserve zero.

When possible, instead of parametrizing results over `(f : ZeroHom M N)`,
you should parametrize over `(F : Type*) [ZeroHomClass F M N] (f : F)`.

When you extend this structure, make sure to also extend `ZeroHomClass`.
-/
structure ZeroHom (M : Type*) (N : Type*) [Zero M] [Zero N] where
  /-- The underlying function -/
  protected toFun : M → N
  /-- The proposition that the function preserves 0 -/
  protected map_zero' : toFun 0 = 0

{M : Type u_10}
{N : Type u_11}
[Zero M]
[Zero N]
(self : ZeroHom M N)


@[to_additive (attr := simp) prod_apply]
theorem prod_apply (f : M →ₙ* N) (g : M →ₙ* P) (x) : f.prod g x = (f x, g x)

{M : Type u_5}
{N : Type u_6}
{P : Type u_7}
[Mul M]
[Mul N]
[Mul P]
(f : M →ₙ* N)
(g : M →ₙ* P)
(x : M)


@[simp]
theorem max_lt_iff : max a b < c ↔ a < c ∧ b < c

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


lemma id {U : Set 𝕜} : MeromorphicOn id U

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{U : Set 𝕜}


@[to_additive]
theorem Nonempty.of_smul_right : (s • t).Nonempty → t.Nonempty

{α : Type u_2}
{β : Type u_3}
[VAdd α β]
{s : Set α}
{t : Set β}


theorem Quotient.forall {α : Sort*} {s : Setoid α} {p : Quotient s → Prop} :
    (∀ a, p a) ↔ ∀ a : α, p ⟦a⟧

{α : Sort u_3}
{s : Setoid α}
{p : Quotient s → Prop}

(∀ (a : Quotient s), p a) ↔ ∀ (a : α), p ⟦a⟧


/-- Implementation of `Mon_.hasLimits`:
the proposed cone over a functor `F : J ⥤ Mon_ C` is a limit cone.
-/
@[simps]
def limitConeIsLimit (F : J ⥤ Mon_ C) : IsLimit (limitCone F)

((Mon_.limitConeIsLimit F).lift s).hom =
  CategoryTheory.Limits.limit.lift (F ⋙ Mon_.forget C) ((Mon_.forget C).mapCone s)


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

AddOpposite.op x = AddOpposite.op y ↔ x = y


/-- The trace of a linear map correspond to the contraction pairing under the isomorphism
 `End(M) ≃ M* ⊗ M`-/
theorem trace_eq_contract_of_basis' [Fintype ι] [DecidableEq ι] (b : Basis ι R M) :
    LinearMap.trace R M = contractLeft R M ∘ₗ (dualTensorHomEquivOfBasis b).symm.toLinearMap

{R : Type u_1}
[CommRing R]
{M : Type u_2}
[AddCommGroup M]
[Module R M]
{ι : Type u_5}
[Fintype ι]
[DecidableEq ι]
(b : Basis ι R M)

LinearMap.trace R M = contractLeft R M ∘ₗ ↑(dualTensorHomEquivOfBasis b).symm


@[simp]
theorem addEquivBoundedOfCompact_apply [AddMonoid β] [LipschitzAdd β] :
    ⇑(addEquivBoundedOfCompact α β) = mkOfCompact

(α : Type u_1)
(β : Type u_2)
[TopologicalSpace α]
[CompactSpace α]
[MetricSpace β]
[AddMonoid β]
[LipschitzAdd β]

⇑(ContinuousMap.addEquivBoundedOfCompact α β) = BoundedContinuousFunction.mkOfCompact


theorem mem_of_mem_span {H : Set ι} {x : M} (hmem : x ∈ Submodule.span R (e '' H)) :
    ∀ i : ι, ε i x ≠ 0 → i ∈ H

{R : Type u_1}
{M : Type u_2}
{ι : Type u_3}
[CommRing R]
[AddCommGroup M]
[Module R M]
{e : ι → M}
{ε : ι → Module.Dual R M}
[DecidableEq ι]
(h : Module.DualBases e ε)
{H : Set ι}
{x : M}
(hmem : x ∈ Submodule.span R (e '' H))
(i : ι)


@[trans]
theorem IsTheta.trans_eventuallyEq {f : α → E} {g₁ g₂ : α → F} (h : f =Θ[l] g₁) (hg : g₁ =ᶠ[l] g₂) :
    f =Θ[l] g₂

{α : Type u_1}
{E : Type u_3}
{F : Type u_4}
[Norm E]
[Norm F]
{l : Filter α}
{f : α → E}
{g₁ g₂ : α → F}
(h : f =Θ[l] g₁)
(hg : g₁ =ᶠ[l] g₂)


theorem aemeasurable_derivWithin_Ici [MeasurableSpace F] [BorelSpace F] (μ : Measure ℝ) :
    AEMeasurable (fun x => derivWithin f (Ici x) x) μ

{F : Type u_1}
[NormedAddCommGroup F]
[NormedSpace ℝ F]
(f : ℝ → F)
[CompleteSpace F]
[MeasurableSpace F]
[BorelSpace F]
(μ : MeasureTheory.Measure ℝ)

AEMeasurable (fun x => derivWithin f (Set.Ici x) x) μ


@[to_additive]
protected lemma IsOfFinOrder.powers_eq_image_range_orderOf [DecidableEq G] (hx : IsOfFinOrder x) :
    (Submonoid.powers x : Set G) = (Finset.range (orderOf x)).image (x ^ ·)

{G : Type u_1}
[Monoid G]
{x : G}
[DecidableEq G]
(hx : IsOfFinOrder x)

↑(Submonoid.powers x) = ↑(Finset.image (fun x_1 => x ^ x_1) (Finset.range (orderOf x)))


/-- The reduction modulo `p` of the minimal polynomial of a root of unity `μ` is separable. -/
theorem separable_minpoly_mod {p : ℕ} [Fact p.Prime] (hdiv : ¬p ∣ n) :
    Separable (map (Int.castRingHom (ZMod p)) (minpoly ℤ μ))

{n : ℕ}
{K : Type u_1}
[CommRing K]
{μ : K}
(h : IsPrimitiveRoot μ n)
[IsDomain K]
[CharZero K]
{p : ℕ}
[Fact (Nat.Prime p)]
(hdiv : ¬p ∣ n)

(Polynomial.map (Int.castRingHom (ZMod p)) (minpoly ℤ μ)).Separable


@[simp]
theorem image₂_empty_left : image₂ f ∅ t = ∅

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


/-- A `ModuleFilterBasis` on a module is a `FilterBasis` satisfying some additional axioms.
  Example : if `M` is a topological module then the neighbourhoods of zero are a
  `ModuleFilterBasis`. Conversely given a `ModuleFilterBasis` one can define a topology
  compatible with the module structure on `M`. -/
structure ModuleFilterBasis (R M : Type*) [CommRing R] [TopologicalSpace R] [AddCommGroup M]
  [Module R M] extends AddGroupFilterBasis M where
  smul' : ∀ {U}, U ∈ sets → ∃ V ∈ 𝓝 (0 : R), ∃ W ∈ sets, V • W ⊆ U
  smul_left' : ∀ (x₀ : R) {U}, U ∈ sets → ∃ V ∈ sets, V ⊆ (fun x ↦ x₀ • x) ⁻¹' U
  smul_right' : ∀ (m₀ : M) {U}, U ∈ sets → ∀ᶠ x in 𝓝 (0 : R), x • m₀ ∈ U

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[TopologicalSpace R]
[AddCommGroup M]
[Module R M]
(self : ModuleFilterBasis R M)
(x₀ : R)
{U : Set M}

U ∈ AddGroupFilterBasis.toFilterBasis.sets → ∃ V ∈ AddGroupFilterBasis.toFilterBasis.sets, V ⊆ (fun x => x₀ • x) ⁻¹' U


/-- The star operation on `Subalgebra` commutes with `Algebra.adjoin`. -/
theorem star_adjoin_comm (s : Set A) : star (Algebra.adjoin R s) = Algebra.adjoin R (star s)

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


theorem exp_bound' {x : ℝ} (h1 : 0 ≤ x) (h2 : x ≤ 1) {n : ℕ} (hn : 0 < n) :
    Real.exp x ≤ (∑ m ∈ Finset.range n, x ^ m / m.factorial) +
      x ^ n * (n + 1) / (n.factorial * n)

Real.exp x ≤ ∑ m ∈ Finset.range n, x ^ m / ↑m.factorial + x ^ n * (↑n + 1) / (↑n.factorial * ↑n)


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

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

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


theorem eventually_iInf_lowerCentralSeries_eq [IsArtinian R M] :
    ∀ᶠ l in Filter.atTop, ⨅ k, lowerCentralSeries R L M k = lowerCentralSeries R L M l

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

∀ᶠ (l : ℕ) in Filter.atTop, ⨅ k, LieModule.lowerCentralSeries R L M k = LieModule.lowerCentralSeries R L M l


/-- The chain complex `s.nondegComplex` attached to a splitting of a simplicial object `X`
becomes isomorphic to the normalized Moore complex `N₁.obj X` defined as a formal direct
factor in the category `Karoubi (ChainComplex C ℕ)`. -/
@[simps]
noncomputable def toKaroubiNondegComplexIsoN₁ :
    (toKaroubi _).obj s.nondegComplex ≅ N₁.obj X

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
{X : CategoryTheory.SimplicialObject C}
(s : SimplicialObject.Splitting X)
[CategoryTheory.Preadditive C]
(n : ℕ)

s.toKaroubiNondegComplexIsoN₁.hom.f.f n =
  (s.cofan (Opposite.op [n])).inj (SimplicialObject.Splitting.IndexSet.id (Opposite.op [n])) ≫
    AlgebraicTopology.DoldKan.PInfty.f n


theorem succ_strictMono : StrictMono (succ : α → α)

{α : Type u_1}
[Preorder α]
[SuccOrder α]
[NoMaxOrder α]


@[simp] lemma monoidalComp_refl {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z) :
    f ⊗≫ g = f ≫ g

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


theorem exists_or_eq_self_of_replaceF (p) (l : List α) :
    l.replaceF p = l ∨ ∃ a a' l₁ l₂,
      (∀ b ∈ l₁, p b = none) ∧ p a = some a' ∧ l = l₁ ++ a :: l₂ ∧ l.replaceF p = l₁ ++ a' :: l₂

{α : Type u_1}
(p : α → Option α)
(l : List α)

List.replaceF p l = l ∨
  ∃ a a' l₁ l₂,
    (∀ (b : α), b ∈ l₁ → p b = none) ∧ p a = some a' ∧ l = l₁ ++ a :: l₂ ∧ List.replaceF p l = l₁ ++ a' :: l₂


theorem card_erase_lt_of_mem {a : α} {s : Multiset α} : a ∈ s → card (s.erase a) < card s

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

a ∈ s → Multiset.card (s.erase a) < Multiset.card s


theorem MulPosReflectLE.toMulPosStrictMono [MulPosReflectLE α] : MulPosStrictMono α

{α : Type u_1}
[Mul α]
[Zero α]
[LinearOrder α]
[MulPosReflectLE α]


private theorem add_left_aux3 (y z : E) :
    ‖2 • z + y‖ * ‖2 • z + y‖ = 2 * (‖y + z‖ * ‖y + z‖ + ‖z‖ * ‖z‖) - ‖y‖ * ‖y‖

{E : Type u_2}
[NormedAddCommGroup E]
[InnerProductSpaceable E]
(y z : E)


lemma rel_of_lt [IsTrans α r] (x : RelSeries r) {i j : Fin (x.length + 1)} (h : i < j) :
    r (x i) (x j)

{α : Type u_1}
{r : Rel α α}
[IsTrans α r]
(x : RelSeries r)
{i j : Fin (x.length + 1)}
(h : i < j)


theorem range_toContinuousMap :
    range toContinuousMap =
      {f : C(Icc v.tMin v.tMax, E) | f v.t₀ = v.x₀ ∧ LipschitzWith v.C f}

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

Set.range ⇑PicardLindelof.FunSpace.toContinuousMap = {f | f v.t₀ = v.x₀ ∧ LipschitzWith v.C ⇑f}


@[reassoc (attr := simp)]
lemma comp_add' (f : L.obj X ⟶ L.obj Y) (g₁ g₂ : L.obj Y ⟶ L.obj Z) :
    f ≫ add' W g₁ g₂ = add' W (f ≫ g₁) (f ≫ g₂)

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_4, u_1} C]
[CategoryTheory.Category.{u_3, u_2} D]
[CategoryTheory.Preadditive C]
{L : CategoryTheory.Functor C D}
(W : CategoryTheory.MorphismProperty C)
[L.IsLocalization W]
[W.HasLeftCalculusOfFractions]
{X Y Z : C}
(f : L.obj X ⟶ L.obj Y)
(g₁ g₂ : L.obj Y ⟶ L.obj Z)

CategoryTheory.CategoryStruct.comp f (CategoryTheory.Localization.Preadditive.add' W g₁ g₂) =
  CategoryTheory.Localization.Preadditive.add' W (CategoryTheory.CategoryStruct.comp f g₁)
    (CategoryTheory.CategoryStruct.comp f g₂)


@[simp]
theorem smul_comap_le_comap_smul (f : M →ₗ[R] M') (S : Submodule R M') (I : Ideal R) :
    I • S.comap f ≤ (I • S).comap f

{R : Type u}
{M : Type v}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
{M' : Type w}
[AddCommMonoid M']
[Module R M']
(f : M →ₗ[R] M')
(S : Submodule R M')
(I : Ideal R)

I • Submodule.comap f S ≤ Submodule.comap f (I • S)


theorem separatingLeft_toLinearMap₂'_iff_det_ne_zero {M : Matrix ι ι R₁} :
    (Matrix.toLinearMap₂' R₁ M).SeparatingLeft (R := R₁) ↔ M.det ≠ 0

{R₁ : Type u_2}
{ι : Type u_16}
[CommRing R₁]
[DecidableEq ι]
[Fintype ι]
[IsDomain R₁]
{M : Matrix ι ι R₁}

((Matrix.toLinearMap₂' R₁) M).SeparatingLeft ↔ M.det ≠ 0


theorem filter_union_filter_of_codisjoint (s : Finset α) (h : Codisjoint p q) :
    s.filter p ∪ s.filter q = s

{α : Type u_1}
(p q : α → Prop)
[DecidablePred p]
[DecidablePred q]
[DecidableEq α]
(s : Finset α)
(h : Codisjoint p q)

Finset.filter p s ∪ Finset.filter q s = s


@[simp, norm_cast]
theorem coe_max (x y : ℝ≥0) : ((max x y : ℝ≥0) : ℝ) = max (x : ℝ) (y : ℝ)


lemma fermatLastTheoremFor_iff_rat {n : ℕ} : FermatLastTheoremFor n ↔ FermatLastTheoremWith ℚ n


@[simp]
theorem one_le_cast [LinearOrderedSemiring α] (n : PosNum) : (1 : α) ≤ n

{α : Type u_1}
[LinearOrderedSemiring α]
(n : PosNum)


/-- Predicate for monoid homomorphisms (deprecated -- use the bundled `MonoidHom` version). -/
@[to_additive]
structure IsMonoidHom [MulOneClass α] [MulOneClass β] (f : α → β) extends IsMulHom f : Prop where
  /-- The proposition that `f` preserves the multiplicative identity. -/
  map_one : f 1 = 1

{α : Type u}
{β : Type v}
[MulOneClass α]
[MulOneClass β]
{f : α → β}
(self : IsMonoidHom f)


theorem subset_empty {s : Finset α} : s ⊆ ∅ ↔ s = ∅

s ⊆ ∅ ↔ s = ∅


theorem csInf_le_csInf' {s t : Set α} (h₁ : t.Nonempty) (h₂ : t ⊆ s) : sInf s ≤ sInf t

{α : Type u_1}
[ConditionallyCompleteLinearOrderBot α]
{s t : Set α}
(h₁ : t.Nonempty)
(h₂ : t ⊆ s)


@[simp]
theorem eLpNorm'_norm {f : α → F} :
    eLpNorm' (fun a => ‖f a‖) q μ = eLpNorm' f q μ

{α : Type u_1}
{F : Type u_3}
{m0 : MeasurableSpace α}
{q : ℝ}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup F]
{f : α → F}

MeasureTheory.eLpNorm' (fun a => ‖f a‖) q μ = MeasureTheory.eLpNorm' f q μ


@[simp]
theorem mgf_zero_measure : mgf X (0 : Measure Ω) t = 0

{Ω : Type u_1}
{m : MeasurableSpace Ω}
{X : Ω → ℝ}
{t : ℝ}


theorem frequently_atTop_modEq_one {k : ℕ} (hk0 : k ≠ 0) :
    ∃ᶠ p in atTop, Nat.Prime p ∧ p ≡ 1 [MOD k]

∃ᶠ (p : ℕ) in Filter.atTop, Nat.Prime p ∧ p ≡ 1 [MOD k]


theorem bitwise_rec_lemma {n : Nat} (hNe : n ≠ 0) : n / 2 < n


@[simp]
theorem algebraMap_apply {_ : CommSemiring R} [_s : ∀ i, Semiring (f i)] [∀ i, Algebra R (f i)]
    (a : R) (i : I) : algebraMap R (∀ i, f i) a i = algebraMap R (f i) a

(I : Type u)
{R : Type u_1}
(f : I → Type v)

∀ {x : CommSemiring R} [_s : (i : I) → Semiring (f i)] [inst : (i : I) → Algebra R (f i)] (a : R) (i : I),
  (algebraMap R ((i : I) → f i)) a i = (algebraMap R (f i)) a


theorem HasFDerivAtFilter.add (hf : HasFDerivAtFilter f f' x L)
    (hg : HasFDerivAtFilter g g' x L) : HasFDerivAtFilter (fun y => f y + g y) (f' + g') x L

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


theorem coeIdeal_absNorm (I₀ : Ideal R) :
    absNorm (I₀ : FractionalIdeal R⁰ K) = Ideal.absNorm I₀

{R : Type u_1}
[CommRing R]
[IsDedekindDomain R]
[Module.Free ℤ R]
[Module.Finite ℤ R]
{K : Type u_2}
[CommRing K]
[Algebra R K]
[IsFractionRing R K]
(I₀ : Ideal R)

FractionalIdeal.absNorm ↑I₀ = ↑(Ideal.absNorm I₀)


lemma equation_zero (Y : R) : W.Equation ![0, Y, 0]

{R : Type u}
[CommRing R]
(W : WeierstrassCurve.Projective R)
(Y : R)


@[simp]
lemma bnot_comp_isSome : (! ·) ∘ @Option.isSome α = Option.isNone

(fun x => !x) ∘ Option.isSome = Option.isNone


@[to_additive]
theorem IsCompact.mul_closedBall_one (hs : IsCompact s) (hδ : 0 ≤ δ) :
    s * closedBall (1 : E) δ = cthickening δ s

{E : Type u_1}
[SeminormedCommGroup E]
{δ : ℝ}
{s : Set E}
(hs : IsCompact s)
(hδ : 0 ≤ δ)

s * Metric.closedBall 1 δ = Metric.cthickening δ s


@[simp]
theorem vars_C : (C r : MvPolynomial σ R).vars = ∅

{R : Type u}
{σ : Type u_1}
{r : R}
[CommSemiring R]


theorem ofFinset_apply_of_not_mem {a : α} (ha : a ∉ s) : ofFinset f s h h' a = 0

{α : Type u_1}
{f : α → ENNReal}
{s : Finset α}
(h : ∑ a ∈ s, f a = 1)
(h' : ∀ a ∉ s, f a = 0)
{a : α}
(ha : a ∉ s)


protected theorem infinite_or_finite (s : Set α) : s.Infinite ∨ s.Finite


@[to_additive (attr := simp)]
theorem map_smul : map (c • ·) μ = μ

[MeasureTheory.VAddInvariantMeasure M α μ]

MeasureTheory.Measure.map (fun x => c +ᵥ x) μ = μ


@[to_additive] lemma IsMulFreimanHom.subset (hA : A₁ ⊆ A₂) (hf : IsMulFreimanHom n A₂ B₂ f)
    (hf' : MapsTo f A₁ B₁) : IsMulFreimanHom n A₁ B₁ f

{α : Type u_2}
{β : Type u_3}
[AddCommMonoid α]
[AddCommMonoid β]
{A₁ A₂ : Set α}
{B₁ B₂ : Set β}
{f : α → β}
{n : ℕ}
(hA : A₁ ⊆ A₂)
(hf : IsAddFreimanHom n A₂ B₂ f)
(hf' : Set.MapsTo f A₁ B₁)


@[to_additive]
lemma comp_def {X Y Z : CommGrp} {f : X ⟶ Y} {g : Y ⟶ Z} : f ≫ g = g.comp f

{X Y Z : AddCommGrp}
{f : X ⟶ Y}
{g : Y ⟶ Z}


@[simp, mfld_simps]
theorem map_source {x : X} (h : x ∈ e.source) : e x ∈ e.target

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


theorem _root_.Zspan.isZlattice {E ι : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
    [Finite ι] (b : Basis ι ℝ E) :
    IsZlattice ℝ (span ℤ (Set.range b)).toAddSubgroup

{E : Type u_1}
{ι : Type u_2}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[Finite ι]
(b : Basis ι ℝ E)

IsZlattice ℝ (Submodule.span ℤ (Set.range ⇑b)).toAddSubgroup


/-- The stabilizer of `Mˣ` acting on itself by conjugation at `x : Mˣ` is exactly the
units of the centralizer of `x : M`. -/
@[simps! apply_coe_val symm_apply_val_coe]
def unitsCentralizerEquiv (x : Mˣ) :
    (Submonoid.centralizer ({↑x} : Set M))ˣ ≃* MulAction.stabilizer (ConjAct Mˣ) x

∀ (a : (↥(Submonoid.centralizer {↑x}))ˣ), ↑↑((unitsCentralizerEquiv M x) a) = ↑↑a


theorem complex_d_succ_comp (n : ℕ) :
    P.complex.d n (n + 1) ≫ P.complex.d (n + 1) (n + 2) = 0

(P : CategoryTheory.ProjectiveResolution Z)

CategoryTheory.CategoryStruct.comp (P.complex.d n (n + 1)) (P.complex.d (n + 1) (n + 2)) = 0


@[simps (config := .lemmasOnly)]
instance instMonoidalCategoryStruct : MonoidalCategoryStruct (ModuleCat.{u} R)

∀ {X₁ Y₁ X₂ Y₂ : ModuleCat R} (f : X₁ ⟶ Y₁) (g : X₂ ⟶ Y₂),
  CategoryTheory.MonoidalCategory.tensorHom f g = TensorProduct.map f g


/-- `restrictScalars S` is an embedding of the lattice of `R`-submodules into
the lattice of `S`-submodules. -/
@[simps]
def restrictScalarsEmbedding : Submodule R M ↪o Submodule S M

(S : Type u_1)
(R : Type u_2)
(M : Type u_3)
[Semiring R]
[AddCommMonoid M]
[Semiring S]
[Module S M]
[Module R M]
[SMul S R]
[IsScalarTower S R M]
(V : Submodule R M)

(Submodule.restrictScalarsEmbedding S R M) V = Submodule.restrictScalars S V


theorem cocycle (i j k : 𝒰.J) : t' 𝒰 f g i j k ≫ t' 𝒰 f g j k i ≫ t' 𝒰 f g k i j = 𝟙 _

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

AlgebraicGeometry.Scheme.Pullback.t' 𝒰 f g i j k ≫
    AlgebraicGeometry.Scheme.Pullback.t' 𝒰 f g j k i ≫ AlgebraicGeometry.Scheme.Pullback.t' 𝒰 f g k i j =
  𝟙
    (CategoryTheory.Limits.pullback (AlgebraicGeometry.Scheme.Pullback.fV 𝒰 f g i j)
      (AlgebraicGeometry.Scheme.Pullback.fV 𝒰 f g i k))


theorem Disjoint.sup_right (hb : Disjoint a b) (hc : Disjoint a c) : Disjoint a (b ⊔ c)

{α : Type u_1}
[DistribLattice α]
[OrderBot α]
{a b c : α}
(hb : Disjoint a b)
(hc : Disjoint a c)


/-- Given a `ContinuousFunctionalCalculus S q`. If we form the predicate `p` for `a : A`
characterized by: `q a` and the spectrum of `a` restricts to the scalar subring `R` via
`f : C(S, R)`, then we can get a restricted functional calculus
`ContinuousFunctionalCalculus R p`. -/
protected theorem cfc (f : C(S, R)) (halg : UniformEmbedding (algebraMap R S)) (h0 : p 0)
    (h : ∀ a, p a ↔ q a ∧ SpectrumRestricts a f) (h_cpct : ∀ a, q a → CompactSpace (spectrum S a)) :
    ContinuousFunctionalCalculus R p

(halg : UniformEmbedding ⇑(algebraMap R S))

(h : ∀ (a : A), p a ↔ q a ∧ SpectrumRestricts a ⇑f)

(h_cpct : ∀ (a : A), q a → CompactSpace ↑(spectrum S a))


@[to_additive]
theorem inter_smul_union_subset_union [DecidableEq α] : (s₁ ∩ s₂) • (t₁ ∪ t₂) ⊆ s₁ • t₁ ∪ s₂ • t₂

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


/-- Product of a multiset of elements in a subgroup of a `CommGroup` is in the subgroup. -/
@[to_additive "Sum of a multiset of elements in an `AddSubgroup` of an `AddCommGroup` is in
 the `AddSubgroup`."]
protected theorem multiset_prod_mem {G} [CommGroup G] (K : Subgroup G) (g : Multiset G) :
    (∀ a ∈ g, a ∈ K) → g.prod ∈ K

{G : Type u_3}
[CommGroup G]
(K : Subgroup G)
(g : Multiset G)


theorem Summable.mul_left (a) (hf : Summable f) : Summable fun i ↦ a * f i

{ι : Type u_1}
{α : Type u_4}
[NonUnitalNonAssocSemiring α]
[TopologicalSpace α]
[TopologicalSemiring α]
{f : ι → α}
(a : α)
(hf : Summable f)


protected theorem secondCountableTopology [SecondCountableTopology Y]
    (h : X ≃ₜ Y) : SecondCountableTopology X

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


/-- An ideal `I` is local iff its Jacobson radical is maximal. -/
class IsLocal (I : Ideal R) : Prop where
  /-- A ring `R` is local if and only if its jacobson radical is maximal -/
  out : IsMaximal (jacobson I)

{R : Type u}
[CommRing R]
{I : Ideal R}
[self : I.IsLocal]


theorem of_add_nat (m : ℕ) (h : Irrational (x + m)) : Irrational x

{x : ℝ}
(m : ℕ)
(h : Irrational (x + ↑m))


theorem Rel.neg {R : Type uR} [Ring R] {r : R → R → Prop} ⦃a b : R⦄ (h : Rel r a b) :
    Rel r (-a) (-b)

{R : Type uR}
[Ring R]
{r : R → R → Prop}
⦃a b : R⦄
(h : RingQuot.Rel r a b)


@[to_additive (attr := simp, norm_cast)]
theorem coe_div [Div β] (f g : α →ₛ β) : ⇑(f / g) = ⇑f / ⇑g

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
[Sub β]
(f g : MeasureTheory.SimpleFunc α β)


@[simp]
theorem unitCoeff_coe {x : ℤ_[p]} (hx : x ≠ 0) :
    (unitCoeff hx : ℚ_[p]) = x * (p : ℚ_[p]) ^ (-x.valuation)

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

↑↑(PadicInt.unitCoeff hx) = ↑x * ↑p ^ (-x.valuation)


theorem Prefunctor.isCovering_of_bijective_star (h : ∀ u, Bijective (φ.star u)) : φ.IsCovering

(h : ∀ (u : U), Function.Bijective (φ.star u))


theorem comp (hg : MeasurableEmbedding g) (hf : MeasurableEmbedding f) :
    MeasurableEmbedding (g ∘ f)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{mα : MeasurableSpace α}
[MeasurableSpace β]
[MeasurableSpace γ]
{f : α → β}
{g : β → γ}
(hg : MeasurableEmbedding g)
(hf : MeasurableEmbedding f)


lemma card_le_card_of_surjective {α : Type u} {β : Type v} [Finite α] (f : α → β)
    (hf : Surjective f) : Nat.card β ≤ Nat.card α

{α : Type u}
{β : Type v}
[Finite α]
(f : α → β)
(hf : Function.Surjective f)


/-- Dual of `Monotone.covariant_of_const` -/
theorem Antitone.covariant_of_const [CovariantClass M N μ (· ≤ ·)] (hf : Antitone f) (m : M) :
    Antitone (f <| μ m ·)

[CovariantClass M N μ fun x x_1 => x ≤ x_1]


lemma KaehlerDifferential.mvPolynomialBasis_repr_comp_D (σ) :
    (mvPolynomialBasis R σ).repr.toLinearMap.compDer (D _ _) =
      MvPolynomial.mkDerivation _ (Finsupp.single · 1)

(R : Type u)
[CommRing R]
(σ : Type u_1)

(↑(KaehlerDifferential.mvPolynomialBasis R σ).repr).compDer (KaehlerDifferential.D R (MvPolynomial σ R)) =
  MvPolynomial.mkDerivation R fun x => Finsupp.single x 1


theorem HasMFDerivAt.congr_mfderiv (h : HasMFDerivAt I I' f x f') (h' : f' = f₁') :
    HasMFDerivAt I I' f x f₁'

{f' f₁' : TangentSpace I x →L[𝕜] TangentSpace I' (f x)}


@[simp]
theorem coe_id : ⇑(StarAlgHom.id R A) = id

(R : Type u_2)
(A : Type u_3)
[CommSemiring R]
[Semiring A]
[Algebra R A]
[Star A]


theorem Quotient.out_injective {s : Setoid α} : Function.Injective (@Quotient.out α s)


nonrec theorem DenseRange.nonempty_iff (hf : DenseRange f) : Nonempty α ↔ Nonempty X

{X : Type u_1}
[TopologicalSpace X]
{α : Type u_4}
{f : α → X}
(hf : DenseRange f)


/-- Recursion on `Nat.Partrec.Code` is computable. -/
theorem rec_computable {α σ} [Primcodable α] [Primcodable σ] {c : α → Code} (hc : Computable c)
    {z : α → σ} (hz : Computable z) {s : α → σ} (hs : Computable s) {l : α → σ} (hl : Computable l)
    {r : α → σ} (hr : Computable r) {pr : α → Code × Code × σ × σ → σ} (hpr : Computable₂ pr)
    {co : α → Code × Code × σ × σ → σ} (hco : Computable₂ co) {pc : α → Code × Code × σ × σ → σ}
    (hpc : Computable₂ pc) {rf : α → Code × σ → σ} (hrf : Computable₂ rf) :
    let PR (a) cf cg hf hg := pr a (cf, cg, hf, hg)
    let CO (a) cf cg hf hg := co a (cf, cg, hf, hg)
    let PC (a) cf cg hf hg := pc a (cf, cg, hf, hg)
    let RF (a) cf hf := rf a (cf, hf)
    let F (a : α) (c : Code) : σ :=
      Nat.Partrec.Code.recOn c (z a) (s a) (l a) (r a) (PR a) (CO a) (PC a) (RF a)
    Computable fun a => F a (c a)

{pr : α → Nat.Partrec.Code × Nat.Partrec.Code × σ × σ → σ}

{co : α → Nat.Partrec.Code × Nat.Partrec.Code × σ × σ → σ}

{pc : α → Nat.Partrec.Code × Nat.Partrec.Code × σ × σ → σ}

let PR := fun a cf cg hf hg => pr a (cf, cg, hf, hg);
let CO := fun a cf cg hf hg => co a (cf, cg, hf, hg);
let PC := fun a cf cg hf hg => pc a (cf, cg, hf, hg);
let RF := fun a cf hf => rf a (cf, hf);
let F := fun a c => Nat.Partrec.Code.recOn c (z a) (s a) (l a) (r a) (PR a) (CO a) (PC a) (RF a);
Computable fun a => F a (c a)


/-- Uniform integrability is preserved by restriction of the measure to a set. -/
protected theorem restrict (hf : UnifIntegrable f p μ) (E : Set α) :
    UnifIntegrable f p (μ.restrict E)

{f : ι → α → β}

(hf : MeasureTheory.UnifIntegrable f p μ)

MeasureTheory.UnifIntegrable f p (μ.restrict E)


/-- Bessel's inequality. -/
theorem Orthonormal.tsum_inner_products_le (hv : Orthonormal 𝕜 v) :
    ∑' i, ‖⟪v i, x⟫‖ ^ 2 ≤ ‖x‖ ^ 2

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{ι : Type u_4}
(x : E)
{v : ι → E}
(hv : Orthonormal 𝕜 v)


theorem Or.elim3 {c d : Prop} (h : a ∨ b ∨ c) (ha : a → d) (hb : b → d) (hc : c → d) : d

{a b c d : Prop}
(h : a ∨ b ∨ c)
(ha : a → d)
(hb : b → d)
(hc : c → d)


protected theorem nonempty (α : Type*) [Infinite α] : Nonempty α


@[simp] theorem sign_sign : sign (sign x) = sign x


theorem isAtom_iff {f : ∀ i, π i} [∀ i, PartialOrder (π i)] [∀ i, OrderBot (π i)] :
    IsAtom f ↔ ∃ i, IsAtom (f i) ∧ ∀ j, j ≠ i → f j = ⊥

{ι : Type u_4}
{π : ι → Type u}
{f : (i : ι) → π i}
[(i : ι) → PartialOrder (π i)]
[(i : ι) → OrderBot (π i)]

IsAtom f ↔ ∃ i, IsAtom (f i) ∧ ∀ (j : ι), j ≠ i → f j = ⊥


@[to_additive]
theorem mul_left_cancel'' [ContravariantClass α α (· * ·) (· ≤ ·)] {a b c : α} (h : a * b = a * c) :
    b = c

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


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

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

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


theorem some_sdiff_some [SDiff α] (a b : α) : some a \ some b = some (a \ b)

Part.some a \ Part.some b = Part.some (a \ b)


@[simp]
theorem subset_union_right {s t : Set α} : t ⊆ s ∪ t


@[to_additive sum_pos']
theorem one_lt_prod' (h : ∀ i ∈ s, 1 ≤ f i) (hs : ∃ i ∈ s, 1 < f i) : 1 < ∏ i ∈ s, f i

{ι : Type u_1}
{M : Type u_4}
[OrderedCancelCommMonoid M]
{f : ι → M}
{s : Finset ι}
(h : ∀ i ∈ s, 1 ≤ f i)
(hs : ∃ i ∈ s, 1 < f i)


theorem projective_iff_injective_op {P : C} : Projective P ↔ Injective (op P)

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

CategoryTheory.Projective P ↔ CategoryTheory.Injective (Opposite.op P)


theorem Finset.isGδ_compl [T1Space X] (s : Finset X) : IsGδ (sᶜ : Set X)

{X : Type u_1}
[TopologicalSpace X]
[T1Space X]
(s : Finset X)


@[arith_mult]
theorem natCast {f : ArithmeticFunction ℕ} [Semiring R] (h : f.IsMultiplicative) :
    IsMultiplicative (f : ArithmeticFunction R)

{R : Type u_1}
{f : ArithmeticFunction ℕ}
[Semiring R]
(h : f.IsMultiplicative)


protected theorem list_sum_mem {L : List A} (h : ∀ x ∈ L, x ∈ S) : L.sum ∈ S

{R : Type u}
{A : Type v}
[CommSemiring R]
[Semiring A]
[Algebra R A]
(S : Subalgebra R A)
{L : List A}
(h : ∀ x ∈ L, x ∈ S)


/-- Composition of monoid homomorphisms is associative. -/
@[to_additive "Composition of additive monoid homomorphisms is associative."]
theorem OneHom.comp_assoc {Q : Type*} [One M] [One N] [One P] [One Q]
    (f : OneHom M N) (g : OneHom N P) (h : OneHom P Q) :
    (h.comp g).comp f = h.comp (g.comp f)

{M : Type u_4}
{N : Type u_5}
{P : Type u_6}
{Q : Type u_10}
[Zero M]
[Zero N]
[Zero P]
[Zero Q]
(f : ZeroHom M N)
(g : ZeroHom N P)
(h : ZeroHom P Q)


theorem subseq_forall_of_frequently {ι : Type*} {x : ℕ → ι} {p : ι → Prop} {l : Filter ι}
    (h_tendsto : Tendsto x atTop l) (h : ∃ᶠ n in atTop, p (x n)) :
    ∃ ns : ℕ → ℕ, Tendsto (fun n => x (ns n)) atTop l ∧ ∀ n, p (x (ns n))

(h_tendsto : Filter.Tendsto x Filter.atTop l)

(h : ∃ᶠ (n : ℕ) in Filter.atTop, p (x n))

∃ ns, Filter.Tendsto (fun n => x (ns n)) Filter.atTop l ∧ ∀ (n : ℕ), p (x (ns n))


protected theorem ne_top_of_tsum_ne_top (h : ∑' a, f a ≠ ∞) (a : α) : f a ≠ ∞

{α : Type u_1}
{f : α → ℝ≥0∞}
(h : ∑' (a : α), f a ≠ ⊤)
(a : α)


theorem ResidueField.algebraMap_eq : algebraMap R (ResidueField R) = residue R

(R : Type u_1)
[CommRing R]
[LocalRing R]

algebraMap R (LocalRing.ResidueField R) = LocalRing.residue R


@[simp]
theorem map_id : map (id : M →ₗ[R] M) (id : N →ₗ[R] N) = .id

{R : Type u_1}
[CommSemiring R]
{M : Type u_4}
{N : Type u_5}
[AddCommMonoid M]
[AddCommMonoid N]
[Module R M]
[Module R N]

TensorProduct.map LinearMap.id LinearMap.id = LinearMap.id


@[to_additive]
lemma ne_bot_iff_exists_ne_one {H : Subgroup G} : H ≠ ⊥ ↔ ∃ a : ↥H, a ≠ 1

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

H ≠ ⊥ ↔ ∃ a, a ≠ 0


/-- The product of `f i` over `i ∈ {a, b}`, `a ≠ b`, is equal to `f a * f b`. -/
@[to_additive "The sum of `f i` over `i ∈ {a, b}`, `a ≠ b`, is equal to `f a + f b`."]
theorem finprod_mem_pair (h : a ≠ b) : (∏ᶠ i ∈ ({a, b} : Set α), f i) = f a * f b

{α : Type u_1}
{M : Type u_5}
[AddCommMonoid M]
{f : α → M}
{a b : α}
(h : a ≠ b)

∑ᶠ (i : α) (_ : i ∈ {a, b}), f i = f a + f b


@[simp]
theorem compl_Ici : (Ici a)ᶜ = Iio a


theorem toNat_le (c : Bool) : c.toNat ≤ 1


protected theorem add_sub_add_right (n k m : Nat) : (n + k) - (m + k) = n - m


theorem monotone_sizeUpTo : Monotone c.sizeUpTo


protected theorem closure (h : e.IsImage s t) : e.IsImage (closure s) (closure t)

{X : Type u_1}
{Y : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
{e : PartialHomeomorph X Y}
{s : Set X}
{t : Set Y}
(h : e.IsImage s t)