@[simp]
theorem outer_Ioc (a b : ℝ) : f.outer (Ioc a b) = ofReal (f b - f a)

f.outer (Set.Ioc a b) = ENNReal.ofReal (↑f b - ↑f a)


lemma factorizationLCMLeft_pos :
    0 < factorizationLCMLeft a b


/-- Two alternating maps indexed by a `Fintype` are equal if they are equal when all arguments
are distinct basis vectors. -/
theorem Basis.ext_alternating {f g : N₁ [⋀^ι]→ₗ[R'] N₂} (e : Basis ι₁ R' N₁)
    (h : ∀ v : ι → ι₁, Function.Injective v → (f fun i => e (v i)) = g fun i => e (v i)) :
    f = g

(h : ∀ (v : ι → ι₁), Function.Injective v → (f fun i => e (v i)) = g fun i => e (v i))


/-- An element `m ∈ M` is contained in the `R`-submodule spanned by a set `s ⊆ M`, if and only if
`m` can be written as a finite `R`-linear combination of elements of `s`.
The implementation uses `Finsupp.sum`. -/
theorem mem_span_set {m : M} {s : Set M} :
    m ∈ Submodule.span R s ↔
      ∃ c : M →₀ R, (c.support : Set M) ⊆ s ∧ (c.sum fun mi r => r • mi) = m

{R : Type u_1}
{M : Type u_2}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{m : M}
{s : Set M}

m ∈ Submodule.span R s ↔ ∃ c, ↑c.support ⊆ s ∧ (c.sum fun mi r => r • mi) = m


@[simp]
theorem conj_inv_apply [AddGroup G] (g h : G) : (Additive.toMul (conj g))⁻¹ h = -g + h + g

(Additive.toMul (AddAut.conj g))⁻¹ h = -g + h + g


/-- `Equiv.piCongrLeft` as a homeomorphism: this is the natural homeomorphism
`Π i, Y (e i) ≃ₜ Π j, Y j` obtained from a bijection `ι ≃ ι'`. -/
@[simps! apply toEquiv]
def piCongrLeft {ι ι' : Type*} {Y : ι' → Type*} [∀ j, TopologicalSpace (Y j)]
    (e : ι ≃ ι') : (∀ i, Y (e i)) ≃ₜ ∀ j, Y j

{ι : Type u_6}
{ι' : Type u_7}
{Y : ι' → Type u_8}
[(j : ι') → TopologicalSpace (Y j)]
(e : ι ≃ ι')

(Homeomorph.piCongrLeft e).toEquiv = Equiv.piCongrLeft Y e


@[to_additive mem_prod]
theorem mem_prod {s : Subsemigroup M} {t : Subsemigroup N} {p : M × N} :
    p ∈ s.prod t ↔ p.1 ∈ s ∧ p.2 ∈ t

{M : Type u_1}
{N : Type u_2}
[Mul M]
[Mul N]
{s : Subsemigroup M}
{t : Subsemigroup N}
{p : M × N}


theorem eventually_gt_atTop [Preorder α] [NoMaxOrder α] (a : α) : ∀ᶠ x in atTop, a < x

{α : Type u_3}
[Preorder α]
[NoMaxOrder α]
(a : α)


@[simp]
theorem toFinset_some {a : α} : (some a).toFinset = {a}


theorem Injective.hasLeftInverse (hf : Injective f) : HasLeftInverse f

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


/-- The minimal polynomial of an element of `E / F` of exponential characteristic `q` has
separable degree one if and only if the minimal polynomial is of the form
`X ^ (q ^ n) - C y` for some `n : ℕ` and `y : F`. -/
theorem natSepDegree_eq_one_iff_eq_X_pow_sub_C : (minpoly F x).natSepDegree = 1 ↔
    ∃ (n : ℕ) (y : F), minpoly F x = X ^ q ^ n - C y

{F : Type u}
{E : Type v}
[Field F]
[Field E]
[Algebra F E]
(q : ℕ)
[hF : ExpChar F q]
{x : E}

(minpoly F x).natSepDegree = 1 ↔ ∃ n y, minpoly F x = Polynomial.X ^ q ^ n - Polynomial.C y


theorem sup_inf_right (a b c : α) : a ⊓ b ⊔ c = (a ⊔ c) ⊓ (b ⊔ c)

{α : Type u}
[DistribLattice α]
(a b c : α)


/-- A substructure `S` includes `closure L s` if and only if it includes `s`. -/
@[simp]
theorem closure_le : closure L s ≤ S ↔ s ⊆ S

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

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


protected lemma exists_congr_left : (∃ a, p a) ↔ ∃ b, p (e.symm b)

{α : Sort u}
{β : Sort v}
{p : α → Prop}
(e : α ≃ β)


/-- **Turán's theorem**. `turanGraph n r` is, up to isomorphism, the unique
`r + 1`-cliquefree Turán-maximal graph on `n` vertices. -/
theorem isTuranMaximal_iff_nonempty_iso_turanGraph (hr : 0 < r) :
    G.IsTuranMaximal r ↔ Nonempty (G ≃g turanGraph (Fintype.card V) r)

{V : Type u_1}
[Fintype V]
[DecidableEq V]
{G : SimpleGraph V}
[DecidableRel G.Adj]
{r : ℕ}
(hr : 0 < r)

G.IsTuranMaximal r ↔ Nonempty (G ≃g SimpleGraph.turanGraph (Fintype.card V) r)


@[to_additive]
theorem isUnit_of_mul_isUnit_right [CommMonoid M] {x y : M} (hu : IsUnit (x * y)) : IsUnit y

{M : Type u_1}
[AddCommMonoid M]
{x y : M}
(hu : IsAddUnit (x + y))


theorem Fin.circulant_isSymm_apply {n} {v : Fin n → α} (h : (circulant v).IsSymm) (i : Fin n) :
    v (-i) = v i

{α : Type u_1}
{n : ℕ}
{v : Fin n → α}
(h : (Matrix.circulant v).IsSymm)
(i : Fin n)


theorem iUnion₂_subset_iUnion (κ : ι → Sort*) (s : ι → Set α) :
    ⋃ (i) (_ : κ i), s i ⊆ ⋃ i, s i

{α : Type u_1}
{ι : Sort u_4}
(κ : ι → Sort u_11)
(s : ι → Set α)


@[to_additive]
theorem DenseRange.topologicalClosure_map_subgroup [Group H] [TopologicalSpace H]
    [TopologicalGroup H] {f : G →* H} (hf : Continuous f) (hf' : DenseRange f) {s : Subgroup G}
    (hs : s.topologicalClosure = ⊤) : (s.map f).topologicalClosure = ⊤

{G : Type w}
{H : Type x}
[TopologicalSpace G]
[AddGroup G]
[TopologicalAddGroup G]
[AddGroup H]
[TopologicalSpace H]
[TopologicalAddGroup H]
{f : G →+ H}
(hf : Continuous ⇑f)
(hf' : DenseRange ⇑f)
{s : AddSubgroup G}
(hs : s.topologicalClosure = ⊤)

(AddSubgroup.map f s).topologicalClosure = ⊤


/-- `Matrix.diagonal` as an `AddMonoidHom`. -/
@[simps]
def diagonalAddMonoidHom [AddZeroClass α] : (n → α) →+ Matrix n n α

(n : Type u_3)
(α : Type v)
[DecidableEq n]
[AddZeroClass α]
(d : n → α)

(Matrix.diagonalAddMonoidHom n α) d = Matrix.diagonal d


/-- See `exists_eq_ciSup_of_not_isSuccLimit` for the
`ConditionallyCompleteLinearOrder` version. -/
lemma exists_eq_ciSup_of_not_isSuccLimit'
    (hf : BddAbove (Set.range f)) (hf' : ¬ IsSuccLimit (⨆ i, f i)) :
    ∃ i, f i = ⨆ i, f i

{ι : Type u_1}
{α : Type u_2}
[ConditionallyCompleteLinearOrderBot α]
{f : ι → α}
(hf : BddAbove (Set.range f))
(hf' : ¬Order.IsSuccLimit (⨆ i, f i))


theorem mem_nhds_iff : s ∈ 𝓝 x ↔ ∃ ε > 0, ball x ε ⊆ s

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


@[to_additive]
theorem Submonoid.mem_nhds_one (S : Submonoid M) (oS : IsOpen (S : Set M)) :
    (S : Set M) ∈ 𝓝 (1 : M)

{M : Type u_3}
[TopologicalSpace M]
[AddCommMonoid M]
(S : AddSubmonoid M)
(oS : IsOpen ↑S)


/-- If a bounded group homomorphism map is constructed from a group homomorphism via the constructor
`AddMonoidHom.mkNormedAddGroupHom`, then its norm is bounded by the bound given to the constructor
if it is nonnegative. -/
theorem mkNormedAddGroupHom_norm_le (f : V₁ →+ V₂) {C : ℝ} (hC : 0 ≤ C) (h : ∀ x, ‖f x‖ ≤ C * ‖x‖) :
    ‖f.mkNormedAddGroupHom C h‖ ≤ C

{V₁ : Type u_2}
{V₂ : Type u_3}
[SeminormedAddCommGroup V₁]
[SeminormedAddCommGroup V₂]
(f : V₁ →+ V₂)
{C : ℝ}
(hC : 0 ≤ C)
(h : ∀ (x : V₁), ‖f x‖ ≤ C * ‖x‖)


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


/-- The spectrum of the diagonal operator is the range of the diagonal viewed as a function. -/
lemma spectrum_diagonal [Field R] (d : n → R) :
    spectrum R (diagonal d) = Set.range d

{R : Type u_1}
{n : Type u_2}
[DecidableEq n]
[Fintype n]
[Field R]
(d : n → R)

spectrum R (Matrix.diagonal d) = Set.range d


theorem get_mem : ∀ (l : List α) n h, get l ⟨n, h⟩ ∈ l

{α : Type u_1}
(l : List α)
(n : Nat)
(h : n < l.length)


theorem IsSubfield.inter {S₁ S₂ : Set F} (hS₁ : IsSubfield S₁) (hS₂ : IsSubfield S₂) :
    IsSubfield (S₁ ∩ S₂)

{F : Type u_1}
[Field F]
{S₁ S₂ : Set F}
(hS₁ : IsSubfield S₁)
(hS₂ : IsSubfield S₂)


theorem lintegral_zero_fun : lintegral μ (0 : α → ℝ≥0∞) = 0

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}


theorem restrict_injective {α β} {f : α → β} (p : α → Prop) (h : Injective f) :
    Injective (restrict p f)

{α : Sort u_4}
{β : Type u_5}
{f : α → β}
(p : α → Prop)
(h : Function.Injective f)

Function.Injective (Subtype.restrict p f)


/-- The indexed supremum of a function is bounded above by a uniform bound-/
theorem ciSup_le [Nonempty ι] {f : ι → α} {c : α} (H : ∀ x, f x ≤ c) : iSup f ≤ c

{α : Type u_1}
{ι : Sort u_4}
[ConditionallyCompleteLattice α]
[Nonempty ι]
{f : ι → α}
{c : α}
(H : ∀ (x : ι), f x ≤ c)


private lemma three_dvd_b_of_dvd_a_of_gcd_eq_one_of_case2 {a b c : ℤ} (ha : a ≠ 0)
    (Hgcd : Finset.gcd {a, b, c} id = 1) (h3a : 3 ∣ a) (HF : a ^ 3 + b ^ 3 + c ^ 3 = 0)
    (H : ∀ a b c : ℤ, c ≠ 0 → ¬ 3 ∣ a → ¬ 3 ∣ b  → 3 ∣ c → IsCoprime a b → a ^ 3 + b ^ 3 ≠ c ^ 3) :
    3 ∣ b

(H : ∀ (a b c : ℤ), c ≠ 0 → ¬3 ∣ a → ¬3 ∣ b → 3 ∣ c → IsCoprime a b → a ^ 3 + b ^ 3 ≠ c ^ 3)


/-- The equivalence between isomorphisms in `Sequential` and homeomorphisms
of topological spaces. -/
@[simps]
def isoEquivHomeo {X Y : Sequential.{u}} : (X ≅ Y) ≃ (X ≃ₜ Y)

{X Y : Sequential}
(f : ↑X.toTop ≃ₜ ↑Y.toTop)

Sequential.isoEquivHomeo.symm f = Sequential.isoOfHomeo f


theorem tsupport_subset_extChartAt_source : tsupport f ⊆ (extChartAt I c).source

{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[FiniteDimensional ℝ E]
{H : Type uH}
[TopologicalSpace H]
{I : ModelWithCorners ℝ E H}
{M : Type uM}
[TopologicalSpace M]
[ChartedSpace H M]
{c : M}
(f : SmoothBumpFunction I c)
[T2Space M]


/-- A subring is closed under addition. -/
protected theorem add_mem {x y : R} : x ∈ s → y ∈ s → x + y ∈ s

{R : Type u}
[Ring R]
(s : Subring R)
{x y : R}


theorem totalDegree (hφ : IsHomogeneous φ n) (h : φ ≠ 0) : totalDegree φ = n

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


@[simp] theorem data_length {l : Array α} : l.data.length = l.size


/-- seeing `ℝ≥0∞` as `Real` does not change their sum, unless one of the `ℝ≥0∞` is infinity -/
theorem toReal_sum {s : Finset α} {f : α → ℝ≥0∞} (hf : ∀ a ∈ s, f a ≠ ∞) :
    ENNReal.toReal (∑ a ∈ s, f a) = ∑ a ∈ s, ENNReal.toReal (f a)

{α : Type u_1}
{s : Finset α}
{f : α → ℝ≥0∞}
(hf : ∀ a ∈ s, f a ≠ ⊤)

(∑ a ∈ s, f a).toReal = ∑ a ∈ s, (f a).toReal


theorem smoothOn_const : SmoothOn I I' (fun _ : M => c) s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M' : Type u_7}
[TopologicalSpace M']
[ChartedSpace H' M']
{s : Set M}
{c : M'}


@[simp]
theorem limsInf_top : limsInf (⊤ : Filter α) = ⊥


theorem Prime.not_prime_pow {x n : ℕ} (hn : 2 ≤ n) : ¬(x ^ n).Prime


/-- A point is its own reflection if and only if it is in the subspace. -/
theorem reflection_eq_self_iff {s : AffineSubspace ℝ P} [Nonempty s]
    [HasOrthogonalProjection s.direction] (p : P) : reflection s p = p ↔ p ∈ s

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{s : AffineSubspace ℝ P}
[Nonempty ↥s]
[HasOrthogonalProjection s.direction]
(p : P)

(EuclideanGeometry.reflection s) p = p ↔ p ∈ s


/-- See also `Irreducible.coprime_iff_not_dvd'`. -/
theorem Irreducible.dvd_iff_not_coprime {p n : R} (hp : Irreducible p) : p ∣ n ↔ ¬IsCoprime p n

{R : Type u}
[CommRing R]
[IsBezout R]
{p n : R}
(hp : Irreducible p)


theorem basicOpen_mul_le_right (f g : A) : basicOpen 𝒜 (f * g) ≤ basicOpen 𝒜 g

{R : Type u_1}
{A : Type u_2}
[CommSemiring R]
[CommRing A]
[Algebra R A]
(𝒜 : ℕ → Submodule R A)
[GradedAlgebra 𝒜]
(f g : A)

ProjectiveSpectrum.basicOpen 𝒜 (f * g) ≤ ProjectiveSpectrum.basicOpen 𝒜 g


@[simp]
theorem productIso_hom_comp_eval_apply (j : J) (x) :
    (equivShrink (∀ j, F j)).symm ((productIso F).hom x) j = Pi.π F j x

{J : Type v}
(F : J → Type u)
[Small.{u, v} J]
(j : J)
(x : ∏ᶜ F)

(equivShrink ((j : J) → F j)).symm ((CategoryTheory.Limits.Types.Small.productIso F).hom x) j =
  CategoryTheory.Limits.Pi.π F j x


@[simp]
theorem map_join' (f : α → β) (S) : Seq.map f (Seq.join S) = Seq.join (Seq.map (map f) S)

{α : Type u}
{β : Type v}
(f : α → β)
(S : Stream'.Seq (Stream'.Seq1 α))

Stream'.Seq.map f S.join = (Stream'.Seq.map (Stream'.Seq1.map f) S).join


theorem linearIndependent_iff' :
    LinearIndependent R v ↔
      ∀ s : Finset ι, ∀ g : ι → R, ∑ i ∈ s, g i • v i = 0 → ∀ i ∈ s, g i = 0

{ι : Type u'}
{R : Type u_2}
{M : Type u_4}
{v : ι → M}
[Semiring R]
[AddCommMonoid M]
[Module R M]

LinearIndependent R v ↔ ∀ (s : Finset ι) (g : ι → R), ∑ i ∈ s, g i • v i = 0 → ∀ i ∈ s, g i = 0


@[reassoc (attr := simp)]
lemma coconeApp_naturality {P : Cᵒᵖ ⥤ Type v₁} {x y : P.Elements} (f : x ⟶ y) :
    yoneda.map f.1.unop ≫ coconeApp φ x = coconeApp φ y

{G : CategoryTheory.Functor (CategoryTheory.Functor Cᵒᵖ (Type v₁)) (CategoryTheory.Functor Dᵒᵖ (Type v₁))}

(φ : F.comp CategoryTheory.yoneda ⟶ CategoryTheory.yoneda.comp G)

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

CategoryTheory.CategoryStruct.comp (CategoryTheory.yoneda.map (↑f).unop)
    (CategoryTheory.Presheaf.compYonedaIsoYonedaCompLan.coconeApp φ x) =
  CategoryTheory.Presheaf.compYonedaIsoYonedaCompLan.coconeApp φ y


/-- The localization map of a submodule. -/
@[simps!]
def Submodule.toLocalized' : M' →ₗ[R] M'.localized' S p f

{R : Type u}
(S : Type u')
{M : Type v}
{N : Type v'}
[CommRing R]
[CommRing S]
[AddCommGroup M]
[AddCommGroup N]
[Module R M]
[Module R N]
[Algebra R S]
[Module S N]
[IsScalarTower R S N]
(p : Submonoid R)
[IsLocalization p S]
(f : M →ₗ[R] N)
[IsLocalizedModule p f]
(M' : Submodule R M)
(c : ↥M')

↑((Submodule.toLocalized' S p f M') c) = f ↑c


theorem _root_.IsCoprime.sup_eq (h : IsCoprime I J) : I ⊔ J = ⊤

{R : Type u}
[CommSemiring R]
{I J : Ideal R}
(h : IsCoprime I J)


@[higher_order tsnd_comp_tfst]
theorem tsnd_tfst {α₀ α₁ β₀ β₁} (f : α₀ → F α₁) (f' : β₀ → G β₁) (x : t α₀ β₀) :
    Comp.mk (tsnd f' <$> tfst f x)
      = bitraverse (Comp.mk ∘ map pure ∘ f) (Comp.mk ∘ pure ∘ f') x

{t : Type u → Type u → Type u}
[Bitraversable t]
{F G : Type u → Type u}
[Applicative F]
[Applicative G]
[LawfulBitraversable t]
[LawfulApplicative F]
[LawfulApplicative G]
{α₀ α₁ β₀ β₁ : Type u}
(f : α₀ → F α₁)
(f' : β₀ → G β₁)

Functor.Comp.mk ∘ Functor.map (Bitraversable.tsnd f') ∘ Bitraversable.tfst f =
  bitraverse (Functor.Comp.mk ∘ Functor.map pure ∘ f) (Functor.Comp.mk ∘ pure ∘ f')


theorem symm_apply_rel (e : r ≃r s) {x y} : r (e.symm x) y ↔ s x (e y)

{α : Type u_1}
{β : Type u_2}
{r : α → α → Prop}
{s : β → β → Prop}
(e : r ≃r s)
{x : β}
{y : α}


@[simp]
theorem iInter_mem {β : Sort v} {s : β → Set α} [Finite β] : (⋂ i, s i) ∈ f ↔ ∀ i, s i ∈ f

{α : Type u}
{f : Filter α}
{β : Sort v}
{s : β → Set α}
[Finite β]


/-- The product of two sets of unique differentiability is a set of unique differentiability. -/
theorem UniqueDiffOn.prod {t : Set F} (hs : UniqueDiffOn 𝕜 s) (ht : UniqueDiffOn 𝕜 t) :
    UniqueDiffOn 𝕜 (s ×ˢ t)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{s : Set E}
{t : Set F}
(hs : UniqueDiffOn 𝕜 s)
(ht : UniqueDiffOn 𝕜 t)


theorem ae_le_set_inter {s' t' : Set α} (h : s ≤ᵐ[μ] t) (h' : s' ≤ᵐ[μ] t') :
    (s ∩ s' : Set α) ≤ᵐ[μ] (t ∩ t' : Set α)

{α : Type u_1}
{F : Type u_3}
[FunLike F (Set α) ℝ≥0∞]
[MeasureTheory.OuterMeasureClass F α]
{μ : F}
{s t s' t' : Set α}
(h : s ≤ᵐ[μ] t)
(h' : s' ≤ᵐ[μ] t')


lemma mem_sup_left {I J : TwoSidedIdeal R} {x : R} (h : x ∈ I) :
    x ∈ I ⊔ J

{R : Type u_1}
[NonUnitalNonAssocRing R]
{I J : TwoSidedIdeal R}
{x : R}
(h : x ∈ I)


@[to_additive]
theorem Subgroup.isSubgroup [Group G] (K : Subgroup G) : IsSubgroup (K : Set G)

{G : Type u_1}
[AddGroup G]
(K : AddSubgroup G)


theorem eq_loopyOn_iff : M = loopyOn E ↔ M.E = E ∧ ∀ X ⊆ M.E, M.Indep X → X = ∅

{α : Type u_1}
{M : Matroid α}
{E : Set α}

M = Matroid.loopyOn E ↔ M.E = E ∧ ∀ X ⊆ M.E, M.Indep X → X = ∅


/-- The integral of `f (R⁻¹ • x)` with respect to an additive Haar measure is a multiple of the
integral of `f`. The formula we give works even when `f` is not integrable or `R = 0`
thanks to the convention that a non-integrable function has integral zero. -/
theorem integral_comp_inv_smul (f : E → F) (R : ℝ) :
    ∫ x, f (R⁻¹ • x) ∂μ = |R ^ finrank ℝ E| • ∫ x, f x ∂μ

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[MeasurableSpace E]
[BorelSpace E]
[FiniteDimensional ℝ E]
(μ : MeasureTheory.Measure E)
[μ.IsAddHaarMeasure]
{F : Type u_2}
[NormedAddCommGroup F]
[NormedSpace ℝ F]
(f : E → F)
(R : ℝ)

∫ (x : E), f (R⁻¹ • x) ∂μ = |R ^ FiniteDimensional.finrank ℝ E| • ∫ (x : E), f x ∂μ


@[simp]
theorem restrict_split (h : I ≤ J) (i : ι) (x : ℝ) : (split J i x).restrict I = split I i x

{ι : Type u_1}
{I J : BoxIntegral.Box ι}
(h : I ≤ J)
(i : ι)
(x : ℝ)

(BoxIntegral.Prepartition.split J i x).restrict I = BoxIntegral.Prepartition.split I i x


/-- The constructed pointwise left Kan extension when `HasPointwiseLeftKanExtension L F` holds. -/
@[simps]
noncomputable def pointwiseLeftKanExtension : D ⥤ H

{C : Type u_1}
{D : Type u_2}
{H : Type u_3}
[CategoryTheory.Category.{u_4, u_1} C]
[CategoryTheory.Category.{u_5, u_2} D]
[CategoryTheory.Category.{u_6, u_3} H]
(L : CategoryTheory.Functor C D)
(F : CategoryTheory.Functor C H)
[L.HasPointwiseLeftKanExtension F]
{Y₁ Y₂ : D}
(f : Y₁ ⟶ Y₂)

(L.pointwiseLeftKanExtension F).map f =
  CategoryTheory.Limits.colimit.desc ((CategoryTheory.CostructuredArrow.proj L Y₁).comp F)
    { pt := CategoryTheory.Limits.colimit ((CategoryTheory.CostructuredArrow.proj L Y₂).comp F),
      ι :=
        {
          app := fun g =>
            CategoryTheory.Limits.colimit.ι ((CategoryTheory.CostructuredArrow.proj L Y₂).comp F)
              ((CategoryTheory.CostructuredArrow.map f).obj g),
          naturality := ⋯ } }


theorem Equivalent.pi [Fintype ι] {Q : ∀ i, QuadraticMap R (Mᵢ i) P}
    {Q' : ∀ i, QuadraticMap R (Nᵢ i) P} (e : ∀ i, (Q i).Equivalent (Q' i)) :
    (pi Q).Equivalent (pi Q')

{Q' : (i : ι) → QuadraticMap R (Nᵢ i) P}

(e : ∀ (i : ι), (Q i).Equivalent (Q' i))

(QuadraticMap.pi Q).Equivalent (QuadraticMap.pi Q')


/--
The elimination principle for `Nonempty α`. If `Nonempty α`, and we can
prove `p` given any element `x : α`, then `p` holds. Note that it is essential
that `p` is a `Prop` here; the version with `p` being a `Sort u` is equivalent
to `Classical.choice`.
-/
protected theorem Nonempty.elim {α : Sort u} {p : Prop} (h₁ : Nonempty α) (h₂ : α → p) : p


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

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


/-- An upper bound on the central binomial coefficient used in the proof of Bertrand's postulate.
The bound splits the prime factors of `centralBinom n` into those
1. At most `sqrt (2 * n)`, which contribute at most `2 * n` for each such prime.
2. Between `sqrt (2 * n)` and `2 * n / 3`, which contribute at most `4^(2 * n / 3)` in total.
3. Between `2 * n / 3` and `n`, which do not exist.
4. Between `n` and `2 * n`, which would not exist in the case where Bertrand's postulate is false.
5. Above `2 * n`, which do not exist.
-/
theorem centralBinom_le_of_no_bertrand_prime (n : ℕ) (n_large : 2 < n)
    (no_prime : ¬∃ p : ℕ, Nat.Prime p ∧ n < p ∧ p ≤ 2 * n) :
    centralBinom n ≤ (2 * n) ^ sqrt (2 * n) * 4 ^ (2 * n / 3)

(no_prime : ¬∃ p, Nat.Prime p ∧ n < p ∧ p ≤ 2 * n)

n.centralBinom ≤ (2 * n) ^ (2 * n).sqrt * 4 ^ (2 * n / 3)


@[to_additive sub]
theorem Filter.Tendsto.div' {f g : α → G} {l : Filter α} {a b : G} (hf : Tendsto f l (𝓝 a))
    (hg : Tendsto g l (𝓝 b)) : Tendsto (fun x => f x / g x) l (𝓝 (a / b))

{G : Type w}
{α : Type u}
[TopologicalSpace G]
[Sub G]
[ContinuousSub G]
{f g : α → G}
{l : Filter α}
{a b : G}
(hf : Filter.Tendsto f l (𝓝 a))
(hg : Filter.Tendsto g l (𝓝 b))

Filter.Tendsto (fun x => f x - g x) l (𝓝 (a - b))


lemma QuotSMulTop.map_first_exact_on_four_term_exact_of_isSMulRegular_last
    {M'''} [AddCommGroup M'''] [Module R M''']
    {r : R} {f₁ : M →ₗ[R] M'} {f₂ : M' →ₗ[R] M''} {f₃ : M'' →ₗ[R] M'''}
    (h₁₂ : Exact f₁ f₂) (h₂₃ : Exact f₂ f₃) (h : IsSMulRegular M''' r) :
    Exact (map r f₁) (map r f₂)

{R : Type u_1}
{M : Type u_3}
{M' : Type u_4}
{M'' : Type u_5}
[CommRing R]
[AddCommGroup M]
[Module R M]
[AddCommGroup M']
[Module R M']
[AddCommGroup M'']
[Module R M'']
{M''' : Type u_6}
[AddCommGroup M''']
[Module R M''']
{r : R}
{f₁ : M →ₗ[R] M'}
{f₂ : M' →ₗ[R] M''}
{f₃ : M'' →ₗ[R] M'''}
(h₁₂ : Function.Exact ⇑f₁ ⇑f₂)
(h₂₃ : Function.Exact ⇑f₂ ⇑f₃)
(h : IsSMulRegular M''' r)

Function.Exact ⇑((QuotSMulTop.map r) f₁) ⇑((QuotSMulTop.map r) f₂)


theorem map_ne {x y : P} (h : x ≠ y) : e x ≠ e y

{𝕜 : Type u_1}
{V : Type u_2}
{V₂ : Type u_5}
{P : Type u_10}
{P₂ : Type u_11}
[NormedField 𝕜]
[SeminormedAddCommGroup V]
[NormedSpace 𝕜 V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]
[SeminormedAddCommGroup V₂]
[NormedSpace 𝕜 V₂]
[PseudoMetricSpace P₂]
[NormedAddTorsor V₂ P₂]
(e : P ≃ᵃⁱ[𝕜] P₂)
{x y : P}
(h : x ≠ y)


@[simp]
theorem linear_injective_iff (f : P1 →ᵃ[k] P2) :
    Function.Injective f.linear ↔ Function.Injective f

{k : Type u_1}
{V1 : Type u_2}
{P1 : Type u_3}
{V2 : Type u_4}
{P2 : Type u_5}
[Ring k]
[AddCommGroup V1]
[Module k V1]
[AffineSpace V1 P1]
[AddCommGroup V2]
[Module k V2]
[AffineSpace V2 P2]
(f : P1 →ᵃ[k] P2)

Function.Injective ⇑f.linear ↔ Function.Injective ⇑f


theorem coindep_def : M.Coindep X ↔ M✶.Indep X

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


@[simp] lemma floorDiv_apply (f : ∀ i, π i) (a : α) (i : ι) : (f ⌊/⌋ a) i = f i ⌊/⌋ a

{ι : Type u_1}
{α : Type u_2}
{π : ι → Type u_4}
[OrderedAddCommMonoid α]
[(i : ι) → OrderedAddCommMonoid (π i)]
[(i : ι) → SMulZeroClass α (π i)]
[(i : ι) → FloorDiv α (π i)]
(f : (i : ι) → π i)
(a : α)
(i : ι)


@[to_additive]
theorem coeFn_inv (f : α →ₘ[μ] γ) : ⇑f⁻¹ =ᵐ[μ] f⁻¹

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

↑f⁻¹ =ᵐ[μ] (↑f)⁻¹


theorem restrictScalars_injective :
    Function.Injective (restrictScalars R : (A →ₙₐ[S] B) → A →ₙₐ[R] B)

(R : Type u_1)
{S : Type u_2}
{A : Type u_3}
{B : Type u_4}
[Monoid R]
[Monoid S]
[NonUnitalNonAssocSemiring A]
[NonUnitalNonAssocSemiring B]
[MulAction R S]
[DistribMulAction S A]
[DistribMulAction S B]
[DistribMulAction R A]
[DistribMulAction R B]
[IsScalarTower R S A]
[IsScalarTower R S B]


@[simp, norm_cast]
theorem cpow_natCast (x : ℂ) (n : ℕ) : x ^ (n : ℂ) = x ^ n


theorem uniqueDiffOn_extChartAt_target (x : M) : UniqueDiffOn 𝕜 (extChartAt I x).target

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


theorem changeForm_comp_changeForm :
    (changeForm h').comp (changeForm h) = changeForm (changeForm.add_proof h h')

(h : LinearMap.BilinMap.toQuadraticMap B = Q' - Q)

(h' : LinearMap.BilinMap.toQuadraticMap B' = Q'' - Q')

CliffordAlgebra.changeForm h' ∘ₗ CliffordAlgebra.changeForm h = CliffordAlgebra.changeForm ⋯


theorem subset_range_iff_exists_image_eq {f : α → β} {s : Set β} : s ⊆ range f ↔ ∃ t, f '' t = s

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


@[simp, norm_cast]
lemma intCast_modEq_intCast' {a b : ℤ} {n : ℕ} : a ≡ b [PMOD (n : α)] ↔ a ≡ b [PMOD (n : ℤ)]

{α : Type u_1}
[AddCommGroupWithOne α]
[CharZero α]
{a b : ℤ}
{n : ℕ}


theorem self_invAct_eq_iff_eq {x y : R} : x ◃⁻¹ x = y ◃⁻¹ y ↔ x = y


/-- The functor `Arrow (Arrow C) ⥤ Square C` which sends
a morphism `Arrow.mk f ⟶ Arrow.mk g` to the commutative square
with `f` on the left side and `g` on the right side. -/
@[simps!]
def fromArrowArrowFunctor : Arrow (Arrow C) ⥤ Square C

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

∀ {X Y : CategoryTheory.Arrow (CategoryTheory.Arrow C)} (φ : X ⟶ Y),
  (CategoryTheory.Square.fromArrowArrowFunctor.map φ).τ₃ = φ.left.right


theorem contDiff_apply (i : ι) : ContDiff 𝕜 n fun f : ι → E => f i

(𝕜 : Type u_1)
[NontriviallyNormedField 𝕜]
(E : Type uE)
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{n : ℕ∞}
{ι : Type u_3}
[Fintype ι]
(i : ι)


theorem bddBelow_bddAbove_iff_subset_Icc : BddBelow s ∧ BddAbove s ↔ ∃ a b, s ⊆ Icc a b

BddBelow s ∧ BddAbove s ↔ ∃ a b, s ⊆ Set.Icc a b


theorem le_tsub_of_add_le_right (h : a + b ≤ c) : a ≤ c - b

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


/-- A subgroup `K` includes `closure k` if and only if it includes `k`. -/
@[to_additive (attr := simp)
  "An additive subgroup `K` includes `closure k` if and only if it includes `k`"]
theorem closure_le : closure k ≤ K ↔ k ⊆ K

{G : Type u_1}
[AddGroup G]
(K : AddSubgroup G)
{k : Set G}


@[simp] lemma div_natCast_re (z : ℂ) (n : ℕ) : (z / n).re = z.re / n


theorem C_mul_X_pow_eq_self (h : p.support.card ≤ 1) : C p.leadingCoeff * X ^ p.natDegree = p

{R : Type u}
[Semiring R]
{p : R[X]}
(h : p.support.card ≤ 1)

Polynomial.C p.leadingCoeff * Polynomial.X ^ p.natDegree = p


theorem apply_mem_neighborSet_iff {v w : V} : f w ∈ G'.neighborSet (f v) ↔ w ∈ G.neighborSet v

{V : Type u_1}
{W : Type u_2}
{G : SimpleGraph V}
{G' : SimpleGraph W}
(f : G ↪g G')
{v w : V}


lemma continuous_coinducingCoprod {S : CompHaus.{u}} (x : X.val.obj ⟨S⟩) :
    Continuous fun a ↦ (X.coinducingCoprod ⟨⟨S, x⟩, a⟩)

(X : CondensedSet)
{S : CompHaus}
(x : X.val.obj (Opposite.op S))

Continuous fun a => CondensedSet.coinducingCoprod X ⟨⟨S, x⟩, a⟩


theorem bisim_equiv (R : M P → M P → Prop)
    (h : ∀ x y, R x y → ∃ a f f', M.dest x = ⟨a, f⟩ ∧ M.dest y = ⟨a, f'⟩ ∧ ∀ i, R (f i) (f' i)) :
    ∀ x y, R x y → x = y

(h : ∀ (x y : P.M), R x y → ∃ a f f', x.dest = ⟨a, f⟩ ∧ y.dest = ⟨a, f'⟩ ∧ ∀ (i : P.B a), R (f i) (f' i))


theorem dvd_lcm_right (n m : ℕ+) : m ∣ lcm n m


lemma hasFDerivAt_jacobiTheta₂ (z : ℂ) {τ : ℂ} (hτ : 0 < im τ) :
    HasFDerivAt (fun p : ℂ × ℂ ↦ jacobiTheta₂ p.1 p.2) (jacobiTheta₂_fderiv z τ) (z, τ)

HasFDerivAt (fun p => jacobiTheta₂ p.1 p.2) (jacobiTheta₂_fderiv z τ) (z, τ)


theorem sum_properDivisors_dvd (h : (∑ x ∈ n.properDivisors, x) ∣ n) :
    ∑ x ∈ n.properDivisors, x = 1 ∨ ∑ x ∈ n.properDivisors, x = n

{n : ℕ}
(h : ∑ x ∈ n.properDivisors, x ∣ n)


theorem Ioo_eq_finset_subtype : Ioo a b = (Ioo (a : ℕ) b).fin n

Finset.Ioo a b = Finset.fin n (Finset.Ioo ↑a ↑b)


theorem compatible_of_mem_maximalAtlas {e e' : PartialHomeomorph M H} (he : e ∈ maximalAtlas I M)
    (he' : e' ∈ maximalAtlas I M) : e.symm.trans e' ∈ contDiffGroupoid ∞ I

(he : e ∈ SmoothManifoldWithCorners.maximalAtlas I M)

(he' : e' ∈ SmoothManifoldWithCorners.maximalAtlas I M)


/-- If a vector space has a finite basis, then its dimension (seen as a cardinal) is equal to the
cardinality of the basis. -/
theorem rank_eq_card_basis {ι : Type w} [Fintype ι] (h : Basis ι R M) :
    Module.rank R M = Fintype.card ι

{R : Type u}
{M : Type v}
[Ring R]
[AddCommGroup M]
[Module R M]
[StrongRankCondition R]
{ι : Type w}
[Fintype ι]
(h : Basis ι R M)


@[to_additive (attr := simp)]
theorem inv_mem_iff {S G} [InvolutiveInv G] {_ : SetLike S G} [InvMemClass S G] {H : S}
    {x : G} : x⁻¹ ∈ H ↔ x ∈ H

{S : Type u_5}
{G : Type u_6}
[InvolutiveNeg G]

∀ {x : SetLike S G} [inst : NegMemClass S G] {H : S} {x_1 : G}, -x_1 ∈ H ↔ x_1 ∈ H


theorem coatomic_of_top_compact (h : IsCompactElement (⊤ : α)) : IsCoatomic α

(h : CompleteLattice.IsCompactElement ⊤)


@[trans]
theorem Rel.trans {x y z : α × α} (a : Rel α x y) (b : Rel α y z) : Rel α x z

{α : Type u_1}
{x y z : α × α}
(a : Sym2.Rel α x y)
(b : Sym2.Rel α y z)


theorem pow_dvd_pow_iff {m n : ℤ} {k : ℕ} (k0 : k ≠ 0) : m ^ k ∣ n ^ k ↔ m ∣ n


@[simp]
theorem bernoulli'_three : bernoulli' 3 = 0


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

(X : AlgebraicGeometry.PresheafedSpace C)


protected theorem differentiableOn : DifferentiableOn 𝕜 (fun x => p.eval x) s

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{s : Set 𝕜}
(p : 𝕜[X])

DifferentiableOn 𝕜 (fun x => Polynomial.eval x p) s


theorem setToL1S_smul_left' (T T' : Set α → E →L[ℝ] F) (c : ℝ)
    (h_smul : ∀ s, MeasurableSet s → μ s < ∞ → T' s = c • T s) (f : α →₁ₛ[μ] E) :
    setToL1S T' f = c • setToL1S T f

(h_smul : ∀ (s : Set α), MeasurableSet s → μ s < ⊤ → T' s = c • T s)

(f : ↥(MeasureTheory.Lp.simpleFunc E 1 μ))

MeasureTheory.L1.SimpleFunc.setToL1S T' f = c • MeasureTheory.L1.SimpleFunc.setToL1S T f


@[local simp]
theorem transitionMap_ideal_mk {m n : ℕ} (hmn : m ≤ n) (x : R) :
    transitionMap I R hmn (Ideal.Quotient.mk (I ^ n • ⊤ : Ideal R) x) =
      Ideal.Quotient.mk (I ^ m • ⊤ : Ideal R) x

{R : Type u_1}
[CommRing R]
(I : Ideal R)
{m n : ℕ}
(hmn : m ≤ n)
(x : R)

(AdicCompletion.transitionMap I R hmn) ((Ideal.Quotient.mk (I ^ n • ⊤)) x) = (Ideal.Quotient.mk (I ^ m • ⊤)) x


/-- The cofork which describes the counit of the adjunction: the morphism from the coequalizer of
this pair to this morphism is the counit.
-/
@[simps!]
def counitCofork (B : D) :
    Cofork (F.map (G.map (adj.counit.app B)))
      (adj.counit.app (F.obj (G.obj B)))

(CategoryTheory.Monad.MonadicityInternal.counitCofork adj B).ι.app X =
  CategoryTheory.Limits.WalkingParallelPair.rec
    (CategoryTheory.CategoryStruct.comp (adj.counit.app (F.obj (G.obj B))) (adj.counit.app B)) (adj.counit.app B) X


@[simp]
theorem testBit_ldiff (m n k) : testBit (ldiff m n) k = (testBit m k && not (testBit n k))

(m.ldiff n).testBit k = (m.testBit k && !n.testBit k)


theorem RelEmbedding.image_minimals_eq (f : r ↪r s) (x : Set α) :
    f '' minimals r x = minimals s (f '' x)

{α : Type u_1}
{β : Type u_2}
{r : α → α → Prop}
{s : β → β → Prop}
(f : r ↪r s)
(x : Set α)

⇑f '' minimals r x = minimals s (⇑f '' x)


theorem Ioc_subset_Ioc_left (h : a₁ ≤ a₂) : Ioc a₂ b ⊆ Ioc a₁ b

{α : Type u_2}
[Preorder α]
[LocallyFiniteOrder α]
{a₁ a₂ b : α}
(h : a₁ ≤ a₂)


@[simp]
theorem orthogonalProjection_eq_zero_iff {v : E} : orthogonalProjection K v = 0 ↔ v ∈ Kᗮ

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


theorem comp_assoc (h : Q₃ →qᵢ Q₄) (g : Q₂ →qᵢ Q₃) (f : Q₁ →qᵢ Q₂) :
    (h.comp g).comp f = h.comp (g.comp f)

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


lemma cfcₙAux_id : cfcₙAux hp₁ a ha (ContinuousMapZero.id rfl) = a

{𝕜 : Type u_1}
{A : Type u_2}
[RCLike 𝕜]
[NonUnitalNormedRing A]
[StarRing A]
[NormedSpace 𝕜 A]
[IsScalarTower 𝕜 A A]
[SMulCommClass 𝕜 A A]
[StarModule 𝕜 A]
{p : A → Prop}
{p₁ : Unitization 𝕜 A → Prop}
(hp₁ : ∀ {x : A}, p₁ ↑x ↔ p x)
(a : A)
(ha : p a)
[ContinuousFunctionalCalculus 𝕜 p₁]

(cfcₙAux ⋯ a ha) (ContinuousMapZero.id ⋯) = ↑a


theorem EventuallyLE.mul_le_mul [MulZeroClass β] [PartialOrder β] [PosMulMono β] [MulPosMono β]
    {l : Filter α} {f₁ f₂ g₁ g₂ : α → β} (hf : f₁ ≤ᶠ[l] f₂) (hg : g₁ ≤ᶠ[l] g₂) (hg₀ : 0 ≤ᶠ[l] g₁)
    (hf₀ : 0 ≤ᶠ[l] f₂) : f₁ * g₁ ≤ᶠ[l] f₂ * g₂

{α : Type u}
{β : Type v}
[MulZeroClass β]
[PartialOrder β]
[PosMulMono β]
[MulPosMono β]
{l : Filter α}
{f₁ f₂ g₁ g₂ : α → β}
(hf : f₁ ≤ᶠ[l] f₂)
(hg : g₁ ≤ᶠ[l] g₂)
(hg₀ : 0 ≤ᶠ[l] g₁)
(hf₀ : 0 ≤ᶠ[l] f₂)


theorem mapRoots_bijective [h : Fact (p.Splits (algebraMap F E))] :
    Function.Bijective (mapRoots p E)

[h : Fact (Polynomial.Splits (algebraMap F E) p)]

Function.Bijective (Polynomial.Gal.mapRoots p E)


theorem of_equiv (e : M ≃ₗ[R] N) : Module.Free R N

{R : Type u}
{M : Type v}
{N : Type z}
[Semiring R]
[AddCommMonoid M]
[Module R M]
[Module.Free R M]
[AddCommMonoid N]
[Module R N]
(e : M ≃ₗ[R] N)


theorem Int.sq_mod_four_eq_one_of_odd {x : ℤ} : Odd x → x ^ 2 % 4 = 1


protected theorem nonempty (s : PositiveCompacts α) : (s : Set α).Nonempty

(s : TopologicalSpace.PositiveCompacts α)


/-- The functor `w.CostructuredArrowDownwards g ⥤ w.CostructuredArrowDownwards g'` induced
by a morphism `γ` such that `R.map γ ≫ g = g'`. -/
@[simps]
def costructuredArrowDownwardsPrecomp
    {X₂ X₂' : C₂} {X₃ : C₃} (g : R.obj X₂ ⟶ B.obj X₃) (g' : R.obj X₂' ⟶ B.obj X₃)
    (γ : X₂' ⟶ X₂) (hγ : R.map γ ≫ g = g') :
    w.CostructuredArrowDownwards g ⥤ w.CostructuredArrowDownwards g'

(hγ : CategoryTheory.CategoryStruct.comp (R.map γ) g = g')

(w.costructuredArrowDownwardsPrecomp g g' γ hγ).map φ =
  CategoryTheory.CostructuredArrow.homMk (CategoryTheory.StructuredArrow.homMk φ.left.right ⋯) ⋯


@[simp]
theorem ite_inter_self (t s s' : Set α) : t.ite s s' ∩ t = s ∩ t


theorem disjoint_range_addLeftEmbedding (a b : ℕ) :
    Disjoint (range a) (map (addLeftEmbedding a) (range b))

Disjoint (Finset.range a) (Finset.map (addLeftEmbedding a) (Finset.range b))


theorem emod_nonneg : ∀ (a : Int) {b : Int}, b ≠ 0 → 0 ≤ a % b


@[simp] lemma schnirelmannDensity_univ : schnirelmannDensity Set.univ = 1


@[simp]
theorem invOf_T (n : ℤ) : ⅟ (T n : R[T;T⁻¹]) = T (-n)

⅟(LaurentPolynomial.T n) = LaurentPolynomial.T (-n)


theorem lt_of_toNNReal_lt {r p : ℝ} (h : r.toNNReal < p.toNNReal) : r < p


/-- `HasBiproduct F` expresses the mere existence of a bicone which is
simultaneously a limit and a colimit of the diagram `F`.
-/
class HasBiproduct (F : J → C) : Prop where mk' ::
  exists_biproduct : Nonempty (LimitBicone F)

[self : CategoryTheory.Limits.HasBiproduct F]


@[to_additive (attr := simp)]
theorem mrange_inl_sup_mrange_inr : mrange (inl M N) ⊔ mrange (inr M N) = ⊤

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

MonoidHom.mrange (MonoidHom.inl M N) ⊔ MonoidHom.mrange (MonoidHom.inr M N) = ⊤


@[simp] theorem add_lt_top : a + b < ∞ ↔ a < ∞ ∧ b < ∞


@[reassoc (attr := simp)]
theorem μ_hom_inv_app (i j : M) (X : C) : (F.μ i j).app X ≫ (F.μIso i j).inv.app X = 𝟙 _

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

CategoryTheory.CategoryStruct.comp ((F.μ i j).app X) ((F.μIso i j).inv.app X) =
  CategoryTheory.CategoryStruct.id ((CategoryTheory.MonoidalCategory.tensorObj (F.obj i) (F.obj j)).obj X)


@[simp, deprecated coe_le_coe "Don't mix Option and WithBot" (since := "2024-05-27")]
theorem some_le_some : @LE.le (WithBot α) _ (Option.some a) (Option.some b) ↔ a ≤ b


theorem map_sub_one [AddGroup G] [One G] [AddGroup H] [AddConstMapClass F G H 1 b]
    (f : F) (x : G) : f (x - 1) = f x - b

{F : Type u_1}
{G : Type u_2}
{H : Type u_3}
[FunLike F G H]
{b : H}
[AddGroup G]
[One G]
[AddGroup H]
[AddConstMapClass F G H 1 b]
(f : F)
(x : G)


theorem Subalgebra.isSimpleOrder_of_finrank (hr : finrank F E = 2) :
    IsSimpleOrder (Subalgebra F E)

(hr : FiniteDimensional.finrank F E = 2)


/-- If a function is `C^n` with `1 ≤ n` around a point, then the derivative of `f` at this point
is also a strict derivative. -/
theorem ContDiffAt.hasStrictFDerivAt {f : E' → F'} {x : E'} (hf : ContDiffAt 𝕂 n f x) (hn : 1 ≤ n) :
    HasStrictFDerivAt f (fderiv 𝕂 f x) x

{n : ℕ∞}
{𝕂 : Type u_1}
[RCLike 𝕂]
{E' : Type u_2}
[NormedAddCommGroup E']
[NormedSpace 𝕂 E']
{F' : Type u_3}
[NormedAddCommGroup F']
[NormedSpace 𝕂 F']
{f : E' → F'}
{x : E'}
(hf : ContDiffAt 𝕂 n f x)
(hn : 1 ≤ n)


/-- A universal property of the trivial square-zero extension, providing a unique
`TrivSqZeroExt R M →ₐ[R] A` for every pair of maps `f : R →ₐ[S] A` and `g : M →ₗ[S] A`,
where the range of `g` has no non-zero products, and scaling the input to `g` on the left or right
amounts to a corresponding multiplication by `f` in the output.

This isomorphism is named to match the very similar `Complex.lift`. -/
@[simps! apply symm_apply_coe]
def liftEquiv :
    {fg : (R →ₐ[S] A) × (M →ₗ[S] A) //
      (∀ x y, fg.2 x * fg.2 y = 0) ∧
      (∀ r x, fg.2 (r •> x) = fg.1 r * fg.2 x) ∧
      (∀ r x, fg.2 (x <• r) = fg.2 x * fg.1 r)} ≃ (tsze R M →ₐ[S] A)

TrivSqZeroExt.liftEquiv fg = TrivSqZeroExt.lift (↑fg).1 (↑fg).2 ⋯ ⋯ ⋯


@[simp]
theorem sInf_toAddSubmonoid (s : Set (Subsemiring R)) :
    (sInf s).toAddSubmonoid = ⨅ t ∈ s, Subsemiring.toAddSubmonoid t

{R : Type u}
[NonAssocSemiring R]
(s : Set (Subsemiring R))

(sInf s).toAddSubmonoid = ⨅ t ∈ s, t.toAddSubmonoid


@[to_additive]
theorem map_iInf_comap_of_surjective (S : ι → Submonoid N) : (⨅ i, (S i).comap f).map f = iInf S

{M : Type u_1}
{N : Type u_2}
[MulOneClass M]
[MulOneClass N]
{F : Type u_4}
[FunLike F M N]
[mc : MonoidHomClass F M N]
{ι : Type u_5}
{f : F}
(hf : Function.Surjective ⇑f)
(S : ι → Submonoid N)

Submonoid.map f (⨅ i, Submonoid.comap f (S i)) = iInf S


/-- A `ModuleFilterBasis` on a module is a `FilterBasis` satisfying some additional axioms.
  Example : if `M` is a topological module then the neighbourhoods of zero are a
  `ModuleFilterBasis`. Conversely given a `ModuleFilterBasis` one can define a topology
  compatible with the module structure on `M`. -/
structure ModuleFilterBasis (R M : Type*) [CommRing R] [TopologicalSpace R] [AddCommGroup M]
  [Module R M] extends AddGroupFilterBasis M where
  smul' : ∀ {U}, U ∈ sets → ∃ V ∈ 𝓝 (0 : R), ∃ W ∈ sets, V • W ⊆ U
  smul_left' : ∀ (x₀ : R) {U}, U ∈ sets → ∃ V ∈ sets, V ⊆ (fun x ↦ x₀ • x) ⁻¹' U
  smul_right' : ∀ (m₀ : M) {U}, U ∈ sets → ∀ᶠ x in 𝓝 (0 : R), x • m₀ ∈ U

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[TopologicalSpace R]
[AddCommGroup M]
[Module R M]
(self : ModuleFilterBasis R M)
(m₀ : M)
{U : Set M}

U ∈ AddGroupFilterBasis.toFilterBasis.sets → ∀ᶠ (x : R) in 𝓝 0, x • m₀ ∈ U


/-- Constructs an isomorphism of lattices from an order isomorphism between them. -/
@[simps]
def Iso.mk {α β : SemilatInfCat.{u}} (e : α ≃o β) : α ≅ β

{α β : SemilatInfCat}
(e : α.X ≃o β.X)
(a : α.X)

(SemilatInfCat.Iso.mk e).hom.toInfHom a = e a


/-- If an order automorphism `fa` is semiconjugate to an order embedding `fb` by a function `g`
and `g'` is an order right adjoint of `g` (i.e. `g' y = sSup {x | f x ≤ y}`), then `fb` is
semiconjugate to `fa` by `g'`.

This is a version of Proposition 2.1 from [Étienne Ghys, Groupes d'homéomorphismes du cercle et
cohomologie bornée][ghys87:groupes]. -/
theorem Semiconj.symm_adjoint [PartialOrder α] [Preorder β] {fa : α ≃o α} {fb : β ↪o β} {g : α → β}
    (h : Function.Semiconj g fa fb) {g' : β → α} (hg' : IsOrderRightAdjoint g g') :
    Function.Semiconj g' fb fa

{α : Type u_1}
{β : Type u_2}
[PartialOrder α]
[Preorder β]
{fa : α ≃o α}
{fb : β ↪o β}
{g : α → β}
(h : Function.Semiconj g ⇑fa ⇑fb)
{g' : β → α}
(hg' : IsOrderRightAdjoint g g')


theorem succ_ne_zero (c : Cardinal) : succ c ≠ 0


lemma tendsto_atTop_r_real (i : α) : Tendsto (fun n => (r i n : ℝ)) atTop atTop

{α : Type u_1}
[Fintype α]
[Nonempty α]
{T : ℕ → ℝ}
{g : ℝ → ℝ}
{a b : α → ℝ}
{r : α → ℕ → ℕ}
(R : AkraBazziRecurrence T g a b r)
(i : α)

Filter.Tendsto (fun n => ↑(r i n)) Filter.atTop Filter.atTop


theorem finite_int_iff {a b : ℤ} : Finite a b ↔ a.natAbs ≠ 1 ∧ b ≠ 0

multiplicity.Finite a b ↔ a.natAbs ≠ 1 ∧ b ≠ 0


protected theorem eq_of_lt_succ_of_not_lt (hmn : m < n + 1) (h : ¬ m < n) : m = n

{m n : Nat}
(hmn : m < n + 1)
(h : ¬m < n)


theorem eq_of_locally_eq₂ {U₁ U₂ V : Opens X} (i₁ : U₁ ⟶ V) (i₂ : U₂ ⟶ V) (hcover : V ≤ U₁ ⊔ U₂)
    (s t : F.1.obj (op V)) (h₁ : F.1.map i₁.op s = F.1.map i₁.op t)
    (h₂ : F.1.map i₂.op s = F.1.map i₂.op t) : s = t

(s t : (CategoryTheory.forget C).obj (F.val.obj (Opposite.op V)))

(h₁ : (F.val.map i₁.op) s = (F.val.map i₁.op) t)

(h₂ : (F.val.map i₂.op) s = (F.val.map i₂.op) t)


theorem Ideal.span_singleton_nonZeroDivisors {R : Type*} [CommSemiring R] [NoZeroDivisors R]
    {r : R} : span {r} ∈ (Ideal R)⁰ ↔ r ∈ R⁰

{R : Type u_1}
[CommSemiring R]
[NoZeroDivisors R]
{r : R}

Ideal.span {r} ∈ nonZeroDivisors (Ideal R) ↔ r ∈ nonZeroDivisors R


/-- Shifting by `i` and shifting by `j` forms an equivalence when `i + j = 0`. -/
@[simps]
def shiftEquiv' (i j : A) (h : i + j = 0) : C ≌ C

(C : Type u)
{A : Type u_1}
[CategoryTheory.Category.{v, u} C]
[AddGroup A]
[CategoryTheory.HasShift C A]
(i j : A)
(h : i + j = 0)

(CategoryTheory.shiftEquiv' C i j h).unitIso = (CategoryTheory.shiftFunctorCompIsoId C i j h).symm


lemma Prime.one_le {p : ℕ} (hp : p.Prime) : 1 ≤ p


theorem norm_comp_le (g : NormedAddGroupHom V₂ V₃) (f : NormedAddGroupHom V₁ V₂) :
    ‖g.comp f‖ ≤ ‖g‖ * ‖f‖

{V₁ : Type u_2}
{V₂ : Type u_3}
{V₃ : Type u_4}
[SeminormedAddCommGroup V₁]
[SeminormedAddCommGroup V₂]
[SeminormedAddCommGroup V₃]
(g : NormedAddGroupHom V₂ V₃)
(f : NormedAddGroupHom V₁ V₂)


theorem tendsto_nhds_top_iff_real {α : Type*} {m : α → EReal} {f : Filter α} :
    Tendsto m f (𝓝 ⊤) ↔ ∀ x : ℝ, ∀ᶠ a in f, ↑x < m a

{α : Type u_2}
{m : α → EReal}
{f : Filter α}

Filter.Tendsto m f (𝓝 ⊤) ↔ ∀ (x : ℝ), ∀ᶠ (a : α) in f, ↑x < m a


lemma CompleteSpace.snd_of_prod [UniformSpace β] [CompleteSpace (α × β)] [h : Nonempty α] :
    CompleteSpace β

{α : Type u}
{β : Type v}
[uniformSpace : UniformSpace α]
[UniformSpace β]
[CompleteSpace (α × β)]
[h : Nonempty α]


/-- If a map between pseudoemetric spaces is a uniform embedding then the edistance between `f x`
and `f y` is controlled in terms of the distance between `x` and `y`.

In fact, this lemma holds for a `UniformInducing` map.
TODO: generalize? -/
theorem controlled_of_uniformEmbedding [PseudoEMetricSpace β] {f : α → β} (h : UniformEmbedding f) :
    (∀ ε > 0, ∃ δ > 0, ∀ {a b : α}, edist a b < δ → edist (f a) (f b) < ε) ∧
      ∀ δ > 0, ∃ ε > 0, ∀ {a b : α}, edist (f a) (f b) < ε → edist a b < δ

{α : Type u}
{β : Type v}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
{f : α → β}
(h : UniformEmbedding f)


theorem appIso_hom (U) :
    (f.appIso U).hom = f.app (f ''ᵁ U) ≫ X.presheaf.map
      (eqToHom (preimage_image_eq f U).symm).op

[H : AlgebraicGeometry.IsOpenImmersion f]

(f.appIso U).hom = f.app (f.opensFunctor.obj U) ≫ X.presheaf.map (CategoryTheory.eqToHom ⋯).op


theorem domLCongr_single {α₁ : Type*} {α₂ : Type*} (e : α₁ ≃ α₂) (i : α₁) (m : M) :
    (Finsupp.domLCongr e : _ ≃ₗ[R] _) (Finsupp.single i m) = Finsupp.single (e i) m

{M : Type u_2}
{R : Type u_5}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{α₁ : Type u_7}
{α₂ : Type u_8}
(e : α₁ ≃ α₂)
(i : α₁)
(m : M)

(Finsupp.domLCongr e) (Finsupp.single i m) = Finsupp.single (e i) m


theorem ω_pow_eq_neg_one (p' : ℕ) (h : lucasLehmerResidue (p' + 2) = 0) :
    (ω : X (q (p' + 2))) ^ 2 ^ (p' + 1) = -1


@[to_additive (attr := simp)]
theorem toWord_inj {x y : FreeGroup α} : toWord x = toWord y ↔ x = y

{α : Type u}
[DecidableEq α]
{x y : FreeGroup α}


@[simp]
theorem mem_bot (x : M) : x ∈ (⊥ : LieSubmodule R L M) ↔ x = 0

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


theorem dist_le (hf : HolderWith C r f) (x y : X) : dist (f x) (f y) ≤ C * dist x y ^ (r : ℝ)

{X : Type u_1}
{Y : Type u_2}
[PseudoMetricSpace X]
[PseudoMetricSpace Y]
{C r : ℝ≥0}
{f : X → Y}
(hf : HolderWith C r f)
(x y : X)


@[simp] theorem map_comp_map (f' : α' → α'') (g' : β' → β'') (f : α → α') (g : β → β') :
    Sum.map f' g' ∘ Sum.map f g = Sum.map (f' ∘ f) (g' ∘ g)


/-- A set in a σ-finite space has positive measure if and only if its intersection with
some member of the countable family of finite measure spanning sets has positive measure. -/
theorem exists_measure_inter_spanningSets_pos [MeasurableSpace α] {μ : Measure α} [SigmaFinite μ]
    (s : Set α) : (∃ n, 0 < μ (s ∩ spanningSets μ n)) ↔ 0 < μ s

{α : Type u_1}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
[MeasureTheory.SigmaFinite μ]
(s : Set α)

(∃ n, 0 < μ (s ∩ MeasureTheory.spanningSets μ n)) ↔ 0 < μ s


@[simp]
theorem pullback_map_self [HasPullbacks C] (f : X ⟶ Y) [Mono f] (g : Subobject X) :
    (pullback f).obj ((map f).obj g) = g

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

(CategoryTheory.Subobject.pullback f).obj ((CategoryTheory.Subobject.map f).obj g) = g


theorem rpow_nonneg {x : ℝ} (hx : 0 ≤ x) (y : ℝ) : 0 ≤ x ^ y


@[simp]
theorem nnnorm_col (v : m → α) : ‖col ι v‖₊ = ‖v‖₊

{m : Type u_3}
{α : Type u_5}
{ι : Type u_7}
[Fintype m]
[Unique ι]
[SeminormedAddCommGroup α]
(v : m → α)


lemma isEquivalence_iff : G.IsEquivalence ↔ G'.IsEquivalence

{W₁ : CategoryTheory.MorphismProperty C₁}

{W₂ : CategoryTheory.MorphismProperty C₂}

(Φ : CategoryTheory.LocalizerMorphism W₁ W₂)

[CategoryTheory.CatCommSq Φ.functor L₁ L₂ G]

[CategoryTheory.CatCommSq Φ.functor L₁' L₂' G']


theorem sub_one_pow_totient_le_cyclotomic_eval {q : ℝ} (hq' : 1 < q) :
    ∀ n, (q - 1) ^ totient n ≤ (cyclotomic n ℝ).eval q

(q - 1) ^ n.totient ≤ Polynomial.eval q (Polynomial.cyclotomic n ℝ)


/-- The braiding isomorphism which swaps a binary biproduct. -/
@[simps]
def biprod.braiding (P Q : C) : P ⊞ Q ≅ Q ⊞ P

(CategoryTheory.Limits.biprod.braiding P Q).hom =
  CategoryTheory.Limits.biprod.lift CategoryTheory.Limits.biprod.snd CategoryTheory.Limits.biprod.fst


theorem liftOrGet_choice {f : α → α → α} (h : ∀ a b, f a b = a ∨ f a b = b) :
    ∀ o₁ o₂, liftOrGet f o₁ o₂ = o₁ ∨ liftOrGet f o₁ o₂ = o₂

{f : α → α → α}

(h : ∀ (a b : α), f a b = a ∨ f a b = b)

Option.liftOrGet f o₁ o₂ = o₁ ∨ Option.liftOrGet f o₁ o₂ = o₂


@[simp]
lemma rightHomologyMap'_id (h : S.RightHomologyData) :
    rightHomologyMap' (𝟙 S) h h = 𝟙 _

CategoryTheory.ShortComplex.rightHomologyMap' (CategoryTheory.CategoryStruct.id S) h h =
  CategoryTheory.CategoryStruct.id h.H


theorem Algebra.IsPushout.comm : Algebra.IsPushout R S R' S' ↔ Algebra.IsPushout R R' S S'

(R : Type u_1)
(S : Type v₃)
[CommSemiring R]
[CommSemiring S]
[Algebra R S]
(R' : Type u_6)
(S' : Type u_7)
[CommSemiring R']
[CommSemiring S']
[Algebra R R']
[Algebra S S']
[Algebra R' S']
[Algebra R S']
[IsScalarTower R R' S']
[IsScalarTower R S S']


@[simp]
theorem zero_apply (z : ℍ) : (0 : ModularForm Γ k) z = 0


theorem limsup_sdiff (a : α) : limsup u f \ a = limsup (fun b => u b \ a) f

{α : Type u_1}
{β : Type u_2}
[CompleteBooleanAlgebra α]
(f : Filter β)
(u : β → α)
(a : α)

Filter.limsup u f \ a = Filter.limsup (fun b => u b \ a) f


lemma inv_eq_conj (hz : ‖z‖ = 1) : z⁻¹ = conj z

{K : Type u_1}
[RCLike K]
{z : K}
(hz : ‖z‖ = 1)


/-- A class guaranteeing that the non-unital continuous functional calculus is uniquely determined
by the properties that it is a continuous non-unital star algebra homomorphism mapping the
(restriction of) the identity to `a`. This is the necessary tool used to establish `cfcₙHom_comp`
and the more common variant `cfcₙ_comp`.

This class will have instances in each of the common cases `ℂ`, `ℝ` and `ℝ≥0` as a consequence of
the Stone-Weierstrass theorem. -/
class UniqueNonUnitalContinuousFunctionalCalculus (R A : Type*) [CommSemiring R] [StarRing R]
    [MetricSpace R] [TopologicalSemiring R] [ContinuousStar R] [NonUnitalRing A] [StarRing A]
    [TopologicalSpace A] [Module R A] [IsScalarTower R A A] [SMulCommClass R A A] : Prop where
  eq_of_continuous_of_map_id (s : Set R) [CompactSpace s] [Zero s] (h0 : (0 : s) = (0 : R))
    (φ ψ : C(s, R)₀ →⋆ₙₐ[R] A) (hφ : Continuous φ) (hψ : Continuous ψ)
    (h : φ (⟨.restrict s <| .id R, h0⟩) = ψ (⟨.restrict s <| .id R, h0⟩)) :
    φ = ψ
  compactSpace_quasispectrum (a : A) : CompactSpace (σₙ R a)

[self : UniqueNonUnitalContinuousFunctionalCalculus R A]

(h :
  φ { toContinuousMap := ContinuousMap.restrict s (ContinuousMap.id R), map_zero' := h0 } =
    ψ { toContinuousMap := ContinuousMap.restrict s (ContinuousMap.id R), map_zero' := h0 })


@[simp]
theorem coe_prodComm_symm : ⇑(prodComm : R × S ≃+* S × R).symm = Prod.swap

{R : Type u_3}
{S : Type u_5}
[NonAssocSemiring R]
[NonAssocSemiring S]


@[to_additive]
theorem val_mk (a : α) (b h₁ h₂) : ↑(Units.mk a b h₁ h₂) = a

{α : Type u}
[Monoid α]
(a b : α)
(h₁ : a * b = 1)
(h₂ : b * a = 1)

↑{ val := a, inv := b, val_inv := h₁, inv_val := h₂ } = a


/-- A functor between categories induces a functor between
the categories of `G`-actions within those categories. -/
@[simps]
def mapAction (F : V ⥤ W) (G : MonCat.{u}) : Action V G ⥤ Action W G

{V : Type (u + 1)}
[CategoryTheory.LargeCategory V]
{W : Type (u + 1)}
[CategoryTheory.LargeCategory W]
(F : V ⥤ W)
(G : MonCat)
(M : Action V G)
(g : ↑G)

((F.mapAction G).obj M).ρ g = F.map (M.ρ g)


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

{α : Type u_3}
{E : Type u_6}
[SeminormedAddGroup E]
[TopologicalSpace α]
{f : α → E}
{s : Set α}
(h : ContinuousOn f s)


@[simp]
theorem inversion_eq_center' : inversion c R x = c ↔ x = c ∨ R = 0

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{c x : P}
{R : ℝ}

EuclideanGeometry.inversion c R x = c ↔ x = c ∨ R = 0


theorem reflect_C_mul_X_pow (N n : ℕ) {c : R} : reflect N (C c * X ^ n) = C c * X ^ revAt N n

{R : Type u_1}
[Semiring R]
(N n : ℕ)
{c : R}

Polynomial.reflect N (Polynomial.C c * Polynomial.X ^ n) = Polynomial.C c * Polynomial.X ^ (Polynomial.revAt N) n


@[simp]
theorem mk_one (h : (1 : α) ∈ Ioc (0 : α) 1) : (⟨1, h⟩ : Ioc (0 : α) 1) = 1

{α : Type u_1}
[StrictOrderedSemiring α]
(h : 1 ∈ Set.Ioc 0 1)


/-- There is a natural equivalence when swapping the coefficients of a quaternion algebra. -/
@[simps]
def swapEquiv : ℍ[R,c₁,c₂] ≃ₐ[R] ℍ[R, c₂, c₁]

{R : Type u_3}
[CommRing R]
(c₁ c₂ : R)
(t : ℍ[R,c₂,c₁])

((QuaternionAlgebra.swapEquiv c₁ c₂).symm t).imJ = t.imI


@[simp]
theorem bitCasesOn_bit1 {C : ℕ → Sort u} (H : ∀ b n, C (bit b n)) (n : ℕ) :
    bitCasesOn (2 * n + 1) H = H true n

(H : (b : Bool) → (n : ℕ) → C (Nat.bit b n))


theorem normalCore_le (H : Subgroup G) : H.normalCore ≤ H

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


/-- We can inflate a set `s` to any bigger size. -/
lemma Finset.exists_superset_card_eq [Fintype α] {n : ℕ} {s : Finset α} (hsn : s.card ≤ n)
    (hnα : n ≤ Fintype.card α) :
    ∃ t, s ⊆ t ∧ t.card = n

{α : Type u_1}
[Fintype α]
{n : ℕ}
{s : Finset α}
(hsn : s.card ≤ n)
(hnα : n ≤ Fintype.card α)


theorem insert_mem_upShadow (hs : s ∈ 𝒜) (ha : a ∉ s) : insert a s ∈ ∂⁺ 𝒜

{α : Type u_1}
[DecidableEq α]
[Fintype α]
{𝒜 : Finset (Finset α)}
{s : Finset α}
{a : α}
(hs : s ∈ 𝒜)
(ha : a ∉ s)


@[to_additive]
lemma mulIndicator_le_mulIndicator_of_subset (h : s ⊆ t) (hf : ∀ a, 1 ≤ f a) (a : α) :
    mulIndicator s f a ≤ mulIndicator t f a

{α : Type u_2}
{M : Type u_4}
[Preorder M]
[One M]
{s t : Set α}
{f : α → M}
(h : s ⊆ t)
(hf : ∀ (a : α), 1 ≤ f a)
(a : α)


@[simp] lemma ker_inf (f g : Filter α) : ker (f ⊓ g) = ker f ∩ ker g


/-- The number of fixed points of a `p ^ n`-th root of the identity function over a finite set
and the set's cardinality have the same residue modulo `p`, where `p` is a prime. -/
theorem card_fixedPoints_modEq [DecidableEq α] {f : Function.End α} {p n : ℕ}
    [hp : Fact p.Prime] (hf : f ^ p ^ n = 1) :
    Fintype.card α ≡ Fintype.card f.fixedPoints [MOD p]

{α : Type u_1}
[Fintype α]
[DecidableEq α]
{f : Function.End α}
{p n : ℕ}
[hp : Fact (Nat.Prime p)]
(hf : f ^ p ^ n = 1)

Fintype.card α ≡ Fintype.card ↑(Function.fixedPoints f) [MOD p]


/-- If a sequence of almost everywhere strongly measurable functions converges almost everywhere,
one can select a strongly measurable function as the almost everywhere limit. -/
theorem _root_.exists_stronglyMeasurable_limit_of_tendsto_ae [PseudoMetrizableSpace β]
    {f : ℕ → α → β} (hf : ∀ n, AEStronglyMeasurable (f n) μ)
    (h_ae_tendsto : ∀ᵐ x ∂μ, ∃ l : β, Tendsto (fun n => f n x) atTop (𝓝 l)) :
    ∃ f_lim : α → β, StronglyMeasurable f_lim ∧
      ∀ᵐ x ∂μ, Tendsto (fun n => f n x) atTop (𝓝 (f_lim x))

{f : ℕ → α → β}

(hf : ∀ (n : ℕ), MeasureTheory.AEStronglyMeasurable (f n) μ)

(h_ae_tendsto : ∀ᵐ (x : α) ∂μ, ∃ l, Filter.Tendsto (fun n => f n x) Filter.atTop (𝓝 l))

∃ f_lim,
  MeasureTheory.StronglyMeasurable f_lim ∧ ∀ᵐ (x : α) ∂μ, Filter.Tendsto (fun n => f n x) Filter.atTop (𝓝 (f_lim x))


@[to_additive (attr := simp, norm_cast)]
theorem toOpens_inf : (↑(U ⊓ V) : Opens G) = ↑U ⊓ ↑V

{G : Type u_1}
[AddGroup G]
[TopologicalSpace G]
{U V : OpenAddSubgroup G}


theorem bot_sets_eq : (⊥ : Filter α).sets = univ


@[simp]
theorem biInter_finset_mem {β : Type v} {s : β → Set α} (is : Finset β) :
    (⋂ i ∈ is, s i) ∈ f ↔ ∀ i ∈ is, s i ∈ f

{α : Type u}
{f : Filter α}
{β : Type v}
{s : β → Set α}
(is : Finset β)


@[simp]
lemma pow_right_inj (ha₀ : 0 < a) (ha₁ : a ≠ 1) : a ^ m = a ^ n ↔ m = n

{R : Type u_3}
[LinearOrderedSemiring R]
{a : R}
{m n : ℕ}
(ha₀ : 0 < a)
(ha₁ : a ≠ 1)


@[simp, norm_cast]
theorem sqrt_intCast (z : ℤ) : Rat.sqrt (z : ℚ) = Int.sqrt z


protected theorem add_right_cancel_iff {a b c : PartENat} (hc : c ≠ ⊤) : a + c = b + c ↔ a = b


/--
The rule set used by an Aesop tactic call. A local rule set is produced by
combining several global rule sets and possibly adding or erasing some
individual rules.
-/
structure LocalRuleSet extends BaseRuleSet where
  /--
  The simp theorems used by the builtin norm simp rule.
  -/
  simpTheoremsArray : Array (Name × SimpTheorems)
  /--
  The simp theorems array must contain at least one `SimpTheorems` structure.
  When a simp theorem is added to a `LocalRuleSet`, it is stored in this first
  `SimpTheorems` structure.
  -/
  simpTheoremsArrayNonempty : 0 < simpTheoremsArray.size
  /--
  The simprocs used by the builtin norm simp rule.
  -/
  simprocsArray : Array (Name × Simprocs)
  /--
  The simprocs array must contain at least one `Simprocs` structure, for the
  same reason as above.
  -/
  simprocsArrayNonempty : 0 < simprocsArray.size
  /--
  FVars that were explicitly added as simp rules.
  -/
  localNormSimpRules : Array LocalNormSimpRule


@[to_additive (attr := simp)]
lemma UniformOnFun.ofFun_div [Div β] (f g : α → β) : ofFun 𝔖 (f / g) = ofFun 𝔖 f / ofFun 𝔖 g

{α : Type u_1}
{β : Type u_2}
{𝔖 : Set (Set α)}
[Sub β]
(f g : α → β)

(UniformOnFun.ofFun 𝔖) (f - g) = (UniformOnFun.ofFun 𝔖) f - (UniformOnFun.ofFun 𝔖) g


theorem transpose_map {f : α → β} {M : Matrix m n α} : Mᵀ.map f = (M.map f)ᵀ

{m : Type u_2}
{n : Type u_3}
{α : Type v}
{β : Type w}
{f : α → β}
{M : Matrix m n α}


/-- The supremum of 2 equivalence relations r and s is the equivalence closure of the
    supremum of the underlying binary operations. -/
theorem sup_def {r s : Setoid α} : r ⊔ s = EqvGen.Setoid (r.Rel ⊔ s.Rel)


theorem isLocalizedModule_toPushforwardStalkAlgHom_aux (y) :
    ∃ x : S × p.asIdeal.primeCompl, x.2 • y = toPushforwardStalkAlgHom R S p x.1

(y :
  ↑(((TopCat.Presheaf.pushforward CommRingCat (AlgebraicGeometry.Spec.topMap (algebraMap ↑R ↑S))).obj
          (AlgebraicGeometry.Spec.structureSheaf ↑S).val).stalk
      p))

∃ x, x.2 • y = (AlgebraicGeometry.StructureSheaf.toPushforwardStalkAlgHom R S p) x.1


/-- If `a ≤ b`, then `(-∞, a) ⊆ (-∞, b)`. In preorders, this is just an implication. If you need
the equivalence in linear orders, use `Iio_subset_Iio_iff`. -/
@[gcongr]
theorem Iio_subset_Iio (h : a ≤ b) : Iio a ⊆ Iio b

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


theorem norm_def (f : Lp E p μ) : ‖f‖ = ENNReal.toReal (eLpNorm f p μ)

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

‖f‖ = (MeasureTheory.eLpNorm (↑↑f) p μ).toReal


theorem hasDerivWithinAt_congr_set' {s t : Set 𝕜} (y : 𝕜) (h : s =ᶠ[𝓝[{y}ᶜ] x] t) :
    HasDerivWithinAt f f' s x ↔ HasDerivWithinAt f f' t x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : 𝕜 → F}
{f' : F}
{x : 𝕜}
{s t : Set 𝕜}
(y : 𝕜)
(h : s =ᶠ[𝓝[{y}ᶜ] x] t)


private theorem start_path : f x₀ = g x₂

{X₁ X₂ Y : TopCat}
{f : C(↑X₁, ↑Y)}
{g : C(↑X₂, ↑Y)}
{x₀ x₁ : ↑X₁}
{x₂ x₃ : ↑X₂}
{p : Path x₀ x₁}
{q : Path x₂ x₃}
(hfg : ∀ (t : ↑I), f (p t) = g (q t))


/-- If two partial equivs are equivalent, so are their inverses. -/
theorem EqOnSource.symm' {e e' : PartialEquiv α β} (h : e ≈ e') : e.symm ≈ e'.symm

{α : Type u_1}
{β : Type u_2}
{e e' : PartialEquiv α β}
(h : e ≈ e')


/-- To construct an isomorphism of structured arrows,
we need an isomorphism of the objects underlying the target,
and to check that the triangle commutes.
-/
@[simps!]
def isoMk {f f' : StructuredArrow S T} (g : f.right ≅ f'.right)
    (w : f.hom ≫ T.map g.hom = f'.hom := by aesop_cat) :
    f ≅ f'

{f f' : CategoryTheory.StructuredArrow S T}

(w : CategoryTheory.CategoryStruct.comp f.hom (T.map g.hom) = f'.hom := by aesop_cat)


@[reassoc]
theorem pentagon_hom_inv {W X Y Z : C} :
    (α_ W X (Y ⊗ Z)).hom ≫ (𝟙 W ⊗ (α_ X Y Z).inv) =
      (α_ (W ⊗ X) Y Z).inv ≫ ((α_ W X Y).hom ⊗ 𝟙 Z) ≫ (α_ W (X ⊗ Y) Z).hom

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

(CategoryTheory.MonoidalCategory.associator W X (CategoryTheory.MonoidalCategory.tensorObj Y Z)).hom ≫
    CategoryTheory.MonoidalCategory.tensorHom (𝟙 W) (CategoryTheory.MonoidalCategory.associator X Y Z).inv =
  (CategoryTheory.MonoidalCategory.associator (CategoryTheory.MonoidalCategory.tensorObj W X) Y Z).inv ≫
    CategoryTheory.MonoidalCategory.tensorHom (CategoryTheory.MonoidalCategory.associator W X Y).hom (𝟙 Z) ≫
      (CategoryTheory.MonoidalCategory.associator W (CategoryTheory.MonoidalCategory.tensorObj X Y) Z).hom


/-- `BoundedOrderHomClass F α β` states that `F` is a type of bounded order morphisms.

You should extend this class when you extend `BoundedOrderHom`. -/
class BoundedOrderHomClass (F α β : Type*) [LE α] [LE β]
  [BoundedOrder α] [BoundedOrder β] [FunLike F α β]
  extends RelHomClass F ((· ≤ ·) : α → α → Prop) ((· ≤ ·) : β → β → Prop) : Prop where
  /-- Morphisms preserve the top element. The preferred spelling is `_root_.map_top`. -/
  map_top (f : F) : f ⊤ = ⊤
  /-- Morphisms preserve the bottom element. The preferred spelling is `_root_.map_bot`. -/
  map_bot (f : F) : f ⊥ = ⊥

{F : Type u_6}
{α : Type u_7}
{β : Type u_8}
[LE α]
[LE β]
[BoundedOrder α]
[BoundedOrder β]
[FunLike F α β]
[self : BoundedOrderHomClass F α β]
(f : F)


theorem ext_iff {χ χ' : MulChar R R'} : χ = χ' ↔ ∀ a : Rˣ, χ a = χ' a

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


{R : Type u_1}
[Semiring R]
{m n : ℕ}
{f : R[X]}
{r : R}
(h : f.coeff m = r)
(natDeg_eq_coeff : m = n)


@[simp]
theorem objEqToHom_refl (i : β) : X.objEqToHom (refl i) = 𝟙 _

(X : CategoryTheory.DifferentialObject ℤ (CategoryTheory.GradedObjectWithShift b V))


@[to_additive]
theorem div_le_inv_mul_iff [CovariantClass α α (swap (· * ·)) (· ≤ ·)] :
    a / b ≤ a⁻¹ * b ↔ a ≤ b

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

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


theorem coe_mul {n : Nat} : ∀ a b : Fin n, ((a * b : Fin n) : Nat) = a * b % n


protected theorem coe_injective : Injective ((↑) : ℚ≥0 → ℚ)


theorem reflectsEpimorphisms.of_iso {F G : C ⥤ D} [ReflectsEpimorphisms F] (α : F ≅ G) :
    ReflectsEpimorphisms G

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


theorem card_filter_univ_eq_vector_get_eq_count [DecidableEq α] (a : α) (v : Vector α n) :
    (univ.filter fun i => a = v.get i).card = v.toList.count a

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

(Finset.filter (fun i => a = v.get i) Finset.univ).card = List.count a v.toList


@[simp]
theorem star_algebraMap (r : R) : star (algebraMap R (FreeAlgebra R X) r) = algebraMap R _ r

{R : Type u_1}
[CommSemiring R]
{X : Type u_2}
(r : R)

star ((algebraMap R (FreeAlgebra R X)) r) = (algebraMap R (FreeAlgebra R X)) r


/-- `CutExpand r` is well-founded when `r` is. -/
theorem _root_.WellFounded.cutExpand (hr : WellFounded r) : WellFounded (CutExpand r)

{α : Type u_1}
{r : α → α → Prop}
(hr : WellFounded r)


@[simp]
theorem inv_hom_id_app_apply (α : F ≅ G) (X) (x) : α.hom.app X (α.inv.app X x) = x

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


@[to_additive (attr := simp)] theorem snd_comp_inl : (snd : M ∗ N →* N).comp inl = 1

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

Monoid.Coprod.snd.comp Monoid.Coprod.inl = 1


@[to_additive (attr := simp)] theorem MonoidHom.comp_id_monCat
    {G : MonCat.{u}} {H : Type u} [Monoid H] (f : G →* H) : f.comp (𝟙 G) = f

{G : MonCat}
{H : Type u}
[Monoid H]
(f : ↑G →* H)


lemma lt_succAbove_iff_lt_castSucc (p : Fin (n + 1)) (i : Fin n) :
    p < p.succAbove i ↔ p < succ i


@[simp]
theorem coeff_C_mul (n : ℕ) (φ : R⟦X⟧) (a : R) : coeff R n (C R a * φ) = a * coeff R n φ

{R : Type u_1}
[Semiring R]
(n : ℕ)
(φ : PowerSeries R)
(a : R)

(PowerSeries.coeff R n) ((PowerSeries.C R) a * φ) = a * (PowerSeries.coeff R n) φ


lemma negAddY_of_Z_ne_zero {P Q : Fin 3 → F} (hP : W.Equation P) (hQ : W.Equation Q) (hPz : P z ≠ 0)
    (hQz : Q z ≠ 0) (hx : P x * Q z ^ 2 ≠ Q x * P z ^ 2) : W.negAddY P Q / addZ P Q ^ 3 =
      W.toAffine.negAddY (P x / P z ^ 2) (Q x / Q z ^ 2) (P y / P z ^ 3)
        (W.toAffine.slope (P x / P z ^ 2) (Q x / Q z ^ 2) (P y / P z ^ 3) (Q y / Q z ^ 3))

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

W.negAddY P Q / WeierstrassCurve.Jacobian.addZ P Q ^ 3 =
  W.toAffine.negAddY (P x / P z ^ 2) (Q x / Q z ^ 2) (P y / P z ^ 3)
    (W.toAffine.slope (P x / P z ^ 2) (Q x / Q z ^ 2) (P y / P z ^ 3) (Q y / Q z ^ 3))


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

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

Stream'.WSeq.LiftRel S (s1.bind f1) (s2.bind f2)


theorem isLittleO_log_id_atTop : log =o[atTop] id


lemma opNorm_mul_flip_apply (a : E) : ‖(mul 𝕜 E).flip a‖ = ‖a‖

(𝕜 : Type u_1)
{E : Type u_2}
[NontriviallyNormedField 𝕜]
[NonUnitalNormedRing E]
[StarRing E]
[NormedStarGroup E]
[NormedSpace 𝕜 E]
[IsScalarTower 𝕜 E E]
[SMulCommClass 𝕜 E E]
[RegularNormedAlgebra 𝕜 E]
(a : E)

‖(ContinuousLinearMap.mul 𝕜 E).flip a‖ = ‖a‖


@[simp]
theorem coeff_mk (f : ℕ → R) (hf) (n : ℕ) : coeff R p n ⟨f, hf⟩ = f n

{R : Type u₁}
[CommSemiring R]
{p : ℕ}
[hp : Fact (Nat.Prime p)]
[CharP R p]
(f : ℕ → R)
(hf : ∀ (n : ℕ), f (n + 1) ^ p = f n)
(n : ℕ)


/-- The parallelepiped formed from the standard basis for `ι → ℝ` is `[0,1]^ι` -/
theorem Basis.parallelepiped_basisFun (ι : Type*) [Fintype ι] :
    (Pi.basisFun ℝ ι).parallelepiped = TopologicalSpace.PositiveCompacts.piIcc01 ι


@[to_additive]
theorem mono_iff_ker_eq_bot : Mono f ↔ f.ker = ⊥

CategoryTheory.Mono f ↔ AddMonoidHom.ker f = ⊥


theorem comp_map {α β γ : TypeVec n} (f : α ⟹ β) (g : β ⟹ γ) :
    ∀ x : P α, (g ⊚ f) <$$> x = g <$$> f <$$> x

{n : ℕ}
(P : MvPFunctor.{u} n)
{α β γ : TypeVec.{u} n}
(f : α ⟹ β)
(g : β ⟹ γ)
(x : ↑P α)


theorem isNormal_iff_strictMono_and_continuous (f : Ordinal.{u} → Ordinal.{u}) :
    IsNormal f ↔ StrictMono f ∧ Continuous f

Ordinal.IsNormal f ↔ StrictMono f ∧ Continuous f


/-- Flipping a complex of complexes over the diagonal, as an equivalence of categories. -/
@[simps]
def flipEquivalence :
    HomologicalComplex₂ C c₁ c₂ ≌ HomologicalComplex₂ C c₂ c₁

(HomologicalComplex₂.flipEquivalence C c₁ c₂).counitIso = HomologicalComplex₂.flipEquivalenceCounitIso C c₁ c₂


theorem norm_iteratedFDeriv_le_seminorm (f : 𝓢(E, F)) (n : ℕ) (x₀ : E) :
    ‖iteratedFDeriv ℝ n f x₀‖ ≤ (SchwartzMap.seminorm 𝕜 0 n) f

(𝕜 : Type u_1)
{E : Type u_4}
{F : Type u_5}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[NormedAddCommGroup F]
[NormedSpace ℝ F]
[NormedField 𝕜]
[NormedSpace 𝕜 F]
[SMulCommClass ℝ 𝕜 F]
(f : SchwartzMap E F)
(n : ℕ)
(x₀ : E)

‖iteratedFDeriv ℝ n (⇑f) x₀‖ ≤ (SchwartzMap.seminorm 𝕜 0 n) f


@[simp]
theorem isHermitian_inv [Fintype m] [DecidableEq m] (A : Matrix m m α) [Invertible A] :
    A⁻¹.IsHermitian ↔ A.IsHermitian

{α : Type u_1}
{m : Type u_3}
[CommRing α]
[StarRing α]
[Fintype m]
[DecidableEq m]
(A : Matrix m m α)
[Invertible A]


/-- Given a closed nonempty subset `s` of `Π (n : ℕ), E n`, there exists a retraction onto this
set, i.e., a continuous map with range equal to `s`, equal to the identity on `s`. -/
theorem exists_retraction_of_isClosed {s : Set (∀ n, E n)} (hs : IsClosed s) (hne : s.Nonempty) :
    ∃ f : (∀ n, E n) → ∀ n, E n, (∀ x ∈ s, f x = x) ∧ range f = s ∧ Continuous f

{E : ℕ → Type u_1}
[(n : ℕ) → TopologicalSpace (E n)]
[∀ (n : ℕ), DiscreteTopology (E n)]
{s : Set ((n : ℕ) → E n)}
(hs : IsClosed s)
(hne : s.Nonempty)

∃ f, (∀ x ∈ s, f x = x) ∧ Set.range f = s ∧ Continuous f


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


theorem self_comp_sort (f : Fin n → α) : f ∘ sort f = graph.proj ∘ graphEquiv₂ f

{n : ℕ}
{α : Type u_1}
[LinearOrder α]
(f : Fin n → α)

f ∘ ⇑(Tuple.sort f) = Tuple.graph.proj ∘ ⇑(Tuple.graphEquiv₂ f)


@[to_additive (attr := simp) neg_add_rev]
theorem mul_inv_rev (a b : G) : (a * b)⁻¹ = b⁻¹ * a⁻¹

{G : Type u_1}
[SubtractionMonoid G]
(a b : G)


@[to_additive]
theorem mem_orbit_iff {a₁ a₂ : α} : a₂ ∈ orbit M a₁ ↔ ∃ x : M, x • a₁ = a₂

{M : Type u}
[Monoid M]
{α : Type v}
[MulAction M α]
{a₁ a₂ : α}

a₂ ∈ MulAction.orbit M a₁ ↔ ∃ x, x • a₁ = a₂


theorem continuousAt_iff_ultrafilter :
    ContinuousAt f x ↔ ∀ g : Ultrafilter X, ↑g ≤ 𝓝 x → Tendsto f g (𝓝 (f x))

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
{f : X → Y}
{x : X}

ContinuousAt f x ↔ ∀ (g : Ultrafilter X), ↑g ≤ 𝓝 x → Filter.Tendsto f (↑g) (𝓝 (f x))


theorem to_from (i : N) (p : Ω (Ω^ { j // j ≠ i } X x) const) : toLoop i (fromLoop i p) = p

(p : Ω (↑(Ω^ { j // j ≠ i } X x)) GenLoop.const)

GenLoop.toLoop i (GenLoop.fromLoop i p) = p


theorem seqTendstoAeSeq_spec (hfg : TendstoInMeasure μ f atTop g) (n k : ℕ)
    (hn : seqTendstoAeSeq hfg n ≤ k) :
    μ { x | (2 : ℝ)⁻¹ ^ n ≤ dist (f k x) (g x) } ≤ (2 : ℝ≥0∞)⁻¹ ^ n

(hfg : MeasureTheory.TendstoInMeasure μ f Filter.atTop g)

(hn : MeasureTheory.ExistsSeqTendstoAe.seqTendstoAeSeq hfg n ≤ k)

μ {x | 2⁻¹ ^ n ≤ dist (f k x) (g x)} ≤ 2⁻¹ ^ n


/-- The type of continuous maps from `α` to `β`.

When possible, instead of parametrizing results over `(f : C(α, β))`,
you should parametrize over `{F : Type*} [ContinuousMapClass F α β] (f : F)`.

When you extend this structure, make sure to extend `ContinuousMapClass`. -/
structure ContinuousMap (α β : Type*) [TopologicalSpace α] [TopologicalSpace β] where
  /-- The function `α → β` -/
  protected toFun : α → β
  /-- Proposition that `toFun` is continuous -/
  protected continuous_toFun : Continuous toFun := by continuity

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
(self : C(α, β))


theorem MulEquiv.decompositionMonoid [DecompositionMonoid β] : DecompositionMonoid α

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


theorem nhds_eq_nhds_emetric_ball (a x : β) (r : ℝ≥0∞) (h : x ∈ ball a r) :
    𝓝 x = map ((↑) : ball a r → β) (𝓝 ⟨x, h⟩)

{β : Type u_2}
[EMetricSpace β]
(a x : β)
(r : ℝ≥0∞)
(h : x ∈ EMetric.ball a r)


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

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


/-- Lemmas with div, dvd and mod operations -/
theorem modDivAux_spec :
    ∀ (k : ℕ+) (r q : ℕ) (_ : ¬(r = 0 ∧ q = 0)),
      ((modDivAux k r q).1 : ℕ) + k * (modDivAux k r q).2 = r + k * q

¬(r = 0 ∧ q = 0) → ↑(k.modDivAux r q).1 + ↑k * (k.modDivAux r q).2 = r + ↑k * q


theorem count_of_forall_not {n : ℕ} (hp : ∀ n' < n, ¬p n') : count p n = 0

{p : ℕ → Prop}
[DecidablePred p]
{n : ℕ}
(hp : ∀ n' < n, ¬p n')


lemma sup_sInf_eq : a ⊔ sInf s = ⨅ b ∈ s, a ⊔ b

{α : Type u}
(minAx : Order.Coframe.MinimalAxioms α)
{s : Set α}
{a : α}


@[simps]
def foldlM.ofFreeMonoid [LawfulMonad m] (f : β → α → m β) : FreeMonoid α →* Monoid.foldlM m β

{m : Type u → Type u}
[Monad m]
{α β : Type u}
[LawfulMonad m]
(f : β → α → m β)
(xs : FreeMonoid α)

(Monoid.foldlM.ofFreeMonoid f) xs = MulOpposite.op (flip (List.foldlM f) (FreeMonoid.toList xs))


@[to_additive (attr := fun_prop)]
theorem ContinuousAt.zpow {f : α → G} {x : α} (hf : ContinuousAt f x) (z : ℤ) :
    ContinuousAt (fun x => f x ^ z) x

{G : Type w}
{α : Type u}
[TopologicalSpace G]
[AddGroup G]
[TopologicalAddGroup G]
[TopologicalSpace α]
{f : α → G}
{x : α}
(hf : ContinuousAt f x)
(z : ℤ)


theorem algebraMap_apply' (r : R) :
    algebraMap R (A ⊗[R] B) r = 1 ⊗ₜ algebraMap R B r

{R : Type uR}
{A : Type uA}
{B : Type uB}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[Semiring B]
[Algebra R B]
(r : R)

(algebraMap R (A ⊗[R] B)) r = 1 ⊗ₜ[R] (algebraMap R B) r


/-- The canonical functor `Karoubi (Karoubi C) ⥤ Karoubi C` -/
@[simps]
def inverse : Karoubi (Karoubi C) ⥤ Karoubi C

(C : Type u_1)
[CategoryTheory.Category.{u_2, u_1} C]

∀ {X Y : CategoryTheory.Idempotents.Karoubi (CategoryTheory.Idempotents.Karoubi C)} (f : X ⟶ Y),
  ((CategoryTheory.Idempotents.KaroubiKaroubi.inverse C).map f).f = f.f.f


/-- Given a simple function `f` with values in `ℝ≥0`, there exists an upper semicontinuous
function `g ≤ f` with integral arbitrarily close to that of `f`. Formulation in terms of
`lintegral`.
Auxiliary lemma for Vitali-Carathéodory theorem `exists_lt_lower_semicontinuous_integral_lt`. -/
theorem SimpleFunc.exists_upperSemicontinuous_le_lintegral_le (f : α →ₛ ℝ≥0)
    (int_f : (∫⁻ x, f x ∂μ) ≠ ∞) {ε : ℝ≥0∞} (ε0 : ε ≠ 0) :
    ∃ g : α → ℝ≥0, (∀ x, g x ≤ f x) ∧ UpperSemicontinuous g ∧
      (∫⁻ x, f x ∂μ) ≤ (∫⁻ x, g x ∂μ) + ε

{α : Type u_1}
[TopologicalSpace α]
[MeasurableSpace α]
[BorelSpace α]
{μ : MeasureTheory.Measure α}
[μ.WeaklyRegular]
(f : MeasureTheory.SimpleFunc α ℝ≥0)
(int_f : ∫⁻ (x : α), ↑(↑f x) ∂μ ≠ ⊤)
{ε : ℝ≥0∞}
(ε0 : ε ≠ 0)

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


theorem condexp_undef (hf : ¬Integrable f μ) : μ[f|m] = 0

{α : Type u_1}
{F' : Type u_3}
[NormedAddCommGroup F']
[NormedSpace ℝ F']
[CompleteSpace F']
{m m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f : α → F'}
(hf : ¬MeasureTheory.Integrable f μ)


theorem nodup_antidiagonalTuple (k n : ℕ) : (antidiagonalTuple k n).Nodup


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

{α : Type u_2}
{β : Type u_3}
[Bot α]
[LE β]
[OrderBot β]


theorem eLpNorm_congr_norm_ae {f : α → F} {g : α → G} (hfg : ∀ᵐ x ∂μ, ‖f x‖ = ‖g x‖) :
    eLpNorm f p μ = eLpNorm g p μ

{α : Type u_1}
{F : Type u_3}
{G : Type u_4}
{m0 : MeasurableSpace α}
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup F]
[NormedAddCommGroup G]
{f : α → F}
{g : α → G}
(hfg : ∀ᵐ (x : α) ∂μ, ‖f x‖ = ‖g x‖)

MeasureTheory.eLpNorm f p μ = MeasureTheory.eLpNorm g p μ


theorem sSup_ord {s : Set Cardinal.{u}} (hs : BddAbove s) : (sSup s).ord = sSup (ord '' s)


theorem compl_section_ordSeparatingSet_mem_nhds (hd : Disjoint s (closure t)) (ha : a ∈ s) :
    (ordConnectedSection <| ordSeparatingSet s t)ᶜ ∈ 𝓝 a

{X : Type u_1}
[LinearOrder X]
[TopologicalSpace X]
[OrderTopology X]
{a : X}
{s t : Set X}
(hd : Disjoint s (closure t))
(ha : a ∈ s)

(s.ordSeparatingSet t).ordConnectedSectionᶜ ∈ 𝓝 a


/-- If `λ` divides `x - 1`, then `λ ^ 4` divides `x ^ 3 - 1`. -/
lemma lambda_pow_four_dvd_cube_sub_one_of_dvd_sub_one {x : 𝓞 K} (h : λ ∣ x - 1) :
    λ ^ 4 ∣ x ^ 3 - 1

{K : Type u_1}
[Field K]
[NumberField K]
[IsCyclotomicExtension {3} ℚ K]
{ζ : K}
(hζ : IsPrimitiveRoot ζ ↑3)
{x : 𝓞 K}
(h : hζ.toInteger - 1 ∣ x - 1)


theorem not_differentiableAt_of_local_left_inverse_hasDerivAt_zero {f g : 𝕜 → 𝕜} {a : 𝕜}
    (hf : HasDerivAt f 0 (g a)) (hfg : f ∘ g =ᶠ[𝓝 a] id) : ¬DifferentiableAt 𝕜 g a

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{f g : 𝕜 → 𝕜}
{a : 𝕜}
(hf : HasDerivAt f 0 (g a))
(hfg : f ∘ g =ᶠ[𝓝 a] id)


theorem derivWithin_const_add (hxs : UniqueDiffWithinAt 𝕜 s x) (c : F) :
    derivWithin (fun y => c + f y) s x = derivWithin f s x

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


@[simp]
theorem map_ofNat [FunLike F R S] [RingHomClass F R S] (f : F) (n : ℕ) [Nat.AtLeastTwo n] :
    (f (no_index (OfNat.ofNat n)) : S) = OfNat.ofNat n

{R : Type u_3}
{S : Type u_4}
{F : Type u_5}
[NonAssocSemiring R]
[NonAssocSemiring S]
[FunLike F R S]
[RingHomClass F R S]
(f : F)
(n : ℕ)
[n.AtLeastTwo]


@[simp] theorem two_lt_top : (2 : ℝ≥0∞) < ∞


theorem UnivLE.trans [UnivLE.{u, v}] [UnivLE.{v, w}] : UnivLE.{u, w}


@[to_additive]
theorem tprod_image {g : γ → β} (f : β → α) {s : Set γ} (hg : Set.InjOn g s) :
    ∏' x : g '' s, f x = ∏' x : s, f (g x)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[CommMonoid α]
[TopologicalSpace α]
{g : γ → β}
(f : β → α)
{s : Set γ}
(hg : Set.InjOn g s)


@[deprecated Absorbent.zero_mem (since := "2024-02-02")]
theorem Absorbent.zero_mem' (hs : Absorbent 𝕜 s) : (0 : E) ∈ s

{𝕜 : Type u_1}
{E : Type u_3}
[NontriviallyNormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{s : Set E}
(hs : Absorbent 𝕜 s)


/-- The bijection `(X' ⟶ Y') ≃ (L.obj X ⟶ L.obj Y)` induced by isomorphisms
`eX : L.obj X ≅ X'` and `eY : L.obj Y ≅ Y'`. -/
@[simps]
def homEquiv : (X' ⟶ Y') ≃ (L.obj X ⟶ L.obj Y)

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Category.{u_4, u_2} D]
{L : CategoryTheory.Functor C D}
{X Y : C}
{X' Y' : D}
(eX : L.obj X ≅ X')
(eY : L.obj Y ≅ Y')
(g : L.obj X ⟶ L.obj Y)

(CategoryTheory.Localization.Preadditive.homEquiv eX eY).symm g =
  CategoryTheory.CategoryStruct.comp eX.inv (CategoryTheory.CategoryStruct.comp g eY.hom)


/-- A monotone function continuous at the indexed supremum over a nonempty `Sort` sends this indexed
supremum to the indexed supremum of the composition. -/
theorem Monotone.map_iSup_of_continuousAt' {ι : Sort*} [Nonempty ι] {f : α → β} {g : ι → α}
    (Cf : ContinuousAt f (iSup g)) (Mf : Monotone f)
    (bdd : BddAbove (range g) := by bddDefault) : f (⨆ i, g i) = ⨆ i, f (g i)

(bdd : BddAbove (Set.range g) := by bddDefault)


@[simp]
theorem equivCongr_trans (e₁₂ : A₁ ≃ₐ[R] A₂) (e₁₂' : A₁' ≃ₐ[R] A₂')
    (e₂₃ : A₂ ≃ₐ[R] A₃) (e₂₃' : A₂' ≃ₐ[R] A₃') :
    (equivCongr e₁₂ e₁₂').trans (equivCongr e₂₃ e₂₃') =
      equivCongr (e₁₂.trans e₂₃) (e₁₂'.trans e₂₃')

{R : Type uR}
{A₁ : Type uA₁}
{A₂ : Type uA₂}
{A₃ : Type uA₃}
{A₁' : Type uA₁'}
{A₂' : Type uA₂'}
{A₃' : Type uA₃'}
[CommSemiring R]
[Semiring A₁]
[Semiring A₂]
[Semiring A₃]
[Semiring A₁']
[Semiring A₂']
[Semiring A₃']
[Algebra R A₁]
[Algebra R A₂]
[Algebra R A₃]
[Algebra R A₁']
[Algebra R A₂']
[Algebra R A₃']
(e₁₂ : A₁ ≃ₐ[R] A₂)
(e₁₂' : A₁' ≃ₐ[R] A₂')
(e₂₃ : A₂ ≃ₐ[R] A₃)
(e₂₃' : A₂' ≃ₐ[R] A₃')

(e₁₂.equivCongr e₁₂').trans (e₂₃.equivCongr e₂₃') = (e₁₂.trans e₂₃).equivCongr (e₁₂'.trans e₂₃')


theorem InjOn.preimage_image_inter (hf : InjOn f s) (hs : s₁ ⊆ s) : f ⁻¹' (f '' s₁) ∩ s = s₁

{α : Type u_1}
{β : Type u_2}
{s s₁ : Set α}
{f : α → β}
(hf : Set.InjOn f s)
(hs : s₁ ⊆ s)


theorem Continuous.arsinh (h : Continuous f) : Continuous fun x => arsinh (f x)

{X : Type u_1}
[TopologicalSpace X]
{f : X → ℝ}
(h : Continuous f)


/-- A natural isomorphism between the functor `map (F ⋙ G) ` and `map F ⋙ map G `. -/
@[simps!]
def mapComp {D E : Type*} [Category D] [Category E] (F : C ⥤ D) (G : D ⥤ E) :
    map (F ⋙ G) ≅ map F ⋙ map G

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{D : Type u_1}
{E : Type u_2}
[CategoryTheory.Category.{u_3, u_1} D]
[CategoryTheory.Category.{u_4, u_2} E]
(F : CategoryTheory.Functor C D)
(G : CategoryTheory.Functor D E)
(X : CategoryTheory.WithTerminal C)

(CategoryTheory.WithTerminal.mapComp F G).inv.app X =
  (match X with
    | CategoryTheory.WithTerminal.of x => CategoryTheory.Iso.refl (CategoryTheory.WithTerminal.of (G.obj (F.obj x)))
    | CategoryTheory.WithTerminal.star => CategoryTheory.Iso.refl CategoryTheory.WithTerminal.star).inv


@[norm_cast]
theorem coe_toAlgHom (f : A →ₐc[R] B) : ⇑(f : A →ₐ[R] B) = f

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


theorem mono (h : InvOn f' f s t) (hs : s₁ ⊆ s) (ht : t₁ ⊆ t) : InvOn f' f s₁ t₁

{α : Type u_1}
{β : Type u_2}
{s s₁ : Set α}
{t t₁ : Set β}
{f : α → β}
{f' : β → α}
(h : Set.InvOn f' f s t)
(hs : s₁ ⊆ s)
(ht : t₁ ⊆ t)


theorem btw_iff_not_sbtw {a b c : α} : btw a b c ↔ ¬sbtw c b a

{α : Type u_1}
[CircularOrder α]
{a b c : α}


/-- The identity morphism of a snake input. -/
@[simps]
def id : Hom S S

(S : CategoryTheory.ShortComplex.SnakeInput C)

(CategoryTheory.ShortComplex.SnakeInput.Hom.id S).f₁ = CategoryTheory.CategoryStruct.id S.L₁


theorem decidableEq_inl_refl {α : Sort u} [h : DecidableEq α] (a : α) :
    h a a = isTrue (Eq.refl a)


theorem snd_sum {ι} [AddCommMonoid R] [AddCommMonoid M] (s : Finset ι) (f : ι → tsze R M) :
    (∑ i ∈ s, f i).snd = ∑ i ∈ s, (f i).snd

{R : Type u}
{M : Type v}
{ι : Type u_3}
[AddCommMonoid R]
[AddCommMonoid M]
(s : Finset ι)
(f : ι → tsze R M)


/--
The well-formedness invariant for a red-black tree is exactly the `mk` constructor,
because the other constructors of `WF` are redundant.
-/
@[simp] theorem WF_iff {t : RBNode α} : t.WF cmp ↔ t.Ordered cmp ∧ ∃ c n, t.Balanced c n

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

Batteries.RBNode.WF cmp t ↔ Batteries.RBNode.Ordered cmp t ∧ ∃ c n, t.Balanced c n


/-- In a normed additive group, every absolutely convergent series converges in the
space iff the space is complete.  -/
lemma NormedAddCommGroup.summable_imp_tendsto_iff_completeSpace :
    (∀ u : ℕ → E, Summable (‖u ·‖) → ∃ a, Tendsto (fun n => ∑ i ∈ range n, u i) atTop (𝓝 a))
     ↔ CompleteSpace E

(∀ (u : ℕ → E),
    (Summable fun x => ‖u x‖) → ∃ a, Filter.Tendsto (fun n => ∑ i ∈ Finset.range n, u i) Filter.atTop (𝓝 a)) ↔
  CompleteSpace E


theorem uniformInducing_pureCauchy : UniformInducing (pureCauchy : α → CauchyFilter α)


theorem exists_nontrivial_relation_sum_zero_of_not_affine_ind {t : Finset V}
    (h : ¬AffineIndependent k ((↑) : t → V)) :
    ∃ f : V → k, ∑ e ∈ t, f e • e = 0 ∧ ∑ e ∈ t, f e = 0 ∧ ∃ x ∈ t, f x ≠ 0

{k : Type u_1}
{V : Type u_2}
[Ring k]
[AddCommGroup V]
[Module k V]
{t : Finset V}
(h : ¬AffineIndependent k Subtype.val)

∃ f, ∑ e ∈ t, f e • e = 0 ∧ ∑ e ∈ t, f e = 0 ∧ ∃ x ∈ t, f x ≠ 0


/-- To check whether two maps are equalized by both maps of a fork, it suffices to check it for the
    first map -/
theorem Fork.equalizer_ext (s : Fork f g) {W : C} {k l : W ⟶ s.pt} (h : k ≫ s.ι = l ≫ s.ι) :
    ∀ j : WalkingParallelPair, k ≫ s.π.app j = l ≫ s.π.app j

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

CategoryTheory.CategoryStruct.comp k (s.π.app j) = CategoryTheory.CategoryStruct.comp l (s.π.app j)


@[to_additive (attr := simp)]
theorem mul_apply (f g : α →*o β) (a : α) : (f * g) a = f a * g a

{α : Type u_2}
{β : Type u_3}
[OrderedCommMonoid α]
[OrderedCommMonoid β]
(f g : α →*o β)
(a : α)


@[simp] lemma mulShift_apply {ψ : AddChar R M} {r : R} {x : R} : mulShift ψ r x = ψ (r * x)

{R : Type u_1}
{M : Type u_2}
[Ring R]
[CommMonoid M]
{ψ : AddChar R M}
{r x : R}


@[to_additive]
theorem locallyCompactSpace_of_hasBasis (V : ℕ → Set Y)
    (hV : ∀ {n x}, x ∈ V n → x * x ∈ V n → x ∈ V (n + 1))
    (hVo : Filter.HasBasis (nhds 1) (fun _ ↦ True) V) :
    LocallyCompactSpace (ContinuousMonoidHom X Y)

(hV : ∀ {n : ℕ} {x : Y}, x ∈ V n → x * x ∈ V n → x ∈ V (n + 1))

(hVo : (nhds 1).HasBasis (fun x => True) V)


protected theorem subsingleton (h : IsAdicComplete (⊤ : Ideal R) M) : Subsingleton M

{R : Type u_1}
[CommRing R]
(M : Type u_2)
[AddCommGroup M]
[Module R M]
(h : IsAdicComplete ⊤ M)


theorem ne_zero_of_natDegree_gt {n : ℕ} (h : n < natDegree p) : p ≠ 0

{R : Type u}
[Semiring R]
{p : R[X]}
{n : ℕ}
(h : n < p.natDegree)


@[simp, mfld_simps]
theorem localTriv_apply {i : ι} (p : Z.TotalSpace) :
    (Z.localTriv i) p = ⟨p.1, Z.coordChange (Z.indexAt p.1) i p.1 p.2⟩

{R : Type u_1}
{B : Type u_2}
{F : Type u_3}
[NontriviallyNormedField R]
[NormedAddCommGroup F]
[NormedSpace R F]
[TopologicalSpace B]
{ι : Type u_5}
(Z : VectorBundleCore R B F ι)
{i : ι}
(p : Z.TotalSpace)

↑(Z.localTriv i) p = (p.proj, (Z.coordChange (Z.indexAt p.proj) i p.proj) p.snd)


/-- From a functor `F : J ⥤ C`, given an initial object of `J`, construct a cone for `J`.
In `limitOfDiagramInitial` we show it is a limit cone. -/
@[simps]
def coneOfDiagramInitial {X : J} (tX : IsInitial X) (F : J ⥤ C) : Cone F

(tX : CategoryTheory.Limits.IsInitial X)

(CategoryTheory.Limits.coneOfDiagramInitial tX F).π.app j = F.map (tX.to j)


@[to_additive]
theorem mul_lowerClosure : s * lowerClosure t = lowerClosure (s * t)

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

s * ↑(lowerClosure t) = ↑(lowerClosure (s * t))


theorem unpair₁ {n f} (hf : @Primrec' n f) : @Primrec' n fun v => (f v).unpair.1

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

Nat.Primrec' fun v => (Nat.unpair (f v)).1


/-- When `f : X ⟶ Y` is a monomorphism, `exists f` agrees with `map f`.
-/
theorem exists_iso_map (f : X ⟶ Y) [Mono f] : «exists» f = map f

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

CategoryTheory.Subobject.exists f = CategoryTheory.Subobject.map f


theorem exists_cons_of_length_pos : ∀ {l : List α}, 0 < l.length → ∃ h t, l = h :: t


lemma one_div_mul_cancel (h : a ≠ 0) : 1 / a * a = 1

{G₀ : Type u_3}
[GroupWithZero G₀]
{a : G₀}
(h : a ≠ 0)


theorem mem_lookup_union_middle {a} {b : β a} {s₁ s₂ s₃ : AList β} :
    b ∈ lookup a (s₁ ∪ s₃) → a ∉ s₂ → b ∈ lookup a (s₁ ∪ s₂ ∪ s₃)

{α : Type u}
{β : α → Type v}
[DecidableEq α]
{a : α}
{b : β a}
{s₁ s₂ s₃ : AList β}

b ∈ AList.lookup a (s₁ ∪ s₃) → a ∉ s₂ → b ∈ AList.lookup a (s₁ ∪ s₂ ∪ s₃)


@[simp]
lemma coe_smul (z : Cocycle F G n) (x : R) :
    (↑(x • z) : Cochain F G n) = x • (z : Cochain F G n)

(z : CochainComplex.HomComplex.Cocycle F G n)


/-- The functor `G : C ⥤ D` exhibits `(C, J)` as a dense subsite of `(D, K)`
if `G` is cover-dense, locally fully-faithful,
and `S` is a cover of `C` if and only if the image of `S` in `D` is a cover. -/
class IsDenseSubsite : Prop where
  isCoverDense' : G.IsCoverDense K := by infer_instance
  isLocallyFull' : G.IsLocallyFull K := by infer_instance
  isLocallyFaithful' : G.IsLocallyFaithful K := by infer_instance
  functorPushforward_mem_iff : ∀ {X : C} {S : Sieve X}, S.functorPushforward G ∈ K _ ↔ S ∈ J _

(J : CategoryTheory.GrothendieckTopology C)

{K : CategoryTheory.GrothendieckTopology D}

[self : CategoryTheory.Functor.IsDenseSubsite J K G]


@[simp]
theorem Proj.stalkIso'_germ' (U : Opens (ProjectiveSpectrum.top 𝒜))
    (x : ProjectiveSpectrum.top 𝒜) (hx : x ∈ U) (s : (Proj.structureSheaf 𝒜).1.obj (op U)) :
    Proj.stalkIso' 𝒜 x ((Proj.structureSheaf 𝒜).presheaf.germ ⟨x, hx⟩ s) = (s.1 ⟨x, hx⟩ : _)

(U : TopologicalSpace.Opens ↑(ProjectiveSpectrum.top 𝒜))

(s : ↑((AlgebraicGeometry.ProjectiveSpectrum.Proj.structureSheaf 𝒜).val.obj (Opposite.op U)))

(AlgebraicGeometry.Proj.stalkIso' 𝒜 x)
    (((AlgebraicGeometry.ProjectiveSpectrum.Proj.structureSheaf 𝒜).presheaf.germ ⟨x, hx⟩) s) =
  ↑s ⟨x, hx⟩


@[simp]
theorem compl_univ : (univ : Set α)ᶜ = ∅


@[to_additive (attr := simp, norm_cast)]
theorem unop_intCast [IntCast α] (n : ℤ) : unop (n : αᵐᵒᵖ) = n


theorem isOpenMap_iff_isOpenMap_of_iSup_eq_top :
    IsOpenMap f ↔ ∀ i, IsOpenMap ((U i).1.restrictPreimage f)

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

IsOpenMap f ↔ ∀ (i : ι), IsOpenMap ((U i).carrier.restrictPreimage f)


@[simp]
theorem arg_neg_iff {z : ℂ} : arg z < 0 ↔ z.im < 0


@[simp] lemma nnnorm_down (x : ULift E) : ‖x.down‖₊ = ‖x‖₊

{E : Type u_2}
[NNNorm E]
(x : ULift.{u_5, u_2} E)


@[simp]
theorem sumCompl_symm_apply {α : Type*} {s : Set α} [DecidablePred (· ∈ s)] {x : s} :
    (Equiv.Set.sumCompl s).symm x = Sum.inl x

{α : Type u_1}
{s : Set α}
[DecidablePred fun x => x ∈ s]
{x : ↑s}

(Equiv.Set.sumCompl s).symm ↑x = Sum.inl x


/-- The centroid of some vertices of a simplex, in terms of `pointsWithCircumcenter`. -/
theorem centroid_eq_affineCombination_of_pointsWithCircumcenter {n : ℕ} (s : Simplex ℝ P n)
    (fs : Finset (Fin (n + 1))) :
    fs.centroid ℝ s.points =
      (univ : Finset (PointsWithCircumcenterIndex n)).affineCombination ℝ s.pointsWithCircumcenter
        (centroidWeightsWithCircumcenter fs)

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{n : ℕ}
(s : Affine.Simplex ℝ P n)
(fs : Finset (Fin (n + 1)))

Finset.centroid ℝ fs s.points =
  (Finset.affineCombination ℝ Finset.univ s.pointsWithCircumcenter) (Affine.Simplex.centroidWeightsWithCircumcenter fs)


@[simp]
protected theorem liftOn'_mk (x : α) (f : α → β) (h) : (Quotient.mk s x).liftOn' f h = f x

(h : ∀ (a b : α), Setoid.r a b → f a = f b)


theorem integrableOn_Iio_iff_integrableAtFilter_atBot_nhdsWithin
    [LinearOrder X] [CompactIccSpace X] [NoMinOrder X] [OrderTopology X] :
    IntegrableOn f (Iio a) μ ↔ IntegrableAtFilter f atBot μ ∧
    IntegrableAtFilter f (𝓝[<] a) μ ∧ LocallyIntegrableOn f (Iio a) μ

{X : Type u_1}
{E : Type u_3}
[MeasurableSpace X]
[TopologicalSpace X]
[NormedAddCommGroup E]
{f : X → E}
{μ : MeasureTheory.Measure X}
{a : X}
[LinearOrder X]
[CompactIccSpace X]
[NoMinOrder X]
[OrderTopology X]

MeasureTheory.IntegrableOn f (Set.Iio a) μ ↔
  MeasureTheory.IntegrableAtFilter f Filter.atBot μ ∧
    MeasureTheory.IntegrableAtFilter f (𝓝[<] a) μ ∧ MeasureTheory.LocallyIntegrableOn f (Set.Iio a) μ


theorem nat_iff' {f : α → β → σ} :
    Primrec₂ f ↔
      Primrec₂ fun m n : ℕ => (@decode α _ m).bind fun a => Option.map (f a) (@decode β _ n)

{α : Type u_1}
{β : Type u_2}
{σ : Type u_3}
[Primcodable α]
[Primcodable β]
[Primcodable σ]
{f : α → β → σ}

Primrec₂ f ↔ Primrec₂ fun m n => (Encodable.decode m).bind fun a => Option.map (f a) (Encodable.decode n)


theorem Path.cast_eq_cast {u v u' v' : U} (hu : u = u') (hv : v = v') (p : Path u v) :
    p.cast hu hv = _root_.cast (by rw [hu, hv]) p

{U : Type u_1}
[Quiver U]
{u v u' v' : U}
(hu : u = u')
(hv : v = v')
(p : Quiver.Path u v)


/--
A subtype-like structure for full subcategories. Morphisms just ignore the property. We don't use
actual subtypes since the simp-normal form `↑X` of `X.val` does not work well for full
subcategories.

See <https://stacks.math.columbia.edu/tag/001D>. We do not define 'strictly full' subcategories.
-/
@[ext]
structure FullSubcategory where
  /-- The category of which this is a full subcategory-/
  obj : C
  /-- The predicate satisfied by all objects in this subcategory-/
  property : Z obj

(self : CategoryTheory.FullSubcategory Z)


@[fun_prop]
theorem hasStrictFDerivAt_list_prod_finRange' {n : ℕ} {x : Fin n → 𝔸} :
    HasStrictFDerivAt (𝕜 := 𝕜) (fun x ↦ ((List.finRange n).map x).prod)
      (∑ i : Fin n, (((List.finRange n).take i).map x).prod •
        smulRight (proj i) (((List.finRange n).drop (.succ i)).map x).prod) x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{𝔸 : Type u_7}
[NormedRing 𝔸]
[NormedAlgebra 𝕜 𝔸]
{n : ℕ}
{x : Fin n → 𝔸}

HasStrictFDerivAt (fun x => (List.map x (List.finRange n)).prod)
  (∑ i : Fin n,
    (List.map x (List.take (↑i) (List.finRange n))).prod •
      (ContinuousLinearMap.proj i).smulRight (List.map x (List.drop (↑i).succ (List.finRange n))).prod)
  x


@[to_additive]
theorem contMDiffWithinAt_finset_prod (h : ∀ i ∈ t, ContMDiffWithinAt I' I n (f i) s x) :
    ContMDiffWithinAt I' I n (fun x => ∏ i ∈ t, f i x) s x

ContMDiffWithinAt I' I n (fun x => ∑ i ∈ t, f i x) s x


lemma eq_of_mem_uIcc_of_mem_uIcc' : b ∈ [[a, c]] → c ∈ [[a, b]] → b = c

{α : Type u_1}
[DistribLattice α]
{a b c : α}

b ∈ Set.uIcc a c → c ∈ Set.uIcc a b → b = c


@[to_additive]
theorem tendsto_inv_nhdsWithin_Ioi_inv {a : H} : Tendsto Inv.inv (𝓝[>] a⁻¹) (𝓝[<] a)

{H : Type x}
[TopologicalSpace H]
[OrderedAddCommGroup H]
[ContinuousNeg H]
{a : H}

Filter.Tendsto Neg.neg (𝓝[>] (-a)) (𝓝[<] a)


theorem liftOn_condition_of_liftOn'_condition {P : Sort v} {f : K[X] → K[X] → P}
    (H : ∀ {p q a} (hq : q ≠ 0) (_ha : a ≠ 0), f (a * p) (a * q) = f p q) ⦃p q p' q' : K[X]⦄
    (hq : q ≠ 0) (hq' : q' ≠ 0) (h : q' * p = q * p') : f p q = f p' q'

(H : ∀ {p q a : K[X]}, q ≠ 0 → a ≠ 0 → f (a * p) (a * q) = f p q)


/-- Auxiliary definition for `mapBifunctorHomologicalComplex`. -/
@[simps!]
def mapBifunctorHomologicalComplexObj (K₁ : HomologicalComplex C₁ c₁) :
    HomologicalComplex C₂ c₂ ⥤ HomologicalComplex₂ D c₁ c₂

[∀ (X₁ : C₁), (F.obj X₁).PreservesZeroMorphisms]

(((F.mapBifunctorHomologicalComplexObj c₂ K₁).map φ).f i₁).f i₂ = (F.obj (K₁.X i₁)).map (φ.f i₂)


{R : Type u}
{M : Type v}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
{I : Ideal R}
{N : Submodule R M}


@[simp]
theorem piCongrRight_symm {ι : Type*} {R S : ι → Type*} [∀ i, NonUnitalNonAssocSemiring (R i)]
    [∀ i, NonUnitalNonAssocSemiring (S i)] (e : ∀ i, R i ≃+* S i) :
    (piCongrRight e).symm = piCongrRight fun i => (e i).symm

[(i : ι) → NonUnitalNonAssocSemiring (R i)]

[(i : ι) → NonUnitalNonAssocSemiring (S i)]

(RingEquiv.piCongrRight e).symm = RingEquiv.piCongrRight fun i => (e i).symm


@[to_additive]
nonrec theorem Smooth.div {f g : M → G} (hf : Smooth I' I f) (hg : Smooth I' I g) :
    Smooth I' I (f / g)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{H : Type u_2}
[TopologicalSpace H]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{I : ModelWithCorners 𝕜 E H}
{G : Type u_5}
[TopologicalSpace G]
[ChartedSpace H G]
[AddGroup G]
[LieAddGroup I G]
{E' : Type u_6}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_7}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M : Type u_8}
[TopologicalSpace M]
[ChartedSpace H' M]
{f g : M → G}
(hf : Smooth I' I f)
(hg : Smooth I' I g)


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

(X : TwoP)
(a : ((𝟭 TwoP).obj X).toBipointed.X)

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


@[simps!]
instance categoryOfGradedObjects (β : Type w) : Category.{max w v} (GradedObject β C)

{C : Type u}
[CategoryTheory.Category.{v, u} C]
(β : Type w)
(X : (i : β) → (fun x => C) i)
(i : β)

CategoryTheory.CategoryStruct.id X i = CategoryTheory.CategoryStruct.id (X i)


lemma chain'_join : ∀ {L : List (List α)}, [] ∉ L →
    (Chain' R L.join ↔ (∀ l ∈ L, Chain' R l) ∧
    L.Chain' (fun l₁ l₂ => ∀ᵉ (x ∈ l₁.getLast?) (y ∈ l₂.head?), R x y))

{α : Type u}
{R : α → α → Prop}
{L : List (List α)}

¬[] ∈ L →
  (List.Chain' R L.join ↔
    (∀ (l : List α), l ∈ L → List.Chain' R l) ∧
      List.Chain' (fun l₁ l₂ => ∀ (x : α), x ∈ l₁.getLast? → ∀ (y : α), y ∈ l₂.head? → R x y) L)


/-- A transformation between applicative functors.  It is a natural
transformation such that `app` preserves the `Pure.pure` and
`Functor.map` (`<*>`) operations. See
`ApplicativeTransformation.preserves_map` for naturality. -/
structure ApplicativeTransformation : Type max (u + 1) v w where
  /-- The function on objects defined by an `ApplicativeTransformation`. -/
  app : ∀ α : Type u, F α → G α
  /-- An `ApplicativeTransformation` preserves `pure`. -/
  preserves_pure' : ∀ {α : Type u} (x : α), app _ (pure x) = pure x
  /-- An `ApplicativeTransformation` intertwines `seq`. -/
  preserves_seq' : ∀ {α β : Type u} (x : F (α → β)) (y : F α), app _ (x <*> y) = app _ x <*> app _ y

{F : Type u → Type v}
[Applicative F]
{G : Type u → Type w}
[Applicative G]
(self : ApplicativeTransformation F G)
{α : Type u}
(x : α)


protected theorem tendsto_nhds_atBot [NoMinOrder X] : Tendsto 𝓝 (atBot : Filter X) (𝓝 atBot)

{X : Type u_2}
[TopologicalSpace X]
[PartialOrder X]
[OrderTopology X]
[NoMinOrder X]

Filter.Tendsto 𝓝 Filter.atBot (𝓝 Filter.atBot)


lemma piEquiv_apply_apply (ι R M : Type*) [Fintype ι] [CommSemiring R]
    [AddCommMonoid M] [Module R M] (v : ι → M) (w : ι → R) :
    piEquiv ι R M v w = ∑ i, w i • v i

(ι : Type u_5)
(R : Type u_6)
(M : Type u_7)
[Fintype ι]
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
(v : ι → M)
(w : ι → R)

((Module.piEquiv ι R M) v) w = ∑ i : ι, w i • v i


theorem mem_univ_pi : f ∈ pi univ t ↔ ∀ i, f i ∈ t i

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

f ∈ Set.univ.pi t ↔ ∀ (i : ι), f i ∈ t i


@[to_additive]
theorem pow_mem_pow (ha : a ∈ s) : ∀ n : ℕ, a ^ n ∈ s ^ n

{α : Type u_2}
[DecidableEq α]
[AddMonoid α]
{s : Finset α}
{a : α}
(ha : a ∈ s)
(n : ℕ)


@[to_additive]
theorem mem_smul {x : β} : x ∈ s • t ↔ ∃ y ∈ s, ∃ z ∈ t, y • z = x

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


theorem inv_mul_eq_one {I : FractionalIdeal A⁰ K} (hI : I ≠ 0) : I⁻¹ * I = 1

{A : Type u_2}
{K : Type u_3}
[CommRing A]
[Field K]
[IsDomain A]
[Algebra A K]
[IsFractionRing A K]
(h : IsDedekindDomainInv A)
{I : FractionalIdeal A⁰ K}
(hI : I ≠ 0)


theorem opow_le_opow_iff_right {a b c : Ordinal} (a1 : 1 < a) : a ^ b ≤ a ^ c ↔ b ≤ c


@[simp]
theorem mem_selfAdjointMatricesSubmodule :
    A₁ ∈ selfAdjointMatricesSubmodule J ↔ J.IsSelfAdjoint A₁

{R : Type u_1}
{n : Type u_12}
[CommRing R]
[Fintype n]
(J A₁ : Matrix n n R)
[DecidableEq n]


theorem ContinuousMapClass.toCocompactMapClass_of_norm [FunLike 𝓕 E F] [ContinuousMapClass 𝓕 E F]
    (h : ∀ (f : 𝓕) (ε : ℝ), ∃ r : ℝ, ∀ x : E, r < ‖x‖ → ε < ‖f x‖) :
    CocompactMapClass 𝓕 E F

(h : ∀ (f : 𝓕) (ε : ℝ), ∃ r, ∀ (x : E), r < ‖x‖ → ε < ‖f x‖)


/-- The duality equivalence `WalkingSpanᵒᵖ ≌ WalkingCospan` -/
@[simps!]
def walkingSpanOpEquiv : WalkingSpanᵒᵖ ≌ WalkingCospan

(X : (CategoryTheory.Limits.WidePushoutShape CategoryTheory.Limits.WalkingPair)ᵒᵖ)

CategoryTheory.Limits.walkingSpanOpEquiv.unitIso.inv.app X = 𝟙 X


protected theorem sub_sub (a b c : Int) : a - b - c = a - (b + c)


/-- **First moment method**. An integrable function is smaller than its integral on a set of
positive measure. -/
theorem measure_le_integral_pos (hf : Integrable f μ) : 0 < μ {x | f x ≤ ∫ a, f a ∂μ}

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f : α → ℝ}
[MeasureTheory.IsProbabilityMeasure μ]
(hf : MeasureTheory.Integrable f μ)


/-- The "evaluation at `X`" functor, such that
`(evaluation.obj X).obj F = F.obj X`,
which is functorial in both `X` and `F`.
-/
@[simps]
def evaluation : C ⥤ (C ⥤ D) ⥤ D

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

((CategoryTheory.evaluation C D).obj X).obj F = F.obj X


@[simp]
theorem inl_pow [Monoid R] [AddMonoid M] [DistribMulAction R M] [DistribMulAction Rᵐᵒᵖ M] (r : R)
    (n : ℕ) : (inl r ^ n : tsze R M) = inl (r ^ n)

{R : Type u}
{M : Type v}
[Monoid R]
[AddMonoid M]
[DistribMulAction R M]
[DistribMulAction Rᵐᵒᵖ M]
(r : R)
(n : ℕ)

TrivSqZeroExt.inl r ^ n = TrivSqZeroExt.inl (r ^ n)


/-- The identification `mop X ⊗ mop Y = mop (Y ⊗ X)` as a natural isomorphism. -/
@[simps!]
def MonoidalOpposite.tensorIso :
    tensor Cᴹᵒᵖ ≅ (unmopFunctor C).prod (unmopFunctor C) ⋙
      Prod.swap C C ⋙ tensor C ⋙ mopFunctor C

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

((CategoryTheory.MonoidalOpposite.tensorIso C).hom.app X).unmop =
  𝟙 (CategoryTheory.MonoidalCategory.tensorObj X.2.unmop X.1.unmop)


@[simp]
theorem compl_univ_iff {s : Set α} : sᶜ = univ ↔ s = ∅


theorem lintegral_strict_mono {f g : α → ℝ≥0∞} (hμ : μ ≠ 0) (hg : AEMeasurable g μ)
    (hfi : ∫⁻ x, f x ∂μ ≠ ∞) (h : ∀ᵐ x ∂μ, f x < g x) : ∫⁻ x, f x ∂μ < ∫⁻ x, g x ∂μ

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f g : α → ℝ≥0∞}
(hμ : μ ≠ 0)
(hg : AEMeasurable g μ)
(hfi : ∫⁻ (x : α), f x ∂μ ≠ ⊤)
(h : ∀ᵐ (x : α) ∂μ, f x < g x)


theorem add_domain (f g : E →ₗ.[R] F) : (f + g).domain = f.domain ⊓ g.domain

{R : Type u_1}
[Ring R]
{E : Type u_2}
[AddCommGroup E]
[Module R E]
{F : Type u_3}
[AddCommGroup F]
[Module R F]
(f g : E →ₗ.[R] F)


/-- Change a cone on `F : J ⥤ Cᵒᵖ` to a cocone on `F.leftOp : Jᵒᵖ ⥤ C`. -/
@[simps!]
def coconeLeftOpOfCone (c : Cone F) : Cocone F.leftOp

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

(CategoryTheory.Limits.coconeLeftOpOfCone c).pt = Opposite.unop c.pt


theorem lt_univ' {c} : c < univ.{u, v} ↔ ∃ c', c = lift.{max (u + 1) v, u} c'

c < Cardinal.univ.{u, v} ↔ ∃ c', c = Cardinal.lift.{max (u + 1) v, u} c'


/-- If a function `f` is twice differentiable on an open convex set `D ⊆ ℝ` and
`f''` is nonnegative on `D`, then `f` is convex on `D`. -/
theorem convexOn_of_deriv2_nonneg' {D : Set ℝ} (hD : Convex ℝ D) {f : ℝ → ℝ}
    (hf' : DifferentiableOn ℝ f D) (hf'' : DifferentiableOn ℝ (deriv f) D)
    (hf''_nonneg : ∀ x ∈ D, 0 ≤ (deriv^[2] f) x) : ConvexOn ℝ D f

(hf''_nonneg : ∀ x ∈ D, 0 ≤ deriv^[2] f x)


protected theorem Antitone.Iic (hf : Antitone f) : Antitone fun x => Iic (f x)

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


/-- A `MorphComponents` can be precomposed with a morphism of simplicial objects. -/
@[simps]
def preComp : MorphComponents X' n Z

{X X' : CategoryTheory.SimplicialObject C}

(f : AlgebraicTopology.DoldKan.MorphComponents X n Z)

(f.preComp g).b i = g.app (Opposite.op [n]) ≫ f.b i


theorem abs_rpow_of_nonneg {x y : ℝ} (hx_nonneg : 0 ≤ x) : |x ^ y| = |x| ^ y


lemma independent_of_independent_coe_Iic_comp {ι : Sort*} {a : α} {t : ι → Set.Iic a}
    (ht : Independent ((↑) ∘ t : ι → α)) : Independent t

(ht : CompleteLattice.Independent (Subtype.val ∘ t))


@[to_additive]
theorem isUnit_of_mul_eq_one_right [CommMonoid M] (a b : M) (h : a * b = 1) : IsUnit b

{M : Type u_1}
[AddCommMonoid M]
(a b : M)
(h : a + b = 0)


@[simp]
theorem fst_add [Add R] [Add A] (x₁ x₂ : Unitization R A) : (x₁ + x₂).fst = x₁.fst + x₂.fst

{R : Type u_3}
{A : Type u_4}
[Add R]
[Add A]
(x₁ x₂ : Unitization R A)


@[to_additive (attr := simp)]
theorem iterate_map_one {M F : Type*} [One M] [FunLike F M M] [OneHomClass F M M]
    (f : F) (n : ℕ) :
    f^[n] 1 = 1

{M : Type u_5}
{F : Type u_6}
[One M]
[FunLike F M M]
[OneHomClass F M M]
(f : F)
(n : ℕ)


/-- Formula for `completedSinZeta` as a Dirichlet series in the convergence range
(first version, with sum over `ℤ`). -/
lemma hasSum_int_completedSinZeta (a : ℝ) {s : ℂ} (hs : 1 < re s) :
    HasSum (fun n : ℤ ↦ Gammaℝ (s + 1) * (-I) * Int.sign n *
    cexp (2 * π * I * a * n) / (↑|n| : ℂ) ^ s / 2) (completedSinZeta a s)

HasSum (fun n => (s + 1).Gammaℝ * -Complex.I * ↑n.sign * cexp (2 * ↑π * Complex.I * ↑a * ↑n) / ↑|n| ^ s / 2)
  (HurwitzZeta.completedSinZeta (↑a) s)


@[simp]
theorem vonMangoldt_mul_zeta : Λ * ζ = log

ArithmeticFunction.vonMangoldt * ↑ArithmeticFunction.zeta = ArithmeticFunction.log


theorem IsLocallyInjective.comp_left {f : X → Y} (hf : IsLocallyInjective f) {g : Y → A}
    (hg : g.Injective) : IsLocallyInjective (g ∘ f)

{X : Type u_1}
{Y : Type u_2}
{A : Type u_3}
[TopologicalSpace X]
{f : X → Y}
(hf : IsLocallyInjective f)
{g : Y → A}
(hg : Function.Injective g)


theorem map_mk {σ : K →+* L} (f : V →ₛₗ[σ] W) (hf : Function.Injective f) (v : V) (hv : v ≠ 0) :
    map f hf (mk K v hv) = mk L (f v) (map_zero f ▸ hf.ne hv)

{K : Type u_1}
{V : Type u_2}
[DivisionRing K]
[AddCommGroup V]
[Module K V]
{L : Type u_3}
{W : Type u_4}
[DivisionRing L]
[AddCommGroup W]
[Module L W]
{σ : K →+* L}
(f : V →ₛₗ[σ] W)
(hf : Function.Injective ⇑f)
(v : V)
(hv : v ≠ 0)

Projectivization.map f hf (Projectivization.mk K v hv) = Projectivization.mk L (f v) ⋯