/-- Special case of the sandwich theorem: if the norm of `f` is eventually bounded by a real
function `a` which tends to `0`, then `f` tends to `1` (neutral element of `SeminormedGroup`).
In this pair of lemmas (`squeeze_one_norm'` and `squeeze_one_norm`), following a convention of
similar lemmas in `Topology.MetricSpace.Basic` and `Topology.Algebra.Order`, the `'` version is
phrased using "eventually" and the non-`'` version is phrased absolutely. -/
@[to_additive "Special case of the sandwich theorem: if the norm of `f` is eventually bounded by a
real function `a` which tends to `0`, then `f` tends to `0`. In this pair of lemmas
(`squeeze_zero_norm'` and `squeeze_zero_norm`), following a convention of similar lemmas in
`Topology.MetricSpace.Pseudo.Defs` and `Topology.Algebra.Order`, the `'` version is phrased using
\"eventually\" and the non-`'` version is phrased absolutely."]
theorem squeeze_one_norm' {f : α → E} {a : α → ℝ} {t₀ : Filter α} (h : ∀ᶠ n in t₀, ‖f n‖ ≤ a n)
    (h' : Tendsto a t₀ (𝓝 0)) : Tendsto f t₀ (𝓝 1)

{α : Type u_3}
{E : Type u_6}
[SeminormedGroup E]
{f : α → E}
{a : α → ℝ}
{t₀ : Filter α}
(h : ∀ᶠ (n : α) in t₀, ‖f n‖ ≤ a n)
(h' : Filter.Tendsto a t₀ (𝓝 0))


@[simp] theorem Fin.univ_image_get [DecidableEq α] (l : List α) :
    Finset.univ.image l.get = l.toFinset

{α : Type u_1}
[DecidableEq α]
(l : List α)

Finset.image l.get Finset.univ = l.toFinset


@[to_additive]
theorem Supports.mono (h : s ⊆ t) (hs : Supports G s b) : Supports G t b

{G : Type u_1}
{α : Type u_3}
{β : Type u_4}
[SMul G α]
[SMul G β]
{s t : Set α}
{b : β}
(h : s ⊆ t)
(hs : MulAction.Supports G s b)


theorem IsInt.nonneg_to_eq {α} [Ring α] {n}
    {a a' : α} (h : IsInt a (.ofNat n)) (e : n = a') : a = a'

(h : Mathlib.Meta.NormNum.IsInt a (Int.ofNat n))


/-- We can shrink a set to any smaller size. -/
lemma exists_subset_card_eq {n : ℕ} (hns : n ≤ s.ncard) : ∃ t ⊆ s, t.ncard = n

{α : Type u_1}
{s : Set α}
{n : ℕ}
(hns : n ≤ s.ncard)


theorem finite_quotient_span_sub_one [hcycl : IsCyclotomicExtension {p ^ (k + 1)} ℚ K]
    (hζ : IsPrimitiveRoot ζ ↑(p ^ (k + 1))) :
    Finite (𝓞 K ⧸ Ideal.span {hζ.toInteger - 1})


protected theorem linearIsometry_apply_dfinsupp_sum_single (W₀ : Π₀ i : ι, G i) :
    hV.linearIsometry (W₀.sum (lp.single 2)) = W₀.sum fun i => V i

{ι : Type u_1}
{𝕜 : Type u_2}
[RCLike 𝕜]
{E : Type u_3}
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[cplt : CompleteSpace E]
{G : ι → Type u_4}
[(i : ι) → NormedAddCommGroup (G i)]
[(i : ι) → InnerProductSpace 𝕜 (G i)]
{V : (i : ι) → G i →ₗᵢ[𝕜] E}
(hV : OrthogonalFamily 𝕜 G V)
(W₀ : Π₀ (i : ι), G i)

hV.linearIsometry (W₀.sum (lp.single 2)) = W₀.sum fun i => ⇑(V i)


/--
The equivalence between `LocallyConstant X Z` and `LocallyConstant Y Z` given a
homeomorphism `X ≃ₜ Y`
-/
@[simps]
def congrLeft [TopologicalSpace Y] (e : X ≃ₜ Y) : LocallyConstant X Z ≃ LocallyConstant Y Z

{X : Type u_1}
{Y : Type u_2}
{Z : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
(e : X ≃ₜ Y)
(g : LocallyConstant X Z)

(LocallyConstant.congrLeft e) g = LocallyConstant.comap e.symm.toContinuousMap g


theorem le_of_max_le_left {a b c : α} (h : max a b ≤ c) : a ≤ c

{α : Type u}
[LinearOrder α]
{a b c : α}
(h : max a b ≤ c)


@[simp]
theorem eqToIso_refl {n : ℕ} (h : n = n) : X.eqToIso h = Iso.refl _

(X : CategoryTheory.CosimplicialObject C)

X.eqToIso h = CategoryTheory.Iso.refl (X.obj (SimplexCategory.mk n))


theorem ContMDiffWithinAt.prod_mk {f : M → M'} {g : M → N'} (hf : ContMDiffWithinAt I I' n f s x)
    (hg : ContMDiffWithinAt I J' n g s x) :
    ContMDiffWithinAt I (I'.prod J') n (fun x => (f x, g x)) 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' : Type u_14}
[NormedAddCommGroup F']
[NormedSpace 𝕜 F']
{G' : Type u_15}
[TopologicalSpace G']
{J' : ModelWithCorners 𝕜 F' G'}
{N' : Type u_16}
[TopologicalSpace N']
[ChartedSpace G' N']
{s : Set M}
{x : M}
{n : ℕ∞}
{f : M → M'}
{g : M → N'}
(hf : ContMDiffWithinAt I I' n f s x)
(hg : ContMDiffWithinAt I J' n g s x)


@[fun_prop]
theorem Differentiable.clm_comp (hc : Differentiable 𝕜 c) (hd : Differentiable 𝕜 d) :
    Differentiable 𝕜 fun y => (c y).comp (d y)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{H : Type u_6}
[NormedAddCommGroup H]
[NormedSpace 𝕜 H]
{c : E → G →L[𝕜] H}
{d : E → F →L[𝕜] G}
(hc : Differentiable 𝕜 c)
(hd : Differentiable 𝕜 d)


theorem transGen_swap : TransGen (swap r) a b ↔ TransGen r b a

{α : Type u_1}
{r : α → α → Prop}
{a b : α}

Relation.TransGen (Function.swap r) a b ↔ Relation.TransGen r b a


@[csimp] theorem scanl_eq_scanlTR : @scanl = @scanlTR


theorem bot_eq [Preorder α] {a : α} : (⊥ : { x : α // a ≤ x }) = ⟨a, le_rfl⟩


lemma mapsTo_of_subsingleton [Subsingleton α] (f : α → α) (s : Set α) : MapsTo f s s

{α : Type u_1}
[Subsingleton α]
(f : α → α)
(s : Set α)


@[simp]
theorem bot_def : (⊥ : Setoid α).Rel = (· = ·)


theorem Antivary.comp_antitone_left (h : Antivary f g) (hf : Antitone f') : Monovary (f' ∘ f) g

{ι : Type u_1}
{α : Type u_3}
{β : Type u_4}
{γ : Type u_5}
[Preorder α]
[Preorder β]
[Preorder γ]
{f : ι → α}
{f' : α → γ}
{g : ι → β}
(h : Antivary f g)
(hf : Antitone f')


/-- Given a morphism of presheaves of commutative rings `φ : S ⟶ F.op ⋙ R`,
this is the type of relative `φ`-derivation of a presheaf of `R`-modules `M`. -/
@[ext]
structure Derivation where
  /-- the underlying additive map `R.obj X →+ M.obj X` of a derivation -/
  d {X : Dᵒᵖ} : R.obj X →+ M.obj X
  d_mul {X : Dᵒᵖ} (a b : R.obj X) : d (a * b) = a • d b + b • d a := by aesop_cat
  d_map {X Y : Dᵒᵖ} (f : X ⟶ Y) (x : R.obj X) :
    d (R.map f x) = M.map f (d x) := by aesop_cat
  d_app {X : Cᵒᵖ} (a : S.obj X) : d (φ.app X a) = 0 := by aesop_cat

{M : PresheafOfModules (R ⋙ CategoryTheory.forget₂ CommRingCat RingCat)}

self.d (a * b) = a • self.d b + b • self.d a


theorem tsum_op [T2Space α] :
    ∑' x, op (f x) = op (∑' x, f x)

{α : Type u_1}
{β : Type u_2}
[AddCommMonoid α]
[TopologicalSpace α]
{f : β → α}
[T2Space α]

∑' (x : β), MulOpposite.op (f x) = MulOpposite.op (∑' (x : β), f x)


@[simp] theorem count_append (a : α) : ∀ l₁ l₂, count a (l₁ ++ l₂) = count a l₁ + count a l₂

{α : Type u_1}
[DecidableEq α]
(a : α)
(l₁ l₂ : List α)

List.count a (l₁ ++ l₂) = List.count a l₁ + List.count a l₂


/-- Translating a function by right-multiplication does not change its integral with respect to a
right-invariant measure. -/
@[to_additive
      "Translating a function by right-addition does not change its integral with respect to a
      right-invariant measure."] -- Porting note: was `@[simp]`
theorem integral_mul_right_eq_self [IsMulRightInvariant μ] (f : G → E) (g : G) :
    (∫ x, f (x * g) ∂μ) = ∫ x, f x ∂μ

{G : Type u_4}
{E : Type u_5}
[MeasurableSpace G]
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{μ : MeasureTheory.Measure G}
[Group G]
[MeasurableMul G]
[μ.IsMulRightInvariant]
(f : G → E)
(g : G)

∫ (x : G), f (x * g) ∂μ = ∫ (x : G), f x ∂μ


theorem hasColimit_multispan_comp : HasColimit (D.diagram.multispan ⋙ F)


lemma lintegral_nnnorm_le (f : X →ᵇ E) :
    ∫⁻ x, ‖f x‖₊ ∂μ ≤ ‖f‖₊ * (μ Set.univ)

{X : Type u_1}
[MeasurableSpace X]
[TopologicalSpace X]
(μ : MeasureTheory.Measure X)
{E : Type u_2}
[NormedAddCommGroup E]
(f : X →ᵇ E)

∫⁻ (x : X), ↑‖f x‖₊ ∂μ ≤ ↑‖f‖₊ * μ Set.univ


@[simp]
theorem swap_obj_inl (X : C) : (swap C D).obj (inl X) = inr X

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

(CategoryTheory.Sum.swap C D).obj (Sum.inl X) = Sum.inr X


theorem restrict_mass (μ : FiniteMeasure Ω) (A : Set Ω) : (μ.restrict A).mass = μ A

{Ω : Type u_1}
[MeasurableSpace Ω]
(μ : MeasureTheory.FiniteMeasure Ω)
(A : Set Ω)


@[simp]
theorem map_apply {α β} (f : α → β) (g : Poly α) (v) : map f g v = g (v ∘ f)

{α : Type u_4}
{β : Type u_5}
(f : α → β)
(g : Poly α)
(v : β → ℕ)


/-- The automorphism of the polynomial algebra given by `p(X) ↦ p(X+t)`,
  with inverse `p(X) ↦ p(X-t)`. -/
@[simps!]
def algEquivAevalXAddC {R} [CommRing R] (t : R) : R[X] ≃ₐ[R] R[X]

{R : Type u_3}
[CommRing R]
(t : R)
(a : R[X])

(Polynomial.algEquivAevalXAddC t) a = (Polynomial.aeval (Polynomial.X + Polynomial.C t)) a


@[to_additive (attr := fun_prop) ContinuousAt.nnnorm]
theorem ContinuousAt.nnnorm' {a : α} (h : ContinuousAt f a) : ContinuousAt (fun x => ‖f x‖₊) a

{α : Type u_3}
{E : Type u_6}
[SeminormedGroup E]
[TopologicalSpace α]
{f : α → E}
{a : α}
(h : ContinuousAt f a)


lemma exists_ne_zero {x : V} (hx : x ≠ 0) :
    ∃ f : V →L[R] R, f x ≠ 0

{R : Type u_1}
{V : Type u_2}
[Ring R]
[AddCommGroup V]
[TopologicalSpace V]
[TopologicalSpace R]
[Module R V]
[SeparatingDual R V]
{x : V}
(hx : x ≠ 0)


/-- The colimit of `J : SingleObj G ⥤ Type u` is equivalent to the quotient of
`J.obj (SingleObj.star G)` by the induced action. -/
@[simps!]
noncomputable def Types.colimitEquivQuotient :
    colimit J ≃ MulAction.orbitRel.Quotient G (J.obj (SingleObj.star G))

(J : CategoryTheory.Functor (CategoryTheory.SingleObj G) (Type u))

∀ (a : CategoryTheory.Limits.colimit J),
  (CategoryTheory.Limits.SingleObj.Types.colimitEquivQuotient J) a =
    Quot.lift (fun p => ⟦p.snd⟧) ⋯ ((CategoryTheory.Limits.Types.colimitEquivQuot J) a)


@[to_additive]
theorem one_div_div : 1 / (a / b) = b / a

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


theorem filter_eq_iInf (p : SeminormFamily 𝕜 E ι) :
    p.moduleFilterBasis.toFilterBasis.filter = ⨅ i, (𝓝 0).comap (p i)

{𝕜 : Type u_1}
{E : Type u_5}
{ι : Type u_8}
[NormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[Nonempty ι]
(p : SeminormFamily 𝕜 E ι)

AddGroupFilterBasis.toFilterBasis.filter = ⨅ i, Filter.comap (⇑(p i)) (𝓝 0)


protected theorem norm_sub_norm_compl_sub_single (hp : 0 < p.toReal) (f : lp E p) (s : Finset α) :
    ‖f‖ ^ p.toReal - ‖f - ∑ i ∈ s, lp.single p i (f i)‖ ^ p.toReal =
      ∑ i ∈ s, ‖f i‖ ^ p.toReal

{α : Type u_1}
{E : α → Type u_2}
{p : ℝ≥0∞}
[(i : α) → NormedAddCommGroup (E i)]
[DecidableEq α]
(hp : 0 < p.toReal)
(f : ↥(lp E p))
(s : Finset α)

‖f‖ ^ p.toReal - ‖f - ∑ i ∈ s, lp.single p i (↑f i)‖ ^ p.toReal = ∑ i ∈ s, ‖↑f i‖ ^ p.toReal


@[reassoc (attr := simp)]
lemma comm_f {K L : HomologicalComplex₂ C c₁ c₂} (f : K ⟶ L) (i₁ i₁' : I₁) (i₂ : I₂) :
    (f.f i₁).f i₂ ≫ (L.d i₁ i₁').f i₂ = (K.d i₁ i₁').f i₂ ≫ (f.f i₁').f i₂


theorem image_mem_nhds (hf : ApproximatesLinearOn f f' s c) (f'symm : f'.NonlinearRightInverse)
    {x : E} (hs : s ∈ 𝓝 x) (hc : Subsingleton F ∨ c < f'symm.nnnorm⁻¹) : f '' s ∈ 𝓝 (f x)


/-- The graph of the inverse generates a `LinearPMap`. -/
theorem mem_inverse_graph_snd_eq_zero (x : F × E)
    (hv : x ∈ (graph f).map (LinearEquiv.prodComm R E F))
    (hv' : x.fst = 0) : x.snd = 0

(hv : x ∈ Submodule.map (LinearEquiv.prodComm R E F) f.graph)


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


theorem IsClosedMap.restrictPreimage (H : IsClosedMap f) (s : Set β) :
    IsClosedMap (s.restrictPreimage f)

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
{f : α → β}
(H : IsClosedMap f)
(s : Set β)


/-- The functor `ComposableArrows C m ⥤ ComposableArrows C n` obtained by precomposition with
a functor `Fin (n + 1) ⥤ Fin (m + 1)`. -/
@[simps!]
def whiskerLeftFunctor (Φ : Fin (n + 1) ⥤ Fin (m + 1)) :
    ComposableArrows C m ⥤ ComposableArrows C n

(Φ : CategoryTheory.Functor (Fin (n + 1)) (Fin (m + 1)))

∀ {X Y : CategoryTheory.ComposableArrows C m} (f : X ⟶ Y) (X_1 : Fin (n + 1)),
  ((CategoryTheory.ComposableArrows.whiskerLeftFunctor Φ).map f).app X_1 = f.app (Φ.obj X_1)


@[simp]
theorem coe_toSubmodule (S : Subalgebra R A) : (toSubmodule S : Set A) = S

{R : Type u}
{A : Type v}
[CommSemiring R]
[Semiring A]
[Algebra R A]
(S : Subalgebra R A)


@[simp] lemma coe_mul [MulZeroClass R] [ContinuousMul R] (f g : C(X, R)₀) : ⇑(f * g) = f * g

{X : Type u_1}
{R : Type u_2}
[Zero X]
[TopologicalSpace X]
[TopologicalSpace R]
[MulZeroClass R]
[ContinuousMul R]
(f g : ContinuousMapZero X R)


protected theorem IsSemisimple.aeval (p : K[X]) : (aeval f p).IsSemisimple

{M : Type u_2}
[AddCommGroup M]
{K : Type u_3}
[Field K]
[Module K M]
{f : Module.End K M}
[FiniteDimensional K M]
(hf : f.IsSemisimple)
(p : K[X])


@[simp]
theorem top_sdiff' (a : α) : ⊤ \ a = ￢a

{α : Type u_2}
[CoheytingAlgebra α]
(a : α)


/-- Weighted generalized mean inequality, version for two elements of `ℝ≥0` and real exponents. -/
theorem rpow_arith_mean_le_arith_mean2_rpow (w₁ w₂ z₁ z₂ : ℝ≥0) (hw' : w₁ + w₂ = 1) {p : ℝ}
    (hp : 1 ≤ p) : (w₁ * z₁ + w₂ * z₂) ^ p ≤ w₁ * z₁ ^ p + w₂ * z₂ ^ p


@[simp]
lemma tensorHom_app_apply {K K' L L' : SSet.{u}} (f : K ⟶ K') (g : L ⟶ L')
    {Δ : SimplexCategoryᵒᵖ} (x : (K ⊗ L).obj Δ) :
    (f ⊗ g).app Δ x = ⟨f.app Δ x.1, g.app Δ x.2⟩

{K K' L L' : SSet}
(f : K ⟶ K')
(g : L ⟶ L')
{Δ : SimplexCategoryᵒᵖ}
(x : (K ⊗ L).obj Δ)

(f ⊗ g).app Δ x = (f.app Δ x.1, g.app Δ x.2)


theorem support_add_subset {x y : HahnSeries Γ R} : support (x + y) ⊆ support x ∪ support y

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


theorem stableUnderInverse {F₁ F₂ : C ⥤ D} (app : ∀ X, F₁.obj X ⟶ F₂.obj X) :
    (naturalityProperty app).StableUnderInverse

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


/-- The length of the List returned by `List.leftpad n a l` is equal
  to the larger of `n` and `l.length` -/
@[simp]
theorem leftpad_length (n : Nat) (a : α) (l : List α) :
    (leftpad n a l).length = max n l.length

{α : Type u_1}
(n : Nat)
(a : α)
(l : List α)

(List.leftpad n a l).length = max n l.length


@[simp]
theorem conj_symm_apply [AddGroup G] (g h : G) : (conj g).symm h = -g + h + g

(AddEquiv.symm (AddAut.conj g)) h = -g + h + g


@[simp]
theorem dualAnnihilator_dualCoannihilator_eq {W : Subspace K V} :
    W.dualAnnihilator.dualCoannihilator = W

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

(Submodule.dualAnnihilator W).dualCoannihilator = W


theorem of_iso_pullback (h : CommSq fst snd f g) [HasPullback f g] (i : P ≅ pullback f g)
    (w₁ : i.hom ≫ pullback.fst _ _ = fst) (w₂ : i.hom ≫ pullback.snd _ _ = snd) :
      IsPullback fst snd f g

(i : P ≅ CategoryTheory.Limits.pullback f g)

(w₁ : i.hom ≫ CategoryTheory.Limits.pullback.fst f g = fst)

(w₂ : i.hom ≫ CategoryTheory.Limits.pullback.snd f g = snd)


@[to_additive]
theorem le_iff_exists_mul : a ≤ b ↔ ∃ c, b = a * c

{α : Type u}
[CanonicallyOrderedCommMonoid α]
{a b : α}


/--
The functor taking `(E : ℰ) (c : Cᵒᵖ)` to the homset `(A.obj C ⟶ E)`. It is shown in `L_adjunction`
that this functor has a left adjoint (provided `E` has colimits) given by taking colimits over
categories of elements.
In the case where `ℰ = Cᵒᵖ ⥤ Type u` and `A = yoneda`, this functor is isomorphic to the identity.

Defined as in [MM92], Chapter I, Section 5, Theorem 2.
-/
@[simps!]
def restrictedYoneda : ℰ ⥤ Cᵒᵖ ⥤ Type v₁

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

∀ {X_1 Y : Cᵒᵖ} (f : X_1 ⟶ Y) (a : (CategoryTheory.yoneda.obj X).obj (A.op.obj X_1)),
  ((CategoryTheory.Presheaf.restrictedYoneda A).obj X).map f a = CategoryTheory.CategoryStruct.comp (A.map f.unop) a


/-- A set is affinely independent if and only if the differences from
a base point in that set are linearly independent. -/
theorem affineIndependent_set_iff_linearIndependent_vsub {s : Set P} {p₁ : P} (hp₁ : p₁ ∈ s) :
    AffineIndependent k (fun p => p : s → P) ↔
      LinearIndependent k (fun v => v : (fun p => (p -ᵥ p₁ : V)) '' (s \ {p₁}) → V)

(k : Type u_1)
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{s : Set P}
{p₁ : P}
(hp₁ : p₁ ∈ s)

(AffineIndependent k fun p => ↑p) ↔ LinearIndependent k fun (v : ↑((fun p => p -ᵥ p₁) '' (s \ {p₁}))) => ↑v


theorem derivative_apply (p : R[X]) : derivative p = p.sum fun n a => C (a * n) * X ^ (n - 1)

Polynomial.derivative p = p.sum fun n a => Polynomial.C (a * ↑n) * Polynomial.X ^ (n - 1)


@[to_additive]
theorem edist_mul_mul_le (a₁ a₂ b₁ b₂ : E) :
    edist (a₁ * a₂) (b₁ * b₂) ≤ edist a₁ b₁ + edist a₂ b₂

{E : Type u_3}
[SeminormedCommGroup E]
(a₁ a₂ b₁ b₂ : E)


theorem CPolynomialAt.add (hf : CPolynomialAt 𝕜 f x) (hg : CPolynomialAt 𝕜 g x) :
    CPolynomialAt 𝕜 (f + g) x

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


@[simp]
theorem expMapCircle_arg (z : circle) : expMapCircle (arg z) = z


theorem evalComp_cons {f g h i j : C} (α : f ⟶ g) (η : g ⟶ h) {ηs : h ⟶ i} {θ : i ⟶ j} {ι : h ⟶ j}
    (pf_ι : ηs ≫ θ = ι)  :
    (α ≫ η ≫ ηs) ≫ θ = α ≫ η ≫ ι

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

CategoryTheory.CategoryStruct.comp (CategoryTheory.CategoryStruct.comp α (CategoryTheory.CategoryStruct.comp η ηs)) θ =
  CategoryTheory.CategoryStruct.comp α (CategoryTheory.CategoryStruct.comp η ι)


@[to_additive]
theorem prod_lt_one' (h : ∀ i ∈ s, f i ≤ 1) (hs : ∃ i ∈ s, f i < 1) : ∏ i ∈ s, f i < 1

{ι : Type u_1}
{M : Type u_4}
[OrderedCancelAddCommMonoid M]
{f : ι → M}
{s : Finset ι}
(h : ∀ i ∈ s, f i ≤ 0)
(hs : ∃ i ∈ s, f i < 0)


theorem sized_falling : (falling k 𝒜 : Set (Finset α)).Sized k

{α : Type u_2}
[DecidableEq α]
(k : ℕ)
(𝒜 : Finset (Finset α))


theorem NF.snd' {e n a} : NF (oadd e n a) → NFBelow a (repr e)


lemma hurwitzZetaEven_residue_one (a : UnitAddCircle) :
    Tendsto (fun s ↦ (s - 1) * hurwitzZetaEven a s) (𝓝[≠] 1) (𝓝 1)

Filter.Tendsto (fun s => (s - 1) * HurwitzZeta.hurwitzZetaEven a s) (𝓝[≠] 1) (𝓝 1)


theorem isomorphisms.infer_property [hf : IsIso f] : (isomorphisms C) f

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


/-- `α` and `β` are isometric if there is an isometric bijection between them. -/
-- Porting note(#5171): was @[nolint has_nonempty_instance]
structure IsometryEquiv (α : Type u) (β : Type v) [PseudoEMetricSpace α] [PseudoEMetricSpace β]
    extends α ≃ β where
  isometry_toFun : Isometry toFun

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


theorem map_dvd_iff {a b} : f a ∣ f b ↔ a ∣ b

{α : Type u_1}
{β : Type u_2}
[Semigroup α]
[Semigroup β]
{F : Type u_3}
[EquivLike F α β]
[MulEquivClass F α β]
(f : F)
{a b : α}


lemma closedBall_eq_of_mem {x y: X} {r : ℝ} (h : y ∈ closedBall x r) :
    closedBall x r = closedBall y r

{X : Type u_1}
[PseudoMetricSpace X]
[IsUltrametricDist X]
{x y : X}
{r : ℝ}
(h : y ∈ Metric.closedBall x r)

Metric.closedBall x r = Metric.closedBall y r


@[trans]
theorem IsTheta.trans {f : α → E} {g : α → F'} {k : α → G} (h₁ : f =Θ[l] g) (h₂ : g =Θ[l] k) :
    f =Θ[l] k

{α : Type u_1}
{E : Type u_3}
{G : Type u_5}
{F' : Type u_7}
[Norm E]
[Norm G]
[SeminormedAddCommGroup F']
{l : Filter α}
{f : α → E}
{g : α → F'}
{k : α → G}
(h₁ : f =Θ[l] g)
(h₂ : g =Θ[l] k)


/-- The extension of `Γ₀ : ChainComplex C ℕ ⥤ SimplicialObject C`
on the idempotent completions. It shall be an equivalence of categories
for any additive category `C`. -/
@[simps!]
def Γ₂ : Karoubi (ChainComplex C ℕ) ⥤ Karoubi (SimplicialObject C)

(P : CategoryTheory.Idempotents.Karoubi (ChainComplex C ℕ))

∀ {X Y : SimplexCategoryᵒᵖ} (θ : X ⟶ Y),
  (AlgebraicTopology.DoldKan.Γ₂.obj P).X.map θ = AlgebraicTopology.DoldKan.Γ₀.Obj.map P.X θ


@[simp]
theorem snd_sub [Sub R] [Sub M] (x₁ x₂ : tsze R M) : (x₁ - x₂).snd = x₁.snd - x₂.snd

{R : Type u}
{M : Type v}
[Sub R]
[Sub M]
(x₁ x₂ : tsze R M)


@[simp]
theorem compl_not_mem_iff : sᶜ ∉ f ↔ s ∈ f

{α : Type u}
{f : Ultrafilter α}
{s : Set α}

sᶜ ∉ f ↔ s ∈ f


theorem has_compl_iff {a} : d.Has aᶜ ↔ d.Has a

{α : Type u_1}
(d : MeasurableSpace.DynkinSystem α)
{a : Set α}


/-- The braiding isomorphism can be passed through a map by swapping the order. -/
@[reassoc]
theorem biprod.braid_natural {W X Y Z : C} (f : X ⟶ Y) (g : Z ⟶ W) :
    biprod.map f g ≫ (biprod.braiding _ _).hom = (biprod.braiding _ _).hom ≫ biprod.map g f

CategoryTheory.Limits.biprod.map f g ≫ (CategoryTheory.Limits.biprod.braiding Y W).hom =
  (CategoryTheory.Limits.biprod.braiding X Z).hom ≫ CategoryTheory.Limits.biprod.map g f


theorem Algebra.isIntegral_trace [FiniteDimensional L F] {x : F} (hx : IsIntegral R x) :
    IsIntegral R (Algebra.trace L F x)

{R : Type u_1}
[CommRing R]
{L : Type u_5}
[Field L]
{F : Type u_6}
[Field F]
[Algebra R L]
[Algebra L F]
[Algebra R F]
[IsScalarTower R L F]
[FiniteDimensional L F]
{x : F}
(hx : IsIntegral R x)


theorem gramSchmidt_inv_triangular (v : ι → E) {i j : ι} (hij : i < j) :
    ⟪gramSchmidt 𝕜 v j, v i⟫ = 0

(𝕜 : Type u_1)
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{ι : Type u_3}
[LinearOrder ι]
[LocallyFiniteOrderBot ι]
[IsWellOrder ι fun x x_1 => x < x_1]
(v : ι → E)
{i j : ι}
(hij : i < j)


theorem natDegree_pos_of_not_isUnit_of_dvd_monic (ha : ¬IsUnit a) (hap : a ∣ p) : 0 < natDegree a

{R : Type u}
[CommSemiring R]
{a p : R[X]}
(hp : p.Monic)
(ha : ¬IsUnit a)
(hap : a ∣ p)


@[simp]
theorem rightUnitor_hom (X : C) : (ρ_ X).hom = coprod.desc (𝟙 _) (initial.to X)

(CategoryTheory.MonoidalCategory.rightUnitor X).hom =
  CategoryTheory.Limits.coprod.desc (CategoryTheory.CategoryStruct.id X) (CategoryTheory.Limits.initial.to X)


theorem Iic_subset_Iic_union_Ioc : Iic b ⊆ Iic a ∪ Ioc a b

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


@[reassoc (attr := simp), elementwise (attr := simp)]
theorem imageSubobject_arrow_comp : factorThruImageSubobject f ≫ (imageSubobject f).arrow = f

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

CategoryTheory.Limits.factorThruImageSubobject f ≫ (CategoryTheory.Limits.imageSubobject f).arrow = f


/-- Adjoining a finite subset is compact in the lattice of intermediate fields. -/
theorem adjoin_finite_isCompactElement {S : Set E} (h : S.Finite) : IsCompactElement (adjoin F S)

{F : Type u_1}
[Field F]
{E : Type u_2}
[Field E]
[Algebra F E]
{S : Set E}
(h : S.Finite)

CompleteLattice.IsCompactElement (IntermediateField.adjoin F S)


theorem Fin.univ_def (n : ℕ) : (univ : Finset (Fin n)) = ⟨List.finRange n, List.nodup_finRange n⟩

Finset.univ = { val := ↑(List.finRange n), nodup := ⋯ }


theorem neg_apply (v : VectorMeasure α M) (i : Set α) : (-v) i = -v i

{α : Type u_1}
{m : MeasurableSpace α}
{M : Type u_3}
[AddCommGroup M]
[TopologicalSpace M]
[TopologicalAddGroup M]
(v : MeasureTheory.VectorMeasure α M)
(i : Set α)


theorem Ordered.insertNew {path : Path α} (hp : path.Ordered cmp) (vp : path.RootOrdered cmp v) :
    (path.insertNew v).Ordered cmp

(hp : Batteries.RBNode.Path.Ordered cmp path)

(vp : Batteries.RBNode.Path.RootOrdered cmp path v)

Batteries.RBNode.Ordered cmp (path.insertNew v)


@[simp]
theorem single_zero_smul_eq_smul (Γ) [OrderedAddCommMonoid Γ] [AddAction Γ Γ']
    [IsOrderedCancelVAdd Γ Γ'] [MulZeroClass R] [SMulWithZero R V] {r : R}
    {x : HahnModule Γ' R V} :
    (HahnSeries.single (0 : Γ) r) • x = r • x

{Γ' : Type u_2}
{R : Type u_3}
{V : Type u_4}
[PartialOrder Γ']
[AddCommMonoid V]
(Γ : Type u_5)
[OrderedAddCommMonoid Γ]
[AddAction Γ Γ']
[IsOrderedCancelVAdd Γ Γ']
[MulZeroClass R]
[SMulWithZero R V]
{r : R}
{x : HahnModule Γ' R V}


theorem exists_path_through_family' {n : ℕ} (p : Fin (n + 1) → X) :
    ∃ (γ : Path (p 0) (p n)) (t : Fin (n + 1) → I), ∀ i, γ (t i) = p i

{X : Type u_1}
[TopologicalSpace X]
[PathConnectedSpace X]
{n : ℕ}
(p : Fin (n + 1) → X)

∃ γ t, ∀ (i : Fin (n + 1)), γ (t i) = p i


theorem map₂_map_left (m : γ → β → δ) (n : α → γ) :
    map₂ m (f.map n) g = map₂ (fun a b => m (n a) b) f g

{α : Type u_1}
{β : Type u_3}
{γ : Type u_5}
{δ : Type u_7}
{f : Filter α}
{g : Filter β}
(m : γ → β → δ)
(n : α → γ)

Filter.map₂ m (Filter.map n f) g = Filter.map₂ (fun a b => m (n a) b) f g


theorem dvd_gcd_mul_gcd_iff_dvd_mul : x ∣ gcd x n * gcd x m ↔ x ∣ n * m


theorem lift_type_eq {α : Type u} {β : Type v} {r s} [IsWellOrder α r] [IsWellOrder β s] :
    lift.{max v w} (type r) = lift.{max u w} (type s) ↔ Nonempty (r ≃r s)

{α : Type u}
{β : Type v}
{r : α → α → Prop}
{s : β → β → Prop}
[IsWellOrder α r]
[IsWellOrder β s]

Ordinal.lift.{max v w, u} (Ordinal.type r) = Ordinal.lift.{max u w, v} (Ordinal.type s) ↔ Nonempty (r ≃r s)


theorem op_iInf (S : ι → Subring R) : (iInf S).op = ⨅ i, (S i).op

{ι : Sort u_1}
{R : Type u_2}
[Ring R]
(S : ι → Subring R)


/-- The minimal polynomial of `1` is `X - 1`. -/
@[simp]
theorem one : minpoly A (1 : B) = X - 1

(A : Type u_1)
(B : Type u_2)
[Field A]
[Ring B]
[Algebra A B]
[Nontrivial B]


theorem div_def (x y : ℤ[i]) :
    x / y = ⟨round ((x * star y).re / norm y : ℚ), round ((x * star y).im / norm y : ℚ)⟩

x / y = { re := round (↑(x * star y).re / ↑(Zsqrtd.norm y)), im := round (↑(x * star y).im / ↑(Zsqrtd.norm y)) }


theorem toReal_le_pi (θ : Angle) : θ.toReal ≤ π


/-- Any integrable function can be approximated by bounded continuous functions,
version in terms of `∫`. -/
theorem Integrable.exists_boundedContinuous_integral_sub_le [μ.WeaklyRegular] {f : α → E}
    (hf : Integrable f μ) {ε : ℝ} (hε : 0 < ε) :
    ∃ g : α →ᵇ E, (∫ x, ‖f x - g x‖ ∂μ) ≤ ε ∧ Integrable g μ

{α : Type u_1}
[TopologicalSpace α]
[NormalSpace α]
[MeasurableSpace α]
[BorelSpace α]
{E : Type u_2}
[NormedAddCommGroup E]
{μ : MeasureTheory.Measure α}
[NormedSpace ℝ E]
[μ.WeaklyRegular]
{f : α → E}
(hf : MeasureTheory.Integrable f μ)
{ε : ℝ}
(hε : 0 < ε)

∃ g, ∫ (x : α), ‖f x - g x‖ ∂μ ≤ ε ∧ MeasureTheory.Integrable (⇑g) μ


theorem prod_dist_eq_of_L2 (x y : WithLp 2 (α × β)) :
    dist x y = √(dist x.fst y.fst ^ 2 + dist x.snd y.snd ^ 2)

{α : Type u_2}
{β : Type u_3}
[SeminormedAddCommGroup α]
[SeminormedAddCommGroup β]
(x y : WithLp 2 (α × β))

dist x y = √(dist x.1 y.1 ^ 2 + dist x.2 y.2 ^ 2)


theorem setSeq_mono ⦃m n : ℕ⦄ (h : m ≤ n) : setSeq hf U_mem n ⊆ setSeq hf U_mem m

{α : Type u}
[uniformSpace : UniformSpace α]
{f : Filter α}
(hf : Cauchy f)
{U : ℕ → Set (α × α)}
(U_mem : ∀ (n : ℕ), U n ∈ 𝓤 α)
⦃m n : ℕ⦄
(h : m ≤ n)

SequentiallyComplete.setSeq hf U_mem n ⊆ SequentiallyComplete.setSeq hf U_mem m


@[simp, norm_cast]
theorem toENNReal_add (m n : ℕ∞) : ↑(m + n) = (m + n : ℝ≥0∞)


theorem and_eq_false_eq_eq_false_or_eq_false (a b : Bool) :
    ((a && b) = false) = (a = false ∨ b = false)


/-- `DFinsupp.single a b` is injective in `a`. For the statement that it is injective in `b`, see
`DFinsupp.single_injective` -/
theorem single_left_injective {b : ∀ i : ι, β i} (h : ∀ i, b i ≠ 0) :
    Function.Injective (fun i => single i (b i) : ι → Π₀ i, β i)

{ι : Type u}
{β : ι → Type v}
[DecidableEq ι]
[(i : ι) → Zero (β i)]
{b : (i : ι) → β i}
(h : ∀ (i : ι), b i ≠ 0)

Function.Injective fun i => DFinsupp.single i (b i)


/-- See `tsub_lt_tsub_iff_left_of_le` for a stronger statement in a linear order. -/
theorem tsub_lt_tsub_iff_left_of_le_of_le [ContravariantClass α α (· + ·) (· < ·)] (h₁ : b ≤ a)
    (h₂ : c ≤ a) : a - b < a - c ↔ c < b

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

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

[ContravariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x < x_1]


@[to_additive]
lemma orbit_subgroup_subset (H : Subgroup G) (a : α) : orbit H a ⊆ orbit G a

{G : Type u_1}
{α : Type u_2}
[AddGroup G]
[AddAction G α]
(H : AddSubgroup G)
(a : α)

AddAction.orbit (↥H) a ⊆ AddAction.orbit G a


/-- If `I` is a `ModelWithCorners.Boundaryless` model, then it is a homeomorphism. -/
@[simps (config := {simpRhs := true})]
def ModelWithCorners.toHomeomorph {𝕜 : Type*} [NontriviallyNormedField 𝕜] {E : Type*}
    [NormedAddCommGroup E] [NormedSpace 𝕜 E] {H : Type*} [TopologicalSpace H]
    (I : ModelWithCorners 𝕜 E H) [I.Boundaryless] : H ≃ₜ E

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
(I : ModelWithCorners 𝕜 E H)
[I.Boundaryless]

∀ (a : E), I.toHomeomorph.symm a = ↑I.symm a


theorem foldl_data_eq_map (l : List α) (acc : Array β) (G : α → β) :
    (l.foldl (fun acc a => acc.push (G a)) acc).data = acc.data ++ l.map G

{α : Type u_1}
{β : Type u_2}
(l : List α)
(acc : Array β)
(G : α → β)

(List.foldl (fun acc a => acc.push (G a)) acc l).data = acc.data ++ List.map G l


lemma _root_.exists_squarefree_dvd_pow_of_ne_zero {x : R} (hx : x ≠ 0) :
    ∃ (y : R) (n : ℕ), Squarefree y ∧ y ∣ x ∧ x ∣ y ^ n

{R : Type u_1}
[CancelCommMonoidWithZero R]
[UniqueFactorizationMonoid R]
{x : R}
(hx : x ≠ 0)


@[simp]
theorem lift_symm_apply (F : MonoidAlgebra k G →ₐ[k] A) (x : G) :
    (lift k G A).symm F x = F (single x 1)

{k : Type u₁}
{G : Type u₂}
[CommSemiring k]
[Monoid G]
{A : Type u₃}
[Semiring A]
[Algebra k A]
(F : MonoidAlgebra k G →ₐ[k] A)
(x : G)

((MonoidAlgebra.lift k G A).symm F) x = F (MonoidAlgebra.single x 1)


/-- If `p` is a prime that does not divide `n`,
then the minimal polynomials of a primitive `n`-th root of unity `μ`
and of `μ ^ p` are the same. -/
theorem minpoly_eq_pow {p : ℕ} [hprime : Fact p.Prime] (hdiv : ¬p ∣ n) :
    minpoly ℤ μ = minpoly ℤ (μ ^ p)

{n : ℕ}
{K : Type u_1}
[CommRing K]
{μ : K}
(h : IsPrimitiveRoot μ n)
[IsDomain K]
[CharZero K]
{p : ℕ}
[hprime : Fact (Nat.Prime p)]
(hdiv : ¬p ∣ n)


theorem drop_append_of_le_length {l₁ l₂ : List α} {n : Nat} (h : n ≤ l₁.length) :
    (l₁ ++ l₂).drop n = l₁.drop n ++ l₂

{α : Type u_1}
{l₁ l₂ : List α}
{n : Nat}
(h : n ≤ l₁.length)

List.drop n (l₁ ++ l₂) = List.drop n l₁ ++ l₂


@[to_additive IsLowerSet.thickening]
protected theorem IsLowerSet.thickening' (hs : IsLowerSet s) (ε : ℝ) :
    IsLowerSet (thickening ε s)

{α : Type u_1}
[NormedOrderedGroup α]
{s : Set α}
(hs : IsLowerSet s)
(ε : ℝ)


@[to_additive (attr := simp, to_additive) (reorder := 1 2, 4 5) ofLex_smul']
theorem pow_ofLex [Pow α β] (a : α) (b : Lex β) : a ^ ofLex b = a ^ b

{β : Type u_2}
{α : Type u_1}
[VAdd β α]
(b : Lex β)
(a : α)


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

(c : CategoryTheory.CostructuredArrow (CategoryTheory.Functor.const J) F)

((CategoryTheory.Limits.Cone.equivCostructuredArrow F).inverse.obj c).π = c.hom


@[to_additive (attr := simp)]
lemma insertNth_div [∀ j, Div (α j)] (i : Fin (n + 1)) (x y : α i)(p q : ∀ j, α (i.succAbove j)) :
    i.insertNth (x / y) (p / q) = i.insertNth x p / i.insertNth y q

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

i.insertNth (x - y) (p - q) = i.insertNth x p - i.insertNth y q


lemma isSplittingField_AdjoinRoot_X_pow_sub_C :
    haveI := Fact.mk H
    letI : Algebra K K[n√a] := inferInstance
    IsSplittingField K K[n√a] (X ^ n - C a)

(H : Irreducible (Polynomial.X ^ n - Polynomial.C a))

Polynomial.IsSplittingField K K[n√a] (Polynomial.X ^ n - Polynomial.C a)


@[simp]
lemma homMk₅_app_five :
    (homMk₅ app₀ app₁ app₂ app₃ app₄ app₅ w₀ w₁ w₂ w₃ w₄).app ⟨5, by valid⟩ = app₅

{f g : CategoryTheory.ComposableArrows C 5}

(w₀ :
  CategoryTheory.CategoryStruct.comp (f.map' 0 1 ⋯ ⋯) app₁ = CategoryTheory.CategoryStruct.comp app₀ (g.map' 0 1 ⋯ ⋯))

(w₁ :
  CategoryTheory.CategoryStruct.comp (f.map' 1 2 ⋯ ⋯) app₂ = CategoryTheory.CategoryStruct.comp app₁ (g.map' 1 2 ⋯ ⋯))

(w₂ :
  CategoryTheory.CategoryStruct.comp (f.map' 2 3 ⋯ ⋯) app₃ = CategoryTheory.CategoryStruct.comp app₂ (g.map' 2 3 ⋯ ⋯))

(w₃ :
  CategoryTheory.CategoryStruct.comp (f.map' 3 4 ⋯ ⋯) app₄ = CategoryTheory.CategoryStruct.comp app₃ (g.map' 3 4 ⋯ ⋯))

(w₄ :
  CategoryTheory.CategoryStruct.comp (f.map' 4 5 ⋯ ⋯) app₅ = CategoryTheory.CategoryStruct.comp app₄ (g.map' 4 5 ⋯ ⋯))

(CategoryTheory.ComposableArrows.homMk₅ app₀ app₁ app₂ app₃ app₄ app₅ w₀ w₁ w₂ w₃ w₄).app ⟨5, ⋯⟩ = app₅


@[simp]
theorem preimage_coe_Iio_top : (some : α → WithTop α) ⁻¹' Iio ⊤ = univ


@[simp high]
theorem inner_orthogonalProjection_eq_of_mem_left [HasOrthogonalProjection K] (u : K) (v : E) :
    ⟪u, orthogonalProjection K v⟫ = ⟪(u : E), v⟫

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
(K : Submodule 𝕜 E)
[HasOrthogonalProjection K]
(u : ↥K)
(v : E)

⟪u, (orthogonalProjection K) v⟫_𝕜 = ⟪↑u, v⟫_𝕜


lemma le_addContent_diff (m : AddContent C) (hC : IsSetRing C) (hs : s ∈ C) (ht : t ∈ C) :
    m s - m t ≤ m (s \ t)

{α : Type u_1}
{C : Set (Set α)}
{s t : Set α}
(m : MeasureTheory.AddContent C)
(hC : MeasureTheory.IsSetRing C)
(hs : s ∈ C)
(ht : t ∈ C)


/-- Closure of a `NonUnitalSubring` `S` equals `S`. -/
theorem closure_eq (s : NonUnitalSubring R) : closure (s : Set R) = s

{R : Type u}
[NonUnitalNonAssocRing R]
(s : NonUnitalSubring R)


/--
`D` has *effectively enough objects with respect to the functor `F` if every object has an
effective presentation.
-/
class EffectivelyEnough : Prop where
  /-- For every `X : D`, there exists an object `p` of `C` with an effective epi `F.obj p ⟶ X`. -/
  presentation : ∀ (X : D), Nonempty (F.EffectivePresentation X)

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Category.{u_4, u_2} D]
{F : CategoryTheory.Functor C D}
[self : F.EffectivelyEnough]
(X : D)


@[simp]
theorem coe_bot [Bot β] : ⇑(⊥ : InfHom α β) = ⊥

{α : Type u_3}
{β : Type u_4}
[Inf α]
[SemilatticeInf β]
[Bot β]


@[simp]
theorem fst_comp_prod : (fst S T).comp (f.prod g) = f

{R : Type u_3}
{S : Type u_5}
{T : Type u_7}
[NonUnitalNonAssocSemiring R]
[NonUnitalNonAssocSemiring S]
[NonUnitalNonAssocSemiring T]
(f : R →ₙ+* S)
(g : R →ₙ+* T)

(NonUnitalRingHom.fst S T).comp (f.prod g) = f


@[simp, nolint simpNF]
theorem quotientInfEquivSupQuotient_apply_mk (p p' : Submodule R M) (x : p) :
    let map := inclusion (le_sup_left : p ≤ p ⊔ p')
    quotientInfEquivSupQuotient p p' (Submodule.Quotient.mk x) =
      @Submodule.Quotient.mk R (p ⊔ p' : Submodule R M) _ _ _ (comap (p ⊔ p').subtype p') (map x)

{R : Type u_1}
{M : Type u_2}
[Ring R]
[AddCommGroup M]
[Module R M]
(p p' : Submodule R M)
(x : ↥p)

let map := Submodule.inclusion ⋯;
(LinearMap.quotientInfEquivSupQuotient p p') (Submodule.Quotient.mk x) = Submodule.Quotient.mk (map x)


theorem Filter.HasBasis.uniformEquicontinuous_iff {κ₁ κ₂ : Type*} {p₁ : κ₁ → Prop}
    {s₁ : κ₁ → Set (β × β)} {p₂ : κ₂ → Prop} {s₂ : κ₂ → Set (α × α)} {F : ι → β → α}
    (hβ : (𝓤 β).HasBasis p₁ s₁) (hα : (𝓤 α).HasBasis p₂ s₂) :
    UniformEquicontinuous F ↔
      ∀ k₂, p₂ k₂ → ∃ k₁, p₁ k₁ ∧ ∀ x y, (x, y) ∈ s₁ k₁ → ∀ i, (F i x, F i y) ∈ s₂ k₂

{ι : Type u_1}
{α : Type u_7}
{β : Type u_9}
[uα : UniformSpace α]
[uβ : UniformSpace β]
{κ₁ : Type u_13}
{κ₂ : Type u_14}
{p₁ : κ₁ → Prop}
{s₁ : κ₁ → Set (β × β)}
{p₂ : κ₂ → Prop}
{s₂ : κ₂ → Set (α × α)}
{F : ι → β → α}
(hβ : (uniformity β).HasBasis p₁ s₁)
(hα : (uniformity α).HasBasis p₂ s₂)

UniformEquicontinuous F ↔
  ∀ (k₂ : κ₂), p₂ k₂ → ∃ k₁, p₁ k₁ ∧ ∀ (x y : β), (x, y) ∈ s₁ k₁ → ∀ (i : ι), (F i x, F i y) ∈ s₂ k₂


@[simp]
theorem tensor_f {X₁ Y₁ X₂ Y₂ : Center C} (f : X₁ ⟶ Y₁) (g : X₂ ⟶ Y₂) : (f ⊗ g).f = f.f ⊗ g.f

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


@[to_additive (attr := simp, aesop safe apply (rule_sets := [finsetNonempty]))]
theorem one_nonempty : (1 : Finset α).Nonempty


@[to_additive existing]
theorem norm_multiset_prod_le (m : Multiset E) : ‖m.prod‖ ≤ (m.map fun x => ‖x‖).sum

{E : Type u_6}
[SeminormedCommGroup E]
(m : Multiset E)

‖m.prod‖ ≤ (Multiset.map (fun x => ‖x‖) m).sum


theorem ContDiff.comp₃ {g : E₁ × E₂ × E₃ → G} {f₁ : F → E₁} {f₂ : F → E₂} {f₃ : F → E₃}
    (hg : ContDiff 𝕜 n g) (hf₁ : ContDiff 𝕜 n f₁) (hf₂ : ContDiff 𝕜 n f₂) (hf₃ : ContDiff 𝕜 n f₃) :
    ContDiff 𝕜 n fun x => g (f₁ x, f₂ x, f₃ x)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type uG}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{n : ℕ∞}
{E₁ : Type u_3}
{E₂ : Type u_4}
{E₃ : Type u_5}
[NormedAddCommGroup E₁]
[NormedAddCommGroup E₂]
[NormedAddCommGroup E₃]
[NormedSpace 𝕜 E₁]
[NormedSpace 𝕜 E₂]
[NormedSpace 𝕜 E₃]
{g : E₁ × E₂ × E₃ → G}
{f₁ : F → E₁}
{f₂ : F → E₂}
{f₃ : F → E₃}
(hg : ContDiff 𝕜 n g)
(hf₁ : ContDiff 𝕜 n f₁)
(hf₂ : ContDiff 𝕜 n f₂)
(hf₃ : ContDiff 𝕜 n f₃)


theorem iterate_le_of_map_le_add_int {x : ℝ} {m : ℤ} (h : f x ≤ x + m) (n : ℕ) :
    f^[n] x ≤ x + n * m

(f : CircleDeg1Lift)
{x : ℝ}
{m : ℤ}
(h : f x ≤ x + ↑m)
(n : ℕ)


/-- See also `Finset.map_prodComm_antidiagonal`. -/
@[simp] theorem map_swap_antidiagonal [AddCommMonoid A] [HasAntidiagonal A] {n : A} :
    (antidiagonal n).map ⟨Prod.swap, Prod.swap_injective⟩ = antidiagonal n

{A : Type u_1}
[AddCommMonoid A]
[Finset.HasAntidiagonal A]
{n : A}

Finset.map { toFun := Prod.swap, inj' := ⋯ } (Finset.antidiagonal n) = Finset.antidiagonal n


@[to_additive (attr := simp)]
theorem rel_mk {s : Setoid M} {h a b} : Con.mk s h a b ↔ r a b

{h : ∀ {w x y z : M}, Setoid.r w x → Setoid.r y z → Setoid.r (w + y) (x + z)}

{ toSetoid := s, add' := h } a b ↔ Setoid.r a b


theorem comp_toThinSkeleton (F : C ⥤ D) : F ⋙ toThinSkeleton D = toThinSkeleton C ⋙ map F

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

F.comp (CategoryTheory.toThinSkeleton D) = (CategoryTheory.toThinSkeleton C).comp (CategoryTheory.ThinSkeleton.map F)


@[simp, norm_cast]
theorem ofReal_add (r s : ℝ) : ((r + s : ℝ) : ℂ) = r + s


@[to_additive]
theorem uniformity_eq_comap_nhds_one_swapped :
    𝓤 α = comap (fun x : α × α => x.1 / x.2) (𝓝 (1 : α))

(α : Type u_1)
[UniformSpace α]
[Group α]
[UniformGroup α]

𝓤 α = Filter.comap (fun x => x.1 / x.2) (𝓝 1)


theorem volume_regionBetween_eq_lintegral' (hf : Measurable f) (hg : Measurable g)
    (hs : MeasurableSet s) :
    μ.prod volume (regionBetween f g s) = ∫⁻ y in s, ENNReal.ofReal ((g - f) y) ∂μ

{α : Type u_1}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
{f g : α → ℝ}
{s : Set α}
(hf : Measurable f)
(hg : Measurable g)
(hs : MeasurableSet s)

(μ.prod MeasureTheory.volume) (regionBetween f g s) = ∫⁻ (y : α) in s, ENNReal.ofReal ((g - f) y) ∂μ


theorem nat_mul (h : LiouvilleWith p x) (hn : n ≠ 0) : LiouvilleWith p (n * x)

{p x : ℝ}
{n : ℕ}
(h : LiouvilleWith p x)
(hn : n ≠ 0)


theorem isUnital_auxGroup (i : N) :
    EckmannHilton.IsUnital (auxGroup i).mul (⟦const⟧ : HomotopyGroup N X x)

{N : Type u_1}
{X : Type u_2}
[TopologicalSpace X]
{x : X}
[DecidableEq N]
(i : N)


theorem multiplicity_eq_multiplicity_iff {a b : α} {c d : β} :
    multiplicity a b = multiplicity c d ↔ ∀ n : ℕ, a ^ n ∣ b ↔ c ^ n ∣ d

{α : Type u_1}
{β : Type u_2}
[Monoid α]
[Monoid β]
[DecidableRel fun x x_1 => x ∣ x_1]
[DecidableRel fun x x_1 => x ∣ x_1]
{a b : α}
{c d : β}

multiplicity a b = multiplicity c d ↔ ∀ (n : ℕ), a ^ n ∣ b ↔ c ^ n ∣ d


theorem agree : f.range = { x | h x = g x }

↑(MonoidHom.range f) = {x | (Grp.SurjectiveOfEpiAuxs.h f) x = (Grp.SurjectiveOfEpiAuxs.g f) x}


@[simp]
theorem iInf_toSubmodule {ι : Sort*} (S : ι → Subalgebra R A) :
    toSubmodule (⨅ i, S i) = ⨅ i, toSubmodule (S i)

{R : Type u}
{A : Type v}
[CommSemiring R]
[Semiring A]
[Algebra R A]
{ι : Sort u_1}
(S : ι → Subalgebra R A)

Subalgebra.toSubmodule (⨅ i, S i) = ⨅ i, Subalgebra.toSubmodule (S i)


/-- The pointwise distance is controlled by the distance between functions, by definition. -/
theorem dist_apply_le_dist (x : α) : dist (f x) (g x) ≤ dist f g

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


theorem SatisfiesM_mapIdxM [Monad m] [LawfulMonad m] (as : Array α) (f : Fin as.size → α → m β)
    (motive : Nat → Prop) (h0 : motive 0)
    (p : Fin as.size → β → Prop)
    (hs : ∀ i, motive i.1 → SatisfiesM (p i · ∧ motive (i + 1)) (f i as[i])) :
    SatisfiesM
      (fun arr => motive as.size ∧ ∃ eq : arr.size = as.size, ∀ i h, p ⟨i, h⟩ arr[i])
      (Array.mapIdxM as f)

(hs : ∀ (i : Fin as.size), motive ↑i → SatisfiesM (fun x => p i x ∧ motive (↑i + 1)) (f i as[i]))

(h₂ : ∀ (i : Nat) (h : i < as.size) (h' : i < bs.size), p ⟨i, h⟩ bs[i])

SatisfiesM (fun arr => motive as.size ∧ ∃ eq, ∀ (i_1 : Nat) (h : i_1 < as.size), p ⟨i_1, h⟩ arr[i_1])
  (Array.mapIdxM.map as f i j h bs)


@[simp]
theorem map_id' (M : Matrix m n α) : M.map (·) = M

{m : Type u_2}
{n : Type u_3}
{α : Type v}
(M : Matrix m n α)


protected theorem codisjoint_iff [OrderTop α] [OrderTop β] {x y : α × β} :
    Codisjoint x y ↔ Codisjoint x.1 y.1 ∧ Codisjoint x.2 y.2

{α : Type u_1}
{β : Type u_2}
[PartialOrder α]
[PartialOrder β]
[OrderTop α]
[OrderTop β]
{x y : α × β}


/-- The identity functor on `C`, viewed as a functor from the
monoidal opposite of `C` to `C`, upgraded to a braided functor. -/
@[simps!] def unmopBraidedFunctor : BraidedFunctor Cᴹᵒᵖ C

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

∀ {X Y : Cᴹᵒᵖ} (f : X ⟶ Y), (CategoryTheory.MonoidalOpposite.unmopBraidedFunctor C).map f = f.unmop


lemma leftHomologyMap_op (φ : S₁ ⟶ S₂) [S₁.HasLeftHomology] [S₂.HasLeftHomology] :
    (leftHomologyMap φ).op = S₂.rightHomologyOpIso.inv ≫ rightHomologyMap (opMap φ) ≫
      S₁.rightHomologyOpIso.hom

(CategoryTheory.ShortComplex.leftHomologyMap φ).op =
  CategoryTheory.CategoryStruct.comp S₂.rightHomologyOpIso.inv
    (CategoryTheory.CategoryStruct.comp
      (CategoryTheory.ShortComplex.rightHomologyMap (CategoryTheory.ShortComplex.opMap φ)) S₁.rightHomologyOpIso.hom)


@[to_additive (attr := simp) sub_mem_addCenter]
theorem div_mem_center (ha : a ∈ Set.center M) (hb : b ∈ Set.center M) : a / b ∈ Set.center M

{M : Type u_1}
[SubtractionMonoid M]
{a b : M}
(ha : a ∈ Set.addCenter M)
(hb : b ∈ Set.addCenter M)


/-- The composition of morphisms of short complexes. -/
@[simps]
def Hom.comp (φ₁₂ : Hom S₁ S₂) (φ₂₃ : Hom S₂ S₃) : Hom S₁ S₃

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

(φ₁₂.comp φ₂₃).τ₂ = CategoryTheory.CategoryStruct.comp φ₁₂.τ₂ φ₂₃.τ₂


/-- The antisymmetrization relation as an equivalence relation. -/
@[simps]
def AntisymmRel.setoid : Setoid α

(α : Type u_1)
(r : α → α → Prop)
[IsPreorder α r]
(a b : α)


∀ {α : Sort u_1} {a b : α}, HEq a b ↔ a = b


protected theorem Embedding.separableSpace [TopologicalSpace α]
    [TopologicalSpace β] [SecondCountableTopology β] {f : α → β} (hf : Embedding f) :
    TopologicalSpace.SeparableSpace α

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
[SecondCountableTopology β]
{f : α → β}
(hf : Embedding f)


/-- If the second of three points is strictly between the other two, the angle at that point
is π. -/
theorem _root_.Sbtw.angle₁₂₃_eq_pi {p₁ p₂ p₃ : P} (h : Sbtw ℝ p₁ p₂ p₃) : ∠ p₁ p₂ p₃ = π

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{p₁ p₂ p₃ : P}
(h : Sbtw ℝ p₁ p₂ p₃)


theorem lor_comm (n m : ℕ) : n ||| m = m ||| n


theorem UniqueMDiffWithinAt.inter (hs : UniqueMDiffWithinAt I s x) (ht : t ∈ 𝓝 x) :
    UniqueMDiffWithinAt I (s ∩ t) x

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


@[simp] lemma toNat_pred_coe_of_pos {i : ℤ} (h : 0 < i) : ((i.toNat - 1 : ℕ) : ℤ) = i - 1


@[simp]
theorem sep_or : { x ∈ s | p x ∨ q x } = { x ∈ s | p x } ∪ { x ∈ s | q x }

{α : Type u}
{s : Set α}
{p q : α → Prop}

{x | x ∈ s ∧ (p x ∨ q x)} = {x | x ∈ s ∧ p x} ∪ {x | x ∈ s ∧ q x}


@[simp]
nonrec lemma d_app (d : M.Derivation' φ') {X : Dᵒᵖ} (a : S'.obj X) :
    d.d (φ'.app X a) = 0

{M : PresheafOfModules (R ⋙ CategoryTheory.forget₂ CommRingCat RingCat)}


/-- The angle at a point is nonnegative. -/
nonrec theorem angle_nonneg (p1 p2 p3 : P) : 0 ≤ ∠ p1 p2 p3

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
(p1 p2 p3 : P)


/-- Produce an association list for the finsupp over its support using choice. -/
@[simps]
noncomputable def toAList (f : α →₀ M) : AList fun _x : α => M

{α : Type u_1}
{M : Type u_2}
[Zero M]
(f : α →₀ M)

f.toAList.entries = List.map Prod.toSigma f.graph.toList


lemma LevyProkhorov.dist_def (μ ν : LevyProkhorov (ProbabilityMeasure Ω)) :
    dist μ ν = levyProkhorovDist μ.toMeasure ν.toMeasure

(μ ν : MeasureTheory.LevyProkhorov (MeasureTheory.ProbabilityMeasure Ω))

dist μ ν = MeasureTheory.levyProkhorovDist ↑μ ↑ν


@[to_additive (attr := simp)]
theorem fixedBy_one_eq_univ : fixedBy α (1 : M) = Set.univ

(α : Type u_1)
(M : Type u_3)
[AddMonoid M]
[AddAction M α]


/-- The lift of a supremum is the supremum of the lifts. -/
theorem lift_iSup {ι : Type v} {f : ι → Cardinal.{w}} (hf : BddAbove (range f)) :
    lift.{u} (iSup f) = ⨆ i, lift.{u} (f i)

{ι : Type v}
{f : ι → Cardinal.{w}}
(hf : BddAbove (Set.range f))

Cardinal.lift.{u, w} (iSup f) = ⨆ i, Cardinal.lift.{u, w} (f i)


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

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


theorem cross_apply (a b : Fin 3 → R) :
    a ×₃ b = ![a 1 * b 2 - a 2 * b 1, a 2 * b 0 - a 0 * b 2, a 0 * b 1 - a 1 * b 0]

{R : Type u_1}
[CommRing R]
(a b : Fin 3 → R)


lemma cfcₙHom_nonneg_iff {a : A} (ha : p a) {f : C(σₙ R a, R)₀} :
    0 ≤ cfcₙHom ha f ↔ 0 ≤ f

[∀ (α : Type u_1) [inst : Zero α] [inst_1 : TopologicalSpace α], StarOrderedRing C(α, R)₀]


theorem isSymmetric_id : (LinearMap.id : E →ₗ[𝕜] E).IsSymmetric

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]


lemma toSpec_preimage_basicOpen {f}
    (t : NumDenSameDeg 𝒜 (.powers f)) :
    (Opens.map (toSpec 𝒜 f).1.base).obj (sbo (.mk t)) =
      Opens.comap ⟨_, continuous_subtype_val⟩ (pbo t.num.1)

(t : HomogeneousLocalization.NumDenSameDeg 𝒜 (Submonoid.powers f))

(TopologicalSpace.Opens.map (AlgebraicGeometry.ProjectiveSpectrum.Proj.toSpec 𝒜 f).val.base).obj
    (PrimeSpectrum.basicOpen (HomogeneousLocalization.mk t)) =
  (TopologicalSpace.Opens.comap { toFun := Subtype.val, continuous_toFun := ⋯ }) (ProjectiveSpectrum.basicOpen 𝒜 ↑t.num)


@[fun_prop]
protected theorem differentiableWithinAt : DifferentiableWithinAt 𝕜 iso s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{x : E}
{s : Set E}
(iso : E ≃ₗᵢ[𝕜] F)


@[simp]
lemma preimage_image_eq (U : X.Opens) : f ⁻¹ᵁ f ''ᵁ U = U

[H : AlgebraicGeometry.IsOpenImmersion f]

(TopologicalSpace.Opens.map f.val.base).obj (f.opensFunctor.obj U) = U


theorem span_insert_eq_span (h : x ∈ span R s) : span R (insert x s) = span R s

{R : Type u_1}
{M : Type u_4}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{x : M}
{s : Set M}
(h : x ∈ Submodule.span R s)

Submodule.span R (insert x s) = Submodule.span R s


/-- The definition of `AffineIndependent`. -/
theorem affineIndependent_def (p : ι → P) :
    AffineIndependent k p ↔
      ∀ (s : Finset ι) (w : ι → k),
        ∑ i ∈ s, w i = 0 → s.weightedVSub p w = (0 : V) → ∀ i ∈ s, w i = 0

(k : Type u_1)
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{ι : Type u_4}
(p : ι → P)

AffineIndependent k p ↔ ∀ (s : Finset ι) (w : ι → k), ∑ i ∈ s, w i = 0 → (s.weightedVSub p) w = 0 → ∀ i ∈ s, w i = 0


/-- The opposite cone of the image of a cocone is the image of the opposite cone. -/
-- Porting note: removed @[simps (config := { rhsMd := semireducible })] and replaced with
@[simps!]
def mapCoconeOp {t : Cocone F} : (mapCocone G t).op ≅ mapCone G.op t.op

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{D : Type u₄}
[CategoryTheory.Category.{v₄, u₄} D]
{F : J ⥤ C}
(G : C ⥤ D)
{t : CategoryTheory.Limits.Cocone F}

(CategoryTheory.Functor.mapCoconeOp G).hom.hom = 𝟙 (Opposite.op (G.obj t.pt))


theorem map_toDual_max (s : Finset α) : s.max.map toDual = (s.image toDual).min

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

WithBot.map (⇑OrderDual.toDual) s.max = (Finset.image (⇑OrderDual.toDual) s).min


@[to_additive (attr := gcongr) neg_le_neg]
theorem inv_le_inv' : a ≤ b → b⁻¹ ≤ a⁻¹

{α : Type u}
[OrderedCommGroup α]
{a b : α}

a ≤ b → b⁻¹ ≤ a⁻¹


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

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


@[to_additive]
theorem union_mul : (s₁ ∪ s₂) * t = s₁ * t ∪ s₂ * t

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


/-- `Fact` version of the dimension of `ℂ` over `ℝ`, locally useful in the definition of the
circle. -/
theorem finrank_real_complex_fact : Fact (finrank ℝ ℂ = 2)

Fact (FiniteDimensional.finrank ℝ ℂ = 2)


@[simp]
theorem coe_id : ⇑(id : P →ᵃⁱ[𝕜] P) = _root_.id

{𝕜 : Type u_1}
{V : Type u_2}
{P : Type u_10}
[NormedField 𝕜]
[SeminormedAddCommGroup V]
[NormedSpace 𝕜 V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]


@[simp, aesop safe apply (rule_sets := [finsetNonempty])]
theorem nonempty_cons (h : a ∉ s) : (cons a s h).Nonempty

{α : Type u_1}
{s : Finset α}
{a : α}
(h : a ∉ s)


theorem lie_abelian_iff_equiv_lie_abelian {R : Type u} {L₁ : Type v} {L₂ : Type w} [CommRing R]
    [LieRing L₁] [LieRing L₂] [LieAlgebra R L₁] [LieAlgebra R L₂] (e : L₁ ≃ₗ⁅R⁆ L₂) :
    IsLieAbelian L₁ ↔ IsLieAbelian L₂


@[simp] theorem SatisfiesM_Except_eq : SatisfiesM (m := Except ε) p x ↔ ∀ a, x = .ok a → p a

∀ {α : Type u_2} {p : α → Prop} {x : Except ε α}, SatisfiesM p x ↔ ∀ (a : α), x = Except.ok a → p a


/-- The canonical isomorphism `(F ⋙ G).mapTriangle ≅ F.mapTriangle ⋙ G.mapTriangle`. -/
@[simps!]
def mapTriangleCompIso : (F ⋙ G).mapTriangle ≅ F.mapTriangle ⋙ G.mapTriangle

(X : CategoryTheory.Pretriangulated.Triangle C)

((F.mapTriangleCompIso G).inv.app X).hom₂ = CategoryTheory.CategoryStruct.id (G.obj (F.obj X.obj₂))


@[simp]
theorem invOfUnit_mul (φ : MvPowerSeries σ R) (u : Rˣ) (h : constantCoeff σ R φ = u) :
    invOfUnit φ u * φ = 1

(h : (MvPowerSeries.constantCoeff σ R) φ = ↑u)


theorem unsym_mul [Mul α] [Add α] [One α] [OfNat α 2] [Invertible (2 : α)] (a b : αˢʸᵐ) :
    unsym (a * b) = ⅟ 2 * (unsym a * unsym b + unsym b * unsym a)

{α : Type u_1}
[Mul α]
[Add α]
[One α]
[OfNat α 2]
[Invertible 2]
(a b : αˢʸᵐ)

SymAlg.unsym (a * b) = ⅟2 * (SymAlg.unsym a * SymAlg.unsym b + SymAlg.unsym b * SymAlg.unsym a)


theorem homEquiv_naturality_left (f : X' ⟶ X) (g : F.obj X ⟶ Y) :
    (adj.homEquiv X' Y) (F.map f ≫ g) = f ≫ (adj.homEquiv X Y) g

(adj : CategoryTheory.Adjunction.CoreHomEquiv F G)

(adj.homEquiv X' Y) (CategoryTheory.CategoryStruct.comp (F.map f) g) =
  CategoryTheory.CategoryStruct.comp f ((adj.homEquiv X Y) g)


theorem volume_preserving_equiv_pi : MeasurePreserving measurableEquivPi

MeasureTheory.MeasurePreserving (⇑Complex.measurableEquivPi) MeasureTheory.volume MeasureTheory.volume


theorem dif_ctx_congr {α : Sort u} {b c : Prop} [dec_b : Decidable b] [dec_c : Decidable c]
    {x : b → α} {u : c → α} {y : ¬b → α} {v : ¬c → α}
    (h_c : b ↔ c) (h_t : ∀ h : c, x (Iff.mpr h_c h) = u h)
    (h_e : ∀ h : ¬c, y (Iff.mpr (not_congr h_c) h) = v h) :
    @dite α b dec_b x y = @dite α c dec_c u v

{α : Sort u}
{b c : Prop}
[dec_b : Decidable b]
[dec_c : Decidable c]
{x : b → α}
{u : c → α}
{y : ¬b → α}
{v : ¬c → α}
(h_c : b ↔ c)
(h_t : ∀ (h : c), x ⋯ = u h)
(h_e : ∀ (h : ¬c), y ⋯ = v h)


@[fun_prop]
theorem hasFDerivAt_id (x : E) : HasFDerivAt id (id 𝕜 E) x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
(x : E)

HasFDerivAt id (ContinuousLinearMap.id 𝕜 E) x


lemma map_le_map_iff (hf : Function.Injective f) :
    N.map f ≤ N₂.map f ↔ N ≤ N₂

{R : Type u}
{L : Type v}
{M : Type w}
{M' : Type w₁}
[CommRing R]
[LieRing L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[AddCommGroup M']
[Module R M']
[LieRingModule L M']
{f : M →ₗ⁅R,L⁆ M'}
{N N₂ : LieSubmodule R L M}
(hf : Function.Injective ⇑f)

LieSubmodule.map f N ≤ LieSubmodule.map f N₂ ↔ N ≤ N₂


lemma exists_eventually_atBot [SemilatticeInf α] [Nonempty α] {r : α → β → Prop} :
    (∃ b, ∀ᶠ a in atBot, r a b) ↔ ∀ᶠ a₀ in atBot, ∃ b, ∀ a ≤ a₀, r a b

{α : Type u_3}
{β : Type u_4}
[SemilatticeInf α]
[Nonempty α]
{r : α → β → Prop}

(∃ b, ∀ᶠ (a : α) in Filter.atBot, r a b) ↔ ∀ᶠ (a₀ : α) in Filter.atBot, ∃ b, ∀ a ≤ a₀, r a b


theorem fixedField_fixingSubgroup [FiniteDimensional F E] [h : IsGalois F E] :
    IntermediateField.fixedField (IntermediateField.fixingSubgroup K) = K

{F : Type u_1}
[Field F]
{E : Type u_2}
[Field E]
[Algebra F E]
(K : IntermediateField F E)
[FiniteDimensional F E]
[h : IsGalois F E]

IntermediateField.fixedField K.fixingSubgroup = K


theorem injective_iff_injective_of_iUnion_eq_univ :
    Injective f ↔ ∀ i, Injective ((U i).restrictPreimage f)

{α : Type u_1}
{β : Type u_2}
{ι : Sort u_4}
{f : α → β}
{U : ι → Set β}
(hU : Set.iUnion U = Set.univ)

Function.Injective f ↔ ∀ (i : ι), Function.Injective ((U i).restrictPreimage f)


/-- If a binary function from a type equipped with a total relation `r` to a monoid is
  anti-symmetric (i.e. satisfies `f a b * f b a = 1`), in order to show it is multiplicative
  (i.e. satisfies `f a c = f a b * f b c`), we may assume `r a b` and `r b c` are satisfied.
  We allow restricting to a subset specified by a predicate `p`. -/
@[to_additive additive_of_isTotal "If a binary function from a type equipped with a total relation
`r` to an additive monoid is anti-symmetric (i.e. satisfies `f a b + f b a = 0`), in order to show
it is additive (i.e. satisfies `f a c = f a b + f b c`), we may assume `r a b` and `r b c` are
satisfied. We allow restricting to a subset specified by a predicate `p`."]
theorem multiplicative_of_isTotal (p : α → Prop) (hswap : ∀ {a b}, p a → p b → f a b * f b a = 1)
    (hmul : ∀ {a b c}, r a b → r b c → p a → p b → p c → f a c = f a b * f b c) {a b c : α}
    (pa : p a) (pb : p b) (pc : p c) : f a c = f a b * f b c

(f : α → α → β)

(hswap : ∀ {a b : α}, p a → p b → f a b + f b a = 0)

(hmul : ∀ {a b c : α}, r a b → r b c → p a → p b → p c → f a c = f a b + f b c)


theorem shiftRight_eq (n : Int) (s : Nat) : n >>> s = Int.shiftRight n s


@[simp]
theorem nhdsWithin_Ioo_eq_nhdsWithin_Ioi {a b : α} (h : a < b) : 𝓝[Ioo a b] a = 𝓝[>] a

{α : Type u}
[TopologicalSpace α]
[LinearOrder α]
[ClosedIciTopology α]
{a b : α}
(h : a < b)


/-- An integral domain is called a `ValuationRing` provided that for any pair
of elements `a b : A`, either `a` divides `b` or vice versa. -/
class ValuationRing (A : Type u) [CommRing A] [IsDomain A] : Prop where
  cond' : ∀ a b : A, ∃ c : A, a * c = b ∨ b * c = a

{A : Type u}
[CommRing A]
[IsDomain A]
[self : ValuationRing A]
(a b : A)


@[to_additive (attr := simp)]
theorem isUnit_mul_self_iff : IsUnit (a * a) ↔ IsUnit a


@[to_additive]
theorem mulSingle_op {g : I → Type*} [∀ i, One (g i)] (op : ∀ i, f i → g i)
    (h : ∀ i, op i 1 = 1) (i : I) (x : f i) :
    mulSingle i (op i x) = fun j => op j (mulSingle i x j)

{I : Type u}
{f : I → Type v₁}
[DecidableEq I]
[(i : I) → One (f i)]
{g : I → Type u_4}
[(i : I) → One (g i)]
(op : (i : I) → f i → g i)
(h : ∀ (i : I), op i 1 = 1)
(i : I)
(x : f i)

Pi.mulSingle i (op i x) = fun j => op j (Pi.mulSingle i x j)


theorem get_even : ∀ (n : ℕ) (s : Stream' α), get (even s) n = get s (2 * n)


@[to_additive]
protected theorem mul_one (x : R[S⁻¹]) : x * 1 = x

{R : Type u_1}
[AddMonoid R]
{S : AddSubmonoid R}
[AddOreLocalization.AddOreSet S]
(x : AddOreLocalization S R)


@[to_additive]
lemma ofUnits_inf (S T : Subgroup Mˣ) : (S ⊔ T).ofUnits = S.ofUnits ⊔ T.ofUnits

{M : Type u_1}
[Monoid M]
(S T : Subgroup Mˣ)


@[simp]
theorem coe_rangeRestrict (f : A →A[R] B) :
    (f.rangeRestrict : A →ₐ[R] (@AlgHom.range R A B  _ _ _ _ _ f)) =
      (f : A →ₐ[R] B).rangeRestrict

{R : Type u_1}
[CommSemiring R]
{A : Type u_2}
[Semiring A]
[TopologicalSpace A]
{B : Type u_3}
[Semiring B]
[TopologicalSpace B]
[Algebra R A]
[Algebra R B]
(f : A →A[R] B)


/-- The product of a strictly monotone function and a monotone function is strictly monotone. -/
@[to_additive add_monotone "The sum of a strictly monotone function and a monotone function is
strictly monotone."]
theorem StrictMono.mul_monotone' (hf : StrictMono f) (hg : Monotone g) :
    StrictMono fun x => f x * g x

[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]


lemma lt_succ_sqrt' (n : ℕ) : n < succ (sqrt n) ^ 2


lemma mul_left_injective_of_inv (A : Matrix m n α) (B : Matrix n m α) (h : A * B = 1) :
    Function.Injective (fun x : Matrix l m α => x * A)

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


@[simp]
lemma aeval_val_relation (i) : aeval P.val (P.relation i) = 0

{R : Type u}
{S : Type v}
[CommRing R]
[CommRing S]
[Algebra R S]
(P : Algebra.Presentation R S)
(i : P.rels)

(MvPolynomial.aeval P.val) (P.relation i) = 0


theorem npow_add (k n : ℕ) (x : M) : x ^ (k + n) = x ^ k * x ^ n

{M : Type u_1}
[MulOneClass M]
[Pow M ℕ]
[NatPowAssoc M]
(k n : ℕ)
(x : M)


theorem Directed.finset_le {r : α → α → Prop} [IsTrans α r] {ι} [hι : Nonempty ι] {f : ι → α}
    (D : Directed r f) (s : Finset ι) : ∃ z, ∀ i ∈ s, r (f i) (f z)

{α : Type u}
{r : α → α → Prop}
[IsTrans α r]
{ι : Type u_1}
[hι : Nonempty ι]
{f : ι → α}
(D : Directed r f)
(s : Finset ι)


theorem nhdsWithin_Ici_basis [TopologicalSpace α] [LinearOrder α] [OrderTopology α] [NoMaxOrder α]
    (a : α) : (𝓝[≥] a).HasBasis (fun u => a < u) fun u => Ico a u

{α : Type u}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
[NoMaxOrder α]
(a : α)

(𝓝[≥] a).HasBasis (fun u => a < u) fun u => Set.Ico a u


theorem op_eq_self_of_principal {op : Ordinal → Ordinal → Ordinal} {a o : Ordinal.{u}} (hao : a < o)
    (H : IsNormal (op a)) (ho : Principal op o) (ho' : IsLimit o) : op a o = o

{op : Ordinal.{u} → Ordinal.{u} → Ordinal.{u}}


/-- Special case of `map_compl` for boolean algebras. -/
theorem map_compl' (a : α) : f aᶜ = (f a)ᶜ

{F : Type u_1}
{α : Type u_3}
{β : Type u_4}
[BooleanAlgebra α]
[BooleanAlgebra β]
[FunLike F α β]
[BoundedLatticeHomClass F α β]
(f : F)
(a : α)


theorem le_tsub_iff_right (h : a ≤ c) : b ≤ c - a ↔ b + a ≤ c

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

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


theorem norm_max_aux₃ {f : ℂ → F} {z w : ℂ} {r : ℝ} (hr : dist w z = r)
    (hd : DiffContOnCl ℂ f (ball z r)) (hz : IsMaxOn (norm ∘ f) (ball z r) z) : ‖f w‖ = ‖f z‖

(hd : DiffContOnCl ℂ f (Metric.ball z r))

(hz : IsMaxOn (norm ∘ f) (Metric.ball z r) z)


theorem keys_kreplace (a : α) (b : β a) : ∀ l : List (Sigma β), (kreplace a b l).keys = l.keys

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


/-- Given a functor `p : 𝒳 ⥤ 𝒮`, an arrow `φ : a ⟶ b` in `𝒳` and an arrow `f : R ⟶ S` in `𝒮`,
`p.IsHomLift f φ` expresses the fact that `φ` lifts `f` through `p`.
This is often drawn as:
```
  a --φ--> b
  -        -
  |        |
  v        v
  R --f--> S
``` -/
class Functor.IsHomLift {R S : 𝒮} {a b : 𝒳} (f : R ⟶ S) (φ : a ⟶ b) : Prop where
  cond : IsHomLiftAux p f φ

{𝒮 : Type u₁}
{𝒳 : Type u₂}
[CategoryTheory.Category.{v₁, u₂} 𝒳]
[CategoryTheory.Category.{v₂, u₁} 𝒮]
{p : 𝒳 ⥤ 𝒮}
{R S : 𝒮}
{a b : 𝒳}
{f : R ⟶ S}
{φ : a ⟶ b}
[self : p.IsHomLift f φ]


theorem biUnion_associatedPrimes_eq_zero_divisors [IsNoetherianRing R] :
    ⋃ p ∈ associatedPrimes R M, p = { r : R | ∃ x : M, x ≠ 0 ∧ r • x = 0 }

(R : Type u_1)
[CommRing R]
(M : Type u_2)
[AddCommGroup M]
[Module R M]
[IsNoetherianRing R]

⋃ p ∈ associatedPrimes R M, ↑p = {r | ∃ x, x ≠ 0 ∧ r • x = 0}


theorem det_eq_of_forall_row_eq_smul_add_pred_aux {n : ℕ} (k : Fin (n + 1)) :
    ∀ (c : Fin n → R) (_hc : ∀ i : Fin n, k < i.succ → c i = 0)
      {M N : Matrix (Fin n.succ) (Fin n.succ) R} (_h0 : ∀ j, M 0 j = N 0 j)
      (_hsucc : ∀ (i : Fin n) (j), M i.succ j = N i.succ j + c i * M (Fin.castSucc i) j),
      det M = det N

(_hc : ∀ (i : Fin n), k < i.succ → c i = 0)

(_h0 : ∀ (j : Fin n.succ), M 0 j = N 0 j)

(_hsucc : ∀ (i : Fin n) (j : Fin n.succ), M i.succ j = N i.succ j + c i * M i.castSucc j)


@[to_additive (attr := gcongr) add_le_add_right]
theorem mul_le_mul_right' [i : CovariantClass α α (swap (· * ·)) (· ≤ ·)] {b c : α} (bc : b ≤ c)
    (a : α) :
    b * a ≤ c * a

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


theorem zero_powerlt {a : Cardinal} (h : a ≠ 0) : 0 ^< a = 1


@[simp] theorem encard_eq_top_iff : s.encard = ⊤ ↔ s.Infinite


@[to_additive]
lemma NormedCommGroup.cauchySeq_iff [Nonempty α] [SemilatticeSup α] {u : α → E} :
    CauchySeq u ↔ ∀ ε > 0, ∃ N, ∀ m, N ≤ m → ∀ n, N ≤ n → ‖u m / u n‖ < ε

{α : Type u_1}
{E : Type u_3}
[SeminormedGroup E]
[Nonempty α]
[SemilatticeSup α]
{u : α → E}

CauchySeq u ↔ ∀ ε > 0, ∃ N, ∀ (m : α), N ≤ m → ∀ (n : α), N ≤ n → ‖u m / u n‖ < ε


@[to_additive sum_nsmul_assoc]
lemma prod_pow_eq_pow_sum  (s : Finset ι) (f : ι → ℕ) (a : β) :
    ∏ i ∈ s, a ^ f i = a ^ ∑ i ∈ s, f i

{ι : Type u_1}
{β : Type u_4}
[AddCommMonoid β]
(s : Finset ι)
(f : ι → ℕ)
(a : β)


/-- A useful consequence of the Lebesgue number lemma: given any compact set `K` contained in an
open set `U`, we can find an (open) entourage `V` such that the ball of size `V` about any point of
`K` is contained in `U`. -/
theorem lebesgue_number_of_compact_open {K U : Set α} (hK : IsCompact K)
    (hU : IsOpen U) (hKU : K ⊆ U) : ∃ V ∈ 𝓤 α, IsOpen V ∧ ∀ x ∈ K, UniformSpace.ball x V ⊆ U

{α : Type ua}
[UniformSpace α]
{K U : Set α}
(hK : IsCompact K)
(hU : IsOpen U)
(hKU : K ⊆ U)


/-- If we (perhaps unintentionally) perform equational rewriting on
the target object of a morphism,
we can replace the resulting `_.mpr f` term by a composition with an `eqToHom`.

It may be advisable to introduce any necessary `eqToHom` morphisms manually,
rather than relying on this lemma firing.
-/
theorem congrArg_mpr_hom_right {X Y Z : C} (p : X ⟶ Y) (q : Z = Y) :
    (congrArg (fun W : C => X ⟶ W) q).mpr p = p ≫ eqToHom q.symm

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{X Y Z : C}
(p : X ⟶ Y)
(q : Z = Y)

⋯.mpr p = CategoryTheory.CategoryStruct.comp p (CategoryTheory.eqToHom ⋯)


/-- The induced scalar multiplication on
`colimit (F ⋙ forget₂ _ AddCommGrp)`. -/
@[simps]
noncomputable def coconePointSMul :
    R →+* End (colimit (F ⋙ forget₂ _ AddCommGrp))

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

(ModuleCat.HasColimit.coconePointSMul F) r =
  CategoryTheory.Limits.colimMap { app := fun j => (F.obj j).smul r, naturality := ⋯ }


theorem himp_inf_distrib (a b c : α) : a ⇨ b ⊓ c = (a ⇨ b) ⊓ (a ⇨ c)

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


@[simp]
theorem tan_neg : tan (-x) = -tan x


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

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

CategoryTheory.CategoryStruct.comp s.unit (CategoryTheory.Bicategory.whiskerLeft f η.right) = t.unit


@[simp]
theorem leibniz_pow (n : ℕ) : D (a ^ n) = n • a ^ (n - 1) • D a

{R : Type u_1}
{A : Type u_2}
{M : Type u_4}
[CommSemiring R]
[CommSemiring A]
[AddCommMonoid M]
[Algebra R A]
[Module A M]
[Module R M]
(D : Derivation R A M)
(a : A)
(n : ℕ)


@[aesop 10% apply (rule_sets := [Measurable])]
protected theorem aemeasurable {β} [Zero β] [MeasurableSpace β] [TopologicalSpace β]
    [PseudoMetrizableSpace β] [BorelSpace β] {f : α → β} (hf : AEFinStronglyMeasurable f μ) :
    AEMeasurable f μ

(hf : MeasureTheory.AEFinStronglyMeasurable f μ)


@[to_additive]
theorem Right.inv_le_self (h : 1 ≤ a) : a⁻¹ ≤ a

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


/-- The function `AddOpposite.op` is a multiplicative equivalence. -/
@[simps! (config := { fullyApplied := false, simpRhs := true })]
def opMulEquiv [Mul α] : α ≃* αᵃᵒᵖ


theorem and_not_self_iff (a : Prop) : a ∧ ¬a ↔ False


/-- A cone `c` on `F : J ⥤ C` lifts to a cone in `Over c.pt` with cone point `𝟙 c.pt`. -/
@[simps]
def Cone.toUnder {F : J ⥤ C} (c : Cone F) :
    Cone (c.toStructuredArrow ⋙ StructuredArrow.toUnder _ _)

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

c.toUnder.pt = CategoryTheory.Under.mk (CategoryTheory.CategoryStruct.id c.pt)


@[to_additive]
theorem snd_one : (1 : NonemptyInterval α).snd = 1


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

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
{X₀ X₁ : C}
(f : X₀ ⟶ X₁)
{i j k : Fin 2}
(hij : i ≤ j)
(hjk : j ≤ k)

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


@[to_additive]
theorem Nonempty.of_div_right : (s / t).Nonempty → t.Nonempty

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


/-- An extensionality lemma for `R ≃L[R] M`. -/
theorem ext₁ [TopologicalSpace R₁] {f g : R₁ ≃L[R₁] M₁} (h : f 1 = g 1) : f = g

{R₁ : Type u_1}
[Semiring R₁]
{M₁ : Type u_4}
[TopologicalSpace M₁]
[AddCommMonoid M₁]
[Module R₁ M₁]
[TopologicalSpace R₁]
{f g : R₁ ≃L[R₁] M₁}
(h : f 1 = g 1)


theorem RingHom.surjective (σ : R₁ →+* R₂) [t : RingHomSurjective σ] : Function.Surjective σ

{R₁ : Type u_1}
{R₂ : Type u_2}
[Semiring R₁]
[Semiring R₂]
(σ : R₁ →+* R₂)
[t : RingHomSurjective σ]


/-- Composition by continuous linear equivs on the left respects higher differentiability at a
point. -/
theorem ContinuousLinearEquiv.comp_contDiffAt_iff (e : F ≃L[𝕜] G) :
    ContDiffAt 𝕜 n (e ∘ f) x ↔ ContDiffAt 𝕜 n f x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type uG}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{f : E → F}
{x : E}
{n : ℕ∞}
(e : F ≃L[𝕜] G)

ContDiffAt 𝕜 n (⇑e ∘ f) x ↔ ContDiffAt 𝕜 n f x


@[norm_cast]
theorem coe_natCast (n : ℕ) : ((n : ℤ) : X q) = (n : X q)


theorem pointed_zero : ((0 : ProperCone 𝕜 E) : ConvexCone 𝕜 E).Pointed

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


theorem eq_of_comp_left_eq' (f g : X ⟶ Y)
    (w : (fun {Z} (h : Y ⟶ Z) => f ≫ h) = fun {Z} (h : Y ⟶ Z) => g ≫ h) : f = g

(w : (fun {Z} h => CategoryTheory.CategoryStruct.comp f h) = fun {Z} h => CategoryTheory.CategoryStruct.comp g h)


theorem comp_aeval {B : Type*} [CommSemiring B] [Algebra R B] (φ : S₁ →ₐ[R] B) :
    φ.comp (aeval f) = aeval fun i => φ (f i)

{R : Type u}
{S₁ : Type v}
{σ : Type u_1}
[CommSemiring R]
[CommSemiring S₁]
[Algebra R S₁]
(f : σ → S₁)
{B : Type u_2}
[CommSemiring B]
[Algebra R B]
(φ : S₁ →ₐ[R] B)

φ.comp (MvPolynomial.aeval f) = MvPolynomial.aeval fun i => φ (f i)


theorem natDegree_mul_C_eq_of_mul_eq_one {ai : R} (au : a * ai = 1) :
    (p * C a).natDegree = p.natDegree

{R : Type u}
{a : R}
[Semiring R]
{p : R[X]}
{ai : R}
(au : a * ai = 1)

(p * Polynomial.C a).natDegree = p.natDegree


theorem uniformity_basis_edist :
    (𝓤 α).HasBasis (fun ε : ℝ≥0∞ => 0 < ε) fun ε => { p : α × α | edist p.1 p.2 < ε }

(𝓤 α).HasBasis (fun ε => 0 < ε) fun ε => {p | edist p.1 p.2 < ε}


theorem ker_prod_ker_le_ker_coprod {M₂ : Type*} [AddCommGroup M₂] [Module R M₂] {M₃ : Type*}
    [AddCommGroup M₃] [Module R M₃] (f : M →ₗ[R] M₃) (g : M₂ →ₗ[R] M₃) :
    (ker f).prod (ker g) ≤ ker (f.coprod g)

{R : Type u}
{M : Type v}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{M₂ : Type u_3}
[AddCommGroup M₂]
[Module R M₂]
{M₃ : Type u_4}
[AddCommGroup M₃]
[Module R M₃]
(f : M →ₗ[R] M₃)
(g : M₂ →ₗ[R] M₃)

(LinearMap.ker f).prod (LinearMap.ker g) ≤ LinearMap.ker (f.coprod g)


@[to_additive]
theorem map_noncommProd [MonoidHomClass F α β] (s : Multiset α) (comm) (f : F) :
    f (s.noncommProd comm) = (s.map f).noncommProd (Multiset.map_noncommProd_aux s comm f)

{F : Type u_1}
{α : Type u_3}
{β : Type u_4}
[Monoid α]
[Monoid β]
[FunLike F α β]
[MonoidHomClass F α β]
(s : Multiset α)
(comm : {x | x ∈ s}.Pairwise Commute)
(f : F)

f (s.noncommProd comm) = (Multiset.map (⇑f) s).noncommProd ⋯


theorem mem_ordConnectedComponent : y ∈ ordConnectedComponent s x ↔ [[x, y]] ⊆ s

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

y ∈ s.ordConnectedComponent x ↔ [[x, y]] ⊆ s


@[to_additive]
theorem smul_opposite_mul {H : Subgroup G} (x g : G) (h : H.op) :
    h • (g * x) = g * h • x

{G : Type u_2}
[Group G]
{H : Subgroup G}
(x g : G)
(h : ↥H.op)


@[simp]
theorem snd_imK_dualNumberEquiv_symm (d : DualNumber (Quaternion R)) :
    (dualNumberEquiv.symm d).imK.snd = d.snd.imK

{R : Type u_1}
[CommRing R]
(d : DualNumber (Quaternion R))

TrivSqZeroExt.snd (Quaternion.dualNumberEquiv.symm d).imK = (TrivSqZeroExt.snd d).imK


@[to_additive]
theorem mulRothNumber_le : mulRothNumber s ≤ s.card

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


theorem HasBasis.eq_bot_iff (hl : l.HasBasis p s) : l = ⊥ ↔ ∃ i, p i ∧ s i = ∅

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


@[simp, norm_cast]
theorem coe_imK : (x : ℍ[R]).imK = 0


@[simp]
theorem opow_succ (a b : Ordinal) : a ^ succ b = a ^ b * a


/-- The obvious triangle `X₁ ⟶ X₁ ⨯ X₂ ⟶ X₂ ⟶ X₁⟦1⟧`. -/
@[simps!]
def binaryProductTriangle (X₁ X₂ : C) [HasZeroMorphisms C] [HasBinaryProduct X₁ X₂] :
    Triangle C

(CategoryTheory.Pretriangulated.binaryProductTriangle X₁ X₂).mor₂ = CategoryTheory.Limits.prod.snd


/-- An `iff` version of `CovBy.eq_or_eq` and `covBy_of_eq_or_eq`. -/
theorem covBy_iff_lt_and_eq_or_eq : a ⋖ b ↔ a < b ∧ ∀ c, a ≤ c → c ≤ b → c = a ∨ c = b

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

a ⋖ b ↔ a < b ∧ ∀ (c : α), a ≤ c → c ≤ b → c = a ∨ c = b


@[simp]
theorem zero_lf_one : (0 : PGame) ⧏ 1


/-- The natural functor from `Fintype` to `Profinite`, endowing a finite type with the
discrete topology. -/
@[simps]
def FintypeCat.toProfinite : FintypeCat ⥤ Profinite

FintypeCat.toProfinite.obj A = Profinite.of ↑A


@[simp]
theorem coeff_monomial_succ : coeff (monomial (n + 1) a) 0 = 0

{R : Type u}
{a : R}
{n : ℕ}
[Semiring R]

((Polynomial.monomial (n + 1)) a).coeff 0 = 0


@[to_additive]
theorem IsCyclic.of_exponent_eq_card [CommGroup α] [Fintype α] (h : exponent α = Fintype.card α) :
    IsCyclic α

(h : AddMonoid.exponent α = Fintype.card α)


theorem comap_incl_eq_bot : N₂.comap N.incl = ⊥ ↔ N ⊓ N₂ = ⊥

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

LieSubmodule.comap N.incl N₂ = ⊥ ↔ N ⊓ N₂ = ⊥


@[simp]
theorem Set.coe_setOf (p : α → Prop) : ↥{ x | p x } = { x // p x }


lemma infSum_union_add_infSum_sups (𝒜 ℬ : Finset (Finset α)) :
    infSum (𝒜 ∪ ℬ) + infSum (𝒜 ⊻ ℬ) = infSum 𝒜 + infSum ℬ

{α : Type u_1}
[Fintype α]
[DecidableEq α]
(𝒜 ℬ : Finset (Finset α))

AhlswedeZhang.infSum (𝒜 ∪ ℬ) + AhlswedeZhang.infSum (𝒜 ⊻ ℬ) = AhlswedeZhang.infSum 𝒜 + AhlswedeZhang.infSum ℬ


@[simp] theorem Decidable.not_imp_self [Decidable a] : (¬a → a) ↔ a


/-- A continuous linear operator is self-adjoint iff it is equal to its adjoint. -/
theorem isSelfAdjoint_iff' {A : E →ₗ[𝕜] E} : IsSelfAdjoint A ↔ LinearMap.adjoint A = A

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[FiniteDimensional 𝕜 E]
{A : E →ₗ[𝕜] E}


/-- The double commutant definition of a von Neumann algebra,
as a *-closed subalgebra of bounded operators on a Hilbert space,
which is equal to its double commutant.

Note that this definition is parameterised by the Hilbert space
on which the algebra faithfully acts, as is standard in the literature.
See `WStarAlgebra` for the abstract notion (a C^*-algebra with Banach space predual).

Note this is a bundled structure, parameterised by the Hilbert space `H`,
rather than a typeclass on the type of elements.
Thus we can't say that the bounded operators `H →L[ℂ] H` form a `VonNeumannAlgebra`
(although we will later construct the instance `WStarAlgebra (H →L[ℂ] H)`),
and instead will use `⊤ : VonNeumannAlgebra H`.
-/
-- Porting note: I don't think the nonempty instance linter exists yet
structure VonNeumannAlgebra (H : Type u) [NormedAddCommGroup H] [InnerProductSpace ℂ H]
    [CompleteSpace H] extends StarSubalgebra ℂ (H →L[ℂ] H) where
  /-- The double commutant (a.k.a. centralizer) of a `VonNeumannAlgebra` is itself. -/
  centralizer_centralizer' : Set.centralizer (Set.centralizer carrier) = carrier

{H : Type u}
[NormedAddCommGroup H]
[InnerProductSpace ℂ H]
[CompleteSpace H]
(self : VonNeumannAlgebra H)


@[simp]
lemma shift_smul (a : ℤ) (x : R) :
    (x • γ).shift a = x • (γ.shift a)

(γ : CochainComplex.HomComplex.Cochain K L n)


theorem neg (h : IntervalIntegrable f μ a b) : IntervalIntegrable (-f) μ a b

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


@[simp] theorem div_eq_zero_iff : a / b = 0 ↔ a = 0 ∨ b = ∞


/-- The composition of braided monoidal functors. -/
@[simps!]
def comp (F : BraidedFunctor C D) (G : BraidedFunctor D E) : BraidedFunctor C E

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.MonoidalCategory C]
[CategoryTheory.BraidedCategory C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
[CategoryTheory.MonoidalCategory D]
[CategoryTheory.BraidedCategory D]
{E : Type u₃}
[CategoryTheory.Category.{v₃, u₃} E]
[CategoryTheory.MonoidalCategory E]
[CategoryTheory.BraidedCategory E]
(F : CategoryTheory.BraidedFunctor C D)
(G : CategoryTheory.BraidedFunctor D E)


theorem Nonsquare.ns (x : ℕ) [Nonsquare x] : ∀ n : ℕ, x ≠ n * n


@[to_additive] lemma le_mulEnergy : s.card * t.card ≤ Eₘ[s, t]

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


theorem JoinedIn.trans (hxy : JoinedIn F x y) (hyz : JoinedIn F y z) : JoinedIn F x z

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


theorem coeff_intCast_ite {n : ℕ} {a : ℤ} : (Int.cast a : R[X]).coeff n = ite (n = 0) a 0

(↑a).coeff n = ↑(if n = 0 then a else 0)


theorem image_coe_Iic : (some : α → WithTop α) '' Iic a = Iic (a : WithTop α)


/-- The underlying set of a non-empty directed Sup of `NonUnitalSubring`s is just a union of the
`NonUnitalSubring`s. Note that this fails without the directedness assumption (the union of two
`NonUnitalSubring`s is typically not a `NonUnitalSubring`) -/
theorem mem_iSup_of_directed {ι} [hι : Nonempty ι] {S : ι → NonUnitalSubring R}
    (hS : Directed (· ≤ ·) S) {x : R} : (x ∈ ⨆ i, S i) ↔ ∃ i, x ∈ S i

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


/-- `s` is a submonoid: a set containing 1 and closed under multiplication.
Note that this structure is deprecated, and the bundled variant `Submonoid M` should be
preferred. -/
@[to_additive]
structure IsSubmonoid (s : Set M) : Prop where
  /-- The proposition that s contains 1. -/
  one_mem : (1 : M) ∈ s
  /-- The proposition that s is closed under multiplication. -/
  mul_mem {a b} : a ∈ s → b ∈ s → a * b ∈ s

{M : Type u_1}
[Monoid M]
{s : Set M}
(self : IsSubmonoid s)


@[simp]
theorem emod_mul_bmod_congr (x : Int) (n : Nat) : Int.bmod (x%n * y) n = Int.bmod (x * y) n


theorem eval_map (x : S) : (p.map f).eval x = p.eval₂ f x

{R : Type u}
{S : Type v}
[Semiring R]
{p : R[X]}
[Semiring S]
(f : R →+* S)
(x : S)

Polynomial.eval x (Polynomial.map f p) = Polynomial.eval₂ f x p


@[simp]
theorem coe_inf (p p' : L.Substructure M) :
    ((p ⊓ p' : L.Substructure M) : Set M) = (p : Set M) ∩ (p' : Set M)

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]
(p p' : L.Substructure M)


theorem lintegral_join {m : Measure (Measure α)} {f : α → ℝ≥0∞} (hf : Measurable f) :
    ∫⁻ x, f x ∂join m = ∫⁻ μ, ∫⁻ x, f x ∂μ ∂m

{m : MeasureTheory.Measure (MeasureTheory.Measure α)}

{f : α → ℝ≥0∞}

∫⁻ (x : α), f x ∂m.join = ∫⁻ (μ : MeasureTheory.Measure α), ∫⁻ (x : α), f x ∂μ ∂m


theorem sound {x y : PSet} (h : PSet.Equiv x y) : mk x = mk y


/-- Multiplication by a `u : Mˣ` on the right doesn't affect `IsUnit`. -/
@[to_additive (attr := simp)
"Addition of a `u : AddUnits M` on the right doesn't affect `IsAddUnit`."]
theorem Units.isUnit_mul_units [Monoid M] (a : M) (u : Mˣ) : IsUnit (a * u) ↔ IsUnit a

{M : Type u_1}
[AddMonoid M]
(a : M)
(u : AddUnits M)


@[simp]
theorem mem_torsionBy_iff (x : M) : x ∈ torsionBy R M a ↔ a • x = 0

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

x ∈ Submodule.torsionBy R M a ↔ a • x = 0


theorem iunfoldr_getLsb' {f : Fin w → α → α × Bool} (state : Nat → α)
    (ind : ∀(i : Fin w), (f i (state i.val)).fst = state (i.val+1)) :
  (∀ i : Fin w, getLsb (iunfoldr f (state 0)).snd i.val = (f i (state i.val)).snd)
  ∧ (iunfoldr f (state 0)).fst = state w

(ind : ∀ (i : Fin w), (f i (state ↑i)).fst = state (↑i + 1))

(∀ (i : Fin w), (BitVec.iunfoldr f (state 0)).snd.getLsb ↑i = (f i (state ↑i)).snd) ∧
  (BitVec.iunfoldr f (state 0)).fst = state w


@[simp]
theorem ofEquiv_σ {f : Filter α} (F : f.Realizer) (E : F.σ ≃ τ) : (F.ofEquiv E).σ = τ

{α : Type u_1}
{τ : Type u_4}
{f : Filter α}
(F : f.Realizer)
(E : F.σ ≃ τ)


/-- `Rel r s t` -- lift the relation `r` between two elements to a relation between `s` and `t`,
s.t. there is a one-to-one mapping between elements in `s` and `t` following `r`. -/
@[mk_iff]
inductive Rel (r : α → β → Prop) : Multiset α → Multiset β → Prop
  | zero : Rel r 0 0
  | cons {a b as bs} : r a b → Rel r as bs → Rel r (a ::ₘ as) (b ::ₘ bs)

{α : Type u_1}
{β : Type v}
(r : α → β → Prop)

∀ (a : Multiset α) (a_1 : Multiset β),
  Multiset.Rel r a a_1 ↔
    a = 0 ∧ a_1 = 0 ∨ ∃ a_2 b as bs, r a_2 b ∧ Multiset.Rel r as bs ∧ a = a_2 ::ₘ as ∧ a_1 = b ::ₘ bs


/-- A (topological) fiber bundle with fiber `F` over a base `B` is a space projecting on `B`
for which the fibers are all homeomorphic to `F`, such that the local situation around each point
is a direct product. -/
class FiberBundle where
  totalSpaceMk_inducing' : ∀ b : B, Inducing (@TotalSpace.mk B F E b)
  trivializationAtlas' : Set (Trivialization F (π F E))
  trivializationAt' : B → Trivialization F (π F E)
  mem_baseSet_trivializationAt' : ∀ b : B, b ∈ (trivializationAt' b).baseSet
  trivialization_mem_atlas' : ∀ b : B, trivializationAt' b ∈ trivializationAtlas'

[TopologicalSpace (Bundle.TotalSpace F E)]

FiberBundle.trivializationAt' b ∈ FiberBundle.trivializationAtlas'


theorem X_pow_card_sub_X_natDegree_eq (hp : 1 < p) : (X ^ p - X : K'[X]).natDegree = p

(K' : Type u_3)
[Field K']
{p : ℕ}
(hp : 1 < p)

(Polynomial.X ^ p - Polynomial.X).natDegree = p


/-- The marginal distribution is independent of the variables in `s`. -/
theorem lmarginal_congr {x y : ∀ i, π i} (f : (∀ i, π i) → ℝ≥0∞)
    (h : ∀ i ∉ s, x i = y i) :
    (∫⋯∫⁻_s, f ∂μ) x = (∫⋯∫⁻_s, f ∂μ) y

(μ : (i : δ) → MeasureTheory.Measure (π i))


@[to_additive]
theorem self_ne_mul_right : a ≠ a * b ↔ b ≠ 1

{M : Type u}
[AddLeftCancelMonoid M]
{a b : M}


@[simp] theorem im_imI : a.im.imI = a.imI


lemma collapse_of_mem (ha : a ∉ s) (ht : t ∈ 𝒜) (hu : u ∈ 𝒜) (hts : t = s)
    (hus : u = insert a s) : collapse 𝒜 a f s = f t + f u

{α : Type u_1}
{β : Type u_2}
[DecidableEq α]
[LinearOrderedCommSemiring β]
{𝒜 : Finset (Finset α)}
{a : α}
{f : Finset α → β}
{s t u : Finset α}
(ha : a ∉ s)
(ht : t ∈ 𝒜)
(hu : u ∈ 𝒜)
(hts : t = s)
(hus : u = insert a s)


/--
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)]

adj.toEquivalence.counitIso.hom.app X = adj.counit.app X


theorem diagonal_toLin' (w : n → R) :
    toLin' (diagonal w) = LinearMap.pi fun i => w i • LinearMap.proj i

{n : Type u_1}
[Fintype n]
[DecidableEq n]
{R : Type v}
[CommSemiring R]
(w : n → R)

Matrix.toLin' (Matrix.diagonal w) = LinearMap.pi fun i => w i • LinearMap.proj i


/-- The series `pow r` converges to `(1-r)⁻¹`. For `r < 1` the RHS is a finite number,
and for `1 ≤ r` the RHS equals `∞`. -/
@[simp]
theorem ENNReal.tsum_geometric (r : ℝ≥0∞) : ∑' n : ℕ, r ^ n = (1 - r)⁻¹


theorem integral_union_eq_left_of_ae (ht_eq : ∀ᵐ x ∂μ.restrict t, f x = 0) :
    ∫ x in s ∪ t, f x ∂μ = ∫ x in s, f x ∂μ

(ht_eq : ∀ᵐ (x : X) ∂μ.restrict t, f x = 0)

∫ (x : X) in s ∪ t, f x ∂μ = ∫ (x : X) in s, f x ∂μ


lemma sUnion_insert_diffFinset (hC : IsSetSemiring C) (hs : s ∈ C) (ht : t ∈ C) (hst : t ⊆ s) :
    ⋃₀ insert t (hC.diffFinset hs ht) = s

{α : Type u_1}
{C : Set (Set α)}
{s t : Set α}
(hC : MeasureTheory.IsSetSemiring C)
(hs : s ∈ C)
(ht : t ∈ C)
(hst : t ⊆ s)


theorem lintegral_comap (κ : Kernel α β) (hg : Measurable g) (c : γ) (g' : β → ℝ≥0∞) :
    ∫⁻ b, g' b ∂comap κ g hg c = ∫⁻ b, g' b ∂κ (g c)

{α : Type u_1}
{β : Type u_2}
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}
{γ : Type u_4}
{mγ : MeasurableSpace γ}
{g : γ → α}
(κ : ProbabilityTheory.Kernel α β)
(hg : Measurable g)
(c : γ)
(g' : β → ℝ≥0∞)

∫⁻ (b : β), g' b ∂(κ.comap g hg) c = ∫⁻ (b : β), g' b ∂κ (g c)


theorem LieAlgebra.ad_eq_lmul_left_sub_lmul_right (A : Type v) [Ring A] [Algebra R A] :
    (ad R A : A → Module.End R A) = LinearMap.mulLeft R - LinearMap.mulRight R

{R : Type u}
[CommRing R]
(A : Type v)
[Ring A]
[Algebra R A]

⇑(LieAlgebra.ad R A) = LinearMap.mulLeft R - LinearMap.mulRight R


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

{α : Type u_2}
[CancelCommMonoid α]
{s : Set α}
{a : α}
(hs : ThreeGPFree s)


@[simp, norm_cast]
theorem LinearMap.mkContinuousOfExistsBound_coe (h : ∃ C, ∀ x, ‖f x‖ ≤ C * ‖x‖) :
    (f.mkContinuousOfExistsBound h : E →ₛₗ[σ] F) = f

{𝕜 : Type u_1}
{𝕜₂ : Type u_2}
{E : Type u_3}
{F : Type u_4}
[Ring 𝕜]
[Ring 𝕜₂]
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup F]
[Module 𝕜 E]
[Module 𝕜₂ F]
{σ : 𝕜 →+* 𝕜₂}
(f : E →ₛₗ[σ] F)
(h : ∃ C, ∀ (x : E), ‖f x‖ ≤ C * ‖x‖)


theorem HasPDF.absolutelyContinuous {X : Ω → E} {ℙ : Measure Ω} {μ : Measure E}
    [hX : HasPDF X ℙ μ] : map X ℙ ≪ μ

{Ω : Type u_1}
{E : Type u_2}
[MeasurableSpace E]

∀ {x : MeasurableSpace Ω} {X : Ω → E} {ℙ : MeasureTheory.Measure Ω} {μ : MeasureTheory.Measure E}
  [hX : MeasureTheory.HasPDF X ℙ μ], MeasureTheory.Measure.map X ℙ ≪ μ


@[simps ωSup]
instance : OmegaCompletePartialOrder (α →𝒄 β)

(c : OmegaCompletePartialOrder.Chain (α →𝒄 β))

OmegaCompletePartialOrder.ωSup c = OmegaCompletePartialOrder.ContinuousHom.ωSup c


@[simp]
lemma ltTrichotomy_lt (h : x < y) : ltTrichotomy x y p q r = p

{α : Type u_2}
[LinearOrder α]
{P : Sort u_5}
{x y : α}
{p q r : P}
(h : x < y)


theorem interior_ae_eq_of_null_frontier {μ : Measure α'} {s : Set α'} (h : μ (frontier s) = 0) :
    interior s =ᵐ[μ] s

{α' : Type u_6}
[TopologicalSpace α']
[MeasurableSpace α']
{μ : MeasureTheory.Measure α'}
{s : Set α'}
(h : μ (frontier s) = 0)


@[simp]
theorem Complex.map_isometryOfOrthonormal (v : OrthonormalBasis (Fin 2) ℝ F) (f : F ≃ₗᵢ[ℝ] F') :
    Complex.isometryOfOrthonormal (v.map f) = (Complex.isometryOfOrthonormal v).trans f

{F : Type u_6}
[NormedAddCommGroup F]
[InnerProductSpace ℝ F]
{F' : Type u_7}
[NormedAddCommGroup F']
[InnerProductSpace ℝ F']
(v : OrthonormalBasis (Fin 2) ℝ F)
(f : F ≃ₗᵢ[ℝ] F')


lemma Inducing.alexandrovDiscrete {f : β → α} (h : Inducing f) : AlexandrovDiscrete β

{α : Type u_3}
{β : Type u_4}
[TopologicalSpace α]
[TopologicalSpace β]
[AlexandrovDiscrete α]
{f : β → α}
(h : Inducing f)


/-- In a product space `Π n, E n`, then `firstDiff x y` is the first index at which `x` and `y`
differ. If `x = y`, then by convention we set `firstDiff x x = 0`. -/
irreducible_def firstDiff (x y : ∀ n, E n) : ℕ

{E : ℕ → Type u_2}
(x y : (n : ℕ) → E n)

PiNat.firstDiff x y = if h : x ≠ y then Nat.find ⋯ else 0


theorem eval₂_trunc_eq_sum_range {S : Type*} [Semiring S] (s : S) (G : R →+* S) (n) (f : R⟦X⟧) :
    (trunc n f).eval₂ G s = ∑ i ∈ range n, G (coeff R i f) * s ^ i

{R : Type u_1}
[Semiring R]
{S : Type u_2}
[Semiring S]
(s : S)
(G : R →+* S)
(n : ℕ)
(f : PowerSeries R)

Polynomial.eval₂ G s (PowerSeries.trunc n f) = ∑ i ∈ Finset.range n, G ((PowerSeries.coeff R i) f) * s ^ i


@[simp]
theorem rank_zero [Nontrivial K] : rank (0 : V →ₗ[K] V') = 0

{K : Type u}
{V : Type v}
{V' : Type v'}
[Ring K]
[AddCommGroup V]
[Module K V]
[AddCommGroup V']
[Module K V']
[Nontrivial K]


/-- Auxiliary definition for `HomologicalComplex₂.flipEquivalence`. -/
@[simps!]
def flipEquivalenceCounitIso :
    flipFunctor C c₂ c₁ ⋙ flipFunctor C c₁ c₂ ≅ 𝟭 (HomologicalComplex₂ C c₂ c₁)

∀ (i_1 : I₁), (((HomologicalComplex₂.flipEquivalenceCounitIso C c₁ c₂).inv.app X).f i).f i_1 = 𝟙 ((X.X i).X i_1)


theorem mem_image2_iff (hf : Injective2 f) : f a b ∈ image2 f s t ↔ a ∈ s ∧ b ∈ t

{α : Type u_1}
{β : Type u_3}
{γ : Type u_5}
{f : α → β → γ}
{s : Set α}
{t : Set β}
{a : α}
{b : β}
(hf : Function.Injective2 f)

f a b ∈ Set.image2 f s t ↔ a ∈ s ∧ b ∈ t


theorem eval_image_univ_pi_subset : eval i '' pi univ t ⊆ t i

{ι : Type u_1}
{α : ι → Type u_2}
{t : (i : ι) → Set (α i)}
{i : ι}


@[simp]
lemma ofReal_lt_one {p : ℝ} : ENNReal.ofReal p < 1 ↔ p < 1


theorem iSup_sup [Nonempty ι] {f : ι → α} {a : α} : (⨆ x, f x) ⊔ a = ⨆ x, f x ⊔ a

{α : Type u_1}
{ι : Sort u_5}
[CompleteLattice α]
[Nonempty ι]
{f : ι → α}
{a : α}


@[reassoc (attr := simp)]
theorem comp_coconePointUniqueUpToIso_inv {s t : Cocone F} (P : IsColimit s) (Q : IsColimit t)
    (j : J) : t.ι.app j ≫ (coconePointUniqueUpToIso P Q).inv = s.ι.app j

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{F : J ⥤ C}
{s t : CategoryTheory.Limits.Cocone F}
(P : CategoryTheory.Limits.IsColimit s)
(Q : CategoryTheory.Limits.IsColimit t)
(j : J)

t.ι.app j ≫ (P.coconePointUniqueUpToIso Q).inv = s.ι.app j


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


/-- `F ⊣ G` represents the data of an adjunction between two functors
`F : C ⥤ D` and `G : D ⥤ C`. `F` is the left adjoint and `G` is the right adjoint.

To construct an `adjunction` between two functors, it's often easier to instead use the
constructors `mkOfHomEquiv` or `mkOfUnitCounit`. To construct a left adjoint,
there are also constructors `leftAdjointOfEquiv` and `adjunctionOfEquivLeft` (as
well as their duals) which can be simpler in practice.

Uniqueness of adjoints is shown in `CategoryTheory.Adjunction.Opposites`.

See <https://stacks.math.columbia.edu/tag/0037>.
-/
structure Adjunction (F : C ⥤ D) (G : D ⥤ C) where
  /-- The equivalence between `Hom (F X) Y` and `Hom X (G Y)` coming from an adjunction -/
  homEquiv : ∀ X Y, (F.obj X ⟶ Y) ≃ (X ⟶ G.obj Y)
  /-- The unit of an adjunction -/
  unit : 𝟭 C ⟶ F.comp G
  /-- The counit of an adjunction -/
  counit : G.comp F ⟶ 𝟭 D
  -- Porting note: It's strange that this `Prop` is being flagged by the `docBlame` linter
  /-- Naturality of the unit of an adjunction -/
  homEquiv_unit : ∀ {X Y f}, (homEquiv X Y) f = (unit : _ ⟶ _).app X ≫ G.map f := by aesop_cat
  -- Porting note: It's strange that this `Prop` is being flagged by the `docBlame` linter
  /-- Naturality of the counit of an adjunction -/
  homEquiv_counit : ∀ {X Y g}, (homEquiv X Y).symm g = F.map g ≫ counit.app Y := by aesop_cat

{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}
(self : F ⊣ G)
{X : C}
{Y : D}
{g : X ⟶ G.obj Y}

(self.homEquiv X Y).symm g = CategoryTheory.CategoryStruct.comp (F.map g) (self.counit.app Y)


/-- This is the second barycentric form of the Lagrange interpolant. -/
theorem eval_interpolate_not_at_node' (hvs : Set.InjOn v s) (hs : s.Nonempty)
    (hx : ∀ i ∈ s, x ≠ v i) :
    eval x (interpolate s v r) =
      (∑ i ∈ s, nodalWeight s v i * (x - v i)⁻¹ * r i) /
        ∑ i ∈ s, nodalWeight s v i * (x - v i)⁻¹

{F : Type u_1}
[Field F]
{ι : Type u_2}
[DecidableEq ι]
{s : Finset ι}
{v : ι → F}
(r : ι → F)
{x : F}
(hvs : Set.InjOn v ↑s)
(hs : s.Nonempty)
(hx : ∀ i ∈ s, x ≠ v i)

Polynomial.eval x ((Lagrange.interpolate s v) r) =
  (∑ i ∈ s, Lagrange.nodalWeight s v i * (x - v i)⁻¹ * r i) / ∑ i ∈ s, Lagrange.nodalWeight s v i * (x - v i)⁻¹


theorem arg_eq_pi_div_two_iff {z : ℂ} : arg z = π / 2 ↔ z.re = 0 ∧ 0 < z.im


/-- An irreducible polynomial of prime degree with two non-real roots has full Galois group. -/
theorem galActionHom_bijective_of_prime_degree {p : ℚ[X]} (p_irr : Irreducible p)
    (p_deg : p.natDegree.Prime)
    (p_roots : Fintype.card (p.rootSet ℂ) = Fintype.card (p.rootSet ℝ) + 2) :
    Function.Bijective (galActionHom p ℂ)

(p_roots : Fintype.card ↑(p.rootSet ℂ) = Fintype.card ↑(p.rootSet ℝ) + 2)

Function.Bijective ⇑(Polynomial.Gal.galActionHom p ℂ)


theorem le_def [PartialOrder β] {f g : C(α, β)} : f ≤ g ↔ ∀ a, f a ≤ g a

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


@[to_additive]
lemma smul_set_closure_subset (K : Set M) (L : Set X) :
    closure K • closure L ⊆ closure (K • L)

{M : Type u_1}
{X : Type u_2}
[TopologicalSpace M]
[TopologicalSpace X]
[VAdd M X]
[ContinuousVAdd M X]
(K : Set M)
(L : Set X)

closure K +ᵥ closure L ⊆ closure (K +ᵥ L)


theorem image_subset_iff_subset_preimage [DecidableEq β] {f : α → β} {s : Finset α} {t : Finset β}
    (hf : Set.InjOn f (f ⁻¹' ↑t)) : s.image f ⊆ t ↔ s ⊆ t.preimage f hf

{α : Type u}
{β : Type v}
[DecidableEq β]
{f : α → β}
{s : Finset α}
{t : Finset β}
(hf : Set.InjOn f (f ⁻¹' ↑t))

Finset.image f s ⊆ t ↔ s ⊆ t.preimage f hf


@[simp]
theorem empty_val' {n' : Type*} (j : n') : (fun i => (![] : Fin 0 → n' → α) i j) = ![]


@[measurability]
theorem sum_measure [Countable ι] {μ : ι → Measure α} (h : ∀ i, AEMeasurable f (μ i)) :
    AEMeasurable f (sum μ)

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
{m0 : MeasurableSpace α}
[MeasurableSpace β]
{f : α → β}
[Countable ι]
{μ : ι → MeasureTheory.Measure α}
(h : ∀ (i : ι), AEMeasurable f (μ i))

AEMeasurable f (MeasureTheory.Measure.sum μ)


theorem mem_Lp_of_nnnorm_ae_le_mul {c : ℝ≥0} {f : α →ₘ[μ] E} {g : Lp F p μ}
    (h : ∀ᵐ x ∂μ, ‖f x‖₊ ≤ c * ‖g x‖₊) : f ∈ Lp E p μ

(h : ∀ᵐ (x : α) ∂μ, ‖↑f x‖₊ ≤ c * ‖↑↑g x‖₊)


protected lemma zero [Zero E] [SMulZeroClass M E] {s : Set E} (hs : 0 ∈ s) : Absorbs M s 0

{M : Type u_1}
{E : Type u_2}
[Bornology M]
[Zero E]
[SMulZeroClass M E]
{s : Set E}
(hs : 0 ∈ s)


/-- Eta rule for costructured arrows. -/
@[simps!]
def eta (f : CostructuredArrow S T) : f ≅ mk f.hom

(f : CategoryTheory.CostructuredArrow S T)

f.eta.hom.left = CategoryTheory.CategoryStruct.id f.left


@[simp]
theorem rel_zero_left {b : Multiset β} : Rel r 0 b ↔ b = 0

{α : Type u_1}
{β : Type v}
{r : α → β → Prop}
{b : Multiset β}


/-- `Equiv.mulLeft` as an `OrderIso`. See also `OrderEmbedding.mulLeft`. -/
@[to_additive (attr := simps! (config := { simpRhs := true }) toEquiv apply)
  "`Equiv.addLeft` as an `OrderIso`. See also `OrderEmbedding.addLeft`."]
def OrderIso.mulLeft (a : α) : α ≃o α

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


@[simp] lemma set_smul_bot : s • (⊥ : Submodule R M) = ⊥

{R : Type u_2}
{M : Type u_3}
[Semiring R]
{S : Type u_4}
[Monoid S]
[AddCommMonoid M]
[Module R M]
[DistribMulAction S M]
(s : Set S)


@[simp]
theorem coe_toEquiv_symm : e.toEquiv.symm = e.symm

{R : Type u_1}
{S : Type u_7}
{M : Type u_8}
{M₂ : Type u_10}
[Semiring R]
[Semiring S]
[AddCommMonoid M]
[AddCommMonoid M₂]
{module_M : Module R M}
{module_S_M₂ : Module S M₂}
{σ : R →+* S}
{σ' : S →+* R}
{re₁ : RingHomInvPair σ σ'}
{re₂ : RingHomInvPair σ' σ}
(e : M ≃ₛₗ[σ] M₂)


theorem disjSum_lt_disjSum_of_lt_of_le (hs : s₁ < s₂) (ht : t₁ ≤ t₂) :
    s₁.disjSum t₁ < s₂.disjSum t₂

{α : Type u_1}
{β : Type u_2}
{s₁ s₂ : Multiset α}
{t₁ t₂ : Multiset β}
(hs : s₁ < s₂)
(ht : t₁ ≤ t₂)


@[norm_cast] -- @[simp] -- Porting note: not in simpNF
theorem intCast_eq (z1 z2 : ℤ) : (z1 : ℤ_[p]) = z2 ↔ z1 = z2

{p : ℕ}
[Fact (Nat.Prime p)]
(z1 z2 : ℤ)


protected theorem decode : Computable (decode (α := α))


theorem toIocMod_add_right_eq_add (a b c : α) :
    toIocMod hp a (b + c) = toIocMod hp (a - c) b + c

{α : Type u_1}
[LinearOrderedAddCommGroup α]
[hα : Archimedean α]
{p : α}
(hp : 0 < p)
(a b c : α)


@[simp]
theorem neg_mem_centralizer [Mul M] [HasDistribNeg M] (ha : a ∈ centralizer S) :
    -a ∈ centralizer S

{M : Type u_1}
{S : Set M}
{a : M}
[Mul M]
[HasDistribNeg M]
(ha : a ∈ S.centralizer)


theorem map_eq_iff {x₁ x₂ : Fin n.succ → ℕ} (hx₁ : ∀ i, x₁ i < d) (hx₂ : ∀ i, x₂ i < d) :
    map d x₁ = map d x₂ ↔ x₁ 0 = x₂ 0 ∧ map d (x₁ ∘ Fin.succ) = map d (x₂ ∘ Fin.succ)

{n d : ℕ}
{x₁ x₂ : Fin n.succ → ℕ}
(hx₁ : ∀ (i : Fin n.succ), x₁ i < d)
(hx₂ : ∀ (i : Fin n.succ), x₂ i < d)

(Behrend.map d) x₁ = (Behrend.map d) x₂ ↔
  x₁ 0 = x₂ 0 ∧ (Behrend.map d) (x₁ ∘ Fin.succ) = (Behrend.map d) (x₂ ∘ Fin.succ)


@[measurability]
protected theorem norm {_ : MeasurableSpace α} {β : Type*} [SeminormedAddCommGroup β] {f : α → β}
    (hf : StronglyMeasurable f) : StronglyMeasurable fun x => ‖f x‖

∀ {x : MeasurableSpace α} {β : Type u_5} [inst : SeminormedAddCommGroup β] {f : α → β},
  MeasureTheory.StronglyMeasurable f → MeasureTheory.StronglyMeasurable fun x => ‖f x‖


theorem tail_sublist : ∀ l : List α, tail l <+ l


theorem mk'_eq_mk'_iff (m₁ m₂ : M) (s₁ s₂ : S) :
    mk' f m₁ s₁ = mk' f m₂ s₂ ↔ ∃ s : S, s • s₁ • m₂ = s • s₂ • m₁

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

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


theorem contDiffWithinAt_zero (hx : x ∈ s) :
    ContDiffWithinAt 𝕜 0 f s x ↔ ∃ u ∈ 𝓝[s] x, ContinuousOn f (s ∩ u)

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


theorem erase_le (a : α) (s : Multiset α) : s.erase a ≤ s

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


/--
Every polynomial with coefficients in a topological semiring gives a (bundled) continuous function.
-/
@[simps]
def toContinuousMap (p : R[X]) : C(R, R)

{R : Type u_1}
[Semiring R]
[TopologicalSpace R]
[TopologicalSemiring R]
(p : R[X])
(x : R)

p.toContinuousMap x = Polynomial.eval x p


/-- The indices of `Quotient.out'` and `IndexedPartition.out` are equal. -/
theorem index_out' (x : hs.Quotient) : hs.index x.out' = hs.index (hs.out x)

{ι : Type u_1}
{α : Type u_2}
{s : ι → Set α}
(hs : IndexedPartition s)
(x : hs.Quotient)

hs.index (Quotient.out' x) = hs.index (hs.out x)


theorem iSup_range' (g : β → α) (f : ι → β) : ⨆ b : range f, g b = ⨆ i, g (f i)

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


lemma pow_def (q : ℚ) (n : ℕ) :
    q ^ n = ⟨q.num ^ n, q.den ^ n,
      by simp [Nat.pow_eq_zero],
      by rw [Int.natAbs_pow]; exact q.reduced.pow _ _⟩

q ^ n = { num := q.num ^ n, den := q.den ^ n, den_nz := ⋯, reduced := ⋯ }


/-- If `P` is some relation between terms of `γ` and sets in `γ`, such that every finite set
`t : Set γ` has some `c : γ` related to it, then there is a recursively defined sequence `u` in `γ`
so `u n` is related to the image of `{0, 1, ..., n-1}` under `u`.

(We use this later to show sequentially compact sets are totally bounded.)
-/
theorem seq_of_forall_finite_exists {γ : Type*} {P : γ → Set γ → Prop}
    (h : ∀ t : Set γ, t.Finite → ∃ c, P c t) : ∃ u : ℕ → γ, ∀ n, P (u n) (u '' Iio n)

(h : ∀ (t : Set γ), t.Finite → ∃ c, P c t)

∃ u, ∀ (n : ℕ), P (u n) (u '' Set.Iio n)


@[simp] protected theorem div_one (n : Nat) : n / 1 = n


theorem modMonomial_add_divMonomial (x : MvPolynomial σ R) (s : σ →₀ ℕ) :
    x %ᵐᵒⁿᵒᵐⁱᵃˡ s + monomial s 1 * (x /ᵐᵒⁿᵒᵐⁱᵃˡ s) = x

{σ : Type u_1}
{R : Type u_2}
[CommSemiring R]
(x : MvPolynomial σ R)
(s : σ →₀ ℕ)

x.modMonomial s + (MvPolynomial.monomial s) 1 * x.divMonomial s = x


@[simp]
theorem map₂_pure (f : α → β → γ) (h₀ h₁) (a : α) (b : β) :
    map₂ f h₀ h₁ (pure a) (pure b) = pure (f a b)

(f : α → β → γ)

(h₀ : ∀ (b : β), Monotone fun a => f a b)

NonemptyInterval.map₂ f h₀ h₁ (NonemptyInterval.pure a) (NonemptyInterval.pure b) = NonemptyInterval.pure (f a b)


@[simp] theorem gcd_zero_right (n : Nat) : gcd n 0 = n


theorem IsOpen.lowerSemicontinuousWithinAt_indicator (hs : IsOpen s) (hy : 0 ≤ y) :
    LowerSemicontinuousWithinAt (indicator s fun _x => y) t x

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

LowerSemicontinuousWithinAt (s.indicator fun _x => y) t x


(h :
  ((∀ (k : ℤ), ↑z.re ≠ (2 * ↑k + 1) * ↑Real.pi / 2) ∧ ∀ (l : ℤ), ↑z.im * Complex.I ≠ (2 * ↑l + 1) * ↑Real.pi / 2) ∨
    (∃ k, ↑z.re = (2 * ↑k + 1) * ↑Real.pi / 2) ∧ ∃ l, ↑z.im * Complex.I = (2 * ↑l + 1) * ↑Real.pi / 2)

Complex.tan z =
  (Complex.tan ↑z.re + Complex.tanh ↑z.im * Complex.I) / (1 - Complex.tan ↑z.re * Complex.tanh ↑z.im * Complex.I)


theorem differentiableAt_of_deriv_ne_zero (h : deriv f x ≠ 0) : DifferentiableAt 𝕜 f x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : 𝕜 → F}
{x : 𝕜}
(h : deriv f x ≠ 0)


lemma addU_smul {P Q : Fin 3 → F} (hPz : P z ≠ 0) (hQz : Q z ≠ 0) {u v : F} (hu : u ≠ 0)
    (hv : v ≠ 0) : addU (u • P) (v • Q) = (u * v) ^ 2 * addU P Q

{F : Type v}
[Field F]
{P Q : Fin 3 → F}
(hPz : P z ≠ 0)
(hQz : Q z ≠ 0)
{u v : F}
(hu : u ≠ 0)
(hv : v ≠ 0)

WeierstrassCurve.Jacobian.addU (u • P) (v • Q) = (u * v) ^ 2 * WeierstrassCurve.Jacobian.addU P Q


theorem arg_inv (x : ℂ) : arg x⁻¹ = if arg x = π then π else -arg x

x⁻¹.arg = if x.arg = π then π else -x.arg


@[to_additive]
theorem mul_subset_mul_right : s₁ ⊆ s₂ → s₁ * t ⊆ s₂ * t

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


theorem Coprime.dvd_of_dvd_mul_left (H1 : Coprime k m) (H2 : k ∣ m * n) : k ∣ n

{k m n : Nat}
(H1 : k.Coprime m)
(H2 : k ∣ m * n)


@[simp, norm_cast] lemma coe_bot : (⊥ : G.Finsubgraph) = (⊥ : G.Subgraph)