/-- Let `X` be a locally compact sigma compact Hausdorff topological space, let `s` be a closed set
in `X`. Suppose that for each `x ∈ s` the sets `B x : ι x → Set X` with the predicate
`p x : ι x → Prop` form a basis of the filter `𝓝 x`. Then there exists a locally finite covering
`fun i ↦ B (c i) (r i)` of `s` such that all “centers” `c i` belong to `s` and each `r i` satisfies
`p (c i)`.

The notation is inspired by the case `B x r = Metric.ball x r` but the theorem applies to
`nhds_basis_opens` as well. If the covering must be subordinate to some open covering of `s`, then
the user should use a basis obtained by `Filter.HasBasis.restrict_subset` or a similar lemma, see
the proof of `paracompact_of_locallyCompact_sigmaCompact` for an example.

The formalization is based on two [ncatlab](https://ncatlab.org/) proofs:
* [locally compact and sigma compact spaces are paracompact](https://ncatlab.org/nlab/show/locally+compact+and+sigma-compact+spaces+are+paracompact);
* [open cover of smooth manifold admits locally finite refinement by closed balls](https://ncatlab.org/nlab/show/partition+of+unity#ExistenceOnSmoothManifolds).

See also `refinement_of_locallyCompact_sigmaCompact_of_nhds_basis` for a version of this lemma
dealing with a covering of the whole space.

In most cases (namely, if `B c r ∪ B c r'` is again a set of the form `B c r''`) it is possible
to choose `α = X`. This fact is not yet formalized in `mathlib`. -/
theorem refinement_of_locallyCompact_sigmaCompact_of_nhds_basis_set [WeaklyLocallyCompactSpace X]
    [SigmaCompactSpace X] [T2Space X] {ι : X → Type u} {p : ∀ x, ι x → Prop} {B : ∀ x, ι x → Set X}
    {s : Set X} (hs : IsClosed s) (hB : ∀ x ∈ s, (𝓝 x).HasBasis (p x) (B x)) :
    ∃ (α : Type v) (c : α → X) (r : ∀ a, ι (c a)),
      (∀ a, c a ∈ s ∧ p (c a) (r a)) ∧
        (s ⊆ ⋃ a, B (c a) (r a)) ∧ LocallyFinite fun a ↦ B (c a) (r a)

∃ α c r, (∀ (a : α), c a ∈ s ∧ p (c a) (r a)) ∧ s ⊆ ⋃ a, B (c a) (r a) ∧ LocallyFinite fun a => B (c a) (r a)


@[simp]
theorem mapOfLE_comp_valuation (R S : ValuationSubring K) (h : R ≤ S) :
    R.mapOfLE S h ∘ R.valuation = S.valuation

{K : Type u}
[Field K]
(R S : ValuationSubring K)
(h : R ≤ S)

⇑(R.mapOfLE S h) ∘ ⇑R.valuation = ⇑S.valuation


theorem bind_covering {S : Sieve X} {R : ∀ ⦃Y : C⦄ ⦃f : Y ⟶ X⦄, S f → Sieve Y} (hS : S ∈ J X)
    (hR : ∀ ⦃Y⦄ ⦃f : Y ⟶ X⦄ (H : S f), R H ∈ J Y) : Sieve.bind S R ∈ J X

(J : CategoryTheory.GrothendieckTopology C)

{R : ⦃Y : C⦄ → ⦃f : Y ⟶ X⦄ → S.arrows f → CategoryTheory.Sieve Y}

(hR : ∀ ⦃Y : C⦄ ⦃f : Y ⟶ X⦄ (H : S.arrows f), R H ∈ J.sieves Y)

CategoryTheory.Sieve.bind S.arrows R ∈ J.sieves X


@[simp]
theorem uniformOfFinset_apply (a : α) :
    uniformOfFinset s hs a = if a ∈ s then (s.card : ℝ≥0∞)⁻¹ else 0

{α : Type u_1}
{s : Finset α}
(hs : s.Nonempty)
(a : α)

(PMF.uniformOfFinset s hs) a = if a ∈ s then (↑s.card)⁻¹ else 0


theorem exact_iff_exact_image_ι :
    S.Exact ↔ (ShortComplex.mk (Abelian.image.ι S.f) S.g
      (Abelian.image_ι_comp_eq_zero S.zero)).Exact

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.Abelian C]
(S : CategoryTheory.ShortComplex C)

S.Exact ↔ (CategoryTheory.ShortComplex.mk (CategoryTheory.Abelian.image.ι S.f) S.g ⋯).Exact


/-- A function `f` from `Finset α` is antitone if and only if `f (insert a s) ≤ f s` for all
`s` and `a ∉ s`. -/
lemma antitone_iff_forall_insert_le : Antitone f ↔ ∀ s ⦃a⦄, a ∉ s → f (insert a s) ≤ f s

{α : Type u_1}
{β : Type u_2}
[Preorder β]
{f : Finset α → β}
[DecidableEq α]

Antitone f ↔ ∀ (s : Finset α) ⦃a : α⦄, a ∉ s → f (insert a s) ≤ f s


theorem ext_s {q₁ q₂ : Semiquot α} : q₁ = q₂ ↔ q₁.s = q₂.s


theorem l_iInf_u [CompleteLattice α] [CompleteLattice β] (gi : GaloisInsertion l u) {ι : Sort x}
    (f : ι → β) : l (⨅ i, u (f i)) = ⨅ i, f i

{α : Type u}
{β : Type v}
{l : α → β}
{u : β → α}
[CompleteLattice α]
[CompleteLattice β]
(gi : GaloisInsertion l u)
{ι : Sort x}
(f : ι → β)


theorem ConvexOn.add_strictConvexOn (hf : ConvexOn 𝕜 s f) (hg : StrictConvexOn 𝕜 s g) :
    StrictConvexOn 𝕜 s (f + g)

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_5}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[OrderedCancelAddCommMonoid β]
[SMul 𝕜 E]
[DistribMulAction 𝕜 β]
{s : Set E}
{f g : E → β}
(hf : ConvexOn 𝕜 s f)
(hg : StrictConvexOn 𝕜 s g)


/-- If `M` and `M'` lie in the same universe, the `S`-rank of `M ⊗[R] M'` is
  `(Module.rank S M) * (Module.rank R M')`. -/
theorem rank_tensorProduct' :
    Module.rank R (M ⊗[S] M₁) = Module.rank R M * Module.rank S M₁

{R S : Type u}
{M M₁ : Type v}
[Ring R]
[CommRing S]
[AddCommGroup M]
[AddCommGroup M₁]
[StrongRankCondition R]
[StrongRankCondition S]
[Module S M]
[Module S M₁]
[Module.Free S M₁]
[Algebra S R]
[Module R M]
[IsScalarTower S R M]
[Module.Free R M]

Module.rank R (TensorProduct S M M₁) = Module.rank R M * Module.rank S M₁


lemma iInf_eq_zero : ⨅ i, (f i : ℕ∞) = 0 ↔ ∃ i, f i = 0


/-- A complex polarization identity, with a linear map
-/
theorem inner_map_polarization (T : V →ₗ[ℂ] V) (x y : V) :
    ⟪T y, x⟫_ℂ =
      (⟪T (x + y), x + y⟫_ℂ - ⟪T (x - y), x - y⟫_ℂ +
            Complex.I * ⟪T (x + Complex.I • y), x + Complex.I • y⟫_ℂ -
          Complex.I * ⟪T (x - Complex.I • y), x - Complex.I • y⟫_ℂ) /
        4

{V : Type u_4}
[NormedAddCommGroup V]
[InnerProductSpace ℂ V]
(T : V →ₗ[ℂ] V)
(x y : V)


theorem isEmpty_coe_sort {s : Set α} : IsEmpty (↥s) ↔ s = ∅


lemma pow_cpow_nat_inv {x : ℂ} {n : ℕ} (h₀ : n ≠ 0) (hlt : -(π / n) < x.arg) (hle : x.arg ≤ π / n) :
    (x ^ n) ^ (n⁻¹ : ℂ) = x

{x : ℂ}
{n : ℕ}
(h₀ : n ≠ 0)
(hlt : -(π / ↑n) < x.arg)
(hle : x.arg ≤ π / ↑n)


/-- An `AffineMap k P1 P2` (notation: `P1 →ᵃ[k] P2`) is a map from `P1` to `P2` that
induces a corresponding linear map from `V1` to `V2`. -/
structure AffineMap (k : Type*) {V1 : Type*} (P1 : Type*) {V2 : Type*} (P2 : Type*) [Ring k]
  [AddCommGroup V1] [Module k V1] [AffineSpace V1 P1] [AddCommGroup V2] [Module k V2]
  [AffineSpace V2 P2] where
  toFun : P1 → P2
  linear : V1 →ₗ[k] V2
  map_vadd' : ∀ (p : P1) (v : V1), toFun (v +ᵥ p) = linear v +ᵥ toFun p

{k : Type u_1}
{V1 : Type u_2}
{P1 : Type u_3}
{V2 : Type u_4}
{P2 : Type u_5}
[Ring k]
[AddCommGroup V1]
[Module k V1]
[AffineSpace V1 P1]
[AddCommGroup V2]
[Module k V2]
[AffineSpace V2 P2]
(self : P1 →ᵃ[k] P2)
(p : P1)
(v : V1)

self.toFun (v +ᵥ p) = self.linear v +ᵥ self.toFun p


/-- The composition of `mapEquiv`s is carried over the `EquivFunctor`.
For plain `Functor`s, this lemma is named `map_map` when applied
or `map_comp_map` when not applied.
-/
@[simp]
theorem mapEquiv_trans {γ : Type u₀} (ab : α ≃ β) (bc : β ≃ γ) :
    (mapEquiv f ab).trans (mapEquiv f bc) = mapEquiv f (ab.trans bc)

(f : Type u₀ → Type u₁)
[EquivFunctor f]
{α β γ : Type u₀}
(ab : α ≃ β)
(bc : β ≃ γ)

(EquivFunctor.mapEquiv f ab).trans (EquivFunctor.mapEquiv f bc) = EquivFunctor.mapEquiv f (ab.trans bc)


/-- If `S` is the localization of `R` away from `r`, we can construct a natural
presentation of `S` as `R`-algebra with a single generator `X` and the relation `r * X - 1 = 0`. -/
@[simps relation, simps (config := .lemmasOnly) rels]
noncomputable def localizationAway : Presentation R S

{R : Type u}
{S : Type v}
[CommRing R]
[CommRing S]
[Algebra R S]
(r : R)
[IsLocalization.Away r S]

∀ (x : Unit), (Algebra.Presentation.localizationAway r).relation x = MvPolynomial.C r * MvPolynomial.X () - 1


/-- The composition of homology map data. -/
@[simps]
def comp {φ : S₁ ⟶ S₂} {φ' : S₂ ⟶ S₃} {h₁ : S₁.HomologyData}
    {h₂ : S₂.HomologyData} {h₃ : S₃.HomologyData}
    (ψ : HomologyMapData φ h₁ h₂) (ψ' : HomologyMapData φ' h₂ h₃) :
    HomologyMapData (φ ≫ φ') h₁ h₃

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

(ψ : CategoryTheory.ShortComplex.HomologyMapData φ h₁ h₂)

(ψ' : CategoryTheory.ShortComplex.HomologyMapData φ' h₂ h₃)


lemma single_eq_indicator (b : α) : single i b = indicator {i} (fun _ _ => b)

{ι : Type u_1}
{α : Type u_2}
[Zero α]
(i : ι)
(b : α)

Finsupp.single i b = Finsupp.indicator {i} fun x x => b


@[simp]
theorem mk_eq_zero (α : Type u) [IsEmpty α] : #α = 0


lemma continuousOn_sinKernel (a : UnitAddCircle) : ContinuousOn (sinKernel a) (Ioi 0)

ContinuousOn (HurwitzZeta.sinKernel a) (Set.Ioi 0)


theorem deriv_circleMap_ne_zero {c : ℂ} {R : ℝ} {θ : ℝ} (hR : R ≠ 0) :
    deriv (circleMap c R) θ ≠ 0


theorem isCompl_sup_right_of_isCompl_sup_left [Lattice α] [BoundedOrder α] [IsModularLattice α]
    (h : Disjoint a b) (hcomp : IsCompl (a ⊔ b) c) :
    IsCompl a (b ⊔ c)

{α : Type u_1}
{a b c : α}
[Lattice α]
[BoundedOrder α]
[IsModularLattice α]
(h : Disjoint a b)
(hcomp : IsCompl (a ⊔ b) c)


/-- A metric space is second countable if one can reconstruct up to any `ε>0` any element of the
space from countably many data. -/
theorem secondCountable_of_countable_discretization {α : Type u} [MetricSpace α]
    (H : ∀ ε > (0 : ℝ), ∃ (β : Type*) (_ : Encodable β) (F : α → β),
      ∀ x y, F x = F y → dist x y ≤ ε) :
    SecondCountableTopology α

(H : ∀ ε > 0, ∃ β x F, ∀ (x y : α), F x = F y → dist x y ≤ ε)


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

(HomologicalComplex.opEquivalence V c).counitIso = HomologicalComplex.opCounitIso V c


@[reassoc]
theorem coequalizer.π_desc {W : C} (k : Y ⟶ W) (h : f ≫ k = g ≫ k) :
    coequalizer.π f g ≫ coequalizer.desc k h = k

(h : CategoryTheory.CategoryStruct.comp f k = CategoryTheory.CategoryStruct.comp g k)

CategoryTheory.CategoryStruct.comp (CategoryTheory.Limits.coequalizer.π f g)
    (CategoryTheory.Limits.coequalizer.desc k h) =
  k


lemma eq_presheaf_map_eqToHom {V W : Opens U} (e : U.ι ''ᵁ V = U.ι ''ᵁ W) :
    X.presheaf.map (eqToHom e).op =
      U.toScheme.presheaf.map (eqToHom <| U.openEmbedding.functor_obj_injective e).op

(e : (AlgebraicGeometry.Scheme.Hom.opensFunctor U.ι).obj V = (AlgebraicGeometry.Scheme.Hom.opensFunctor U.ι).obj W)

X.presheaf.map (CategoryTheory.eqToHom e).op = (↑U).presheaf.map (CategoryTheory.eqToHom ⋯).op


theorem DifferentiableAt.norm (hf : DifferentiableAt ℝ f x) (h0 : f x ≠ 0) :
    DifferentiableAt ℝ (fun y => ‖f y‖) x

(𝕜 : Type u_1)
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[NormedSpace ℝ E]
{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace ℝ G]
{f : G → E}
{x : G}
(hf : DifferentiableAt ℝ f x)
(h0 : f x ≠ 0)


theorem le_iInf₂_iff {f : ∀ i, κ i → α} : (a ≤ ⨅ (i) (j), f i j) ↔ ∀ i j, a ≤ f i j

{α : Type u_1}
{ι : Sort u_5}
{κ : ι → Sort u_7}
[CompleteLattice α]
{a : α}
{f : (i : ι) → κ i → α}

a ≤ ⨅ i, ⨅ j, f i j ↔ ∀ (i : ι) (j : κ i), a ≤ f i j


@[to_additive (attr := simp)]
theorem coe_zpow (s : Finset α) : ∀ n : ℤ, ↑(s ^ n) = (s : Set α) ^ n

{α : Type u_2}
[DecidableEq α]
[SubtractionMonoid α]
(s : Finset α)
(n : ℤ)


@[simp] lemma natDegree_X_pow_mul (hp : p ≠ 0) : natDegree (X ^ n * p) = natDegree p + n

{R : Type u}
[Semiring R]
[Nontrivial R]
{p : R[X]}
(n : ℕ)
(hp : p ≠ 0)

(Polynomial.X ^ n * p).natDegree = p.natDegree + n


@[simp] theorem id_comp (f : SupHom α β) : (SupHom.id β).comp f = f

{α : Type u_3}
{β : Type u_4}
[Sup α]
[Sup β]
(f : SupHom α β)


theorem coeff_erase (p : R[X]) (n i : ℕ) :
    (p.erase n).coeff i = if i = n then 0 else p.coeff i

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

(Polynomial.erase n p).coeff i = if i = n then 0 else p.coeff i


@[simp]
theorem coe_countPAddMonoidHom : (countPAddMonoidHom p : Multiset α → ℕ) = countP p

{α : Type u_1}
(p : α → Prop)
[DecidablePred p]

⇑(Multiset.countPAddMonoidHom p) = Multiset.countP p


theorem modMonomial_add_divMonomial_single (x : MvPolynomial σ R) (i : σ) :
    x %ᵐᵒⁿᵒᵐⁱᵃˡ Finsupp.single i 1 + X i * (x /ᵐᵒⁿᵒᵐⁱᵃˡ Finsupp.single i 1) = x

{σ : Type u_1}
{R : Type u_2}
[CommSemiring R]
(x : MvPolynomial σ R)
(i : σ)

x.modMonomial (Finsupp.single i 1) + MvPolynomial.X i * x.divMonomial (Finsupp.single i 1) = x


theorem Separable.mul_unit {f g : R[X]} (hf : f.Separable) (hg : IsUnit g) : (f * g).Separable

{R : Type u}
[CommSemiring R]
{f g : R[X]}
(hf : f.Separable)
(hg : IsUnit g)


theorem ext_num_den_iff : p = q ↔ p.num = q.num ∧ p.den = q.den


theorem eq_one_iff' {a : ℕ} (ha0 : (a : ZMod p) ≠ 0) :
    legendreSym p a = 1 ↔ IsSquare (a : ZMod p)

(p : ℕ)
[Fact (Nat.Prime p)]
{a : ℕ}
(ha0 : ↑a ≠ 0)


theorem mem_lowerBounds_image (Hf : MonotoneOn f t) (Hst : s ⊆ t) (Has : a ∈ lowerBounds s)
    (Hat : a ∈ t) : f a ∈ lowerBounds (f '' s)

{α : Type u}
{β : Type v}
[Preorder α]
[Preorder β]
{f : α → β}
{s t : Set α}
{a : α}
(Hf : MonotoneOn f t)
(Hst : s ⊆ t)
(Has : a ∈ lowerBounds s)
(Hat : a ∈ t)


theorem derivative_X_add_C_sq (c : R) : derivative ((X + C c) ^ 2) = C 2 * (X + C c)

Polynomial.derivative ((Polynomial.X + Polynomial.C c) ^ 2) = Polynomial.C 2 * (Polynomial.X + Polynomial.C c)


theorem midpoint_mem_segment [Invertible (2 : 𝕜)] (x y : E) : midpoint 𝕜 x y ∈ [x -[𝕜] y]

{𝕜 : Type u_1}
{E : Type u_2}
[LinearOrderedRing 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[Invertible 2]
(x y : E)


@[simp] theorem maximum?_nil [Max α] : ([] : List α).maximum? = none


/-- `x ↦ fderiv 𝕜 (f x) (g x) (k x)` is smooth. -/
theorem ContDiff.fderiv_apply {f : E → F → G} {g k : E → F} {n m : ℕ∞}
    (hf : ContDiff 𝕜 m <| Function.uncurry f) (hg : ContDiff 𝕜 n g) (hk : ContDiff 𝕜 n k)
    (hnm : n + 1 ≤ m) : ContDiff 𝕜 n fun x => fderiv 𝕜 (f x) (g x) (k x)

(hf : ContDiff 𝕜 m (Function.uncurry f))

ContDiff 𝕜 n fun x => (fderiv 𝕜 (f x) (g x)) (k x)


/-- `IsAdjoinRootMonic.liftPolyₗ` lifts a linear map on polynomials to a linear map on `S`. -/
@[simps!]
def liftPolyₗ {T : Type*} [AddCommGroup T] [Module R T] (h : IsAdjoinRootMonic S f)
    (g : R[X] →ₗ[R] T) : S →ₗ[R] T

{R : Type u}
{S : Type v}
[CommRing R]
[Ring S]
{f : R[X]}
[Algebra R S]
{T : Type u_1}
[AddCommGroup T]
[Module R T]
(h : IsAdjoinRootMonic S f)
(g : R[X] →ₗ[R] T)

∀ (a : S), (h.liftPolyₗ g) a = g (h.modByMonicHom a)


/-- Forgetting that maps are total and making them total again by adding a point is the same as just
adding a point. -/
@[simps!]
noncomputable def typeToPartialFunIsoPartialFunToPointed :
    typeToPartialFun ⋙ partialFunToPointed ≅ typeToPointed

(a : ((typeToPartialFun ⋙ partialFunToPointed).obj X).X)

(typeToPartialFunIsoPartialFunToPointed.hom.app X).toFun a = a


@[simp]
theorem preimage_cast_Ici (p : ℚ≥0) : (↑) ⁻¹' Ici (p : K) = Ici p

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


theorem minimum_le_coe_iff : l.minimum ≤ a ↔ ∃ b, b ∈ l ∧ b ≤ a

{α : Type u_1}
[LinearOrder α]
{l : List α}
{a : α}


@[simp]
theorem leadingCoeff_hermite (n : ℕ) : (hermite n).leadingCoeff = 1


theorem mem_singleton (a : α) : a ∈ ({a} : Set α)


theorem mem_cycleFactorsFinset_support_le {p f : Perm α} (h : p ∈ cycleFactorsFinset f) :
    p.support ≤ f.support

{α : Type u_2}
[DecidableEq α]
[Fintype α]
{p f : Equiv.Perm α}
(h : p ∈ f.cycleFactorsFinset)


@[simp]
theorem map_add_one : ∀ x, f (x + 1) = f x + 1


@[simp]
theorem _root_.aemeasurable_add_measure_iff :
    AEMeasurable f (μ + ν) ↔ AEMeasurable f μ ∧ AEMeasurable f ν

{α : Type u_2}
{β : Type u_3}
{m0 : MeasurableSpace α}
[MeasurableSpace β]
{f : α → β}
{μ ν : MeasureTheory.Measure α}


theorem isSheaf_comp_of_isSheaf (s : A ⥤ B) [PreservesLimitsOfSize.{v₁, max v₁ u₁} s]
    (h : IsSheaf J P) : IsSheaf J (P ⋙ s)

(J : CategoryTheory.GrothendieckTopology C)

[CategoryTheory.Limits.PreservesLimitsOfSize.{v₁, max v₁ u₁, v₂, v₃, u₂, u₃} s]

(h : CategoryTheory.Presheaf.IsSheaf J P)

CategoryTheory.Presheaf.IsSheaf J (P.comp s)


theorem pairwise_subtype_iff_pairwise_finset' (r : β → β → Prop) (f : α → β) :
    Pairwise (r on fun x : s => f x) ↔ (s : Set α).Pairwise (r on f)

{α : Type u_1}
{β : Type u_2}
{s : Finset α}
(r : β → β → Prop)
(f : α → β)

Pairwise (r on fun x => f ↑x) ↔ (↑s).Pairwise (r on f)


@[simp]
theorem ListBlank.cons_mk {Γ} [Inhabited Γ] (a : Γ) (l : List Γ) :
    ListBlank.cons a (ListBlank.mk l) = ListBlank.mk (a :: l)

{Γ : Type u_1}
[Inhabited Γ]
(a : Γ)
(l : List Γ)

Turing.ListBlank.cons a (Turing.ListBlank.mk l) = Turing.ListBlank.mk (a :: l)


theorem convex_halfspace_im_gt (r : ℝ) : Convex ℝ { c : ℂ | r < c.im }


theorem mem_minimals_setOf_iff {P : α → Prop} :
    x ∈ minimals r (setOf P) ↔ P x ∧ ∀ ⦃y⦄, P y → r y x → x = y

{α : Type u_1}
{r : α → α → Prop}
{x : α}
[IsAntisymm α r]
{P : α → Prop}

x ∈ minimals r (setOf P) ↔ P x ∧ ∀ ⦃y : α⦄, P y → r y x → x = y


/-- A countable sum of finite measures is s-finite.
This lemma is superseeded by the instance below. -/
lemma sfinite_sum_of_countable [Countable ι]
    (m : ι → Measure α) [∀ n, IsFiniteMeasure (m n)] : SFinite (Measure.sum m)

[∀ (n : ι), MeasureTheory.IsFiniteMeasure (m n)]


/-- Let `f : ℝ → ℝ` be a differentiable function. If `f'` is nonnegative, then
`f` is a monotone function. -/
theorem monotone_of_deriv_nonneg {f : ℝ → ℝ} (hf : Differentiable ℝ f) (hf' : ∀ x, 0 ≤ deriv f x) :
    Monotone f

{f : ℝ → ℝ}
(hf : Differentiable ℝ f)
(hf' : ∀ (x : ℝ), 0 ≤ deriv f x)


@[nontriviality]
theorem LinearDisjoint.of_subsingleton [Subsingleton R] : M.LinearDisjoint N

{R : Type u}
{S : Type v}
[CommSemiring R]
[Semiring S]
[Algebra R S]
{M N : Submodule R S}
[Subsingleton R]


theorem nsmul_add_modEq (n : ℕ) : n • p + a ≡ a [PMOD p]

{α : Type u_1}
[AddCommGroup α]
{p a : α}
(n : ℕ)


theorem pow_mem_pow {x : A} (hx : x ∈ M) (n : ℕ) : x ^ n ∈ M ^ n

{R : Type u}
[CommSemiring R]
{A : Type v}
[Semiring A]
[Algebra R A]
(M : Submodule R A)
{x : A}
(hx : x ∈ M)
(n : ℕ)


theorem sum_sub_index [∀ i, AddGroup (β i)] [∀ (i) (x : β i), Decidable (x ≠ 0)] [AddCommGroup γ]
    {f g : Π₀ i, β i} {h : ∀ i, β i → γ} (h_sub : ∀ i b₁ b₂, h i (b₁ - b₂) = h i b₁ - h i b₂) :
    (f - g).sum h = f.sum h - g.sum h

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

(h_sub : ∀ (i : ι) (b₁ b₂ : β i), h i (b₁ - b₂) = h i b₁ - h i b₂)


lemma isRightKanExtension_iff_of_iso₂ {F₁' F₂' : D ⥤ H} (α₁ : L ⋙ F₁' ⟶ F₁) (α₂ : L ⋙ F₂' ⟶ F₂)
    (e : F₁ ≅ F₂) (e' : F₁' ≅ F₂') (h : whiskerLeft L e'.hom ≫ α₂ = α₁ ≫ e.hom) :
    F₁'.IsRightKanExtension α₁ ↔ F₂'.IsRightKanExtension α₂

(h :
  CategoryTheory.CategoryStruct.comp (CategoryTheory.whiskerLeft L e'.hom) α₂ =
    CategoryTheory.CategoryStruct.comp α₁ e.hom)


lemma ball_mem_nhds [TopologicalSpace E] {p : Seminorm 𝕝 E} (hp : Continuous p) {r : ℝ}
    (hr : 0 < r) : p.ball 0 r ∈ (𝓝 0 : Filter E)

{𝕝 : Type u_6}
{E : Type u_7}
[SeminormedRing 𝕝]
[AddCommGroup E]
[Module 𝕝 E]
[TopologicalSpace E]
{p : Seminorm 𝕝 E}
(hp : Continuous ⇑p)
{r : ℝ}
(hr : 0 < r)


/-- A homeomorphism induces a partial homeomorphism on the whole space -/
@[simps! (config := mfld_cfg)]
def _root_.Homeomorph.toPartialHomeomorph (e : X ≃ₜ Y) : PartialHomeomorph X Y

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


/-- The morphism `snakeInput hS₁ i j hij ⟶ snakeInput hS₂ i j hij` induced by
a morphism `φ : S₁ ⟶ S₂` of short complexes of homological complexes, that
are short exact (`hS₁ : S₁.ShortExact` and `hS₂ : S₁.ShortExact`). -/
@[simps]
noncomputable def mapSnakeInput (i j : ι) (hij : c.Rel i j) :
    snakeInput hS₁ i j hij ⟶ snakeInput hS₂ i j hij

{S₁ S₂ : CategoryTheory.ShortComplex (HomologicalComplex C c)}

(HomologicalComplex.HomologySequence.mapSnakeInput φ hS₁ hS₂ i j hij).f₂ =
  (HomologicalComplex.cyclesFunctor C c j).mapShortComplex.map φ


@[simp]
theorem leftDual_rightDual {X : C} [HasRightDual X] : ᘁXᘁ = X

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


protected theorem injective (e : R ≃+* S) : Function.Injective e

{R : Type u_4}
{S : Type u_5}
[Mul R]
[Mul S]
[Add R]
[Add S]
(e : R ≃+* S)


protected theorem map_eq_one_iff : f x = 1 ↔ x = 1

{R : Type u_4}
{S : Type u_5}
[NonAssocSemiring R]
[NonAssocSemiring S]
(f : R ≃+* S)
{x : R}


@[simp] theorem length_utf8EncodeChar (c : Char) : (utf8EncodeChar c).length = c.utf8Size

(String.utf8EncodeChar c).length = c.utf8Size


@[simp]
theorem isPure_univ [Inhabited α] : @IsPure α univ ↔ Subsingleton α


lemma natCast_lt_natCast (han : a ≤ n) (hbn : b ≤ n) : (a : Fin (n + 1)) < b ↔ a < b


theorem unbounded_of_tendsto_atBot' [Nonempty α] [SemilatticeInf α] [Preorder β] [NoMinOrder β]
    {f : α → β} (h : Tendsto f atBot atBot) : ¬BddBelow (range f)

(h : Filter.Tendsto f Filter.atBot Filter.atBot)


@[simp]
theorem prod_repr_inl (x) (i) : (b.prod b').repr x (Sum.inl i) = b.repr x.1 i

{ι : Type u_1}
{ι' : Type u_2}
{R : Type u_3}
{M : Type u_6}
{M' : Type u_7}
[Semiring R]
[AddCommMonoid M]
[Module R M]
[AddCommMonoid M']
[Module R M']
(b : Basis ι R M)
(b' : Basis ι' R M')
(x : M × M')
(i : ι)

((b.prod b').repr x) (Sum.inl i) = (b.repr x.1) i


@[simp]
theorem ofSubalgebras_symm_apply (h : L₁'.map ↑e = L₂') (x : L₂') :
    ↑((e.ofSubalgebras _ _ h).symm x) = e.symm x

(h : LieSubalgebra.map e.toLieHom L₁' = L₂')

↑((LieEquiv.ofSubalgebras L₁' L₂' e h).symm x) = e.symm ↑x


theorem Coloring.colorClasses_finite [Finite α] : C.colorClasses.Finite

{V : Type u}
{G : SimpleGraph V}
{α : Type u_1}
(C : G.Coloring α)
[Finite α]


theorem lie_mem_sup_of_mem_normalizer {x y z : L} (hx : x ∈ H.normalizer) (hy : y ∈ (R ∙ x) ⊔ ↑H)
    (hz : z ∈ (R ∙ x) ⊔ ↑H) : ⁅y, z⁆ ∈ (R ∙ x) ⊔ ↑H

(hy : y ∈ Submodule.span R {x} ⊔ H.toSubmodule)

(hz : z ∈ Submodule.span R {x} ⊔ H.toSubmodule)

⁅y, z⁆ ∈ Submodule.span R {x} ⊔ H.toSubmodule


theorem lintegral_mono_set' {_ : MeasurableSpace α} ⦃μ : Measure α⦄ {s t : Set α} {f : α → ℝ≥0∞}
    (hst : s ≤ᵐ[μ] t) : ∫⁻ x in s, f x ∂μ ≤ ∫⁻ x in t, f x ∂μ

∀ {x : MeasurableSpace α} ⦃μ : MeasureTheory.Measure α⦄ {s t : Set α} {f : α → ℝ≥0∞},
  s ≤ᵐ[μ] t → ∫⁻ (x : α) in s, f x ∂μ ≤ ∫⁻ (x : α) in t, f x ∂μ


/-- Auxiliary lemma for Abel's limit theorem. The difference between the sum `l` at 1 and the
power series's value at a point `z` away from 1 can be rewritten as `1 - z` times a power series
whose coefficients are tail sums of `l`. -/
lemma abel_aux (h : Tendsto (fun n ↦ ∑ i ∈ range n, f i) atTop (𝓝 l)) {z : ℂ} (hz : ‖z‖ < 1) :
    Tendsto (fun n ↦ (1 - z) * ∑ i ∈ range n, (l - ∑ j ∈ range (i + 1), f j) * z ^ i)
      atTop (𝓝 (l - ∑' n, f n * z ^ n))

(h : Filter.Tendsto (fun n => ∑ i ∈ Finset.range n, f i) Filter.atTop (𝓝 l))

Filter.Tendsto (fun n => (1 - z) * ∑ i ∈ Finset.range n, (l - ∑ j ∈ Finset.range (i + 1), f j) * z ^ i) Filter.atTop
  (𝓝 (l - ∑' (n : ℕ), f n * z ^ n))


@[simp, mfld_simps]
theorem prod_trans (e : PartialHomeomorph X Y) (f : PartialHomeomorph Y Z)
    (e' : PartialHomeomorph X' Y') (f' : PartialHomeomorph Y' Z') :
    (e.prod e').trans (f.prod f') = (e.trans f).prod (e'.trans f')

{X : Type u_1}
{X' : Type u_2}
{Y : Type u_3}
{Y' : Type u_4}
{Z : Type u_5}
{Z' : Type u_6}
[TopologicalSpace X]
[TopologicalSpace X']
[TopologicalSpace Y]
[TopologicalSpace Y']
[TopologicalSpace Z]
[TopologicalSpace Z']
(e : PartialHomeomorph X Y)
(f : PartialHomeomorph Y Z)
(e' : PartialHomeomorph X' Y')
(f' : PartialHomeomorph Y' Z')


theorem Kernel.integral_integral_add ⦃f g : β × γ → E⦄ (hf : Integrable f ((κ ⊗ₖ η) a))
    (hg : Integrable g ((κ ⊗ₖ η) a)) :
    ∫ x, ∫ y, f (x, y) + g (x, y) ∂η (a, x) ∂κ a =
      ∫ x, ∫ y, f (x, y) ∂η (a, x) ∂κ a + ∫ x, ∫ y, g (x, y) ∂η (a, x) ∂κ a

{η : ProbabilityTheory.Kernel (α × β) γ}

⦃f g : β × γ → E⦄

(hf : MeasureTheory.Integrable f ((κ ⊗ₖ η) a))

(hg : MeasureTheory.Integrable g ((κ ⊗ₖ η) a))

∫ (x : β), ∫ (y : γ), f (x, y) + g (x, y) ∂η (a, x) ∂κ a =
  ∫ (x : β), ∫ (y : γ), f (x, y) ∂η (a, x) ∂κ a + ∫ (x : β), ∫ (y : γ), g (x, y) ∂η (a, x) ∂κ a


theorem Nodup.ndunion (s : Multiset α) {t : Multiset α} : Nodup t → Nodup (ndunion s t)

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


theorem Infinite.encard_eq {s : Set α} (h : s.Infinite) : s.encard = ⊤

{α : Type u_1}
{s : Set α}
(h : s.Infinite)


/-- A group homomorphism is injective iff its kernel is trivial. -/
@[to_additive "An additive group homomorphism is injective if its kernel is trivial."]
theorem injective_iff {f : α → β} (hf : IsGroupHom f) :
    Function.Injective f ↔ ∀ a, f a = 1 → a = 1

{α : Type u}
{β : Type v}
[AddGroup α]
[AddGroup β]
{f : α → β}
(hf : IsAddGroupHom f)

Function.Injective f ↔ ∀ (a : α), f a = 0 → a = 0


/-- A unit `a` of a finite field `F` of odd characteristic is a square
if and only if `a ^ (#F / 2) = 1`. -/
theorem unit_isSquare_iff (hF : ringChar F ≠ 2) (a : Fˣ) :
    IsSquare a ↔ a ^ (Fintype.card F / 2) = 1

{F : Type u_3}
[Field F]
[Fintype F]
(hF : ringChar F ≠ 2)
(a : Fˣ)


nonrec theorem comp {f : β →. σ} {g : α → β} (hf : Partrec f) (hg : Computable g) :
    Partrec fun a => f (g a)

{α : Type u_1}
{β : Type u_2}
{σ : Type u_4}
[Primcodable α]
[Primcodable β]
[Primcodable σ]
{f : β →. σ}
{g : α → β}
(hf : Partrec f)
(hg : Computable g)


protected theorem tsum_sigma {β : α → Type*} (f : ∀ a, β a → ℝ≥0∞) :
    ∑' p : Σa, β a, f p.1 p.2 = ∑' (a) (b), f a b

{α : Type u_1}
{β : α → Type u_4}
(f : (a : α) → β a → ℝ≥0∞)

∑' (p : (a : α) × β a), f p.fst p.snd = ∑' (a : α) (b : β a), f a b


@[to_additive (attr := simp)]
theorem noncommCoprod_unique (f : M × N →* P) :
    (f.comp (inl M N)).noncommCoprod (f.comp (inr M N)) (fun _ _ => (commute_inl_inr _ _).map f)
      = f

{M : Type u_1}
{N : Type u_2}
{P : Type u_3}
[MulOneClass M]
[MulOneClass N]
[Monoid P]
(f : M × N →* P)

(f.comp (MonoidHom.inl M N)).noncommCoprod (f.comp (MonoidHom.inr M N)) ⋯ = f


lemma map₂_coe_coe (f : α → β → γ) (a : α) (b : β) : map₂ f a b = f a b

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


theorem eq_star_iff_eq_star [InvolutiveStar R] {r s : R} : r = star s ↔ s = star r

{R : Type u}
[InvolutiveStar R]
{r s : R}


@[simp] theorem run_bind_throw [Monad m] (e : ε) (f : α → ExceptCpsT ε m β) : run (throw e >>= f : ExceptCpsT ε m β) = run (throw e)

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


@[to_additive (attr := simp)]
theorem inv_singleton (a : α) : ({a} : Finset α)⁻¹ = {a⁻¹}

{α : Type u_2}
[DecidableEq α]
[Inv α]
(a : α)


/-- We say that a measurable space separates points if for any two distinct points,
there is a measurable set containing one but not the other. -/
class SeparatesPoints (α : Type*) [m : MeasurableSpace α] : Prop where
  separates : ∀ x y : α, (∀ s, MeasurableSet s → (x ∈ s → y ∈ s)) → x = y

[self : MeasurableSpace.SeparatesPoints α]

(∀ (s : Set α), MeasurableSet s → x ∈ s → y ∈ s) → x = y


theorem unit_iso_comm (V : Rep k G) (g : G) (x : V) :
    unitIsoAddEquiv ((V.ρ g).toFun x) = ((ofModuleMonoidAlgebra.obj
      (toModuleMonoidAlgebra.obj V)).ρ g).toFun (unitIsoAddEquiv x)

{k G : Type u}
[CommRing k]
[Monoid G]
(V : Rep k G)
(g : G)
(x : CoeSort.coe V)

Rep.unitIsoAddEquiv ((V.ρ g).toFun x) =
  ((Rep.ofModuleMonoidAlgebra.obj (Rep.toModuleMonoidAlgebra.obj V)).ρ g).toFun (Rep.unitIsoAddEquiv x)


/-- The constructed pushout cocone in the category of types. -/
@[simps!]
def cocone : PushoutCocone f g

{S X₁ X₂ : Type u}
(f : S ⟶ X₁)
(g : S ⟶ X₂)
(j : CategoryTheory.Limits.WalkingSpan)

∀ (a : (CategoryTheory.Limits.span f g).obj j),
  (CategoryTheory.Limits.Types.Pushout.cocone f g).ι.app j a =
    Option.rec (f ≫ CategoryTheory.Limits.Types.Pushout.inl f g)
      (fun val =>
        CategoryTheory.Limits.WalkingPair.rec (CategoryTheory.Limits.Types.Pushout.inl f g)
          (CategoryTheory.Limits.Types.Pushout.inr f g) val)
      j a


@[to_additive]
lemma prod_mul_eq_prod_mul_of_exists [Zero M] [CommMonoid N]
    {f : α →₀ M} {g : α → M → N} {n₁ n₂ : N}
    (a : α) (ha : a ∈ f.support)
    (h : g a (f a) * n₁ = g a (f a) * n₂) :
    f.prod g * n₁ = f.prod g * n₂

{α : Type u_1}
{M : Type u_8}
{N : Type u_10}
[Zero M]
[CommMonoid N]
{f : α →₀ M}
{g : α → M → N}
{n₁ n₂ : N}
(a : α)
(ha : a ∈ f.support)
(h : g a (f a) * n₁ = g a (f a) * n₂)


theorem integrable_iff_cauchy [CompleteSpace F] :
    Integrable I l f vol ↔ Cauchy ((l.toFilteriUnion I ⊤).map (integralSum f vol))

{ι : Type u}
{E : Type v}
{F : Type w}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[NormedAddCommGroup F]
[NormedSpace ℝ F]
{I : BoxIntegral.Box ι}
[Fintype ι]
{l : BoxIntegral.IntegrationParams}
{f : (ι → ℝ) → E}
{vol : ι →ᵇᵃ[⊤] E →L[ℝ] F}
[CompleteSpace F]

BoxIntegral.Integrable I l f vol ↔ Cauchy (Filter.map (BoxIntegral.integralSum f vol) (l.toFilteriUnion I ⊤))


theorem powerset_card_biUnion [DecidableEq (Finset α)] (s : Finset α) :
    Finset.powerset s = (range (s.card + 1)).biUnion fun i => powersetCard i s

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

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


@[field_simps]
theorem sub_divp (a b : α) (u : αˣ) : a - b /ₚ u = (a * u - b) /ₚ u

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


/-- If the quotient by `center G` is nilpotent, then so is G. -/
theorem of_quotient_center_nilpotent (h : IsNilpotent (G ⧸ center G)) : IsNilpotent G

(h : Group.IsNilpotent (G ⧸ Subgroup.center G))


theorem IsUpperSet.exists_subset_ball (hs : IsUpperSet s) (hx : x ∈ closure s) (hδ : 0 < δ) :
    ∃ y, closedBall y (δ / 4) ⊆ closedBall x δ ∧ closedBall y (δ / 4) ⊆ interior s

{ι : Type u_2}
[Fintype ι]
{s : Set (ι → ℝ)}
{x : ι → ℝ}
{δ : ℝ}
(hs : IsUpperSet s)
(hx : x ∈ closure s)
(hδ : 0 < δ)

∃ y, Metric.closedBall y (δ / 4) ⊆ Metric.closedBall x δ ∧ Metric.closedBall y (δ / 4) ⊆ interior s


theorem Nontrivial.infsep_exists_of_finite [Finite s] (hs : s.Nontrivial) :
    ∃ x ∈ s, ∃ y ∈ s, x ≠ y ∧ s.infsep = dist x y

{α : Type u_1}
[PseudoMetricSpace α]
{s : Set α}
[Finite ↑s]
(hs : s.Nontrivial)


/-- **Strict inequality case of the Rearrangement Inequality**: Pointwise scalar multiplication of
`f` and `g`, which monovary together, is strictly decreased by a permutation if and only if
`f` and `g ∘ σ` do not monovary together. Stated by permuting the entries of `g`. -/
theorem MonovaryOn.sum_smul_comp_perm_lt_sum_smul_iff (hfg : MonovaryOn f g s)
    (hσ : {x | σ x ≠ x} ⊆ s) :
    ∑ i ∈ s, f i • g (σ i) < ∑ i ∈ s, f i • g i ↔ ¬MonovaryOn f (g ∘ σ) s

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[LinearOrderedRing α]
[LinearOrderedAddCommGroup β]
[Module α β]
[OrderedSMul α β]
{s : Finset ι}
{σ : Equiv.Perm ι}
{f : ι → α}
{g : ι → β}
(hfg : MonovaryOn f g ↑s)
(hσ : {x | σ x ≠ x} ⊆ ↑s)

∑ i ∈ s, f i • g (σ i) < ∑ i ∈ s, f i • g i ↔ ¬MonovaryOn f (g ∘ ⇑σ) ↑s


theorem rightInvSeq_reverse (ω : List B) :
    ris (ω.reverse) = (lis ω).reverse

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

cs.rightInvSeq ω.reverse = (cs.leftInvSeq ω).reverse


lemma mul_dvd_of_dvd_div (hcb : c ∣ b) (h : a ∣ b / c) : c * a ∣ b

{a b c : ℤ}
(hcb : c ∣ b)
(h : a ∣ b / c)


lemma isRightKanExtension_of_iso {F' F'' : D ⥤ H} (e : F' ≅ F'') {L : C ⥤ D} {F : C ⥤ H}
    (α : L ⋙ F' ⟶ F) (α' : L ⋙ F'' ⟶ F) (comm : whiskerLeft L e.hom ≫ α' = α)
    [F'.IsRightKanExtension α] : F''.IsRightKanExtension α'

(comm : CategoryTheory.CategoryStruct.comp (CategoryTheory.whiskerLeft L e.hom) α' = α)


theorem Nat.zero_le : (n : Nat) → LE.le 0 n


@[simp]
theorem map_intCast (n : ℤ) : D (n : A) = 0

{R : Type u_1}
[CommRing R]
{A : Type u_2}
[CommRing A]
[Algebra R A]
{M : Type u_3}
[AddCommGroup M]
[Module A M]
[Module R M]
(D : Derivation R A M)
(n : ℤ)


@[to_additive]
theorem single_le_finprod {M : Type*} [OrderedCommMonoid M] (i : α) {f : α → M}
    (hf : (mulSupport f).Finite) (h : ∀ j, 1 ≤ f j) : f i ≤ ∏ᶠ j, f j

{α : Type u_1}
{M : Type u_7}
[OrderedAddCommMonoid M]
(i : α)
{f : α → M}
(hf : (Function.support f).Finite)
(h : ∀ (j : α), 0 ≤ f j)


theorem splits_X_pow (n : ℕ) : (X ^ n).Splits i

{K : Type v}
{L : Type w}
[CommRing K]
[Field L]
(i : K →+* L)
(n : ℕ)


theorem map₂_swap (m : α → β → γ) (f : Filter α) (g : Filter β) :
    map₂ m f g = map₂ (fun a b => m b a) g f

{α : Type u_1}
{β : Type u_3}
{γ : Type u_5}
(m : α → β → γ)
(f : Filter α)
(g : Filter β)

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


theorem foldr'_algebraMap (f : M →ₗ[R] CliffordAlgebra Q × N →ₗ[R] N)
    (hf : ∀ m x fx, f m (ι Q m * x, f m (x, fx)) = Q m • fx) (n r) :
    foldr' Q f hf n (algebraMap R _ r) = r • n

(hf : ∀ (m : M) (x : CliffordAlgebra Q) (fx : N), (f m) ((CliffordAlgebra.ι Q) m * x, (f m) (x, fx)) = Q m • fx)

(CliffordAlgebra.foldr' Q f hf n) ((algebraMap R (CliffordAlgebra Q)) r) = r • n


/-- The permutation that sorts `f` is the identity if and only if `f` is monotone. -/
theorem sort_eq_refl_iff_monotone : sort f = Equiv.refl _ ↔ Monotone f

{n : ℕ}
{α : Type u_1}
[LinearOrder α]
{f : Fin n → α}

Tuple.sort f = Equiv.refl (Fin n) ↔ Monotone f


theorem mul_inv_cancel {f : CauSeq β abv} (hf) : f * inv f hf ≈ 1

{α : Type u_1}
{β : Type u_2}
[LinearOrderedField α]
[DivisionRing β]
{abv : β → α}
[IsAbsoluteValue abv]
{f : CauSeq β abv}
(hf : ¬f.LimZero)


theorem condexpL2_indicator_eq_toSpanSingleton_comp (hm : m ≤ m0) (hs : MeasurableSet s)
    (hμs : μ s ≠ ∞) (x : E') : (condexpL2 E' 𝕜 hm (indicatorConstLp 2 hs hμs x) : α →₂[μ] E') =
    (toSpanSingleton ℝ x).compLp (condexpL2 ℝ ℝ hm (indicatorConstLp 2 hs hμs 1))

{α : Type u_1}
{E' : Type u_3}
(𝕜 : Type u_7)
[RCLike 𝕜]
[NormedAddCommGroup E']
[InnerProductSpace 𝕜 E']
[CompleteSpace E']
[NormedSpace ℝ E']
{m m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s : Set α}
(hm : m ≤ m0)
(hs : MeasurableSet s)
(hμs : μ s ≠ ⊤)
(x : E')

↑((MeasureTheory.condexpL2 E' 𝕜 hm) (MeasureTheory.indicatorConstLp 2 hs hμs x)) =
  (ContinuousLinearMap.toSpanSingleton ℝ x).compLp
    ↑((MeasureTheory.condexpL2 ℝ ℝ hm) (MeasureTheory.indicatorConstLp 2 hs hμs 1))


theorem map_mul_left_nhds₀ (ha : a ≠ 0) (b : G₀) : map (a * ·) (𝓝 b) = 𝓝 (a * b)

{G₀ : Type u_3}
[TopologicalSpace G₀]
[GroupWithZero G₀]
[ContinuousMul G₀]
{a : G₀}
(ha : a ≠ 0)
(b : G₀)

Filter.map (fun x => a * x) (𝓝 b) = 𝓝 (a * b)


theorem toIcoDiv_neg' (a b : α) : toIcoDiv hp (-a) b = -(toIocDiv hp a (-b) + 1)

{α : Type u_1}
[LinearOrderedAddCommGroup α]
[hα : Archimedean α]
{p : α}
(hp : 0 < p)
(a b : α)


@[simp] lemma mul_mod_mod (a b c : ℕ) : (a * (b % c)) % c = a * b % c


theorem image2_iUnion_left (s : ι → Set α) (t : Set β) :
    image2 f (⋃ i, s i) t = ⋃ i, image2 f (s i) t

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{ι : Sort u_4}
(f : α → β → γ)
(s : ι → Set α)
(t : Set β)

Set.image2 f (⋃ i, s i) t = ⋃ i, Set.image2 f (s i) t


theorem injective_mapNatBool [MeasurableSpace α] [CountablyGenerated α]
    [SeparatesPoints α] : Injective (mapNatBool α)

(α : Type u_1)
[MeasurableSpace α]
[MeasurableSpace.CountablyGenerated α]
[MeasurableSpace.SeparatesPoints α]


/-- The distance to a set is controlled by the Hausdorff distance. -/
theorem infEdist_le_hausdorffEdist_of_mem (h : x ∈ s) : infEdist x t ≤ hausdorffEdist s t

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

EMetric.infEdist x t ≤ EMetric.hausdorffEdist s t


@[simp]
theorem natCast_mod (a : ℕ) (n : ℕ) : ((a % n : ℕ) : ZMod n) = a


theorem range_inl : range (inl R M M₂) = ker (snd R M M₂)

(R : Type u)
(M : Type v)
(M₂ : Type w)
[Semiring R]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R M₂]

LinearMap.range (LinearMap.inl R M M₂) = LinearMap.ker (LinearMap.snd R M M₂)


private lemma aux {n k : ℕ} (hk : 0 < k) (hn : k ≤ n) : n < 2 * k * (n / k)


theorem inclusion_injective : Function.Injective (inclusion h)

{R : Type u}
{L : Type v}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
{K K' : LieSubalgebra R L}
(h : K ≤ K')


/-- The Bochner integral is measurable. This shows that the integrand of (the right-hand-side of)
  the symmetric version of Fubini's theorem is measurable.
  This version has `f` in curried form. -/
theorem MeasureTheory.StronglyMeasurable.integral_prod_left [SFinite μ] ⦃f : α → β → E⦄
    (hf : StronglyMeasurable (uncurry f)) : StronglyMeasurable fun y => ∫ x, f x y ∂μ

⦃f : α → β → E⦄

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

MeasureTheory.StronglyMeasurable fun y => ∫ (x : α), f x y ∂μ


theorem congr_fun₂ {f g : M →ₛₗ[ρ₁₂] N →ₛₗ[σ₁₂] P} (h : f = g) (x y) : f x y = g x y

{R : Type u_1}
[Semiring R]
{S : Type u_2}
[Semiring S]
{R₂ : Type u_3}
[Semiring R₂]
{S₂ : Type u_4}
[Semiring S₂]
{M : Type u_5}
{N : Type u_6}
{P : Type u_7}
[AddCommMonoid M]
[AddCommMonoid N]
[AddCommMonoid P]
[Module R M]
[Module S N]
[Module R₂ P]
[Module S₂ P]
[SMulCommClass S₂ R₂ P]
{ρ₁₂ : R →+* R₂}
{σ₁₂ : S →+* S₂}
{f g : M →ₛₗ[ρ₁₂] N →ₛₗ[σ₁₂] P}
(h : f = g)
(x : M)
(y : N)


theorem eq_one_of_smul_eq_one (hH : Nat.Coprime (Nat.card H) H.index) (α : H.QuotientDiff)
    (h : H) : h • α = α → h = 1

{G : Type u_1}
[Group G]
{H : Subgroup G}
[H.IsCommutative]
[H.FiniteIndex]
[H.Normal]
(hH : (Nat.card ↥H).Coprime H.index)
(α : H.QuotientDiff)
(h : ↥H)


@[simp]
theorem map_valEmbedding_Icc : (Icc a b).map Fin.valEmbedding = Icc ↑a ↑b

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


/-- The type of flags, aka maximal chains, of an order. -/
structure Flag (α : Type*) [LE α] where
  /-- The `carrier` of a flag is the underlying set. -/
  carrier : Set α
  /-- By definition, a flag is a chain -/
  Chain' : IsChain (· ≤ ·) carrier
  /-- By definition, a flag is a maximal chain -/
  max_chain' : ∀ ⦃s⦄, IsChain (· ≤ ·) s → carrier ⊆ s → carrier = s

IsChain (fun x x_1 => x ≤ x_1) self.carrier


lemma meas_le_lintegral₀ {f : α → ℝ≥0∞} (hf : AEMeasurable f μ)
    {s : Set α} (hs : ∀ x ∈ s, 1 ≤ f x) : μ s ≤ ∫⁻ a, f a ∂μ

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f : α → ℝ≥0∞}
(hf : AEMeasurable f μ)
{s : Set α}
(hs : ∀ x ∈ s, 1 ≤ f x)


@[simp]
theorem toTopCat_map (X : TopCat.{u}) {U V : Opens X} {f : U ⟶ V} {x} {h} :
    ((toTopCat X).map f) ⟨x, h⟩ = ⟨x, f.le h⟩

(X : TopCat)
{U V : TopologicalSpace.Opens ↑X}
{f : U ⟶ V}
{x : ↑X}
{h : x ∈ U}

((TopologicalSpace.Opens.toTopCat X).map f) ⟨x, h⟩ = ⟨x, ⋯⟩


theorem Sublist.trans {l₁ l₂ l₃ : List α} (h₁ : l₁ <+ l₂) (h₂ : l₂ <+ l₃) : l₁ <+ l₃

{α : Type u_1}
{l₁ l₂ l₃ : List α}
(h₁ : l₁ <+ l₂)
(h₂ : l₂ <+ l₃)


theorem toUniformSpace_eq :
    ‹PseudoMetricSpace α›.toUniformSpace = .ofDist dist dist_self dist_comm dist_triangle

PseudoMetricSpace.toUniformSpace = UniformSpace.ofDist dist ⋯ ⋯ ⋯


theorem Integrable.pos_part {f : α → ℝ} (hf : Integrable f μ) :
    Integrable (fun a => max (f a) 0) μ

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

MeasureTheory.Integrable (fun a => max (f a) 0) μ


theorem empty_infinite_Theory_isComplete : Language.empty.infiniteTheory.IsComplete


lemma indicator_smul_apply (s : Set α) (r : α → R) (f : α → M) (a : α) :
    indicator s (fun a ↦ r a • f a) a = r a • indicator s f a

{α : Type u_1}
{R : Type u_2}
{M : Type u_3}
[Zero M]
[SMulZeroClass R M]
(s : Set α)
(r : α → R)
(f : α → M)
(a : α)

s.indicator (fun a => r a • f a) a = r a • s.indicator f a


theorem exists_unique_iff_card_one {α} [Fintype α] (p : α → Prop) [DecidablePred p] :
    (∃! a : α, p a) ↔ (Finset.univ.filter p).card = 1

{α : Type u_4}
[Fintype α]
(p : α → Prop)
[DecidablePred p]

(∃! a, p a) ↔ (Finset.filter p Finset.univ).card = 1


lemma negY_of_Z_ne_zero {P : Fin 3 → F} (hPz : P z ≠ 0) :
    W.negY P / P z ^ 3 = W.toAffine.negY (P x / P z ^ 2) (P y / P z ^ 3)

{F : Type v}
[Field F]
{W : WeierstrassCurve.Jacobian F}
{P : Fin 3 → F}
(hPz : P z ≠ 0)


@[to_additive (attr := simp)]
lemma inv_smul_smul (g : G) (a : α) : g⁻¹ • g • a = a

{G : Type u_3}
{α : Type u_7}
[AddGroup G]
[AddAction G α]
(g : G)
(a : α)


theorem locally_ne_zero (hp : HasFPowerSeriesAt f p z₀) (h : p ≠ 0) : ∀ᶠ z in 𝓝[≠] z₀, f z ≠ 0

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{p : FormalMultilinearSeries 𝕜 𝕜 E}
{f : 𝕜 → E}
{z₀ : 𝕜}
(hp : HasFPowerSeriesAt f p z₀)
(h : p ≠ 0)


@[to_additive pi_nnnorm_lt_iff]
lemma pi_nnnorm_lt_iff' {r : ℝ≥0} (hr : 0 < r) : ‖x‖₊ < r ↔ ∀ i, ‖x i‖₊ < r

{ι : Type u_1}
{π : ι → Type u_4}
[Fintype ι]
[(i : ι) → SeminormedGroup (π i)]
{x : (i : ι) → π i}
{r : ℝ≥0}
(hr : 0 < r)


theorem hasDerivAt_lineMap :  HasDerivAt (lineMap a b) (b - a) x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{a b : E}
{x : 𝕜}

HasDerivAt (⇑(AffineMap.lineMap a b)) (b - a) x


lemma generateFrom_memPartition_le_range (t : ℕ → Set α) (n : ℕ) :
    generateFrom (memPartition t n) ≤ generateFrom (range t)

MeasurableSpace.generateFrom (memPartition t n) ≤ MeasurableSpace.generateFrom (Set.range t)


/-- `BiheytingHomClass F α β` states that `F` is a type of bi-Heyting homomorphisms.

You should extend this class when you extend `BiheytingHom`. -/
class BiheytingHomClass (F α β : Type*) [BiheytingAlgebra α] [BiheytingAlgebra β] [FunLike F α β]
  extends LatticeHomClass F α β : Prop where
  /-- The proposition that a bi-Heyting homomorphism preserves the Heyting implication. -/
  map_himp (f : F) : ∀ a b, f (a ⇨ b) = f a ⇨ f b
  /-- The proposition that a bi-Heyting homomorphism preserves the difference operation. -/
  map_sdiff (f : F) : ∀ a b, f (a \ b) = f a \ f b

{F : Type u_6}
{α : Type u_7}
{β : Type u_8}
[BiheytingAlgebra α]
[BiheytingAlgebra β]
[FunLike F α β]
[self : BiheytingHomClass F α β]
(f : F)
(a b : α)


@[simp]
theorem toSpanNonzeroSingleton_coord {x : E} (h : x ≠ 0) (y : 𝕜 ∙ x) :
    toSpanNonzeroSingleton 𝕜 x h (coord 𝕜 x h y) = y

(𝕜 : Type u_1)
{E : Type u_2}
[NormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{x : E}
(h : x ≠ 0)
(y : ↥(Submodule.span 𝕜 {x}))

(ContinuousLinearEquiv.toSpanNonzeroSingleton 𝕜 x h) ((ContinuousLinearEquiv.coord 𝕜 x h) y) = y


/-- The augmented Čech conerve associated to an arrow. -/
@[simps]
def augmentedCechConerve : CosimplicialObject.Augmented C

[∀ (n : ℕ), CategoryTheory.Limits.HasWidePushout f.left (fun x => f.right) fun x => f.hom]


theorem mk_subtype_le {α : Type u} (p : α → Prop) : #(Subtype p) ≤ #α


protected theorem measurableSet_ge_of_countable' [Countable ι] (hτ : IsStoppingTime f τ) (i : ι) :
    MeasurableSet[hτ.measurableSpace] {ω | i ≤ τ ω}

{Ω : Type u_1}
{ι : Type u_3}
{m : MeasurableSpace Ω}
[LinearOrder ι]
{f : MeasureTheory.Filtration ι m}
{τ : Ω → ι}
[Countable ι]
(hτ : MeasureTheory.IsStoppingTime f τ)
(i : ι)


@[simp]
theorem torsionBy.mk_ideal_smul (a b : R) (x : torsionBy R M a) :
    (Ideal.Quotient.mk (Ideal.span {a})) b • x = b • x

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
(a b : R)
(x : ↥(Submodule.torsionBy R M a))


@[simp] theorem natAdd_subNat_cast {i : Fin (n + m)} (h : n ≤ i) :
    natAdd n (subNat n (cast (Nat.add_comm ..) i) h) = i

{n m : Nat}
{i : Fin (n + m)}
(h : n ≤ ↑i)

Fin.natAdd n (Fin.subNat n (Fin.cast ⋯ i) h) = i


/-- A right homology data for a short complex `S` in the opposite category
induces a left homology data for `S.unop`. -/
@[simps]
def unop {S : ShortComplex Cᵒᵖ} (h : S.RightHomologyData) : S.unop.LeftHomologyData


theorem unit_associated_one [Monoid α] {u : αˣ} : (u : α) ~ᵤ 1


theorem mem_resolventSet_of_norm_lt_mul {a : A} {k : 𝕜} (h : ‖a‖ * ‖(1 : A)‖ < ‖k‖) : k ∈ ρ a

{𝕜 : Type u_1}
{A : Type u_2}
[NormedField 𝕜]
[NormedRing A]
[NormedAlgebra 𝕜 A]
[CompleteSpace A]
{a : A}
{k : 𝕜}
(h : ‖a‖ * ‖1‖ < ‖k‖)


theorem map {A B : Cᵒᵖ ⥤ Type v} (η : A ⟶ B) [IsIso η] : IsIndObject A → IsIndObject B

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

CategoryTheory.Limits.IsIndObject A → CategoryTheory.Limits.IsIndObject B


/-- **Markov's inequality** also known as **Chebyshev's first inequality**. -/
theorem mul_meas_ge_le_integral_of_nonneg {f : α → ℝ} (hf_nonneg : 0 ≤ᵐ[μ] f)
    (hf_int : Integrable f μ) (ε : ℝ) : ε * (μ { x | ε ≤ f x }).toReal ≤ ∫ x, f x ∂μ

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f : α → ℝ}
(hf_nonneg : 0 ≤ᵐ[μ] f)
(hf_int : MeasureTheory.Integrable f μ)
(ε : ℝ)

ε * (μ {x | ε ≤ f x}).toReal ≤ ∫ (x : α), f x ∂μ


/-- The volume form is invariant under pullback by a positively-oriented isometric automorphism. -/
theorem volumeForm_comp_linearIsometryEquiv (φ : E ≃ₗᵢ[ℝ] E)
    (hφ : 0 < LinearMap.det (φ.toLinearEquiv : E →ₗ[ℝ] E)) (x : Fin n → E) :
    o.volumeForm (φ ∘ x) = o.volumeForm x

[_i : Fact (FiniteDimensional.finrank ℝ E = n)]

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


/-- Characteristic `≠ 2` and nontrivial implies that `-1 ≠ 1`. -/
lemma Ring.neg_one_ne_one_of_char_ne_two {R : Type*} [NonAssocRing R] [Nontrivial R]
    (hR : ringChar R ≠ 2) : (-1 : R) ≠ 1

{R : Type u_2}
[NonAssocRing R]
[Nontrivial R]
(hR : ringChar R ≠ 2)


theorem reduceOption_length_le (l : List (Option α)) : l.reduceOption.length ≤ l.length


theorem option_casesOn {o : α → Option β} {f : α → σ} {g : α → β → σ} (ho : Computable o)
    (hf : Computable f) (hg : Computable₂ g) :
    @Computable _ σ _ _ fun a => Option.casesOn (o a) (f a) (g a)

{α : Type u_1}
{β : Type u_2}
{σ : Type u_4}
[Primcodable α]
[Primcodable β]
[Primcodable σ]
{o : α → Option β}
{f : α → σ}
{g : α → β → σ}
(ho : Computable o)
(hf : Computable f)
(hg : Computable₂ g)

Computable fun a => Option.casesOn (o a) (f a) (g a)


theorem le_comap_of_map_le {T : L.Substructure N} {f : M →[L] N} : S.map f ≤ T → S ≤ T.comap f

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

FirstOrder.Language.Substructure.map f S ≤ T → S ≤ FirstOrder.Language.Substructure.comap f T


/-- Expressing locally uniform convergence using `edist`. -/
theorem tendstoLocallyUniformly_iff {ι : Type*} [TopologicalSpace β] {F : ι → β → α} {f : β → α}
    {p : Filter ι} :
    TendstoLocallyUniformly F f p ↔
      ∀ ε > 0, ∀ x : β, ∃ t ∈ 𝓝 x, ∀ᶠ n in p, ∀ y ∈ t, edist (f y) (F n y) < ε

{α : Type u}
{β : Type v}
[PseudoEMetricSpace α]
{ι : Type u_2}
[TopologicalSpace β]
{F : ι → β → α}
{f : β → α}
{p : Filter ι}

TendstoLocallyUniformly F f p ↔ ∀ ε > 0, ∀ (x : β), ∃ t ∈ 𝓝 x, ∀ᶠ (n : ι) in p, ∀ y ∈ t, edist (f y) (F n y) < ε


@[elab_as_elim, induction_eliminator, cases_eliminator]
theorem induction_on {β : LocalizedModule S M → Prop} (h : ∀ (m : M) (s : S), β (mk m s)) :
    ∀ x : LocalizedModule S M, β x

(h : ∀ (m : M) (s : ↥S), β (LocalizedModule.mk m s))


@[simp]
theorem den_one : (1 : ℚ).den = 1


/-- The equivalence `Square C ≌ Arrow (Arrow C)` which sends a
commutative square `sq` to the obvious arrow from the top morphism of `sq`
to the bottom morphism of `sq`. -/
@[simps]
def arrowArrowEquivalence' : Square C ≌ Arrow (Arrow C)

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

CategoryTheory.Square.arrowArrowEquivalence'.counitIso =
  CategoryTheory.Iso.refl (CategoryTheory.Square.fromArrowArrowFunctor'.comp CategoryTheory.Square.toArrowArrowFunctor')


theorem Ordered.ins : ∀ {path : Path α} {t : RBNode α},
    t.Ordered cmp → path.Ordered cmp → t.All (path.RootOrdered cmp) → (path.ins t).Ordered cmp

{α : Type u_1}
{cmp : α → α → Ordering}
{path : Batteries.RBNode.Path α}
{t : Batteries.RBNode α}

Batteries.RBNode.Ordered cmp t →
  Batteries.RBNode.Path.Ordered cmp path →
    Batteries.RBNode.All (Batteries.RBNode.Path.RootOrdered cmp path) t → Batteries.RBNode.Ordered cmp (path.ins t)


theorem SuperpolynomialDecay.trans_eventuallyLE (hk : 0 ≤ᶠ[l] k) (hg : SuperpolynomialDecay l k g)
    (hg' : SuperpolynomialDecay l k g') (hfg : g ≤ᶠ[l] f) (hfg' : f ≤ᶠ[l] g') :
    SuperpolynomialDecay l k f

(hg : Asymptotics.SuperpolynomialDecay l k g)

(hg' : Asymptotics.SuperpolynomialDecay l k g')


/-- The span of a subset `s` is the union over all `n` of the set of linear combinations of at most
`n` terms belonging to `s`. -/
lemma span_eq_iUnion_nat (s : Set M) :
    (Submodule.span R s : Set M) = ⋃ (n : ℕ),
      (fun (f : Fin n → (R × M)) ↦ ∑ i, (f i).1 • (f i).2) '' ({f | ∀ i, (f i).2 ∈ s})

{R : Type u_1}
{M : Type u_2}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(s : Set M)

↑(Submodule.span R s) = ⋃ n, (fun f => ∑ i : Fin n, (f i).1 • (f i).2) '' {f | ∀ (i : Fin n), (f i).2 ∈ s}


theorem infinitePos_mul_of_not_infinitesimal_pos_infinitePos {x y : ℝ*} :
    ¬Infinitesimal x → 0 < x → InfinitePos y → InfinitePos (x * y)

¬x.Infinitesimal → 0 < x → y.InfinitePos → (x * y).InfinitePos


@[simp] theorem run_pure [Monad m] : run (pure x : ExceptCpsT ε m α) = pure (Except.ok x)

{m : Type u_1 → Type u_2}
{ε α : Type u_1}
{x : α}
[Monad m]


protected theorem mul_comm : I * J = J * I

{R : Type u}
[CommSemiring R]
(I J : Ideal R)


/-- To bound the Hausdorff measure (or, more generally, for a measure defined using
`MeasureTheory.Measure.mkMetric`) of a set, one may use coverings with maximum diameter tending to
`0`, indexed by any sequence of finite types. -/
theorem mkMetric_le_liminf_sum {β : Type*} {ι : β → Type*} [hι : ∀ n, Fintype (ι n)] (s : Set X)
    {l : Filter β} (r : β → ℝ≥0∞) (hr : Tendsto r l (𝓝 0)) (t : ∀ n : β, ι n → Set X)
    (ht : ∀ᶠ n in l, ∀ i, diam (t n i) ≤ r n) (hst : ∀ᶠ n in l, s ⊆ ⋃ i, t n i) (m : ℝ≥0∞ → ℝ≥0∞) :
    mkMetric m s ≤ liminf (fun n => ∑ i, m (diam (t n i))) l

(r : β → ℝ≥0∞)

(ht : ∀ᶠ (n : β) in l, ∀ (i : ι n), EMetric.diam (t n i) ≤ r n)

(m : ℝ≥0∞ → ℝ≥0∞)

(MeasureTheory.Measure.mkMetric m) s ≤ Filter.liminf (fun n => ∑ i : ι n, m (EMetric.diam (t n i))) l


theorem isPrefixOf_cons₂ [BEq α] {a : α} :
    isPrefixOf (a::as) (b::bs) = (a == b && isPrefixOf as bs)

{α : Type u}
{as : List α}
{b : α}
{bs : List α}
[BEq α]
{a : α}

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


@[simp]
theorem Iio_filter_lt {α} [LinearOrder α] [LocallyFiniteOrderBot α] (a b : α) :
    (Iio a).filter (· < b) = Iio (min a b)

{α : Type u_3}
[LinearOrder α]
[LocallyFiniteOrderBot α]
(a b : α)

Finset.filter (fun x => x < b) (Finset.Iio a) = Finset.Iio (min a b)


/-- A predicate saying that a function is differentiable on a set and is continuous on its
closure. This is a common assumption in complex analysis. -/
structure DiffContOnCl (f : E → F) (s : Set E) : Prop where
  protected differentiableOn : DifferentiableOn 𝕜 f s
  protected continuousOn : ContinuousOn f (closure s)

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


theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r)
    (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f g : E → F}
{pf pg : FormalMultilinearSeries 𝕜 E F}
{x : E}
{r : ℝ≥0∞}
(hf : HasFPowerSeriesOnBall f pf x r)
(hg : HasFPowerSeriesOnBall g pg x r)


theorem edist_lt_of_edist_lt_div (hf : LipschitzWith K f) {x y : α} {d : ℝ≥0∞}
    (h : edist x y < d / K) : edist (f x) (f y) < d

{α : Type u}
{β : Type v}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
{K : ℝ≥0}
{f : α → β}
(hf : LipschitzWith K f)
{x y : α}
{d : ℝ≥0∞}
(h : edist x y < d / ↑K)


theorem mk'_surjective : Function.Surjective (Function.uncurry <| mk' f : M × S → M')

{R : Type u_1}
[CommSemiring R]
(S : Submonoid R)
{M : Type u_2}
{M' : Type u_3}
[AddCommMonoid M]
[AddCommMonoid M']
[Module R M]
[Module R M']
(f : M →ₗ[R] M')
[IsLocalizedModule S f]

Function.Surjective (Function.uncurry (IsLocalizedModule.mk' f))


theorem Ioo_inter_Ioc_of_left_le (h : b₁ ≤ b₂) : Ioo a₁ b₁ ∩ Ioc a₂ b₂ = Ioo (max a₁ a₂) b₁

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

Set.Ioo a₁ b₁ ∩ Set.Ioc a₂ b₂ = Set.Ioo (max a₁ a₂) b₁


@[to_additive (attr := simp) one_zsmul]
lemma zpow_one (a : G) : a ^ (1 : ℤ) = a


lemma mk_inj_right {a₁ a₂ : α} {b : β} : (a₁, b) = (a₂, b) ↔ a₁ = a₂

{α : Type u_1}
{β : Type u_2}
{a₁ a₂ : α}
{b : β}


run_cmd
  for typeName' in [`UInt8, `UInt16, `UInt32, `UInt64, `USize] do
  let typeName := Lean.mkIdent typeName'
  Lean.Elab.Command.elabCommand (← `(
    namespace $typeName
      instance neZero : NeZero size := ⟨by decide⟩

      instance : Neg $typeName where
        neg a := mk (-a.val)

      instance : Pow $typeName ℕ where
        pow a n := mk (a.val ^ n)

      instance : SMul ℕ $typeName where
        smul n a := mk (n • a.val)

      instance : SMul ℤ $typeName where
        smul z a := mk (z • a.val)

      lemma neg_def (a : $typeName) : -a = ⟨-a.val⟩ := rfl

      lemma pow_def (a : $typeName) (n : ℕ) : a ^ n = ⟨a.val ^ n⟩ := rfl

      lemma nsmul_def (n : ℕ) (a : $typeName) : n • a = ⟨n • a.val⟩ := rfl

      lemma zsmul_def (z : ℤ) (a : $typeName) : z • a = ⟨z • a.val⟩ := rfl

      open $typeName (eq_of_val_eq) in
      lemma val_injective : Function.Injective val := @eq_of_val_eq

      instance instCommMonoid : CommMonoid $typeName :=
        Function.Injective.commMonoid val val_injective
          rfl (fun _ _ => rfl) (fun _ _ => rfl)

      instance instNonUnitalCommRing : NonUnitalCommRing $typeName :=
        Function.Injective.nonUnitalCommRing val val_injective
          rfl (fun _ _ => rfl) (fun _ _ => rfl) (fun _ => rfl) (fun _ _ => rfl)
          (fun _ _ => rfl) (fun _ _ => rfl)

      local instance instNatCast : NatCast $typeName where
        natCast n := mk n

      local instance instIntCast : IntCast $typeName where
        intCast z := mk z

      lemma natCast_def (n : ℕ) : (n : $typeName) = ⟨n⟩ := rfl

      lemma intCast_def (z : ℤ) : (z : $typeName) = ⟨z⟩ := rfl

      local instance instCommRing : CommRing $typeName :=
        Function.Injective.commRing val val_injective
          rfl rfl (fun _ _ => rfl) (fun _ _ => rfl) (fun _ => rfl) (fun _ _ => rfl)
          (fun _ _ => rfl) (fun _ _ => rfl) (fun _ _ => rfl) (fun _ => rfl) (fun _ => rfl)

      namespace CommRing
      attribute [scoped instance] instCommRing instNatCast instIntCast
      end CommRing

    end $typeName
  ))
  -- interpolating docstrings above is more trouble than it's worth
  let docString :=
    s!"To use this instance, use `open scoped {typeName'}.CommRing`.\n\n" ++
    "See the module docstring for an explanation"
  Lean.addDocString (typeName'.mkStr "instCommRing") docString
  Lean.addDocString (typeName'.mkStr "instNatCast") docString
  Lean.addDocString (typeName'.mkStr "instIntCast") docString


@[to_additive]
theorem smul_inter_subset : s • (t₁ ∩ t₂) ⊆ s • t₁ ∩ s • t₂

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

s • (t₁ ∩ t₂) ⊆ s • t₁ ∩ s • t₂


theorem imageToKernel_comp_left {Z : V} (h : Z ⟶ A) (w : f ≫ g = 0) :
    imageToKernel (h ≫ f) g (by simp [w]) =
      Subobject.ofLE _ _ (imageSubobject_comp_le h f) ≫ imageToKernel f g w

imageToKernel (h ≫ f) g ⋯ =
  (CategoryTheory.Limits.imageSubobject (h ≫ f)).ofLE (CategoryTheory.Limits.imageSubobject f) ⋯ ≫ imageToKernel f g w


@[to_additive]
lemma prod_mul_prod_eq_prod_zipWith_of_length_eq (l l' : List M) (h : l.length = l'.length) :
    l.prod * l'.prod = (zipWith (· * ·) l l').prod

{M : Type u_4}
[CommMonoid M]
(l l' : List M)
(h : l.length = l'.length)

l.prod * l'.prod = (List.zipWith (fun x x_1 => x * x_1) l l').prod


theorem span_singleton_lt_span_singleton [IsDomain α] {x y : α} :
    span ({x} : Set α) < span ({y} : Set α) ↔ DvdNotUnit y x

{α : Type u}
[CommSemiring α]
[IsDomain α]
{x y : α}

Ideal.span {x} < Ideal.span {y} ↔ DvdNotUnit y x


@[simp]
theorem lcRow0_apply (p : Fin 2 → ℤ) (g : Matrix (Fin 2) (Fin 2) ℝ) :
    lcRow0 p g = p 0 * g 0 0 + p 1 * g 0 1

(ModularGroup.lcRow0 p) g = ↑(p 0) * g 0 0 + ↑(p 1) * g 0 1


theorem map_iSup (f : X ⟶ Y) {ι : Type*} (U : ι → Opens Y) :
    (map f).obj (iSup U) = iSup ((map f).obj ∘ U)

{X Y : TopCat}
(f : X ⟶ Y)
{ι : Type u_1}
(U : ι → TopologicalSpace.Opens ↑Y)

(TopologicalSpace.Opens.map f).obj (iSup U) = iSup ((TopologicalSpace.Opens.map f).obj ∘ U)


@[simp]
protected theorem smul_def (f : Module.End R M) (a : M) : f • a = f a

{R : Type u_1}
{M : Type u_5}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(f : Module.End R M)
(a : M)


@[simp]
theorem isVonNBounded_vadd (x : E) : IsVonNBounded 𝕜 (x +ᵥ s) ↔ IsVonNBounded 𝕜 s

{𝕜 : Type u_1}
{E : Type u_3}
[NormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[TopologicalSpace E]
[ContinuousSMul 𝕜 E]
[ContinuousAdd E]
{s : Set E}
(x : E)

Bornology.IsVonNBounded 𝕜 (x +ᵥ s) ↔ Bornology.IsVonNBounded 𝕜 s


/-- The categorical equivalence between `C` and `ULift C`. -/
@[simps]
def ULift.equivalence : C ≌ ULift.{u₂} C

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

CategoryTheory.ULift.equivalence.unitIso.hom = CategoryTheory.CategoryStruct.id (CategoryTheory.Functor.id C)


@[to_additive (attr := simp)]
lemma coe_id {X : CommMonCat} : (𝟙 X : X → X) = id


@[simp]
lemma le_smul_iff_one_le_left [SMulPosMono α β] [SMulPosReflectLE α β] (hb : 0 < b) :
    b ≤ a • b ↔ 1 ≤ a

{α : Type u_1}
{β : Type u_2}
{a : α}
{b : β}
[Monoid α]
[Zero β]
[MulAction α β]
[Preorder α]
[Preorder β]
[SMulPosMono α β]
[SMulPosReflectLE α β]
(hb : 0 < b)


theorem dite_ite_distrib_right {a : p → α} {b : p → α} {c : ¬p → α} :
    dite p (fun hp ↦ ite q (a hp) (b hp)) c = ite q (dite p a c) (dite p b c)

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

dite p (fun hp => if q then a hp else b hp) c = if q then dite p a c else dite p b c


@[simp, norm_cast]
theorem coe_zero : ((0 : M₁ →SL[σ₁₂] M₂) : M₁ →ₛₗ[σ₁₂] M₂) = 0

{R₁ : Type u_1}
{R₂ : Type u_2}
[Semiring R₁]
[Semiring R₂]
{σ₁₂ : R₁ →+* R₂}
{M₁ : Type u_4}
[TopologicalSpace M₁]
[AddCommMonoid M₁]
{M₂ : Type u_6}
[TopologicalSpace M₂]
[AddCommMonoid M₂]
[Module R₁ M₁]
[Module R₂ M₂]


@[simp]
theorem trNat_zero : trNat 0 = []


theorem map₂_flip (f : α → β → γ) :
    map₂ f xs ys = map₂ (flip f) ys xs

{α : Type u_2}
{n : ℕ}
{β : Type u_3}
(xs : Mathlib.Vector α n)
(ys : Mathlib.Vector β n)
{γ : Type u_1}
(f : α → β → γ)

Mathlib.Vector.map₂ f xs ys = Mathlib.Vector.map₂ (flip f) ys xs


@[reassoc (attr := simp)]
lemma inv_hom_id_left (e : f ≅ g) : e.inv.left ≫ e.hom.left = 𝟙 _

{T : Type u}
[CategoryTheory.Category.{v, u} T]
{f g : CategoryTheory.Arrow T}
(e : f ≅ g)

CategoryTheory.CategoryStruct.comp e.inv.left e.hom.left = CategoryTheory.CategoryStruct.id g.left


theorem HasSum.mul (hf : HasSum f s) (hg : HasSum g t)
    (hfg : Summable fun x : ι × κ ↦ f x.1 * g x.2) :
    HasSum (fun x : ι × κ ↦ f x.1 * g x.2) (s * t)

{ι : Type u_1}
{κ : Type u_2}
{α : Type u_4}
[TopologicalSpace α]
[T3Space α]
[NonUnitalNonAssocSemiring α]
[TopologicalSemiring α]
{f : ι → α}
{g : κ → α}
{s t : α}
(hf : HasSum f s)
(hg : HasSum g t)
(hfg : Summable fun x => f x.1 * g x.2)


/-- The canonical morphism from a presheaf of modules to its associated sheaf. -/
@[simps]
def toSheafify : M₀ ⟶ (restrictScalars α).obj (sheafify α φ).val

{J : CategoryTheory.GrothendieckTopology C}

(PresheafOfModules.toSheafify α φ).hom = φ


theorem L1.SimpleFunc.toLp_one_eq_toL1 (f : α →ₛ E) (hf : Integrable f μ) :
    (Lp.simpleFunc.toLp f (memℒp_one_iff_integrable.2 hf) : α →₁[μ] E) = hf.toL1 f

{α : Type u_1}
{E : Type u_4}
[MeasurableSpace α]
[NormedAddCommGroup E]
{μ : MeasureTheory.Measure α}
(f : MeasureTheory.SimpleFunc α E)
(hf : MeasureTheory.Integrable (↑f) μ)

↑(MeasureTheory.Lp.simpleFunc.toLp f ⋯) = MeasureTheory.Integrable.toL1 (↑f) hf


/-- the sum of two homotopies is a homotopy between the sum of the respective morphisms. -/
@[simps!]
def add {f₁ g₁ f₂ g₂ : C ⟶ D} (h₁ : Homotopy f₁ g₁) (h₂ : Homotopy f₂ g₂) :
    Homotopy (f₁ + f₂) (g₁ + g₂)

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

(h₁.add h₂).hom i j = h₁.hom i j + h₂.hom i j


theorem eq_one_iff_odd {n : ℕ} : (n : ZMod 2) = 1 ↔ Odd n


/-- The space of functions `Fin 2 → α` is equivalent to `α × α`. See also `piFinTwoEquiv` and
`prodEquivPiFinTwo`. -/
@[simps (config := .asFn)]
def finTwoArrowEquiv (α : Type*) : (Fin 2 → α) ≃ α × α

⇑(finTwoArrowEquiv α) = (piFinTwoEquiv fun x => α).toFun


theorem factorial_lt (hn : 0 < n) : n ! < m ! ↔ n < m


@[simp] theorem closedBall_zero : closedBall x 0 = {x}


theorem foldr_eq_foldr_list (f : Fin n → α → α) (x) : foldr n f x = (list n).foldr f x

{n : Nat}
{α : Type u_1}
(f : Fin n → α → α)
(x : α)

Fin.foldr n f x = List.foldr f x (Fin.list n)


@[to_additive]
theorem continuous_of_continuous_uncurry {A : Type*} [TopologicalSpace A]
    (f : A → ContinuousMonoidHom B C) (h : Continuous (Function.uncurry fun x y => f x y)) :
    Continuous f

(h : Continuous (Function.uncurry fun x y => (f x) y))


@[simp]
theorem one_coeff_zero : (1 : 𝕎 R).coeff 0 = 1

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


theorem add_divOf (x y : k[G]) (g : G) : (x + y) /ᵒᶠ g = x /ᵒᶠ g + y /ᵒᶠ g

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


/-- Two isomorphic functors `F₁` and `F₂` induce isomorphic functors
`F₁.mapTriangle` and `F₂.mapTriangle` if the isomorphism `F₁ ≅ F₂` is compatible
with the shifts. -/
@[simps!]
def mapTriangleIso {F₁ F₂ : C ⥤ D} (e : F₁ ≅ F₂) [F₁.CommShift ℤ] [F₂.CommShift ℤ]
    [NatTrans.CommShift e.hom ℤ] : F₁.mapTriangle ≅ F₂.mapTriangle

(X : CategoryTheory.Pretriangulated.Triangle C)

((CategoryTheory.Functor.mapTriangleIso e).inv.app X).hom₃ = e.inv.app X.obj₃


theorem isLeftRegular [Mul R] {a : R} (h : IsSMulRegular R a) : IsLeftRegular a

{R : Type u_1}
[Mul R]
{a : R}
(h : IsSMulRegular R a)


theorem measurableSingletonClass_of_countablySeparated
    [MeasurableSpace α] [CountablySeparated α] :
    MeasurableSingletonClass α

{α : Type u_1}
[MeasurableSpace α]
[MeasurableSpace.CountablySeparated α]


/-- A morphism between source objects `S ⟶ S'`
contravariantly induces a functor between structured arrows,
`StructuredArrow S' T ⥤ StructuredArrow S T`.

Ideally this would be described as a 2-functor from `D`
(promoted to a 2-category with equations as 2-morphisms)
to `Cat`.
-/
@[simps!]
def map (f : S ⟶ S') : StructuredArrow S' T ⥤ StructuredArrow S T

(X : CategoryTheory.Comma (CategoryTheory.Functor.fromPUnit S') T)

((CategoryTheory.StructuredArrow.map f).obj X).right = X.right


theorem contDiff_sinh {n} : ContDiff ℂ n sinh


theorem powHalf_le_one (n : ℕ) : powHalf n ≤ 1


@[to_additive Filter.Tendsto.nnnorm]
theorem Filter.Tendsto.nnnorm' (h : Tendsto f l (𝓝 a)) : Tendsto (fun x => ‖f x‖₊) l (𝓝 ‖a‖₊)

{α : Type u_3}
{E : Type u_6}
[SeminormedAddGroup E]
{a : E}
{l : Filter α}
{f : α → E}
(h : Filter.Tendsto f l (𝓝 a))

Filter.Tendsto (fun x => ‖f x‖₊) l (𝓝 ‖a‖₊)


theorem sum_cycleType (σ : Perm α) : σ.cycleType.sum = σ.support.card

{α : Type u_1}
[Fintype α]
[DecidableEq α]
(σ : Equiv.Perm α)


theorem compl_cIoo {a b : α} : (cIoo a b)ᶜ = cIcc b a

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


theorem encard_congr (e : s ≃ t) : s.encard = t.encard

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


protected theorem contMDiff (s : Cₛ^n⟮I; F, V⟯) :
    ContMDiff I (I.prod 𝓘(𝕜, F)) n fun x => TotalSpace.mk' F x (s x : V x)

[TopologicalSpace (Bundle.TotalSpace F V)]

ContMDiff I (I.prod 𝓘(𝕜, F)) n fun x => Bundle.TotalSpace.mk' F x (s x)


theorem detAux_def'' {ι' : Type*} [Fintype ι'] [DecidableEq ι'] (tb : Trunc <| Basis ι A M)
    (b' : Basis ι' A M) (f : M →ₗ[A] M) :
    LinearMap.detAux tb f = Matrix.det (LinearMap.toMatrix b' b' f)

{M : Type u_2}
[AddCommGroup M]
{ι : Type u_4}
[DecidableEq ι]
[Fintype ι]
{A : Type u_5}
[CommRing A]
[Module A M]
{ι' : Type u_7}
[Fintype ι']
[DecidableEq ι']
(tb : Trunc (Basis ι A M))
(b' : Basis ι' A M)
(f : M →ₗ[A] M)

(LinearMap.detAux tb) f = ((LinearMap.toMatrix b' b') f).det


theorem essSup_const (c : β) (hμ : μ ≠ 0) : essSup (fun _ : α => c) μ = c

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[ConditionallyCompleteLattice β]
(c : β)
(hμ : μ ≠ 0)


/-- Exactness of `S.X₃.homology i ⟶ S.X₁.homology j ⟶ S.X₂.homology j`. -/
lemma homology_exact₁ : (ShortComplex.mk _ _ (δ_comp hS i j hij)).Exact

{S : CategoryTheory.ShortComplex (HomologicalComplex C c)}

(CategoryTheory.ShortComplex.mk (hS.δ i j hij) (HomologicalComplex.homologyMap S.f j) ⋯).Exact


theorem _root_.ContinuousOn.ennreal_mul [TopologicalSpace α] {f g : α → ℝ≥0∞} {s : Set α}
    (hf : ContinuousOn f s) (hg : ContinuousOn g s) (h₁ : ∀ x ∈ s, f x ≠ 0 ∨ g x ≠ ∞)
    (h₂ : ∀ x ∈ s, g x ≠ 0 ∨ f x ≠ ∞) : ContinuousOn (fun x => f x * g x) s

{α : Type u_1}
[TopologicalSpace α]
{f g : α → ℝ≥0∞}
{s : Set α}
(hf : ContinuousOn f s)
(hg : ContinuousOn g s)
(h₁ : ∀ x ∈ s, f x ≠ 0 ∨ g x ≠ ⊤)
(h₂ : ∀ x ∈ s, g x ≠ 0 ∨ f x ≠ ⊤)


theorem norm_intCast_eq_padic_norm (z : ℤ) : ‖(z : ℤ_[p])‖ = ‖(z : ℚ_[p])‖


/-- The algebra isomorphism `adjoin ℤ {ζ} ≃ₐ[ℤ] (𝓞 K)`, where `ζ` is a primitive `p ^ k`-th root of
unity and `K` is a `p ^ k`-th cyclotomic extension of `ℚ`. -/
@[simps!]
noncomputable def _root_.IsPrimitiveRoot.adjoinEquivRingOfIntegers
    [IsCyclotomicExtension {p ^ k} ℚ K] (hζ : IsPrimitiveRoot ζ ↑(p ^ k)) :
    adjoin ℤ ({ζ} : Set K) ≃ₐ[ℤ] 𝓞 K

{p : ℕ+}
{k : ℕ}
{K : Type u}
[Field K]
[CharZero K]
{ζ : K}
[hp : Fact (Nat.Prime ↑p)]
[IsCyclotomicExtension {p ^ k} ℚ K]
(hζ : IsPrimitiveRoot ζ ↑(p ^ k))
(a : ↥(Algebra.adjoin ℤ {ζ}))

hζ.adjoinEquivRingOfIntegers a = (IsIntegralClosure.lift ℤ (𝓞 K) K) a


/-- The **Upward Löwenheim–Skolem Theorem**: If `κ` is a cardinal greater than the cardinalities of
`L` and an infinite `L`-structure `M`, then `M` has an elementary extension of cardinality `κ`. -/
theorem exists_elementaryEmbedding_card_eq_of_ge (M : Type w') [L.Structure M] [iM : Infinite M]
    (κ : Cardinal.{w}) (h1 : Cardinal.lift.{w} L.card ≤ Cardinal.lift.{max u v} κ)
    (h2 : Cardinal.lift.{w} #M ≤ Cardinal.lift.{w'} κ) :
    ∃ N : Bundled L.Structure, Nonempty (M ↪ₑ[L] N) ∧ #N = κ

(h1 : Cardinal.lift.{w, max u v} L.card ≤ Cardinal.lift.{max u v, w} κ)

(h2 : Cardinal.lift.{w, w'} #M ≤ Cardinal.lift.{w', w} κ)


@[simp]
theorem indexOf_cons_ne {a b : α} (l : List α) : b ≠ a → indexOf a (b :: l) = succ (indexOf a l)

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

b ≠ a → List.indexOf a (b :: l) = (List.indexOf a l).succ


/-- **Vitali-Carathéodory Theorem**: given an integrable real function `f`, there exists an
integrable function `g > f` which is lower semicontinuous, with integral arbitrarily close
to that of `f`. This function has to be `EReal`-valued in general. -/
theorem exists_lt_lowerSemicontinuous_integral_lt [SigmaFinite μ] (f : α → ℝ) (hf : Integrable f μ)
    {ε : ℝ} (εpos : 0 < ε) :
    ∃ g : α → EReal,
      (∀ x, (f x : EReal) < g x) ∧
      LowerSemicontinuous g ∧
      Integrable (fun x => EReal.toReal (g x)) μ ∧
      (∀ᵐ x ∂μ, g x < ⊤) ∧ (∫ x, EReal.toReal (g x) ∂μ) < (∫ x, f x ∂μ) + ε

{α : Type u_1}
[TopologicalSpace α]
[MeasurableSpace α]
[BorelSpace α]
{μ : MeasureTheory.Measure α}
[μ.WeaklyRegular]
[MeasureTheory.SigmaFinite μ]
(f : α → ℝ)
(hf : MeasureTheory.Integrable f μ)
{ε : ℝ}
(εpos : 0 < ε)

∃ g,
  (∀ (x : α), ↑(f x) < g x) ∧
    LowerSemicontinuous g ∧
      MeasureTheory.Integrable (fun x => (g x).toReal) μ ∧
        (∀ᵐ (x : α) ∂μ, g x < ⊤) ∧ ∫ (x : α), (g x).toReal ∂μ < ∫ (x : α), f x ∂μ + ε


@[to_additive (attr := simp)]
theorem image_mul_left :
    image (fun b => a * b) t = preimage t (fun b => a⁻¹ * b) (mul_right_injective _).injOn

{α : Type u_2}
[DecidableEq α]
[AddGroup α]
{t : Finset α}
{a : α}

Finset.image (fun b => a + b) t = t.preimage (fun b => -a + b) ⋯


theorem card_le_of_injective [Finite β] (f : α → β) (hf : Function.Injective f) :
    Nat.card α ≤ Nat.card β

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


lemma exponentialPDF_eq (r x : ℝ) :
    exponentialPDF r x = ENNReal.ofReal (if 0 ≤ x then r * exp (-(r * x)) else 0)

ProbabilityTheory.exponentialPDF r x = ENNReal.ofReal (if 0 ≤ x then r * rexp (-(r * x)) else 0)


@[simp]
theorem embeddingsMatrix_apply (b : κ → B) (i) (σ : B →ₐ[A] C) :
    embeddingsMatrix A C b i σ = σ (b i)

{κ : Type w}
(A : Type u)
{B : Type v}
(C : Type z)
[CommRing A]
[CommRing B]
[Algebra A B]
[CommRing C]
[Algebra A C]
(b : κ → B)
(i : κ)
(σ : B →ₐ[A] C)

Algebra.embeddingsMatrix A C b i σ = σ (b i)


theorem lintegral_lt_top {f : α →ₛ ℝ≥0∞} (hm : f.FinMeasSupp μ) (hf : ∀ᵐ a ∂μ, f a ≠ ∞) :
    f.lintegral μ < ∞

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f : MeasureTheory.SimpleFunc α ℝ≥0∞}
(hm : f.FinMeasSupp μ)
(hf : ∀ᵐ (a : α) ∂μ, ↑f a ≠ ⊤)


@[to_additive]
theorem Left.inv_le_self (h : 1 ≤ a) : a⁻¹ ≤ a

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


theorem biUnion_assoc (πi : ∀ J, Prepartition J) (πi' : Box ι → ∀ J : Box ι, Prepartition J) :
    (π.biUnion fun J => (πi J).biUnion (πi' J)) =
      (π.biUnion πi).biUnion fun J => πi' (π.biUnionIndex πi J) J

(πi : (J : BoxIntegral.Box ι) → BoxIntegral.Prepartition J)

(πi' : BoxIntegral.Box ι → (J : BoxIntegral.Box ι) → BoxIntegral.Prepartition J)


/-- The category of cones on `F` is just the comma category `(Δ ↓ F)`, where `Δ` is the constant
    functor. -/
@[simps! (config := { notRecursive := [`PLift, `ULift] })]
def Cone.equivCostructuredArrow (F : J ⥤ C) : Cone F ≌ CostructuredArrow (const J) F

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
(F : CategoryTheory.Functor J C)
(c : CategoryTheory.Limits.Cone F)

((CategoryTheory.Limits.Cone.equivCostructuredArrow F).functor.obj c).right.as = PUnit.unit


@[ext]
lemma hom_ext {X Y : StructuredArrow S T} (f g : X ⟶ Y) (h : f.right = g.right) : f = g

{X Y : CategoryTheory.StructuredArrow S T}


@[to_additive (attr := simp)]
theorem coe_top : ((⊤ : Submonoid M) : Set M) = Set.univ


theorem sub_mem_Ioc_iff_left : a - b ∈ Set.Ioc c d ↔ a ∈ Set.Ioc (c + b) (d + b)

{α : Type u_1}
[OrderedAddCommGroup α]
{a b c d : α}


theorem comap_neBot_iff_frequently {f : Filter β} {m : α → β} :
    NeBot (comap m f) ↔ ∃ᶠ y in f, y ∈ range m

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

(Filter.comap m f).NeBot ↔ ∃ᶠ (y : β) in f, y ∈ Set.range m


theorem measure_le_lintegral_thickenedIndicator (μ : Measure X) {E : Set X}
    (E_mble : MeasurableSet E) {δ : ℝ} (δ_pos : 0 < δ) :
    μ E ≤ ∫⁻ x, (thickenedIndicator δ_pos E x : ℝ≥0∞) ∂μ

{X : Type u_1}
[MeasurableSpace X]
[PseudoEMetricSpace X]
(μ : MeasureTheory.Measure X)
{E : Set X}
(E_mble : MeasurableSet E)
{δ : ℝ}
(δ_pos : 0 < δ)

μ E ≤ ∫⁻ (x : X), ↑((thickenedIndicator δ_pos E) x) ∂μ


@[to_additive]
theorem mulDysonETransform.smul_finset_snd_subset_fst :
    e • (mulDysonETransform e x).2 ⊆ (mulDysonETransform e x).1

{α : Type u_1}
[DecidableEq α]
[CommGroup α]
{e : α}
{x : Finset α × Finset α}

e • (Finset.mulDysonETransform e x).2 ⊆ (Finset.mulDysonETransform e x).1


theorem Set.Finite.isOpen_sInter {s : Set (Set X)} (hs : s.Finite) :
    (∀ t ∈ s, IsOpen t) → IsOpen (⋂₀ s)

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


theorem u_l_leftInverse [PartialOrder α] [Preorder β] (gi : GaloisCoinsertion l u) :
    LeftInverse u l

{α : Type u}
{β : Type v}
{l : α → β}
{u : β → α}
[PartialOrder α]
[Preorder β]
(gi : GaloisCoinsertion l u)


@[simp]
theorem mem_edgeSet : s(v, w) ∈ G.edgeSet ↔ G.Adj v w

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


/-- The `n+1`-dimensional loops are in bijection with the loops in the space of
  `n`-dimensional loops with base point `const`.
  We allow an arbitrary indexing type `N` in place of `Fin n` here. -/
@[simps]
def loopHomeo (i : N) : Ω^ N X x ≃ₜ Ω (Ω^ { j // j ≠ i } X x) const

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

(GenLoop.loopHomeo i) p = GenLoop.toLoop i p


/-- As `0` is the default value for `Real.sInf` of the empty set, it suffices to show that `S` is
bounded below by `0` to show that `0 ≤ sInf S`.
-/
theorem sInf_nonneg (S : Set ℝ) (hS : ∀ x ∈ S, (0 : ℝ) ≤ x) : 0 ≤ sInf S


theorem iSup_ite (f g : ι → α) :
    ⨆ i, (if p i then f i else g i) = (⨆ (i) (_ : p i), f i) ⊔ ⨆ (i) (_ : ¬p i), g i

{α : Type u_1}
{ι : Sort u_5}
[CompleteLattice α]
(p : ι → Prop)
[DecidablePred p]
(f g : ι → α)

(⨆ i, if p i then f i else g i) = (⨆ i, ⨆ (_ : p i), f i) ⊔ ⨆ i, ⨆ (_ : ¬p i), g i


@[simp]
theorem nhds_discrete (α : Type*) [TopologicalSpace α] [DiscreteTopology α] : @nhds α _ = pure

(α : Type u_3)
[TopologicalSpace α]
[DiscreteTopology α]


@[simp]
theorem realize_one (v : α → R) : Term.realize v (1 : ring.Term α) = 1

{α : Type u_1}
{R : Type u_2}
[Add R]
[Mul R]
[Neg R]
[One R]
[Zero R]
[FirstOrder.Ring.CompatibleRing R]
(v : α → R)

FirstOrder.Language.Term.realize v 1 = 1


theorem integrableOn_rpow_mul_exp_neg_rpow {p s : ℝ} (hs : -1 < s) (hp : 1 ≤ p) :
    IntegrableOn (fun x : ℝ => x ^ s * exp (- x ^ p)) (Ioi 0)

MeasureTheory.IntegrableOn (fun x => x ^ s * rexp (-x ^ p)) (Set.Ioi 0) MeasureTheory.volume


theorem sublattice_closure_eq_top (L : Set C(X, ℝ)) (nA : L.Nonempty)
    (inf_mem : ∀ᵉ (f ∈ L) (g ∈ L), f ⊓ g ∈ L)
    (sup_mem : ∀ᵉ (f ∈ L) (g ∈ L), f ⊔ g ∈ L) (sep : L.SeparatesPointsStrongly) :
    closure L = ⊤

{X : Type u_1}
[TopologicalSpace X]
[CompactSpace X]
(L : Set C(X, ℝ))
(nA : L.Nonempty)
(inf_mem : ∀ f ∈ L, ∀ g ∈ L, f ⊓ g ∈ L)
(sup_mem : ∀ f ∈ L, ∀ g ∈ L, f ⊔ g ∈ L)
(sep : L.SeparatesPointsStrongly)


theorem absNorm_eq_zero_iff [NoZeroDivisors K] {I : FractionalIdeal R⁰ K} :
    absNorm I = 0 ↔ I = 0

{I : FractionalIdeal (nonZeroDivisors R) K}


@[to_additive]
theorem Step.cons {x} (H : Red.Step L₁ L₂) : Red.Step (x :: L₁) (x :: L₂)

{α : Type u}
{L₁ L₂ : List (α × Bool)}
{x : α × Bool}
(H : FreeAddGroup.Red.Step L₁ L₂)

FreeAddGroup.Red.Step (x :: L₁) (x :: L₂)


theorem _root_.AlgebraicGeometry.isIso_iff_isOpenImmersion {X Y : Scheme.{u}} (f : X ⟶ Y) :
    IsIso f ↔ IsOpenImmersion f ∧ Epi f.1.base

{X Y : AlgebraicGeometry.Scheme}
(f : X ⟶ Y)

CategoryTheory.IsIso f ↔ AlgebraicGeometry.IsOpenImmersion f ∧ CategoryTheory.Epi f.val.base


/-- A version of `CategoryTheory.whiskeringRight` for bifunctors, obtained by uncurrying,
applying `whiskeringRight` and currying back
-/
@[simps!]
def whiskeringRight₂ : (C ⥤ D ⥤ E) ⥤ (B ⥤ C) ⥤ (B ⥤ D) ⥤ B ⥤ E

(X : CategoryTheory.Functor C (CategoryTheory.Functor D E))

∀ (X_1 : CategoryTheory.Functor B C) (Y : CategoryTheory.Functor B D) {X_2 Y_1 : B} (f : X_2 ⟶ Y_1),
  ((((CategoryTheory.whiskeringRight₂ B C D E).obj X).obj X_1).obj Y).map f =
    CategoryTheory.CategoryStruct.comp ((X.map (X_1.map f)).app (Y.obj X_2)) ((X.obj (X_1.obj Y_1)).map (Y.map f))


/-- `cyclotomic n` is primitive. -/
theorem cyclotomic.isPrimitive (n : ℕ) (R : Type*) [CommRing R] : (cyclotomic n R).IsPrimitive


@[simp]
theorem ppow_one (x : M) : x ^ (1 : ℕ+) = x

{M : Type u_1}
[Mul M]
[Pow M ℕ+]
[PNatPowAssoc M]
(x : M)


/-- Two homomorphisms out of a free group are equal if they are equal on generators.

See note [partially-applied ext lemmas]. -/
@[to_additive (attr := ext) "Two homomorphisms out of a free additive group are equal if they are
  equal on generators. See note [partially-applied ext lemmas]."]
theorem ext_hom {G : Type*} [Group G] (f g : FreeGroup α →* G) (h : ∀ a, f (of a) = g (of a)) :
    f = g

(h : ∀ (a : α), f (FreeGroup.of a) = g (FreeGroup.of a))


@[simp]
theorem frobenius_norm_transpose (A : Matrix m n α) : ‖Aᵀ‖ = ‖A‖

{m : Type u_3}
{n : Type u_4}
{α : Type u_5}
[Fintype m]
[Fintype n]
[SeminormedAddCommGroup α]
(A : Matrix m n α)


@[to_additive (attr := simp)]
lemma smul_inv_smul (g : G) (a : α) : g • g⁻¹ • a = a

{G : Type u_3}
{α : Type u_7}
[Group G]
[MulAction G α]
(g : G)
(a : α)


@[to_additive (attr := simp)]
lemma piFinset_inv [∀ i, Inv (α i)] (s : ∀ i, Finset (α i)) :
    piFinset (fun i ↦ (s i)⁻¹) = (piFinset s)⁻¹

{ι : Type u_5}
{α : ι → Type u_6}
[Fintype ι]
[DecidableEq ι]
[(i : ι) → DecidableEq (α i)]
[(i : ι) → Inv (α i)]
(s : (i : ι) → Finset (α i))

(Fintype.piFinset fun i => (s i)⁻¹) = (Fintype.piFinset s)⁻¹


theorem monomial_injective (n : ℕ) : Function.Injective (monomial n : R → R[X])


@[simp] lemma mul_def : Nat.mul m n = m * n


@[simp]
theorem linMulLin_add (f g h : M →ₗ[R] A) : linMulLin f (g + h) = linMulLin f g + linMulLin f h

{R : Type u_3}
{M : Type u_4}
{A : Type u_7}
[CommSemiring R]
[NonUnitalNonAssocSemiring A]
[AddCommMonoid M]
[Module R M]
[Module R A]
[SMulCommClass R A A]
[IsScalarTower R A A]
(f g h : M →ₗ[R] A)

QuadraticMap.linMulLin f (g + h) = QuadraticMap.linMulLin f g + QuadraticMap.linMulLin f h


/-- The left multiplication map: `(a, b) ↦ a * b`. See also `AddMonoidHom.mulLeft`. -/
@[simps!]
def AddMonoid.End.mulLeft : R →+ AddMonoid.End R

{R : Type u_1}
[NonUnitalNonAssocSemiring R]
(r : R)

∀ (x : R), (AddMonoid.End.mulLeft r) x = r * x


theorem IccExtend_of_le_left (f : Icc a b → β) (hx : x ≤ a) :
    IccExtend h f x = f ⟨a, left_mem_Icc.2 h⟩

{α : Type u_1}
{β : Type u_2}
[LinearOrder α]
{a b : α}
(h : a ≤ b)
{x : α}
(f : ↑(Set.Icc a b) → β)
(hx : x ≤ a)


@[to_additive]
theorem absolutelyContinuous_map_div_left (g : G) : μ ≪ map (fun h => g / h) μ

{G : Type u_1}
[MeasurableSpace G]
[AddGroup G]
[MeasurableAdd₂ G]
(μ : MeasureTheory.Measure G)
[MeasureTheory.SFinite μ]
[MeasurableNeg G]
[μ.IsAddLeftInvariant]
(g : G)

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


@[bv_toNat] theorem getLsb_last (x : BitVec w) :
    x.getLsb (w-1) = decide (2 ^ (w-1) ≤ x.toNat)

x.getLsb (w - 1) = decide (2 ^ (w - 1) ≤ x.toNat)


/-- Let `G` be a complete nonarchimedean multiplicative abelian group. Then a function `f : α → G`
is unconditionally multipliable if and only if it tends to one on the filter of cofinite sets. -/
@[to_additive "Let `G` be a complete nonarchimedean additive abelian group. Then a function
`f : α → G` is unconditionally summable if and only if it tends to zero on the filter of cofinite
sets."]
theorem multipliable_iff_tendsto_cofinite_one [CompleteSpace G] (f : α → G) :
    Multipliable f ↔ Tendsto f cofinite (𝓝 1)

{α : Type u_1}
{G : Type u_2}
[CommGroup G]
[UniformSpace G]
[UniformGroup G]
[NonarchimedeanGroup G]
[CompleteSpace G]
(f : α → G)

Multipliable f ↔ Filter.Tendsto f Filter.cofinite (𝓝 1)


theorem AECover.aemeasurable {β : Type*} [MeasurableSpace β] [l.IsCountablyGenerated] [l.NeBot]
    {f : α → β} {φ : ι → Set α} (hφ : AECover μ l φ)
    (hfm : ∀ i, AEMeasurable f (μ.restrict <| φ i)) : AEMeasurable f μ

(hfm : ∀ (i : ι), AEMeasurable f (μ.restrict (φ i)))


theorem bot_ne_top : (⊥ : AffineSubspace k P) ≠ ⊤

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


@[simp]
theorem Icc_union_Ioo_eq_Ico (h₁ : a ≤ b) (h₂ : b < c) : Icc a b ∪ Ioo b c = Ico a c

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


theorem bddLat_dual_comp_forget_to_semilatInfCat :
    BddLat.dual ⋙ forget₂ BddLat SemilatInfCat =
    forget₂ BddLat SemilatSupCat ⋙ SemilatSupCat.dual

BddLat.dual ⋙ CategoryTheory.forget₂ BddLat SemilatInfCat =
  CategoryTheory.forget₂ BddLat SemilatSupCat ⋙ SemilatSupCat.dual


/-- If a monotone function `u : ι → α` tends to `atTop` along *some* non-trivial filter `l`, then
it tends to `atTop` along `atTop`. -/
theorem tendsto_atTop_of_monotone_of_filter [Preorder ι] [Preorder α] {l : Filter ι} {u : ι → α}
    (h : Monotone u) [NeBot l] (hu : Tendsto u l atTop) : Tendsto u atTop atTop

{ι : Type u_1}
{α : Type u_3}
[Preorder ι]
[Preorder α]
{l : Filter ι}
{u : ι → α}
(h : Monotone u)
[l.NeBot]
(hu : Filter.Tendsto u l Filter.atTop)

Filter.Tendsto u Filter.atTop Filter.atTop


theorem map_inf [SemilatticeInf β] {f : α → β} (hf : Monotone f) (x y : α) :
    f (x ⊓ y) = f x ⊓ f y

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


theorem replicate_subset_singleton (n) (a : α) : replicate n a ⊆ [a]


theorem add_mem' (U : (Opens (ProjectiveSpectrum.top 𝒜))ᵒᵖ) (a b : ∀ x : U.unop, at x.1)
    (ha : (isLocallyFraction 𝒜).pred a) (hb : (isLocallyFraction 𝒜).pred b) :
    (isLocallyFraction 𝒜).pred (a + b)

(U : (TopologicalSpace.Opens ↑(ProjectiveSpectrum.top 𝒜))ᵒᵖ)

(a b : (x : ↥(Opposite.unop U)) → HomogeneousLocalization.AtPrime 𝒜 (↑x).asHomogeneousIdeal.toIdeal)

(ha : (AlgebraicGeometry.ProjectiveSpectrum.StructureSheaf.isLocallyFraction 𝒜).pred a)

(hb : (AlgebraicGeometry.ProjectiveSpectrum.StructureSheaf.isLocallyFraction 𝒜).pred b)

(AlgebraicGeometry.ProjectiveSpectrum.StructureSheaf.isLocallyFraction 𝒜).pred (a + b)


@[to_additive]
theorem mk'_mul (x₁ x₂ : M) (y₁ y₂ : S) : f.mk' (x₁ * x₂) (y₁ * y₂) = f.mk' x₁ y₁ * f.mk' x₂ y₂

{M : Type u_1}
[CommMonoid M]
{S : Submonoid M}
{N : Type u_2}
[CommMonoid N]
(f : S.LocalizationMap N)
(x₁ x₂ : M)
(y₁ y₂ : ↥S)


theorem isBigOWith_zero' : IsBigOWith 0 l (fun _x => (0 : E')) g

{α : Type u_1}
{F : Type u_4}
{E' : Type u_6}
[Norm F]
[SeminormedAddCommGroup E']
(g : α → F)
(l : Filter α)

Asymptotics.IsBigOWith 0 l (fun _x => 0) g


theorem add_right_inj (h : a ≠ ∞) : a + b = a + c ↔ b = c


@[to_additive (attr := simp)]
theorem noncommProd_toFinset [DecidableEq α] (l : List α) (f : α → β) (comm) (hl : l.Nodup) :
    noncommProd l.toFinset f comm = (l.map f).prod

(comm : (↑l.toFinset).Pairwise fun a b => Commute (f a) (f b))

l.toFinset.noncommProd f comm = (List.map f l).prod


theorem mem_singleton_self (a : α) : a ∈ ({a} : Finset α)


lemma eulerMascheroniConstant_eq_neg_deriv : γ = -deriv Gamma 1


/-- Down-compressing a family doesn't change its size. -/
@[simp]
theorem card_compression (a : α) (𝒜 : Finset (Finset α)) : (𝓓 a 𝒜).card = 𝒜.card

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


theorem Antitone.quasiconcaveOn (hf : Antitone f) : QuasiconcaveOn 𝕜 univ f

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_4}
[OrderedSemiring 𝕜]
[LinearOrderedAddCommMonoid E]
[OrderedAddCommMonoid β]
[Module 𝕜 E]
[OrderedSMul 𝕜 E]
{f : E → β}
(hf : Antitone f)


theorem HasStrictFDerivAt.comp_hasStrictDerivAt (hl : HasStrictFDerivAt l l' (f x))
    (hf : HasStrictDerivAt f f' x) : HasStrictDerivAt (l ∘ f) (l' f') x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{E : Type w}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{f : 𝕜 → F}
{f' : F}
(x : 𝕜)
{l : F → E}
{l' : F →L[𝕜] E}
(hl : HasStrictFDerivAt l l' (f x))
(hf : HasStrictDerivAt f f' x)


theorem add_compContinuous [TopologicalSpace γ] (h : C(γ, α)) :
    (g + f).compContinuous h = g.compContinuous h + f.compContinuous h

{α : Type u}
{β : Type v}
{γ : Type w}
[TopologicalSpace α]
[PseudoMetricSpace β]
[AddMonoid β]
[BoundedAdd β]
[ContinuousAdd β]
(f g : BoundedContinuousFunction α β)
[TopologicalSpace γ]
(h : C(γ, α))


@[simp]
theorem quotQuotEquivCommₐ_toRingEquiv :
    (quotQuotEquivCommₐ R I J : _ ⧸ J.map (Quotient.mkₐ R I) ≃+* _ ⧸ I.map (Quotient.mkₐ R J)) =
      quotQuotEquivComm I J

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

↑(DoubleQuot.quotQuotEquivCommₐ R I J) = DoubleQuot.quotQuotEquivComm I J


/-- The special case of the first cosimplicial identity -/
@[reassoc]
theorem δ_comp_δ_self {n} {i : Fin (n + 2)} :
    X.δ i ≫ X.δ (Fin.castSucc i) = X.δ i ≫ X.δ i.succ

(X : CategoryTheory.CosimplicialObject C)

X.δ i ≫ X.δ i.castSucc = X.δ i ≫ X.δ i.succ


theorem sequenceOfCofinals.monotone : Monotone (sequenceOfCofinals p 𝒟)

{P : Type u_1}
[Preorder P]
(p : P)
{ι : Type u_2}
[Encodable ι]
(𝒟 : ι → Order.Cofinal P)


/-- We can compute a left derived functor on a morphism using a descent of that morphism
to a chain map between chosen projective resolutions.
-/
theorem Functor.leftDerived_map_eq (F : C ⥤ D) [F.Additive] (n : ℕ) {X Y : C} (f : X ⟶ Y)
    {P : ProjectiveResolution X} {Q : ProjectiveResolution Y} (g : P.complex ⟶ Q.complex)
    (w : g ≫ Q.π = P.π ≫ (ChainComplex.single₀ C).map f) :
    (F.leftDerived n).map f =
      (P.isoLeftDerivedObj F n).hom ≫
        (F.mapHomologicalComplex _ ⋙ HomologicalComplex.homologyFunctor _ _ n).map g ≫
          (Q.isoLeftDerivedObj F n).inv

{P : CategoryTheory.ProjectiveResolution X}

{Q : CategoryTheory.ProjectiveResolution Y}

(w : CategoryTheory.CategoryStruct.comp g Q.π = CategoryTheory.CategoryStruct.comp P.π ((ChainComplex.single₀ C).map f))

(F.leftDerived n).map f =
  CategoryTheory.CategoryStruct.comp (P.isoLeftDerivedObj F n).hom
    (CategoryTheory.CategoryStruct.comp
      (((F.mapHomologicalComplex (ComplexShape.down ℕ)).comp
            (HomologicalComplex.homologyFunctor D (ComplexShape.down ℕ) n)).map
        g)
      (Q.isoLeftDerivedObj F n).inv)


theorem add_def' (a b : Rat) : a + b = mkRat (a.num * b.den + b.num * a.den) (a.den * b.den)

a + b = mkRat (a.num * ↑b.den + b.num * ↑a.den) (a.den * b.den)


theorem compress_mem_compression (ha : a ∈ s) : compress u v a ∈ 𝓒 u v s

{α : Type u_1}
[GeneralizedBooleanAlgebra α]
[DecidableRel Disjoint]
[DecidableRel fun x x_1 => x ≤ x_1]
{s : Finset α}
{u v a : α}
[DecidableEq α]
(ha : a ∈ s)

UV.compress u v a ∈ UV.compression u v s


theorem support_formPerm_of_nodup' (l : List α) (h : Nodup l) (h' : ∀ x : α, l ≠ [x]) :
    { x | formPerm l x ≠ x } = l.toFinset

{α : Type u_1}
[DecidableEq α]
(l : List α)
(h : l.Nodup)
(h' : ∀ (x : α), l ≠ [x])


/-- Given a vector `v` of length `n`, make a vector of length `n + 1` whose product is `1`,
by appending the inverse of the product of `v`. -/
@[simps]
def vectorEquiv : Vector G n ≃ vectorsProdEqOne G (n + 1)

(v : ↑(Equiv.Perm.vectorsProdEqOne G (n + 1)))

(Equiv.Perm.VectorsProdEqOne.vectorEquiv G n).symm v = (↑v).tail


/-- We say that a type has `MeasurableAdd` if `(· + c)` and `(· + c)` are measurable functions.
For a typeclass assuming measurability of `uncurry (· + ·)` see `MeasurableAdd₂`. -/
class MeasurableAdd (M : Type*) [MeasurableSpace M] [Add M] : Prop where
  measurable_const_add : ∀ c : M, Measurable (c + ·)
  measurable_add_const : ∀ c : M, Measurable (· + c)

{M : Type u_2}
[MeasurableSpace M]
[Add M]
[self : MeasurableAdd M]
(c : M)


/-- If we dilate the interior of a convex set about a point in its interior by a scale `t > 1`,
the result includes the closure of the original set.

TODO Generalise this from convex sets to sets that are balanced / star-shaped about `x`. -/
theorem Convex.closure_subset_image_homothety_interior_of_one_lt {s : Set E} (hs : Convex ℝ s)
    {x : E} (hx : x ∈ interior s) (t : ℝ) (ht : 1 < t) :
    closure s ⊆ homothety x t '' interior s

{E : Type u_3}
[AddCommGroup E]
[Module ℝ E]
[TopologicalSpace E]
[TopologicalAddGroup E]
[ContinuousSMul ℝ E]
{s : Set E}
(hs : Convex ℝ s)
{x : E}
(hx : x ∈ interior s)
(t : ℝ)
(ht : 1 < t)

closure s ⊆ ⇑(AffineMap.homothety x t) '' interior s


@[simp]
theorem sin_two_pi : sin (2 * π) = 0


/-- Given a left homology map data `ψ : LeftHomologyMapData φ h₁ h₂` such that
both left homology data `h₁` and `h₂` are preserved by a functor `F`, this is
the induced left homology map data for the morphism `F.mapShortComplex.map φ`. -/
@[simps]
def LeftHomologyMapData.map {φ : S₁ ⟶ S₂} {h₁ : S₁.LeftHomologyData}
    {h₂ : S₂.LeftHomologyData} (ψ : LeftHomologyMapData φ h₁ h₂) (F : C ⥤ D)
    [F.PreservesZeroMorphisms] [h₁.IsPreservedBy F] [h₂.IsPreservedBy F] :
    LeftHomologyMapData (F.mapShortComplex.map φ) (h₁.map F) (h₂.map F)

(ψ : CategoryTheory.ShortComplex.LeftHomologyMapData φ h₁ h₂)


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

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{H : Type u_2}
[TopologicalSpace H]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{I : ModelWithCorners 𝕜 E H}
{G : Type u_4}
[Add G]
[TopologicalSpace G]
[ChartedSpace H G]
[SmoothAdd I G]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M : Type u_7}
[TopologicalSpace M]
[ChartedSpace H' M]
{f g : M → G}
{s : Set M}
{n : ℕ∞}
(hf : ContMDiffOn I' I n f s)
(hg : ContMDiffOn I' I n g s)


/-- Verschiebung is the same as multiplication by `p` on the ring of Witt vectors of `ZMod p`. -/
theorem verschiebung_zmod (x : 𝕎 (ZMod p)) : verschiebung x = x * p

{p : ℕ}
[hp : Fact (Nat.Prime p)]
(x : WittVector p (ZMod p))


theorem coordinate_eval_2 : (coordinate 2).eval (.ofList (a0 :: a1 :: a2 :: t)) = a2

(Lean.Omega.LinearCombo.coordinate 2).eval (Lean.Omega.Coeffs.ofList (a0 :: a1 :: a2 :: t)) = a2


theorem linear_trivializationOfMemPretrivializationAtlas (a : VectorPrebundle R F E)
    {e : Pretrivialization F (π F E)} (he : e ∈ a.pretrivializationAtlas) :
    letI := a.totalSpaceTopology
    Trivialization.IsLinear R (trivializationOfMemPretrivializationAtlas a he)

{e : Pretrivialization F Bundle.TotalSpace.proj}

Trivialization.IsLinear R (a.trivializationOfMemPretrivializationAtlas he)


theorem imageSieve_whisker_forget {F G : Cᵒᵖ ⥤ A} (f : F ⟶ G) {U : C} (s : G.obj (op U)) :
    imageSieve (whiskerRight f (forget A)) s = imageSieve f s

(s : (CategoryTheory.forget A).obj (G.obj (Opposite.op U)))

CategoryTheory.Presheaf.imageSieve (CategoryTheory.whiskerRight f (CategoryTheory.forget A)) s =
  CategoryTheory.Presheaf.imageSieve f s


@[simp]
theorem sym_neg [Neg α] (a : α) : sym (-a) = -sym a


@[simp]
theorem get_tail_succ : ∀ (v : Vector α n.succ) (i : Fin n), get (tail v) i = get v i.succ

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


theorem _root_.Int.addLeft_one_isCycle : (Equiv.addLeft 1 : Perm ℤ).IsCycle


theorem locallyFinite_of_finite [Finite ι] (f : ι → Set X) : LocallyFinite f

{ι : Type u_1}
{X : Type u_4}
[TopologicalSpace X]
[Finite ι]
(f : ι → Set X)


@[norm_cast]
-- Porting note: removed `simp`: proof is `simp only [DFunLike.coe_fn_eq]`
theorem coeFn_inj {e e' : P₁ ≃ᵃ[k] P₂} : (e : P₁ → P₂) = e' ↔ e = e'

{k : Type u_1}
{P₁ : Type u_2}
{P₂ : Type u_3}
{V₁ : Type u_6}
{V₂ : Type u_7}
[Ring k]
[AddCommGroup V₁]
[Module k V₁]
[AffineSpace V₁ P₁]
[AddCommGroup V₂]
[Module k V₂]
[AffineSpace V₂ P₂]
{e e' : P₁ ≃ᵃ[k] P₂}


theorem sub_le_succ_sub (a i : Nat) : a - i ≤ a.succ - i


/-- **Equality case of the Rearrangement Inequality**: Pointwise scalar multiplication of `f` and
`g`, which antivary together, is unchanged by a permutation if and only if `f` and `g ∘ σ` antivary
together. Stated by permuting the entries of `g`. -/
theorem Antivary.sum_smul_comp_perm_eq_sum_smul_iff (hfg : Antivary f g) :
    ∑ i, f i • g (σ i) = ∑ i, f i • g i ↔ Antivary f (g ∘ σ)

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[LinearOrderedRing α]
[LinearOrderedAddCommGroup β]
[Module α β]
[OrderedSMul α β]
{σ : Equiv.Perm ι}
{f : ι → α}
{g : ι → β}
[Fintype ι]
(hfg : Antivary f g)

∑ i : ι, f i • g (σ i) = ∑ i : ι, f i • g i ↔ Antivary f (g ∘ ⇑σ)


theorem StrictMono.comp_strictAntiOn (hg : StrictMono g) (hf : StrictAntiOn f s) :
    StrictAntiOn (g ∘ f) s

{α : Type u}
{β : Type v}
{γ : Type w}
[Preorder α]
[Preorder β]
[Preorder γ]
{g : β → γ}
{f : α → β}
{s : Set α}
(hg : StrictMono g)
(hf : StrictAntiOn f s)


@[simp] -- Porting note (#10618): was @[simp]
theorem integral_comp_div (hc : c ≠ 0) :
    (∫ x in a..b, f (x / c)) = c • ∫ x in a / c..b / c, f x

{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{a b c : ℝ}
(f : ℝ → E)
(hc : c ≠ 0)

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


theorem eq_of_le_of_forall_le_of_dense [LinearOrder α] [DenselyOrdered α] {a₁ a₂ : α} (h₁ : a₂ ≤ a₁)
    (h₂ : ∀ a, a₂ < a → a₁ ≤ a) : a₁ = a₂

{α : Type u_2}
[LinearOrder α]
[DenselyOrdered α]
{a₁ a₂ : α}
(h₁ : a₂ ≤ a₁)
(h₂ : ∀ (a : α), a₂ < a → a₁ ≤ a)


/-- The standard radical and Jacobson radical of an ideal `I` of `R` are equal if and only if
the nilradical and Jacobson radical of the quotient ring `R/I` coincide -/
-- Porting note: changed `Quotient.mk'` to ``
theorem radical_eq_jacobson_iff_radical_quotient_eq_jacobson_bot :
    I.radical = I.jacobson ↔ radical (⊥ : Ideal (R ⧸ I)) = jacobson ⊥

I.radical = I.jacobson ↔ ⊥.radical = ⊥.jacobson


lemma negOnePow_eq_one_iff (n : ℤ) : n.negOnePow = 1 ↔ Even n


@[simp]
theorem mmap_nil {m} [Monad m] {α β} (f : α → m β) : mmap f nil = pure nil

{m : Type u_2 → Type u_3}
[Monad m]
{α : Type u_4}
{β : Type u_2}
(f : α → m β)

Mathlib.Vector.mmap f Mathlib.Vector.nil = pure Mathlib.Vector.nil


@[instance]
theorem ordConnected_Ici {a : α} : OrdConnected (Ici a)


@[simp]
theorem IsInvariantSubring.coe_subtypeHom' :
    ((IsInvariantSubring.subtypeHom M U).toRingHom : U →+* R') = U.subtype

(M : Type u_1)
[Monoid M]
{R' : Type u_2}
[Ring R']
[MulSemiringAction M R']
(U : Subring R')
[IsInvariantSubring M U]

(IsInvariantSubring.subtypeHom M U).toRingHom = U.subtype


theorem forall_disjSups_iff {p : α → Prop} :
    (∀ c ∈ s ○ t, p c) ↔ ∀ a ∈ s, ∀ b ∈ t, Disjoint a b → p (a ⊔ b)

{α : Type u_2}
[DecidableEq α]
[SemilatticeSup α]
[OrderBot α]
[DecidableRel Disjoint]
{s t : Finset α}
{p : α → Prop}

(∀ c ∈ s.disjSups t, p c) ↔ ∀ a ∈ s, ∀ b ∈ t, Disjoint a b → p (a ⊔ b)


@[simp] theorem ofReal_ne_top {r : ℝ} : ENNReal.ofReal r ≠ ∞


@[simp]
theorem AntivaryOn.empty : AntivaryOn f g ∅

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


theorem Int.two_pow_sub_pow' {x y : ℤ} (n : ℕ) (hxy : 4 ∣ x - y) (hx : ¬2 ∣ x) :
    multiplicity 2 (x ^ n - y ^ n) = multiplicity 2 (x - y) + multiplicity (2 : ℤ) n

multiplicity 2 (x ^ n - y ^ n) = multiplicity 2 (x - y) + multiplicity 2 ↑n


theorem mem_closure_ne_iff_frequently_within {z : α} {s : Set α} :
    z ∈ closure (s \ {z}) ↔ ∃ᶠ x in 𝓝[≠] z, x ∈ s

{α : Type u_1}
[TopologicalSpace α]
{z : α}
{s : Set α}

z ∈ closure (s \ {z}) ↔ ∃ᶠ (x : α) in 𝓝[≠] z, x ∈ s


/-- The cosine of an angle in a right-angled triangle multiplied by the hypotenuse equals the
adjacent side. -/
theorem cos_angle_mul_dist_of_angle_eq_pi_div_two {p₁ p₂ p₃ : P} (h : ∠ p₁ p₂ p₃ = π / 2) :
    Real.cos (∠ p₂ p₃ p₁) * dist p₁ p₃ = dist p₃ p₂

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{p₁ p₂ p₃ : P}
(h : ∠ p₁ p₂ p₃ = π / 2)


@[simp]
theorem homIso_hom (h : IsLimit t) {W : C} (f : ULift.{u₁} (W ⟶ t.pt)) :
    (IsLimit.homIso h W).hom f = (t.extend f.down).π

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{F : J ⥤ C}
{t : CategoryTheory.Limits.Cone F}
(h : CategoryTheory.Limits.IsLimit t)
{W : C}
(f : ULift.{u₁, v₃} (W ⟶ t.pt))

(h.homIso W).hom f = (t.extend f.down).π


lemma pow_le_pow_iff_right (h : 1 < a) : a ^ n ≤ a ^ m ↔ n ≤ m

{R : Type u_3}
[StrictOrderedSemiring R]
{a : R}
{n m : ℕ}
(h : 1 < a)


theorem cpow_eq_nhds' {p : ℂ × ℂ} (hp_fst : p.fst ≠ 0) :
    (fun x => x.1 ^ x.2) =ᶠ[𝓝 p] fun x => exp (log x.1 * x.2)

(fun x => x.1 ^ x.2) =ᶠ[𝓝 p] fun x => Complex.exp (Complex.log x.1 * x.2)


theorem quotientEquivQuotientMinpolyMap_symm_apply_mk (pb : PowerBasis R S) (I : Ideal R)
    (g : R[X]) :
    (pb.quotientEquivQuotientMinpolyMap I).symm (Ideal.Quotient.mk (Ideal.span
      ({(minpoly R pb.gen).map (Ideal.Quotient.mk I)} : Set (Polynomial (R ⧸ I))))
        (g.map (Ideal.Quotient.mk I))) = Ideal.Quotient.mk (I.map (algebraMap R S))
          (aeval pb.gen g)

{R : Type u}
{S : Type v}
[CommRing R]
[CommRing S]
[Algebra R S]
(pb : PowerBasis R S)
(I : Ideal R)
(g : R[X])

(pb.quotientEquivQuotientMinpolyMap I).symm
    ((Ideal.Quotient.mk (Ideal.span {Polynomial.map (Ideal.Quotient.mk I) (minpoly R pb.gen)}))
      (Polynomial.map (Ideal.Quotient.mk I) g)) =
  (Ideal.Quotient.mk (Ideal.map (algebraMap R S) I)) ((Polynomial.aeval pb.gen) g)


/-- **First moment method**. A measurable function is greater than its mean on a set of positive
measure. -/
theorem measure_laverage_le_pos (hμ : μ ≠ 0) (hint : ∫⁻ a, f a ∂μ ≠ ∞) :
    0 < μ {x | ⨍⁻ a, f a ∂μ ≤ f x}

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


theorem comm {H K : Subgroup G} : Commensurable H K ↔ Commensurable K H

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


@[to_additive (attr := measurability)]
theorem AEMeasurable.div_const [MeasurableDiv G] (hf : AEMeasurable f μ) (c : G) :
    AEMeasurable (fun x => f x / c) μ

{G : Type u_2}
{α : Type u_3}
[MeasurableSpace G]
[Sub G]
{m : MeasurableSpace α}
{f : α → G}
{μ : MeasureTheory.Measure α}
[MeasurableSub G]
(hf : AEMeasurable f μ)
(c : G)


theorem Integrable.swap [SFinite μ] ⦃f : α × β → E⦄ (hf : Integrable f (μ.prod ν)) :
    Integrable (f ∘ Prod.swap) (ν.prod μ)

⦃f : α × β → E⦄

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

MeasureTheory.Integrable (f ∘ Prod.swap) (ν.prod μ)


/-- The `v`-adic valuation of `r ∈ R` is less than 1 if and only if `v` divides the ideal `(r)`. -/
theorem valuation_lt_one_iff_dvd (r : R) :
    v.valuation (algebraMap R K r) < 1 ↔ v.asIdeal ∣ Ideal.span {r}

(v : IsDedekindDomain.HeightOneSpectrum R)

v.valuation ((algebraMap R K) r) < 1 ↔ v.asIdeal ∣ Ideal.span {r}


@[to_additive]
theorem comap_mono {f : G →* N} {K K' : Subgroup N} : K ≤ K' → comap f K ≤ comap f K'

{G : Type u_1}
[Group G]
{N : Type u_5}
[Group N]
{f : G →* N}
{K K' : Subgroup N}

K ≤ K' → Subgroup.comap f K ≤ Subgroup.comap f K'


theorem Nontrivial.infsep_eq_iInf (hs : s.Nontrivial) :
    s.infsep = ⨅ d : s.offDiag, (uncurry dist) (d : α × α)

{α : Type u_1}
[PseudoMetricSpace α]
{s : Set α}
(hs : s.Nontrivial)

s.infsep = ⨅ d, Function.uncurry dist ↑d


@[simp]
theorem mem_mk (s : Subsemiring L) (hK : ∀ x, algebraMap K L x ∈ s) (hi) (x : L) :
    x ∈ IntermediateField.mk (Subalgebra.mk s hK) hi ↔ x ∈ s

(hK : ∀ (x : K), (algebraMap K L) x ∈ s)

(hi :
  ∀ x ∈ { toSubsemiring := s, algebraMap_mem' := hK }.carrier,
    x⁻¹ ∈ { toSubsemiring := s, algebraMap_mem' := hK }.carrier)

x ∈ { toSubsemiring := s, algebraMap_mem' := hK, inv_mem' := hi } ↔ x ∈ s


/-- The subgroup generated by an element of a group equals the set of integer number powers of
    the element. -/
@[to_additive
      "The `AddSubgroup` generated by an element of an `AddGroup` equals the set of
      natural number multiples of the element."]
theorem mem_closure_singleton {x y : G} : y ∈ closure ({x} : Set G) ↔ ∃ n : ℤ, x ^ n = y

y ∈ Subgroup.closure {x} ↔ ∃ n, x ^ n = y


@[simp] lemma sdiff_singleton_wcovBy (s : Set α) (a : α) : s \ {a} ⩿ s


@[to_additive]
theorem prod_divisorsAntidiagonal {M : Type*} [CommMonoid M] (f : ℕ → ℕ → M) {n : ℕ} :
    ∏ i ∈ n.divisorsAntidiagonal, f i.1 i.2 = ∏ i ∈ n.divisors, f i (n / i)

{M : Type u_1}
[CommMonoid M]
(f : ℕ → ℕ → M)
{n : ℕ}


/-- Every chain map is homotopic to itself. -/
@[simps!, refl]
def refl (f : C ⟶ D) : Homotopy f f

{ι : Type u_1}
{V : Type u}
[CategoryTheory.Category.{v, u} V]
[CategoryTheory.Preadditive V]
{c : ComplexShape ι}
{C D : HomologicalComplex V c}
(f : C ⟶ D)
(i j : ι)


@[simp]
theorem segment_eq_Icc (h : x ≤ y) : [x -[𝕜] y] = Icc x y

{𝕜 : Type u_1}
[LinearOrderedField 𝕜]
{x y : 𝕜}
(h : x ≤ y)


@[simp]
theorem DiagramOfCones.mkOfHasLimits_conePoints :
    (DiagramOfCones.mkOfHasLimits F).conePoints = F ⋙ lim

(CategoryTheory.Limits.DiagramOfCones.mkOfHasLimits F).conePoints = F ⋙ CategoryTheory.Limits.lim


theorem mem_of_mem_equivPair_tail {i j : ι} {w : Word M} (m : M i) :
    (⟨i, m⟩ ∈ (equivPair j w).tail.toList) → ⟨i, m⟩ ∈ w.toList

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

⟨i, m⟩ ∈ ((Monoid.CoprodI.Word.equivPair j) w).tail.toList → ⟨i, m⟩ ∈ w.toList


/-- Construct an adjunction between functors `F` and `G` given a unit and counit for the adjunction
satisfying the triangle identities. -/

@[simps!]
def mkOfUnitCounit (adj : CoreUnitCounit F G) : F ⊣ G

(adj : CategoryTheory.Adjunction.CoreUnitCounit F G)

((CategoryTheory.Adjunction.mkOfUnitCounit adj).homEquiv X Y) f =
  CategoryTheory.CategoryStruct.comp (adj.unit.app X) (G.map f)


@[simp]
theorem coe_one : ((1 : r ≃r r) : α → α) = id