theorem smul_sup (r : R) (p q : NonarchAddGroupSeminorm E) : r • (p ⊔ q) = r • p ⊔ r • q

{R : Type u_2}
{E : Type u_4}
[AddGroup E]
[SMul R ℝ]
[SMul R ℝ≥0]
[IsScalarTower R ℝ≥0 ℝ]
(r : R)
(p q : NonarchAddGroupSeminorm E)


@[nontriviality]
protected theorem Subsingleton.le [Preorder α] [Subsingleton α] (x y : α) : x ≤ y

{α : Type u_1}
[Preorder α]
[Subsingleton α]
(x y : α)


@[simp]
theorem kernelForkOfFork_ofι {P : C} (ι : P ⟶ X) (w : ι ≫ f = ι ≫ g) :
    kernelForkOfFork (Fork.ofι ι w) = KernelFork.ofι ι (by simp [w])

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Preadditive C]
{X Y : C}
{f g : X ⟶ Y}
{P : C}
(ι : P ⟶ X)
(w : ι ≫ f = ι ≫ g)

CategoryTheory.Preadditive.kernelForkOfFork (CategoryTheory.Limits.Fork.ofι ι w) =
  CategoryTheory.Limits.KernelFork.ofι ι ⋯


/-- The top subgroup is isomorphic to the group.

This is the group version of `Submonoid.topEquiv`. -/
@[to_additive (attr := simps!)
      "The top additive subgroup is isomorphic to the additive group.

      This is the additive group version of `AddSubmonoid.topEquiv`."]
def topEquiv : (⊤ : Subgroup G) ≃* G


/-- If the algebra map `R →+* A` is injective then `A` has the same characteristic as `R`. -/
theorem charP_of_injective_algebraMap {R A : Type*} [CommSemiring R] [Semiring A] [Algebra R A]
    (h : Function.Injective (algebraMap R A)) (p : ℕ) [CharP R p] : CharP A p

(h : Function.Injective ⇑(algebraMap R A))


@[to_additive]
theorem prod_subsingleton {α β : Type*} [CommMonoid β] [Subsingleton α] [Fintype α] (f : α → β)
    (a : α) : ∏ x : α, f x = f a

{α : Type u_9}
{β : Type u_10}
[AddCommMonoid β]
[Subsingleton α]
[Fintype α]
(f : α → β)
(a : α)


theorem Valid'.rotateR {l} {x : α} {r o₁ o₂} (hl : Valid' o₁ l x) (hr : Valid' x r o₂)
    (H1 : ¬size l + size r ≤ 1) (H2 : delta * size r < size l)
    (H3 : 2 * size l ≤ 9 * size r + 5 ∨ size l ≤ 3) : Valid' o₁ (@rotateR α l x r) o₂

(H3 : 2 * l.size ≤ 9 * r.size + 5 ∨ l.size ≤ 3)


@[to_additive]
theorem isClosedMap_mul_right (a : G) : IsClosedMap (· * a)

{G : Type w}
[TopologicalSpace G]
[Group G]
[ContinuousMul G]
(a : G)


@[to_additive]
theorem div_toGerm (f g : α →ₘ[μ] γ) : (f / g).toGerm = f.toGerm / g.toGerm

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


@[simp]
theorem tensorHom_app {F G F' G' : C ⥤ D} {α : F ⟶ G} {β : F' ⟶ G'} {X} :
    (α ⊗ β).app X = α.app X ⊗ β.app X

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


theorem integral_deterministic' {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
    [CompleteSpace E] {f : β → E} {g : α → β} {a : α} (hg : Measurable g)
    (hf : StronglyMeasurable f) : ∫ x, f x ∂deterministic g hg a = f (g a)

(hf : MeasureTheory.StronglyMeasurable f)

∫ (x : β), f x ∂(ProbabilityTheory.Kernel.deterministic g hg) a = f (g a)


theorem Nonempty.inl (hs : s.Nonempty) : (s ∪ t).Nonempty

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


theorem unpaired' {f : ℕ → ℕ → ℕ} : Nat.Primrec (Nat.unpaired f) ↔ Primrec₂ f

{f : ℕ → ℕ → ℕ}


@[to_additive (attr := simp)]
theorem const_le_one : const β a ≤ 1 ↔ a ≤ 1

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


{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]
{c : M}
(f : SmoothBumpFunction I c)


theorem Integrable.comp_div {g : ℝ → F} (hg : Integrable g) {R : ℝ} (hR : R ≠ 0) :
    Integrable fun x => g (x / R)

(hg : MeasureTheory.Integrable g MeasureTheory.volume)

MeasureTheory.Integrable (fun x => g (x / R)) MeasureTheory.volume


/-- Products commute with path composition.
    This is `trans_prod_eq_prod_trans` descended to the quotient. -/
theorem comp_prod_eq_prod_comp : prod q₁ q₂ ⬝ prod r₁ r₂ = prod (q₁ ⬝ r₁) (q₂ ⬝ r₂)

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
{a₁ a₂ a₃ : α}
{b₁ b₂ b₃ : β}
(q₁ : Path.Homotopic.Quotient a₁ a₂)
(q₂ : Path.Homotopic.Quotient b₁ b₂)
(r₁ : Path.Homotopic.Quotient a₂ a₃)
(r₂ : Path.Homotopic.Quotient b₂ b₃)

(Path.Homotopic.prod q₁ q₂).comp (Path.Homotopic.prod r₁ r₂) = Path.Homotopic.prod (q₁.comp r₁) (q₂.comp r₂)


@[to_additive]
theorem ContMDiffOn.inv {f : M → G} {s : Set M} (hf : ContMDiffOn I' I n f s) :
    ContMDiffOn I' I n (fun x => (f x)⁻¹) s

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


/--
  If an accumulation function `f`, produces the same output bits regardless of accumulation state,
  then the state is redundant and can be optimized out
-/
@[simp]
theorem mapAccumr_eq_map_of_unused_state (f : α → σ → σ × β) (s : σ)
    (h : ∀ a s s', (f a s).snd = (f a s').snd) :
    (mapAccumr f xs s).snd = (map (fun x => (f x s).snd) xs)

(f : α → σ → σ × β)

(Mathlib.Vector.mapAccumr f xs s).2 = Mathlib.Vector.map (fun x => (f x s).2) xs


theorem mul_compl_self {P : { P : M // IsLprojection X P }} : (↑P : M) * ↑Pᶜ = 0

{X : Type u_1}
[NormedAddCommGroup X]
{M : Type u_2}
[Ring M]
[Module M X]
{P : { P // IsLprojection X P }}


theorem inv_reindex (e₁ e₂ : n ≃ m) (A : Matrix n n α) : (reindex e₁ e₂ A)⁻¹ = reindex e₂ e₁ A⁻¹

{m : Type u}
{n : Type u'}
{α : Type v}
[Fintype n]
[DecidableEq n]
[CommRing α]
[Fintype m]
[DecidableEq m]
(e₁ e₂ : n ≃ m)
(A : Matrix n n α)

((Matrix.reindex e₁ e₂) A)⁻¹ = (Matrix.reindex e₂ e₁) A⁻¹


/-- Any morphism between initial objects is an isomorphism. -/
lemma isIso_of_isInitial {X Y : C} (hX : IsInitial X) (hY : IsInitial Y) (f : X ⟶ Y) :
    IsIso f

(hX : CategoryTheory.Limits.IsInitial X)

(hY : CategoryTheory.Limits.IsInitial Y)


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

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

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


theorem iff_of_openCover (𝒰 : Y.OpenCover) [∀ i, IsAffine (𝒰.obj i)] :
    P f ↔ ∀ i, Q (𝒰.pullbackHom f i)

{P : CategoryTheory.MorphismProperty AlgebraicGeometry.Scheme}

[∀ (i : 𝒰.J), AlgebraicGeometry.IsAffine (𝒰.obj i)]

P f ↔ ∀ (i : (𝒰.pullbackCover f).J), Q (𝒰.pullbackHom f i)


/-- If `s : ℕ → Set α` is a monotone sequence of sets such that `∑' k, m (s (k + 1) \ s k) ≠ ∞`,
then `m (⋃ n, s n) = ⨆ n, m (s n)`. -/
theorem iUnion_nat_of_monotone_of_tsum_ne_top (m : OuterMeasure α) {s : ℕ → Set α}
    (h_mono : ∀ n, s n ⊆ s (n + 1)) (h0 : (∑' k, m (s (k + 1) \ s k)) ≠ ∞) :
    m (⋃ n, s n) = ⨆ n, m (s n)


/-- If `v` is a linearly independent family of vectors and the kernel of a linear map `f` is
disjoint with the submodule spanned by the vectors of `v`, then `f ∘ v` is a linearly independent
family of vectors. See also `LinearIndependent.map'` for a special case assuming `ker f = ⊥`. -/
theorem LinearIndependent.map (hv : LinearIndependent R v) {f : M →ₗ[R] M'}
    (hf_inj : Disjoint (span R (range v)) (LinearMap.ker f)) : LinearIndependent R (f ∘ v)

(hf_inj : Disjoint (Submodule.span R (Set.range v)) (LinearMap.ker f))


@[ext] theorem ext_of {X Y : Type u} [CommRing X] [CommRing Y] (f g : X →+* Y)
    (h : ∀ x, f x = g x) :
    @Eq (CommRingCat.of X ⟶ CommRingCat.of Y) f g

{X Y : Type u}
[CommRing X]
[CommRing Y]
(f g : X →+* Y)
(h : ∀ (x : X), f x = g x)


@[simp]
lemma divInt_mul_divInt' (n₁ d₁ n₂ d₂ : ℤ) : (n₁ /. d₁) * (n₂ /. d₂) = (n₁ * n₂) /. (d₁ * d₂)

Rat.divInt n₁ d₁ * Rat.divInt n₂ d₂ = Rat.divInt (n₁ * n₂) (d₁ * d₂)


/-- `Sigma.mk` as a `Function.Embedding`. -/
@[simps apply]
def sigmaMk (a : α) : β a ↪ Σx, β x

{α : Type u_1}
{β : α → Type u_3}
(a : α)
(snd : β a)

(Function.Embedding.sigmaMk a) snd = ⟨a, snd⟩


theorem isIso_of_bijective {x y : SimplexCategory} {f : x ⟶ y}
    (hf : Function.Bijective f.toOrderHom.toFun) : IsIso f

(hf : Function.Bijective (SimplexCategory.Hom.toOrderHom f).toFun)


@[simp] lemma mkRat_nonneg {a : ℤ} (ha : 0 ≤ a) (b : ℕ) : 0 ≤ mkRat a b


theorem HasMFDerivAt.mdifferentiableAt (h : HasMFDerivAt I I' f x f') :
    MDifferentiableAt I I' f x

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


lemma presheaf_map_eqToHom_op (X : Scheme) (U V : X.Opens) (i : U = V) :
    X.presheaf.map (eqToHom i).op = eqToHom (i ▸ rfl)

(X : AlgebraicGeometry.Scheme)
(U V : X.Opens)
(i : U = V)

X.presheaf.map (CategoryTheory.eqToHom i).op = CategoryTheory.eqToHom ⋯


theorem dart_fst_mem_support_of_mem_darts {u v : V} :
    ∀ (p : G.Walk u v) {d : G.Dart}, d ∈ p.darts → d.fst ∈ p.support

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


@[simp]
theorem insert_inter_of_not_mem {s₁ s₂ : Finset α} {a : α} (h : a ∉ s₂) :
    insert a s₁ ∩ s₂ = s₁ ∩ s₂

{α : Type u_1}
[DecidableEq α]
{s₁ s₂ : Finset α}
{a : α}
(h : a ∉ s₂)


/-- A subsemigroup is closed under multiplication. -/
@[to_additive "An `AddSubsemigroup` is closed under addition."]
protected theorem mul_mem {x y : M} : x ∈ S → y ∈ S → x * y ∈ S

{M : Type u_1}
[Add M]
(S : AddSubsemigroup M)
{x y : M}


theorem measurable_of_not_zero_le_restrict (hi : ¬0 ≤[i] v) : MeasurableSet i

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


@[to_additive (attr := simp)]
lemma sup_one [SemilatticeSup β] [OrderBot β] (f : α → β) : sup 1 f = f 1

{α : Type u_2}
{β : Type u_3}
[Zero α]
[SemilatticeSup β]
[OrderBot β]
(f : α → β)


@[simp] theorem rTensor_tmul : f.rTensor M (n ⊗ₜ m) = f n ⊗ₜ m

{R : Type u_1}
[CommSemiring R]
(M : Type u_4)
{N : Type u_5}
{P : Type u_6}
[AddCommMonoid M]
[AddCommMonoid N]
[AddCommMonoid P]
[Module R M]
[Module R N]
[Module R P]
(f : N ≃ₗ[R] P)
(m : M)
(n : N)

(LinearEquiv.rTensor M f) (n ⊗ₜ[R] m) = f n ⊗ₜ[R] m


@[simp]
theorem primitiveRoots_zero : primitiveRoots 0 R = ∅

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


/-- Any two morphisms from an initial object are equal. -/
theorem IsInitial.hom_ext {X Y : C} (t : IsInitial X) (f g : X ⟶ Y) : f = g

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


theorem comp_bfamilyOfFamily' {ι : Type u} (r : ι → ι → Prop) [IsWellOrder ι r] (f : ι → α)
    (g : α → β) : (fun i hi => g (bfamilyOfFamily' r f i hi)) = bfamilyOfFamily' r (g ∘ f)

{α : Type u_1}
{β : Type u_2}
{ι : Type u}
(r : ι → ι → Prop)
[IsWellOrder ι r]
(f : ι → α)
(g : α → β)

(fun i hi => g (Ordinal.bfamilyOfFamily' r f i hi)) = Ordinal.bfamilyOfFamily' r (g ∘ f)


/-- Add extra postfix to context-free rewriting. -/
lemma Rewrites.append_right {r : ContextFreeRule T N} {v w : List (Symbol T N)}
    (hvw : r.Rewrites v w) (p : List (Symbol T N)) : r.Rewrites (v ++ p) (w ++ p)

{T : Type uT}
{N : Type uN}
{r : ContextFreeRule T N}
{v w : List (Symbol T N)}
(hvw : r.Rewrites v w)
(p : List (Symbol T N))


theorem setCurr : ∀ {it}, Valid it → Valid (it.setCurr c)


theorem iIndepSet.indep_generateFrom_le_nat [IsMarkovKernel κ] {s : ℕ → Set Ω}
    (hsm : ∀ n, MeasurableSet (s n)) (hs : iIndepSet s κ μ) (n : ℕ) :
    Indep (generateFrom {s (n + 1)}) (generateFrom { t | ∃ k ≤ n, s k = t }) κ μ

(hs : ProbabilityTheory.Kernel.iIndepSet s κ μ)

ProbabilityTheory.Kernel.Indep (MeasurableSpace.generateFrom {s (n + 1)})
  (MeasurableSpace.generateFrom {t | ∃ k ≤ n, s k = t}) κ μ


theorem kstar_mul_le_self : a * b ≤ b → a∗ * b ≤ b

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


theorem modifyNthTail_eq_take_drop (f : List α → List α) (H : f [] = []) :
    ∀ n l, modifyNthTail f n l = take n l ++ f (drop n l)

{α : Type u_1}
(f : List α → List α)
(H : f [] = [])
(n : Nat)
(l : List α)

List.modifyNthTail f n l = List.take n l ++ f (List.drop n l)


@[refl, simp]
theorem EventuallyEq.refl (l : Filter α) (f : α → β) : f =ᶠ[l] f

{α : Type u}
{β : Type v}
(l : Filter α)
(f : α → β)


/-- Multiplication on the left by a nonzero element of a normed division ring tends to infinity at
infinity. -/
theorem tendsto_mul_left_cobounded {a : α} (ha : a ≠ 0) :
    Tendsto (a * ·) (cobounded α) (cobounded α)

{α : Type u_1}
[NormedDivisionRing α]
{a : α}
(ha : a ≠ 0)

Filter.Tendsto (fun x => a * x) (Bornology.cobounded α) (Bornology.cobounded α)


private lemma induction_structuredArrow' (g : StructuredArrow (W.Q.obj X) W.Q) : P g

(P : CategoryTheory.StructuredArrow (W.Q.obj X) W.Q → Prop)

(hP₀ : P (CategoryTheory.StructuredArrow.mk (CategoryTheory.CategoryStruct.id (W.Q.obj X))))

(hP₁ :
  ∀ ⦃Y₁ Y₂ : C⦄ (f : Y₁ ⟶ Y₂) (φ : W.Q.obj X ⟶ W.Q.obj Y₁),
    P (CategoryTheory.StructuredArrow.mk φ) →
      P (CategoryTheory.StructuredArrow.mk (CategoryTheory.CategoryStruct.comp φ (W.Q.map f))))

(hP₂ :
  ∀ ⦃Y₁ Y₂ : C⦄ (w : Y₁ ⟶ Y₂) (hw : W w) (φ : W.Q.obj X ⟶ W.Q.obj Y₂),
    P (CategoryTheory.StructuredArrow.mk φ) →
      P
        (CategoryTheory.StructuredArrow.mk
          (CategoryTheory.CategoryStruct.comp φ (CategoryTheory.Localization.isoOfHom W.Q W w hw).inv)))

(g : CategoryTheory.StructuredArrow (W.Q.obj X) W.Q)


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

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

∀ {X Y : CategoryTheory.StructuredArrow F (CategoryTheory.Functor.const J)} (f : X ⟶ Y),
  ((CategoryTheory.Limits.Cocone.equivStructuredArrow F).inverse.map f).hom = f.right


theorem mirror_neg : (-p).mirror = -p.mirror

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


@[simp]
theorem inv_prod {i j} (w : NeWord G i j) : w.inv.prod = w.prod⁻¹

{ι : Type u_1}
{G : ι → Type u_4}
[(i : ι) → Group (G i)]
{i j : ι}
(w : Monoid.CoprodI.NeWord G i j)


lemma le_egauge_closedBall_one (x : E) : ‖x‖₊ ≤ egauge 𝕜 (closedBall 0 1) x

(𝕜 : Type u_1)
[NormedField 𝕜]
{E : Type u_3}
[SeminormedAddCommGroup E]
[NormedSpace 𝕜 E]
(x : E)

↑‖x‖₊ ≤ egauge 𝕜 (Metric.closedBall 0 1) x


protected theorem eq_mul_of_div_eq_right {a b c : Int}
    (H1 : b ∣ a) (H2 : a.div b = c) : a = b * c


@[simp]
theorem subtypePerm_one (p : α → Prop) (h := fun _ => Iff.rfl) : @subtypePerm α p 1 h = 1

{α : Type u}
(p : α → Prop)
(h : ∀ (x : α), p x ↔ p x := ⋯)


@[mono]
theorem comap_mono : Monotone (comap m)


theorem tendsto_nearestPt {e : ℕ → α} {x : α} (hx : x ∈ closure (range e)) :
    Tendsto (fun N => nearestPt e N x) atTop (𝓝 x)

{α : Type u_1}
[MeasurableSpace α]
[PseudoEMetricSpace α]
[OpensMeasurableSpace α]
{e : ℕ → α}
{x : α}
(hx : x ∈ closure (Set.range e))

Filter.Tendsto (fun N => ↑(MeasureTheory.SimpleFunc.nearestPt e N) x) Filter.atTop (𝓝 x)


@[to_additive (attr := simp)]
theorem prod_mk_fst_snd (x : M ∗ N) : (fst x, snd x) = toProd x

{M : Type u_1}
{N : Type u_2}
[AddMonoid M]
[AddMonoid N]
(x : AddMonoid.Coprod M N)

(AddMonoid.Coprod.fst x, AddMonoid.Coprod.snd x) = AddMonoid.Coprod.toSum x


@[to_additive]
theorem card_dvd_exponent_pow_rank : Nat.card G ∣ Monoid.exponent G ^ Group.rank G

(G : Type u_1)
[AddCommGroup G]
[AddGroup.FG G]

Nat.card G ∣ AddMonoid.exponent G ^ AddGroup.rank G


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

CategoryTheory.Limits.pushout.inr f g ≫ (CategoryTheory.Limits.pushoutIsoUnopPullback f g).hom =
  (CategoryTheory.Limits.pullback.snd f.op g.op).unop


theorem succ_lt_succ_iff : succ a < succ b ↔ a < b

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


theorem roots_expand_map_frobenius_le :
    (expand R p f).roots.map (frobenius R p) ≤ p • f.roots

{R : Type u_1}
[CommRing R]
[IsDomain R]
(p : ℕ)
[ExpChar R p]
(f : R[X])

Multiset.map (⇑(frobenius R p)) ((Polynomial.expand R p) f).roots ≤ p • f.roots


/-- The inclusion `(P^(i + 1) / P^e) ⊂ (P^i / P^e)`. -/
@[simps]
def powQuotSuccInclusion (i : ℕ) :
    Ideal.map (Ideal.Quotient.mk (P ^ e)) (P ^ (i + 1)) →ₗ[R ⧸ p]
    Ideal.map (Ideal.Quotient.mk (P ^ e)) (P ^ i)

(x : ↥(Ideal.map (Ideal.Quotient.mk (P ^ Ideal.ramificationIdx f p P)) (P ^ (i + 1))))

↑((Ideal.powQuotSuccInclusion f p P i) x) = ↑x


/-- A version of the law of total probability for counting probabilities. -/
theorem condCount_add_compl_eq (u t : Set Ω) (hs : s.Finite) :
    condCount (s ∩ u) t * condCount s u + condCount (s ∩ uᶜ) t * condCount s uᶜ =
      condCount s t

{Ω : Type u_1}
[MeasurableSpace Ω]
[MeasurableSingletonClass Ω]
{s : Set Ω}
(u t : Set Ω)
(hs : s.Finite)

(ProbabilityTheory.condCount (s ∩ u)) t * (ProbabilityTheory.condCount s) u +
    (ProbabilityTheory.condCount (s ∩ uᶜ)) t * (ProbabilityTheory.condCount s) uᶜ =
  (ProbabilityTheory.condCount s) t


theorem finite_integral_rpow_sub_one_pow_aux {r : ℝ} (n : ℕ) (hnr : (n : ℝ) < r) :
    (∫⁻ x : ℝ in Ioc 0 1, ENNReal.ofReal ((x ^ (-r⁻¹) - 1) ^ n)) < ∞

∫⁻ (x : ℝ) in Set.Ioc 0 1, ENNReal.ofReal ((x ^ (-r⁻¹) - 1) ^ n) < ⊤


@[simp]
theorem toFinsupp_zero : (0 : R[X]).toFinsupp = 0


theorem eq_false' (h : p → False) : p = False


@[simp]
theorem star_mk (a₁ a₂ a₃ a₄ : R) : star (mk a₁ a₂ a₃ a₄ : ℍ[R,c₁,c₂]) = ⟨a₁, -a₂, -a₃, -a₄⟩

{R : Type u_3}
[CommRing R]
{c₁ c₂ : R}
(a₁ a₂ a₃ a₄ : R)

star { re := a₁, imI := a₂, imJ := a₃, imK := a₄ } = { re := a₁, imI := -a₂, imJ := -a₃, imK := -a₄ }


@[to_additive]
protected theorem Prod.orderOf (x : α × β) : orderOf x = (orderOf x.1).lcm (orderOf x.2)

{α : Type u_4}
{β : Type u_5}
[AddMonoid α]
[AddMonoid β]
(x : α × β)

addOrderOf x = (addOrderOf x.1).lcm (addOrderOf x.2)


@[simp]
theorem arg_neg_one : arg (-1) = π


/-- **Fourier inversion formula**: If a function `f` on a finite-dimensional real inner product
space is continuous, integrable, and its Fourier transform `𝓕 f` is also integrable,
then `𝓕 (𝓕⁻ f) = f`. -/
theorem Continuous.fourier_inversion_inv (h : Continuous f)
    (hf : Integrable f) (h'f : Integrable (𝓕 f)) :
    𝓕 (𝓕⁻ f) = f

(hf : MeasureTheory.Integrable f MeasureTheory.volume)

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


@[simp] lemma div_div_div_eq_div (dvd : b ∣ a) (dvd2 : a ∣ c) : c / (a / b) / b = c / a

{a b c : ℕ}
(dvd : b ∣ a)
(dvd2 : a ∣ c)


theorem continuousOn_mul {f g : ℝ → A} (hf : IntervalIntegrable f μ a b)
    (hg : ContinuousOn g [[a, b]]) : IntervalIntegrable (fun x => g x * f x) μ a b

{A : Type u_5}
[NormedRing A]
{a b : ℝ}
{μ : MeasureTheory.Measure ℝ}
{f g : ℝ → A}
(hf : IntervalIntegrable f μ a b)
(hg : ContinuousOn g [[a, b]])


theorem pow_lt_top : a < ∞ → ∀ n : ℕ, a ^ n < ∞


theorem segment_subset_convexJoin (hx : x ∈ s) (hy : y ∈ t) : segment 𝕜 x y ⊆ convexJoin 𝕜 s t

{𝕜 : Type u_2}
{E : Type u_3}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[Module 𝕜 E]
{s t : Set E}
{x y : E}
(hx : x ∈ s)
(hy : y ∈ t)


theorem Fork.IsLimit.hom_ext {s : Fork f g} (hs : IsLimit s) {W : C} {k l : W ⟶ s.pt}
    (h : k ≫ Fork.ι s = l ≫ Fork.ι s) : k = l

(h : CategoryTheory.CategoryStruct.comp k s.ι = CategoryTheory.CategoryStruct.comp l s.ι)


@[simp]
theorem norm_coe {E} [SeminormedAddCommGroup E] (x : E) : ‖(x : Completion E)‖ = ‖x‖

{E : Type u_2}
[SeminormedAddCommGroup E]
(x : E)

‖↑E x‖ = ‖x‖


@[simp]
lemma eval_lift_apply (f : ∀ (n : ℕ), M →ₗ[R] N ⧸ (I ^ n • ⊤ : Submodule R N))
    (h : ∀ {m n : ℕ} (hle : m ≤ n), transitionMap I N hle ∘ₗ f n = f m)
    (n : ℕ) (x : M) : (lift I f h x).val n = f n x

(h : ∀ {m n : ℕ} (hle : m ≤ n), AdicCompletion.transitionMap I N hle ∘ₗ f n = f m)

↑((AdicCompletion.lift I f ⋯) x) n = (f n) x


lemma rnDeriv_eq_top_iff' (κ η : Kernel α γ) (a : α) (x : γ) :
    rnDeriv κ η a x = ∞ ↔ x ∈ mutuallySingularSetSlice κ η a

[hαγ : MeasurableSpace.CountableOrCountablyGenerated α γ]

κ.rnDeriv η a x = ⊤ ↔ x ∈ κ.mutuallySingularSetSlice η a


@[simp]
theorem smeval_X_pow {n : ℕ} :
    (X ^ n : R[X]).smeval x = x ^ n

(R : Type u_1)
[Semiring R]
{S : Type u_2}
[AddCommMonoid S]
[Pow S ℕ]
[MulActionWithZero R S]
(x : S)
{n : ℕ}


@[simp]
protected theorem map_natCast (n : ℕ) : (n : R[X]).map f = n

{R : Type u}
{S : Type v}
[Semiring R]
[Semiring S]
(f : R →+* S)
(n : ℕ)


protected theorem neg_lt_neg {a b : Int} (h : a < b) : -b < -a


@[reassoc (attr := simp)]
theorem w (h : s ⟶ t) : s.unit ≫ h.right ▷ f = t.unit

{s t : CategoryTheory.Bicategory.LeftLift f g}

CategoryTheory.CategoryStruct.comp s.unit (CategoryTheory.Bicategory.whiskerRight h.right f) = t.unit


/-- The composition of a continuous linear map with a continuous multilinear map is a bounded
bilinear operation. -/
theorem isBoundedBilinearMap_compMultilinear {ι : Type*} {E : ι → Type*} [Fintype ι]
    [∀ i, NormedAddCommGroup (E i)] [∀ i, NormedSpace 𝕜 (E i)] :
    IsBoundedBilinearMap 𝕜 fun p : (F →L[𝕜] G) × ContinuousMultilinearMap 𝕜 E F =>
      p.1.compContinuousMultilinearMap p.2

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{ι : Type u_5}
{E : ι → Type u_6}
[Fintype ι]
[(i : ι) → NormedAddCommGroup (E i)]
[(i : ι) → NormedSpace 𝕜 (E i)]

IsBoundedBilinearMap 𝕜 fun p => p.1.compContinuousMultilinearMap p.2


@[reassoc (attr := simp)]
lemma _root_.CategoryTheory.Iso.hom_inv_id_triangle_hom₁ {A B : Triangle C} (e : A ≅ B) :
    e.hom.hom₁ ≫ e.inv.hom₁ = 𝟙 _

{A B : CategoryTheory.Pretriangulated.Triangle C}


protected theorem add_lt_add_of_lt_of_le {a b c d : Nat} (hlt : a < b) (hle : c ≤ d) :
    a + c < b + d


theorem tensorLeftHomEquiv_naturality {X Y Y' Z Z' : C} [ExactPairing Y Y'] (f : Y' ⊗ X ⟶ Z)
    (g : Z ⟶ Z') :
    (tensorLeftHomEquiv X Y Y' Z') (f ≫ g) = (tensorLeftHomEquiv X Y Y' Z) f ≫ Y ◁ g

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

(CategoryTheory.tensorLeftHomEquiv X Y Y' Z') (f ≫ g) = (CategoryTheory.tensorLeftHomEquiv X Y Y' Z) f ≫ Y ◁ g


/-- Composition with a linear map before and after alternatization are equivalent. -/
theorem compMultilinearMap_alternatization (g : N' →ₗ[R] N'₂)
    (f : MultilinearMap R (fun _ : ι => M) N') :
    MultilinearMap.alternatization (g.compMultilinearMap f)
      = g.compAlternatingMap (MultilinearMap.alternatization f)

{R : Type u_1}
[Semiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
{N' : Type u_6}
[AddCommGroup N']
[Module R N']
{ι : Type u_7}
{N'₂ : Type u_10}
[AddCommGroup N'₂]
[Module R N'₂]
[DecidableEq ι]
[Fintype ι]
(g : N' →ₗ[R] N'₂)
(f : MultilinearMap R (fun x => M) N')


/--
This typeclass captures properties shared by ℝ and ℂ, with an API that closely matches that of ℂ.
-/
class RCLike (K : semiOutParam Type*) extends DenselyNormedField K, StarRing K,
    NormedAlgebra ℝ K, CompleteSpace K where
  re : K →+ ℝ
  im : K →+ ℝ
  /-- Imaginary unit in `K`. Meant to be set to `0` for `K = ℝ`. -/
  I : K
  I_re_ax : re I = 0
  I_mul_I_ax : I = 0 ∨ I * I = -1
  re_add_im_ax : ∀ z : K, 𝓚 (re z) + 𝓚 (im z) * I = z
  ofReal_re_ax : ∀ r : ℝ, re (𝓚 r) = r
  ofReal_im_ax : ∀ r : ℝ, im (𝓚 r) = 0
  mul_re_ax : ∀ z w : K, re (z * w) = re z * re w - im z * im w
  mul_im_ax : ∀ z w : K, im (z * w) = re z * im w + im z * re w
  conj_re_ax : ∀ z : K, re (conj z) = re z
  conj_im_ax : ∀ z : K, im (conj z) = -im z
  conj_I_ax : conj I = -I
  norm_sq_eq_def_ax : ∀ z : K, ‖z‖ ^ 2 = re z * re z + im z * im z
  mul_im_I_ax : ∀ z : K, im z * im I = im z
  /-- only an instance in the `ComplexOrder` locale -/
  [toPartialOrder : PartialOrder K]
  le_iff_re_im {z w : K} : z ≤ w ↔ re z ≤ re w ∧ im z = im w
  -- note we cannot put this in the `extends` clause
  [toDecidableEq : DecidableEq K]

{K : semiOutParam (Type u_1)}
[self : RCLike K]
(z : K)

RCLike.re ((starRingEnd K) z) = RCLike.re z


/-- Bifunctor. This typeclass asserts that a lawless `Bifunctor` is lawful. -/
class LawfulBifunctor (F : Type u₀ → Type u₁ → Type u₂) [Bifunctor F] : Prop where
  id_bimap : ∀ {α β} (x : F α β), bimap id id x = x
  bimap_bimap :
    ∀ {α₀ α₁ α₂ β₀ β₁ β₂} (f : α₀ → α₁) (f' : α₁ → α₂) (g : β₀ → β₁) (g' : β₁ → β₂) (x : F α₀ β₀),
      bimap f' g' (bimap f g x) = bimap (f' ∘ f) (g' ∘ g) x

{F : Type u₀ → Type u₁ → Type u₂}
[Bifunctor F]
[self : LawfulBifunctor F]
{α : Type u₀}
{β : Type u₁}
(x : F α β)


@[simp]
theorem ldiff_bit : ∀ a m b n, ldiff (bit a m) (bit b n) = bit (a && not b) (ldiff m n)

(Nat.bit a m).ldiff (Nat.bit b n) = Nat.bit (a && !b) (m.ldiff n)


theorem mul_le_of_mul_le_of_nonneg_right [MulPosMono α] (h : a * b ≤ c) (hle : d ≤ a) (b0 : 0 ≤ b) :
    d * b ≤ c

{α : Type u_1}
{a b c d : α}
[Mul α]
[Zero α]
[Preorder α]
[MulPosMono α]
(h : a * b ≤ c)
(hle : d ≤ a)
(b0 : 0 ≤ b)


theorem isOpen_iff_inter_of_iSup_eq_top (s : Set β) : IsOpen s ↔ ∀ i, IsOpen (s ∩ U i)

{β : Type u_2}
[TopologicalSpace β]
{ι : Type u_3}
{U : ι → TopologicalSpace.Opens β}
(hU : iSup U = ⊤)
(s : Set β)

IsOpen s ↔ ∀ (i : ι), IsOpen (s ∩ ↑(U i))


lemma add_eq_one_iff : m + n = 1 ↔ m = 0 ∧ n = 1 ∨ m = 1 ∧ n = 0


@[to_additive (attr := simp)]
theorem coe_mkHomeomorph_symm : ⇑(mkHomeomorph : M ≃ₜ Mᵈᵐᵃ).symm = mk.symm


theorem ContMDiffWithinAt.mono_of_mem (hf : ContMDiffWithinAt I I' n f s x) (hts : s ∈ 𝓝[t] x) :
    ContMDiffWithinAt I I' n f t x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M' : Type u_7}
[TopologicalSpace M']
[ChartedSpace H' M']
{f : M → M'}
{s t : Set M}
{x : M}
{n : ℕ∞}
(hf : ContMDiffWithinAt I I' n f s x)
(hts : s ∈ 𝓝[t] x)


@[simp] theorem zeroExtend_eq (x : BitVec n) : zeroExtend n x = x


theorem ULift.closedEmbedding_down [TopologicalSpace X] :
    ClosedEmbedding (ULift.down : ULift.{v, u} X → X)


theorem ConcaveOn.comp_convexOn (hg : ConcaveOn 𝕜 (f '' s) g) (hf : ConvexOn 𝕜 s f)
    (hg' : AntitoneOn g (f '' s)) : ConcaveOn 𝕜 s (g ∘ f)

{𝕜 : Type u_1}
{E : Type u_2}
{α : Type u_4}
{β : Type u_5}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[OrderedAddCommMonoid α]
[OrderedAddCommMonoid β]
[SMul 𝕜 E]
[SMul 𝕜 α]
[SMul 𝕜 β]
{s : Set E}
{f : E → β}
{g : β → α}
(hg : ConcaveOn 𝕜 (f '' s) g)
(hf : ConvexOn 𝕜 s f)
(hg' : AntitoneOn g (f '' s))


@[reassoc (attr := simp)]
theorem diagonalObjPullbackFstIso_inv_snd_snd {X Y Z : C} (f : X ⟶ Z) (g : Y ⟶ Z) :
    (diagonalObjPullbackFstIso f g).inv ≫ pullback.snd _ _ ≫ pullback.snd _ _ =
      pullback.fst _ _ ≫ pullback.snd _ _

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

(CategoryTheory.Limits.diagonalObjPullbackFstIso f g).inv ≫
    CategoryTheory.Limits.pullback.snd (CategoryTheory.Limits.pullback.fst f g)
        (CategoryTheory.Limits.pullback.fst f g) ≫
      CategoryTheory.Limits.pullback.snd f g =
  CategoryTheory.Limits.pullback.fst (CategoryTheory.Limits.pullback.snd g g ≫ g) f ≫
    CategoryTheory.Limits.pullback.snd g g


theorem _root_.fourierIntegral_gaussian_pi' (hb : 0 < b.re) (c : ℂ) :
    (𝓕 fun x : ℝ => cexp (-π * b * x ^ 2 + 2 * π * c * x)) = fun t : ℝ =>
    1 / b ^ (1 / 2 : ℂ) * cexp (-π / b * (t + I * c) ^ 2)

(𝓕 fun x => cexp (-↑π * b * ↑x ^ 2 + 2 * ↑π * c * ↑x)) = fun t =>
  1 / b ^ (1 / 2) * cexp (-↑π / b * (↑t + Complex.I * c) ^ 2)


/-- Strictly monotone functions preserve the colex ordering. -/
lemma toColex_image_le_toColex_image (hf : StrictMono f) :
    toColex (s.image f) ≤ toColex (t.image f) ↔ toColex s ≤ toColex t

{α : Type u_1}
{β : Type u_2}
[LinearOrder α]
[LinearOrder β]
{f : α → β}
{s t : Finset α}
(hf : StrictMono f)

{ ofColex := Finset.image f s } ≤ { ofColex := Finset.image f t } ↔ { ofColex := s } ≤ { ofColex := t }


/-- A compact set is separable. -/
theorem IsCompact.isSeparable {s : Set α} (hs : IsCompact s) : IsSeparable s

{α : Type u}
[PseudoMetricSpace α]
{s : Set α}
(hs : IsCompact s)


@[simp] protected theorem div_left_inj {a b d : Int}
    (hda : d ∣ a) (hdb : d ∣ b) : a.div d = b.div d ↔ a = b


theorem of_d_ne {i j : α} (h : i + 1 ≠ j) : (of X d sq).d i j = 0


theorem Nonempty.of_image₂_left (h : (s.image₂ f t).Nonempty) : s.Nonempty

{α : Type u_1}
{β : Type u_3}
{γ : Type u_5}
[DecidableEq γ]
{f : α → β → γ}
{s : Finset α}
{t : Finset β}
(h : (Finset.image₂ f s t).Nonempty)


/--
If and only if, or logical bi-implication. `a ↔ b` means that `a` implies `b` and vice versa.
By `propext`, this implies that `a` and `b` are equal and hence any expression involving `a`
is equivalent to the corresponding expression with `b` instead.
-/
structure Iff (a b : Prop) : Prop where
  /-- If `a → b` and `b → a` then `a` and `b` are equivalent. -/
  intro ::
  /-- Modus ponens for if and only if. If `a ↔ b` and `a`, then `b`. -/
  mp : a → b
  /-- Modus ponens for if and only if, reversed. If `a ↔ b` and `b`, then `a`. -/
  mpr : b → a


@[simp]
theorem monomial_zero_eq_C : ⇑(monomial R (0 : σ →₀ ℕ)) = C σ R

{σ : Type u_1}
{R : Type u_2}
[Semiring R]

⇑(MvPowerSeries.monomial R 0) = ⇑(MvPowerSeries.C σ R)


@[reassoc]
theorem δ_comp_σ_of_gt' {n} {i : Fin (n + 3)} {j : Fin (n + 2)} (H : j.succ < i) :
    X.δ i ≫ X.σ j =
      X.σ (j.castLT ((add_lt_add_iff_right 1).mp (lt_of_lt_of_le H i.is_le))) ≫
        X.δ (i.pred <|
          fun (hi : i = 0) => by simp only [Fin.not_lt_zero, hi] at H)

(X : CategoryTheory.CosimplicialObject C)

X.δ i ≫ X.σ j = X.σ (j.castLT ⋯) ≫ X.δ (i.pred ⋯)


theorem outerMeasure_preimage (f : G ≃ₜ G) (h : ∀ ⦃K : Compacts G⦄, μ (K.map f f.continuous) = μ K)
    (A : Set G) : μ.outerMeasure (f ⁻¹' A) = μ.outerMeasure A

(h :
  ∀ ⦃K : TopologicalSpace.Compacts G⦄,
    (fun s => ↑(μ.toFun s)) (TopologicalSpace.Compacts.map ⇑f ⋯ K) = (fun s => ↑(μ.toFun s)) K)

μ.outerMeasure (⇑f ⁻¹' A) = μ.outerMeasure A


@[to_additive]
theorem const_mul [Mul γ] [MeasurableMul γ] (h : IdentDistrib f g μ ν) (c : γ) :
    IdentDistrib (fun x => c * f x) (fun x => c * g x) μ ν

(h : ProbabilityTheory.IdentDistrib f g μ ν)

ProbabilityTheory.IdentDistrib (fun x => c + f x) (fun x => c + g x) μ ν


protected theorem IsFiniteMeasureOnCompacts.smul [TopologicalSpace α] (μ : Measure α)
    [IsFiniteMeasureOnCompacts μ] {c : ℝ≥0∞} (hc : c ≠ ∞) : IsFiniteMeasureOnCompacts (c • μ)

MeasureTheory.IsFiniteMeasureOnCompacts (c • μ)


@[to_additive]
theorem card_left_transversal (h : S ∈ leftTransversals (H : Set G)) : Nat.card S = H.index

{G : Type u_1}
[Group G]
{H : Subgroup G}
{S : Set G}
(h : S ∈ Subgroup.leftTransversals ↑H)


theorem lt_lsub_iff {ι : Type u} {f : ι → Ordinal.{max u v}} {a} :
    a < lsub.{_, v} f ↔ ∃ i, a ≤ f i

{ι : Type u}
{f : ι → Ordinal.{max u v}}
{a : Ordinal.{max v u}}


@[to_additive]
theorem mul_eq_of_eq_div' (h : b = c / a) : a * b = c

{G : Type u_3}
[AddCommGroup G]
{a b c : G}
(h : b = c - a)


theorem verticalIntegral_norm_le (hb : 0 < b.re) (c : ℝ) {T : ℝ} (hT : 0 ≤ T) :
    ‖verticalIntegral b c T‖ ≤
      (2 : ℝ) * |c| * exp (-(b.re * T ^ 2 - (2 : ℝ) * |b.im| * |c| * T - b.re * c ^ 2))

‖GaussianFourier.verticalIntegral b c T‖ ≤ 2 * |c| * rexp (-(b.re * T ^ 2 - 2 * |b.im| * |c| * T - b.re * c ^ 2))


theorem cg_closure_singleton (x : M) : CG (closure L ({x} : Set M))

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


/-- If the oriented angle between three points is `π / 2`, so is the unoriented angle
(reversed). -/
theorem angle_rev_eq_pi_div_two_of_oangle_eq_pi_div_two {p₁ p₂ p₃ : P} (h : ∡ p₁ p₂ p₃ = ↑(π / 2)) :
    ∠ p₃ p₂ p₁ = π / 2

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


theorem totallyBounded_of_forall_symm {s : Set α}
    (h : ∀ V ∈ 𝓤 α, SymmetricRel V → ∃ t : Set α, Set.Finite t ∧ s ⊆ ⋃ y ∈ t, ball y V) :
    TotallyBounded s

(h : ∀ V ∈ 𝓤 α, SymmetricRel V → ∃ t, t.Finite ∧ s ⊆ ⋃ y ∈ t, UniformSpace.ball y V)


lemma IsIntegralCurveOn.continuousOn (hγ : IsIntegralCurveOn γ v s) :
    ContinuousOn γ s

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{H : Type u_2}
[TopologicalSpace H]
{I : ModelWithCorners ℝ E H}
{M : Type u_3}
[TopologicalSpace M]
[ChartedSpace H M]
[SmoothManifoldWithCorners I M]
{γ : ℝ → M}
{v : (x : M) → TangentSpace I x}
{s : Set ℝ}
(hγ : IsIntegralCurveOn γ v s)


theorem comp_differentiable_iff {f : G → E} : Differentiable 𝕜 (iso ∘ f) ↔ Differentiable 𝕜 f

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
(iso : E ≃ₗᵢ[𝕜] F)
{f : G → E}

Differentiable 𝕜 (⇑iso ∘ f) ↔ Differentiable 𝕜 f


theorem wordProd_cons (i : B) (ω : List B) : π (i :: ω) = s i * π ω

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

cs.wordProd (i :: ω) = cs.simple i * cs.wordProd ω


/-- The converse: if the additive character takes the value `1` only at `0`,
then it is primitive. -/
theorem zmod_char_primitive_of_eq_one_only_at_zero (n : ℕ) (ψ : AddChar (ZMod n) C)
    (hψ : ∀ a, ψ a = 1 → a = 0) : IsPrimitive ψ

{C : Type v}
[CommMonoid C]
(n : ℕ)
(ψ : AddChar (ZMod n) C)
(hψ : ∀ (a : ZMod n), ψ a = 1 → a = 0)


/-- If an integrable function has zero integral on all compact sets in a sigma-compact space, then
it is zero almost everwhere. -/
lemma ae_eq_zero_of_forall_setIntegral_isCompact_eq_zero
    [SigmaCompactSpace β] [R1Space β] {μ : Measure β} {f : β → E} (hf : Integrable f μ)
    (h'f : ∀ (s : Set β), IsCompact s → ∫ x in s, f x ∂μ = 0) :
    f =ᵐ[μ] 0

(h'f : ∀ (s : Set β), IsCompact s → ∫ (x : β) in s, f x ∂μ = 0)


/-- If a set is bounded below and above, and nonempty, its infimum is less than or equal to
its supremum. -/
theorem csInf_le_csSup (hb : BddBelow s) (ha : BddAbove s) (ne : s.Nonempty) : sInf s ≤ sSup s

{α : Type u_1}
[ConditionallyCompleteLattice α]
{s : Set α}
(hb : BddBelow s)
(ha : BddAbove s)
(ne : s.Nonempty)


protected theorem fin_support_approx : ∀ n, μ (support (hf.approx n)) < ∞

(hf : MeasureTheory.FinStronglyMeasurable f μ)


theorem symmetric_symmetrizeRel (V : Set (α × α)) : SymmetricRel (symmetrizeRel V)


@[to_additive]
theorem Function.Injective.hasProd_range_iff {g : γ → β} (hg : Injective g) :
    HasProd (fun x : Set.range g ↦ f x) a ↔ HasProd (f ∘ g) a

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[AddCommMonoid α]
[TopologicalSpace α]
{f : β → α}
{a : α}
{g : γ → β}
(hg : Function.Injective g)

HasSum (fun x => f ↑x) a ↔ HasSum (f ∘ g) a


protected theorem antitone : Antitone F.N

{R M : Type u}
[CommRing R]
[AddCommGroup M]
[Module R M]
{I : Ideal R}
(F : I.Filtration M)


theorem rank_quotient_le (p : Submodule R M) : Module.rank R (M ⧸ p) ≤ Module.rank R M

{R : Type u}
{M : Type v}
[Ring R]
[AddCommGroup M]
[Module R M]
(p : Submodule R M)


@[simp]
theorem comap_eq_top_iff {I : Ideal S} : I.comap f = ⊤ ↔ I = ⊤

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


theorem any_eq (s : String) (p : Char → Bool) : any s p = s.1.any p


theorem natCast_mul {a₁ a₃ : ℕ} (a₂) (_ : ((a₁ : ℕ) : R) = b₁)
    (_ : ((a₃ : ℕ) : R) = b₃) : ((a₁ ^ a₂ * a₃ : ℕ) : R) = b₁ ^ a₂ * b₃

{R : Type u_1}
[CommSemiring R]
{b₁ b₃ : R}
{a₁ a₃ : ℕ}
(a₂ : ℕ)

↑a₁ = b₁ → ↑a₃ = b₃ → ↑(a₁ ^ a₂ * a₃) = b₁ ^ a₂ * b₃


theorem mul_limZero_right (f : CauSeq β abv) {g} (hg : LimZero g) : LimZero (f * g)

{α : Type u_1}
{β : Type u_2}
[LinearOrderedField α]
[Ring β]
{abv : β → α}
[IsAbsoluteValue abv]
(f : CauSeq β abv)
{g : CauSeq β abv}
(hg : g.LimZero)


@[simp]
theorem whiskerLeft_apply (L : ModuleCat.{u} R) {M N : ModuleCat.{u} R} (f : M ⟶ N)
    (l : L) (m : M) :
    (L ◁ f) (l ⊗ₜ m) = l ⊗ₜ f m

{R : Type u}
[CommRing R]
(L : ModuleCat R)
{M N : ModuleCat R}
(f : M ⟶ N)
(l : ↑L)
(m : ↑M)

(CategoryTheory.MonoidalCategory.whiskerLeft L f) (l ⊗ₜ[R] m) = l ⊗ₜ[R] f m


/-- A lax functor `F` between bicategories `B` and `C` consists of a function between objects
`F.obj`, a function between 1-morphisms `F.map`, and a function between 2-morphisms `F.map₂`.

Unlike functors between categories, `F.map` do not need to strictly commute with the composition,
and do not need to strictly preserve the identity. Instead, there are specified 2-morphisms
`𝟙 (F.obj a) ⟶ F.map (𝟙 a)` and `F.map f ≫ F.map g ⟶ F.map (f ≫ g)`.

`F.map₂` strictly commute with compositions and preserve the identity. They also preserve the
associator, the left unitor, and the right unitor modulo some adjustments of domains and codomains
of 2-morphisms.
-/
structure LaxFunctor (B: Type u₁) [Bicategory.{w₁, v₁} B] (C : Type u₂) [Bicategory.{w₂, v₂} C]
    extends PrelaxFunctor B C where
  /-- The 2-morphism underlying the lax unity constraint. -/
  mapId (a : B) : 𝟙 (obj a) ⟶ map (𝟙 a)
  /-- The 2-morphism underlying the lax functoriality constraint. -/
  mapComp {a b c : B} (f : a ⟶ b) (g : b ⟶ c) : map f ≫ map g ⟶ map (f ≫ g)
  /-- Naturality of the lax functoriality constraight, on the left. -/
  mapComp_naturality_left :
    ∀ {a b c : B} {f f' : a ⟶ b} (η : f ⟶ f') (g : b ⟶ c),
      mapComp f g ≫ map₂ (η ▷ g) = map₂ η ▷ map g ≫ mapComp f' g:= by aesop_cat
  /-- Naturality of the lax functoriality constraight, on the right. -/
  mapComp_naturality_right :
    ∀ {a b c : B} (f : a ⟶ b) {g g' : b ⟶ c} (η : g ⟶ g'),
     mapComp f g ≫ map₂ (f ◁ η) = map f ◁ map₂ η ≫ mapComp f g' := by aesop_cat
  /-- Lax associativity -/
  map₂_associator :
    ∀ {a b c d : B} (f : a ⟶ b) (g : b ⟶ c) (h : c ⟶ d),
      mapComp f g ▷ map h ≫ mapComp (f ≫ g) h ≫ map₂ (α_ f g h).hom =
      (α_ (map f) (map g) (map h)).hom ≫ map f ◁ mapComp g h ≫ mapComp f (g ≫ h) := by aesop_cat
  /-- Lax left unity -/
  map₂_leftUnitor :
    ∀ {a b : B} (f : a ⟶ b),
      map₂ (λ_ f).inv = (λ_ (map f)).inv ≫ mapId a ▷ map f ≫ mapComp (𝟙 a) f := by aesop_cat
  /-- Lax right unity -/
  map₂_rightUnitor :
    ∀ {a b : B} (f : a ⟶ b),
      map₂ (ρ_ f).inv = (ρ_ (map f)).inv ≫ map f ◁ mapId b ≫ mapComp f (𝟙 b) := by aesop_cat

{B : Type u₁}
[CategoryTheory.Bicategory B]
{C : Type u₂}
[CategoryTheory.Bicategory C]
(self : CategoryTheory.LaxFunctor B C)
{a b : B}
(f : a ⟶ b)

self.map₂ (CategoryTheory.Bicategory.rightUnitor f).inv =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.rightUnitor (self.map f)).inv
    (CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.whiskerLeft (self.map f) (self.mapId b))
      (self.mapComp f (CategoryTheory.CategoryStruct.id b)))


theorem indicator_le_thickenedIndicatorAux (δ : ℝ) (E : Set α) :
    (E.indicator fun _ => (1 : ℝ≥0∞)) ≤ thickenedIndicatorAux δ E

{α : Type u_1}
[PseudoEMetricSpace α]
(δ : ℝ)
(E : Set α)

(E.indicator fun x => 1) ≤ thickenedIndicatorAux δ E


theorem isNoetherianRing : IsNoetherianRing A

{A : Type u_2}
[CommRing A]
[IsDomain A]
(h : IsDedekindDomainInv A)


theorem takeWhile_cons_of_pos {x : α} (h : p x) :
    List.takeWhile p (x :: l) = x :: takeWhile p l

{α : Type u}
{p : α → Bool}
{l : List α}
{x : α}
(h : p x = true)

List.takeWhile p (x :: l) = x :: List.takeWhile p l


@[simp] theorem zero_emod (b : Int) : 0 % b = 0


theorem pow_monotone (n : ℕ) : Monotone fun f : CircleDeg1Lift => f ^ n


/-- A functor from a pretriangulated category to an abelian category is an homological functor
if it sends distinguished triangles to exact sequences. -/
class IsHomological extends F.PreservesZeroMorphisms : Prop where
  exact (T : Triangle C) (hT : T ∈ distTriang C) :
    ((shortComplexOfDistTriangle T hT).map F).Exact

[∀ (n : ℤ), (CategoryTheory.shiftFunctor C n).Additive]

(T : CategoryTheory.Pretriangulated.Triangle C)

(hT : T ∈ CategoryTheory.Pretriangulated.distinguishedTriangles)

((CategoryTheory.Pretriangulated.shortComplexOfDistTriangle T hT).map F).Exact


/-- We can always derive `HasFiniteColimits C` by providing colimits at an
arbitrary universe. -/
theorem hasFiniteColimits_of_hasFiniteColimits_of_size
    (h : ∀ (J : Type w) {𝒥 : SmallCategory J} (_ : @FinCategory J 𝒥), HasColimitsOfShape J C) :
    HasFiniteColimits C

(h :
  ∀ (J : Type w) {𝒥 : CategoryTheory.SmallCategory J},
    CategoryTheory.FinCategory J → CategoryTheory.Limits.HasColimitsOfShape J C)


theorem isMaximal_def {I : Ideal α} : I.IsMaximal ↔ IsCoatom I


@[simp]
theorem nodup_reverse_iff {s : Cycle α} : s.reverse.Nodup ↔ s.Nodup


theorem subsingleton_of_subsingleton [Subsingleton α] {s : Set α} : Set.Subsingleton s

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


theorem IsCompact.finite (hs : IsCompact s) (hs' : DiscreteTopology s) : s.Finite

{X : Type u}
[TopologicalSpace X]
{s : Set X}
(hs : IsCompact s)
(hs' : DiscreteTopology ↑s)


@[to_additive]
theorem Group.rank_spec [h : Group.FG G] :
    ∃ S : Finset G, S.card = Group.rank G ∧ Subgroup.closure (S : Set G) = ⊤

(G : Type u_3)
[AddGroup G]
[h : AddGroup.FG G]

∃ S, S.card = AddGroup.rank G ∧ AddSubgroup.closure ↑S = ⊤


theorem Base.insert_not_base {e : α} (hB : M.Base B) (heB : e ∉ B) : ¬ M.Base (insert e B)

{α : Type u_1}
{M : Matroid α}
{B : Set α}
{e : α}
(hB : M.Base B)
(heB : e ∉ B)


@[simp]
theorem algebraMap_inj (x y : R) :
    algebraMap R (TensorAlgebra R M) x = algebraMap R (TensorAlgebra R M) y ↔ x = y

{R : Type u_1}
[CommSemiring R]
(M : Type u_2)
[AddCommMonoid M]
[Module R M]
(x y : R)

(algebraMap R (TensorAlgebra R M)) x = (algebraMap R (TensorAlgebra R M)) y ↔ x = y


theorem mod_two_eq_zero_or_one (n : Nat) : n % 2 = 0 ∨ n % 2 = 1


@[simp]
theorem eta (o : WellOrder) : mk o.α o.r o.wo = o


@[to_additive]
protected theorem UniformFun.hasBasis_nhds_one_of_basis {p : ι → Prop} {b : ι → Set G}
    (h : (𝓝 1 : Filter G).HasBasis p b) :
    (𝓝 1 : Filter (α →ᵤ G)).HasBasis p fun i => { f : α →ᵤ G | ∀ x, toFun f x ∈ b i }

{α : Type u_1}
{G : Type u_2}
{ι : Type u_3}
[Group G]
[UniformSpace G]
[UniformGroup G]
{p : ι → Prop}
{b : ι → Set G}
(h : (𝓝 1).HasBasis p b)

(𝓝 1).HasBasis p fun i => {f | ∀ (x : α), UniformFun.toFun f x ∈ b i}


/-- A right homology map data for a morphism of short complexes in the opposite category
induces a left homology map data in the original category. -/
@[simps]
def RightHomologyMapData.unop {S₁ S₂ : ShortComplex Cᵒᵖ} {φ : S₁ ⟶ S₂}
    {h₁ : S₁.RightHomologyData} {h₂ : S₂.RightHomologyData}
    (ψ : RightHomologyMapData φ h₁ h₂) : LeftHomologyMapData (unopMap φ) h₂.unop h₁.unop

{S₁ S₂ : CategoryTheory.ShortComplex Cᵒᵖ}

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


theorem map_zero₂ (f : M →SL[ρ₁₂] F →SL[σ₁₂] G') (y : F) : f 0 y = 0

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{R : Type u_5}
{𝕜₂ : Type u_6}
{𝕜' : Type u_7}
[NontriviallyNormedField 𝕜']
[NontriviallyNormedField 𝕜₂]
{M : Type u_8}
[TopologicalSpace M]
{σ₁₂ : 𝕜 →+* 𝕜₂}
{G' : Type u_9}
[NormedAddCommGroup G']
[NormedSpace 𝕜₂ G']
[NormedSpace 𝕜' G']
[SMulCommClass 𝕜₂ 𝕜' G']
[Semiring R]
[AddCommMonoid M]
[Module R M]
{ρ₁₂ : R →+* 𝕜'}
(f : M →SL[ρ₁₂] F →SL[σ₁₂] G')
(y : F)


theorem not_lt_of_lt {α : Sort u} {lt : α → α → Prop} [IsStrictOrder α lt] {a b} :
    lt a b → ¬lt b a

{α : Sort u}
{lt : α → α → Prop}
[IsStrictOrder α lt]
{a b : α}


theorem singleton_mul_subgroup {H : Subgroup G} {h : G} (hh : h ∈ H) : {h} * (H : Set G) = H

{G : Type u_2}
[Group G]
{H : Subgroup G}
{h : G}
(hh : h ∈ H)


/-- Helper lemma to chain together a `simp` proof and the result of `mkProdPrf`. -/
theorem derive_trans {α} [Mul α] {a b c d : α} (h : a = b) (h' : c * b = d) : c * a = d

{α : Type u_1}
[Mul α]
{a b c d : α}
(h : a = b)
(h' : c * b = d)


@[to_additive]
theorem mul_mem_mul : s ∈ f → t ∈ g → s * t ∈ f * g

{α : Type u_2}
[Mul α]
{f g : Filter α}
{s t : Set α}


@[reassoc (attr := simp)]
theorem hom_inv_id_app {F G : C ⥤ D} (α : F ≅ G) (X : C) :
    α.hom.app X ≫ α.inv.app X = 𝟙 (F.obj X)

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


theorem mem_closure_pi {ι : Type*} {α : ι → Type*} [∀ i, TopologicalSpace (α i)] {I : Set ι}
    {s : ∀ i, Set (α i)} {x : ∀ i, α i} : x ∈ closure (pi I s) ↔ ∀ i ∈ I, x i ∈ closure (s i)

{ι : Type u_7}
{α : ι → Type u_8}
[(i : ι) → TopologicalSpace (α i)]
{I : Set ι}
{s : (i : ι) → Set (α i)}
{x : (i : ι) → α i}

x ∈ closure (I.pi s) ↔ ∀ i ∈ I, x i ∈ closure (s i)


lemma mor₂_eq_zero_of_mono₃ (h : Mono T.mor₃) : T.mor₂ = 0

[∀ (n : ℤ), (CategoryTheory.shiftFunctor C n).Additive]

(T : CategoryTheory.Pretriangulated.Triangle C)

(hT : T ∈ CategoryTheory.Pretriangulated.distinguishedTriangles)


theorem ne_zero_of_gcd {x y : ℤ} (hc : gcd x y ≠ 0) : x ≠ 0 ∨ y ≠ 0


/-- The object of `smoothSheaf IM I M N` for the open set `U` in `M` is
`C^∞⟮IM, (unop U : Opens M); I, N⟯`, the `(IM, I)`-smooth functions from `U` to `N`.  This is not
just a "moral" equality but a literal and definitional equality! -/
lemma smoothSheaf.obj_eq (U : (Opens (TopCat.of M))ᵒᵖ) :
    (smoothSheaf IM I M N).presheaf.obj U = C^∞⟮IM, (unop U : Opens M); I, N⟯

(U : (TopologicalSpace.Opens ↑(TopCat.of M))ᵒᵖ)

(smoothSheaf IM I M N).presheaf.obj U = ContMDiffMap IM I (↥(Opposite.unop U)) N ⊤


theorem getD_eq_default {n : ℕ} (hn : l.length ≤ n) : l.getD n d = d

{α : Type u}
(l : List α)
(d : α)
{n : ℕ}
(hn : l.length ≤ n)


/-- The cocone for `F` constructed from the colimit of
`(F ⋙ forget₂ (ModuleCat R) AddCommGrp)`. -/
@[simps]
noncomputable def colimitCocone : Cocone F

[CategoryTheory.Limits.HasColimit (F ⋙ CategoryTheory.forget₂ (ModuleCat R) AddCommGrp)]

(ModuleCat.HasColimit.colimitCocone F).ι.app j =
  ModuleCat.homMk (CategoryTheory.Limits.colimit.ι (F ⋙ CategoryTheory.forget₂ (ModuleCat R) AddCommGrp) j) ⋯


/-- The ring homomorphism `ℤ → ZMod n` has kernel generated by `n`. -/
theorem ZMod.ker_intCastRingHom (n : ℕ) :
    RingHom.ker (Int.castRingHom (ZMod n)) = Ideal.span ({(n : ℤ)} : Set ℤ)

RingHom.ker (Int.castRingHom (ZMod n)) = Ideal.span {↑n}


/-- Lift an order homomorphism `f : α →o β` to an order homomorphism `WithTop α →o WithTop β`. -/
@[simps (config := .asFn)]
protected def withTopMap (f : α →o β) : WithTop α →o WithTop β

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


/-- Characterization of the value of `Nat.gcd`. -/
theorem gcd_eq_iff (a b : Nat) :
    gcd a b = g ↔ g ∣ a ∧ g ∣ b ∧ (∀ c, c ∣ a → c ∣ b → c ∣ g)

a.gcd b = g ↔ g ∣ a ∧ g ∣ b ∧ ∀ (c : Nat), c ∣ a → c ∣ b → c ∣ g


protected theorem lipschitzOnWith {t} (ht : t ∈ Icc v.tMin v.tMax) :
    LipschitzOnWith v.L (v t) (closedBall v.x₀ v.R)

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
(v : PicardLindelof E)
{t : ℝ}
(ht : t ∈ Set.Icc v.tMin v.tMax)

LipschitzOnWith v.L (v.toFun t) (Metric.closedBall v.x₀ ↑v.R)


lemma quot_ofList_smul_nontrivial {rs : List R} (h : IsRegular M rs)
    (N : Submodule R M) : Nontrivial (M ⧸ Ideal.ofList rs • N)

(h : RingTheory.Sequence.IsRegular M rs)


@[to_additive (attr := simp)]
theorem le_mul_inv_iff_mul_le : c ≤ a * b⁻¹ ↔ c * b ≤ a

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


theorem comap_eq_of_inverse {f : Filter α} {g : Filter β} {φ : α → β} (ψ : β → α) (eq : ψ ∘ φ = id)
    (hφ : Tendsto φ f g) (hψ : Tendsto ψ g f) : comap φ g = f

{α : Type u}
{β : Type v}
{f : Filter α}
{g : Filter β}
{φ : α → β}
(ψ : β → α)
(eq : ψ ∘ φ = id)
(hφ : Filter.Tendsto φ f g)
(hψ : Filter.Tendsto ψ g f)


theorem Sbtw.ne_right {x y z : P} (h : Sbtw R x y z) : y ≠ z

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[OrderedRing R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
{x y z : P}
(h : Sbtw R x y z)


/-- Remap a simplex along an `Equiv` of index types. -/
@[simps]
def reindex {m n : ℕ} (s : Simplex k P m) (e : Fin (m + 1) ≃ Fin (n + 1)) : Simplex k P n

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{m n : ℕ}
(s : Affine.Simplex k P m)
(e : Fin (m + 1) ≃ Fin (n + 1))

∀ (a : Fin (n + 1)), (s.reindex e).points a = (s.points ∘ ⇑e.symm) a


@[simp]
theorem interior_setOf_im_le (a : ℝ) : interior { z : ℂ | z.im ≤ a } = { z | z.im < a }

interior {z | z.im ≤ a} = {z | z.im < a}


lemma isClosed_iff_isLowerSet_and_dirSupClosed : IsClosed s ↔ IsLowerSet s ∧ DirSupClosed s

{α : Type u_1}
[Preorder α]
[TopologicalSpace α]
[Topology.IsScott α]
{s : Set α}


@[simp]
theorem ball_bot {r : ℝ} (x : E) (hr : 0 < r) : ball (⊥ : Seminorm 𝕜 E) x r = Set.univ

{𝕜 : Type u_3}
{E : Type u_7}
[SeminormedRing 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{r : ℝ}
(x : E)
(hr : 0 < r)


/-- `LinearMap.toAddMonoidHom` promoted to an `AddMonoidHom`. -/
@[simps]
def toAddMonoidHom' : (M →ₛₗ[σ₁₂] M₂) →+ M →+ M₂

{R₁ : Type u_2}
{R₂ : Type u_3}
{M : Type u_9}
{M₂ : Type u_11}
[Semiring R₁]
[Semiring R₂]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R₁ M]
[Module R₂ M₂]
{σ₁₂ : R₁ →+* R₂}
(f : M →ₛₗ[σ₁₂] M₂)

LinearMap.toAddMonoidHom' f = f.toAddMonoidHom


@[simp]
protected lemma comp_smul {n₁ n₂ n₁₂ : ℤ} (z₁ : Cochain F G n₁) (k : R) (z₂ : Cochain G K n₂)
    (h : n₁ + n₂ = n₁₂ ) : z₁.comp (k • z₂) h = k • (z₁.comp z₂ h)

(z₁ : CochainComplex.HomComplex.Cochain F G n₁)

(z₂ : CochainComplex.HomComplex.Cochain G K n₂)


/-- Given `z : S`, `IsLocalization.sec M z` is defined to be a pair `(x, y) : R × M` such
that `z * f y = f x` (so this lemma is true by definition). -/
theorem sec_spec (z : S) :
    z * algebraMap R S (IsLocalization.sec M z).2 = algebraMap R S (IsLocalization.sec M z).1

{R : Type u_1}
[CommSemiring R]
(M : Submonoid R)
{S : Type u_2}
[CommSemiring S]
[Algebra R S]
[IsLocalization M S]
(z : S)

z * (algebraMap R S) ↑(IsLocalization.sec M z).2 = (algebraMap R S) (IsLocalization.sec M z).1


lemma polyCharpoly_coeff_rank_ne_zero :
    (polyCharpoly φ b).coeff (rank R L M) ≠ 0

(R : Type u_1)
(L : Type u_3)
(M : Type u_4)
{ι : Type u_5}
[CommRing R]
[Nontrivial R]
[LieRing L]
[LieAlgebra R L]
[Module.Finite R L]
[Module.Free R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
[Module.Finite R M]
[Module.Free R M]
[Fintype ι]
[DecidableEq ι]
(b : Basis ι R L)

((↑(LieModule.toEnd R L M)).polyCharpoly b).coeff (LieModule.rank R L M) ≠ 0


theorem Ne.le_iff_lt [PartialOrder α] {a b : α} (h : a ≠ b) : a ≤ b ↔ a < b

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


/-- In a real vector space of dimension `> 1`, the complement of any countable set is path
connected. -/
theorem Set.Countable.isPathConnected_compl_of_one_lt_rank
    (h : 1 < Module.rank ℝ E) {s : Set E} (hs : s.Countable) :
    IsPathConnected sᶜ

{E : Type u_1}
[AddCommGroup E]
[Module ℝ E]
[TopologicalSpace E]
[ContinuousAdd E]
[ContinuousSMul ℝ E]
(h : 1 < Module.rank ℝ E)
{s : Set E}
(hs : s.Countable)


theorem measurable_to_countable' [MeasurableSpace α] [Countable α] [MeasurableSpace β] {f : β → α}
    (h : ∀ x, MeasurableSet (f ⁻¹' {x})) : Measurable f

(h : ∀ (x : α), MeasurableSet (f ⁻¹' {x}))


@[simp]
theorem interUnionPullbackCone_snd :
    (interUnionPullbackCone F U V).snd = F.1.map (homOfLE le_sup_right).op

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X : TopCat}
(F : TopCat.Sheaf C X)
(U V : TopologicalSpace.Opens ↑X)

(F.interUnionPullbackCone U V).snd = F.val.map (CategoryTheory.homOfLE ⋯).op


theorem card_eq_one : s.card = 1 ↔ ∃ a, s = {a}


/-- In other words, `limsup cofinite s` is the set of elements lying inside the family `s`
infinitely often. -/
theorem cofinite.limsup_set_eq : limsup s cofinite = { x | { n | x ∈ s n }.Infinite }

{α : Type u_1}
{ι : Type u_4}
{s : ι → Set α}

Filter.limsup s Filter.cofinite = {x | {n | x ∈ s n}.Infinite}


theorem IsCoprime.of_mul_add_left_left (h : IsCoprime (y * z + x) y) : IsCoprime x y

{R : Type u}
[CommSemiring R]
{x y z : R}
(h : IsCoprime (y * z + x) y)


theorem realize_con {A : Set M} {a : A} {v : α → M} : (L.con a).term.realize v = a

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]
{α : Type u'}
{A : Set M}
{a : ↑A}
{v : α → M}

FirstOrder.Language.Term.realize v (L.con a).term = ↑a


lemma sum_const [Countable ι] (μ : ι → Measure β) :
    Kernel.sum (fun n ↦ const α (μ n)) = const α (Measure.sum μ)

{α : Type u_1}
{β : Type u_2}
{ι : Type u_3}
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}
[Countable ι]
(μ : ι → MeasureTheory.Measure β)

(ProbabilityTheory.Kernel.sum fun n => ProbabilityTheory.Kernel.const α (μ n)) =
  ProbabilityTheory.Kernel.const α (MeasureTheory.Measure.sum μ)


/-- If a zero morphism is a cokernel of `f`, then `f` is an epimorphism. -/
theorem epi_of_zero_cokernel {X Y : C} (f : X ⟶ Y) (Z : C)
    (l : IsColimit (CokernelCofork.ofπ (0 : Y ⟶ Z) (show f ≫ 0 = 0 by simp))) : Epi f

(l : CategoryTheory.Limits.IsColimit (CategoryTheory.Limits.CokernelCofork.ofπ 0 ⋯))


theorem ofDual_min' {s : Finset αᵒᵈ} (hs : s.Nonempty) :
    ofDual (min' s hs) = max' (s.image ofDual) (hs.image _)

{α : Type u_2}
[LinearOrder α]
{s : Finset αᵒᵈ}
(hs : s.Nonempty)

OrderDual.ofDual (s.min' hs) = (Finset.image (⇑OrderDual.ofDual) s).max' ⋯


@[simp]
theorem orderIsoUnitIntervalBirational_apply_coe (x : ℝ≥0∞) :
    (orderIsoUnitIntervalBirational x : ℝ) = (x⁻¹ + 1)⁻¹.toReal

↑(ENNReal.orderIsoUnitIntervalBirational x) = (x⁻¹ + 1)⁻¹.toReal


@[to_additive noncommSum_eq_card_nsmul]
theorem noncommProd_eq_pow_card (s : Multiset α) (comm) (m : α) (h : ∀ x ∈ s, x = m) :
    s.noncommProd comm = m ^ Multiset.card s

(comm : {x | x ∈ s}.Pairwise AddCommute)


@[to_additive]
theorem lt_mul_of_lt_of_one_lt' [CovariantClass α α (· * ·) (· ≤ ·)] {a b c : α} (hbc : b < c)
    (ha : 1 < a) :
    b < c * a

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


theorem mem_toOption {o : Part α} [Decidable o.Dom] {a : α} : a ∈ toOption o ↔ a ∈ o

{α : Type u_1}
{o : Part α}
[Decidable o.Dom]
{a : α}


theorem testBit_toNat (x : BitVec w) : x.toNat.testBit i = x.getLsb i


theorem stoppedProcess_eq' (n : ℕ) : stoppedProcess u τ n = Set.indicator {a | n + 1 ≤ τ a} (u n) +
    ∑ i ∈ Finset.range (n + 1), Set.indicator {a | τ a = i} (u i)

{Ω : Type u_1}
{β : Type u_2}
{u : ℕ → Ω → β}
{τ : Ω → ℕ}
[AddCommMonoid β]
(n : ℕ)

MeasureTheory.stoppedProcess u τ n =
  {a | n + 1 ≤ τ a}.indicator (u n) + ∑ i ∈ Finset.range (n + 1), {a | τ a = i}.indicator (u i)


private theorem norm_unitOf (a : α) : ‖unitOf a‖₊ = 1

{α : Type u_5}
[NormedDivisionRing α]
[NormedAlgebra ℝ α]
(a : α)


theorem eval₂_cast_comp (f : σ → τ) (c : ℤ →+* R) (g : τ → R) (p : MvPolynomial σ ℤ) :
    eval₂ c (g ∘ f) p = eval₂ c g (rename f p)

{σ : Type u_1}
{τ : Type u_2}
{R : Type u_4}
[CommSemiring R]
(f : σ → τ)
(c : ℤ →+* R)
(g : τ → R)
(p : MvPolynomial σ ℤ)

MvPolynomial.eval₂ c (g ∘ f) p = MvPolynomial.eval₂ c g ((MvPolynomial.rename f) p)


@[simp]
theorem manyOneReducible_toNat {p : Set α} : p ≤₀ toNat p

{α : Type u}
[Primcodable α]
[Inhabited α]
{p : Set α}


protected lemma lt_or_lt_of_ne : a ≠ b → a < b ∨ b < a


/-- The injection from a subtype is an isometry -/
theorem _root_.isometry_subtype_coe {s : Set α} : Isometry ((↑) : s → α)

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


private theorem add_left_aux6 (x y z : E) :
    ‖(I : 𝕜) • (x + y) - z‖ * ‖(I : 𝕜) • (x + y) - z‖ =
    (‖(I : 𝕜) • (2 • x + y)‖ * ‖(I : 𝕜) • (2 • x + y)‖ +
    ‖(I : 𝕜) • y - 2 • z‖ * ‖(I : 𝕜) • y - 2 • z‖) / 2 -
    ‖(I : 𝕜) • x + z‖ * ‖(I : 𝕜) • x + z‖

{𝕜 : Type u_1}
[RCLike 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[InnerProductSpaceable E]
(x y z : E)

‖RCLike.I • (x + y) - z‖ * ‖RCLike.I • (x + y) - z‖ =
  (‖RCLike.I • (2 • x + y)‖ * ‖RCLike.I • (2 • x + y)‖ + ‖RCLike.I • y - 2 • z‖ * ‖RCLike.I • y - 2 • z‖) / 2 -
    ‖RCLike.I • x + z‖ * ‖RCLike.I • x + z‖


theorem t2Space [TopologicalSpace F] [TopologicalAddGroup F] [T2Space F]
    (𝔖 : Set (Set E)) (h𝔖 : ⋃₀ 𝔖 = Set.univ) : T2Space (UniformConvergenceCLM σ F 𝔖)

{𝕜₁ : Type u_1}
{𝕜₂ : Type u_2}
[NormedField 𝕜₁]
[NormedField 𝕜₂]
(σ : 𝕜₁ →+* 𝕜₂)
{E : Type u_3}
(F : Type u_4)
[AddCommGroup E]
[Module 𝕜₁ E]
[TopologicalSpace E]
[AddCommGroup F]
[Module 𝕜₂ F]
[TopologicalSpace F]
[TopologicalAddGroup F]
[T2Space F]
(𝔖 : Set (Set E))
(h𝔖 : ⋃₀ 𝔖 = Set.univ)


/-- Auxiliary definition used to build `QuadraticModuleCat.instMonoidalCategory`. -/
@[simps! form]
noncomputable abbrev tensorObj (X Y : QuadraticModuleCat.{u} R) : QuadraticModuleCat.{u} R

{R : Type u}
[CommRing R]
[Invertible 2]
(X Y : QuadraticModuleCat R)

(QuadraticModuleCat.instMonoidalCategory.tensorObj X Y).form = X.form.tmul Y.form


theorem Finset.norm_prod_le' {α : Type*} [NormedCommRing α] (s : Finset ι) (hs : s.Nonempty)
    (f : ι → α) : ‖∏ i ∈ s, f i‖ ≤ ∏ i ∈ s, ‖f i‖

{ι : Type u_4}
{α : Type u_5}
[NormedCommRing α]
(s : Finset ι)
(hs : s.Nonempty)
(f : ι → α)


theorem trans_trichotomous_left [IsTrans α r] [IsTrichotomous α r] {a b c : α} :
    ¬r b a → r b c → r a c

{α : Type u}
{r : α → α → Prop}
[IsTrans α r]
[IsTrichotomous α r]
{a b c : α}


theorem length_foldr_permutationsAux2 (t : α) (ts : List α) (r L : List (List α)) :
    length (foldr (fun y r => (permutationsAux2 t ts r y id).2) r L) =
      Nat.sum (map length L) + length r

{α : Type u_1}
(t : α)
(ts : List α)
(r L : List (List α))

(List.foldr (fun y r => (List.permutationsAux2 t ts r y id).2) r L).length = Nat.sum (List.map List.length L) + r.length


@[to_additive]
theorem smul_mem_smul_set : b ∈ s → a • b ∈ a • s

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


theorem ord_cof_le (o : Ordinal.{u}) : o.cof.ord ≤ o


/-- The functor `(Square C)ᵒᵖ ⥤ Square Cᵒᵖ`. -/
@[simps]
def opFunctor : (Square C)ᵒᵖ ⥤ Square Cᵒᵖ

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

∀ {X Y : (CategoryTheory.Square C)ᵒᵖ} (φ : X ⟶ Y), (CategoryTheory.Square.opFunctor.map φ).τ₄ = φ.unop.τ₁.op


@[to_additive]
theorem prod_range_succ_div_top : (∏ i ∈ range (n + 1), f i) / f n = ∏ i ∈ range n, f i

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

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


@[simp]
theorem modEq_zero : a ≡ b [PMOD 0] ↔ a = b

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


theorem restrict_biInf {ι} {I : Set ι} (hI : I.Nonempty) (s : Set α) (m : ι → OuterMeasure α) :
    restrict s (⨅ i ∈ I, m i) = ⨅ i ∈ I, restrict s (m i)

{α : Type u_1}
{ι : Type u_2}
{I : Set ι}
(hI : I.Nonempty)
(s : Set α)
(m : ι → MeasureTheory.OuterMeasure α)

(MeasureTheory.OuterMeasure.restrict s) (⨅ i ∈ I, m i) = ⨅ i ∈ I, (MeasureTheory.OuterMeasure.restrict s) (m i)


lemma IsGLB.exists_of_nonempty_of_not_isPredLimit
    (hf : IsGLB (Set.range f) x) (hx : ¬ IsPredLimit x) :
    ∃ i, f i = x

{ι : Type u_1}
{α : Type u_2}
[ConditionallyCompleteLinearOrder α]
[Nonempty ι]
{f : ι → α}
{x : α}
(hf : IsGLB (Set.range f) x)
(hx : ¬Order.IsPredLimit x)


@[simp]
lemma toNNReal_one : (1 : C(X, ℝ)).toNNReal = 1


@[simp]
private lemma mkSelfProdFib_map_π (t : F.obj X) : F.map (Pi.π _ t) (mkSelfProdFib F X) = t

(F : CategoryTheory.Functor C FintypeCat)

F.map (CategoryTheory.Limits.Pi.π (fun x => X) t) (CategoryTheory.PreGaloisCategory.mkSelfProdFib F X) = t


theorem hasDerivAt_iff_isLittleO_nhds_zero :
    HasDerivAt f f' x ↔ (fun h => f (x + h) - f x - h • f') =o[𝓝 0] fun h => h

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : 𝕜 → F}
{f' : F}
{x : 𝕜}


@[to_additive (attr := aesop safe 20 apply (rule_sets := [Measurable]))]
protected theorem div [Div β] [ContinuousDiv β] (hf : StronglyMeasurable f)
    (hg : StronglyMeasurable g) : StronglyMeasurable (f / g)

(hf : MeasureTheory.StronglyMeasurable f)

(hg : MeasureTheory.StronglyMeasurable g)

MeasureTheory.StronglyMeasurable (f / g)


theorem aemeasurable_indicator_iff {s} (hs : MeasurableSet s) :
    AEMeasurable (indicator s f) μ ↔ AEMeasurable f (μ.restrict s)

{α : Type u_2}
{β : Type u_3}
{m0 : MeasurableSpace α}
[MeasurableSpace β]
{f : α → β}
{μ : MeasureTheory.Measure α}
[Zero β]
{s : Set α}
(hs : MeasurableSet s)

AEMeasurable (s.indicator f) μ ↔ AEMeasurable f (μ.restrict s)


/-- A map `f : E × F → G` satisfies `IsBoundedBilinearMap 𝕜 f` if it is bilinear and
continuous. -/
structure IsBoundedBilinearMap (f : E × F → G) : Prop where
  add_left : ∀ (x₁ x₂ : E) (y : F), f (x₁ + x₂, y) = f (x₁, y) + f (x₂, y)
  smul_left : ∀ (c : 𝕜) (x : E) (y : F), f (c • x, y) = c • f (x, y)
  add_right : ∀ (x : E) (y₁ y₂ : F), f (x, y₁ + y₂) = f (x, y₁) + f (x, y₂)
  smul_right : ∀ (c : 𝕜) (x : E) (y : F), f (x, c • y) = c • f (x, y)
  bound : ∃ C > 0, ∀ (x : E) (y : F), ‖f (x, y)‖ ≤ C * ‖x‖ * ‖y‖

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{f : E × F → G}
(self : IsBoundedBilinearMap 𝕜 f)
(x : E)
(y₁ y₂ : F)


theorem irreducible_pow_sup_of_ge (hI : I ≠ ⊥) (hJ : Irreducible J) (n : ℕ)
    (hn : multiplicity J I ≤ n) :
    J ^ n ⊔ I = J ^ (multiplicity J I).get (PartENat.dom_of_le_natCast hn)

{T : Type u_4}
[CommRing T]
[IsDedekindDomain T]
{I J : Ideal T}
(hI : I ≠ ⊥)
(hJ : Irreducible J)
(n : ℕ)
(hn : multiplicity J I ≤ ↑n)

J ^ n ⊔ I = J ^ (multiplicity J I).get ⋯


/-- In a local ring the characteristics is either zero or a prime power. -/
theorem charP_zero_or_prime_power (R : Type*) [CommRing R] [LocalRing R] (q : ℕ)
    [char_R_q : CharP R q] : q = 0 ∨ IsPrimePow q

(R : Type u_1)
[CommRing R]
[LocalRing R]
(q : ℕ)
[char_R_q : CharP R q]


@[norm_cast]
theorem diagonal_intCast [Zero α] [IntCast α] (m : ℤ) : diagonal (fun _ : n => (m : α)) = m

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


@[simp] lemma isUnit_conjTranspose : IsUnit Aᴴ ↔ IsUnit A

{n : Type u_2}
{α : Type u_3}
[Fintype n]
[DecidableEq n]
[Semiring α]
[StarRing α]
(A : Matrix n n α)


@[simp]
lemma image_coe_Ico (x y : ℝ) : Real.toEReal '' Ico x y = Ico ↑x ↑y

Real.toEReal '' Set.Ico x y = Set.Ico ↑x ↑y


@[to_additive (attr := simp)]
lemma smul_coe_set [Group G] [SetLike S G] [SubgroupClass S G] {s : S} {a : G} (ha : a ∈ s) :
    a • (s : Set G) = s

{G : Type u_2}
{S : Type u_4}
[Group G]
[SetLike S G]
[SubgroupClass S G]
{s : S}
{a : G}
(ha : a ∈ s)


@[to_additive (attr := simp)]
theorem noncommProd_coe (l : List α) (comm) : noncommProd (l : Multiset α) comm = l.prod

{α : Type u_3}
[Monoid α]
(l : List α)
(comm : {x | x ∈ ↑l}.Pairwise Commute)


theorem surjective_unitGroupToResidueFieldUnits :
    Function.Surjective A.unitGroupToResidueFieldUnits

{K : Type u}
[Field K]
(A : ValuationSubring K)


theorem AddMonoidHom.toNatLinearMap_injective [AddCommMonoid M] [AddCommMonoid M₂] :
    Function.Injective (@AddMonoidHom.toNatLinearMap M M₂ _ _)

{M : Type u_9}
{M₂ : Type u_11}
[AddCommMonoid M]
[AddCommMonoid M₂]


@[simp]
theorem abs_arg_le_pi_div_two_iff {z : ℂ} : |arg z| ≤ π / 2 ↔ 0 ≤ re z


lemma Cotangent.val_smul''' {R₀} [CommRing R₀] [Algebra R₀ S] (r : R₀) (x : P.Cotangent) :
    (r • x).val = P.σ (algebraMap R₀ S r) • x.val

{R : Type u}
{S : Type v}
[CommRing R]
[CommRing S]
[Algebra R S]
{P : Algebra.Generators R S}
{R₀ : Type u_1}
[CommRing R₀]
[Algebra R₀ S]
(r : R₀)
(x : P.Cotangent)

(r • x).val = P.σ ((algebraMap R₀ S) r) • x.val


/-- (Impl).
Given a cone for (X × K -), produce a cone for K using the natural transformation `γ₂` -/
@[simps]
def forgetCone {X : C} {K : J ⥤ C} (s : Cone (K ⋙ prod.functor.obj X)) : Cone K

(s : CategoryTheory.Limits.Cone (K ⋙ CategoryTheory.Limits.prod.functor.obj X))

(CategoryTheory.ProdPreservesConnectedLimits.forgetCone s).pt = s.pt


/-- Each function of a family equicontinuous at `x₀` is continuous at `x₀`. -/
theorem EquicontinuousAt.continuousAt {F : ι → X → α} {x₀ : X} (h : EquicontinuousAt F x₀) (i : ι) :
    ContinuousAt (F i) x₀

{ι : Type u_1}
{X : Type u_3}
{α : Type u_7}
[tX : TopologicalSpace X]
[uα : UniformSpace α]
{F : ι → X → α}
{x₀ : X}
(h : EquicontinuousAt F x₀)
(i : ι)


@[simp]
lemma isSemisimple_zero [IsSemisimpleModule R M] : IsSemisimple (0 : Module.End R M)

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
[IsSemisimpleModule R M]


@[measurability]
theorem SimpleFunc.aestronglyMeasurable {_ : MeasurableSpace α} {μ : Measure α} [TopologicalSpace β]
    (f : α →ₛ β) : AEStronglyMeasurable f μ

∀ {x : MeasurableSpace α} {μ : MeasureTheory.Measure α} [inst : TopologicalSpace β] (f : MeasureTheory.SimpleFunc α β),
  MeasureTheory.AEStronglyMeasurable (↑f) μ


lemma le_of_smul_le_smul_left [PosSMulReflectLE α β] (h : a • b₁ ≤ a • b₂) (ha : 0 < a) : b₁ ≤ b₂

{α : Type u_1}
{β : Type u_2}
{a : α}
{b₁ b₂ : β}
[SMul α β]
[Preorder α]
[Preorder β]
[Zero α]
[PosSMulReflectLE α β]
(h : a • b₁ ≤ a • b₂)
(ha : 0 < a)


/-- The identity monad. -/
@[simps!]
def id : Monad C

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

(CategoryTheory.Monad.id C).η.app X = CategoryTheory.CategoryStruct.id X


@[simp]
theorem lcs_zero (N : LieSubmodule R L M) : N.lcs 0 = N

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


@[simp] lemma posFittingCompOf_le_lowerCentralSeries (x : L) (k : ℕ) :
    posFittingCompOf R M x ≤ lowerCentralSeries R L M k

(R : Type u_2)
{L : Type u_3}
(M : Type u_4)
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[LieAlgebra.IsNilpotent R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
(x : L)
(k : ℕ)

LieModule.posFittingCompOf R M x ≤ LieModule.lowerCentralSeries R L M k


theorem ext_iff {inst₁ inst₂ : NonUnitalRing R} :
    inst₁ = inst₂ ↔
      (local_hAdd[R, inst₁] = local_hAdd[R, inst₂]) ∧
      (local_hMul[R, inst₁] = local_hMul[R, inst₂])

{R : Type u}
{inst₁ inst₂ : NonUnitalRing R}

inst₁ = inst₂ ↔ HAdd.hAdd = HAdd.hAdd ∧ HMul.hMul = HMul.hMul


@[simp]
theorem lookup_insert {a} {b : β a} (s : Finmap β) : lookup a (insert a b s) = some b

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

Finmap.lookup a (Finmap.insert a b s) = some b


@[simp]
theorem reindex_symm (eₘ : m ≃ l) (eₙ : n ≃ o) :
    (reindex eₘ eₙ).symm = (reindex eₘ.symm eₙ.symm : Matrix l o α ≃ _)

{l : Type u_1}
{m : Type u_2}
{n : Type u_3}
{o : Type u_4}
{α : Type v}
(eₘ : m ≃ l)
(eₙ : n ≃ o)

(Matrix.reindex eₘ eₙ).symm = Matrix.reindex eₘ.symm eₙ.symm


@[simp]
theorem coe_nil : ↑([] : List α) = @nil α


@[simp]
theorem add_apply [∀ i j, Add (α i j)] (M N : DMatrix m n α) (i j) : (M + N) i j = M i j + N i j

{m : Type u_2}
{n : Type u_3}
{α : m → n → Type v}
[(i : m) → (j : n) → Add (α i j)]
(M N : DMatrix m n α)
(i : m)
(j : n)


@[reassoc (attr := simp)]
lemma rightDerived_fac_app (G : D ⥤ H) (β : F ⟶ L ⋙ G) (X : C) :
    α.app X ≫ (RF.rightDerivedDesc α W G β).app (L.obj X) = β.app X

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

CategoryTheory.CategoryStruct.comp (α.app X) ((RF.rightDerivedDesc α W G β).app (L.obj X)) = β.app X


theorem of_map_sup [SemilatticeSup α] [SemilatticeSup β] {f : α → β}
    (h : ∀ x y, f (x ⊔ y) = f x ⊔ f y) : Monotone f

(h : ∀ (x y : α), f (x ⊔ y) = f x ⊔ f y)


lemma addXYZ_of_Z_ne_zero {P Q : Fin 3 → F} (hP : W.Equation P) (hQ : W.Equation Q) (hPz : P z ≠ 0)
    (hQz : Q z ≠ 0) (hx : P x * Q z ^ 2 ≠ Q x * P z ^ 2) :
    W.addXYZ P Q = addZ P Q •
      ![W.toAffine.addX (P x / P z ^ 2) (Q x / Q z ^ 2)
          (W.toAffine.slope (P x / P z ^ 2) (Q x / Q z ^ 2) (P y / P z ^ 3) (Q y / Q z ^ 3)),
        W.toAffine.addY (P x / P z ^ 2) (Q x / Q z ^ 2) (P y / P z ^ 3)
          (W.toAffine.slope (P x / P z ^ 2) (Q x / Q z ^ 2) (P y / P z ^ 3) (Q y / Q z ^ 3)),
        1]

{F : Type v}
[Field F]
{W : WeierstrassCurve.Jacobian F}
{P Q : Fin 3 → F}
(hP : W.Equation P)
(hQ : W.Equation Q)
(hPz : P z ≠ 0)
(hQz : Q z ≠ 0)
(hx : P x * Q z ^ 2 ≠ Q x * P z ^ 2)

W.addXYZ P Q =
  WeierstrassCurve.Jacobian.addZ P Q •
    ![W.toAffine.addX (P x / P z ^ 2) (Q x / Q z ^ 2)
        (W.toAffine.slope (P x / P z ^ 2) (Q x / Q z ^ 2) (P y / P z ^ 3) (Q y / Q z ^ 3)),
      W.toAffine.addY (P x / P z ^ 2) (Q x / Q z ^ 2) (P y / P z ^ 3)
        (W.toAffine.slope (P x / P z ^ 2) (Q x / Q z ^ 2) (P y / P z ^ 3) (Q y / Q z ^ 3)),
      1]


theorem precomp_map_heq (H : E ⥤ C) (hmap : ∀ {X Y} (f : X ⟶ Y), HEq (F.map f) (G.map f)) {X Y : E}
    (f : X ⟶ Y) : HEq ((H ⋙ F).map f) ((H ⋙ G).map f)

(hmap : ∀ {X Y : C} (f : X ⟶ Y), HEq (F.map f) (G.map f))

HEq ((H.comp F).map f) ((H.comp G).map f)


/-- The proposition that a square
```
  W ---f---> X
  |          |
  g          h
  |          |
  v          v
  Y ---i---> Z

```
is a commuting square.
-/
structure CommSq {W X Y Z : C} (f : W ⟶ X) (g : W ⟶ Y) (h : X ⟶ Z) (i : Y ⟶ Z) : Prop where
  /-- The square commutes. -/
  w : f ≫ h = g ≫ i

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
{W X Y Z : C}
{f : W ⟶ X}
{g : W ⟶ Y}
{h : X ⟶ Z}
{i : Y ⟶ Z}
(self : CategoryTheory.CommSq f g h i)

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


@[simp]
theorem id_base (X : SheafedSpace C) : (𝟙 X : X ⟶ X).base = 𝟙 (X : TopCat)

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


lemma insertNth_mem_Icc {i : Fin (n + 1)} {x : α i} {p : ∀ j, α (i.succAbove j)}
    {q₁ q₂ : ∀ j, α j} :
    i.insertNth x p ∈ Icc q₁ q₂ ↔
      x ∈ Icc (q₁ i) (q₂ i) ∧ p ∈ Icc (fun j ↦ q₁ (i.succAbove j)) fun j ↦ q₂ (i.succAbove j)

{n : ℕ}
{α : Fin (n + 1) → Type u_1}
[(i : Fin (n + 1)) → Preorder (α i)]
{i : Fin (n + 1)}
{x : α i}
{p : (j : Fin n) → α (i.succAbove j)}
{q₁ q₂ : (j : Fin (n + 1)) → α j}

i.insertNth x p ∈ Set.Icc q₁ q₂ ↔
  x ∈ Set.Icc (q₁ i) (q₂ i) ∧ p ∈ Set.Icc (fun j => q₁ (i.succAbove j)) fun j => q₂ (i.succAbove j)


@[simp]
theorem cthickening_singleton {α : Type*} [PseudoMetricSpace α] (x : α) {δ : ℝ} (hδ : 0 ≤ δ) :
    cthickening δ ({x} : Set α) = closedBall x δ

{α : Type u_2}
[PseudoMetricSpace α]
(x : α)
{δ : ℝ}
(hδ : 0 ≤ δ)

Metric.cthickening δ {x} = Metric.closedBall x δ


@[to_additive]
theorem one_div_one : (1 : G) / 1 = 1


@[simp] lemma log_lt_log_iff {x y : ℝ≥0∞} : log x < log y ↔ x < y


theorem isNat_eq_false [AddMonoidWithOne α] [CharZero α] : {a b : α} → {a' b' : ℕ} →
    IsNat a a' → IsNat b b' → Nat.beq a' b' = false → ¬a = b

{α : Type u_1}
[AddMonoidWithOne α]
[CharZero α]
{a b : α}
{a' b' : ℕ}

Mathlib.Meta.NormNum.IsNat a a' → Mathlib.Meta.NormNum.IsNat b b' → a'.beq b' = false → ¬a = b


@[to_additive (attr := simp)]
theorem Homeomorph.shearMulRight_coe :
    ⇑(Homeomorph.shearMulRight G) = fun z : G × G => (z.1, z.1 * z.2)

(G : Type w)
[TopologicalSpace G]
[AddGroup G]
[TopologicalAddGroup G]

⇑(Homeomorph.shearAddRight G) = fun z => (z.1, z.1 + z.2)


/-- For each `a`, we can find a `b` in the codomain, such that `a`'s relation to
the domain of `f` is `b`'s relation to the image of `f`.

Thus, if `a` is not already in `f`, then we can extend `f` by sending `a` to `b`.
-/
theorem exists_across [DenselyOrdered β] [NoMinOrder β] [NoMaxOrder β] [Nonempty β]
    (f : PartialIso α β) (a : α) :
    ∃ b : β, ∀ p ∈ f.val, cmp (Prod.fst p) a = cmp (Prod.snd p) b

{α : Type u_1}
{β : Type u_2}
[LinearOrder α]
[LinearOrder β]
[DenselyOrdered β]
[NoMinOrder β]
[NoMaxOrder β]
[Nonempty β]
(f : Order.PartialIso α β)
(a : α)


@[mono, gcongr]
theorem convexHull_mono (hst : s ⊆ t) : convexHull 𝕜 s ⊆ convexHull 𝕜 t

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


/-- Given a sequence of subsets `sᵢ` of a metric space, together with a sequence of radii `rᵢ`
such that `rᵢ → 0`, the set of points which belong to infinitely many of the
`rᵢ`-thickenings of `sᵢ` is unchanged almost everywhere for a uniformly locally doubling measure if
the `rᵢ` are all scaled by a positive constant.

This lemma is a generalisation of Lemma 9 appearing on page 217 of
[J.W.S. Cassels, *Some metrical theorems in Diophantine approximation. I*](cassels1950).

See also `blimsup_cthickening_mul_ae_eq`.

NB: The `: Set α` type ascription is present because of
https://github.com/leanprover-community/mathlib/issues/16932. -/
theorem blimsup_thickening_mul_ae_eq (p : ℕ → Prop) (s : ℕ → Set α) {M : ℝ} (hM : 0 < M) (r : ℕ → ℝ)
    (hr : Tendsto r atTop (𝓝 0)) :
    (blimsup (fun i => thickening (M * r i) (s i)) atTop p : Set α) =ᵐ[μ]
      (blimsup (fun i => thickening (r i) (s i)) atTop p : Set α)

(hr : Filter.Tendsto r Filter.atTop (𝓝 0))

Filter.blimsup (fun i => Metric.thickening (M * r i) (s i)) Filter.atTop p =ᵐ[μ]
  Filter.blimsup (fun i => Metric.thickening (r i) (s i)) Filter.atTop p


theorem pullback_eq_top_of_mem (S : Sieve X) {f : Y ⟶ X} : S f → S.pullback f = ⊤

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

S.arrows f → CategoryTheory.Sieve.pullback f S = ⊤


theorem Nat.card_coe_set_eq (s : Set α) : Nat.card s = s.ncard


@[deprecated getElem_set_of_ne (since := "2024-06-12")]
theorem get_set_of_ne {l : List α} {i j : ℕ} (h : i ≠ j) (a : α)
    (hj : j < (l.set i a).length) :
    (l.set i a).get ⟨j, hj⟩ = l.get ⟨j, by simpa using hj⟩

{α : Type u}
{l : List α}
{i j : ℕ}
(h : i ≠ j)
(a : α)
(hj : j < (l.set i a).length)


theorem derivative_rootMultiplicity_of_root [CharZero R] {p : R[X]} {t : R} (hpt : p.IsRoot t) :
    p.derivative.rootMultiplicity t = p.rootMultiplicity t - 1

{R : Type u}
[CommRing R]
[IsDomain R]
[CharZero R]
{p : R[X]}
{t : R}
(hpt : p.IsRoot t)

Polynomial.rootMultiplicity t (Polynomial.derivative p) = Polynomial.rootMultiplicity t p - 1


theorem mul_eq_closure_mul_set (M N : AddSubmonoid R) :
    M * N = closure ((M : Set R) * (N : Set R))

{R : Type u_4}
[NonUnitalNonAssocSemiring R]
(M N : AddSubmonoid R)


@[simp]
theorem get_drop (n m : ℕ) (s : Stream' α) : get (drop m s) n = get s (n + m)

(Stream'.drop m s).get n = s.get (n + m)


/-- The addition of ofDigits of two lists is equal to ofDigits of digit-wise addition of them-/
theorem ofDigits_add_ofDigits_eq_ofDigits_zipWith_of_length_eq {b : ℕ} {l1 l2 : List ℕ}
    (h : l1.length = l2.length) :
    ofDigits b l1 + ofDigits b l2 = ofDigits b (l1.zipWith (· + ·) l2)

Nat.ofDigits b l1 + Nat.ofDigits b l2 = Nat.ofDigits b (List.zipWith (fun x x_1 => x + x_1) l1 l2)


lemma toLowerSet_inj {a b : α} : toLowerSet a = toLowerSet b ↔ a = b

Topology.WithLowerSet.toLowerSet a = Topology.WithLowerSet.toLowerSet b ↔ a = b


@[simp]
theorem mem_filter {s : Finset α} {a : α} : a ∈ s.filter p ↔ a ∈ s ∧ p a

{α : Type u_1}
{p : α → Prop}
[DecidablePred p]
{s : Finset α}
{a : α}


@[simp]
theorem fromCostructuredArrow_obj_mk (F : Cᵒᵖ ⥤ Type v) {X : C} (f : yoneda.obj X ⟶ F) :
    (fromCostructuredArrow F).obj (op (CostructuredArrow.mk f)) = ⟨op X, yonedaEquiv.1 f⟩

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

(CategoryTheory.CategoryOfElements.fromCostructuredArrow F).obj (Opposite.op (CategoryTheory.CostructuredArrow.mk f)) =
  ⟨Opposite.op X, CategoryTheory.yonedaEquiv.toFun f⟩


/-- The image of a dense set under a continuous map with dense range is a dense set. -/
theorem DenseRange.dense_image {f : X → Y} (hf' : DenseRange f) (hf : Continuous f)
    (hs : Dense s) : Dense (f '' s)

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
{s : Set X}
{f : X → Y}
(hf' : DenseRange f)
(hf : Continuous f)
(hs : Dense s)


theorem smul_closure (a : M) (s : Set R) : a • span s = span (a • s)

{M : Type u_1}
{R : Type u_2}
[Monoid M]
[CommRing R]
[MulSemiringAction M R]
(a : M)
(s : Set R)


theorem card_Ioo_eq_card_Ioc_sub_one (a b : α) : (Ioo a b).card = (Ioc a b).card - 1

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

(Finset.Ioo a b).card = (Finset.Ioc a b).card - 1


/-- A typeclass saying that `(p : R × R) ↦ p.1 * p.2` maps any product of bounded sets to a bounded
set. This property automatically holds for non-unital seminormed rings, but it also holds, e.g.,
for `ℝ≥0`. -/
class BoundedMul (R : Type*) [Bornology R] [Mul R] : Prop where
  isBounded_mul : ∀ {s t : Set R},
    Bornology.IsBounded s → Bornology.IsBounded t → Bornology.IsBounded (s * t)

{R : Type u_1}
[Bornology R]
[Mul R]
[self : BoundedMul R]
{s t : Set R}


@[measurability]
theorem aemeasurable_iInf {ι} {μ : 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 coe_neg (D : Derivation R A M) : ⇑(-D) = -D

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


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


/-- First Fundamental Domain Lemma: Any `z : ℍ` can be moved to `𝒟` by an element of
`SL(2,ℤ)` -/
theorem exists_smul_mem_fd (z : ℍ) : ∃ g : SL(2, ℤ), g • z ∈ 𝒟


/-- The continuous homomorphism given by inclusion of the second factor. -/
@[to_additive (attr := simps!)
  "The continuous homomorphism given by inclusion of the second factor."]
def inr : ContinuousMonoidHom B (A × B)

(A : Type u_2)
(B : Type u_3)
[AddMonoid A]
[AddMonoid B]
[TopologicalSpace A]
[TopologicalSpace B]
(i : B)

(ContinuousAddMonoidHom.inr A B) i =
  ((ContinuousAddMonoidHom.zero B A).toAddMonoidHom i, (ContinuousAddMonoidHom.id B).toAddMonoidHom i)


@[simp] theorem toNat_append (x : BitVec m) (y : BitVec n) :
    (x ++ y).toNat = x.toNat <<< n ||| y.toNat

{m n : Nat}
(x : BitVec m)
(y : BitVec n)


theorem maximum?_replicate [Max α] {n : Nat} {a : α} (w : max a a = a) :
    (replicate n a).maximum? = if n = 0 then none else some a

{α : Type u_1}
[Max α]
{n : Nat}
{a : α}
(w : max a a = a)

(List.replicate n a).maximum? = if n = 0 then none else some a


theorem add_mul_ediv_right (a b : Int) {c : Int} (H : c ≠ 0) : (a + b * c) / c = a / c + b


theorem ClusterPt.of_inf_right {f g : Filter X} (H : ClusterPt x <| f ⊓ g) :
    ClusterPt x g

{X : Type u}
{x : X}
[TopologicalSpace X]
{f g : Filter X}
(H : ClusterPt x (f ⊓ g))


theorem Countable.image {s : Set α} (hs : s.Countable) (f : α → β) : (f '' s).Countable

{α : Type u}
{β : Type v}
{s : Set α}
(hs : s.Countable)
(f : α → β)


lemma connectedSpace_iff_univ : ConnectedSpace α ↔ IsConnected (univ : Set α)


lemma coyoneda_exact₃ {X : C} (f : X ⟶ T.obj₃) (hf : f ≫ T.mor₃ = 0) :
    ∃ (g : X ⟶ T.obj₂), f = g ≫ T.mor₂

[∀ (n : ℤ), (CategoryTheory.shiftFunctor C n).Additive]

(T : CategoryTheory.Pretriangulated.Triangle C)

(hT : T ∈ CategoryTheory.Pretriangulated.distinguishedTriangles)


theorem coe_injective : Injective ((↑) : α → WithTop α)


theorem exists_eq_mul_self [IsSepClosed k] (x : k) [h2 : NeZero (2 : k)] : ∃ z, x = z * z

{k : Type u}
[Field k]
[IsSepClosed k]
(x : k)
[h2 : NeZero 2]


theorem geom_sum_Ico_mul [Ring α] (x : α) {m n : ℕ} (hmn : m ≤ n) :
    (∑ i ∈ Finset.Ico m n, x ^ i) * (x - 1) = x ^ n - x ^ m

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


theorem unbounded_lt_iff [LinearOrder α] : Unbounded (· < ·) s ↔ ∀ a, ∃ b ∈ s, a ≤ b

{α : Type u_1}
{s : Set α}
[LinearOrder α]

Set.Unbounded (fun x x_1 => x < x_1) s ↔ ∀ (a : α), ∃ b ∈ s, a ≤ b


/-- For a unital C⋆-subalgebra `S` of `A` and `x : S`, if `↑x : A` is invertible in `A`, then
`x` is invertible in `S`. -/
theorem StarSubalgebra.coe_isUnit {S : StarSubalgebra ℂ A} (hS : IsClosed (S : Set A)) {x : S} :
    IsUnit (x : A) ↔ IsUnit x

{A : Type u_1}
[NormedRing A]
[NormedAlgebra ℂ A]
[StarRing A]
[CstarRing A]
[StarModule ℂ A]
[CompleteSpace A]
{S : StarSubalgebra ℂ A}
(hS : IsClosed ↑S)
{x : ↥S}


/-- Writing explicitly the `n+1`-th derivative as the composition of a currying linear equiv,
and the `n`-th derivative of the derivative. -/
theorem iteratedFDerivWithin_succ_eq_comp_right {n : ℕ} (hs : UniqueDiffOn 𝕜 s) (hx : x ∈ s) :
    iteratedFDerivWithin 𝕜 (n + 1) f s x =
      (continuousMultilinearCurryRightEquiv' 𝕜 n E F ∘
          iteratedFDerivWithin 𝕜 n (fun y => fderivWithin 𝕜 f s y) s)
        x

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

iteratedFDerivWithin 𝕜 (n + 1) f s x =
  (⇑(continuousMultilinearCurryRightEquiv' 𝕜 n E F) ∘ iteratedFDerivWithin 𝕜 n (fun y => fderivWithin 𝕜 f s y) s) x


theorem sheaf_eq_amalgamation (ℱ : Sheaf K A) {X : A} {U : D} {T : Sieve U} (hT)
    (x : FamilyOfElements _ T) (hx) (t) (h : x.IsAmalgamation t) :
    t = (ℱ.cond X T hT).amalgamate x hx

{K : CategoryTheory.GrothendieckTopology D}

(x : CategoryTheory.Presieve.FamilyOfElements (ℱ.val.comp (CategoryTheory.coyoneda.obj (Opposite.op X))) T.arrows)

(t : (ℱ.val.comp (CategoryTheory.coyoneda.obj (Opposite.op X))).obj (Opposite.op U))


/-- If `s` is finite, the product of the elements of the list `factors C s x`
is the delta function at `x`. -/
theorem factors_prod_eq_basis (x : π C (· ∈ s)) :
    (factors C s x).prod = spanFinBasis C s x

(x : ↑(Profinite.NobelingProof.π C fun x => x ∈ s))

(Profinite.NobelingProof.factors C s x).prod = Profinite.NobelingProof.spanFinBasis C s x


@[simp]
lemma shiftFunctorAdd'_eq (a b c : ℤ) (h : a + b = c) :
    CategoryTheory.shiftFunctorAdd' (Triangle C) a b c h =
      Triangle.shiftFunctorAdd' C a b c h

CategoryTheory.shiftFunctorAdd' (CategoryTheory.Pretriangulated.Triangle C) a b c h =
  CategoryTheory.Pretriangulated.Triangle.shiftFunctorAdd' C a b c h


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

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


theorem Antitone.convex_gt (hf : Antitone f) (r : β) : Convex 𝕜 { x | r < f x }

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


theorem UniformInducing.cauchy_map_iff {f : α → β} (hf : UniformInducing f) {F : Filter α} :
    Cauchy (map f F) ↔ Cauchy F

{α : Type u}
{β : Type v}
[UniformSpace α]
[UniformSpace β]
{f : α → β}
(hf : UniformInducing f)
{F : Filter α}


@[to_additive]
theorem cauchySeq_finset_iff_nat_tprod_vanishing {f : ℕ → G} :
    (CauchySeq fun s : Finset ℕ ↦ ∏ n ∈ s, f n) ↔
      ∀ e ∈ 𝓝 (1 : G), ∃ N : ℕ, ∀ t ⊆ {n | N ≤ n}, (∏' n : t, f n) ∈ e

{G : Type u_2}
[CommGroup G]
[UniformSpace G]
[UniformGroup G]
{f : ℕ → G}

(CauchySeq fun s => ∏ n ∈ s, f n) ↔ ∀ e ∈ 𝓝 1, ∃ N, ∀ t ⊆ {n | N ≤ n}, ∏' (n : ↑t), f ↑n ∈ e


theorem of_le (N : Submonoid R) (h₁ : M ≤ N) (h₂ : ∀ r ∈ N, IsUnit (algebraMap R S r)) :
    IsLocalization N S

(h₂ : ∀ r ∈ N, IsUnit ((algebraMap R S) r))


/-- Given a distinguished triangle `T` such that `T.mor₃ = 0` and the datum of morphisms
`inr : T.obj₃ ⟶ T.obj₂` and `fst : T.obj₂ ⟶ T.obj₁` satisfying suitable relations, this
is the binary biproduct data expressing that `T.obj₂` identifies to the binary
biproduct of `T.obj₁` and `T.obj₃`.
See also `exists_iso_binaryBiproduct_of_distTriang`. -/
@[simps]
def binaryBiproductData (T : Triangle C) (hT : T ∈ distTriang C) (hT₀ : T.mor₃ = 0)
    (inr : T.obj₃ ⟶ T.obj₂) (inr_snd : inr ≫ T.mor₂ = 𝟙 _) (fst : T.obj₂ ⟶ T.obj₁)
    (total : fst ≫ T.mor₁ + T.mor₂ ≫ inr = 𝟙 T.obj₂) :
    BinaryBiproductData T.obj₁ T.obj₃

[∀ (n : ℤ), (CategoryTheory.shiftFunctor C n).Additive]

(T : CategoryTheory.Pretriangulated.Triangle C)

(hT : T ∈ CategoryTheory.Pretriangulated.distinguishedTriangles)

(CategoryTheory.Pretriangulated.binaryBiproductData T hT hT₀ inr inr_snd fst total).bicone.inr = inr


theorem submodule_span_le_lieSpan : Submodule.span R s ≤ lieSpan R L s

{R : Type u}
{L : Type v}
{M : Type w}
[CommRing R]
[LieRing L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
{s : Set M}

Submodule.span R s ≤ ↑(LieSubmodule.lieSpan R L s)


theorem matPolyEquiv_symm_map_eval (M : (Matrix n n R)[X]) (r : R) :
    (matPolyEquiv.symm M).map (eval r) = M.eval (scalar n r)

{R : Type u}
[CommRing R]
{n : Type v}
[DecidableEq n]
[Fintype n]
(M : (Matrix n n R)[X])
(r : R)

(matPolyEquiv.symm M).map (Polynomial.eval r) = Polynomial.eval ((Matrix.scalar n) r) M


theorem tendsto_norm_atTop_atTop : Tendsto (norm : ℝ → ℝ) atTop atTop

Filter.Tendsto norm Filter.atTop Filter.atTop


theorem «forall» {p : Opens α → Prop} : (∀ U, p U) ↔ ∀ (U : Set α) (hU : IsOpen U), p ⟨U, hU⟩

{α : Type u_2}
[TopologicalSpace α]
{p : TopologicalSpace.Opens α → Prop}

(∀ (U : TopologicalSpace.Opens α), p U) ↔ ∀ (U : Set α) (hU : IsOpen U), p { carrier := U, is_open' := hU }


@[to_additive]
theorem smul_le_smul_left : g₁ ≤ g₂ → f • g₁ ≤ f • g₂

{α : Type u_2}
{β : Type u_3}
[SMul α β]
{f : Filter α}
{g₁ g₂ : Filter β}

g₁ ≤ g₂ → f • g₁ ≤ f • g₂


/-- The homogeneous degree bounds the total degree.

See also `MvPolynomial.IsHomogeneous.totalDegree` when `φ` is non-zero. -/
lemma totalDegree_le (hφ : IsHomogeneous φ n) : φ.totalDegree ≤ n

{σ : Type u_1}
{R : Type u_3}
[CommSemiring R]
{φ : MvPolynomial σ R}
{n : ℕ}
(hφ : φ.IsHomogeneous n)


theorem one_lt_card_iff_nontrivial [Finite α] : 1 < Nat.card α ↔ Nontrivial α


/-- If `M` and `N` are linearly disjoint, `M'` and `N'` are submodules of `M` and `N`,
respectively, such that `M` and `N'` are flat, then `M'` and `N'` are also linearly disjoint. -/
theorem of_le_of_flat_left (H : M.LinearDisjoint N) {M' N' : Submodule R S}
    (hm : M' ≤ M) (hn : N' ≤ N) [Module.Flat R M] [Module.Flat R N'] :
    M'.LinearDisjoint N'

{R : Type u}
{S : Type v}
[CommRing R]
[Ring S]
[Algebra R S]
{M N : Submodule R S}
(H : M.LinearDisjoint N)
{M' N' : Submodule R S}
(hm : M' ≤ M)
(hn : N' ≤ N)
[Module.Flat R ↥M]
[Module.Flat R ↥N']


@[simp, nolint simpNF]
lemma ofLawson_inj {a b : WithLawson α} : ofLawson a = ofLawson b ↔ a = b

{α : Type u_1}
{a b : Topology.WithLawson α}

Topology.WithLawson.ofLawson a = Topology.WithLawson.ofLawson b ↔ a = b


@[reassoc (attr := simp)]
lemma inr_f_triangle_mor₃_f (p : ℤ) : (inr φ).f p ≫ (triangle φ).mor₃.f p = 0

(CochainComplex.mappingCone.inr φ).f p ≫ (CochainComplex.mappingCone.triangle φ).mor₃.f p = 0


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

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

Finset.image (fun b => a * b) t = t.preimage (fun b => a⁻¹ * b) ⋯


@[simp]
theorem eqToHom_f {C₁ C₂ : HomologicalComplex V c} (h : C₁ = C₂) (n : ι) :
    HomologicalComplex.Hom.f (eqToHom h) n =
      eqToHom (congr_fun (congr_arg HomologicalComplex.X h) n)

(CategoryTheory.eqToHom h).f n = CategoryTheory.eqToHom ⋯


lemma Indep.eq_union_image_of_disjointSum {h I} (hI : (disjointSum M N h).Indep I) :
    ∃ IM IN, M.Indep IM ∧ N.Indep IN ∧ Disjoint IM IN ∧ I = IM ∪ IN

{α : Type u_1}
{M N : Matroid α}
{h : Disjoint M.E N.E}
{I : Set α}
(hI : (M.disjointSum N h).Indep I)


@[to_additive]
theorem inter_div_subset : s₁ ∩ s₂ / t ⊆ s₁ / t ∩ (s₂ / t)

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


lemma ContinuousAt.finset_inf_apply (hs : ∀ i ∈ s, ContinuousAt (f i) x) :
    ContinuousAt (fun a ↦ s.inf (f · a)) x

{L : Type u_1}
{X : Type u_2}
[TopologicalSpace L]
[TopologicalSpace X]
{ι : Type u_3}
[SemilatticeInf L]
[OrderTop L]
[ContinuousInf L]
{s : Finset ι}
{f : ι → X → L}
{x : X}
(hs : ∀ i ∈ s, ContinuousAt (f i) x)

ContinuousAt (fun a => s.inf fun x => f x a) x


nonrec theorem _root_.IsUnit.stronglyMeasurable_const_smul_iff {_ : MeasurableSpace α} {c : M}
    (hc : IsUnit c) :
    (StronglyMeasurable fun x => c • f x) ↔ StronglyMeasurable f

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{M : Type u_5}
[TopologicalSpace β]
[Monoid M]
[MulAction M β]
[ContinuousConstSMul M β]

∀ {x : MeasurableSpace α} {c : M},
  IsUnit c → ((MeasureTheory.StronglyMeasurable fun x => c • f x) ↔ MeasureTheory.StronglyMeasurable f)


protected theorem ContMDiffOn.coordChangeL
    (hf : ContMDiffOn IM IB n f s) (he : MapsTo f s e.baseSet) (he' : MapsTo f s e'.baseSet) :
    ContMDiffOn IM 𝓘(𝕜, F →L[𝕜] F) n (fun y ↦ (e.coordChangeL 𝕜 e' (f y) : F →L[𝕜] F)) s

[TopologicalSpace (Bundle.TotalSpace F E)]

{e e' : Trivialization F Bundle.TotalSpace.proj}

ContMDiffOn IM 𝓘(𝕜, F →L[𝕜] F) n (fun y => ↑(Trivialization.coordChangeL 𝕜 e e' (f y))) s


@[to_additive]
theorem prod_univ_two' [CommMonoid β] (f : α → β) (a b : α) :
    ∏ i, f (![a, b] i) = f a * f b

{α : Type u_1}
{β : Type u_2}
[AddCommMonoid β]
(f : α → β)
(a b : α)

∑ i : Fin (Nat.succ 0).succ, f (![a, b] i) = f a + f b


theorem _root_.LinearMap.annihilator_le_of_surjective (f : M →ₗ[R] M')
    (hf : Function.Surjective f) : Module.annihilator R M ≤ Module.annihilator R M'

{R : Type u}
{M : Type v}
{M' : Type u_1}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
[AddCommMonoid M']
[Module R M']
(f : M →ₗ[R] M')
(hf : Function.Surjective ⇑f)


theorem inv_liminf {ι : Sort _} {x : ι → ℝ≥0∞} {l : Filter ι} :
    (liminf x l)⁻¹ = limsup (fun i => (x i)⁻¹) l

{ι : Type u_4}
{x : ι → ℝ≥0∞}
{l : Filter ι}

(Filter.liminf x l)⁻¹ = Filter.limsup (fun i => (x i)⁻¹) l


@[to_additive (attr := simp)]
theorem pow_right (h : Commute a b) (n : ℕ) : Commute a (b ^ n)

{M : Type u_2}
[AddMonoid M]
{a b : M}
(h : AddCommute a b)
(n : ℕ)


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

CategoryTheory.Limits.kernel.lift g f w ≫ CategoryTheory.Limits.kernel.map g g' q r h₂ =
  p ≫ CategoryTheory.Limits.kernel.lift g' f' w'


theorem mem_support_ofMultiset_iff (a : α) : a ∈ (ofMultiset s hs).support ↔ a ∈ s.toFinset

{α : Type u_1}
{s : Multiset α}
(hs : s ≠ 0)
(a : α)

a ∈ (PMF.ofMultiset s hs).support ↔ a ∈ s.toFinset


theorem isUnitTrinomial_iff :
    p.IsUnitTrinomial ↔ p.support.card = 3 ∧ ∀ k ∈ p.support, IsUnit (p.coeff k)


protected
lemma IsSMulRegular.eq_zero_of_smul_eq_zero [Zero M] [SMulZeroClass R M]
    {r : R} {x : M} (h1 : IsSMulRegular M r) (h2 : r • x = 0) : x = 0

{R : Type u_1}
{M : Type u_3}
[Zero M]
[SMulZeroClass R M]
{r : R}
{x : M}
(h1 : IsSMulRegular M r)
(h2 : r • x = 0)


/-- A helper function used in defining the Čech adjunction. -/
@[simps]
def equivalenceRightToLeft (X : SimplicialObject.Augmented C) (F : Arrow C)
    (G : X ⟶ F.augmentedCechNerve) : Augmented.toArrow.obj X ⟶ F

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

(X : CategoryTheory.SimplicialObject.Augmented C)

(CategoryTheory.SimplicialObject.equivalenceRightToLeft X F G).left =
  G.left.app (Opposite.op (SimplexCategory.mk 0)) ≫ CategoryTheory.Limits.WidePullback.π (fun x => F.hom) 0


@[simp]
theorem hasFDerivAtFilter_pi' :
    HasFDerivAtFilter Φ Φ' x L ↔
      ∀ i, HasFDerivAtFilter (fun x => Φ x i) ((proj i).comp Φ') x L

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{x : E}
{L : Filter E}
{ι : Type u_6}
[Fintype ι]
{F' : ι → Type u_7}
[(i : ι) → NormedAddCommGroup (F' i)]
[(i : ι) → NormedSpace 𝕜 (F' i)]
{Φ : E → (i : ι) → F' i}
{Φ' : E →L[𝕜] (i : ι) → F' i}

HasFDerivAtFilter Φ Φ' x L ↔ ∀ (i : ι), HasFDerivAtFilter (fun x => Φ x i) ((ContinuousLinearMap.proj i).comp Φ') x L


@[ext] theorem USize.ext : {x y : USize} → x.toNat = y.toNat → x = y


@[simp]
theorem basisFun_equivFun : (Pi.basisFun R η).equivFun = LinearEquiv.refl _ _

(R : Type u_1)
(η : Type u_2)
[Semiring R]
[Finite η]

(Pi.basisFun R η).equivFun = LinearEquiv.refl R (η → R)


@[norm_cast]
protected theorem hasSum_coe {f : α → ℝ≥0} {r : ℝ≥0} :
    HasSum (fun a => (f a : ℝ≥0∞)) ↑r ↔ HasSum f r

HasSum (fun a => ↑(f a)) ↑r ↔ HasSum f r


theorem det_sum_le {ι : Type*} (s : Finset ι) {A : ι → Matrix n n R} {abv : AbsoluteValue R S}
    {x : S} (hx : ∀ k i j, abv (A k i j) ≤ x) :
    abv (det (∑ k ∈ s, A k)) ≤
      Nat.factorial (Fintype.card n) • (Finset.card s • x) ^ Fintype.card n

(hx : ∀ (k : ι) (i j : n), abv (A k i j) ≤ x)

abv (∑ k ∈ s, A k).det ≤ (Fintype.card n).factorial • (s.card • x) ^ Fintype.card n


theorem one_le_one_div (h1 : 0 < a) (h2 : a ≤ 1) : 1 ≤ 1 / a

{α : Type u_2}
[LinearOrderedSemifield α]
{a : α}
(h1 : 0 < a)
(h2 : a ≤ 1)


lemma cos_quadratic_upper_bound (hx : |x| ≤ π) : cos x ≤ 1 - 2 / π ^ 2 * x ^ 2

Real.cos x ≤ 1 - 2 / Real.pi ^ 2 * x ^ 2


/-- The opposite of an `R[I]` is ring equivalent to
the `AddMonoidAlgebra Rᵐᵒᵖ I` over the opposite ring, taking elements to their opposite. -/
@[simps! (config := { simpRhs := true }) apply symm_apply]
protected noncomputable def opRingEquiv [AddCommMonoid G] :
    k[G]ᵐᵒᵖ ≃+* kᵐᵒᵖ[G]

{k : Type u₁}
{G : Type u₂}
[Semiring k]
[AddCommMonoid G]

∀ (a : (G →₀ k)ᵐᵒᵖ), AddMonoidAlgebra.opRingEquiv a = Finsupp.mapRange MulOpposite.op ⋯ (MulOpposite.unop a)


/-- If a function is analytic on a set `s`, so are its successive derivatives. -/
theorem AnalyticOn.iterated_deriv [CompleteSpace F] (h : AnalyticOn 𝕜 f s) (n : ℕ) :
    AnalyticOn 𝕜 (_root_.deriv^[n] f) s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : 𝕜 → F}
{s : Set 𝕜}
[CompleteSpace F]
(h : AnalyticOn 𝕜 f s)
(n : ℕ)


lemma coeFn_mk (μ : Measure Ω) (hμ) :
    DFunLike.coe (F := ProbabilityMeasure Ω) ⟨μ, hμ⟩ = fun s ↦ (μ s).toNNReal

(hμ : MeasureTheory.IsProbabilityMeasure μ)


theorem lintegral_prod (κ : Kernel α β) [IsSFiniteKernel κ] (η : Kernel α γ) [IsSFiniteKernel η]
    (a : α) {g : β × γ → ℝ≥0∞} (hg : Measurable g) :
    ∫⁻ c, g c ∂(κ ×ₖ η) a = ∫⁻ b, ∫⁻ c, g (b, c) ∂η a ∂κ a

{α : Type u_1}
{β : Type u_2}
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}
{γ : Type u_4}
{mγ : MeasurableSpace γ}
(κ : ProbabilityTheory.Kernel α β)
[ProbabilityTheory.IsSFiniteKernel κ]
(η : ProbabilityTheory.Kernel α γ)
[ProbabilityTheory.IsSFiniteKernel η]
(a : α)
{g : β × γ → ℝ≥0∞}
(hg : Measurable g)

∫⁻ (c : β × γ), g c ∂(κ.prod η) a = ∫⁻ (b : β), ∫⁻ (c : γ), g (b, c) ∂η a ∂κ a


theorem cmp_compares : ∀ a b : NONote, (cmp a b).Compares a b


theorem of_rat_mul : Irrational (q * x) → Irrational x


theorem ae_of_ae_trim (hm : m ≤ m0) {μ : Measure α} {P : α → Prop} (h : ∀ᵐ x ∂μ.trim hm, P x) :
    ∀ᵐ x ∂μ, P x

{α : Type u_1}
{m m0 : MeasurableSpace α}
(hm : m ≤ m0)
{μ : MeasureTheory.Measure α}
{P : α → Prop}
(h : ∀ᵐ (x : α) ∂μ.trim hm, P x)


theorem le_imp_le_iff_lt_imp_lt {β} [LinearOrder α] [LinearOrder β] {a b : α} {c d : β} :
    a ≤ b → c ≤ d ↔ d < c → b < a

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


@[simp]
theorem intCast_mem_zmultiples_one : ↑(k : ℤ) ∈ zmultiples (1 : R)


/-- If `l : Filter ℂ` is an "exponential comparison filter", then for any complex `a` and any
positive real `b`, we have `(fun z ↦ z ^ a) =o[l] (fun z ↦ exp (b * z))`. -/
theorem isLittleO_cpow_exp (hl : IsExpCmpFilter l) (a : ℂ) {b : ℝ} (hb : 0 < b) :
    (fun z => z ^ a) =o[l] fun z => exp (b * z)

{l : Filter ℂ}
(hl : Complex.IsExpCmpFilter l)
(a : ℂ)
{b : ℝ}
(hb : 0 < b)

(fun z => z ^ a) =o[l] fun z => Complex.exp (↑b * z)


lemma abv_eq_zero {x} : abv x = 0 ↔ x = 0

{S : Type u_5}
[OrderedSemiring S]
{R : Type u_6}
[Semiring R]
(abv : R → S)
[IsAbsoluteValue abv]
{x : R}


theorem ContinuousLinearMap.integrable_comp {φ : α → H} (L : H →L[𝕜] E) (φ_int : Integrable φ μ) :
    Integrable (fun a : α => L (φ a)) μ

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{E : Type u_5}
[NormedAddCommGroup E]
{𝕜 : Type u_6}
[NontriviallyNormedField 𝕜]
[NormedSpace 𝕜 E]
{H : Type u_7}
[NormedAddCommGroup H]
[NormedSpace 𝕜 H]
{φ : α → H}
(L : H →L[𝕜] E)
(φ_int : MeasureTheory.Integrable φ μ)

MeasureTheory.Integrable (fun a => L (φ a)) μ


@[to_additive]
theorem unique_one {α : Type*} [Unique α] [One α] : default = (1 : α)


@[simp]
theorem coe_of_injective_castSucc_symm {n : ℕ} (i : Fin n.succ) (hi) :
    ((Equiv.ofInjective castSucc (castSucc_injective _)).symm ⟨i, hi⟩ : ℕ) = i

{n : ℕ}
(i : Fin n.succ)
(hi : i ∈ Set.range Fin.castSucc)

↑((Equiv.ofInjective Fin.castSucc ⋯).symm ⟨i, hi⟩) = ↑i


lemma pow_card_sub_one {p : ℕ} [Fact p.Prime] (a : ZMod p) :
    a ^ (p - 1) = if a ≠ 0 then 1 else 0

{p : ℕ}
[Fact (Nat.Prime p)]
(a : ZMod p)


@[to_additive (attr := simp)]
theorem coe_of (R : Type u) [Mul R] : (MagmaCat.of R : Type u) = R


theorem modEq_iff_add_fac {a b n : ℤ} : a ≡ b [ZMOD n] ↔ ∃ t, b = a + n * t


/-- In a real normed space, the image of the unit ball under scalar multiplication by a positive
constant `r` is the ball of radius `r`. -/
theorem smul_unitBall_of_pos {r : ℝ} (hr : 0 < r) : r • ball (0 : E) 1 = ball (0 : E) r

{E : Type u_2}
[SeminormedAddCommGroup E]
[NormedSpace ℝ E]
{r : ℝ}
(hr : 0 < r)


theorem dist_ne_zero {x y : γ} : dist x y ≠ 0 ↔ x ≠ y


/-- The counit isomorphism of the
equivalence `triangleOpEquivalence C : (Triangle C)ᵒᵖ ≌ Triangle Cᵒᵖ` . -/
@[simps!]
noncomputable def counitIso : inverse C ⋙ functor C ≅ 𝟭 _

(X : CategoryTheory.Pretriangulated.Triangle Cᵒᵖ)

((CategoryTheory.Pretriangulated.TriangleOpEquivalence.counitIso C).hom.app X).hom₁ =
  CategoryTheory.CategoryStruct.id X.obj₁


@[to_additive (attr := simp)]
theorem singleton_div (a : α) : {a} / s = s.image (a / ·)

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

{a} - s = Finset.image (fun x => a - x) s


theorem isClosed_C1 : IsClosed (C1 C ho)

(ho : o < Ordinal.type fun x x_1 => x < x_1)

IsClosed (Profinite.NobelingProof.C1 C ho)


/-- `piFinTwoEquiv` as an `IsometryEquiv`. -/
@[simps!]
def piFinTwo (α : Fin 2 → Type*) [∀ i, PseudoEMetricSpace (α i)] : (∀ i, α i) ≃ᵢ α 0 × α 1

[(i : Fin 2) → PseudoEMetricSpace (α i)]

(IsometryEquiv.piFinTwo α).symm p i = Fin.cons p.1 (Fin.cons p.2 finZeroElim) i


@[to_additive]
theorem prod_Ico_eq_prod_range (f : ℕ → M) (m n : ℕ) :
    ∏ k ∈ Ico m n, f k = ∏ k ∈ range (n - m), f (m + k)

{M : Type u_2}
[AddCommMonoid M]
(f : ℕ → M)
(m n : ℕ)

∑ k ∈ Finset.Ico m n, f k = ∑ k ∈ Finset.range (n - m), f (m + k)


theorem ult_eq_not_carry (x y : BitVec w) : x.ult y = !carry w x (~~~y) true


@[simp]
theorem reindexFinsetRange_apply (x : Finset.univ.image b) : b.reindexFinsetRange x = x

(x : { x // x ∈ Finset.image (⇑b) Finset.univ })