/-- The Fréchet derivative of the Fourier transform of `f` is the Fourier transform of
    `fun v ↦ -2 * π * I ⟪v, ⬝⟫ f v`. -/
theorem hasFDerivAt_fourierIntegral
    (hf_int : Integrable f) (hvf_int : Integrable (fun v ↦ ‖v‖ * ‖f v‖)) (x : V) :
    HasFDerivAt (𝓕 f) (𝓕 (fourierSMulRight (innerSL ℝ) f) x) x

(hf_int : MeasureTheory.Integrable f MeasureTheory.volume)

(hvf_int : MeasureTheory.Integrable (fun v => ‖v‖ * ‖f v‖) MeasureTheory.volume)

HasFDerivAt (𝓕 f) (𝓕 (VectorFourier.fourierSMulRight (innerSL ℝ) f) x) x


@[measurability]
nonrec theorem AEMeasurable.min {f g : δ → α} {μ : Measure δ} (hf : AEMeasurable f μ)
    (hg : AEMeasurable g μ) : AEMeasurable (fun a => min (f a) (g a)) μ

{α : Type u_1}
{δ : Type u_4}
[TopologicalSpace α]
[MeasurableSpace α]
[OpensMeasurableSpace α]
[MeasurableSpace δ]
[LinearOrder α]
[OrderClosedTopology α]
[SecondCountableTopology α]
{f g : δ → α}
{μ : MeasureTheory.Measure δ}
(hf : AEMeasurable f μ)
(hg : AEMeasurable g μ)


/-- The substructure generated by a set includes the set. -/
@[simp]
theorem subset_closure : s ⊆ closure L s

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]
{s : Set M}

s ⊆ ↑((FirstOrder.Language.Substructure.closure L).toFun s)


@[simp, norm_cast]
theorem coe_pow (f : CauSeq β abv) (n : ℕ) : ⇑(f ^ n) = (f : ℕ → β) ^ n

{α : Type u_1}
{β : Type u_2}
[LinearOrderedField α]
[Ring β]
{abv : β → α}
[IsAbsoluteValue abv]
(f : CauSeq β abv)
(n : ℕ)


∀ {α : Type u_1} {α_1 : Type u_2} {f g : α → α_1}, List.map f = List.map g ↔ f = g


@[to_additive]
theorem prod_set' [CommGroup α] (v : Vector α n) (i : Fin n) (a : α) :
    (v.set i a).toList.prod = v.toList.prod * (v.get i)⁻¹ * a

{n : ℕ}
{α : Type u_1}
[CommGroup α]
(v : Mathlib.Vector α n)
(i : Fin n)
(a : α)


theorem Tape.map_mk₁ {Γ Γ'} [Inhabited Γ] [Inhabited Γ'] (f : PointedMap Γ Γ') (l : List Γ) :
    (Tape.mk₁ l).map f = Tape.mk₁ (l.map f)

{Γ : Type u_1}
{Γ' : Type u_2}
[Inhabited Γ]
[Inhabited Γ']
(f : Turing.PointedMap Γ Γ')
(l : List Γ)

Turing.Tape.map f (Turing.Tape.mk₁ l) = Turing.Tape.mk₁ (List.map f.f l)


/-- For a path `γ`, `γ.truncate` gives a "continuous family of paths", by which we
  mean the uncurried function which maps `(t₀, t₁, s)` to `γ.truncate t₀ t₁ s` is continuous. -/
@[continuity]
theorem truncate_continuous_family {a b : X} (γ : Path a b) :
    Continuous (fun x => γ.truncate x.1 x.2.1 x.2.2 : ℝ × ℝ × I → X)

{X : Type u_1}
[TopologicalSpace X]
{a b : X}
(γ : Path a b)

Continuous fun x => (γ.truncate x.1 x.2.1) x.2.2


@[simp]
theorem map_map : (p.map f).map f' = p.map (f'.comp f)

{V : Type u}
{V' : Type v}
{V'' : Type w}
{G : SimpleGraph V}
{G' : SimpleGraph V'}
{G'' : SimpleGraph V''}
(f : G →g G')
(f' : G' →g G'')
{u v : V}
(p : G.Walk u v)

SimpleGraph.Walk.map f' (SimpleGraph.Walk.map f p) = SimpleGraph.Walk.map (f'.comp f) p


theorem image_diff_preimage {f : α → β} {s : Set α} {t : Set β} :
    f '' (s \ f ⁻¹' t) = f '' s \ t

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


@[simp]
theorem card_lt_of_card_iUnion_lt {ι : Type u} {α : Type u} {t : ι → Set α} {c : Cardinal}
    (h : #(⋃ i, t i) < c) (i : ι) : #(t i) < c

{ι α : Type u}
{t : ι → Set α}
{c : Cardinal.{u}}
(h : #↑(⋃ i, t i) < c)
(i : ι)


theorem card_insert_le (a : α) (s : Finset α) : card (insert a s) ≤ s.card + 1

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


/-- Let `α` have minimal polynomial `f` over `R` and `I` be an ideal of `R`,
then `R[α] / (I) = (R[x] / (f)) / pS = (R/p)[x] / (f mod p)`. -/
@[simps!]
noncomputable def quotientEquivQuotientMinpolyMap (pb : PowerBasis R S) (I : Ideal R) :
    (S ⧸ I.map (algebraMap R S)) ≃ₐ[R]
      Polynomial (R ⧸ I) ⧸
        Ideal.span ({(minpoly R pb.gen).map (Ideal.Quotient.mk I)} : Set (Polynomial (R ⧸ I)))

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

∀ (a : (R ⧸ I)[X] ⧸ Ideal.span {Polynomial.map (Ideal.Quotient.mk I) (minpoly R pb.gen)}),
  (pb.quotientEquivQuotientMinpolyMap I).symm a =
    (↑↑(AlgEquiv.ofRingEquiv ⋯)).symm ((↑↑(AdjoinRoot.quotEquivQuotMap (minpoly R pb.gen) I)).symm a)


theorem snd_apply (κ : Kernel α (β × γ)) (a : α) : snd κ a = (κ a).map Prod.snd

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

κ.snd a = MeasureTheory.Measure.map Prod.snd (κ a)


@[simp, bv_toNat] theorem toNat_mul (x y : BitVec n) : (x * y).toNat = (x.toNat * y.toNat) % 2 ^ n

(x * y).toNat = x.toNat * y.toNat % 2 ^ n


/-- The space of constant maps is equivalent to the space of maps that are alternating with respect
to an empty family. -/
@[simps]
def constLinearEquivOfIsEmpty [IsEmpty ι] : N'' ≃ₗ[R'] (M'' [⋀^ι]→ₗ[R'] N'')

{ι : Type u_7}
{R' : Type u_10}
{M'' : Type u_11}
{N'' : Type u_13}
[CommSemiring R']
[AddCommMonoid M'']
[AddCommMonoid N'']
[Module R' M'']
[Module R' N'']
[IsEmpty ι]
(m : N'')

AlternatingMap.constLinearEquivOfIsEmpty m = AlternatingMap.constOfIsEmpty R' M'' ι m


lemma HasGoodTrifunctor₁₂Obj.hasMap :
    HasMap ((((mapTrifunctor (bifunctorComp₁₂ F₁₂ G) I₁ I₂ I₃).obj X₁).obj X₂).obj X₃) r

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

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

{ρ₁₂ : CategoryTheory.GradedObject.BifunctorComp₁₂IndexData r}

{X₁ : CategoryTheory.GradedObject I₁ C₁}

{X₂ : CategoryTheory.GradedObject I₂ C₂}

{X₃ : CategoryTheory.GradedObject I₃ C₃}

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

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

[H : CategoryTheory.GradedObject.HasGoodTrifunctor₁₂Obj F₁₂ G ρ₁₂ X₁ X₂ X₃]

((((CategoryTheory.GradedObject.mapTrifunctor (CategoryTheory.bifunctorComp₁₂ F₁₂ G) I₁ I₂ I₃).obj X₁).obj X₂).obj
      X₃).HasMap
  r


lemma asympBound_def {n : ℕ} : asympBound g a b n = n ^ p a b + sumTransform (p a b) g 0 n

{α : Type u_1}
[Fintype α]
(g : ℝ → ℝ)
(a b : α → ℝ)
{n : ℕ}

AkraBazziRecurrence.asympBound g a b n =
  ↑n ^ AkraBazziRecurrence.p a b + AkraBazziRecurrence.sumTransform (AkraBazziRecurrence.p a b) g 0 n


theorem mul_cpow_ofReal_nonneg {a b : ℝ} (ha : 0 ≤ a) (hb : 0 ≤ b) (r : ℂ) :
    ((a : ℂ) * (b : ℂ)) ^ r = (a : ℂ) ^ r * (b : ℂ) ^ r


theorem toNonAssocRing_injective :
    Function.Injective (@toNonAssocRing R)


theorem ContDiff.of_succ {n : ℕ} (h : ContDiff 𝕜 (n + 1) f) : ContDiff 𝕜 n f

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{n : ℕ}
(h : ContDiff 𝕜 (↑n + 1) f)


/-- If `φ : a ⟶ b` lifts `𝟙 T` and `ψ : b ⟶ c` lifts `f`, then `φ  ≫ ψ` lifts `f` -/
lemma comp_lift_id_left' {a b c : 𝒳} (R : 𝒮) (φ : a ⟶ b) [p.IsHomLift (𝟙 R) φ]
    {S T : 𝒮} (f : S ⟶ T) (ψ : b ⟶ c) [p.IsHomLift f ψ] : p.IsHomLift f (φ ≫ ψ)

{𝒮 : Type u₁}
{𝒳 : Type u₂}
[CategoryTheory.Category.{v₁, u₂} 𝒳]
[CategoryTheory.Category.{v₂, u₁} 𝒮]
(p : 𝒳 ⥤ 𝒮)
{a b c : 𝒳}
(R : 𝒮)
(φ : a ⟶ b)
[p.IsHomLift (𝟙 R) φ]
{S T : 𝒮}
(f : S ⟶ T)
(ψ : b ⟶ c)
[p.IsHomLift f ψ]


@[simp]
theorem isEmpty_psigma {α} {E : α → Sort*} : IsEmpty (PSigma E) ↔ ∀ a, IsEmpty (E a)

IsEmpty (PSigma E) ↔ ∀ (a : α), IsEmpty (E a)


theorem le_biUnionIndex (hJ : J ∈ π.biUnion πi) : J ≤ π.biUnionIndex πi J

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


@[simp]
theorem iterateFrobeniusEquiv_zero  : iterateFrobeniusEquiv R p 0 = RingEquiv.refl R

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


theorem snd_iSup [SupSet α] [SupSet β] (f : ι → α × β) : (iSup f).snd = ⨆ i, (f i).snd

{α : Type u_1}
{β : Type u_2}
{ι : Sort u_5}
[SupSet α]
[SupSet β]
(f : ι → α × β)


@[to_additive]
theorem prehaar_empty (K₀ : PositiveCompacts G) {U : Set G} : prehaar (K₀ : Set G) U ⊥ = 0

(K₀ : TopologicalSpace.PositiveCompacts G)

MeasureTheory.Measure.haar.addPrehaar (↑K₀) U ⊥ = 0


@[simp]
theorem diagram_left : D.diagram.left = D.V

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


theorem lt_of_lf {x y : PGame} (h : x ⧏ y) (ox : Numeric x) (oy : Numeric y) : x < y

{x y : SetTheory.PGame}
(h : x ⧏ y)
(ox : x.Numeric)
(oy : y.Numeric)


/-- The seminorm of an element in a product space is `< r` if and only if the norm of each
component is. -/
@[to_additive pi_norm_lt_iff "The seminorm of an element in a product space is `< r` if and only
if the norm of each component is."]
lemma pi_norm_lt_iff' (hr : 0 < r) : ‖x‖ < r ↔ ∀ i, ‖x i‖ < r

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


@[simp]
theorem AdditiveFunctor.ofRightExact_obj_fst (F : C ⥤ᵣ D) :
    ((AdditiveFunctor.ofRightExact C D).obj F).obj = F.obj

((CategoryTheory.AdditiveFunctor.ofRightExact C D).obj F).obj = F.obj


protected theorem eq [IsWellOrder β s] (f g : r ≼i s) (a) : f a = g a

{α : Type u_1}
{β : Type u_2}
{r : α → α → Prop}
{s : β → β → Prop}
[IsWellOrder β s]
(f g : r ≼i s)
(a : α)


theorem strictAnti_iff {f : WithBot α → β} :
    StrictAnti f ↔ StrictAnti (fun a ↦ f a : α → β) ∧ ∀ x : α, f x < f ⊥

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

StrictAnti f ↔ (StrictAnti fun a => f ↑a) ∧ ∀ (x : α), f ↑x < f ⊥


theorem add (hT : FinMeasAdditive μ T) (hT' : FinMeasAdditive μ T') :
    FinMeasAdditive μ (T + T')

(hT : MeasureTheory.FinMeasAdditive μ T)

(hT' : MeasureTheory.FinMeasAdditive μ T')

MeasureTheory.FinMeasAdditive μ (T + T')


theorem isHomogeneous_zero (n : ℕ) : IsHomogeneous (0 : MvPolynomial σ R) n

(σ : Type u_1)
(R : Type u_3)
[CommSemiring R]
(n : ℕ)


theorem cycleOf_mul_of_apply_right_eq_self [DecidableRel (f * g).SameCycle]
    (h : Commute f g) (x : α) (hx : g x = x) : (f * g).cycleOf x = f.cycleOf x

{α : Type u_2}
{f g : Equiv.Perm α}
[DecidableRel f.SameCycle]
[DecidableRel (f * g).SameCycle]
(h : Commute f g)
(x : α)
(hx : g x = x)


@[simp, reassoc]
lemma mapMap_comp : mapMap (φ ≫ ψ) p = mapMap φ p ≫ mapMap ψ p

{X Y Z : CategoryTheory.GradedObject I C}

CategoryTheory.GradedObject.mapMap (CategoryTheory.CategoryStruct.comp φ ψ) p =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.GradedObject.mapMap φ p) (CategoryTheory.GradedObject.mapMap ψ p)


lemma cpow_inv_two_re (x : ℂ) : (x ^ (2⁻¹ : ℂ)).re = sqrt ((abs x + x.re) / 2)

(x ^ 2⁻¹).re = √((Complex.abs x + x.re) / 2)


theorem isBigO_id {f : E → F} (h : IsBoundedLinearMap 𝕜 f) (l : Filter E) : f =O[l] fun x => x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
(h : IsBoundedLinearMap 𝕜 f)
(l : Filter E)


/-- A `LinearPMap` is contained in its closure. -/
theorem le_closure (f : E →ₗ.[R] F) : f ≤ f.closure

{R : Type u_1}
{E : Type u_2}
{F : Type u_3}
[CommRing R]
[AddCommGroup E]
[AddCommGroup F]
[Module R E]
[Module R F]
[TopologicalSpace E]
[TopologicalSpace F]
[ContinuousAdd E]
[ContinuousAdd F]
[TopologicalSpace R]
[ContinuousSMul R E]
[ContinuousSMul R F]
(f : E →ₗ.[R] F)


@[to_additive (attr := simp)]
theorem preimage_mul_left_one : (a * ·) ⁻¹' 1 = {a⁻¹}


/-- Compute the Mellin transform of the modifying term used to kill off the constants at
`0` and `∞`. -/
lemma f_modif_aux2 {s : ℂ} (hs : P.k < re s) :
    mellin (fun x ↦ P.f_modif x - P.f x + P.f₀) s = (1 / s) • P.f₀ + (P.ε  / (P.k - s)) • P.g₀

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
[CompleteSpace E]
(P : WeakFEPair E)
{s : ℂ}
(hs : P.k < s.re)

mellin (fun x => P.f_modif x - P.f x + P.f₀) s = (1 / s) • P.f₀ + (P.ε / (↑P.k - s)) • P.g₀


/-- Note: this lemma is specifically about `Fintype.ofSubsingleton`. For a statement about
arbitrary `Fintype` instances, use either `Fintype.card_le_one_iff_subsingleton` or
`Fintype.card_unique`. -/
@[simp]
theorem card_ofSubsingleton (a : α) [Subsingleton α] : @Fintype.card _ (ofSubsingleton a) = 1


theorem sInf_image2_eq_sSup_sInf (h₁ : ∀ b, GaloisConnection (toDual ∘ l₁ b) (swap u b ∘ ofDual))
    (h₂ : ∀ a, GaloisConnection (l₂ a) (u a)) : sInf (image2 u s t) = u (sSup s) (sInf t)

{u : α → β → γ}

{l₁ : β → γ → α}

{l₂ : α → γ → β}

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

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

sInf (Set.image2 u s t) = u (sSup s) (sInf t)


/-- `e.symm` is a right inverse of `e`, written as `e (e.symm y) = y`. -/
@[to_additive (attr := simp) "`e.symm` is a right inverse of `e`, written as `e (e.symm y) = y`."]
theorem apply_symm_apply (e : M ≃* N) (y : N) : e (e.symm y) = y

{M : Type u_6}
{N : Type u_7}
[Add M]
[Add N]
(e : M ≃+ N)
(y : N)


protected lemma eq_sub_of_add_eq (h : c + b = a) : c = a - b


theorem isInt_add {α} [Ring α] : ∀ {f : α → α → α} {a b : α} {a' b' c : ℤ},
    f = HAdd.hAdd → IsInt a a' → IsInt b b' → Int.add a' b' = c → IsInt (f a b) c

{α : Type u_1}
[Ring α]
{f : α → α → α}
{a b : α}
{a' b' c : ℤ}

f = HAdd.hAdd →
  Mathlib.Meta.NormNum.IsInt a a' →
    Mathlib.Meta.NormNum.IsInt b b' → a'.add b' = c → Mathlib.Meta.NormNum.IsInt (f a b) c


@[to_additive (attr := simp) add_mem_addCenter]
theorem mul_mem_center {z₁ z₂ : M} (hz₁ : z₁ ∈ Set.center M) (hz₂ : z₂ ∈ Set.center M) :
    z₁ * z₂ ∈ Set.center M

{M : Type u_1}
[Add M]
{z₁ z₂ : M}
(hz₁ : z₁ ∈ Set.addCenter M)
(hz₂ : z₂ ∈ Set.addCenter M)


theorem ContinuousLinearMap.exists_right_inverse_of_surjective [FiniteDimensional 𝕜 F]
    (f : E →L[𝕜] F) (hf : LinearMap.range f = ⊤) :
    ∃ g : F →L[𝕜] E, f.comp g = ContinuousLinearMap.id 𝕜 F

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[CompleteSpace 𝕜]
[AddCommGroup E]
[TopologicalSpace E]
[TopologicalAddGroup E]
[Module 𝕜 E]
[ContinuousSMul 𝕜 E]
[AddCommGroup F]
[TopologicalSpace F]
[T2Space F]
[TopologicalAddGroup F]
[Module 𝕜 F]
[ContinuousSMul 𝕜 F]
[FiniteDimensional 𝕜 F]
(f : E →L[𝕜] F)
(hf : LinearMap.range f = ⊤)

∃ g, f.comp g = ContinuousLinearMap.id 𝕜 F


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

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

∀ {X Y : J} (f : X ⟶ Y),
  ((CategoryTheory.ShortComplex.FunctorEquivalence.functor J C).obj S).map f =
    S.mapNatTrans ((CategoryTheory.evaluation J C).map f)


theorem smul_ofFunction {c : ℝ≥0∞} (hc : c ≠ ∞) : c • OuterMeasure.ofFunction m m_empty =
    OuterMeasure.ofFunction (c • m) (by simp [m_empty])

{α : Type u_1}
{m : Set α → ℝ≥0∞}
{m_empty : m ∅ = 0}
{c : ℝ≥0∞}
(hc : c ≠ ⊤)

c • MeasureTheory.OuterMeasure.ofFunction m m_empty = MeasureTheory.OuterMeasure.ofFunction (c • m) ⋯


theorem exists_root_of_splits' {f : K[X]} (hs : Splits i f) (hf0 : degree (f.map i) ≠ 0) :
    ∃ x, eval₂ i x f = 0

{K : Type v}
{L : Type w}
[CommRing K]
[Field L]
(i : K →+* L)
{f : K[X]}
(hs : Polynomial.Splits i f)
(hf0 : (Polynomial.map i f).degree ≠ 0)


theorem inseparable_iff_of_le_nhds {f g : CauchyFilter α} {a b : α}
    (ha : f.1 ≤ 𝓝 a) (hb : g.1 ≤ 𝓝 b) : Inseparable a b ↔ Inseparable f g

{α : Type u}
[UniformSpace α]
{f g : CauchyFilter α}
{a b : α}
(ha : ↑f ≤ 𝓝 a)
(hb : ↑g ≤ 𝓝 b)


@[to_additive]
theorem preimage_mul_right_one' : (· * b⁻¹) ⁻¹' 1 = {b}


/--
The presheaf sending each object to the set of `J`-closed sieves on it. This presheaf is a `J`-sheaf
(and will turn out to be a subobject classifier for the category of `J`-sheaves).
-/
@[simps]
def Functor.closedSieves : Cᵒᵖ ⥤ Type max v u

(J₁ : CategoryTheory.GrothendieckTopology C)

(CategoryTheory.Functor.closedSieves J₁).obj X = { S // J₁.IsClosed S }


theorem isOpenMap_sigma_map {f₁ : ι → κ} {f₂ : ∀ i, σ i → τ (f₁ i)} :
    IsOpenMap (Sigma.map f₁ f₂) ↔ ∀ i, IsOpenMap (f₂ i)

{ι : Type u_5}
{κ : Type u_6}
{σ : ι → Type u_7}
{τ : κ → Type u_8}
[(i : ι) → TopologicalSpace (σ i)]
[(k : κ) → TopologicalSpace (τ k)]
{f₁ : ι → κ}
{f₂ : (i : ι) → σ i → τ (f₁ i)}

IsOpenMap (Sigma.map f₁ f₂) ↔ ∀ (i : ι), IsOpenMap (f₂ i)


theorem top_of_top_mem (h : ⊤ ∈ I) : I = ⊤

{P : Type u_1}
[LE P]
[OrderTop P]
{I : Order.Ideal P}
(h : ⊤ ∈ I)


/-- Functor composition induces a functor on augmented cosimplicial objects. -/
@[simps]
def whiskering (D : Type u') [Category.{v'} D] : (C ⥤ D) ⥤ Augmented C ⥤ Augmented D

(C : Type u)
[CategoryTheory.Category.{v, u} C]
(D : Type u')
[CategoryTheory.Category.{v', u'} D]

∀ {X Y : C ⥤ D} (η : X ⟶ Y) (A : CategoryTheory.CosimplicialObject.Augmented C),
  (((CategoryTheory.CosimplicialObject.Augmented.whiskering C D).map η).app A).right =
    CategoryTheory.whiskerLeft (CategoryTheory.CosimplicialObject.Augmented.drop.obj A) η


theorem add_tensor {W X Y Z : C} (f g : W ⟶ X) (h : Y ⟶ Z) : (f + g) ⊗ h = f ⊗ h + g ⊗ h

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Preadditive C]
[CategoryTheory.MonoidalCategory C]
[CategoryTheory.MonoidalPreadditive C]
{W X Y Z : C}
(f g : W ⟶ X)
(h : Y ⟶ Z)

CategoryTheory.MonoidalCategory.tensorHom (f + g) h =
  CategoryTheory.MonoidalCategory.tensorHom f h + CategoryTheory.MonoidalCategory.tensorHom g h


/-- This gives that any category is equivalent to a disjoint union of connected categories. -/
@[simps! functor]
def decomposedEquiv : Decomposed J ≌ J

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

CategoryTheory.decomposedEquiv.functor = CategoryTheory.decomposedTo J


theorem add_right_neg_le_zero (x : PGame) : x + -x ≤ 0


lemma NNReal.nndist_eq (a b : ℝ≥0) : nndist a b = max (a - b) (b - a)


theorem measurableSet_filtrationOfSet' {s : ι → Set Ω} (hsm : ∀ n, MeasurableSet[m] (s n))
    (i : ι) : MeasurableSet[filtrationOfSet hsm i] (s i)

{Ω : Type u_1}
{ι : Type u_3}
{m : MeasurableSpace Ω}
[Preorder ι]
{s : ι → Set Ω}
(hsm : ∀ (n : ι), MeasurableSet (s n))
(i : ι)


lemma ZMod.natCast_smul_units (n : ℕ) (au : Additive ℤˣ) : (n : ZMod 2) • au = n • au


/-- The `del` function preserves the ordering invariants. -/
protected theorem Ordered.del : ∀ {t : RBNode α}, t.Ordered cmp → (del cut t).Ordered cmp

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

Batteries.RBNode.Ordered cmp t → Batteries.RBNode.Ordered cmp (Batteries.RBNode.del cut t)


@[simp]
theorem toLinearMap_comp (g : Q₂ →qᵢ Q₃) (f : Q₁ →qᵢ Q₂) :
    (g.comp f).toLinearMap = g.toLinearMap.comp f.toLinearMap

{R : Type u_2}
{M₁ : Type u_4}
{M₂ : Type u_5}
{M₃ : Type u_6}
{N : Type u_8}
[CommSemiring R]
[AddCommMonoid M₁]
[AddCommMonoid M₂]
[AddCommMonoid M₃]
[AddCommMonoid N]
[Module R M₁]
[Module R M₂]
[Module R M₃]
[Module R N]
{Q₁ : QuadraticMap R M₁ N}
{Q₂ : QuadraticMap R M₂ N}
{Q₃ : QuadraticMap R M₃ N}
(g : Q₂ →qᵢ Q₃)
(f : Q₁ →qᵢ Q₂)

(g.comp f).toLinearMap = g.toLinearMap ∘ₗ f.toLinearMap


@[simp, norm_cast]
theorem isLittleO_ofReal_left {f : α → ℝ} {g : α → E} : (f · : α → ℂ) =o[l] g ↔ f =o[l] g

{α : Type u_1}
{E : Type u_2}
[Norm E]
{l : Filter α}
{f : α → ℝ}
{g : α → E}


@[simp] theorem coprime_zero_right (n : Nat) : Coprime n 0 ↔ n = 1


@[simp]
theorem val_sum {α : Type*} (s : Finset α) (f : α → AdicCompletion I M) (n : ℕ) :
    (Finset.sum s f).val n = Finset.sum s (fun a ↦ (f a).val n)

{R : Type u_1}
[CommRing R]
{I : Ideal R}
{M : Type u_2}
[AddCommGroup M]
[Module R M]
{α : Type u_4}
(s : Finset α)
(f : α → AdicCompletion I M)
(n : ℕ)


theorem piTensorHomMapFun₂_smul (r : R) (φ : ⨂[R] i, s i →ₗ[R] t i →ₗ[R] t' i) :
    piTensorHomMapFun₂ (r • φ) = r • piTensorHomMapFun₂ φ

(φ : PiTensorProduct R fun i => s i →ₗ[R] t i →ₗ[R] t' i)

(r • φ).piTensorHomMapFun₂ = r • φ.piTensorHomMapFun₂


/-- A `Finset` for an empty type is empty. -/
theorem eq_empty_of_isEmpty [IsEmpty α] (s : Finset α) : s = ∅

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


theorem Antiperiodic.int_mul_sub_eq [Ring α] [Ring β] (h : Antiperiodic f c) (n : ℤ) :
    f (n * c - x) = (n.negOnePow : ℤ) * f (-x)

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


theorem insert_inter_distrib (s t : Finset α) (a : α) :
    insert a (s ∩ t) = insert a s ∩ insert a t

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


theorem iff_dvd_total : ValuationRing R ↔ IsTotal R (· ∣ ·)

{R : Type u_1}
[CommRing R]
[IsDomain R]

ValuationRing R ↔ IsTotal R fun x x_1 => x ∣ x_1


theorem zero_union_range_succ : {0} ∪ range succ = univ


@[simp]
theorem congr_symm_tmul (f : M ≃ₗ[R] P) (g : N ≃ₗ[R] Q) (p : P) (q : Q) :
    (congr f g).symm (p ⊗ₜ q) = f.symm p ⊗ₜ g.symm q

{R : Type u_1}
[CommSemiring R]
{M : Type u_4}
{N : Type u_5}
{P : Type u_6}
{Q : Type u_7}
[AddCommMonoid M]
[AddCommMonoid N]
[AddCommMonoid P]
[AddCommMonoid Q]
[Module R M]
[Module R N]
[Module R P]
[Module R Q]
(f : M ≃ₗ[R] P)
(g : N ≃ₗ[R] Q)
(p : P)
(q : Q)

(TensorProduct.congr f g).symm (p ⊗ₜ[R] q) = f.symm p ⊗ₜ[R] g.symm q


@[simp]
theorem transpose_ofNat [DecidableEq n] [AddMonoidWithOne α] (d : ℕ) [d.AtLeastTwo] :
    (no_index (OfNat.ofNat d) : Matrix n n α)ᵀ = OfNat.ofNat d

{n : Type u_3}
{α : Type v}
[DecidableEq n]
[AddMonoidWithOne α]
(d : ℕ)
[d.AtLeastTwo]


theorem HasDerivWithinAt.derivWithin (h : HasDerivWithinAt f f' s x)
    (hxs : UniqueDiffWithinAt 𝕜 s x) : derivWithin f s x = f'

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : 𝕜 → F}
{f' : F}
{x : 𝕜}
{s : Set 𝕜}
(h : HasDerivWithinAt f f' s x)
(hxs : UniqueDiffWithinAt 𝕜 s x)


theorem spanSingleton_inv_mul {x : K} (hx : x ≠ 0) :
    (spanSingleton R₁⁰ x)⁻¹ * spanSingleton R₁⁰ x = 1

(K : Type u_3)
[Field K]
{R₁ : Type u_4}
[CommRing R₁]
[IsDomain R₁]
[Algebra R₁ K]
[IsFractionRing R₁ K]
{x : K}
(hx : x ≠ 0)

(FractionalIdeal.spanSingleton R₁⁰ x)⁻¹ * FractionalIdeal.spanSingleton R₁⁰ x = 1


@[simp]
lemma map_id : map r (LinearMap.id : M →ₗ[R] M) = .id

{R : Type u_2}
[CommRing R]
(r : R)
(M : Type u_1)
[AddCommGroup M]
[Module R M]

(QuotSMulTop.map r) LinearMap.id = LinearMap.id


@[simp]
theorem indexOf_of_not_mem {l : List α} {a : α} : a ∉ l → indexOf a l = length l

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


@[simp]
theorem map₂Left_nil_right : map₂Left f as [] = as.map fun a => f a none

{α : Type u}
{β : Type v}
{γ : Type w}
(f : α → Option β → γ)
(as : List α)

List.map₂Left f as [] = List.map (fun a => f a none) as


theorem prodMap_comap_prod (f : M →ₗ[R] M₂) (g : M₃ →ₗ[R] M₄) (S : Submodule R M₂)
    (S' : Submodule R M₄) :
    (Submodule.prod S S').comap (LinearMap.prodMap f g) = (S.comap f).prod (S'.comap g)

{R : Type u}
{M : Type v}
{M₂ : Type w}
{M₃ : Type y}
{M₄ : Type z}
[Semiring R]
[AddCommMonoid M]
[AddCommMonoid M₂]
[AddCommMonoid M₃]
[AddCommMonoid M₄]
[Module R M]
[Module R M₂]
[Module R M₃]
[Module R M₄]
(f : M →ₗ[R] M₂)
(g : M₃ →ₗ[R] M₄)
(S : Submodule R M₂)
(S' : Submodule R M₄)

Submodule.comap (f.prodMap g) (S.prod S') = (Submodule.comap f S).prod (Submodule.comap g S')


@[simp]
theorem val_inclusion {S T : NonUnitalStarSubalgebra R A} (h : S ≤ T) (s : S) :
    (inclusion h s : A) = s

{R : Type u}
{A : Type v}
[CommSemiring R]
[StarRing R]
[NonUnitalSemiring A]
[StarRing A]
[Module R A]
[IsScalarTower R A A]
[SMulCommClass R A A]
[StarModule R A]
{S T : NonUnitalStarSubalgebra R A}
(h : S ≤ T)
(s : ↥S)

↑((NonUnitalStarSubalgebra.inclusion h) s) = ↑s


theorem card_Ioo_eq_card_Icc_sub_two (a b : α) : card (Ioo a b) = card (Icc a b) - 2

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

Multiset.card (Multiset.Ioo a b) = Multiset.card (Multiset.Icc a b) - 2


theorem term_ord_aux {i : I} (ho : ord I i < Ordinal.type ((·<·) : I → I → Prop)) :
    term I ho = i

(ho : Profinite.NobelingProof.ord I i < Ordinal.type fun x x_1 => x < x_1)


@[simp]
theorem map_id :
    map LinearMap.id = AlgHom.id R (ExteriorAlgebra R M)

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

ExteriorAlgebra.map LinearMap.id = AlgHom.id R (ExteriorAlgebra R M)


theorem le_iff {i₁ i₂ : Pos} : i₁ ≤ i₂ ↔ i₁.byteIdx ≤ i₂.byteIdx


theorem mem_nhdsWithin_prod_iff {x : X} {y : Y} {s : Set (X × Y)} {tx : Set X} {ty : Set Y} :
    s ∈ 𝓝[tx ×ˢ ty] (x, y) ↔ ∃ u ∈ 𝓝[tx] x, ∃ v ∈ 𝓝[ty] y, u ×ˢ v ⊆ s

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]
{x : X}
{y : Y}
{s : Set (X × Y)}
{tx : Set X}
{ty : Set Y}


@[simp]
theorem mapRange_id (h : ∀ i, id (0 : β₁ i) = 0 := fun i => rfl) (g : Π₀ i : ι, β₁ i) :
    mapRange (fun i => (id : β₁ i → β₁ i)) h g = g

{ι : Type u}
{β₁ : ι → Type v₁}
[(i : ι) → Zero (β₁ i)]
(h : ∀ (i : ι), id 0 = 0 := ⋯)
(g : Π₀ (i : ι), β₁ i)


theorem Complex.sin_eq_tsum' (z : ℂ) :
    Complex.sin z = ∑' n : ℕ, (z * Complex.I) ^ (2 * n + 1) / ↑(2 * n + 1)! / Complex.I

Complex.sin z = ∑' (n : ℕ), (z * Complex.I) ^ (2 * n + 1) / ↑(2 * n + 1)! / Complex.I


nonrec theorem HasDerivWithinAt.add (hf : HasDerivWithinAt f f' s x)
    (hg : HasDerivWithinAt g g' s x) : HasDerivWithinAt (fun y => f y + g y) (f' + g') s x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f g : 𝕜 → F}
{f' g' : F}
{x : 𝕜}
{s : Set 𝕜}
(hf : HasDerivWithinAt f f' s x)
(hg : HasDerivWithinAt g g' s x)


@[simp] lemma fib_pos {n : ℕ} : 0 < fib n ↔ 0 < n


theorem mono_set (hst : s ⊆ t) (hf : ApproximatesLinearOn f f' t c) :
    ApproximatesLinearOn f f' s c

{𝕜 : 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}
{s t : Set E}
{c : ℝ≥0}
(hst : s ⊆ t)
(hf : ApproximatesLinearOn f f' t c)


theorem add_neg_self {X Y : C} (a : X ⟶ Y) : a + -a = 0


theorem pow_dvd_iff_le_multiplicity {a b : α} {k : ℕ} :
    a ^ k ∣ b ↔ (k : PartENat) ≤ multiplicity a b

{α : Type u_1}
[Monoid α]
[DecidableRel fun x x_1 => x ∣ x_1]
{a b : α}
{k : ℕ}


@[simp]
theorem AbsoluteValue.map_units_int (abv : AbsoluteValue ℤ S) (x : ℤˣ) : abv x = 1

{S : Type u_2}
[LinearOrderedCommRing S]
(abv : AbsoluteValue ℤ S)
(x : ℤˣ)


/-- **Dirichlet Unit Theorem**. Any unit `x` of `𝓞 K` can be written uniquely as the product of
a root of unity and powers of the units of the fundamental system `fundSystem`. -/
theorem exist_unique_eq_mul_prod (x : (𝓞 K)ˣ) : ∃! ζe : torsion K × (Fin (rank K) → ℤ),
    x = ζe.1 * ∏ i, (fundSystem K i) ^ (ζe.2 i)

(K : Type u_1)
[Field K]
[NumberField K]
(x : (𝓞 K)ˣ)

∃! ζe, x = ↑ζe.1 * ∏ i : Fin (NumberField.Units.rank K), NumberField.Units.fundSystem K i ^ ζe.2 i


lemma isReal_mk_iff {φ : K →+* ℂ} :
    IsReal (mk φ) ↔ ComplexEmbedding.IsReal φ

(NumberField.InfinitePlace.mk φ).IsReal ↔ NumberField.ComplexEmbedding.IsReal φ


theorem of_b_eq_zero (ha : P.a = 0) (hb : P.b = 0) : P.toPoly = C P.c * X + C P.d

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

P.toPoly = Polynomial.C P.c * Polynomial.X + Polynomial.C P.d


theorem replicate_left_injective (a : α) : Injective (replicate · a)

Function.Injective fun x => Multiset.replicate x a


theorem mul_val_succ [Fintype n'] (A : Matrix (Fin m.succ) n' α) (B : Matrix n' o' α) (i : Fin m)
    (j : o') : (A * B) i.succ j = (of (vecTail (of.symm A)) * B) i j

{α : Type u}
{m : ℕ}
{n' : Type uₙ}
{o' : Type uₒ}
[NonUnitalNonAssocSemiring α]
[Fintype n']
(A : Matrix (Fin m.succ) n' α)
(B : Matrix n' o' α)
(i : Fin m)
(j : o')

(A * B) i.succ j = (Matrix.of (Matrix.vecTail (Matrix.of.symm A)) * B) i j


@[simp]
theorem coe_prod (K : NonemptyCompacts α) (L : NonemptyCompacts β) :
    (K.prod L : Set (α × β)) = (K : Set α) ×ˢ (L : Set β)

(K : TopologicalSpace.NonemptyCompacts α)

(L : TopologicalSpace.NonemptyCompacts β)


/-- Evaluation of a `MonoidHom` at a point as a monoid homomorphism. See also `MonoidHom.apply`
for the evaluation of any function at a point. -/
@[to_additive (attr := simps!)
      "Evaluation of an `AddMonoidHom` at a point as an additive monoid homomorphism.
      See also `AddMonoidHom.apply` for the evaluation of any function at a point."]
def eval [MulOneClass M] [CommMonoid N] : M →* (M →* N) →* N

{M : Type uM}
{N : Type uN}
[AddZeroClass M]
[AddCommMonoid N]
(y : M)
(x : M →+ N)


theorem mirror_C (a : R) : (C a).mirror = C a

(Polynomial.C a).mirror = Polynomial.C a


@[simp]
theorem Fintype.card_punit : Fintype.card PUnit = 1


theorem limRatioMeas_measurable : Measurable (v.limRatioMeas hρ)

(hρ : ρ ≪ μ)


/-- A comonoid object in the category of `R`-modules has a natural comultiplication
and counit. -/
@[simps]
instance ofComonObjCoalgebraStruct (X : Comon_ (ModuleCat R)) :
    CoalgebraStruct R X.X

{R : Type u}
[CommRing R]
(X : Comon_ (ModuleCat R))


@[simp, mfld_simps]
theorem transEquiv_transEquiv (e : PartialEquiv α β) (f' : β ≃ γ) (f'' : γ ≃ δ) :
    (e.transEquiv f').transEquiv f'' = e.transEquiv (f'.trans f'')

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{δ : Type u_4}
(e : PartialEquiv α β)
(f' : β ≃ γ)
(f'' : γ ≃ δ)


lemma yonedaEquiv_yoneda_map {X Y : C} (f : X ⟶ Y) : yonedaEquiv (yoneda.map f) = f

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

CategoryTheory.yonedaEquiv (CategoryTheory.yoneda.map f) = f


theorem exists_rep [Monoid α] (a : Associates α) : ∃ a0 : α, Associates.mk a0 = a

{α : Type u_1}
[Monoid α]
(a : Associates α)


@[simp]
lemma inv_hom_id_apply {X Y : FintypeCat} (f : X ≅ Y) (y : Y) : f.hom (f.inv y) = y


@[to_additive]
theorem comap_comap (K : Subgroup P) (g : N →* P) (f : G →* N) :
    (K.comap g).comap f = K.comap (g.comp f)

{G : Type u_1}
[Group G]
{N : Type u_5}
[Group N]
{P : Type u_6}
[Group P]
(K : Subgroup P)
(g : N →* P)
(f : G →* N)

Subgroup.comap f (Subgroup.comap g K) = Subgroup.comap (g.comp f) K


/-- `cyclotomic n` is monic. -/
theorem cyclotomic.monic (n : ℕ) (R : Type*) [Ring R] : (cyclotomic n R).Monic


@[simp]
theorem left_vsub_lineMap (p₀ p₁ : P1) (c : k) : p₀ -ᵥ lineMap p₀ p₁ c = c • (p₀ -ᵥ p₁)

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

p₀ -ᵥ (AffineMap.lineMap p₀ p₁) c = c • (p₀ -ᵥ p₁)


theorem sdiff_lt_sdiff_right (h : x < y) (hz : z ≤ x) : x \ z < y \ z

{α : Type u}
{x y z : α}
[GeneralizedBooleanAlgebra α]
(h : x < y)
(hz : z ≤ x)


protected nonrec theorem ContinuousWithinAt.inversion (hc : ContinuousWithinAt c s a₀)
    (hR : ContinuousWithinAt R s a₀) (hx : ContinuousWithinAt x s a₀) (hne : x a₀ ≠ c a₀) :
    ContinuousWithinAt (fun a ↦ inversion (c a) (R a) (x a)) s a₀

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{X : Type u_3}
[TopologicalSpace X]
{c x : X → P}
{R : X → ℝ}
{a₀ : X}
{s : Set X}
(hc : ContinuousWithinAt c s a₀)
(hR : ContinuousWithinAt R s a₀)
(hx : ContinuousWithinAt x s a₀)
(hne : x a₀ ≠ c a₀)

ContinuousWithinAt (fun a => EuclideanGeometry.inversion (c a) (R a) (x a)) s a₀


lemma trunc_X_of {n : ℕ} (hn : 2 ≤ n) : trunc n X = (Polynomial.X : R[X])

{R : Type u_1}
[Semiring R]
{n : ℕ}
(hn : 2 ≤ n)

PowerSeries.trunc n PowerSeries.X = Polynomial.X


@[simp] lemma op_inv_leftUnitor (X : C) : (λ_ X).inv.op = (λ_ (op X)).hom

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

(CategoryTheory.MonoidalCategory.leftUnitor X).inv.op = (CategoryTheory.MonoidalCategory.leftUnitor (Opposite.op X)).hom


theorem natDegree_lt_natDegree_iff (hp : p ≠ 0) : natDegree p < natDegree q ↔ degree p < degree q

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

p.natDegree < q.natDegree ↔ p.degree < q.degree


theorem rothNumberNat_def (n : ℕ) : rothNumberNat n = addRothNumber (range n)

rothNumberNat n = addRothNumber (Finset.range n)


@[simp]
theorem mem_single {J'} (h : J ≤ I) : J' ∈ single I J h ↔ J' = J

{ι : Type u_1}
{I J J' : BoxIntegral.Box ι}
(h : J ≤ I)

J' ∈ BoxIntegral.Prepartition.single I J h ↔ J' = J


theorem ne_iff {l₁ l₂ : List α} (H : length l₁ ≤ length l₂) : Lex (· ≠ ·) l₁ l₂ ↔ l₁ ≠ l₂

{α : Type u}
{l₁ l₂ : List α}
(H : l₁.length ≤ l₂.length)

List.Lex (fun x x_1 => x ≠ x_1) l₁ l₂ ↔ l₁ ≠ l₂


@[simp]
theorem min_insert {a : α} {s : Finset α} : (insert a s).min = min (↑a) s.min

{α : Type u_2}
[LinearOrder α]
{a : α}
{s : Finset α}


@[simp] lemma liftRelAux_inl_inl {a : α} {b : β} :
  LiftRelAux R C (Sum.inl a) (Sum.inl b) = R a b

{C : Computation α → Computation β → Prop}

Computation.LiftRelAux R C (Sum.inl a) (Sum.inl b) = R a b


@[simp]
theorem renameEquiv_trans (e : σ ≃ τ) (f : τ ≃ α) :
    (renameEquiv R e).trans (renameEquiv R f) = renameEquiv R (e.trans f)

{σ : Type u_1}
{τ : Type u_2}
{α : Type u_3}
(R : Type u_4)
[CommSemiring R]
(e : σ ≃ τ)
(f : τ ≃ α)

(MvPolynomial.renameEquiv R e).trans (MvPolynomial.renameEquiv R f) = MvPolynomial.renameEquiv R (e.trans f)


/-- A normed commutative ring is a commutative ring endowed with a norm which satisfies
the inequality `‖x y‖ ≤ ‖x‖ ‖y‖`. -/
class NormedCommRing (α : Type*) extends NormedRing α where
  /-- Multiplication is commutative. -/
  mul_comm : ∀ x y : α, x * y = y * x

{α : Type u_5}
[self : NormedCommRing α]
(x y : α)


@[to_additive (attr := simp)]
theorem comp_id (f : α →*o β) : f.comp (OrderMonoidHom.id α) = f

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


theorem StrictMono.minimal_preimage_bot [LinearOrder α] [PartialOrder β] [OrderBot β] {f : α → β}
    (H : StrictMono f) {a} (h_bot : f a = ⊥) (x : α) : a ≤ x

{α : Type u}
{β : Type v}
[LinearOrder α]
[PartialOrder β]
[OrderBot β]
{f : α → β}
(H : StrictMono f)
{a : α}
(h_bot : f a = ⊥)
(x : α)


theorem dvd_gcd_iff : k ∣ gcd m n ↔ k ∣ m ∧ k ∣ n


/-- Harder inclusion: at a point in `D f K`, the function `f` has a derivative, in `K`. -/
theorem D_subset_differentiable_set {K : Set (E →L[𝕜] F)} (hK : IsComplete K) :
    D f K ⊆ { x | DifferentiableAt 𝕜 f x ∧ fderiv 𝕜 f x ∈ K }

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{K : Set (E →L[𝕜] F)}
(hK : IsComplete K)

FDerivMeasurableAux.D f K ⊆ {x | DifferentiableAt 𝕜 f x ∧ fderiv 𝕜 f x ∈ K}


theorem HasCompactSupport.mul_left (hf : HasCompactSupport f') : HasCompactSupport (f * f')

{α : Type u_2}
{β : Type u_4}
[TopologicalSpace α]
[MulZeroClass β]
{f f' : α → β}
(hf : HasCompactSupport f')


@[simp]
theorem sigma_cons (a : α) (l₁ : List α) (l₂ : ∀ a, List (σ a)) :
    (a :: l₁).sigma l₂ = map (Sigma.mk a) (l₂ a) ++ l₁.sigma l₂

{α : Type u_1}
{σ : α → Type u_3}
(a : α)
(l₁ : List α)
(l₂ : (a : α) → List (σ a))

(a :: l₁).sigma l₂ = List.map (Sigma.mk a) (l₂ a) ++ l₁.sigma l₂


theorem isLUB_sSup (s : Set α) : IsLUB s (sSup s)

{α : Type u_1}
[CompleteSemilatticeSup α]
(s : Set α)


protected lemma le_antisymm_iff : a = b ↔ a ≤ b ∧ b ≤ a


theorem add_mem_Ico_iff_left : a + b ∈ Set.Ico c d ↔ a ∈ Set.Ico (c - b) (d - b)

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


theorem one_def : (1 : Language α) = ({[]} : Set (List α))


theorem map_add_int [AddGroupWithOne G] [AddGroupWithOne H] [AddConstMapClass F G H 1 1]
    (f : F) (x : G) (n : ℤ) : f (x + n) = f x + n

{F : Type u_1}
{G : Type u_2}
{H : Type u_3}
[FunLike F G H]
[AddGroupWithOne G]
[AddGroupWithOne H]
[AddConstMapClass F G H 1 1]
(f : F)
(x : G)
(n : ℤ)


theorem inf_of_right (h : μ.FiniteAtFilter g) : μ.FiniteAtFilter (f ⊓ g)

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f g : Filter α}
(h : μ.FiniteAtFilter g)


protected theorem ne_iff {p q : FormalMultilinearSeries 𝕜 E F} : p ≠ q ↔ ∃ n, p n ≠ q n

{𝕜 : Type u}
{E : Type v}
{F : Type w}
[Ring 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[TopologicalSpace E]
[TopologicalAddGroup E]
[ContinuousConstSMul 𝕜 E]
[AddCommGroup F]
[Module 𝕜 F]
[TopologicalSpace F]
[TopologicalAddGroup F]
[ContinuousConstSMul 𝕜 F]
{p q : FormalMultilinearSeries 𝕜 E F}


lemma Cotangent.map_sub_map (f g : Hom P P') :
    map f - map g = (f.sub g) ∘ₗ P.cotangentComplex

{R : Type u}
{S : Type v}
[CommRing R]
[CommRing S]
[Algebra R S]
{P : Algebra.Generators R S}
{R' : Type u'}
{S' : Type v'}
[CommRing R']
[CommRing S']
[Algebra R' S']
{P' : Algebra.Generators R' S'}
[Algebra R R']
[Algebra S S']
[Algebra R S']
[IsScalarTower R R' S']
[IsScalarTower R S S']
(f g : P.Hom P')

Algebra.Generators.Cotangent.map f - Algebra.Generators.Cotangent.map g = f.sub g ∘ₗ P.cotangentComplex


/-- A multiplicative morphism property `W` has right calculus of fractions if
any left fraction can be turned into a right fraction and that two morphisms
that can be equalized by postcomposition with a morphism in `W` can also
be equalized by precomposition with a morphism in `W`. -/
class HasRightCalculusOfFractions extends W.IsMultiplicative : Prop where
  exists_rightFraction ⦃X Y : C⦄ (φ : W.LeftFraction X Y) :
    ∃ (ψ : W.RightFraction X Y), ψ.s ≫ φ.f = ψ.f ≫ φ.s
  ext : ∀ ⦃X Y Y' : C⦄ (f₁ f₂ : X ⟶ Y) (s : Y ⟶ Y') (_ : W s)
    (_ : f₁ ≫ s = f₂ ≫ s), ∃ (X' : C) (t : X' ⟶ X) (_ : W t), t ≫ f₁ = t ≫ f₂

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
{W : CategoryTheory.MorphismProperty C}
[self : W.HasRightCalculusOfFractions]
⦃X Y : C⦄
(φ : W.LeftFraction X Y)

∃ ψ, CategoryTheory.CategoryStruct.comp ψ.s φ.f = CategoryTheory.CategoryStruct.comp ψ.f φ.s


@[simp]
theorem tendsto_dist_left_atTop_iff (c : α) {f : β → α} {l : Filter β} :
    Tendsto (fun x ↦ dist c (f x)) l atTop ↔ Tendsto f l (cobounded α)

{α : Type u}
{β : Type v}
[PseudoMetricSpace α]
(c : α)
{f : β → α}
{l : Filter β}

Filter.Tendsto (fun x => dist c (f x)) l Filter.atTop ↔ Filter.Tendsto f l (Bornology.cobounded α)


/-- Given a measurable function `f` with values in `ℝ≥0`, there exists a lower semicontinuous
function `g ≥ f` with integral arbitrarily close to that of `f`. Formulation in terms of
`lintegral`.
Auxiliary lemma for Vitali-Carathéodory theorem `exists_lt_lower_semicontinuous_integral_lt`. -/
theorem exists_le_lowerSemicontinuous_lintegral_ge (f : α → ℝ≥0∞) (hf : Measurable f) {ε : ℝ≥0∞}
    (εpos : ε ≠ 0) :
    ∃ g : α → ℝ≥0∞,
      (∀ x, f x ≤ g x) ∧ LowerSemicontinuous g ∧ (∫⁻ x, g x ∂μ) ≤ (∫⁻ x, f x ∂μ) + ε

{α : Type u_1}
[TopologicalSpace α]
[MeasurableSpace α]
[BorelSpace α]
(μ : MeasureTheory.Measure α)
[μ.WeaklyRegular]
(f : α → ℝ≥0∞)
(hf : Measurable f)
{ε : ℝ≥0∞}
(εpos : ε ≠ 0)

∃ g, (∀ (x : α), f x ≤ g x) ∧ LowerSemicontinuous g ∧ ∫⁻ (x : α), g x ∂μ ≤ ∫⁻ (x : α), f x ∂μ + ε


theorem Filter.Tendsto.isBoundedUnder_ge (h : Tendsto u f (𝓝 a)) : f.IsBoundedUnder (· ≥ ·) u

{ι : Type u_1}
{α : Type u_2}
[Preorder α]
[TopologicalSpace α]
[BoundedGENhdsClass α]
{f : Filter ι}
{u : ι → α}
{a : α}
(h : Filter.Tendsto u f (𝓝 a))

Filter.IsBoundedUnder (fun x x_1 => x ≥ x_1) f u


@[simp]
theorem range_mk' : LieModuleHom.range (mk' N) = ⊤

{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)


@[simp]
theorem id_apply (x : M) : id L M x = x

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]
(x : M)


protected theorem add_mem : a ∈ I → b ∈ I → a + b ∈ I

{α : Type u}
[Semiring α]
(I : Ideal α)
{a b : α}


theorem update_apply_equiv_apply [DecidableEq α'] [DecidableEq α] (f : α → β)
    (g : α' ≃ α) (a : α) (v : β) (a' : α') : update f a v (g a') = update (f ∘ g) (g.symm a) v a'

{α' : Sort u_1}
{α : Sort u_2}
{β : Sort u_3}
[DecidableEq α']
[DecidableEq α]
(f : α → β)
(g : α' ≃ α)
(a : α)
(v : β)
(a' : α')

Function.update f a v (g a') = Function.update (f ∘ ⇑g) (g.symm a) v a'


theorem coeff_inv [DecidableEq σ] (n : σ →₀ ℕ) (φ : MvPowerSeries σ k) :
    coeff k n φ⁻¹ =
      if n = 0 then (constantCoeff σ k φ)⁻¹
      else
        -(constantCoeff σ k φ)⁻¹ *
          ∑ x ∈ antidiagonal n, if x.2 < n then coeff k x.1 φ * coeff k x.2 φ⁻¹ else 0

{σ : Type u_1}
{k : Type u_3}
[Field k]
[DecidableEq σ]
(n : σ →₀ ℕ)
(φ : MvPowerSeries σ k)

(MvPowerSeries.coeff k n) φ⁻¹ =
  if n = 0 then ((MvPowerSeries.constantCoeff σ k) φ)⁻¹
  else
    -((MvPowerSeries.constantCoeff σ k) φ)⁻¹ *
      ∑ x ∈ Finset.antidiagonal n,
        if x.2 < n then (MvPowerSeries.coeff k x.1) φ * (MvPowerSeries.coeff k x.2) φ⁻¹ else 0


theorem _root_.Function.Semiconj.filter_comap {f : α → β} {ga : α → α} {gb : β → β}
    (h : Function.Semiconj f ga gb) : Function.Semiconj (comap f) (comap gb) (comap ga)

{α : Type u}
{β : Type v}
{f : α → β}
{ga : α → α}
{gb : β → β}
(h : Function.Semiconj f ga gb)

Function.Semiconj (Filter.comap f) (Filter.comap gb) (Filter.comap ga)


/-- A ring `R` is isomorphic to `R × S` when `S` is the zero ring -/
@[simps]
def prodZeroRing : R ≃+* R × S

(R : Type u_3)
(S : Type u_5)
[NonAssocSemiring R]
[NonAssocSemiring S]
[Subsingleton S]
(x : R)


@[rclike_simps]
theorem smul_im (r : ℝ) (z : K) : im (r • z) = r * im z

{K : Type u_1}
[RCLike K]
(r : ℝ)
(z : K)


/-- General fencing theorem for continuous functions with an estimate on the derivative.
Let `f` and `B` be continuous functions on `[a, b]` such that

* `f a ≤ B a`;
* `B` has right derivative `B'` at every point of `[a, b)`;
* for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)`
  is bounded above by a function `f'`;
* we have `f' x < B' x` whenever `f x = B x`.

Then `f x ≤ B x` everywhere on `[a, b]`. -/
theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ → ℝ} {a b : ℝ}
    (hf : ContinuousOn f (Icc a b))
    -- `hf'` actually says `liminf (f z - f x) / (z - x) ≤ f' x`
    (hf' : ∀ x ∈ Ico a b, ∀ r, f' x < r → ∃ᶠ z in 𝓝[>] x, slope f x z < r)
    {B B' : ℝ → ℝ} (ha : f a ≤ B a) (hB : ContinuousOn B (Icc a b))
    (hB' : ∀ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x)
    (bound : ∀ x ∈ Ico a b, f x = B x → f' x < B' x) : ∀ ⦃x⦄, x ∈ Icc a b → f x ≤ B x

(hf' : ∀ x ∈ Set.Ico a b, ∀ (r : ℝ), f' x < r → ∃ᶠ (z : ℝ) in 𝓝[>] x, slope f x z < r)

(hB' : ∀ x ∈ Set.Ico a b, HasDerivWithinAt B (B' x) (Set.Ici x) x)

(bound : ∀ x ∈ Set.Ico a b, f x = B x → f' x < B' x)


theorem sum_eq_one {x} (hx : x ∈ s) : ∑ᶠ i, f i x = 1

{ι : Type uι}
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{H : Type uH}
[TopologicalSpace H]
{I : ModelWithCorners ℝ E H}
{M : Type uM}
[TopologicalSpace M]
[ChartedSpace H M]
{s : Set M}
(f : SmoothPartitionOfUnity ι I M s)
{x : M}
(hx : x ∈ s)


nonrec theorem ContDiffAt.div [CompleteSpace 𝕜] {f g : E → 𝕜} {n} (hf : ContDiffAt 𝕜 n f x)
    (hg : ContDiffAt 𝕜 n g x) (hx : g x ≠ 0) : ContDiffAt 𝕜 n (fun x => f x / g x) x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{x : E}
[CompleteSpace 𝕜]
{f g : E → 𝕜}
{n : ℕ∞}
(hf : ContDiffAt 𝕜 n f x)
(hg : ContDiffAt 𝕜 n g x)
(hx : g x ≠ 0)


/-- The free functor from the Eilenberg-Moore category, constructing an algebra for any object. -/
@[simps]
def free : C ⥤ Algebra T

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

∀ {X Y : C} (f : X ⟶ Y), (T.free.map f).f = T.map f


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

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


theorem zorn_partialOrder (h : ∀ c : Set α, IsChain (· ≤ ·) c → BddAbove c) :
    ∃ m : α, ∀ a, m ≤ a → a = m

(h : ∀ (c : Set α), IsChain (fun x x_1 => x ≤ x_1) c → BddAbove c)


theorem Equiv.le {x y : PGame} (h : x ≈ y) : x ≤ y


@[to_additive (attr := simp)]
theorem preimage_inv (s : Finset α) : s.preimage (·⁻¹) inv_injective.injOn = s⁻¹

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


@[simp] lemma smoothSheafCommRing.eval_germ (U : Opens M) (x : U)
    (f : (smoothSheafCommRing IM I M R).presheaf.obj (op U)) :
    smoothSheafCommRing.eval IM I M R x ((smoothSheafCommRing IM I M R).presheaf.germ x f)
    = f x

(f : ↑((smoothSheafCommRing IM I M R).presheaf.obj (Opposite.op U)))

(smoothSheafCommRing.eval IM I M R ↑x) (((smoothSheafCommRing IM I M R).presheaf.germ x) f) = ↑f x


theorem bounded_gt_inter_not_gt [SemilatticeInf α] (a : α) :
    Bounded (· > ·) (s ∩ { b | ¬a < b }) ↔ Bounded (· > ·) s

{α : Type u_1}
{s : Set α}
[SemilatticeInf α]
(a : α)

Set.Bounded (fun x x_1 => x > x_1) (s ∩ {b | ¬a < b}) ↔ Set.Bounded (fun x x_1 => x > x_1) s


theorem doubleFactorial_add_two (n : ℕ) : (n + 2)‼ = (n + 2) * n‼


theorem IsGalois.of_algEquiv [IsGalois F E] (f : E ≃ₐ[F] E') : IsGalois F E'

{F : Type u_1}
{E : Type u_3}
[Field F]
[Field E]
{E' : Type u_4}
[Field E']
[Algebra F E']
[Algebra F E]
[IsGalois F E]
(f : E ≃ₐ[F] E')


theorem lsub_le {ι} {f : ι → Ordinal} {a} : (∀ i, f i < a) → lsub f ≤ a

{ι : Type u_4}
{f : ι → Ordinal.{max u_5 u_4}}
{a : Ordinal.{max u_5 u_4}}

(∀ (i : ι), f i < a) → Ordinal.lsub f ≤ a


/-- If `f : A →ₐ[R] B` is a surjection between finitely-presented `R`-algebras, then the kernel of
`f` is finitely generated. -/
theorem ker_fG_of_surjective (f : A →ₐ[R] B) (hf : Function.Surjective f)
    [FinitePresentation R A] [FinitePresentation R B] : f.toRingHom.ker.FG

{R : Type w₁}
{A : Type w₂}
{B : Type w₃}
[CommRing R]
[CommRing A]
[Algebra R A]
[CommRing B]
[Algebra R B]
(f : A →ₐ[R] B)
(hf : Function.Surjective ⇑f)
[Algebra.FinitePresentation R A]
[Algebra.FinitePresentation R B]


@[to_additive (attr := simp)]
theorem ofBijective_apply_symm_apply {n : N} (f : M →* N) (hf : Bijective f) :
    f ((ofBijective f hf).symm n) = n

{M : Type u_6}
{N : Type u_7}
[AddZeroClass M]
[AddZeroClass N]
{n : N}
(f : M →+ N)
(hf : Function.Bijective ⇑f)

f ((AddEquiv.ofBijective f hf).symm n) = n


/-- Another way to coerce a `Multiset` to a type is to go through `m.toEnumFinset` and coerce
that `Finset` to a type. -/
@[simps]
def Multiset.coeEquiv (m : Multiset α) : m ≃ m.toEnumFinset

{α : Type u_1}
[DecidableEq α]
(m : Multiset α)
(x : { x // x ∈ m.toEnumFinset })


@[simp]
theorem upperClosure_sUnion (S : Set (Set α)) : upperClosure (⋃₀ S) = ⨅ s ∈ S, upperClosure s

{α : Type u_1}
[Preorder α]
(S : Set (Set α))


theorem iterate_fixed {x} (h : f x = x) (n : ℕ) : f^[n] x = x

{α : Type u}
{f : α → α}
{x : α}
(h : f x = x)
(n : ℕ)


protected theorem half_le_self : a / 2 ≤ a


theorem ofDigits_neg_one :
    ∀ L : List ℕ, ofDigits (-1 : ℤ) L = (L.map fun n : ℕ => (n : ℤ)).alternatingSum

Nat.ofDigits (-1) L = (List.map (fun n => ↑n) L).alternatingSum


/-- `pb.liftEquiv` states that roots of the minimal polynomial of `pb.gen` correspond to
maps sending `pb.gen` to that root.

This is the bundled equiv version of `PowerBasis.lift`.
If the codomain of the `AlgHom`s is an integral domain, then the roots form a multiset,
see `liftEquiv'` for the corresponding statement.
-/
@[simps]
noncomputable def liftEquiv (pb : PowerBasis A S) :
    (S →ₐ[A] S') ≃ { y : S' // aeval y (minpoly A pb.gen) = 0 }

(y : { y // (Polynomial.aeval y) (minpoly A pb.gen) = 0 })


theorem map_piecewise_smul [DecidableEq ι] (c : ι → R) (m : ∀ i, M₁ i) (s : Finset ι) :
    f (s.piecewise (fun i => c i • m i) m) = (∏ i ∈ s, c i) • f m

{R : Type u}
{ι : Type v}
{M₁ : ι → Type w₁}
{M₂ : Type w₂}
[CommSemiring R]
[(i : ι) → AddCommMonoid (M₁ i)]
[AddCommMonoid M₂]
[(i : ι) → Module R (M₁ i)]
[Module R M₂]
[(i : ι) → TopologicalSpace (M₁ i)]
[TopologicalSpace M₂]
(f : ContinuousMultilinearMap R M₁ M₂)
[DecidableEq ι]
(c : ι → R)
(m : (i : ι) → M₁ i)
(s : Finset ι)


@[simp]
theorem N₁Γ₀_hom_app_f_f (K : ChainComplex C ℕ) (n : ℕ) :
    (N₁Γ₀.hom.app K).f.f n = (Γ₀.splitting K).toKaroubiNondegComplexIsoN₁.inv.f.f n

(AlgebraicTopology.DoldKan.N₁Γ₀.hom.app K).f.f n =
  (AlgebraicTopology.DoldKan.Γ₀.splitting K).toKaroubiNondegComplexIsoN₁.inv.f.f n


@[simp]
theorem coe_coe : (f.toMultilinearMap : (∀ i, M₁ i) → M₂) = f

{R : Type u}
{ι : Type v}
{M₁ : ι → Type w₁}
{M₂ : Type w₂}
[Semiring R]
[(i : ι) → AddCommMonoid (M₁ i)]
[AddCommMonoid M₂]
[(i : ι) → Module R (M₁ i)]
[Module R M₂]
[(i : ι) → TopologicalSpace (M₁ i)]
[TopologicalSpace M₂]
(f : ContinuousMultilinearMap R M₁ M₂)


theorem subset_mapRange_neLocus [DecidableEq N] [Zero N] [DecidableEq M] [Zero M] (f g : α →₀ N)
    {F : N → M} (F0 : F 0 = 0) : (f.mapRange F F0).neLocus (g.mapRange F F0) ⊆ f.neLocus g

{α : Type u_1}
{M : Type u_2}
{N : Type u_3}
[DecidableEq α]
[DecidableEq N]
[Zero N]
[DecidableEq M]
[Zero M]
(f g : α →₀ N)
{F : N → M}
(F0 : F 0 = 0)

(Finsupp.mapRange F F0 f).neLocus (Finsupp.mapRange F F0 g) ⊆ f.neLocus g


/-- A `CommRing` `K` which is the localization of an integral domain `R` at `R - {0}` is an
integral domain. -/
protected theorem isDomain : IsDomain K

(A : Type u_4)
[CommRing A]
[IsDomain A]
{K : Type u_5}
[CommRing K]
[Algebra A K]
[IsFractionRing A K]


@[reassoc (attr := simp)]
theorem colimit.ι_post (j : J) :
    colimit.ι (F ⋙ G) j ≫ colimit.post F G = G.map (colimit.ι F j)

[CategoryTheory.Limits.HasColimit (F ⋙ G)]

CategoryTheory.Limits.colimit.ι (F ⋙ G) j ≫ CategoryTheory.Limits.colimit.post F G =
  G.map (CategoryTheory.Limits.colimit.ι F j)


theorem continuousOn_toReal : ContinuousOn EReal.toReal ({⊥, ⊤}ᶜ : Set EReal)


theorem locally_zero_iff (hp : HasFPowerSeriesAt f p z₀) : (∀ᶠ z in 𝓝 z₀, f z = 0) ↔ p = 0

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


theorem to_skyscraper_fromStalk {𝓕 : Presheaf C X} {c : C} (f : 𝓕 ⟶ skyscraperPresheaf p₀ c) :
    toSkyscraperPresheaf p₀ (fromStalk _ f) = f

[(U : TopologicalSpace.Opens ↑X) → Decidable (p₀ ∈ U)]

StalkSkyscraperPresheafAdjunctionAuxs.toSkyscraperPresheaf p₀ (StalkSkyscraperPresheafAdjunctionAuxs.fromStalk p₀ f) = f


@[simp]
theorem valuedCompletion_apply (x : K) : Valued.v (x : hat K) = v x

{K : Type u_1}
[Field K]
{Γ₀ : Type u_2}
[LinearOrderedCommGroupWithZero Γ₀]
[hv : Valued K Γ₀]
(x : K)


/-- Given a tower of algebras `R → A → B`, and a square-zero `I : ideal B`,
there is a 1-1 correspondence between `R`-derivations from `A` to `I` and
lifts `A →ₐ[R] B` of the canonical map `A →ₐ[R] B ⧸ I`. -/
@[simps!]
def derivationToSquareZeroEquivLift : Derivation R A I ≃
    { f : A →ₐ[R] B // (Ideal.Quotient.mkₐ R I).comp f = IsScalarTower.toAlgHom R A (B ⧸ I) }

{R : Type u}
{A : Type v}
{B : Type w}
[CommSemiring R]
[CommSemiring A]
[CommRing B]
[Algebra R A]
[Algebra R B]
(I : Ideal B)
(hI : I ^ 2 = ⊥)
[Algebra A B]
[IsScalarTower R A B]
(d : Derivation R A ↥I)
(x : A)

↑((derivationToSquareZeroEquivLift I hI) d) x = ↑(d x) + (algebraMap A B) x


lemma _root_.Odd.not_two_dvd_nat (h : Odd n) : ¬(2 ∣ n)


@[to_additive]
theorem smul_singleton (b : β) : s • ({b} : Finset β) = s.image (· • b)

{α : Type u_2}
{β : Type u_3}
[DecidableEq β]
[VAdd α β]
{s : Finset α}
(b : β)

s +ᵥ {b} = Finset.image (fun x => x +ᵥ b) s


/-- Construct `IsGroupHom` from its only hypothesis. -/
@[to_additive "Construct `IsAddGroupHom` from its only hypothesis."]
theorem IsGroupHom.mk' [Group α] [Group β] {f : α → β} (hf : ∀ x y, f (x * y) = f x * f y) :
    IsGroupHom f

(hf : ∀ (x y : α), f (x + y) = f x + f y)


theorem periodic_coprime (a : ℕ) : Periodic (Coprime a) a


theorem multiplicity_two_factorial_lt : ∀ {n : ℕ} (_ : n ≠ 0), multiplicity 2 n ! < n


@[simp]
theorem union_subset_iff {s t u : Set α} : s ∪ t ⊆ u ↔ s ⊆ u ∧ t ⊆ u


@[simp]
theorem hasFiniteIntegral_neg_iff {f : α → β} : HasFiniteIntegral (-f) μ ↔ HasFiniteIntegral f μ

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup β]
{f : α → β}

MeasureTheory.HasFiniteIntegral (-f) μ ↔ MeasureTheory.HasFiniteIntegral f μ


@[to_additive]
theorem div_subset_iff : s / t ⊆ u ↔ ∀ x ∈ s, ∀ y ∈ t, x / y ∈ u

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


@[fun_prop]
theorem DifferentiableWithinAt.sub (hf : DifferentiableWithinAt 𝕜 f s x)
    (hg : DifferentiableWithinAt 𝕜 g s x) : DifferentiableWithinAt 𝕜 (fun y => f y - g y) s x

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


theorem lintegral_abs_det_fderiv_le_addHaar_image_aux1 (hs : MeasurableSet s)
    (hf' : ∀ x ∈ s, HasFDerivWithinAt f (f' x) s x) (hf : InjOn f s) {ε : ℝ≥0} (εpos : 0 < ε) :
    (∫⁻ x in s, ENNReal.ofReal |(f' x).det| ∂μ) ≤ μ (f '' s) + 2 * ε * μ s

∫⁻ (x : E) in s, ENNReal.ofReal |(f' x).det| ∂μ ≤ μ (f '' s) + 2 * ↑ε * μ s


{α : Type u}
[LE α]
[OrderBot α]
{a : α}


/-- The `AddSubmonoid` generated by an element of an `AddMonoid` equals the set of
natural number multiples of the element. -/
theorem mem_closure_singleton {x y : A} : y ∈ closure ({x} : Set A) ↔ ∃ n : ℕ, n • x = y

y ∈ AddSubmonoid.closure {x} ↔ ∃ n, n • x = y


/-- To give a morphism in the over category, it suffices to give an arrow fitting in a commutative
    triangle. -/
@[simps!]
def homMk {U V : Over X} (f : U.left ⟶ V.left) (w : f ≫ V.hom = U.hom := by aesop_cat) : U ⟶ V

(w : CategoryTheory.CategoryStruct.comp f V.hom = U.hom := by aesop_cat)

(CategoryTheory.Over.homMk f w).left = f


@[reassoc]
theorem Scheme.restrictFunctor_map_ofRestrict {U V : X.Opens} (i : U ⟶ V) :
    (X.restrictFunctor.map i).1 ≫ V.ι = U.ι

{X : AlgebraicGeometry.Scheme}
{U V : X.Opens}
(i : U ⟶ V)

(X.restrictFunctor.map i).left ≫ V.ι = U.ι


theorem toNNReal_eq_toNNReal_iff (x y : ℝ≥0∞) :
    x.toNNReal = y.toNNReal ↔ x = y ∨ x = 0 ∧ y = ⊤ ∨ x = ⊤ ∧ y = 0


@[simp]
theorem Ioc_union_Ioc_symm : Ioc a b ∪ Ioc b a = Ioc (min a b) (max a b)

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

Set.Ioc a b ∪ Set.Ioc b a = Set.Ioc (min a b) (max a b)


@[to_additive (attr := simp)]
theorem inv_mk : (mk L)⁻¹ = mk (invRev L)

-FreeAddGroup.mk L = FreeAddGroup.mk (FreeAddGroup.negRev L)


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


theorem isPiSystem_Ioi : IsPiSystem (range Ioi : Set (Set α))


@[elab_as_elim]
theorem induction_on {p : hatα → Prop} (a : hatα) (hp : IsClosed { a | p a }) (ih : ∀ a, p (ι a)) :
    p a

{α : Type u_1}
[UniformSpace α]
(pkg : AbstractCompletion α)
{p : pkg.space → Prop}
(a : pkg.space)
(hp : IsClosed {a | p a})
(ih : ∀ (a : α), p (pkg.coe a))


/-- Build an isomorphism in the category `MonCat` from a `MulEquiv` between `Monoid`s. -/
@[to_additive (attr := simps) AddEquiv.toAddMonCatIso
      "Build an isomorphism in the category `AddMonCat` from\nan `AddEquiv` between `AddMonoid`s."]
def MulEquiv.toMonCatIso (e : X ≃* Y) : MonCat.of X ≅ MonCat.of Y

{X Y : Type u}
[Monoid X]
[Monoid Y]
(e : X ≃* Y)

e.toMonCatIso.inv = MonCat.ofHom e.symm.toMonoidHom


/-- A constructor for `IsSplitEpi f` taking a `SplitEpi f` as an argument -/
theorem IsSplitEpi.mk' {X Y : C} {f : X ⟶ Y} (se : SplitEpi f) : IsSplitEpi f

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


theorem getLsb_add_add_bool {i : Nat} (i_lt : i < w) (x y : BitVec w) (c : Bool) :
    getLsb (x + y + zeroExtend w (ofBool c)) i =
      Bool.xor (getLsb x i) (Bool.xor (getLsb y i) (carry i x y c))

{w i : Nat}
(i_lt : i < w)
(x y : BitVec w)
(c : Bool)

(x + y + BitVec.zeroExtend w (BitVec.ofBool c)).getLsb i = (x.getLsb i).xor ((y.getLsb i).xor (BitVec.carry i x y c))


@[simp] lemma erase_lt : s.erase a < s ↔ a ∈ s

{α : Type u_1}
[Preorder α]
{s : LowerSet α}
{a : α}


lemma bddBelow_pi {s : Set (∀ a, π a)} :
    BddBelow s ↔ ∀ a, BddBelow (Function.eval a '' s)

{α : Type u}
{π : α → Type u_1}
[(a : α) → Preorder (π a)]
{s : Set ((a : α) → π a)}

BddBelow s ↔ ∀ (a : α), BddBelow (Function.eval a '' s)


@[simp]
theorem divByMonic_zero (p : R[X]) : p /ₘ 0 = 0


@[simp]
theorem Cofork.app_zero_eq_comp_π_left (s : Cofork f g) : s.ι.app zero = f ≫ s.π

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

s.ι.app CategoryTheory.Limits.WalkingParallelPair.zero = CategoryTheory.CategoryStruct.comp f s.π


/--
Correctness theorem for `iunfoldr`.
-/
theorem iunfoldr_replace
    {f : Fin w → α → α × Bool} (state : Nat → α) (value : BitVec w) (a : α)
    (init : state 0 = a)
    (step : ∀(i : Fin w), f i (state i.val) = (state (i.val+1), value.getLsb i.val)) :
    iunfoldr f a = (state w, value)

(step : ∀ (i : Fin w), f i (state ↑i) = (state (↑i + 1), value.getLsb ↑i))


@[simp]
theorem bot_apply (a : α) : (⊥ : α ≃. β) a = none


lemma IsLowerSet.erase (hs : IsLowerSet s) (has : ∀ b ∈ s, a ≤ b → b = a) : IsLowerSet (s \ {a})

{α : Type u_1}
[LE α]
{s : Set α}
{a : α}
(hs : IsLowerSet s)
(has : ∀ b ∈ s, a ≤ b → b = a)


theorem support_single_disjoint {b' : M} (hb : b ≠ 0) (hb' : b' ≠ 0) {i j : α} :
    Disjoint (single i b).support (single j b').support ↔ i ≠ j

{α : Type u_1}
{M : Type u_5}
[Zero M]
{b b' : M}
(hb : b ≠ 0)
(hb' : b' ≠ 0)
{i j : α}

Disjoint (Finsupp.single i b).support (Finsupp.single j b').support ↔ i ≠ j


/-- (An auxiliary definition for `functorCategoryMonoidal`.) -/
@[simps]
def whiskerLeft (F) (β : F' ⟶ G') : tensorObj F F' ⟶ tensorObj F G'

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
[CategoryTheory.MonoidalCategory D]
{F' G' : C ⥤ D}
(F : C ⥤ D)
(β : F' ⟶ G')
(X : C)

(CategoryTheory.Monoidal.FunctorCategory.whiskerLeft F β).app X = F.obj X ◁ β.app X


protected theorem Convex.convexHull_union (hs : Convex 𝕜 s) (ht : Convex 𝕜 t) (hs₀ : s.Nonempty)
    (ht₀ : t.Nonempty) : convexHull 𝕜 (s ∪ t) = convexJoin 𝕜 s t

{𝕜 : Type u_2}
{E : Type u_3}
[LinearOrderedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{s t : Set E}
(hs : Convex 𝕜 s)
(ht : Convex 𝕜 t)
(hs₀ : s.Nonempty)
(ht₀ : t.Nonempty)

(convexHull 𝕜) (s ∪ t) = convexJoin 𝕜 s t


@[simp] theorem one_imI : (1 : ℍ[R]).imI = 0


@[simp]
theorem withTop_id : (InfHom.id α).withTop = InfTopHom.id _

(InfHom.id α).withTop = InfTopHom.id (WithTop α)


theorem map_top (f : α → β) : map f ⊤ = restrict (range f) ⊤

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

(MeasureTheory.OuterMeasure.map f) ⊤ = (MeasureTheory.OuterMeasure.restrict (Set.range f)) ⊤


theorem map_map {α : F ⟶ G} {X Y : Grothendieck F} {f : X ⟶ Y} :
    (Grothendieck.map α).map f =
    ⟨f.base, (eqToHom (α.naturality f.base).symm).app X.fiber ≫ (α.app Y.base).map f.fiber⟩

{F G : CategoryTheory.Functor C CategoryTheory.Cat}

(CategoryTheory.Grothendieck.map α).map f =
  { base := f.base,
    fiber := CategoryTheory.CategoryStruct.comp ((CategoryTheory.eqToHom ⋯).app X.fiber) ((α.app Y.base).map f.fiber) }


theorem incl_range (s : AddSubgroup V₁) : (incl s).range = s

{V₁ : Type u_3}
[SeminormedAddCommGroup V₁]
(s : AddSubgroup V₁)


theorem le_add_sub (a b : Ordinal) : a ≤ b + (a - b)


theorem IsBigOWith.congr' (h : IsBigOWith c₁ l f₁ g₁) (hc : c₁ = c₂) (hf : f₁ =ᶠ[l] f₂)
    (hg : g₁ =ᶠ[l] g₂) : IsBigOWith c₂ l f₂ g₂

{α : Type u_1}
{E : Type u_3}
{F : Type u_4}
[Norm E]
[Norm F]
{c₁ c₂ : ℝ}
{l : Filter α}
{f₁ f₂ : α → E}
{g₁ g₂ : α → F}
(h : Asymptotics.IsBigOWith c₁ l f₁ g₁)
(hc : c₁ = c₂)
(hf : f₁ =ᶠ[l] f₂)
(hg : g₁ =ᶠ[l] g₂)


theorem measure_if {x : β} {t : Set β} {s : Set α} :
    μ (if x ∈ t then s else ∅) = indicator t (fun _ => μ s) x

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{x : β}
{t : Set β}
{s : Set α}

μ (if x ∈ t then s else ∅) = t.indicator (fun x => μ s) x


/-- The iterated differential within a set `s` at a point `x` is not modified if one intersects
`s` with a neighborhood of `x`. -/
theorem iteratedFDerivWithin_inter {n : ℕ} (hu : u ∈ 𝓝 x) :
    iteratedFDerivWithin 𝕜 n f (s ∩ u) x = iteratedFDerivWithin 𝕜 n f s x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{s u : Set E}
{f : E → F}
{x : E}
{n : ℕ}
(hu : u ∈ 𝓝 x)


/-- Given a commutative diagram
    X --f--> Y --g--> Z
    |        |        |
    |        |        |
    v        v        v
    X' -f'-> Y' -g'-> Z'
with horizontal arrows composing to zero,
then we obtain a commutative square
   cokernel f ---> Z
   |               |
   | cokernel.map  |
   |               |
   v               v
   cokernel f' --> Z'
-/
theorem cokernel.map_desc {X Y Z X' Y' Z' : C} (f : X ⟶ Y) [HasCokernel f] (g : Y ⟶ Z)
    (w : f ≫ g = 0) (f' : X' ⟶ Y') [HasCokernel f'] (g' : Y' ⟶ Z') (w' : f' ≫ g' = 0) (p : X ⟶ X')
    (q : Y ⟶ Y') (r : Z ⟶ Z') (h₁ : f ≫ q = p ≫ f') (h₂ : g ≫ r = q ≫ g') :
    cokernel.map f f' p q h₁ ≫ cokernel.desc f' g' w' = cokernel.desc f g w ≫ r

CategoryTheory.Limits.cokernel.map f f' p q h₁ ≫ CategoryTheory.Limits.cokernel.desc f' g' w' =
  CategoryTheory.Limits.cokernel.desc f g w ≫ r


@[to_additive (attr := simp)] theorem fst_comp_inl : (fst : M ∗ N →* M).comp inl = .id _

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

Monoid.Coprod.fst.comp Monoid.Coprod.inl = MonoidHom.id M


theorem map_nsmul (f : α → β) (n : ℕ) (s) : map f (n • s) = n • map f s

{α : Type u_1}
{β : Type v}
(f : α → β)
(n : ℕ)
(s : Multiset α)

Multiset.map f (n • s) = n • Multiset.map f s


theorem mem_aroots' [CommRing S] [IsDomain S] [Algebra T S] {p : T[X]} {a : S} :
    a ∈ p.aroots S ↔ p.map (algebraMap T S) ≠ 0 ∧ aeval a p = 0

{S : Type v}
{T : Type w}
[CommRing T]
[CommRing S]
[IsDomain S]
[Algebra T S]
{p : Polynomial T}
{a : S}

a ∈ p.aroots S ↔ Polynomial.map (algebraMap T S) p ≠ 0 ∧ (Polynomial.aeval a) p = 0


lemma coe_apply (l : Line α ι) (x : α) (i : ι) : l x i = (l.idxFun i).getD x

{α : Type u_2}
{ι : Type u_3}
(l : Combinatorics.Line α ι)
(x : α)
(i : ι)

(fun x i => (l.idxFun i).getD x) x i = (l.idxFun i).getD x


theorem Disjoint.le_symmDiff_sup_symmDiff_left (h : Disjoint a b) : c ≤ a ∆ c ⊔ b ∆ c

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


@[reassoc (attr := simp)]
theorem σ_naturality {X' X : CosimplicialObject C} (f : X ⟶ X') {n : ℕ} (i : Fin (n + 1)) :
    X.σ i ≫ f.app (SimplexCategory.mk n) = f.app (SimplexCategory.mk (n + 1)) ≫ X'.σ i

{X' X : CategoryTheory.CosimplicialObject C}


lemma unitHomEquiv_symm_comp {M N : SheafOfModules.{u} R} (s : M.sections) (p : M ⟶ N) :
    M.unitHomEquiv.symm s ≫ p = N.unitHomEquiv.symm (sectionsMap p s)

{J : CategoryTheory.GrothendieckTopology C}

[J.HasSheafCompose (CategoryTheory.forget₂ RingCat AddCommGrp)]

M.unitHomEquiv.symm s ≫ p = N.unitHomEquiv.symm (SheafOfModules.sectionsMap p s)


theorem StrictAnti.const_mul [PosMulStrictMono α]
    (hf : StrictAnti f) (ha : 0 < a) : StrictAnti fun x => a * f x

{α : Type u}
{β : Type u_1}
[Semiring α]
[PartialOrder α]
{a : α}
[Preorder β]
{f : β → α}
[PosMulStrictMono α]
(hf : StrictAnti f)
(ha : 0 < a)


lemma mul_bot_of_neg : ∀ {x : EReal}, x < 0 → x * ⊥ = ⊤


@[to_additive]
theorem ThreeGPFree.smul_set (hs : ThreeGPFree s) : ThreeGPFree (a • s)

{α : Type u_2}
[AddCancelCommMonoid α]
{s : Set α}
{a : α}
(hs : ThreeAPFree s)


theorem preimage_subset_source {s : Set B} (hb : s ⊆ e.baseSet) : proj ⁻¹' s ⊆ e.source

{B : Type u_2}
{F : Type u_3}
{Z : Type u_5}
[TopologicalSpace B]
[TopologicalSpace F]
{proj : Z → B}
[TopologicalSpace Z]
(e : Trivialization F proj)
{s : Set B}
(hb : s ⊆ e.baseSet)


/-- A pair of continuous (semi)linear equivalences generates an equivalence between the spaces of
continuous linear maps. See also `ContinuousLinearEquiv.arrowCongr`. -/
@[simps]
def arrowCongrEquiv (e₁₂ : M₁ ≃SL[σ₁₂] M₂) (e₄₃ : M₄ ≃SL[σ₄₃] M₃) :
    (M₁ →SL[σ₁₄] M₄) ≃ (M₂ →SL[σ₂₃] M₃)

{R₁ : Type u_1}
{R₂ : Type u_2}
{R₃ : Type u_3}
[Semiring R₁]
[Semiring R₂]
[Semiring R₃]
{σ₁₂ : R₁ →+* R₂}
{σ₂₁ : R₂ →+* R₁}
[RingHomInvPair σ₁₂ σ₂₁]
[RingHomInvPair σ₂₁ σ₁₂]
{σ₂₃ : R₂ →+* R₃}
{σ₁₃ : R₁ →+* R₃}
[RingHomCompTriple σ₁₂ σ₂₃ σ₁₃]
{M₁ : Type u_4}
[TopologicalSpace M₁]
[AddCommMonoid M₁]
{M₂ : Type u_6}
[TopologicalSpace M₂]
[AddCommMonoid M₂]
{M₃ : Type u_7}
[TopologicalSpace M₃]
[AddCommMonoid M₃]
{M₄ : Type u_8}
[TopologicalSpace M₄]
[AddCommMonoid M₄]
[Module R₁ M₁]
[Module R₂ M₂]
[Module R₃ M₃]
{R₄ : Type u_9}
[Semiring R₄]
[Module R₄ M₄]
{σ₃₄ : R₃ →+* R₄}
{σ₄₃ : R₄ →+* R₃}
[RingHomInvPair σ₃₄ σ₄₃]
[RingHomInvPair σ₄₃ σ₃₄]
{σ₂₄ : R₂ →+* R₄}
{σ₁₄ : R₁ →+* R₄}
[RingHomCompTriple σ₂₁ σ₁₄ σ₂₄]
[RingHomCompTriple σ₂₄ σ₄₃ σ₂₃]
[RingHomCompTriple σ₁₃ σ₃₄ σ₁₄]
(e₁₂ : M₁ ≃SL[σ₁₂] M₂)
(e₄₃ : M₄ ≃SL[σ₄₃] M₃)
(f : M₁ →SL[σ₁₄] M₄)

(e₁₂.arrowCongrEquiv e₄₃) f = (↑e₄₃).comp (f.comp ↑e₁₂.symm)


theorem toWellOrderExtension_strictMono [Preorder α] [WellFoundedLT α] :
    StrictMono (toWellOrderExtension : α → WellOrderExtension α)

{α : Type u}
[Preorder α]
[WellFoundedLT α]


@[reassoc (attr := simp)]
theorem μ_naturality {m n : M} {X Y : C} (f : X ⟶ Y) :
    (F.obj n).map ((F.obj m).map f) ≫ (F.μ m n).app Y = (F.μ m n).app X ≫ (F.obj _).map f

(F : CategoryTheory.MonoidalFunctor M (CategoryTheory.Functor C C))

CategoryTheory.CategoryStruct.comp ((F.obj n).map ((F.obj m).map f)) ((F.μ m n).app Y) =
  CategoryTheory.CategoryStruct.comp ((F.μ m n).app X) ((F.obj (CategoryTheory.MonoidalCategory.tensorObj m n)).map f)


/--
If `f : X ⟶ Y⟦m⟧`, `n + m = 0` and `ha' : m + a = a'`, this lemma relates the two
morphisms `F.shiftMap f a a' ha'` and `(F.shift a').map (f⟦n⟧')`. Indeed,
via canonical isomorphisms, they both identify to morphisms
`(F.shift a).obj X ⟶ (F.shift a').obj Y`.
-/
lemma shiftIso_hom_app_comp_shiftMap_of_add_eq_zero [F.ShiftSequence G]
    {X Y : C} {m : G} (f : X ⟶ Y⟦m⟧)
    (n : G) (hnm : n + m = 0) (a a' : G) (ha' : m + a = a') :
    (F.shiftIso n a' a (by rw [← ha', ← add_assoc, hnm, zero_add])).hom.app X ≫
      F.shiftMap f a a' ha' =
    (F.shift a').map (f⟦n⟧' ≫ (shiftFunctorCompIsoId C m n
      (by rw [← add_left_inj m, add_assoc, hnm, zero_add, add_zero])).hom.app Y)

(f : X ⟶ (CategoryTheory.shiftFunctor C m).obj Y)

(F.shiftIso n a' a ⋯).hom.app X ≫ F.shiftMap f a a' ha' =
  (F.shift a').map ((CategoryTheory.shiftFunctor C n).map f ≫ (CategoryTheory.shiftFunctorCompIsoId C m n ⋯).hom.app Y)


@[simp]
theorem mapMatrix_refl : (RingEquiv.refl α).mapMatrix = RingEquiv.refl (Matrix m m α)

{m : Type u_2}
{α : Type v}
[Fintype m]
[DecidableEq m]
[NonAssocSemiring α]


theorem zero_lt_sub_of_lt (h : i < a) : 0 < a - i


/-- Continuity at a point of the result of dividing two functions continuous at that point, where
the denominator is nonzero. -/
nonrec theorem ContinuousAt.div (hf : ContinuousAt f a) (hg : ContinuousAt g a) (h₀ : g a ≠ 0) :
    ContinuousAt (f / g) a

{α : Type u_1}
{G₀ : Type u_3}
[GroupWithZero G₀]
[TopologicalSpace G₀]
[HasContinuousInv₀ G₀]
[ContinuousMul G₀]
{f g : α → G₀}
[TopologicalSpace α]
{a : α}
(hf : ContinuousAt f a)
(hg : ContinuousAt g a)
(h₀ : g a ≠ 0)


theorem coe_X : ((X : PowerSeries R) : LaurentSeries R) = single 1 1

(HahnSeries.ofPowerSeries ℤ R) PowerSeries.X = (HahnSeries.single 1) 1


/-- Commutativity of a subgroup -/
structure IsCommutative : Prop where
  /-- `*` is commutative on `H` -/
  is_comm : Std.Commutative (α := H) (· * ·)

{G : Type u_1}
[Group G]
{H : Subgroup G}
(self : H.IsCommutative)


theorem approx_le_fix (i : ℕ) : approx f i ≤ Part.fix f

(f : ((a : α) → Part (β a)) →o (a : α) → Part (β a))


@[simp]
theorem toUnitHom_eq (χ : MulChar R R') : toUnitHom χ = equivToUnitHom χ

{R : Type u_1}
[CommMonoid R]
{R' : Type u_2}
[CommMonoidWithZero R']
(χ : MulChar R R')


@[simp]
theorem deriv_sin : deriv sin = cos


theorem _root_.LinearMap.IsSymmetric.isSelfAdjoint {A : E →L[𝕜] E}
    (hA : (A : E →ₗ[𝕜] E).IsSymmetric) : IsSelfAdjoint A

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[CompleteSpace E]
{A : E →L[𝕜] E}
(hA : (↑A).IsSymmetric)


@[simp]
theorem augment_d_one_zero (C : ChainComplex V ℕ) {X : V} (f : C.X 0 ⟶ X) (w : C.d 1 0 ≫ f = 0) :
    (augment C f w).d 1 0 = f


@[reassoc]
lemma toStalk_stalkMap_toSpec (f) (x) :
    StructureSheaf.toStalk _ _ ≫ (toSpec 𝒜 f).stalkMap x =
      awayToΓ 𝒜 f ≫ (Proj| pbo f).presheaf.Γgerm x

(x : ↑((AlgebraicGeometry.Proj.toLocallyRingedSpace 𝒜).restrict ⋯).toTopCat)

CategoryTheory.CategoryStruct.comp
    (AlgebraicGeometry.StructureSheaf.toStalk (↑(CommRingCat.of (HomogeneousLocalization.Away 𝒜 f)))
      ((AlgebraicGeometry.ProjectiveSpectrum.Proj.toSpec 𝒜 f).val.base x))
    (AlgebraicGeometry.LocallyRingedSpace.Hom.stalkMap (AlgebraicGeometry.ProjectiveSpectrum.Proj.toSpec 𝒜 f) x) =
  CategoryTheory.CategoryStruct.comp (AlgebraicGeometry.ProjectiveSpectrum.Proj.awayToΓ 𝒜 f)
    (((AlgebraicGeometry.Proj.toLocallyRingedSpace 𝒜).restrict ⋯).presheaf.Γgerm x)


/-- This lemma is useful for working with `ℝˣ` -/
theorem sign_apply_eq_of_ne_zero (r : ℝ) (h : r ≠ 0) : sign r = -1 ∨ sign r = 1


theorem image_eta (f : α → β) : f '' s = (fun x => f x) '' s

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


lemma map_comp {i j k : Fin (n + 1 + 1)} (hij : i ≤ j) (hjk : j ≤ k) :
    map F f i k (hij.trans hjk) = map F f i j hij ≫ map F f j k hjk

(F : CategoryTheory.ComposableArrows C n)

CategoryTheory.ComposableArrows.Precomp.map F f i k ⋯ =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.ComposableArrows.Precomp.map F f i j hij)
    (CategoryTheory.ComposableArrows.Precomp.map F f j k hjk)


theorem image_eq {Δ Δ' Δ'' : SimplexCategory} {φ : Δ ⟶ Δ''} {e : Δ ⟶ Δ'} [Epi e] {i : Δ' ⟶ Δ''}
    [Mono i] (fac : e ≫ i = φ) : image φ = Δ'

{Δ Δ' Δ'' : SimplexCategory}
{φ : Δ ⟶ Δ''}
{e : Δ ⟶ Δ'}
[CategoryTheory.Epi e]
{i : Δ' ⟶ Δ''}
[CategoryTheory.Mono i]
(fac : e ≫ i = φ)


@[simp]
theorem finSuccEquiv'_symm_none (i : Fin (n + 1)) : (finSuccEquiv' i).symm none = i


@[simp]
theorem coe_cast_hom : ⇑(castHom α) = ((↑) : ℚ → α)

{α : Type u_3}
[DivisionRing α]
[CharZero α]


/-- The element `0` is left-regular if and only if `R` is trivial. -/
theorem isLeftRegular_zero_iff_subsingleton : IsLeftRegular (0 : R) ↔ Subsingleton R


theorem IsIntegral.minpoly_splits_tower_top [Algebra K L] [IsScalarTower R K L]
    (h : Splits (algebraMap R L) (minpoly R x)) :
    Splits (algebraMap K L) (minpoly K x)

(h : Polynomial.Splits (algebraMap R L) (minpoly R x))

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


lemma map_Ψ₂Sq : (W.map f).Ψ₂Sq = W.Ψ₂Sq.map f

{R : Type r}
{S : Type s}
[CommRing R]
[CommRing S]
(W : WeierstrassCurve R)
(f : R →+* S)

(W.map f).Ψ₂Sq = Polynomial.map f W.Ψ₂Sq


/-- The `balance2` function preserves the ordering invariants. -/
protected theorem Ordered.balance2 {l : RBNode α} {v : α} {r : RBNode α}
    (lv : l.All (cmpLT cmp · v)) (vr : r.All (cmpLT cmp v ·))
    (hl : l.Ordered cmp) (hr : r.Ordered cmp) : (balance2 l v r).Ordered cmp

(lv : Batteries.RBNode.All (fun x => Batteries.RBNode.cmpLT cmp x v) l)

(vr : Batteries.RBNode.All (fun x => Batteries.RBNode.cmpLT cmp v x) r)

Batteries.RBNode.Ordered cmp (l.balance2 v r)


theorem flip_bijective_iff₁ [FiniteDimensional K V₁] : Bijective B.flip ↔ Bijective B

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

Function.Bijective ⇑B.flip ↔ Function.Bijective ⇑B


@[simp]
theorem deriv_div (hc : DifferentiableAt 𝕜 c x) (hd : DifferentiableAt 𝕜 d x) (hx : d x ≠ 0) :
    deriv (fun x => c x / d x) x = (deriv c x * d x - c x * deriv d x) / d x ^ 2

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{x : 𝕜}
{𝕜' : Type u_1}
[NontriviallyNormedField 𝕜']
[NormedAlgebra 𝕜 𝕜']
{c d : 𝕜 → 𝕜'}
(hc : DifferentiableAt 𝕜 c x)
(hd : DifferentiableAt 𝕜 d x)
(hx : d x ≠ 0)


/-- If `L` is an algebraic extension of `K = Frac(A)` and `L` has no zero smul divisors by `A`,
then `L` is the localization of the integral closure `C` of `A` in `L` at `A⁰`. -/
theorem IsIntegralClosure.isLocalization [Algebra.IsAlgebraic K L] :
    IsLocalization (Algebra.algebraMapSubmonoid C A⁰) L

(A : Type u_2)
(K : Type u_3)
[CommRing A]
[Field K]
[IsDomain A]
[Algebra A K]
[IsFractionRing A K]
(L : Type u_4)
[Field L]
(C : Type u_5)
[CommRing C]
[Algebra K L]
[Algebra A L]
[IsScalarTower A K L]
[Algebra C L]
[IsIntegralClosure C A L]
[Algebra A C]
[IsScalarTower A C L]
[Algebra.IsAlgebraic K L]


theorem multiset_sum_sum_index [AddCommMonoid M] [AddCommMonoid N] (f : Multiset (α →₀ M))
    (h : α → M → N) (h₀ : ∀ a, h a 0 = 0)
    (h₁ : ∀ (a : α) (b₁ b₂ : M), h a (b₁ + b₂) = h a b₁ + h a b₂) :
    f.sum.sum h = (f.map fun g : α →₀ M => g.sum h).sum

f.sum.sum h = (Multiset.map (fun g => g.sum h) f).sum


/-- `Real.sinh` as an `Equiv`. -/
@[simps]
def sinhEquiv : ℝ ≃ ℝ


theorem continuous_delayReflRight : Continuous fun p : I × Path x y => delayReflRight p.1 p.2

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

Continuous fun p => Path.delayReflRight p.1 p.2


theorem inseparable_def : (x ~ᵢ y) ↔ 𝓝 x = 𝓝 y

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


/-- If `∀ I > J, P I` implies `P J`, then `P` holds for all submodules. -/
theorem induction {P : Submodule R M → Prop} (hgt : ∀ I, (∀ J < I, P J) → P I) (I : Submodule R M) :
    P I

(hgt : ∀ (I : Submodule R M), (∀ J < I, P J) → P I)


nonrec theorem le_div_iff {a b r : ℝ≥0} (hr : r ≠ 0) : a ≤ b / r ↔ a * r ≤ b


@[simp]
theorem single_sub {β : ι → Type v} [∀ i, AddGroup (β i)] (i : ι) (x y : β i) :
    single i (x - y) = single i x - single i y

{ι : Type u}
[DecidableEq ι]
{β : ι → Type v}
[(i : ι) → AddGroup (β i)]
(i : ι)
(x y : β i)

DFinsupp.single i (x - y) = DFinsupp.single i x - DFinsupp.single i y


@[simp]
theorem coe_sigmaUnique {β : α → Type*} [∀ a, Unique (β a)] :
    (⇑(sigmaUnique α β) : (a : α) × (β a) → α) = Sigma.fst

{α : Type u_2}
{β : α → Type u_1}
[(a : α) → Unique (β a)]


theorem comap_inf_map_of_injective (p q : Submodule R M) : (p.map f ⊓ q.map f).comap f = p ⊓ q

{R : Type u_1}
{R₂ : Type u_3}
{M : Type u_5}
{M₂ : Type u_7}
[Semiring R]
[Semiring R₂]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R₂ M₂]
{σ₁₂ : R →+* R₂}
{F : Type u_9}
[FunLike F M M₂]
[SemilinearMapClass F σ₁₂ M M₂]
[RingHomSurjective σ₁₂]
{f : F}
(hf : Function.Injective ⇑f)
(p q : Submodule R M)

Submodule.comap f (Submodule.map f p ⊓ Submodule.map f q) = p ⊓ q


theorem isLocalExtrOn_const {b : β} : IsLocalExtrOn (fun _ => b) s a

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[Preorder β]
{s : Set α}
{a : α}
{b : β}


@[simp] theorem negSucc_ne_zero (n : Nat) : -[n+1] ≠ 0


@[simp]
theorem coe_sub (f g : CuspForm Γ k) : ⇑(f - g) = f - g

{Γ : Subgroup SL(2, ℤ)}
{k : ℤ}
(f g : CuspForm Γ k)


@[simp]
lemma mem_derivedSet {A : Set X} {x : X} : x ∈ derivedSet A ↔ AccPt x (𝓟 A)

{X : Type u_1}
[TopologicalSpace X]
{A : Set X}
{x : X}


lemma jacobiTheta₂_undef (z : ℂ) {τ : ℂ} (hτ : im τ ≤ 0) : jacobiTheta₂ z τ = 0


@[simp] lemma cocardinal_aleph0_eq_cofinite :
    cocardinal (α := α) isRegular_aleph0 = cofinite

Filter.cocardinal α Cardinal.isRegular_aleph0 = Filter.cofinite


lemma Module.isClosed_support [Module.Finite R M] :
    IsClosed (Module.support R M)

{R : Type u_1}
{M : Type u_3}
[CommRing R]
[AddCommGroup M]
[Module R M]
[Module.Finite R M]


theorem HasBasis.disjoint_iff (hl : l.HasBasis p s) (hl' : l'.HasBasis p' s') :
    Disjoint l l' ↔ ∃ i, p i ∧ ∃ i', p' i' ∧ Disjoint (s i) (s' i')

{α : Type u_1}
{ι : Sort u_4}
{ι' : Sort u_5}
{l l' : Filter α}
{p : ι → Prop}
{s : ι → Set α}
{p' : ι' → Prop}
{s' : ι' → Set α}
(hl : l.HasBasis p s)
(hl' : l'.HasBasis p' s')


theorem Mem.left_unique : Relator.LeftUnique ((· ∈ ·) : α → Part α → Prop)


/-- The explicit left homology data of a short complex of modules that is
given by a kernel and a quotient given by the `LinearMap` API. -/
@[simps]
def moduleCatLeftHomologyData : S.LeftHomologyData

(S : CategoryTheory.ShortComplex (ModuleCat R))


theorem isGLB_biInf {s : Set β} {f : β → α} : IsGLB (f '' s) (⨅ x ∈ s, f x)

{α : Type u_1}
{β : Type u_2}
[CompleteLattice α]
{s : Set β}
{f : β → α}


@[simp, rclike_simps]
theorem conj_ofReal (r : ℝ) : conj (r : K) = (r : K)


/-- Let `0 < r ∈ ℝ` and `j ∈ ℤ`. Then either `j ∈ B'_r` or `B'_r` jumps over `j`. -/
private theorem hit_or_miss' (h : r > 0) :
    j ∈ {beattySeq' r k | k} ∨ ∃ k : ℤ, k ≤ j / r ∧ (j + 1) / r < k + 1

j ∈ {x | ∃ k, beattySeq' r k = x} ∨ ∃ k, ↑k ≤ ↑j / r ∧ (↑j + 1) / r < ↑k + 1


/-- **Darboux's theorem**: the image of a `Set.OrdConnected` set under `f'` is a `Set.OrdConnected`
set, `HasDerivWithinAt` version. -/
theorem Set.OrdConnected.image_hasDerivWithinAt {s : Set ℝ} (hs : OrdConnected s)
    (hf : ∀ x ∈ s, HasDerivWithinAt f (f' x) s x) : OrdConnected (f' '' s)


theorem limNthHom_one : limNthHom f_compat 1 = 1

(f_compat : ∀ (k1 k2 : ℕ) (hk : k1 ≤ k2), (ZMod.castHom ⋯ (ZMod (p ^ k1))).comp (f k2) = f k1)


theorem algebraMap_apply' (p : R[X]) : algebraMap R[X] A⟦X⟧ p = map (algebraMap R A) p

{R : Type u_1}
(A : Type u_2)
[CommSemiring R]
[CommSemiring A]
[Algebra R A]
(p : Polynomial R)

(algebraMap (Polynomial R) (PowerSeries A)) p = (PowerSeries.map (algebraMap R A)) ↑p


@[simp] lemma ofList_append (rs₁ rs₂ : List R) :
    ofList (rs₁ ++ rs₂) = ofList rs₁ ⊔ ofList rs₂

{R : Type u_1}
[Semiring R]
(rs₁ rs₂ : List R)

Ideal.ofList (rs₁ ++ rs₂) = Ideal.ofList rs₁ ⊔ Ideal.ofList rs₂


theorem foldl_ext (f g : α → β → α) (a : α) {l : List β} (H : ∀ a : α, ∀ b ∈ l, f a b = g a b) :
    foldl f a l = foldl g a l

(f g : α → β → α)

(H : ∀ (a : α) (b : β), b ∈ l → f a b = g a b)


/-- `A` is in the `r`-th slice of `𝒜` iff it's in `𝒜` and has cardinality `r`. -/
theorem mem_slice : A ∈ 𝒜 # r ↔ A ∈ 𝒜 ∧ A.card = r

{α : Type u_1}
{𝒜 : Finset (Finset α)}
{A : Finset α}
{r : ℕ}


@[reassoc]
theorem diag_σ {X : C} : diag X ≫ σ = 0

CategoryTheory.Limits.diag X ≫ CategoryTheory.NonPreadditiveAbelian.σ = 0


@[simp]
theorem map₂_none_left (f : α → β → γ) (b : Option β) : map₂ f none b = none

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


theorem sbtw_irrefl_left_right {a b : α} : ¬sbtw a b a

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


/-- See also `Finset.prod_pi_mulSingle`. -/
@[to_additive "See also `Finset.sum_pi_single`."]
lemma prod_pi_mulSingle {α : ι → Type*} [∀ i, CommMonoid (α i)] (i : ι) (f : ∀ i, α i) :
    ∏ j, Pi.mulSingle j (f j) i = f i

{ι : Type u_6}
[Fintype ι]
[DecidableEq ι]
{α : ι → Type u_9}
[(i : ι) → CommMonoid (α i)]
(i : ι)
(f : (i : ι) → α i)


@[simp]
theorem restrictScalars.map_apply {R : Type u₁} {S : Type u₂} [Ring R] [Ring S] (f : R →+* S)
    {M M' : ModuleCat.{v} S} (g : M ⟶ M') (x) : (restrictScalars f).map g x = g x

(x : ↑((ModuleCat.restrictScalars f).obj M))

((ModuleCat.restrictScalars f).map g) x = g x


theorem subset_convexHull : s ⊆ convexHull 𝕜 s

(𝕜 : Type u_1)
{E : Type u_2}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[Module 𝕜 E]
(s : Set E)


protected theorem sub_lt_sub_of_le_of_lt {a b c d : Int}
  (hab : a ≤ b) (hcd : c < d) : a - d < b - c


@[to_additive]
theorem smul_mem_smul : s ∈ f → t ∈ g → s • t ∈ f • g

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


theorem LinearIndependent.span_eq_top_of_card_eq_finrank {ι : Type*} [Nonempty ι]
    [Fintype ι] {b : ι → V} (lin_ind : LinearIndependent K b)
    (card_eq : Fintype.card ι = finrank K V) : span K (Set.range b) = ⊤

(card_eq : Fintype.card ι = FiniteDimensional.finrank K V)


@[simp]
theorem lineMap_eq_right_iff [NoZeroSMulDivisors k V1] {p₀ p₁ : P1} {c : k} :
    lineMap p₀ p₁ c = p₁ ↔ p₀ = p₁ ∨ c = 1

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

(AffineMap.lineMap p₀ p₁) c = p₁ ↔ p₀ = p₁ ∨ c = 1


theorem Nonempty.product (hs : s.Nonempty) (ht : t.Nonempty) : (s ×ˢ t).Nonempty

{α : Type u_1}
{β : Type u_2}
{s : Finset α}
{t : Finset β}
(hs : s.Nonempty)
(ht : t.Nonempty)


theorem IsClosed.interior_union_right (h : IsClosed t) :
    interior (s ∪ t) ⊆ interior s ∪ t

{X : Type u}
{s t : Set X}
[TopologicalSpace X]
(h : IsClosed t)


/-- If a binary fan `t` over `P Q` is a limit cone, then `t.swap` is a limit cone over `Q P`.
-/
@[simps]
def IsLimit.swapBinaryFan {P Q : C} {t : BinaryFan P Q} (I : IsLimit t) : IsLimit t.swap

{t : CategoryTheory.Limits.BinaryFan P Q}

(s : CategoryTheory.Limits.Cone (CategoryTheory.Limits.pair Q P))

I.swapBinaryFan.lift s = I.lift (CategoryTheory.Limits.BinaryFan.swap s)


@[simp]
theorem comp_assoc (f : BiheytingHom γ δ) (g : BiheytingHom β γ) (h : BiheytingHom α β) :
    (f.comp g).comp h = f.comp (g.comp h)

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
{δ : Type u_5}
[BiheytingAlgebra α]
[BiheytingAlgebra β]
[BiheytingAlgebra γ]
[BiheytingAlgebra δ]
(f : BiheytingHom γ δ)
(g : BiheytingHom β γ)
(h : BiheytingHom α β)


theorem iInf_le' (f : ι → α) (i : ι) : iInf f ≤ f i

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


/-- If `V : Π i, G i →ₗᵢ[𝕜] E` is an orthogonal family such that the supremum of the ranges of
`V i` is dense, then `(E, V)` is a Hilbert sum of `G`. -/
theorem IsHilbertSum.mk [∀ i, CompleteSpace <| G i] (hVortho : OrthogonalFamily 𝕜 G V)
    (hVtotal : ⊤ ≤ (⨆ i, LinearMap.range (V i).toLinearMap).topologicalClosure) :
    IsHilbertSum 𝕜 G V


@[simp]
lemma cfc_algebraMap (r : R) (f : R → R) : cfc f (algebraMap R A r) = algebraMap R A (f r)

{R : Type u_1}
{A : Type u_2}
{p : A → Prop}
[CommSemiring R]
[StarRing R]
[MetricSpace R]
[TopologicalSemiring R]
[ContinuousStar R]
[TopologicalSpace A]
[Ring A]
[StarRing A]
[Algebra R A]
[ContinuousFunctionalCalculus R p]
(r : R)
(f : R → R)

cfc f ((algebraMap R A) r) = (algebraMap R A) (f r)


@[simp] lemma head_eraseLast (p : RelSeries r) : p.eraseLast.head = p.head

{α : Type u_1}
{r : Rel α α}
(p : RelSeries r)


/-- The product map of two `C^n` functions is `C^n`. -/
theorem ContDiff.prod_map {f : E → F} {g : E' → F'} (hf : ContDiff 𝕜 n f) (hg : ContDiff 𝕜 n g) :
    ContDiff 𝕜 n (Prod.map f g)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{n : ℕ∞}
{E' : Type u_3}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{F' : Type u_4}
[NormedAddCommGroup F']
[NormedSpace 𝕜 F']
{f : E → F}
{g : E' → F'}
(hf : ContDiff 𝕜 n f)
(hg : ContDiff 𝕜 n g)


/-- `h x (f x / g x)` is continuous under certain conditions, even if the denominator is sometimes
  `0`. See docstring of `ContinuousAt.comp_div_cases`. -/
theorem Continuous.comp_div_cases {f g : α → G₀} (h : α → G₀ → β) (hf : Continuous f)
    (hg : Continuous g) (hh : ∀ a, g a ≠ 0 → ContinuousAt (↿h) (a, f a / g a))
    (h2h : ∀ a, g a = 0 → Tendsto (↿h) (𝓝 a ×ˢ ⊤) (𝓝 (h a 0))) :
    Continuous fun x => h x (f x / g x)

(h : α → G₀ → β)

(hh : ∀ (a : α), g a ≠ 0 → ContinuousAt (↿h) (a, f a / g a))

(h2h : ∀ (a : α), g a = 0 → Filter.Tendsto (↿h) (𝓝 a ×ˢ ⊤) (𝓝 (h a 0)))


@[ext]
theorem RingHom.functions_ext [Finite I] (G : Type*) [NonAssocSemiring G] (g h : (∀ i, f i) →+* G)
    (H : ∀ (i : I) (x : f i), g (single i x) = h (single i x)) : g = h

(H : ∀ (i : I) (x : f i), g (Pi.single i x) = h (Pi.single i x))


theorem one_lt_order [Finite P] [Finite L] : 1 < order P L

(P : Type u_1)
(L : Type u_2)
[Membership P L]
[Configuration.ProjectivePlane P L]
[Finite P]
[Finite L]

1 < Configuration.ProjectivePlane.order P L


theorem exists_eq_tmul_of_forall (x : TensorProduct R M N)
    (h : ∀ (m₁ m₂ : M) (n₁ n₂ : N), ∃ m n, m₁ ⊗ₜ n₁ + m₂ ⊗ₜ n₂ = m ⊗ₜ[R] n) :
    ∃ m n, x = m ⊗ₜ n

(h : ∀ (m₁ m₂ : M) (n₁ n₂ : N), ∃ m n, m₁ ⊗ₜ[R] n₁ + m₂ ⊗ₜ[R] n₂ = m ⊗ₜ[R] n)


/-- The presheaf of abelian groups attached to a `CorePresheafOfModules R`. -/
@[simps]
def presheaf : Cᵒᵖ ⥤ AddCommGrp.{v}

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

M.presheaf.obj X = AddCommGrp.of (M.obj X)


theorem sub_int (h : Irrational x) (m : ℤ) : Irrational (x - m)


theorem IsIrreducible.isPreirreducible (h : IsIrreducible s) : IsPreirreducible s

{X : Type u_1}
[TopologicalSpace X]
{s : Set X}
(h : IsIrreducible s)


/-- **Young's inequality**, a version for nonnegative real numbers. -/
theorem young_inequality_of_nonneg {a b p q : ℝ} (ha : 0 ≤ a) (hb : 0 ≤ b)
    (hpq : p.IsConjExponent q) : a * b ≤ a ^ p / p + b ^ q / q


@[simp]
theorem coe_copy (f : A →⋆ₐ[R] B) (f' : A → B) (h : f' = f) : ⇑(f.copy f' h) = f'

{R : Type u_2}
{A : Type u_3}
{B : Type u_4}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[Star A]
[Semiring B]
[Algebra R B]
[Star B]
(f : A →⋆ₐ[R] B)
(f' : A → B)
(h : f' = ⇑f)


theorem toSmoothPartitionOfUnity_zero_of_zero {i : ι} {x : M} (h : fs i x = 0) :
    fs.toSmoothPartitionOfUnity i x = 0

{ι : Type uι}
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[FiniteDimensional ℝ E]
{H : Type uH}
[TopologicalSpace H]
{I : ModelWithCorners ℝ E H}
{M : Type uM}
[TopologicalSpace M]
[ChartedSpace H M]
[SmoothManifoldWithCorners I M]
{s : Set M}
(fs : SmoothBumpCovering ι I M s)
[T2Space M]
{i : ι}
{x : M}
(h : ↑(fs.toFun i) x = 0)


@[to_additive (attr := simp)]
lemma sup'_inv [SemilatticeSup β] {s : Finset α} (hs : s⁻¹.Nonempty) (f : α → β) :
    sup' s⁻¹ hs f = sup' s hs.of_inv (f ·⁻¹)

{α : Type u_2}
{β : Type u_3}
[DecidableEq α]
[Inv α]
[SemilatticeSup β]
{s : Finset α}
(hs : s⁻¹.Nonempty)
(f : α → β)


@[to_additive (attr := simp)]
lemma Filter.inv_cobounded : (cobounded E)⁻¹ = cobounded E

-Bornology.cobounded E = Bornology.cobounded E


@[simp, mfld_simps]
theorem refl_prod_refl :
    (PartialEquiv.refl α).prod (PartialEquiv.refl β) = PartialEquiv.refl (α × β)


/-- If `L/K` is a field extension and an element `y` of `K` is a root of the minimal polynomial
of an element `x ∈ L`, then `y` maps to `x` under the field embedding. -/
theorem root {x : B} (hx : IsIntegral A x) {y : A} (h : IsRoot (minpoly A x) y) :
    algebraMap A B y = x

{A : Type u_1}
{B : Type u_2}
[Field A]
[Ring B]
[IsDomain B]
[Algebra A B]
{x : B}
(hx : IsIntegral A x)
{y : A}
(h : (minpoly A x).IsRoot y)


theorem semiconjBy_iff_semiconj {f g₁ g₂ : CircleDeg1Lift} :
    SemiconjBy f g₁ g₂ ↔ Semiconj f g₁ g₂

SemiconjBy f g₁ g₂ ↔ Function.Semiconj ⇑f ⇑g₁ ⇑g₂


@[simp]
theorem homOfLE_comp {x y z : X} (h : x ≤ y) (k : y ≤ z) :
    homOfLE h ≫ homOfLE k = homOfLE (h.trans k)

{X : Type u}
[Preorder X]
{x y z : X}
(h : x ≤ y)
(k : y ≤ z)

CategoryTheory.CategoryStruct.comp (CategoryTheory.homOfLE h) (CategoryTheory.homOfLE k) = CategoryTheory.homOfLE ⋯


@[to_additive sum_primeFactors_gcd_add_sum_primeFactors_mul]
theorem prod_primeFactors_gcd_mul_prod_primeFactors_mul {β : Type*} [CommMonoid β] (m n : ℕ)
    (f : ℕ → β) :
    (m.gcd n).primeFactors.prod f * (m * n).primeFactors.prod f =
      m.primeFactors.prod f * n.primeFactors.prod f

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


@[simp]
theorem comp_hom' {M N K : Bimod A B} (f : M ⟶ N) (g : N ⟶ K) :
    (f ≫ g : Hom M K).hom = f.hom ≫ g.hom

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.MonoidalCategory C]
{A B : Mon_ C}
{M N K : Bimod A B}
(f : M ⟶ N)
(g : N ⟶ K)


@[simp]
theorem insertNth_apply_same (i : Fin (n + 1)) (x : α i) (p : ∀ j, α (i.succAbove j)) :
    insertNth i x p i = x

{n : ℕ}
{α : Fin (n + 1) → Type u}
(i : Fin (n + 1))
(x : α i)
(p : (j : Fin n) → α (i.succAbove j))


/-- A (unital) star subsemiring is a non-associative ring which is closed under the `star`
operation. -/
structure StarSubsemiring (R : Type v) [NonAssocSemiring R] [Star R]
    extends Subsemiring R : Type v where
  /-- The `carrier` of a `StarSubsemiring` is closed under the `star` operation. -/
  star_mem' {a} : a ∈ carrier → star a ∈ carrier

{R : Type v}
[NonAssocSemiring R]
[Star R]
(self : StarSubsemiring R)
{a : R}

a ∈ self.carrier → star a ∈ self.carrier


theorem iSup_eq_top (f : ι → α) : iSup f = ⊤ ↔ ∀ b < ⊤, ∃ i, b < f i

{α : Type u_1}
{ι : Sort u_5}
[CompleteLinearOrder α]
(f : ι → α)


/-- Postcomposing `f` with `Prod.snd` is `C^n` -/
theorem ContDiff.snd {f : E → F × G} (hf : ContDiff 𝕜 n f) : ContDiff 𝕜 n fun x => (f x).2

{𝕜 : 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]
{n : ℕ∞}
{f : E → F × G}
(hf : ContDiff 𝕜 n f)


@[ext]
lemma ext' {F G : LaxMonoidalFunctor C D} {α β : F ⟶ G} (w : ∀ X : C, α.app X = β.app X) : α = β

{F G : CategoryTheory.LaxMonoidalFunctor C D}


@[simp]
theorem keys_nil : @keys α β [] = []


theorem continuous_toPOUFun (i : ι) : Continuous (f.toPOUFun i)

{ι : Type u}
{X : Type v}
[TopologicalSpace X]
{s : Set X}
(f : BumpCovering ι X s)
(i : ι)


theorem iSup_le_sum {ι} (f : ι → Cardinal) : iSup f ≤ sum f

{ι : Type u_1}
(f : ι → Cardinal.{max u_1 u_2})


theorem exists_pair_ne (α : Type*) [Nontrivial α] : ∃ x y : α, x ≠ y


/-- Given an ideal `𝓟` of a commutative semiring `R`, we say that a polynomial `f : R[X]`
is *weakly Eisenstein at `𝓟`* if `∀ n, n < f.natDegree → f.coeff n ∈ 𝓟`. -/
@[mk_iff]
structure IsWeaklyEisensteinAt [CommSemiring R] (f : R[X]) (𝓟 : Ideal R) : Prop where
  mem : ∀ {n}, n < f.natDegree → f.coeff n ∈ 𝓟

{R : Type u}
[CommSemiring R]
{f : R[X]}
{𝓟 : Ideal R}
(self : f.IsWeaklyEisensteinAt 𝓟)
{n : ℕ}


{α : Type u_1}
[LinearOrderedCommMonoidWithZero α]
{a : α}


theorem intervalIntegrable_iff_integrableOn_Ioo_of_le [NoAtoms μ] (hab : a ≤ b) :
    IntervalIntegrable f μ a b ↔ IntegrableOn f (Ioo a b) μ

{E : Type u_3}
[NormedAddCommGroup E]
{f : ℝ → E}
{a b : ℝ}
{μ : MeasureTheory.Measure ℝ}
[MeasureTheory.NoAtoms μ]
(hab : a ≤ b)

IntervalIntegrable f μ a b ↔ MeasureTheory.IntegrableOn f (Set.Ioo a b) μ


theorem isCompactOpen_iff_eq_finset_affine_union {X : Scheme} (U : Set X) :
    IsCompact U ∧ IsOpen U ↔ ∃ s : Set X.affineOpens, s.Finite ∧ U = ⋃ i ∈ s, i

{X : AlgebraicGeometry.Scheme}
(U : Set ↑↑X.toPresheafedSpace)

IsCompact U ∧ IsOpen U ↔ ∃ s, s.Finite ∧ U = ⋃ i ∈ s, ↑↑i


lemma dvd_mul_of_div_dvd (h : b ∣ a) (hdiv : a / b ∣ c) : a ∣ b * c

{a b c : ℕ}
(h : b ∣ a)
(hdiv : a / b ∣ c)


lemma sign_mul_inv_abs (a : EReal) : (sign a) * (a.abs : EReal)⁻¹ = a⁻¹


theorem natDegree_neg_le_of_le {p : R[X]} (hp : natDegree p ≤ m) : natDegree (-p) ≤ m

{R : Type u}
{m : ℕ}
[Ring R]
{p : R[X]}
(hp : p.natDegree ≤ m)


theorem ne_one : minpoly G F x ≠ (1 : Polynomial (FixedPoints.subfield G F))

(G : Type u)
[Group G]
(F : Type v)
[Field F]
[MulSemiringAction G F]
[Fintype G]
(x : F)


theorem coe_measurableEquiv : ⇑(EuclideanSpace.measurableEquiv ι) = WithLp.equiv 2 _

⇑(EuclideanSpace.measurableEquiv ι) = ⇑(WithLp.equiv 2 ((i : ι) → (fun x => ℝ) i))


theorem generate_neBot_iff {s : Set (Set α)} :
    NeBot (generate s) ↔ ∀ t, t ⊆ s → t.Finite → (⋂₀ t).Nonempty

(Filter.generate s).NeBot ↔ ∀ t ⊆ s, t.Finite → (⋂₀ t).Nonempty


theorem measure_diff' (s : Set α) (hm : MeasurableSet t) (h_fin : μ t ≠ ∞) :
    μ (s \ t) = μ (s ∪ t) - μ t

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{t : Set α}
(s : Set α)
(hm : MeasurableSet t)
(h_fin : μ t ≠ ⊤)


@[simp, rclike_simps]
theorem div_I (z : K) : z / I = -(z * I)


/-- In a tetrahedron with vertices `x`, `y`, `p`, `q`, any segment `[u, v]` joining the opposite
edges `[x, p]` and `[y, q]` passes through any triangle of vertices `p`, `q`, `z` where
`z ∈ [x, y]`. -/
theorem not_disjoint_segment_convexHull_triple {p q u v x y z : E} (hz : z ∈ segment 𝕜 x y)
    (hu : u ∈ segment 𝕜 x p) (hv : v ∈ segment 𝕜 y q) :
    ¬Disjoint (segment 𝕜 u v) (convexHull 𝕜 {p, q, z})

{𝕜 : Type u_1}
{E : Type u_2}
[LinearOrderedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{p q u v x y z : E}
(hz : z ∈ segment 𝕜 x y)
(hu : u ∈ segment 𝕜 x p)
(hv : v ∈ segment 𝕜 y q)

¬Disjoint (segment 𝕜 u v) ((convexHull 𝕜) {p, q, z})


theorem HasMFDerivAt.mul (hp : HasMFDerivAt I 𝓘(𝕜, F') p z p')
    (hq : HasMFDerivAt I 𝓘(𝕜, F') q z q') :
    HasMFDerivAt I 𝓘(𝕜, F') (p * q) z (p z • q' + q z • p' : E →L[𝕜] F')

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
[SmoothManifoldWithCorners I M]
{z : M}
{F' : Type u_11}
[NormedCommRing F']
[NormedAlgebra 𝕜 F']
{p q : M → F'}
{p' q' : TangentSpace I z →L[𝕜] F'}
(hp : HasMFDerivAt I 𝓘(𝕜, F') p z p')
(hq : HasMFDerivAt I 𝓘(𝕜, F') q z q')

HasMFDerivAt I 𝓘(𝕜, F') (p * q) z (p z • q' + q z • p')


protected theorem mul_max_mul_right (a b c : Nat) : max (a * c) (b * c) = max a b * c


@[simp] theorem modifyHead_nil (f : α → α) : [].modifyHead f = []


/-- The free functor from the Eilenberg-Moore category, constructing an algebra for any object. -/
@[simps]
def free : C ⥤ Algebra T

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


/-- In the space `ℝ × ℝ`, the Hausdorff measure coincides exactly with the Lebesgue measure. -/
@[simp]
theorem hausdorffMeasure_prod_real : (μH[2] : Measure (ℝ × ℝ)) = volume


theorem sub_le_of_le_add {d} (h : μ ≤ d + ν) : μ - ν ≤ d

{α : Type u_1}
{m : MeasurableSpace α}
{μ ν d : MeasureTheory.Measure α}
(h : μ ≤ d + ν)


theorem DirectSum.coeLinearMap_eq_dfinsupp_sum [DecidableEq σ] [DecidableEq R] [DecidableEq M]
    (x : DirectSum M fun i : M => ↥(weightedHomogeneousSubmodule R w i)) :
    (coeLinearMap fun i : M => weightedHomogeneousSubmodule R w i) x =
      DFinsupp.sum x (fun _ x => ↑x)

(x : DirectSum M fun i => ↥(MvPolynomial.weightedHomogeneousSubmodule R w i))

(DirectSum.coeLinearMap fun i => MvPolynomial.weightedHomogeneousSubmodule R w i) x = DFinsupp.sum x fun x x_1 => ↑x_1


@[to_additive (attr := mono)]
theorem div_subset_div : s₁ ⊆ t₁ → s₂ ⊆ t₂ → s₁ / s₂ ⊆ t₁ / t₂

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

s₁ ⊆ t₁ → s₂ ⊆ t₂ → s₁ - s₂ ⊆ t₁ - t₂


theorem Nodup.rotate_congr_iff {l : List α} (hl : l.Nodup) {i j : ℕ} :
    l.rotate i = l.rotate j ↔ i % l.length = j % l.length ∨ l = []

{α : Type u}
{l : List α}
(hl : l.Nodup)
{i j : ℕ}


theorem ContinuousOn.div (hf : ContinuousOn f s) (hg : ContinuousOn g s) (h₀ : ∀ x ∈ s, g x ≠ 0) :
    ContinuousOn (f / g) s

{α : Type u_1}
{G₀ : Type u_3}
[GroupWithZero G₀]
[TopologicalSpace G₀]
[HasContinuousInv₀ G₀]
[ContinuousMul G₀]
{f g : α → G₀}
[TopologicalSpace α]
{s : Set α}
(hf : ContinuousOn f s)
(hg : ContinuousOn g s)
(h₀ : ∀ x ∈ s, g x ≠ 0)


/-- To check that a property holds almost everywhere with respect to an additive Haar measure, it
suffices to check it almost everywhere along all translates of a given vector subspace. This is an
instance of a disintegration argument for additive Haar measures. -/
lemma ae_mem_of_ae_add_linearMap_mem [LocallyCompactSpace F] {s : Set F} (hs : MeasurableSet s)
    (h : ∀ y, ∀ᵐ x ∂μ, y + L x ∈ s) : ∀ᵐ y ∂ν, y ∈ s

(h : ∀ (y : F), ∀ᵐ (x : E) ∂μ, y + L x ∈ s)


/-- In a category in which every monomorphism is split, every monomorphism splits. This is not an
    instance because it would create an instance loop. -/
theorem isSplitMono_of_mono [SplitMonoCategory C] {X Y : C} (f : X ⟶ Y) [Mono f] : IsSplitMono f

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


protected theorem add_right_cancel' (c : ℤ) (h : a + c ≡ b + c [ZMOD n]) : a ≡ b [ZMOD n]

{n a b : ℤ}
(c : ℤ)
(h : a + c ≡ b + c [ZMOD n])


@[simp]
theorem preimage_add_const_Ici : (fun x => x + a) ⁻¹' Ici b = Ici (b - a)

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

(fun x => x + a) ⁻¹' Set.Ici b = Set.Ici (b - a)


lemma mul_eq_top_iff : a * b = ⊤ ↔ a ≠ 0 ∧ b = ⊤ ∨ a = ⊤ ∧ b ≠ 0

{α : Type u_1}
[DecidableEq α]
[MulZeroClass α]
{a b : WithTop α}


theorem LinearIndependent.span_repr_eq [Nontrivial R] (x) :
    Span.repr R (Set.range v) x =
      (hv.repr x).equivMapDomain (Equiv.ofInjective _ hv.injective)

{ι : Type u'}
{R : Type u_2}
{M : Type u_4}
{v : ι → M}
[Ring R]
[AddCommGroup M]
[Module R M]
(hv : LinearIndependent R v)
[Nontrivial R]
(x : ↥(Submodule.span R (Set.range v)))

Span.repr R (Set.range v) x = Finsupp.equivMapDomain (Equiv.ofInjective v ⋯) (hv.repr x)


/-- If `A` is a non-unital `R`-algebra, then the subgroup of units of `Unitization R A` whose
scalar part is `1 : R` (i.e., `Unitization.unitsFstOne`) is isomorphic to the group of units of
`PreQuasiregular A`. -/
@[simps]
def unitsFstOne_mulEquiv_quasiregular : unitsFstOne R A ≃* (PreQuasiregular A)ˣ

(R : Type u_1)
{A : Type u_2}
[CommSemiring R]
[NonUnitalSemiring A]
[Module R A]
[IsScalarTower R A A]
[SMulCommClass R A A]
(x : ↥(Unitization.unitsFstOne R A))

↑((Unitization.unitsFstOne_mulEquiv_quasiregular R) x) = PreQuasiregular.equiv (↑↑x).snd


theorem mul_eq_max' {a b : Cardinal} (h : ℵ₀ ≤ a * b) : a * b = max a b


theorem le_add_right (a b : Ordinal) : a ≤ a + b


/-- subtypes by an all-false predicate are false. -/
theorem Subtype.isEmpty_of_false {p : α → Prop} (hp : ∀ a, ¬p a) : IsEmpty (Subtype p)

{α : Sort u_1}
{p : α → Prop}
(hp : ∀ (a : α), ¬p a)


@[elementwise, simp]
theorem ofRestrict_invApp {C : Type*} [Category C] (X : PresheafedSpace C) {Y : TopCat}
    {f : Y ⟶ TopCat.of X.carrier} (h : OpenEmbedding f) (U : Opens (X.restrict h).carrier) :
    (PresheafedSpace.IsOpenImmersion.ofRestrict X h).invApp U = 𝟙 _

(X : AlgebraicGeometry.PresheafedSpace C)

(U : TopologicalSpace.Opens ↑↑(X.restrict h))

AlgebraicGeometry.PresheafedSpace.IsOpenImmersion.invApp (X.ofRestrict h) U =
  𝟙 ((X.restrict h).presheaf.obj (Opposite.op U))


theorem toPartENat_apply_of_aleph0_le {c : Cardinal} (h : ℵ₀ ≤ c) : toPartENat c = ⊤

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