/-- Lift a functor `F : C ⥤ D` to `WithTerminal C ⥤ D`. -/
@[simps]
def lift {D : Type*} [Category D] {Z : D} (F : C ⥤ D) (M : ∀ x : C, F.obj x ⟶ Z)
    (hM : ∀ (x y : C) (f : x ⟶ y), F.map f ≫ M y = M x) : WithTerminal C ⥤ D

(hM : ∀ (x y : C) (f : x ⟶ y), CategoryTheory.CategoryStruct.comp (F.map f) (M y) = M x)

(CategoryTheory.WithTerminal.lift F M hM).map f =
  match X, Y, f with
  | CategoryTheory.WithTerminal.of x, CategoryTheory.WithTerminal.of y, f => F.map (CategoryTheory.WithTerminal.down f)
  | CategoryTheory.WithTerminal.of x, CategoryTheory.WithTerminal.star, x_1 => M x
  | CategoryTheory.WithTerminal.star, CategoryTheory.WithTerminal.star, x => CategoryTheory.CategoryStruct.id Z


lemma toColex_inj {s t : Finset α} : toColex s = toColex t ↔ s = t

{ ofColex := s } = { ofColex := t } ↔ s = t


@[simp]
theorem sup_apply (x : ℝ) : (f ⊔ g) x = max (f x) (g x)


theorem liftProp_iff {P : (H → H') → Set H → H → Prop} {f : M → M'} :
    LiftProp P f ↔
      Continuous f ∧ ∀ x, P (chartAt H' (f x) ∘ f ∘ (chartAt H x).symm) univ (chartAt H x x)

{H : Type u_1}
{M : Type u_2}
{H' : Type u_3}
{M' : Type u_4}
[TopologicalSpace H]
[TopologicalSpace M]
[ChartedSpace H M]
[TopologicalSpace H']
[TopologicalSpace M']
[ChartedSpace H' M']
{P : (H → H') → Set H → H → Prop}
{f : M → M'}

ChartedSpace.LiftProp P f ↔
  Continuous f ∧ ∀ (x : M), P (↑(chartAt H' (f x)) ∘ f ∘ ↑(chartAt H x).symm) Set.univ (↑(chartAt H x) x)


lemma ofJ1728_j [Invertible (2 : R)] : (ofJ1728 R).j = 1728

(R : Type u)
[CommRing R]
[Invertible 2]


theorem mulVec_stdBasisMatrix [Fintype m] (i : n) (j : m) (c : α) (x : m → α) :
    mulVec (stdBasisMatrix i j c) x = Function.update (0 : n → α) i (c * x j)

{m : Type u_2}
{n : Type u_3}
{α : Type u_5}
[DecidableEq m]
[DecidableEq n]
[Semiring α]
[Fintype m]
(i : n)
(j : m)
(c : α)
(x : m → α)

(Matrix.stdBasisMatrix i j c).mulVec x = Function.update 0 i (c * x j)


theorem symm {a b : α} (hab : a ≈ b) : b ≈ a

{α : Sort u}
[Setoid α]
{a b : α}
(hab : a ≈ b)


lemma solidClosure_min (hst : s ⊆ t) (ht : IsSolid t) : solidClosure s ⊆ t

(ht : LatticeOrderedAddCommGroup.IsSolid t)

LatticeOrderedAddCommGroup.solidClosure s ⊆ t


theorem sorted_ofFn_iff {r : α → α → Prop} : (ofFn f).Sorted r ↔ ((· < ·) ⇒ r) f f

{n : ℕ}
{α : Type u}
{f : Fin n → α}
{r : α → α → Prop}

List.Sorted r (List.ofFn f) ↔ ((fun x x_1 => x < x_1) ⇒ r) f f


protected theorem one_le_inv : 1 ≤ a⁻¹ ↔ a ≤ 1

1 ≤ a⁻¹ ↔ a ≤ 1


nonrec theorem disjoint_iff {f g : ι →₀ α} : Disjoint f g ↔ Disjoint f.support g.support


theorem mk_injective (s : Finset ι) : Function.Injective (mk β s)

{ι : Type v}
{β : ι → Type w}
[(i : ι) → AddCommMonoid (β i)]
[DecidableEq ι]
(s : Finset ι)


theorem ofSet_trans {s : Set X} (hs : IsOpen s) : (ofSet s hs).trans e = e.restr s

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

(PartialHomeomorph.ofSet s hs).trans e = e.restr s


theorem pos_eq_endPos {l r it} (h : ValidFor l r it) : it.2 = it.1.endPos ↔ r = []

{l r : List Char}
{it : String.Iterator}
(h : String.Iterator.ValidFor l r it)


theorem isGreatest_Iic : IsGreatest (Iic a) a


/-- The tensor product bifunctor `C ⥤ C ⥤ C` of a monoidal category. -/
@[simps]
def curriedTensor : C ⥤ C ⥤ C

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

∀ {X Y : C} (f : X ⟶ Y) (Y_1 : C),
  ((CategoryTheory.MonoidalCategory.curriedTensor C).map f).app Y_1 = CategoryTheory.MonoidalCategory.whiskerRight f Y_1


theorem specializes_iff_eq [T1Space X] {x y : X} : x ⤳ y ↔ x = y

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


/-- The restriction of a presheafed space along an open embedding into the space.
-/
@[simps]
def restrict {U : TopCat} (X : PresheafedSpace C) {f : U ⟶ (X : TopCat)}
    (h : OpenEmbedding f) : PresheafedSpace C

(X : AlgebraicGeometry.PresheafedSpace C)

(X.restrict h).presheaf = ⋯.functor.op ⋙ X.presheaf


protected theorem image_symm_eq_preimage (e : P₁ ≃ᵃL[k] P₂) (s : Set P₂) :
    e.symm '' s = e ⁻¹' s

{k : Type u_1}
{P₁ : Type u_2}
{P₂ : Type u_3}
{V₁ : Type u_6}
{V₂ : Type u_7}
[Ring k]
[AddCommGroup V₁]
[Module k V₁]
[AddTorsor V₁ P₁]
[AddCommGroup V₂]
[Module k V₂]
[AddTorsor V₂ P₂]
[TopologicalSpace P₁]
[TopologicalSpace P₂]
(e : P₁ ≃ᵃL[k] P₂)
(s : Set P₂)


/-- The category of multiforks is equivalent to the category of forks over `∏ᶜ I.left ⇉ ∏ᶜ I.right`.
It then follows from `CategoryTheory.IsLimit.ofPreservesConeTerminal` (or `reflects`) that it
preserves and reflects limit cones.
-/
@[simps]
noncomputable def multiforkEquivPiFork : Multifork I ≌ Fork I.fstPiMap I.sndPiMap

(I : CategoryTheory.Limits.MulticospanIndex C)

I.multiforkEquivPiFork.counitIso =
  CategoryTheory.NatIso.ofComponents
    (fun K =>
      CategoryTheory.Limits.Fork.ext (CategoryTheory.Iso.refl ((I.ofPiForkFunctor.comp I.toPiForkFunctor).obj K).pt) ⋯)
    ⋯


/-- A version of `Finset.sup'_map` with LHS and RHS reversed.
Also, this lemma assumes that `s` is nonempty instead of assuming that its image is nonempty. -/
lemma sup'_comp_eq_map {s : Finset γ} {f : γ ↪ β} (g : β → α) (hs : s.Nonempty) :
    s.sup' hs (g ∘ f) = (s.map f).sup' (map_nonempty.2 hs) g

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[SemilatticeSup α]
{s : Finset γ}
{f : γ ↪ β}
(g : β → α)
(hs : s.Nonempty)

s.sup' hs (g ∘ ⇑f) = (Finset.map f s).sup' ⋯ g


theorem W_eq_integral_sin_pow_div_integral_sin_pow (k : ℕ) : (π / 2)⁻¹ * W k =
    (∫ x : ℝ in (0)..π, sin x ^ (2 * k + 1)) / ∫ x : ℝ in (0)..π, sin x ^ (2 * k)

(π / 2)⁻¹ * Real.Wallis.W k = (∫ (x : ℝ) in 0 ..π, Real.sin x ^ (2 * k + 1)) / ∫ (x : ℝ) in 0 ..π, Real.sin x ^ (2 * k)


theorem logb_mul (hx : x ≠ 0) (hy : y ≠ 0) : logb b (x * y) = logb b x + logb b y

Real.logb b (x * y) = Real.logb b x + Real.logb b y


theorem toPartitionOfUnity_eq_mul_prod (i : ι) (x : X) (t : Finset ι)
    (ht : ∀ j, WellOrderingRel j i → f j x ≠ 0 → j ∈ t) :
    f.toPartitionOfUnity i x = f i x * ∏ j ∈ t.filter fun j => WellOrderingRel j i, (1 - f j x)

(ht : ∀ (j : ι), WellOrderingRel j i → (f j) x ≠ 0 → j ∈ t)

(f.toPartitionOfUnity i) x = (f i) x * ∏ j ∈ Finset.filter (fun j => WellOrderingRel j i) t, (1 - (f j) x)


theorem mul_def {f g : k[G]} :
    f * g = f.sum fun a₁ b₁ => g.sum fun a₂ b₂ => single (a₁ + a₂) (b₁ * b₂)

{k : Type u₁}
{G : Type u₂}
[Semiring k]
[Add G]
{f g : AddMonoidAlgebra k G}

f * g = Finsupp.sum f fun a₁ b₁ => Finsupp.sum g fun a₂ b₂ => AddMonoidAlgebra.single (a₁ + a₂) (b₁ * b₂)


theorem size_empty : (#[] : Array α).size = 0


/-- Two multivariate formal power series are equal
 if and only if all their coefficients are equal. -/
theorem ext_iff {φ ψ : MvPowerSeries σ R} : φ = ψ ↔ ∀ n : σ →₀ ℕ, coeff R n φ = coeff R n ψ

{σ : Type u_1}
{R : Type u_2}
[Semiring R]
{φ ψ : MvPowerSeries σ R}

φ = ψ ↔ ∀ (n : σ →₀ ℕ), (MvPowerSeries.coeff R n) φ = (MvPowerSeries.coeff R n) ψ


theorem HasStrictFDerivAt.cos (hf : HasStrictFDerivAt f f' x) :
    HasStrictFDerivAt (fun x => Real.cos (f x)) (-Real.sin (f x) • f') x

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : E → ℝ}
{f' : E →L[ℝ] ℝ}
{x : E}
(hf : HasStrictFDerivAt f f' x)


/-- The maximal ideal of `k⟦X⟧` is generated by `X`. -/
theorem maximalIdeal_eq_span_X : LocalRing.maximalIdeal (k⟦X⟧) = Ideal.span {X}

LocalRing.maximalIdeal (PowerSeries k) = Ideal.span {PowerSeries.X}


/-- The direction equals the `vectorSpan`. -/
theorem direction_eq_vectorSpan (s : AffineSubspace k P) : s.direction = vectorSpan k (s : Set P)

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
(s : AffineSubspace k P)


theorem ContMDiffOn.prod_mk_space {f : M → E'} {g : M → F'} (hf : ContMDiffOn I 𝓘(𝕜, E') n f s)
    (hg : ContMDiffOn I 𝓘(𝕜, F') n g s) : ContMDiffOn I 𝓘(𝕜, E' × F') n (fun x => (f x, g x)) s

{𝕜 : 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']
{F' : Type u_14}
[NormedAddCommGroup F']
[NormedSpace 𝕜 F']
{s : Set M}
{n : ℕ∞}
{f : M → E'}
{g : M → F'}
(hf : ContMDiffOn I 𝓘(𝕜, E') n f s)
(hg : ContMDiffOn I 𝓘(𝕜, F') n g s)


lemma natDegree_preΨ_pos {n : ℤ} (hn : 2 < n.natAbs) (h : (n : R) ≠ 0) :
    0 < (W.preΨ n).natDegree

{R : Type u}
[CommRing R]
(W : WeierstrassCurve R)
{n : ℤ}
(hn : 2 < n.natAbs)
(h : ↑n ≠ 0)


theorem logb_div (hx : x ≠ 0) (hy : y ≠ 0) : logb b (x / y) = logb b x - logb b y

Real.logb b (x / y) = Real.logb b x - Real.logb b y


/-- The Yoneda embedding, as a functor from `C` into presheaves on `C`.

See <https://stacks.math.columbia.edu/tag/001O>.
-/
@[simps]
def yoneda : C ⥤ Cᵒᵖ ⥤ Type v₁

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

(CategoryTheory.yoneda.obj X).obj Y = (Opposite.unop Y ⟶ X)


@[fun_prop]
theorem HasStrictFDerivAt.const_mul (ha : HasStrictFDerivAt a a' x) (b : 𝔸) :
    HasStrictFDerivAt (fun y => b * a y) (b • a') x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{x : E}
{𝔸 : Type u_6}
[NormedRing 𝔸]
[NormedAlgebra 𝕜 𝔸]
{a : E → 𝔸}
{a' : E →L[𝕜] 𝔸}
(ha : HasStrictFDerivAt a a' x)
(b : 𝔸)


protected theorem ne_zero_iff_zero_lt : n ≠ 0 ↔ 0 < n


/-- Variant of the mean value inequality on a convex set, using a bound on the difference between
the derivative and a fixed linear map, rather than a bound on the derivative itself. Version with
`HasFDerivWithinAt`. -/
theorem norm_image_sub_le_of_norm_hasFDerivWithin_le'
    (hf : ∀ x ∈ s, HasFDerivWithinAt f (f' x) s x) (bound : ∀ x ∈ s, ‖f' x - φ‖ ≤ C)
    (hs : Convex ℝ s) (xs : x ∈ s) (ys : y ∈ s) : ‖f y - f x - φ (y - x)‖ ≤ C * ‖y - x‖


theorem coeff_smul (f : MvPowerSeries σ R) (n) (a : R) : coeff _ n (a • f) = a * coeff _ n f

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

(MvPowerSeries.coeff R n) (a • f) = a * (MvPowerSeries.coeff R n) f


theorem embDomain_apply :
    s.embDomain f b = if h : b ∈ Set.range f then s (Classical.choose h) else 0

{Γ : Type u_1}
{R : Type u_2}
[PartialOrder Γ]
[AddCommMonoid R]
{α : Type u_3}
{β : Type u_4}
(s : HahnSeries.SummableFamily Γ R α)
(f : α ↪ β)
{b : β}

(s.embDomain f) b = if h : b ∈ Set.range ⇑f then s (Classical.choose h) else 0


@[simp] theorem nthLe_tail (l : List α) (i) (h : i < l.tail.length)
    (h' : i + 1 < l.length := (by simp only [length_tail] at h; omega)) :
    l.tail.nthLe i h = l.nthLe (i + 1) h'

{α : Type u}
(l : List α)
(i : ℕ)
(h : i < l.tail.length)
(h' : i + 1 < l.length := ⋯)


theorem card_support_eq_three (hp : p.IsUnitTrinomial) : p.support.card = 3

{p : Polynomial ℤ}
(hp : p.IsUnitTrinomial)


@[simp]
theorem map_atTop (e : α ≃o β) : map (e : α → β) atTop = atTop

{α : Type u_3}
{β : Type u_4}
[Preorder α]
[Preorder β]
(e : α ≃o β)

Filter.map (⇑e) Filter.atTop = Filter.atTop


protected theorem intCast_mem (n : ℤ) : (n : L) ∈ S

{K : Type u_1}
{L : Type u_2}
[Field K]
[Field L]
[Algebra K L]
(S : IntermediateField K L)
(n : ℤ)


theorem iteratedSliceBackward_forget_forget :
    iteratedSliceBackward f ⋙ forget f ⋙ forget X = forget f.left

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

f.iteratedSliceBackward.comp ((CategoryTheory.Over.forget f).comp (CategoryTheory.Over.forget X)) =
  CategoryTheory.Over.forget f.left


theorem foldl_range_eq_of_range_eq {f : α → β → α} {g : α → γ → α}
    (hfg : (Set.range fun a c => f c a) = Set.range fun b c => g c b) (a : α) :
    Set.range (foldl f a) = Set.range (foldl g a)

{f : α → β → α}

{g : α → γ → α}

Set.range (List.foldl f a) = Set.range (List.foldl g a)


@[simp]
theorem cons_ndunion (s t : Multiset α) (a : α) : ndunion (a ::ₘ s) t = ndinsert a (ndunion s t)

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

(a ::ₘ s).ndunion t = Multiset.ndinsert a (s.ndunion t)


@[simp] theorem moduleCat_of_toModuleCat (X : CoalgebraCat.{v} R) :
    ModuleCat.of R X.toModuleCat = X.toModuleCat

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

ModuleCat.of R ↑X.toModuleCat = X.toModuleCat


theorem martingale_nat [IsFiniteMeasure μ] {f : ℕ → Ω → ℝ} (hadp : Adapted 𝒢 f)
    (hint : ∀ i, Integrable (f i) μ) (hf : ∀ i, f i =ᵐ[μ] μ[f (i + 1)|𝒢 i]) : Martingale f 𝒢 μ

{f : ℕ → Ω → ℝ}

(hint : ∀ (i : ℕ), MeasureTheory.Integrable (f i) μ)


@[simp, fun_prop]
theorem DifferentiableAt.inverse (hf : DifferentiableAt 𝕜 h z) (hz : IsUnit (h z)) :
    DifferentiableAt 𝕜 (fun x => Ring.inverse (h x)) z

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{R : Type u_6}
[NormedRing R]
[NormedAlgebra 𝕜 R]
[CompleteSpace R]
{h : E → R}
{z : E}
(hf : DifferentiableAt 𝕜 h z)
(hz : IsUnit (h z))


@[to_additive]
theorem le_div_iff_mul_le : a ≤ c / b ↔ a * b ≤ c

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


@[simp]
theorem isNClique_one : G.IsNClique 1 s ↔ ∃ a, s = {a}

{α : Type u_1}
{G : SimpleGraph α}
{s : Finset α}


@[simp] theorem contains_eq [BEq α] (a : α) (l : AssocList α β) :
    contains a l = l.toList.any (·.1 == a)

{α : Type u_1}
{β : Type u_2}
[BEq α]
(a : α)
(l : Batteries.AssocList α β)

Batteries.AssocList.contains a l = l.toList.any fun x => x.fst == a


theorem Disjoint.left_le_of_le_sup_right (h : a ≤ b ⊔ c) (hd : Disjoint a c) : a ≤ b

{α : Type u_1}
[DistribLattice α]
[OrderBot α]
{a b c : α}
(h : a ≤ b ⊔ c)
(hd : Disjoint a c)


/-- For `f : α →ᵤ β`, `𝓝 f` admits the family `{g | ∀ x, (f x, g x) ∈ V}` for `V ∈ 𝓑` as a filter
basis, for any basis `𝓑` of `𝓤 β`. -/
protected theorem hasBasis_nhds_of_basis (f) {p : ι → Prop} {s : ι → Set (β × β)}
    (h : HasBasis (𝓤 β) p s) :
    (𝓝 f).HasBasis p fun i => { g | (f, g) ∈ UniformFun.gen α β (s i) }

(α : Type u_1)
(β : Type u_2)
{ι : Type u_4}
[UniformSpace β]
(f : α →ᵤ β)
{p : ι → Prop}
{s : ι → Set (β × β)}
(h : (𝓤 β).HasBasis p s)

(𝓝 f).HasBasis p fun i => {g | (f, g) ∈ UniformFun.gen α β (s i)}


theorem le_map_inf [SemilatticeInf α] [SemilatticeSup β] {f : α → β} (h : Antitone f) (x y : α) :
    f x ⊔ f y ≤ f (x ⊓ y)

{α : Type u}
{β : Type v}
[SemilatticeInf α]
[SemilatticeSup β]
{f : α → β}
(h : Antitone f)
(x y : α)


theorem raise'_chain : ∀ (l) {m n}, m < n → List.Chain (· < ·) m (raise' l n)

m < n → List.Chain (fun x x_1 => x < x_1) m (Denumerable.raise' l n)


/-- Construct a bundled `LaxMonoidalFunctor` from the object level function
and `Functorial` and `LaxMonoidal` typeclasses.
-/
@[simps]
def of (F : C → D) [I₁ : Functorial.{v₁, v₂} F] [I₂ : LaxMonoidal.{v₁, v₂} F] :
    LaxMonoidalFunctor.{v₁, v₂} C D

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.MonoidalCategory C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
[CategoryTheory.MonoidalCategory D]
(F : C → D)
[I₁ : CategoryTheory.Functorial F]
[I₂ : CategoryTheory.LaxMonoidal F]

∀ (a : C), (CategoryTheory.LaxMonoidalFunctor.of F).obj a = F a


theorem cast_eq_of_cons_eq_cons {u v v' w : U} {p : Path u v} {p' : Path u v'} {e : v ⟶ w}
    {e' : v' ⟶ w} (h : p.cons e = p'.cons e') : p.cast rfl (obj_eq_of_cons_eq_cons h) = p'

{U : Type u_1}
[Quiver U]
{u v v' w : U}
{p : Quiver.Path u v}
{p' : Quiver.Path u v'}
{e : v ⟶ w}
{e' : v' ⟶ w}
(h : p.cons e = p'.cons e')


@[simp]
theorem semiconjBy_star_star_star {x y z : R} :
    SemiconjBy (star x) (star z) (star y) ↔ SemiconjBy x y z

{R : Type u}
[Mul R]
[StarMul R]
{x y z : R}


@[simp] lemma strictAnti_vecCons : StrictAnti (vecCons a f) ↔ f 0 < a ∧ StrictAnti f

{α : Type u_1}
[Preorder α]
{n : ℕ}
{f : Fin (n + 1) → α}
{a : α}

StrictAnti (Matrix.vecCons a f) ↔ f 0 < a ∧ StrictAnti f


/-- The supremum of a set of congruence relations is the same as the smallest congruence relation
    containing the supremum of the set's image under the map to the underlying binary relation. -/
@[to_additive "The supremum of a set of additive congruence relations is the same as the smallest
additive congruence relation containing the supremum of the set's image under the map to the
underlying binary relation."]
theorem sSup_def {S : Set (Con M)} :
    sSup S = conGen (sSup ((⇑) '' S))

{M : Type u_1}
[Add M]
{S : Set (AddCon M)}

sSup S = addConGen (sSup (DFunLike.coe '' S))


@[to_additive (attr := simp)]
theorem inv_mk (f : α → γ) (hf) : (mk f hf : α →ₘ[μ] γ)⁻¹ = mk f⁻¹ hf.inv

(hf : MeasureTheory.AEStronglyMeasurable f μ)

-MeasureTheory.AEEqFun.mk f hf = MeasureTheory.AEEqFun.mk (-f) ⋯


theorem tsum_geometric_inv_two : (∑' n : ℕ, (2 : ℝ)⁻¹ ^ n) = 2


theorem erase_le_iff_le_cons {s t : Multiset α} {a : α} : s.erase a ≤ t ↔ s ≤ a ::ₘ t

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


@[simp]
theorem length_iterate (f : α → α) (a : α) (n : ℕ) : length (iterate f a n) = n

{α : Type u_1}
(f : α → α)
(a : α)
(n : ℕ)


@[simp]
theorem toSubgroupEquiv_one : toSubgroupEquiv φ 1 = φ

{G : Type u_1}
[Group G]
{A B : Subgroup G}
(φ : ↥A ≃* ↥B)


@[simp]
theorem closure_univ : closure (Set.univ : Set R) = ⊤

{R : Type u}
[NonUnitalNonAssocSemiring R]

NonUnitalSubsemiring.closure Set.univ = ⊤


/--
The coherent sheaf condition on an essentially small site can be checked after precomposing with
the equivalence with a small category.
-/
theorem precoherent_isSheaf_iff_of_essentiallySmall [EssentiallySmall C] (F : Cᵒᵖ ⥤ A) :
    IsSheaf (coherentTopology C) F ↔
      IsSheaf (coherentTopology (SmallModel C)) ((equivSmallModel C).inverse.op ⋙ F)

[CategoryTheory.EssentiallySmall.{u_4, u_5, u_1} C]

CategoryTheory.Presheaf.IsSheaf (CategoryTheory.coherentTopology C) F ↔
  CategoryTheory.Presheaf.IsSheaf (CategoryTheory.coherentTopology (CategoryTheory.SmallModel.{u_4, u_5, u_1} C))
    ((CategoryTheory.equivSmallModel C).inverse.op.comp F)


/--
If `g` and `h` commute, then `g` moves `h ^ j • x` iff `g` moves `x`.
-/
@[to_additive "If `g` and `h` commute, then `g` moves `(j • h) +ᵥ x` iff `g` moves `x`."]
theorem smul_zpow_movedBy_eq_of_commute {g h : G} (comm : Commute g h) (j : ℤ) :
    h ^ j • (fixedBy α g)ᶜ = (fixedBy α g)ᶜ

{α : Type u_1}
{G : Type u_2}
[Group G]
[MulAction G α]
{g h : G}
(comm : Commute g h)
(j : ℤ)

h ^ j • (MulAction.fixedBy α g)ᶜ = (MulAction.fixedBy α g)ᶜ


@[mono]
theorem toNonUnitalSubsemiring_strictMono :
    StrictMono (toNonUnitalSubsemiring : NonUnitalSubring R → NonUnitalSubsemiring R)


theorem update_inl_apply_inr [DecidableEq (α ⊕ β)] {f : α ⊕ β → γ} {i : α} {j : β} {x : γ} :
    update f (inl i) x (inr j) = f (inr j)

{α : Type u}
{β : Type v}
{γ : Type u_1}
[DecidableEq (α ⊕ β)]
{f : α ⊕ β → γ}
{i : α}
{j : β}
{x : γ}

Function.update f (Sum.inl i) x (Sum.inr j) = f (Sum.inr j)


lemma d_none_eq_zero (i j : Option ι) (hi : i = none) :
    d K i j = 0


@[to_additive (attr := simp)]
theorem comp_apply (x : F) : (p.comp f) x = p (f x)

{E : Type u_4}
{F : Type u_5}
[AddGroup E]
[AddGroup F]
(p : AddGroupSeminorm E)
(f : F →+ E)
(x : F)


@[to_additive]
theorem mem_comm_iff (nH : H.Normal) {a b : G} : a * b ∈ H ↔ b * a ∈ H

{G : Type u_1}
[Group G]
{H : Subgroup G}
(nH : H.Normal)
{a b : G}


@[reassoc (attr := simp)]
theorem pullbackAssoc_inv_fst_fst [HasPullback ((pullback.snd _ _ : Z₁ ⟶ X₂) ≫ f₃) f₄]
    [HasPullback f₁ ((pullback.fst _ _ : Z₂ ⟶ X₂) ≫ f₂)] :
    (pullbackAssoc f₁ f₂ f₃ f₄).inv ≫ pullback.fst _ _ ≫ pullback.fst _ _ = pullback.fst _ _

[CategoryTheory.Limits.HasPullback (CategoryTheory.Limits.pullback.snd f₁ f₂ ≫ f₃) f₄]

[CategoryTheory.Limits.HasPullback f₁ (CategoryTheory.Limits.pullback.fst f₃ f₄ ≫ f₂)]

(CategoryTheory.Limits.pullbackAssoc f₁ f₂ f₃ f₄).inv ≫
    CategoryTheory.Limits.pullback.fst (CategoryTheory.Limits.pullback.snd f₁ f₂ ≫ f₃) f₄ ≫
      CategoryTheory.Limits.pullback.fst f₁ f₂ =
  CategoryTheory.Limits.pullback.fst f₁ (CategoryTheory.Limits.pullback.fst f₃ f₄ ≫ f₂)


@[simp]
theorem self_trans_symm (h : X ≃ₜ Y) : h.trans h.symm = Homeomorph.refl X

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
(h : X ≃ₜ Y)


theorem coe_mem_principalUnitGroup_iff {x : A.unitGroup} :
    (x : Kˣ) ∈ A.principalUnitGroup ↔
      A.unitGroupMulEquiv x ∈ (Units.map (LocalRing.residue A).toMonoidHom).ker

{K : Type u}
[Field K]
(A : ValuationSubring K)
{x : ↥A.unitGroup}

↑x ∈ A.principalUnitGroup ↔ A.unitGroupMulEquiv x ∈ (Units.map ↑(LocalRing.residue ↥A)).ker


@[deprecated map_sub (since := "2024-06-26")]
protected theorem map_sub (x y) : φ (x - y) = φ x - φ y

{R : Type u}
{A : Type v}
{B : Type w}
[CommSemiring R]
[Ring A]
[Ring B]
[Algebra R A]
[Algebra R B]
(φ : A →ₐ[R] B)
(x y : A)


theorem condexpIndL1Fin_smul' [NormedSpace ℝ F] [SMulCommClass ℝ 𝕜 F] (hs : MeasurableSet s)
    (hμs : μ s ≠ ∞) (c : 𝕜) (x : F) :
    condexpIndL1Fin hm hs hμs (c • x) = c • condexpIndL1Fin hm hs hμs x

{α : Type u_1}
{F : Type u_3}
{𝕜 : Type u_7}
[RCLike 𝕜]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{m m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s : Set α}
{hm : m ≤ m0}
[MeasureTheory.SigmaFinite (μ.trim hm)]
[NormedSpace ℝ F]
[SMulCommClass ℝ 𝕜 F]
(hs : MeasurableSet s)
(hμs : μ s ≠ ⊤)
(c : 𝕜)
(x : F)

MeasureTheory.condexpIndL1Fin hm hs hμs (c • x) = c • MeasureTheory.condexpIndL1Fin hm hs hμs x


/-- From a natrual transformation of functors `C ⥤ D`, the induced natural transformation
of functors `WithInitial C ⥤ WithInitial D`. -/
@[simps]
def map₂ {D : Type*} [Category D] {F G : C ⥤ D} (η : F ⟶ G) : map F ⟶ map G

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{D : Type u_1}
[CategoryTheory.Category.{u_2, u_1} D]
{F G : CategoryTheory.Functor C D}
(η : F ⟶ G)
(X : CategoryTheory.WithInitial C)

(CategoryTheory.WithInitial.map₂ η).app X =
  match X with
  | CategoryTheory.WithInitial.of x => η.app x
  | CategoryTheory.WithInitial.star => CategoryTheory.CategoryStruct.id CategoryTheory.WithInitial.star


@[simp] protected theorem mul_pos_iff_of_pos_right {a b : Nat} (h : 0 < b) :
    0 < a * b ↔ 0 < a


@[simp]
theorem list_ofNat_zero : ofNat (List α) 0 = []


theorem bijective_of_isScalarTower' [Field R] [Algebra K R]
    [NoZeroSMulDivisors K R]
    [Algebra.IsAlgebraic K R] [Algebra L R] [IsScalarTower K L R] (f : R →ₐ[K] L) :
    Function.Bijective f

{K : Type u_1}
{L : Type u_2}
{R : Type u_3}
[CommRing K]
[Field L]
[Algebra K L]
[Field R]
[Algebra K R]
[NoZeroSMulDivisors K R]
[Algebra.IsAlgebraic K R]
[Algebra L R]
[IsScalarTower K L R]
(f : R →ₐ[K] L)


theorem tan_ne_zero_iff {θ : ℂ} : tan θ ≠ 0 ↔ ∀ k : ℤ, (k * π / 2 : ℂ) ≠ θ

Complex.tan θ ≠ 0 ↔ ∀ (k : ℤ), ↑k * ↑Real.pi / 2 ≠ θ


/-- Construct a functor out of the wide pushout shape given a J-indexed collection of arrows from a
fixed object.
-/
@[simps]
def wideSpan (B : C) (objs : J → C) (arrows : ∀ j : J, B ⟶ objs j) : WidePushoutShape J ⥤ C

{J : Type w}
{C : Type u}
[CategoryTheory.Category.{v, u} C]
(B : C)
(objs : J → C)
(arrows : (j : J) → B ⟶ objs j)

∀ {X Y : CategoryTheory.Limits.WidePushoutShape J} (f : X ⟶ Y),
  (CategoryTheory.Limits.WidePushoutShape.wideSpan B objs arrows).map f =
    CategoryTheory.Limits.WidePushoutShape.Hom.casesOn (motive := fun a a_1 t =>
      X = a → Y = a_1 → HEq f t → ((fun j => Option.casesOn j B objs) X ⟶ (fun j => Option.casesOn j B objs) Y)) f
      (fun X_1 h =>
        Eq.ndrec (motive := fun X_2 =>
          Y = X_2 →
            HEq f (CategoryTheory.Limits.WidePushoutShape.Hom.id X_2) →
              ((fun j => Option.casesOn j B objs) X ⟶ (fun j => Option.casesOn j B objs) Y))
          (fun h =>
            Eq.ndrec (motive := fun {Y} =>
              (f : X ⟶ Y) →
                HEq f (CategoryTheory.Limits.WidePushoutShape.Hom.id X) →
                  ((fun j => Option.casesOn j B objs) X ⟶ (fun j => Option.casesOn j B objs) Y))
              (fun f h => 𝟙 ((fun j => Option.casesOn j B objs) X)) ⋯ f)
          h)
      (fun j h =>
        Eq.ndrec (motive := fun {X} =>
          (f : X ⟶ Y) →
            Y = some j →
              HEq f (CategoryTheory.Limits.WidePushoutShape.Hom.init j) →
                ((fun j => Option.casesOn j B objs) X ⟶ (fun j => Option.casesOn j B objs) Y))
          (fun f h =>
            Eq.ndrec (motive := fun {Y} =>
              (f : none ⟶ Y) →
                HEq f (CategoryTheory.Limits.WidePushoutShape.Hom.init j) →
                  ((fun j => Option.casesOn j B objs) none ⟶ (fun j => Option.casesOn j B objs) Y))
              (fun f h => arrows j) ⋯ f)
          ⋯ f)
      ⋯ ⋯ ⋯


theorem mem_factors'_of_dvd {a p : α} (ha0 : a ≠ 0) (hp : Irreducible p) (hd : p ∣ a) :
    Subtype.mk (Associates.mk p) (irreducible_mk.2 hp) ∈ factors' a

{α : Type u_1}
[CancelCommMonoidWithZero α]
[UniqueFactorizationMonoid α]
{a p : α}
(ha0 : a ≠ 0)
(hp : Irreducible p)
(hd : p ∣ a)

⟨Associates.mk p, ⋯⟩ ∈ Associates.factors' a


/-- If `a` is even, then `n` is odd iff `n % a` is odd. -/
lemma Odd.mod_even_iff (ha : Even a) : Odd (n % a) ↔ Odd n


@[simp]
theorem sumLexDualAntidistrib_inl :
    sumLexDualAntidistrib α β (toDual (inl a)) = inr (toDual a)

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

(OrderIso.sumLexDualAntidistrib α β) (OrderDual.toDual (Sum.inl a)) = Sum.inr (OrderDual.toDual a)


protected theorem image_preimage : GaloisConnection (image f) (preimage f)

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

GaloisConnection (Set.image f) (Set.preimage f)


theorem toComplex_sub (x y : ℤ[i]) : ((x - y : ℤ[i]) : ℂ) = x - y

GaussianInt.toComplex (x - y) = GaussianInt.toComplex x - GaussianInt.toComplex y


@[to_additive]
theorem eq_of_eqOn_dense {s : Set G} (hs : closure s = ⊤) {f g : G →* M} (h : s.EqOn f g) : f = g

{G : Type u_1}
[AddGroup G]
{M : Type u_7}
[AddMonoid M]
{s : Set G}
(hs : AddSubgroup.closure s = ⊤)
{f g : G →+ M}
(h : Set.EqOn (⇑f) (⇑g) s)


@[simp, norm_cast]
theorem coe_offDiag : (s.offDiag : Set (α × α)) = (s : Set α).offDiag

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


@[to_additive]
protected lemma eq_div_of_mul_eq (h : IsUnit c) : a * c = b → a = b / c

{α : Type u}
[SubtractionMonoid α]
{a b c : α}
(h : IsAddUnit c)


@[simp, norm_cast]
theorem natCast_div (m n : ℕ) : ((m / n : ℕ) : Ordinal) = m / n


/-- The cones defined by `coneOfAdj` are limit cones. -/
@[simps]
def isLimitConeOfAdj (F : J ⥤ C) :
    IsLimit (coneOfAdj adj F)

(adj : CategoryTheory.Functor.const J ⊣ L)

(CategoryTheory.Limits.isLimitConeOfAdj adj F).lift s = (adj.homEquiv s.pt F) s.π


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

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

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

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

(ψ.comp ψ').φH = CategoryTheory.CategoryStruct.comp ψ.φH ψ'.φH


@[simp]
theorem toList_eq_self {xs : List α} : toList xs = xs


@[to_additive (attr := simp)]
theorem quot_map_mk (β : Type v) (f : List (α × Bool) → List (β × Bool))
    (H : (Red.Step ⇒ Red.Step) f f) : Quot.map f H (mk L) = mk (f L)

(H : (FreeAddGroup.Red.Step ⇒ FreeAddGroup.Red.Step) f f)

Quot.map f H (FreeAddGroup.mk L) = FreeAddGroup.mk (f L)


theorem NeBot.of_vsub_right : (f -ᵥ g : Filter α).NeBot → g.NeBot

{α : Type u_2}
{β : Type u_3}
[VSub α β]
{f g : Filter β}


protected nonrec theorem SmoothWithinAt.coordChange
    (hf : SmoothWithinAt IM IB f s x) (hg : SmoothWithinAt IM 𝓘(𝕜, F) g s x)
    (he : f x ∈ e.baseSet) (he' : f x ∈ e'.baseSet) :
    SmoothWithinAt IM 𝓘(𝕜, F) (fun y ↦ e.coordChange e' (f y) (g y)) s x

[TopologicalSpace (Bundle.TotalSpace F E)]

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

SmoothWithinAt IM 𝓘(𝕜, F) (fun y => e.coordChange e' (f y) (g y)) s x


@[simp, norm_cast]
theorem coe_zsmul (z : ℤ) (x : R) : (↑(z • x) : c.Quotient) = z • (x : c.Quotient)

{R : Type u_2}
[AddGroup R]
[Mul R]
(c : RingCon R)
(z : ℤ)
(x : R)


@[simp] lemma infIrredUpperSet_symm_apply (s : {s : UpperSet α // InfIrred s}) [Fintype s] :
    infIrredUpperSet.symm s = (s.1 : Set α).toFinset.inf id

{α : Type u_1}
[SemilatticeInf α]
[OrderTop α]
[Finite α]
(s : { s // InfIrred s })
[Fintype ↥↑s]

OrderIso.infIrredUpperSet.symm s = (↑↑s).toFinset.inf id


@[simp]
theorem Perm.subtypeCongr.symm : (ep.subtypeCongr en).symm = Perm.subtypeCongr ep.symm en.symm

{ε : Type u_1}
{p : ε → Prop}
[DecidablePred p]
(ep : Equiv.Perm { a // p a })
(en : Equiv.Perm { a // ¬p a })

Equiv.symm (ep.subtypeCongr en) = Equiv.Perm.subtypeCongr (Equiv.symm ep) (Equiv.symm en)


theorem changeForm.associated_neg_proof [Invertible (2 : R)] :
    (QuadraticMap.associated (R := R) (M := M) (-Q)).toQuadraticMap = 0 - Q

{R : Type u1}
[CommRing R]
{M : Type u2}
[AddCommGroup M]
[Module R M]
{Q : QuadraticForm R M}
[Invertible 2]

(QuadraticMap.associated (-Q)).toQuadraticMap = 0 - Q


theorem iso_iff {P Q : C} (i : P ≅ Q) : Injective P ↔ Injective Q

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{P Q : C}
(i : P ≅ Q)

CategoryTheory.Injective P ↔ CategoryTheory.Injective Q


@[simp]
theorem head_map (s : Stream' α) : head (map f s) = f (head s)

{α : Type u}
{β : Type v}
(f : α → β)
(s : Stream' α)


/-- The exponent is zero iff for all nonzero `n`, one can find a `g` such that `g ^ n ≠ 1`. -/
@[to_additive "The exponent is zero iff for all nonzero `n`, one can find a `g` such that
`n • g ≠ 0`."]
theorem exponent_eq_zero_iff_forall : exponent G = 0 ↔ ∀ n > 0, ∃ g : G, g ^ n ≠ 1

AddMonoid.exponent G = 0 ↔ ∀ n > 0, ∃ g, n • g ≠ 0


@[simp]
theorem ones_length (n : ℕ) : (ones n).length = n


theorem FamilyOfElements.comp_of_compatible (S : Sieve X) {x : FamilyOfElements P S}
    (t : x.Compatible) {f : Y ⟶ X} (hf : S f) {Z} (g : Z ⟶ Y) :
    x (g ≫ f) (S.downward_closed hf g) = P.map g.op (x f hf)

{P : CategoryTheory.Functor Cᵒᵖ (Type w)}

{x : CategoryTheory.Presieve.FamilyOfElements P S.arrows}

x (CategoryTheory.CategoryStruct.comp g f) ⋯ = P.map g.op (x f hf)


@[simp] lemma op_zpow (x : α) (z : ℤ) : op (x ^ z) = op x ^ z

{α : Type u_1}
[DivInvMonoid α]
(x : α)
(z : ℤ)

MulOpposite.op (x ^ z) = MulOpposite.op x ^ z


/-- If a set in a manifold has the unique derivative property, then its pullback by any extended
chart, in the vector space, also has the unique derivative property. -/
theorem UniqueMDiffOn.uniqueDiffOn_target_inter (hs : UniqueMDiffOn I s) (x : M) :
    UniqueDiffOn 𝕜 ((extChartAt I x).target ∩ (extChartAt I x).symm ⁻¹' s)

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

UniqueDiffOn 𝕜 ((extChartAt I x).target ∩ ↑(extChartAt I x).symm ⁻¹' s)


theorem _root_.MeasurableEmbedding.setIntegral_map {Y} {_ : MeasurableSpace Y} {f : X → Y}
    (hf : MeasurableEmbedding f) (g : Y → E) (s : Set Y) :
    ∫ y in s, g y ∂Measure.map f μ = ∫ x in f ⁻¹' s, g (f x) ∂μ

{X : Type u_1}
{E : Type u_3}
[MeasurableSpace X]
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{μ : MeasureTheory.Measure X}
{Y : Type u_5}

∀ {x : MeasurableSpace Y} {f : X → Y},
  MeasurableEmbedding f →
    ∀ (g : Y → E) (s : Set Y), ∫ (y : Y) in s, g y ∂MeasureTheory.Measure.map f μ = ∫ (x : X) in f ⁻¹' s, g (f x) ∂μ


@[simp]
theorem MonoidWithZero.coe_inverse {M : Type*} [CommMonoidWithZero M] :
    (MonoidWithZero.inverse : M → M) = Ring.inverse


theorem pow_right_mono (h : 1 ≤ a) : Monotone (a ^ ·)

{R : Type u_3}
[OrderedSemiring R]
{a : R}
(h : 1 ≤ a)


lemma C_Ψ₂Sq : C W.Ψ₂Sq = W.ψ₂ ^ 2 - 4 * W.toAffine.polynomial

{R : Type r}
[CommRing R]
(W : WeierstrassCurve R)

Polynomial.C W.Ψ₂Sq = W.ψ₂ ^ 2 - 4 * W.toAffine.polynomial


lemma measurable_singularPart_fun_right (κ η : Kernel α γ) (a : α) :
    Measurable (fun x : γ ↦ Real.toNNReal (rnDerivAux κ (κ + η) a x)
      - Real.toNNReal (1 - rnDerivAux κ (κ + η) a x) * rnDeriv κ η a x)

[hαγ : MeasurableSpace.CountableOrCountablyGenerated α γ]

Measurable fun x => ↑(κ.rnDerivAux (κ + η) a x).toNNReal - ↑(1 - κ.rnDerivAux (κ + η) a x).toNNReal * κ.rnDeriv η a x


/-- Any three points in an orthocentric system are affinely independent. -/
theorem OrthocentricSystem.affineIndependent {s : Set P} (ho : OrthocentricSystem s) {p : Fin 3 → P}
    (hps : Set.range p ⊆ s) (hpi : Function.Injective p) : AffineIndependent ℝ p

(ho : EuclideanGeometry.OrthocentricSystem s)


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

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


theorem leadingCoeff_ne_iff {x : HahnSeries Γ R} : x.leadingCoeff ≠ 0 ↔ x ≠ 0

{Γ : Type u_1}
{R : Type u_2}
[PartialOrder Γ]
[Zero R]
{x : HahnSeries Γ R}


/-- A binary bicone morphism between two binary bicones for the same diagram is a morphism of the
binary bicone points which commutes with the cone and cocone legs. -/
structure BinaryBiconeMorphism {P Q : C} (A B : BinaryBicone P Q) where
  /-- A morphism between the two vertex objects of the bicones -/
  hom : A.pt ⟶ B.pt
  /-- The triangle consisting of the two natural transformations and `hom` commutes -/
  wfst : hom ≫ B.fst = A.fst := by aesop_cat
  /-- The triangle consisting of the two natural transformations and `hom` commutes -/
  wsnd : hom ≫ B.snd = A.snd := by aesop_cat
  /-- The triangle consisting of the two natural transformations and `hom` commutes -/
  winl : A.inl ≫ hom = B.inl := by aesop_cat
  /-- The triangle consisting of the two natural transformations and `hom` commutes -/
  winr : A.inr ≫ hom = B.inr := by aesop_cat

{A B : CategoryTheory.Limits.BinaryBicone P Q}

(self : CategoryTheory.Limits.BinaryBiconeMorphism A B)


@[simp]
theorem map_id : map _ (leComap_id A) = id

{X : Type u_2}
[TopologicalSpace X]
{A : DiscreteQuotient X}

DiscreteQuotient.map (ContinuousMap.id X) ⋯ = id


theorem iSup_natCast : ⨆ n : ℕ, (n : ℝ≥0∞) = ∞


@[simp] theorem indexesOf_nil [BEq α] : ([] : List α).indexesOf x = []


@[reassoc (attr := simp)]
theorem triangle_assoc_comp_right_inv (X Y : C) :
    (ρ_ X).inv ▷ Y ≫ (α_ X (𝟙_ C) Y).hom = X ◁ (λ_ Y).inv

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

CategoryTheory.CategoryStruct.comp
    (CategoryTheory.MonoidalCategory.whiskerRight (CategoryTheory.MonoidalCategory.rightUnitor X).inv Y)
    (CategoryTheory.MonoidalCategory.associator X (𝟙_ C) Y).hom =
  CategoryTheory.MonoidalCategory.whiskerLeft X (CategoryTheory.MonoidalCategory.leftUnitor Y).inv


/-- A rotation of a nonzero vector equals that vector if and only if the angle is zero. -/
@[simp]
theorem rotation_eq_self_iff_angle_eq_zero {x : V} (hx : x ≠ 0) (θ : Real.Angle) :
    o.rotation θ x = x ↔ θ = 0

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


theorem mem_comap_iff {f : Filter β} {m : α → β} (inj : Injective m) (large : Set.range m ∈ f)
    {S : Set α} : S ∈ comap m f ↔ m '' S ∈ f

{α : Type u}
{β : Type v}
{f : Filter β}
{m : α → β}
(inj : Function.Injective m)
(large : Set.range m ∈ f)
{S : Set α}


@[simp]
lemma leftUnitor_inv_app (F : J ⥤ C) (j : J) :
    (λ_ F).inv.app j = (λ_ (F.obj j)).inv

{J : Type u_1}
{C : Type u_2}
[CategoryTheory.Category.{u_3, u_1} J]
[CategoryTheory.Category.{u_4, u_2} C]
[CategoryTheory.ChosenFiniteProducts C]
(F : CategoryTheory.Functor J C)
(j : J)

(CategoryTheory.MonoidalCategory.leftUnitor F).inv.app j = (CategoryTheory.MonoidalCategory.leftUnitor (F.obj j)).inv


theorem sub_def' (a b : Rat) : a - b = mkRat (a.num * b.den - b.num * a.den) (a.den * b.den)

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


@[simp] theorem sym2_coe (xs : List α) : (xs : Multiset α).sym2 = xs.sym2


theorem invFun_restrict [Nonempty α] : (Set.range f).restrict (invFun f) = hf.invOfMemRange

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

(Set.range f).restrict (Function.invFun f) = hf.invOfMemRange


theorem cos_arcsin (x : ℝ) : cos (arcsin x) = √(1 - x ^ 2)


theorem exists_code {n} {f : Vector ℕ n →. ℕ} (hf : Nat.Partrec' f) :
    ∃ c : Code, ∀ v : Vector ℕ n, c.eval v.1 = pure <$> f v

{n : ℕ}
{f : Mathlib.Vector ℕ n →. ℕ}
(hf : Nat.Partrec' f)

∃ c, ∀ (v : Mathlib.Vector ℕ n), c.eval ↑v = pure <$> f v


theorem range_list_map (f : α → β) : range (map f) = { l | ∀ x ∈ l, x ∈ range f }

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

Set.range (List.map f) = {l | ∀ x ∈ l, x ∈ Set.range f}


@[simp]
theorem onFinset_apply {s : Finset α} {f : α → M} {hf a} : (onFinset s f hf : α →₀ M) a = f a

{α : Type u_1}
{M : Type u_5}
[Zero M]
{s : Finset α}
{f : α → M}
{hf : ∀ (a : α), f a ≠ 0 → a ∈ s}
{a : α}


/-- A product of a function `f : Fin (n + 1) → β` over all `Fin (n + 1)`
is the product of `f 0` plus the remaining product -/
@[to_additive "A sum of a function `f : Fin (n + 1) → β` over all `Fin (n + 1)` is the sum of
`f 0` plus the remaining product"]
theorem prod_univ_succ [CommMonoid β] {n : ℕ} (f : Fin (n + 1) → β) :
    ∏ i, f i = f 0 * ∏ i : Fin n, f i.succ

{β : Type u_2}
[AddCommMonoid β]
{n : ℕ}
(f : Fin (n + 1) → β)

∑ i : Fin (n + 1), f i = f 0 + ∑ i : Fin n, f i.succ


@[simp]
theorem cast_one' [One α] [Add α] : (PosNum.one : α) = 1


theorem infinite [Infinite R] [Nontrivial M] : Infinite M

(R : Type u)
(M : Type v)
[Semiring R]
[AddCommMonoid M]
[Module R M]
[Module.Free R M]
[Infinite R]
[Nontrivial M]


theorem eventually_gt_of_tendsto_gt {l : Filter γ} {f : γ → α} {u v : α} (hv : u < v)
    (h : Filter.Tendsto f l (𝓝 v)) : ∀ᶠ a in l, u < f a

{α : Type u}
{γ : Type w}
[TopologicalSpace α]
[LinearOrder α]
[ClosedIicTopology α]
{l : Filter γ}
{f : γ → α}
{u v : α}
(hv : u < v)
(h : Filter.Tendsto f l (𝓝 v))


theorem u_smooth : ContDiff ℝ ⊤ (u : E → ℝ)

(E : Type u_1)
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[FiniteDimensional ℝ E]


@[deprecated getElem_zip (since := "2024-06-12")]
theorem get_zip {l : List α} {l' : List β} {i : Fin (zip l l').length} :
    (zip l l').get i =
      (l.get ⟨i, lt_length_left_of_zip i.isLt⟩, l'.get ⟨i, lt_length_right_of_zip i.isLt⟩)

{α : Type u}
{β : Type u_1}
{l : List α}
{l' : List β}
{i : Fin (l.zip l').length}

(l.zip l').get i = (l.get ⟨↑i, ⋯⟩, l'.get ⟨↑i, ⋯⟩)


theorem union_union_union_comm (s t u v : Finset α) : s ∪ t ∪ (u ∪ v) = s ∪ u ∪ (t ∪ v)

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


/-- Spec, as a contravariant functor from commutative rings to sheafed spaces.
-/
@[simps]
def Spec.toSheafedSpace : CommRingCat.{u}ᵒᵖ ⥤ SheafedSpace CommRingCat

AlgebraicGeometry.Spec.toSheafedSpace.obj R = AlgebraicGeometry.Spec.sheafedSpaceObj (Opposite.unop R)


theorem nonneg_def {a : Int} : NonNeg a ↔ ∃ n : Nat, a = n


@[to_additive]
theorem Multipliable.tprod_vanishing (hf : Multipliable f) ⦃e : Set G⦄ (he : e ∈ 𝓝 1) :
    ∃ s : Finset α, ∀ t : Set α, Disjoint t s → (∏' b : t, f b) ∈ e

{α : Type u_1}
{G : Type u_5}
[TopologicalSpace G]
[AddCommGroup G]
[TopologicalAddGroup G]
{f : α → G}
(hf : Summable f)
⦃e : Set G⦄
(he : e ∈ 𝓝 0)

∃ s, ∀ (t : Set α), Disjoint t ↑s → ∑' (b : ↑t), f ↑b ∈ e


@[simp]
theorem compl_top : (⊤ : Prepartition I).compl = ⊥

{ι : Type u_1}
{I : BoxIntegral.Box ι}
[Finite ι]


theorem preimage [TopologicalSpace Y] {f : X → Y} {s t : Set Y} (h : SeparatedNhds s t)
    (hf : Continuous f) : SeparatedNhds (f ⁻¹' s) (f ⁻¹' t)

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
{f : X → Y}
{s t : Set Y}
(h : SeparatedNhds s t)
(hf : Continuous f)


Complex.log Complex.I = ↑Real.pi / 2 * Complex.I


@[simp]
theorem ofLeftInverse_apply [RingHomInvPair σ₁₂ σ₂₁] [RingHomInvPair σ₂₁ σ₁₂]
    (h : Function.LeftInverse g f) (x : M) : ↑(ofLeftInverse h x) = f x

{R : Type u_1}
{R₂ : Type u_3}
{M : Type u_5}
{M₂ : Type u_7}
[Semiring R]
[Semiring R₂]
[AddCommMonoid M]
[AddCommMonoid M₂]
{module_M : Module R M}
{module_M₂ : Module R₂ M₂}
{σ₁₂ : R →+* R₂}
{σ₂₁ : R₂ →+* R}
{f : M →ₛₗ[σ₁₂] M₂}
{g : M₂ →ₛₗ[σ₂₁] M}
[RingHomInvPair σ₁₂ σ₂₁]
[RingHomInvPair σ₂₁ σ₁₂]
(h : Function.LeftInverse ⇑g ⇑f)
(x : M)

↑((LinearEquiv.ofLeftInverse h) x) = f x


theorem volumeForm_map {F : Type*} [NormedAddCommGroup F] [InnerProductSpace ℝ F]
    [Fact (finrank ℝ F = n)] (φ : E ≃ₗᵢ[ℝ] F) (x : Fin n → F) :
    (Orientation.map (Fin n) φ.toLinearEquiv o).volumeForm x = o.volumeForm (φ.symm ∘ x)

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

[Fact (FiniteDimensional.finrank ℝ F = n)]

((Orientation.map (Fin n) φ.toLinearEquiv) o).volumeForm x = o.volumeForm (⇑φ.symm ∘ x)


@[to_additive (attr := simp)]
theorem zero_comp : (0 : GroupSeminorm E).comp f = 0

{E : Type u_4}
{F : Type u_5}
[AddGroup E]
[AddGroup F]
(f : F →+ E)


@[simp, norm_cast]
theorem coe_eq_empty {s : Finset α} : (s : Set α) = ∅ ↔ s = ∅

↑s = ∅ ↔ s = ∅


private lemma piEquivOfFintype_comp_ofTensorProduct_eq :
    piEquivOfFintype I (fun _ : ι ↦ R) ∘ₗ ofTensorProduct I (ι → R) =
      (TensorProduct.piScalarRight R (AdicCompletion I R) (AdicCompletion I R) ι).toLinearMap

{R : Type u_1}
[CommRing R]
(I : Ideal R)
(ι : Type u_4)
[Fintype ι]
[DecidableEq ι]

↑(AdicCompletion.piEquivOfFintype I fun x => R) ∘ₗ AdicCompletion.ofTensorProduct I (ι → R) =
  ↑(TensorProduct.piScalarRight R (AdicCompletion I R) (AdicCompletion I R) ι)


lemma bot_lt_mul_inv {I : FractionalIdeal R₁⁰ K} (hI : I ≠ ⊥) : ⊥ < I * I⁻¹

{K : Type u_3}
[Field K]
{R₁ : Type u_4}
[CommRing R₁]
[IsDomain R₁]
[Algebra R₁ K]
[IsFractionRing R₁ K]
{I : FractionalIdeal R₁⁰ K}
(hI : I ≠ ⊥)


@[simp]
protected theorem range_succ : range succ = { i | 0 < i }


theorem iInf_option_toFinset (o : Option α) (f : α → β) : ⨅ x ∈ o.toFinset, f x = ⨅ x ∈ o, f x

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


@[simp] lemma shiftl_eq_shiftLeft (p : Num) (n : Nat) : p.shiftl n = p <<< n


theorem Nonempty.prod : s.Nonempty → t.Nonempty → (s ×ˢ t).Nonempty

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


@[simp]
theorem sum_biUnion_boxes {M : Type*} [AddCommMonoid M] (π : Prepartition I)
    (πi : ∀ J, Prepartition J) (f : Box ι → M) :
    (∑ J ∈ π.boxes.biUnion fun J => (πi J).boxes, f J) =
      ∑ J ∈ π.boxes, ∑ J' ∈ (πi J).boxes, f J'

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

∑ J ∈ π.boxes.biUnion fun J => (πi J).boxes, f J = ∑ J ∈ π.boxes, ∑ J' ∈ (πi J).boxes, f J'


@[reassoc]
lemma mappingConeCompHomotopyEquiv_comm₂ :
    (mappingConeCompHomotopyEquiv f g).hom ≫
      (triangle (mappingConeCompTriangle f g).mor₁).mor₃ =
      (mappingConeCompTriangle f g).mor₃

(CochainComplex.mappingConeCompHomotopyEquiv f g).hom ≫
    (CochainComplex.mappingCone.triangle (CochainComplex.mappingConeCompTriangle f g).mor₁).mor₃ =
  (CochainComplex.mappingConeCompTriangle f g).mor₃


/-- If `ν` is a finite measure, and `s ⊆ α × β` is measurable, then `x ↦ ν { y | (x, y) ∈ s }` is
  a measurable function. `measurable_measure_prod_mk_left` is strictly more general. -/
theorem measurable_measure_prod_mk_left_finite [IsFiniteMeasure ν] {s : Set (α × β)}
    (hs : MeasurableSet s) : Measurable fun x => ν (Prod.mk x ⁻¹' s)

{α : Type u_1}
{β : Type u_3}
[MeasurableSpace α]
[MeasurableSpace β]
{ν : MeasureTheory.Measure β}
[MeasureTheory.IsFiniteMeasure ν]
{s : Set (α × β)}
(hs : MeasurableSet s)


@[simp]
theorem content_one : content (1 : R[X]) = 1

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


theorem xn_modEq_x2n_sub_lem {n j} (h : j ≤ n) : xn a1 (2 * n - j) + xn a1 j ≡ 0 [MOD xn a1 n]

Pell.xn a1 (2 * n - j) + Pell.xn a1 j ≡ 0 [MOD Pell.xn a1 n]


theorem himp_def [∀ i, HImp (π i)] (a b : ∀ i, π i) : a ⇨ b = fun i => a i ⇨ b i

{ι : Type u_1}
{π : ι → Type u_4}
[(i : ι) → HImp (π i)]
(a b : (i : ι) → π i)


/-- A Lie algebra is simple if it is irreducible as a Lie module over itself via the adjoint
action, and it is non-Abelian. -/
class IsSimple : Prop where
  eq_bot_or_eq_top : ∀ I : LieIdeal R L, I = ⊥ ∨ I = ⊤
  non_abelian : ¬IsLieAbelian L

{R : Type u_1}
{L : Type u_2}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[self : LieAlgebra.IsSimple R L]
(I : LieIdeal R L)


/-- A version of `IsPrimitiveRoot.eq_pow_of_mem_rootsOfUnity` that takes a natural number `k`
as argument instead of a `PNat` (and `ζ : R` instead of `ζ : Rˣ`). -/
lemma eq_pow_of_mem_rootsOfUnity' {k : ℕ} (hk : 0 < k) {ζ : R} (hζ : IsPrimitiveRoot ζ k) {ξ : Rˣ}
    (hξ : ξ ∈ rootsOfUnity (⟨k, hk⟩ : ℕ+) R) :
    ∃ i < k, ζ ^ i = ξ

{R : Type u_4}
[CommRing R]
[IsDomain R]
{k : ℕ}
(hk : 0 < k)
{ζ : R}
(hζ : IsPrimitiveRoot ζ k)
{ξ : Rˣ}
(hξ : ξ ∈ rootsOfUnity ⟨k, hk⟩ R)


protected theorem image_symm_eq_preimage (e : M₁ ≃SL[σ₁₂] M₂) (s : Set M₂) :
    e.symm '' s = e ⁻¹' s

{R₁ : Type u_1}
{R₂ : Type u_2}
[Semiring R₁]
[Semiring R₂]
{σ₁₂ : R₁ →+* R₂}
{σ₂₁ : R₂ →+* R₁}
[RingHomInvPair σ₁₂ σ₂₁]
[RingHomInvPair σ₂₁ σ₁₂]
{M₁ : Type u_4}
[TopologicalSpace M₁]
[AddCommMonoid M₁]
{M₂ : Type u_6}
[TopologicalSpace M₂]
[AddCommMonoid M₂]
[Module R₁ M₁]
[Module R₂ M₂]
(e : M₁ ≃SL[σ₁₂] M₂)
(s : Set M₂)


/-- If `G` is cocontinuous, then `G.op.ran` pushes sheaves to sheaves.

This is SGA 4 III 2.2. An alternative reference is
https://stacks.math.columbia.edu/tag/00XK (where results
are obtained under the additional assumption that
`C` and `D` have pullbacks).
-/
theorem ran_isSheaf_of_isCocontinuous (ℱ : Sheaf J A) :
    Presheaf.IsSheaf K (G.op.ran.obj ℱ.val)

{J : CategoryTheory.GrothendieckTopology C}

(K : CategoryTheory.GrothendieckTopology D)

[∀ (F : Cᵒᵖ ⥤ A), G.op.HasPointwiseRightKanExtension F]

CategoryTheory.Presheaf.IsSheaf K (G.op.ran.obj ℱ.val)


/-- If `P` is local at the target, to show that `P` is stable under base change, it suffices to
check this for base change along a morphism of affine schemes. -/
lemma stableUnderBaseChange_of_stableUnderBaseChangeOnAffine_of_isLocalAtTarget
    (P : MorphismProperty Scheme) [IsLocalAtTarget P]
    (hP₂ : (of P).StableUnderBaseChange) :
    P.StableUnderBaseChange

(P : CategoryTheory.MorphismProperty AlgebraicGeometry.Scheme)

(hP₂ : (AlgebraicGeometry.AffineTargetMorphismProperty.of P).StableUnderBaseChange)


@[simp] theorem sign_nonneg : 0 ≤ sign x ↔ 0 ≤ x


/-- An order isomorphism between the domains and codomains of two prosets of
order homomorphisms gives an order isomorphism between the two function prosets. -/
@[simps apply symm_apply]
def arrowCongr {α β γ δ} [Preorder α] [Preorder β] [Preorder γ] [Preorder δ]
    (f : α ≃o γ) (g : β ≃o δ) : (α →o β) ≃o (γ →o δ)

{α : Type u_6}
{β : Type u_7}
{γ : Type u_8}
{δ : Type u_9}
[Preorder α]
[Preorder β]
[Preorder γ]
[Preorder δ]
(f : α ≃o γ)
(g : β ≃o δ)
(p : γ →o δ)

(RelIso.symm (f.arrowCongr g)) p = (↑g.symm).comp (p.comp ↑f)


@[simp]
theorem Icc_diff_both : Icc a b \ {a, b} = Ioo a b

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


theorem zero_CNF {o : Ordinal} (ho : o ≠ 0) : CNF 0 o = [⟨0, o⟩]


@[simp]
theorem quadraticCharFun_zero : quadraticCharFun F 0 = 0

{F : Type u_1}
[Field F]
[Fintype F]
[DecidableEq F]


theorem union_quotToDoset (H K : Subgroup G) : ⋃ q, quotToDoset H K q = Set.univ

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


@[simp]
theorem cliqueFree_bot (h : 2 ≤ n) : (⊥ : SimpleGraph α).CliqueFree n


/-- The **Cayley-Hamilton Theorem** for f.g. modules over arbitrary rings states that for each
`R`-endomorphism `φ` of an `R`-module `M` such that `φ(M) ≤ I • M` for some ideal `I`, there
exists some `n` and some `aᵢ ∈ Iⁱ` such that `φⁿ + a₁ φⁿ⁻¹ + ⋯ + aₙ = 0`.

This is the version found in Eisenbud 4.3, which is slightly weaker than Matsumura 2.1
(this lacks the constraint on `n`), and is slightly stronger than Atiyah-Macdonald 2.4.
-/
theorem LinearMap.exists_monic_and_coeff_mem_pow_and_aeval_eq_zero_of_range_le_smul
    [Module.Finite R M] (f : Module.End R M) (I : Ideal R) (hI : LinearMap.range f ≤ I • ⊤) :
    ∃ p : R[X], p.Monic ∧ (∀ k, p.coeff k ∈ I ^ (p.natDegree - k)) ∧ Polynomial.aeval f p = 0

{M : Type u_2}
[AddCommGroup M]
(R : Type u_3)
[CommRing R]
[Module R M]
[Module.Finite R M]
(f : Module.End R M)
(I : Ideal R)
(hI : LinearMap.range f ≤ I • ⊤)

∃ p, p.Monic ∧ (∀ (k : ℕ), p.coeff k ∈ I ^ (p.natDegree - k)) ∧ (Polynomial.aeval f) p = 0


theorem Function.Surjective.lieModule_lcs_map_eq (k : ℕ) :
    (lowerCentralSeries R L M k : Submodule R M).map g = lowerCentralSeries R L₂ M₂ k

(hfg : ∀ (x : L) (m : M), ⁅f x, g m⁆ = g ⁅x, m⁆)

Submodule.map g ↑(LieModule.lowerCentralSeries R L M k) = ↑(LieModule.lowerCentralSeries R L₂ M₂ k)


/-- If `b` is a right identity for `f : α → β → α`, then `{b}` is a right identity for
`Finset.image₂ f`. -/
theorem image₂_right_identity {f : γ → β → γ} {b : β} (h : ∀ a, f a b = a) (s : Finset γ) :
    image₂ f s {b} = s

{β : Type u_3}
{γ : Type u_5}
[DecidableEq γ]
{f : γ → β → γ}
{b : β}
(h : ∀ (a : γ), f a b = a)
(s : Finset γ)


theorem toGlueL_isometry (hΦ : Isometry Φ) (hΨ : Isometry Ψ) : Isometry (toGlueL hΦ hΨ)

{X : Type u}
{Y : Type v}
{Z : Type w}
[Nonempty Z]
[MetricSpace Z]
[MetricSpace X]
[MetricSpace Y]
{Φ : Z → X}
{Ψ : Z → Y}
(hΦ : Isometry Φ)
(hΨ : Isometry Ψ)


@[simp]
theorem fderiv.log (hf : DifferentiableAt ℝ f x) (hx : f x ≠ 0) :
    fderiv ℝ (fun x => log (f x)) x = (f x)⁻¹ • fderiv ℝ f x

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : E → ℝ}
{x : E}
(hf : DifferentiableAt ℝ f x)
(hx : f x ≠ 0)

fderiv ℝ (fun x => Real.log (f x)) x = (f x)⁻¹ • fderiv ℝ f x


theorem sumInv_comp_sum : sumInv I M ∘ₗ sum I M = LinearMap.id

{R : Type u_1}
[CommRing R]
(I : Ideal R)
{ι : Type u_6}
[DecidableEq ι]
(M : ι → Type u_7)
[(i : ι) → AddCommGroup (M i)]
[(i : ι) → Module R (M i)]
[Fintype ι]

AdicCompletion.sumInv I M ∘ₗ AdicCompletion.sum I M = LinearMap.id


lemma isRightAdjoint (adj : F ⊣ G) : G.IsRightAdjoint

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


@[to_additive]
theorem Subgroup.pow_index_mem {G : Type*} [Group G] (H : Subgroup G) [Normal H] (g : G) :
    g ^ index H ∈ H

{G : Type u_6}
[AddGroup G]
(H : AddSubgroup G)
[H.Normal]
(g : G)


theorem image (hs : IsAntichain r s) (f : α → β) (h : ∀ ⦃a b⦄, r' (f a) (f b) → r a b) :
    IsAntichain r' (f '' s)

(h : ∀ ⦃a b : α⦄, r' (f a) (f b) → r a b)


lemma Set.Subsingleton.isClosed [T1Space X] {A : Set X} (h : A.Subsingleton) : IsClosed A

{X : Type u_1}
[TopologicalSpace X]
[T1Space X]
{A : Set X}
(h : A.Subsingleton)


@[simp]
protected theorem repr_reindex (b : OrthonormalBasis ι 𝕜 E) (e : ι ≃ ι') (x : E) (i' : ι') :
    (b.reindex e).repr x i' = b.repr x (e.symm i')

{ι : Type u_1}
{ι' : Type u_2}
{𝕜 : Type u_3}
[RCLike 𝕜]
{E : Type u_4}
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[Fintype ι]
[Fintype ι']
(b : OrthonormalBasis ι 𝕜 E)
(e : ι ≃ ι')
(x : E)
(i' : ι')


theorem isBigO_const_mul_right_iff' {g : α → R} {c : R} (hc : IsUnit c) :
    (f =O[l] fun x => c * g x) ↔ f =O[l] g

{α : Type u_1}
{E : Type u_3}
{R : Type u_13}
[Norm E]
[SeminormedRing R]
{f : α → E}
{l : Filter α}
{g : α → R}
{c : R}
(hc : IsUnit c)


theorem hasFDerivWithinAt_congr_set (h : s =ᶠ[𝓝 x] t) :
    HasFDerivWithinAt f f' s x ↔ HasFDerivWithinAt f f' t x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{f' : E →L[𝕜] F}
{x : E}
{s t : Set E}
(h : s =ᶠ[𝓝 x] t)


@[simp]
theorem coe_toAffineMap (e : P₁ ≃ᵃ[k] P₂) : (e.toAffineMap : P₁ → P₂) = (e : P₁ → P₂)

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


theorem not_isDiag_of_mem_edgeSet : e ∈ edgeSet G → ¬e.IsDiag

{V : Type u}
(G : SimpleGraph V)
{e : Sym2 V}


@[simp]
theorem apply_zero (F : HomotopyWith f₀ f₁ P) (x : X) : F (0, x) = f₀ x

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]
{f₀ f₁ : C(X, Y)}
{P : C(X, Y) → Prop}
(F : f₀.HomotopyWith f₁ P)
(x : X)


@[to_additive (attr := simp 1100, norm_cast)]
theorem val_list_prod (l : List H) : (l.prod : G) = (l.map Subtype.val).prod

{G : Type u_1}
[AddGroup G]
(H : AddSubgroup G)
(l : List ↥H)


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


theorem ceil_map_map_zero_le : ⌈f (g 0)⌉ ≤ ⌈f 0⌉ + ⌈g 0⌉


theorem sin_arg (x : ℂ) : Real.sin (arg x) = x.im / abs x


/-- A variation of the emetric characterization of Cauchy sequences that deals with
`ℝ≥0` upper bounds. -/
theorem cauchySeq_iff_NNReal [Nonempty β] [SemilatticeSup β] {u : β → α} :
    CauchySeq u ↔ ∀ ε : ℝ≥0, 0 < ε → ∃ N, ∀ n, N ≤ n → edist (u n) (u N) < ε

{α : Type u}
{β : Type v}
[PseudoEMetricSpace α]
[Nonempty β]
[SemilatticeSup β]
{u : β → α}

CauchySeq u ↔ ∀ (ε : ℝ≥0), 0 < ε → ∃ N, ∀ (n : β), N ≤ n → edist (u n) (u N) < ↑ε


/-- Oriented angles are continuous when the vectors involved are nonzero. -/
theorem continuousAt_oangle {x : V × V} (hx1 : x.1 ≠ 0) (hx2 : x.2 ≠ 0) :
    ContinuousAt (fun y : V × V => o.oangle y.1 y.2) x

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

ContinuousAt (fun y => o.oangle y.1 y.2) x


@[simp]
theorem head!_append [Inhabited α] (t : List α) {s : List α} (h : s ≠ []) :
    head! (s ++ t) = head! s

{α : Type u}
[Inhabited α]
(t : List α)
{s : List α}
(h : s ≠ [])


@[deprecated smul_inf_le (since := "2024-03-31")]
protected theorem smul_inf_le (M₁ M₂ : Submodule R M) :
    I • (M₁ ⊓ M₂) ≤ I • M₁ ⊓ I • M₂

{R : Type u}
{M : Type v}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
(I : Ideal R)
(M₁ M₂ : Submodule R M)

I • (M₁ ⊓ M₂) ≤ I • M₁ ⊓ I • M₂


theorem isSheaf_iff_multiequalizer [∀ (X : C) (S : J.Cover X), HasMultiequalizer (S.index P)] :
    IsSheaf J P ↔ ∀ (X : C) (S : J.Cover X), IsIso (S.toMultiequalizer P)

(J : CategoryTheory.GrothendieckTopology C)

[∀ (X : C) (S : J.Cover X), CategoryTheory.Limits.HasMultiequalizer (S.index P)]

CategoryTheory.Presheaf.IsSheaf J P ↔ ∀ (X : C) (S : J.Cover X), CategoryTheory.IsIso (S.toMultiequalizer P)


theorem coe_le : ∀ {o : Option α}, b ∈ o → ((a : WithBot α) ≤ o ↔ a ≤ b)

{α : Type u_1}
{a b : α}
[LE α]
{o : Option α}


/-- The left fraction from `X` to `Y` given by a morphism `f : X ⟶ Y`. -/
@[simps]
def ofHom (f : X ⟶ Y) [W.ContainsIdentities] :
    W.LeftFraction X Y

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
(W : CategoryTheory.MorphismProperty C)
{X Y : C}
(f : X ⟶ Y)
[W.ContainsIdentities]

(CategoryTheory.MorphismProperty.LeftFraction.ofHom W f).Y' = Y


@[to_additive]
theorem closure_mul_le (S T : Set G) : closure (S * T) ≤ closure S ⊔ closure T

{G : Type u_2}
[AddGroup G]
(S T : Set G)

AddSubgroup.closure (S + T) ≤ AddSubgroup.closure S ⊔ AddSubgroup.closure T


theorem inj_on_iUnion_of_directed {s : ι → Set α} (hs : Directed (· ⊆ ·) s) {f : α → β}
    (hf : ∀ i, InjOn f (s i)) : InjOn f (⋃ i, s i)

(hs : Directed (fun x x_1 => x ⊆ x_1) s)


lemma LSeries.term_add_apply (f g : ℕ → ℂ) (s : ℂ) (n : ℕ) :
    term (f + g) s n = term f s n + term g s n

LSeries.term (f + g) s n = LSeries.term f s n + LSeries.term g s n


@[simp]
theorem normSq_pos {z : ℂ} : 0 < normSq z ↔ z ≠ 0


@[ext]
lemma ext_inner {A B : E →WOT[𝕜] F} (h : ∀ x y, ⟪y, A x⟫_𝕜 = ⟪y, B x⟫_𝕜) : A = B

(h : ∀ (x : E) (y : F), ⟪y, A x⟫_𝕜 = ⟪y, B x⟫_𝕜)


@[simp] theorem reverseAux_nil : reverseAux [] r = r

∀ {α : Type u_1} {r : List α}, List.nil.reverseAux r = r


/-- A map `f : X → Y` is proper if and only if it is continuous and the map
`(Prod.map f id : X × Filter X → Y × Filter X)` is closed. This is stronger than
`isProperMap_iff_universally_closed` since it shows that there's only one space to check to get
properness, but in most cases it doesn't matter. -/
theorem isProperMap_iff_isClosedMap_filter {X : Type u} {Y : Type v} [TopologicalSpace X]
    [TopologicalSpace Y] {f : X → Y} :
    IsProperMap f ↔ Continuous f ∧ IsClosedMap
      (Prod.map f id : X × Filter X → Y × Filter X)

IsProperMap f ↔ Continuous f ∧ IsClosedMap (Prod.map f id)


@[to_additive MeasureTheory.pairwise_disjoint_addFundamentalInterior]
theorem pairwise_disjoint_fundamentalInterior :
    Pairwise (Disjoint on fun g : G => g • fundamentalInterior G s)

(G : Type u_1)
{α : Type u_3}
[Group G]
[MulAction G α]
(s : Set α)

Pairwise (Disjoint on fun g => g • MeasureTheory.fundamentalInterior G s)


@[to_additive (attr := simp)]
theorem div_apply [Div β] [ContinuousDiv β] (f g : C(α, β)) (x : α) : (f / g) x = f x / g x

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
[Sub β]
[ContinuousSub β]
(f g : C(α, β))
(x : α)


@[simp] theorem UInt8.toUInt16_toNat (x : UInt8) : x.toUInt16.toNat = x.toNat


theorem mem_toPartialHomeomorph_source (hf : HasStrictFDerivAt f (f' : E →L[𝕜] F) a) :
    a ∈ (hf.toPartialHomeomorph f).source

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[CompleteSpace E]
{f : E → F}
{f' : E ≃L[𝕜] F}
{a : E}
(hf : HasStrictFDerivAt f (↑f') a)

a ∈ (HasStrictFDerivAt.toPartialHomeomorph f hf).source


@[simp]
lemma prodMkLeft_add (κ η : Kernel α β) :
    prodMkLeft γ (κ + η) = prodMkLeft γ κ + prodMkLeft γ η

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

ProbabilityTheory.Kernel.prodMkLeft γ (κ + η) =
  ProbabilityTheory.Kernel.prodMkLeft γ κ + ProbabilityTheory.Kernel.prodMkLeft γ η


theorem isNat_lt_false [OrderedSemiring α] {a b : α} {a' b' : ℕ}
    (ha : IsNat a a') (hb : IsNat b b') (h : Nat.ble b' a' = true) : ¬a < b

{α : Type u_1}
[OrderedSemiring α]
{a b : α}
{a' b' : ℕ}
(ha : Mathlib.Meta.NormNum.IsNat a a')
(hb : Mathlib.Meta.NormNum.IsNat b b')
(h : b'.ble a' = true)


@[simp]
theorem id_comp (p : FormalMultilinearSeries 𝕜 E F) (h : p 0 = 0) : (id 𝕜 F).comp p = p

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
(p : FormalMultilinearSeries 𝕜 E F)
(h : p 0 = 0)

(FormalMultilinearSeries.id 𝕜 F).comp p = p


theorem locallyConvexSpace_iff_exists_convex_subset_zero :
    LocallyConvexSpace 𝕜 E ↔ ∀ U ∈ (𝓝 0 : Filter E), ∃ S ∈ (𝓝 0 : Filter E), Convex 𝕜 S ∧ S ⊆ U

(𝕜 : Type u_1)
(E : Type u_2)
[OrderedSemiring 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[TopologicalSpace E]
[TopologicalAddGroup E]

LocallyConvexSpace 𝕜 E ↔ ∀ U ∈ 𝓝 0, ∃ S ∈ 𝓝 0, Convex 𝕜 S ∧ S ⊆ U


theorem lt_of_ceil_lt (h : ⌈a⌉₊ < n) : a < n

{α : Type u_2}
[LinearOrderedSemiring α]
[FloorSemiring α]
{a : α}
{n : ℕ}
(h : ⌈a⌉₊ < n)


theorem coe_sSup_of_directedOn {S : Set (NonUnitalSubsemiring R)} (Sne : S.Nonempty)
    (hS : DirectedOn (· ≤ ·) S) : (↑(sSup S) : Set R) = ⋃ s ∈ S, ↑s

(hS : DirectedOn (fun x x_1 => x ≤ x_1) S)


/-- If `f` is locally integrable on `[a, ∞)`, and `f =O[atTop] g`, for some
`g` integrable at `atTop`, then `f` is integrable on `[a, ∞)`. -/
theorem LocallyIntegrableOn.integrableOn_of_isBigO_atTop [IsMeasurablyGenerated (atTop (α := α))]
    (hf : LocallyIntegrableOn f (Ici a) μ) (ho : f =O[atTop] g)
    (hg : IntegrableAtFilter g atTop μ) : IntegrableOn f (Ici a) μ

(hf : MeasureTheory.LocallyIntegrableOn f (Set.Ici a) μ)

(hg : MeasureTheory.IntegrableAtFilter g Filter.atTop μ)

MeasureTheory.IntegrableOn f (Set.Ici a) μ


theorem not_monic_zero_iff : ¬Monic (0 : R[X]) ↔ (0 : R) ≠ 1


/-- The underlying oplax monoidal functor of a (strong) monoidal functor. -/
@[simps]
noncomputable def MonoidalFunctor.toOplaxMonoidalFunctor (F : MonoidalFunctor C D) :
    OplaxMonoidalFunctor C D

(F : CategoryTheory.MonoidalFunctor C D)

F.toOplaxMonoidalFunctor.η = CategoryTheory.inv F.ε


/-- The map `(eVariationOn · s)` is lower semicontinuous for pointwise convergence *on `s`*.
Pointwise convergence on `s` is encoded here as uniform convergence on the family consisting of the
singletons of elements of `s`.
-/
protected theorem lowerSemicontinuous (s : Set α) :
    LowerSemicontinuous fun f : α →ᵤ[s.image singleton] E => eVariationOn f s

{α : Type u_1}
[LinearOrder α]
{E : Type u_2}
[PseudoEMetricSpace E]
(s : Set α)

LowerSemicontinuous fun f => eVariationOn f s


theorem mul_def (α : Type*) (t₁ t₂ : Language.ring.Term α) :
    t₁ * t₂ = mulFunc.apply₂ t₁ t₂

(t₁ t₂ : FirstOrder.Language.ring.Term α)

t₁ * t₂ = FirstOrder.Ring.mulFunc.apply₂ t₁ t₂


theorem two_zsmul_ne_zero_iff {θ : Angle} : (2 : ℤ) • θ ≠ 0 ↔ θ ≠ 0 ∧ θ ≠ π

2 • θ ≠ 0 ↔ θ ≠ 0 ∧ θ ≠ ↑π


/-- An inducing equiv between topological spaces is a homeomorphism. -/
@[simps toEquiv] -- Porting note (#11215): TODO: was `@[simps]`
def toHomeomorphOfInducing (f : X ≃ Y) (hf : Inducing f) : X ≃ₜ Y

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
(f : X ≃ Y)
(hf : Inducing ⇑f)

(f.toHomeomorphOfInducing hf).toEquiv = f


@[simp]
theorem image₂_subset_iff : image₂ f s t ⊆ u ↔ ∀ x ∈ s, ∀ y ∈ t, f x y ∈ u

{α : Type u_1}
{β : Type u_3}
{γ : Type u_5}
[DecidableEq γ]
{f : α → β → γ}
{s : Finset α}
{t : Finset β}
{u : Finset γ}

Finset.image₂ f s t ⊆ u ↔ ∀ x ∈ s, ∀ y ∈ t, f x y ∈ u


/--
If the unit and counit of a given adjunction are (pointwise) isomorphisms, then we can upgrade the
adjunction to an equivalence.
-/
@[simps!]
noncomputable def toEquivalence (adj : F ⊣ G) [∀ X, IsIso (adj.unit.app X)]
    [∀ Y, IsIso (adj.counit.app Y)] : C ≌ D

[∀ (X : C), CategoryTheory.IsIso (adj.unit.app X)]

[∀ (Y : D), CategoryTheory.IsIso (adj.counit.app Y)]


theorem IndepSets.iUnion {s : ι → Set (Set Ω)} {s' : Set (Set Ω)}
    (hyp : ∀ n, IndepSets (s n) s' μ) :
    IndepSets (⋃ n, s n) s' μ

(hyp : ∀ (n : ι), ProbabilityTheory.IndepSets (s n) s' μ)

ProbabilityTheory.IndepSets (⋃ n, s n) s' μ


theorem norm_apply (x : S) : norm R x = LinearMap.det (lmul R S x)

(R : Type u_1)
{S : Type u_2}
[CommRing R]
[Ring S]
[Algebra R S]
(x : S)

(Algebra.norm R) x = LinearMap.det ((Algebra.lmul R S) x)


theorem indicatorConstLp_coeFn_nmem : ∀ᵐ x : α ∂μ, x ∉ s → indicatorConstLp p hs hμs c x = 0

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup E]
{s : Set α}
{hs : MeasurableSet s}
{hμs : μ s ≠ ⊤}
{c : E}

∀ᵐ (x : α) ∂μ, x ∉ s → ↑↑(MeasureTheory.indicatorConstLp p hs hμs c) x = 0


@[to_additive]
theorem map_mul_left_eq_self (μ : Measure G) [IsMulLeftInvariant μ] (g : G) :
    map (g * ·) μ = μ

{G : Type u_2}
[MeasurableSpace G]
[Mul G]
(μ : MeasureTheory.Measure G)
[μ.IsMulLeftInvariant]
(g : G)

MeasureTheory.Measure.map (fun x => g * x) μ = μ


@[to_additive]
protected theorem Finset.hasProd_compl_iff (s : Finset β) :
    HasProd (fun x : { x // x ∉ s } ↦ f x) a ↔ HasProd f (a * ∏ i ∈ s, f i)

{α : Type u_1}
{β : Type u_2}
[CommGroup α]
[TopologicalSpace α]
[TopologicalGroup α]
{f : β → α}
{a : α}
(s : Finset β)

HasProd (fun x => f ↑x) a ↔ HasProd f (a * ∏ i ∈ s, f i)


theorem integral_rexp_neg_mul_sq_norm {b : ℝ} (hb : 0 < b) :
    ∫ v : V, rexp (- b * ‖v‖^2) = (π / b) ^ (FiniteDimensional.finrank ℝ V / 2 : ℝ)

{V : Type u_1}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[FiniteDimensional ℝ V]
[MeasurableSpace V]
[BorelSpace V]
{b : ℝ}
(hb : 0 < b)

∫ (v : V), rexp (-b * ‖v‖ ^ 2) = (π / b) ^ (↑(FiniteDimensional.finrank ℝ V) / 2)


@[simp]
theorem IsUnit.squarefree [CommMonoid R] {x : R} (h : IsUnit x) : Squarefree x

{R : Type u_1}
[CommMonoid R]
{x : R}
(h : IsUnit x)


/-- This property is sometimes referred to as `α` being upper continuous. -/
protected theorem DirectedOn.sSup_inf_eq (h : DirectedOn (· ≤ ·) s) :
    sSup s ⊓ a = ⨆ b ∈ s, b ⊓ a

(h : DirectedOn (fun x x_1 => x ≤ x_1) s)


theorem lift_le {F : IntermediateField K L} (E : IntermediateField K F) : lift E ≤ F

{K : Type u_1}
{L : Type u_2}
[Field K]
[Field L]
[Algebra K L]
{F : IntermediateField K L}
(E : IntermediateField K ↥F)


theorem unop {X : Cᵒᵖ} (h : IsZero X) : IsZero (Opposite.unop X)

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X : Cᵒᵖ}
(h : CategoryTheory.Limits.IsZero X)


theorem norm_eq_of_associated {d : ℤ} (hd : d ≤ 0) {x y : ℤ√d} (h : Associated x y) :
    x.norm = y.norm


theorem IrreducibleSpace.isIrreducible_univ (X : Type*) [TopologicalSpace X] [IrreducibleSpace X] :
    IsIrreducible (univ : Set X)

(X : Type u_3)
[TopologicalSpace X]
[IrreducibleSpace X]


@[to_additive]
theorem union_div : (s₁ ∪ s₂) / t = s₁ / t ∪ s₂ / t

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


theorem schur_complement_eq₂₂ [Fintype m] [Fintype n] [DecidableEq n] (A : Matrix m m 𝕜)
    (B : Matrix m n 𝕜) {D : Matrix n n 𝕜} (x : m → 𝕜) (y : n → 𝕜) [Invertible D]
    (hD : D.IsHermitian) :
    (star (x ⊕ᵥ y)) ᵥ* (fromBlocks A B Bᴴ D) ⬝ᵥ (x ⊕ᵥ y) =
      (star ((D⁻¹ * Bᴴ) *ᵥ x + y)) ᵥ* D ⬝ᵥ ((D⁻¹ * Bᴴ) *ᵥ x + y) +
        (star x) ᵥ* (A - B * D⁻¹ * Bᴴ) ⬝ᵥ x

{m : Type u_2}
{n : Type u_3}
{𝕜 : Type u_5}
[CommRing 𝕜]
[PartialOrder 𝕜]
[StarRing 𝕜]
[StarOrderedRing 𝕜]
[Fintype m]
[Fintype n]
[DecidableEq n]
(A : Matrix m m 𝕜)
(B : Matrix m n 𝕜)
{D : Matrix n n 𝕜}
(x : m → 𝕜)
(y : n → 𝕜)
[Invertible D]
(hD : D.IsHermitian)

Matrix.dotProduct (Matrix.vecMul (star (Sum.elim x y)) (Matrix.fromBlocks A B B.conjTranspose D)) (Sum.elim x y) =
  Matrix.dotProduct (Matrix.vecMul (star ((D⁻¹ * B.conjTranspose).mulVec x + y)) D)
      ((D⁻¹ * B.conjTranspose).mulVec x + y) +
    Matrix.dotProduct (Matrix.vecMul (star x) (A - B * D⁻¹ * B.conjTranspose)) x


theorem gc_map_comap (f : F) : GaloisConnection (map f) (comap f)

{R : Type u_1}
{R₂ : Type u_3}
{M : Type u_5}
{M₂ : Type u_7}
[Semiring R]
[Semiring R₂]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R₂ M₂]
{σ₁₂ : R →+* R₂}
{F : Type u_9}
[FunLike F M M₂]
[SemilinearMapClass F σ₁₂ M M₂]
[RingHomSurjective σ₁₂]
(f : F)

GaloisConnection (Submodule.map f) (Submodule.comap f)


theorem pi_eq_empty_iff' : s.pi t = ∅ ↔ ∃ i ∈ s, t i = ∅

{ι : Type u_1}
{α : ι → Type u_2}
{s : Set ι}
{t : (i : ι) → Set (α i)}
[∀ (i : ι), Nonempty (α i)]


protected theorem congr_arg (F : Homotopy f₀ f₁) {x y : I × X} (h : x = y) : F x = F y

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]
{f₀ f₁ : C(X, Y)}
(F : f₀.Homotopy f₁)
{x y : ↑I × X}
(h : x = y)


protected theorem continuous : Continuous e

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


theorem span_le_adjoin (s : Set A) : span R s ≤ Subalgebra.toSubmodule (adjoin R s)

(R : Type uR)
{A : Type uA}
[CommSemiring R]
[Semiring A]
[Algebra R A]
(s : Set A)

Submodule.span R s ≤ Subalgebra.toSubmodule (Algebra.adjoin R s)


theorem HasFTaylorSeriesUpToOn.zero_eq' (h : HasFTaylorSeriesUpToOn n f p s) {x : E} (hx : x ∈ s) :
    p x 0 = (continuousMultilinearCurryFin0 𝕜 E F).symm (f x)

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{s : Set E}
{f : E → F}
{n : ℕ∞}
{p : E → FormalMultilinearSeries 𝕜 E F}
(h : HasFTaylorSeriesUpToOn n f p s)
{x : E}
(hx : x ∈ s)


@[congr]
theorem ite_congr {x y u v : α} {s : Decidable b} [Decidable c]
    (h₁ : b = c) (h₂ : c → x = u) (h₃ : ¬ c → y = v) : ite b x y = ite c u v

{α : Sort u_1}
{b c : Prop}
{x y u v : α}
{s : Decidable b}
[Decidable c]
(h₁ : b = c)
(h₂ : c → x = u)
(h₃ : ¬c → y = v)


lemma lawsonClosed_of_scottClosed (s : Set α) (h : IsClosed (WithScott.ofScott ⁻¹' s)) :
    IsClosed (WithLawson.ofLawson ⁻¹' s)

(h : IsClosed (⇑Topology.WithScott.ofScott ⁻¹' s))

IsClosed (⇑Topology.WithLawson.ofLawson ⁻¹' s)


theorem drop_append_stream : ∀ (l : List α) (s : Stream' α), drop l.length (l ++ₛ s) = s

{α : Type u}
(l : List α)
(s : Stream' α)


theorem union_apply_right {α} {s t : Set α} [DecidablePred fun x => x ∈ s] (H : s ∩ t ⊆ ∅)
    {a : (s ∪ t : Set α)} (ha : ↑a ∈ t) : Equiv.Set.union H a = Sum.inr ⟨a, ha⟩

{α : Type u_1}
{s t : Set α}
[DecidablePred fun x => x ∈ s]
(H : s ∩ t ⊆ ∅)
{a : ↑(s ∪ t)}
(ha : ↑a ∈ t)

(Equiv.Set.union H) a = Sum.inr ⟨↑a, ha⟩


theorem union_union_distrib_left (s t u : Set α) : s ∪ (t ∪ u) = s ∪ t ∪ (s ∪ u)


/-- Formula for orthogonal projection onto a single unit vector. -/
theorem orthogonalProjection_unit_singleton {v : E} (hv : ‖v‖ = 1) (w : E) :
    (orthogonalProjection (𝕜 ∙ v) w : E) = ⟪v, w⟫ • v

(𝕜 : Type u_1)
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{v : E}
(hv : ‖v‖ = 1)
(w : E)

↑((orthogonalProjection (Submodule.span 𝕜 {v})) w) = ⟪v, w⟫_𝕜 • v


theorem sdiff_inf_distrib (a b c : α) : a \ (b ⊓ c) = a \ b ⊔ a \ c

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


theorem Matrix.Represents.zero : (0 : Matrix ι ι R).Represents b 0

{ι : Type u_1}
[Fintype ι]
{M : Type u_2}
[AddCommGroup M]
{R : Type u_3}
[CommRing R]
[Module R M]
{b : ι → M}
[DecidableEq ι]


@[to_additive (attr := simp)]
theorem length_of (x : α) : (of x).length = 1


@[simp]
theorem toFun_inducedStructureEquiv_Symm (e : M ≃ N) :
    (by
    letI : L.Structure N := inducedStructure e
    exact DFunLike.coe (@inducedStructureEquiv L M N _ e).symm) = (e.symm : N → M)

{L : FirstOrder.Language}
{M : Type u_1}
{N : Type u_2}
[L.Structure M]
(e : M ≃ N)


theorem Embedding.map_nhds_of_mem (hf : Embedding f) (x : X) (h : range f ∈ 𝓝 (f x)) :
    (𝓝 x).map f = 𝓝 (f x)

{X : Type u_1}
{Y : Type u_2}
{f : X → Y}
[TopologicalSpace X]
[TopologicalSpace Y]
(hf : Embedding f)
(x : X)
(h : Set.range f ∈ 𝓝 (f x))


theorem ciSup_false (f : False → α) : ⨆ i, f i = ⊥

{α : Type u_1}
[ConditionallyCompleteLinearOrderBot α]
(f : False → α)


@[simp] theorem range_rangeRestrict : range f.rangeRestrict = ⊤

{R : Type u_1}
{R₂ : Type u_2}
{M : Type u_6}
{M₂ : Type u_7}
[Semiring R]
[Semiring R₂]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R₂ M₂]
{τ₁₂ : R →+* R₂}
[RingHomSurjective τ₁₂]
(f : M →ₛₗ[τ₁₂] M₂)


@[nolint unusedHavesSuffices]
theorem fastGrowing_def {o : ONote} {x} (e : fundamentalSequence o = x) :
    fastGrowing o =
      match
        (motive := (x : Option ONote ⊕ (ℕ → ONote)) → FundamentalSequenceProp o x → ℕ → ℕ)
        x, e ▸ fundamentalSequence_has_prop o with
      | Sum.inl none, _ => Nat.succ
      | Sum.inl (some a), _ =>
        fun i => (fastGrowing a)^[i] i
      | Sum.inr f, _ => fun i =>
        fastGrowing (f i) i

{o : ONote}
{x : Option ONote ⊕ (ℕ → ONote)}
(e : o.fundamentalSequence = x)

o.fastGrowing =
  match (motive := (x : Option ONote ⊕ (ℕ → ONote)) → o.FundamentalSequenceProp x → ℕ → ℕ) x, ⋯ with
  | Sum.inl none, x => Nat.succ
  | Sum.inl (some a), x => fun i => a.fastGrowing^[i] i
  | Sum.inr f, x => fun i => (f i).fastGrowing i


/-- One half of the equivalence between `C` and `AsSmall C`. -/
@[simps]
def AsSmall.down : AsSmall C ⥤ C

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

CategoryTheory.AsSmall.down.obj X = X.down


@[simp, norm_cast]
theorem coe_zero : ↑(0 : ProperCone 𝕜 E) = (0 : ConvexCone 𝕜 E)

{𝕜 : Type u_1}
[OrderedSemiring 𝕜]
{E : Type u_2}
[AddCommMonoid E]
[TopologicalSpace E]
[T1Space E]
[Module 𝕜 E]


lemma rightHomologyMap_comm [S₁.HasRightHomology] [S₂.HasRightHomology] :
    rightHomologyMap φ ≫ h₂.rightHomologyIso.hom = h₁.rightHomologyIso.hom ≫ γ.φH

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

CategoryTheory.CategoryStruct.comp (CategoryTheory.ShortComplex.rightHomologyMap φ) h₂.rightHomologyIso.hom =
  CategoryTheory.CategoryStruct.comp h₁.rightHomologyIso.hom γ.φH


@[to_additive (attr := measurability)]
theorem QuotientGroup.measurable_coe {G} [Group G] [MeasurableSpace G] {S : Subgroup G} :
    Measurable ((↑) : G → G ⧸ S)

{G : Type u_6}
[AddGroup G]
[MeasurableSpace G]
{S : AddSubgroup G}


@[reassoc (attr := simp)]
theorem pentagon_inv_inv_hom_hom_inv :
    (α_ W (X ⊗ Y) Z).inv ≫ (α_ W X Y).inv ▷ Z ≫ (α_ (W ⊗ X) Y Z).hom =
      W ◁ (α_ X Y Z).hom ≫ (α_ W X (Y ⊗ Z)).inv

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.MonoidalCategory C]
{W X Y Z : C}

CategoryTheory.CategoryStruct.comp
    (CategoryTheory.MonoidalCategory.associator W (CategoryTheory.MonoidalCategory.tensorObj X Y) Z).inv
    (CategoryTheory.CategoryStruct.comp
      (CategoryTheory.MonoidalCategory.whiskerRight (CategoryTheory.MonoidalCategory.associator W X Y).inv Z)
      (CategoryTheory.MonoidalCategory.associator (CategoryTheory.MonoidalCategory.tensorObj W X) Y Z).hom) =
  CategoryTheory.CategoryStruct.comp
    (CategoryTheory.MonoidalCategory.whiskerLeft W (CategoryTheory.MonoidalCategory.associator X Y Z).hom)
    (CategoryTheory.MonoidalCategory.associator W X (CategoryTheory.MonoidalCategory.tensorObj Y Z)).inv


theorem lintegral_Lp_mul_le_Lq_mul_Lr {α} [MeasurableSpace α] {p q r : ℝ} (hp0_lt : 0 < p)
    (hpq : p < q) (hpqr : 1 / p = 1 / q + 1 / r) (μ : Measure α) {f g : α → ℝ≥0∞}
    (hf : AEMeasurable f μ) (hg : AEMeasurable g μ) :
    (∫⁻ a, (f * g) a ^ p ∂μ) ^ (1 / p) ≤
      (∫⁻ a, f a ^ q ∂μ) ^ (1 / q) * (∫⁻ a, g a ^ r ∂μ) ^ (1 / r)

{α : Type u_2}
[MeasurableSpace α]
{p q r : ℝ}
(hp0_lt : 0 < p)
(hpq : p < q)
(hpqr : 1 / p = 1 / q + 1 / r)
(μ : MeasureTheory.Measure α)
{f g : α → ENNReal}
(hf : AEMeasurable f μ)
(hg : AEMeasurable g μ)


@[simp] theorem not_false_eq_true : (¬ False) = True


@[simp]
theorem refl_trans (h : M ≃ₘ^n⟮I, I'⟯ M') : (Diffeomorph.refl I M n).trans h = h

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{E' : Type u_3}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H : Type u_5}
[TopologicalSpace H]
{H' : Type u_6}
[TopologicalSpace H']
{I : ModelWithCorners 𝕜 E H}
{I' : ModelWithCorners 𝕜 E' H'}
{M : Type u_9}
[TopologicalSpace M]
[ChartedSpace H M]
{M' : Type u_10}
[TopologicalSpace M']
[ChartedSpace H' M']
{n : ℕ∞}
(h : M ≃ₘ^n⟮I, I'⟯ M')


theorem norm_of_nonneg (hr : 0 ≤ r) : ‖r‖ = r


theorem SmoothAt.smoothWithinAt (hf : SmoothAt I I' f x) : SmoothWithinAt I I' f s 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 : Set M}
{x : M}
(hf : SmoothAt I I' f x)


lemma cfc_const (r : R) (a : A) (ha : p a := by cfc_tac) :
    cfc (fun _ ↦ r) a = algebraMap R A r

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


theorem ConvexOn.le_right_of_left_le (hf : ConvexOn 𝕜 s f) {x y z : E} (hx : x ∈ s) (hy : y ∈ s)
    (hz : z ∈ openSegment 𝕜 x y) (hxz : f x ≤ f z) : f z ≤ f y

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_5}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[LinearOrderedCancelAddCommMonoid β]
[SMul 𝕜 E]
[Module 𝕜 β]
[OrderedSMul 𝕜 β]
{s : Set E}
{f : E → β}
(hf : ConvexOn 𝕜 s f)
{x y z : E}
(hx : x ∈ s)
(hy : y ∈ s)
(hz : z ∈ openSegment 𝕜 x y)
(hxz : f x ≤ f z)


theorem rank_diagonal [DecidableEq m] [DecidableEq K] (w : m → K) :
    LinearMap.rank (toLin' (diagonal w)) = Fintype.card { i // w i ≠ 0 }

{m : Type u_1}
[Fintype m]
{K : Type u}
[Field K]
[DecidableEq m]
[DecidableEq K]
(w : m → K)

(Matrix.toLin' (Matrix.diagonal w)).rank = ↑(Fintype.card { i // w i ≠ 0 })


theorem Differentiable.comp' {g : F → G} (hg : Differentiable K g) (hf : Differentiable K f) :
    Differentiable K (fun x => g (f x))

{K : Type u_1}
[NontriviallyNormedField K]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace K E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace K F]
{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace K G]
{f : E → F}
{g : F → G}
(hg : Differentiable K g)
(hf : Differentiable K f)


/-- The first projection functor `ShortComplex C ⥤ C`. -/
@[simps]
def π₁ : ShortComplex C ⥤ C

CategoryTheory.ShortComplex.π₁.obj S = S.X₁


@[to_additive (attr := simp)]
theorem traverse_pure (x) : traverse F (pure x : FreeMagma α) = pure <$> F x

{α β : Type u}
{m : Type u → Type u}
[Applicative m]
(F : α → m β)
(x : α)


/-- When the domain has a zero, then the inverse of a multiplicative character `χ`,
applied to `a`, is `χ` applied to the inverse of `a`. -/
theorem inv_apply {R : Type*} [CommMonoidWithZero R] (χ : MulChar R R') (a : R) :
    χ⁻¹ a = χ (Ring.inverse a)

{R' : Type u_2}
[CommMonoidWithZero R']
{R : Type u_3}
[CommMonoidWithZero R]
(χ : MulChar R R')
(a : R)


protected theorem Decidable.forall_or_right {q} {p : α → Prop} [Decidable q] :
    (∀ x, p x ∨ q) ↔ (∀ x, p x) ∨ q

{α : Sort u_1}
{q : Prop}
{p : α → Prop}
[Decidable q]

(∀ (x : α), p x ∨ q) ↔ (∀ (x : α), p x) ∨ q


theorem fg_def {S : IntermediateField F E} : S.FG ↔ ∃ t : Set E, Set.Finite t ∧ adjoin F t = S

{F : Type u_1}
[Field F]
{E : Type u_2}
[Field E]
[Algebra F E]
{S : IntermediateField F E}

S.FG ↔ ∃ t, t.Finite ∧ IntermediateField.adjoin F t = S


/-- Given `c = lineMap a b r`, `a < c < b`, the point `(c, f c)` is non-strictly below the
segment `[(a, f a), (b, f b)]` if and only if `slope f a c ≤ slope f c b`. -/
theorem map_le_lineMap_iff_slope_le_slope (hab : a < b) (h₀ : 0 < r) (h₁ : r < 1) :
    f c ≤ lineMap (f a) (f b) r ↔ slope f a c ≤ slope f c b

{k : Type u_1}
{E : Type u_2}
[LinearOrderedField k]
[OrderedAddCommGroup E]
[Module k E]
[OrderedSMul k E]
{f : k → E}
{a b r : k}
(hab : a < b)
(h₀ : 0 < r)
(h₁ : r < 1)

f ((AffineMap.lineMap a b) r) ≤ (AffineMap.lineMap (f a) (f b)) r ↔
  slope f a ((AffineMap.lineMap a b) r) ≤ slope f ((AffineMap.lineMap a b) r) b


theorem differentiableOn_congr (h' : ∀ x ∈ s, f₁ x = f x) :
    DifferentiableOn 𝕜 f₁ s ↔ DifferentiableOn 𝕜 f s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f f₁ : E → F}
{s : Set E}
(h' : ∀ x ∈ s, f₁ x = f x)


/-- The evaluation map `C(X, Y) × X → Y` is continuous
if `X, Y` is a locally compact pair of spaces. -/
@[continuity]
theorem continuous_eval [LocallyCompactPair X Y] : Continuous fun p : C(X, Y) × X => p.1 p.2

{X : Type u_2}
{Y : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
[LocallyCompactPair X Y]


@[elementwise (attr := simp)]
theorem binaryProductIso_inv_comp_fst (X Y : Type u) :
    (binaryProductIso X Y).inv ≫ Limits.prod.fst = _root_.Prod.fst

(CategoryTheory.Limits.Types.binaryProductIso X Y).inv ≫ CategoryTheory.Limits.prod.fst = Prod.fst


@[to_additive (attr := simp)]
theorem pure_mul_pure : pure a * pure b = pure (a * b)

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

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

NonemptyInterval.pure a + NonemptyInterval.pure b = NonemptyInterval.pure (a + b)


theorem Base.exchange_mem {e : α}
    (hB₁ : M.Base B₁) (hB₂ : M.Base B₂) (hxB₁ : e ∈ B₁) (hxB₂ : e ∉ B₂) :
    ∃ y, (y ∈ B₂ ∧ y ∉ B₁) ∧ M.Base (insert y (B₁ \ {e}))

{α : Type u_1}
{M : Matroid α}
{B₁ B₂ : Set α}
{e : α}
(hB₁ : M.Base B₁)
(hB₂ : M.Base B₂)
(hxB₁ : e ∈ B₁)
(hxB₂ : e ∉ B₂)


@[simp]
theorem linearProjOfIsCompl_apply_eq_zero_iff (h : IsCompl p q) {x : E} :
    linearProjOfIsCompl p q h x = 0 ↔ x ∈ q

{R : Type u_1}
[Ring R]
{E : Type u_2}
[AddCommGroup E]
[Module R E]
{p q : Submodule R E}
(h : IsCompl p q)
{x : E}

(p.linearProjOfIsCompl q h) x = 0 ↔ x ∈ q


/-- The second projection of `prod F G`, onto `G`. -/
@[simps]
def prod.snd : prod F G ⟶ G

{F G : CategoryTheory.Functor C (Type w)}

∀ (x : C) (a : (CategoryTheory.FunctorToTypes.prod F G).obj x), CategoryTheory.FunctorToTypes.prod.snd.app x a = a.2


@[to_additive]
theorem mem_iInf {ι : Sort*} {S : ι → Subgroup G} {x : G} : (x ∈ ⨅ i, S i) ↔ ∀ i, x ∈ S i

{G : Type u_1}
[Group G]
{ι : Sort u_5}
{S : ι → Subgroup G}
{x : G}


/-- If `α` is a linear succ order, `β` is a preorder, and `f : α → β` is a monotone function, then
the intervals `Set.Ioc (f n) (f (Order.succ n))` are pairwise disjoint. -/
theorem pairwise_disjoint_on_Ioc_succ [SuccOrder α] [Preorder β] {f : α → β} (hf : Monotone f) :
    Pairwise (Disjoint on fun n => Ioc (f n) (f (succ n)))

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

Pairwise (Disjoint on fun n => Set.Ioc (f n) (f (Order.succ n)))


/-- A normal element whose `ℂ`-spectrum is contained in `ℝ` is selfadjoint. -/
lemma SpectrumRestricts.isSelfAdjoint (a : A) (ha : SpectrumRestricts a Complex.reCLM)
    [IsStarNormal a] : IsSelfAdjoint a

(ha : SpectrumRestricts a ⇑Complex.reCLM)


/-- The base function from which one will construct a family of bump functions. One could
add more properties if they are useful and satisfied in the examples of inner product spaces
and finite dimensional vector spaces, notably derivative norm control in terms of `R - 1`.

TODO: do we ever need `f x = 1 ↔ ‖x‖ ≤ 1`? -/
-- Porting note(#5171): linter not yet ported; was @[nolint has_nonempty_instance]
structure ContDiffBumpBase (E : Type*) [NormedAddCommGroup E] [NormedSpace ℝ E] where
  /-- The function underlying this family of bump functions -/
  toFun : ℝ → E → ℝ
  mem_Icc : ∀ (R : ℝ) (x : E), toFun R x ∈ Icc (0 : ℝ) 1
  symmetric : ∀ (R : ℝ) (x : E), toFun R (-x) = toFun R x
  smooth : ContDiffOn ℝ ⊤ (uncurry toFun) (Ioi (1 : ℝ) ×ˢ (univ : Set E))
  eq_one : ∀ R : ℝ, 1 < R → ∀ x : E, ‖x‖ ≤ 1 → toFun R x = 1
  support : ∀ R : ℝ, 1 < R → Function.support (toFun R) = Metric.ball (0 : E) R

{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
(self : ContDiffBumpBase E)
(R : ℝ)
(x : E)


theorem set_walk_self_length_zero_eq (u : V) : {p : G.Walk u u | p.length = 0} = {Walk.nil}

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

{p | p.length = 0} = {SimpleGraph.Walk.nil}


/-- Given a cone over `F ⋙ G`, we can construct a `Cone G` with the same cocone point.
-/
@[simps]
def extendCone : Cone (F ⋙ G) ⥤ Cone G

(c : CategoryTheory.Limits.Cone (F.comp G))

(CategoryTheory.Functor.Initial.extendCone.obj c).π.app d =
  CategoryTheory.CategoryStruct.comp (c.π.app (CategoryTheory.Functor.Initial.lift F d))
    (G.map (CategoryTheory.Functor.Initial.homToLift F d))


theorem imp.swap : (a → b → c) ↔ (b → a → c)


@[simp]
theorem cast_sub' (a b : ZMod n) : (cast (a - b : ZMod n) : R) = cast a - cast b

{n : ℕ}
{R : Type u_1}
[Ring R]
[CharP R n]
(a b : ZMod n)


@[simp]
theorem cons_append (a : α) (s t) : append (cons a s) t = cons a (append s t)

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

(Stream'.WSeq.cons a s).append t = Stream'.WSeq.cons a (s.append t)


theorem cons_map_snd_darts {u v : V} (p : G.Walk u v) : (u :: p.darts.map (·.snd)) = p.support

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

u :: List.map (fun x => x.toProd.2) p.darts = p.support


lemma slope_le_right_deriv (hfc : ConcaveOn ℝ S f) (hx : x ∈ S) (hy : y ∈ S) (hxy : x < y)
    (hfd : DifferentiableWithinAt ℝ f (Ioi x) x) :
    slope f x y ≤ derivWithin f (Ioi x) x

(hfd : DifferentiableWithinAt ℝ f (Set.Ioi x) x)

slope f x y ≤ derivWithin f (Set.Ioi x) x


theorem false_and_iff : False ∧ p ↔ False


/-- Entourages are neighborhoods of the diagonal. -/
theorem nhdsSet_diagonal_le_uniformity : 𝓝ˢ (diagonal α) ≤ 𝓤 α


theorem lcm_union [DecidableEq β] : (s₁ ∪ s₂).lcm f = GCDMonoid.lcm (s₁.lcm f) (s₂.lcm f)

{α : Type u_2}
{β : Type u_3}
[CancelCommMonoidWithZero α]
[NormalizedGCDMonoid α]
{s₁ s₂ : Finset β}
{f : β → α}
[DecidableEq β]

(s₁ ∪ s₂).lcm f = lcm (s₁.lcm f) (s₂.lcm f)


@[simp]
theorem coe_toContinuousLinearEquiv : ⇑e.toContinuousLinearEquiv = e

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


theorem unbounded_inter_not (H : ∀ a b, ∃ m, ∀ c, r c a ∨ r c b → r c m) (a : α) :
    Unbounded r (s ∩ { b | ¬r b a }) ↔ Unbounded r s

(H : ∀ (a b : α), ∃ m, ∀ (c : α), r c a ∨ r c b → r c m)

Set.Unbounded r (s ∩ {b | ¬r b a}) ↔ Set.Unbounded r s


lemma toAffineLift_neg (P : W.Point) : (-P).toAffineLift = -P.toAffineLift

{F : Type v}
[Field F]
{W : WeierstrassCurve.Jacobian F}
(P : W.Point)


@[simp]
theorem edgeDensity_empty_right (s : Finset α) : edgeDensity r s ∅ = 0

{α : Type u_4}
{β : Type u_5}
(r : α → β → Prop)
[(a : α) → DecidablePred (r a)]
(s : Finset α)


/-- Combine finitely supported functions over `{a // P a}` and `{a // ¬P a}`, by case-splitting on
`P a`. -/
@[simps]
def piecewise (f : Subtype P →₀ M) (g : {a // ¬ P a} →₀ M) : α →₀ M

{α : Type u_1}
{M : Type u_13}
[Zero M]
{P : α → Prop}
[DecidablePred P]
(f : Subtype P →₀ M)
(g : { a // ¬P a } →₀ M)

(f.piecewise g).support =
  (Finset.map (Function.Embedding.subtype P) f.support).disjUnion
    (Finset.map (Function.Embedding.subtype fun a => ¬P a) g.support) ⋯


lemma mem_iSup_iff_exists_finsupp (p : ι → Submodule R N) (x : N) :
    x ∈ iSup p ↔ ∃ (f : ι →₀ N), (∀ i, f i ∈ p i) ∧ (f.sum fun _i xi ↦ xi) = x

{ι : Type u_1}
{R : Type u_2}
{N : Type u_5}
[Semiring R]
[AddCommMonoid N]
[Module R N]
(p : ι → Submodule R N)
(x : N)

x ∈ iSup p ↔ ∃ f, (∀ (i : ι), f i ∈ p i) ∧ (f.sum fun _i xi => xi) = x


lemma tendsto_measure_Icc_nhdsWithin_right' (b : ℝ) :
    Tendsto (fun δ ↦ μ (Icc (b - δ) (b + δ))) (𝓝[>] (0 : ℝ)) (𝓝 (μ {b}))

Filter.Tendsto (fun δ => μ (Set.Icc (b - δ) (b + δ))) (𝓝[>] 0) (𝓝 (μ {b}))


theorem ClusterPt.of_le_nhds' {f : Filter X} (H : f ≤ 𝓝 x) (_hf : NeBot f) :
    ClusterPt x f

{X : Type u}
{x : X}
[TopologicalSpace X]
{f : Filter X}
(H : f ≤ 𝓝 x)
(_hf : f.NeBot)


theorem exists_seq_mono_tendsto (I : Box ι) :
    ∃ J : ℕ →o Box ι,
      (∀ n, Box.Icc (J n) ⊆ Box.Ioo I) ∧
        Tendsto (lower ∘ J) atTop (𝓝 I.lower) ∧ Tendsto (upper ∘ J) atTop (𝓝 I.upper)

∃ J,
  (∀ (n : ℕ), BoxIntegral.Box.Icc (J n) ⊆ BoxIntegral.Box.Ioo I) ∧
    Filter.Tendsto (BoxIntegral.Box.lower ∘ ⇑J) Filter.atTop (𝓝 I.lower) ∧
      Filter.Tendsto (BoxIntegral.Box.upper ∘ ⇑J) Filter.atTop (𝓝 I.upper)


/-- Convert between an equality with adding a group element to a point
and an equality of a subtraction of two points with a group
element. -/
theorem eq_vadd_iff_vsub_eq (p₁ : P) (g : G) (p₂ : P) : p₁ = g +ᵥ p₂ ↔ p₁ -ᵥ p₂ = g

{G : Type u_1}
{P : Type u_2}
[AddGroup G]
[T : AddTorsor G P]
(p₁ : P)
(g : G)
(p₂ : P)


/-- An explicit description of `χ₄` on integers / naturals -/
theorem χ₄_int_eq_if_mod_four (n : ℤ) :
    χ₄ n = if n % 2 = 0 then 0 else if n % 4 = 1 then 1 else -1

ZMod.χ₄ ↑n = if n % 2 = 0 then 0 else if n % 4 = 1 then 1 else -1


@[measurability]
theorem AEMeasurable.inf_const (hf : AEMeasurable f μ) (c : M) :
    AEMeasurable (fun x => f x ⊓ c) μ

{M : Type u_1}
[MeasurableSpace M]
{α : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f : α → M}
[Inf M]
[MeasurableInf M]
(hf : AEMeasurable f μ)
(c : M)


/-- In a second countable space, the set of points where an antitone function is not continuous
is at most countable. -/
theorem countable_not_continuousAt [SecondCountableTopology β] :
    Set.Countable { x | ¬ContinuousAt f x }

{α : Type u_1}
{β : Type u_2}
[LinearOrder α]
[ConditionallyCompleteLinearOrder β]
[TopologicalSpace β]
[OrderTopology β]
{f : α → β}
(hf : Antitone f)
[TopologicalSpace α]
[OrderTopology α]
[SecondCountableTopology β]


protected theorem Measurable.comp {_ : MeasurableSpace α} {_ : MeasurableSpace β}
    {_ : MeasurableSpace γ} {g : β → γ} {f : α → β} (hg : Measurable g) (hf : Measurable f) :
    Measurable (g ∘ f)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}

∀ {x : MeasurableSpace α} {x_1 : MeasurableSpace β} {x_2 : MeasurableSpace γ} {g : β → γ} {f : α → β},
  Measurable g → Measurable f → Measurable (g ∘ f)


theorem range_add_eq_union : range (a + b) = range a ∪ (range b).map (addLeftEmbedding a)

Finset.range (a + b) = Finset.range a ∪ Finset.map (addLeftEmbedding a) (Finset.range b)


@[simp]
theorem hasse_adj : (hasse α).Adj a b ↔ a ⋖ b ∨ b ⋖ a

(SimpleGraph.hasse α).Adj a b ↔ a ⋖ b ∨ b ⋖ a


protected theorem add_neg_cancel_left (a b : Int) : a + (-a + b) = b


theorem HasBasis.le_iff (hl : l.HasBasis p s) : l ≤ l' ↔ ∀ t ∈ l', ∃ i, p i ∧ s i ⊆ t

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


theorem measurable_eq_mp {i i' : δ} (h : i = i') : Measurable (congr_arg π h).mp

{δ : Type u_4}
(π : δ → Type u_6)
[(a : δ) → MeasurableSpace (π a)]
{i i' : δ}
(h : i = i')


@[simp]
theorem tendsto_neg_atTop_iff : Tendsto (fun x => -f x) l atTop ↔ Tendsto f l atBot

{α : Type u_3}
{β : Type u_4}
[OrderedAddCommGroup β]
{l : Filter α}
{f : α → β}

Filter.Tendsto (fun x => -f x) l Filter.atTop ↔ Filter.Tendsto f l Filter.atBot


@[continuity]
theorem continuous_abs : Continuous abs


lemma Presheaf.IsSheaf.isSheafFor {P : Cᵒᵖ ⥤ Type w} (hP : Presheaf.IsSheaf J P)
    {X : C} (S : Sieve X) (hS : S ∈ J X) : Presieve.IsSheafFor P S.arrows

{J : CategoryTheory.GrothendieckTopology C}

{P : CategoryTheory.Functor Cᵒᵖ (Type w)}

(hP : CategoryTheory.Presheaf.IsSheaf J P)


@[simp]
theorem ofNat_im (n : ℕ) [n.AtLeastTwo] : (no_index (OfNat.ofNat n) : ℤ√d).im = 0


theorem DifferentiableWithinAt.sqrt (hf : DifferentiableWithinAt ℝ f s x) (hx : f x ≠ 0) :
    DifferentiableWithinAt ℝ (fun y => √(f y)) s x

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : E → ℝ}
{s : Set E}
{x : E}
(hf : DifferentiableWithinAt ℝ f s x)
(hx : f x ≠ 0)


@[simp]
theorem coe_zero : ⇑(0 : Seminorm 𝕜 E) = 0

{𝕜 : Type u_3}
{E : Type u_7}
[SeminormedRing 𝕜]
[AddGroup E]
[SMul 𝕜 E]


@[simp] theorem zero_imI : (0 : ℍ[R,c₁,c₂]).imI = 0


theorem isBridge_iff {u v : V} :
    G.IsBridge s(u, v) ↔ G.Adj u v ∧ ¬(G \ fromEdgeSet {s(u, v)}).Reachable u v

{V : Type u}
{G : SimpleGraph V}
{u v : V}

G.IsBridge s(u, v) ↔ G.Adj u v ∧ ¬(G \ SimpleGraph.fromEdgeSet {s(u, v)}).Reachable u v


theorem bindOnSupport_comm (p : PMF α) (q : PMF β) (f : ∀ a ∈ p.support, ∀ b ∈ q.support, PMF γ) :
    (p.bindOnSupport fun a ha => q.bindOnSupport (f a ha)) =
      q.bindOnSupport fun b hb => p.bindOnSupport fun a ha => f a ha b hb

(f : (a : α) → a ∈ p.support → (b : β) → b ∈ q.support → PMF γ)


@[simp]
theorem IsSymm.add {A B : Matrix n n α} [Add α] (hA : A.IsSymm) (hB : B.IsSymm) : (A + B).IsSymm

{α : Type u_1}
{n : Type u_3}
{A B : Matrix n n α}
[Add α]
(hA : A.IsSymm)
(hB : B.IsSymm)


/-- If `f : ℝ → ℝ` is strictly convex on `S` and differentiable within `S` at `x ∈ S`, then the
slope of any secant line with left endpoint at `x` is strictly greater than the derivative of `f`
within `S` at `x`.

This is fractionally weaker than `StrictConvexOn.lt_slope_of_hasDerivWithinAt_Ioi` but simpler to
apply under a `DifferentiableOn S` hypothesis. -/
lemma lt_slope_of_hasDerivWithinAt (hfc : StrictConvexOn ℝ S f)
    (hx : x ∈ S) (hy : y ∈ S) (hxy : x < y) (hf' : HasDerivWithinAt f f' S x) :
    f' < slope f x y

{S : Set ℝ}
{f : ℝ → ℝ}
{x y f' : ℝ}
(hfc : StrictConvexOn ℝ S f)
(hx : x ∈ S)
(hy : y ∈ S)
(hxy : x < y)
(hf' : HasDerivWithinAt f f' S x)


theorem hasColimit_of_coreflective (F : J ⥤ D) (R : D ⥤ C) [HasColimit (F ⋙ R)] [Coreflective R] :
    HasColimit F


@[simp]
theorem num_zero : num (0 : RatFunc K) = 0


@[simp]
theorem neLocus_sub_left : neLocus (f - g₁) (f - g₂) = neLocus g₁ g₂

{α : Type u_1}
{N : Type u_3}
[DecidableEq α]
[DecidableEq N]
[AddGroup N]
(f g₁ g₂ : α →₀ N)

(f - g₁).neLocus (f - g₂) = g₁.neLocus g₂


@[simp]
theorem ceil_intCast (z : ℤ) : ⌈(z : α)⌉ = z

{α : Type u_2}
[LinearOrderedRing α]
[FloorRing α]
(z : ℤ)


theorem self_eq_X_pow_order_mul_divided_by_X_pow_order {f : R⟦X⟧} (hf : f ≠ 0) :
    X ^ f.order.get (order_finite_iff_ne_zero.mpr hf) * divided_by_X_pow_order hf = f

{R : Type u_1}
[Semiring R]
{f : PowerSeries R}
(hf : f ≠ 0)

PowerSeries.X ^ f.order.get ⋯ * PowerSeries.divided_by_X_pow_order hf = f


@[norm_cast]
theorem coe_sub : ∀ {x y : ℚ}, (↑(x - y) : ℚ_[p]) = ↑x - ↑y


theorem cons_ne {a a' : α} {b : δ a} {f : ∀ a ∈ m, δ a} (h' : a' ∈ a ::ₘ m)
    (h : a' ≠ a) : Pi.cons m a b f a' h' = f a' ((mem_cons.1 h').resolve_left h)

{α : Type u_1}
[DecidableEq α]
{δ : α → Sort u_2}
{m : Multiset α}
{a a' : α}
{b : δ a}
{f : (a : α) → a ∈ m → δ a}
(h' : a' ∈ a ::ₘ m)
(h : a' ≠ a)


theorem natTrailingDegree_monomial (ha : a ≠ 0) : natTrailingDegree (monomial n a) = n

{R : Type u}
{a : R}
{n : ℕ}
[Semiring R]
(ha : a ≠ 0)

((Polynomial.monomial n) a).natTrailingDegree = n


@[simp]
lemma comp_val {X Y Z : LightCondensed.{u} C} (f : X ⟶ Y) (g : Y ⟶ Z) :
    (f ≫ g).val = f.val ≫ g.val

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


@[simp]
theorem range_inl_union_range_inr : range (Sum.inl : α → α ⊕ β) ∪ range Sum.inr = univ

Set.range Sum.inl ∪ Set.range Sum.inr = Set.univ


/-- Integral curves are unique on open intervals.

If a $C^1$ vector field `v` admits two integral curves `γ γ' : ℝ → M` on some open interval
`Ioo a b`, and `γ t₀ = γ' t₀` for some `t ∈ Ioo a b`, then `γ` and `γ'` agree on `Ioo a b`. -/
theorem isIntegralCurveOn_Ioo_eqOn_of_contMDiff (ht₀ : t₀ ∈ Ioo a b)
    (hγt : ∀ t ∈ Ioo a b, I.IsInteriorPoint (γ t))
    (hv : ContMDiff I I.tangent 1 (fun x ↦ (⟨x, v x⟩ : TangentBundle I M)))
    (hγ : IsIntegralCurveOn γ v (Ioo a b)) (hγ' : IsIntegralCurveOn γ' v (Ioo a b))
    (h : γ t₀ = γ' t₀) : EqOn γ γ' (Ioo a b)

(hγt : ∀ t ∈ Set.Ioo a b, I.IsInteriorPoint (γ t))

(hv : ContMDiff I I.tangent 1 fun x => { proj := x, snd := v x })

(hγ : IsIntegralCurveOn γ v (Set.Ioo a b))

(hγ' : IsIntegralCurveOn γ' v (Set.Ioo a b))


theorem mem_of_mem_tail (h : a ∈ l.tail) : a ∈ l

{α : Type u_1}
{l : List α}
{a : α}
(h : a ∈ l.tail)


theorem inr_mono : Monotone (toLex ∘ inr : β → α ⊕ₗ β)

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]


@[grind_norm] theorem eq_false_eq (p : Prop) : (p = False) = ¬p


theorem Ioo_union_left (hab : a < b) : Ioo a b ∪ {a} = Ico a b

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


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

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


/-- The equivalence between `Bipointed` and itself induced by `Prod.swap` both ways. -/
@[simps!]
def swapEquiv : Bipointed ≌ Bipointed

(X : Bipointed)
(a : ((𝟭 Bipointed).obj X).X)

(Bipointed.swapEquiv.counitIso.inv.app X).toFun a = a


theorem IsOpen.nullMeasurableSet {μ} (h : IsOpen s) : NullMeasurableSet s μ

{α : Type u_1}
{s : Set α}
[TopologicalSpace α]
[MeasurableSpace α]
[OpensMeasurableSpace α]
{μ : MeasureTheory.Measure α}
(h : IsOpen s)


theorem inf_sdiff_right : a ⊓ a \ b = a \ b

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


theorem _root_.IsTop.Iic_eq (h : IsTop a) : Iic a = univ

{α : Type u_1}
[Preorder α]
{a : α}
(h : IsTop a)


theorem isSheaf_iff_isSheaf_of_type (P : Cᵒᵖ ⥤ Type w) :
    Presheaf.IsSheaf J P ↔ Presieve.IsSheaf J P

(J : CategoryTheory.GrothendieckTopology C)

(P : CategoryTheory.Functor Cᵒᵖ (Type w))

CategoryTheory.Presheaf.IsSheaf J P ↔ CategoryTheory.Presieve.IsSheaf J P


protected theorem neg_nonpos_of_nonneg {a : Int} (h : 0 ≤ a) : -a ≤ 0


/-- The diameter of a union is controlled by the sum of the diameters, and the distance between
any two points in each of the sets. This lemma is true without any side condition, since it is
obviously true if `s ∪ t` is unbounded. -/
theorem diam_union {t : Set α} (xs : x ∈ s) (yt : y ∈ t) :
    diam (s ∪ t) ≤ diam s + dist x y + diam t

{α : Type u}
[PseudoMetricSpace α]
{s : Set α}
{x y : α}
{t : Set α}
(xs : x ∈ s)
(yt : y ∈ t)

Metric.diam (s ∪ t) ≤ Metric.diam s + dist x y + Metric.diam t


theorem HasFDerivAt.continuousAt (h : HasFDerivAt f f' x) : ContinuousAt f x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{f' : E →L[𝕜] F}
{x : E}
(h : HasFDerivAt f f' x)


@[to_additive]
theorem TendstoUniformlyOnFilter.mul (hf : TendstoUniformlyOnFilter f g l l')
    (hf' : TendstoUniformlyOnFilter f' g' l l') : TendstoUniformlyOnFilter (f * f') (g * g') l l'


@[simp] lemma algebraMap_apply (y) :
    algebraMap (HomogeneousLocalization 𝒜 x) (Localization x) y = y.val

{ι : Type u_1}
{R : Type u_2}
{A : Type u_3}
[AddCommMonoid ι]
[DecidableEq ι]
[CommRing R]
[CommRing A]
[Algebra R A]
{𝒜 : ι → Submodule R A}
[GradedAlgebra 𝒜]
{x : Submonoid A}
(y : HomogeneousLocalization 𝒜 x)

(algebraMap (HomogeneousLocalization 𝒜 x) (at x)) y = y.val


theorem up_le_up {s t : Set α} : Set.up s ≤ Set.up t ↔ s ⊆ t


theorem unitization_range :
    (unitization s).range = subalgebraOfSubsemiring (Subsemiring.closure s)

{R : Type u_1}
{S : Type u_2}
[Semiring R]
[SetLike S R]
[hSR : NonUnitalSubsemiringClass S R]
(s : S)

(NonUnitalSubsemiring.unitization s).range = subalgebraOfSubsemiring (Subsemiring.closure ↑s)


theorem dense_iff (hf : Inducing f) {s : Set X} :
    Dense s ↔ ∀ x, f x ∈ closure (f '' s)

{X : Type u_1}
{Y : Type u_2}
{f : X → Y}
[TopologicalSpace X]
[TopologicalSpace Y]
(hf : Inducing f)
{s : Set X}

Dense s ↔ ∀ (x : X), f x ∈ closure (f '' s)


/-- Reinterpreting an `F`-costructured arrow `F.obj d ⟶ X` as an arrow over `X` induces a functor
    `CostructuredArrow F X ⥤ Over X`. -/
@[simps!]
def toOver (F : D ⥤ T) (X : T) : CostructuredArrow F X ⥤ Over X

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

∀ (X_1 : CategoryTheory.Comma (F.comp (CategoryTheory.Functor.id T)) (CategoryTheory.Functor.fromPUnit X)),
  ((CategoryTheory.CostructuredArrow.toOver F X).obj X_1).right = X_1.right


theorem data_take : ∀ {s}, Valid s → ∀ n, (s.take n).toString.1 = s.toString.1.take n

s.Valid → ∀ (n : Nat), (s.take n).toString.data = List.take n s.toString.data


theorem InnerProductSpace.volume_closedBall (x : E) (r : ℝ) :
    volume (Metric.closedBall x r) = (.ofReal r) ^ finrank ℝ E *
      .ofReal (sqrt π ^ finrank ℝ E / Gamma (finrank ℝ E / 2 + 1))

{E : Type u_1}
[NormedAddCommGroup E]
[InnerProductSpace ℝ E]
[FiniteDimensional ℝ E]
[MeasurableSpace E]
[BorelSpace E]
[Nontrivial E]
(x : E)
(r : ℝ)

MeasureTheory.volume (Metric.closedBall x r) =
  ENNReal.ofReal r ^ FiniteDimensional.finrank ℝ E *
    ENNReal.ofReal (√Real.pi ^ FiniteDimensional.finrank ℝ E / Real.Gamma (↑(FiniteDimensional.finrank ℝ E) / 2 + 1))


theorem WCovBy.Ioc_subset (h : a ⩿ b) : Ioc a b ⊆ {b}

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


/-- Given a point, a bounded subset is included in some ball around this point -/
theorem isBounded_iff_subset_closedBall (c : α) : IsBounded s ↔ ∃ r, s ⊆ closedBall c r

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

Bornology.IsBounded s ↔ ∃ r, s ⊆ Metric.closedBall c r


/-- Finite dimensionality is preserved under linear equivalence. -/
protected theorem finiteDimensional (f : V ≃ₗ[K] V₂) [FiniteDimensional K V] :
    FiniteDimensional K V₂

{K : Type u}
{V : Type v}
[DivisionRing K]
[AddCommGroup V]
[Module K V]
{V₂ : Type v'}
[AddCommGroup V₂]
[Module K V₂]
(f : V ≃ₗ[K] V₂)
[FiniteDimensional K V]