/-- The (normalized) Moore complex of a simplicial object `X` in an abelian category `C`.

The `n`-th object is intersection of
the kernels of `X.δ i : X.obj n ⟶ X.obj (n-1)`, for `i = 1, ..., n`.

The differentials are induced from `X.δ 0`,
which maps each of these intersections of kernels to the next.
-/
@[simps]
def normalizedMooreComplex : SimplicialObject C ⥤ ChainComplex C ℕ

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

(AlgebraicTopology.normalizedMooreComplex C).obj X = AlgebraicTopology.NormalizedMooreComplex.obj X


/-- Consider a series of functions `∑' n, f n x`. If the series converges at a
point, and all functions in the series are differentiable with a summable bound on the derivatives,
then the series converges everywhere. -/
theorem summable_of_summable_hasDerivAt (hu : Summable u)
    (hg : ∀ n y, HasDerivAt (g n) (g' n y) y) (hg' : ∀ n y, ‖g' n y‖ ≤ u n)
    (hg0 : Summable fun n => g n y₀) (y : 𝕜) : Summable fun n => g n y

(hg : ∀ (n : α) (y : 𝕜), HasDerivAt (g n) (g' n y) y)

(hg' : ∀ (n : α) (y : 𝕜), ‖g' n y‖ ≤ u n)


theorem commute_pow_left_of_commute
    [Semiring R₂] [AddCommMonoid M₂] [Module R₂ M₂] {σ₁₂ : R →+* R₂}
    {f : M →ₛₗ[σ₁₂] M₂} {g : Module.End R M} {g₂ : Module.End R₂ M₂}
    (h : g₂.comp f = f.comp g) (k : ℕ) : (g₂ ^ k).comp f = f.comp (g ^ k)

{R : Type u_1}
{R₂ : Type u_3}
{M : Type u_5}
{M₂ : Type u_7}
[Semiring R]
[AddCommMonoid M]
[Module R M]
[Semiring R₂]
[AddCommMonoid M₂]
[Module R₂ M₂]
{σ₁₂ : R →+* R₂}
{f : M →ₛₗ[σ₁₂] M₂}
{g : Module.End R M}
{g₂ : Module.End R₂ M₂}
(h : LinearMap.comp g₂ f = f.comp g)
(k : ℕ)

LinearMap.comp (g₂ ^ k) f = f.comp (g ^ k)


theorem lowerSemicontinuous_iff_isClosed_epigraph {f : α → γ} :
    LowerSemicontinuous f ↔ IsClosed {p : α × γ | f p.1 ≤ p.2}

{α : Type u_1}
[TopologicalSpace α]
{γ : Type u_3}
[CompleteLinearOrder γ]
[DenselyOrdered γ]
[TopologicalSpace γ]
[OrderTopology γ]
{f : α → γ}

LowerSemicontinuous f ↔ IsClosed {p | f p.1 ≤ p.2}


theorem one_kronecker [MulZeroOneClass α] [DecidableEq l] (B : Matrix m n α) :
    (1 : Matrix l l α) ⊗ₖ B =
      Matrix.reindex (Equiv.prodComm _ _) (Equiv.prodComm _ _) (blockDiagonal fun _ => B)

{α : Type u_2}
{l : Type u_8}
{m : Type u_9}
{n : Type u_10}
[MulZeroOneClass α]
[DecidableEq l]
(B : Matrix m n α)

Matrix.kroneckerMap (fun x x_1 => x * x_1) 1 B =
  (Matrix.reindex (Equiv.prodComm m l) (Equiv.prodComm n l)) (Matrix.blockDiagonal fun x => B)


@[simp]
theorem prod'_toLaxMonoidalFunctor :
    (F.prod' G).toLaxMonoidalFunctor = F.toLaxMonoidalFunctor.prod' G.toLaxMonoidalFunctor

(F : CategoryTheory.MonoidalFunctor C D)

(G : CategoryTheory.MonoidalFunctor C E)

(F.prod' G).toLaxMonoidalFunctor = F.prod' G.toLaxMonoidalFunctor


@[simp]
theorem isGLB_image {s : Set α} {x : β} : IsGLB (f '' s) x ↔ IsGLB s (f.symm x)

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
(f : α ≃o β)
{s : Set α}
{x : β}


@[simp]
theorem coe_inclusion_apply (h : S₁ ≤ S₂) (x : S₁) : (inclusion h x : P₁) = x

{k : Type u_1}
{V₁ : Type u_2}
{P₁ : Type u_3}
[Ring k]
[AddCommGroup V₁]
[Module k V₁]
[AffineSpace V₁ P₁]
{S₁ S₂ : AffineSubspace k P₁}
[Nonempty ↥S₁]
[Nonempty ↥S₂]
(h : S₁ ≤ S₂)
(x : ↥S₁)


/-- Variant of `EqOn.image_eq`, for one function being the identity. -/
theorem EqOn.image_eq_self {f : α → α} (h : Set.EqOn f id s) : f '' s = s

{α : Type u_1}
{s : Set α}
{f : α → α}
(h : Set.EqOn f id s)


theorem cast_toNat_of_lt_aleph0 {c : Cardinal} (h : c < ℵ₀) : ↑(toNat c) = c

{c : Cardinal.{u_1}}
(h : c < Cardinal.aleph0)


theorem _root_.MeasureTheory.Memℒp.inf {f g : α → E} (hf : Memℒp f p μ) (hg : Memℒp g p μ) :
    Memℒp (f ⊓ g) p μ

{α : Type u_1}
{E : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{p : ℝ≥0∞}
[NormedLatticeAddCommGroup E]
{f g : α → E}
(hf : MeasureTheory.Memℒp f p μ)
(hg : MeasureTheory.Memℒp g p μ)


@[reassoc (attr := simp)]
theorem pullbackIsoUnopPushout_inv_snd {X Y Z : C} (f : X ⟶ Z) (g : Y ⟶ Z) [HasPullback f g]
    [HasPushout f.op g.op] :
    (pullbackIsoUnopPushout f g).inv ≫ pullback.snd f g =
      (pushout.inr _ _ : _ ⟶ pushout f.op g.op).unop

(CategoryTheory.Limits.pullbackIsoUnopPushout f g).inv ≫ CategoryTheory.Limits.pullback.snd f g =
  (CategoryTheory.Limits.pushout.inr f.op g.op).unop


/-- Constructs an isomorphism of finite partial orders from an order isomorphism between them. -/
@[simps]
def Iso.mk {α β : FinPartOrd.{u}} (e : α ≃o β) : α ≅ β

{α β : FinPartOrd}
(e : ↑α.toPartOrd ≃o ↑β.toPartOrd)


/-- The `δ`-thickened indicator of a set `E` is the function that equals `1` on `E`
and `0` outside a `δ`-thickening of `E` and interpolates (continuously) between
these values using `infEdist _ E`.

`thickenedIndicator` is the (bundled) bounded continuous function with `ℝ≥0`-values.
See `thickenedIndicatorAux` for the unbundled `ℝ≥0∞`-valued function. -/
@[simps]
def thickenedIndicator {δ : ℝ} (δ_pos : 0 < δ) (E : Set α) : α →ᵇ ℝ≥0

{α : Type u_1}
[PseudoEMetricSpace α]
{δ : ℝ}
(δ_pos : 0 < δ)
(E : Set α)
(x : α)

(thickenedIndicator δ_pos E) x = (thickenedIndicatorAux δ E x).toNNReal


@[simp]
theorem nat_power_aleph0 {n : ℕ} (hn : 2 ≤ n) : (n ^ aleph0.{u} : Cardinal.{u}) = 𝔠

↑n ^ Cardinal.aleph0 = Cardinal.continuum


theorem FactorSet.sup_add_inf_eq_add [DecidableEq (Associates α)] :
    ∀ a b : FactorSet α, a ⊔ b + a ⊓ b = a + b

{α : Type u_1}
[CancelCommMonoidWithZero α]
[DecidableEq (Associates α)]
(a b : Associates.FactorSet α)


@[simp] lemma card_pos : 0 < s.card ↔ s.Nonempty


@[simp]
lemma graphOn_insert (f : α → β) (x : α) (s : Set α) :
    graphOn f (insert x s) = insert (x, f x) (graphOn f s)

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

Set.graphOn f (insert x s) = insert (x, f x) (Set.graphOn f s)


theorem Int.measurable_ceil [OpensMeasurableSpace R] : Measurable (Int.ceil : R → ℤ)

{R : Type u_2}
[LinearOrderedRing R]
[FloorRing R]
[TopologicalSpace R]
[OrderTopology R]
[MeasurableSpace R]
[OpensMeasurableSpace R]


@[simp]
theorem Tape.mk'_left_right₀ {Γ} [Inhabited Γ] (T : Tape Γ) : Tape.mk' T.left T.right₀ = T

{Γ : Type u_1}
[Inhabited Γ]
(T : Turing.Tape Γ)


theorem ucs_comap_incl (k : ℕ) :
    ((⊥ : LieSubmodule R L M).ucs k).comap N.incl = (⊥ : LieSubmodule R L N).ucs k

{R : Type u}
{L : Type v}
{M : Type w}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
(N : LieSubmodule R L M)
(k : ℕ)

LieSubmodule.comap N.incl (LieSubmodule.ucs k ⊥) = LieSubmodule.ucs k ⊥


@[simp]
theorem nonempty_Ioi [NoMaxOrder α] : (Ioi a).Nonempty

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


theorem ContDiffOn.clm_apply {f : E → F →L[𝕜] G} {g : E → F} {n : ℕ∞} (hf : ContDiffOn 𝕜 n f s)
    (hg : ContDiffOn 𝕜 n g s) : ContDiffOn 𝕜 n (fun x => (f x) (g x)) s

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


theorem succ_nadd : succ a ♯ b = succ (a ♯ b)


@[simp] theorem dvd_one {n : Nat} : n ∣ 1 ↔ n = 1


@[to_additive]
lemma preimage_mul (hm : Injective m) {s t : Set β} (hs : s ⊆ range m) (ht : t ⊆ range m) :
    m ⁻¹' (s * t) = m ⁻¹' s * m ⁻¹' t

{F : Type u_1}
{α : Type u_2}
{β : Type u_3}
[Add α]
[Add β]
[FunLike F α β]
[AddHomClass F α β]
(m : F)
(hm : Function.Injective ⇑m)
{s t : Set β}
(hs : s ⊆ Set.range ⇑m)
(ht : t ⊆ Set.range ⇑m)


nonrec theorem ContinuousWithinAt.sqrt (h : ContinuousWithinAt f s x) :
    ContinuousWithinAt (fun x => √(f x)) s x

{α : Type u_1}
[TopologicalSpace α]
{f : α → ℝ}
{s : Set α}
{x : α}
(h : ContinuousWithinAt f s x)


theorem exists_splitMany_inf_eq_filter_of_finite (s : Set (Prepartition I)) (hs : s.Finite) :
    ∃ t : Finset (ι × ℝ),
      ∀ π ∈ s, π ⊓ splitMany I t = (splitMany I t).filter fun J => ↑J ⊆ π.iUnion

{ι : Type u_1}
{I : BoxIntegral.Box ι}
[Finite ι]
(s : Set (BoxIntegral.Prepartition I))
(hs : s.Finite)

∃ t,
  ∀ π ∈ s,
    π ⊓ BoxIntegral.Prepartition.splitMany I t = (BoxIntegral.Prepartition.splitMany I t).filter fun J => ↑J ⊆ π.iUnion


@[ext]
theorem ext {f g : α →₀ M} (h : ∀ a, f a = g a) : f = g

{α : Type u_1}
{M : Type u_5}
[Zero M]
{f g : α →₀ M}
(h : ∀ (a : α), f a = g a)


theorem range_image_pred_top_sub (n : ℕ) :
    ((Finset.range n).image fun j => n - 1 - j) = Finset.range n

Finset.image (fun j => n - 1 - j) (Finset.range n) = Finset.range n


@[simp]
theorem hom_ext_iff {P Q : Karoubi C} {f g : P ⟶ Q} : f = g ↔ f.f = g.f

{P Q : CategoryTheory.Idempotents.Karoubi C}


@[to_additive (attr := simp)]
theorem image_inv : Inv.inv '' s = s⁻¹

{α : Type u_2}
[InvolutiveNeg α]
{s : Set α}


/-- The Law of Quadratic Reciprocity: if `p` and `q` are primes that are both congruent
to `3` mod `4`, then `(q / p) = -(p / q)`. -/
theorem quadratic_reciprocity_three_mod_four (hp : p % 4 = 3) (hq : q % 4 = 3) :
    legendreSym q p = -legendreSym p q

{p q : ℕ}
[Fact (Nat.Prime p)]
[Fact (Nat.Prime q)]
(hp : p % 4 = 3)
(hq : q % 4 = 3)


@[simp]
theorem lookup_to_alist {a} (s : List (Sigma β)) : lookup a s.toAList = s.dlookup a

{α : Type u}
{β : α → Type v}
[DecidableEq α]
{a : α}
(s : List (Sigma β))

AList.lookup a s.toAList = List.dlookup a s


@[simp]
theorem coeFn_ofSeqClosedGraph
    (hg : ∀ (u : ℕ → E) (x y), Tendsto u atTop (𝓝 x) → Tendsto (g ∘ u) atTop (𝓝 y) → y = g x) :
    ⇑(ContinuousLinearMap.ofSeqClosedGraph hg) = g

(hg :
  ∀ (u : ℕ → E) (x : E) (y : F),
    Filter.Tendsto u Filter.atTop (𝓝 x) → Filter.Tendsto (⇑g ∘ u) Filter.atTop (𝓝 y) → y = g x)

⇑(ContinuousLinearMap.ofSeqClosedGraph hg) = ⇑g


@[simp]
theorem fract_eq_self {a : α} : fract a = a ↔ 0 ≤ a ∧ a < 1

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


/-- Given right homology data `h₁` and `h₂` for two short complexes `S₁` and `S₂`,
a `RightHomologyMapData` for a morphism `φ : S₁ ⟶ S₂`
consists of a description of the induced morphisms on the `Q` (opcycles)
and `H` (right homology) fields of `h₁` and `h₂`. -/
structure RightHomologyMapData where
  /-- the induced map on opcycles -/
  φQ : h₁.Q ⟶ h₂.Q
  /-- the induced map on right homology -/
  φH : h₁.H ⟶ h₂.H
  /-- commutation with `p` -/
  commp : h₁.p ≫ φQ = φ.τ₂ ≫ h₂.p := by aesop_cat
  /-- commutation with `g'` -/
  commg' : φQ ≫ h₂.g' = h₁.g' ≫ φ.τ₃ := by aesop_cat
  /-- commutation with `ι` -/
  commι : φH ≫ h₂.ι = h₁.ι ≫ φQ := by aesop_cat

(self : CategoryTheory.ShortComplex.RightHomologyMapData φ h₁ h₂)

CategoryTheory.CategoryStruct.comp self.φQ h₂.g' = CategoryTheory.CategoryStruct.comp h₁.g' φ.τ₃


@[simp]
theorem MultilinearMap.curryRight_apply (f : MultilinearMap R M M₂)
    (m : ∀ i : Fin n, M (castSucc i)) (x : M (last n)) : f.curryRight m x = f (snoc m x)

[(i : Fin n.succ) → AddCommMonoid (M i)]


theorem LinearIndependent.group_smul {G : Type*} [hG : Group G] [DistribMulAction G R]
    [DistribMulAction G M] [IsScalarTower G R M] [SMulCommClass G R M] {v : ι → M}
    (hv : LinearIndependent R v) (w : ι → G) : LinearIndependent R (w • v)

{ι : Type u'}
{R : Type u_2}
{M : Type u_4}
[Ring R]
[AddCommGroup M]
[Module R M]
{G : Type u_8}
[hG : Group G]
[DistribMulAction G R]
[DistribMulAction G M]
[IsScalarTower G R M]
[SMulCommClass G R M]
{v : ι → M}
(hv : LinearIndependent R v)
(w : ι → G)


protected theorem antilipschitz : AntilipschitzWith 1 e

{R : Type u_1}
{R₂ : Type u_2}
{E : Type u_5}
{E₂ : Type u_6}
[Semiring R]
[Semiring R₂]
{σ₁₂ : R →+* R₂}
{σ₂₁ : R₂ →+* R}
[RingHomInvPair σ₁₂ σ₂₁]
[RingHomInvPair σ₂₁ σ₁₂]
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup E₂]
[Module R E]
[Module R₂ E₂]
(e : E ≃ₛₗᵢ[σ₁₂] E₂)


/-- Typeclass for normal field extension: `K` is a normal extension of `F` iff the minimal
polynomial of every element `x` in `K` splits in `K`, i.e. every conjugate of `x` is in `K`. -/
class Normal extends Algebra.IsAlgebraic F K : Prop where
  splits' (x : K) : Splits (algebraMap F K) (minpoly F x)

{F : Type u_1}
{K : Type u_2}
[Field F]
[Field K]
[Algebra F K]
[self : Normal F K]
(x : K)

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


@[simp]
theorem optionEquivSumPUnit_coe (a : α) : optionEquivSumPUnit α a = Sum.inl a

(Equiv.optionEquivSumPUnit α) (some a) = Sum.inl a


/-- Let `r > 1` and `1/r + 1/s = 1`. Suppose there is an integer `j` where `B_r` and `B'_s` both
jump over `j` (i.e. an anti-collision). Then this leads to a contradiction. -/
private theorem no_anticollision :
    ¬∃ j k m : ℤ, k < j / r ∧ (j + 1) / r ≤ k + 1 ∧ m ≤ j / s ∧ (j + 1) / s < m + 1

¬∃ j k m, ↑k < ↑j / r ∧ (↑j + 1) / r ≤ ↑k + 1 ∧ ↑m ≤ ↑j / s ∧ (↑j + 1) / s < ↑m + 1


theorem of_eventually_mem_of_forall_separating_preimage (p : Set β → Prop) {s : Set β}
    [HasCountableSeparatingOn β p s] (hf : ∀ᶠ x in l, f x ∈ s) (hg : ∀ᶠ x in l, g x ∈ s)
    (h : ∀ U : Set β, p U → f ⁻¹' U =ᶠ[l] g ⁻¹' U) : f =ᶠ[l] g

(h : ∀ (U : Set β), p U → f ⁻¹' U =ᶠ[l] g ⁻¹' U)


@[simp]
theorem Metric.emetric_ball_top (x : α) : EMetric.ball x ⊤ = univ

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


/-- `x⁻¹` is analytic away from zero -/
lemma analyticOn_inv : AnalyticOn 𝕜 (fun z ↦ z⁻¹) {z : 𝕝 | z ≠ 0}

{𝕜 : Type u_2}
[NontriviallyNormedField 𝕜]
{𝕝 : Type u_7}
[NontriviallyNormedField 𝕝]
[NormedAlgebra 𝕜 𝕝]


@[to_additive (attr := simp)]
theorem MonoidHom.map_zpowers (f : G →* N) (x : G) :
    (Subgroup.zpowers x).map f = Subgroup.zpowers (f x)

{G : Type u_1}
[Group G]
{N : Type u_3}
[Group N]
(f : G →* N)
(x : G)

Subgroup.map f (Subgroup.zpowers x) = Subgroup.zpowers (f x)


lemma closedEmbedding_toContinuousMap [T1Space R] :
    ClosedEmbedding ((↑) : C(X, R)₀ → C(X, R))

{X : Type u_1}
{R : Type u_3}
[Zero X]
[Zero R]
[TopologicalSpace X]
[TopologicalSpace R]
[T1Space R]


@[to_additive (attr := simp)]
lemma min'_one [LinearOrder α] : (1 : Finset α).min' one_nonempty = 1


/-- Interpret an `Equiv` as a `PartialEquiv` by restricting it to `s` in the domain
and to `t` in the codomain. -/
@[simps (config := .asFn)]
def _root_.Equiv.toPartialEquivOfImageEq (e : α ≃ β) (s : Set α) (t : Set β) (h : e '' s = t) :
    PartialEquiv α β

{α : Type u_1}
{β : Type u_2}
(e : α ≃ β)
(s : Set α)
(t : Set β)
(h : ⇑e '' s = t)


theorem spanSingleton_eq_spanSingleton [NoZeroSMulDivisors R P] {x y : P} :
    spanSingleton S x = spanSingleton S y ↔ ∃ z : Rˣ, z • x = y

{R : Type u_1}
[CommRing R]
{S : Submonoid R}
{P : Type u_2}
[CommRing P]
[Algebra R P]
[loc : IsLocalization S P]
[NoZeroSMulDivisors R P]
{x y : P}

FractionalIdeal.spanSingleton S x = FractionalIdeal.spanSingleton S y ↔ ∃ z, z • x = y


theorem tendsto_atTop_pure [PartialOrder α] [OrderTop α] (f : α → β) :
    Tendsto f atTop (pure <| f ⊤)

{α : Type u_3}
{β : Type u_4}
[PartialOrder α]
[OrderTop α]
(f : α → β)

Filter.Tendsto f Filter.atTop (pure (f ⊤))


/-- The cardinality of a nontrivial module over a ring is at least the cardinality of the ring if
there are no zero divisors (for instance if the ring is a field) -/
theorem mk_le_of_module (R : Type u) (E : Type v)
    [AddCommGroup E] [Ring R] [Module R E] [Nontrivial E] [NoZeroSMulDivisors R E] :
    Cardinal.lift.{v} (#R) ≤ Cardinal.lift.{u} (#E)

Cardinal.lift.{v, u} (Cardinal.mk R) ≤ Cardinal.lift.{u, v} (Cardinal.mk E)


@[to_additive (attr := simp, aesop safe apply (rule_sets := [finsetNonempty]))]
theorem div_nonempty : (s / t).Nonempty ↔ s.Nonempty ∧ t.Nonempty

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

(s - t).Nonempty ↔ s.Nonempty ∧ t.Nonempty


lemma smul_le_smul_iff_of_neg_left [PosSMulMono α β] [PosSMulReflectLE α β] (ha : a < 0) :
    a • b₁ ≤ a • b₂ ↔ b₂ ≤ b₁

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

a • b₁ ≤ a • b₂ ↔ b₂ ≤ b₁


theorem Equiv.Computable.trans {α β γ} [Primcodable α] [Primcodable β] [Primcodable γ] {e₁ : α ≃ β}
    {e₂ : β ≃ γ} : e₁.Computable → e₂.Computable → (e₁.trans e₂).Computable

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[Primcodable α]
[Primcodable β]
[Primcodable γ]
{e₁ : α ≃ β}
{e₂ : β ≃ γ}


@[to_additive Summable.of_add_one_of_neg_add_one]
lemma Multipliable.of_add_one_of_neg_add_one {f : ℤ → M}
    (hf₁ : Multipliable fun n : ℕ ↦ f (n + 1)) (hf₂ : Multipliable fun n : ℕ ↦ f (-(n + 1))) :
    Multipliable f

{M : Type u_1}
[AddCommMonoid M]
[TopologicalSpace M]
[ContinuousAdd M]
{f : ℤ → M}
(hf₁ : Summable fun n => f (↑n + 1))
(hf₂ : Summable fun n => f (-(↑n + 1)))


theorem div_rat (h : Irrational x) {q : ℚ} (hq : q ≠ 0) : Irrational (x / q)

{x : ℝ}
(h : Irrational x)
{q : ℚ}
(hq : q ≠ 0)


@[simp]
theorem nil_append {u v : V} (p : G.Walk u v) : nil.append p = p

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


@[measurability]
protected theorem ennnorm {β : Type*} [SeminormedAddCommGroup β] {f : α → β}
    (hf : AEStronglyMeasurable f μ) : AEMeasurable (fun a => (‖f a‖₊ : ℝ≥0∞)) μ

(hf : MeasureTheory.AEStronglyMeasurable f μ)


protected theorem isExtreme (hAB : IsExposed 𝕜 A B) : IsExtreme 𝕜 A B

{𝕜 : Type u_1}
{E : Type u_2}
[TopologicalSpace 𝕜]
[LinearOrderedRing 𝕜]
[AddCommMonoid E]
[TopologicalSpace E]
[Module 𝕜 E]
{A B : Set E}
(hAB : IsExposed 𝕜 A B)


@[simp]
theorem start_mem_support {u v : V} (p : G.Walk u v) : u ∈ p.support


theorem exists_succ_eq_of_ne_zero {x : Fin (n + 1)} (h : x ≠ 0) :
    ∃ y, Fin.succ y = x


@[to_additive (attr := simp)]
lemma op_eq_one_iff [One α] (a : α) : op a = 1 ↔ a = 1


@[to_additive (attr := simp)]
theorem singleton_mul_singleton (a b : α) : ({a} : Finset α) * {b} = {a * b}

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


theorem uIcc_injective_left (a : α) : Injective (uIcc a)

{α : Type u_2}
[DistribLattice α]
[LocallyFiniteOrder α]
(a : α)


@[simp]
theorem zpow_toGerm (f : α →ₘ[μ] γ) (n : ℤ) : (f ^ n).toGerm = f.toGerm ^ n

{α : Type u_1}
{γ : Type u_3}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
[TopologicalSpace γ]
[Group γ]
[TopologicalGroup γ]
(f : α →ₘ[μ] γ)
(n : ℤ)


@[symm]
theorem symm : SeparatedNhds s t → SeparatedNhds t s

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


theorem iSup_mul {ι : Sort*} {f : ι → ℝ≥0∞} {a : ℝ≥0∞} : iSup f * a = ⨆ i, f i * a

{ι : Sort u_4}
{f : ι → ℝ≥0∞}
{a : ℝ≥0∞}


theorem compl_sup_compl_le : aᶜ ⊔ bᶜ ≤ (a ⊓ b)ᶜ

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

aᶜ ⊔ bᶜ ≤ (a ⊓ b)ᶜ


theorem inf_map_atTop_neBot_iff [SemilatticeSup α] [Nonempty α] {F : Filter β} {u : α → β} :
    NeBot (F ⊓ map u atTop) ↔ ∀ U ∈ F, ∀ N, ∃ n ≥ N, u n ∈ U

{α : Type u_3}
{β : Type u_4}
[SemilatticeSup α]
[Nonempty α]
{F : Filter β}
{u : α → β}

(F ⊓ Filter.map u Filter.atTop).NeBot ↔ ∀ U ∈ F, ∀ (N : α), ∃ n ≥ N, u n ∈ U


theorem le_levenshtein_cons (xs : List α) (y ys) :
    ∃ xs', xs' <:+ xs ∧ levenshtein C xs' ys ≤ levenshtein C xs (y :: ys)


/-- The type of complete lattice homomorphisms from `α` to `β`. -/
structure CompleteLatticeHom (α β : Type*) [CompleteLattice α] [CompleteLattice β] extends
  sInfHom α β where
  /-- The proposition that complete lattice homomorphism commutes with arbitrary suprema/joins. -/
  map_sSup' (s : Set α) : toFun (sSup s) = sSup (toFun '' s)

{α : Type u_8}
{β : Type u_9}
[CompleteLattice α]
[CompleteLattice β]
(self : CompleteLatticeHom α β)
(s : Set α)

self.toFun (sSup s) = sSup (self.toFun '' s)


@[simp]
theorem toReal_inj {θ ψ : Angle} : θ.toReal = ψ.toReal ↔ θ = ψ


@[simp]
theorem reverse_injective : Injective (@reverse α)


@[simp]
theorem single_embedding {n : ℕ} (h : 0 < n) (i : Fin n) :
    ((single n h).embedding (0 : Fin 1)) i = i

((Composition.single n h).embedding 0) i = i


lemma mem_distTriang_iff (T : Triangle (DerivedCategory C)) :
    (T ∈ distTriang (DerivedCategory C)) ↔ ∃ (X Y : CochainComplex C ℤ) (f : X ⟶ Y),
      Nonempty (T ≅ Q.mapTriangle.obj (CochainComplex.mappingCone.triangle f))

(T : CategoryTheory.Pretriangulated.Triangle (DerivedCategory C))

T ∈ CategoryTheory.Pretriangulated.distinguishedTriangles ↔
  ∃ X Y f, Nonempty (T ≅ DerivedCategory.Q.mapTriangle.obj (CochainComplex.mappingCone.triangle f))


theorem IsLeast.csInf_mem (H : IsLeast s a) : sInf s ∈ s

{α : Type u_1}
[ConditionallyCompleteLattice α]
{s : Set α}
{a : α}
(H : IsLeast s a)


@[simp] theorem join_replicate_singleton : (replicate n [a]).join = replicate n a

∀ {α : Type u_1} {a : α}, (List.replicate n [a]).join = List.replicate n a


lemma continuousAt_jacobiTheta₂ (z : ℂ) {τ : ℂ} (hτ : 0 < im τ) :
    ContinuousAt (fun p : ℂ × ℂ ↦ jacobiTheta₂ p.1 p.2) (z, τ)

ContinuousAt (fun p => jacobiTheta₂ p.1 p.2) (z, τ)


protected theorem hasSum_linearIsometry (f : lp G 2) :
    HasSum (fun i => V i (f i)) (hV.linearIsometry f)

{ι : Type u_1}
{𝕜 : Type u_2}
[RCLike 𝕜]
{E : Type u_3}
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[cplt : CompleteSpace E]
{G : ι → Type u_4}
[(i : ι) → NormedAddCommGroup (G i)]
[(i : ι) → InnerProductSpace 𝕜 (G i)]
{V : (i : ι) → G i →ₗᵢ[𝕜] E}
(hV : OrthogonalFamily 𝕜 G V)
(f : ↥(lp G 2))

HasSum (fun i => (V i) (↑f i)) (hV.linearIsometry f)


/-- Given `S' : Solution'`, then there is `S₁ : Solution` such that
`S₁.multiplicity = S'.multiplicity`. -/
lemma exists_Solution_of_Solution' : ∃ (S₁ : Solution hζ), S₁.multiplicity = S'.multiplicity

(S' : FermatLastTheoremForThreeGen.Solution' hζ)


theorem map_some : f <$> some a = some (f a)

∀ {α α_1 : Type u_1} {f : α → α_1} {a : α}, f <$> some a = some (f a)


@[deprecated disintegrate (since := "2024-07-26")]
lemma compProd_fst_condKernelBorel (κ : Kernel α (γ × Ω)) [IsFiniteKernel κ] :
    fst κ ⊗ₖ condKernelBorel κ = κ

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


theorem hasColimit_mapGlueData_diagram : HasMulticoequalizer (D.mapGlueData F).diagram

[H : (i j k : D.J) → CategoryTheory.Limits.PreservesLimit (CategoryTheory.Limits.cospan (D.f i j) (D.f i k)) F]


@[simp] theorem decide_mem_cons [BEq α] [LawfulBEq α] {l : List α} :
    decide (y ∈ a :: l) = (y == a || decide (y ∈ l))

{α : Type u_1}
{y a : α}
[BEq α]
[LawfulBEq α]
{l : List α}


{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
(x : 𝕜)


/-- The closure of a set equals the intersection of its open thickenings of positive radii
accumulating at zero. -/
theorem closure_eq_iInter_thickening' (E : Set α) (s : Set ℝ) (hs₀ : s ⊆ Ioi 0)
    (hs : ∀ ε, 0 < ε → (s ∩ Ioc 0 ε).Nonempty) : closure E = ⋂ δ ∈ s, thickening δ E

(hs : ∀ (ε : ℝ), 0 < ε → (s ∩ Set.Ioc 0 ε).Nonempty)

closure E = ⋂ δ ∈ s, Metric.thickening δ E


@[simp]
theorem prod_eq_empty_iff : s ×ˢ t = ∅ ↔ s = ∅ ∨ t = ∅

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

s ×ˢ t = ∅ ↔ s = ∅ ∨ t = ∅


@[gcongr] protected theorem add_lt_add_right : a ≠ ∞ → b < c → b + a < c + a


theorem uniformContinuous_of_const [UniformSpace β] {c : α → β} (h : ∀ a b, c a = c b) :
    UniformContinuous c

{α : Type ua}
{β : Type ub}
[UniformSpace α]
[UniformSpace β]
{c : α → β}
(h : ∀ (a b : α), c a = c b)


theorem exists_list_of_mem_closure {s : Set R} {x : R} (h : x ∈ closure s) :
    ∃ L : List (List R), (∀ t ∈ L, ∀ y ∈ t, y ∈ s ∨ y = (-1 : R)) ∧ (L.map List.prod).sum = x

{R : Type u}
[Ring R]
{s : Set R}
{x : R}
(h : x ∈ Subring.closure s)

∃ L, (∀ t ∈ L, ∀ y ∈ t, y ∈ s ∨ y = -1) ∧ (List.map List.prod L).sum = x


@[reassoc (attr := simp)]
theorem image.compIso_hom_comp_image_ι [HasImage f] [IsIso g] :
    (image.compIso f g).hom ≫ image.ι (f ≫ g) = image.ι f ≫ g

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

(CategoryTheory.Limits.image.compIso f g).hom ≫ CategoryTheory.Limits.image.ι (f ≫ g) =
  CategoryTheory.Limits.image.ι f ≫ g


@[simp]
theorem empty_vecAlt0 (α) {h} : vecAlt0 h (![] : Fin 0 → α) = ![]


/-- A normed group is a group endowed with a norm for which `dist x y = ‖x / y‖` defines a metric
space structure. -/
@[to_additive]
class NormedCommGroup (E : Type*) extends Norm E, CommGroup E, MetricSpace E where
  dist := fun x y => ‖x / y‖
  /-- The distance function is induced by the norm. -/
  dist_eq : ∀ x y, dist x y = ‖x / y‖ := by aesop

{E : Type u_9}
[self : NormedCommGroup E]
(x y : E)


@[simp]
theorem lift_symm_apply (F : FreeLieAlgebra R X →ₗ⁅R⁆ L) : (lift R).symm F = F ∘ of R

(R : Type u)
{X : Type v}
[CommRing R]
{L : Type w}
[LieRing L]
[LieAlgebra R L]
(F : FreeLieAlgebra R X →ₗ⁅R⁆ L)

(FreeLieAlgebra.lift R).symm F = ⇑F ∘ FreeLieAlgebra.of R


/-- The `ℤ`-submodule spanned by a single element `a` is isomorphic to the quotient of `ℤ`
by the ideal generated by the order of `a`. -/
@[simps!] noncomputable def intSpanEquivQuotAddOrderOf (a : A) :
    (ℤ ∙ a) ≃ₗ[ℤ] ℤ ⧸ Ideal.span {(addOrderOf a : ℤ)}

∀ (a_1 : ↥(Submodule.span ℤ {a})),
  (CharacterModule.intSpanEquivQuotAddOrderOf a) a_1 =
    ((LinearMap.ker (LinearMap.toSpanSingleton ℤ A a)).quotEquivOfEq (Ideal.span {↑(addOrderOf a)}) ⋯)
      ((LinearMap.toSpanSingleton ℤ A a).quotKerEquivRange.symm
        ((LinearEquiv.ofEq (Submodule.span ℤ {a}) (LinearMap.range (LinearMap.toSpanSingleton ℤ A a)) ⋯) a_1))


@[norm_cast]
theorem diagonal_intCast' [Zero α] [IntCast α] (m : ℤ) : diagonal ((m : n → α)) = m

{n : Type u_3}
{α : Type v}
[DecidableEq n]
[Zero α]
[IntCast α]
(m : ℤ)


theorem erase_eq_eraseP [LawfulBEq α] (a : α) : ∀ l : List α,  l.erase a = l.eraseP (a == ·)

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

l.erase a = List.eraseP (fun x => a == x) l


theorem Monotone.directed_le [Preorder α] [IsDirected α (· ≤ ·)] [Preorder β] {f : α → β} :
    Monotone f → Directed (· ≤ ·) f

{α : Type u}
{β : Type v}
[Preorder α]
[IsDirected α fun x x_1 => x ≤ x_1]
[Preorder β]
{f : α → β}

Monotone f → Directed (fun x x_1 => x ≤ x_1) f


@[simp]
theorem toDual_apply_coe (a : α) : WithBot.toDual (a : WithBot α) = toDual a

WithBot.toDual ↑a = ↑(OrderDual.toDual a)


/-- The quadratic form on `Module.Dual R M × M` defined as `Q (f, x) = f x`. -/
@[simps]
def dualProd : QuadraticForm R (Module.Dual R M × M)

(R : Type u_1)
(M : Type u_2)
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
(p : Module.Dual R M × M)

(QuadraticForm.dualProd R M) p = p.1 p.2


@[simp]
theorem coe_icisSupHom : (icisSupHom : α → UpperSet α) = Ici


/-- Four-way commutativity of `prod`. The name matches `mul_mul_mul_comm`. -/
@[simps apply]
def prodProdProdComm (α β γ δ : Type*) : (α × β) × γ × δ ≃ (α × γ) × β × δ

(α : Type u_1)
(β : Type u_2)
(γ : Type u_3)
(δ : Type u_4)
(abcd : (α × β) × γ × δ)

(Equiv.prodProdProdComm α β γ δ) abcd = ((abcd.1.1, abcd.2.1), abcd.1.2, abcd.2.2)


theorem pointwise_smul_subset_iff {a : α} {S T : Submonoid M} : a • S ≤ T ↔ S ≤ a⁻¹ • T

{α : Type u_1}
{M : Type u_3}
[Monoid M]
[Group α]
[MulDistribMulAction α M]
{a : α}
{S T : Submonoid M}

a • S ≤ T ↔ S ≤ a⁻¹ • T


theorem succ_castPred_eq_castPred_succ {a : Fin (n + 1)} (ha : a ≠ last n)
    (ha' := a.succ_ne_last_iff.mpr ha) :
    (a.castPred ha).succ = (succ a).castPred ha'

{n : ℕ}
{a : Fin (n + 1)}
(ha : a ≠ Fin.last n)
(ha' : a.succ ≠ Fin.last (n + 1) := ⋯)

(a.castPred ha).succ = a.succ.castPred ha'


theorem interior_compact_eq_empty (hs : IsCompact s) : interior s = ∅


/-- The isomorphism between `P⁺ ⋙ F` and `(P ⋙ F)⁺`, functorially in `P`. -/
@[simps! hom_app inv_app]
def plusFunctorWhiskerRightIso :
    J.plusFunctor D ⋙ (whiskeringRight _ _ _).obj F ≅
      (whiskeringRight _ _ _).obj F ⋙ J.plusFunctor E

(J : CategoryTheory.GrothendieckTopology C)

[CategoryTheory.Category.{max v u, w₁} D]

[CategoryTheory.Category.{max v u, w₂} E]

[∀ (α β : Type (max v u)) (fst snd : β → α),
    CategoryTheory.Limits.HasLimitsOfShape (CategoryTheory.Limits.WalkingMulticospan fst snd) D]

[∀ (α β : Type (max v u)) (fst snd : β → α),
    CategoryTheory.Limits.HasLimitsOfShape (CategoryTheory.Limits.WalkingMulticospan fst snd) E]

[(X : C) →
    (W : J.Cover X) →
      (P : CategoryTheory.Functor Cᵒᵖ D) → CategoryTheory.Limits.PreservesLimit (W.index P).multicospan F]

[∀ (X : C), CategoryTheory.Limits.HasColimitsOfShape (J.Cover X)ᵒᵖ D]

[∀ (X : C), CategoryTheory.Limits.HasColimitsOfShape (J.Cover X)ᵒᵖ E]

[(X : C) → CategoryTheory.Limits.PreservesColimitsOfShape (J.Cover X)ᵒᵖ F]

(J.plusFunctorWhiskerRightIso F).inv.app X = (J.plusCompIso F X).inv


/-- Let `P` be a polynomial over `R`. If its constant term is a unit and its other coefficients are
nilpotent, then `P` is a unit.

See also `Polynomial.isUnit_iff_coeff_isUnit_isNilpotent`. -/
theorem isUnit_of_coeff_isUnit_isNilpotent (hunit : IsUnit (P.coeff 0))
    (hnil : ∀ i, i ≠ 0 → IsNilpotent (P.coeff i)) : IsUnit P

(hnil : ∀ (i : ℕ), i ≠ 0 → IsNilpotent (P.coeff i))


@[simp] lemma rootSystem_root_apply (α) : (rootSystem H).root α = α

{K : Type u_1}
{L : Type u_2}
[Field K]
[CharZero K]
[LieRing L]
[LieAlgebra K L]
[LieAlgebra.IsKilling K L]
[FiniteDimensional K L]
(H : LieSubalgebra K L)
[H.IsCartanSubalgebra]
[LieModule.IsTriangularizable K (↥H) L]
(α : { α // α.IsNonZero })

(LieAlgebra.IsKilling.rootSystem H).root α = LieModule.Weight.toLinear K (↥H) L ↑α


theorem coprime_multiset_prod_right_iff {k : ℕ} {m : Multiset ℕ} :
    Coprime k m.prod ↔ ∀ n ∈ m, Coprime k n


/-- A version of `antisymm'` with `r` explicit.

This lemma matches the lemmas from lean core in `Init.Algebra.Classes`, but is missing there.  -/
@[elab_without_expected_type]
theorem antisymm_of' (r : α → α → Prop) [IsAntisymm α r] {a b : α} : r a b → r b a → b = a

{α : Type u}
(r : α → α → Prop)
[IsAntisymm α r]
{a b : α}


@[simp]
lemma homOfDegreewiseSplit_f (n : ℤ) :
    (homOfDegreewiseSplit S σ).f n =
      (cocycleOfDegreewiseSplit S σ).1.v n (n + 1) rfl

(S : CategoryTheory.ShortComplex (CochainComplex C ℤ))

(σ : (n : ℤ) → (S.map (HomologicalComplex.eval C (ComplexShape.up ℤ) n)).Splitting)

(CochainComplex.homOfDegreewiseSplit S σ).f n = (↑(CochainComplex.cocycleOfDegreewiseSplit S σ)).v n (n + 1) ⋯


@[to_additive Ico_add_Icc_subset]
theorem Ico_mul_Icc_subset' [LocallyFiniteOrder α] (a b c d : α) :
    Ico a b * Icc c d ⊆ Ico (a * c) (b * d)

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

[CovariantClass α α (Function.swap HMul.hMul) LT.lt]

Finset.Ico a b * Finset.Icc c d ⊆ Finset.Ico (a * c) (b * d)


theorem nhds_toDual (x : X) : 𝓝 (toDual x) = map toDual (𝓝 x)

{X : Type u}
[TopologicalSpace X]
(x : X)

𝓝 (OrderDual.toDual x) = Filter.map (⇑OrderDual.toDual) (𝓝 x)


@[simp] lemma closure_union_closure_left_eq (M : Matroid α) (X Y : Set α) :
    M.closure (M.closure X ∪ Y) = M.closure (X ∪ Y)

{α : Type u_2}
(M : Matroid α)
(X Y : Set α)


@[to_additive]
theorem finprod_mem_inter_mulSupport (f : α → M) (s : Set α) :
    ∏ᶠ i ∈ s ∩ mulSupport f, f i = ∏ᶠ i ∈ s, f i

{α : Type u_1}
{M : Type u_5}
[CommMonoid M]
(f : α → M)
(s : Set α)

∏ᶠ (i : α) (_ : i ∈ s ∩ Function.mulSupport f), f i = ∏ᶠ (i : α) (_ : i ∈ s), f i


/-- Technical lemma to rewrite suitably the preimage of an intersection under an extended chart, to
bring it into a convenient form to apply derivative lemmas. -/
theorem extChartAt_preimage_inter_eq (x : M) :
    (extChartAt I x).symm ⁻¹' (s ∩ t) ∩ range I =
      (extChartAt I x).symm ⁻¹' s ∩ range I ∩ (extChartAt I x).symm ⁻¹' t

{𝕜 : Type u_1}
{E : Type u_2}
{M : Type u_3}
{H : Type u_4}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[TopologicalSpace H]
[TopologicalSpace M]
(I : ModelWithCorners 𝕜 E H)
{s t : Set M}
[ChartedSpace H M]
(x : M)

↑(extChartAt I x).symm ⁻¹' (s ∩ t) ∩ Set.range ↑I =
  ↑(extChartAt I x).symm ⁻¹' s ∩ Set.range ↑I ∩ ↑(extChartAt I x).symm ⁻¹' t


@[simp]
theorem Iio_union_Ici : Iio a ∪ Ici a = univ


theorem Cofix.abs_repr {α} (x : Cofix F α) : Quot.mk _ (Cofix.repr x) = x

{n : ℕ}
{F : TypeVec.{u} (n + 1) → Type u}
[q : MvQPF F]
{α : TypeVec.{u} n}
(x : MvQPF.Cofix F α)


theorem Set.Countable.isLindelof (hs : s.Countable) : IsLindelof s

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


@[simp]
theorem lowerCentralSeries_one : lowerCentralSeries G 1 = commutator G


@[simp]
theorem pullback_top {f : Y ⟶ X} : (⊤ : Sieve X).pullback f = ⊤

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{X Y : C}
{f : Y ⟶ X}


@[simp]
theorem coe_of (M : Type w) [L.Structure M] [M ⊨ T] [Nonempty M] : (of T M : Type w) = M

{L : FirstOrder.Language}
(T : L.Theory)
(M : Type w)
[L.Structure M]
[M ⊨ T]
[Nonempty M]

↑(FirstOrder.Language.Theory.ModelType.of T M) = M


theorem isPrime_ideal_prod_top {I : Ideal R} [h : I.IsPrime] : (prod I (⊤ : Ideal S)).IsPrime

{R : Type u}
{S : Type v}
[Semiring R]
[Semiring S]
{I : Ideal R}
[h : I.IsPrime]


/-- If the `d` from `Ideal.exists_mul_add_mem_pow_succ` is unique, up to `P`,
then so are the `c`s, up to `P ^ (i + 1)`.
Inspired by [Neukirch], proposition 6.1 -/
theorem Ideal.mul_add_mem_pow_succ_inj (P : Ideal S) {i : ℕ} (a d d' e e' : S) (a_mem : a ∈ P ^ i)
    (e_mem : e ∈ P ^ (i + 1)) (e'_mem : e' ∈ P ^ (i + 1)) (h : d - d' ∈ P) :
    a * d + e - (a * d' + e') ∈ P ^ (i + 1)

{S : Type u_1}
[CommRing S]
(P : Ideal S)
{i : ℕ}
(a d d' e e' : S)
(a_mem : a ∈ P ^ i)
(e_mem : e ∈ P ^ (i + 1))
(e'_mem : e' ∈ P ^ (i + 1))
(h : d - d' ∈ P)


lemma isIso_of_yoneda_map_bijective {X Y : C} (f : X ⟶ Y)
    (hf : ∀ (T : C), Function.Bijective (fun (x : T ⟶ X) => x ≫ f)) :
    IsIso f

(hf : ∀ (T : C), Function.Bijective fun x => CategoryTheory.CategoryStruct.comp x f)


@[to_additive (attr := simp)]
theorem op_comp_unop : (op : α → αᵐᵒᵖ) ∘ unop = id


@[to_additive]
lemma leOnePart_eq_inv_inf_one (a : α) : a⁻ᵐ = (a ⊓ 1)⁻¹

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

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


theorem extChartAt_image_nhd_mem_nhds_of_boundaryless [I.Boundaryless]
    {x : M} (hx : s ∈ 𝓝 x) : extChartAt I x '' s ∈ 𝓝 (extChartAt I x x)

{𝕜 : Type u_1}
{E : Type u_2}
{M : Type u_3}
{H : Type u_4}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[TopologicalSpace H]
[TopologicalSpace M]
(I : ModelWithCorners 𝕜 E H)
{s : Set M}
[ChartedSpace H M]
[I.Boundaryless]
{x : M}
(hx : s ∈ 𝓝 x)

↑(extChartAt I x) '' s ∈ 𝓝 (↑(extChartAt I x) x)


theorem Algebra.norm_complex_eq : Algebra.norm ℝ = normSq.toMonoidHom


lemma PosSMulReflectLE.toPosSMulStrictMono [PosSMulReflectLE α β] : PosSMulStrictMono α β

{α : Type u_1}
{β : Type u_2}
[SMul α β]
[Preorder α]
[LinearOrder β]
[Zero α]
[PosSMulReflectLE α β]


@[grind_norm] theorem eq_true_eq (p : Prop) : (p = True) = p


protected lemma injective (b : FreeGroupBasis ι G) : Injective b

{ι : Type u_1}
{G : Type u_3}
[Group G]
(b : FreeGroupBasis ι G)


theorem nonarchimedean (q r : ℤ_[p]) : ‖q + r‖ ≤ max ‖q‖ ‖r‖

{p : ℕ}
[Fact (Nat.Prime p)]
(q r : ℤ_[p])


theorem iSup_iInf_eq [CompletelyDistribLattice α] {f : ∀ a, κ a → α} :
    (⨆ a, ⨅ b, f a b) = ⨅ g : ∀ a, κ a, ⨆ a, f a (g a)

{α : Type u}
{ι : Sort w}
{κ : ι → Sort w'}
[CompletelyDistribLattice α]
{f : (a : ι) → κ a → α}


theorem aleph0_le_cardinal_mk_of_charZero (R A : Type*) [CommRing R] [IsDomain R] [Ring A]
    [Algebra R A] [CharZero A] : ℵ₀ ≤ #{ x : A // IsAlgebraic R x }

(R : Type u_1)
(A : Type u_2)
[CommRing R]
[IsDomain R]
[Ring A]
[Algebra R A]
[CharZero A]


theorem lie_of_same [DecidableEq ι] {i : ι} (x y : L i) :
    ⁅of L i x, of L i y⁆ = of L i ⁅x, y⁆

{ι : Type v}
(L : ι → Type w)
[(i : ι) → LieRing (L i)]
[DecidableEq ι]
{i : ι}
(x y : L i)

⁅(DirectSum.of L i) x, (DirectSum.of L i) y⁆ = (DirectSum.of L i) ⁅x, y⁆


@[to_additive (attr := simp)]
theorem div_nonempty : (s / t).Nonempty ↔ s.Nonempty ∧ t.Nonempty

(s - t).Nonempty ↔ s.Nonempty ∧ t.Nonempty


theorem succ_dvd_or_succ_dvd_of_succ_sum_dvd_mul {p : ℕ} (p_prime : Nat.Prime p) {m n : ℤ}
    {k l : ℕ} (hpm : ↑(p ^ k) ∣ m) (hpn : ↑(p ^ l) ∣ n) (hpmn : ↑(p ^ (k + l + 1)) ∣ m * n) :
    ↑(p ^ (k + 1)) ∣ m ∨ ↑(p ^ (l + 1)) ∣ n


/-- If `F` creates colimits of shape `J`, and `D` has colimits of shape `J`, then
`C` has colimits of shape `J`.
-/
theorem hasColimitsOfShape_of_hasColimitsOfShape_createsColimitsOfShape (F : C ⥤ D)
    [HasColimitsOfShape J D] [CreatesColimitsOfShape J F] : HasColimitsOfShape J C


theorem map_eq_neg_one_iff {x : R} : f x = -1 ↔ x = -1

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


@[simp, norm_cast]
theorem coe_ofCard [Finite G] {p : ℕ} [Fact p.Prime] (H : Subgroup G)
    (card_eq : Nat.card H = p ^ (Nat.card G).factorization p) : ↑(ofCard H card_eq) = H

(card_eq : Nat.card ↥H = p ^ (Nat.card G).factorization p)


/-- If we multiply a positive solution with the inverse of a fundamental solution,
the `x`-coordinate stays positive. -/
theorem mul_inv_x_pos {a₁ : Solution₁ d} (h : IsFundamental a₁) {a : Solution₁ d} (hax : 1 < a.x)
    (hay : 0 < a.y) : 0 < (a * a₁⁻¹).x

{d : ℤ}
{a₁ : Pell.Solution₁ d}
(h : Pell.IsFundamental a₁)
{a : Pell.Solution₁ d}
(hax : 1 < a.x)
(hay : 0 < a.y)


@[simp]
theorem differentiableAt_log_iff : DifferentiableAt ℝ log x ↔ x ≠ 0


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

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


/-- In a complete normed ring, an element `y` of distance less than `‖x⁻¹‖⁻¹` from `x` is a unit.
Here we construct its `Units` structure. -/
@[simps! val]
def ofNearby (x : Rˣ) (y : R) (h : ‖y - x‖ < ‖(↑x⁻¹ : R)‖⁻¹) : Rˣ

{R : Type u_1}
[NormedRing R]
[CompleteSpace R]
(x : Rˣ)
(y : R)
(h : ‖y - ↑x‖ < ‖↑x⁻¹‖⁻¹)


/-- `padicValNat p 1` is `0` for any `p`. -/
@[simp]
protected theorem one : padicValNat p 1 = 0


@[simp]
theorem nnnorm_div (a b : α) : ‖a / b‖₊ = ‖a‖₊ / ‖b‖₊

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

‖a / b‖₊ = ‖a‖₊ / ‖b‖₊


theorem pred_update (P : ∀ ⦃a⦄, β a → Prop) (f : ∀ a, β a) (a' : α) (v : β a') (a : α) :
    P (update f a' v a) ↔ a = a' ∧ P v ∨ a ≠ a' ∧ P (f a)

{α : Sort u}
{β : α → Sort v}
[DecidableEq α]
(P : ⦃a : α⦄ → β a → Prop)
(f : (a : α) → β a)
(a' : α)
(v : β a')
(a : α)

P (Function.update f a' v a) ↔ a = a' ∧ P v ∨ a ≠ a' ∧ P (f a)


theorem map_injective_of_isIntegral [IsIntegral X] {U V : X.Opens} (i : U ⟶ V)
    [H : Nonempty U] : Function.Injective (X.presheaf.map i.op)

(X : AlgebraicGeometry.Scheme)
[AlgebraicGeometry.IsIntegral X]
{U V : X.Opens}
(i : U ⟶ V)
[H : Nonempty ↑↑(↑U).toPresheafedSpace]


@[simp]
theorem cos_neg : cos (-x) = cos x


/-- `IsNormalAddSubgroup (s : Set A)` expresses the fact that `s` is a normal additive subgroup
of the additive group `A`. Important: the preferred way to say this in Lean is via bundled
subgroups `S : AddSubgroup A` and `hs : S.normal`, and not via this structure. -/
structure IsNormalAddSubgroup [AddGroup A] (s : Set A) extends IsAddSubgroup s : Prop where
  /-- The proposition that `s` is closed under (additive) conjugation. -/
  normal : ∀ n ∈ s, ∀ g : A, g + n + -g ∈ s

{A : Type u_3}
[AddGroup A]
{s : Set A}
(self : IsNormalAddSubgroup s)
(n : A)


theorem RingHom.IsIntegralElem.of_mul_unit (x y : S) (r : R) (hr : f r * y = 1)
    (hx : f.IsIntegralElem (x * y)) : f.IsIntegralElem x

{R : Type u_1}
{S : Type u_4}
[CommRing R]
[CommRing S]
(f : R →+* S)
(x y : S)
(r : R)
(hr : f r * y = 1)
(hx : f.IsIntegralElem (x * y))


/-- The 2-isomorphism `normalizeIso p f` is natural in `f`. -/
theorem normalize_naturality {a b c : B} (p : Path a b) {f g : Hom b c} (η : f ⟶ g) :
    (preinclusion B).map ⟨p⟩ ◁ η ≫ (normalizeIso p g).hom =
      (normalizeIso p f).hom ≫
        (preinclusion B).map₂ (eqToHom (Discrete.ext _ _ (normalizeAux_congr p η)))

{f g : CategoryTheory.FreeBicategory.Hom b c}

CategoryTheory.CategoryStruct.comp
    (CategoryTheory.Bicategory.whiskerLeft ((CategoryTheory.FreeBicategory.preinclusion B).map { as := p }) η)
    (CategoryTheory.FreeBicategory.normalizeIso p g).hom =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.FreeBicategory.normalizeIso p f).hom
    ((CategoryTheory.FreeBicategory.preinclusion B).map₂ (CategoryTheory.eqToHom ⋯))


theorem map_bind (x : m α) {g : α → m β} {f : β → γ} :
    f <$> (x >>= g) = x >>= fun a => f <$> g a

{α β γ : Type u}
{m : Type u → Type v}
[Monad m]
[LawfulMonad m]
(x : m α)
{g : α → m β}
{f : β → γ}

f <$> (x >>= g) = do
  let a ← x
  f <$> g a


/-- The $L^1$ norm is less than the $L^\infty$ norm scaled by the cardinality. -/
@[to_additive Pi.sum_nnnorm_apply_le_nnnorm "The $L^1$ norm is less than the $L^\\infty$ norm
scaled by the cardinality."]
lemma Pi.sum_nnnorm_apply_le_nnnorm' : ∑ i, ‖f i‖₊ ≤ Fintype.card ι • ‖f‖₊

{ι : Type u_1}
{π : ι → Type u_4}
[Fintype ι]
[(i : ι) → SeminormedGroup (π i)]
(f : (i : ι) → π i)


/-- The iUnion of connected sets indexed by a type with an archimedean successor (like `ℕ` or `ℤ`)
  such that any two neighboring sets meet is connected. -/
theorem IsConnected.iUnion_of_chain [Nonempty β] {s : β → Set α} (H : ∀ n, IsConnected (s n))
    (K : ∀ n, (s n ∩ s (succ n)).Nonempty) : IsConnected (⋃ n, s n)

(K : ∀ (n : β), (s n ∩ s (Order.succ n)).Nonempty)


theorem bounded_gt_Ioc [Preorder α] (a b : α) : Bounded (· > ·) (Ioc a b)

Set.Bounded (fun x x_1 => x > x_1) (Set.Ioc a b)


@[aesop safe apply]
lemma min_bi_le {b : α → ℝ} (i : α) : b (min_bi b) ≤ b i

{α : Type u_1}
[Finite α]
[Nonempty α]
{b : α → ℝ}
(i : α)


@[to_additive (attr := simp)]
lemma val_mem_ofUnits_iff_mem (H : Subgroup Gˣ) (x : Gˣ) : (x : G) ∈ H.ofUnits ↔ x ∈ H

{G : Type u_2}
[Group G]
(H : Subgroup Gˣ)
(x : Gˣ)


@[to_additive]
protected theorem all [CommMagma S] (a b : S) : Commute a b

{S : Type u_3}
[AddCommMagma S]
(a b : S)


@[to_additive]
theorem mul_mem_cancel_left (h : a ∈ s) : a * b ∈ s ↔ b ∈ s

{G : Type u_1}
{a b : G}
[Group G]
{s : Set G}
(hs : IsSubgroup s)
(h : a ∈ s)


theorem ncard_le_one_iff_subset_singleton [Nonempty α]
    (hs : s.Finite := by toFinite_tac) :
    s.ncard ≤ 1 ↔ ∃ x : α, s ⊆ {x}

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


theorem Indep.basis_setOf_insert_basis (hI : M.Indep I) :
    M.Basis I {x | M.Basis I (insert x I)}

{α : Type u_1}
{M : Matroid α}
{I : Set α}
(hI : M.Indep I)


protected theorem comp_eq (h : Semiconj₂ f ga gb) : bicompr f ga = bicompl gb f f

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{ga : α → α → α}
{gb : β → β → β}
(h : Function.Semiconj₂ f ga gb)

Function.bicompr f ga = Function.bicompl gb f f


@[to_additive]
theorem mul_inter_subset : s * (t₁ ∩ t₂) ⊆ s * t₁ ∩ (s * t₂)

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


theorem lt_toDual_iff {a : WithTop αᵒᵈ} {b : WithBot α} :
    a < WithBot.toDual b ↔ b < WithTop.ofDual a

{α : Type u_1}
[LT α]
{a : WithTop αᵒᵈ}
{b : WithBot α}


theorem Prefunctor.star_comp (u : U) : (φ ⋙q ψ).star u = ψ.star (φ.obj u) ∘ φ.star u

{U : Type u_1}
[Quiver U]
{V : Type u_3}
[Quiver V]
(φ : U ⥤q V)
{W : Type u_2}
[Quiver W]
(ψ : V ⥤q W)
(u : U)


theorem Results.len_unique {s : Computation α} {a b m n} (h1 : Results s a m) (h2 : Results s b n) :
    m = n

{α : Type u}
{s : Computation α}
{a b : α}
{m n : ℕ}
(h1 : s.Results a m)
(h2 : s.Results b n)


/-- Symmetric statement to `Filter.map₂_map_left_comm`. -/
theorem map_map₂_distrib_left {n : γ → δ} {m' : α' → β → δ} {n' : α → α'}
    (h_distrib : ∀ a b, n (m a b) = m' (n' a) b) : (map₂ m f g).map n = map₂ m' (f.map n') g

{m : α → β → γ}

(h_distrib : ∀ (a : α) (b : β), n (m a b) = m' (n' a) b)

Filter.map n (Filter.map₂ m f g) = Filter.map₂ m' (Filter.map n' f) g


lemma BddBelow.smul_of_nonneg (hs : BddBelow s) (ha : 0 ≤ a) : BddBelow (a • s)

{α : Type u_1}
{β : Type u_2}
[SMul α β]
[Preorder α]
[Preorder β]
[Zero α]
[PosSMulMono α β]
{a : α}
{s : Set β}
(hs : BddBelow s)
(ha : 0 ≤ a)


protected theorem isBounded : Bornology.IsBounded (K : Set V)

{V : Type u_1}
[SeminormedAddCommGroup V]
[NormedSpace ℝ V]
(K : ConvexBody V)


/-- The forgetful monoidal functor from the Drinfeld center to the original category. -/
@[simps]
def forget : MonoidalFunctor (Center C) C

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

(CategoryTheory.Center.forget C).ε = 𝟙 (𝟙_ C)


theorem cmp_congr_left (xy : cmp x y = .eq) : cmp x z = cmp y z

∀ {x : Sort u_1} {cmp : x → x → Ordering} [inst : Batteries.TransCmp cmp] {x_1 y z : x},
  cmp x_1 y = Ordering.eq → cmp x_1 z = cmp y z


@[to_additive (attr := simp)]
lemma mul_stabilizer_self : s * stabilizer G s = s

{G : Type u_1}
[AddCommGroup G]
(s : Set G)


@[to_additive]
protected theorem right_comm (h : IsMulCentral c) (a b) : a * b * c = a * c * b

{M : Type u_1}
{c : M}
[Mul M]
(h : IsMulCentral c)
(a b : M)


theorem setToSimpleFunc_const' [Nonempty α] (T : Set α → F →L[ℝ] F') (x : F)
    {m : MeasurableSpace α} : SimpleFunc.setToSimpleFunc T (SimpleFunc.const α x) = T univ x

{α : Type u_1}
{F : Type u_3}
{F' : Type u_4}
[NormedAddCommGroup F]
[NormedSpace ℝ F]
[NormedAddCommGroup F']
[NormedSpace ℝ F']
[Nonempty α]
(T : Set α → F →L[ℝ] F')
(x : F)
{m : MeasurableSpace α}

MeasureTheory.SimpleFunc.setToSimpleFunc T (MeasureTheory.SimpleFunc.const α x) = (T Set.univ) x


/-- Define the nontrivial quadratic character on `ZMod 4`, `χ₄`.
It corresponds to the extension `ℚ(√-1)/ℚ`. -/
@[simps]
def χ₄ : MulChar (ZMod 4) ℤ


theorem gradedComm_tmul_one (a : ⨁ i, 𝒜 i) : gradedComm R 𝒜 ℬ (a ⊗ₜ 1) = 1 ⊗ₜ a

(R : Type u_1)
{ι : Type u_2}
[CommSemiring ι]
[Module ι (Additive ℤˣ)]
[DecidableEq ι]
(𝒜 : ι → Type u_5)
(ℬ : ι → Type u_6)
[CommRing R]
[(i : ι) → AddCommGroup (𝒜 i)]
[(i : ι) → AddCommGroup (ℬ i)]
[(i : ι) → Module R (𝒜 i)]
[(i : ι) → Module R (ℬ i)]
[DirectSum.GRing 𝒜]
[DirectSum.GRing ℬ]
[DirectSum.GAlgebra R 𝒜]
[DirectSum.GAlgebra R ℬ]
(a : ⨁ (i : ι), 𝒜 i)

(TensorProduct.gradedComm R 𝒜 ℬ) (a ⊗ₜ[R] 1) = 1 ⊗ₜ[R] a


@[simps]
instance Endofunctor.coalgebraPreadditive : Preadditive (Endofunctor.Coalgebra F)

(A₁ A₂ : CategoryTheory.Endofunctor.Coalgebra F)

CategoryTheory.Endofunctor.Coalgebra.Hom.f 0 = 0


lemma piecewise_mem_Icc (h : f ≤ g) : s.piecewise f g ∈ Set.Icc f g

{ι : Type u_1}
(s : Finset ι)
[(j : ι) → Decidable (j ∈ s)]
{π : ι → Type u_3}
{f g : (i : ι) → π i}
[(i : ι) → Preorder (π i)]
(h : f ≤ g)


@[to_additive top_prod]
theorem top_prod (H : Subgroup N) : (⊤ : Subgroup G).prod H = H.comap (MonoidHom.snd G N)

{G : Type u_1}
[Group G]
{N : Type u_5}
[Group N]
(H : Subgroup N)

⊤.prod H = Subgroup.comap (MonoidHom.snd G N) H


private theorem toIxxMod_antisymm (h₁₂₃ : toIcoMod hp a b ≤ toIocMod hp a c)
    (h₁₃₂ : toIcoMod hp a c ≤ toIocMod hp a b) :
    b ≡ a [PMOD p] ∨ c ≡ b [PMOD p] ∨ a ≡ c [PMOD p]


theorem AddMonoid.fg_def : AddMonoid.FG N ↔ (⊤ : AddSubmonoid N).FG


theorem copy_eq (f : C(α, β)) (f' : α → β) (h : f' = f) : f.copy f' h = f

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
(f : C(α, β))
(f' : α → β)
(h : f' = ⇑f)


/--
Cost structure for strings, where cost is the length of the token.
-/
@[simps!]
def stringLengthCost : Cost String String ℕ

Levenshtein.stringLengthCost.insert b = b.length


theorem mem_cons (s : WSeq α) (a) : a ∈ cons a s

{α : Type u}
(s : Stream'.WSeq α)
(a : α)


@[simp]
theorem compress_self (u a : α) : compress u u a = a

{α : Type u_1}
[GeneralizedBooleanAlgebra α]
[DecidableRel Disjoint]
[DecidableRel fun x x_1 => x ≤ x_1]
(u a : α)


/-- If `f` is strictly differentiable at `x` with derivative `f'` and `K > ‖f'‖₊`, then `f` is
`K`-Lipschitz in a neighborhood of `x`. -/
theorem HasStrictFDerivAt.exists_lipschitzOnWith_of_nnnorm_lt (hf : HasStrictFDerivAt f f' x)
    (K : ℝ≥0) (hK : ‖f'‖₊ < K) : ∃ s ∈ 𝓝 x, LipschitzOnWith K f s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{f' : E →L[𝕜] F}
{x : E}
(hf : HasStrictFDerivAt f f' x)
(K : ℝ≥0)
(hK : ‖f'‖₊ < K)


theorem linearIndependent_fin_cons {n} {v : Fin n → V} :
    LinearIndependent K (Fin.cons x v : Fin (n + 1) → V) ↔
      LinearIndependent K v ∧ x ∉ Submodule.span K (range v)

{K : Type u_3}
{V : Type u}
[DivisionRing K]
[AddCommGroup V]
[Module K V]
{x : V}
{n : ℕ}
{v : Fin n → V}

LinearIndependent K (Fin.cons x v) ↔ LinearIndependent K v ∧ x ∉ Submodule.span K (Set.range v)


/--
A semireal ring is a non-trivial commutative ring (with unit) in which `-1` is *not* a sum of
squares. Note that `-1` does not make sense in a semiring. Below we define the class `isSemiReal R`
for all additive monoid `R` equipped with a multiplication, a multiplicative unit and a negation.
-/
@[mk_iff]
class isSemireal [AddMonoid R] [Mul R] [One R] [Neg R] : Prop where
  non_trivial        : (0 : R) ≠ 1
  neg_one_not_SumSq  : ¬isSumSq (-1 : R)

{R : Type u_1}
[AddMonoid R]
[Mul R]
[One R]
[Neg R]
[self : isSemireal R]


theorem conformal_id : Conformal (id : X → X)

{X : Type u_1}
[NormedAddCommGroup X]
[NormedSpace ℝ X]


theorem CauchySeq.comp_tendsto {γ} [Preorder β] [SemilatticeSup γ] [Nonempty γ] {f : β → α}
    (hf : CauchySeq f) {g : γ → β} (hg : Tendsto g atTop atTop) : CauchySeq (f ∘ g)

(hg : Filter.Tendsto g Filter.atTop Filter.atTop)


lemma exact_iff_δlast {n : ℕ} (S : ComposableArrows C (n + 2)) :
    S.Exact ↔ S.δlast.Exact ∧ (mk₂ (S.map' n (n + 1)) (S.map' (n + 1) (n + 2))).Exact

(S : CategoryTheory.ComposableArrows C (n + 2))

S.Exact ↔
  S.δlast.Exact ∧ (CategoryTheory.ComposableArrows.mk₂ (S.map' n (n + 1) ⋯ ⋯) (S.map' (n + 1) (n + 2) ⋯ ⋯)).Exact


theorem cos_coe_pi : cos (π : Angle) = -1


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

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

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


private lemma triple_eq_triple_of_mem (hst : Disjoint s t) (hsu : Disjoint s u) (htu : Disjoint t u)
    {x₁ x₂ y₁ y₂ z₁ z₂ : α} (h : ({x₁, y₁, z₁} : Finset α) = {x₂, y₂, z₂})
    (hx₁ : x₁ ∈ s) (hx₂ : x₂ ∈ s) (hy₁ : y₁ ∈ t) (hy₂ : y₂ ∈ t) (hz₁ : z₁ ∈ u) (hz₂ : z₂ ∈ u) :
    (x₁, y₁, z₁) = (x₂, y₂, z₂)

{α : Type u_1}
{s t u : Finset α}
[DecidableEq α]
(hst : Disjoint s t)
(hsu : Disjoint s u)
(htu : Disjoint t u)
{x₁ x₂ y₁ y₂ z₁ z₂ : α}
(h : {x₁, y₁, z₁} = {x₂, y₂, z₂})
(hx₁ : x₁ ∈ s)
(hx₂ : x₂ ∈ s)
(hy₁ : y₁ ∈ t)
(hy₂ : y₂ ∈ t)
(hz₁ : z₁ ∈ u)
(hz₂ : z₂ ∈ u)


theorem Ico_add_bij : BijOn (· + d) (Ico a b) (Ico (a + d) (b + d))

{M : Type u_1}
[OrderedCancelAddCommMonoid M]
[ExistsAddOfLE M]
(a b d : M)

Set.BijOn (fun x => x + d) (Set.Ico a b) (Set.Ico (a + d) (b + d))


@[simp]
theorem lastFun_comp {α₀ α₁ α₂ : TypeVec (n + 1)} (f₀ : α₀ ⟹ α₁) (f₁ : α₁ ⟹ α₂) :
    lastFun (f₁ ⊚ f₀) = lastFun f₁ ∘ lastFun f₀

{n : ℕ}
{α₀ : TypeVec.{u_1} (n + 1)}
{α₁ : TypeVec.{u_2} (n + 1)}
{α₂ : TypeVec.{u_3} (n + 1)}
(f₀ : α₀.Arrow α₁)
(f₁ : α₁.Arrow α₂)

TypeVec.lastFun (TypeVec.comp f₁ f₀) = TypeVec.lastFun f₁ ∘ TypeVec.lastFun f₀


@[simp]
lemma powersMulHom_apply (x : α) (n : Multiplicative ℕ) : powersMulHom α x n = x ^ toAdd n

(α : Type u_1)
[CommMonoid α]
(x : α)
(n : Multiplicative ℕ)

((powersMulHom α) x) n = x ^ Multiplicative.toAdd n


@[simp]
lemma biSup_comap_subtype_eq_top {ι : Type*} (s : Set ι) (p : ι → Submodule R M) :
    ⨆ i ∈ s, (p i).comap (⨆ i ∈ s, p i).subtype = ⊤

{R : Type u_1}
{M : Type u_4}
[Semiring R]
[AddCommGroup M]
[Module R M]
{ι : Type u_9}
(s : Set ι)
(p : ι → Submodule R M)

⨆ i ∈ s, Submodule.comap (⨆ i ∈ s, p i).subtype (p i) = ⊤


theorem mem_nhdsWithin {t : Set α} {a : α} {s : Set α} :
    t ∈ 𝓝[s] a ↔ ∃ u, IsOpen u ∧ a ∈ u ∧ u ∩ s ⊆ t

{α : Type u_1}
[TopologicalSpace α]
{t : Set α}
{a : α}
{s : Set α}


@[simp]
theorem coeff_zero_X (i : σ) : coeff 0 (X i : MvPolynomial σ R) = 0

{R : Type u}
{σ : Type u_1}
[CommSemiring R]
(i : σ)

MvPolynomial.coeff 0 (MvPolynomial.X i) = 0


private theorem someExistsOneDivLT_lt (hi : ¬s ≤[i] 0) :
    (1 / (findExistsOneDivLT s i + 1) : ℝ) < s (someExistsOneDivLT s i)

(hi : ¬MeasureTheory.VectorMeasure.restrict s i ≤ MeasureTheory.VectorMeasure.restrict 0 i)

1 / (↑(MeasureTheory.SignedMeasure.findExistsOneDivLT s i) + 1) <
  ↑s (MeasureTheory.SignedMeasure.someExistsOneDivLT s i)


@[simp]
theorem augment_d_succ_succ (C : CochainComplex V ℕ) {X : V} (f : X ⟶ C.X 0) (w : f ≫ C.d 0 1 = 0)
    (i j : ℕ) : (augment C f w).d (i + 1) (j + 1) = C.d i j

(C.augment f w).d (i + 1) (j + 1) = C.d i j


theorem isOpen_singleton_nhdsAdjoint {α : Type*} {a b : α} (f : Filter α) (hb : b ≠ a) :
    IsOpen[nhdsAdjoint a f] {b}

{α : Type u_1}
{a b : α}
(f : Filter α)
(hb : b ≠ a)


theorem Sylow.coe_smul {g : G} {P : Sylow p G} : ↑(g • P) = MulAut.conj g • (P : Set G)

{p : ℕ}
{G : Type u_1}
[Group G]
{g : G}
{P : Sylow p G}


@[to_additive]
theorem prod_Ico_div_bot (hmn : m < n) : (∏ i ∈ Ico m n, f i) / f m = ∏ i ∈ Ico (m + 1) n, f i

{M : Type u_3}
(f : ℕ → M)
{m n : ℕ}
[CommGroup M]
(hmn : m < n)

(∏ i ∈ Finset.Ico m n, f i) / f m = ∏ i ∈ Finset.Ico (m + 1) n, f i


@[simp]
theorem iInter_iInter_eq_or_left {b : β} {p : β → Prop} {s : ∀ x : β, x = b ∨ p x → Set α} :
    ⋂ (x) (h), s x h = s b (Or.inl rfl) ∩ ⋂ (x) (h : p x), s x (Or.inr h)

{α : Type u_1}
{β : Type u_2}
{b : β}
{p : β → Prop}
{s : (x : β) → x = b ∨ p x → Set α}

⋂ x, ⋂ (h : x = b ∨ p x), s x h = s b ⋯ ∩ ⋂ x, ⋂ (h : p x), s x ⋯


theorem colimit.desc_extend (F : J ⥤ C) [HasColimit F] (c : Cocone F) {X : C} (f : c.pt ⟶ X) :
    colimit.desc F (c.extend f) = colimit.desc F c ≫ f

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u}
[CategoryTheory.Category.{v, u} C]
(F : J ⥤ C)
[CategoryTheory.Limits.HasColimit F]
(c : CategoryTheory.Limits.Cocone F)
{X : C}
(f : c.pt ⟶ X)

CategoryTheory.Limits.colimit.desc F (c.extend f) = CategoryTheory.Limits.colimit.desc F c ≫ f


lemma inv_mulVec_eq_vec {A : Matrix n n α} [Invertible A]
    {u v : n → α} (hM : u = A.mulVec v) : A⁻¹.mulVec u = v

{n : Type u'}
{α : Type v}
[Fintype n]
[DecidableEq n]
[CommRing α]
{A : Matrix n n α}
[Invertible A]
{u v : n → α}
(hM : u = A.mulVec v)


@[simp]
lemma comp_mk₀_id (α : Ext X Y n) :
    α.comp (mk₀ (𝟙 Y)) (add_zero n) = α

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Abelian C]
[CategoryTheory.HasExt C]
{X Y : C}
{n : ℕ}
(α : CategoryTheory.Abelian.Ext X Y n)

α.comp (CategoryTheory.Abelian.Ext.mk₀ (CategoryTheory.CategoryStruct.id Y)) ⋯ = α


/-- A word and its maximal reduction correspond to the same element of the free group. -/
@[to_additive "A word and its maximal reduction correspond to the same element of the additive free
  group."]
theorem reduce.self : mk (reduce L) = mk L

{α : Type u}
{L : List (α × Bool)}
[DecidableEq α]

FreeGroup.mk (FreeGroup.reduce L) = FreeGroup.mk L


theorem ConvexOn.sub_strictConcaveOn (hf : ConvexOn 𝕜 s f) (hg : StrictConcaveOn 𝕜 s g) :
    StrictConvexOn 𝕜 s (f - g)

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


theorem iInf_const_mono (h : ι' → ι) : ⨅ _ : ι, a ≤ ⨅ _ : ι', a

{α : Type u_1}
{ι : Sort u_5}
{ι' : Sort u_6}
[CompleteLattice α]
{a : α}
(h : ι' → ι)


/-- Hamiltonian paths are paths. -/
lemma IsHamiltonian.isPath (hp : p.IsHamiltonian) : p.IsPath

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


@[simp]
theorem one_comp : comp (1 : R[X]) p = 1


theorem insert_val' (a : α) (s : Finset α) : (insert a s).1 = dedup (a ::ₘ s.1)

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


theorem smul_nonpos {f : ι → Ω → F} {c : ℝ} (hc : c ≤ 0) (hf : Supermartingale f ℱ μ) :
    Submartingale (c • f) ℱ μ

(hf : MeasureTheory.Supermartingale f ℱ μ)


protected theorem differentiableAt : DifferentiableAt 𝕜 (fun x => p.eval x) x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{x : 𝕜}
(p : 𝕜[X])

DifferentiableAt 𝕜 (fun x => Polynomial.eval x p) x


theorem psub_eq_some {m : ℕ} : ∀ {n k}, psub m n = some k ↔ k + n = m


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


theorem all_ae_of {ι : Sort*} {p : α → ι → Prop} (hp : ∀ᵐ a ∂μ, ∀ i, p a i) (i : ι) :
    ∀ᵐ a ∂μ, p a i

{α : Type u_1}
{F : Type u_3}
[FunLike F (Set α) ℝ≥0∞]
[MeasureTheory.OuterMeasureClass F α]
{μ : F}
{ι : Sort u_4}
{p : α → ι → Prop}
(hp : ∀ᵐ (a : α) ∂μ, ∀ (i : ι), p a i)
(i : ι)


/-- `simp` normal form version of `total_dualBasis` -/
@[simp]
theorem total_coord [CommRing R] [AddCommGroup M] [Module R M] [Finite ι] (b : Basis ι R M)
    (f : ι →₀ R) (i : ι) : Finsupp.total ι (Dual R M) R b.coord f (b i) = f i

{R : Type uR}
{M : Type uM}
{ι : Type uι}
[CommRing R]
[AddCommGroup M]
[Module R M]
[Finite ι]
(b : Basis ι R M)
(f : ι →₀ R)
(i : ι)

((Finsupp.total ι (Module.Dual R M) R b.coord) f) (b i) = f i


theorem cpow_sub {x : ℂ} (y z : ℂ) (hx : x ≠ 0) : x ^ (y - z) = x ^ y / x ^ z


@[simp]
theorem cancel_right {g₁ g₂ : BotHom β γ} {f : BotHom α β} (hf : Surjective f) :
    g₁.comp f = g₂.comp f ↔ g₁ = g₂

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[Bot α]
[Bot β]
[Bot γ]
{g₁ g₂ : BotHom β γ}
{f : BotHom α β}
(hf : Function.Surjective ⇑f)


/-- A constant polynomial has zero separable degree. -/
theorem natSepDegree_eq_zero (h : f.natDegree = 0) : f.natSepDegree = 0

{F : Type u}
[Field F]
(f : F[X])
(h : f.natDegree = 0)


@[reassoc]
theorem map_whiskerLeft (X : C) {Y Z : C} (f : Y ⟶ Z) :
    F.map (X ◁ f) = inv (F.μ X Y) ≫ F.obj X ◁ F.map f ≫ F.μ X Z

(F : CategoryTheory.MonoidalFunctor C D)

F.map (CategoryTheory.MonoidalCategory.whiskerLeft X f) =
  CategoryTheory.inv (F.μ X Y) ≫ CategoryTheory.MonoidalCategory.whiskerLeft (F.obj X) (F.map f) ≫ F.μ X Z


theorem iCondIndepSet.condIndep_generateFrom_le [LinearOrder ι] {s : ι → Set Ω}
    (hsm : ∀ n, MeasurableSet (s n)) (hs : iCondIndepSet m' hm' s μ) (i : ι) {k : ι} (hk : i < k) :
    CondIndep m' (generateFrom {s k}) (generateFrom { t | ∃ j ≤ i, s j = t }) hm' μ

(hs : ProbabilityTheory.iCondIndepSet m' hm' s μ)

ProbabilityTheory.CondIndep m' (MeasurableSpace.generateFrom {s k})
  (MeasurableSpace.generateFrom {t | ∃ j ≤ i, s j = t}) hm' μ


lemma prod_pos (h0 : ∀ i ∈ s, 0 < f i) : 0 < ∏ i ∈ s, f i

{ι : Type u_1}
{R : Type u_2}
[CommMonoidWithZero R]
[PartialOrder R]
[ZeroLEOneClass R]
[PosMulStrictMono R]
[Nontrivial R]
{f : ι → R}
{s : Finset ι}
(h0 : ∀ i ∈ s, 0 < f i)


theorem generate_le {s : Set (Set α)} (h : ∀ t ∈ s, d.Has t) : generate s ≤ d

{α : Type u_1}
(d : MeasurableSpace.DynkinSystem α)
{s : Set (Set α)}
(h : ∀ t ∈ s, d.Has t)

MeasurableSpace.DynkinSystem.generate s ≤ d


theorem exists_measurable_superset₂ (μ ν : Measure α) (s : Set α) :
    ∃ t, s ⊆ t ∧ MeasurableSet t ∧ μ t = μ s ∧ ν t = ν s

{α : Type u_1}
[MeasurableSpace α]
(μ ν : MeasureTheory.Measure α)
(s : Set α)


theorem sin_arctan (x : ℝ) : sin (arctan x) = x / √(1 + x ^ 2)

Real.sin (Real.arctan x) = x / √(1 + x ^ 2)


theorem typein_lt_self {o : Ordinal} (i : o.out.α) :
    @typein _ (· < ·) (isWellOrder_out_lt _) i < o

{o : Ordinal.{u_3}}
(i : (Quotient.out o).α)

Ordinal.typein (fun x x_1 => x < x_1) i < o


theorem lipschitzOnWith_iff_restrict : LipschitzOnWith K f s ↔ LipschitzWith K (s.restrict f)

{α : Type u}
{β : Type v}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
{K : ℝ≥0}
{s : Set α}
{f : α → β}


/-- The congruence relation used to localize a `CommMonoid` at a submonoid can be expressed
equivalently as an infimum (see `Localization.r`) or explicitly
(see `Localization.r'`). -/
@[to_additive AddLocalization.r_eq_r'
    "The additive congruence relation used to localize an `AddCommMonoid` at a submonoid can be
expressed equivalently as an infimum (see `AddLocalization.r`) or explicitly
(see `AddLocalization.r'`)."]
theorem r_eq_r' : r S = r' S

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

AddLocalization.r S = AddLocalization.r' S


@[simp] theorem preimage_Iic : e ⁻¹' Iic (e x) = Iic x

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
(e : α ↪o β)
(x : α)


/-- Local equivalence between subsets `source` and `target` of `α` and `β` respectively. The
(global) maps `toFun : α → β` and `invFun : β → α` map `source` to `target` and conversely, and are
inverse to each other there. The values of `toFun` outside of `source` and of `invFun` outside of
`target` are irrelevant. -/
structure PartialEquiv (α : Type*) (β : Type*) where
  /-- The global function which has a partial inverse. Its value outside of the `source` subset is
  irrelevant. -/
  toFun : α → β
  /-- The partial inverse to `toFun`. Its value outside of the `target` subset is irrelevant. -/
  invFun : β → α
  /-- The domain of the partial equivalence. -/
  source : Set α
  /-- The codomain of the partial equivalence. -/
  target : Set β
  /-- The proposition that elements of `source` are mapped to elements of `target`. -/
  map_source' : ∀ ⦃x⦄, x ∈ source → toFun x ∈ target
  /-- The proposition that elements of `target` are mapped to elements of `source`. -/
  map_target' : ∀ ⦃x⦄, x ∈ target → invFun x ∈ source
  /-- The proposition that `invFun` is a left-inverse of `toFun` on `source`. -/
  left_inv' : ∀ ⦃x⦄, x ∈ source → invFun (toFun x) = x
  /-- The proposition that `invFun` is a right-inverse of `toFun` on `target`. -/
  right_inv' : ∀ ⦃x⦄, x ∈ target → toFun (invFun x) = x

{α : Type u_5}
{β : Type u_6}
(self : PartialEquiv α β)
⦃x : α⦄


@[simp]
theorem extend_comp_eq' [MeasurableSpace β] (f₁ : α →ₛ γ) {g : α → β} (hg : MeasurableEmbedding g)
    (f₂ : β →ₛ γ) : f₁.extend g hg f₂ ∘ g = f₁

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[MeasurableSpace α]
[MeasurableSpace β]
(f₁ : MeasureTheory.SimpleFunc α γ)
{g : α → β}
(hg : MeasurableEmbedding g)
(f₂ : MeasureTheory.SimpleFunc β γ)


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


theorem sum_ite_self_eq [DecidableEq α] {N : Type*} [AddCommMonoid N] (f : α →₀ N) (a : α) :
    (f.sum fun x v => ite (a = x) v 0) = f a

{α : Type u_1}
[DecidableEq α]
{N : Type u_16}
[AddCommMonoid N]
(f : α →₀ N)
(a : α)

(f.sum fun x v => if a = x then v else 0) = f a


protected theorem bijective (e : P₁ ≃ᵃ[k] P₂) : Bijective 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 : P₁ ≃ᵃ[k] P₂)


@[deprecated map_pow (since := "2024-06-20")]
protected theorem map_pow : ∀ (x : A₁) (n : ℕ), e (x ^ n) = e x ^ n

{R : Type uR}
{A₁ : Type uA₁}
{A₂ : Type uA₂}
[CommSemiring R]
[Semiring A₁]
[Semiring A₂]
[Algebra R A₁]
[Algebra R A₂]
(e : A₁ ≃ₐ[R] A₂)
(x : A₁)
(n : ℕ)


theorem swapLeft_apply' (κ : Kernel (α × β) γ) (a : β × α) (s : Set γ) :
    swapLeft κ a s = κ a.swap s

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


lemma nonsingular_zero [Nontrivial R] : W'.Nonsingular ![1, 1, 0]

{R : Type u}
[CommRing R]
{W' : WeierstrassCurve.Jacobian R}
[Nontrivial R]


protected theorem _root_.AEMeasurable.nullMeasurable {f : α → β} (h : AEMeasurable f μ) :
    NullMeasurable f μ

{α : Type u_1}
{β : Type u_2}
{m0 : MeasurableSpace α}
[MeasurableSpace β]
{μ : MeasureTheory.Measure α}
{f : α → β}
(h : AEMeasurable f μ)


@[simp]
theorem ι_range_map_lift (f : M →ₗ[R] A) (cond : ∀ m, f m * f m = algebraMap _ _ (Q m)) :
    (ι Q).range.map (lift Q ⟨f, cond⟩).toLinearMap = LinearMap.range f

(cond : ∀ (m : M), f m * f m = (algebraMap R A) (Q m))

Submodule.map ((CliffordAlgebra.lift Q) ⟨f, cond⟩).toLinearMap (LinearMap.range (CliffordAlgebra.ι Q)) =
  LinearMap.range f


/-- A real function into a finite dimensional real vector space which is Lipschitz on a set
is differentiable almost everywhere in this set. For the general Rademacher theorem assuming
that the source space is finite dimensional, see `LipschitzOnWith.ae_differentiableWithinAt`. -/
theorem LipschitzOnWith.ae_differentiableWithinAt_real {C : ℝ≥0} {f : ℝ → V} {s : Set ℝ}
    (h : LipschitzOnWith C f s) (hs : MeasurableSet s) :
    ∀ᵐ x ∂volume.restrict s, DifferentiableWithinAt ℝ f s x

{V : Type u_3}
[NormedAddCommGroup V]
[NormedSpace ℝ V]
[FiniteDimensional ℝ V]
{C : ℝ≥0}
{f : ℝ → V}
{s : Set ℝ}
(h : LipschitzOnWith C f s)
(hs : MeasurableSet s)

∀ᵐ (x : ℝ) ∂MeasureTheory.volume.restrict s, DifferentiableWithinAt ℝ f s x


@[to_additive (attr := simp)]
lemma mker_fst : mker (fst M N) = .prod ⊥ ⊤

{M : Type u_1}
{N : Type u_2}
[MulOneClass M]
[MulOneClass N]

MonoidHom.mker (MonoidHom.fst M N) = ⊥.prod ⊤


@[simp]
theorem intervalIntegrable_pow : IntervalIntegrable (fun x => x ^ n) μ a b


lemma mem_kstar_iff_exists_nonempty {x : List α} :
    x ∈ l∗ ↔ ∃ S : List (List α), x = S.join ∧ ∀ y ∈ S, y ∈ l ∧ y ≠ []

{α : Type u_1}
{l : Language α}
{x : List α}

x ∈ l∗ ↔ ∃ S, x = S.join ∧ ∀ y ∈ S, y ∈ l ∧ y ≠ []


/-- Right unitor for the vertical composition of oplax natural transformations. -/
-- Porting note: verified that projections are correct and changed @[simps] to @[simps!]
@[simps!]
def rightUnitor (η : F ⟶ G) : η ≫ 𝟙 G ≅ η

{B : Type u₁}
[CategoryTheory.Bicategory B]
{C : Type u₂}
[CategoryTheory.Bicategory C]
{F G : CategoryTheory.OplaxFunctor B C}
(η : F ⟶ G)
(a : B)

(CategoryTheory.OplaxNatTrans.rightUnitor η).inv.app a = (CategoryTheory.Bicategory.rightUnitor (η.app a)).inv


/-- The complement to a Lindelöf set belongs to a filter `f` with the countable intersection
  property if it belongs to each filter `𝓝 x ⊓ f`, `x ∈ s`. -/
theorem IsLindelof.compl_mem_sets (hs : IsLindelof s) {f : Filter X} [CountableInterFilter f]
    (hf : ∀ x ∈ s, sᶜ ∈ 𝓝 x ⊓ f) : sᶜ ∈ f

{X : Type u}
[TopologicalSpace X]
{s : Set X}
(hs : IsLindelof s)
{f : Filter X}
[CountableInterFilter f]
(hf : ∀ x ∈ s, sᶜ ∈ 𝓝 x ⊓ f)


@[simp, nolint simpNF]
theorem free_map_coe {α β : Type u} {f : α → β} : ⇑(free.map f) = ⇑(rename f)

⇑(CommRingCat.free.map f) = ⇑(MvPolynomial.rename f)


@[to_additive]
theorem inv_mul_eq_div : a⁻¹ * b = b / a

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


theorem smul_zero_subset (s : Set α) : s • (0 : Set β) ⊆ 0

{α : Type u_2}
{β : Type u_3}
[Zero β]
[SMulZeroClass α β]
(s : Set α)


theorem whiskerLeft_π_actLeft :
    (R.X ◁ coequalizer.π _ _) ≫ actLeft P Q =
      (α_ _ _ _).inv ≫ (P.actLeft ▷ Q.X) ≫ coequalizer.π _ _

[(X : C) →
    CategoryTheory.Limits.PreservesColimitsOfSize.{0, 0, v₁, v₁, u₁, u₁} (CategoryTheory.MonoidalCategory.tensorLeft X)]

R.X ◁ CategoryTheory.Limits.coequalizer.π (P.actRight ▷ Q.X) ((α_ P.X S.X Q.X).hom ≫ P.X ◁ Q.actLeft) ≫
    Bimod.TensorBimod.actLeft P Q =
  (α_ R.X P.X Q.X).inv ≫
    P.actLeft ▷ Q.X ≫ CategoryTheory.Limits.coequalizer.π (P.actRight ▷ Q.X) ((α_ P.X S.X Q.X).hom ≫ P.X ◁ Q.actLeft)


@[simp]
theorem cofinite_eq : (cofinite : Filter ℤ) = atBot ⊔ atTop

Filter.cofinite = Filter.atBot ⊔ Filter.atTop


theorem isComplemented_bot : IsComplemented (⊥ : α)

{α : Type u_1}
[Lattice α]
[BoundedOrder α]


theorem eq_iSup_nat (m : Set X → ℝ≥0∞) : mkMetric' m = ⨆ n : ℕ, mkMetric'.pre m n⁻¹

{X : Type u_2}
[EMetricSpace X]
(m : Set X → ℝ≥0∞)

MeasureTheory.OuterMeasure.mkMetric' m = ⨆ n, MeasureTheory.OuterMeasure.mkMetric'.pre m (↑n)⁻¹


@[to_additive le_card_add_mul_addEnergy] lemma le_card_add_mul_mulEnergy (s t : Finset α) :
    s.card ^ 2 * t.card ^ 2 ≤ (s * t).card * Eₘ[s, t]

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

s.card ^ 2 * t.card ^ 2 ≤ (s + t).card * s.addEnergy t


theorem le_floor_iff (ha : 0 ≤ a) : n ≤ ⌊a⌋₊ ↔ (n : α) ≤ a

{α : Type u_2}
[LinearOrderedSemiring α]
[FloorSemiring α]
{a : α}
{n : ℕ}
(ha : 0 ≤ a)

n ≤ ⌊a⌋₊ ↔ ↑n ≤ a


theorem natDegree_cancelLeads_lt_of_natDegree_le_natDegree_of_comm
    (comm : p.leadingCoeff * q.leadingCoeff = q.leadingCoeff * p.leadingCoeff)
    (h : p.natDegree ≤ q.natDegree) (hq : 0 < q.natDegree) :
    (p.cancelLeads q).natDegree < q.natDegree


/-- Composition of two `AddConstMap`s. -/
@[simps (config := .asFn)]
def comp {K : Type*} [Add K] {c : K} (g : H →+c[b, c] K) (f : G →+c[a, b] H) :
    G →+c[a, c] K

{G : Type u_1}
{H : Type u_2}
[Add G]
[Add H]
{a : G}
{b : H}
{K : Type u_3}
[Add K]
{c : K}
(g : AddConstMap H K b c)
(f : AddConstMap G H a b)


theorem Ioo_subset_Ioo_left (h : a₁ ≤ a₂) : Ioo a₂ b ⊆ Ioo a₁ b

{α : Type u_2}
[Preorder α]
[LocallyFiniteOrder α]
{a₁ a₂ b : α}
(h : a₁ ≤ a₂)


theorem integral_Iic_sub_Iic (ha : IntegrableOn f (Iic a) μ) (hb : IntegrableOn f (Iic b) μ) :
    ((∫ x in Iic b, f x ∂μ) - ∫ x in Iic a, f x ∂μ) = ∫ x in a..b, f x ∂μ

(ha : MeasureTheory.IntegrableOn f (Set.Iic a) μ)

(hb : MeasureTheory.IntegrableOn f (Set.Iic b) μ)

∫ (x : ℝ) in Set.Iic b, f x ∂μ - ∫ (x : ℝ) in Set.Iic a, f x ∂μ = ∫ (x : ℝ) in a..b, f x ∂μ


@[to_additive]
theorem update_div [∀ i, Div (f i)] [DecidableEq I] (f₁ f₂ : ∀ i, f i) (i : I) (x₁ : f i)
    (x₂ : f i) : update (f₁ / f₂) i (x₁ / x₂) = update f₁ i x₁ / update f₂ i x₂

{I : Type u}
{f : I → Type v}
[(i : I) → Div (f i)]
[DecidableEq I]
(f₁ f₂ : (i : I) → f i)
(i : I)
(x₁ x₂ : f i)

Function.update (f₁ / f₂) i (x₁ / x₂) = Function.update f₁ i x₁ / Function.update f₂ i x₂


theorem Equiv.finite_iff (f : α ≃ β) : Finite α ↔ Finite β

{α : Sort u_1}
{β : Sort u_2}
(f : α ≃ β)


@[to_additive]
theorem one_eq_mk : (1 : FreeGroup α) = mk []


theorem hasConstantSpeedOnWith_iff_variationOnFromTo_eq :
    HasConstantSpeedOnWith f s l ↔ LocallyBoundedVariationOn f s ∧
      ∀ ⦃x⦄ (_ : x ∈ s) ⦃y⦄ (_ : y ∈ s), variationOnFromTo f s x y = l * (y - x)

{E : Type u_2}
[PseudoEMetricSpace E]
{f : ℝ → E}
{s : Set ℝ}
{l : ℝ≥0}

HasConstantSpeedOnWith f s l ↔
  LocallyBoundedVariationOn f s ∧ ∀ ⦃x : ℝ⦄, x ∈ s → ∀ ⦃y : ℝ⦄, y ∈ s → variationOnFromTo f s x y = ↑l * (y - x)


theorem trans_of_set' {s : Set Y} (hs : IsOpen s) :
    e.trans (ofSet s hs) = e.restr (e.source ∩ e ⁻¹' s)

{X : Type u_1}
{Y : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
(e : PartialHomeomorph X Y)
{s : Set Y}
(hs : IsOpen s)

e.trans (PartialHomeomorph.ofSet s hs) = e.restr (e.source ∩ ↑e ⁻¹' s)


@[to_additive (attr := simp)]
theorem coprod_apply (p : M × N) : f.coprod g p = f p.1 * g p.2

{M : Type u_5}
{N : Type u_6}
{P : Type u_7}
[MulOneClass M]
[MulOneClass N]
[CommMonoid P]
(f : M →* P)
(g : N →* P)
(p : M × N)


@[reassoc (attr := simp)]
theorem Q_idem (q : ℕ) : (Q q : K[X] ⟶ K[X]) ≫ Q q = Q q

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

AlgebraicTopology.DoldKan.Q q ≫ AlgebraicTopology.DoldKan.Q q = AlgebraicTopology.DoldKan.Q q


theorem content_eq_gcd_range_of_lt (p : R[X]) (n : ℕ) (h : p.natDegree < n) :
    p.content = (Finset.range n).gcd p.coeff

{R : Type u_1}
[CommRing R]
[IsDomain R]
[NormalizedGCDMonoid R]
(p : Polynomial R)
(n : ℕ)
(h : p.natDegree < n)


@[simp] lemma prob_compl_eq_zero_iff (hs : MeasurableSet s) : μ sᶜ = 0 ↔ μ s = 1

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s : Set α}
[MeasureTheory.IsProbabilityMeasure μ]
(hs : MeasurableSet s)


{α : Type u}
[TopologicalSpace α]
[Preorder α]
[ClosedIicTopology α]
{a : α}


theorem span_eq_span (hs : s ⊆ span R t) (ht : t ⊆ span R s) : span R s = span R t

{R : Type u_1}
{M : Type u_4}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{s t : Set M}
(hs : s ⊆ ↑(Submodule.span R t))
(ht : t ⊆ ↑(Submodule.span R s))


@[simp, norm_cast]
theorem complex_ofReal_eval_U : ∀ (x : ℝ) n, (((U ℝ n).eval x : ℝ) : ℂ) = (U ℂ n).eval (x : ℂ)

↑(Polynomial.eval x (Polynomial.Chebyshev.U ℝ n)) = Polynomial.eval (↑x) (Polynomial.Chebyshev.U ℂ n)


/-- The product of a family of triangles. -/
@[simps!]
def productTriangle : Triangle C

(T : J → CategoryTheory.Pretriangulated.Triangle C)

[CategoryTheory.Limits.HasProduct fun j => (T j).obj₁]

[CategoryTheory.Limits.HasProduct fun j => (T j).obj₂]

[CategoryTheory.Limits.HasProduct fun j => (T j).obj₃]

[CategoryTheory.Limits.HasProduct fun j => (CategoryTheory.shiftFunctor C 1).obj (T j).obj₁]

(CategoryTheory.Pretriangulated.productTriangle T).mor₃ =
  (CategoryTheory.Limits.Pi.map fun j => (T j).mor₃) ≫
    CategoryTheory.inv (CategoryTheory.Limits.piComparison (CategoryTheory.shiftFunctor C 1) fun j => (T j).obj₁)


@[simp]
lemma bit_mod_two_eq_one_iff (a x) :
    bit a x % 2 = 1 ↔ a


@[simp] theorem succ_ne_zero (n : Nat) : succ n ≠ 0


/-- An [exhaustion by compact sets](https://en.wikipedia.org/wiki/Exhaustion_by_compact_sets) of a
topological space is a sequence of compact sets `K n` such that `K n ⊆ interior (K (n + 1))` and
`⋃ n, K n = univ`.

If `X` is a locally compact sigma compact space, then `CompactExhaustion.choice X` provides
a choice of an exhaustion by compact sets. This choice is also available as
`(default : CompactExhaustion X)`. -/
structure CompactExhaustion (X : Type*) [TopologicalSpace X] where
  /-- The sequence of compact sets that form a compact exhaustion. -/
  toFun : ℕ → Set X
  /-- The sets in the compact exhaustion are in fact compact. -/
  isCompact' : ∀ n, IsCompact (toFun n)
  /-- The sets in the compact exhaustion form a sequence:
    each set is contained in the interior of the next. -/
  subset_interior_succ' : ∀ n, toFun n ⊆ interior (toFun (n + 1))
  /-- The union of all sets in a compact exhaustion equals the entire space. -/
  iUnion_eq' : ⋃ n, toFun n = univ

{X : Type u_4}
[TopologicalSpace X]
(self : CompactExhaustion X)


@[simp, aesop safe apply (rule_sets := [finsetNonempty])]
theorem sym2_nonempty : s.sym2.Nonempty ↔ s.Nonempty


/-- Division `y ↦ x / y` as an `IsometryEquiv`. -/
@[to_additive (attr := simps! apply symm_apply toEquiv)
  "Subtraction `y ↦ x - y` as an `IsometryEquiv`."]
def divLeft (c : G) : G ≃ᵢ G

{G : Type v}
[Group G]
[PseudoEMetricSpace G]
[IsometricSMul G G]
[IsometricSMul Gᵐᵒᵖ G]
(c : G)

(IsometryEquiv.divLeft c).toEquiv = Equiv.divLeft c


protected theorem StrictMono.monotone (hf : StrictMono f) : Monotone f

{α : Type u}
{β : Type v}
[PartialOrder α]
[Preorder β]
{f : α → β}
(hf : StrictMono f)


/-- The obvious functor `(J ⥤ ShortComplex C) ⥤ ShortComplex (J ⥤ C)`. -/
@[simps]
def inverse : (J ⥤ ShortComplex C) ⥤ ShortComplex (J ⥤ C)

(F : CategoryTheory.Functor J (CategoryTheory.ShortComplex C))

((CategoryTheory.ShortComplex.FunctorEquivalence.inverse J C).obj F).f =
  CategoryTheory.whiskerLeft F CategoryTheory.ShortComplex.π₁Toπ₂


private theorem succ_mod_two : succ x % 2 = 1 - x % 2


/-- **Cauchy integral formula**: if `f : ℂ → E` is complex differentiable on an open disc and is
continuous on its closure, then for any `w` in this open ball we have
$\frac{1}{2πi}\oint_{|z-c|=R}(z-w)^{-1}f(z)\,dz=f(w)$. -/
theorem _root_.DiffContOnCl.two_pi_i_inv_smul_circleIntegral_sub_inv_smul {R : ℝ} {c w : ℂ}
    {f : ℂ → E} (hf : DiffContOnCl ℂ f (ball c R)) (hw : w ∈ ball c R) :
    ((2 * π * I : ℂ)⁻¹ • ∮ z in C(c, R), (z - w)⁻¹ • f z) = f w

(hf : DiffContOnCl ℂ f (Metric.ball c R))

((2 * ↑π * Complex.I)⁻¹ • ∮ (z : ℂ) in C(c, R), (z - w)⁻¹ • f z) = f w


@[reassoc (attr := simp)]
theorem prod.map_fst {W X Y Z : C} [HasBinaryProduct W X] [HasBinaryProduct Y Z] (f : W ⟶ Y)
    (g : X ⟶ Z) : prod.map f g ≫ prod.fst = prod.fst ≫ f

CategoryTheory.Limits.prod.map f g ≫ CategoryTheory.Limits.prod.fst = CategoryTheory.Limits.prod.fst ≫ f


theorem isUniformOfEmpty (hP : P.parts = ∅) : P.IsUniform G ε

{α : Type u_1}
{𝕜 : Type u_2}
[LinearOrderedField 𝕜]
[DecidableEq α]
{A : Finset α}
{P : Finpartition A}
{G : SimpleGraph α}
[DecidableRel G.Adj]
{ε : 𝕜}
(hP : P.parts = ∅)


{R : Type u_3}
[CommRing R]
(r : R)
(a : ℍ[R])


@[simp]
theorem trans_one {α : Sort*} {β : Type*} (e : α ≃ β) : e.trans (1 : Perm β) = e

{α : Sort u_1}
{β : Type u_2}
(e : α ≃ β)


theorem lt_pred_iff {j : Fin n} {i : Fin (n + 1)} (hi : i ≠ 0) : j < pred i hi ↔ succ j < i


theorem or_rotate : a ∨ b ∨ c ↔ b ∨ c ∨ a


theorem closedBall_disjoint_closedBall (h : δ + ε < dist x y) :
    Disjoint (closedBall x δ) (closedBall y ε)

{α : Type u}
[PseudoMetricSpace α]
{x y : α}
{δ ε : ℝ}
(h : δ + ε < dist x y)

Disjoint (Metric.closedBall x δ) (Metric.closedBall y ε)


theorem nhds_basis_ball_inv_nat_pos :
    (𝓝 x).HasBasis (fun n => 0 < n) fun n : ℕ => ball x (1 / ↑n)

{α : Type u}
[PseudoMetricSpace α]
{x : α}

(𝓝 x).HasBasis (fun n => 0 < n) fun n => Metric.ball x (1 / ↑n)


@[simp]
theorem pi_insert [∀ a, DecidableEq (β a)] {s : Finset α} {t : ∀ a : α, Finset (β a)} {a : α}
    (ha : a ∉ s) : pi (insert a s) t = (t a).biUnion fun b => (pi s t).image (Pi.cons s a b)

{α : Type u_1}
{β : α → Type u}
[DecidableEq α]
[(a : α) → DecidableEq (β a)]
{s : Finset α}
{t : (a : α) → Finset (β a)}
{a : α}
(ha : a ∉ s)

(insert a s).pi t = (t a).biUnion fun b => Finset.image (Finset.Pi.cons s a b) (s.pi t)


lemma odd_pow' {n : ℕ} (h : n ≠ 0) : Odd (m ^ n) ↔ Odd m


theorem isUnit_det_of_left_inverse (h : B * A = 1) : IsUnit A.det

{n : Type u'}
{α : Type v}
[Fintype n]
[DecidableEq n]
[CommRing α]
{A B : Matrix n n α}
(h : B * A = 1)


lemma IsPointwiseLeftKanExtension.hasPointwiseLeftKanExtension :
    HasPointwiseLeftKanExtension L F

{C : Type u_1}
{D : Type u_2}
{H : Type u_3}
[CategoryTheory.Category.{u_4, u_1} C]
[CategoryTheory.Category.{u_5, u_2} D]
[CategoryTheory.Category.{u_6, u_3} H]
{L : CategoryTheory.Functor C D}
{F : CategoryTheory.Functor C H}
{E : L.LeftExtension F}
(h : E.IsPointwiseLeftKanExtension)


theorem withDensity_add_right (f : α → ℝ≥0∞) {g : α → ℝ≥0∞} (hg : Measurable g) :
    μ.withDensity (f + g) = μ.withDensity f + μ.withDensity g

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


theorem essInf_mono_ae {f g : α → β} (hfg : f ≤ᵐ[μ] g) : essInf f μ ≤ essInf g μ

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[CompleteLattice β]
{f g : α → β}
(hfg : f ≤ᵐ[μ] g)


@[simp]
lemma rightDerivedNatTrans_id :
    rightDerivedNatTrans RF RF α α W (𝟙 F) = 𝟙 RF

{C : Type u_5}
{D : Type u_1}
{H : Type u_3}
[CategoryTheory.Category.{u_6, u_5} C]
[CategoryTheory.Category.{u_4, u_1} D]
[CategoryTheory.Category.{u_2, u_3} H]
(RF : CategoryTheory.Functor D H)
{F : CategoryTheory.Functor C H}
{L : CategoryTheory.Functor C D}
(α : F ⟶ L.comp RF)
(W : CategoryTheory.MorphismProperty C)
[L.IsLocalization W]
[RF.IsRightDerivedFunctor α W]

RF.rightDerivedNatTrans RF α α W (CategoryTheory.CategoryStruct.id F) = CategoryTheory.CategoryStruct.id RF


@[simp]
theorem mem_equalizer (x : A) : x ∈ StarAlgHom.equalizer f g ↔ f x = g x

{F : Type u_1}
{R : Type u_2}
{A : Type u_3}
{B : Type u_4}
[CommSemiring R]
[StarRing R]
[Semiring A]
[Algebra R A]
[StarRing A]
[StarModule R A]
[Semiring B]
[Algebra R B]
[StarRing B]
[FunLike F A B]
[AlgHomClass F R A B]
[StarAlgHomClass F R A B]
(f g : F)
(x : A)


theorem directed_ptsOfPeriod_pNat (f : α → α) : Directed (· ⊆ ·) fun n : ℕ+ => ptsOfPeriod f n

Directed (fun x x_1 => x ⊆ x_1) fun n => Function.ptsOfPeriod f ↑n


theorem exists_covby_infinite_Ici_of_infinite_Ici [IsStronglyAtomic α]
    (ha : (Set.Ici a).Infinite) (hfin : {x | a ⋖ x}.Finite) :
    ∃ b, a ⋖ b ∧ (Set.Ici b).Infinite

{α : Type u_1}
[PartialOrder α]
{a : α}
[IsStronglyAtomic α]
(ha : (Set.Ici a).Infinite)
(hfin : {x | a ⋖ x}.Finite)


/-- The subgroup generated by a set includes the set. -/
@[to_additive (attr := simp, aesop safe 20 apply (rule_sets := [SetLike]))
  "The `AddSubgroup` generated by a set includes the set."]
theorem subset_closure : k ⊆ closure k


@[norm_cast, simp]
theorem coe_mul : ((x * y : R) : ℍ[R,c₁,c₂]) = x * y

{R : Type u_3}
[CommRing R]
{c₁ c₂ : R}
(x y : R)


/-- A union of a nonempty chain of ideals of sets is an ideal. -/
lemma isIdeal_sUnion_of_isChain {C : Set (Set P)} (hidl : ∀ I ∈ C, IsIdeal I)
    (hC : IsChain (· ⊆ ·) C) (hNe : C.Nonempty) : IsIdeal C.sUnion

{P : Type u_1}
[Preorder P]
{C : Set (Set P)}
(hidl : ∀ I ∈ C, Order.IsIdeal I)
(hC : IsChain (fun x x_1 => x ⊆ x_1) C)
(hNe : C.Nonempty)


theorem Nat.le_succ (n : Nat) : LE.le n (succ n)


theorem HasDerivAt.sin (hf : HasDerivAt f f' x) :
    HasDerivAt (fun x => Real.sin (f x)) (Real.cos (f x) * f') x

{f : ℝ → ℝ}
{f' x : ℝ}
(hf : HasDerivAt f f' x)


/-- Promote `AdjoinRoot.quotAdjoinRootEquivQuotPolynomialQuot` to an alg_equiv.  -/
@[simps!]
noncomputable def quotEquivQuotMap (f : R[X]) (I : Ideal R) :
    (AdjoinRoot f ⧸ Ideal.map (of f) I) ≃ₐ[R]
      (R ⧸ I)[X] ⧸ Ideal.span ({Polynomial.map (Ideal.Quotient.mk I) f} : Set (R ⧸ I)[X])

(a : AdjoinRoot f ⧸ Ideal.map (AdjoinRoot.of f) I)

(AdjoinRoot.quotEquivQuotMap f I) a = (AdjoinRoot.quotAdjoinRootEquivQuotPolynomialQuot I f) a


/-- Auxiliary lemma proving that the composition of `C^n` functions on domains is `C^n` when all
spaces live in the same universe. Use instead `ContDiffOn.comp` which removes the universe
assumption (but is deduced from this one). -/
private theorem ContDiffOn.comp_same_univ {Eu : Type u} [NormedAddCommGroup Eu] [NormedSpace 𝕜 Eu]
    {Fu : Type u} [NormedAddCommGroup Fu] [NormedSpace 𝕜 Fu] {Gu : Type u} [NormedAddCommGroup Gu]
    [NormedSpace 𝕜 Gu] {s : Set Eu} {t : Set Fu} {g : Fu → Gu} {f : Eu → Fu}
    (hg : ContDiffOn 𝕜 n g t) (hf : ContDiffOn 𝕜 n f s) (st : s ⊆ f ⁻¹' t) :
    ContDiffOn 𝕜 n (g ∘ f) s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{n : ℕ∞}
{Eu : Type u}
[NormedAddCommGroup Eu]
[NormedSpace 𝕜 Eu]
{Fu : Type u}
[NormedAddCommGroup Fu]
[NormedSpace 𝕜 Fu]
{Gu : Type u}
[NormedAddCommGroup Gu]
[NormedSpace 𝕜 Gu]
{s : Set Eu}
{t : Set Fu}
{g : Fu → Gu}
{f : Eu → Fu}
(hg : ContDiffOn 𝕜 n g t)
(hf : ContDiffOn 𝕜 n f s)
(st : s ⊆ f ⁻¹' t)


@[simp]
theorem val_eq_coe (s : Sym α n) : s.1 = ↑s


theorem exists_lt_nsmul [OrderedAddCommMonoid M] [Archimedean M]
    [CovariantClass M M (· + ·) (· < ·)] {a : M} (ha : 0 < a) (b : M) :
    ∃ n : ℕ, b < n • a

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


theorem ordConnected_biInter {ι : Sort*} {p : ι → Prop} {s : ∀ i, p i → Set α}
    (hs : ∀ i hi, OrdConnected (s i hi)) : OrdConnected (⋂ (i) (hi), s i hi)

(hs : ∀ (i : ι) (hi : p i), (s i hi).OrdConnected)

(⋂ i, ⋂ (hi : p i), s i hi).OrdConnected


theorem image_uIcc (h : ContinuousOn f <| [[a, b]]) :
    f '' [[a, b]] = [[sInf (f '' [[a, b]]), sSup (f '' [[a, b]])]]

{α : Type u_2}
{β : Type u_3}
[ConditionallyCompleteLinearOrder α]
[TopologicalSpace α]
[OrderTopology α]
[TopologicalSpace β]
[DenselyOrdered α]
[ConditionallyCompleteLinearOrder β]
[OrderTopology β]
{f : α → β}
{a b : α}
(h : ContinuousOn f (Set.uIcc a b))

f '' Set.uIcc a b = Set.uIcc (sInf (f '' Set.uIcc a b)) (sSup (f '' Set.uIcc a b))


@[simp]
theorem coe_toCLM (φ : characterSpace 𝕜 A) : ⇑(toCLM φ) = φ

{𝕜 : Type u_1}
{A : Type u_2}
[CommSemiring 𝕜]
[TopologicalSpace 𝕜]
[ContinuousAdd 𝕜]
[ContinuousConstSMul 𝕜 𝕜]
[NonUnitalNonAssocSemiring A]
[TopologicalSpace A]
[Module 𝕜 A]
(φ : ↑(WeakDual.characterSpace 𝕜 A))


theorem JoinedIn.target_mem (h : JoinedIn F x y) : y ∈ F

{X : Type u_1}
[TopologicalSpace X]
{x y : X}
{F : Set X}
(h : JoinedIn F x y)


@[to_additive]
theorem RightCancelMonoid.toMonoid_injective {M : Type u} :
    Function.Injective (@RightCancelMonoid.toMonoid M)


/-- In a group with zero, the center of the units is the preimage of the center. -/
lemma center_units_eq : center G₀ˣ = ((↑) : G₀ˣ → G₀) ⁻¹' center G₀

Set.center G₀ˣ = Units.val ⁻¹' Set.center G₀


theorem Int.coprime_of_sq_sum' {r s : ℤ} (h : IsCoprime r s) :
    IsCoprime (r ^ 2 + s ^ 2) (r * s)


@[simp]
theorem one_toProd : (1 : 𝓜(𝕜, A)).toProd = 1

{𝕜 : Type u_1}
{A : Type u_2}
[NontriviallyNormedField 𝕜]
[NonUnitalNormedRing A]
[NormedSpace 𝕜 A]
[SMulCommClass 𝕜 A A]
[IsScalarTower 𝕜 A A]


@[to_additive]
theorem pow_eq_prod_const (b : β) : ∀ n, b ^ n = ∏ _k ∈ range n, b

{β : Type u_4}
[AddCommMonoid β]
(b : β)
(n : ℕ)


@[simp]
theorem map_iterate (f : α → α) (g : β → β) (n : ℕ) :
    (Prod.map f g)^[n] = Prod.map f^[n] g^[n]

{α : Type u_1}
{β : Type u_2}
(f : α → α)
(g : β → β)
(n : ℕ)


@[simp]
theorem mapBilinear_apply (f : M →ₗ[A] P) (g : N →ₗ[R] Q) :
    mapBilinear R A B M N P Q f g = map f g

{R : Type uR}
{A : Type uA}
{B : Type uB}
{M : Type uM}
{N : Type uN}
{P : Type uP}
{Q : Type uQ}
[CommSemiring R]
[Semiring A]
[Semiring B]
[Algebra R A]
[Algebra R B]
[AddCommMonoid M]
[Module R M]
[Module A M]
[IsScalarTower R A M]
[AddCommMonoid N]
[Module R N]
[AddCommMonoid P]
[Module R P]
[Module A P]
[Module B P]
[IsScalarTower R A P]
[IsScalarTower R B P]
[SMulCommClass A B P]
[AddCommMonoid Q]
[Module R Q]
(f : M →ₗ[A] P)
(g : N →ₗ[R] Q)

((TensorProduct.AlgebraTensorModule.mapBilinear R A B M N P Q) f) g = TensorProduct.AlgebraTensorModule.map f g


theorem contDiffOn_extend_coord_change [ChartedSpace H M] (hf : f ∈ maximalAtlas I M)
    (hf' : f' ∈ maximalAtlas I M) :
    ContDiffOn 𝕜 ⊤ (f.extend I ∘ (f'.extend I).symm) ((f'.extend I).symm ≫ f.extend I).source

(hf : f ∈ SmoothManifoldWithCorners.maximalAtlas I M)

(hf' : f' ∈ SmoothManifoldWithCorners.maximalAtlas I M)

ContDiffOn 𝕜 ⊤ (↑(f.extend I) ∘ ↑(f'.extend I).symm) ((f'.extend I).symm ≫ f.extend I).source


protected theorem eq_of_mul_eq_mul_left {a b c : Int} (ha : a ≠ 0) (h : a * b = a * c) : b = c


theorem of_uncurry_right [TopologicalSpace β] {_ : MeasurableSpace α} {_ : MeasurableSpace γ}
    {f : α → γ → β} (hf : StronglyMeasurable (uncurry f)) {y : γ} :
    StronglyMeasurable fun x => f x y

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

∀ {x : MeasurableSpace α} {x_1 : MeasurableSpace γ} {f : α → γ → β},
  MeasureTheory.StronglyMeasurable (Function.uncurry f) → ∀ {y : γ}, MeasureTheory.StronglyMeasurable fun x => f x y


theorem IsEquivalent.isTheta (h : u ~[l] v) : u =Θ[l] v

{α : Type u_1}
{β : Type u_2}
[NormedAddCommGroup β]
{u v : α → β}
{l : Filter α}
(h : u ~[l] v)


@[to_additive (attr := simp)]
theorem coe_bot : ((⊥ : Subgroup G) : Set G) = {1}


@[simp]
theorem disjoint_add_left {s t u : Multiset α} :
    Disjoint (s + t) u ↔ Disjoint s u ∧ Disjoint t u

(s + t).Disjoint u ↔ s.Disjoint u ∧ t.Disjoint u


@[simp]
theorem coe_toAddSubmonoid (s : NonUnitalSubsemiring R) : (s.toAddSubmonoid : Set R) = s

{R : Type u}
[NonUnitalNonAssocSemiring R]
(s : NonUnitalSubsemiring R)


/-- If the square below commutes, the bottom map is uniquely specified:
```
R  →  S
↓     ↓
Rₘ → Sₘ
```
-/
theorem IsLocalization.algebraMap_eq_map_map_submonoid :
    algebraMap Rₘ Sₘ =
      map Sₘ (algebraMap R S)
        (show _ ≤ (Algebra.algebraMapSubmonoid S M).comap _ from M.le_comap_map)

[i : IsLocalization (Algebra.algebraMapSubmonoid S M) Sₘ]

algebraMap Rₘ Sₘ = IsLocalization.map Sₘ (algebraMap R S) ⋯


theorem normalize_mul_normalize (n₁ n₂) {d₁ d₂} (z₁ z₂) :
    normalize n₁ d₁ z₁ * normalize n₂ d₂ z₂ =
    normalize (n₁ * n₂) (d₁ * d₂) (Nat.mul_ne_zero z₁ z₂)

(n₁ n₂ : Int)
{d₁ d₂ : Nat}
(z₁ : d₁ ≠ 0)
(z₂ : d₂ ≠ 0)

Rat.normalize n₁ d₁ z₁ * Rat.normalize n₂ d₂ z₂ = Rat.normalize (n₁ * n₂) (d₁ * d₂) ⋯


theorem coinduced_continuous {α β : Type*} [t : TopologicalSpace α] [Ring β] (f : α → β) :
    Continuous[t, (coinduced f).toTopologicalSpace] f

{α : Type u_2}
{β : Type u_3}
[t : TopologicalSpace α]
[Ring β]
(f : α → β)


theorem mem_nhds_zero {s : Set R} : s ∈ 𝓝 (0 : R) ↔ ∃ γ : Γ₀ˣ, { x | v x < (γ : Γ₀) } ⊆ s

{R : Type u}
[Ring R]
{Γ₀ : Type v}
[LinearOrderedCommGroupWithZero Γ₀]
[_i : Valued R Γ₀]
{s : Set R}

s ∈ 𝓝 0 ↔ ∃ γ, {x | Valued.v x < ↑γ} ⊆ s


theorem subset_pointwise_smul_iff {a : M} {S T : Ideal R} : S ≤ a • T ↔ a⁻¹ • S ≤ T

{M : Type u_1}
{R : Type u_2}
[Group M]
[CommRing R]
[MulSemiringAction M R]
{a : M}
{S T : Ideal R}

S ≤ a • T ↔ a⁻¹ • S ≤ T


theorem initial.subsingleton_to {A : C} : Subsingleton (A ⟶ ⊥_ C)


@[simp]
theorem testBit_two_pow_self (n : ℕ) : testBit (2 ^ n) n = true


theorem isInt_lcm : {x y nx ny : ℤ} → {z : ℕ} →
    IsInt x nx → IsInt y ny → Int.lcm nx ny = z → IsNat (Int.lcm x y) z

Mathlib.Meta.NormNum.IsInt x nx →
  Mathlib.Meta.NormNum.IsInt y ny → nx.lcm ny = z → Mathlib.Meta.NormNum.IsNat (x.lcm y) z


theorem arg_neg_eq_arg_sub_pi_iff {x : ℂ} :
    arg (-x) = arg x - π ↔ 0 < x.im ∨ x.im = 0 ∧ x.re < 0

(-x).arg = x.arg - π ↔ 0 < x.im ∨ x.im = 0 ∧ x.re < 0


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

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

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


theorem toMeasure_injective : Function.Injective ((↑) : ProbabilityMeasure Ω → Measure Ω)


@[reassoc (attr := simp)]
lemma ιMapObj_iso_inv (i : I) (hi : p i = j) :
    X.ιMapObj p i j hi ≫ (c.iso hc).inv = c.inj ⟨i, hi⟩

(hc : CategoryTheory.Limits.IsColimit c)

CategoryTheory.CategoryStruct.comp (X.ιMapObj p i j hi) (CategoryTheory.GradedObject.CofanMapObjFun.iso hc).inv =
  CategoryTheory.Limits.Cofan.inj c ⟨i, hi⟩


theorem comp_ring_hom_ext {X : LocallyRingedSpace.{u}} {R : CommRingCat.{u}} {f : R ⟶ Γ.obj (op X)}
    {β : X ⟶ Spec.locallyRingedSpaceObj R}
    (w : X.toΓSpec.1.base ≫ (Spec.locallyRingedSpaceMap f).1.base = β.1.base)
    (h :
      ∀ r : R,
        f ≫ X.presheaf.map (homOfLE le_top : (Opens.map β.1.base).obj (basicOpen r) ⟶ _).op =
          toOpen R (basicOpen r) ≫ β.1.c.app (op (basicOpen r))) :
    X.toΓSpec ≫ Spec.locallyRingedSpaceMap f = β

{f : R ⟶ AlgebraicGeometry.LocallyRingedSpace.Γ.obj (Opposite.op X)}

{β : X ⟶ AlgebraicGeometry.Spec.locallyRingedSpaceObj R}

(w :
  CategoryTheory.CategoryStruct.comp X.toΓSpec.val.base (AlgebraicGeometry.Spec.locallyRingedSpaceMap f).val.base =
    β.val.base)

(h :
  ∀ (r : ↑R),
    CategoryTheory.CategoryStruct.comp f (X.presheaf.map (CategoryTheory.homOfLE ⋯).op) =
      CategoryTheory.CategoryStruct.comp (AlgebraicGeometry.StructureSheaf.toOpen (↑R) (PrimeSpectrum.basicOpen r))
        (β.val.c.app (Opposite.op (PrimeSpectrum.basicOpen r))))

CategoryTheory.CategoryStruct.comp X.toΓSpec (AlgebraicGeometry.Spec.locallyRingedSpaceMap f) = β


theorem right_le_or : ∀ x y : Bool, y ≤ (x || y)


@[simp]
theorem head_think (s : WSeq α) : head (think s) = (head s).think


lemma le_comap_range_lTensor (q : Q) :
    LinearMap.range g ≤ (LinearMap.range (lTensor Q g)).comap (TensorProduct.mk R Q P q)

{R : Type u_1}
[CommSemiring R]
{N : Type u_3}
{P : Type u_4}
{Q : Type u_5}
[AddCommMonoid N]
[AddCommMonoid P]
[AddCommMonoid Q]
[Module R N]
[Module R P]
[Module R Q]
(g : N →ₗ[R] P)
(q : Q)

LinearMap.range g ≤ Submodule.comap ((TensorProduct.mk R Q P) q) (LinearMap.range (LinearMap.lTensor Q g))


theorem of_epi_eq_zero {X Y : C} (f : X ⟶ Y) [Epi f] (h : f = 0) : IsZero Y


/-- If each partial application of `f` is injective, and images of `t` under those partial
applications are disjoint (but not necessarily distinct!), then the size of `s` divides the size of
`finset.image₂ f s t`. -/
theorem card_dvd_card_image₂_left (hf : ∀ b ∈ t, Injective fun a => f a b)
    (ht : ((fun b => s.image fun a => f a b) '' t).PairwiseDisjoint id) :
    s.card ∣ (image₂ f s t).card

{f : α → β → γ}

(hf : ∀ b ∈ t, Function.Injective fun a => f a b)

(ht : ((fun b => Finset.image (fun a => f a b) s) '' ↑t).PairwiseDisjoint id)


theorem differentiableWithinAt_inv (x_ne_zero : x ≠ 0) :
    DifferentiableWithinAt 𝕜 (fun x => x⁻¹) s x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{x : 𝕜}
{s : Set 𝕜}
(x_ne_zero : x ≠ 0)


@[simp]
theorem preimage_const_sub_Ioo : (fun x => a - x) ⁻¹' Ioo b c = Ioo (a - c) (a - b)

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

(fun x => a - x) ⁻¹' Set.Ioo b c = Set.Ioo (a - c) (a - b)


theorem mulMap_one_left_eq : mulMap 1 N = N.subtype ∘ₗ N.lTensorOne.toLinearMap

{R : Type u}
{S : Type v}
[CommSemiring R]
[Semiring S]
[Algebra R S]
(N : Submodule R S)

Submodule.mulMap 1 N = N.subtype ∘ₗ ↑N.lTensorOne


theorem centralizer_le (s t : Set R) (h : s ⊆ t) : centralizer t ≤ centralizer s

{R : Type u}
[Ring R]
(s t : Set R)
(h : s ⊆ t)

Subring.centralizer t ≤ Subring.centralizer s


protected theorem coe_ne_coe_iff {x y : ℝ} : (x : EReal) ≠ (y : EReal) ↔ x ≠ y

↑x ≠ ↑y ↔ x ≠ y


theorem comap_comap (A : ValuationSubring J) (g : L →+* J) (f : K →+* L) :
    (A.comap g).comap f = A.comap (g.comp f)

{K : Type u}
[Field K]
{L : Type u_1}
{J : Type u_2}
[Field L]
[Field J]
(A : ValuationSubring J)
(g : L →+* J)
(f : K →+* L)


theorem liminf_finset_inf' [ConditionallyCompleteLinearOrder β] {f : Filter α}
    {F : ι → α → β} {s : Finset ι} (hs : s.Nonempty)
    (h₁ : ∀ i ∈ s, f.IsCoboundedUnder (· ≥ ·) (F i) := by exact fun _ _ ↦ by isBoundedDefault)
    (h₂ : ∀ i ∈ s, f.IsBoundedUnder (· ≥ ·) (F i) := by exact fun _ _ ↦ by isBoundedDefault) :
    liminf (fun a ↦ inf' s hs (fun i ↦ F i a)) f = inf' s hs (fun i ↦ liminf (F i) f)

{F : ι → α → β}

(h₁ : ∀ i ∈ s, Filter.IsCoboundedUnder (fun x x_1 => x ≥ x_1) f (F i) := by exact fun _ _ ↦ by isBoundedDefault)

(h₂ : ∀ i ∈ s, Filter.IsBoundedUnder (fun x x_1 => x ≥ x_1) f (F i) := by exact fun _ _ ↦ by isBoundedDefault)

Filter.liminf (fun a => s.inf' hs fun i => F i a) f = s.inf' hs fun i => Filter.liminf (F i) f


theorem toTrivialization_apply {x : E} {I : Type*} [TopologicalSpace I]
    (h : IsEvenlyCovered f (f x) I) : (h.toTrivialization x).2 = ⟨x, rfl⟩

{E : Type u_1}
{X : Type u_2}
[TopologicalSpace E]
[TopologicalSpace X]
{f : E → X}
{x : E}
{I : Type u_3}
[TopologicalSpace I]
(h : IsEvenlyCovered f (f x) I)


theorem continuousAt_rpow (p : ℝ × ℝ) (h : p.1 ≠ 0 ∨ 0 < p.2) :
    ContinuousAt (fun p : ℝ × ℝ => p.1 ^ p.2) p


/-- This statement is meant to be combined with `le_or_lt_of_add_le_add` and similar lemmas. -/
@[to_additive AddETransform.card "This statement is meant to be combined with
`le_or_lt_of_add_le_add` and similar lemmas."]
protected theorem MulETransform.card :
    (mulETransformLeft e x).1.card + (mulETransformLeft e x).2.card +
        ((mulETransformRight e x).1.card + (mulETransformRight e x).2.card) =
      x.1.card + x.2.card + (x.1.card + x.2.card)

{α : Type u_1}
[DecidableEq α]
[Group α]
(e : α)
(x : Finset α × Finset α)

(Finset.mulETransformLeft e x).1.card + (Finset.mulETransformLeft e x).2.card +
    ((Finset.mulETransformRight e x).1.card + (Finset.mulETransformRight e x).2.card) =
  x.1.card + x.2.card + (x.1.card + x.2.card)


theorem Ico_inter_Ico {a b c d : α} : Ico a b ∩ Ico c d = Ico (max a c) (min b d)

{α : Type u_2}
[LinearOrder α]
[LocallyFiniteOrder α]
{a b c d : α}

Finset.Ico a b ∩ Finset.Ico c d = Finset.Ico (max a c) (min b d)


@[to_additive (attr := measurability)]
theorem mul_const [Mul β] [ContinuousMul β] (hf : StronglyMeasurable f) (c : β) :
    StronglyMeasurable fun x => f x * c

(hf : MeasureTheory.StronglyMeasurable f)

MeasureTheory.StronglyMeasurable fun x => f x + c


/-- `Real.toNNReal` bundled as a continuous map for convenience. -/
@[simps (config := .asFn)]
noncomputable def _root_.ContinuousMap.realToNNReal : C(ℝ, ℝ≥0)


@[simp]
theorem lift_residue_apply {R S : Type*} [CommRing R] [LocalRing R] [Field S] (f : R →+* S)
    [IsLocalRingHom f] (x) : lift f (residue R x) = f x

{R : Type u_4}
{S : Type u_5}
[CommRing R]
[LocalRing R]
[Field S]
(f : R →+* S)
[IsLocalRingHom f]
(x : R)

(LocalRing.ResidueField.lift f) ((LocalRing.residue R) x) = f x


protected theorem map_mul (f₁ f₂ : M →ₗ[A] M) (g₁ g₂ : N →ₗ[R] N) :
    map (f₁ * f₂) (g₁ * g₂) = map f₁ g₁ * map f₂ g₂

{R : Type uR}
{A : Type uA}
{M : Type uM}
{N : Type uN}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[AddCommMonoid M]
[Module R M]
[Module A M]
[IsScalarTower R A M]
[AddCommMonoid N]
[Module R N]
(f₁ f₂ : M →ₗ[A] M)
(g₁ g₂ : N →ₗ[R] N)

TensorProduct.AlgebraTensorModule.map (f₁ * f₂) (g₁ * g₂) =
  TensorProduct.AlgebraTensorModule.map f₁ g₁ * TensorProduct.AlgebraTensorModule.map f₂ g₂


theorem smul_eq_C_mul (f : MvPowerSeries σ R) (a : R) : a • f = C σ R a * f

{σ : Type u_1}
{R : Type u_2}
[Semiring R]
(f : MvPowerSeries σ R)
(a : R)


/-- If `f : ι → Filter α` is directed, `ι` is not empty, and `∀ i, f i ≠ ⊥`, then `iInf f ≠ ⊥`.
See also `iInf_neBot_of_directed` for a version assuming `Nonempty α` instead of `Nonempty ι`. -/
theorem iInf_neBot_of_directed' {f : ι → Filter α} [Nonempty ι] (hd : Directed (· ≥ ·) f) :
    (∀ i, NeBot (f i)) → NeBot (iInf f)

(hd : Directed (fun x x_1 => x ≥ x_1) f)

(∀ (i : ι), (f i).NeBot) → (iInf f).NeBot


@[to_additive (attr := simp)] lemma mulEnergy_empty_left : Eₘ[∅, t] = 0

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


/-- Temporary lemma that we can tag with `gcongr` -/
@[gcongr]
theorem _root_.GCongr.Filter.comap_le_comap {F G : Filter β} (h : F ≤ G) :
    comap m F ≤ comap m G

{α : Type u}
{β : Type v}
{m : α → β}
{F G : Filter β}
(h : F ≤ G)


@[simp]
theorem coe_currySumEquiv_symm : ⇑(currySumEquiv R ι M₂ M' ι').symm = uncurrySum

{R : Type uR}
{ι : Type uι}
{M₂ : Type v₂}
{M' : Type v'}
[CommSemiring R]
[AddCommMonoid M']
[AddCommMonoid M₂]
[Module R M']
[Module R M₂]
{ι' : Type u_1}

⇑(MultilinearMap.currySumEquiv R ι M₂ M' ι').symm = MultilinearMap.uncurrySum


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

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

∀ {X Y : CategoryTheory.Square C} (φ : X ⟶ Y), (CategoryTheory.Square.toArrowArrowFunctor.map φ).right.left = φ.τ₂


@[aesop unsafe 5% (rule_sets := [Matroid])]
private theorem subset_ground_of_subset (hXY : X ⊆ Y) (hY : Y ⊆ M.E) : X ⊆ M.E

{α : Type u_1}
{M : Matroid α}
{X Y : Set α}
(hXY : X ⊆ Y)
(hY : Y ⊆ M.E)


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

(F : CategoryTheory.Functor C (CategoryTheory.Idempotents.Karoubi D))

(CategoryTheory.Idempotents.functorExtension₁ C D).obj F = CategoryTheory.Idempotents.FunctorExtension₁.obj F


/-- The functor `ShortComplex C ⥤ ShortComplex D` induced by a functor `C ⥤ D` which
preserves zero morphisms. -/
@[simps]
def _root_.CategoryTheory.Functor.mapShortComplex (F : C ⥤ D) [F.PreservesZeroMorphisms] :
    ShortComplex C ⥤ ShortComplex D

∀ {X Y : CategoryTheory.ShortComplex C} (φ : X ⟶ Y), (F.mapShortComplex.map φ).τ₂ = F.map φ.τ₂


theorem add_factorial_lt_factorial_add {i n : ℕ} (hi : 2 ≤ i) (hn : 1 ≤ n) :
    i + n ! < (i + n)!


theorem reflection_singleton_apply (u v : E) :
    reflection (𝕜 ∙ u) v = 2 • (⟪u, v⟫ / ((‖u‖ : 𝕜) ^ 2)) • u - v

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

(reflection (Submodule.span 𝕜 {u})) v = 2 • (⟪u, v⟫_𝕜 / ↑‖u‖ ^ 2) • u - v


@[simp 1100]
theorem normalize_lcm [NormalizedGCDMonoid α] (a b : α) : normalize (lcm a b) = lcm a b

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


lemma coyoneda_exact₁ {X : C} (f : X ⟶ T.obj₁⟦(1 : ℤ)⟧) (hf : f ≫ T.mor₁⟦1⟧' = 0) :
    ∃ (g : X ⟶ T.obj₃), f = g ≫ T.mor₃

[∀ (n : ℤ), (CategoryTheory.shiftFunctor C n).Additive]

(T : CategoryTheory.Pretriangulated.Triangle C)

(hT : T ∈ CategoryTheory.Pretriangulated.distinguishedTriangles)

(f : X ⟶ (CategoryTheory.shiftFunctor C 1).obj T.obj₁)

(hf : f ≫ (CategoryTheory.shiftFunctor C 1).map T.mor₁ = 0)


/-- A frame, aka complete Heyting algebra, is a complete lattice whose `⊓` distributes over `⨆`. -/
class Order.Frame (α : Type*) extends CompleteLattice α, HeytingAlgebra α where
  /-- `⊓` distributes over `⨆`. -/
  inf_sSup_le_iSup_inf (a : α) (s : Set α) : a ⊓ sSup s ≤ ⨆ b ∈ s, a ⊓ b

{α : Type u_1}
[self : Order.Frame α]
(a : α)
(s : Set α)


theorem exists_le_of_sum_le {s : Finset α} (hs : s.Nonempty) {f g : α → ℝ≥0∞}
    (Hle : ∑ i ∈ s, f i ≤ ∑ i ∈ s, g i) : ∃ i ∈ s, f i ≤ g i

{α : Type u_1}
{s : Finset α}
(hs : s.Nonempty)
{f g : α → ℝ≥0∞}
(Hle : ∑ i ∈ s, f i ≤ ∑ i ∈ s, g i)


theorem inr_injective [Zero R] : Function.Injective (inr : M → tsze R M)


/-- You can compute a product over an encodable type by multiplying over the natural numbers and
taking a supremum. -/
@[to_additive "You can compute a sum over an encodable type by summing over the natural numbers and
  taking a supremum. This is useful for outer measures."]
theorem tprod_iSup_decode₂ [CompleteLattice α] (m : α → M) (m0 : m ⊥ = 1) (s : β → α) :
    ∏' i : ℕ, m (⨆ b ∈ decode₂ β i, s b) = ∏' b : β, m (s b)

{M : Type u_1}
[AddCommMonoid M]
[TopologicalSpace M]
{α : Type u_3}
{β : Type u_4}
[Encodable β]
[CompleteLattice α]
(m : α → M)
(m0 : m ⊥ = 0)
(s : β → α)

∑' (i : ℕ), m (⨆ b ∈ Encodable.decode₂ β i, s b) = ∑' (b : β), m (s b)