theorem Memℒp.smul_of_top_right {p : ℝ≥0∞} {f : α → E} {φ : α → 𝕜} (hf : Memℒp f p μ)
    (hφ : Memℒp φ ∞ μ) : Memℒp (φ • f) p μ

{𝕜 : Type u_1}
{α : Type u_2}
{E : Type u_3}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[NormedRing 𝕜]
[NormedAddCommGroup E]
[MulActionWithZero 𝕜 E]
[BoundedSMul 𝕜 E]
{p : ℝ≥0∞}
{f : α → E}
{φ : α → 𝕜}
(hf : MeasureTheory.Memℒp f p μ)
(hφ : MeasureTheory.Memℒp φ ⊤ μ)


theorem ne_cast_int (h : LiouvilleWith p x) (hp : 1 < p) (m : ℤ) : x ≠ m

{p x : ℝ}
(h : LiouvilleWith p x)
(hp : 1 < p)
(m : ℤ)


/-- Torsion submonoids are torsion. -/
@[to_additive "Additive torsion submonoids are additively torsion."]
theorem torsion.isTorsion : IsTorsion <| torsion G


@[nontriviality]
lemma coeffs_eq_empty_of_subsingleton [Subsingleton R] (p : MvPolynomial σ R) : p.coeffs = ∅

{R : Type u}
{σ : Type u_1}
[CommSemiring R]
[Subsingleton R]
(p : MvPolynomial σ R)


@[to_additive]
lemma mk_inv_mul_mk_eq_one (S : Submonoid M) {x : Mˣ} (h : x ∈ S.units) :
    (⟨_, h.2⟩ : S) * ⟨_, h.1⟩ = 1

{M : Type u_1}
[Monoid M]
(S : Submonoid M)
{x : Mˣ}
(h : x ∈ S.units)

⟨(Units.coeHom M) x⁻¹, ⋯⟩ * ⟨(Units.coeHom M) x, ⋯⟩ = 1


@[simp]
theorem coe_zero [Zero β] : ⇑(0 : C_c(α, β)) = 0

{α : Type u_2}
{β : Type u_3}
[TopologicalSpace α]
[TopologicalSpace β]
[Zero β]


lemma sub_one_lt_iff : m - 1 < n ↔ m ≤ n


/-- See Note [no_index around OfNat.ofNat] -/
lemma cpow_ofNat_mul (x : ℂ) (n : ℕ) [n.AtLeastTwo] (y : ℂ) :
    x ^ (no_index (OfNat.ofNat n) * y) = (x ^ y) ^ (OfNat.ofNat n : ℕ)

x ^ (OfNat.ofNat n * y) = (x ^ y) ^ OfNat.ofNat n


@[fun_prop]
theorem HasStrictFDerivAt.mul_const (hc : HasStrictFDerivAt c c' x) (d : 𝔸') :
    HasStrictFDerivAt (fun y => c y * d) (d • c') x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{x : E}
{𝔸' : Type u_7}
[NormedCommRing 𝔸']
[NormedAlgebra 𝕜 𝔸']
{c : E → 𝔸'}
{c' : E →L[𝕜] 𝔸'}
(hc : HasStrictFDerivAt c c' x)
(d : 𝔸')


@[simp]
theorem ker_equiv {F' : Type*} [EquivLike F' R S] [RingEquivClass F' R S] (f : F') : ker f = ⊥

{R : Type u}
{S : Type v}
[Ring R]
[Semiring S]
{F' : Type u_2}
[EquivLike F' R S]
[RingEquivClass F' R S]
(f : F')


theorem card_subtype_not_diag [Fintype α] :
    card { a : Sym2 α // ¬a.IsDiag } = (card α).choose 2

{α : Type u_1}
[DecidableEq α]
[Fintype α]

Fintype.card { a // ¬a.IsDiag } = (Fintype.card α).choose 2


theorem map_span (f : F) (s : Set R) : map f (span s) = span (f '' s)

{R : Type u}
{S : Type v}
{F : Type u_1}
[Semiring R]
[Semiring S]
[FunLike F R S]
[rc : RingHomClass F R S]
(f : F)
(s : Set R)

Ideal.map f (Ideal.span s) = Ideal.span (⇑f '' s)


@[ext]
theorem ext {f g : A →ₑ+[φ] B} : (∀ x, f x = g x) → f = g

{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 g : A →ₑ+[φ] B}


@[fun_prop]
protected theorem ContinuousLinearMap.hasFDerivAt : HasFDerivAt e e x

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


theorem integral_mul_cexp_neg_mul_sq {b : ℂ} (hb : 0 < b.re) :
    ∫ r : ℝ in Ioi 0, (r : ℂ) * cexp (-b * (r : ℂ) ^ 2) = (2 * b)⁻¹

∫ (r : ℝ) in Set.Ioi 0, ↑r * cexp (-b * ↑r ^ 2) = (2 * b)⁻¹


@[to_additive] lemma max_div_min_eq_mabs' (a b : α) : max a b / min a b = |a / b|ₘ

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

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


@[to_additive (attr := simp) zsmul_sub]
lemma div_zpow (a b : α) (n : ℤ) : (a / b) ^ n = a ^ n / b ^ n

{α : Type u_1}
[SubtractionCommMonoid α]
(a b : α)
(n : ℤ)


theorem Sum.elim_intCast_intCast {α β γ : Type*} [IntCast γ] (n : ℤ) :
    Sum.elim (n : α → γ) (n : β → γ) = n

{α : Type u_5}
{β : Type u_6}
{γ : Type u_7}
[IntCast γ]
(n : ℤ)


@[simp]
theorem dedup_eq_self [DecidableEq α] (s : Finset α) : dedup s.1 = s.1

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


theorem IsGreatest.mem_maximals [Preorder α] (h : IsGreatest s a) : a ∈ maximals (· ≤ ·) s

{α : Type u_1}
{s : Set α}
{a : α}
[Preorder α]
(h : IsGreatest s a)


lemma StrictAntiOn.mapsTo_Ico (h : StrictAntiOn f (Icc a b)) :
    MapsTo f (Ico a b) (Ioc (f b) (f a))

{α : Type u_1}
{β : Type u_2}
{f : α → β}
[PartialOrder α]
[Preorder β]
{a b : α}
(h : StrictAntiOn f (Set.Icc a b))

Set.MapsTo f (Set.Ico a b) (Set.Ioc (f b) (f a))


@[simp]
theorem symm_constVSub (p : P) :
    (constVSub 𝕜 p).symm =
      (LinearIsometryEquiv.neg 𝕜).toAffineIsometryEquiv.trans (vaddConst 𝕜 p)

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

(AffineIsometryEquiv.constVSub 𝕜 p).symm =
  (LinearIsometryEquiv.neg 𝕜).toAffineIsometryEquiv.trans (AffineIsometryEquiv.vaddConst 𝕜 p)


@[simp]
theorem toCone_pt (c : BinaryBicone P Q) : c.toCone.pt = c.pt

(c : CategoryTheory.Limits.BinaryBicone P Q)


/-- When the second map `S.g` is zero, this is the left homology data on `S` given
by any colimit cokernel cofork of `S.f` -/
@[simps]
def ofIsColimitCokernelCofork (hg : S.g = 0) (c : CokernelCofork S.f) (hc : IsColimit c) :
    S.LeftHomologyData

(c : CategoryTheory.Limits.CokernelCofork S.f)

(hc : CategoryTheory.Limits.IsColimit c)

(CategoryTheory.ShortComplex.LeftHomologyData.ofIsColimitCokernelCofork S hg c hc).H = c.pt


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

{f g : CategoryTheory.ComposableArrows C 5}

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

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

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

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

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

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


/-- An extensionality for measures. It is `ext_of_generateFrom_of_iUnion` formulated in terms of
`FiniteSpanningSetsIn`. -/
protected theorem ext {ν : Measure α} {C : Set (Set α)} (hA : ‹_› = generateFrom C)
    (hC : IsPiSystem C) (h : μ.FiniteSpanningSetsIn C) (h_eq : ∀ s ∈ C, μ s = ν s) : μ = ν

(hA : m0 = MeasurableSpace.generateFrom C)


theorem StarConvex.add_left (hs : StarConvex 𝕜 x s) (z : E) :
    StarConvex 𝕜 (z + x) ((fun x => z + x) '' s)

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[Module 𝕜 E]
{x : E}
{s : Set E}
(hs : StarConvex 𝕜 x s)
(z : E)


lemma closure_inter_coborder :
    closure s ∩ coborder s = s

{X : Type u_1}
[TopologicalSpace X]
{s : Set X}


@[simp]
theorem map_obj_left : ((map f).obj U).left = U.left

{T : Type u₁}
[CategoryTheory.Category.{v₁, u₁} T]
{X Y : T}
{f : X ⟶ Y}
{U : CategoryTheory.Over X}

((CategoryTheory.Over.map f).obj U).left = U.left


/-- The category of algebras over an additive monad on a preadditive category is preadditive. -/
@[simps]
instance Monad.algebraPreadditive : Preadditive (Monad.Algebra T)

(C : Type u₁)
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.Preadditive C]
(T : CategoryTheory.Monad C)
[T.Additive]
(F G : T.Algebra)

CategoryTheory.Monad.Algebra.Hom.f 0 = 0


/-- If the oriented angle between two vectors is `π / 2`, the inner product of those vectors
is zero. -/
theorem inner_eq_zero_of_oangle_eq_pi_div_two {x y : V} (h : o.oangle x y = (π / 2 : ℝ)) :
    ⟪x, y⟫ = 0

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


lemma cast_def (q : ℚ) : (q : K) = q.num / q.den


{α : Type u_2}
[SemilatticeSup α]
(s t : Set α)


/-- `a ≤ b` as natural numbers if and only if `a ≤ b` in `Fin n`. -/
@[norm_cast, simp]
theorem val_fin_le {n : ℕ} {a b : Fin n} : (a : ℕ) ≤ (b : ℕ) ↔ a ≤ b

↑a ≤ ↑b ↔ a ≤ b


/-- The equivalence of functor categories given by currying/uncurrying.
-/
@[simps!]
def currying : C ⥤ D ⥤ E ≌ C × D ⥤ E

{C : Type u₂}
[CategoryTheory.Category.{v₂, u₂} C]
{D : Type u₃}
[CategoryTheory.Category.{v₃, u₃} D]
{E : Type u₄}
[CategoryTheory.Category.{v₄, u₄} E]

∀ {X Y : CategoryTheory.Functor C (CategoryTheory.Functor D E)} (T : X ⟶ Y) (X_1 : C × D),
  (CategoryTheory.currying.functor.map T).app X_1 = (T.app X_1.1).app X_1.2


/-- `MvPolynomial.coeff m` but promoted to a `LinearMap`. -/
@[simps]
def lcoeff (m : σ →₀ ℕ) : MvPolynomial σ R →ₗ[R] R

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

(MvPolynomial.lcoeff R m) p = MvPolynomial.coeff m p


@[to_additive]
theorem mono' {f' : α → γ} (hf : HasCompactMulSupport f)
    (hff' : mulSupport f' ⊆ mulTSupport f) : HasCompactMulSupport f'

(hff' : Function.support f' ⊆ tsupport f)


theorem lintegral_sub_le (f g : α → ℝ≥0∞) (hf : Measurable f) :
    ∫⁻ x, g x ∂μ - ∫⁻ x, f x ∂μ ≤ ∫⁻ x, g x - f x ∂μ

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

∫⁻ (x : α), g x ∂μ - ∫⁻ (x : α), f x ∂μ ≤ ∫⁻ (x : α), g x - f x ∂μ


theorem ContMDiff.prod_mk_space {f : M → E'} {g : M → F'} (hf : ContMDiff I 𝓘(𝕜, E') n f)
    (hg : ContMDiff I 𝓘(𝕜, F') n g) : ContMDiff I 𝓘(𝕜, E' × F') n fun x => (f x, g 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']
{F' : Type u_14}
[NormedAddCommGroup F']
[NormedSpace 𝕜 F']
{n : ℕ∞}
{f : M → E'}
{g : M → F'}
(hf : ContMDiff I 𝓘(𝕜, E') n f)
(hg : ContMDiff I 𝓘(𝕜, F') n g)


@[simp]
theorem appHom_restrict {X : D} {Y : C} (f : op X ⟶ op (G.obj Y)) (x) :
    ℱ'.val.map f (appHom α X x) = α.app (op Y) (ℱ.map f x)

{K : CategoryTheory.GrothendieckTopology D}

{ℱ : CategoryTheory.Functor Dᵒᵖ (Type v)}

(f : Opposite.op X ⟶ Opposite.op (G.obj Y))

ℱ'.val.map f (CategoryTheory.Functor.IsCoverDense.Types.appHom α X x) = α.app (Opposite.op Y) (ℱ.map f x)


@[simp]
theorem mem_ofWithBot {boxes : Finset (WithBot (Box ι))} {h₁ h₂} :
    J ∈ (ofWithBot boxes h₁ h₂ : Prepartition I) ↔ (J : WithBot (Box ι)) ∈ boxes

{boxes : Finset (WithBot (BoxIntegral.Box ι))}

J ∈ BoxIntegral.Prepartition.ofWithBot boxes h₁ h₂ ↔ ↑J ∈ boxes


@[to_additive]
theorem inv_smul_mem_iff : a⁻¹ • b ∈ s ↔ b ∈ a • s

{α : Type u_2}
{β : Type u_3}
[DecidableEq β]
[AddGroup α]
[AddAction α β]
{s : Finset β}
{a : α}
{b : β}


@[simp]
theorem coe_sup : ⇑(f ⊔ g) = ⇑f ⊔ ⇑g

{α : Type u_2}
{β : Type u_3}
[Top α]
[SemilatticeSup β]
[OrderTop β]
(f g : TopHom α β)


@[simp]
theorem subset_sInf_def [Inhabited s] :
    @sInf s _ = fun t =>
      if ht : t.Nonempty ∧ BddBelow t ∧ sInf ((↑) '' t : Set α) ∈ s
      then ⟨sInf ((↑) '' t : Set α), ht.2.2⟩ else
      default

{α : Type u_2}
(s : Set α)
[Preorder α]
[InfSet α]
[Inhabited ↑s]

sInf = fun t =>
  if ht : t.Nonempty ∧ BddBelow t ∧ sInf (Subtype.val '' t) ∈ s then ⟨sInf (Subtype.val '' t), ⋯⟩ else default


@[simp]
theorem comapDomain'_smul [Monoid γ] [∀ i, AddMonoid (β i)] [∀ i, DistribMulAction γ (β i)]
    (h : κ → ι) {h' : ι → κ} (hh' : Function.LeftInverse h' h) (r : γ) (f : Π₀ i, β i) :
    comapDomain' h hh' (r • f) = r • comapDomain' h hh' f

{ι : Type u}
{γ : Type w}
{β : ι → Type v}
{κ : Type u_1}
[Monoid γ]
[(i : ι) → AddMonoid (β i)]
[(i : ι) → DistribMulAction γ (β i)]
(h : κ → ι)
{h' : ι → κ}
(hh' : Function.LeftInverse h' h)
(r : γ)
(f : Π₀ (i : ι), β i)

DFinsupp.comapDomain' h hh' (r • f) = r • DFinsupp.comapDomain' h hh' f


@[deprecated shiftLeft_add (since := "2024-06-02")]
theorem shiftLeft_shiftLeft (m n : Nat) : ∀ k, (m <<< n) <<< k = m <<< (n + k)


theorem IsBigO.eq_zero_imp (h : f'' =O[l] g'') : ∀ᶠ x in l, g'' x = 0 → f'' x = 0

{α : Type u_1}
{E'' : Type u_9}
{F'' : Type u_10}
[NormedAddCommGroup E'']
[NormedAddCommGroup F'']
{f'' : α → E''}
{g'' : α → F''}
{l : Filter α}
(h : f'' =O[l] g'')


theorem basis_uniformity {ι : Sort*} {p : ι → Prop} {s : ι → Set (α × α)} (h : (𝓤 α).HasBasis p s) :
    (𝓤 (CauchyFilter α)).HasBasis p (gen ∘ s)

{α : Type u}
[UniformSpace α]
{ι : Sort u_1}
{p : ι → Prop}
{s : ι → Set (α × α)}
(h : (𝓤 α).HasBasis p s)

(𝓤 (CauchyFilter α)).HasBasis p (CauchyFilter.gen ∘ s)


theorem disjSups_subset_right (hs : s₁ ⊆ s₂) : s₁ ○ t ⊆ s₂ ○ t

{α : Type u_2}
[DecidableEq α]
[SemilatticeSup α]
[OrderBot α]
[DecidableRel Disjoint]
{s₁ s₂ t : Finset α}
(hs : s₁ ⊆ s₂)


@[simp]
theorem equivariantOfLinearOfComm_apply (v : V) : (equivariantOfLinearOfComm f h) v = f v

(h : ∀ (g : G) (v : V), f (MonoidAlgebra.single g 1 • v) = MonoidAlgebra.single g 1 • f v)

(MonoidAlgebra.equivariantOfLinearOfComm f h) v = f v


/-- The map `(x, y) ↦ (x / y, y)` preserves the measure `μ × ν`. -/
@[to_additive measurePreserving_sub_prod
" The map `(x, y) ↦ (x - y, y)` preserves the measure `μ × ν`. "]
theorem measurePreserving_div_prod [IsMulRightInvariant μ] :
    MeasurePreserving (fun z : G × G => (z.1 / z.2, z.2)) (μ.prod ν) (μ.prod ν)

{G : Type u_1}
[MeasurableSpace G]
[Group G]
[MeasurableMul₂ G]
(μ ν : MeasureTheory.Measure G)
[MeasureTheory.SFinite ν]
[MeasureTheory.SFinite μ]
[MeasurableInv G]
[μ.IsMulRightInvariant]

MeasureTheory.MeasurePreserving (fun z => (z.1 / z.2, z.2)) (μ.prod ν) (μ.prod ν)


/-- The infimum of two congruence relations equals the infimum of the underlying binary
    operations. -/
@[to_additive (attr := simp, norm_cast)
  "The infimum of two additive congruence relations equals the infimum of the underlying binary
  operations."]
theorem coe_inf {c d : Con M} : ⇑(c ⊓ d) = ⇑c ⊓ ⇑d


theorem isometry_conj : Isometry (conj : ℂ → ℂ)


theorem generateFrom_le_iff {s : Set (Set α)} (m : MeasurableSpace α) :
    generateFrom s ≤ m ↔ s ⊆ { t | MeasurableSet[m] t }

{α : Type u_1}
{s : Set (Set α)}
(m : MeasurableSpace α)

MeasurableSpace.generateFrom s ≤ m ↔ s ⊆ {t | MeasurableSet t}


lemma snd (h : LeftFraction₂Rel z₁ z₂) : LeftFractionRel z₁.snd z₂.snd

(h : CategoryTheory.MorphismProperty.LeftFraction₂Rel z₁ z₂)


theorem ae_const_le_iff_forall_lt_measure_zero {β} [LinearOrder β] [TopologicalSpace β]
    [OrderTopology β] [FirstCountableTopology β] (f : α → β) (c : β) :
    (∀ᵐ x ∂μ, c ≤ f x) ↔ ∀ b < c, μ {x | f x ≤ b} = 0

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{β : Type u_3}
[LinearOrder β]
[TopologicalSpace β]
[OrderTopology β]
[FirstCountableTopology β]
(f : α → β)
(c : β)

(∀ᵐ (x : α) ∂μ, c ≤ f x) ↔ ∀ b < c, μ {x | f x ≤ b} = 0


@[simp] theorem map_eq (e : α ≃ᵐ β) : MeasurableSpace.map e ‹_› = ‹_›

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


theorem union_distrib_iInter₂_right (s : ∀ i, κ i → Set α) (t : Set α) :
    (⋂ (i) (j), s i j) ∪ t = ⋂ (i) (j), s i j ∪ t

{α : Type u_1}
{ι : Sort u_4}
{κ : ι → Sort u_7}
(s : (i : ι) → κ i → Set α)
(t : Set α)

(⋂ i, ⋂ j, s i j) ∪ t = ⋂ i, ⋂ j, s i j ∪ t


theorem iSup_apply {ι : Sort*} [CompleteLattice β] (f : ι → α →o β) (x : α) :
    (⨆ i, f i) x = ⨆ i, f i x

{α : Type u_1}
{β : Type u_2}
[Preorder α]
{ι : Sort u_3}
[CompleteLattice β]
(f : ι → α →o β)
(x : α)


@[simp]
theorem lift_comp_of (f : FreeCommRing α →+* R) : lift (f ∘ of) = f

{α : Type u}
{R : Type v}
[CommRing R]
(f : FreeCommRing α →+* R)

FreeCommRing.lift (⇑f ∘ FreeCommRing.of) = f


theorem subset_range_enumerate {s : Set α} (h : s.Countable) (default : α) :
    s ⊆ range (enumerateCountable h default)

{α : Type u}
{s : Set α}
(h : s.Countable)
(default : α)

s ⊆ Set.range (Set.enumerateCountable h default)


/-- If a subgroup of a topological group has `1` in its interior, then it is open. -/
@[to_additive "If a subgroup of an additive topological group has `0` in its interior, then it is
open."]
theorem isOpen_of_one_mem_interior [ContinuousMul G] (H: Subgroup G)
    (h_1_int : (1 : G) ∈ interior (H : Set G)) : IsOpen (H : Set G)

{G : Type u_1}
[AddGroup G]
[TopologicalSpace G]
[ContinuousAdd G]
(H : AddSubgroup G)
(h_1_int : 0 ∈ interior ↑H)


/-- `Fin.cast` as an `OrderIso`.

`castOrderIso eq i` embeds `i` into an equal `Fin` type. -/
@[simps]
def castOrderIso (eq : n = m) : Fin n ≃o Fin m


/-- A more general version of `finprod_mem_mul_diff` that requires `t ∩ mulSupport f` rather than
`t` to be finite. -/
@[to_additive
      "A more general version of `finsum_mem_add_diff` that requires `t ∩ support f` rather
      than `t` to be finite."]
theorem finprod_mem_mul_diff' (hst : s ⊆ t) (ht : (t ∩ mulSupport f).Finite) :
    ((∏ᶠ i ∈ s, f i) * ∏ᶠ i ∈ t \ s, f i) = ∏ᶠ i ∈ t, f i

(ht : (t ∩ Function.mulSupport f).Finite)


protected lemma InvOn.extendDomain (h : InvOn g₁ g₂ s t) :
    InvOn (g₁.extendDomain f) (g₂.extendDomain f) ((↑) ∘ f '' s) ((↑) ∘ f '' t)

{α : Type u_1}
{β : Type u_2}
{p : β → Prop}
[DecidablePred p]
{f : α ≃ Subtype p}
{g₁ g₂ : Equiv.Perm α}
{s t : Set α}
(h : Set.InvOn (⇑g₁) (⇑g₂) s t)

Set.InvOn (⇑(g₁.extendDomain f)) (⇑(g₂.extendDomain f)) (Subtype.val ∘ ⇑f '' s) (Subtype.val ∘ ⇑f '' t)


@[simp] theorem cons_and_cons (x y : BitVec w) (a b : Bool) :
    (cons a x) &&& (cons b y) = cons (a && b) (x &&& y)

BitVec.cons a x &&& BitVec.cons b y = BitVec.cons (a && b) (x &&& y)


theorem Filter.TendstoNhdsWithinIoi.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜]
    (h : Tendsto f l (𝓝[>] c)) : Tendsto (fun a => b * f a) l (𝓝[>] (b * c))

{α : Type u_2}
{𝕜 : Type u_6}
[Preorder 𝕜]
[Zero 𝕜]
[Mul 𝕜]
[TopologicalSpace 𝕜]
[ContinuousMul 𝕜]
{l : Filter α}
{f : α → 𝕜}
{b c : 𝕜}
(hb : 0 < b)
[PosMulStrictMono 𝕜]
[PosMulReflectLT 𝕜]
(h : Filter.Tendsto f l (𝓝[>] c))

Filter.Tendsto (fun a => b * f a) l (𝓝[>] (b * c))


/-- For any non-zero `n` less than the period of `m` on `a`, `a` is moved by `m ^ n`. -/
@[to_additive "For any non-zero `n` less than the period of `m` on `a`, `a` is moved by `n • m`."]
theorem pow_smul_ne_of_lt_period {m : M} {a : α} {n : ℕ} (n_pos : 0 < n)
    (n_lt_period : n < period m a) : m ^ n • a ≠ a

(n_lt_period : n < AddAction.period m a)


theorem Nonempty.of_image2_left (h : (Set.image2 f s t).Nonempty) : s.Nonempty

{α : Type u_1}
{β : Type u_3}
{γ : Type u_5}
{f : α → β → γ}
{s : Set α}
{t : Set β}
(h : (Set.image2 f s t).Nonempty)


@[simp]
theorem preimage_mul_const_Icc (a b : α) {c : α} (h : 0 < c) :
    (fun x => x * c) ⁻¹' Icc a b = Icc (a / c) (b / c)

{α : Type u_1}
[LinearOrderedField α]
(a b : α)
{c : α}
(h : 0 < c)

(fun x => x * c) ⁻¹' Set.Icc a b = Set.Icc (a / c) (b / c)


theorem msb_append {x : BitVec w} {y : BitVec v} :
    (x ++ y).msb = bif (w == 0) then (y.msb) else (x.msb)

{w v : Nat}
{x : BitVec w}
{y : BitVec v}

(x ++ y).msb = bif w == 0 then y.msb else x.msb


@[simp]
theorem coe_linearMap_maxTrivLinearMapEquivLieModuleHom (f : maxTrivSubmodule R L (M →ₗ[R] N)) :
    (maxTrivLinearMapEquivLieModuleHom f : M →ₗ[R] N) = (f : M →ₗ[R] N)

(f : ↥(LieModule.maxTrivSubmodule R L (M →ₗ[R] N)))

↑(LieModule.maxTrivLinearMapEquivLieModuleHom f) = ↑f


lemma equivToUnitHom_mul_apply (χ₁ χ₂ : MulChar R R') (a : Rˣ) :
    equivToUnitHom (χ₁ * χ₂) a = equivToUnitHom χ₁ a * equivToUnitHom χ₂ a

{R : Type u_1}
[CommMonoid R]
{R' : Type u_2}
[CommMonoidWithZero R']
(χ₁ χ₂ : MulChar R R')
(a : Rˣ)

(MulChar.equivToUnitHom (χ₁ * χ₂)) a = (MulChar.equivToUnitHom χ₁) a * (MulChar.equivToUnitHom χ₂) a


@[ext]
lemma ext {f g : C(X, R)₀} (h : ∀ x, f x = g x) : f = g

{X : Type u_1}
{R : Type u_3}
[Zero X]
[Zero R]
[TopologicalSpace X]
[TopologicalSpace R]
{f g : ContinuousMapZero X R}
(h : ∀ (x : X), f x = g x)


/-- The edistance to a closed set depends continuously on the point and the set -/
theorem continuous_infEdist_hausdorffEdist :
    Continuous fun p : α × Closeds α => infEdist p.1 p.2

Continuous fun p => EMetric.infEdist p.1 ↑p.2


theorem sub_sub (a b c : Ordinal) : a - b - c = a - (b + c)


theorem cof_eq_sInf_lsub (o : Ordinal.{u}) : cof o =
    sInf { a : Cardinal | ∃ (ι : Type u) (f : ι → Ordinal), lsub.{u, u} f = o ∧ #ι = a }

o.cof = sInf {a | ∃ ι f, Ordinal.lsub f = o ∧ #ι = a}


/-- On a finite-dimensional space, an injective linear map is surjective. -/
theorem surjective_of_injective [FiniteDimensional K V] {f : V →ₗ[K] V} (hinj : Injective f) :
    Surjective f

{K : Type u}
{V : Type v}
[DivisionRing K]
[AddCommGroup V]
[Module K V]
[FiniteDimensional K V]
{f : V →ₗ[K] V}
(hinj : Function.Injective ⇑f)


theorem mk_one_eq_algebraMap (x) : mk x 1 = algebraMap R (Localization M) x

{R : Type u_1}
[CommSemiring R]
{M : Submonoid R}
(x : R)

Localization.mk x 1 = (algebraMap R (Localization M)) x


theorem mem_iff {A : Matrix (l ⊕ l) (l ⊕ l) R} :
    A ∈ symplecticGroup l R ↔ A * J l R * Aᵀ = J l R

{l : Type u_1}
{R : Type u_2}
[DecidableEq l]
[Fintype l]
[CommRing R]
{A : Matrix (l ⊕ l) (l ⊕ l) R}

A ∈ Matrix.symplecticGroup l R ↔ A * Matrix.J l R * Aᵀ = Matrix.J l R


@[to_additive]
theorem relindex_dvd_index_of_normal [H.Normal] : H.relindex K ∣ H.index

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


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

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


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

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

∀ {X_1 Y : CategoryTheory.Comma (F.comp (CategoryTheory.Functor.id T)) (CategoryTheory.Functor.fromPUnit X)}
  (f : X_1 ⟶ Y),
  ((CategoryTheory.CostructuredArrow.toOver F X).map f).right = CategoryTheory.CategoryStruct.id X_1.right


theorem eval₂_list_prod (l : List R[X]) (x : S) : eval₂ f x l.prod = (l.map (eval₂ f x)).prod

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

Polynomial.eval₂ f x l.prod = (List.map (Polynomial.eval₂ f x) l).prod


@[simp]
theorem sub_apply (x y : M₁) : (B₁ - D₁) x y = B₁ x y - D₁ x y

{R₁ : Type u_4}
{M₁ : Type u_5}
[CommRing R₁]
[AddCommGroup M₁]
[Module R₁ M₁]
(B₁ D₁ : LinearMap.BilinForm R₁ M₁)
(x y : M₁)


theorem compl_singleton_eq (a : α) : ({a} : Set α)ᶜ = { x | x ≠ a }


theorem natCast_fin_two (n : ℕ) : (n : Matrix (Fin 2) (Fin 2) α) = !![↑n, 0; 0, ↑n]

{α : Type u}
[AddMonoidWithOne α]
(n : ℕ)


theorem mem_iff_nonempty {α : Type*} [Subsingleton α] {s : Set α} {x : α} : x ∈ s ↔ s.Nonempty

{α : Type u_2}
[Subsingleton α]
{s : Set α}
{x : α}


lemma mem_principal_self : x ∈ principal x


@[to_additive tsum_nat_add_neg_add_one]
lemma tprod_nat_mul_neg_add_one [T2Space M] {f : ℤ → M} (hf : Multipliable f) :
    ∏' (n : ℕ), (f n * f (-(n + 1))) = ∏' (n : ℤ), f n

{M : Type u_1}
[AddCommMonoid M]
[TopologicalSpace M]
[T2Space M]
{f : ℤ → M}
(hf : Summable f)


lemma cfcₙ_comp_neg (hf : ContinuousOn f ((- ·) '' (σₙ R a)) := by cfc_cont_tac)
    (h0 : f 0 = 0 := by cfc_zero_tac) (ha : p a := by cfc_tac) :
    cfcₙ (f <| - ·) a = cfcₙ f (-a)

(hf : ContinuousOn f ((fun x => -x) '' σₙ R a) := by cfc_cont_tac)


@[simp]
theorem coe_isComplEquivProj_apply (q : { q // IsCompl p q }) :
    (p.isComplEquivProj q : E →ₗ[R] p) = linearProjOfIsCompl p q q.2

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

↑(p.isComplEquivProj q) = p.linearProjOfIsCompl ↑q ⋯


@[simp]
theorem toOption_eq_some_iff {o : Part α} [Decidable o.Dom] {a : α} :
    toOption o = Option.some a ↔ a ∈ o

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


@[simps]
instance biconeCategoryStruct : CategoryStruct (Bicone J)

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

CategoryTheory.CategoryStruct.id j =
  CategoryTheory.Bicone.casesOn j CategoryTheory.BiconeHom.left_id CategoryTheory.BiconeHom.right_id fun k =>
    CategoryTheory.BiconeHom.diagram (CategoryTheory.CategoryStruct.id k)


/-- Every ultrafilter `u` on `Ultrafilter α` converges to a unique
  point of `Ultrafilter α`, namely `joinM u`. -/
theorem ultrafilter_converges_iff {u : Ultrafilter (Ultrafilter α)} {x : Ultrafilter α} :
    ↑u ≤ 𝓝 x ↔ x = joinM u

{α : Type u}
{u : Ultrafilter (Ultrafilter α)}
{x : Ultrafilter α}


theorem log_le_log_iff (h : 0 < x) (h₁ : 0 < y) : log x ≤ log y ↔ x ≤ y


theorem projIcc_surjOn : SurjOn (projIcc a b h) (Icc a b) univ

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

Set.SurjOn (Set.projIcc a b h) (Set.Icc a b) Set.univ


theorem log_def {b : Ordinal} (h : 1 < b) (x : Ordinal) :
    log b x = pred (sInf { o | x < b ^ o })

Ordinal.log b x = (sInf {o | x < b ^ o}).pred


theorem IsSwap.mul_mem_closure_three_cycles {σ τ : Perm α} (hσ : IsSwap σ) (hτ : IsSwap τ) :
    σ * τ ∈ closure { σ : Perm α | IsThreeCycle σ }

{α : Type u_1}
[Fintype α]
[DecidableEq α]
{σ τ : Equiv.Perm α}
(hσ : σ.IsSwap)
(hτ : τ.IsSwap)

σ * τ ∈ Subgroup.closure {σ | σ.IsThreeCycle}


theorem le_def {K₁ K₂ : Pretopology C} : K₁ ≤ K₂ ↔ (K₁ : ∀ X : C, Set (Presieve X)) ≤ K₂

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Limits.HasPullbacks C]
{K₁ K₂ : CategoryTheory.Pretopology C}


@[simp]
theorem cliqueFree_two : G.CliqueFree 2 ↔ G = ⊥


private theorem size_set {ks : Array α} {vs : Array β} (h : ks.size = vs.size) (i : Fin ks.size) (j : Fin vs.size) (k : α) (v : β)
                           : (ks.set i k).size = (vs.set j v).size

{α : Type u_1}
{β : Type u_2}
{ks : Array α}
{vs : Array β}
(h : ks.size = vs.size)
(i : Fin ks.size)
(j : Fin vs.size)
(k : α)
(v : β)


/-- If `l : Filter ℂ` is an "exponential comparison filter", then $\log |z| =o(ℜ z)$ along `l`.
This is the main lemma in the proof of `Complex.IsExpCmpFilter.isLittleO_cpow_exp` below.
-/
theorem isLittleO_log_abs_re (hl : IsExpCmpFilter l) : (fun z => Real.log (abs z)) =o[l] re

{l : Filter ℂ}
(hl : Complex.IsExpCmpFilter l)

(fun z => Real.log (Complex.abs z)) =o[l] Complex.re


/-- Let `P` be the minimal polynomial of a root of unity `μ` and `Q` be the minimal polynomial of
`μ ^ p`, where `p` is a natural number that does not divide `n`. Then `P` divides `expand ℤ p Q`. -/
theorem minpoly_dvd_expand {p : ℕ} (hdiv : ¬p ∣ n) :
    minpoly ℤ μ ∣ expand ℤ p (minpoly ℤ (μ ^ p))

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

minpoly ℤ μ ∣ (Polynomial.expand ℤ p) (minpoly ℤ (μ ^ p))


lemma ext_to_X' (i : ι) (hi : ¬ c.Rel i (c.next i)) {A : C} {f g : A ⟶ X φ i}
    (h : f ≫ sndX φ i = g ≫ sndX φ i) : f = g

{f g : A ⟶ HomologicalComplex.homotopyCofiber.X φ i}

(h : f ≫ HomologicalComplex.homotopyCofiber.sndX φ i = g ≫ HomologicalComplex.homotopyCofiber.sndX φ i)


/-- Do not use this lemma: It is made obsolete by `exists_right_complement'_of_coprime` -/
private theorem step5 {P : Sylow (Nat.card N).minFac N} : P.1 ≠ ⊥

(h3 : ∀ (H : Subgroup G), ¬N.IsComplement' H)


/-- An antitone function is continuous to the right at a point if and only if its right limit
coincides with the value of the function. -/
theorem continuousWithinAt_Ioi_iff_rightLim_eq :
    ContinuousWithinAt f (Ioi x) x ↔ rightLim f x = f x

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

ContinuousWithinAt f (Set.Ioi x) x ↔ Function.rightLim f x = f x


protected lemma isCompl_iff {a b : L} :
    IsCompl a b ↔ IsCompl (a : α) (b : α)

{α : Type u_1}
[CompleteLattice α]
{L : CompleteSublattice α}
{a b : ↥L}


@[simp]
theorem range_subset {m n : Nat} : range m ⊆ range n ↔ m ≤ n


theorem nil_prefix (l : List α) : [] <+: l


theorem adapted_predictablePart' : Adapted ℱ fun n => predictablePart f ℱ μ n

{Ω : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace Ω}
{μ : MeasureTheory.Measure Ω}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[CompleteSpace E]
{f : ℕ → Ω → E}
{ℱ : MeasureTheory.Filtration ℕ m0}

MeasureTheory.Adapted ℱ fun n => MeasureTheory.predictablePart f ℱ μ n


@[to_additive (attr := simp)]
theorem inv_lt_div_iff_lt_mul : a⁻¹ < b / c ↔ c < a * b

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

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


@[simp]
theorem comap_top (f : F) : comap f (⊤ : NonUnitalSubsemiring S) = (⊤ : NonUnitalSubsemiring R)

{R : Type u}
{S : Type v}
[NonUnitalNonAssocSemiring R]
[NonUnitalNonAssocSemiring S]
{F : Type u_1}
[FunLike F R S]
[NonUnitalRingHomClass F R S]
(f : F)


@[simp]
lemma star_le_star_iff {x y : R} : star x ≤ star y ↔ x ≤ y

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


/--
A module is finitely presented if it is finitely generated by some set `s`
and the kernel of the presentation `Rˢ → M` is also finitely generated.
-/
class Module.FinitePresentation : Prop where
  out : ∃ (s : Finset M), Submodule.span R (s : Set M) = ⊤ ∧
    (LinearMap.ker (Finsupp.total s M R Subtype.val)).FG

{R : Type u_1}
{M : Type u_2}
[Semiring R]
[AddCommMonoid M]
[Module R M]
[self : Module.FinitePresentation R M]

∃ s, Submodule.span R ↑s = ⊤ ∧ (LinearMap.ker (Finsupp.total { x // x ∈ s } M R Subtype.val)).FG


theorem sub_singleton_eq (a : A) (r : R) : σ a - {r} = σ (a - ↑ₐ r)

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

spectrum R a - {r} = spectrum R (a - (algebraMap R A) r)


theorem le_csInf_iff' (hs : s.Nonempty) : b ≤ sInf s ↔ b ∈ lowerBounds s

{α : Type u_1}
[ConditionallyCompleteLinearOrder α]
{s : Set α}
{b : α}
[IsWellOrder α fun x x_1 => x < x_1]
(hs : s.Nonempty)


theorem isIso_iff_mono_and_epi [Balanced C] {X Y : C} (f : X ⟶ Y) : IsIso f ↔ Mono f ∧ Epi f

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

CategoryTheory.IsIso f ↔ CategoryTheory.Mono f ∧ CategoryTheory.Epi f


/-- Rotation by π / 2 is the "right-angle-rotation" map `J`. -/
theorem rotation_pi_div_two : o.rotation (π / 2 : ℝ) = J

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

o.rotation ↑(π / 2) = o.rightAngleRotation


/-- Constant functions are torus integrable -/
theorem torusIntegrable_const (a : E) (c : ℂⁿ) (R : ℝⁿ) : TorusIntegrable (fun _ => a) c R

{n : ℕ}
{E : Type u_1}
[NormedAddCommGroup E]
(a : E)
(c : Fin n → ℂ)
(R : Fin n → ℝ)


protected theorem Tendsto.mul {f : Filter α} {ma : α → ℝ≥0∞} {mb : α → ℝ≥0∞} {a b : ℝ≥0∞}
    (hma : Tendsto ma f (𝓝 a)) (ha : a ≠ 0 ∨ b ≠ ∞) (hmb : Tendsto mb f (𝓝 b))
    (hb : b ≠ 0 ∨ a ≠ ∞) : Tendsto (fun a => ma a * mb a) f (𝓝 (a * b))

{α : Type u_1}
{f : Filter α}
{ma mb : α → ℝ≥0∞}
{a b : ℝ≥0∞}
(hma : Filter.Tendsto ma f (𝓝 a))
(ha : a ≠ 0 ∨ b ≠ ⊤)
(hmb : Filter.Tendsto mb f (𝓝 b))
(hb : b ≠ 0 ∨ a ≠ ⊤)

Filter.Tendsto (fun a => ma a * mb a) f (𝓝 (a * b))


theorem unitsModPrincipalUnitsEquivResidueFieldUnits_comp_quotientGroup_mk :
    A.unitsModPrincipalUnitsEquivResidueFieldUnits.toMonoidHom.comp (QuotientGroup.mk' _) =
      A.unitGroupToResidueFieldUnits

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

A.unitsModPrincipalUnitsEquivResidueFieldUnits.toMonoidHom.comp
    (QuotientGroup.mk' (Subgroup.comap A.unitGroup.subtype A.principalUnitGroup)) =
  A.unitGroupToResidueFieldUnits


theorem toFun_eq_coe {f : CentroidHom α} : f.toFun = f

{α : Type u_5}
[NonUnitalNonAssocSemiring α]
{f : CentroidHom α}


protected theorem isAntisymm : ∀ (_ : r ↪r s) [IsAntisymm β s], IsAntisymm α r

{α : Type u_1}
{β : Type u_2}
{r : α → α → Prop}
{s : β → β → Prop}

r ↪r s → ∀ [inst : IsAntisymm β s], IsAntisymm α r


/-- A CHSH tuple in a *-monoid consists of 4 self-adjoint involutions `A₀ A₁ B₀ B₁` such that
the `Aᵢ` commute with the `Bⱼ`.

The physical interpretation is that `A₀` and `A₁` are a pair of boolean observables which
are spacelike separated from another pair `B₀` and `B₁` of boolean observables.
-/
--@[nolint has_nonempty_instance] Porting note(#5171): linter not ported yet
structure IsCHSHTuple {R} [Monoid R] [StarMul R] (A₀ A₁ B₀ B₁ : R) : Prop where
  A₀_inv : A₀ ^ 2 = 1
  A₁_inv : A₁ ^ 2 = 1
  B₀_inv : B₀ ^ 2 = 1
  B₁_inv : B₁ ^ 2 = 1
  A₀_sa : star A₀ = A₀
  A₁_sa : star A₁ = A₁
  B₀_sa : star B₀ = B₀
  B₁_sa : star B₁ = B₁
  A₀B₀_commutes : A₀ * B₀ = B₀ * A₀
  A₀B₁_commutes : A₀ * B₁ = B₁ * A₀
  A₁B₀_commutes : A₁ * B₀ = B₀ * A₁
  A₁B₁_commutes : A₁ * B₁ = B₁ * A₁

{R : Type u_1}
[Monoid R]
[StarMul R]
{A₀ A₁ B₀ B₁ : R}
(self : IsCHSHTuple A₀ A₁ B₀ B₁)


/-- A subalgebra `S` of `A / R` determines a subring `S.op` of the opposite ring `Aᵐᵒᵖ / R`. -/
@[simps]
def opEquiv : Subalgebra R A ≃o Subalgebra R Aᵐᵒᵖ

{R : Type u_2}
{A : Type u_3}
[CommSemiring R]
[Semiring A]
[Algebra R A]
(S : Subalgebra R Aᵐᵒᵖ)

(RelIso.symm Subalgebra.opEquiv) S = S.unop


@[simp]
theorem wellFoundedOn_image {s : Set β} : (f '' s).WellFoundedOn r ↔ s.WellFoundedOn (r on f)

{α : Type u_2}
{β : Type u_3}
{r : α → α → Prop}
{f : β → α}
{s : Set β}


lemma exact_of_comp_eq_zero_of_ker_le_range
    (h1 : g ∘ₗ f = 0) (h2 : ker g ≤ range f) : Exact f g

(h2 : LinearMap.ker g ≤ LinearMap.range f)


theorem mod_mul_left_mod (a b c : ℤ) : a % (b * c) % c = a % c


theorem mem_map₂_iff {c : γ} : c ∈ map₂ f a b ↔ ∃ a' b', a' ∈ a ∧ b' ∈ b ∧ f a' b' = c

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{f : α → β → γ}
{a : Option α}
{b : Option β}
{c : γ}

c ∈ Option.map₂ f a b ↔ ∃ a' b', a' ∈ a ∧ b' ∈ b ∧ f a' b' = c


theorem isSolvable_of_top_eq_bot (h : (⊤ : Subgroup G) = ⊥) : IsSolvable G


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

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

`F.map₂` strictly commute with compositions and preserve the identity. They also preserve the
associator, the left unitor, and the right unitor modulo some adjustments of domains and codomains
of 2-morphisms.
-/
structure OplaxFunctor (B : Type u₁) [Bicategory.{w₁, v₁} B] (C : Type u₂)
  [Bicategory.{w₂, v₂} C] extends PrelaxFunctor B C where
  mapId (a : B) : map (𝟙 a) ⟶ 𝟙 (obj a)
  mapComp {a b c : B} (f : a ⟶ b) (g : b ⟶ c) : map (f ≫ g) ⟶ map f ≫ map g
  mapComp_naturality_left :
    ∀ {a b c : B} {f f' : a ⟶ b} (η : f ⟶ f') (g : b ⟶ c),
      map₂ (η ▷ g) ≫ mapComp f' g = mapComp f g ≫ map₂ η ▷ map g := by
    aesop_cat
  mapComp_naturality_right :
    ∀ {a b c : B} (f : a ⟶ b) {g g' : b ⟶ c} (η : g ⟶ g'),
      map₂ (f ◁ η) ≫ mapComp f g' = mapComp f g ≫ map f ◁ map₂ η := by
    aesop_cat
  -- Porting note: `map₂_associator_aux` was used here in lean 3, but this was a hack
  -- to avoid a timeout; we revert this hack here (because it was causing other problems
  -- and was not necessary in lean 4)
  map₂_associator :
    ∀ {a b c d : B} (f : a ⟶ b) (g : b ⟶ c) (h : c ⟶ d),
      map₂ (α_ f g h).hom ≫ mapComp f (g ≫ h) ≫ map f ◁ mapComp g h =
    mapComp (f ≫ g) h ≫ mapComp f g ▷ map h ≫ (α_ (map f) (map g) (map h)).hom := by
    aesop_cat
  map₂_leftUnitor :
    ∀ {a b : B} (f : a ⟶ b),
      map₂ (λ_ f).hom = mapComp (𝟙 a) f ≫ mapId a ▷ map f ≫ (λ_ (map f)).hom := by
    aesop_cat
  map₂_rightUnitor :
    ∀ {a b : B} (f : a ⟶ b),
      map₂ (ρ_ f).hom = mapComp f (𝟙 b) ≫ map f ◁ mapId b ≫ (ρ_ (map f)).hom := by
    aesop_cat

(self : CategoryTheory.OplaxFunctor B C)

CategoryTheory.CategoryStruct.comp (self.map₂ (CategoryTheory.Bicategory.associator f g h).hom)
    (CategoryTheory.CategoryStruct.comp (self.mapComp f (CategoryTheory.CategoryStruct.comp g h))
      (CategoryTheory.Bicategory.whiskerLeft (self.map f) (self.mapComp g h))) =
  CategoryTheory.CategoryStruct.comp (self.mapComp (CategoryTheory.CategoryStruct.comp f g) h)
    (CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.whiskerRight (self.mapComp f g) (self.map h))
      (CategoryTheory.Bicategory.associator (self.map f) (self.map g) (self.map h)).hom)


theorem dTwo_comp_dOne : dTwo A ∘ₗ dOne A = 0

{k G : Type u}
[CommRing k]
[Group G]
(A : Rep k G)

groupCohomology.dTwo A ∘ₗ groupCohomology.dOne A = 0


@[simp]
theorem neg_dotProduct : -v ⬝ᵥ w = -(v ⬝ᵥ w)

{m : Type u_2}
{α : Type v}
[Fintype m]
[NonUnitalNonAssocRing α]
(v w : m → α)


theorem reflexive_manyOneReducible {α} [Primcodable α] : Reflexive (@ManyOneReducible α α _ _)


@[simp]
theorem coe_one : ((1 : A →⋆ₙ+* A) : A → A) = id

{A : Type u_1}
[NonUnitalNonAssocSemiring A]
[Star A]


@[simp] theorem minimalPeriod_id : minimalPeriod id x = 1


theorem star_eq_adjoint (A : E →ₗ[𝕜] E) : star A = LinearMap.adjoint A

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


theorem eq_of_clusterPt_uniformity [T0Space α] {x y : α} (h : ClusterPt (x, y) (𝓤 α)) : x = y

{α : Type u}
[UniformSpace α]
[T0Space α]
{x y : α}
(h : ClusterPt (x, y) (𝓤 α))


@[simp, norm_cast] lemma coe_ratCast (s : S) (x : ℚ) : ((x : s) : K) = x

{K : Type u}
[DivisionRing K]
{S : Type u_1}
[SetLike S K]
[h : SubfieldClass S K]
(s : S)
(x : ℚ)


theorem inclusion_right (h : s ⊆ t) (x : t) (m : (x : α) ∈ s) : inclusion h ⟨x, m⟩ = x

{α : Type u_1}
{s t : Set α}
(h : s ⊆ t)
(x : ↑t)
(m : ↑x ∈ s)


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


@[simp]
theorem length_simple (i : B) : ℓ (s i) = 1

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


theorem locallyIntegrable_finset_sum' {ι} (s : Finset ι) {f : ι → X → E}
    (hf : ∀ i ∈ s, LocallyIntegrable (f i) μ) : LocallyIntegrable (∑ i ∈ s, f i) μ

(hf : ∀ i ∈ s, MeasureTheory.LocallyIntegrable (f i) μ)

MeasureTheory.LocallyIntegrable (∑ i ∈ s, f i) μ


@[simp]
theorem count_apply_finset' {s : Finset α} (s_mble : MeasurableSet (s : Set α)) :
    count (↑s : Set α) = s.card

{α : Type u_1}
[MeasurableSpace α]
{s : Finset α}
(s_mble : MeasurableSet ↑s)

MeasureTheory.Measure.count ↑s = ↑s.card


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

(hS : S ∈ AddSubgroup.rightTransversals ↑H)

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


theorem deleteVerts_verts : (G'.deleteVerts s).verts = G'.verts \ s

{V : Type u}
{G : SimpleGraph V}
{G' : G.Subgraph}
{s : Set V}


theorem sub_left (x y z : M₁) : B₁ (x - y) z = B₁ x z - B₁ y z

{R₁ : Type u_4}
{M₁ : Type u_5}
[CommRing R₁]
[AddCommGroup M₁]
[Module R₁ M₁]
{B₁ : LinearMap.BilinForm R₁ M₁}
(x y z : M₁)


protected theorem nsmul_mem {x : R} (hx : x ∈ s) (n : ℕ) : n • x ∈ s

{R : Type u}
[NonAssocSemiring R]
(s : Subsemiring R)
{x : R}
(hx : x ∈ s)
(n : ℕ)


/-- Any two continuous `R`-algebra morphisms from `R` are equal -/
@[ext]
theorem ext_ring [TopologicalSpace R] {f g : R →A[R] A} : f = g

{R : Type u_1}
[CommSemiring R]
{A : Type u_2}
[Semiring A]
[TopologicalSpace A]
[Algebra R A]
[TopologicalSpace R]
{f g : R →A[R] A}


theorem relMap_quotient_mk' {n : ℕ} (r : L.Relations n) (x : Fin n → M) :
    (RelMap r fun i => (⟦x i⟧ : Quotient s)) ↔ @RelMap _ _ ps.toStructure _ r x

{L : FirstOrder.Language}
{M : Type u_1}
(s : Setoid M)
[ps : L.Prestructure s]
{n : ℕ}
(r : L.Relations n)
(x : Fin n → M)

(FirstOrder.Language.Structure.RelMap r fun i => ⟦x i⟧) ↔ FirstOrder.Language.Structure.RelMap r x


@[to_additive relindex_mul_index]
theorem relindex_mul_index (h : H ≤ K) : H.relindex K * K.index = H.index

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


lemma segment_inter_eq_endpoint_of_linearIndependent_of_ne [OrderedCommRing 𝕜] [NoZeroDivisors 𝕜]
    [AddCommGroup E] [Module 𝕜 E]
    {x y : E} (h : LinearIndependent 𝕜 ![x, y]) {s t : 𝕜} (hs : s ≠ t) (c : E) :
    [c + x -[𝕜] c + t • y] ∩ [c + x -[𝕜] c + s • y] = {c + x}

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedCommRing 𝕜]
[NoZeroDivisors 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{x y : E}
(h : LinearIndependent 𝕜 ![x, y])
{s t : 𝕜}
(hs : s ≠ t)
(c : E)


theorem piCongrLeft_symm_preimage_pi (f : ι' ≃ ι) (s : Set ι') (t : ∀ i, Set (α i)) :
    (f.piCongrLeft α).symm ⁻¹' s.pi (fun i' => t <| f i') = (f '' s).pi t

{ι : Type u_1}
{ι' : Type u_2}
{α : ι → Type u_3}
(f : ι' ≃ ι)
(s : Set ι')
(t : (i : ι) → Set (α i))

(⇑(Equiv.piCongrLeft α f).symm ⁻¹' s.pi fun i' => t (f i')) = (⇑f '' s).pi t


/-- The translation of a star-convex set is also star-convex. -/
theorem StarConvex.preimage_add_left (hs : StarConvex 𝕜 (x + z) s) :
    StarConvex 𝕜 x ((fun x => x + z) ⁻¹' s)

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[Module 𝕜 E]
{x z : E}
{s : Set E}
(hs : StarConvex 𝕜 (x + z) s)


@[simp]
theorem fold_empty : (∅ : Finset α).fold op b f = b

{α : Type u_1}
{β : Type u_2}
{op : β → β → β}
[hc : Std.Commutative op]
[ha : Std.Associative op]
{f : α → β}
{b : β}


@[simp]
theorem cancel_left (hg : Injective g) : g.comp f₁ = g.comp f₂ ↔ f₁ = f₂

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[HeytingAlgebra α]
[HeytingAlgebra β]
[HeytingAlgebra γ]
{f₁ f₂ : HeytingHom α β}
{g : HeytingHom β γ}
(hg : Function.Injective ⇑g)


theorem min_mem_image_coe {s : Finset α} (hs : s.Nonempty) :
    s.min ∈ (s.image (↑) : Finset (WithTop α))

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


@[simp] lemma inv_divInt' (a b : ℤ) : (a /. b)⁻¹ = b /. a


@[simp, norm_cast]
theorem coe_le_coe : (a : WithBot α) ≤ b ↔ a ≤ b

↑a ≤ ↑b ↔ a ≤ b


@[simp]
theorem compl_compl_compl (a : α) : aᶜᶜᶜ = aᶜ

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


theorem sup_disjoint (K₁ K₂ : Compacts G) (h : Disjoint (K₁ : Set G) K₂)
    (h₁ : IsClosed (K₁ : Set G)) (h₂ : IsClosed (K₂ : Set G)) :
    μ (K₁ ⊔ K₂) = μ K₁ + μ K₂

{G : Type w}
[TopologicalSpace G]
(μ : MeasureTheory.Content G)
(K₁ K₂ : TopologicalSpace.Compacts G)
(h : Disjoint ↑K₁ ↑K₂)
(h₁ : IsClosed ↑K₁)
(h₂ : IsClosed ↑K₂)

(fun s => ↑(μ.toFun s)) (K₁ ⊔ K₂) = (fun s => ↑(μ.toFun s)) K₁ + (fun s => ↑(μ.toFun s)) K₂


@[simp]
lemma N₂_map_isoΓ₀_hom_app_f (X : ChainComplex C ℕ) :
    (N₂.map (isoΓ₀.hom.app X)).f = PInfty

(AlgebraicTopology.DoldKan.N₂.map (CategoryTheory.Idempotents.DoldKan.isoΓ₀.hom.app X)).f =
  AlgebraicTopology.DoldKan.PInfty


theorem join_splitWrtCompositionAux {ns : List ℕ} :
    ∀ {l : List α}, ns.sum = l.length → (l.splitWrtCompositionAux ns).join = l

{α : Type u_1}
{ns : List ℕ}
{l : List α}


/-- A localization always has cardinality less than or equal to the base ring. -/
theorem card_le : #L ≤ #R

{R : Type u}
[CommRing R]
(S : Submonoid R)
{L : Type u}
[CommRing L]
[Algebra R L]
[IsLocalization S L]


@[simp 1001] -- Porting note: increase priority so that the LHS doesn't simplify
theorem norm_norm [SeminormedAddCommGroup α] (x : α) : ‖‖x‖‖ = ‖x‖

{α : Type u_1}
[SeminormedAddCommGroup α]
(x : α)


theorem star_self_mem_adjoin_singleton (x : A) : star x ∈ adjoin R ({x} : Set A)

(R : Type u_2)
{A : Type u_3}
[CommSemiring R]
[StarRing R]
[Semiring A]
[Algebra R A]
[StarRing A]
[StarModule R A]
(x : A)


@[to_additive]
theorem mem_closure {x : M} : x ∈ closure s ↔ ∀ S : Submonoid M, s ⊆ S → x ∈ S

{M : Type u_1}
[MulOneClass M]
{s : Set M}
{x : M}

x ∈ Submonoid.closure s ↔ ∀ (S : Submonoid M), s ⊆ ↑S → x ∈ S


/-- If a predicate is true in a neighborhood of `x`, then it is true for `x`. -/
theorem Filter.Eventually.self_of_nhds {p : X → Prop} (h : ∀ᶠ y in 𝓝 x, p y) : p x

{X : Type u}
{x : X}
[TopologicalSpace X]
{p : X → Prop}
(h : ∀ᶠ (y : X) in 𝓝 x, p y)


/-- A natural number `m` divides the sum `m + n` if and only if `m` divides `n`.-/
@[simp] protected lemma dvd_add_self_left : m ∣ m + n ↔ m ∣ n


theorem coeFn_posPart (f : Lp ℝ p μ) : ⇑(posPart f) =ᵐ[μ] fun a => max (f a) 0

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

↑↑(MeasureTheory.Lp.posPart f) =ᵐ[μ] fun a => max (↑↑f a) 0


theorem integral_Ioc_eq_integral_Ioo : ∫ t in Ioc x y, f t ∂μ = ∫ t in Ioo x y, f t ∂μ

{X : Type u_1}
{E : Type u_3}
[MeasurableSpace X]
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : X → E}
{μ : MeasureTheory.Measure X}
[PartialOrder X]
{x y : X}
[MeasureTheory.NoAtoms μ]

∫ (t : X) in Set.Ioc x y, f t ∂μ = ∫ (t : X) in Set.Ioo x y, f t ∂μ


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

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

TrivSqZeroExt.inl (∑ i ∈ s, f i) = ∑ i ∈ s, TrivSqZeroExt.inl (f i)


@[simp]
theorem setToL1S_zero_left (f : α →₁ₛ[μ] E) : setToL1S (0 : Set α → E →L[ℝ] F) f = 0

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

MeasureTheory.L1.SimpleFunc.setToL1S 0 f = 0


@[to_additive]
theorem smul_set_mem_smul_filter : s ∈ f → a • s ∈ a • f

{α : Type u_2}
{β : Type u_3}
[SMul α β]
{f : Filter β}
{s : Set β}
{a : α}


theorem gcd_mul_addOrderOf_div_eq {n : ℕ} (m : ℕ) (hn : 0 < n) :
    m.gcd n * addOrderOf (↑(↑m / ↑n * p) : AddCircle p) = n

{𝕜 : Type u_1}
[LinearOrderedField 𝕜]
(p : 𝕜)
[hp : Fact (0 < p)]
{n : ℕ}
(m : ℕ)
(hn : 0 < n)


theorem isConnected_Icc (h : a ≤ b) : IsConnected (Icc a b)

{α : Type u}
[ConditionallyCompleteLinearOrder α]
[TopologicalSpace α]
[OrderTopology α]
[DenselyOrdered α]
{a b : α}
(h : a ≤ b)


@[measurability]
theorem measurable_quot_mk {r : α → α → Prop} : Measurable (Quot.mk r)

{α : Type u_1}
[MeasurableSpace α]
{r : α → α → Prop}


@[to_additive (attr := simp)]
theorem mulSingle_mem_pi [DecidableEq η] {I : Set η} {H : ∀ i, Subgroup (f i)} (i : η) (x : f i) :
    Pi.mulSingle i x ∈ pi I H ↔ i ∈ I → x ∈ H i

{η : Type u_7}
{f : η → Type u_8}
[(i : η) → Group (f i)]
[DecidableEq η]
{I : Set η}
{H : (i : η) → Subgroup (f i)}
(i : η)
(x : f i)

Pi.mulSingle i x ∈ Subgroup.pi I H ↔ i ∈ I → x ∈ H i


/-- For a nonzero `k = r/s ∈ K`, the fractional ideal `(k)` is equal to the product
`∏_v v^(val_v(r) - val_v(s))`. -/
theorem finprod_heightOneSpectrum_factorization_principal_fraction {n : R} (hn : n ≠ 0) (d : ↥R⁰) :
    ∏ᶠ v : HeightOneSpectrum R, (v.asIdeal : FractionalIdeal R⁰ K) ^
      ((Associates.mk v.asIdeal).count (Associates.mk (Ideal.span {n} : Ideal R)).factors -
        (Associates.mk v.asIdeal).count (Associates.mk ((Ideal.span {(↑d : R)}) :
        Ideal R)).factors : ℤ) = spanSingleton R⁰ (mk' K n d)

{R : Type u_1}
[CommRing R]
{K : Type u_2}
[Field K]
[Algebra R K]
[IsFractionRing R K]
[IsDedekindDomain R]
{n : R}
(hn : n ≠ 0)
(d : ↥R⁰)

∏ᶠ (v : IsDedekindDomain.HeightOneSpectrum R),
    ↑v.asIdeal ^
      (↑((Associates.mk v.asIdeal).count (Associates.mk (Ideal.span {n})).factors) -
        ↑((Associates.mk v.asIdeal).count (Associates.mk (Ideal.span {↑d})).factors)) =
  FractionalIdeal.spanSingleton R⁰ (IsLocalization.mk' K n d)


theorem mul_lt_top_iff {a b : ℝ≥0∞} : a * b < ∞ ↔ a < ∞ ∧ b < ∞ ∨ a = 0 ∨ b = 0

a * b < ⊤ ↔ a < ⊤ ∧ b < ⊤ ∨ a = 0 ∨ b = 0


theorem invOfUnit_eq (φ : MvPowerSeries σ k) (h : constantCoeff σ k φ ≠ 0) :
    invOfUnit φ (Units.mk0 _ h) = φ⁻¹

(h : (MvPowerSeries.constantCoeff σ k) φ ≠ 0)

φ.invOfUnit (Units.mk0 ((MvPowerSeries.constantCoeff σ k) φ) h) = φ⁻¹


theorem lift_comp (g : M →ₗ[R] M'') (h : ∀ x : S, IsUnit ((algebraMap R (Module.End R M'')) x)) :
    (lift S f g h).comp f = g

(h : ∀ (x : ↥S), IsUnit ((algebraMap R (Module.End R M'')) ↑x))


theorem iteratedFDerivWithin_neg_apply {f : E → F} (hu : UniqueDiffOn 𝕜 s) (hx : x ∈ s) :
    iteratedFDerivWithin 𝕜 i (-f) s x = -iteratedFDerivWithin 𝕜 i f s x

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


theorem pow_le_of_le_log {b x y : ℕ} (hy : y ≠ 0) (h : x ≤ log b y) : b ^ x ≤ y

{b x y : ℕ}
(hy : y ≠ 0)
(h : x ≤ Nat.log b y)


/-- The inclusion functor from sheaves to presheaves. -/
@[simps]
def sheafOfTypesToPresheaf : SheafOfTypes J ⥤ Cᵒᵖ ⥤ Type w

(J : CategoryTheory.GrothendieckTopology C)

∀ {X Y : CategoryTheory.SheafOfTypes J} (f : X ⟶ Y), (CategoryTheory.sheafOfTypesToPresheaf J).map f = f.val


theorem convex_ball (a : E) (r : ℝ) : Convex ℝ (Metric.ball a r)

{E : Type u_2}
[SeminormedAddCommGroup E]
[NormedSpace ℝ E]
(a : E)
(r : ℝ)


theorem mapsTo_iUnion₂ {s : ∀ i, κ i → Set α} {t : Set β} {f : α → β} :
    MapsTo f (⋃ (i) (j), s i j) t ↔ ∀ i j, MapsTo f (s i j) t

{α : Type u_1}
{β : Type u_2}
{ι : Sort u_4}
{κ : ι → Sort u_7}
{s : (i : ι) → κ i → Set α}
{t : Set β}
{f : α → β}

Set.MapsTo f (⋃ i, ⋃ j, s i j) t ↔ ∀ (i : ι) (j : κ i), Set.MapsTo f (s i j) t


@[to_additive]
theorem map_sup (S T : Subsemigroup M) (f : M →ₙ* N) : (S ⊔ T).map f = S.map f ⊔ T.map f

{M : Type u_1}
{N : Type u_2}
[Mul M]
[Mul N]
(S T : Subsemigroup M)
(f : M →ₙ* N)

Subsemigroup.map f (S ⊔ T) = Subsemigroup.map f S ⊔ Subsemigroup.map f T


/-- The product of two elements of the additive closure of a submonoid `M` is an element of the
additive closure of `M`. -/
theorem mul_mem_add_closure (ha : a ∈ AddSubmonoid.closure (S : Set R))
    (hb : b ∈ AddSubmonoid.closure (S : Set R)) : a * b ∈ AddSubmonoid.closure (S : Set R)

{M : Type u_1}
{R : Type u_4}
[NonUnitalNonAssocSemiring R]
[SetLike M R]
[MulMemClass M R]
{S : M}
{a b : R}
(ha : a ∈ AddSubmonoid.closure ↑S)
(hb : b ∈ AddSubmonoid.closure ↑S)


theorem option_some_iff {f : α → σ} : (Primrec fun a => some (f a)) ↔ Primrec f

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


theorem mp_mem (hs : s ∈ f) (h : { x | x ∈ s → x ∈ t } ∈ f) : t ∈ f

{α : Type u}
{f : Filter α}
{s t : Set α}
(hs : s ∈ f)
(h : {x | x ∈ s → x ∈ t} ∈ f)


/-- If every dissociated subset of `s` has size at most `d`, then `s` is actually generated by a
subset of size at most `d`.

This is a dissociation analog of the fact that a set whose linearly independent subsets all have
size at most `d` is of dimension at most `d` itself. -/
@[to_additive "If every dissociated subset of `s` has size at most `d`, then `s` is actually
generated by a subset of size at most `d`.

This is a dissociation analog of the fact that a set whose linearly independent subspaces all have
size at most `d` is of dimension at most `d` itself."]
lemma exists_subset_mulSpan_card_le_of_forall_mulDissociated
    (hs : ∀ s', s' ⊆ s → MulDissociated (s' : Set α) → s'.card ≤ d) :
    ∃ s', s' ⊆ s ∧ s'.card ≤ d ∧ s ⊆ mulSpan s'

(hs : ∀ s' ⊆ s, MulDissociated ↑s' → s'.card ≤ d)


theorem basisSets_smul (U) (hU : U ∈ p.basisSets) :
    ∃ V ∈ 𝓝 (0 : 𝕜), ∃ W ∈ p.addGroupFilterBasis.sets, V • W ⊆ U

{𝕜 : Type u_1}
{E : Type u_5}
{ι : Type u_8}
[NormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
(p : SeminormFamily 𝕜 E ι)
[Nonempty ι]
(U : Set E)
(hU : U ∈ p.basisSets)

∃ V ∈ 𝓝 0, ∃ W ∈ AddGroupFilterBasis.toFilterBasis.sets, V • W ⊆ U


theorem ofNatCode_eq : ofNat Code = ofNatCode

Denumerable.ofNat Nat.Partrec.Code = Nat.Partrec.Code.ofNatCode


theorem squarefree_iff_prime_squarefree {n : ℕ} : Squarefree n ↔ ∀ x, Prime x → ¬x * x ∣ n

Squarefree n ↔ ∀ (x : ℕ), Nat.Prime x → ¬x * x ∣ n


theorem diff_iUnion [Nonempty ι] (s : Set β) (t : ι → Set β) : (s \ ⋃ i, t i) = ⋂ i, s \ t i

{β : Type u_2}
{ι : Sort u_4}
[Nonempty ι]
(s : Set β)
(t : ι → Set β)


@[simp]
lemma card_Iic : (Iic b).card = b + 1


theorem nhdsWithin_Iio_basis' {a : α} (h : ∃ b, b < a) : (𝓝[<] a).HasBasis (· < a) (Ioo · a)

{α : Type u_1}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
{a : α}
(h : ∃ b, b < a)

(𝓝[<] a).HasBasis (fun x => x < a) fun x => Set.Ioo x a


theorem covBy_iff_wcovBy_and_lt : a ⋖ b ↔ a ⩿ b ∧ a < b


lemma reverse_eq_image (l : Language α) : l.reverse = List.reverse '' l


/-- If `X` is a normal topological space and `U` is a locally finite open covering of a closed set
`s`, then there exists a `PartitionOfUnity ι X s` that is subordinate to `U`. If `X` is a
paracompact space, then the assumption `hf : LocallyFinite U` can be omitted, see
`BumpCovering.exists_isSubordinate`. -/
theorem exists_isSubordinate_of_locallyFinite [NormalSpace X] (hs : IsClosed s) (U : ι → Set X)
    (ho : ∀ i, IsOpen (U i)) (hf : LocallyFinite U) (hU : s ⊆ ⋃ i, U i) :
    ∃ f : PartitionOfUnity ι X s, f.IsSubordinate U

{ι : Type u}
{X : Type v}
[TopologicalSpace X]
{s : Set X}
[NormalSpace X]
(hs : IsClosed s)
(U : ι → Set X)
(ho : ∀ (i : ι), IsOpen (U i))
(hf : LocallyFinite U)
(hU : s ⊆ ⋃ i, U i)


/-- A lattice is atomistic iff every element is a `sSup` of a set of atoms. -/
class IsAtomistic : Prop where
  /-- Every element is a `sSup` of a set of atoms. -/
  eq_sSup_atoms : ∀ b : α, ∃ s : Set α, b = sSup s ∧ ∀ a, a ∈ s → IsAtom a

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


@[to_additive]
theorem contMDiff_finprod_cond (hc : ∀ i, p i → ContMDiff I' I n (f i))
    (hf : LocallyFinite fun i => mulSupport (f i)) :
    ContMDiff I' I n fun x => ∏ᶠ (i) (_ : p i), f i x

(hc : ∀ (i : ι), p i → ContMDiff I' I n (f i))

(hf : LocallyFinite fun i => Function.support (f i))

ContMDiff I' I n fun x => ∑ᶠ (i : ι) (_ : p i), f i x


protected theorem le_max_left ( a b : Nat) : a ≤ max a b


theorem ex_of_PSigma {α : Type u} {p : α → Prop} : (PSigma (fun x => p x)) → Exists (fun x => p x)


@[to_additive (attr := simp) norm_eq_zero]
theorem norm_eq_zero'' : ‖a‖ = 0 ↔ a = 1

{E : Type u_6}
[NormedAddGroup E]
{a : E}


@[ext]
theorem ext : (∀ i j, M i j = N i j) → M = N

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

(∀ (i : m) (j : n), M i j = N i j) → M = N


/-- In a space with second countable topology, measurable implies ae strongly measurable. -/
@[fun_prop, aesop unsafe 30% apply (rule_sets := [Measurable])]
theorem _root_.Measurable.aestronglyMeasurable {_ : MeasurableSpace α} {μ : Measure α}
    [MeasurableSpace β] [PseudoMetrizableSpace β] [SecondCountableTopology β]
    [OpensMeasurableSpace β] (hf : Measurable f) : AEStronglyMeasurable f μ

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

∀ {x : MeasurableSpace α} {μ : MeasureTheory.Measure α} [inst : MeasurableSpace β]
  [inst_1 : TopologicalSpace.PseudoMetrizableSpace β] [inst_2 : SecondCountableTopology β]
  [inst_3 : OpensMeasurableSpace β], Measurable f → MeasureTheory.AEStronglyMeasurable f μ


theorem domDomCongr_trans (σ₁ : ι ≃ ι') (σ₂ : ι' ≃ ι'') (f : M [⋀^ι]→ₗ[R] N) :
    f.domDomCongr (σ₁.trans σ₂) = (f.domDomCongr σ₁).domDomCongr σ₂

{R : Type u_1}
[Semiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
{N : Type u_3}
[AddCommMonoid N]
[Module R N]
{ι : Type u_7}
{ι' : Type u_8}
{ι'' : Type u_9}
(σ₁ : ι ≃ ι')
(σ₂ : ι' ≃ ι'')
(f : M [⋀^ι]→ₗ[R] N)

AlternatingMap.domDomCongr (σ₁.trans σ₂) f = AlternatingMap.domDomCongr σ₂ (AlternatingMap.domDomCongr σ₁ f)


/-- The special adjoint functor theorem: if `F : C ⥤ D` preserves colimits and `C` is cocomplete,
well-copowered and has a small separating set, then `F` has a right adjoint.
-/
lemma isLeftAdjoint_of_preservesColimits_of_isSeparating [HasColimits C] [WellPowered Cᵒᵖ]
    {𝒢 : Set C} [Small.{v} 𝒢] (h𝒢 : IsSeparating 𝒢) (F : C ⥤ D) [PreservesColimits F] :
    F.IsLeftAdjoint


/-- The functor `CondensedSet ⥤ TopCat`  -/
@[simps]
def condensedSetToTopCat : CondensedSet.{u} ⥤ TopCat.{u+1}

∀ {X Y : CondensedSet} (f : X ⟶ Y), condensedSetToTopCat.map f = CondensedSet.toTopCatMap f


lemma LSeriesSummable_of_abscissaOfAbsConv_lt_re {f : ℕ → ℂ} {s : ℂ}
    (hs : abscissaOfAbsConv f < s.re) : LSeriesSummable f s

(hs : LSeries.abscissaOfAbsConv f < ↑s.re)


lemma baseChange_nonsingular (hf : Function.Injective f) (x y : A) :
    (W.baseChange B).toAffine.Nonsingular (f x) (f y) ↔
      (W.baseChange A).toAffine.Nonsingular x y

{R : Type r}
[CommRing R]
(W : WeierstrassCurve.Affine R)
{S : Type s}
[CommRing S]
[Algebra R S]
{A : Type u}
[CommRing A]
[Algebra R A]
[Algebra S A]
[IsScalarTower R S A]
{B : Type v}
[CommRing B]
[Algebra R B]
[Algebra S B]
[IsScalarTower R S B]
{f : A →ₐ[S] B}
(hf : Function.Injective ⇑f)
(x y : A)

(WeierstrassCurve.baseChange W B).toAffine.Nonsingular (f x) (f y) ↔
  (WeierstrassCurve.baseChange W A).toAffine.Nonsingular x y


@[simp]
theorem zipRight'_nil_left : zipRight' ([] : List α) bs = (bs.map fun b => (none, b), [])

[].zipRight' bs = (List.map (fun b => (none, b)) bs, [])


@[to_additive]
theorem inter_mul_subset : s₁ ∩ s₂ * t ⊆ s₁ * t ∩ (s₂ * t)

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


theorem interior_iInter_subset (s : ι → Set X) : interior (⋂ i, s i) ⊆ ⋂ i, interior (s i)

{X : Type u}
{ι : Sort w}
[TopologicalSpace X]
(s : ι → Set X)


@[simp]
protected theorem natCast (n : ℕ) : IsSelfAdjoint (n : R)

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


lemma closure_iInter_eq_iInter_closure_of_iUnion_indep [hι : Nonempty ι] (Is : ι → Set α)
    (h : M.Indep (⋃ i, Is i)) : M.closure (⋂ i, Is i) = (⋂ i, M.closure (Is i))

{α : Type u_2}
{M : Matroid α}
{ι : Sort u_3}
[hι : Nonempty ι]
(Is : ι → Set α)
(h : M.Indep (⋃ i, Is i))

M.closure (⋂ i, Is i) = ⋂ i, M.closure (Is i)


@[simp, norm_cast]
theorem rpow_natCast (x : ℝ) (n : ℕ) : x ^ (n : ℝ) = x ^ n


theorem prime_generator_of_isPrime (S : Ideal R) [S.IsPrincipal] [is_prime : S.IsPrime]
    (ne_bot : S ≠ ⊥) : Prime (generator S)

{R : Type u}
[CommRing R]
(S : Ideal R)
[Submodule.IsPrincipal S]
[is_prime : S.IsPrime]
(ne_bot : S ≠ ⊥)


@[simp]
theorem one_mul_hom {Z : C} (f : Z ⟶ M.X) : (M.one ⊗ f) ≫ M.mul = (λ_ Z).hom ≫ f

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.MonoidalCategory C]
{M : Mon_ C}
{Z : C}
(f : Z ⟶ M.X)


@[to_additive sub_nonpos]
theorem div_le_one' : a / b ≤ 1 ↔ a ≤ b

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


/-- Converse of "angles in same segment are equal" and "opposite angles of a cyclic quadrilateral
add to π", for oriented angles mod π. -/
theorem cospherical_of_two_zsmul_oangle_eq_of_not_collinear {p₁ p₂ p₃ p₄ : P}
    (h : (2 : ℤ) • ∡ p₁ p₂ p₄ = (2 : ℤ) • ∡ p₁ p₃ p₄) (hn : ¬Collinear ℝ ({p₁, p₂, p₄} : Set P)) :
    Cospherical ({p₁, p₂, p₃, p₄} : Set P)

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

EuclideanGeometry.Cospherical {p₁, p₂, p₃, p₄}


@[simp] lemma lxor_eq_xor (p q : Num) : p.lxor q = p ^^^ q


@[simp] lemma _root_.EReal.expOrderIso_symm : expOrderIso.symm = logOrderIso


/-- A relabelling lets us prove equivalence of games. -/
theorem equiv (r : x ≡r y) : x ≈ y

{x y : SetTheory.PGame}
(r : x.Relabelling y)


theorem skolem {α : Sort u} {b : α → Sort v} {p : ∀ x, b x → Prop} : (∀ x, ∃ y, p x y) ↔ ∃ (f : ∀ x, b x), ∀ x, p x (f x)

{α : Sort u}
{b : α → Sort v}
{p : (x : α) → b x → Prop}

(∀ (x : α), ∃ y, p x y) ↔ ∃ f, ∀ (x : α), p x (f x)


lemma mono (hS : BooleanGenerators S) {T : Set α} (hTS : T ⊆ S) : BooleanGenerators T

(hS : IsCompactlyGenerated.BooleanGenerators S)


theorem OrderIso.complementedLattice_iff (f : α ≃o β) :
    ComplementedLattice α ↔ ComplementedLattice β

{α : Type u_2}
{β : Type u_3}
[Lattice α]
[Lattice β]
[BoundedOrder α]
[BoundedOrder β]
(f : α ≃o β)


/-- Finite sums of analytic functions are analytic -/
theorem Finset.analyticOn_sum {f : α → E → F} {s : Set E}
    (N : Finset α) (h : ∀ n ∈ N, AnalyticOn 𝕜 (f n) s) :
    AnalyticOn 𝕜 (fun z ↦ ∑ n ∈ N, f n z) s

{α : Type u_1}
{𝕜 : Type u_2}
[NontriviallyNormedField 𝕜]
{E : Type u_3}
{F : Type u_4}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : α → E → F}
{s : Set E}
(N : Finset α)
(h : ∀ n ∈ N, AnalyticOn 𝕜 (f n) s)

AnalyticOn 𝕜 (fun z => ∑ n ∈ N, f n z) s


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

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

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


@[simp] lemma dens_cons (h : a ∉ s) : (s.cons a h).dens = dens s + (Fintype.card α : ℚ≥0)⁻¹

{α : Type u_2}
[Fintype α]
{s : Finset α}
{a : α}
(h : a ∉ s)

(Finset.cons a s h).dens = s.dens + (↑(Fintype.card α))⁻¹


theorem IsPrimitive.ne_zero [Nontrivial R] {p : R[X]} (hp : p.IsPrimitive) : p ≠ 0

{R : Type u_1}
[CommSemiring R]
[Nontrivial R]
{p : Polynomial R}
(hp : p.IsPrimitive)


@[to_additive pi_nnnorm_const_le]
lemma pi_nnnorm_const_le' (a : E) : ‖fun _ : ι => a‖₊ ≤ ‖a‖₊

{ι : Type u_1}
{E : Type u_2}
[Fintype ι]
[SeminormedGroup E]
(a : E)


@[simp]
theorem mul_antipode_lTensor_comul_apply (a : A) :
    LinearMap.mul' R A (antipode.lTensor A (Coalgebra.comul a)) =
    algebraMap R A (Coalgebra.counit a)

{R : Type u}
{A : Type v}
[CommSemiring R]
[Semiring A]
[HopfAlgebra R A]
(a : A)

(LinearMap.mul' R A) ((LinearMap.lTensor A HopfAlgebra.antipode) (Coalgebra.comul a)) =
  (algebraMap R A) (Coalgebra.counit a)


protected lemma IsLittleO.sqrt (hfg : f =o[l] g) (hg : 0 ≤ᶠ[l] g) :
    (Real.sqrt <| f ·) =o[l] (Real.sqrt <| g ·)

{α : Type u_1}
{l : Filter α}
{f g : α → ℝ}
(hfg : f =o[l] g)
(hg : 0 ≤ᶠ[l] g)


theorem min_le_of_le (l : List α) (a : α) {x : α} (hx : x ∈ l) (h : x ≤ a) : l.foldr min ⊤ ≤ a

{α : Type u_1}
[LinearOrder α]
[OrderTop α]
(l : List α)
(a : α)
{x : α}
(hx : x ∈ l)
(h : x ≤ a)


theorem erase_mem_shadow (hs : s ∈ 𝒜) (ha : a ∈ s) : erase s a ∈ ∂ 𝒜

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


theorem setToL1S_add_left (T T' : Set α → E →L[ℝ] F) (f : α →₁ₛ[μ] E) :
    setToL1S (T + T') f = setToL1S T f + setToL1S T' f

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

MeasureTheory.L1.SimpleFunc.setToL1S (T + T') f =
  MeasureTheory.L1.SimpleFunc.setToL1S T f + MeasureTheory.L1.SimpleFunc.setToL1S T' f


@[simp]
theorem nnrealPart_coeFn_eq (f : α →ᵇ ℝ) : ⇑f.nnrealPart = Real.toNNReal ∘ ⇑f

{α : Type u}
[TopologicalSpace α]
(f : BoundedContinuousFunction α ℝ)


/-- If `K` is a `p ^ k`-th cyclotomic extension of `ℚ`, then `(adjoin ℤ {ζ})` is the
integral closure of `ℤ` in `K`. -/
theorem isIntegralClosure_adjoin_singleton_of_prime_pow [hcycl : IsCyclotomicExtension {p ^ k} ℚ K]
    (hζ : IsPrimitiveRoot ζ ↑(p ^ k)) : IsIntegralClosure (adjoin ℤ ({ζ} : Set K)) ℤ K

IsIntegralClosure ↥(Algebra.adjoin ℤ {ζ}) ℤ K


/-- If a function `f` with a densely ordered codomain is monotone on a right neighborhood of `a` and
the image of this neighborhood under `f` is a right neighborhood of `f a`, then `f` is continuous at
`a` from the right. -/
theorem continuousWithinAt_right_of_monotoneOn_of_image_mem_nhdsWithin [DenselyOrdered β]
    {f : α → β} {s : Set α} {a : α} (h_mono : MonotoneOn f s) (hs : s ∈ 𝓝[≥] a)
    (hfs : f '' s ∈ 𝓝[≥] f a) : ContinuousWithinAt f (Ici a) a

{α : Type u_1}
{β : Type u_2}
[LinearOrder α]
[TopologicalSpace α]
[OrderTopology α]
[LinearOrder β]
[TopologicalSpace β]
[OrderTopology β]
[DenselyOrdered β]
{f : α → β}
{s : Set α}
{a : α}
(h_mono : MonotoneOn f s)
(hs : s ∈ 𝓝[≥] a)
(hfs : f '' s ∈ 𝓝[≥] f a)


@[elab_as_elim]
protected theorem induction {α : Type*} {p : Finset α → Prop} [DecidableEq α] (empty : p ∅)
    (insert : ∀ ⦃a : α⦄ {s : Finset α}, a ∉ s → p s → p (insert a s)) : ∀ s, p s


theorem setOf_subset_eq_univ_iff (S : L[[α]].Theory) :
    { p : T.CompleteType α | S ⊆ ↑p } = Set.univ ↔
      ∀ φ, φ ∈ S → (L.lhomWithConstants α).onTheory T ⊨ᵇ φ

{L : FirstOrder.Language}
{T : L.Theory}
{α : Type w}
(S : L[[α]].Theory)

{p | S ⊆ ↑p} = Set.univ ↔ ∀ φ ∈ S, (L.lhomWithConstants α).onTheory T ⊨ᵇ φ


theorem Disjoint.sup_left (ha : Disjoint a c) (hb : Disjoint b c) : Disjoint (a ⊔ b) c

{α : Type u_1}
[DistribLattice α]
[OrderBot α]
{a b c : α}
(ha : Disjoint a c)
(hb : Disjoint b c)


/-- A closed interval in a densely ordered conditionally complete linear order is preconnected. -/
theorem isPreconnected_Icc : IsPreconnected (Icc a b)

{α : Type u}
[ConditionallyCompleteLinearOrder α]
[TopologicalSpace α]
[OrderTopology α]
[DenselyOrdered α]
{a b : α}


theorem _root_.Set.Infinite.exists_gt (hs : s.Infinite) : ∀ a, ∃ b ∈ s, a < b

{α : Type u_2}
[LinearOrder α]
[LocallyFiniteOrderBot α]
{s : Set α}
(hs : s.Infinite)
(a : α)


/-- A *circuit* at `u : V` is a nonempty trail beginning and ending at `u`. -/
@[mk_iff isCircuit_def]
structure IsCircuit {u : V} (p : G.Walk u u) extends IsTrail p : Prop where
  ne_nil : p ≠ nil

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

p.IsCircuit ↔ p.IsTrail ∧ p ≠ SimpleGraph.Walk.nil


@[simp, elementwise]
theorem kernelIsoKer_hom_ker_subtype :
    -- Porting note (#11036): broken dot notation
    (kernelIsoKer f).hom ≫ (LinearMap.ker f).subtype = kernel.ι f

{R : Type u}
[Ring R]
{G H : ModuleCat R}
(f : G ⟶ H)

(ModuleCat.kernelIsoKer f).hom ≫ (LinearMap.ker f).subtype = CategoryTheory.Limits.kernel.ι f


theorem continuous_sum_dom {f : X ⊕ Y → Z} :
    Continuous f ↔ Continuous (f ∘ Sum.inl) ∧ Continuous (f ∘ Sum.inr)

{X : Type u}
{Y : Type v}
{Z : Type u_1}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
{f : X ⊕ Y → Z}


@[deprecated (since := "2024-06-05")]
theorem tailing_le_tunnel (f : M × N →ₗ[R] M) (i : Injective f) (n : ℕ) :
    tailing f i n ≤ OrderDual.ofDual (α := Submodule R M) (tunnel f i n)

{R : Type u}
{M : Type v}
[Ring R]
{N : Type u_3}
[AddCommGroup M]
[Module R M]
[AddCommGroup N]
[Module R N]
(f : M × N →ₗ[R] M)
(i : Function.Injective ⇑f)
(n : ℕ)

f.tailing i n ≤ OrderDual.ofDual ((f.tunnel i) n)


theorem ext (d : Dioph S) (H : ∀ v, v ∈ S ↔ v ∈ S') : Dioph S'

{α : Type u}
{S S' : Set (α → ℕ)}
(d : Dioph S)
(H : ∀ (v : α → ℕ), v ∈ S ↔ v ∈ S')


lemma contractible_mem_essImageDistTriang [EssSurj L] [HasZeroObject D]
    [HasZeroMorphisms D] [L.PreservesZeroMorphisms] (X : D) :
    contractibleTriangle X ∈ L.essImageDistTriang

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

CategoryTheory.Pretriangulated.contractibleTriangle X ∈ L.essImageDistTriang


/-- Fundamental theorem of calculus: if `f : ℝ → E` is integrable on `a..b` and `f x` has a finite
limit `c` almost surely as `x` tends to `b` from the right or from the left, then the right
(resp., left) derivative of `u ↦ ∫ x in a..u, f x` at `b` equals `c`. -/
theorem derivWithin_integral_of_tendsto_ae_right (hf : IntervalIntegrable f volume a b)
    {s t : Set ℝ} [FTCFilter b (𝓝[s] b) (𝓝[t] b)] (hmeas : StronglyMeasurableAtFilter f (𝓝[t] b))
    (hb : Tendsto f (𝓝[t] b ⊓ ae volume) (𝓝 c))
    (hs : UniqueDiffWithinAt ℝ s b := by uniqueDiffWithinAt_Ici_Iic_univ) :
    derivWithin (fun u => ∫ x in a..u, f x) s b = c

(hf : IntervalIntegrable f MeasureTheory.volume a b)

[intervalIntegral.FTCFilter b (𝓝[s] b) (𝓝[t] b)]

(hmeas : StronglyMeasurableAtFilter f (𝓝[t] b) MeasureTheory.volume)

(hb : Filter.Tendsto f (𝓝[t] b ⊓ MeasureTheory.ae MeasureTheory.volume) (𝓝 c))

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


lemma findGreatest_eq_iff :
    Nat.findGreatest P k = m ↔ m ≤ k ∧ (m ≠ 0 → P m) ∧ ∀ ⦃n⦄, m < n → n ≤ k → ¬P n

{m k : ℕ}
{P : ℕ → Prop}
[DecidablePred P]

Nat.findGreatest P k = m ↔ m ≤ k ∧ (m ≠ 0 → P m) ∧ ∀ ⦃n : ℕ⦄, m < n → n ≤ k → ¬P n


theorem nhdsWithin_sUnion {S : Set (Set α)} (hS : S.Finite) (a : α) :
    𝓝[⋃₀ S] a = ⨆ s ∈ S, 𝓝[s] a

{α : Type u_1}
[TopologicalSpace α]
{S : Set (Set α)}
(hS : S.Finite)
(a : α)


/-- The natural `ContinuousLinearEquiv` from `ℂ` to `ℝ × ℝ`. -/
@[simps! (config := { simpRhs := true }) apply symm_apply_re symm_apply_im]
def equivRealProdCLM : ℂ ≃L[ℝ] ℝ × ℝ

∀ (a : ℝ × ℝ), (Complex.equivRealProdCLM.symm a).re = a.1


/-- `mulEquivAut` as an isomorphism between automorphism groups. -/
@[simps!]
noncomputable def autMulEquivOfFullyFaithful (X : C) :
    Aut X ≃* Aut (f.obj X)

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{D : Type u'}
[CategoryTheory.Category.{v', u'} D]
{f : CategoryTheory.Functor C D}
(hf : f.FullyFaithful)
(X : C)
(e : f.obj X ≅ f.obj X)

((hf.autMulEquivOfFullyFaithful X).symm e).inv = hf.preimage e.inv


theorem equivalence_inverse : (equivalence : SimplicialObject C ≌ _).inverse = Γ


@[simp, nolint simpNF] -- Added `nolint simpNF` to avoid a timeout #8386
theorem aux_mul (x y : even Q) : aux f (x * y) = aux f x * aux f y

{R : Type uR}
{M : Type uM}
[CommRing R]
[AddCommGroup M]
[Module R M]
{Q : QuadraticForm R M}
{A : Type uA}
[Ring A]
[Algebra R A]
(f : CliffordAlgebra.EvenHom Q A)
(x y : ↥(CliffordAlgebra.even Q))

(CliffordAlgebra.even.lift.aux f) (x * y) = (CliffordAlgebra.even.lift.aux f) x * (CliffordAlgebra.even.lift.aux f) y


@[simp]
theorem mul_self_pos [ExistsAddOfLE α] [PosMulStrictMono α] [MulPosStrictMono α]
    [CovariantClass α α (· + ·) (· < ·)] [ContravariantClass α α (· + ·) (· < ·)]
    {a : α} : 0 < a * a ↔ a ≠ 0

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

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


protected theorem stronglyMeasurable (hf : Martingale f ℱ μ) (i : ι) :
    StronglyMeasurable[ℱ i] (f i)

{Ω : Type u_1}
{E : Type u_2}
{ι : Type u_3}
[Preorder ι]
{m0 : MeasurableSpace Ω}
{μ : MeasureTheory.Measure Ω}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[CompleteSpace E]
{f : ι → Ω → E}
{ℱ : MeasureTheory.Filtration ι m0}
(hf : MeasureTheory.Martingale f ℱ μ)
(i : ι)


theorem zigzag_symmetric : Symmetric (@Zigzag J _)

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


/-- Definition of `≤` for congruence relations. -/
@[to_additive "Definition of `≤` for additive congruence relations."]
theorem le_def {c d : Con M} : c ≤ d ↔ ∀ {x y}, c x y → d x y


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

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

ContinuousOn (fun a => s.inf fun x => f x a) t


/-- If `t` is a non-empty open subset of `H`,
  every chart of `t` is the restriction of some chart on `H`. -/
-- XXX: can I unify this with `chart_eq`?
lemma chart_eq' {t : Opens H} (ht : Nonempty t) {e' : PartialHomeomorph t H}
    (he' : e' ∈ atlas H t) : ∃ x : t, e' = (chartAt H ↑x).subtypeRestr ht

{H : Type u}
[TopologicalSpace H]
{t : TopologicalSpace.Opens H}
(ht : Nonempty ↥t)
{e' : PartialHomeomorph (↥t) H}
(he' : e' ∈ atlas H ↥t)

∃ x, e' = (chartAt H ↑x).subtypeRestr ht


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


@[simp]
theorem isDiag_neg_iff [AddGroup α] {A : Matrix n n α} : (-A).IsDiag ↔ A.IsDiag

{α : Type u_1}
{n : Type u_4}
[AddGroup α]
{A : Matrix n n α}


theorem IsOpenMap.sum_elim {f : X → Z} {g : Y → Z} (hf : IsOpenMap f) (hg : IsOpenMap g) :
    IsOpenMap (Sum.elim f g)

{X : Type u}
{Y : Type v}
{Z : Type u_1}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
{f : X → Z}
{g : Y → Z}
(hf : IsOpenMap f)
(hg : IsOpenMap g)


@[simps (config := .lemmasOnly)]
instance instMonoidalCategoryStruct : MonoidalCategoryStruct (ModuleCat.{u} R)


theorem inter_le_left (s t : Multiset α) : s ∩ t ≤ s

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


theorem balanceR_eq_balance' {l x r} (hl : Balanced l) (hr : Balanced r) (sl : Sized l)
    (sr : Sized r)
    (H : (∃ l', Raised (size l) l' ∧ BalancedSz l' (size r)) ∨
        ∃ r', Raised r' (size r) ∧ BalancedSz (size l) r') :
    @balanceR α l x r = balance' l x r

(H :
  (∃ l', Ordnode.Raised l.size l' ∧ Ordnode.BalancedSz l' r.size) ∨
    ∃ r', Ordnode.Raised r' r.size ∧ Ordnode.BalancedSz l.size r')


theorem one_eq_span : (1 : Submodule R A) = R ∙ 1

{R : Type u}
[CommSemiring R]
{A : Type v}
[Semiring A]
[Algebra R A]


theorem lt_ord_of_lt {l m : Products I} {o : Ordinal} (h₁ : m < l)
    (h₂ : ∀ i ∈ l.val, ord I i < o) : ∀ i ∈ m.val, ord I i < o

{l m : Profinite.NobelingProof.Products I}

(h₂ : ∀ i ∈ ↑l, Profinite.NobelingProof.ord I i < o)

i ∈ ↑m → Profinite.NobelingProof.ord I i < o


/-- Injectivity of the underlying `algebraMap` descends to the algebra induced by localization. -/
theorem localizationAlgebra_injective (hRS : Function.Injective (algebraMap R S)) :
    Function.Injective (@algebraMap Rₘ Sₘ _ _ (localizationAlgebra M S))

[i : IsLocalization (Algebra.algebraMapSubmonoid S M) Sₘ]

(hRS : Function.Injective ⇑(algebraMap R S))


@[to_additive]
theorem coe_comp_orderHom (f : β →*o γ) (g : α →*o β) :
    (f.comp g : α →o γ) = (f : β →o γ).comp g

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[Preorder α]
[Preorder β]
[Preorder γ]
[MulOneClass α]
[MulOneClass β]
[MulOneClass γ]
(f : β →*o γ)
(g : α →*o β)


@[to_additive]
theorem ne_one_of_norm_ne_zero : ‖a‖ ≠ 0 → a ≠ 1

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

‖a‖ ≠ 0 → a ≠ 0


lemma isLocallyInjective_iff_nhds {f : X → Y} :
    IsLocallyInjective f ↔ ∀ x : X, ∃ U ∈ 𝓝 x, U.InjOn f

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

IsLocallyInjective f ↔ ∀ (x : X), ∃ U ∈ 𝓝 x, Set.InjOn f U


@[simp]
theorem ret_bind (a) (f : α → Computation β) : bind (pure a) f = f a

{α : Type u}
{β : Type v}
(a : α)
(f : α → Computation β)


theorem isJacobson_MvPolynomial_fin {R : Type u} [CommRing R] [H : IsJacobson R] :
    ∀ n : ℕ, IsJacobson (MvPolynomial (Fin n) R)

{R : Type u}
[CommRing R]
[H : Ideal.IsJacobson R]
(n : ℕ)

Ideal.IsJacobson (MvPolynomial (Fin n) R)


@[simp]
theorem singleton_inter_of_not_mem {a : α} {s : Finset α} (H : a ∉ s) : {a} ∩ s = ∅

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


/-- `pointsWithCircumcenter`, applied to `circumcenterIndex`, equals the
circumcenter. -/
@[simp]
theorem pointsWithCircumcenter_eq_circumcenter {n : ℕ} (s : Simplex ℝ P n) :
    s.pointsWithCircumcenter circumcenterIndex = s.circumcenter

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

s.pointsWithCircumcenter Affine.Simplex.PointsWithCircumcenterIndex.circumcenterIndex = s.circumcenter


/-- A version of `exists_ne_zero_mem_ideal_lt'` for the ring of integers of `K`. -/
theorem exists_ne_zero_mem_ringOfIntegers_lt' (w₀ : {w : InfinitePlace K // IsComplex w})
    (h : minkowskiBound K ↑1 < volume (convexBodyLT' K f w₀)) :
    ∃ a : 𝓞 K, a ≠ 0 ∧ (∀ w : InfinitePlace K, w ≠ w₀ → w a < f w) ∧
      |(w₀.val.embedding a).re| < 1 ∧ |(w₀.val.embedding a).im| < (f w₀ : ℝ) ^ 2

{f : NumberField.InfinitePlace K → NNReal}

(h :
  NumberField.mixedEmbedding.minkowskiBound K 1 <
    MeasureTheory.volume (NumberField.mixedEmbedding.convexBodyLT' K f w₀))

∃ a,
  a ≠ 0 ∧
    (∀ (w : NumberField.InfinitePlace K), w ≠ ↑w₀ → w ↑a < ↑(f w)) ∧
      |((↑w₀).embedding ↑a).re| < 1 ∧ |((↑w₀).embedding ↑a).im| < ↑(f ↑w₀) ^ 2


theorem comp.get_map (f : α ⟹ β) (x : comp P Q α) :
    comp.get (f <$$> x) = (fun i (x : Q i α) => f <$$> x) <$$> comp.get x

{n m : ℕ}
{P : MvPFunctor.{u} n}
{Q : Fin2 n → MvPFunctor.{u} m}
{α β : TypeVec.{u} m}
(f : α ⟹ β)
(x : ↑(P.comp Q) α)

MvPFunctor.comp.get (f <$$> x) = (fun i x => f <$$> x) <$$> MvPFunctor.comp.get x


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

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


@[to_additive]
theorem infinite_not_isOfFinOrder {x : G} (h : ¬IsOfFinOrder x) :
    { y : G | ¬IsOfFinOrder y }.Infinite

{G : Type u_1}
[AddLeftCancelMonoid G]
{x : G}
(h : ¬IsOfFinAddOrder x)


/-- A weak sequence is *productive* if it never stalls forever - there are
 always a finite number of `think`s between `cons` constructors.
 The sequence itself is allowed to be infinite though. -/
class Productive (s : WSeq α) : Prop where
  get?_terminates : ∀ n, (get? s n).Terminates

{α : Type u}
{s : Stream'.WSeq α}
[self : s.Productive]
(n : ℕ)


theorem dvd_iterate_derivative_pow (f : R[X]) (n : ℕ) {m : ℕ} (c : R) (hm : m ≠ 0) :
    (n : R) ∣ eval c (derivative^[m] (f ^ n))

{R : Type u}
[CommSemiring R]
(f : R[X])
(n : ℕ)
{m : ℕ}
(c : R)
(hm : m ≠ 0)

↑n ∣ Polynomial.eval c ((⇑Polynomial.derivative)^[m] (f ^ n))


/-- A real differentiable map `f` is conformal at point `x` if and only if its
    differential `fderiv ℝ f x` at that point scales every inner product by a positive scalar. -/
theorem conformalAt_iff' {f : E → F} {x : E} : ConformalAt f x ↔
    ∃ c : ℝ, 0 < c ∧ ∀ u v : E, ⟪fderiv ℝ f x u, fderiv ℝ f x v⟫ = c * ⟪u, v⟫

{E : Type u_1}
{F : Type u_2}
[NormedAddCommGroup E]
[NormedAddCommGroup F]
[InnerProductSpace ℝ E]
[InnerProductSpace ℝ F]
{f : E → F}
{x : E}

ConformalAt f x ↔ ∃ c, 0 < c ∧ ∀ (u v : E), ⟪(fderiv ℝ f x) u, (fderiv ℝ f x) v⟫_ℝ = c * ⟪u, v⟫_ℝ


@[to_additive (attr := simp)]
theorem snd_comp_swap : snd.comp (swap M N) = fst

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

AddMonoid.Coprod.snd.comp (AddMonoid.Coprod.swap M N) = AddMonoid.Coprod.fst


theorem toFinset_eq {s : Multiset α} (n : Nodup s) : Finset.mk s n = s.toFinset

{α : Type u_1}
[DecidableEq α]
{s : Multiset α}
(n : s.Nodup)


theorem stoppedValue_piecewise_const' {ι' : Type*} {i j : ι'} {f : ι' → Ω → ℝ} :
    stoppedValue f (s.piecewise (fun _ => i) fun _ => j) =
    s.indicator (f i) + sᶜ.indicator (f j)

{Ω : Type u_1}
{s : Set Ω}
[DecidablePred fun x => x ∈ s]
{ι' : Type u_4}
{i j : ι'}
{f : ι' → Ω → ℝ}

MeasureTheory.stoppedValue f (s.piecewise (fun x => i) fun x => j) = s.indicator (f i) + sᶜ.indicator (f j)


/-- A closure operator on the preorder `α` is a monotone function which is extensive (every `x`
is less than its closure) and idempotent. -/
structure ClosureOperator [Preorder α] extends α →o α where
  /-- An element is less than or equal its closure -/
  le_closure' : ∀ x, x ≤ toFun x
  /-- Closures are idempotent -/
  idempotent' : ∀ x, toFun (toFun x) = toFun x
  /-- Predicate for an element to be closed.

  By default, this is defined as `c.IsClosed x := (c x = x)` (see `isClosed_iff`).
  We allow an override to fix definitional equalities. -/
  IsClosed (x : α) : Prop := toFun x = x
  isClosed_iff {x : α} : IsClosed x ↔ toFun x = x := by aesop

{α : Type u_1}
[Preorder α]
(self : ClosureOperator α)
(x : α)


/-- A map `f : α → β` is said to be *quasi measure preserving* (a.k.a. non-singular) w.r.t. measures
`μa` and `μb` if it is measurable and `μb s = 0` implies `μa (f ⁻¹' s) = 0`. -/
structure QuasiMeasurePreserving {m0 : MeasurableSpace α} (f : α → β)
  (μa : Measure α := by volume_tac)
  (μb : Measure β := by volume_tac) : Prop where
  protected measurable : Measurable f
  protected absolutelyContinuous : μa.map f ≪ μb

{μa : autoParam (MeasureTheory.Measure α) _auto✝}

{μb : autoParam (MeasureTheory.Measure β) _auto✝¹}

(self : MeasureTheory.Measure.QuasiMeasurePreserving f μa μb)

(MeasureTheory.Measure.map f μa).AbsolutelyContinuous μb


@[simp]
theorem toMultiset_inf : toMultiset (f ⊓ g) = toMultiset f ∩ toMultiset g

{α : Type u_1}
[DecidableEq α]
(f g : Π₀ (_a : α), ℕ)

DFinsupp.toMultiset (f ⊓ g) = DFinsupp.toMultiset f ∩ DFinsupp.toMultiset g


/-- Division `y ↦ x / y` as an `IsometryEquiv`. -/
@[to_additive (attr := simps! apply symm_apply toEquiv)
  "Subtraction `y ↦ x - y` as an `IsometryEquiv`."]
def divLeft (c : G) : G ≃ᵢ G

{G : Type v}
[AddGroup G]
[PseudoEMetricSpace G]
[IsometricVAdd G G]
[IsometricVAdd Gᵃᵒᵖ G]
(c b : G)


/-- The roots of `cyclotomic' n R` are the primitive `n`-th roots of unity. -/
theorem roots_of_cyclotomic (n : ℕ) (R : Type*) [CommRing R] [IsDomain R] :
    (cyclotomic' n R).roots = (primitiveRoots n R).val

(n : ℕ)
(R : Type u_2)
[CommRing R]
[IsDomain R]

(Polynomial.cyclotomic' n R).roots = (primitiveRoots n R).val


@[simp]
theorem ofPowerSeries_X : ofPowerSeries Γ R PowerSeries.X = single 1 1

{Γ : Type u_1}
{R : Type u_2}
[Semiring R]
[StrictOrderedSemiring Γ]

(HahnSeries.ofPowerSeries Γ R) PowerSeries.X = (HahnSeries.single 1) 1


/-- The unit of the adjunction `condensedSetToTopCat ⊣ topCatToCondensedSet` -/
@[simps val_app val_app_apply]
def topCatAdjunctionUnit (X : CondensedSet.{u}) : X ⟶ X.toTopCat.toCondensedSet

(s : ↑(compHausToTop.obj (Opposite.unop S)))

(X.topCatAdjunctionUnit.val.app S x) s = X.val.map (CompHaus.const (Opposite.unop S) s).op x


theorem Prime.eq_one_of_pow {x n : ℕ} (h : (x ^ n).Prime) : n = 1


theorem cocompact_le_atBot [OrderTop α] [CompactIccSpace α] :
    cocompact α ≤ atBot

{α : Type u_2}
[LinearOrder α]
[TopologicalSpace α]
[OrderTop α]
[CompactIccSpace α]


@[simp] theorem xor_not_left : Xor' (¬a) b ↔ (a ↔ b)


/-- A continuous linear map is zero iff its norm vanishes. -/
theorem opNorm_zero_iff : ‖f‖ = 0 ↔ f = 0

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


@[simp] theorem nil_merge (s : α → α → Bool) (r) : merge s [] r = r

{α : Type u_1}
(s : α → α → Bool)
(r : List α)


/--
Let `(R, m, k)` be a noetherian local domain (possibly a field).
The following are equivalent:
0. `R` is a PID
1. `R` is a valuation ring
2. `R` is a dedekind domain
3. `R` is integrally closed with at most one non-zero prime ideal
4. `m` is principal
5. `dimₖ m/m² ≤ 1`
6. Every nonzero ideal is a power of `m`.

Also see `DiscreteValuationRing.TFAE` for a version assuming `¬ IsField R`.
-/
theorem tfae_of_isNoetherianRing_of_localRing_of_isDomain
    [IsNoetherianRing R] [LocalRing R] [IsDomain R] :
    List.TFAE
      [IsPrincipalIdealRing R, ValuationRing R, IsDedekindDomain R,
        IsIntegrallyClosed R ∧ ∀ P : Ideal R, P ≠ ⊥ → P.IsPrime → P = maximalIdeal R,
        (maximalIdeal R).IsPrincipal,
        finrank (ResidueField R) (CotangentSpace R) ≤ 1,
        ∀ (I) (_ : I ≠ ⊥), ∃ n : ℕ, I = maximalIdeal R ^ n]

(R : Type u_1)
[CommRing R]
[IsNoetherianRing R]
[LocalRing R]
[IsDomain R]

[IsPrincipalIdealRing R, ValuationRing R, IsDedekindDomain R,
    IsIntegrallyClosed R ∧ ∀ (P : Ideal R), P ≠ ⊥ → P.IsPrime → P = LocalRing.maximalIdeal R,
    Submodule.IsPrincipal (LocalRing.maximalIdeal R),
    FiniteDimensional.finrank (LocalRing.ResidueField R) (LocalRing.CotangentSpace R) ≤ 1,
    ∀ (I : Ideal R), I ≠ ⊥ → ∃ n, I = LocalRing.maximalIdeal R ^ n].TFAE


theorem opow_lt_opow_left_of_succ {a b c : Ordinal} (ab : a < b) : a ^ succ c < b ^ succ c


@[to_additive add_const]
theorem StrictAntiOn.mul_const' (hf : StrictAntiOn f s) (c : α) :
    StrictAntiOn (fun x => f x * c) s

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


@[to_additive]
theorem saturated_iff_npow {H : Subgroup G} :
    Saturated H ↔ ∀ (n : ℕ) (g : G), g ^ n ∈ H → n = 0 ∨ g ∈ H

{G : Type u_1}
[AddGroup G]
{H : AddSubgroup G}

H.Saturated ↔ ∀ (n : ℕ) (g : G), n • g ∈ H → n = 0 ∨ g ∈ H


lemma opcyclesMap'_eq : opcyclesMap' φ h₁ h₂ = γ.φQ

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

CategoryTheory.ShortComplex.opcyclesMap' φ h₁ h₂ = γ.φQ


@[simp]
theorem sign_inv (r : ℝ) : sign r⁻¹ = sign r


theorem of_div_int (m : ℤ) (h : Irrational (x / m)) : Irrational x

{x : ℝ}
(m : ℤ)
(h : Irrational (x / ↑m))


/-- Variant of the previous result with the variable expressed as `y` instead of `x + y`. -/
theorem HasFiniteFPowerSeriesOnBall.eq_partialSum'
    (hf : HasFiniteFPowerSeriesOnBall f p x n r) :
    ∀ y ∈ EMetric.ball x r, ∀ m, n ≤ m →
    f y = p.partialSum m (y - x)

y ∈ EMetric.ball x r → ∀ (m : ℕ), n ≤ m → f y = p.partialSum m (y - x)


@[simp]
theorem toReal_eq_neg_pi_div_two_iff {θ : Angle} : θ.toReal = -π / 2 ↔ θ = (-π / 2 : ℝ)


@[ext]
protected theorem funext {F G : L →ᴸ L'} (h_fun : F.onFunction = G.onFunction)
    (h_rel : F.onRelation = G.onRelation) : F = G

{L : FirstOrder.Language}
{L' : FirstOrder.Language}
{F G : L →ᴸ L'}
(h_fun : F.onFunction = G.onFunction)
(h_rel : F.onRelation = G.onRelation)


protected lemma codisjoint_iff {a b : L} :
    Codisjoint a b ↔ Codisjoint (a : α) (b : α)

{α : Type u_1}
[CompleteLattice α]
{L : CompleteSublattice α}
{a b : ↥L}


/-- If `m : ℕ` is coprime with `n`,
then the minimal polynomials of a primitive `n`-th root of unity `μ`
and of `μ ^ m` are the same. -/
theorem minpoly_eq_pow_coprime {m : ℕ} (hcop : Nat.Coprime m n) :
    minpoly ℤ μ = minpoly ℤ (μ ^ m)

{n : ℕ}
{K : Type u_1}
[CommRing K]
{μ : K}
(h : IsPrimitiveRoot μ n)
[IsDomain K]
[CharZero K]
{m : ℕ}
(hcop : m.Coprime n)


@[ext]
lemma hom_ext₂ {f g : ComposableArrows C 2} {φ φ' : f ⟶ g}
    (h₀ : app' φ 0 = app' φ' 0) (h₁ : app' φ 1 = app' φ' 1) (h₂ : app' φ 2 = app' φ' 2) :
    φ = φ'

{f g : CategoryTheory.ComposableArrows C 2}

(h₀ : CategoryTheory.ComposableArrows.app' φ 0 ⋯ = CategoryTheory.ComposableArrows.app' φ' 0 ⋯)

(h₁ : CategoryTheory.ComposableArrows.app' φ 1 ⋯ = CategoryTheory.ComposableArrows.app' φ' 1 ⋯)

(h₂ : CategoryTheory.ComposableArrows.app' φ 2 ⋯ = CategoryTheory.ComposableArrows.app' φ' 2 ⋯)


@[simp]
lemma mk₀_id_comp (α : Ext X Y n) :
    (mk₀ (𝟙 X)).comp α (zero_add n) = α

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Abelian C]
[CategoryTheory.HasExt C]
{X Y : C}
{n : ℕ}
(α : CategoryTheory.Abelian.Ext X Y n)

(CategoryTheory.Abelian.Ext.mk₀ (CategoryTheory.CategoryStruct.id X)).comp α ⋯ = α


@[simp]
theorem cycleRange_succAbove {n : ℕ} (i : Fin (n + 1)) (j : Fin n) :
    i.cycleRange (i.succAbove j) = j.succ


lemma mul_scaleRoots' (p q : R[X]) (r : R) (h : leadingCoeff p * leadingCoeff q ≠ 0) :
    (p * q).scaleRoots r = p.scaleRoots r * q.scaleRoots r

(h : p.leadingCoeff * q.leadingCoeff ≠ 0)


theorem finiteType : Algebra.FiniteType R (AdjoinRoot f)


theorem map_lt_of_translationNumber_lt_int {n : ℤ} (h : τ f < n) (x : ℝ) : f x < x + n

(f : CircleDeg1Lift)
{n : ℤ}
(h : f.translationNumber < ↑n)
(x : ℝ)


/-- `TopologicalSpace.Opens.compl` as an `OrderIso` to the order dual of
`TopologicalSpace.Closeds α`. -/
@[simps]
def Opens.complOrderIso : Opens α ≃o (Closeds α)ᵒᵈ

∀ (a : TopologicalSpace.Opens α),
  (TopologicalSpace.Opens.complOrderIso α) a = (⇑OrderDual.toDual ∘ TopologicalSpace.Opens.compl) a


theorem continuous_of_scottContinuous {α β} [OmegaCompletePartialOrder α]
    [OmegaCompletePartialOrder β] (f : Scott α → Scott β)
    (hf : OmegaCompletePartialOrder.Continuous' f) : Continuous f


theorem stmts₁_trans {q₁ q₂ : Stmt₁} : q₁ ∈ stmts₁ q₂ → stmts₁ q₁ ⊆ stmts₁ q₂

{Γ : Type u_1}
{Λ : Type u_2}
{σ : Type u_3}
{q₁ q₂ : Turing.TM1.Stmt Γ Λ σ}

q₁ ∈ Turing.TM1.stmts₁ q₂ → Turing.TM1.stmts₁ q₁ ⊆ Turing.TM1.stmts₁ q₂


lemma coe_algebraMap_eq_CC : algebraMap R R[X][Y] = CC (R := R)


@[to_additive (attr := simp, to_additive) (reorder := 1 2, 4 5) toLex_smul]
theorem toLex_pow [Pow α β] (a : α) (b : β) : toLex (a ^ b) = toLex a ^ b

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


@[simp]
theorem cancel_left {g : β →+* γ} {f₁ f₂ : α →+* β} (hg : Injective g) :
    g.comp f₁ = g.comp f₂ ↔ f₁ = f₂

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

∀ {x : NonAssocSemiring α} {x_1 : NonAssocSemiring β} {x_2 : NonAssocSemiring γ} {g : β →+* γ} {f₁ f₂ : α →+* β},
  Function.Injective ⇑g → (g.comp f₁ = g.comp f₂ ↔ f₁ = f₂)


theorem option_iget [Inhabited α] : Primrec (@Option.iget α _)

{α : Type u_1}
[Primcodable α]
[Inhabited α]


theorem mem_jacobson_bot {x : R} : x ∈ jacobson (⊥ : Ideal R) ↔ ∀ y, IsUnit (x * y + 1)

x ∈ ⊥.jacobson ↔ ∀ (y : R), IsUnit (x * y + 1)


@[simp] lemma le_killingCompl_top_of_isLieAbelian [IsLieAbelian I] :
    I ≤ LieIdeal.killingCompl R L ⊤

(R : Type u_1)
(L : Type u_3)
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[Module.Free R L]
[Module.Finite R L]
(I : LieIdeal R L)
[IsDomain R]
[IsPrincipalIdealRing R]
[IsLieAbelian ↥↑I]


/-- The preimage of a set `s` under a continuous linear map `f` with nonzero determinant has measure
equal to `μ s` times the absolute value of the inverse of the determinant of `f`. -/
@[simp]
theorem addHaar_preimage_continuousLinearMap {f : E →L[ℝ] E}
    (hf : LinearMap.det (f : E →ₗ[ℝ] E) ≠ 0) (s : Set E) :
    μ (f ⁻¹' s) = ENNReal.ofReal (abs (LinearMap.det (f : E →ₗ[ℝ] E))⁻¹) * μ s

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[MeasurableSpace E]
[BorelSpace E]
[FiniteDimensional ℝ E]
(μ : MeasureTheory.Measure E)
[μ.IsAddHaarMeasure]
{f : E →L[ℝ] E}
(hf : LinearMap.det ↑f ≠ 0)
(s : Set E)

μ (⇑f ⁻¹' s) = ENNReal.ofReal |(LinearMap.det ↑f)⁻¹| * μ s


protected theorem encode : Computable (@encode α _)


theorem monomial_add_single : monomial (s + Finsupp.single n e) a = monomial s a * X n ^ e

{R : Type u}
{σ : Type u_1}
{a : R}
{e : ℕ}
{n : σ}
{s : σ →₀ ℕ}
[CommSemiring R]

(MvPolynomial.monomial (s + Finsupp.single n e)) a = (MvPolynomial.monomial s) a * MvPolynomial.X n ^ e


/-- The rays given by two nonzero vectors are equal if and only if those vectors
satisfy `SameRay`. -/
theorem ray_eq_iff {v₁ v₂ : M} (hv₁ : v₁ ≠ 0) (hv₂ : v₂ ≠ 0) :
    rayOfNeZero R _ hv₁ = rayOfNeZero R _ hv₂ ↔ SameRay R v₁ v₂

{R : Type u_1}
[StrictOrderedCommSemiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
{v₁ v₂ : M}
(hv₁ : v₁ ≠ 0)
(hv₂ : v₂ ≠ 0)

rayOfNeZero R v₁ hv₁ = rayOfNeZero R v₂ hv₂ ↔ SameRay R v₁ v₂


theorem whiskeringLeft_obj_preimage_app {F G : Karoubi C ⥤ D}
    (τ : toKaroubi _ ⋙ F ⟶ toKaroubi _ ⋙ G) (P : Karoubi C) :
    (((whiskeringLeft _ _ _).obj (toKaroubi _)).preimage τ).app P =
      F.map P.decompId_i ≫ τ.app P.X ≫ G.map P.decompId_p

{F G : CategoryTheory.Functor (CategoryTheory.Idempotents.Karoubi C) D}

(τ : (CategoryTheory.Idempotents.toKaroubi C).comp F ⟶ (CategoryTheory.Idempotents.toKaroubi C).comp G)

(P : CategoryTheory.Idempotents.Karoubi C)

(((CategoryTheory.whiskeringLeft C (CategoryTheory.Idempotents.Karoubi C) D).obj
            (CategoryTheory.Idempotents.toKaroubi C)).preimage
        τ).app
    P =
  CategoryTheory.CategoryStruct.comp (F.map P.decompId_i)
    (CategoryTheory.CategoryStruct.comp (τ.app P.X) (G.map P.decompId_p))


@[to_additive]
theorem isComplement_univ_singleton {g : G} : IsComplement (univ : Set G) {g}


theorem le_gauge_of_subset_closedBall (hs : Absorbent ℝ s) (hr : 0 ≤ r) (hsr : s ⊆ closedBall 0 r) :
    ‖x‖ / r ≤ gauge s x

{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{s : Set E}
{r : ℝ}
{x : E}
(hs : Absorbent ℝ s)
(hr : 0 ≤ r)
(hsr : s ⊆ Metric.closedBall 0 r)


@[simp] theorem trunc_trunc_mul {n} (f g : R ⟦X⟧) :
    trunc n ((trunc n f) * g : R⟦X⟧) = trunc n (f * g)

{R : Type u_2}
[CommSemiring R]
{n : ℕ}
(f g : PowerSeries R)

PowerSeries.trunc n (↑(PowerSeries.trunc n f) * g) = PowerSeries.trunc n (f * g)


theorem balancedCoreAux_subset (s : Set E) : balancedCoreAux 𝕜 s ⊆ s

{𝕜 : Type u_1}
{E : Type u_2}
[NormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
(s : Set E)


@[to_additive] theorem embedding_mk_symm : Embedding (@mk M).symm


theorem nsmul_comp (n : ℕ) : (n • f) ≫ g = n • f ≫ g

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Preadditive C]
{P Q R : C}
(f : P ⟶ Q)
(g : Q ⟶ R)
(n : ℕ)


lemma isEquivalence_left_of_isEquivalence_right (h : L ⊣ R) [R.IsEquivalence] : L.IsEquivalence

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{L : C ⥤ D}
{R : D ⥤ C}
(h : L ⊣ R)
[R.IsEquivalence]


@[to_additive]
theorem CancelCommMonoid.toCommMonoid_injective {M : Type u} :
    Function.Injective (@CancelCommMonoid.toCommMonoid M)


@[to_additive]
theorem map_mrange (g : N →* P) (f : M →* N) : f.mrange.map g = mrange (comp g f)

{M : Type u_1}
{N : Type u_2}
{P : Type u_3}
[MulOneClass M]
[MulOneClass N]
[MulOneClass P]
(g : N →* P)
(f : M →* N)

Submonoid.map g (MonoidHom.mrange f) = MonoidHom.mrange (g.comp f)


@[simp]
theorem erase_zero (a : α) : (0 : Multiset α).erase a = 0


@[simp]
theorem range_cos : range cos = (Icc (-1) 1 : Set ℝ)


/-- This is a special case of `tsub_le_iff_right`, which should be used instead of this.
  This is needed to prove `OrderedSub (Multiset α)`. -/
protected theorem sub_le_iff_le_add : s - t ≤ u ↔ s ≤ u + t

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


@[to_additive]
theorem singleton_mul_mem_nhds (a : α) {b : α} (h : s ∈ 𝓝 b) : {a} * s ∈ 𝓝 (a * b)

{α : Type u}
[TopologicalSpace α]
[Group α]
[ContinuousConstSMul α α]
{s : Set α}
(a : α)
{b : α}
(h : s ∈ 𝓝 b)


theorem le_comap_primeCompl_iff {J : Ideal P} [hJ : J.IsPrime] {f : R →+* P} :
    I.primeCompl ≤ J.primeCompl.comap f ↔ J.comap f ≤ I

{R : Type u_1}
[CommSemiring R]
{P : Type u_3}
[CommSemiring P]
{I : Ideal R}
[hI : I.IsPrime]
{J : Ideal P}
[hJ : J.IsPrime]
{f : R →+* P}

I.primeCompl ≤ Submonoid.comap f J.primeCompl ↔ Ideal.comap f J ≤ I


@[simp]
theorem monovaryOn_id_iff : MonovaryOn f id s ↔ MonotoneOn f s

{ι : Type u_1}
{α : Type u_3}
[Preorder α]
{f : ι → α}
{s : Set ι}
[PartialOrder ι]


@[simp]
theorem add_eq_top : a + b = ⊤ ↔ a = ⊤ ∨ b = ⊤


@[to_additive (attr := simp)]
theorem smul_univ [Fintype β] {s : Finset α} (hs : s.Nonempty) : s • (univ : Finset β) = univ

{α : Type u_2}
{β : Type u_3}
[DecidableEq β]
[Group α]
[MulAction α β]
[Fintype β]
{s : Finset α}
(hs : s.Nonempty)


@[simp, norm_cast] theorem coe_eq_zero : (↑r : ℝ≥0∞) = 0 ↔ r = 0


@[to_additive]
theorem measurePreserving_mul_right (μ : Measure G) [IsMulRightInvariant μ] (g : G) :
    MeasurePreserving (· * g) μ μ

{G : Type u_2}
[MeasurableSpace G]
[Add G]
[MeasurableAdd G]
(μ : MeasureTheory.Measure G)
[μ.IsAddRightInvariant]
(g : G)

MeasureTheory.MeasurePreserving (fun x => x + g) μ μ


theorem IsBoundedUnder.bddBelow_range [Preorder β] [IsDirected β (· ≥ ·)] {f : ℕ → β}
    (hf : IsBoundedUnder (· ≥ ·) atTop f) : BddBelow (range f)

(hf : Filter.IsBoundedUnder (fun x x_1 => x ≥ x_1) Filter.atTop f)


theorem exists_finset_support (x : FreeCommRing α) : ∃ s : Finset α, IsSupported x ↑s


/-- A theorem by Vasconcelos, given a finite module `M` over a commutative ring, any
surjective endomorphism of `M` is also injective.
It is a consequence of the fact `CommRing.orzechProperty`
that any commutative ring `R` satisfies the `OrzechProperty`;
please use `OrzechProperty.injective_of_surjective_endomorphism` instead.
This is similar to `IsNoetherian.injective_of_surjective_endomorphism` but only applies in the
commutative case, but does not use a Noetherian hypothesis. -/
@[deprecated OrzechProperty.injective_of_surjective_endomorphism (since := "2024-05-30")]
theorem Module.Finite.injective_of_surjective_endomorphism {R : Type*} [CommRing R] {M : Type*}
    [AddCommGroup M] [Module R M] [Finite R M] (f : M →ₗ[R] M)
    (f_surj : Function.Surjective f) : Function.Injective f

{R : Type u_1}
[CommRing R]
{M : Type u_2}
[AddCommGroup M]
[Module R M]
[Module.Finite R M]
(f : M →ₗ[R] M)
(f_surj : Function.Surjective ⇑f)


theorem _root_.Monotone.iUnion_nat_add {f : ℕ → Set α} (hf : Monotone f) (k : ℕ) :
    ⋃ n, f (n + k) = ⋃ n, f n

{α : Type u_1}
{f : ℕ → Set α}
(hf : Monotone f)
(k : ℕ)


/-- There are `⌈b / r⌉ - ⌈a / r⌉` multiples of `r` in `[a, b)`, if `a ≤ b`. -/
theorem Ico_filter_dvd_card : ((Ico a b).filter (r ∣ ·)).card =
    max (⌈b / (r : ℚ)⌉ - ⌈a / (r : ℚ)⌉) 0

↑(Finset.filter (fun x => r ∣ x) (Finset.Ico a b)).card = max (⌈↑b / ↑r⌉ - ⌈↑a / ↑r⌉) 0


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

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

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


theorem comp_mul_left (hf : IntervalIntegrable f volume a b) (c : ℝ) :
    IntervalIntegrable (fun x => f (c * x)) volume (a / c) (b / c)

(hf : IntervalIntegrable f MeasureTheory.volume a b)

IntervalIntegrable (fun x => f (c * x)) MeasureTheory.volume (a / c) (b / c)


/-- A linear isometry preserves the property of being orthonormal. -/
theorem Orthonormal.comp_linearIsometry {v : ι → E} (hv : Orthonormal 𝕜 v) (f : E →ₗᵢ[𝕜] E') :
    Orthonormal 𝕜 (f ∘ v)

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{ι : Type u_4}
{E' : Type u_7}
[NormedAddCommGroup E']
[InnerProductSpace 𝕜 E']
{v : ι → E}
(hv : Orthonormal 𝕜 v)
(f : E →ₗᵢ[𝕜] E')


lemma Pi.map'_comp_map' {f : α → C} {g : β → C} {h : γ → C} [HasProduct f] [HasProduct g]
    [HasProduct h] (p : β → α) (p' : γ → β) (q : ∀ (b : β), f (p b) ⟶ g b)
    (q' : ∀ (c : γ), g (p' c) ⟶ h c) :
    Pi.map' p q ≫ Pi.map' p' q' = Pi.map' (p ∘ p') (fun c => q (p' c) ≫ q' c)

{β : Type w}
{α : Type w₂}
{γ : Type w₃}
{C : Type u}
[CategoryTheory.Category.{v, u} C]
{f : α → C}
{g : β → C}
{h : γ → C}
[CategoryTheory.Limits.HasProduct f]
[CategoryTheory.Limits.HasProduct g]
[CategoryTheory.Limits.HasProduct h]
(p : β → α)
(p' : γ → β)
(q : (b : β) → f (p b) ⟶ g b)
(q' : (c : γ) → g (p' c) ⟶ h c)

CategoryTheory.Limits.Pi.map' p q ≫ CategoryTheory.Limits.Pi.map' p' q' =
  CategoryTheory.Limits.Pi.map' (p ∘ p') fun c => q (p' c) ≫ q' c


theorem contDiff_norm_rpow {p : ℝ} (hp : 1 < p) : ContDiff ℝ 1 (fun x : E ↦ ‖x‖ ^ p)

{E : Type u_1}
[NormedAddCommGroup E]
[InnerProductSpace ℝ E]
{p : ℝ}
(hp : 1 < p)


theorem Sbtw.dist_lt_max_dist (p : P) {p₁ p₂ p₃ : P} (h : Sbtw ℝ p₁ p₂ p₃) :
    dist p₂ p < max (dist p₁ p) (dist p₃ p)

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


theorem card_infs_le : (s ⊼ t).card ≤ s.card * t.card

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


@[fun_prop]
protected theorem DifferentiableWithinAt.iterate {f : E → E} (hf : DifferentiableWithinAt 𝕜 f s x)
    (hx : f x = x) (hs : MapsTo f s s) (n : ℕ) : DifferentiableWithinAt 𝕜 f^[n] s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{x : E}
{s : Set E}
{f : E → E}
(hf : DifferentiableWithinAt 𝕜 f s x)
(hx : f x = x)
(hs : Set.MapsTo f s s)
(n : ℕ)


/-- A submodule `S` is a core of `f` if the closure of the restriction of `f` to `S` is `f`. -/
structure HasCore (f : E →ₗ.[R] F) (S : Submodule R E) : Prop where
  le_domain : S ≤ f.domain
  closure_eq : (f.domRestrict S).closure = f

{R : Type u_1}
{E : Type u_2}
{F : Type u_3}
[CommRing R]
[AddCommGroup E]
[AddCommGroup F]
[Module R E]
[Module R F]
[TopologicalSpace E]
[TopologicalSpace F]
[ContinuousAdd E]
[ContinuousAdd F]
[TopologicalSpace R]
[ContinuousSMul R E]
[ContinuousSMul R F]
{f : E →ₗ.[R] F}
{S : Submodule R E}
(self : f.HasCore S)


@[simp]
theorem bodd_subNatNat (m n : ℕ) : bodd (subNatNat m n) = xor m.bodd n.bodd

(Int.subNatNat m n).bodd = xor m.bodd n.bodd


theorem toEquiv_injective : Injective (toEquiv : (P₁ ≃ᵃ[k] P₂) → P₁ ≃ P₂)

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


/-- An open null set w.r.t. an `IsOpenPosMeasure` is empty. -/
theorem _root_.IsOpen.eq_empty_of_measure_zero (hU : IsOpen U) (h₀ : μ U = 0) : U = ∅

{X : Type u_1}
[TopologicalSpace X]
{m : MeasurableSpace X}
{μ : MeasureTheory.Measure X}
[μ.IsOpenPosMeasure]
{U : Set X}
(hU : IsOpen U)
(h₀ : μ U = 0)


theorem valAux_eq {f : PreTilt K v O hv p} {n : ℕ} (hfn : coeff _ _ n f ≠ 0) :
    valAux K v O hv p f = ModP.preVal K v O hv p (coeff _ _ n f) ^ p ^ n

(hfn : (Perfection.coeff (ModP K v O hv p) p n) f ≠ 0)

PreTilt.valAux K v O hv p f = ModP.preVal K v O hv p ((Perfection.coeff (ModP K v O hv p) p n) f) ^ p ^ n


protected theorem neg_lt_sub_left_of_lt_add {a b c : Int} (h : c < a + b) : -a < b - c


theorem and_twoPow_eq (x : BitVec w) (i : Nat) :
    x &&& (twoPow w i) = if x.getLsb i then twoPow w i else 0#w

x &&& BitVec.twoPow w i = if x.getLsb i = true then BitVec.twoPow w i else 0#w