theorem ofDigits_eq_foldr {α : Type*} [Semiring α] (b : α) (L : List ℕ) :
    ofDigits b L = List.foldr (fun x y => ↑x + b * y) 0 L

{α : Type u_1}
[Semiring α]
(b : α)
(L : List ℕ)

Nat.ofDigits b L = List.foldr (fun x y => ↑x + b * y) 0 L


theorem le_iff_specializes (x y : PrimeSpectrum R) : x ≤ y ↔ x ⤳ y

{R : Type u}
[CommSemiring R]
(x y : PrimeSpectrum R)


lemma exists_lt_mem_inter_of_not_pairwise_disjoint [LinearOrder ι]
    {f : ι → Set α} (h : ¬ Pairwise (Disjoint on f)) :
    ∃ i j : ι, i < j ∧ ∃ x, x ∈ f i ∩ f j

{α : Type u_1}
{ι : Type u_4}
[LinearOrder ι]
{f : ι → Set α}
(h : ¬Pairwise (Disjoint on f))


@[simp]
theorem empty_subset (x : ZFSet.{u}) : (∅ : ZFSet) ⊆ x


theorem norm_lift_le {N : Type*} [SeminormedAddCommGroup N] (S : AddSubgroup M)
    (f : NormedAddGroupHom M N) (hf : ∀ s ∈ S, f s = 0) :
    ‖lift S f hf‖ ≤ ‖f‖

{M : Type u_1}
[SeminormedAddCommGroup M]
{N : Type u_3}
[SeminormedAddCommGroup N]
(S : AddSubgroup M)
(f : NormedAddGroupHom M N)
(hf : ∀ s ∈ S, f s = 0)


/-- **Schur's Lemma** for linear maps between (possibly distinct) simple modules -/
theorem bijective_or_eq_zero [IsSimpleModule R M] [IsSimpleModule R N] (f : M →ₗ[R] N) :
    Function.Bijective f ∨ f = 0

{R : Type u_2}
[Ring R]
{M : Type u_4}
[AddCommGroup M]
[Module R M]
{N : Type u_5}
[AddCommGroup N]
[Module R N]
[IsSimpleModule R M]
[IsSimpleModule R N]
(f : M →ₗ[R] N)


protected theorem assoc (F : A ⥤ B) (G : B ⥤ C) (H : C ⥤ D) : (F ⋙ G) ⋙ H = F ⋙ G ⋙ H

{A : Type u₁}
[CategoryTheory.Category.{v₁, u₁} A]
{B : Type u₂}
[CategoryTheory.Category.{v₂, u₂} B]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{D : Type u₄}
[CategoryTheory.Category.{v₄, u₄} D]
(F : CategoryTheory.Functor A B)
(G : CategoryTheory.Functor B C)
(H : CategoryTheory.Functor C D)


theorem castSucc_pred_eq_pred_castSucc {a : Fin (n + 1)} (ha : a ≠ 0)
    (ha' := a.castSucc_ne_zero_iff.mpr ha) :
    (a.pred ha).castSucc = (castSucc a).pred ha'

{n : ℕ}
{a : Fin (n + 1)}
(ha : a ≠ 0)
(ha' : a.castSucc ≠ 0 := ⋯)

(a.pred ha).castSucc = a.castSucc.pred ha'


theorem upcrossingsBefore_eq_sum (hab : a < b) : upcrossingsBefore a b f N ω =
    ∑ i ∈ Finset.Ico 1 (N + 1), {n | upperCrossingTime a b f N n ω < N}.indicator 1 i

{Ω : Type u_1}
{a b : ℝ}
{f : ℕ → Ω → ℝ}
{N : ℕ}
{ω : Ω}
(hab : a < b)

MeasureTheory.upcrossingsBefore a b f N ω =
  ∑ i ∈ Finset.Ico 1 (N + 1), {n | MeasureTheory.upperCrossingTime a b f N n ω < N}.indicator 1 i


theorem eLpNorm_mono_ae_real {f : α → F} {g : α → ℝ} (h : ∀ᵐ x ∂μ, ‖f x‖ ≤ g x) :
    eLpNorm f p μ ≤ eLpNorm g p μ

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

MeasureTheory.eLpNorm f p μ ≤ MeasureTheory.eLpNorm g p μ


@[simp] lemma zero_apply (x : E) : (0 : E →WOT[𝕜] F) x = 0

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[RCLike 𝕜]
[AddCommGroup E]
[TopologicalSpace E]
[Module 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
(x : E)


/-- A uniformly Cauchy sequence converges uniformly to its limit -/
theorem UniformCauchySeqOnFilter.tendstoUniformlyOnFilter_of_tendsto [NeBot p]
    (hF : UniformCauchySeqOnFilter F p p')
    (hF' : ∀ᶠ x : α in p', Tendsto (fun n => F n x) p (𝓝 (f x))) :
    TendstoUniformlyOnFilter F f p p'

{F : ι → α → β}

(hF' : ∀ᶠ (x : α) in p', Filter.Tendsto (fun n => F n x) p (𝓝 (f x)))


/-- The functor sending `X : C` to the constant functor `J ⥤ C` sending everything to `X`.
-/
@[simps]
def const : C ⥤ J ⥤ C

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

∀ {X Y : C} (f : X ⟶ Y) (x : J), ((CategoryTheory.Functor.const J).map f).app x = f


theorem mul_inv_cancel_iff {I : FractionalIdeal R₁⁰ K} : I * I⁻¹ = 1 ↔ ∃ J, I * J = 1

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


theorem coeff_X' [DecidableEq σ] (i : σ) (m) :
    coeff m (X i : MvPolynomial σ R) = if Finsupp.single i 1 = m then 1 else 0

{R : Type u}
{σ : Type u_1}
[CommSemiring R]
[DecidableEq σ]
(i : σ)
(m : σ →₀ ℕ)

MvPolynomial.coeff m (MvPolynomial.X i) = if Finsupp.single i 1 = m then 1 else 0


theorem lt_of_tendsto_zero_of_pos {f : ℕ → ℝ} (hf : Tendsto f atTop (𝓝 0)) :
    ∀ {r : ℝ}, 0 < r → ofSeq f < (r : ℝ*)

(hf : Filter.Tendsto f Filter.atTop (𝓝 0))


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

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


theorem symm_map_nhdsWithin_range (x : H) : map I.symm (𝓝[range I] I x) = 𝓝 x

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

Filter.map (↑I.symm) (𝓝[Set.range ↑I] ↑I x) = 𝓝 x


@[simp]
theorem equivEquivIso_hom {X Y : Type u} (e : X ≃ Y) : equivEquivIso e = e.toIso


theorem toOuterMeasure_apply : p.toOuterMeasure s = ∑' x, s.indicator p x

p.toOuterMeasure s = ∑' (x : α), s.indicator (⇑p) x


lemma SpecializingMap.stableUnderSpecialization_image (hf : SpecializingMap f)
    {s : Set X} (hs : StableUnderSpecialization s) : StableUnderSpecialization (f '' s)

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


lemma quasiIsoAt_iff_isIso_homologyMap (f : K ⟶ L) (i : ι)
    [K.HasHomology i] [L.HasHomology i] :
    QuasiIsoAt f i ↔ IsIso (homologyMap f i)

QuasiIsoAt f i ↔ CategoryTheory.IsIso (HomologicalComplex.homologyMap f i)


theorem down_up {f : Type u₀ → Type u₁} {g : Type max u₀ v₀ → Type v₁} [ULiftable f g] {α}
    (x : f α) : down (up x : g (ULift.{v₀} α)) = x

{f : Type u₀ → Type u₁}
{g : Type (max u₀ v₀) → Type v₁}
[ULiftable f g]
{α : Type u₀}
(x : f α)


theorem map_id_apply (x : ResidueField R) : map (RingHom.id R) x = x

{R : Type u_1}
[CommRing R]
[LocalRing R]
(x : LocalRing.ResidueField R)

(LocalRing.ResidueField.map (RingHom.id R)) x = x


/-- Note this is more general than `IsSelfAdjoint.star_mul_self` as `B` can be rectangular. -/
theorem isHermitian_transpose_mul_self [Fintype m] (A : Matrix m n α) : (Aᴴ * A).IsHermitian

{α : Type u_1}
{m : Type u_3}
{n : Type u_4}
[NonUnitalSemiring α]
[StarRing α]
[Fintype m]
(A : Matrix m n α)


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

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

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


/-- The cardinality of the complex numbers, as a set. -/
-- @[simp] -- Porting note (#10618): simp can prove this
theorem mk_univ_complex : #(Set.univ : Set ℂ) = 𝔠


theorem rothNumberNat_le (N : ℕ) : rothNumberNat N ≤ N


/-- Vertical inverse of a 2-commutative square -/
@[simps! iso'_hom_app iso'_inv_app]
def vInv (_ : CatCommSq T L.functor R.functor B) : CatCommSq B L.inverse R.inverse T

∀ (x : CategoryTheory.CatCommSq T L.functor R.functor B) (X : C₃),
  CategoryTheory.CatCommSq.iso'.hom.app X =
    CategoryTheory.CategoryStruct.comp (R.inverse.map (B.map (L.counitIso.inv.app X)))
      (CategoryTheory.CategoryStruct.comp
        (R.inverse.map ((CategoryTheory.CatCommSq.iso T L.functor R.functor B).inv.app (L.inverse.obj X)))
        (R.unitIso.inv.app (T.obj (L.inverse.obj X))))


theorem iUnion_mem_generateMeasurableRec {s : Set (Set α)} {i : ω₁} {f : ℕ → Set α}
    (hf : ∀ n, ∃ j < i, f n ∈ generateMeasurableRec s j) :
    (⋃ n, f n) ∈ generateMeasurableRec s i

{i : (Quotient.out (Cardinal.aleph 1).ord).α}

(hf : ∀ (n : ℕ), ∃ j < i, f n ∈ MeasurableSpace.generateMeasurableRec s j)

⋃ n, f n ∈ MeasurableSpace.generateMeasurableRec s i


/-- The non negative norm seen as an `ENNReal` and then as a `Real` is equal to the norm. -/
@[to_additive toReal_coe_nnnorm "The non negative norm seen as an `ENNReal` and
then as a `Real` is equal to the norm."]
theorem toReal_coe_nnnorm' (a : E) : (‖a‖₊ : ℝ≥0∞).toReal = ‖a‖

{E : Type u_6}
[SeminormedAddGroup E]
(a : E)


@[simp]
theorem factorization_one : factorization 1 = 0


theorem _root_.IsAntichain.finite_of_partiallyWellOrderedOn (ha : IsAntichain r s)
    (hp : s.PartiallyWellOrderedOn r) : s.Finite

{α : Type u_2}
{r : α → α → Prop}
{s : Set α}
(ha : IsAntichain r s)
(hp : s.PartiallyWellOrderedOn r)


theorem Iio_union_Ioo (h : min c d < b) : Iio b ∪ Ioo c d = Iio (max b d)

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

Set.Iio b ∪ Set.Ioo c d = Set.Iio (max b d)


theorem compl_cylinder (s : Finset ι) (S : Set (∀ i : s, α i)) :
    (cylinder s S)ᶜ = cylinder s (Sᶜ)

{ι : Type u_1}
{α : ι → Type u_2}
(s : Finset ι)
(S : Set ((i : { x // x ∈ s }) → α ↑i))

(MeasureTheory.cylinder s S)ᶜ = MeasureTheory.cylinder s Sᶜ


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

(F : CategoryTheory.LaxMonoidalFunctor V W)

∀ (a : Action V G) (g : ↑G), ((CategoryTheory.MonoidalFunctor.mapActionLax F G).obj a).ρ g = F.map (a.ρ g)


@[simp]
theorem ofDual_compl (a : αᵒᵈ) : ofDual aᶜ = ￢ofDual a

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

OrderDual.ofDual aᶜ = ￢OrderDual.ofDual a


private theorem deriv_ne_zero : F.derivative.eval a ≠ 0

(hnorm : ‖Polynomial.eval a F‖ < ‖Polynomial.eval a (Polynomial.derivative F)‖ ^ 2)

Polynomial.eval a (Polynomial.derivative F) ≠ 0


/-- Each element of the group defines a module automorphism.

This is a stronger version of `DistribMulAction.toAddAut`. -/
@[simps]
def toModuleAut : S →* M ≃ₗ[R] M

(R : Type u_1)
{S : Type u_7}
(M : Type u_8)
[Semiring R]
[AddCommMonoid M]
[Module R M]
[Group S]
[DistribMulAction S M]
[SMulCommClass S R M]
(s : S)

(DistribMulAction.toModuleAut R M) s = DistribMulAction.toLinearEquiv R M s


/-- Linear isomorphism obtained by separating the term of index `none` of a direct sum over
`Option ι`. -/
@[simps]
noncomputable def lequivProdDirectSum : (⨁ i, α i) ≃ₗ[R] α none × ⨁ i, α (some i)

(R : Type u)
[Semiring R]
{ι : Type v}
{α : Option ι → Type w}
[(i : Option ι) → AddCommMonoid (α i)]
[(i : Option ι) → Module R (α i)]

∀ (a : DirectSum (Option ι) fun i => α i), (DirectSum.lequivProdDirectSum R) a = DirectSum.addEquivProdDirectSum.toFun a


theorem union_sdiff_symm : s ∪ t \ s = t ∪ s \ t

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


theorem Base.dep_of_insert (hB : M.Base B) (heB : e ∉ B) (he : e ∈ M.E := by aesop_mat) :
    M.Dep (insert e B)

{α : Type u_1}
{M : Matroid α}
{B : Set α}
{e : α}
(hB : M.Base B)
(heB : e ∉ B)
(he : e ∈ M.E := by aesop_mat)


theorem map_le_of_le_comap {T : L.Substructure N} {f : M →[L] N} : S ≤ T.comap f → S.map f ≤ T

{L : FirstOrder.Language}
{M : Type w}
{N : Type u_1}
[L.Structure M]
[L.Structure N]
(S : L.Substructure M)
{T : L.Substructure N}
{f : L.Hom M N}

S ≤ FirstOrder.Language.Substructure.comap f T → FirstOrder.Language.Substructure.map f S ≤ T


@[elab_as_elim]
theorem adjoin_induction₂ {s : Set A} {p : A → A → Prop} {a b : A} (ha : a ∈ adjoin R s)
    (hb : b ∈ adjoin R s) (Hs : ∀ x ∈ s, ∀ y ∈ s, p x y) (H0_left : ∀ y, p 0 y)
    (H0_right : ∀ x, p x 0) (Hadd_left : ∀ x₁ x₂ y, p x₁ y → p x₂ y → p (x₁ + x₂) y)
    (Hadd_right : ∀ x y₁ y₂, p x y₁ → p x y₂ → p x (y₁ + y₂))
    (Hmul_left : ∀ x₁ x₂ y, p x₁ y → p x₂ y → p (x₁ * x₂) y)
    (Hmul_right : ∀ x y₁ y₂, p x y₁ → p x y₂ → p x (y₁ * y₂))
    (Hsmul_left : ∀ (r : R) x y, p x y → p (r • x) y)
    (Hsmul_right : ∀ (r : R) x y, p x y → p x (r • y)) : p a b

(Hadd_left : ∀ (x₁ x₂ y : A), p x₁ y → p x₂ y → p (x₁ + x₂) y)

(Hadd_right : ∀ (x y₁ y₂ : A), p x y₁ → p x y₂ → p x (y₁ + y₂))

(Hmul_left : ∀ (x₁ x₂ y : A), p x₁ y → p x₂ y → p (x₁ * x₂) y)

(Hmul_right : ∀ (x y₁ y₂ : A), p x y₁ → p x y₂ → p x (y₁ * y₂))

(Hsmul_left : ∀ (r : R) (x y : A), p x y → p (r • x) y)

(Hsmul_right : ∀ (r : R) (x y : A), p x y → p x (r • y))


lemma isRatStieltjesPoint_unit_prod_iff (f : α → ℚ → ℝ) (a : α) :
    IsRatStieltjesPoint (fun p : Unit × α ↦ f p.2) ((), a)
      ↔ IsRatStieltjesPoint f a

ProbabilityTheory.IsRatStieltjesPoint (fun p => f p.2) ((), a) ↔ ProbabilityTheory.IsRatStieltjesPoint f a


/-- If `x * y = a * ∏ i ∈ s, p i` where `p i` is always prime, then
  `x` and `y` can both be written as a divisor of `a` multiplied by
  a product over a subset of `s`  -/
theorem mul_eq_mul_prime_prod {α : Type*} [DecidableEq α] {x y a : R} {s : Finset α} {p : α → R}
    (hp : ∀ i ∈ s, Prime (p i)) (hx : x * y = a * ∏ i ∈ s, p i) :
    ∃ (t u : Finset α) (b c : R),
      t ∪ u = s ∧ Disjoint t u ∧ a = b * c ∧ (x = b * ∏ i ∈ t, p i) ∧ y = c * ∏ i ∈ u, p i

{R : Type u_1}
[CancelCommMonoidWithZero R]
{α : Type u_2}
[DecidableEq α]
{x y a : R}
{s : Finset α}
{p : α → R}
(hp : ∀ i ∈ s, Prime (p i))
(hx : x * y = a * ∏ i ∈ s, p i)

∃ t u b c, t ∪ u = s ∧ Disjoint t u ∧ a = b * c ∧ x = b * ∏ i ∈ t, p i ∧ y = c * ∏ i ∈ u, p i


@[simp]
theorem relabel_not (g : α → β ⊕ (Fin n)) {k} (φ : L.BoundedFormula α k) :
    φ.not.relabel g = (φ.relabel g).not

{L : FirstOrder.Language}
{α : Type u'}
{β : Type v'}
{n : ℕ}
(g : α → β ⊕ Fin n)
{k : ℕ}
(φ : L.BoundedFormula α k)

FirstOrder.Language.BoundedFormula.relabel g φ.not = (FirstOrder.Language.BoundedFormula.relabel g φ).not


theorem sInf_upward_closed_eq_succ_iff {s : Set ℕ} (hs : ∀ k₁ k₂ : ℕ, k₁ ≤ k₂ → k₁ ∈ s → k₂ ∈ s)
    (k : ℕ) : sInf s = k + 1 ↔ k + 1 ∈ s ∧ k ∉ s

(hs : ∀ (k₁ k₂ : ℕ), k₁ ≤ k₂ → k₁ ∈ s → k₂ ∈ s)


theorem FiniteDimensional.rank_linearMap :
    Module.rank S (M →ₗ[R] N) = lift.{w} (Module.rank R M) * lift.{v} (Module.rank S N)

(R : Type u)
(S : Type u')
(M : Type v)
(N : Type w)
[Ring R]
[Ring S]
[AddCommGroup M]
[Module R M]
[Module.Free R M]
[Module.Finite R M]
[AddCommGroup N]
[Module R N]
[Module S N]
[SMulCommClass R S N]
[StrongRankCondition R]
[StrongRankCondition S]
[Module.Free S N]

Module.rank S (M →ₗ[R] N) = Cardinal.lift.{w, v} (Module.rank R M) * Cardinal.lift.{v, w} (Module.rank S N)


/-- This is the *continuous functional calculus* of an element `a : A` in a non-unital algebra
applied to bare functions.  When either `a` does not satisfy the predicate `p` (i.e., `a` is not
`IsStarNormal`, `IsSelfAdjoint`, or `0 ≤ a` when `R` is `ℂ`, `ℝ`, or `ℝ≥0`, respectively), or when
`f : R → R` is not continuous on the quasispectrum of `a` or `f 0 ≠ 0`, then `cfcₙ f a` returns the
junk value `0`.

This is the primary declaration intended for widespread use of the continuous functional calculus
for non-unital algebras, and all the API applies to this declaration. For more information, see the
module documentation for `Analysis.CstarAlgebra.ContinuousFunctionalCalculus.Unital`. -/
noncomputable irreducible_def cfcₙ (f : R → R) (a : A) : A

cfcₙ f a =
  if h : p a ∧ ContinuousOn f (σₙ R a) ∧ f 0 = 0 then
    (cfcₙHom ⋯) { toFun := (σₙ R a).restrict f, continuous_toFun := ⋯, map_zero' := ⋯ }
  else 0


/-- `TStructure C` is the type of t-structures on the (pre)triangulated category `C`. -/
structure TStructure where
  /-- the predicate of objects that are `≤ n` for `n : ℤ`. -/
  LE (n : ℤ) : C → Prop
  /-- the predicate of objects that are `≥ n` for `n : ℤ`. -/
  GE (n : ℤ) : C → Prop
  LE_closedUnderIsomorphisms (n : ℤ) : ClosedUnderIsomorphisms (LE n) := by infer_instance
  GE_closedUnderIsomorphisms (n : ℤ) : ClosedUnderIsomorphisms (GE n) := by infer_instance
  LE_shift (n a n' : ℤ) (h : a + n' = n) (X : C) (hX : LE n X) : LE n' (X⟦a⟧)
  GE_shift (n a n' : ℤ) (h : a + n' = n) (X : C) (hX : GE n X) : GE n' (X⟦a⟧)
  zero' ⦃X Y : C⦄ (f : X ⟶ Y) (hX : LE 0 X) (hY : GE 1 Y) : f = 0
  LE_zero_le : LE 0 ≤ LE 1
  GE_one_le : GE 1 ≤ GE 0
  exists_triangle_zero_one (A : C) : ∃ (X Y : C) (_ : LE 0 X) (_ : GE 1 Y)
    (f : X ⟶ A) (g : A ⟶ Y) (h : Y ⟶ X⟦(1 : ℤ)⟧), Triangle.mk f g h ∈ distTriang C

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

(self : CategoryTheory.Triangulated.TStructure C)


/-- If `F` has all arrows surjective, then it "factors through a poset". -/
theorem thin_diagram_of_surjective (Fsur : ∀ ⦃i j : J⦄ (f : i ⟶ j), (F.map f).Surjective) {i j}
    (f g : i ⟶ j) : F.map f = F.map g

(Fsur : ∀ ⦃i j : J⦄ (f : i ⟶ j), Function.Surjective (F.map f))


/-- The degree of `cyclotomic n R` is positive. -/
theorem degree_cyclotomic_pos (n : ℕ) (R : Type*) (hpos : 0 < n) [Ring R] [Nontrivial R] :
    0 < (cyclotomic n R).degree

(n : ℕ)
(R : Type u_1)
(hpos : 0 < n)
[Ring R]
[Nontrivial R]


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

{M : Type u_1}
[CommMonoid M]
(a b : M)
(h : a * b = 1)


@[to_additive]
theorem map_iSup {ι : Sort*} (f : G →* N) (s : ι → Subgroup G) :
    (iSup s).map f = ⨆ i, (s i).map f

{G : Type u_1}
[Group G]
{N : Type u_5}
[Group N]
{ι : Sort u_7}
(f : G →* N)
(s : ι → Subgroup G)

Subgroup.map f (iSup s) = ⨆ i, Subgroup.map f (s i)


theorem corec_roll {α : TypeVec n} {X Y} {x₀ : X} (f : X → Y) (g : Y → F (α ::: X)) :
    Cofix.corec (g ∘ f) x₀ = Cofix.corec (MvFunctor.map (id ::: f) ∘ g) (f x₀)

{n : ℕ}
{F : TypeVec.{u} (n + 1) → Type u}
[q : MvQPF F]
{α : TypeVec.{u} n}
{X Y : Type u}
{x₀ : X}
(f : X → Y)
(g : Y → F (α ::: X))

MvQPF.Cofix.corec (g ∘ f) x₀ = MvQPF.Cofix.corec (MvFunctor.map (TypeVec.id ::: f) ∘ g) (f x₀)


@[simp]
theorem insert_apply_right {α} {s : Set.{u} α} [DecidablePred (· ∈ s)] {a : α} (H : a ∉ s) (b : s) :
    Equiv.Set.insert H ⟨b, Or.inr b.2⟩ = Sum.inl b

{α : Type u}
{s : Set α}
[DecidablePred fun x => x ∈ s]
{a : α}
(H : a ∉ s)
(b : ↑s)

(Equiv.Set.insert H) ⟨↑b, ⋯⟩ = Sum.inl b


/-- A property `C → Prop` is a monoidal predicate if it is closed under `𝟙_` and `⊗`.
-/
class MonoidalPredicate : Prop where
  prop_id : P (𝟙_ C) := by aesop_cat
  prop_tensor : ∀ {X Y}, P X → P Y → P (X ⊗ Y) := by aesop_cat

[self : CategoryTheory.MonoidalCategory.MonoidalPredicate P]


@[simp]
lemma natDegree_preΨ' {n : ℕ} (h : (n : R) ≠ 0) :
    (W.preΨ' n).natDegree = (n ^ 2 - if Even n then 4 else 1) / 2

{R : Type u}
[CommRing R]
(W : WeierstrassCurve R)
{n : ℕ}
(h : ↑n ≠ 0)


theorem extendScalars_adjoin {K : IntermediateField F E} {S : Set E} (h : K ≤ adjoin F S) :
    extendScalars h = adjoin K S

{F : Type u_1}
[Field F]
{E : Type u_2}
[Field E]
[Algebra F E]
{K : IntermediateField F E}
{S : Set E}
(h : K ≤ IntermediateField.adjoin F S)

IntermediateField.extendScalars h = IntermediateField.adjoin (↥K) S


protected theorem MulAction.surjective₀ (ha : a ≠ 0) : Function.Surjective (a • · : β → β)

{α : Type u}
{β : Type v}
[GroupWithZero α]
[MulAction α β]
{a : α}
(ha : a ≠ 0)


theorem dvdNotUnit_of_lt {a b : Associates α} (hlt : a < b) : DvdNotUnit a b

{α : Type u_1}
[CommMonoidWithZero α]
{a b : Associates α}
(hlt : a < b)


lemma natAbs_le_of_dvd_ne_zero (hmn : m ∣ n) (hn : n ≠ 0) : natAbs m ≤ natAbs n


theorem digits_def' :
    ∀ {b : ℕ} (_ : 1 < b) {n : ℕ} (_ : 0 < n), digits b n = (n % b) :: digits b (n / b)

1 < b → ∀ {n : ℕ}, 0 < n → b.digits n = n % b :: b.digits (n / b)


@[simp]
theorem coe_toAlgEquiv : ⇑(e : A ≃ₐ[R] B) = e

{R : Type u}
{A : Type v}
{B : Type w}
[CommSemiring R]
[Semiring A]
[Semiring B]
[Algebra R A]
[Algebra R B]
[CoalgebraStruct R A]
[CoalgebraStruct R B]
(e : A ≃ₐc[R] B)


lemma isZero_iff_isStrictlySupported_and_isStrictlySupportedOutside :
    IsZero K ↔ K.IsStrictlySupported e ∧ K.IsStrictlySupportedOutside e

CategoryTheory.Limits.IsZero K ↔ K.IsStrictlySupported e ∧ K.IsStrictlySupportedOutside e


@[to_additive]
theorem IsComplement'.symm (h : IsComplement' H K) : IsComplement' K H

{G : Type u_1}
[Group G]
{H K : Subgroup G}
(h : H.IsComplement' K)


@[simp]
theorem pushoutCoconeOfLeftIso_ι_app_left : (pushoutCoconeOfLeftIso f g).ι.app left = inv f ≫ g

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

(CategoryTheory.Limits.pushoutCoconeOfLeftIso f g).ι.app CategoryTheory.Limits.WalkingSpan.left =
  CategoryTheory.inv f ≫ g


@[simp]
theorem coe_comp (f : BoundedLatticeHom β γ) (g : BoundedLatticeHom α β) :
    (f.comp g : α → γ) = f ∘ g

{α : Type u_3}
{β : Type u_4}
{γ : Type u_5}
[Lattice α]
[Lattice β]
[Lattice γ]
[BoundedOrder α]
[BoundedOrder β]
[BoundedOrder γ]
(f : BoundedLatticeHom β γ)
(g : BoundedLatticeHom α β)


theorem lt_rootMultiplicity_iff_isRoot_iterate_derivative
    [CharZero R] {p : R[X]} {t : R} {n : ℕ} (h : p ≠ 0) :
    n < p.rootMultiplicity t ↔ ∀ m ≤ n, (derivative^[m] p).IsRoot t

{R : Type u}
[CommRing R]
[IsDomain R]
[CharZero R]
{p : R[X]}
{t : R}
{n : ℕ}
(h : p ≠ 0)

n < Polynomial.rootMultiplicity t p ↔ ∀ m ≤ n, ((⇑Polynomial.derivative)^[m] p).IsRoot t


@[to_additive]
theorem inv_toFun_mul_mem (hS : S ∈ Subgroup.leftTransversals (H : Set G)) (g : G) :
    (toFun hS g : G)⁻¹ * g ∈ H

(hS : S ∈ AddSubgroup.leftTransversals ↑H)

-↑(AddSubgroup.MemLeftTransversals.toFun hS g) + g ∈ H


@[to_additive (attr := simp)]
theorem mul_apply {M N} [Mul M] [CommSemigroup N] (f g : M →ₙ* N) (x : M) :
    (f * g) x = f x * g x

{M : Type u_9}
{N : Type u_10}
[Mul M]
[CommSemigroup N]
(f g : M →ₙ* N)
(x : M)


theorem compl_sup_distrib (a b : α) : (a ⊔ b)ᶜ = aᶜ ⊓ bᶜ

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


@[to_additive]
theorem prod_antidiagonal_swap {M : Type*} [CommMonoid M] (n : α →₀ ℕ)
    (f : (α →₀ ℕ) → (α →₀ ℕ) → M) :
    ∏ p ∈ antidiagonal n, f p.1 p.2 = ∏ p ∈ antidiagonal n, f p.2 p.1

{α : Type u}
[DecidableEq α]
{M : Type u_1}
[CommMonoid M]
(n : α →₀ ℕ)
(f : (α →₀ ℕ) → (α →₀ ℕ) → M)

∏ p ∈ Finset.antidiagonal n, f p.1 p.2 = ∏ p ∈ Finset.antidiagonal n, f p.2 p.1


theorem _root_.StrictMono.tendsto_atTop {φ : ℕ → ℕ} (h : StrictMono φ) : Tendsto φ atTop atTop

Filter.Tendsto φ Filter.atTop Filter.atTop


@[simp]
lemma ofProd_ι_mk (m₁ : M₁) (m₂ : M₂) :
    ofProd Q₁ Q₂ (ι _ (m₁, m₂)) = ι Q₁ m₁ ᵍ⊗ₜ 1 + 1 ᵍ⊗ₜ ι Q₂ m₂

{R : Type u_1}
{M₁ : Type u_2}
{M₂ : Type u_3}
[CommRing R]
[AddCommGroup M₁]
[AddCommGroup M₂]
[Module R M₁]
[Module R M₂]
(Q₁ : QuadraticForm R M₁)
(Q₂ : QuadraticForm R M₂)
(m₁ : M₁)
(m₂ : M₂)

(CliffordAlgebra.ofProd Q₁ Q₂) ((CliffordAlgebra.ι (QuadraticMap.prod Q₁ Q₂)) (m₁, m₂)) =
  (CliffordAlgebra.ι Q₁) m₁ ᵍ⊗ₜ[R] 1 + 1 ᵍ⊗ₜ[R] (CliffordAlgebra.ι Q₂) m₂


@[simp]
theorem coe_sdiff (s t : Subtype (MeasurableSet : Set α → Prop)) : ↑(s \ t) = (s : Set α) \ t

{α : Type u_1}
[MeasurableSpace α]
(s t : Subtype MeasurableSet)


theorem preimage_spanningSetsIndex_singleton (μ : Measure α) [SigmaFinite μ] (n : ℕ) :
    spanningSetsIndex μ ⁻¹' {n} = disjointed (spanningSets μ) n

{α : Type u_1}
{m0 : MeasurableSpace α}
(μ : MeasureTheory.Measure α)
[MeasureTheory.SigmaFinite μ]
(n : ℕ)

MeasureTheory.spanningSetsIndex μ ⁻¹' {n} = disjointed (MeasureTheory.spanningSets μ) n


theorem lift_unique [IsDirected ι (· ≤ ·)] (F : DirectLimit G f →ₗ[R] P) (x) :
    F x =
      lift R ι G f (fun i => F.comp <| of R ι G f i)
        (fun i j hij x => by rw [LinearMap.comp_apply, of_f]; rfl) x

{R : Type u}
[Ring R]
{ι : Type v}
[Preorder ι]
{G : ι → Type w}
[(i : ι) → AddCommGroup (G i)]
[(i : ι) → Module R (G i)]
{f : (i j : ι) → i ≤ j → G i →ₗ[R] G j}
[DecidableEq ι]
{P : Type u₁}
[AddCommGroup P]
[Module R P]
[IsDirected ι fun x x_1 => x ≤ x_1]
(F : Module.DirectLimit G f →ₗ[R] P)
(x : Module.DirectLimit G f)

F x = (Module.DirectLimit.lift R ι G f (fun i => F ∘ₗ Module.DirectLimit.of R ι G f i) ⋯) x


theorem wittStructureInt_vars [Fintype idx] (Φ : MvPolynomial idx ℤ) (n : ℕ) :
    (wittStructureInt p Φ n).vars ⊆ Finset.univ ×ˢ Finset.range (n + 1)

(p : ℕ)
{idx : Type u_2}
[hp : Fact (Nat.Prime p)]
[Fintype idx]
(Φ : MvPolynomial idx ℤ)
(n : ℕ)


theorem natDegree_minpolyGen [Nontrivial A] (pb : PowerBasis A S) :
    natDegree (minpolyGen pb) = pb.dim

{S : Type u_2}
[Ring S]
{A : Type u_4}
[CommRing A]
[Algebra A S]
[Nontrivial A]
(pb : PowerBasis A S)


theorem Monotone.mul [PosMulMono α] [MulPosMono α]
    (hf : Monotone f) (hg : Monotone g) (hf₀ : ∀ x, 0 ≤ f x) (hg₀ : ∀ x, 0 ≤ g x) :
    Monotone (f * g)

{α : Type u}
{β : Type u_1}
[Semiring α]
[Preorder α]
[Preorder β]
{f g : β → α}
[PosMulMono α]
[MulPosMono α]
(hf : Monotone f)
(hg : Monotone g)
(hf₀ : ∀ (x : β), 0 ≤ f x)
(hg₀ : ∀ (x : β), 0 ≤ g x)


theorem LipschitzWith.comp_memℒp {α E F} {K} [MeasurableSpace α] {μ : Measure α}
    [NormedAddCommGroup E] [NormedAddCommGroup F] {f : α → E} {g : E → F} (hg : LipschitzWith K g)
    (g0 : g 0 = 0) (hL : Memℒp f p μ) : Memℒp (g ∘ f) p μ

{p : ℝ≥0∞}
{α : Type u_5}
{E : Type u_6}
{F : Type u_7}
{K : ℝ≥0}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup E]
[NormedAddCommGroup F]
{f : α → E}
{g : E → F}
(hg : LipschitzWith K g)
(g0 : g 0 = 0)
(hL : MeasureTheory.Memℒp f p μ)


/-- The lower part of the first column of the snake diagram is exact. -/
lemma exact_C₁_down : (ShortComplex.mk S.v₁₂.τ₁ S.v₂₃.τ₁
    (by rw [← comp_τ₁, S.w₁₃, zero_τ₁])).Exact

(S : CategoryTheory.ShortComplex.SnakeInput C)

(CategoryTheory.ShortComplex.mk S.v₁₂.τ₁ S.v₂₃.τ₁ ⋯).Exact


theorem le_nhdsAdjoint_iff {α : Type*} (a : α) (f : Filter α) (t : TopologicalSpace α) :
    t ≤ nhdsAdjoint a f ↔ @nhds α t a ≤ pure a ⊔ f ∧ ∀ b ≠ a, IsOpen[t] {b}

{α : Type u_1}
(a : α)
(f : Filter α)
(t : TopologicalSpace α)

t ≤ nhdsAdjoint a f ↔ 𝓝 a ≤ pure a ⊔ f ∧ ∀ (b : α), b ≠ a → IsOpen {b}


theorem X_pow_eq_monomial : X n ^ e = monomial (Finsupp.single n e) (1 : R)

{R : Type u}
{σ : Type u_1}
{e : ℕ}
{n : σ}
[CommSemiring R]

MvPolynomial.X n ^ e = (MvPolynomial.monomial (Finsupp.single n e)) 1


@[to_additive (attr := simp)]
lemma comp_div (f : G →* H) (g h : M →* G) : f.comp (g / h) = f.comp g / f.comp h

{M : Type u_3}
{G : Type u_6}
{H : Type u_7}
[AddZeroClass M]
[AddCommGroup G]
[AddCommGroup H]
(f : G →+ H)
(g h : M →+ G)


@[simp, norm_cast] lemma coe_mk' (f : ∀ i, β i) (s) : ⇑(⟨f, s⟩ : Π₀ i, β i) = f

(s : Trunc { s // ∀ (i : ι), i ∈ s ∨ f i = 0 })


/-- This duplicates the global `smul_eq_mul`, but doesn't have to unfold anywhere near as much to
apply. -/
protected theorem _root_.Ideal.smul_eq_mul (I J : Ideal R) : I • J = I * J

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


/-- A morphism of schemes `f : X ⟶ Y` is a preimmersion if the underlying map of
topological spaces is an embedding and the induced morphisms of stalks are all surjective. -/
@[mk_iff]
class IsPreimmersion {X Y : Scheme} (f : X ⟶ Y) : Prop where
  base_embedding : Embedding f.1.base
  surj_on_stalks : ∀ x, Function.Surjective (f.stalkMap x)

[self : AlgebraicGeometry.IsPreimmersion f]

Function.Surjective ⇑(AlgebraicGeometry.Scheme.Hom.stalkMap f x)


@[simp]
theorem vsub_eq_empty : s -ᵥ t = ∅ ↔ s = ∅ ∨ t = ∅

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


@[simp]
theorem mem_toFinset {a : α} {o : Option α} : a ∈ o.toFinset ↔ a ∈ o


theorem exists_of_compat [CompactSpace X] (Qs : (Q : DiscreteQuotient X) → Q)
    (compat : ∀ (A B : DiscreteQuotient X) (h : A ≤ B), ofLE h (Qs _) = Qs _) :
    ∃ x : X, ∀ Q : DiscreteQuotient X, Q.proj x = Qs _

(Qs : (Q : DiscreteQuotient X) → Quotient Q.toSetoid)

(compat : ∀ (A B : DiscreteQuotient X) (h : A ≤ B), DiscreteQuotient.ofLE h (Qs A) = Qs B)

∃ x, ∀ (Q : DiscreteQuotient X), Q.proj x = Qs Q


@[simp]
theorem ListBlank.tail_cons {Γ} [Inhabited Γ] (a : Γ) : ∀ l : ListBlank Γ, (l.cons a).tail = l

{Γ : Type u_1}
[Inhabited Γ]
(a : Γ)
(l : Turing.ListBlank Γ)


theorem natDegree_one_le : natDegree (1 : R[X]) ≤ 0


nonrec theorem HasDerivWithinAt.sub (hf : HasDerivWithinAt f f' s x)
    (hg : HasDerivWithinAt g g' s x) : HasDerivWithinAt (fun x => f x - g x) (f' - g') s x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f g : 𝕜 → F}
{f' g' : F}
{x : 𝕜}
{s : Set 𝕜}
(hf : HasDerivWithinAt f f' s x)
(hg : HasDerivWithinAt g g' s x)


theorem tsum_unop [T2Space α] {f : β → αᵐᵒᵖ} :
    ∑' x, unop (f x) = unop (∑' x, f x)

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

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


theorem isCompl_bot_top : IsCompl (⊥ : α) ⊤

{α : Type u_1}
[Lattice α]
[BoundedOrder α]


@[to_additive]
theorem isComplement_singleton_right {g : G} : IsComplement S {g} ↔ S = univ

{G : Type u_1}
[Group G]
{S : Set G}
{g : G}

Subgroup.IsComplement S {g} ↔ S = Set.univ


theorem nonzeroMinimum_le {xs : List Nat} (m : a ∈ xs) (h : a ≠ 0) : xs.nonzeroMinimum ≤ a

{a : Nat}
{xs : List Nat}
(m : a ∈ xs)
(h : a ≠ 0)


theorem range_image (f : α → β) : range (image f) = 𝒫 range f

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


theorem hasBasis_nhdsSet_Ici_Ici (a : α) [NeBot (𝓝[<] a)] :
    HasBasis (𝓝ˢ (Ici a)) (· < a) Ici

{α : Type u_1}
[LinearOrder α]
[TopologicalSpace α]
[OrderTopology α]
(a : α)
[(𝓝[<] a).NeBot]

(𝓝ˢ (Set.Ici a)).HasBasis (fun x => x < a) Set.Ici


theorem liftAlgHom_apply_div (p q : K[X]) :
    liftAlgHom φ hφ (algebraMap _ _ p / algebraMap _ _ q) = φ p / φ q

{K : Type u}
[CommRing K]
[IsDomain K]
{L : Type u_1}
{S : Type u_3}
[Field L]
[CommSemiring S]
[Algebra S K[X]]
[Algebra S L]
(φ : K[X] →ₐ[S] L)
(hφ : K[X]⁰ ≤ Submonoid.comap φ L⁰)
(p q : K[X])

(RatFunc.liftAlgHom φ hφ) ((algebraMap K[X] (RatFunc K)) p / (algebraMap K[X] (RatFunc K)) q) = φ p / φ q


theorem NormedAddGroupHom.extension_def (f : NormedAddGroupHom G H) (v : G) :
    f.extension v = Completion.extension f v

{G : Type u_1}
[SeminormedAddCommGroup G]
{H : Type u_2}
[SeminormedAddCommGroup H]
[T0Space H]
[CompleteSpace H]
(f : NormedAddGroupHom G H)
(v : G)

f.extension (↑G v) = UniformSpace.Completion.extension (⇑f) (↑G v)


@[simp]
theorem isConj_one_left {a : α} : IsConj a 1 ↔ a = 1


@[to_additive (attr := simp, norm_cast)]
lemma coe_eq_one : (a : WithTop α) = 1 ↔ a = 1


/-- The sum of `2⁻¹ ^ i` for `n ≤ i` equals `2 * 2⁻¹ ^ n`. -/
theorem tsum_geometric_inv_two_ge (n : ℕ) :
    (∑' i, ite (n ≤ i) ((2 : ℝ)⁻¹ ^ i) 0) = 2 * 2⁻¹ ^ n

(∑' (i : ℕ), if n ≤ i then 2⁻¹ ^ i else 0) = 2 * 2⁻¹ ^ n


/-- The product of two monotone functions is monotone. -/
@[to_additive add "The sum of two monotone functions is monotone."]
theorem Monotone.mul' [CovariantClass α α (· * ·) (· ≤ ·)]
    [CovariantClass α α (swap (· * ·)) (· ≤ ·)] (hf : Monotone f) (hg : Monotone g) :
    Monotone fun x => f x * g x

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

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


/-- The **multidimensional Hales-Jewett theorem**, aka **extended Hales-Jewett theorem**: For any
finite types `η`, `α` and `κ`, there exists a finite type `ι` such that whenever the hypercube
`ι → α` is `κ`-colored, there is a monochromatic combinatorial subspace of dimension `η`. -/
theorem exists_mono_in_high_dimension (α κ η) [Finite α] [Finite κ] [Finite η] :
    ∃ (ι : Type) (_ : Fintype ι), ∀ C : (ι → α) → κ, ∃ l : Subspace η α ι, l.IsMono C

(α : Type u_5)
(κ : Type u_6)
(η : Type u_7)
[Finite α]
[Finite κ]
[Finite η]

∃ ι x, ∀ (C : (ι → α) → κ), ∃ l, Combinatorics.Subspace.IsMono C l


@[simp]
theorem formPerm_mem_iff_mem : l.formPerm x ∈ l ↔ x ∈ l

{α : Type u_1}
[DecidableEq α]
{l : List α}
{x : α}


theorem continuous_decomposeProdAdjoint_symm [TopologicalAddGroup A] :
    Continuous (StarModule.decomposeProdAdjoint R A).symm

(R : Type u_1)
(A : Type u_2)
[Semiring R]
[StarMul R]
[TrivialStar R]
[AddCommGroup A]
[Module R A]
[StarAddMonoid A]
[StarModule R A]
[Invertible 2]
[TopologicalSpace A]
[TopologicalAddGroup A]

Continuous ⇑(StarModule.decomposeProdAdjoint R A).symm


theorem subset_support_tsub [DecidableEq ι] {f1 f2 : ι →₀ α} :
    f1.support \ f2.support ⊆ (f1 - f2).support

{ι : Type u_1}
{α : Type u_2}
[CanonicallyOrderedAddCommMonoid α]
[Sub α]
[OrderedSub α]
[DecidableEq ι]
{f1 f2 : ι →₀ α}


@[simp]
theorem insertNth_succ_cons (s : List α) (hd x : α) (n : ℕ) :
    insertNth (n + 1) x (hd :: s) = hd :: insertNth n x s

{α : Type u}
(s : List α)
(hd x : α)
(n : ℕ)

List.insertNth (n + 1) x (hd :: s) = hd :: List.insertNth n x s


@[simp]
theorem dist_ne {i j : ι} (h : i ≠ j) (x : E i) (y : E j) :
    dist (⟨i, x⟩ : Σk, E k) ⟨j, y⟩ = dist x (Nonempty.some ⟨x⟩) + 1 + dist (Nonempty.some ⟨y⟩) y

{ι : Type u_1}
{E : ι → Type u_2}
[(i : ι) → MetricSpace (E i)]
{i j : ι}
(h : i ≠ j)
(x : E i)
(y : E j)

dist ⟨i, x⟩ ⟨j, y⟩ = dist x ⋯.some + 1 + dist ⋯.some y


theorem sign_eq_one_of_pos {a : Int} (h : 0 < a) : sign a = 1


theorem pred_lt_pred : ∀ {n m}, n ≠ 0 → n < m → pred n < pred m


@[to_additive (attr := simp) card_nsmul_eq_zero']
theorem pow_card_eq_one' {G : Type*} [Group G] {x : G} : x ^ Nat.card G = 1


/-- Two `MonoidHom`s from a quotient group are equal if their compositions with
`QuotientGroup.mk'` are equal.

See note [partially-applied ext lemmas]. -/
@[to_additive (attr := ext 1100) "Two `AddMonoidHom`s from an additive quotient group are equal if
 their compositions with `AddQuotientGroup.mk'` are equal.

 See note [partially-applied ext lemmas]. "]
theorem monoidHom_ext ⦃f g : G ⧸ N →* M⦄ (h : f.comp (mk' N) = g.comp (mk' N)) : f = g

(h : f.comp (QuotientGroup.mk' N) = g.comp (QuotientGroup.mk' N))


theorem dvd_content_iff_C_dvd {p : R[X]} {r : R} : r ∣ p.content ↔ C r ∣ p

{R : Type u_1}
[CommRing R]
[IsDomain R]
[NormalizedGCDMonoid R]
{p : Polynomial R}
{r : R}


lemma quasiIso_descShortComplex : QuasiIso (descShortComplex S)

{S : CategoryTheory.ShortComplex (CochainComplex C ℤ)}


theorem terminatedAt_iff_partNum_none : g.TerminatedAt n ↔ g.partNums.get? n = none

{α : Type u_1}
{g : GenContFract α}
{n : ℕ}


/-- Cardinality of an `Iio` of finsets. -/
theorem card_Iio_finset : (Iio s).card = 2 ^ s.card - 1

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


theorem comap_map (f : L →ₐ[K] L') (S : IntermediateField K L) : (S.map f).comap f = S

{K : Type u_1}
{L : Type u_2}
{L' : Type u_3}
[Field K]
[Field L]
[Field L']
[Algebra K L]
[Algebra K L']
(f : L →ₐ[K] L')
(S : IntermediateField K L)

IntermediateField.comap f (IntermediateField.map f S) = S


@[simp]
theorem map_div (v : AddValuation K Γ₀) {x y : K} : v (x / y) = v x - v y

{K : Type u_1}
[DivisionRing K]
{Γ₀ : Type u_4}
[LinearOrderedAddCommGroupWithTop Γ₀]
(v : AddValuation K Γ₀)
{x y : K}


/-- The element `0` is left-regular if and only if `R` is trivial. -/
theorem IsLeftRegular.subsingleton (h : IsLeftRegular (0 : R)) : Subsingleton R

{R : Type u_1}
[MulZeroClass R]
(h : IsLeftRegular 0)


theorem continuous_pow (hf : Continuous f) (n : ℕ) : Continuous (f ^ n : CircleDeg1Lift)

(f : CircleDeg1Lift)
(hf : Continuous ⇑f)
(n : ℕ)


@[simp] theorem prev_zero (s : Substring) : s.prev 0 = 0


@[to_additive]
protected theorem map_eq_one_iff (h : M ≃* N) {x : M} : h x = 1 ↔ x = 1

{M : Type u_6}
{N : Type u_7}
[AddZeroClass M]
[AddZeroClass N]
(h : M ≃+ N)
{x : M}


theorem mirror_natDegree : p.mirror.natDegree = p.natDegree

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


lemma pow_pos_iff (hn : n ≠ 0) : 0 < a ^ n ↔ 0 < a

{α : Type u_1}
[LinearOrderedCommMonoidWithZero α]
{a : α}
{n : ℕ}
[NoZeroDivisors α]
(hn : n ≠ 0)


@[simp, norm_cast]
theorem coe_sSup (S : Set (UpperSet α)) : (↑(sSup S) : Set α) = ⋂ s ∈ S, ↑s

{α : Type u_1}
[LE α]
(S : Set (UpperSet α))


theorem eq_top_or_lt_top (a : α) : a = ⊤ ∨ a < ⊤

{α : Type u}
[PartialOrder α]
[OrderTop α]
(a : α)


/-- A lattice is coatomistic iff every element is an `sInf` of a set of coatoms. -/
class IsCoatomistic : Prop where
  /-- Every element is a `sInf` of a set of coatoms. -/
  eq_sInf_coatoms : ∀ b : α, ∃ s : Set α, b = sInf s ∧ ∀ a, a ∈ s → IsCoatom a

{α : Type u_2}
[CompleteLattice α]
[self : IsCoatomistic α]
(b : α)


@[simp]
lemma rightHomologyMap'_add :
    rightHomologyMap' (φ + φ') h₁ h₂ = rightHomologyMap' φ h₁ h₂ +
      rightHomologyMap' φ' h₁ h₂

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Preadditive C]
{S₁ S₂ : CategoryTheory.ShortComplex C}
{φ φ' : S₁ ⟶ S₂}
(h₁ : S₁.RightHomologyData)
(h₂ : S₂.RightHomologyData)

CategoryTheory.ShortComplex.rightHomologyMap' (φ + φ') h₁ h₂ =
  CategoryTheory.ShortComplex.rightHomologyMap' φ h₁ h₂ + CategoryTheory.ShortComplex.rightHomologyMap' φ' h₁ h₂


theorem ContinuousSMul.induced {R : Type*} {α : Type*} {β : Type*} {F : Type*} [FunLike F α β]
    [Semiring R] [AddCommMonoid α] [AddCommMonoid β] [Module R α] [Module R β]
    [TopologicalSpace R] [LinearMapClass F R α β] [tβ : TopologicalSpace β] [ContinuousSMul R β]
    (f : F) : @ContinuousSMul R α _ _ (tβ.induced f)

{R : Type u_5}
{α : Type u_6}
{β : Type u_7}
{F : Type u_8}
[FunLike F α β]
[Semiring R]
[AddCommMonoid α]
[AddCommMonoid β]
[Module R α]
[Module R β]
[TopologicalSpace R]
[LinearMapClass F R α β]
[tβ : TopologicalSpace β]
[ContinuousSMul R β]
(f : F)


theorem iterate_pos_le_iff_map_le' (h : Commute f g) (hf : StrictMono f) (hg : Monotone g) {x n}
    (hn : 0 < n) : f^[n] x ≤ g^[n] x ↔ f x ≤ g x

{α : Type u_1}
[LinearOrder α]
{f g : α → α}
(h : Function.Commute f g)
(hf : StrictMono f)
(hg : Monotone g)
{x : α}
{n : ℕ}
(hn : 0 < n)


@[simp]
theorem unitSphereToUnits_apply_coe [NormedDivisionRing 𝕜] (x : sphere (0 : 𝕜) 1) :
    (unitSphereToUnits 𝕜 x : 𝕜) = x

{𝕜 : Type u_1}
[NormedDivisionRing 𝕜]
(x : ↑(Metric.sphere 0 1))


theorem map_strictMono_of_injective : StrictMono (map f)

{L : FirstOrder.Language}
{M : Type w}
{N : Type u_1}
[L.Structure M]
[L.Structure N]
{f : L.Hom M N}
(hf : Function.Injective ⇑f)


theorem hasStrictDerivAt_cos (x : ℝ) : HasStrictDerivAt cos (-sin x) x

HasStrictDerivAt Real.cos (-Real.sin x) x


theorem zpowers_eq {k : ℕ+} {ζ : Rˣ} (h : IsPrimitiveRoot ζ k) :
    Subgroup.zpowers ζ = rootsOfUnity k R

{R : Type u_4}
[CommRing R]
[IsDomain R]
{k : ℕ+}
{ζ : Rˣ}
(h : IsPrimitiveRoot ζ ↑k)


/-- When `p` is prime, then the totient of `p ^ (n + 1)` is `p ^ n * (p - 1)` -/
theorem totient_prime_pow_succ {p : ℕ} (hp : p.Prime) (n : ℕ) : φ (p ^ (n + 1)) = p ^ n * (p - 1)


@[to_additive]
theorem measurePreserving_inv (μ : Measure G) [IsInvInvariant μ] : MeasurePreserving Inv.inv μ μ

{G : Type u_2}
[MeasurableSpace G]
[Neg G]
[MeasurableNeg G]
(μ : MeasureTheory.Measure G)
[μ.IsNegInvariant]

MeasureTheory.MeasurePreserving Neg.neg μ μ


@[simp]
theorem tprodL_coe : (tprodL 𝕜).toMultilinearMap = tprod 𝕜 (s := E)

[(i : ι) → SeminormedAddCommGroup (E i)]

(PiTensorProduct.tprodL 𝕜).toMultilinearMap = PiTensorProduct.tprod 𝕜


@[to_additive (attr := simp)]
theorem div_lt_div_iff_left (a : α) : a / b < a / c ↔ c < 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]


@[to_additive (attr := simp)]
theorem prod_eq_prod_fintype [Fintype ι] [∀ i, Zero (β i)] [∀ (i : ι) (x : β i), Decidable (x ≠ 0)]
    -- Porting note: `f` was a typeclass argument
    [CommMonoid γ] (v : Π₀ i, β i) {f : ∀ i, β i → γ} (hf : ∀ i, f i 0 = 1) :
    v.prod f = ∏ i, f i (DFinsupp.equivFunOnFintype v i)

[(i : ι) → (x : β i) → Decidable (x ≠ 0)]

v.prod f = ∏ i : ι, f i (DFinsupp.equivFunOnFintype v i)


protected theorem div_eq_of_lt_le (lo : k * n ≤ m) (hi : m < (k + 1) * n) : m / n = k

{k n m : Nat}
(lo : k * n ≤ m)
(hi : m < (k + 1) * n)


@[to_additive]
theorem map_equiv_eq_comap_symm (f : M ≃* N) (K : Submonoid M) :
    K.map f.toMonoidHom = K.comap f.symm.toMonoidHom

{M : Type u_1}
{N : Type u_2}
[MulOneClass M]
[MulOneClass N]
(f : M ≃* N)
(K : Submonoid M)

Submonoid.map f.toMonoidHom K = Submonoid.comap f.symm.toMonoidHom K


/-- A `DivisionRing` is a `Ring` with multiplicative inverses for nonzero elements.

An instance of `DivisionRing K` includes maps `ratCast : ℚ → K` and `qsmul : ℚ → K → K`.
Those two fields are needed to implement the `DivisionRing K → Algebra ℚ K` instance since we need
to control the specific definitions for some special cases of `K` (in particular `K = ℚ` itself).
See also note [forgetful inheritance]. Similarly, there are maps `nnratCast ℚ≥0 → K` and
`nnqsmul : ℚ≥0 → K → K` to implement the `DivisionSemiring K → Algebra ℚ≥0 K` instance.

If the division ring has positive characteristic `p`, our division by zero convention forces
`ratCast (1 / p) = 1 / 0 = 0`. -/
class DivisionRing (α : Type*)
  extends Ring α, DivInvMonoid α, Nontrivial α, NNRatCast α, RatCast α where
  /-- For a nonzero `a`, `a⁻¹` is a right multiplicative inverse. -/
  protected mul_inv_cancel : ∀ (a : α), a ≠ 0 → a * a⁻¹ = 1
  /-- The inverse of `0` is `0` by convention. -/
  protected inv_zero : (0 : α)⁻¹ = 0
  protected nnratCast := NNRat.castRec
  /-- However `NNRat.cast` is defined, it must be equal to `a / b`.

  Do not use this lemma directly. Use `NNRat.cast_def` instead. -/
  protected nnratCast_def (q : ℚ≥0) : (NNRat.cast q : α) = q.num / q.den := by intros; rfl
  /-- Scalar multiplication by a nonnegative rational number.

  Unless there is a risk of a `Module ℚ≥0 _` instance diamond, write `nnqsmul := _`. This will set
  `nnqsmul` to `(NNRat.cast · * ·)` thanks to unification in the default proof of `nnqsmul_def`.

  Do not use directly. Instead use the `•` notation. -/
  protected nnqsmul : ℚ≥0 → α → α
  /-- However `qsmul` is defined, it must be propositionally equal to multiplication by `Rat.cast`.

  Do not use this lemma directly. Use `NNRat.smul_def` instead. -/
  protected nnqsmul_def (q : ℚ≥0) (a : α) : nnqsmul q a = NNRat.cast q * a := by intros; rfl
  protected ratCast := Rat.castRec
  /-- However `Rat.cast q` is defined, it must be propositionally equal to `q.num / q.den`.

  Do not use this lemma directly. Use `Rat.cast_def` instead. -/
  protected ratCast_def (q : ℚ) : (Rat.cast q : α) = q.num / q.den := by intros; rfl
  /-- Scalar multiplication by a rational number.

  Unless there is a risk of a `Module ℚ _` instance diamond, write `qsmul := _`. This will set
  `qsmul` to `(Rat.cast · * ·)` thanks to unification in the default proof of `qsmul_def`.

  Do not use directly. Instead use the `•` notation. -/
  protected qsmul : ℚ → α → α
  /-- However `qsmul` is defined, it must be propositionally equal to multiplication by `Rat.cast`.

  Do not use this lemma directly. Use `Rat.cast_def` instead. -/
  protected qsmul_def (a : ℚ) (x : α) : qsmul a x = Rat.cast a * x := by intros; rfl

{α : Type u_4}
[self : DivisionRing α]
(q : ℚ≥0)


@[simps!]
instance category : Category (Square C)

{C : Type u}
[CategoryTheory.Category.{v, u} C]
(sq : CategoryTheory.Square C)

(CategoryTheory.CategoryStruct.id sq).τ₁ = CategoryTheory.CategoryStruct.id sq.X₁


/-- The cartesian product of `C^n` functions is `C^n`. -/
theorem ContDiff.prod {f : E → F} {g : E → G} (hf : ContDiff 𝕜 n f) (hg : ContDiff 𝕜 n g) :
    ContDiff 𝕜 n fun x : E => (f x, g x)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type uG}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{n : ℕ∞}
{f : E → F}
{g : E → G}
(hf : ContDiff 𝕜 n f)
(hg : ContDiff 𝕜 n g)


theorem intermediate_value_Ioo {a b : α} (hab : a ≤ b) {f : α → δ} (hf : ContinuousOn f (Icc a b)) :
    Ioo (f a) (f b) ⊆ f '' Ioo a b

{α : Type u}
[ConditionallyCompleteLinearOrder α]
[TopologicalSpace α]
[OrderTopology α]
[DenselyOrdered α]
{δ : Type u_1}
[LinearOrder δ]
[TopologicalSpace δ]
[OrderClosedTopology δ]
{a b : α}
(hab : a ≤ b)
{f : α → δ}
(hf : ContinuousOn f (Set.Icc a b))


@[simp, reassoc]
lemma germ_stalkIso_inv {X : Scheme.{u}} (U : X.Opens) (V : U.toScheme.Opens) (x : U)
    (hx : x ∈ V) : X.presheaf.germ ⟨x.val, show x.val ∈ U.ι ''ᵁ V from ⟨x, hx, rfl⟩⟩ ≫
      (U.stalkIso x).inv = U.toScheme.presheaf.germ ⟨x, hx⟩

{X : AlgebraicGeometry.Scheme}
(U : X.Opens)
(V : (↑U).Opens)
(x : ↥U)
(hx : x ∈ V)

X.presheaf.germ ⟨↑x, ⋯⟩ ≫ (U.stalkIso x).inv = (↑U).presheaf.germ ⟨x, hx⟩


/-- When `F` is cofinal, and `F ⋙ G` has a colimit, then `G` has a colimit also.

We can't make this an instance, because `F` is not determined by the goal.
(Even if this weren't a problem, it would cause a loop with `comp_hasColimit`.)
-/
theorem hasColimit_of_comp [HasColimit (F ⋙ G)] : HasColimit G


lemma eq_one_iff_conductor_eq_one (hn : n ≠ 0) : χ = 1 ↔ conductor χ = 1

{R : Type u_1}
[CommMonoidWithZero R]
{n : ℕ}
{χ : DirichletCharacter R n}
(hn : n ≠ 0)


theorem _root_.Set.smul_mem_center (r : R) {a : A} (ha : a ∈ Set.center A) :
    r • a ∈ Set.center A

{R : Type u_1}
{A : Type u_2}
[CommSemiring R]
[NonUnitalNonAssocSemiring A]
[Module R A]
[IsScalarTower R A A]
[SMulCommClass R A A]
(r : R)
{a : A}
(ha : a ∈ Set.center A)


@[to_additive]
nonrec lemma orbitRel.Quotient.mapsTo_smul_orbit (g : G) (x : orbitRel.Quotient G α) :
    Set.MapsTo (g • ·) x.orbit x.orbit

{G : Type u_1}
{α : Type u_2}
[AddGroup G]
[AddAction G α]
(g : G)
(x : AddAction.orbitRel.Quotient G α)

Set.MapsTo (fun x => g +ᵥ x) x.orbit x.orbit


/-- Compressing a family is idempotent. -/
@[simp]
theorem compression_idem (u v : α) (s : Finset α) : 𝓒 u v (𝓒 u v s) = 𝓒 u v s

{α : Type u_1}
[GeneralizedBooleanAlgebra α]
[DecidableRel Disjoint]
[DecidableRel fun x x_1 => x ≤ x_1]
[DecidableEq α]
(u v : α)
(s : Finset α)

UV.compression u v (UV.compression u v s) = UV.compression u v s


@[simp]
theorem snd_inf [Inf α] [Inf β] (p q : α × β) : (p ⊓ q).snd = p.snd ⊓ q.snd

(α : Type u)
(β : Type v)
[Inf α]
[Inf β]
(p q : α × β)


/-- The counit isomorphism of `equivalence`. -/
@[simps!]
def equivalenceCounitIso : G ⋙ F ⋙ eB.inverse ≅ 𝟭 B

{A : Type u_1}
{B : Type u_3}
{B' : Type u_4}
[CategoryTheory.Category.{u_5, u_1} A]
[CategoryTheory.Category.{u_6, u_3} B]
[CategoryTheory.Category.{u_7, u_4} B']
{eB : B ≌ B'}
{F : A ⥤ B'}
{G : B ⥤ A}
(η : G ⋙ F ≅ eB.functor)
(X : B)

(AlgebraicTopology.DoldKan.Compatibility.equivalenceCounitIso η).hom.app X =
  eB.inverse.map (η.hom.app X) ≫ eB.unitIso.inv.app X


theorem digits_one (b n) (n0 : 0 < n) (nb : n < b) : Nat.digits b n = [n] ∧ 1 < b ∧ 0 < n


theorem field_closure_preimage_le (f : K →+* L) (s : Set L) :
    closure (f ⁻¹' s) ≤ (closure s).comap f

{K : Type u}
{L : Type v}
[DivisionRing K]
[DivisionRing L]
(f : K →+* L)
(s : Set L)

Subfield.closure (⇑f ⁻¹' s) ≤ Subfield.comap f (Subfield.closure s)


theorem tsum_sub {f : ℕ → ℝ≥0∞} {g : ℕ → ℝ≥0∞} (h₁ : ∑' i, g i ≠ ∞) (h₂ : g ≤ f) :
    ∑' i, (f i - g i) = ∑' i, f i - ∑' i, g i

{f g : ℕ → ℝ≥0∞}
(h₁ : ∑' (i : ℕ), g i ≠ ⊤)
(h₂ : g ≤ f)


@[simp]
theorem bihimp_fst [GeneralizedHeytingAlgebra α] [GeneralizedHeytingAlgebra β] (a b : α × β) :
    (a ⇔ b).1 = a.1 ⇔ b.1

{α : Type u_2}
{β : Type u_3}
[GeneralizedHeytingAlgebra α]
[GeneralizedHeytingAlgebra β]
(a b : α × β)


@[simp]
theorem toDual_le_toDual [LE α] {a b : α} : toDual a ≤ toDual b ↔ b ≤ a

OrderDual.toDual a ≤ OrderDual.toDual b ↔ b ≤ a


theorem zero_nmem_multiset_map_X_add_C {α : Type*} (m : Multiset α) (f : α → R) :
    (0 : R[X]) ∉ m.map fun a => X + C (f a)

{R : Type u}
[Nontrivial R]
[Semiring R]
{α : Type u_1}
(m : Multiset α)
(f : α → R)

0 ∉ Multiset.map (fun a => Polynomial.X + Polynomial.C (f a)) m


lemma IsMatching.induce_connectedComponent (h : M.IsMatching) (c : ConnectedComponent G) :
    (M.induce (M.verts ∩ c.supp)).IsMatching

{V : Type u_1}
{G : SimpleGraph V}
{M : G.Subgraph}
(h : M.IsMatching)
(c : G.ConnectedComponent)


private theorem smul_ne_zero_of_pos_of_ne_zero [Preorder α] (ha : 0 < a) (hb : b ≠ 0) : a • b ≠ 0

{α : Type u_1}
{β : Type u_2}
[Zero α]
[Zero β]
[SMul α β]
[NoZeroSMulDivisors α β]
{a : α}
{b : β}
[Preorder α]
(ha : 0 < a)
(hb : b ≠ 0)


@[simp]
theorem bit_true : bit true = (2 * · + 1)


@[to_additive (attr := simp)]
theorem mem_unop {x : G} {S : Subgroup Gᵐᵒᵖ} : x ∈ S.unop ↔ MulOpposite.op x ∈ S

{G : Type u_2}
[Group G]
{x : G}
{S : Subgroup Gᵐᵒᵖ}


protected theorem lt_of_lt_of_le {n m k : Nat} : n < m → m ≤ k → n < k


theorem AccPt.map {β : Type*} [TopologicalSpace β] {F : Filter X} {x : X}
    (h : AccPt x F) {f : X → β} (hf1 : ContinuousAt f x) (hf2 : Function.Injective f) :
    AccPt (f x) (map f F)

{X : Type u_1}
[TopologicalSpace X]
{β : Type u_2}
[TopologicalSpace β]
{F : Filter X}
{x : X}
(h : AccPt x F)
{f : X → β}
(hf1 : ContinuousAt f x)
(hf2 : Function.Injective f)


@[simp]
theorem mem_dom (f : α →. β) (x : α) : x ∈ Dom f ↔ ∃ y, y ∈ f x

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


theorem lineMap_apply_module' (p₀ p₁ : V1) (c : k) : lineMap p₀ p₁ c = c • (p₁ - p₀) + p₀

{k : Type u_1}
{V1 : Type u_2}
[Ring k]
[AddCommGroup V1]
[Module k V1]
(p₀ p₁ : V1)
(c : k)

(AffineMap.lineMap p₀ p₁) c = c • (p₁ - p₀) + p₀


protected theorem map_zero (f : A →ₑ+[φ] B) : f 0 = 0

{M : Type u_1}
[Monoid M]
{N : Type u_2}
[Monoid N]
{φ : M →* N}
{A : Type u_4}
[AddMonoid A]
[DistribMulAction M A]
{B : Type u_5}
[AddMonoid B]
[DistribMulAction N B]
(f : A →ₑ+[φ] B)


/-- Type **stars and bars** for the case `n = 2`. -/
protected theorem card [Fintype α] : card (Sym2 α) = Nat.choose (card α + 1) 2

Fintype.card (Sym2 α) = (Fintype.card α + 1).choose 2


/-- If the codomain of a homeomorphism is a locally connected space, then the domain is also
a locally connected space. -/
theorem locallyConnectedSpace [i : LocallyConnectedSpace Y] (h : X ≃ₜ Y) :
    LocallyConnectedSpace X

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


@[simp] theorem add_re : (a + b).re = a.re + b.re

{R : Type u_3}
[CommRing R]
(a b : ℍ[R])


theorem image_eq_preimage (e : α ≃ᵐ β) (s : Set α) : e '' s = e.symm ⁻¹' s

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
[MeasurableSpace β]
(e : α ≃ᵐ β)
(s : Set α)


theorem bijective_iff_injective_and_card (f : α → β) :
    Bijective f ↔ Injective f ∧ card α = card β

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

Function.Bijective f ↔ Function.Injective f ∧ Fintype.card α = Fintype.card β


theorem insertNth_binop (op : ∀ j, α j → α j → α j) (i : Fin (n + 1)) (x y : α i)
    (p q : ∀ j, α (i.succAbove j)) :
    (i.insertNth (op i x y) fun j ↦ op _ (p j) (q j)) = fun j ↦
      op j (i.insertNth x p j) (i.insertNth y q j)

(op : (j : Fin (n + 1)) → α j → α j → α j)

(i.insertNth (op i x y) fun j => op (i.succAbove j) (p j) (q j)) = fun j => op j (i.insertNth x p j) (i.insertNth y q j)


lemma Exact.isZero_X₂_iff (hS : S.Exact) : IsZero S.X₂ ↔ S.f = 0 ∧ S.g = 0

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

CategoryTheory.Limits.IsZero S.X₂ ↔ S.f = 0 ∧ S.g = 0


@[simp]
theorem ofIsEmpty_top (r : α → α → Prop) [IsEmpty α] {b : β} (H : ∀ b', ¬s b' b) :
    (ofIsEmpty r H).top = b

{α : Type u_1}
{β : Type u_2}
{s : β → β → Prop}
(r : α → α → Prop)
[IsEmpty α]
{b : β}
(H : ∀ (b' : β), ¬s b' b)


/-- **Fundamental theorem of calculus-1**: if `f : ℝ → E` is integrable on `a..b` and `f` is
continuous at `b`, then `u ↦ ∫ x in a..u, f x` has derivative `f b` at `b`. -/
theorem integral_hasDerivAt_right (hf : IntervalIntegrable f volume a b)
    (hmeas : StronglyMeasurableAtFilter f (𝓝 b)) (hb : ContinuousAt f b) :
    HasDerivAt (fun u => ∫ x in a..u, f x) (f b) b

(hf : IntervalIntegrable f MeasureTheory.volume a b)

(hmeas : StronglyMeasurableAtFilter f (𝓝 b) MeasureTheory.volume)

HasDerivAt (fun u => ∫ (x : ℝ) in a..u, f x) (f b) b


/-- Continuous linear equivalences between modules. We only put the type classes that are necessary
for the definition, although in applications `M` and `M₂` will be topological modules over the
topological semiring `R`. -/
-- Porting note (#5171): linter not ported yet; was @[nolint has_nonempty_instance]
structure ContinuousLinearEquiv {R : Type*} {S : Type*} [Semiring R] [Semiring S] (σ : R →+* S)
    {σ' : S →+* R} [RingHomInvPair σ σ'] [RingHomInvPair σ' σ] (M : Type*) [TopologicalSpace M]
    [AddCommMonoid M] (M₂ : Type*) [TopologicalSpace M₂] [AddCommMonoid M₂] [Module R M]
    [Module S M₂] extends M ≃ₛₗ[σ] M₂ where
  continuous_toFun : Continuous toFun := by continuity
  continuous_invFun : Continuous invFun := by continuity

{R : Type u_1}
{S : Type u_2}
[Semiring R]
[Semiring S]
{σ : R →+* S}
{σ' : S →+* R}
[RingHomInvPair σ σ']
[RingHomInvPair σ' σ]
{M : Type u_3}
[TopologicalSpace M]
[AddCommMonoid M]
{M₂ : Type u_4}
[TopologicalSpace M₂]
[AddCommMonoid M₂]
[Module R M]
[Module S M₂]
(self : M ≃SL[σ] M₂)


/-- The obvious homotopy between two equal morphisms of short complexes. -/
@[simps]
def ofEq (h : φ₁ = φ₂) : Homotopy φ₁ φ₂

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Preadditive C]
{S₁ S₂ : CategoryTheory.ShortComplex C}
{φ₁ φ₂ : S₁ ⟶ S₂}
(h : φ₁ = φ₂)

(CategoryTheory.ShortComplex.Homotopy.ofEq h).h₃ = 0


@[to_additive]
theorem prod_compl_mul_prod [Fintype α] [DecidableEq α] (s : Finset α) (f : α → β) :
    (∏ i ∈ sᶜ, f i) * ∏ i ∈ s, f i = ∏ i, f i

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

(∏ i ∈ sᶜ, f i) * ∏ i ∈ s, f i = ∏ i : α, f i


lemma zpow_neg_two_nonneg (a : α) : 0 ≤ a ^ (-2 : ℤ)

{α : Type u_1}
[LinearOrderedField α]
(a : α)


@[simp]
lemma OpenCover.comp_app {X : Scheme.{u}} {𝓤 𝓥 𝓦 : X.OpenCover}
    (f : 𝓤 ⟶ 𝓥) (g : 𝓥 ⟶ 𝓦) (j : 𝓤.J) :
    (f ≫ g).app j = f.app j ≫ g.app _

{X : AlgebraicGeometry.Scheme}
{𝓤 𝓥 𝓦 : X.OpenCover}
(f : 𝓤 ⟶ 𝓥)
(g : 𝓥 ⟶ 𝓦)
(j : 𝓤.J)

(f ≫ g).app j = f.app j ≫ g.app (f.idx j)


@[norm_cast]
theorem coe_intCast (z : ℤ) : ↑(z : R) = (z : ℍ[R,c₁,c₂])

{R : Type u_3}
[CommRing R]
{c₁ c₂ : R}
(z : ℤ)


@[simp]
theorem toBoolAlg_add (a b : α) : toBoolAlg (a + b) = toBoolAlg a ∆ toBoolAlg b

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


theorem mod_eq_zero_of_dvd {m n : Nat} (H : m ∣ n) : n % m = 0


lemma bypass_eq_self_of_length_le {u v : V} (p : G.Walk u v) (h : p.length ≤ p.bypass.length) :
    p.bypass = p

{V : Type u}
{G : SimpleGraph V}
[DecidableEq V]
{u v : V}
(p : G.Walk u v)
(h : p.length ≤ p.bypass.length)


@[simp]
theorem take_eq_nil_iff {l : List α} {k : Nat} : l.take k = [] ↔ l = [] ∨ k = 0


lemma absolutelyContinuous_sum_right {μs : ι → Measure α} (i : ι) (hνμ : ν ≪ μs i) :
    ν ≪ Measure.sum μs

{α : Type u_1}
{ι : Type u_5}
{m0 : MeasurableSpace α}
{ν : MeasureTheory.Measure α}
{μs : ι → MeasureTheory.Measure α}
(i : ι)
(hνμ : ν.AbsolutelyContinuous (μs i))


/-- Note that this applies to `ℂ` via `Complex.strictOrderedCommRing`. -/
@[simp]
theorem dotProduct_self_star_eq_zero {v : n → R} : dotProduct v (star v) = 0 ↔ v = 0

{n : Type u_2}
{R : Type u_4}
[Fintype n]
[PartialOrder R]
[NonUnitalRing R]
[StarRing R]
[StarOrderedRing R]
[NoZeroDivisors R]
{v : n → R}

Matrix.dotProduct v (star v) = 0 ↔ v = 0


theorem subset_iInter {t : Set β} {s : ι → Set β} (h : ∀ i, t ⊆ s i) : t ⊆ ⋂ i, s i

{β : Type u_2}
{ι : Sort u_4}
{t : Set β}
{s : ι → Set β}
(h : ∀ (i : ι), t ⊆ s i)


theorem pow_le_one_iff_of_nonneg (ha : 0 ≤ a) (hn : n ≠ 0) : a ^ n ≤ 1 ↔ a ≤ 1

{R : Type u_3}
[LinearOrderedSemiring R]
{a : R}
{n : ℕ}
(ha : 0 ≤ a)
(hn : n ≠ 0)


@[to_additive]
theorem mem_subgroupOf {H K : Subgroup G} {h : K} : h ∈ H.subgroupOf K ↔ (h : G) ∈ H

{G : Type u_1}
[Group G]
{H K : Subgroup G}
{h : ↥K}


theorem two_mul_arctan {x : ℝ} (h₁ : -1 < x) (h₂ : x < 1) :
    2 * arctan x = arctan (2 * x / (1 - x ^ 2))

2 * Real.arctan x = Real.arctan (2 * x / (1 - x ^ 2))


theorem constantsOn_constants : (constantsOn α).Constants = α

(FirstOrder.Language.constantsOn α).Constants = α


/-- A function on `[0, 1]` with the norm of the derivative within `[0, 1]`
bounded by `C` satisfies `‖f 1 - f 0‖ ≤ C`, `HasDerivWithinAt`
version. -/
theorem norm_image_sub_le_of_norm_deriv_le_segment_01' {f' : ℝ → E} {C : ℝ}
    (hf : ∀ x ∈ Icc (0 : ℝ) 1, HasDerivWithinAt f (f' x) (Icc (0 : ℝ) 1) x)
    (bound : ∀ x ∈ Ico (0 : ℝ) 1, ‖f' x‖ ≤ C) : ‖f 1 - f 0‖ ≤ C

(hf : ∀ x ∈ Set.Icc 0 1, HasDerivWithinAt f (f' x) (Set.Icc 0 1) x)


theorem ker_dualMap_eq_dualCoannihilator_range (f : M →ₗ[R] M') :
    LinearMap.ker f.dualMap = (Dual.eval R M' ∘ₗ f).range.dualCoannihilator

{R : Type u_1}
{M : Type u_2}
{M' : Type u_3}
[CommRing R]
[AddCommGroup M]
[Module R M]
[AddCommGroup M']
[Module R M']
(f : M →ₗ[R] M')

LinearMap.ker f.dualMap = (LinearMap.range (Module.Dual.eval R M' ∘ₗ f)).dualCoannihilator


theorem sSup_disjoint_iff {s : Set α} : Disjoint (sSup s) a ↔ ∀ b ∈ s, Disjoint b a

{α : Type u}
[Order.Frame α]
{a : α}
{s : Set α}


theorem mapRange.addEquiv_trans (f : M ≃+ N) (f₂ : N ≃+ P) :
    (mapRange.addEquiv (f.trans f₂) : (α →₀ M) ≃+ (α →₀ P)) =
      (mapRange.addEquiv f).trans (mapRange.addEquiv f₂)

{α : Type u_1}
{M : Type u_5}
{N : Type u_7}
{P : Type u_8}
[AddCommMonoid M]
[AddCommMonoid N]
[AddCommMonoid P]
(f : M ≃+ N)
(f₂ : N ≃+ P)

Finsupp.mapRange.addEquiv (f.trans f₂) = (Finsupp.mapRange.addEquiv f).trans (Finsupp.mapRange.addEquiv f₂)


theorem sub_apply (m : ι → M) : (f - g) m = f m - g m

{R : Type u_1}
{M : Type u_2}
{N : Type u_4}
{ι : Type u_6}
[Ring R]
[AddCommGroup M]
[Module R M]
[TopologicalSpace M]
[AddCommGroup N]
[Module R N]
[TopologicalSpace N]
(f g : M [⋀^ι]→L[R] N)
[TopologicalAddGroup N]
(m : ι → M)


lemma eq_one_or_neg_one_of_mul_eq_neg_one' (h : u * v = -1) : u = 1 ∧ v = -1 ∨ u = -1 ∧ v = 1


/-- The `k`-th shadow of a family of `r`-sets is a family of `r - k`-sets. -/
lemma _root_.Set.Sized.shadow_iterate (h𝒜 : (𝒜 : Set (Finset α)).Sized r) :
    (∂^[k] 𝒜 : Set (Finset α)).Sized (r - k)

{α : Type u_1}
[DecidableEq α]
{𝒜 : Finset (Finset α)}
{k r : ℕ}
(h𝒜 : Set.Sized r ↑𝒜)

Set.Sized (r - k) ↑(Finset.shadow^[k] 𝒜)


theorem lt_replicate_succ {m : Multiset α} {x : α} {n : ℕ} :
    m < replicate (n + 1) x ↔ m ≤ replicate n x

{α : Type u_1}
{m : Multiset α}
{x : α}
{n : ℕ}

m < Multiset.replicate (n + 1) x ↔ m ≤ Multiset.replicate n x


theorem fderivWithin_sin (hf : DifferentiableWithinAt ℝ f s x) (hxs : UniqueDiffWithinAt ℝ s x) :
    fderivWithin ℝ (fun x => Real.sin (f x)) s x = Real.cos (f x) • fderivWithin ℝ f s x

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


protected theorem add_assoc : a + b + c = a + (b + c)


@[simp]
theorem range_cast_int : range ((↑) : ℕ → ℤ) = Ici 0


theorem IsUnit.ring_inverse {a : M₀} : IsUnit a → IsUnit (Ring.inverse a)

{M₀ : Type u_2}
[MonoidWithZero M₀]
{a : M₀}


theorem filter_congr {p q : α → Bool} :
    ∀ {l : List α}, (∀ x ∈ l, p x = q x) → filter p l = filter q l

{α : Type u_1}
{p q : α → Bool}
{l : List α}

(∀ (x : α), x ∈ l → p x = q x) → List.filter p l = List.filter q l


@[to_additive]
theorem csSup_div (hs₀ : s.Nonempty) (hs₁ : BddAbove s) (ht₀ : t.Nonempty) (ht₁ : BddBelow t) :
    sSup (s / t) = sSup s / sInf t

[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 le_padicValNat_iff_replicate_subperm_primeFactorsList {a b : ℕ} {n : ℕ} (ha : a.Prime)
    (hb : b ≠ 0) :
    n ≤ padicValNat a b ↔ replicate n a <+~ b.primeFactorsList

{a b n : ℕ}
(ha : Nat.Prime a)
(hb : b ≠ 0)

n ≤ padicValNat a b ↔ (List.replicate n a).Subperm b.primeFactorsList


theorem IsRadical.squarefree (h0 : x ≠ 0) (h : IsRadical x) : Squarefree x

{R : Type u_1}
[CancelCommMonoidWithZero R]
{x : R}
(h0 : x ≠ 0)
(h : IsRadical x)


@[simp]
theorem divX_C_mul : divX (C a * p) = C a * divX p

{R : Type u}
{a : R}
[Semiring R]
{p : R[X]}

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


/-- If a prime `p` has positive multiplicity in the `n`th central binomial coefficient,
`p` is no more than `2 * n` -/
theorem factorization_centralBinom_eq_zero_of_two_mul_lt (h : 2 * n < p) :
    (centralBinom n).factorization p = 0


theorem tendsto_fract_right [OrderClosedTopology α] [TopologicalAddGroup α] (n : ℤ) :
    Tendsto (fract : α → α) (𝓝[≥] n) (𝓝[≥] 0)

{α : Type u_1}
[LinearOrderedRing α]
[FloorRing α]
[TopologicalSpace α]
[OrderClosedTopology α]
[TopologicalAddGroup α]
(n : ℤ)

Filter.Tendsto Int.fract (𝓝[≥] ↑n) (𝓝[≥] 0)


theorem isAdjointPairLeftAdjointOfNondegenerate (B : BilinForm K V) (b : B.Nondegenerate)
    (φ : V →ₗ[K] V) : IsAdjointPair B B (B.leftAdjointOfNondegenerate b φ) φ

{V : Type u_5}
{K : Type u_6}
[Field K]
[AddCommGroup V]
[Module K V]
[FiniteDimensional K V]
(B : LinearMap.BilinForm K V)
(b : B.Nondegenerate)
(φ : V →ₗ[K] V)

B.IsAdjointPair B (B.leftAdjointOfNondegenerate b φ) φ


@[simp]
theorem minFac_two : minFac 2 = 2


@[simp]
theorem iUnion_Iio_coe_nat : ⋃ n : ℕ, Iio (n : ℝ≥0∞) = {∞}ᶜ


theorem mem_iInf {ι : Sort*} {x : E} {f : ι → ConvexCone 𝕜 E} : x ∈ iInf f ↔ ∀ i, x ∈ f i

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[SMul 𝕜 E]
{ι : Sort u_5}
{x : E}
{f : ι → ConvexCone 𝕜 E}


theorem eqOn_adjoin {s : Set A} (h : Set.EqOn D1 D2 s) : Set.EqOn D1 D2 (adjoin R s)

{R : Type u_1}
{A : Type u_2}
{M : Type u_4}
[CommSemiring R]
[CommSemiring A]
[AddCommMonoid M]
[Algebra R A]
[Module A M]
[Module R M]
{D1 D2 : Derivation R A M}
{s : Set A}
(h : Set.EqOn (⇑D1) (⇑D2) s)


/-- The `balance2` function does nothing if the second argument is already balanced. -/
theorem balance2_eq {l : RBNode α} {v : α} {r : RBNode α}
    (hr : r.Balanced c n) : balance2 l v r = node black l v r

{α : Type u_1}
{c : Batteries.RBColor}
{n : Nat}
{l : Batteries.RBNode α}
{v : α}
{r : Batteries.RBNode α}
(hr : r.Balanced c n)

l.balance2 v r = Batteries.RBNode.node Batteries.RBColor.black l v r


lemma isLocalizedModule_id (R') [CommSemiring R'] [Algebra R R'] [IsLocalization S R'] [Module R' M]
    [IsScalarTower R R' M] : IsLocalizedModule S (.id : M →ₗ[R] M)

{R : Type u_1}
[CommSemiring R]
(S : Submonoid R)
(M : Type u_2)
[AddCommMonoid M]
[Module R M]
(R' : Type u_6)
[CommSemiring R']
[Algebra R R']
[IsLocalization S R']
[Module R' M]
[IsScalarTower R R' M]


theorem foldr_cons_eq_toList : ∀ (t : Ordnode α) (r : List α), t.foldr List.cons r = toList t ++ r

{α : Type u_1}
(t : Ordnode α)
(r : List α)

Ordnode.foldr List.cons t r = t.toList ++ r


theorem lift_spec (φ : V ⥤q V') : of V ⋙q (lift φ).toPrefunctor = φ

{V : Type u}
[Quiver V]
{V' : Type u'}
[CategoryTheory.Groupoid V']
(φ : V ⥤q V')

CategoryTheory.Groupoid.Free.of V ⋙q (CategoryTheory.Groupoid.Free.lift φ).toPrefunctor = φ


/-- A nonzero vector is in the same ray as a multiple of itself if and only if that multiple
is positive. -/
theorem sameRay_smul_right_iff_of_ne {v : M} (hv : v ≠ 0) {r : R} (hr : r ≠ 0) :
    SameRay R v (r • v) ↔ 0 < r

{R : Type u_1}
[LinearOrderedCommRing R]
{M : Type u_2}
[AddCommGroup M]
[Module R M]
[NoZeroSMulDivisors R M]
{v : M}
(hv : v ≠ 0)
{r : R}
(hr : r ≠ 0)


theorem ideal_eq_span_pow_p {s : Ideal ℤ_[p]} (hs : s ≠ ⊥) :
    ∃ n : ℕ, s = Ideal.span {(p : ℤ_[p]) ^ n}

{p : ℕ}
[hp : Fact (Nat.Prime p)]
{s : Ideal ℤ_[p]}
(hs : s ≠ ⊥)


lemma pullback.hom_ext {Z : Profinite.{u}} (a b : Z ⟶ pullback f g)
    (hfst : a ≫ pullback.fst f g = b ≫ pullback.fst f g)
    (hsnd : a ≫ pullback.snd f g = b ≫ pullback.snd f g) : a = b

(hfst :
  CategoryTheory.CategoryStruct.comp a (Profinite.pullback.fst f g) =
    CategoryTheory.CategoryStruct.comp b (Profinite.pullback.fst f g))

(hsnd :
  CategoryTheory.CategoryStruct.comp a (Profinite.pullback.snd f g) =
    CategoryTheory.CategoryStruct.comp b (Profinite.pullback.snd f g))


@[simp]
theorem wittOne_pos_eq_zero (n : ℕ) (hn : 0 < n) : wittOne p n = 0

(p : ℕ)
[hp : Fact (Nat.Prime p)]
(n : ℕ)
(hn : 0 < n)


theorem ContDiffWithinAt.ccos {n} (hf : ContDiffWithinAt ℂ n f s x) :
    ContDiffWithinAt ℂ n (fun x => Complex.cos (f x)) s x

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
{f : E → ℂ}
{x : E}
{s : Set E}
{n : ℕ∞}
(hf : ContDiffWithinAt ℂ n f s x)


@[reassoc (attr := simp)]
theorem pullbackDiagonalMapIso_inv_fst :
    (pullbackDiagonalMapIso f i i₁ i₂).inv ≫ pullback.fst _ _ =
      pullback.fst _ _ ≫ i₁ ≫ pullback.fst _ _

(i₁ : V₁ ⟶ CategoryTheory.Limits.pullback f i)

(i₂ : V₂ ⟶ CategoryTheory.Limits.pullback f i)

(CategoryTheory.Limits.pullbackDiagonalMapIso f i i₁ i₂).inv ≫
    CategoryTheory.Limits.pullback.fst (CategoryTheory.Limits.pullback.diagonal f)
      (CategoryTheory.Limits.pullback.map (i₁ ≫ CategoryTheory.Limits.pullback.snd f i)
        (i₂ ≫ CategoryTheory.Limits.pullback.snd f i) f f (i₁ ≫ CategoryTheory.Limits.pullback.fst f i)
        (i₂ ≫ CategoryTheory.Limits.pullback.fst f i) i ⋯ ⋯) =
  CategoryTheory.Limits.pullback.fst i₁ i₂ ≫ i₁ ≫ CategoryTheory.Limits.pullback.fst f i


theorem of_finite {f : A →+* B} (hf : f.Finite) : f.FiniteType

{A : Type u_1}
{B : Type u_2}
[CommRing A]
[CommRing B]
{f : A →+* B}
(hf : f.Finite)


@[simp]
theorem Gamma0_mem (N : ℕ) (A : SL(2, ℤ)) : A ∈ Gamma0 N ↔ ((↑ₘA 1 0 : ℤ) : ZMod N) = 0

A ∈ CongruenceSubgroup.Gamma0 N ↔ ↑(↑A 1 0) = 0


@[reassoc (attr := simp)]
lemma Sigma.ι_comp_map' {f : α → C} {g : β → C} [HasCoproduct f] [HasCoproduct g]
    (p : α → β) (q : ∀ (a : α), f a ⟶ g (p a)) (a : α) :
    Sigma.ι f a ≫ Sigma.map' p q = q a ≫ Sigma.ι g (p a)

{β : Type w}
{α : Type w₂}
{C : Type u}
[CategoryTheory.Category.{v, u} C]
{f : α → C}
{g : β → C}
[CategoryTheory.Limits.HasCoproduct f]
[CategoryTheory.Limits.HasCoproduct g]
(p : α → β)
(q : (a : α) → f a ⟶ g (p a))
(a : α)

CategoryTheory.Limits.Sigma.ι f a ≫ CategoryTheory.Limits.Sigma.map' p q = q a ≫ CategoryTheory.Limits.Sigma.ι g (p a)


@[simp]
theorem floor_sub_one [Sub α] [OrderedSub α] [ExistsAddOfLE α] (a : α) : ⌊a - 1⌋₊ = ⌊a⌋₊ - 1

{α : Type u_2}
[LinearOrderedSemiring α]
[FloorSemiring α]
[Sub α]
[OrderedSub α]
[ExistsAddOfLE α]
(a : α)


theorem nnnorm_coe_le_nnnorm (x : α) : ‖f x‖₊ ≤ ‖f‖₊

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[SeminormedAddCommGroup β]
(f : BoundedContinuousFunction α β)
(x : α)

‖f x‖₊ ≤ ‖f‖₊


@[simp]
theorem lt_iff_toList_lt : ∀ {s₁ s₂ : String}, s₁ < s₂ ↔ s₁.toList < s₂.toList


theorem preimage_eq_empty {s : Set β} (h : Disjoint s (range f)) :
    f ⁻¹' s = ∅

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{s : Set β}
(h : Disjoint s (Set.range f))


theorem iUnion_decode₂ (f : β → Set α) : ⋃ (i : ℕ) (b ∈ decode₂ β i), f b = ⋃ b, f b

{α : Type u_1}
{β : Type u_2}
[Encodable β]
(f : β → Set α)

⋃ i, ⋃ b ∈ Encodable.decode₂ β i, f b = ⋃ b, f b


theorem iSup_insert (a : α) (s : Finset α) (t : α → β) :
    ⨆ x ∈ insert a s, t x = t a ⊔ ⨆ x ∈ s, t x

{α : Type u_2}
{β : Type u_3}
[CompleteLattice β]
[DecidableEq α]
(a : α)
(s : Finset α)
(t : α → β)


theorem iterate_mul (m : ℕ) : ∀ n, f^[m * n] = f^[m]^[n]


@[simp] theorem UInt64.toNat_ofNat (n) :
    (no_index (OfNat.ofNat n) : UInt64).toNat = n % UInt64.size


@[simp]
theorem apply_inv_self (f : Perm α) (x) : f (f⁻¹ x) = x


theorem isOpen_range_coe : IsOpen (range ((↑) : X → OnePoint X))


theorem coe_decompose_mul_add_of_right_mem [AddRightCancelMonoid ι] [GradedRing 𝒜] {a b : A}
    (b_mem : b ∈ 𝒜 j) : (decompose 𝒜 (a * b) (i + j) : A) = decompose 𝒜 a i * b

{ι : Type u_1}
{A : Type u_3}
{σ : Type u_4}
[DecidableEq ι]
[Semiring A]
[SetLike σ A]
[AddSubmonoidClass σ A]
(𝒜 : ι → σ)
{i j : ι}
[AddRightCancelMonoid ι]
[GradedRing 𝒜]
{a b : A}
(b_mem : b ∈ 𝒜 j)

↑(((DirectSum.decompose 𝒜) (a * b)) (i + j)) = ↑(((DirectSum.decompose 𝒜) a) i) * b


theorem det_adjustToOrientation [Nonempty ι] (e : Basis ι R M)
    (x : Orientation R M ι) :
    (e.adjustToOrientation x).det = e.det ∨ (e.adjustToOrientation x).det = -e.det

{R : Type u_1}
[LinearOrderedCommRing R]
{M : Type u_2}
[AddCommGroup M]
[Module R M]
{ι : Type u_3}
[Fintype ι]
[DecidableEq ι]
[Nonempty ι]
(e : Basis ι R M)
(x : Orientation R M ι)


theorem ContDiffOn.continuousOn_iteratedFDerivWithin {m : ℕ} (h : ContDiffOn 𝕜 n f s)
    (hmn : (m : ℕ∞) ≤ n) (hs : UniqueDiffOn 𝕜 s) : ContinuousOn (iteratedFDerivWithin 𝕜 m f s) s

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{s : Set E}
{f : E → F}
{n : ℕ∞}
{m : ℕ}
(h : ContDiffOn 𝕜 n f s)
(hmn : ↑m ≤ n)
(hs : UniqueDiffOn 𝕜 s)


/-- A gluing datum consists of
1. An index type `J`
2. An object `U i` for each `i : J`.
3. An object `V i j` for each `i j : J`.
4. A monomorphism `f i j : V i j ⟶ U i` for each `i j : J`.
5. A transition map `t i j : V i j ⟶ V j i` for each `i j : J`.
such that
6. `f i i` is an isomorphism.
7. `t i i` is the identity.
8. The pullback for `f i j` and `f i k` exists.
9. `V i j ×[U i] V i k ⟶ V i j ⟶ V j i` factors through `V j k ×[U j] V j i ⟶ V j i` via some
    `t' : V i j ×[U i] V i k ⟶ V j k ×[U j] V j i`.
10. `t' i j k ≫ t' j k i ≫ t' k i j = 𝟙 _`.
-/
-- Porting note(#5171): linter not ported yet
-- @[nolint has_nonempty_instance]
structure GlueData where
  J : Type v
  U : J → C
  V : J × J → C
  f : ∀ i j, V (i, j) ⟶ U i
  f_mono : ∀ i j, Mono (f i j) := by infer_instance
  f_hasPullback : ∀ i j k, HasPullback (f i j) (f i k) := by infer_instance
  f_id : ∀ i, IsIso (f i i) := by infer_instance
  t : ∀ i j, V (i, j) ⟶ V (j, i)
  t_id : ∀ i, t i i = 𝟙 _
  t' : ∀ i j k, pullback (f i j) (f i k) ⟶ pullback (f j k) (f j i)
  t_fac : ∀ i j k, t' i j k ≫ pullback.snd _ _ = pullback.fst _ _ ≫ t i j
  cocycle : ∀ i j k, t' i j k ≫ t' j k i ≫ t' k i j = 𝟙 _

{C : Type u₁}
[CategoryTheory.Category.{v, u₁} C]
(self : CategoryTheory.GlueData C)
(i j : self.J)


/-- `QuaternionAlgebra.imJ` as a `LinearMap`-/
@[simps]
def imJₗ : ℍ[R,c₁,c₂] →ₗ[R] R

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

(QuaternionAlgebra.imJₗ c₁ c₂) self = self.imJ


/-- We can assume that a minimal solution to `a ^ 4 + b ^ 4 = c ^ 2` has
`a` odd and `c` positive. -/
theorem exists_pos_odd_minimal {a b c : ℤ} (h : Fermat42 a b c) :
    ∃ a0 b0 c0, Minimal a0 b0 c0 ∧ a0 % 2 = 1 ∧ 0 < c0

∃ a0 b0 c0, Fermat42.Minimal a0 b0 c0 ∧ a0 % 2 = 1 ∧ 0 < c0


/-- The cartesian product of two multilinear maps, as a multilinear map. -/
@[simps]
def prod (f : MultilinearMap R M₁ M₂) (g : MultilinearMap R M₁ M₃) :
    MultilinearMap R M₁ (M₂ × M₃)

{R : Type uR}
{ι : Type uι}
{M₁ : ι → Type v₁}
{M₂ : Type v₂}
{M₃ : Type v₃}
[Semiring R]
[(i : ι) → AddCommMonoid (M₁ i)]
[AddCommMonoid M₂]
[AddCommMonoid M₃]
[(i : ι) → Module R (M₁ i)]
[Module R M₂]
[Module R M₃]
(f : MultilinearMap R M₁ M₂)
(g : MultilinearMap R M₁ M₃)
(m : (i : ι) → M₁ i)


@[simp]
theorem span_empty : lieSpan R L (∅ : Set L) = ⊥

(R : Type u)
(L : Type v)
[CommRing R]
[LieRing L]
[LieAlgebra R L]


@[to_additive]
theorem iUnion_smul_ae_eq (h : IsFundamentalDomain G s μ) : ⋃ g : G, g • s =ᵐ[μ] univ

(h : MeasureTheory.IsAddFundamentalDomain G s μ)


theorem ind_apply (x : X) (hx : x ∈ s) : f (f.ind x hx) x = 1

{ι : Type u}
{X : Type v}
[TopologicalSpace X]
{s : Set X}
(f : BumpCovering ι X s)
(x : X)
(hx : x ∈ s)


lemma pushoutCocone_inl_eq_inr_imp_of_iso {c c' : PushoutCocone f g} (e : c ≅ c')
    (x₁ : X₁) (x₂ : X₂) (h : c.inl x₁ = c.inr x₂) :
    c'.inl x₁ = c'.inr x₂

{c c' : CategoryTheory.Limits.PushoutCocone f g}


/-- The compatibility isomorphisms of the total complex with the shifts
in both variables "commute" only up to a sign `(x * y).negOnePow`. -/
lemma totalShift₁Iso_trans_totalShift₂Iso :
    ((shiftFunctor₂ C y).obj K).totalShift₁Iso x ≪≫
      (shiftFunctor (CochainComplex C ℤ) x).mapIso (K.totalShift₂Iso y) =
    (x * y).negOnePow • (total.mapIso ((shiftFunctor₁₂CommIso C x y).app K) (up ℤ)) ≪≫
      ((shiftFunctor₁ C x).obj K).totalShift₂Iso y ≪≫
      (shiftFunctor _ y).mapIso (K.totalShift₁Iso x) ≪≫
      (shiftFunctorComm (CochainComplex C ℤ) x y).app _

(K : HomologicalComplex₂ C (ComplexShape.up ℤ) (ComplexShape.up ℤ))

((HomologicalComplex₂.shiftFunctor₂ C y).obj K).totalShift₁Iso x ≪≫
    (CategoryTheory.shiftFunctor (CochainComplex C ℤ) x).mapIso (K.totalShift₂Iso y) =
  (x * y).negOnePow •
    HomologicalComplex₂.total.mapIso ((HomologicalComplex₂.shiftFunctor₁₂CommIso C x y).app K) (ComplexShape.up ℤ) ≪≫
      ((HomologicalComplex₂.shiftFunctor₁ C x).obj K).totalShift₂Iso y ≪≫
        (CategoryTheory.shiftFunctor (HomologicalComplex C (ComplexShape.up ℤ)) y).mapIso (K.totalShift₁Iso x) ≪≫
          (CategoryTheory.shiftFunctorComm (CochainComplex C ℤ) x y).app (K.total (ComplexShape.up ℤ))


theorem support_single_mul [Mul G] [IsLeftCancelMul G] (f : MonoidAlgebra k G) (r : k)
    (hr : ∀ y, r * y = 0 ↔ y = 0) (x : G) :
    (single x r * f : MonoidAlgebra k G).support = f.support.map (mulLeftEmbedding x)

{k : Type u₁}
{G : Type u₂}
[Semiring k]
[Mul G]
[IsLeftCancelMul G]
(f : MonoidAlgebra k G)
(r : k)
(hr : ∀ (y : k), r * y = 0 ↔ y = 0)
(x : G)

(MonoidAlgebra.single x r * f).support = Finset.map (mulLeftEmbedding x) f.support


theorem smeval_assoc_X_pow (m n : ℕ) :
    p.smeval x * x ^ m * x ^ n = p.smeval x * (x ^ m * x ^ n)

(R : Type u_1)
[Semiring R]
(p : Polynomial R)
{S : Type u_2}
[NonAssocSemiring S]
[Module R S]
[IsScalarTower R S S]
[Pow S ℕ]
[NatPowAssoc S]
(x : S)
(m n : ℕ)


@[simp]
theorem mk_zero [Nontrivial α] (h : (0 : α) ∈ Ico (0 : α) 1) : (⟨0, h⟩ : Ico (0 : α) 1) = 0

{α : Type u_1}
[OrderedSemiring α]
[Nontrivial α]
(h : 0 ∈ Set.Ico 0 1)


theorem nat_mul (h : Irrational x) {m : ℕ} (hm : m ≠ 0) : Irrational (m * x)

{x : ℝ}
(h : Irrational x)
{m : ℕ}
(hm : m ≠ 0)


theorem mod_def (a b : Int) : mod a b = a - b * a.div b


theorem isMin_iterate_pred_of_eq_of_ne {n m : ℕ} (h_eq : pred^[n] a = pred^[m] a)
    (h_ne : n ≠ m) : IsMin (pred^[n] a)

(h_eq : Order.pred^[n] a = Order.pred^[m] a)


theorem uniformEquicontinuousOn_iInf_rng {u : κ → UniformSpace α'} {F : ι → β → α'}
    {S : Set β} : UniformEquicontinuousOn (uα := ⨅ k, u k) F S ↔
      ∀ k, UniformEquicontinuousOn (uα := u k) F S

{ι : Type u_1}
{κ : Type u_2}
{α' : Type u_8}
{β : Type u_9}
[uβ : UniformSpace β]
{u : κ → UniformSpace α'}
{F : ι → β → α'}
{S : Set β}

UniformEquicontinuousOn F S ↔ ∀ (k : κ), UniformEquicontinuousOn F S


@[simp]
theorem tensorDistrib_tmul (Q₁ : QuadraticForm A M₁) (Q₂ : QuadraticForm R M₂) (m₁ : M₁) (m₂ : M₂) :
    tensorDistrib R A (Q₁ ⊗ₜ Q₂) (m₁ ⊗ₜ m₂) = Q₂ m₂ • Q₁ m₁

{R : Type uR}
{A : Type uA}
{M₁ : Type uM₁}
{M₂ : Type uM₂}
[CommRing R]
[CommRing A]
[AddCommGroup M₁]
[AddCommGroup M₂]
[Algebra R A]
[Module R M₁]
[Module A M₁]
[SMulCommClass R A M₁]
[IsScalarTower R A M₁]
[Module R M₂]
[Invertible 2]
(Q₁ : QuadraticForm A M₁)
(Q₂ : QuadraticForm R M₂)
(m₁ : M₁)
(m₂ : M₂)

((QuadraticForm.tensorDistrib R A) (Q₁ ⊗ₜ[R] Q₂)) (m₁ ⊗ₜ[R] m₂) = Q₂ m₂ • Q₁ m₁


theorem concat_eq_concat {l l' : List α} {a b : α} : concat l a = concat l' b ↔ l = l' ∧ a = b

{α : Type u_1}
{l l' : List α}
{a b : α}

l.concat a = l'.concat b ↔ l = l' ∧ a = b


theorem Monovary.dual_left : Monovary f g → Antivary (toDual ∘ f) g

{ι : Type u_1}
{α : Type u_3}
{β : Type u_4}
[Preorder α]
[Preorder β]
{f : ι → α}
{g : ι → β}

Monovary f g → Antivary (⇑OrderDual.toDual ∘ f) g


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

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


@[measurability]
theorem Measurable.nat_floor (hf : Measurable f) : Measurable fun x => ⌊f x⌋₊

{α : Type u_1}
{R : Type u_2}
[MeasurableSpace α]
[LinearOrderedSemiring R]
[FloorSemiring R]
[TopologicalSpace R]
[OrderTopology R]
[MeasurableSpace R]
[OpensMeasurableSpace R]
{f : α → R}
(hf : Measurable f)


@[simp]
theorem leftComm_symm_tmul (m : M) (p : P) (q : Q) :
    (leftComm R A M P Q).symm (p ⊗ₜ (m ⊗ₜ q)) = m ⊗ₜ (p ⊗ₜ q)

(R : Type uR)
(A : Type uA)
{M : Type uM}
{P : Type uP}
{Q : Type uQ}
[CommSemiring R]
[CommSemiring A]
[Algebra R A]
[AddCommMonoid M]
[Module R M]
[Module A M]
[IsScalarTower R A M]
[AddCommMonoid P]
[Module R P]
[Module A P]
[IsScalarTower R A P]
[AddCommMonoid Q]
[Module R Q]
(m : M)
(p : P)
(q : Q)

(TensorProduct.AlgebraTensorModule.leftComm R A M P Q).symm (p ⊗ₜ[A] m ⊗ₜ[R] q) = m ⊗ₜ[A] p ⊗ₜ[R] q


theorem map_injective {f : F} (hf : ker f = ⊥) : Injective (map f)

{R : Type u_1}
{R₂ : Type u_2}
{M : Type u_4}
{M₂ : Type u_5}
[Semiring R]
[Semiring R₂]
[AddCommGroup M]
[AddCommGroup M₂]
[Module R M]
[Module R₂ M₂]
{τ₁₂ : R →+* R₂}
[RingHomSurjective τ₁₂]
{F : Type u_8}
[FunLike F M M₂]
[SemilinearMapClass F τ₁₂ M M₂]
{f : F}
(hf : LinearMap.ker f = ⊥)


/-- The image of a 1-pre-hypercover by a functor. -/
@[simps]
def map : PreOneHypercover (F.obj X)

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


@[to_additive]
theorem prod_univ_three [CommMonoid β] (f : Fin 3 → β) : ∏ i, f i = f 0 * f 1 * f 2

{β : Type u_2}
[AddCommMonoid β]
(f : Fin 3 → β)


/-- Torsion by a set is torsion by the ideal generated by it. -/
theorem torsionBySet_eq_torsionBySet_span :
    torsionBySet R M s = torsionBySet R M (Ideal.span s)

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
(s : Set R)

Submodule.torsionBySet R M s = Submodule.torsionBySet R M ↑(Ideal.span s)


@[simp] theorem twoPowSum_toFinset_bitIndices (n : ℕ) :
    ∑ i in n.bitIndices.toFinset, 2 ^ i = n


theorem Injective.surjective_comp_right [Nonempty γ] (hf : Injective f) :
    Surjective fun g : β → γ ↦ g ∘ f

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


@[simp]
theorem preimage_union {s t : Set β} : f ⁻¹' (s ∪ t) = f ⁻¹' s ∪ f ⁻¹' t

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


@[to_additive (attr := simp)]
theorem quotientMulEquivOfEq_mk {M N : Subgroup G} [M.Normal] [N.Normal] (h : M = N) (x : G) :
    QuotientGroup.quotientMulEquivOfEq h (QuotientGroup.mk x) = QuotientGroup.mk x

{G : Type u}
[AddGroup G]
{M N : AddSubgroup G}
[M.Normal]
[N.Normal]
(h : M = N)
(x : G)

(QuotientAddGroup.quotientAddEquivOfEq h) ↑x = ↑x


theorem mkRat_def (n d) : mkRat n d = if d0 : d = 0 then 0 else normalize n d d0

mkRat n d = if d0 : d = 0 then 0 else Rat.normalize n d d0


theorem orderTop_add_eq_right {Γ} [LinearOrder Γ] {x y : HahnSeries Γ R}
    (hxy : y.orderTop < x.orderTop) : (x + y).orderTop = y.orderTop

{R : Type u_2}
[AddMonoid R]
{Γ : Type u_3}
[LinearOrder Γ]
{x y : HahnSeries Γ R}
(hxy : y.orderTop < x.orderTop)


theorem smul_toGerm (c : 𝕜) (f : α →ₘ[μ] γ) : (c • f).toGerm = c • f.toGerm

{α : Type u_1}
{γ : Type u_3}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
[TopologicalSpace γ]
{𝕜 : Type u_5}
[SMul 𝕜 γ]
[ContinuousConstSMul 𝕜 γ]
(c : 𝕜)
(f : α →ₘ[μ] γ)


/--
`IdempotentOp op` indicates `op` is an idempotent binary operation.
i.e. `a ∘ a = a`.
-/
class IdempotentOp (op : α → α → α) : Prop where
  /-- An idempotent operation satisfies `a ∘ a = a`. -/
  idempotent : (x : α) → op x x = x

{α : Sort u}
{op : α → α → α}
[self : Std.IdempotentOp op]
(x : α)


/-- A corollary of Liouville's theorem where the function tends to a finite value at infinity
(i.e., along `Filter.cocompact`, which in proper spaces coincides with `Bornology.cobounded`). -/
theorem eq_const_of_tendsto_cocompact [Nontrivial E] {f : E → F} (hf : Differentiable ℂ f) {c : F}
    (hb : Tendsto f (cocompact E) (𝓝 c)) : f = Function.const E c

(hb : Filter.Tendsto f (Filter.cocompact E) (𝓝 c))


theorem comp_apply (g : B →A[R] C) (f : A →A[R] B) (x : A) : (g.comp f) x = g (f x)

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


@[simp]
theorem prod_apply (x) : f.prod g x = (f x, g x)

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


/-- An angle in a right-angled triangle expressed using `arctan`, version subtracting vectors. -/
theorem oangle_sub_right_eq_arctan_of_oangle_eq_pi_div_two {x y : V} (h : o.oangle x y = ↑(π / 2)) :
    o.oangle y (y - x) = Real.arctan (‖x‖ / ‖y‖)

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

o.oangle y (y - x) = ↑(Real.arctan (‖x‖ / ‖y‖))


theorem differentiable_fourierIntegral
    (hf_int : Integrable f) (hvf_int : Integrable (fun v ↦ ‖v‖ * ‖f v‖)) :
    Differentiable ℝ (𝓕 f)

(hf_int : MeasureTheory.Integrable f MeasureTheory.volume)

(hvf_int : MeasureTheory.Integrable (fun v => ‖v‖ * ‖f v‖) MeasureTheory.volume)


theorem char_rmatch_iff (a : α) (x : List α) : rmatch (char a) x ↔ x = [a]

{α : Type u_1}
[dec : DecidableEq α]
(a : α)
(x : List α)

(RegularExpression.char a).rmatch x = true ↔ x = [a]


theorem natDegree_monomial_eq (i : ℕ) {r : R} (r0 : r ≠ 0) : (monomial i r).natDegree = i

{R : Type u}
[Semiring R]
(i : ℕ)
{r : R}
(r0 : r ≠ 0)

((Polynomial.monomial i) r).natDegree = i


@[simp]
theorem toIcoDiv_zsmul_add (a b : α) (m : ℤ) : toIcoDiv hp a (m • p + b) = m + toIcoDiv hp a b

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


@[simp]
theorem coe_toLp [NormedField 𝕜] [NormedSpace 𝕜 E] (f : C(α, E)) :
    (toLp (E := E) p μ 𝕜 f : α →ₘ[μ] E) = f.toAEEqFun μ

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
{p : ℝ≥0∞}
(μ : MeasureTheory.Measure α)
[NormedAddCommGroup E]
[TopologicalSpace α]
[BorelSpace α]
[SecondCountableTopologyEither α E]
[CompactSpace α]
[MeasureTheory.IsFiniteMeasure μ]
{𝕜 : Type u_5}
[Fact (1 ≤ p)]
[NormedField 𝕜]
[NormedSpace 𝕜 E]
(f : C(α, E))

↑((ContinuousMap.toLp p μ 𝕜) f) = ContinuousMap.toAEEqFun μ f


theorem zpow_injective (h₀ : 0 < a) (h₁ : a ≠ 1) : Injective (a ^ · : ℤ → α)

{α : Type u_1}
[LinearOrderedSemifield α]
{a : α}
(h₀ : 0 < a)
(h₁ : a ≠ 1)


@[simp]
theorem torsionBySet_univ : torsionBySet R M Set.univ = ⊥

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]


@[to_additive]
theorem map_le_iff_le_comap {f : M →ₙ* N} {S : Subsemigroup M} {T : Subsemigroup N} :
    S.map f ≤ T ↔ S ≤ T.comap f

{M : Type u_1}
{N : Type u_2}
[Add M]
[Add N]
{f : AddHom M N}
{S : AddSubsemigroup M}
{T : AddSubsemigroup N}

AddSubsemigroup.map f S ≤ T ↔ S ≤ AddSubsemigroup.comap f T


@[to_additive]
theorem finprod_congr {f g : α → M} (h : ∀ x, f x = g x) : finprod f = finprod g

{M : Type u_2}
{α : Sort u_4}
[AddCommMonoid M]
{f g : α → M}
(h : ∀ (x : α), f x = g x)


theorem DifferentiableAt.dist (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x)
    (hne : f x ≠ g x) : DifferentiableAt ℝ (fun y => dist (f y) (g y)) x

(𝕜 : Type u_1)
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[NormedSpace ℝ E]
{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace ℝ G]
{f g : G → E}
{x : G}
(hf : DifferentiableAt ℝ f x)
(hg : DifferentiableAt ℝ g x)
(hne : f x ≠ g x)


theorem SurjOn.congr (h : SurjOn f₁ s t) (H : EqOn f₁ f₂ s) : SurjOn f₂ s t

{α : Type u_1}
{β : Type u_2}
{s : Set α}
{t : Set β}
{f₁ f₂ : α → β}
(h : Set.SurjOn f₁ s t)
(H : Set.EqOn f₁ f₂ s)


theorem DifferentiableOn.cosh (hc : DifferentiableOn ℝ f s) :
    DifferentiableOn ℝ (fun x => Real.cosh (f x)) s

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : E → ℝ}
{s : Set E}
(hc : DifferentiableOn ℝ f s)


/-- If `M` and `M'` are each other's inverse matrices, they provide an equivalence between `n → A`
and `m → A` corresponding to `M.vecMul` and `M'.vecMul`. -/
@[simps]
def Matrix.toLinearEquivRight'OfInv [Fintype n] [DecidableEq n] {M : Matrix m n R}
    {M' : Matrix n m R} (hMM' : M * M' = 1) (hM'M : M' * M = 1) : (n → R) ≃ₗ[R] m → R

{R : Type u_1}
[Semiring R]
{m : Type u_3}
{n : Type u_4}
[Fintype m]
[DecidableEq m]
[Fintype n]
[DecidableEq n]
{M : Matrix m n R}
{M' : Matrix n m R}
(hMM' : M * M' = 1)
(hM'M : M' * M = 1)
(a : m → R)

∀ (a_1 : n), (Matrix.toLinearEquivRight'OfInv hMM' hM'M).symm a a_1 = (Matrix.toLinearMapRight' M) a a_1


/-- **Integration by parts on (-∞, ∞).**
For finite intervals, see: `intervalIntegral.integral_mul_deriv_eq_deriv_mul`. -/
theorem integral_mul_deriv_eq_deriv_mul [CompleteSpace A]
    (hu : ∀ x, HasDerivAt u (u' x) x) (hv : ∀ x, HasDerivAt v (v' x) x)
    (huv' : Integrable (u * v')) (hu'v : Integrable (u' * v))
    (h_bot : Tendsto (u * v) atBot (𝓝 a')) (h_top : Tendsto (u * v) atTop (𝓝 b')) :
    ∫ (x : ℝ), u x * v' x = b' - a' - ∫ (x : ℝ), u' x * v x

(huv' : MeasureTheory.Integrable (u * v') MeasureTheory.volume)

(hu'v : MeasureTheory.Integrable (u' * v) MeasureTheory.volume)

(h_bot : Filter.Tendsto (u * v) Filter.atBot (𝓝 a'))

(h_top : Filter.Tendsto (u * v) Filter.atTop (𝓝 b'))


theorem DenseRange.nonempty [h : Nonempty X] (hf : DenseRange f) : Nonempty α

{X : Type u_1}
[TopologicalSpace X]
{α : Type u_4}
{f : α → X}
[h : Nonempty X]
(hf : DenseRange f)


lemma KaehlerDifferential.mapBaseChange_surjective
    (h : Function.Surjective (algebraMap A B)) :
    Function.Surjective (KaehlerDifferential.mapBaseChange R A B)

(h : Function.Surjective ⇑(algebraMap A B))

Function.Surjective ⇑(KaehlerDifferential.mapBaseChange R A B)


/-- The `vectorSpan` of a finite affinely independent family has dimension one less than its
cardinality. -/
lemma AffineIndependent.finrank_vectorSpan_add_one [Fintype ι] [Nonempty ι] {p : ι → P}
    (hi : AffineIndependent k p) : finrank k (vectorSpan k (Set.range p)) + 1 = Fintype.card ι

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
{ι : Type u_4}
[DivisionRing k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
[Fintype ι]
[Nonempty ι]
{p : ι → P}
(hi : AffineIndependent k p)

FiniteDimensional.finrank k ↥(vectorSpan k (Set.range p)) + 1 = Fintype.card ι


/-- The obvious functor `(WidePullbackShape J)ᵒᵖ ⥤ WidePushoutShape J`-/
@[simps!]
def widePullbackShapeUnop : (WidePullbackShape J)ᵒᵖ ⥤ WidePushoutShape J

∀ {X Y : (CategoryTheory.Limits.WidePullbackShape J)ᵒᵖ} (f : X ⟶ Y),
  (CategoryTheory.Limits.widePullbackShapeUnop J).map f =
    (CategoryTheory.Limits.widePullbackShapeOpMap J (Opposite.unop Y) (Opposite.unop X) f.unop).unop


lemma HasLeftKanExtension.mk (F' : D ⥤ H) {L : C ⥤ D} {F : C ⥤ H} (α : F ⟶ L ⋙ F')
    [F'.IsLeftKanExtension α] : HasLeftKanExtension L F

{C : Type u_1}
{H : Type u_3}
{D : Type u_5}
[CategoryTheory.Category.{u_9, u_1} C]
[CategoryTheory.Category.{u_8, u_3} H]
[CategoryTheory.Category.{u_7, u_5} D]
(F' : CategoryTheory.Functor D H)
{L : CategoryTheory.Functor C D}
{F : CategoryTheory.Functor C H}
(α : F ⟶ L.comp F')
[F'.IsLeftKanExtension α]


theorem mem_closure_of_gauge_le_one (hc : Convex ℝ s) (hs₀ : 0 ∈ s) (ha : Absorbent ℝ s)
    (h : gauge s x ≤ 1) : x ∈ closure s

{E : Type u_2}
[AddCommGroup E]
[Module ℝ E]
{s : Set E}
{x : E}
[TopologicalSpace E]
[ContinuousSMul ℝ E]
(hc : Convex ℝ s)
(hs₀ : 0 ∈ s)
(ha : Absorbent ℝ s)
(h : gauge s x ≤ 1)


/-- An ordered `*`-ring is a `*`ring with a partial order such that the nonnegative elements
constitute precisely the `AddSubmonoid` generated by elements of the form `star s * s`.

If you are working with a `NonUnitalRing` and not a `NonUnitalSemiring`, it may be more
convenient to declare instances using `StarOrderedRing.of_nonneg_iff`.

Porting note: dropped an unneeded assumption
`add_le_add_left : ∀ {x y}, x ≤ y → ∀ z, z + x ≤ z + y` -/
class StarOrderedRing (R : Type u) [NonUnitalSemiring R] [PartialOrder R]
    [StarRing R] : Prop where
  /-- characterization of the order in terms of the `StarRing` structure. -/
  le_iff :
    ∀ x y : R, x ≤ y ↔ ∃ p, p ∈ AddSubmonoid.closure (Set.range fun s => star s * s) ∧ y = x + p

{R : Type u}
[NonUnitalSemiring R]
[PartialOrder R]
[StarRing R]
[self : StarOrderedRing R]
(x y : R)

x ≤ y ↔ ∃ p ∈ AddSubmonoid.closure (Set.range fun s => star s * s), y = x + p


@[simp]
theorem mk_le_one_iff_set_subsingleton {s : Set α} : #s ≤ 1 ↔ s.Subsingleton


theorem TotallyBounded.exists_subset {s : Set α} (hs : TotallyBounded s) {U : Set (α × α)}
    (hU : U ∈ 𝓤 α) : ∃ t, t ⊆ s ∧ Set.Finite t ∧ s ⊆ ⋃ y ∈ t, { x | (x, y) ∈ U }

{α : Type u}
[uniformSpace : UniformSpace α]
{s : Set α}
(hs : TotallyBounded s)
{U : Set (α × α)}
(hU : U ∈ 𝓤 α)

∃ t ⊆ s, t.Finite ∧ s ⊆ ⋃ y ∈ t, {x | (x, y) ∈ U}


@[to_additive (attr := simp) addHaarScalarFactor_smul]
lemma haarScalarFactor_smul [LocallyCompactSpace G] (μ' μ : Measure G) [IsHaarMeasure μ]
    [IsFiniteMeasureOnCompacts μ'] [IsMulLeftInvariant μ'] {c : ℝ≥0} :
    haarScalarFactor (c • μ') μ = c • haarScalarFactor μ' μ

(c • μ').haarScalarFactor μ = c • μ'.haarScalarFactor μ


/-- If a sieve S is contained in a sieve T, then we have a morphism of presheaves on their induced
presheaves.
-/
@[simps]
def natTransOfLe {S T : Sieve X} (h : S ≤ T) : S.functor ⟶ T.functor

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{X : C}
{S T : CategoryTheory.Sieve X}
(h : S ≤ T)
(Y : Cᵒᵖ)
(f : S.functor.obj Y)

↑((CategoryTheory.Sieve.natTransOfLe h).app Y f) = ↑f


@[simp] theorem getElem!_nil [Inhabited α] {n : Nat} : ([] : List α)[n]! = default


theorem any_map (f : α → β) (l : List α) (p : β → Bool) : (l.map f).any p = l.any (p ∘ f)

{α : Type u_1}
{β : Type u_2}
(f : α → β)
(l : List α)
(p : β → Bool)


theorem Zlattice.FG [hs : IsZlattice K L] : AddSubgroup.FG L

(K : Type u_1)
[NormedLinearOrderedField K]
[HasSolidNorm K]
[FloorRing K]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace K E]
[FiniteDimensional K E]
[ProperSpace E]
(L : AddSubgroup E)
[DiscreteTopology ↥L]
[hs : IsZlattice K L]


theorem ContMDiffWithinAt.congr (h : ContMDiffWithinAt I I' n f s x) (h₁ : ∀ y ∈ s, f₁ y = f y)
    (hx : f₁ x = f x) : ContMDiffWithinAt I I' n f₁ s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M' : Type u_7}
[TopologicalSpace M']
[ChartedSpace H' M']
{f f₁ : M → M'}
{s : Set M}
{x : M}
{n : ℕ∞}
(h : ContMDiffWithinAt I I' n f s x)
(h₁ : ∀ y ∈ s, f₁ y = f y)
(hx : f₁ x = f x)


@[simp]
theorem iUnion_Ioo_coe_nat : ⋃ n : ℕ, Ioo a n = Ioi a \ {∞}


theorem lpMeasSubgroupToLpTrim_ae_eq (hm : m ≤ m0) (f : lpMeasSubgroup F m p μ) :
    lpMeasSubgroupToLpTrim F p μ hm f =ᵐ[μ] f

(f : ↥(MeasureTheory.lpMeasSubgroup F m p μ))

↑↑(MeasureTheory.lpMeasSubgroupToLpTrim F p μ hm f) =ᵐ[μ] ↑↑↑f


@[simp]
theorem support_filter : (p.filter s h).support = s ∩ p.support

{α : Type u_1}
{p : PMF α}
{s : Set α}
(h : ∃ a ∈ s, a ∈ p.support)


lemma isZero₃_of_isZero₁₂ (h₁ : IsZero T.obj₁) (h₂ : IsZero T.obj₂) : IsZero T.obj₃

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

(T : CategoryTheory.Pretriangulated.Triangle C)

(hT : T ∈ CategoryTheory.Pretriangulated.distinguishedTriangles)

(h₁ : CategoryTheory.Limits.IsZero T.obj₁)

(h₂ : CategoryTheory.Limits.IsZero T.obj₂)


@[to_additive]
theorem eventually_div_right_iff (μ : Measure G) [IsMulRightInvariant μ] (t : G) {p : G → Prop} :
    (∀ᵐ x ∂μ, p (x / t)) ↔ ∀ᵐ x ∂μ, p x

{G : Type u_2}
[MeasurableSpace G]
[AddGroup G]
[MeasurableAdd G]
(μ : MeasureTheory.Measure G)
[μ.IsAddRightInvariant]
(t : G)
{p : G → Prop}

(∀ᵐ (x : G) ∂μ, p (x - t)) ↔ ∀ᵐ (x : G) ∂μ, p x


theorem mkPiRing_zero [Fintype ι] : MultilinearMap.mkPiRing R ι (0 : M₂) = 0

{R : Type uR}
{ι : Type uι}
{M₂ : Type v₂}
[CommSemiring R]
[AddCommMonoid M₂]
[Module R M₂]
[Fintype ι]


@[simp]
theorem symm_image_image (e : M₁ ≃SL[σ₁₂] M₂) (s : Set M₁) : e.symm '' (e '' s) = s

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


@[to_additive]
theorem coe_of (R : Type u) [Monoid R] : (MonCat.of R : Type u) = R


@[to_additive (attr := simp)]
theorem fst_div [Div G] [Div H] (a b : G × H) : (a / b).1 = a.1 / b.1

{G : Type u_3}
{H : Type u_4}
[Sub G]
[Sub H]
(a b : G × H)


theorem equivariantProjection_condition (v : V) : (π.equivariantProjection G) (i v) = v

{k : Type u}
[CommRing k]
(G : Type u)
[Group G]
{V : Type v}
[AddCommGroup V]
[Module k V]
[Module (MonoidAlgebra k G) V]
[IsScalarTower k (MonoidAlgebra k G) V]
{W : Type w}
[AddCommGroup W]
[Module k W]
[Module (MonoidAlgebra k G) W]
[IsScalarTower k (MonoidAlgebra k G) W]
(π : W →ₗ[k] V)
(i : V →ₗ[MonoidAlgebra k G] W)
(h : ∀ (v : V), π (i v) = v)
[Fintype G]
[Invertible ↑(Fintype.card G)]
(v : V)

(LinearMap.equivariantProjection G π) (i v) = v


@[simp]
theorem pointed_toConvexCone (S : Submodule 𝕜 E) : S.toConvexCone.Pointed

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[Module 𝕜 E]
(S : Submodule 𝕜 E)


theorem dvd_of_le (hv : Integers v O) {x y : O}
    (h : v (algebraMap O F x) ≤ v (algebraMap O F y)) : y ∣ x

(h : v ((algebraMap O F) x) ≤ v ((algebraMap O F) y))


@[reassoc (attr := simp)]
lemma rightUnitor_naturality (φ : X ⟶ X') :
    tensorHom φ (𝟙 (tensorUnit)) ≫ (rightUnitor X').hom =
      (rightUnitor X).hom ≫ φ

[(X₁ : C) →
    CategoryTheory.Limits.PreservesColimit (CategoryTheory.Functor.empty C)
      ((CategoryTheory.MonoidalCategory.curriedTensor C).obj X₁)]

{X X' : CategoryTheory.GradedObject I C}

CategoryTheory.CategoryStruct.comp
    (CategoryTheory.GradedObject.Monoidal.tensorHom φ
      (CategoryTheory.CategoryStruct.id CategoryTheory.GradedObject.Monoidal.tensorUnit))
    (CategoryTheory.GradedObject.Monoidal.rightUnitor X').hom =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.GradedObject.Monoidal.rightUnitor X).hom φ


@[to_additive (attr := simp, norm_cast)]
theorem coe_div (x y : H) : (↑(x / y) : G) = ↑x / ↑y

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


theorem comap_map_eq_self {f : R →+* S} {s : Subring R}
    (h : f ⁻¹' {0} ⊆ s) : (s.map f).comap f = s

{R : Type u}
{S : Type v}
[Ring R]
[Ring S]
{f : R →+* S}
{s : Subring R}
(h : ⇑f ⁻¹' {0} ⊆ ↑s)


theorem isLittleO_zero : (fun _x => (0 : E')) =o[l] g'

{α : Type u_1}
{E' : Type u_6}
{F' : Type u_7}
[SeminormedAddCommGroup E']
[SeminormedAddCommGroup F']
(g' : α → F')
(l : Filter α)


lemma _root_.StrictMono.nat_pow [Preorder α] (hn : n ≠ 0) (hf : StrictMono f) :
    StrictMono (f · ^ n)

{α : Type u_1}
{n : ℕ}
{f : α → ℕ}
[Preorder α]
(hn : n ≠ 0)
(hf : StrictMono f)


lemma infClosed_range [FunLike F α β] [InfHomClass F α β] (f : F) : InfClosed (Set.range f)

{F : Type u_1}
{α : Type u_2}
{β : Type u_3}
[SemilatticeInf α]
[SemilatticeInf β]
[FunLike F α β]
[InfHomClass F α β]
(f : F)


/-- The functor `(Φ.op.RightResolution X₂)ᵒᵖ ⥤ Φ.LeftResolution X₂.unop`. -/
@[simps]
def RightResolution.unopFunctor (X₂ : C₂ᵒᵖ) [W₁.IsMultiplicative] :
    (Φ.op.RightResolution X₂)ᵒᵖ ⥤ Φ.LeftResolution X₂.unop

{W₁ : CategoryTheory.MorphismProperty C₁}

{W₂ : CategoryTheory.MorphismProperty C₂}

(Φ : CategoryTheory.LocalizerMorphism W₁ W₂)

∀ {X Y : (Φ.op.RightResolution X₂)ᵒᵖ} (φ : X ⟶ Y),
  ((CategoryTheory.LocalizerMorphism.RightResolution.unopFunctor Φ X₂).map φ).f = φ.unop.f.unop


theorem chainHeight_eq_iSup_subtype : s.chainHeight = ⨆ l : s.subchain, ↑l.1.length


theorem InnerProductSpace.volume_ball (x : E) (r : ℝ) :
    volume (Metric.ball x r) = (.ofReal r) ^ finrank ℝ E *
      .ofReal (sqrt π ^ finrank ℝ E / Gamma (finrank ℝ E / 2 + 1))

{E : Type u_1}
[NormedAddCommGroup E]
[InnerProductSpace ℝ E]
[FiniteDimensional ℝ E]
[MeasurableSpace E]
[BorelSpace E]
[Nontrivial E]
(x : E)
(r : ℝ)

MeasureTheory.volume (Metric.ball x r) =
  ENNReal.ofReal r ^ FiniteDimensional.finrank ℝ E *
    ENNReal.ofReal (√Real.pi ^ FiniteDimensional.finrank ℝ E / Real.Gamma (↑(FiniteDimensional.finrank ℝ E) / 2 + 1))


/-- If the indicators of measurable sets `Aᵢ` tend pointwise to the indicator of a set `A`
and we eventually have `Aᵢ ⊆ B` for some set `B` of finite measure, then the measures of `Aᵢ`
tend to the measure of `A`. -/
lemma tendsto_measure_of_tendsto_indicator [NeBot L] {μ : Measure α}
    (As_mble : ∀ i, MeasurableSet (As i)) {B : Set α} (B_mble : MeasurableSet B)
    (B_finmeas : μ B ≠ ∞) (As_le_B : ∀ᶠ i in L, As i ⊆ B)
    (h_lim : ∀ x, ∀ᶠ i in L, x ∈ As i ↔ x ∈ A) :
    Tendsto (fun i ↦ μ (As i)) L (𝓝 (μ A))

(As_mble : ∀ (i : ι), MeasurableSet (As i))

(h_lim : ∀ (x : α), ∀ᶠ (i : ι) in L, x ∈ As i ↔ x ∈ A)

Filter.Tendsto (fun i => μ (As i)) L (nhds (μ A))


@[simp, norm_cast] lemma re_nnratCast (q : ℚ≥0) : (q : ℍ[R]).re = q

{R : Type u_1}
[LinearOrderedField R]
(q : ℚ≥0)


theorem ord_le_type (r : α → α → Prop) [h : IsWellOrder α r] : ord #α ≤ type r

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


/-- Let `μ` be an (outer) measure; let `s : ι → Set α` be a sequence of sets, `S = ⋃ n, s n`.
If `μ (S \ s n)` tends to zero along some nontrivial filter (usually `Filter.atTop` on `ι = ℕ`),
then `μ S = ⨆ n, μ (s n)`. -/
theorem measure_iUnion_of_tendsto_zero {ι} (μ : F) {s : ι → Set α} (l : Filter ι) [NeBot l]
    (h0 : Tendsto (fun k => μ ((⋃ n, s n) \ s k)) l (𝓝 0)) : μ (⋃ n, s n) = ⨆ n, μ (s n)

(h0 : Filter.Tendsto (fun k => μ ((⋃ n, s n) \ s k)) l (𝓝 0))


@[reassoc]
lemma homologySequenceδ_comp :
    F.homologySequenceδ T n₀ n₁ h ≫ (F.shift n₁).map T.mor₁ = 0

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

(T : CategoryTheory.Pretriangulated.Triangle C)

(hT : T ∈ CategoryTheory.Pretriangulated.distinguishedTriangles)

CategoryTheory.CategoryStruct.comp (F.homologySequenceδ T n₀ n₁ h) ((F.shift n₁).map T.mor₁) = 0


theorem KaehlerDifferential.End_equiv_aux (f : S →ₐ[R] S ⊗ S ⧸ KaehlerDifferential.ideal R S ^ 2) :
    (Ideal.Quotient.mkₐ R (KaehlerDifferential.ideal R S).cotangentIdeal).comp f =
        IsScalarTower.toAlgHom R S _ ↔
      (TensorProduct.lmul' R : S ⊗[R] S →ₐ[R] S).kerSquareLift.comp f = AlgHom.id R S

(f : S →ₐ[R] TensorProduct R S S ⧸ KaehlerDifferential.ideal R S ^ 2)

(Ideal.Quotient.mkₐ R (KaehlerDifferential.ideal R S).cotangentIdeal).comp f =
    IsScalarTower.toAlgHom R S
      ((TensorProduct R S S ⧸ KaehlerDifferential.ideal R S ^ 2) ⧸ (KaehlerDifferential.ideal R S).cotangentIdeal) ↔
  (Algebra.TensorProduct.lmul' R).kerSquareLift.comp f = AlgHom.id R S


theorem mul_factorial_pred (hn : 0 < n) : n * (n - 1)! = n !


@[simp]
theorem coe_neg (f : NormedAddGroupHom V₁ V₂) : ⇑(-f) = -f

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


lemma whiskerLeftIso_mapId (f : a ⟶ b) : whiskerLeftIso (F.map f) (F.mapId b) =
    (F.mapComp f (𝟙 b)).symm ≪≫ F.map₂Iso (ρ_ f) ≪≫ (ρ_ (F.map f)).symm

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

CategoryTheory.Bicategory.whiskerLeftIso (F.map f) (F.mapId b) =
  (F.mapComp f (CategoryTheory.CategoryStruct.id b)).symm ≪≫
    F.map₂Iso (CategoryTheory.Bicategory.rightUnitor f) ≪≫ (CategoryTheory.Bicategory.rightUnitor (F.map f)).symm


@[to_additive]
theorem mem_iSup {ι : Sort*} (p : ι → Submonoid M) {m : M} :
    (m ∈ ⨆ i, p i) ↔ ∀ N, (∀ i, p i ≤ N) → m ∈ N

{M : Type u_1}
[MulOneClass M]
{ι : Sort u_4}
(p : ι → Submonoid M)
{m : M}

m ∈ ⨆ i, p i ↔ ∀ (N : Submonoid M), (∀ (i : ι), p i ≤ N) → m ∈ N


@[to_additive]
theorem finprod_cond_ne (f : α → M) (a : α) [DecidableEq α] (hf : (mulSupport f).Finite) :
    (∏ᶠ (i) (_ : i ≠ a), f i) = ∏ i ∈ hf.toFinset.erase a, f i

{α : Type u_1}
{M : Type u_5}
[CommMonoid M]
(f : α → M)
(a : α)
[DecidableEq α]
(hf : (Function.mulSupport f).Finite)

∏ᶠ (i : α) (_ : i ≠ a), f i = ∏ i ∈ hf.toFinset.erase a, f i


@[simp]
theorem ppow_apply {f : ArithmeticFunction R} {k x : ℕ} (kpos : 0 < k) : f.ppow k x = f x ^ k

{R : Type u_1}
[Semiring R]
{f : ArithmeticFunction R}
{k x : ℕ}
(kpos : 0 < k)


/-- Reinterpret a lattice homomorphism as a lattice homomorphism between the dual lattices. -/
@[simps]
protected def dual : LatticeHom α β ≃ LatticeHom αᵒᵈ βᵒᵈ

{α : Type u_3}
{β : Type u_4}
[Lattice α]
[Lattice β]
(f : LatticeHom αᵒᵈ βᵒᵈ)

(LatticeHom.dual.symm f).toSupHom = SupHom.dual.symm f.toInfHom


theorem continuousAt_add_coe_top (a : ℝ) :
    ContinuousAt (fun p : EReal × EReal => p.1 + p.2) (a, ⊤)

ContinuousAt (fun p => p.1 + p.2) (↑a, ⊤)


@[simp]
protected theorem map_one : (1 : R[X]).map f = 1

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