theorem unfold_zsmul {α} [AddCommGroup α] (n : ℤ) (x y : α)
    (h : smulg n x = y) : n • x = y

{α : Type u_1}
[AddCommGroup α]
(n : ℤ)
(x y : α)
(h : Mathlib.Tactic.Abel.smulg n x = y)


theorem carrier.smul_mem (c x : A) (hx : x ∈ carrier f_deg q) : c • x ∈ carrier f_deg q

(q :
  ↑↑(AlgebraicGeometry.Spec.locallyRingedSpaceObj
          (CommRingCat.of (HomogeneousLocalization.Away 𝒜 f))).toPresheafedSpace)

(hx : x ∈ AlgebraicGeometry.ProjIsoSpecTopComponent.FromSpec.carrier f_deg q)

c • x ∈ AlgebraicGeometry.ProjIsoSpecTopComponent.FromSpec.carrier f_deg q


theorem prec' {n f g h} (hf : @Primrec' n f) (hg : @Primrec' n g) (hh : @Primrec' (n + 2) h) :
    @Primrec' n fun v => (f v).rec (g v) fun y IH : ℕ => h (y ::ᵥ IH ::ᵥ v)

{n : ℕ}
{f g : Mathlib.Vector ℕ n → ℕ}
{h : Mathlib.Vector ℕ (n + 2) → ℕ}
(hf : Nat.Primrec' f)
(hg : Nat.Primrec' g)
(hh : Nat.Primrec' h)

Nat.Primrec' fun v => Nat.rec (g v) (fun y IH => h (y ::ᵥ IH ::ᵥ v)) (f v)


theorem eval_comp
    {η η' : f ⟶ g} {θ θ' : g ⟶ h} {ι : f ⟶ h}
    (pf_η : η = η') (pf_θ : θ = θ') (pf_ηθ : η' ≫ θ' = ι) :
    η ≫ θ = ι

(pf_ηθ : CategoryTheory.CategoryStruct.comp η' θ' = ι)

CategoryTheory.CategoryStruct.comp η θ = ι


theorem Iio_mem_nhdsSet_Ioc (h : b < c) : Iio c ∈ 𝓝ˢ (Ioc a b)

{α : Type u_1}
[LinearOrder α]
[TopologicalSpace α]
[OrderClosedTopology α]
{a b c : α}
(h : b < c)


theorem Integrable.ae_convolution_exists (hf : Integrable f ν) (hg : Integrable g μ) :
    ∀ᵐ x ∂μ, ConvolutionExistsAt f g x L ν

{𝕜 : Type u𝕜}
{G : Type uG}
{E : Type uE}
{E' : Type uE'}
{F : Type uF}
[NormedAddCommGroup E]
[NormedAddCommGroup E']
[NormedAddCommGroup F]
{f : G → E}
{g : G → E'}
[NontriviallyNormedField 𝕜]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜 E']
[NormedSpace 𝕜 F]
(L : E →L[𝕜] E' →L[𝕜] F)
[MeasurableSpace G]
{μ ν : MeasureTheory.Measure G}
[AddGroup G]
[MeasurableAdd₂ G]
[MeasurableNeg G]
[MeasureTheory.SFinite μ]
[μ.IsAddRightInvariant]
[MeasureTheory.SFinite ν]
(hf : MeasureTheory.Integrable f ν)
(hg : MeasureTheory.Integrable g μ)

∀ᵐ (x : G) ∂μ, MeasureTheory.ConvolutionExistsAt f g x L ν


theorem NormedAddCommGroup.cauchy_series_of_le_geometric' {C : ℝ} {u : ℕ → α} {r : ℝ} (hr : r < 1)
    (h : ∀ n, ‖u n‖ ≤ C * r ^ n) : CauchySeq fun n ↦ ∑ k ∈ range (n + 1), u k

{α : Type u_1}
[SeminormedAddCommGroup α]
{C : ℝ}
{u : ℕ → α}
{r : ℝ}
(hr : r < 1)
(h : ∀ (n : ℕ), ‖u n‖ ≤ C * r ^ n)

CauchySeq fun n => ∑ k ∈ Finset.range (n + 1), u k


theorem iUnion_Ioo_of_tendsto [Finite ι] {I : Box ι} {J : ℕ → Box ι} (hJ : Monotone J)
    (hl : Tendsto (lower ∘ J) atTop (𝓝 I.lower)) (hu : Tendsto (upper ∘ J) atTop (𝓝 I.upper)) :
    ⋃ n, Box.Ioo (J n) = Box.Ioo I

(hl : Filter.Tendsto (BoxIntegral.Box.lower ∘ J) Filter.atTop (𝓝 I.lower))

(hu : Filter.Tendsto (BoxIntegral.Box.upper ∘ J) Filter.atTop (𝓝 I.upper))

⋃ n, BoxIntegral.Box.Ioo (J n) = BoxIntegral.Box.Ioo I


@[simp]
theorem inl_sub [AddGroup R] [AddGroup A] (r₁ r₂ : R) :
    (inl (r₁ - r₂) : Unitization R A) = inl r₁ - inl r₂

{R : Type u_3}
(A : Type u_4)
[AddGroup R]
[AddGroup A]
(r₁ r₂ : R)

Unitization.inl (r₁ - r₂) = Unitization.inl r₁ - Unitization.inl r₂


@[to_additive (attr := simp) (reorder := 9 10)]
theorem map_pow [Monoid G] [Monoid H] [MonoidHomClass F G H] (f : F) (a : G) :
    ∀ n : ℕ, f (a ^ n) = f a ^ n

{G : Type u_7}
{H : Type u_8}
{F : Type u_9}
[FunLike F G H]
[Monoid G]
[Monoid H]
[MonoidHomClass F G H]
(f : F)
(a : G)
(n : ℕ)


theorem IsTrail.reverse {u v : V} (p : G.Walk u v) (h : p.IsTrail) : p.reverse.IsTrail

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


theorem basis_iff_basis'_subset_ground : M.Basis I X ↔ M.Basis' I X ∧ X ⊆ M.E

{α : Type u_1}
{M : Matroid α}
{I X : Set α}


/-- If `exp R x.fst` converges to `e` then `exp R x` converges to `inl e + inr (e • x.snd)`. -/
theorem hasSum_expSeries_of_smul_comm
    (x : tsze R M) (hx : MulOpposite.op x.fst • x.snd = x.fst • x.snd)
    {e : R} (h : HasSum (fun n => expSeries 𝕜 R n fun _ => x.fst) e) :
    HasSum (fun n => expSeries 𝕜 (tsze R M) n fun _ => x) (inl e + inr (e • x.snd))

(h : HasSum (fun n => (NormedSpace.expSeries 𝕜 R n) fun x_1 => x.fst) e)

HasSum (fun n => (NormedSpace.expSeries 𝕜 (tsze R M) n) fun x_1 => x)
  (TrivSqZeroExt.inl e + TrivSqZeroExt.inr (e • x.snd))


@[simp]
theorem sUnion_bounded_univ : ⋃₀ { s : Set α | IsBounded s } = univ

∀ {x : Bornology α}, ⋃₀ {s | Bornology.IsBounded s} = Set.univ


theorem comap_prod_prod (f : M →ₗ[R] M₂) (g : M →ₗ[R] M₃) (p : Submodule R M₂)
    (q : Submodule R M₃) : comap (prod f g) (p.prod q) = comap f p ⊓ comap g q

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

Submodule.comap (f.prod g) (p.prod q) = Submodule.comap f p ⊓ Submodule.comap g q


lemma stableUnderGeneralization_sUnion (S : Set (Set X))
    (H : ∀ s ∈ S, StableUnderGeneralization s) : StableUnderGeneralization (⋃₀ S)


@[to_additive]
theorem map_one₂ {_ : MulOneClass M} {_ : MulOneClass N} {_ : CommMonoid P} (f : M →* N →* P)
    (n : N) : f 1 n = 1

{M : Type uM}
{N : Type uN}
{P : Type uP}

∀ {x : AddZeroClass M} {x_1 : AddZeroClass N} {x_2 : AddCommMonoid P} (f : M →+ N →+ P) (n : N), (f 0) n = 0


theorem Nodup.map {f : α → β} {s : Multiset α} (hf : Injective f) : Nodup s → Nodup (map f s)

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{s : Multiset α}
(hf : Function.Injective f)


@[simp]
theorem range_logb : range (logb b) = univ

{b : ℝ}
(b_pos : 0 < b)
(b_ne_one : b ≠ 1)


@[simp] theorem appendList_cons (arr : Array α) (a : α) (l : List α) :
    arr ++ (a :: l) = arr.push a ++ l

{α : Type u_1}
(arr : Array α)
(a : α)
(l : List α)


@[simp]
theorem isSuccLimit_iff : IsSuccLimit a ↔ IsMin a

{α : Type u_1}
[PartialOrder α]
[SuccOrder α]
{a : α}
[IsSuccArchimedean α]


@[simp]
theorem Matrix.toLinearMapₛₗ₂'_toMatrix' (B : (n → R₁) →ₛₗ[σ₁] (m → R₂) →ₛₗ[σ₂] N₂) :
    Matrix.toLinearMapₛₗ₂' R σ₁ σ₂ (LinearMap.toMatrixₛₗ₂' R B) = B

(Matrix.toLinearMapₛₗ₂' R σ₁ σ₂) ((LinearMap.toMatrixₛₗ₂' R) B) = B


theorem Ioo_subset_Ioi_self : Ioo a b ⊆ Ioi a


@[to_additive]
theorem Finite.smul_set : s.Finite → (a • s).Finite

{α : Type u_2}
{β : Type u_3}
[SMul α β]
{s : Set β}
{a : α}


@[to_additive]
lemma isTorsionFree_iff_torsion_eq_bot {G} [CommGroup G] :
    IsTorsionFree G ↔ CommGroup.torsion G = ⊥

AddMonoid.IsTorsionFree G ↔ AddCommGroup.torsion G = ⊥


@[simp]
theorem comp_inj_right {p : Path a b} {q₁ q₂ : Path b c} : p.comp q₁ = p.comp q₂ ↔ q₁ = q₂

{V : Type u}
[Quiver V]
{a b c : V}
{p : Quiver.Path a b}
{q₁ q₂ : Quiver.Path b c}


theorem karoubiUniversal_functor_eq : (karoubiUniversal C D).functor = functorExtension C D

(C : Type u_1)
(D : Type u_2)
[CategoryTheory.Category.{u_4, u_1} C]
[CategoryTheory.Category.{u_5, u_2} D]
[CategoryTheory.IsIdempotentComplete D]

(CategoryTheory.Idempotents.karoubiUniversal C D).functor = CategoryTheory.Idempotents.functorExtension C D


/-- The diagonal elements of a complex hermitian matrix are real. -/
theorem IsHermitian.coe_re_apply_self {A : Matrix n n α} (h : A.IsHermitian) (i : n) :
    (re (A i i) : α) = A i i

{α : Type u_1}
{n : Type u_4}
[RCLike α]
{A : Matrix n n α}
(h : A.IsHermitian)
(i : n)


@[ext]
lemma ext {X Y : Mon_ C} {f g : X ⟶ Y} (w : f.hom = g.hom) : f = g

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.MonoidalCategory C]
{X Y : Mon_ C}
{f g : X ⟶ Y}
(w : f.hom = g.hom)


@[simp]
theorem convexJoin_iUnion_right (s : Set E) (t : ι → Set E) :
    convexJoin 𝕜 s (⋃ i, t i) = ⋃ i, convexJoin 𝕜 s (t i)

{ι : Sort u_1}
{𝕜 : Type u_2}
{E : Type u_3}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[Module 𝕜 E]
(s : Set E)
(t : ι → Set E)


/-- The cosine of an angle in a right-angled triangle multiplied by the hypotenuse equals the
adjacent side. -/
theorem cos_angle_add_mul_norm_of_inner_eq_zero {x y : V} (h : ⟪x, y⟫ = 0) :
    Real.cos (angle x (x + y)) * ‖x + y‖ = ‖x‖

{V : Type u_1}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
{x y : V}
(h : ⟪x, y⟫_ℝ = 0)

Real.cos (InnerProductGeometry.angle x (x + y)) * ‖x + y‖ = ‖x‖


theorem max_zero_left : ∀ a : Ordinal, max 0 a = a


/-- Drop the augmentation. -/
@[simps!]
def drop : Augmented C ⥤ CosimplicialObject C

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

∀ {X Y : CategoryTheory.Comma (CategoryTheory.CosimplicialObject.const C) (𝟭 (CategoryTheory.CosimplicialObject C))}
  (f : X ⟶ Y), CategoryTheory.CosimplicialObject.Augmented.drop.map f = f.right


theorem log_neg (h0 : 0 < x) (h1 : x < 1) : log x < 0


lemma Base.mapEmbedding {B : Set α} (hB : M.Base B) (f : α ↪ β) :
    (M.mapEmbedding f).Base (f '' B)

{α : Type u_1}
{β : Type u_2}
{M : Matroid α}
{B : Set α}
(hB : M.Base B)
(f : α ↪ β)


theorem dropWhile_append {xs ys : List α} :
    (xs ++ ys).dropWhile p =
      if (xs.dropWhile p).isEmpty then ys.dropWhile p else xs.dropWhile p ++ ys

{α : Type u_1}
{p : α → Bool}
{xs ys : List α}

List.dropWhile p (xs ++ ys) =
  if (List.dropWhile p xs).isEmpty = true then List.dropWhile p ys else List.dropWhile p xs ++ ys


theorem pi_Ioc_ae_eq_pi_Icc {s : Set ι} {f g : ∀ i, α i} :
    (pi s fun i => Ioc (f i) (g i)) =ᵐ[Measure.pi μ] pi s fun i => Icc (f i) (g i)

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

[∀ (i : ι), MeasureTheory.SigmaFinite (μ i)]

[∀ (i : ι), MeasureTheory.NoAtoms (μ i)]

(s.pi fun i => Set.Ioc (f i) (g i)) =ᵐ[MeasureTheory.Measure.pi μ] s.pi fun i => Set.Icc (f i) (g i)


lemma IndepFun.meas_inter {β γ : Type*} [mβ : MeasurableSpace β] [mγ : MeasurableSpace γ]
    {f : Ω → β} {g : Ω → γ} (hfg : IndepFun f g κ μ)
    {s t : Set Ω} (hs : MeasurableSet[mβ.comap f] s) (ht : MeasurableSet[mγ.comap g] t) :
    ∀ᵐ a ∂μ, κ a (s ∩ t) = κ a s * κ a t

(hfg : ProbabilityTheory.Kernel.IndepFun f g κ μ)

∀ᵐ (a : α) ∂μ, (κ a) (s ∩ t) = (κ a) s * (κ a) t


theorem negSucc_eq' (m : Nat) : -[m+1] = -m - 1


(𝕜 : Type u_1)
[NontriviallyNormedField 𝕜]
(𝕜' : Type u_3)
[NonUnitalSeminormedRing 𝕜']
[NormedSpace 𝕜 𝕜']
[IsScalarTower 𝕜 𝕜' 𝕜']
[SMulCommClass 𝕜 𝕜' 𝕜']


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

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


/-- The obvious projection functor from structured arrows. -/
@[simps!]
def proj (S : D) (T : C ⥤ D) : StructuredArrow S T ⥤ C

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
(S : D)
(T : CategoryTheory.Functor C D)

∀ {X Y : CategoryTheory.Comma (CategoryTheory.Functor.fromPUnit S) T} (f : X ⟶ Y),
  (CategoryTheory.StructuredArrow.proj S T).map f = f.right


@[reassoc (attr := simp)]
theorem μ_naturalityᵣ {m n n' : M} (g : n ⟶ n') (X : C) :
    (F.map g).app ((F.obj m).obj X) ≫ (F.μ m n').app X =
      (F.μ m n).app X ≫ (F.map (m ◁ g)).app X

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

CategoryTheory.CategoryStruct.comp ((F.map g).app ((F.obj m).obj X)) ((F.μ m n').app X) =
  CategoryTheory.CategoryStruct.comp ((F.μ m n).app X) ((F.map (CategoryTheory.MonoidalCategory.whiskerLeft m g)).app X)


/-- The equivalence, given by swapping factors, between `C × D` and `D × C`.
-/
@[simps!]
def braiding : C × D ≌ D × C

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

(CategoryTheory.Prod.braiding C D).counitIso.inv.app X =
  (CategoryTheory.CategoryStruct.id X.1, CategoryTheory.CategoryStruct.id X.2)


theorem normed_neg (f : ContDiffBump (0 : E)) (x : E) : f.normed μ (-x) = f.normed μ x

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[HasContDiffBump E]
[MeasurableSpace E]
{μ : MeasureTheory.Measure E}
(f : ContDiffBump 0)
(x : E)


/-- The power series expansion of `Complex.cos`. -/
theorem Complex.hasSum_cos (z : ℂ) :
    HasSum (fun n : ℕ => (-1) ^ n * z ^ (2 * n) / ↑(2 * n)!) (Complex.cos z)

HasSum (fun n => (-1) ^ n * z ^ (2 * n) / ↑(2 * n)!) (Complex.cos z)


/-- The underlying relation of the tripartite-from-triangles graph.

Two vertices are related iff there exists a triangle index containing them both. -/
@[mk_iff] inductive Rel (t : Finset (α × β × γ)) : α ⊕ β ⊕ γ → α ⊕ β ⊕ γ → Prop
| in₀₁ ⦃a b c⦄ : (a, b, c) ∈ t → Rel t (in₀ a) (in₁ b)
| in₁₀ ⦃a b c⦄ : (a, b, c) ∈ t → Rel t (in₁ b) (in₀ a)
| in₀₂ ⦃a b c⦄ : (a, b, c) ∈ t → Rel t (in₀ a) (in₂ c)
| in₂₀ ⦃a b c⦄ : (a, b, c) ∈ t → Rel t (in₂ c) (in₀ a)
| in₁₂ ⦃a b c⦄ : (a, b, c) ∈ t → Rel t (in₁ b) (in₂ c)
| in₂₁ ⦃a b c⦄ : (a, b, c) ∈ t → Rel t (in₂ c) (in₁ b)

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

∀ (a a_1 : α ⊕ β ⊕ γ),
  SimpleGraph.TripartiteFromTriangles.Rel t a a_1 ↔
    (∃ a_2 b c, (a_2, b, c) ∈ t ∧ a = Sum3.in₀ a_2 ∧ a_1 = Sum3.in₁ b) ∨
      (∃ a_2 b c, (a_2, b, c) ∈ t ∧ a = Sum3.in₁ b ∧ a_1 = Sum3.in₀ a_2) ∨
        (∃ a_2 b c, (a_2, b, c) ∈ t ∧ a = Sum3.in₀ a_2 ∧ a_1 = Sum3.in₂ c) ∨
          (∃ a_2 b c, (a_2, b, c) ∈ t ∧ a = Sum3.in₂ c ∧ a_1 = Sum3.in₀ a_2) ∨
            (∃ a_2 b c, (a_2, b, c) ∈ t ∧ a = Sum3.in₁ b ∧ a_1 = Sum3.in₂ c) ∨
              ∃ a_2 b c, (a_2, b, c) ∈ t ∧ a = Sum3.in₂ c ∧ a_1 = Sum3.in₁ b


theorem toAlgEquiv_injective [FaithfulSMul G A] :
    Function.Injective (MulSemiringAction.toAlgEquiv R A : G → A ≃ₐ[R] A)

{G : Type u_2}
(R : Type u_3)
(A : Type u_4)
[CommSemiring R]
[Semiring A]
[Algebra R A]
[Group G]
[MulSemiringAction G A]
[SMulCommClass G R A]
[FaithfulSMul G A]

Function.Injective (MulSemiringAction.toAlgEquiv R A)


@[simp]
theorem inclusion_mk {S T : NonUnitalStarSubalgebra R A} (h : S ≤ T) (x : A) (hx : x ∈ S) :
    inclusion h ⟨x, hx⟩ = ⟨x, h hx⟩

{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)
(x : A)
(hx : x ∈ S)

(NonUnitalStarSubalgebra.inclusion h) ⟨x, hx⟩ = ⟨x, ⋯⟩


@[simp]
theorem length_dropSlice (i j : ℕ) (xs : List α) :
    (List.dropSlice i j xs).length = xs.length - min j (xs.length - i)


/-- Shows that $(e^{X})^k = e^{kX}$. -/
theorem exp_pow_eq_rescale_exp [Algebra ℚ A] (k : ℕ) : exp A ^ k = rescale (k : A) (exp A)

{A : Type u_1}
[CommRing A]
[Algebra ℚ A]
(k : ℕ)

PowerSeries.exp A ^ k = (PowerSeries.rescale ↑k) (PowerSeries.exp A)


theorem norm_eq_zero_iff {f : Lp E p μ} (hp : 0 < p) : ‖f‖ = 0 ↔ f = 0

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup E]
{f : ↥(MeasureTheory.Lp E p μ)}
(hp : 0 < p)


theorem exists_frobenius_solution_fractionRing {a : FractionRing (𝕎 k)} (ha : a ≠ 0) :
    ∃ᵉ (b ≠ 0) (m : ℤ), φ b * a = (p : FractionRing (𝕎 k)) ^ m * b

(p : ℕ)
[hp : Fact (Nat.Prime p)]
{k : Type u_1}
[Field k]
[CharP k p]
[IsAlgClosed k]
{a : FractionRing (WittVector p k)}
(ha : a ≠ 0)

∃ b, b ≠ 0 ∧ ∃ m, (IsFractionRing.fieldEquivOfRingEquiv (WittVector.frobeniusEquiv p k)) b * a = ↑p ^ m * b


theorem erase_ssubset {a : α} {s : Finset α} (h : a ∈ s) : s.erase a ⊂ s

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


theorem of_isKan_whisker [HasLeftKanLift f g] (t : LeftLift f g) {x : B} (h : x ⟶ c)
    (H : IsKan (t.whisker h)) (i : t.whisker h ≅ (lanLiftLeftLift f g).whisker h) :
    LanLift.CommuteWith f g h

(t : CategoryTheory.Bicategory.LeftLift f g)

(i : t.whisker h ≅ (CategoryTheory.Bicategory.lanLiftLeftLift f g).whisker h)

CategoryTheory.Bicategory.LanLift.CommuteWith f g h


theorem τ_apply_fromCoset : τ (fromCoset ⟨f.range, 1, one_leftCoset _⟩) = ∞

(Grp.SurjectiveOfEpiAuxs.tau f) (Grp.SurjectiveOfEpiAuxs.XWithInfinity.fromCoset ⟨↑(MonoidHom.range f), ⋯⟩) =
  Grp.SurjectiveOfEpiAuxs.XWithInfinity.infinity


theorem natDegree_sub_le (p q : R[X]) : natDegree (p - q) ≤ max (natDegree p) (natDegree q)

(p - q).natDegree ≤ max p.natDegree q.natDegree


@[simp]
theorem comap_dist_left_atTop (c : α) : comap (dist c) atTop = cobounded α

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

Filter.comap (dist c) Filter.atTop = Bornology.cobounded α


@[to_additive]
private lemma devosMulRel_iff :
    DevosMulRel x y ↔
      (x.1 * x.2).card < (y.1 * y.2).card ∨
        (x.1 * x.2).card = (y.1 * y.2).card ∧ y.1.card + y.2.card < x.1.card + x.2.card ∨
          (x.1 * x.2).card = (y.1 * y.2).card ∧
            x.1.card + x.2.card = y.1.card + y.2.card ∧ x.1.card < y.1.card

{α : Type u_1}
[Group α]
[DecidableEq α]
{x y : Finset α × Finset α}


/-- Isomorphism between `M ∗ PUnit` and `M`. -/
@[simps! (config := .asFn)]
def coprodUnit : AddMonoid.Coprod M PUnit ≃+ M


/-- `Xᵢ` satisfies the strong law of large numbers along all integers. This follows from the
corresponding fact along the sequences `c^n`, and the fact that any integer can be sandwiched
between `c^n` and `c^(n+1)` with comparably small error if `c` is close enough to `1`
(which is formalized in `tendsto_div_of_monotone_of_tendsto_div_floor_pow`). -/
theorem strong_law_aux7 :
    ∀ᵐ ω, Tendsto (fun n : ℕ => (∑ i ∈ range n, X i ω) / n) atTop (𝓝 𝔼[X 0])

(X : ℕ → Ω → ℝ)

(hint : MeasureTheory.Integrable (X 0) ℙ)

(hindep : Pairwise fun i j => ProbabilityTheory.IndepFun (X i) (X j) ℙ)

(hident : ∀ (i : ℕ), ProbabilityTheory.IdentDistrib (X i) (X 0) ℙ ℙ)

(hnonneg : ∀ (i : ℕ) (ω : Ω), 0 ≤ X i ω)

∀ᵐ (ω : Ω), Filter.Tendsto (fun n => (∑ i ∈ Finset.range n, X i ω) / ↑n) Filter.atTop (𝓝 (∫ (a : Ω), X 0 a))


theorem zip_map' (f : α → β) (g : α → γ) :
    ∀ l : List α, zip (l.map f) (l.map g) = l.map fun a => (f a, g a)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
(f : α → β)
(g : α → γ)
(l : List α)

(List.map f l).zip (List.map g l) = List.map (fun a => (f a, g a)) l


@[simp] lemma smoothNumbers_one : smoothNumbers 1 = {1}


/-- The augmented Čech nerve construction, as a functor from `Arrow C`. -/
@[simps!]
def augmentedCechNerve : Arrow C ⥤ SimplicialObject.Augmented C

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

∀ {X Y : SimplexCategoryᵒᵖ} (g : X ⟶ Y),
  (CategoryTheory.SimplicialObject.augmentedCechNerve.obj f).left.map g =
    CategoryTheory.Limits.WidePullback.lift (CategoryTheory.Limits.WidePullback.base fun x => f.hom)
      (fun i => CategoryTheory.Limits.WidePullback.π (fun x => f.hom) ((SimplexCategory.Hom.toOrderHom g.unop) i)) ⋯


lemma iIndepSets.meas_iInter [Fintype ι] (h : iIndepSets π κ μ) (hs : ∀ i, s i ∈ π i) :
    ∀ᵐ a ∂μ, κ a (⋂ i, s i) = ∏ i, κ a (s i)

(h : ProbabilityTheory.Kernel.iIndepSets π κ μ)

∀ᵐ (a : α) ∂μ, (κ a) (⋂ i, s i) = ∏ i : ι, (κ a) (s i)


@[ext]
lemma left_tensor_tensorObj₃_ext {j : I} {A : C} (Z : C)
    (f g : Z ⊗ tensorObj X₁ (tensorObj X₂ X₃) j ⟶ A)
    [H : HasGoodTensorTensor₂₃ X₁ X₂ X₃]
    [hZ : HasLeftTensor₃ObjExt Z X₁ X₂ X₃ j]
    (h : ∀ (i₁ i₂ i₃ : I) (h : i₁ + i₂ + i₃ = j),
      (_ ◁ ιTensorObj₃ X₁ X₂ X₃ i₁ i₂ i₃ j h) ≫ f =
        (_ ◁ ιTensorObj₃ X₁ X₂ X₃ i₁ i₂ i₃ j h) ≫ g) : f = g

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

[X₁.HasTensor (CategoryTheory.GradedObject.Monoidal.tensorObj X₂ X₃)]

(f g :
  CategoryTheory.MonoidalCategory.tensorObj Z
      (CategoryTheory.GradedObject.Monoidal.tensorObj X₁ (CategoryTheory.GradedObject.Monoidal.tensorObj X₂ X₃) j) ⟶
    A)

[hZ : CategoryTheory.GradedObject.HasLeftTensor₃ObjExt Z X₁ X₂ X₃ j]

(h :
  ∀ (i₁ i₂ i₃ : I) (h : i₁ + i₂ + i₃ = j),
    CategoryTheory.CategoryStruct.comp
        (CategoryTheory.MonoidalCategory.whiskerLeft Z
          (CategoryTheory.GradedObject.Monoidal.ιTensorObj₃ X₁ X₂ X₃ i₁ i₂ i₃ j h))
        f =
      CategoryTheory.CategoryStruct.comp
        (CategoryTheory.MonoidalCategory.whiskerLeft Z
          (CategoryTheory.GradedObject.Monoidal.ιTensorObj₃ X₁ X₂ X₃ i₁ i₂ i₃ j h))
        g)


theorem Nat.card_eq_card_units_add_one [GroupWithZero α] [Finite α] :
    Nat.card α = Nat.card αˣ + 1

{α : Type u_1}
[GroupWithZero α]
[Finite α]


theorem positivize_sat {s x v} (w : s.sat' x v) :
    (positivizeConstraint s x).sat' (positivizeCoeffs s x) v

{s : Lean.Omega.Constraint}
{x v : Lean.Omega.Coeffs}
(w : s.sat' x v = true)

(Lean.Omega.positivizeConstraint s x).sat' (Lean.Omega.positivizeCoeffs s x) v = true


theorem LipschitzWith.locallyBoundedVariationOn {f : ℝ → E} {C : ℝ≥0} (hf : LipschitzWith C f)
    (s : Set ℝ) : LocallyBoundedVariationOn f s

{E : Type u_2}
[PseudoEMetricSpace E]
{f : ℝ → E}
{C : ℝ≥0}
(hf : LipschitzWith C f)
(s : Set ℝ)


/-- A set `s` is preconnected if and only if
for every cover by two closed sets that are disjoint on `s`,
it is contained in one of the two covering sets. -/
theorem isPreconnected_iff_subset_of_disjoint_closed :
    IsPreconnected s ↔
      ∀ u v, IsClosed u → IsClosed v → s ⊆ u ∪ v → s ∩ (u ∩ v) = ∅ → s ⊆ u ∨ s ⊆ v

{α : Type u}
[TopologicalSpace α]
{s : Set α}

IsPreconnected s ↔ ∀ (u v : Set α), IsClosed u → IsClosed v → s ⊆ u ∪ v → s ∩ (u ∩ v) = ∅ → s ⊆ u ∨ s ⊆ v


theorem preimage_singleton_nonempty {f : α → β} {y : β} : (f ⁻¹' {y}).Nonempty ↔ y ∈ range f

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{y : β}


theorem IsClosed.completeSpace_coe [CompleteSpace α] {s : Set α} (hs : IsClosed s) :
    CompleteSpace s

{α : Type u}
[UniformSpace α]
[CompleteSpace α]
{s : Set α}
(hs : IsClosed s)


/-- For every nonzero ideal `I` of `v`, there are finitely many maximal ideals `v` such that
`v^-(val_v(I))` is not the unit ideal. -/
theorem finite_mulSupport_inv {I : Ideal R} (hI : I ≠ 0) :
    (mulSupport fun v : HeightOneSpectrum R => (v.asIdeal : FractionalIdeal R⁰ K) ^
      (-((Associates.mk v.asIdeal).count (Associates.mk I).factors : ℤ))).Finite

{R : Type u_1}
[CommRing R]
{K : Type u_2}
[Field K]
[Algebra R K]
[IsFractionRing R K]
[IsDedekindDomain R]
{I : Ideal R}
(hI : I ≠ 0)

(Function.mulSupport fun v => ↑v.asIdeal ^ (-↑((Associates.mk v.asIdeal).count (Associates.mk I).factors))).Finite


lemma mapHomologicalComplex_upToQuasiIso_Q_inverts_quasiIso :
    (HomologicalComplex.quasiIso C c).IsInvertedBy
      (F.mapHomologicalComplex c ⋙ HomologicalComplexUpToQuasiIso.Q)


/-- **Orzech's theorem** for Noetherian module: if `R` is a ring (not necessarily commutative),
`M` is a Noetherian `R`-module, `N` is a submodule, `f : N →ₗ[R] M` is surjective, then `f` is also
injective. -/
theorem IsNoetherian.injective_of_surjective_of_submodule
    {N : Submodule R M} (f : N →ₗ[R] M) (hf : Surjective f) : Injective f

{R : Type u_1}
{M : Type u_2}
[Ring R]
[AddCommGroup M]
[Module R M]
[IsNoetherian R M]
{N : Submodule R M}
(f : ↥N →ₗ[R] M)
(hf : Function.Surjective ⇑f)


/-- Alternatization of a continuous multilinear map. -/
@[simps (config := .lemmasOnly) apply_toContinuousMultilinearMap]
def alternatization : ContinuousMultilinearMap R (fun _ : ι => M) N →+ M [⋀^ι]→L[R] N

(f : ContinuousMultilinearMap R (fun x => M) N)

(ContinuousMultilinearMap.alternatization f).toContinuousMultilinearMap =
  ∑ σ : Equiv.Perm ι, Equiv.Perm.sign σ • ContinuousMultilinearMap.domDomCongr σ f


protected lemma add_comm : a + b = b + a


/-- Another version of `Polynomial.sum_bernoulli`. -/
theorem bernoulli_eq_sub_sum (n : ℕ) :
    (n.succ : ℚ) • bernoulli n =
      monomial n (n.succ : ℚ) - ∑ k ∈ Finset.range n, ((n + 1).choose k : ℚ) • bernoulli k

↑n.succ • Polynomial.bernoulli n =
  (Polynomial.monomial n) ↑n.succ - ∑ k ∈ Finset.range n, ↑((n + 1).choose k) • Polynomial.bernoulli k


lemma mapDerivedCategoryFactorsh_hom_app (K : CochainComplex C₁ ℤ) :
    F.mapDerivedCategoryFactorsh.hom.app ((HomotopyCategory.quotient _ _).obj K) =
      F.mapDerivedCategory.map ((DerivedCategory.quotientCompQhIso C₁).hom.app K) ≫
        F.mapDerivedCategoryFactors.hom.app K ≫
        (DerivedCategory.quotientCompQhIso C₂).inv.app _ ≫
        DerivedCategory.Qh.map ((F.mapHomotopyCategoryFactors (ComplexShape.up ℤ)).inv.app K)

F.mapDerivedCategoryFactorsh.hom.app ((HomotopyCategory.quotient C₁ (ComplexShape.up ℤ)).obj K) =
  F.mapDerivedCategory.map ((DerivedCategory.quotientCompQhIso C₁).hom.app K) ≫
    F.mapDerivedCategoryFactors.hom.app K ≫
      (DerivedCategory.quotientCompQhIso C₂).inv.app ((F.mapHomologicalComplex (ComplexShape.up ℤ)).obj K) ≫
        DerivedCategory.Qh.map ((F.mapHomotopyCategoryFactors (ComplexShape.up ℤ)).inv.app K)


theorem cases {p : Prop → Prop} (h1 : p True) (h2 : p False) (a) : p a

{p : Prop → Prop}
(h1 : p True)
(h2 : p False)
(a : Prop)


@[ext]
lemma SecondObj.ext (z₁ z₂ : SecondObj P S) (h : ∀ (Y Z : C) (g : Z ⟶ Y) (f : Y ⟶ X)
    (hf : S.arrows f), (Pi.π _ ⟨Y, Z, g, f, hf⟩ : SecondObj P S ⟶ _) z₁ =
      (Pi.π _ ⟨Y, Z, g, f, hf⟩ : SecondObj P S ⟶ _) z₂) : z₁ = z₂

{P : CategoryTheory.Functor Cᵒᵖ (Type (max v u))}

(z₁ z₂ : CategoryTheory.Equalizer.Sieve.SecondObj P S)

(h :
  ∀ (Y Z : C) (g : Z ⟶ Y) (f : Y ⟶ X) (hf : S.arrows f),
    CategoryTheory.Limits.Pi.π (fun f => P.obj (Opposite.op f.snd.fst)) ⟨Y, ⟨Z, ⟨g, ⟨f, hf⟩⟩⟩⟩ z₁ =
      CategoryTheory.Limits.Pi.π (fun f => P.obj (Opposite.op f.snd.fst)) ⟨Y, ⟨Z, ⟨g, ⟨f, hf⟩⟩⟩⟩ z₂)


/-- Postcompose a partial equivalence with an equivalence.
We modify the source and target to have better definitional behavior. -/
@[simps!]
def transEquiv (e : PartialEquiv α β) (f' : β ≃ γ) : PartialEquiv α γ

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

∀ (a : α), ↑(e.transEquiv f') a = f' (↑e a)


lemma isZero_single_comp_eval (j i : ι) (hi : i ≠ j) : IsZero (single V c j ⋙ eval V c i)

CategoryTheory.Limits.IsZero (HomologicalComplex.single V c j ⋙ HomologicalComplex.eval V c i)


theorem Set.coe_eq_subtype (s : Set α) : ↥s = { x // x ∈ s }


/-- Given rings `R` and `S` of characteristic `p`, with `R` being perfect,
any homomorphism `R →+* S` can be lifted to a homomorphism `R →+* Perfection S p`. -/
@[simps]
noncomputable def lift (R : Type u₁) [CommSemiring R] [CharP R p] [PerfectRing R p]
    (S : Type u₂) [CommSemiring S] [CharP S p] : (R →+* S) ≃ (R →+* Ring.Perfection S p)

(p : ℕ)
[hp : Fact (Nat.Prime p)]
(R : Type u₁)
[CommSemiring R]
[CharP R p]
[PerfectRing R p]
(S : Type u₂)
[CommSemiring S]
[CharP S p]
(f : R →+* S)
(r : R)
(n : ℕ)

↑(((Perfection.lift p R S) f) r) n = f ((⇑↑(frobeniusEquiv R p).symm)^[n] r)


@[to_additive]
theorem hasProd_fintype [Fintype β] (f : β → α) : HasProd f (∏ b, f b)

{α : Type u_1}
{β : Type u_2}
[CommMonoid α]
[TopologicalSpace α]
[Fintype β]
(f : β → α)


@[simp, norm_cast]
theorem coe_real_complex_mul (r : ℝ) (z : ℂ) : (r • z : ℍ) = ↑r * ↑z


@[simp]
theorem antidiagonal_zero : @antidiagonal α 0 = {(0, 0)}


@[simp]
theorem preimage_inv (s : Set α) : r.inv.preimage s = r.image s

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


@[simp]
theorem symmDiff_sup_inf : a ∆ b ⊔ a ⊓ b = a ⊔ b

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


theorem Subalgebra.inv_mem_of_algebraic {x : A} (hx : _root_.IsAlgebraic K (x : L)) :
    (x⁻¹ : L) ∈ A

{K : Type u_3}
{L : Type u_4}
[Field K]
[Field L]
[Algebra K L]
(A : Subalgebra K L)
{x : ↥A}
(hx : IsAlgebraic K ↑x)


theorem fourierIntegral_real_eq (f : ℝ → E) (w : ℝ) :
    fourierIntegral f w = ∫ v : ℝ, 𝐞 (-(v * w)) • f v

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
(f : ℝ → E)
(w : ℝ)

Real.fourierIntegral f w = ∫ (v : ℝ), Real.fourierChar (-(v * w)) • f v


/-- `{a}.max' _` is `a`. -/
@[simp]
theorem max'_singleton (a : α) : ({a} : Finset α).max' (singleton_nonempty _) = a


theorem all_dual {P : α → Prop} : ∀ {t : Ordnode α}, All P (dual t) ↔ All P t

{α : Type u_1}
{P : α → Prop}
{t : Ordnode α}


@[simp]
theorem cthickening_thickening (hε : 0 ≤ ε) (hδ : 0 < δ) (s : Set E) :
    cthickening ε (thickening δ s) = cthickening (ε + δ) s

{E : Type u_2}
[SeminormedAddCommGroup E]
[NormedSpace ℝ E]
{δ ε : ℝ}
(hε : 0 ≤ ε)
(hδ : 0 < δ)
(s : Set E)

Metric.cthickening ε (Metric.thickening δ s) = Metric.cthickening (ε + δ) s


/-- Given `u : α → γ` a uniform inducing map, a family `𝓕 : ι → β → α` is uniformly equicontinuous
iff the family `𝓕'`, obtained by composing each function of `𝓕` by `u`, is uniformly
equicontinuous. -/
theorem UniformInducing.uniformEquicontinuous_iff {F : ι → β → α} {u : α → γ}
    (hu : UniformInducing u) : UniformEquicontinuous F ↔ UniformEquicontinuous ((u ∘ ·) ∘ F)

{ι : Type u_1}
{α : Type u_7}
{β : Type u_9}
{γ : Type u_11}
[uα : UniformSpace α]
[uβ : UniformSpace β]
[uγ : UniformSpace γ]
{F : ι → β → α}
{u : α → γ}
(hu : UniformInducing u)

UniformEquicontinuous F ↔ UniformEquicontinuous ((fun x => u ∘ x) ∘ F)


theorem adjoin_le_iff {S : NonUnitalSubalgebra R A} {s : Set A} : adjoin R s ≤ S ↔ s ⊆ S

{R : Type u}
{A : Type v}
[CommSemiring R]
[NonUnitalNonAssocSemiring A]
[Module R A]
[IsScalarTower R A A]
[SMulCommClass R A A]
{S : NonUnitalSubalgebra R A}
{s : Set A}

NonUnitalAlgebra.adjoin R s ≤ S ↔ s ⊆ ↑S


@[simp]
theorem coe_prodAssoc [Module R E₂] [Module R E₃] :
    (prodAssoc R E E₂ E₃ : (E × E₂) × E₃ → E × E₂ × E₃) = Equiv.prodAssoc E E₂ E₃

(R : Type u_1)
(E : Type u_5)
(E₂ : Type u_6)
(E₃ : Type u_7)
[Semiring R]
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup E₂]
[SeminormedAddCommGroup E₃]
[Module R E]
[Module R E₂]
[Module R E₃]

⇑(LinearIsometryEquiv.prodAssoc R E E₂ E₃) = ⇑(Equiv.prodAssoc E E₂ E₃)


@[simp] lemma dist_up_up (x y : β) : dist (ULift.up x) (ULift.up y) = dist x y

{β : Type u_2}
[PseudoMetricSpace β]
(x y : β)

dist { down := x } { down := y } = dist x y


/-- **Portmanteau theorem** -/
theorem le_measure_compl_liminf_of_limsup_measure_le {ι : Type*} {L : Filter ι} {μ : Measure Ω}
    {μs : ι → Measure Ω} [IsProbabilityMeasure μ] [∀ i, IsProbabilityMeasure (μs i)] {E : Set Ω}
    (E_mble : MeasurableSet E) (h : (L.limsup fun i => μs i E) ≤ μ E) :
    μ Eᶜ ≤ L.liminf fun i => μs i Eᶜ

[∀ (i : ι), MeasureTheory.IsProbabilityMeasure (μs i)]

(h : Filter.limsup (fun i => (μs i) E) L ≤ μ E)

μ Eᶜ ≤ Filter.liminf (fun i => (μs i) Eᶜ) L


private theorem minimalPeriod_iterate_eq_div_gcd_aux (h : 0 < gcd (minimalPeriod f x) n) :
    minimalPeriod f^[n] x = minimalPeriod f x / Nat.gcd (minimalPeriod f x) n

(h : 0 < (Function.minimalPeriod f x).gcd n)

Function.minimalPeriod f^[n] x = Function.minimalPeriod f x / (Function.minimalPeriod f x).gcd n


theorem functorPullback_monotone (X : C) :
    Monotone (Sieve.functorPullback F : Sieve (F.obj X) → Sieve X)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
(F : CategoryTheory.Functor C D)
(X : C)


@[to_additive]
theorem Function.Surjective.multipliable_iff_of_hasProd_iff {α' : Type*} [CommMonoid α']
    [TopologicalSpace α'] {e : α' → α} (hes : Function.Surjective e) {f : β → α} {g : γ → α'}
    (he : ∀ {a}, HasProd f (e a) ↔ HasProd g a) : Multipliable f ↔ Multipliable g

(he : ∀ {a : α'}, HasSum f (e a) ↔ HasSum g a)


lemma W_iff_isIso_map_of_adjunction (adj : G ⊣ sheafToPresheaf J A)
    {P₁ P₂ : Cᵒᵖ ⥤ A} (f : P₁ ⟶ P₂) :
    J.W f ↔ IsIso (G.map f)

(J : CategoryTheory.GrothendieckTopology C)

{G : CategoryTheory.Functor (CategoryTheory.Functor Cᵒᵖ A) (CategoryTheory.Sheaf J A)}

(adj : G ⊣ CategoryTheory.sheafToPresheaf J A)


lemma fibration_iff_image_Ici [Preorder α] [Preorder β] (hf : Monotone f) :
    Fibration (· ≥ ·) (· ≥ ·) f ↔ ∀ x, f '' Ici x = Ici (f x)

{α : Type u_1}
{β : Type u_2}
{f : α → β}
[Preorder α]
[Preorder β]
(hf : Monotone f)

Relation.Fibration (fun x x_1 => x ≥ x_1) (fun x x_1 => x ≥ x_1) f ↔ ∀ (x : α), f '' Set.Ici x = Set.Ici (f x)


@[simp]
theorem Int.not_irrational (m : ℤ) : ¬Irrational m


theorem encode_lt_pair (cf cg) :
    encode cf < encode (pair cf cg) ∧ encode cg < encode (pair cf cg)

Encodable.encode cf < Encodable.encode (cf.pair cg) ∧ Encodable.encode cg < Encodable.encode (cf.pair cg)


/-- Shows how the entries of the sequence of the computed continued fraction can be obtained by the
integer parts of the stream of integer and fractional parts.
-/
theorem get?_of_eq_some_of_succ_get?_intFractPair_stream {ifp_succ_n : IntFractPair K}
    (stream_succ_nth_eq : IntFractPair.stream v (n + 1) = some ifp_succ_n) :
    (of v).s.get? n = some ⟨1, ifp_succ_n.b⟩

{ifp_succ_n : GenContFract.IntFractPair K}

(stream_succ_nth_eq : GenContFract.IntFractPair.stream v (n + 1) = some ifp_succ_n)

(GenContFract.of v).s.get? n = some { a := 1, b := ↑ifp_succ_n.b }


lemma predAbove_castSucc_of_le (p i : Fin n) (h : i ≤ p) : p.predAbove (castSucc i) = i


theorem right_unique (hxy : IsCompl x y) (hxz : IsCompl x z) : y = z

{α : Type u_1}
[DistribLattice α]
[BoundedOrder α]
{x y z : α}
(hxy : IsCompl x y)
(hxz : IsCompl x z)


lemma ShortExact.isIso_f_iff {S : ShortComplex C} (hS : S.ShortExact) [Balanced C] :
    IsIso S.f ↔ IsZero S.X₃

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Preadditive C]
{S : CategoryTheory.ShortComplex C}
(hS : S.ShortExact)
[CategoryTheory.Balanced C]

CategoryTheory.IsIso S.f ↔ CategoryTheory.Limits.IsZero S.X₃


/-- **Phragmen-Lindelöf principle** in a strip `U = {z : ℂ | a < re z < b}`.
Let `f g : ℂ → E` be functions such that

* `f` and `g` are differentiable on `U` and are continuous on its closure;
* `‖f z‖` and `‖g z‖` are bounded from above by `A * exp(B * exp(c * |im z|))` on `U` for some
  `c < π / (b - a)`;
* `f z = g z` on the boundary of `U`.

Then `f` is equal to `g` on the closed strip `{z : ℂ | a ≤ re z ≤ b}`.
-/
theorem eqOn_vertical_strip {g : ℂ → E} (hdf : DiffContOnCl ℂ f (re ⁻¹' Ioo a b))
    (hBf : ∃ c < π / (b - a), ∃ B, f =O[comap (_root_.abs ∘ im) atTop ⊓ 𝓟 (re ⁻¹' Ioo a b)]
      fun z ↦ expR (B * expR (c * |z.im|)))
    (hdg : DiffContOnCl ℂ g (re ⁻¹' Ioo a b))
    (hBg : ∃ c < π / (b - a), ∃ B, g =O[comap (_root_.abs ∘ im) atTop ⊓ 𝓟 (re ⁻¹' Ioo a b)]
      fun z ↦ expR (B * expR (c * |z.im|)))
    (ha : ∀ z : ℂ, re z = a → f z = g z) (hb : ∀ z : ℂ, re z = b → f z = g z) :
    EqOn f g (re ⁻¹' Icc a b)

(hdf : DiffContOnCl ℂ f (Complex.re ⁻¹' Set.Ioo a b))

(hBf :
  ∃ c < π / (b - a),
    ∃ B,
      f =O[Filter.comap (abs ∘ Complex.im) Filter.atTop ⊓ 𝓟 (Complex.re ⁻¹' Set.Ioo a b)] fun z =>
        expR (B * expR (c * |z.im|)))

(hdg : DiffContOnCl ℂ g (Complex.re ⁻¹' Set.Ioo a b))

(hBg :
  ∃ c < π / (b - a),
    ∃ B,
      g =O[Filter.comap (abs ∘ Complex.im) Filter.atTop ⊓ 𝓟 (Complex.re ⁻¹' Set.Ioo a b)] fun z =>
        expR (B * expR (c * |z.im|)))

Set.EqOn f g (Complex.re ⁻¹' Set.Icc a b)


protected nonrec theorem HasStrictDerivAt.iterate {f : 𝕜 → 𝕜} {f' : 𝕜}
    (hf : HasStrictDerivAt f f' x) (hx : f x = x) (n : ℕ) :
    HasStrictDerivAt f^[n] (f' ^ n) x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
(x : 𝕜)
{f : 𝕜 → 𝕜}
{f' : 𝕜}
(hf : HasStrictDerivAt f f' x)
(hx : f x = x)
(n : ℕ)


@[to_additive]
lemma tprod_nat_mul_neg [T2Space M] {f : ℤ → M} (hf : Multipliable f) :
    ∏' n : ℕ, (f n * f (-n)) = (∏' n : ℤ, f n) * f 0

{M : Type u_1}
[CommMonoid M]
[TopologicalSpace M]
[ContinuousMul M]
[T2Space M]
{f : ℤ → M}
(hf : Multipliable f)


@[to_additive]
theorem continuousOn_finset_prod {f : ι → X → M} (s : Finset ι) {t : Set X} :
    (∀ i ∈ s, ContinuousOn (f i) t) → ContinuousOn (fun a => ∏ i ∈ s, f i a) t

{ι : Type u_1}
{M : Type u_3}
{X : Type u_5}
[TopologicalSpace X]
[TopologicalSpace M]
[CommMonoid M]
[ContinuousMul M]
{f : ι → X → M}
(s : Finset ι)
{t : Set X}


/-- **Fourier inversion formula**: If a function `f` on a finite-dimensional real inner product
space is integrable, and its Fourier transform `𝓕 f` is also integrable, then `𝓕⁻ (𝓕 f) = f` at
continuity points of `f`. -/
theorem MeasureTheory.Integrable.fourier_inversion
    (hf : Integrable f) (h'f : Integrable (𝓕 f)) {v : V}
    (hv : ContinuousAt f v) : 𝓕⁻ (𝓕 f) v = f v

(hf : MeasureTheory.Integrable f MeasureTheory.volume)

(h'f : MeasureTheory.Integrable (𝓕 f) MeasureTheory.volume)


/-- The functor `Comma L R ⥤ Comma L R` induced by the identity natural transformation on `L` is
    naturally isomorphic to the identity functor. -/
@[simps!]
def mapLeftId : mapLeft R (𝟙 L) ≅ 𝟭 _

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

((CategoryTheory.Comma.mapLeftId L R).inv.app X).left = CategoryTheory.CategoryStruct.id X.left


@[simp]
theorem invOf_neg [Monoid α] [HasDistribNeg α] (a : α) [Invertible a] [Invertible (-a)] :
    ⅟ (-a) = -⅟ a

{α : Type u}
[Monoid α]
[HasDistribNeg α]
(a : α)
[Invertible a]
[Invertible (-a)]


@[simp]
theorem smul_neg (r : M) (x : A) : r • -x = -(r • x)

{M : Type u_1}
{A : Type u_4}
[Monoid M]
[AddGroup A]
[DistribMulAction M A]
(r : M)
(x : A)


/-- Every set is either empty, infinite, or can have its `encard` reduced by a removal. Intended
  for well-founded induction on the value of `encard`. -/
theorem eq_empty_or_encard_eq_top_or_encard_diff_singleton_lt (s : Set α) :
    s = ∅ ∨ s.encard = ⊤ ∨ ∃ a ∈ s, (s \ {a}).encard < s.encard


protected theorem trichotomy₂ {p q : ℝ≥0∞} (hpq : p ≤ q) :
    p = 0 ∧ q = 0 ∨
      p = 0 ∧ q = ∞ ∨
        p = 0 ∧ 0 < q.toReal ∨
          p = ∞ ∧ q = ∞ ∨
            0 < p.toReal ∧ q = ∞ ∨ 0 < p.toReal ∧ 0 < q.toReal ∧ p.toReal ≤ q.toReal

p = 0 ∧ q = 0 ∨
  p = 0 ∧ q = ⊤ ∨
    p = 0 ∧ 0 < q.toReal ∨ p = ⊤ ∧ q = ⊤ ∨ 0 < p.toReal ∧ q = ⊤ ∨ 0 < p.toReal ∧ 0 < q.toReal ∧ p.toReal ≤ q.toReal


theorem eval_eq_smeval : p.eval r = p.smeval r

{R : Type u_1}
[Semiring R]
(r : R)
(p : Polynomial R)


theorem mem_closure_range_iff_nat {e : β → α} {a : α} :
    a ∈ closure (range e) ↔ ∀ n : ℕ, ∃ k : β, dist a (e k) < 1 / ((n : ℝ) + 1)

{α : Type u}
{β : Type v}
[PseudoMetricSpace α]
{e : β → α}
{a : α}

a ∈ closure (Set.range e) ↔ ∀ (n : ℕ), ∃ k, dist a (e k) < 1 / (↑n + 1)


theorem exists_floor (x : ℝ) : ∃ ub : ℤ, (ub : ℝ) ≤ x ∧ ∀ z : ℤ, (z : ℝ) ≤ x → z ≤ ub

∃ ub, ↑ub ≤ x ∧ ∀ (z : ℤ), ↑z ≤ x → z ≤ ub


theorem tendsto_sum_indicator_atTop_iff' [IsFiniteMeasure μ] {s : ℕ → Set Ω}
    (hs : ∀ n, MeasurableSet[ℱ n] (s n)) : ∀ᵐ ω ∂μ,
    Tendsto (fun n => ∑ k ∈ Finset.range n,
      (s (k + 1)).indicator (1 : Ω → ℝ) ω) atTop atTop ↔
    Tendsto (fun n => ∑ k ∈ Finset.range n,
      (μ[(s (k + 1)).indicator (1 : Ω → ℝ)|ℱ k]) ω) atTop atTop

{Ω : Type u_1}
{m0 : MeasurableSpace Ω}
{μ : MeasureTheory.Measure Ω}
{ℱ : MeasureTheory.Filtration ℕ m0}
[MeasureTheory.IsFiniteMeasure μ]
{s : ℕ → Set Ω}
(hs : ∀ (n : ℕ), MeasurableSet (s n))

∀ᵐ (ω : Ω) ∂μ,
  Filter.Tendsto (fun n => ∑ k ∈ Finset.range n, (s (k + 1)).indicator 1 ω) Filter.atTop Filter.atTop ↔
    Filter.Tendsto (fun n => ∑ k ∈ Finset.range n, (μ[(s (k + 1)).indicator 1|↑ℱ k]) ω) Filter.atTop Filter.atTop


lemma Set.Icc.coe_sInf [ConditionallyCompleteLattice α] {a b : α} (h : a ≤ b)
    {S : Set (Set.Icc a b)} (hS : S.Nonempty) : letI := Set.Icc.completeLattice h
    ↑(sInf S) = sInf ((↑) '' S : Set α)

{α : Type u_2}
[ConditionallyCompleteLattice α]
{a b : α}
(h : a ≤ b)
{S : Set ↑(Set.Icc a b)}
(hS : S.Nonempty)


theorem IsPoly.neg {f : (α → ℕ) → ℤ} : IsPoly f → IsPoly (-f)


@[simp]
lemma cotangentSpaceBasis_repr_tmul (r x i) :
    P.cotangentSpaceBasis.repr (r ⊗ₜ .D _ _ x) i = r * aeval P.val (pderiv i x)

{R : Type u}
{S : Type v}
[CommRing R]
[CommRing S]
[Algebra R S]
(P : Algebra.Generators R S)
(r : S)
(x : P.Ring)
(i : P.vars)

(P.cotangentSpaceBasis.repr (r ⊗ₜ[P.Ring] (KaehlerDifferential.D R P.Ring) x)) i =
  r * (MvPolynomial.aeval P.val) ((MvPolynomial.pderiv i) x)


theorem mem_bind : b ∈ (P.bind Q).parts ↔ ∃ A hA, b ∈ (Q A hA).parts

{Q : (i : α) → i ∈ P.parts → Finpartition i}

b ∈ (P.bind Q).parts ↔ ∃ A, ∃ (hA : A ∈ P.parts), b ∈ (Q A hA).parts


@[to_additive]
theorem subsingleton_quotient_top : Subsingleton (G ⧸ (⊤ : Subgroup G))


theorem Ioo_union_Ioo (h₁ : min a b < max c d) (h₂ : min c d < max a b) :
    Ioo a b ∪ Ioo c d = Ioo (min a c) (max b d)

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

Set.Ioo a b ∪ Set.Ioo c d = Set.Ioo (min a c) (max b d)


/-- The length of a path is at least the length of the shortest path -/
theorem shortest_path_spec {a : V} (p : Path r a) : (shortestPath r a).length ≤ p.length

{V : Type u}
[Quiver V]
(r : V)
[Quiver.RootedConnected r]
{a : V}
(p : Quiver.Path r a)

(Quiver.shortestPath r a).length ≤ p.length


/-- This is [grinberg_clifford_2016][] Theorem 12  -/
theorem contractRight_mul_ι (a : M) (b : CliffordAlgebra Q) :
    b * ι Q a⌊d = d a • b - b⌊d * ι Q a

{R : Type u1}
[CommRing R]
{M : Type u2}
[AddCommGroup M]
[Module R M]
{Q : QuadraticForm R M}
(d : Module.Dual R M)
(a : M)
(b : CliffordAlgebra Q)

(CliffordAlgebra.contractRight (b * (CliffordAlgebra.ι Q) a)) d =
  d a • b - (CliffordAlgebra.contractRight b) d * (CliffordAlgebra.ι Q) a


/-- A structure on an oplax functor that promotes an oplax functor to a pseudofunctor.
See `Pseudofunctor.mkOfOplax`.
-/
-- Porting note(#5171): linter not ported yet
-- @[nolint has_nonempty_instance]
-- Porting note: removing primes in structure name because
-- my understanding is that they're no longer needed
structure PseudoCore (F : OplaxFunctor B C) where
  mapIdIso (a : B) : F.map (𝟙 a) ≅ 𝟙 (F.obj a)
  mapCompIso {a b c : B} (f : a ⟶ b) (g : b ⟶ c) : F.map (f ≫ g) ≅ F.map f ≫ F.map g
  mapIdIso_hom : ∀ {a : B}, (mapIdIso a).hom = F.mapId a := by aesop_cat
  mapCompIso_hom :
    ∀ {a b c : B} (f : a ⟶ b) (g : b ⟶ c), (mapCompIso f g).hom = F.mapComp f g := by aesop_cat

{B : Type u₁}
[CategoryTheory.Bicategory B]
{C : Type u₂}
[CategoryTheory.Bicategory C]
{F : CategoryTheory.OplaxFunctor B C}
(self : F.PseudoCore)
{a b c : B}
(f : a ⟶ b)
(g : b ⟶ c)

(self.mapCompIso f g).hom = F.mapComp f g


theorem pow_apply_mem_support {n : ℕ} {x : α} : (f ^ n) x ∈ f.support ↔ x ∈ f.support

{α : Type u_1}
[DecidableEq α]
[Fintype α]
{f : Equiv.Perm α}
{n : ℕ}
{x : α}


theorem inf_sup_distrib_right (s : Finset ι) (f : ι → α) (a : α) :
    s.inf f ⊔ a = s.inf fun i => f i ⊔ a

{α : Type u_2}
{ι : Type u_5}
[DistribLattice α]
[OrderTop α]
(s : Finset ι)
(f : ι → α)
(a : α)


theorem le_one (i : ι) (x : M) : 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)
(i : ι)
(x : M)


theorem IsAntichain.minimals_upperClosure [PartialOrder α] (hs : IsAntichain (· ≤ ·) s) :
    minimals (· ≤ ·) (upperClosure s : Set α) = s

(hs : IsAntichain (fun x x_1 => x ≤ x_1) s)

minimals (fun x x_1 => x ≤ x_1) ↑(upperClosure s) = s


theorem le_lfp {a : α} (h : ∀ b, f b ≤ b → a ≤ b) : a ≤ lfp f

{α : Type u}
[CompleteLattice α]
(f : α →o α)
{a : α}
(h : ∀ (b : α), f b ≤ b → a ≤ b)


lemma _root_.Set.PairwiseDisjoint.isPartition_of_exists_of_ne_empty {α : Type*} {s : Set (Set α)}
    (h₁ : s.PairwiseDisjoint id) (h₂ : ∀ a : α, ∃ x ∈ s, a ∈ x) (h₃ : ∅ ∉ s) :
    Setoid.IsPartition s

{α : Type u_2}
{s : Set (Set α)}
(h₁ : s.PairwiseDisjoint id)
(h₂ : ∀ (a : α), ∃ x ∈ s, a ∈ x)
(h₃ : ∅ ∉ s)


theorem coe_decompose_mul_of_left_mem_of_le (a_mem : a ∈ 𝒜 i) (h : i ≤ n) :
    (decompose 𝒜 (a * b) n : A) = a * decompose 𝒜 b (n - i)

[ContravariantClass ι ι (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1]

↑(((DirectSum.decompose 𝒜) (a * b)) n) = a * ↑(((DirectSum.decompose 𝒜) b) (n - i))


/-- A family of `indicatorConstLp` functions is continuous in the parameter,
if `μ (s y ∆ s x)` tends to zero as `y` tends to `x` for all `x`. -/
theorem continuous_indicatorConstLp_set [Fact (1 ≤ p)] {X : Type*} [TopologicalSpace X]
    {s : X → Set α} {hs : ∀ x, MeasurableSet (s x)} {hμs : ∀ x, μ (s x) ≠ ∞} (hp : p ≠ ∞)
    (h : ∀ x, Tendsto (fun y ↦ μ (s y ∆ s x)) (𝓝 x) (𝓝 0)) :
    Continuous fun x ↦ indicatorConstLp p (hs x) (hμs x) c

(h : ∀ (x : X), Filter.Tendsto (fun y => μ (s y ∆ s x)) (𝓝 x) (𝓝 0))

Continuous fun x => MeasureTheory.indicatorConstLp p ⋯ ⋯ c


lemma uniformContinuous_inl : UniformContinuous (Sum.inl : α → α ⊕ β)

{α : Type ua}
{β : Type ub}
[UniformSpace α]
[UniformSpace β]


lemma isCornerFree_singleton (x : G × G) : IsCornerFree {x}

{G : Type u_1}
[AddCommMonoid G]
(x : G × G)


/-- The projection from a trivial fiber bundle to its base is open. -/
protected theorem quotientMap_proj [Nonempty F] (h : IsHomeomorphicTrivialFiberBundle F proj) :
    QuotientMap proj


@[to_additive]
theorem Multipliable.congr (hf : Multipliable f) (hfg : ∀ b, f b = g b) : Multipliable g

{α : Type u_1}
{β : Type u_2}
[AddCommMonoid α]
[TopologicalSpace α]
{f g : β → α}
(hf : Summable f)
(hfg : ∀ (b : β), f b = g b)


theorem add_one_pos (n : Nat) : 0 < n + 1


@[simp]
theorem multichoose_zero_right (n : ℕ) : multichoose n 0 = 1


@[to_additive]
theorem inv_iff_ker {f : G → H} (hf : IsGroupHom f) (a b : G) : f a = f b ↔ a * b⁻¹ ∈ ker f

{G : Type u_1}
{H : Type u_2}
[Group G]
[Group H]
{f : G → H}
(hf : IsGroupHom f)
(a b : G)


@[simp]
theorem coe_mk (f : α → β) (h : Continuous f) : ⇑(⟨f, h⟩ : C(α, β)) = f

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
(f : α → β)
(h : Continuous f)

⇑{ toFun := f, continuous_toFun := h } = f


theorem supp_eq {α : Type u} (x : F α) :
    supp x = { u | ∀ a f, abs ⟨a, f⟩ = x → u ∈ f '' univ }

{F : Type u → Type u}
[q : QPF F]
{α : Type u}
(x : F α)

Functor.supp x = {u | ∀ (a : (QPF.P F).A) (f : (QPF.P F).B a → α), QPF.abs ⟨a, f⟩ = x → u ∈ f '' Set.univ}


@[simp] theorem takeD_zero (l) (a : α) : takeD 0 l a = []


@[simp]
lemma image_subtype_val_Ioi_Iio {a : α} (b : Ioi a) : Subtype.val '' Iio b = Ioo a b

{α : Type u_1}
[Preorder α]
{a : α}
(b : ↑(Set.Ioi a))


protected theorem point_finite (x : M) : {i | fs i x ≠ 0}.Finite

{ι : 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]
{s : Set M}
(fs : SmoothBumpCovering ι I M s)
(x : M)


/-- The functor `(W.Localization ⥤ D) ⥤ (W.FunctorsInverting D)` induced by the
composition with `W.Q : C ⥤ W.Localization`. -/
@[simps!]
def functor : (W.Localization ⥤ D) ⥤ W.FunctorsInverting D

{C : Type uC}
[CategoryTheory.Category.{uC', uC} C]
(W : CategoryTheory.MorphismProperty C)
(D : Type uD)
[CategoryTheory.Category.{uD', uD} D]

∀ {X Y : CategoryTheory.Functor W.Localization D} (f : X ⟶ Y) (X_1 : C),
  ((CategoryTheory.Localization.Construction.WhiskeringLeftEquivalence.functor W D).map f).app X_1 = f.app (W.Q.obj X_1)


lemma exact_iff_mono_fromOpcycles [S.HasHomology] : S.Exact ↔ Mono S.fromOpcycles

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Preadditive C]
(S : CategoryTheory.ShortComplex C)
[S.HasHomology]

S.Exact ↔ CategoryTheory.Mono S.fromOpcycles


@[measurability]
theorem aemeasurable_iSup {ι} {μ : Measure δ} [Countable ι] {f : ι → δ → α}
    (hf : ∀ i, AEMeasurable (f i) μ) : AEMeasurable (fun b => ⨆ i, f i b) μ

{α : Type u_1}
{δ : Type u_4}
[TopologicalSpace α]
[MeasurableSpace α]
[BorelSpace α]
[MeasurableSpace δ]
[ConditionallyCompleteLinearOrder α]
[OrderTopology α]
[SecondCountableTopology α]
{ι : Sort u_5}
{μ : MeasureTheory.Measure δ}
[Countable ι]
{f : ι → δ → α}
(hf : ∀ (i : ι), AEMeasurable (f i) μ)


@[simp]
theorem rightUnitor_inv (X : C) : (ρ_ X).inv = prod.lift (𝟙 _) (terminal.from X)

(CategoryTheory.MonoidalCategory.rightUnitor X).inv =
  CategoryTheory.Limits.prod.lift (CategoryTheory.CategoryStruct.id X) (CategoryTheory.Limits.terminal.from X)


theorem IsOpen.lowerSemicontinuous_indicator (hs : IsOpen s) (hy : 0 ≤ y) :
    LowerSemicontinuous (indicator s fun _x => y)

{α : Type u_1}
[TopologicalSpace α]
{β : Type u_2}
[Preorder β]
{s : Set α}
{y : β}
[Zero β]
(hs : IsOpen s)
(hy : 0 ≤ y)

LowerSemicontinuous (s.indicator fun _x => y)


@[simp]
theorem mem_product {p : α × β} : p ∈ s ×ˢ t ↔ p.1 ∈ s ∧ p.2 ∈ t

{α : Type u_1}
{β : Type u_2}
{s : Finset α}
{t : Finset β}
{p : α × β}


@[fun_prop]
theorem hasFDerivWithinAt_fst {s : Set (E × F)} :
    HasFDerivWithinAt (@Prod.fst E F) (fst 𝕜 E F) s p

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{p : E × F}
{s : Set (E × F)}

HasFDerivWithinAt Prod.fst (ContinuousLinearMap.fst 𝕜 E F) s p


/-- The `DFinsupp` version of `Finsupp.liftAddHom_singleAddHom`,-/
@[simp, nolint simpNF] -- Porting note: linter claims that simp can prove this, but it can not
theorem liftAddHom_singleAddHom [∀ i, AddCommMonoid (β i)] :
    liftAddHom (β := β) (singleAddHom β) = AddMonoidHom.id (Π₀ i, β i)

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

DFinsupp.liftAddHom (DFinsupp.singleAddHom β) = AddMonoidHom.id (Π₀ (i : ι), β i)


/-- The recognition theorem for ind-objects: `A : Cᵒᵖ ⥤ Type v` is an ind-object if and only if
    `CostructuredArrow yoneda A` is filtered and finally `v`-small.

    Theorem 6.1.5 of [Kashiwara2006] -/
theorem isIndObject_iff (A : Cᵒᵖ ⥤ Type v) : IsIndObject A ↔
    (IsFiltered (CostructuredArrow yoneda A) ∧ FinallySmall.{v} (CostructuredArrow yoneda A))

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

CategoryTheory.Limits.IsIndObject A ↔
  CategoryTheory.IsFiltered (CategoryTheory.CostructuredArrow CategoryTheory.yoneda A) ∧
    CategoryTheory.FinallySmall (CategoryTheory.CostructuredArrow CategoryTheory.yoneda A)


@[to_additive]
theorem mk_left_injective (b : s) : Injective fun a => mk a b

{α : Type u_1}
[AddCancelCommMonoid α]
{s : AddSubmonoid α}
(b : ↥s)

Function.Injective fun a => AddLocalization.mk a b


/-- When a function is `C^n` in a set `s` of unique differentiability, it admits
`ftaylorSeriesWithin 𝕜 f s` as a Taylor series up to order `n` in `s`. -/
theorem contDiff_iff_ftaylorSeries :
    ContDiff 𝕜 n f ↔ HasFTaylorSeriesUpTo n f (ftaylorSeries 𝕜 f)

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{n : ℕ∞}


/-- Transfer `IsPurelyInseparable` across an `AlgEquiv`. -/
theorem AlgEquiv.isPurelyInseparable (e : K ≃ₐ[F] E) [IsPurelyInseparable F K] :
    IsPurelyInseparable F E

{F : Type u}
{E : Type v}
[Field F]
[Field E]
[Algebra F E]
{K : Type w}
[Field K]
[Algebra F K]
(e : K ≃ₐ[F] E)
[IsPurelyInseparable F K]


theorem epi_iff_surjective {X Y : LightProfinite.{u}} (f : X ⟶ Y) :
    Epi f ↔ Function.Surjective f

CategoryTheory.Epi f ↔ Function.Surjective ⇑f


@[simp]
theorem Iic_erase [DecidableEq α] (b : α) : (Iic b).erase b = Iio b

{α : Type u_2}
[PartialOrder α]
[LocallyFiniteOrderBot α]
[DecidableEq α]
(b : α)


@[trans]
protected theorem Reachable.trans {u v w : V} (huv : G.Reachable u v) (hvw : G.Reachable v w) :
    G.Reachable u w

{V : Type u}
{G : SimpleGraph V}
{u v w : V}
(huv : G.Reachable u v)
(hvw : G.Reachable v w)


theorem injective_of_isPartialInv_right {α β} {f : α → β} {g} (H : IsPartialInv f g) (x y b)
    (h₁ : b ∈ g x) (h₂ : b ∈ g y) : x = y

{α : Type u_4}
{β : Sort u_5}
{f : α → β}
{g : β → Option α}
(H : Function.IsPartialInv f g)
(x y : β)
(b : α)
(h₁ : b ∈ g x)
(h₂ : b ∈ g y)


(μ : MeasureTheory.Measure E := by volume_tac)


@[to_additive]
theorem eq_prod_range_div' {M : Type*} [CommGroup M] (f : ℕ → M) (n : ℕ) :
    f n = ∏ i ∈ range (n + 1), if i = 0 then f 0 else f i / f (i - 1)

{M : Type u_6}
[CommGroup M]
(f : ℕ → M)
(n : ℕ)

f n = ∏ i ∈ Finset.range (n + 1), if i = 0 then f 0 else f i / f (i - 1)


@[simp]
lemma LieModule.toEnd_baseChange (x : L) :
    toEnd A (A ⊗[R] L) (A ⊗[R] M) (1 ⊗ₜ x) = (toEnd R L M x).baseChange A

(R : Type u_1)
(A : Type u_2)
(L : Type u_3)
(M : Type u_4)
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
[CommRing A]
[Algebra R A]
(x : L)

(LieModule.toEnd A (A ⊗[R] L) (A ⊗[R] M)) (1 ⊗ₜ[R] x) = LinearMap.baseChange A ((LieModule.toEnd R L M) x)


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

{α : Type u_1}
{G : Type u_2}
[AddCommGroup G]
[UniformSpace G]
[UniformAddGroup G]
[NonarchimedeanAddGroup G]
[CompleteSpace G]
(f : α → G)

Summable f ↔ Filter.Tendsto f Filter.cofinite (𝓝 0)


theorem natDegree_pow_le_of_le (n : ℕ) (hp : natDegree p ≤ m) :
    natDegree (p ^ n) ≤ n * m

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


theorem get?_succ_scanl {i : ℕ} : (scanl f b l).get? (i + 1) =
    ((scanl f b l).get? i).bind fun x => (l.get? i).map fun y => f x y

{α : Type u}
{β : Type v}
{f : β → α → β}
{b : β}
{l : List α}
{i : ℕ}

(List.scanl f b l).get? (i + 1) = ((List.scanl f b l).get? i).bind fun x => Option.map (fun y => f x y) (l.get? i)


/-- At `0` the Gamma function is undefined; by convention we assign it the value `0`. -/
@[simp]
theorem Gamma_zero : Gamma 0 = 0


theorem mk'_eq_zero' {m : M} (s : S) : mk' f m s = 0 ↔ ∃ s' : S, s' • m = 0

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

IsLocalizedModule.mk' f m s = 0 ↔ ∃ s', s' • m = 0


theorem map_id (x : Subobject X) : (map (𝟙 X)).obj x = x

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

(CategoryTheory.Subobject.map (CategoryTheory.CategoryStruct.id X)).obj x = x


@[simp] lemma toEquiv_ofEquiv (a : Specialization α) : toEquiv (ofEquiv a) = a

Specialization.toEquiv (Specialization.ofEquiv a) = a


@[simp] theorem neg_coeffs {l : LinearCombo} : (-l).coeffs = -l.coeffs


@[scoped simp]
theorem map_zsmul_add [AddCommGroup G] [AddGroup H] [AddConstMapClass F G H a b]
    (f : F) (n : ℤ) (x : G) : f (n • a + x) = f x + n • b

{F : Type u_1}
{G : Type u_2}
{H : Type u_3}
[FunLike F G H]
{a : G}
{b : H}
[AddCommGroup G]
[AddGroup H]
[AddConstMapClass F G H a b]
(f : F)
(n : ℤ)
(x : G)


theorem inf_comm (a b : α) : a ⊓ b = b ⊓ a

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


@[simp]
theorem algebraMap_eq_zero_iff (x : R) : algebraMap R (ExteriorAlgebra R M) x = 0 ↔ x = 0

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

(algebraMap R (ExteriorAlgebra R M)) x = 0 ↔ x = 0


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


private lemma binomial_sum_eq (h : n < m) :
    ∑ i ∈ range (n + 1), (n.choose i * (m - n) / ((m - i) * m.choose i) : ℚ) = 1

∑ i ∈ Finset.range (n + 1), ↑(n.choose i) * (↑m - ↑n) / ((↑m - ↑i) * ↑(m.choose i)) = 1


theorem sin_lt_sin_of_lt_of_le_pi_div_two {x y : ℝ} (hx₁ : -(π / 2) ≤ x) (hy₂ : y ≤ π / 2)
    (hxy : x < y) : sin x < sin y

{x y : ℝ}
(hx₁ : -(Real.pi / 2) ≤ x)
(hy₂ : y ≤ Real.pi / 2)
(hxy : x < y)


theorem _root_.LinearIndependent.lt_aleph0_of_finiteDimensional {ι : Type w} [FiniteDimensional K V]
    {v : ι → V} (h : LinearIndependent K v) : #ι < ℵ₀

{K : Type u}
{V : Type v}
[DivisionRing K]
[AddCommGroup V]
[Module K V]
{ι : Type w}
[FiniteDimensional K V]
{v : ι → V}
(h : LinearIndependent K v)


@[to_additive]
theorem IsOpen.exists_smul_mem [IsMinimal M α] (x : α) {U : Set α} (hUo : IsOpen U)
    (hne : U.Nonempty) : ∃ c : M, c • x ∈ U

(M : Type u_1)
{α : Type u_3}
[AddMonoid M]
[TopologicalSpace α]
[AddAction M α]
[AddAction.IsMinimal M α]
(x : α)
{U : Set α}
(hUo : IsOpen U)
(hne : U.Nonempty)


@[to_additive exists_addOrderOf_eq_pow_padic_val_nat_add_exponent]
theorem _root_.Nat.Prime.exists_orderOf_eq_pow_factorization_exponent {p : ℕ} (hp : p.Prime) :
    ∃ g : G, orderOf g = p ^ (exponent G).factorization p

(G : Type u)
[AddMonoid G]
{p : ℕ}
(hp : Nat.Prime p)

∃ g, addOrderOf g = p ^ (AddMonoid.exponent G).factorization p


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

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


theorem IsTrans.swap (r) [IsTrans α r] : IsTrans α (swap r)

{α : Type u}
(r : α → α → Prop)
[IsTrans α r]


@[simp]
lemma map_id (κ : Kernel α β) : map κ id measurable_id = κ

{α : Type u_1}
{β : Type u_2}
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}
(κ : ProbabilityTheory.Kernel α β)


@[simp] theorem castLT_mk (i n m : Nat) (hn : i < n) (hm : i < m) : castLT ⟨i, hn⟩ hm = ⟨i, hm⟩


theorem strictAntiOn_Iic_of_succ_lt [SuccOrder α] [IsSuccArchimedean α] {n : α}
    (hψ : ∀ m, m < n → ψ (succ m) < ψ m) : StrictAntiOn ψ (Set.Iic n)

{α : Type u_1}
{β : Type u_2}
[PartialOrder α]
[Preorder β]
{ψ : α → β}
[SuccOrder α]
[IsSuccArchimedean α]
{n : α}
(hψ : ∀ m < n, ψ (Order.succ m) < ψ m)


@[to_additive]
theorem comp_mul (g : β →*o γ) (f₁ f₂ : α →*o β) : g.comp (f₁ * f₂) = g.comp f₁ * g.comp f₂

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[OrderedAddCommMonoid α]
[OrderedAddCommMonoid β]
[OrderedAddCommMonoid γ]
(g : β →+o γ)
(f₁ f₂ : α →+o β)

g.comp (f₁ + f₂) = g.comp f₁ + g.comp f₂


theorem rel_head!_of_mem [Inhabited I] {i : I} {l : Products I} (hi : i ∈ l.val) :
    i ≤ l.val.head!

{l : Profinite.NobelingProof.Products I}


theorem StarConvex.smul_mem (hs : StarConvex 𝕜 0 s) (hx : x ∈ s) {t : 𝕜} (ht₀ : 0 ≤ t)
    (ht₁ : t ≤ 1) : t • x ∈ s

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedRing 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{x : E}
{s : Set E}
(hs : StarConvex 𝕜 0 s)
(hx : x ∈ s)
{t : 𝕜}
(ht₀ : 0 ≤ t)
(ht₁ : t ≤ 1)


theorem sign_eq_neg_one_iff_neg (a : Int) : sign a = -1 ↔ a < 0


/-- The definitional equality between `(vecCons α p)`-ary heterogeneous functions into `τ`
  and function from `α` to `p`-ary heterogeneous functions into `τ`. -/
@[simps!]
def fromTypes_cons_equiv {n} (α : Type u) (p : Fin n → Type u) (τ : Type u) :
    FromTypes (vecCons α p) τ ≃ (α → FromTypes p τ)

(a : Function.FromTypes (Matrix.vecCons α p) τ)

(Function.fromTypes_cons_equiv α p τ).symm a = a


@[simp] lemma map_add_left_Ioo (a b c : α) :
    (Ioo a b).map (addLeftEmbedding c) = Ioo (c + a) (c + b)

{α : Type u_2}
[OrderedCancelAddCommMonoid α]
[ExistsAddOfLE α]
[LocallyFiniteOrder α]
(a b c : α)

Finset.map (addLeftEmbedding c) (Finset.Ioo a b) = Finset.Ioo (c + a) (c + b)


/-- Definition of `Function.Semiconj` in terms of functional equality. -/
lemma _root_.Function.semiconj_iff_comp_eq : Semiconj f ga gb ↔ f ∘ ga = gb ∘ f

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{ga : α → α}
{gb : β → β}

Function.Semiconj f ga gb ↔ f ∘ ga = gb ∘ f


@[simp] lemma LieModuleEquiv.range_coe {M' : Type*}
    [AddCommGroup M'] [Module R M'] [LieRingModule L M'] (e : M ≃ₗ⁅R,L⁆ M') :
    LieModuleHom.range (e : M →ₗ⁅R,L⁆ M') = ⊤

(R : Type u)
(L : Type v)
[CommRing R]
[LieRing L]
(M : Type u_1)
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
{M' : Type u_2}
[AddCommGroup M']
[Module R M']
[LieRingModule L M']
(e : M ≃ₗ⁅R,L⁆ M')


@[to_additive]
theorem prod_piecewise [DecidableEq α] (s t : Finset α) (f g : α → β) :
    (∏ x ∈ s, (t.piecewise f g) x) = (∏ x ∈ s ∩ t, f x) * ∏ x ∈ s \ t, g x

{α : Type u_3}
{β : Type u_4}
[CommMonoid β]
[DecidableEq α]
(s t : Finset α)
(f g : α → β)

∏ x ∈ s, t.piecewise f g x = (∏ x ∈ s ∩ t, f x) * ∏ x ∈ s \ t, g x


theorem map_sub_range' (a s n : Nat) (h : a ≤ s) :
    map (· - a) (range' s n step) = range' (s - a) n step

List.map (fun x => x - a) (List.range' s n step) = List.range' (s - a) n step


theorem mem_map_of_mem (f : F) {I : Ideal R} {x : R} (h : x ∈ I) : f x ∈ map f I

{R : Type u}
{S : Type v}
{F : Type u_1}
[Semiring R]
[Semiring S]
[FunLike F R S]
(f : F)
{I : Ideal R}
{x : R}
(h : x ∈ I)


@[simp]
lemma univ_map_eval₂Hom (M : n × n → S) :
    (univ R n).map (eval₂Hom f M) = charpoly (Matrix.of M.curry)

{R : Type u_1}
{S : Type u_2}
(n : Type u_3)
[CommRing R]
[CommRing S]
[Fintype n]
[DecidableEq n]
(f : R →+* S)
(M : n × n → S)

Polynomial.map (MvPolynomial.eval₂Hom f M) (Matrix.charpoly.univ R n) = (Matrix.of (Function.curry M)).charpoly


theorem sup_le_of_le_sdiff_left (h : b ≤ c \ a) (hac : a ≤ c) : a ⊔ b ≤ c

{α : Type u_2}
[GeneralizedCoheytingAlgebra α]
{a b c : α}
(h : b ≤ c \ a)
(hac : a ≤ c)


/-- `TransCmp cmp` asserts that `cmp` induces a transitive relation. -/
class TransCmp (cmp : α → α → Ordering) extends OrientedCmp cmp : Prop where
  /-- The comparator operation is transitive. -/
  le_trans : cmp x y ≠ .gt → cmp y z ≠ .gt → cmp x z ≠ .gt

{α : Sort u_1}
{cmp : α → α → Ordering}
[self : Batteries.TransCmp cmp]
{x y z : α}

cmp x y ≠ Ordering.gt → cmp y z ≠ Ordering.gt → cmp x z ≠ Ordering.gt


@[simp]
theorem biUnion_top : (π.biUnion fun _ => ⊤) = π

{ι : Type u_1}
{I : BoxIntegral.Box ι}
(π : BoxIntegral.Prepartition I)


/-- Intermediate stage of assembling the counit. -/
@[simps]
def counitAuxAux (F : (CostructuredArrow yoneda A)ᵒᵖ ⥤ Type v) (s : CostructuredArrow yoneda A) :
    F.obj (op s) ≅ OverArrows (yonedaCollectionPresheafToA F) s.hom

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

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

(s : CategoryTheory.CostructuredArrow CategoryTheory.yoneda A)

∀ (a : F.obj (Opposite.op s)),
  (CategoryTheory.OverPresheafAux.counitAuxAux F s).hom a = CategoryTheory.OverPresheafAux.counitForward F s a


@[reassoc]
theorem tensorHom_def' {X₁ Y₁ X₂ Y₂ : C} (f : X₁ ⟶ Y₁) (g : X₂ ⟶ Y₂) :
    f ⊗ g = X₁ ◁ g ≫ f ▷ Y₂

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

CategoryTheory.MonoidalCategory.tensorHom f g =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.whiskerLeft X₁ g)
    (CategoryTheory.MonoidalCategory.whiskerRight f Y₂)


/-- Build an isomorphism in the category `CommRingCat` from a `RingEquiv` between `CommRingCat`s. -/
@[simps]
def toCommRingCatIso [CommRing X] [CommRing Y] (e : X ≃+* Y) :
    CommRingCat.of X ≅ CommRingCat.of Y

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


@[to_additive] lemma eq_one_iff (h : SemiconjBy a x y): x = 1 ↔ y = 1

{G : Type u_1}
[AddGroup G]
(a : G)
{x y : G}
(h : AddSemiconjBy a x y)


@[simp]
theorem preimage_const_add_Ioc : (fun x => a + x) ⁻¹' Ioc b c = Ioc (b - a) (c - a)

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

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


/-- A block matrix mulitplied by a row partitioned matrix gives a row partitioned matrix -/
lemma fromBlocks_mul_fromRows (A₁ : Matrix n₁ n R) (A₂ : Matrix n₂ n R)
    (B₁₁ : Matrix m₁ n₁ R) (B₁₂ : Matrix m₁ n₂ R) (B₂₁ : Matrix m₂ n₁ R) (B₂₂ : Matrix m₂ n₂ R) :
    fromBlocks B₁₁ B₁₂ B₂₁ B₂₂ * (fromRows A₁ A₂) =
      fromRows (B₁₁ * A₁ + B₁₂ * A₂) (B₂₁ * A₁ + B₂₂ * A₂)

{R : Type u_1}
{m₁ : Type u_3}
{m₂ : Type u_4}
{n : Type u_5}
{n₁ : Type u_6}
{n₂ : Type u_7}
[Fintype n₁]
[Fintype n₂]
[Semiring R]
(A₁ : Matrix n₁ n R)
(A₂ : Matrix n₂ n R)
(B₁₁ : Matrix m₁ n₁ R)
(B₁₂ : Matrix m₁ n₂ R)
(B₂₁ : Matrix m₂ n₁ R)
(B₂₂ : Matrix m₂ n₂ R)

Matrix.fromBlocks B₁₁ B₁₂ B₂₁ B₂₂ * A₁.fromRows A₂ = (B₁₁ * A₁ + B₁₂ * A₂).fromRows (B₂₁ * A₁ + B₂₂ * A₂)


theorem diagonal_apply [Zero α] (d : n → α) (i j) : diagonal d i j = if i = j then d i else 0

{n : Type u_3}
{α : Type v}
[DecidableEq n]
[Zero α]
(d : n → α)
(i j : n)

Matrix.diagonal d i j = if i = j then d i else 0


lemma MapsTo.perm_pow : MapsTo f s s → ∀ n : ℕ, MapsTo (f ^ n) s s

{α : Type u_1}
{f : Equiv.Perm α}
{s : Set α}

Set.MapsTo (⇑f) s s → ∀ (n : ℕ), Set.MapsTo (⇑(f ^ n)) s s


@[simp]
theorem closure_compl : closure sᶜ = (interior s)ᶜ

{X : Type u}
{s : Set X}
[TopologicalSpace X]


/-- The universal property of a strongly cartesian morphism.

This lemma is more flexible with respect to non-definitional equalities than the field
`universal_property'` of `IsStronglyCartesian`. -/
lemma universal_property {R' : 𝒮} {a' : 𝒳} (g : R' ⟶ R) (f' : R' ⟶ S) (hf' : f' = g ≫ f)
    (φ' : a' ⟶ b) [IsHomLift p f' φ'] : ∃! χ : a' ⟶ a, IsHomLift p g χ ∧ χ ≫ φ = φ'

{𝒮 : Type u₁}
{𝒳 : Type u₂}
[CategoryTheory.Category.{v₁, u₁} 𝒮]
[CategoryTheory.Category.{v₂, u₂} 𝒳]
(p : 𝒳 ⥤ 𝒮)
{R S : 𝒮}
{a b : 𝒳}
(f : R ⟶ S)
(φ : a ⟶ b)
[p.IsStronglyCartesian f φ]
{R' : 𝒮}
{a' : 𝒳}
(g : R' ⟶ R)
(f' : R' ⟶ S)
(hf' : f' = g ≫ f)
(φ' : a' ⟶ b)
[p.IsHomLift f' φ']


@[to_additive prod_eq_top_iff]
theorem prod_eq_top_iff {s : Submonoid M} {t : Submonoid N} : s.prod t = ⊤ ↔ s = ⊤ ∧ t = ⊤

{M : Type u_1}
{N : Type u_2}
[MulOneClass M]
[MulOneClass N]
{s : Submonoid M}
{t : Submonoid N}


theorem lt_div_iff (hc : 0 < c) : a < b / c ↔ a * c < b

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


lemma density_mono_set (hκν : fst κ ≤ ν) (a : α) (x : γ) {s s' : Set β} (h : s ⊆ s') :
    density κ ν a x s ≤ density κ ν a x s'

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


theorem exists_mem_Ioc_zpow {x y : ℝ≥0∞} (hx : x ≠ 0) (h'x : x ≠ ∞) (hy : 1 < y) (h'y : y ≠ ⊤) :
    ∃ n : ℤ, x ∈ Ioc (y ^ n) (y ^ (n + 1))

{x y : ENNReal}
(hx : x ≠ 0)
(h'x : x ≠ ⊤)
(hy : 1 < y)
(h'y : y ≠ ⊤)


theorem TendstoLocallyUniformlyOn.tendsto_at (hf : TendstoLocallyUniformlyOn F f p s) {a : α}
    (ha : a ∈ s) : Tendsto (fun i => F i a) p (𝓝 (f a))

{F : ι → α → β}

Filter.Tendsto (fun i => F i a) p (𝓝 (f a))


@[to_additive]
theorem mem_sInf {S : Set (Subsemigroup M)} {x : M} : x ∈ sInf S ↔ ∀ p ∈ S, x ∈ p

{M : Type u_1}
[Mul M]
{S : Set (Subsemigroup M)}
{x : M}


theorem mem_smul_pointwise_iff_exists (m : M) (r : R) (S : Subring R) :
    r ∈ m • S ↔ ∃ s : R, s ∈ S ∧ m • s = r

{M : Type u_1}
{R : Type u_2}
[Monoid M]
[Ring R]
[MulSemiringAction M R]
(m : M)
(r : R)
(S : Subring R)


theorem mem_closure_iff {s : Set R} {x} :
    x ∈ closure s ↔ x ∈ AddSubgroup.closure (Submonoid.closure s : Set R)

{R : Type u}
[Ring R]
{s : Set R}
{x : R}

x ∈ Subring.closure s ↔ x ∈ AddSubgroup.closure ↑(Submonoid.closure s)


@[to_additive (attr := fun_prop) sub]
theorem ContinuousOn.div' (hf : ContinuousOn f s) (hg : ContinuousOn g s) :
    ContinuousOn (fun x => f x / g x) s

{G : Type w}
{α : Type u}
[TopologicalSpace G]
[Div G]
[ContinuousDiv G]
[TopologicalSpace α]
{f g : α → G}
{s : Set α}
(hf : ContinuousOn f s)
(hg : ContinuousOn g s)


@[simp]
theorem norm_one : norm (1 : ℤ√d) = 1


theorem reflectsEpimorphisms_of_preserves_of_reflects (F : C ⥤ D) (G : D ⥤ E)
    [PreservesEpimorphisms G] [ReflectsEpimorphisms (F ⋙ G)] : ReflectsEpimorphisms F

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{E : Type u₃}
[CategoryTheory.Category.{v₃, u₃} E]
(F : C ⥤ D)
(G : D ⥤ E)
[G.PreservesEpimorphisms]
[(F ⋙ G).ReflectsEpimorphisms]


@[to_additive]
theorem closure_eq_mclosure {s : Set G} : closure s = Monoid.Closure (s ∪ Inv.inv ⁻¹' s)

Group.closure s = Monoid.Closure (s ∪ Inv.inv ⁻¹' s)


theorem gcd_dvd_gcd_mul_right (i j k : ℤ) : gcd i j ∣ gcd (i * k) j


/-- A family of submodules in an `R`-module `M` is a submodules basis if it satisfies
some axioms ensuring there is a topology on `M` which is compatible with the module structure and
admits this family as a basis of neighborhoods of zero. -/
structure SubmodulesBasis [TopologicalSpace R] (B : ι → Submodule R M) : Prop where
  /-- Condition for `B` to be a filter basis on `M`. -/
  inter : ∀ i j, ∃ k, B k ≤ B i ⊓ B j
  /-- For any element `m : M` and any set `B` in the basis, `a • m` lies in `B` for all
    `a` sufficiently close to `0`. -/
  smul : ∀ (m : M) (i : ι), ∀ᶠ a in 𝓝 (0 : R), a • m ∈ B i

{ι : Type u_1}
{R : Type u_2}
[CommRing R]
{M : Type u_4}
[AddCommGroup M]
[Module R M]
[TopologicalSpace R]
{B : ι → Submodule R M}
(self : SubmodulesBasis B)
(m : M)
(i : ι)


theorem contractLeft_mul_algebraMap (a : CliffordAlgebra Q) (r : R) :
    d⌋(a * algebraMap _ _ r) = d⌋a * algebraMap _ _ r

{R : Type u1}
[CommRing R]
{M : Type u2}
[AddCommGroup M]
[Module R M]
{Q : QuadraticForm R M}
(d : Module.Dual R M)
(a : CliffordAlgebra Q)
(r : R)

(CliffordAlgebra.contractLeft d) (a * (algebraMap R (CliffordAlgebra Q)) r) =
  (CliffordAlgebra.contractLeft d) a * (algebraMap R (CliffordAlgebra Q)) r


/-- The equivalence `F.elementsᵒᵖ ≌ (yoneda, F)` is compatible with the forgetful functors. -/
@[simps!]
def costructuredArrowYonedaEquivalenceFunctorProj (F : Cᵒᵖ ⥤ Type v) :
    (costructuredArrowYonedaEquivalence F).functor ⋙ CostructuredArrow.proj _ _ ≅ (π F).leftOp

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

(CategoryTheory.CategoryOfElements.costructuredArrowYonedaEquivalenceFunctorProj F).hom.app X =
  CategoryTheory.CategoryStruct.id (Opposite.unop (Opposite.unop X).1)


protected theorem succ_max_succ (x y) : max (succ x) (succ y) = succ (max x y)


@[simp]
theorem frequently_map {P : β → Prop} : (∃ᶠ b in map m f, P b) ↔ ∃ᶠ a in f, P (m a)

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

(∃ᶠ (b : β) in Filter.map m f, P b) ↔ ∃ᶠ (a : α) in f, P (m a)


theorem div_lt_iff_of_neg' (hc : c < 0) : b / c < a ↔ c * a < b

{α : Type u_2}
[LinearOrderedField α]
{a b c : α}
(hc : c < 0)


/-- The canonical isomorphism of triangles
`binaryProductTriangle X₁ X₂ ≅ binaryBiproductTriangle X₁ X₂`. -/
@[simps!]
def binaryProductTriangleIsoBinaryBiproductTriangle
    (X₁ X₂ : C) [HasZeroMorphisms C] [HasBinaryBiproduct X₁ X₂] :
    binaryProductTriangle X₁ X₂ ≅ binaryBiproductTriangle X₁ X₂

(CategoryTheory.Pretriangulated.binaryProductTriangleIsoBinaryBiproductTriangle X₁ X₂).inv.hom₂ =
  CategoryTheory.Limits.prod.lift CategoryTheory.Limits.biprod.fst CategoryTheory.Limits.biprod.snd


theorem self_comp_symm (h : α ≃ᵢ β) : (h : α → β) ∘ h.symm = id

{α : Type u}
{β : Type v}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
(h : α ≃ᵢ β)


@[to_additive]
protected theorem hasFiniteIntegral_on_iff (hs : IsFundamentalDomain G s μ)
    (ht : IsFundamentalDomain G t μ) {f : α → E} (hf : ∀ (g : G) (x), f (g • x) = f x) :
    HasFiniteIntegral f (μ.restrict s) ↔ HasFiniteIntegral f (μ.restrict t)

[MeasureTheory.SMulInvariantMeasure G α μ]

(hs : MeasureTheory.IsFundamentalDomain G s μ)

(ht : MeasureTheory.IsFundamentalDomain G t μ)

(hf : ∀ (g : G) (x : α), f (g • x) = f x)

MeasureTheory.HasFiniteIntegral f (μ.restrict s) ↔ MeasureTheory.HasFiniteIntegral f (μ.restrict t)


@[simp]
theorem mem_cons (a : α) (s : Stream' α) : a ∈ a::s


theorem AntitoneOn.quasiconvexOn (hf : AntitoneOn f s) (hs : Convex 𝕜 s) : QuasiconvexOn 𝕜 s f

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_4}
[OrderedSemiring 𝕜]
[LinearOrderedAddCommMonoid E]
[OrderedAddCommMonoid β]
[Module 𝕜 E]
[OrderedSMul 𝕜 E]
{s : Set E}
{f : E → β}
(hf : AntitoneOn f s)
(hs : Convex 𝕜 s)


/-- The definition of a Grothendieck topology: a set of sieves `J X` on each object `X` satisfying
three axioms:
1. For every object `X`, the maximal sieve is in `J X`.
2. If `S ∈ J X` then its pullback along any `h : Y ⟶ X` is in `J Y`.
3. If `S ∈ J X` and `R` is a sieve on `X`, then provided that the pullback of `R` along any arrow
   `f : Y ⟶ X` in `S` is in `J Y`, we have that `R` itself is in `J X`.

A sieve `S` on `X` is referred to as `J`-covering, (or just covering), if `S ∈ J X`.

See <https://stacks.math.columbia.edu/tag/00Z4>, or [nlab], or [MM92][] Chapter III, Section 2,
Definition 1.
-/
structure GrothendieckTopology where
  /-- A Grothendieck topology on `C` consists of a set of sieves for each object `X`,
    which satisfy some axioms. -/
  sieves : ∀ X : C, Set (Sieve X)
  /-- The sieves associated to each object must contain the top sieve.
    Use `GrothendieckTopology.top_mem`. -/
  top_mem' : ∀ X, ⊤ ∈ sieves X
  /-- Stability under pullback. Use `GrothendieckTopology.pullback_stable`. -/
  pullback_stable' : ∀ ⦃X Y : C⦄ ⦃S : Sieve X⦄ (f : Y ⟶ X), S ∈ sieves X → S.pullback f ∈ sieves Y
  /-- Transitivity of sieves in a Grothendieck topology.
    Use `GrothendieckTopology.transitive`. -/
  transitive' :
    ∀ ⦃X⦄ ⦃S : Sieve X⦄ (_ : S ∈ sieves X) (R : Sieve X),
      (∀ ⦃Y⦄ ⦃f : Y ⟶ X⦄, S f → R.pullback f ∈ sieves Y) → R ∈ sieves X

(self : CategoryTheory.GrothendieckTopology C)

S ∈ self.sieves X →
  ∀ (R : CategoryTheory.Sieve X),
    (∀ ⦃Y : C⦄ ⦃f : Y ⟶ X⦄, S.arrows f → CategoryTheory.Sieve.pullback f R ∈ self.sieves Y) → R ∈ self.sieves X


@[to_additive]
theorem dist_mul_mul_le_of_le (h₁ : dist a₁ b₁ ≤ r₁) (h₂ : dist a₂ b₂ ≤ r₂) :
    dist (a₁ * a₂) (b₁ * b₂) ≤ r₁ + r₂

{E : Type u_3}
[SeminormedCommGroup E]
{a₁ a₂ b₁ b₂ : E}
{r₁ r₂ : ℝ}
(h₁ : dist a₁ b₁ ≤ r₁)
(h₂ : dist a₂ b₂ ≤ r₂)


theorem isPairSelfAdjoint_equiv (e : M' ≃ₗ[R] M) (f : Module.End R M) :
    IsPairSelfAdjoint B₂ F₂ f ↔
      IsPairSelfAdjoint (B₂.comp ↑e ↑e) (F₂.comp ↑e ↑e) (e.symm.conj f)

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
{M' : Type u_9}
[AddCommMonoid M']
[Module R M']
(B₂ F₂ : LinearMap.BilinForm R M)
(e : M' ≃ₗ[R] M)
(f : Module.End R M)

B₂.IsPairSelfAdjoint F₂ f ↔ (B₂.comp ↑e ↑e).IsPairSelfAdjoint (F₂.comp ↑e ↑e) (e.symm.conj f)


lemma isStrictlySupported_of_iso [K.IsStrictlySupported e] : L.IsStrictlySupported e


theorem IsBigOWith.isBigO (h : IsBigOWith c l f g) : f =O[l] g

{α : Type u_1}
{E : Type u_3}
{F : Type u_4}
[Norm E]
[Norm F]
{c : ℝ}
{f : α → E}
{g : α → F}
{l : Filter α}
(h : Asymptotics.IsBigOWith c l f g)


/-- The inner product between two vectors is zero if and only if the first vector is zero or
the second is a multiple of a `π / 2` rotation of that vector. -/
theorem inner_eq_zero_iff_eq_zero_or_eq_smul_rotation_pi_div_two {x y : V} :
    ⟪x, y⟫ = 0 ↔ x = 0 ∨ ∃ r : ℝ, r • o.rotation (π / 2 : ℝ) x = y

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

⟪x, y⟫_ℝ = 0 ↔ x = 0 ∨ ∃ r, r • (o.rotation ↑(π / 2)) x = y


/-- The (scalar) product of a sequence that tends to zero with a bounded one also tends to zero. -/
theorem tendsto_zero_smul_of_tendsto_zero_of_bounded {ι 𝕜 𝔸 : Type*} [NormedDivisionRing 𝕜]
    [NormedAddCommGroup 𝔸] [Module 𝕜 𝔸] [BoundedSMul 𝕜 𝔸] {l : Filter ι} {ε : ι → 𝕜} {f : ι → 𝔸}
    (hε : Tendsto ε l (𝓝 0)) (hf : Filter.IsBoundedUnder (· ≤ ·) l (norm ∘ f)) :
    Tendsto (ε • f) l (𝓝 0)

(hf : Filter.IsBoundedUnder (fun x x_1 => x ≤ x_1) l (norm ∘ f))


theorem totallyBounded_iff {s : Set α} :
    TotallyBounded s ↔ ∀ ε > 0, ∃ t : Set α, t.Finite ∧ s ⊆ ⋃ y ∈ t, ball y ε

{α : Type u}
[PseudoMetricSpace α]
{s : Set α}

TotallyBounded s ↔ ∀ ε > 0, ∃ t, t.Finite ∧ s ⊆ ⋃ y ∈ t, Metric.ball y ε


@[to_additive]
theorem mulAntidiagonal_min_mul_min {α} [LinearOrderedCancelCommMonoid α] {s t : Set α}
    (hs : s.IsWF) (ht : t.IsWF) (hns : s.Nonempty) (hnt : t.Nonempty) :
    mulAntidiagonal hs.isPWO ht.isPWO (hs.min hns * ht.min hnt) = {(hs.min hns, ht.min hnt)}

{α : Type u_2}
[LinearOrderedCancelCommMonoid α]
{s t : Set α}
(hs : s.IsWF)
(ht : t.IsWF)
(hns : s.Nonempty)
(hnt : t.Nonempty)

Finset.mulAntidiagonal ⋯ ⋯ (hs.min hns * ht.min hnt) = {(hs.min hns, ht.min hnt)}


theorem bijective_iff_bijOn_univ : Bijective f ↔ BijOn f univ univ

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

Function.Bijective f ↔ Set.BijOn f Set.univ Set.univ


/-- The injection into a pi group at different indices commutes.

For injections of commuting elements at the same index, see `Commute.map` -/
@[to_additive
      "The injection into an additive pi group at different indices commutes.

      For injections of commuting elements at the same index, see `AddCommute.map`"]
theorem Pi.mulSingle_commute [∀ i, MulOneClass <| f i] :
    Pairwise fun i j => ∀ (x : f i) (y : f j), Commute (mulSingle i x) (mulSingle j y)

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

Pairwise fun i j => ∀ (x : f i) (y : f j), AddCommute (Pi.single i x) (Pi.single j y)


/-- An unbundled functor. -/
class Functorial (F : C → D) : Type max v₁ v₂ u₁ u₂ where
  /-- A functorial map extends to an action on morphisms. -/
  map' : ∀ {X Y : C}, (X ⟶ Y) → (F X ⟶ F Y)
  /-- A functorial map preserves identities. -/
  map_id' : ∀ X : C, map' (𝟙 X) = 𝟙 (F X) := by aesop_cat
  /-- A functorial map preserves composition of morphisms. -/
  map_comp' : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z), map' (f ≫ g) = map' f ≫ map' g := by
    aesop_cat

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{F : C → D}
[self : CategoryTheory.Functorial F]
{X Y Z : C}
(f : X ⟶ Y)
(g : Y ⟶ Z)

CategoryTheory.Functorial.map' (CategoryTheory.CategoryStruct.comp f g) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.Functorial.map' f) (CategoryTheory.Functorial.map' g)


theorem biInter_sigma (s : Set ι) (t : ∀ i, Set (α i)) (f : Sigma α → Set β) :
    ⋂ ij ∈ s.sigma t, f ij = ⋂ i ∈ s, ⋂ j ∈ t i, f ⟨i, j⟩

{ι : Type u_1}
{α : ι → Type u_3}
{β : Type u_6}
(s : Set ι)
(t : (i : ι) → Set (α i))
(f : Sigma α → Set β)


@[simp]
theorem infs_singleton : s ⊼ {b} = s.image fun a => a ⊓ b

{α : Type u_2}
[SemilatticeInf α]
{s : Set α}
{b : α}


/-- If the coproducts `W ⨿ X` and `Y ⨿ Z` exist, then every pair of isomorphisms `f : W ≅ Y` and
   `g : W ≅ Z` induces an isomorphism `coprod.mapIso f g : W ⨿ X ≅ Y ⨿ Z`. -/
@[simps]
def coprod.mapIso {W X Y Z : C} [HasBinaryCoproduct W X] [HasBinaryCoproduct Y Z] (f : W ≅ Y)
    (g : X ≅ Z) : W ⨿ X ≅ Y ⨿ Z

(CategoryTheory.Limits.coprod.mapIso f g).hom = CategoryTheory.Limits.coprod.map f.hom g.hom


@[continuity]
theorem continuous_exp : Continuous exp


/-- **Artin--Tate lemma**: if A ⊆ B ⊆ C is a chain of subrings of commutative rings, and
A is noetherian, and C is algebra-finite over A, and C is module-finite over B,
then B is algebra-finite over A.

References: Atiyah--Macdonald Proposition 7.8; Stacks 00IS; Altman--Kleiman 16.17. -/
theorem fg_of_fg_of_fg [IsNoetherianRing A] (hAC : (⊤ : Subalgebra A C).FG)
    (hBC : (⊤ : Submodule B C).FG) (hBCi : Function.Injective (algebraMap B C)) :
    (⊤ : Subalgebra A B).FG

(hBCi : Function.Injective ⇑(algebraMap B C))


/-- The identity morphism on a comonoid object. -/
@[simps]
def id (M : Comon_ C) : Hom M M

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


/-- A variant of `eq_whisker` with a more convenient argument order for use in tactics.  -/
theorem eq_whisker' {X Y : C} {f g : X ⟶ Y} (w : f = g) {Z : C} (h : Y ⟶ Z) :
    f ≫ h = g ≫ h

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
{X Y : C}
{f g : X ⟶ Y}
(w : f = g)
{Z : C}
(h : Y ⟶ Z)

CategoryTheory.CategoryStruct.comp f h = CategoryTheory.CategoryStruct.comp g h


/-- Every separable metric space embeds isometrically in `ℓ^∞(ℕ)`. -/
theorem exists_isometric_embedding (α : Type u) [MetricSpace α] [SeparableSpace α] :
    ∃ f : α → ℓ^∞(ℕ), Isometry f

(α : Type u)
[MetricSpace α]
[TopologicalSpace.SeparableSpace α]


@[simp]
theorem lTensor_pow (f : N →ₗ[R] N) (n : ℕ) : f.lTensor M ^ n = (f ^ n).lTensor M

{R : Type u_1}
[CommSemiring R]
{M : Type u_4}
{N : Type u_5}
[AddCommMonoid M]
[AddCommMonoid N]
[Module R M]
[Module R N]
(f : N →ₗ[R] N)
(n : ℕ)

LinearMap.lTensor M f ^ n = LinearMap.lTensor M (f ^ n)


lemma degree_eq_zero_iff (d : σ →₀ ℕ) : degree d = 0 ↔ d = 0


/-- Given `s` and `t` signed measures, `s + it` is a complex measure-/
@[simps!]
def _root_.MeasureTheory.SignedMeasure.toComplexMeasure (s t : SignedMeasure α) :
    ComplexMeasure α

{α : Type u_1}
{m : MeasurableSpace α}
(s t : MeasureTheory.SignedMeasure α)
(i : Set α)


theorem getElem_mem_data (a : Array α) (h : i < a.size) : a[i] ∈ a.data

{α : Type u_1}
{i : Nat}
(a : Array α)
(h : i < a.size)


theorem nfpFamily_lt_ord {ι} {f : ι → Ordinal → Ordinal} {c} (hc : ℵ₀ < cof c) (hc' : #ι < cof c)
    (hf : ∀ (i), ∀ b < c, f i b < c) {a} : a < c → nfpFamily.{u, u} f a < c

{ι : Type u}
{f : ι → Ordinal.{u} → Ordinal.{u}}
{c : Ordinal.{u}}
(hc : ℵ₀ < c.cof)
(hc' : #ι < c.cof)
(hf : ∀ (i : ι), ∀ b < c, f i b < c)
{a : Ordinal.{u}}


theorem inv_comp_eq (α : X ≅ Y) {f : X ⟶ Z} {g : Y ⟶ Z} : α.inv ≫ f = g ↔ f = α.hom ≫ g

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

CategoryTheory.CategoryStruct.comp α.inv f = g ↔ f = CategoryTheory.CategoryStruct.comp α.hom g


/-- If `F ≤ E` are two intermediate fields of `L / K` such that `[L : F] ≤ [L : E]` are finite,
then `F = E`. -/
theorem eq_of_le_of_finrank_le' [FiniteDimensional F L] (h_le : F ≤ E)
    (h_finrank : finrank F L ≤ finrank E L) : F = E

(h_finrank : FiniteDimensional.finrank (↥F) L ≤ FiniteDimensional.finrank (↥E) L)


@[simp]
theorem curry_uncurry (f : Function.FromTypes p τ) : curry (uncurry f) = f

{n : ℕ}
{p : Fin n → Type u}
{τ : Type u}
(f : Function.FromTypes p τ)


/-- If a function `f` with a densely ordered codomain is strictly monotone on a neighborhood of `a`
and the image of this set under `f` is a neighborhood of `f a`, then `f` is continuous at `a`. -/
theorem StrictMonoOn.continuousAt_of_image_mem_nhds [DenselyOrdered β] {f : α → β} {s : Set α}
    {a : α} (h_mono : StrictMonoOn f s) (hs : s ∈ 𝓝 a) (hfs : f '' s ∈ 𝓝 (f a)) :
    ContinuousAt f a

{α : Type u_1}
{β : Type u_2}
[LinearOrder α]
[TopologicalSpace α]
[OrderTopology α]
[LinearOrder β]
[TopologicalSpace β]
[OrderTopology β]
[DenselyOrdered β]
{f : α → β}
{s : Set α}
{a : α}
(h_mono : StrictMonoOn f s)
(hs : s ∈ 𝓝 a)
(hfs : f '' s ∈ 𝓝 (f a))


/-- The submodule `weightedHomogeneousSubmodule R w m` of homogeneous `MvPolynomial`s of
  degree `n` is equal to the `R`-submodule of all `p : (σ →₀ ℕ) →₀ R` such that
  `p.support ⊆ {d | weight w d = m}`. While equal, the former has a
  convenient definitional reduction. -/
theorem weightedHomogeneousSubmodule_eq_finsupp_supported (w : σ → M) (m : M) :
    weightedHomogeneousSubmodule R w m = Finsupp.supported R R { d | weight w d = m }

(R : Type u_1)
{M : Type u_2}
[CommSemiring R]
{σ : Type u_3}
[AddCommMonoid M]
(w : σ → M)
(m : M)

MvPolynomial.weightedHomogeneousSubmodule R w m = Finsupp.supported R R {d | (Finsupp.weight w) d = m}


@[simp, norm_cast] lemma coe_bot : (↑(⊥ : Clopens α) : Set α) = ∅


theorem Filter.HasBasis.uniformContinuous_iff {ι'} [UniformSpace β] {p : ι → Prop}
    {s : ι → Set (α × α)} (ha : (𝓤 α).HasBasis p s) {q : ι' → Prop} {t : ι' → Set (β × β)}
    (hb : (𝓤 β).HasBasis q t) {f : α → β} :
    UniformContinuous f ↔ ∀ i, q i → ∃ j, p j ∧ ∀ x y, (x, y) ∈ s j → (f x, f y) ∈ t i

{α : Type ua}
{β : Type ub}
{ι : Sort u_1}
[UniformSpace α]
{ι' : Sort u_2}
[UniformSpace β]
{p : ι → Prop}
{s : ι → Set (α × α)}
(ha : (𝓤 α).HasBasis p s)
{q : ι' → Prop}
{t : ι' → Set (β × β)}
(hb : (𝓤 β).HasBasis q t)
{f : α → β}

UniformContinuous f ↔ ∀ (i : ι'), q i → ∃ j, p j ∧ ∀ (x y : α), (x, y) ∈ s j → (f x, f y) ∈ t i


@[to_additive (attr := continuity, fun_prop)]
theorem Continuous.inv (hf : Continuous f) : Continuous fun x => (f x)⁻¹

{G : Type w}
{α : Type u}
[TopologicalSpace G]
[Inv G]
[ContinuousInv G]
[TopologicalSpace α]
{f : α → G}
(hf : Continuous f)


theorem eLpNormEssSup_smul_measure {f : α → F} {c : ℝ≥0∞} (hc : c ≠ 0) :
    eLpNormEssSup f (c • μ) = eLpNormEssSup f μ

{α : Type u_1}
{F : Type u_3}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup F]
{f : α → F}
{c : ℝ≥0∞}
(hc : c ≠ 0)

MeasureTheory.eLpNormEssSup f (c • μ) = MeasureTheory.eLpNormEssSup f μ


@[to_additive (attr := simp) const_pos]
theorem one_lt_const : 1 < const β a ↔ 1 < a

{α : Type u_3}
{β : Type u_4}
[One α]
[Preorder α]
{a : α}
[Nonempty β]


@[to_additive]
theorem gc_map_comap (f : F) : GaloisConnection (map f) (comap f)

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

GaloisConnection (Submonoid.map f) (Submonoid.comap f)


theorem dualLift_rightInverse (W : Subspace K V) :
    Function.RightInverse W.dualLift W.dualRestrict

{K : Type u}
{V : Type v}
[Field K]
[AddCommGroup V]
[Module K V]
(W : Subspace K V)

Function.RightInverse ⇑W.dualLift ⇑(Submodule.dualRestrict W)


@[to_additive]
theorem unsym_ne_one_iff [One α] (a : αˢʸᵐ) : unsym a ≠ (1 : α) ↔ a ≠ (1 : αˢʸᵐ)


@[to_additive] lemma mabs_le_mabs (h₀ : a ≤ b) (h₁ : a⁻¹ ≤ b) : |a|ₘ ≤ |b|ₘ

{α : Type u_1}
[Lattice α]
[AddGroup α]
{a b : α}
(h₀ : a ≤ b)
(h₁ : -a ≤ b)


@[to_additive]
theorem div_div_div_eq : a / b / (c / d) = a * d / (b * c)

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


theorem ClassGroup.mk_eq_mk {I J : (FractionalIdeal R⁰ <| FractionRing R)ˣ} :
    ClassGroup.mk I = ClassGroup.mk J ↔
      ∃ x : (FractionRing R)ˣ, I * toPrincipalIdeal R (FractionRing R) x = J

{I J : (FractionalIdeal R⁰ (FractionRing R))ˣ}

ClassGroup.mk I = ClassGroup.mk J ↔ ∃ x, I * (toPrincipalIdeal R (FractionRing R)) x = J


theorem IsGLB.exists_seq_antitone_tendsto {t : Set α} {x : α} [IsCountablyGenerated (𝓝 x)]
    (htx : IsGLB t x) (ht : t.Nonempty) :
    ∃ u : ℕ → α, Antitone u ∧ (∀ n, x ≤ u n) ∧ Tendsto u atTop (𝓝 x) ∧ ∀ n, u n ∈ t

{α : Type u_1}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
{t : Set α}
{x : α}
[(𝓝 x).IsCountablyGenerated]
(htx : IsGLB t x)
(ht : t.Nonempty)

∃ u, Antitone u ∧ (∀ (n : ℕ), x ≤ u n) ∧ Filter.Tendsto u Filter.atTop (𝓝 x) ∧ ∀ (n : ℕ), u n ∈ t


theorem indep_iSup_of_antitone [SemilatticeInf ι] {Ω} {m : ι → MeasurableSpace Ω}
    {m' m0 : MeasurableSpace Ω} {κ : Kernel α Ω} {μ : Measure α} [IsMarkovKernel κ]
    (h_indep : ∀ i, Indep (m i) m' κ μ) (h_le : ∀ i, m i ≤ m0) (h_le' : m' ≤ m0)
    (hm : Antitone m) :
    Indep (⨆ i, m i) m' κ μ

(h_indep : ∀ (i : ι), ProbabilityTheory.Kernel.Indep (m i) m' κ μ)

ProbabilityTheory.Kernel.Indep (⨆ i, m i) m' κ μ


theorem zero_pow_le_one : ∀ n : ℕ, (0 : R) ^ n ≤ 1

{R : Type u_3}
[OrderedSemiring R]
(n : ℕ)


theorem Subset.inter_eq_left {xs ys : List α} (h : xs ⊆ ys) : xs ∩ ys = xs

{α : Type u_1}
[DecidableEq α]
{xs ys : List α}
(h : xs ⊆ ys)


theorem coeff_mul {a₃ c₂ k : ℕ}
    (a₁ a₂ : ℕ) (_ : a₃ = c₂ * k) : a₁ ^ a₂ * a₃ = (a₁ ^ a₂ * c₂) * k

a₃ = c₂ * k → a₁ ^ a₂ * a₃ = a₁ ^ a₂ * c₂ * k


@[simp, aesop safe apply (rule_sets := [finsetNonempty])]
theorem nonempty_Ico : (Ico a b).Nonempty ↔ a < b

{α : Type u_2}
[Preorder α]
[LocallyFiniteOrder α]
{a b : α}


/-- Note that the `IsScalarTower M α α` and `SMulCommClass M α α` typeclass arguments are
usually satisfied by `Algebra M α`. -/
@[to_additive] -- Porting note: nolint to_additive_doc
lemma smul_mul_smul [Mul α] (r s : M) (x y : α) [IsScalarTower M α α] [SMulCommClass M α α] :
    r • x * s • y = (r * s) • (x * y)

{M : Type u_1}
{α : Type u_7}
[AddMonoid M]
[AddAction M α]
[Add α]
(r s : M)
(x y : α)
[VAddAssocClass M α α]
[VAddCommClass M α α]


@[simp]
theorem sinh_inj : sinh x = sinh y ↔ x = y


theorem map_csInf (e : α ≃o β) {s : Set α} (hne : s.Nonempty) (hbdd : BddBelow s) :
    e (sInf s) = ⨅ x : s, e x

{α : Type u_1}
{β : Type u_2}
[ConditionallyCompleteLattice α]
[ConditionallyCompleteLattice β]
(e : α ≃o β)
{s : Set α}
(hne : s.Nonempty)
(hbdd : BddBelow s)


/-- L'Hôpital's rule for approaching a real, `HasDerivAt` version. This
  does not require anything about the situation at `a` -/
theorem lhopital_zero_nhds' (hff' : ∀ᶠ x in 𝓝[≠] a, HasDerivAt f (f' x) x)
    (hgg' : ∀ᶠ x in 𝓝[≠] a, HasDerivAt g (g' x) x) (hg' : ∀ᶠ x in 𝓝[≠] a, g' x ≠ 0)
    (hfa : Tendsto f (𝓝[≠] a) (𝓝 0)) (hga : Tendsto g (𝓝[≠] a) (𝓝 0))
    (hdiv : Tendsto (fun x => f' x / g' x) (𝓝[≠] a) l) :
    Tendsto (fun x => f x / g x) (𝓝[≠] a) l

(hff' : ∀ᶠ (x : ℝ) in 𝓝[≠] a, HasDerivAt f (f' x) x)

(hgg' : ∀ᶠ (x : ℝ) in 𝓝[≠] a, HasDerivAt g (g' x) x)

(hdiv : Filter.Tendsto (fun x => f' x / g' x) (𝓝[≠] a) l)

Filter.Tendsto (fun x => f x / g x) (𝓝[≠] a) l


@[simp]
theorem dropFun_prod {α α' β β' : TypeVec (n + 1)} (f : α ⟹ β) (f' : α' ⟹ β') :
    dropFun (f ⊗' f') = (dropFun f ⊗' dropFun f')

{n : ℕ}
{α α' β β' : TypeVec.{u_1} (n + 1)}
(f : α.Arrow β)
(f' : α'.Arrow β')

TypeVec.dropFun (TypeVec.prod.map f f') = TypeVec.prod.map (TypeVec.dropFun f) (TypeVec.dropFun f')


@[norm_cast]
theorem coe_fn_coe (f : R →ₑ+*[φ] S) : ⇑(f : R →+* S) = f

{M : Type u_1}
[Monoid M]
{N : Type u_2}
[Monoid N]
{φ : M →* N}
{R : Type u_10}
[Semiring R]
[MulSemiringAction M R]
{S : Type u_12}
[Semiring S]
[MulSemiringAction N S]
(f : R →ₑ+*[φ] S)


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

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

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


theorem mul_geom_sum₂_Ico [CommRing α] (x y : α) {m n : ℕ} (hmn : m ≤ n) :
    ((x - y) * ∑ i ∈ Finset.Ico m n, x ^ i * y ^ (n - 1 - i)) = x ^ n - x ^ m * y ^ (n - m)

{α : Type u}
[CommRing α]
(x y : α)
{m n : ℕ}
(hmn : m ≤ n)

(x - y) * ∑ i ∈ Finset.Ico m n, x ^ i * y ^ (n - 1 - i) = x ^ n - x ^ m * y ^ (n - m)


@[simp, norm_cast]
theorem coe_inj {e₁ e₂ : ENorm 𝕜 V} : (e₁ : V → ℝ≥0∞) = e₂ ↔ e₁ = e₂

{𝕜 : Type u_1}
{V : Type u_2}
[NormedField 𝕜]
[AddCommGroup V]
[Module 𝕜 V]
{e₁ e₂ : ENorm 𝕜 V}

↑e₁ = ↑e₂ ↔ e₁ = e₂


/-- Given any sequence `ε` of scalars which tends to `𝓝[≠] 0`, we have that a set `S` is bounded
  if and only if for any sequence `x : ℕ → S`, `ε • x` tends to 0. This actually works for any
  indexing type `ι`, but in the special case `ι = ℕ` we get the important fact that convergent
  sequences fully characterize bounded sets. -/
theorem isVonNBounded_iff_smul_tendsto_zero {ε : ι → 𝕜} {l : Filter ι} [l.NeBot]
    (hε : Tendsto ε l (𝓝[≠] 0)) {S : Set E} :
    IsVonNBounded 𝕜 S ↔ ∀ x : ι → E, (∀ n, x n ∈ S) → Tendsto (ε • x) l (𝓝 0)

{𝕜 : Type u_1}
{E : Type u_3}
{ι : Type u_6}
[NontriviallyNormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[TopologicalSpace E]
[ContinuousSMul 𝕜 E]
{ε : ι → 𝕜}
{l : Filter ι}
[l.NeBot]
(hε : Filter.Tendsto ε l (𝓝[≠] 0))
{S : Set E}

Bornology.IsVonNBounded 𝕜 S ↔ ∀ (x : ι → E), (∀ (n : ι), x n ∈ S) → Filter.Tendsto (ε • x) l (𝓝 0)


/-- The open cover associated to an affine open cover. -/
@[simps]
def openCover {X : Scheme.{u}} (𝓤 : X.AffineOpenCover) : X.OpenCover

{X : AlgebraicGeometry.Scheme}
(𝓤 : X.AffineOpenCover)


@[simp] lemma mem_noncenter {G} [Monoid G] (g : ConjClasses G) :
  g ∈ noncenter G ↔ g.carrier.Nontrivial

{G : Type u_6}
[Monoid G]
(g : ConjClasses G)

g ∈ ConjClasses.noncenter G ↔ g.carrier.Nontrivial


theorem mul_le_mul_left {I J : FractionalIdeal S P} (hIJ : I ≤ J) (J' : FractionalIdeal S P) :
    J' * I ≤ J' * J

{R : Type u_1}
[CommRing R]
{S : Submonoid R}
{P : Type u_2}
[CommRing P]
[Algebra R P]
{I J : FractionalIdeal S P}
(hIJ : I ≤ J)
(J' : FractionalIdeal S P)


@[to_additive]
lemma _root_.Function.const_inv [Inv β] (a : β) : (const α a)⁻¹ = const α a⁻¹

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

-Function.const α a = Function.const α (-a)


/-- A function `f : 𝕜 → 𝕜` is strictly convex iff for any three points `x < y < z` the slope of
the secant line of `f` on `[x, y]` is strictly less than the slope of the secant line of `f` on
`[y, z]`. -/
theorem strictConvexOn_iff_slope_strict_mono_adjacent :
    StrictConvexOn 𝕜 s f ↔
      Convex 𝕜 s ∧
        ∀ ⦃x y z : 𝕜⦄,
          x ∈ s → z ∈ s → x < y → y < z → (f y - f x) / (y - x) < (f z - f y) / (z - y)

{𝕜 : Type u_1}
[LinearOrderedField 𝕜]
{s : Set 𝕜}
{f : 𝕜 → 𝕜}


@[simp]
theorem im_conj (z : 𝔻) : z.conj.im = -z.im


theorem Nonempty.vsub : s.Nonempty → t.Nonempty → (s -ᵥ t : Finset α).Nonempty

{α : Type u_2}
{β : Type u_3}
[VSub α β]
[DecidableEq α]
{s t : Finset β}

s.Nonempty → t.Nonempty → (s -ᵥ t).Nonempty


theorem sub_half (h : a ≠ ∞) : a - a / 2 = a / 2


theorem liftRel_bind {δ} (R : α → β → Prop) (S : γ → δ → Prop) {s1 : Computation α}
    {s2 : Computation β} {f1 : α → Computation γ} {f2 : β → Computation δ} (h1 : LiftRel R s1 s2)
    (h2 : ∀ {a b}, R a b → LiftRel S (f1 a) (f2 b)) : LiftRel S (bind s1 f1) (bind s2 f2)

(h2 : ∀ {a : α} {b : β}, R a b → Computation.LiftRel S (f1 a) (f2 b))

Computation.LiftRel S (s1.bind f1) (s2.bind f2)


theorem EReal.tendsto_const_div_atTop_nhds_zero_nat {C : EReal} (h : C ≠ ⊥) (h' : C ≠ ⊤) :
    Tendsto (fun n : ℕ ↦ C / n) atTop (𝓝 0)

Filter.Tendsto (fun n => C / ↑n) Filter.atTop (𝓝 0)


/-- A twisted version of the relation `Λ * ↑ζ = log` in terms of complex sequences. -/
lemma convolution_twist_vonMangoldt {N : ℕ} (χ : DirichletCharacter ℂ N) :
    (↗χ * ↗Λ) ⍟ ↗χ = ↗χ * ↗Complex.log

(((fun n => χ ↑n) * fun n => ↑(ArithmeticFunction.vonMangoldt n)) ⍟ fun n => χ ↑n) =
  (fun n => χ ↑n) * fun n => Complex.log ↑n


@[simp]
theorem sqrt_div' (x) {y : ℝ} (hy : 0 ≤ y) : √(x / y) = √x / √y


@[to_additive]
theorem IsCyclic.image_range_card (ha : ∀ x : α, x ∈ zpowers a) :
    Finset.image (fun i => a ^ i) (range (Fintype.card α)) = univ

(ha : ∀ (x : α), x ∈ Subgroup.zpowers a)

Finset.image (fun i => a ^ i) (Finset.range (Fintype.card α)) = Finset.univ


@[to_additive]
theorem mem_powers_iff_mem_range_orderOf [DecidableEq G] :
    y ∈ powers x ↔ y ∈ (Finset.range (orderOf x)).image (x ^ ·)

{G : Type u_1}
[AddLeftCancelMonoid G]
[Finite G]
{x y : G}
[DecidableEq G]

y ∈ AddSubmonoid.multiples x ↔ y ∈ Finset.image (fun x_1 => x_1 • x) (Finset.range (addOrderOf x))


theorem MeasurableSet.nullMeasurableSet_subtype_coe {t : Set s} (hs : NullMeasurableSet s μ)
    (ht : MeasurableSet t) : NullMeasurableSet ((↑) '' t) μ

(hs : MeasureTheory.NullMeasurableSet s μ)

MeasureTheory.NullMeasurableSet (Subtype.val '' t) μ


@[simp]
theorem ImageMap.mk.injEq' {f g : Arrow C} [HasImage f.hom] [HasImage g.hom] {sq : f ⟶ g}
    (map : image f.hom ⟶ image g.hom)
    (map_ι : map ≫ image.ι g.hom = image.ι f.hom ≫ sq.right := by aesop_cat)
    (map' : image f.hom ⟶ image g.hom)
    (map_ι' : map' ≫ image.ι g.hom = image.ι f.hom ≫ sq.right) : (map = map') = True

(map : CategoryTheory.Limits.image f.hom ⟶ CategoryTheory.Limits.image g.hom)

(map_ι : map ≫ CategoryTheory.Limits.image.ι g.hom = CategoryTheory.Limits.image.ι f.hom ≫ sq.right := by aesop_cat)

(map' : CategoryTheory.Limits.image f.hom ⟶ CategoryTheory.Limits.image g.hom)

(map_ι' : map' ≫ CategoryTheory.Limits.image.ι g.hom = CategoryTheory.Limits.image.ι f.hom ≫ sq.right)


@[to_additive] lemma lintegral_eq_tsum'' (h : IsFundamentalDomain G s μ) (f : α → ℝ≥0∞) :
    ∫⁻ x, f x ∂μ = ∑' g : G, ∫⁻ x in s, f (g • x) ∂μ

[MeasureTheory.VAddInvariantMeasure G α μ]

(h : MeasureTheory.IsAddFundamentalDomain G s μ)

(f : α → ℝ≥0∞)

∫⁻ (x : α), f x ∂μ = ∑' (g : G), ∫⁻ (x : α) in s, f (g +ᵥ x) ∂μ


theorem Finite.countable {s : Set α} (hs : s.Finite) : s.Countable

{α : Type u}
{s : Set α}
(hs : s.Finite)


theorem nhds_coe_coe {r p : ℝ} :
    𝓝 ((r : EReal), (p : EReal)) = (𝓝 (r, p)).map fun p : ℝ × ℝ => (↑p.1, ↑p.2)

𝓝 (↑r, ↑p) = Filter.map (fun p => (↑p.1, ↑p.2)) (𝓝 (r, p))


/-- A convenience wrapper for MeasureTheory.Measure.isAddHaarMeasure_map`. -/
theorem _root_.ContinuousLinearEquiv.isAddHaarMeasure_map
    {E F R S : Type*} [Semiring R] [Semiring S]
    [AddCommGroup E] [Module R E] [AddCommGroup F] [Module S F]
    [TopologicalSpace E] [TopologicalAddGroup E] [TopologicalSpace F]
    [TopologicalAddGroup F]
    {σ : R →+* S} {σ' : S →+* R} [RingHomInvPair σ σ'] [RingHomInvPair σ' σ]
    [MeasurableSpace E] [BorelSpace E] [MeasurableSpace F] [BorelSpace F]
    (L : E ≃SL[σ] F) (μ : Measure E) [IsAddHaarMeasure μ] :
    IsAddHaarMeasure (μ.map L)

{E : Type u_4}
{F : Type u_5}
{R : Type u_6}
{S : Type u_7}
[Semiring R]
[Semiring S]
[AddCommGroup E]
[Module R E]
[AddCommGroup F]
[Module S F]
[TopologicalSpace E]
[TopologicalAddGroup E]
[TopologicalSpace F]
[TopologicalAddGroup F]
{σ : R →+* S}
{σ' : S →+* R}
[RingHomInvPair σ σ']
[RingHomInvPair σ' σ]
[MeasurableSpace E]
[BorelSpace E]
[MeasurableSpace F]
[BorelSpace F]
(L : E ≃SL[σ] F)
(μ : MeasureTheory.Measure E)
[μ.IsAddHaarMeasure]


@[simp]
lemma addOppositeEquiv_support (x : HahnSeries Γ (Rᵃᵒᵖ)) :
    (addOppositeEquiv x).unop.support = x.support

{Γ : Type u_1}
{R : Type u_2}
[PartialOrder Γ]
[AddMonoid R]
(x : HahnSeries Γ Rᵃᵒᵖ)

(AddOpposite.unop (HahnSeries.addOppositeEquiv x)).support = x.support


@[simp]
theorem dist_midpoint_left (p₁ p₂ : P) : dist (midpoint 𝕜 p₁ p₂) p₁ = ‖(2 : 𝕜)‖⁻¹ * dist p₁ p₂

{V : Type u_2}
{P : Type u_3}
[SeminormedAddCommGroup V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]
{𝕜 : Type u_6}
[NormedField 𝕜]
[NormedSpace 𝕜 V]
[Invertible 2]
(p₁ p₂ : P)

dist (midpoint 𝕜 p₁ p₂) p₁ = ‖2‖⁻¹ * dist p₁ p₂


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

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


theorem hasseDeriv_coeff (k : ℕ) (f : LaurentSeries V) (n : ℤ) :
    (hasseDeriv R k f).coeff n = Ring.choose (n + k) k • f.coeff (n + k)

{R : Type u_1}
[Semiring R]
{V : Type u_2}
[AddCommGroup V]
[Module R V]
(k : ℕ)
(f : LaurentSeries V)
(n : ℤ)

((LaurentSeries.hasseDeriv R k) f).coeff n = Ring.choose (n + ↑k) k • f.coeff (n + ↑k)


lemma mkRat_eq_div (n : ℤ) (d : ℕ) : mkRat n d = n / d


@[to_additive]
theorem mem_leftTransversals_iff_bijective :
    S ∈ leftTransversals (H : Set G) ↔
      Function.Bijective (S.restrict (Quotient.mk'' : G → Quotient (QuotientGroup.leftRel H)))

{G : Type u_1}
[Group G]
{H : Subgroup G}
{S : Set G}

S ∈ Subgroup.leftTransversals ↑H ↔ Function.Bijective (S.restrict Quotient.mk'')


theorem ext_elem (h : IsAdjoinRootMonic S f) ⦃x y : S⦄
    (hxy : ∀ i < natDegree f, h.coeff x i = h.coeff y i) : x = y

(hxy : ∀ i < f.natDegree, h.coeff x i = h.coeff y i)


@[simp]
lemma flip_flip : P.flip.flip = P

{ι : Type u_1}
{R : Type u_2}
{M : Type u_3}
{N : Type u_4}
[CommRing R]
[AddCommGroup M]
[Module R M]
[AddCommGroup N]
[Module R N]
(P : RootPairing ι R M N)


/--
A morphism is "quasi-compact" if the underlying map of topological spaces is, i.e. if the preimages
of quasi-compact open sets are quasi-compact.
-/
@[mk_iff]
class QuasiCompact (f : X ⟶ Y) : Prop where
  /-- Preimage of compact open set under a quasi-compact morphism between schemes is compact. -/
  isCompact_preimage : ∀ U : Set Y, IsOpen U → IsCompact U → IsCompact (f.1.base ⁻¹' U)

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

AlgebraicGeometry.QuasiCompact f ↔
  ∀ (U : Set ↑↑Y.toPresheafedSpace), IsOpen U → IsCompact U → IsCompact (⇑f.val.base ⁻¹' U)


theorem mul_lt_omega_opow {a b c : Ordinal} (c0 : 0 < c) (ha : a < (omega^c)) (hb : b < omega) :
    a * b < (omega^c)

{a b c : Ordinal.{u_1}}
(c0 : 0 < c)
(ha : a < Ordinal.omega ^ c)
(hb : b < Ordinal.omega)


@[simp]
theorem ofStream_cons (a : α) (s) : ofStream (a::s) = cons a (ofStream s)

↑(Stream'.cons a s) = Stream'.Seq.cons a ↑s


protected theorem Sorted.ge_of_gt [Preorder α] {l : List α} (h : l.Sorted (· > ·)) :
    l.Sorted (· ≥ ·)

(h : List.Sorted (fun x x_1 => x > x_1) l)


theorem toReal_eq_one_iff (x : ℝ≥0∞) : x.toReal = 1 ↔ x = 1


@[simp] theorem up_inf [Inf α] (a b : α) : up (a ⊓ b) = up a ⊓ up b

{ down := a ⊓ b } = { down := a } ⊓ { down := b }


/-- An element `ζ` is a primitive `k`-th root of unity if `ζ ^ k = 1`,
and if `l` satisfies `ζ ^ l = 1` then `k ∣ l`. -/
@[mk_iff IsPrimitiveRoot.iff_def]
structure IsPrimitiveRoot (ζ : M) (k : ℕ) : Prop where
  pow_eq_one : ζ ^ (k : ℕ) = 1
  dvd_of_pow_eq_one : ∀ l : ℕ, ζ ^ l = 1 → k ∣ l

{M : Type u_1}
[CommMonoid M]
{ζ : M}
{k : ℕ}
(self : IsPrimitiveRoot ζ k)
(l : ℕ)