/-- Given Localization maps `f : M →* N, k : P →* Q` for Submonoids `S, T` respectively, if a
`CommMonoid` homomorphism `g : M →* P` induces a `f.map hy k : N →* Q`, then for all `z : N`,
we have `f.map hy k z * k (g y) = k (g x)` where `x : M, y ∈ S` are such that
`z * f y = f x`. -/
@[to_additive
    "Given Localization maps `f : M →+ N, k : P →+ Q` for Submonoids `S, T` respectively, if an
`AddCommMonoid` homomorphism `g : M →+ P` induces a `f.map hy k : N →+ Q`, then for all `z : N`,
we have `f.map hy k z + k (g y) = k (g x)` where `x : M, y ∈ S` are such that
`z + f y = f x`."]
theorem map_mul_right (z) : f.map hy k z * k.toMap (g (f.sec z).2) = k.toMap (g (f.sec z).1)

{M : Type u_1}
[AddCommMonoid M]
{S : AddSubmonoid M}
{N : Type u_2}
[AddCommMonoid N]
{P : Type u_3}
[AddCommMonoid P]
(f : S.LocalizationMap N)
{g : M →+ P}
{T : AddSubmonoid P}
(hy : ∀ (y : ↥S), g ↑y ∈ T)
{Q : Type u_4}
[AddCommMonoid Q]
{k : T.LocalizationMap Q}
(z : N)

(f.map hy k) z + k.toMap (g ↑(f.sec z).2) = k.toMap (g (f.sec z).1)


theorem not_finiteRk (M : Matroid α) [InfiniteRk M] : ¬ FiniteRk M

{α : Type u_1}
(M : Matroid α)
[M.InfiniteRk]


@[to_additive]
theorem TopologicalGroup.ext {G : Type*} [Group G] {t t' : TopologicalSpace G}
    (tg : @TopologicalGroup G t _) (tg' : @TopologicalGroup G t' _)
    (h : @nhds G t 1 = @nhds G t' 1) : t = t'

{G : Type u_1}
[Group G]
{t t' : TopologicalSpace G}
(tg : TopologicalGroup G)
(tg' : TopologicalGroup G)
(h : 𝓝 1 = 𝓝 1)


@[mono]
theorem monotone_eapprox (f : α → ℝ≥0∞) : Monotone (eapprox f)

{α : Type u_1}
[MeasurableSpace α]
(f : α → ℝ≥0∞)


theorem prodMap_comp (f₁₂ : M →ₗ[R] M₂) (f₂₃ : M₂ →ₗ[R] M₃) (g₁₂ : M₄ →ₗ[R] M₅)
    (g₂₃ : M₅ →ₗ[R] M₆) :
    f₂₃.prodMap g₂₃ ∘ₗ f₁₂.prodMap g₁₂ = (f₂₃ ∘ₗ f₁₂).prodMap (g₂₃ ∘ₗ g₁₂)

{R : Type u}
{M : Type v}
{M₂ : Type w}
{M₃ : Type y}
{M₄ : Type z}
{M₅ : Type u_1}
{M₆ : Type u_2}
[Semiring R]
[AddCommMonoid M]
[AddCommMonoid M₂]
[AddCommMonoid M₃]
[AddCommMonoid M₄]
[AddCommMonoid M₅]
[AddCommMonoid M₆]
[Module R M]
[Module R M₂]
[Module R M₃]
[Module R M₄]
[Module R M₅]
[Module R M₆]
(f₁₂ : M →ₗ[R] M₂)
(f₂₃ : M₂ →ₗ[R] M₃)
(g₁₂ : M₄ →ₗ[R] M₅)
(g₂₃ : M₅ →ₗ[R] M₆)


theorem size_to_nat : ∀ n, (size n : ℕ) = Nat.size n


@[simp] theorem reverse_balance1 (l : RBNode α) (v : α) (r : RBNode α) :
    (balance1 l v r).reverse = balance2 r.reverse v l.reverse

{α : Type u_1}
(l : Batteries.RBNode α)
(v : α)
(r : Batteries.RBNode α)

(l.balance1 v r).reverse = r.reverse.balance2 v l.reverse


theorem ae_of_ae_restrict_of_ae_restrict_compl (t : Set α) {p : α → Prop}
    (ht : ∀ᵐ x ∂μ.restrict t, p x) (htc : ∀ᵐ x ∂μ.restrict tᶜ, p x) : ∀ᵐ x ∂μ, p x

{α : Type u_2}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
(t : Set α)
{p : α → Prop}
(ht : ∀ᵐ (x : α) ∂μ.restrict t, p x)
(htc : ∀ᵐ (x : α) ∂μ.restrict tᶜ, p x)


theorem integrable_of_integrable_trim (hm : m ≤ m0) (hf_int : Integrable f (μ'.trim hm)) :
    Integrable f μ'

(hf_int : MeasureTheory.Integrable f (μ'.trim hm))


@[simp, norm_cast] lemma coe_pow (f : AddMonoid.End A) (n : ℕ) : (↑(f ^ n) : A → A) = f^[n]

(A : Type u_10)
[AddZeroClass A]
(f : AddMonoid.End A)
(n : ℕ)


theorem filter_ne [DecidableEq β] (s : Finset β) (b : β) :
    (s.filter fun a => b ≠ a) = s.erase b

{β : Type u_2}
[DecidableEq β]
(s : Finset β)
(b : β)

Finset.filter (fun a => b ≠ a) s = s.erase b


@[simp]
theorem testAgainstNN_one (μ : FiniteMeasure Ω) : μ.testAgainstNN 1 = μ.mass

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


theorem monomial_zero_one : monomial 0 (1 : R) = 1


@[simp] theorem iota_succ : iota (i+1) = (i+1) :: iota i

List.iota (i + 1) = (i + 1) :: List.iota i


@[to_additive]
theorem inf_relindex_right : (H ⊓ K).relindex K = H.relindex K

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


lemma left_ne_zero_of_mem_divisorsAntidiagonal {p : ℕ × ℕ} (hp : p ∈ n.divisorsAntidiagonal) :
    p.1 ≠ 0

{n : ℕ}
{p : ℕ × ℕ}
(hp : p ∈ n.divisorsAntidiagonal)


@[simp]
theorem obj_d_eq (X : SimplicialObject C) (n : ℕ) :
    (AlternatingFaceMapComplex.obj X).d (n + 1) n
      = ∑ i : Fin (n + 2), (-1 : ℤ) ^ (i : ℕ) • X.δ i

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Preadditive C]
(X : CategoryTheory.SimplicialObject C)
(n : ℕ)

(AlgebraicTopology.AlternatingFaceMapComplex.obj X).d (n + 1) n = ∑ i : Fin (n + 2), (-1) ^ ↑i • X.δ i


@[simp]
theorem coe_ne_empty : (I : Set (ι → ℝ)) ≠ ∅


lemma isOpen_iff_isUpperSet : IsOpen s ↔ IsUpperSet s

{α : Type u_1}
[Preorder α]
[TopologicalSpace α]
[Topology.IsUpperSet α]
{s : Set α}


lemma continuous_negPart : Continuous (negPart : α → α)

{α : Type u_1}
[NormedLatticeAddCommGroup α]


@[simp]
theorem quotQuotEquivQuotOfLE_comp_quotQuotMkₐ (h : I ≤ J) :
    AlgHom.comp (↑(quotQuotEquivQuotOfLEₐ R h)) (quotQuotMkₐ R I J) = Quotient.mkₐ R J

(R : Type u)
{A : Type u_1}
[CommSemiring R]
[CommRing A]
[Algebra R A]
{I J : Ideal A}
(h : I ≤ J)

(↑(DoubleQuot.quotQuotEquivQuotOfLEₐ R h)).comp (DoubleQuot.quotQuotMkₐ R I J) = Ideal.Quotient.mkₐ R J


/-- An equivalence between opposite categories gives an equivalence between the original categories.
-/
@[simps]
def unop (e : Cᵒᵖ ≌ Dᵒᵖ) : C ≌ D

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
(e : Cᵒᵖ ≌ Dᵒᵖ)

e.unop.unitIso = (CategoryTheory.NatIso.unop e.unitIso).symm


@[simp]
theorem inits_append : ∀ s t : List α, inits (s ++ t) = s.inits ++ t.inits.tail.map fun l => s ++ l

(s ++ t).inits = s.inits ++ List.map (fun l => s ++ l) t.inits.tail


theorem modelWithCornersSelf_prod : 𝓘(𝕜, E × F) = 𝓘(𝕜, E).prod 𝓘(𝕜, F)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_4}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]


@[simp]
theorem frequently_false (f : Filter α) : ¬∃ᶠ _ in f, False


theorem Pairwise.of_cons (p : (a :: l).Pairwise R) : Pairwise R l

∀ {α : Type u_1} {a : α} {l : List α} {R : α → α → Prop}, List.Pairwise R (a :: l) → List.Pairwise R l


theorem restrict_map (μ : Measure α) (s : Set β) :
    (μ.map f).restrict s = (μ.restrict <| f ⁻¹' s).map f

{α : Type u_2}
{β : Type u_3}
{m0 : MeasurableSpace α}
{m1 : MeasurableSpace β}
{f : α → β}
(hf : MeasurableEmbedding f)
(μ : MeasureTheory.Measure α)
(s : Set β)

(MeasureTheory.Measure.map f μ).restrict s = MeasureTheory.Measure.map f (μ.restrict (f ⁻¹' s))


theorem num_mem_carrier_iff (hm : 0 < m) (q : Spec.T A⁰_ f)
    (z : HomogeneousLocalization.NumDenSameDeg 𝒜 (.powers f)) :
    z.num.1 ∈ carrier f_deg q ↔ HomogeneousLocalization.mk z ∈ q.asIdeal

(q :
  ↑↑(AlgebraicGeometry.Spec.locallyRingedSpaceObj
          (CommRingCat.of (HomogeneousLocalization.Away 𝒜 f))).toPresheafedSpace)

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

↑z.num ∈ AlgebraicGeometry.ProjIsoSpecTopComponent.FromSpec.carrier f_deg q ↔ HomogeneousLocalization.mk z ∈ q.asIdeal


@[to_additive]
theorem union_smul [DecidableEq α] : (s₁ ∪ s₂) • t = s₁ • t ∪ s₂ • t

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


/-- This key lemma says that if a finitely supported dependent function `x₀` is obtained by merging
  two such functions `x₁` and `x₂`, and if we evolve `x₀` down the `DFinsupp.Lex` relation one
  step and get `x`, we can always evolve one of `x₁` and `x₂` down the `DFinsupp.Lex` relation
  one step while keeping the other unchanged, and merge them back (possibly in a different way)
  to get back `x`. In other words, the two parts evolve essentially independently under
  `DFinsupp.Lex`. This is used to show that a function `x` is accessible if
  `DFinsupp.single i (x i)` is accessible for each `i` in the (finite) support of `x`
  (`DFinsupp.Lex.acc_of_single`). -/
theorem lex_fibration [∀ (i) (s : Set ι), Decidable (i ∈ s)] :
    Fibration (InvImage (GameAdd (DFinsupp.Lex r s) (DFinsupp.Lex r s)) snd) (DFinsupp.Lex r s)
      fun x => piecewise x.2.1 x.2.2 x.1

[(i : ι) → (s : Set ι) → Decidable (i ∈ s)]

Relation.Fibration (InvImage (Prod.GameAdd (DFinsupp.Lex r s) (DFinsupp.Lex r s)) Prod.snd) (DFinsupp.Lex r s) fun x =>
  x.2.1.piecewise x.2.2 x.1


@[simp]
theorem map_equivMapOfInjective_symm_apply (f : F) (i : Injective f) (p : Submodule R M)
    (x : p.map f) : f ((equivMapOfInjective f i p).symm x) = x

{R : Type u_1}
{R₂ : Type u_3}
{M : Type u_5}
{M₂ : Type u_7}
[Semiring R]
[Semiring R₂]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R₂ M₂]
{σ₁₂ : R →+* R₂}
{σ₂₁ : R₂ →+* R}
[RingHomInvPair σ₁₂ σ₂₁]
[RingHomInvPair σ₂₁ σ₁₂]
{F : Type u_9}
[FunLike F M M₂]
[SemilinearMapClass F σ₁₂ M M₂]
(f : F)
(i : Function.Injective ⇑f)
(p : Submodule R M)
(x : ↥(Submodule.map f p))

f ↑((Submodule.equivMapOfInjective f i p).symm x) = ↑x


@[to_additive]
theorem mem_closure {a : G} : a ∈ s → a ∈ closure s

{G : Type u_1}
[AddGroup G]
{s : Set G}
{a : G}


/-- **Minimum principle** for concave functions on an interval. If a function `f` is concave on the
interval `[x, y]`, then the eventual minimum of `f` on `[x, y]` is at `x` or `y`. -/
lemma ConcaveOn.min_le_of_mem_Icc {f : 𝕜 → β} {x y z : 𝕜} (hf : ConcaveOn 𝕜 (Icc x y) f)
    (hz : z ∈ Icc x y) : min (f x) (f y) ≤ f z

{𝕜 : Type u_1}
{β : Type u_4}
[LinearOrderedField 𝕜]
[LinearOrderedAddCommGroup β]
[Module 𝕜 β]
[OrderedSMul 𝕜 β]
{f : 𝕜 → β}
{x y z : 𝕜}
(hf : ConcaveOn 𝕜 (Set.Icc x y) f)
(hz : z ∈ Set.Icc x y)


/-- Every split mono `f` with a cokernel induces a binary bicone with `f` as its `inl` and
the cokernel map as its `snd`.
We will show in `is_bilimit_binary_bicone_of_split_mono_of_cokernel` that this binary bicone is in
fact already a biproduct. -/
@[simps]
def binaryBiconeOfIsSplitMonoOfCokernel {X Y : C} {f : X ⟶ Y} [IsSplitMono f] {c : CokernelCofork f}
    (i : IsColimit c) : BinaryBicone X c.pt

{c : CategoryTheory.Limits.CokernelCofork f}

(CategoryTheory.Limits.binaryBiconeOfIsSplitMonoOfCokernel i).snd = CategoryTheory.Limits.Cofork.π c


@[simp]
theorem dual_def (x : E) (f : Dual 𝕜 E) : inclusionInDoubleDual 𝕜 E x f = f x

(𝕜 : Type u_1)
[NontriviallyNormedField 𝕜]
(E : Type u_2)
[SeminormedAddCommGroup E]
[NormedSpace 𝕜 E]
(x : E)
(f : NormedSpace.Dual 𝕜 E)

((NormedSpace.inclusionInDoubleDual 𝕜 E) x) f = f x


theorem map_id (s : Multiset α) : map id s = s


theorem continuousAt_iff_continuous_left_right {a : α} {f : α → β} :
    ContinuousAt f a ↔ ContinuousWithinAt f (Iic a) a ∧ ContinuousWithinAt f (Ici a) a

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

ContinuousAt f a ↔ ContinuousWithinAt f (Set.Iic a) a ∧ ContinuousWithinAt f (Set.Ici a) a


theorem pointwise_smul_subset_iff {a : M} {S T : Ideal R} : a • S ≤ T ↔ S ≤ a⁻¹ • T

{M : Type u_1}
{R : Type u_2}
[Group M]
[CommRing R]
[MulSemiringAction M R]
{a : M}
{S T : Ideal R}

a • S ≤ T ↔ S ≤ a⁻¹ • T


/-- Adding a point to a set preserves its boundedness above. -/
@[simp]
theorem bddAbove_insert [IsDirected α (· ≤ ·)] {s : Set α} {a : α} :
    BddAbove (insert a s) ↔ BddAbove s

{α : Type u}
[Preorder α]
[IsDirected α fun x x_1 => x ≤ x_1]
{s : Set α}
{a : α}


theorem gc_lcs_ucs (k : ℕ) :
    GaloisConnection (fun N : LieSubmodule R L M => N.lcs k) fun N : LieSubmodule R L M =>
      N.ucs k

{R : Type u}
{L : Type v}
{M : Type w}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
(k : ℕ)

GaloisConnection (fun N => LieSubmodule.lcs k N) fun N => LieSubmodule.ucs k N


lemma sup_image₂_left (g : γ → δ) : sup (image₂ f s t) g = sup s fun x ↦ sup t (g <| f x ·)

{α : Type u_1}
{β : Type u_3}
{γ : Type u_5}
{δ : Type u_7}
[DecidableEq γ]
{f : α → β → γ}
(s : Finset α)
(t : Finset β)
[SemilatticeSup δ]
[OrderBot δ]
(g : γ → δ)

(Finset.image₂ f s t).sup g = s.sup fun x => t.sup fun x_1 => g (f x x_1)


@[to_additive]
lemma inv_mem_units (S : Submonoid M) {x : Mˣ} (h : x ∈ S.units) : x⁻¹ ∈ S.units

{M : Type u_1}
[AddMonoid M]
(S : AddSubmonoid M)
{x : AddUnits M}
(h : x ∈ S.addUnits)


/-- Iff can now be used to do substitutions in a calculation -/
theorem Iff.subst {a b : Prop} {p : Prop → Prop} (h₁ : a ↔ b) (h₂ : p a) : p b


/-- Natural identification to a `FiberBundleCore`. -/
@[simps (config := mfld_cfg)]
def toFiberBundleCore : FiberBundleCore ι B F

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

Z.toFiberBundleCore.coordChange = fun i j b => ⇑(Z.coordChange i j b)


theorem support_swap_mul_swap {x y z : α} (h : List.Nodup [x, y, z]) :
    support (swap x y * swap y z) = {x, y, z}

{α : Type u_1}
[DecidableEq α]
[Fintype α]
{x y z : α}
(h : [x, y, z].Nodup)

(Equiv.swap x y * Equiv.swap y z).support = {x, y, z}


@[simp]
theorem mk_pi {ι : Type u} (α : ι → Type v) : #(∀ i, α i) = prod fun i => #(α i)

Cardinal.mk ((i : ι) → α i) = Cardinal.prod fun i => Cardinal.mk (α i)


@[to_additive]
lemma smul_eq_iff_eq_inv_smul (g : α) {x y : β} : g • x = y ↔ x = g⁻¹ • y

{α : Type u_1}
{β : Type u_2}
[Group α]
[MulAction α β]
(g : α)
{x y : β}


@[to_additive]
theorem isGLB_inv' : IsGLB s⁻¹ a⁻¹ ↔ IsLUB s a

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

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


theorem pwFilter_subset [DecidableRel (α := α) R] (l : List α) : pwFilter R l ⊆ l

{α : Type u_1}
{R : α → α → Prop}
[DecidableRel R]
(l : List α)


@[to_additive (attr := simp)]
theorem toList_comp_ofList : @toList α ∘ ofList = id

⇑FreeAddMonoid.toList ∘ ⇑FreeAddMonoid.ofList = id


theorem lift_range_le {f : A →ₙₐ[R] C} {S : Subalgebra R C} :
    (lift f).range ≤ S ↔ NonUnitalAlgHom.range f ≤ S.toNonUnitalSubalgebra

{R : Type u_1}
{A : Type u_2}
{C : Type u_3}
[CommSemiring R]
[NonUnitalSemiring A]
[Module R A]
[SMulCommClass R A A]
[IsScalarTower R A A]
[Semiring C]
[Algebra R C]
{f : A →ₙₐ[R] C}
{S : Subalgebra R C}

(Unitization.lift f).range ≤ S ↔ NonUnitalAlgHom.range f ≤ S.toNonUnitalSubalgebra


@[simp]
theorem coe_le {l₁ l₂ : List α} : (l₁ : Multiset α) ≤ l₂ ↔ l₁ <+~ l₂

↑l₁ ≤ ↑l₂ ↔ l₁ <+~ l₂


theorem sup_congr {f g : β → α} (hs : s₁ = s₂) (hfg : ∀ a ∈ s₂, f a = g a) :
    s₁.sup f = s₂.sup g

{α : Type u_2}
{β : Type u_3}
[SemilatticeSup α]
[OrderBot α]
{s₁ s₂ : Finset β}
{f g : β → α}
(hs : s₁ = s₂)
(hfg : ∀ a ∈ s₂, f a = g a)


theorem exists_eq_pow_p_mul' (a : 𝕎 k) (ha : a ≠ 0) :
    ∃ (m : ℕ) (b : Units (𝕎 k)), a = (p : 𝕎 k) ^ m * b

{p : ℕ}
[hp : Fact (Nat.Prime p)]
{k : Type u_1}
[Field k]
[CharP k p]
[PerfectRing k p]
(a : WittVector p k)
(ha : a ≠ 0)


run_cmd
  for typeName' in [`UInt8, `UInt16, `UInt32, `UInt64, `USize] do
  let typeName := Lean.mkIdent typeName'
  Lean.Elab.Command.elabCommand (← `(
    namespace $typeName
      instance neZero : NeZero size := ⟨by decide⟩

      instance : Neg $typeName where
        neg a := mk (-a.val)

      instance : Pow $typeName ℕ where
        pow a n := mk (a.val ^ n)

      instance : SMul ℕ $typeName where
        smul n a := mk (n • a.val)

      instance : SMul ℤ $typeName where
        smul z a := mk (z • a.val)

      lemma neg_def (a : $typeName) : -a = ⟨-a.val⟩ := rfl

      lemma pow_def (a : $typeName) (n : ℕ) : a ^ n = ⟨a.val ^ n⟩ := rfl

      lemma nsmul_def (n : ℕ) (a : $typeName) : n • a = ⟨n • a.val⟩ := rfl

      lemma zsmul_def (z : ℤ) (a : $typeName) : z • a = ⟨z • a.val⟩ := rfl

      open $typeName (eq_of_val_eq) in
      lemma val_injective : Function.Injective val := @eq_of_val_eq

      instance instCommMonoid : CommMonoid $typeName :=
        Function.Injective.commMonoid val val_injective
          rfl (fun _ _ => rfl) (fun _ _ => rfl)

      instance instNonUnitalCommRing : NonUnitalCommRing $typeName :=
        Function.Injective.nonUnitalCommRing val val_injective
          rfl (fun _ _ => rfl) (fun _ _ => rfl) (fun _ => rfl) (fun _ _ => rfl)
          (fun _ _ => rfl) (fun _ _ => rfl)

      local instance instNatCast : NatCast $typeName where
        natCast n := mk n

      local instance instIntCast : IntCast $typeName where
        intCast z := mk z

      lemma natCast_def (n : ℕ) : (n : $typeName) = ⟨n⟩ := rfl

      lemma intCast_def (z : ℤ) : (z : $typeName) = ⟨z⟩ := rfl

      local instance instCommRing : CommRing $typeName :=
        Function.Injective.commRing val val_injective
          rfl rfl (fun _ _ => rfl) (fun _ _ => rfl) (fun _ => rfl) (fun _ _ => rfl)
          (fun _ _ => rfl) (fun _ _ => rfl) (fun _ _ => rfl) (fun _ => rfl) (fun _ => rfl)

      namespace CommRing
      attribute [scoped instance] instCommRing instNatCast instIntCast
      end CommRing

    end $typeName
  ))
  -- interpolating docstrings above is more trouble than it's worth
  let docString :=
    s!"To use this instance, use `open scoped {typeName'}.CommRing`.\n\n" ++
    "See the module docstring for an explanation"
  Lean.addDocString (typeName'.mkStr "instCommRing") docString
  Lean.addDocString (typeName'.mkStr "instNatCast") docString
  Lean.addDocString (typeName'.mkStr "instIntCast") docString


@[simp]
theorem conjTranspose_inv_ofNat_smul [DivisionSemiring R] [AddCommMonoid α] [StarAddMonoid α]
    [Module R α] (c : ℕ) [c.AtLeastTwo] (M : Matrix m n α) :
    ((no_index (OfNat.ofNat c : R))⁻¹ • M)ᴴ = (OfNat.ofNat c : R)⁻¹ • Mᴴ

{m : Type u_2}
{n : Type u_3}
{R : Type u_7}
{α : Type v}
[DivisionSemiring R]
[AddCommMonoid α]
[StarAddMonoid α]
[Module R α]
(c : ℕ)
[c.AtLeastTwo]
(M : Matrix m n α)

((OfNat.ofNat c)⁻¹ • M)ᴴ = (OfNat.ofNat c)⁻¹ • Mᴴ


theorem iSup_eq_top_iff_coe_toSubmodule {ι : Sort*} {N : ι → LieSubmodule R L M} :
    ⨆ i, N i = ⊤ ↔ ⨆ i, (N i : Submodule R M) = ⊤

{R : Type u}
{L : Type v}
{M : Type w}
[CommRing R]
[LieRing L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
{ι : Sort u_1}
{N : ι → LieSubmodule R L M}


@[simp]
theorem lintegral_const (c : ℝ≥0∞) : ∫⁻ _, c ∂μ = c * μ univ

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
(c : ℝ≥0∞)


@[simp]
theorem coe_comp_pseudoEpimorphism (g : EsakiaHom β γ) (f : EsakiaHom α β) :
    (g.comp f : PseudoEpimorphism α γ) = (g : PseudoEpimorphism β γ).comp f

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[TopologicalSpace α]
[Preorder α]
[TopologicalSpace β]
[Preorder β]
[TopologicalSpace γ]
[Preorder γ]
(g : EsakiaHom β γ)
(f : EsakiaHom α β)

{ toOrderHom := ↑(g.comp f), exists_map_eq_of_map_le' := ⋯ } =
  { toOrderHom := ↑g, exists_map_eq_of_map_le' := ⋯ }.comp { toOrderHom := ↑f, exists_map_eq_of_map_le' := ⋯ }


lemma addU_ne_zero_of_Y_ne {P Q : Fin 3 → F} (hPz : P z ≠ 0) (hQz : Q z ≠ 0)
    (hy : P y * Q z ^ 3 ≠ Q y * P z ^ 3) : addU P Q ≠ 0

{F : Type v}
[Field F]
{P Q : Fin 3 → F}
(hPz : P z ≠ 0)
(hQz : Q z ≠ 0)
(hy : P y * Q z ^ 3 ≠ Q y * P z ^ 3)


theorem StronglyMeasurable.integral_kernel_prod_left' ⦃f : β × α → E⦄ (hf : StronglyMeasurable f) :
    StronglyMeasurable fun y => ∫ x, f (x, y) ∂κ y

⦃f : β × α → E⦄

(hf : MeasureTheory.StronglyMeasurable f)

MeasureTheory.StronglyMeasurable fun y => ∫ (x : β), f (x, y) ∂κ y


/-- Build an isomorphism in the category `Module R` from a `LinearEquiv` between `Module`s. -/
@[simps]
def LinearEquiv.toModuleIso {g₁ : AddCommGroup X₁} {g₂ : AddCommGroup X₂} {m₁ : Module R X₁}
    {m₂ : Module R X₂} (e : X₁ ≃ₗ[R] X₂) : ModuleCat.of R X₁ ≅ ModuleCat.of R X₂

{R : Type u}
[Ring R]
{X₁ X₂ : Type v}
{g₁ : AddCommGroup X₁}
{g₂ : AddCommGroup X₂}
{m₁ : Module R X₁}
{m₂ : Module R X₂}
(e : X₁ ≃ₗ[R] X₂)


theorem tmul_neg (m : M) (n : N) : m ⊗ₜ (-n) = -m ⊗ₜ[R] n

{R : Type u_1}
[CommSemiring R]
{M : Type u_2}
{N : Type u_3}
[AddCommGroup M]
[AddCommGroup N]
[Module R M]
[Module R N]
(m : M)
(n : N)


@[to_additive (attr := simp)]
theorem image2_div : image2 Div.div s t = s / t


theorem cycleType (h : IsThreeCycle σ) : σ.cycleType = {3}

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


/-- If `a < b` then there exist `a' > a` and `b' < b` such that `Set.Iio a'` is strictly to the left
of `Set.Ioi b'`. -/
lemma LT.lt.exists_disjoint_Iio_Ioi (h : a < b) :
    ∃ a' > a, ∃ b' < b, ∀ x < a', ∀ y > b', x < y

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


protected theorem IsTransitive.sUnion (h : x.IsTransitive) :
    (⋃₀ x : ZFSet).IsTransitive


@[to_additive]
theorem ciSup_mul_ciSup_le [CovariantClass α α (· * ·) (· ≤ ·)]
    [CovariantClass α α (Function.swap (· * ·)) (· ≤ ·)] {a : α} {g : ι → α} {h : ι' → α}
    (H : ∀ i j, g i * h j ≤ a) : iSup g * iSup h ≤ a

[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 of_apply [AddZeroClass G] (a : Multiplicative G) :
    of k G a = single (Multiplicative.toAdd a) 1

{k : Type u₁}
{G : Type u₂}
[Semiring k]
[AddZeroClass G]
(a : Multiplicative G)

(AddMonoidAlgebra.of k G) a = AddMonoidAlgebra.single (Multiplicative.toAdd a) 1


theorem exists_compact_not_null [InnerRegular μ] : (∃ K, IsCompact K ∧ μ K ≠ 0) ↔ μ ≠ 0

{α : Type u_1}
[MeasurableSpace α]
[TopologicalSpace α]
{μ : MeasureTheory.Measure α}
[μ.InnerRegular]


theorem of_eventually_mem_of_forall_separating_mem_iff (p : Set β → Prop) {s : Set β}
    [h' : HasCountableSeparatingOn β p s] (hf : ∀ᶠ x in l, f x ∈ s) (hg : ∀ᶠ x in l, g x ∈ s)
    (h : ∀ U : Set β, p U → ∀ᶠ x in l, f x ∈ U ↔ g x ∈ U) : f =ᶠ[l] g

(h : ∀ (U : Set β), p U → ∀ᶠ (x : α) in l, f x ∈ U ↔ g x ∈ U)


theorem apply_single [AddCommMonoid M] [Module R M] [DecidableEq ι] (f : (i : ι) → φ i →ₗ[R] M)
    (i j : ι) (x : φ i) : f j (Pi.single i x j) = (Pi.single i (f i x) : ι → M) j

{R : Type u}
{M : Type v}
{ι : Type x}
[Semiring R]
{φ : ι → Type i}
[(i : ι) → AddCommMonoid (φ i)]
[(i : ι) → Module R (φ i)]
[AddCommMonoid M]
[Module R M]
[DecidableEq ι]
(f : (i : ι) → φ i →ₗ[R] M)
(i j : ι)
(x : φ i)

(f j) (Pi.single i x j) = Pi.single i ((f i) x) j


theorem card_eq_zero_iff_empty (α : Type*) : card α = 0 ↔ IsEmpty α


@[to_additive (attr := simp) AddSubmonoid.center_toAddSubsemigroup]
theorem center_toSubsemigroup : (center M).toSubsemigroup = Subsemigroup.center M

(AddSubmonoid.center M).toAddSubsemigroup = AddSubsemigroup.center M


@[simp]
theorem unop_top : (⊤ : Subsemiring Rᵐᵒᵖ).unop = ⊤


@[simp]
theorem finsuppTensorFinsuppLid_apply_apply (f : ι →₀ R) (g : κ →₀ N) (a : ι) (b : κ) :
    finsuppTensorFinsuppLid R N ι κ (f ⊗ₜ[R] g) (a, b) = f a • g b

(R : Type u_1)
(N : Type u_4)
(ι : Type u_5)
(κ : Type u_6)
[CommSemiring R]
[AddCommMonoid N]
[Module R N]
(f : ι →₀ R)
(g : κ →₀ N)
(a : ι)
(b : κ)

((finsuppTensorFinsuppLid R N ι κ) (f ⊗ₜ[R] g)) (a, b) = f a • g b


theorem liftAux_map_add (f : X → L) (a b : lib R X) :
    liftAux R f (a + b) = liftAux R f a + liftAux R f b

(R : Type u)
{X : Type v}
[CommRing R]
{L : Type w}
[LieRing L]
[LieAlgebra R L]
(f : X → L)
(a b : lib R X)

(FreeLieAlgebra.liftAux R f) (a + b) = (FreeLieAlgebra.liftAux R f) a + (FreeLieAlgebra.liftAux R f) b


theorem iterate_derivative_at_0_ne_zero [CharZero R] (n ν : ℕ) (h : ν ≤ n) :
    (Polynomial.derivative^[ν] (bernsteinPolynomial R n ν)).eval 0 ≠ 0

(R : Type u_1)
[CommRing R]
[CharZero R]
(n ν : ℕ)
(h : ν ≤ n)

Polynomial.eval 0 ((⇑Polynomial.derivative)^[ν] (bernsteinPolynomial R n ν)) ≠ 0


/-- If `s` has the unique differential property, `f` is differentiable on `s` and its derivative
at every point of `s` has dense range, then `f '' s` has the unique differential property. -/
theorem UniqueMDiffOn.image_denseRange (hs : UniqueMDiffOn I s) {f : M → M'}
    (hf : MDifferentiableOn I I' f s) (hd : ∀ x ∈ s, DenseRange (mfderivWithin I I' f s x)) :
    UniqueMDiffOn I' (f '' s)

(hd : ∀ x ∈ s, DenseRange ⇑(mfderivWithin I I' f s x))


@[simp] lemma disjointSigma_indep_iff {h I} :
    (Matroid.disjointSigma M h).Indep I ↔
      (∀ i, (M i).Indep (I ∩ (M i).E)) ∧ I ⊆ ⋃ i, (M i).E

{h : Pairwise (Disjoint on fun i => (M i).E)}

(Matroid.disjointSigma M h).Indep I ↔ (∀ (i : ι), (M i).Indep (I ∩ (M i).E)) ∧ I ⊆ ⋃ i, (M i).E


@[simp] lemma comap_loopyOn (f : α → β) (E : Set β) : comap (loopyOn E) f = loopyOn (f ⁻¹' E)

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

(Matroid.loopyOn E).comap f = Matroid.loopyOn (f ⁻¹' E)


theorem _root_.MeasureTheory.AEStronglyMeasurable.memℒp_truncation [IsFiniteMeasure μ]
    (hf : AEStronglyMeasurable f μ) {A : ℝ} {p : ℝ≥0∞} : Memℒp (truncation f A) p μ

(hf : MeasureTheory.AEStronglyMeasurable f μ)

MeasureTheory.Memℒp (ProbabilityTheory.truncation f A) p μ


/-- A crude lemma estimating the difference between `log (1-x)` and its Taylor series at `0`,
where the main point of the bound is that it tends to `0`. The goal is to deduce the series
expansion of the logarithm, in `hasSum_pow_div_log_of_abs_lt_1`.

Porting note (#11215): TODO: use one of generic theorems about Taylor's series
to prove this estimate.
-/
theorem abs_log_sub_add_sum_range_le {x : ℝ} (h : |x| < 1) (n : ℕ) :
    |(∑ i ∈ range n, x ^ (i + 1) / (i + 1)) + log (1 - x)| ≤ |x| ^ (n + 1) / (1 - |x|)


@[simp] protected theorem sub_add_min_cancel (n m : Nat) : n - m + min n m = n


theorem npow_mem_zpowers (g : G) (k : ℕ) : g ^ k ∈ zpowers g

{G : Type u_1}
[Group G]
(g : G)
(k : ℕ)


/-- Given a closed set `s`, a point belongs to `s` iff its infimum distance to this set vanishes. -/
theorem _root_.IsClosed.not_mem_iff_infDist_pos (h : IsClosed s) (hs : s.Nonempty) :
    x ∉ s ↔ 0 < infDist x s

{α : Type u}
[PseudoMetricSpace α]
{s : Set α}
{x : α}
(h : IsClosed s)
(hs : s.Nonempty)


/-- Auxiliary lemma in the proof of `integral_eq_sub_of_hasDeriv_right_of_le`: real version -/
theorem integral_eq_sub_of_hasDeriv_right_of_le_real (hab : a ≤ b)
    (hcont : ContinuousOn g (Icc a b)) (hderiv : ∀ x ∈ Ioo a b, HasDerivWithinAt g (g' x) (Ioi x) x)
    (g'int : IntegrableOn g' (Icc a b)) : ∫ y in a..b, g' y = g b - g a

(hderiv : ∀ x ∈ Set.Ioo a b, HasDerivWithinAt g (g' x) (Set.Ioi x) x)

(g'int : MeasureTheory.IntegrableOn g' (Set.Icc a b) MeasureTheory.volume)


theorem isGenericPoint_iff_forall_closed (hS : IsClosed S) (hxS : x ∈ S) :
    IsGenericPoint x S ↔ ∀ Z : Set α, IsClosed Z → x ∈ Z → S ⊆ Z

{α : Type u_1}
[TopologicalSpace α]
{x : α}
{S : Set α}
(hS : IsClosed S)
(hxS : x ∈ S)

IsGenericPoint x S ↔ ∀ (Z : Set α), IsClosed Z → x ∈ Z → S ⊆ Z


@[simp]
theorem toOuterMeasure_uniformOfFinset_apply :
    (uniformOfFinset s hs).toOuterMeasure t = (s.filter (· ∈ t)).card / s.card

{α : Type u_1}
{s : Finset α}
(hs : s.Nonempty)
(t : Set α)

(PMF.uniformOfFinset s hs).toOuterMeasure t = ↑(Finset.filter (fun x => x ∈ t) s).card / ↑s.card


/-- The bijection of `Trident.IsLimit.homIso` is natural in `Z`. -/
theorem Trident.IsLimit.homIso_natural [Nonempty J] {t : Trident f} (ht : IsLimit t) {Z Z' : C}
    (q : Z' ⟶ Z) (k : Z ⟶ t.pt) :
    (Trident.IsLimit.homIso ht _ (q ≫ k) : Z' ⟶ X) =
      q ≫ (Trident.IsLimit.homIso ht _ k : Z ⟶ X)

{J : Type w}
{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X Y : C}
{f : J → (X ⟶ Y)}
[Nonempty J]
{t : CategoryTheory.Limits.Trident f}
(ht : CategoryTheory.Limits.IsLimit t)
{Z Z' : C}
(q : Z' ⟶ Z)
(k : Z ⟶ t.pt)

↑((CategoryTheory.Limits.Trident.IsLimit.homIso ht Z') (CategoryTheory.CategoryStruct.comp q k)) =
  CategoryTheory.CategoryStruct.comp q ↑((CategoryTheory.Limits.Trident.IsLimit.homIso ht Z) k)


@[simp]
lemma ofZeros_g' (hf : S.f = 0) (hg : S.g = 0) :
    (ofZeros S hf hg).g' = 0

(CategoryTheory.ShortComplex.RightHomologyData.ofZeros S hf hg).g' = 0


@[reassoc]
lemma whiskerRight_mapId_inv (f : a ⟶ b) : (F.mapId a).inv ▷ F.map f =
    (λ_ (F.map f)).hom ≫ F.map₂ (λ_ f).inv ≫ (F.mapComp (𝟙 a) f).hom

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

CategoryTheory.Bicategory.whiskerRight (F.mapId a).inv (F.map f) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.leftUnitor (F.map f)).hom
    (CategoryTheory.CategoryStruct.comp (F.map₂ (CategoryTheory.Bicategory.leftUnitor f).inv)
      (F.mapComp (CategoryTheory.CategoryStruct.id a) f).hom)


theorem sublistsLen_sublist_of_sublist (n) {l₁ l₂ : List α} (h : l₁ <+ l₂) :
    sublistsLen n l₁ <+ sublistsLen n l₂

{α : Type u}
(n : ℕ)
{l₁ l₂ : List α}
(h : l₁.Sublist l₂)

(List.sublistsLen n l₁).Sublist (List.sublistsLen n l₂)


@[simp]
theorem superFactorial_one : sf 1 = 1


@[to_additive support_prod_mk']
theorem mulSupport_prod_mk' (f : α → M × N) :
    mulSupport f = (mulSupport fun x => (f x).1) ∪ mulSupport fun x => (f x).2

{α : Type u_1}
{M : Type u_5}
{N : Type u_7}
[One M]
[One N]
(f : α → M × N)

Function.mulSupport f = (Function.mulSupport fun x => (f x).1) ∪ Function.mulSupport fun x => (f x).2


@[simp]
theorem id_comp (η : ApplicativeTransformation F G) : idTransformation.comp η = η

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

ApplicativeTransformation.idTransformation.comp η = η


@[simp]
theorem card_Icc : (Icc a b).card = b + 1 - a


theorem biUnion_coe_eq_coe (I : WithBot (Box ι)) :
    ⋃ (J : Box ι) (_ : ↑J = I), (J : Set (ι → ℝ)) = I

{ι : Type u_1}
(I : WithBot (BoxIntegral.Box ι))


@[simp]
theorem sumDiffSubset_apply_inr {α} {s t : Set α} (h : s ⊆ t) [DecidablePred (· ∈ s)]
    (x : (t \ s : Set α)) : Equiv.Set.sumDiffSubset h (Sum.inr x) = inclusion diff_subset x

{α : Type u_1}
{s t : Set α}
(h : s ⊆ t)
[DecidablePred fun x => x ∈ s]
(x : ↑(t \ s))

(Equiv.Set.sumDiffSubset h) (Sum.inr x) = Set.inclusion ⋯ x


theorem epi_iff_range_eq_top : Epi f ↔ f.range = ⊤

CategoryTheory.Epi f ↔ MonoidHom.range f = ⊤


theorem invOf_submatrix_equiv_eq (A : Matrix m m α) (e₁ e₂ : n ≃ m) [Invertible A]
    [Invertible (A.submatrix e₁ e₂)] : ⅟ (A.submatrix e₁ e₂) = (⅟ A).submatrix e₂ e₁

{m : Type u}
{n : Type u'}
{α : Type v}
[Fintype n]
[DecidableEq n]
[CommRing α]
[Fintype m]
[DecidableEq m]
(A : Matrix m m α)
(e₁ e₂ : n ≃ m)
[Invertible A]
[Invertible (A.submatrix ⇑e₁ ⇑e₂)]

⅟(A.submatrix ⇑e₁ ⇑e₂) = (⅟A).submatrix ⇑e₂ ⇑e₁


@[to_additive]
theorem diff_mul_diff : diff ϕ R S * diff ϕ S T = diff ϕ R T

(R S T : ↑(AddSubgroup.leftTransversals ↑H))

AddSubgroup.leftTransversals.diff ϕ R S + AddSubgroup.leftTransversals.diff ϕ S T =
  AddSubgroup.leftTransversals.diff ϕ R T


theorem apply_mem_span_image_of_mem_span [RingHomSurjective σ₁₂] (f : F) {x : M}
    {s : Set M} (h : x ∈ Submodule.span R s) : f x ∈ Submodule.span R₂ (f '' s)

{R : Type u_1}
{R₂ : Type u_2}
{M : Type u_4}
{M₂ : Type u_5}
[Semiring R]
[AddCommMonoid M]
[Module R M]
[Semiring R₂]
{σ₁₂ : R →+* R₂}
[AddCommMonoid M₂]
[Module R₂ M₂]
{F : Type u_8}
[FunLike F M M₂]
[SemilinearMapClass F σ₁₂ M M₂]
[RingHomSurjective σ₁₂]
(f : F)
{x : M}
{s : Set M}
(h : x ∈ Submodule.span R s)


theorem range_cos_infinite : (range Real.cos).Infinite


theorem isRat_rpow_pos {a b : ℝ} {nb : ℕ}
    {num : ℤ} {den : ℕ}
    (pb : IsNat b nb) (pe' : IsRat (a ^ nb) num den) :
    IsRat (a ^ b) num den

(pe' : Mathlib.Meta.NormNum.IsRat (a ^ nb) num den)

Mathlib.Meta.NormNum.IsRat (a ^ b) num den


protected theorem isClosed (h : IsGenericPoint x S) : IsClosed S

{α : Type u_1}
[TopologicalSpace α]
{x : α}
{S : Set α}
(h : IsGenericPoint x S)


@[simp]
theorem trans_toCoalgHom :
    (e₁₂.trans e₂₃ : A →ₗc[R] C) = e₂₃.comp e₁₂

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
{C : Type u_4}
[CommSemiring R]
[AddCommMonoid A]
[AddCommMonoid B]
[AddCommMonoid C]
[Module R A]
[Module R B]
[Module R C]
[CoalgebraStruct R A]
[CoalgebraStruct R B]
[CoalgebraStruct R C]
{e₁₂ : A ≃ₗc[R] B}
{e₂₃ : B ≃ₗc[R] C}


@[simp]
theorem wellFoundedOn_insert : WellFoundedOn (insert a s) r ↔ WellFoundedOn s r

{α : Type u_2}
{r : α → α → Prop}
[IsStrictOrder α r]
{s : Set α}
{a : α}

(insert a s).WellFoundedOn r ↔ s.WellFoundedOn r


theorem coe_num_denom : (f : LaurentSeries F) = f.num / f.denom

↑f = (HahnSeries.ofPowerSeries ℤ F) ↑f.num / (HahnSeries.ofPowerSeries ℤ F) ↑f.denom


@[simp] theorem endofunctorMonoidalCategory_tensorObj_map (F G : C ⥤ C) {X Y : C} (f : X ⟶ Y) :
    (F ⊗ G).map f = G.map (F.map f)

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

(CategoryTheory.MonoidalCategory.tensorObj F G).map f = G.map (F.map f)


theorem tendsto_setIntegral_of_antitone {ι : Type*} [Countable ι] [SemilatticeSup ι]
    {s : ι → Set X} (hsm : ∀ i, MeasurableSet (s i)) (h_anti : Antitone s)
    (hfi : ∃ i, IntegrableOn f (s i) μ) :
    Tendsto (fun i ↦ ∫ x in s i, f x ∂μ) atTop (𝓝 (∫ x in ⋂ n, s n, f x ∂μ))

(hfi : ∃ i, MeasureTheory.IntegrableOn f (s i) μ)

Filter.Tendsto (fun i => ∫ (x : X) in s i, f x ∂μ) Filter.atTop (𝓝 (∫ (x : X) in ⋂ n, s n, f x ∂μ))


theorem isLittleO_log_rpow_rpow_atTop {s : ℝ} (r : ℝ) (hs : 0 < s) :
    (fun x => log x ^ r) =o[atTop] fun x => x ^ s

(fun x => Real.log x ^ r) =o[Filter.atTop] fun x => x ^ s


theorem eLpNorm_mono_nnnorm {f : α → F} {g : α → G} (h : ∀ x, ‖f x‖₊ ≤ ‖g x‖₊) :
    eLpNorm f p μ ≤ eLpNorm g p μ

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

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


protected theorem subset (v : PartialRefinement u s) (i : ι) : v i ⊆ u i

(v : ShrinkingLemma.PartialRefinement u s)


lemma Set.Ici_ciSup [Nonempty ι] {f : ι → α} (hf : BddAbove (range f)) :
    Ici (⨆ i, f i) = ⋂ i, Ici (f i)

{α : Type u_1}
{ι : Sort u_4}
[ConditionallyCompleteLattice α]
[Nonempty ι]
{f : ι → α}
(hf : BddAbove (Set.range f))


/-- If the angle between three points is `π`, the last two points are not equal. -/
theorem right_ne_of_oangle_eq_pi {p₁ p₂ p₃ : P} (h : ∡ p₁ p₂ p₃ = π) : p₃ ≠ p₂

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


@[simp]
lemma polyCharpoly_map_eq_charpoly (x : L) :
    (polyCharpoly φ b).map (MvPolynomial.eval (b.repr x)) = (φ x).charpoly

{R : Type u_1}
{L : Type u_2}
{M : Type u_3}
{ι : Type u_5}
[CommRing R]
[AddCommGroup L]
[Module R L]
[AddCommGroup M]
[Module R M]
(φ : L →ₗ[R] Module.End R M)
[Fintype ι]
[DecidableEq ι]
[Module.Free R M]
[Module.Finite R M]
(b : Basis ι R L)
(x : L)

Polynomial.map (MvPolynomial.eval ⇑(b.repr x)) (φ.polyCharpoly b) = LinearMap.charpoly (φ x)


@[simp]
theorem Ioo_union_Icc_eq_Ioc (h₁ : a < b) (h₂ : b ≤ c) : Ioo a b ∪ Icc b c = Ioc a c

{α : Type u_1}
[LinearOrder α]
{a b c : α}
(h₁ : a < b)
(h₂ : b ≤ c)


/-- `zeroLocus` and `vanishingIdeal` form a galois connection. -/
theorem gc_set :
    @GaloisConnection (Set A) (Set (ProjectiveSpectrum 𝒜))ᵒᵈ _ _
      (fun s => zeroLocus 𝒜 s) fun t => vanishingIdeal t

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

GaloisConnection (fun s => ProjectiveSpectrum.zeroLocus 𝒜 s) fun t => ↑(ProjectiveSpectrum.vanishingIdeal t)


@[reassoc (attr := simp)]
lemma stalkMap_germ' (U : Opens Y) (x : X) (hx : f.val.base x ∈ U) :
    Y.presheaf.germ ⟨f.val.base x, hx⟩ ≫ f.stalkMap x =
      f.val.c.app (op U) ≫ X.presheaf.germ (U := (Opens.map f.val.base).obj U) ⟨x, hx⟩

{X Y : AlgebraicGeometry.LocallyRingedSpace}

(U : TopologicalSpace.Opens ↑Y.toTopCat)

Y.presheaf.germ ⟨f.val.base x, hx⟩ ≫ AlgebraicGeometry.LocallyRingedSpace.Hom.stalkMap f x =
  f.val.c.app (Opposite.op U) ≫ X.presheaf.germ ⟨x, hx⟩


@[simp]
theorem mem_subalgebraEquivIntermediateField_symm [Algebra.IsAlgebraic K L]
    {S : IntermediateField K L} {x : L} :
    x ∈ subalgebraEquivIntermediateField.symm S ↔ x ∈ S

{K : Type u_1}
{L : Type u_2}
[Field K]
[Field L]
[Algebra K L]
[Algebra.IsAlgebraic K L]
{S : IntermediateField K L}
{x : L}


/-- The counit morphism `R ⟶ Γ(Spec R)` given by `AlgebraicGeometry.StructureSheaf.toOpen`.  -/
@[simps!]
def toSpecΓ (R : CommRingCat.{u}) : R ⟶ Γ.obj (op (Spec.toLocallyRingedSpace.obj (op R)))

(R : CommRingCat)
(f : ↑(CommRingCat.of ↑R))
(x : ↥(Opposite.unop (Opposite.op ⊤)))

↑((AlgebraicGeometry.toSpecΓ R) f) x = (algebraMap (↑R) (AlgebraicGeometry.StructureSheaf.Localizations ↑R ↑x)) f


theorem mul_right_mono : Monotone (· * a)


theorem coe_apply (x : R_hat R K) (v : HeightOneSpectrum R) : (x : K_hat R K) v = ↑(x v)

(x : DedekindDomain.FiniteIntegralAdeles R K)

(v : IsDedekindDomain.HeightOneSpectrum R)


/-- If a `l : List α` is `Nodup l`, then all of its cyclic permutants are distinct. -/
protected theorem Nodup.cyclicPermutations {l : List α} (hn : Nodup l) :
    Nodup (cyclicPermutations l)

{α : Type u}
{l : List α}
(hn : l.Nodup)


theorem comap_jacobson {f : R →+* S} {K : Ideal S} :
    comap f K.jacobson = sInf (comap f '' { J : Ideal S | K ≤ J ∧ J.IsMaximal })

{R : Type u}
{S : Type v}
[Ring R]
[Ring S]
{f : R →+* S}
{K : Ideal S}

Ideal.comap f K.jacobson = sInf (Ideal.comap f '' {J | K ≤ J ∧ J.IsMaximal})


protected theorem HasDerivWithinAt.iterate {f : 𝕜 → 𝕜} {f' : 𝕜} (hf : HasDerivWithinAt f f' s x)
    (hx : f x = x) (hs : MapsTo f s s) (n : ℕ) : HasDerivWithinAt f^[n] (f' ^ n) s x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
(x : 𝕜)
{s : Set 𝕜}
{f : 𝕜 → 𝕜}
{f' : 𝕜}
(hf : HasDerivWithinAt f f' s x)
(hx : f x = x)
(hs : Set.MapsTo f s s)
(n : ℕ)


theorem zpow_eq_one_iff_dvd (h : IsPrimitiveRoot ζ k) (l : ℤ) : ζ ^ l = 1 ↔ (k : ℤ) ∣ l

{G : Type u_3}
[DivisionCommMonoid G]
{k : ℕ}
{ζ : G}
(h : IsPrimitiveRoot ζ k)
(l : ℤ)


@[simp] lemma invert_apply (f : R[T;T⁻¹]) (n : ℤ) : invert f n = f (-n)

{R : Type u_2}
[CommSemiring R]
(f : R[T;T⁻¹])
(n : ℤ)


protected theorem add_mul : (a + b) * c = a * c + b * c


@[reassoc]
theorem curry_natural_right (f : A ⨯ X ⟶ Y) (g : Y ⟶ Y') :
    curry (f ≫ g) = curry f ≫ (exp _).map g

CategoryTheory.CartesianClosed.curry (CategoryTheory.CategoryStruct.comp f g) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.CartesianClosed.curry f) ((CategoryTheory.exp A).map g)


theorem prod_finsetApprox_ne_zero : algebraMap R S (∏ m ∈ finsetApprox bS adm, m) ≠ 0

{R : Type u_1}
{S : Type u_2}
[EuclideanDomain R]
[CommRing S]
[IsDomain S]
[Algebra R S]
{abv : AbsoluteValue R ℤ}
{ι : Type u_5}
[DecidableEq ι]
[Fintype ι]
(bS : Basis ι R S)
(adm : abv.IsAdmissible)
[Infinite R]
[DecidableEq R]

(algebraMap R S) (∏ m ∈ ClassGroup.finsetApprox bS adm, m) ≠ 0


/-- If a monoidal functor `F` is an equivalence of categories then its inverse is also monoidal. -/
@[simps]
noncomputable def monoidalInverse [F.IsEquivalence] :
    MonoidalFunctor D C

(F : CategoryTheory.MonoidalFunctor C D)

(CategoryTheory.monoidalInverse F h).toLaxMonoidalFunctor = CategoryTheory.monoidalAdjoint F h


theorem factorial_mul_pow_le_factorial : ∀ {m n : ℕ}, m ! * (m + 1) ^ n ≤ (m + n)!

m.factorial * (m + 1) ^ n ≤ (m + n).factorial


@[to_additive (attr := simp)]
theorem rel_eq_coe (c : Con M) : c.r = c


theorem map_id_left_eq_curry_map {j : J} {k k' : K} {f : k ⟶ k'} :
    F.map ((𝟙 j, f) : (j, k) ⟶ (j, k')) = ((curry.obj F).obj j).map f

{J : Type u₁}
{K : Type u₂}
[CategoryTheory.Category.{v₁, u₁} J]
[CategoryTheory.Category.{v₂, u₂} K]
{C : Type u}
[CategoryTheory.Category.{v, u} C]
(F : J × K ⥤ C)
{j : J}
{k k' : K}
{f : k ⟶ k'}

F.map (𝟙 j, f) = ((CategoryTheory.curry.obj F).obj j).map f


lemma P2_neg_right : P2 x₁ x₂ y ↔ P2 x₁ x₂ (-y)

Surreal.Multiplication.P2 x₁ x₂ y ↔ Surreal.Multiplication.P2 x₁ x₂ (-y)


theorem toLieHom_injective {f g : A →ₐ[R] B} (h : (f : A →ₗ⁅R⁆ B) = (g : A →ₗ⁅R⁆ B)) : f = g

{A : Type v}
[Ring A]
{R : Type u}
[CommRing R]
[Algebra R A]
{B : Type w}
[Ring B]
[Algebra R B]
{f g : A →ₐ[R] B}
(h : f.toLieHom = g.toLieHom)


lemma SpectrumRestricts.smul_of_nonneg {A : Type*} [Ring A] [Algebra ℝ A] {a : A}
    (ha : SpectrumRestricts a ContinuousMap.realToNNReal) {r : ℝ} (hr : 0 ≤ r) :
    SpectrumRestricts (r • a) ContinuousMap.realToNNReal

(ha : SpectrumRestricts a ⇑ContinuousMap.realToNNReal)

SpectrumRestricts (r • a) ⇑ContinuousMap.realToNNReal


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

{M : Type u_1}
{N : Type u_2}
[Add M]
[Add N]
{s : Set M}
(hs : AddSubsemigroup.closure s = ⊤)
{f g : AddHom M N}
(h : Set.EqOn (⇑f) (⇑g) s)


theorem norm_le_of_forall_sum_le (hp : 0 < p.toReal) {C : ℝ} (hC : 0 ≤ C) {f : lp E p}
    (hf : ∀ s : Finset α, ∑ i ∈ s, ‖f i‖ ^ p.toReal ≤ C ^ p.toReal) : ‖f‖ ≤ C

(hf : ∀ (s : Finset α), ∑ i ∈ s, ‖↑f i‖ ^ p.toReal ≤ C ^ p.toReal)


theorem EventuallyLE.countable_iInter [Countable ι] {s t : ι → Set α} (h : ∀ i, s i ≤ᶠ[l] t i) :
    ⋂ i, s i ≤ᶠ[l] ⋂ i, t i

{ι : Sort u_1}
{α : Type u_2}
{l : Filter α}
[CountableInterFilter l]
[Countable ι]
{s t : ι → Set α}
(h : ∀ (i : ι), s i ≤ᶠ[l] t i)


@[to_additive]
theorem sec_spec' {f : LocalizationMap S N} (z : N) :
    f.toMap (f.sec z).1 = f.toMap (f.sec z).2 * z

{M : Type u_1}
[CommMonoid M]
{S : Submonoid M}
{N : Type u_2}
[CommMonoid N]
{f : S.LocalizationMap N}
(z : N)

f.toMap (f.sec z).1 = f.toMap ↑(f.sec z).2 * z


theorem pairwise_iff_forall_sublist : l.Pairwise R ↔ (∀ {a b}, [a,b] <+ l → R a b)

∀ {α : Type u_1} {l : List α} {R : α → α → Prop}, List.Pairwise R l ↔ ∀ {a b : α}, [a, b] <+ l → R a b


@[simp] lemma infClosure_supClosure (s : Set α) : infClosure (supClosure s) = latticeClosure s

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


lemma l2_opNorm_conjTranspose_mul_self (A : Matrix m n 𝕜) : ‖Aᴴ * A‖ = ‖A‖ * ‖A‖

{𝕜 : Type u_1}
{m : Type u_2}
{n : Type u_3}
[RCLike 𝕜]
[Fintype m]
[Fintype n]
[DecidableEq n]
(A : Matrix m n 𝕜)

‖Aᴴ * A‖ = ‖A‖ * ‖A‖


@[csimp] theorem zipWithLeft'_eq_zipWithLeft'TR : @zipWithLeft' = @zipWithLeft'TR

(α : Type u_3)
(β : Type u_2)
(γ : Type u_1)
(f : α → Option β → γ)
(acc : Array γ)
(as : List α)
(bs : List β)

List.zipWithLeft'TR.go f as bs acc =
  match List.zipWithLeft' f as bs with
  | (l, r) => (acc.toList ++ l, r)


/-- An adjunction between preorder categories induces a galois connection.
-/
theorem Adjunction.gc {L : X ⥤ Y} {R : Y ⥤ X} (adj : L ⊣ R) : GaloisConnection L.obj R.obj

{X : Type u}
{Y : Type v}
[Preorder X]
[Preorder Y]
{L : CategoryTheory.Functor X Y}
{R : CategoryTheory.Functor Y X}
(adj : L ⊣ R)


theorem eq_zero_of_eval_eq_zero [Finite σ] (p : MvPolynomial σ K) (h : ∀ v : σ → K, eval v p = 0)
    (hp : p ∈ restrictDegree σ K (Fintype.card K - 1)) : p = 0

(h : ∀ (v : σ → K), (MvPolynomial.eval v) p = 0)

(hp : p ∈ MvPolynomial.restrictDegree σ K (Fintype.card K - 1))


@[simp]
theorem primeFactorsList_eq_nil (n : ℕ) : n.primeFactorsList = [] ↔ n = 0 ∨ n = 1


{V : Type u_1}
[SeminormedAddCommGroup V]


lemma ciSup_neg {p : Prop} {f : p → α} (hp : ¬ p) :
    ⨆ (h : p), f h = sSup (∅ : Set α)

{α : Type u_1}
[ConditionallyCompleteLattice α]
{p : Prop}
{f : p → α}
(hp : ¬p)


theorem χ₄_nat_eq_if_mod_four (n : ℕ) :
    χ₄ n = if n % 2 = 0 then 0 else if n % 4 = 1 then 1 else -1

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


/-- The result of reflecting. -/
theorem reflection_apply (p : E) : reflection K p = 2 • (orthogonalProjection K p : E) - p

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

(reflection K) p = 2 • ↑((orthogonalProjection K) p) - p


theorem OneOneEquiv.congr_left {α β γ} [Primcodable α] [Primcodable β] [Primcodable γ]
    {p : α → Prop} {q : β → Prop} {r : γ → Prop} (h : OneOneEquiv p q) :
    OneOneEquiv p r ↔ OneOneEquiv q r

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[Primcodable α]
[Primcodable β]
[Primcodable γ]
{p : α → Prop}
{q : β → Prop}
{r : γ → Prop}
(h : OneOneEquiv p q)


/-- **The Law of the Unconscious Statistician**: Given a random variable `X` and a measurable
function `f`, `f ∘ X` is a random variable with expectation `∫ x, pdf X x • f x ∂μ`
where `μ` is a measure on the codomain of `X`. -/
theorem integral_pdf_smul [IsFiniteMeasure ℙ] {X : Ω → E} [HasPDF X ℙ μ] {f : E → F}
    (hf : AEStronglyMeasurable f μ) : ∫ x, (pdf X ℙ μ x).toReal • f x ∂μ = ∫ x, f (X x) ∂ℙ

(hf : MeasureTheory.AEStronglyMeasurable f μ)

∫ (x : E), (MeasureTheory.pdf X ℙ μ x).toReal • f x ∂μ = ∫ (x : Ω), f (X x) ∂ℙ


theorem map_map (g : α ⟹ β) (h : β ⟹ γ) (x : F α) : h <$$> g <$$> x = (h ⊚ g) <$$> x

{n : ℕ}
{α β γ : TypeVec.{u} n}
{F : TypeVec.{u} n → Type v}
[MvFunctor F]
[LawfulMvFunctor F]
(g : α ⟹ β)
(h : β ⟹ γ)
(x : F α)


@[simp, nolint simpNF] -- Added `nolint simpNF` to avoid a timeout #8386
theorem aux_one : aux f 1 = 1

{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)


@[simp]
lemma map₁_map₂ {F G : Cᵒᵖ ⥤ Type v} {η : F ⟶ A} {μ : G ⟶ A} (ε : F ⟶ G)
    (hε : ε ≫ μ = η) {X Y : C} {s : yoneda.obj X ⟶ A} {t : yoneda.obj Y ⟶ A} (f : X ⟶ Y)
    (hf : yoneda.map f ≫ t = s) (u : OverArrows η t) :
    (u.map₁ ε hε).map₂ f hf = (u.map₂ f hf).map₁ ε hε

{A F G : CategoryTheory.Functor Cᵒᵖ (Type v)}

(hε : CategoryTheory.CategoryStruct.comp ε μ = η)

(hf : CategoryTheory.CategoryStruct.comp (CategoryTheory.yoneda.map f) t = s)

(u : CategoryTheory.OverPresheafAux.OverArrows η t)


@[to_additive (attr := gcongr)]
lemma zpow_le_zpow' (hn : 0 ≤ n) (h : a ≤ b) : a ^ n ≤ b ^ n

{α : Type u_1}
[OrderedCommGroup α]
{n : ℤ}
{a b : α}
(hn : 0 ≤ n)
(h : a ≤ b)


@[simps id_val comp_val]
instance instCategorySheaf : Category (Sheaf J A)

{J : CategoryTheory.GrothendieckTopology C}

∀ {X Y Z : CategoryTheory.Sheaf J A} (f : X ⟶ Y) (g : Y ⟶ Z),
  (CategoryTheory.CategoryStruct.comp f g).val = CategoryTheory.CategoryStruct.comp f.val g.val


@[to_additive sub_nsmul_neg]
theorem inv_pow_sub (a : G) {m n : ℕ} (h : n ≤ m) : a⁻¹ ^ (m - n) = (a ^ m)⁻¹ * a ^ n

{G : Type u_3}
[Group G]
(a : G)
{m n : ℕ}
(h : n ≤ m)


theorem has_good_supp_iff {α : TypeVec n} (x : F α) :
    (∀ p, LiftP p x ↔ ∀ (i), ∀ u ∈ supp x i, p i u) ↔
      ∃ a f, abs ⟨a, f⟩ = x ∧ ∀ i a' f', abs ⟨a', f'⟩ = x → f i '' univ ⊆ f' i '' univ

{n : ℕ}
{F : TypeVec.{u} n → Type u_1}
[q : MvQPF F]
{α : TypeVec.{u} n}
(x : F α)

(∀ (p : (i : Fin2 n) → α i → Prop), MvFunctor.LiftP p x ↔ ∀ (i : Fin2 n), ∀ u ∈ MvFunctor.supp x i, p i u) ↔
  ∃ a f,
    MvQPF.abs ⟨a, f⟩ = x ∧
      ∀ (i : Fin2 n) (a' : (MvQPF.P F).A) (f' : (MvQPF.P F).B a' ⟹ α),
        MvQPF.abs ⟨a', f'⟩ = x → f i '' Set.univ ⊆ f' i '' Set.univ


@[simp]
theorem sym_eq_empty : s.sym n = ∅ ↔ n ≠ 0 ∧ s = ∅

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


@[to_additive addMeasure_map_restrict_apply]
lemma measure_map_restrict_apply (s : Set α) {U : Set (Quotient α_mod_G)}
    (meas_U : MeasurableSet U) :
    (μ.restrict s).map π U = μ ((π ⁻¹' U) ∩ s)

{U : Set (Quotient (MulAction.orbitRel G α))}

(MeasureTheory.Measure.map (Quotient.mk (MulAction.orbitRel G α)) (μ.restrict s)) U =
  μ (Quotient.mk (MulAction.orbitRel G α) ⁻¹' U ∩ s)


@[to_additive (attr := simp)]
theorem comp_id : p.comp (MonoidHom.id _) = p

{E : Type u_4}
[AddGroup E]
(p : AddGroupSeminorm E)


@[simp]
lemma toFinite_zero : Measure.toFinite (0 : Measure α) = 0


protected theorem sub (hm : IsPeriodicPt f m x) (hn : IsPeriodicPt f n x) :
    IsPeriodicPt f (m - n) x

{α : Type u_1}
{f : α → α}
{x : α}
{m n : ℕ}
(hm : Function.IsPeriodicPt f m x)
(hn : Function.IsPeriodicPt f n x)


/-- A convex function on a segment is upper-bounded by the max of its endpoints. -/
theorem ConvexOn.le_on_segment' (hf : ConvexOn 𝕜 s f) {x y : E} (hx : x ∈ s) (hy : y ∈ s) {a b : 𝕜}
    (ha : 0 ≤ a) (hb : 0 ≤ b) (hab : a + b = 1) : f (a • x + b • y) ≤ max (f x) (f y)

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_5}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[LinearOrderedAddCommMonoid β]
[SMul 𝕜 E]
[Module 𝕜 β]
[OrderedSMul 𝕜 β]
{s : Set E}
{f : E → β}
(hf : ConvexOn 𝕜 s f)
{x y : E}
(hx : x ∈ s)
(hy : y ∈ s)
{a b : 𝕜}
(ha : 0 ≤ a)
(hb : 0 ≤ b)
(hab : a + b = 1)


theorem isAdjointPair_unique_of_nondegenerate (B : BilinForm R₁ M₁) (b : B.Nondegenerate)
    (φ ψ₁ ψ₂ : M₁ →ₗ[R₁] M₁) (hψ₁ : IsAdjointPair B B ψ₁ φ) (hψ₂ : IsAdjointPair B B ψ₂ φ) :
    ψ₁ = ψ₂

{R₁ : Type u_3}
{M₁ : Type u_4}
[CommRing R₁]
[AddCommGroup M₁]
[Module R₁ M₁]
(B : LinearMap.BilinForm R₁ M₁)
(b : B.Nondegenerate)
(φ ψ₁ ψ₂ : M₁ →ₗ[R₁] M₁)
(hψ₁ : B.IsAdjointPair B ψ₁ φ)
(hψ₂ : B.IsAdjointPair B ψ₂ φ)


lemma eq_div_of_mul_eq (hc : c ≠ 0) : a * c = b → a = b / c

{G₀ : Type u_3}
[GroupWithZero G₀]
{a b c : G₀}
(hc : c ≠ 0)


theorem le_iff' (hf : f.support ⊆ s) : f ≤ g ↔ ∀ i ∈ s, f i ≤ g i

[(i : ι) → CanonicallyOrderedAddCommMonoid (α i)]

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


theorem Nat.le_of_succ_le_succ {n m : Nat} : LE.le (succ n) (succ m) → LE.le n m


theorem isBounded_image2 (f : α → β → γ) {K₁ K₂ : ℝ≥0} {s : Set α} {t : Set β}
    (hs : Bornology.IsBounded s) (ht : Bornology.IsBounded t)
    (hf₁ : ∀ b ∈ t, LipschitzOnWith K₁ (fun a => f a b) s)
    (hf₂ : ∀ a ∈ s, LipschitzOnWith K₂ (f a) t) : Bornology.IsBounded (Set.image2 f s t)

(f : α → β → γ)


theorem disjoint_atBot_principal_Ioi [Preorder α] (x : α) : Disjoint atBot (𝓟 (Ioi x))


@[simp, mfld_simps]
theorem coe_transDiffeomorph_symm : ⇑(I.transDiffeomorph e).symm = I.symm ∘ e.symm

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{E' : Type u_3}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H : Type u_5}
[TopologicalSpace H]
(I : ModelWithCorners 𝕜 E H)
(e : E ≃ₘ⟮𝓘(𝕜, E), 𝓘(𝕜, E')⟯ E')

↑(I.transDiffeomorph e).symm = ↑I.symm ∘ ⇑e.symm


/-- The short complex `L₀.X₃ ⟶ L₃.X₁ ⟶ L₃.X₂`. -/
@[simps]
noncomputable def L₂' : ShortComplex C

(S : CategoryTheory.ShortComplex.SnakeInput C)


theorem injective_codRestrict (f : F) (S : NonUnitalSubalgebra R B) (hf : ∀ x : A, f x ∈ S) :
    Function.Injective (NonUnitalAlgHom.codRestrict f S hf) ↔ Function.Injective f

{F : Type v'}
{R : Type u}
{A : Type v}
{B : Type w}
[CommSemiring R]
[NonUnitalNonAssocSemiring A]
[Module R A]
[NonUnitalNonAssocSemiring B]
[Module R B]
[FunLike F A B]
[NonUnitalAlgHomClass F R A B]
(f : F)
(S : NonUnitalSubalgebra R B)
(hf : ∀ (x : A), f x ∈ S)

Function.Injective ⇑(NonUnitalAlgHom.codRestrict f S hf) ↔ Function.Injective ⇑f


@[simp]
theorem getElem_zip {l : List α} {l' : List β} {i : Nat} {h : i < (zip l l').length} :
    (zip l l')[i] =
      (l[i]'(lt_length_left_of_zip h), l'[i]'(lt_length_right_of_zip h))

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


theorem Theory.simpleGraph_isSatisfiable : Theory.IsSatisfiable Theory.simpleGraph


theorem inversion_vsub_center (c : P) (R : ℝ) (x : P) :
    inversion c R x -ᵥ c = (R / dist x c) ^ 2 • (x -ᵥ c)

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

EuclideanGeometry.inversion c R x -ᵥ c = (R / dist x c) ^ 2 • (x -ᵥ c)


theorem subsingleton_of_subset_singleton (h : s ⊆ {a}) : s.Subsingleton

{α : Type u}
{a : α}
{s : Set α}
(h : s ⊆ {a})


/-- Useful in proofs by induction. -/
theorem forall_of_forall_cons {p : α → Prop} {h : a ∉ s} (H : ∀ x, x ∈ cons a s h → p x) (x)
    (h : x ∈ s) : p x

{α : Type u_1}
{s : Finset α}
{a : α}
{p : α → Prop}
{h : a ∉ s}
(H : ∀ x ∈ Finset.cons a s h, p x)
(x : α)


theorem norm_condexpInd_le : ‖(condexpInd G hm μ s : G →L[ℝ] α →₁[μ] G)‖ ≤ (μ s).toReal

{α : Type u_1}
{G : Type u_5}
[NormedAddCommGroup G]
{m m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s : Set α}
[NormedSpace ℝ G]
{hm : m ≤ m0}
[MeasureTheory.SigmaFinite (μ.trim hm)]

‖MeasureTheory.condexpInd G hm μ s‖ ≤ (μ s).toReal


/-- The preimage under the projection from the tangent bundle of a set with unique differential in
the basis also has unique differential. -/
theorem UniqueMDiffOn.tangentBundle_proj_preimage (hs : UniqueMDiffOn I s) :
    UniqueMDiffOn I.tangent (π E (TangentSpace I) ⁻¹' s)

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

UniqueMDiffOn I.tangent (Bundle.TotalSpace.proj ⁻¹' s)


theorem disjoint_sup_left_of_disjoint_sup_right [Lattice α] [OrderBot α]
    [IsModularLattice α] (h : Disjoint b c) (hsup : Disjoint a (b ⊔ c)) :
    Disjoint (a ⊔ b) c

{α : Type u_1}
{a b c : α}
[Lattice α]
[OrderBot α]
[IsModularLattice α]
(h : Disjoint b c)
(hsup : Disjoint a (b ⊔ c))


@[simp]
theorem mk_preimage_prod_right (ha : a ∈ s) : Prod.mk a ⁻¹' s ×ˢ t = t

{α : Type u_1}
{β : Type u_2}
{s : Set α}
{t : Set β}
{a : α}
(ha : a ∈ s)


@[simp]
theorem toList_eq_singleton_iff {a : α} {s : Finset α} : s.toList = [a] ↔ s = {a}


/-- If `J` is `u`-small, the category of `R`-modules has limits of shape `J`. -/
lemma hasLimitsOfShape [Small.{w} J] : HasLimitsOfShape J (ModuleCat.{w} R)

{R : Type u}
[Ring R]
{J : Type v}
[CategoryTheory.Category.{t, v} J]
[Small.{w, v} J]

CategoryTheory.Limits.HasLimitsOfShape J (ModuleCat R)


/-- In a strictly convex space, if `x` and `y` are not in the same ray, then `‖x + y‖ < ‖x‖ + ‖y‖`.
-/
theorem norm_add_lt_of_not_sameRay (h : ¬SameRay ℝ x y) : ‖x + y‖ < ‖x‖ + ‖y‖

{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[StrictConvexSpace ℝ E]
{x y : E}
(h : ¬SameRay ℝ x y)


@[to_additive]
theorem ball_mul_singleton : ball x δ * {y} = ball (x * y) δ

{E : Type u_1}
[SeminormedAddCommGroup E]
(δ : ℝ)
(x y : E)

Metric.ball x δ + {y} = Metric.ball (x + y) δ


theorem MvPolynomial.prod_X_add_C_coeff (k : ℕ) (h : k ≤ card σ) :
    (∏ i : σ, (Polynomial.X + Polynomial.C (MvPolynomial.X i)) : Polynomial _).coeff k =
    MvPolynomial.esymm σ R (card σ - k)

(R : Type u_1)
(σ : Type u_2)
[CommSemiring R]
[Fintype σ]
(k : ℕ)
(h : k ≤ Fintype.card σ)

(∏ i : σ, (Polynomial.X + Polynomial.C (MvPolynomial.X i))).coeff k = MvPolynomial.esymm σ R (Fintype.card σ - k)


@[simp]
theorem smul_comp {V : Type*} [NormedAddCommGroup V] [NormedSpace 𝕜 V] (r : 𝕜)
    (g : C^∞⟮I'', N'; 𝓘(𝕜, V), V⟯) (h : C^∞⟮I, N; I'', N'⟯) : (r • g).comp h = r • g.comp h

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_4}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{N : Type u_6}
[TopologicalSpace N]
[ChartedSpace H N]
{E'' : Type u_7}
[NormedAddCommGroup E'']
[NormedSpace 𝕜 E'']
{H'' : Type u_8}
[TopologicalSpace H'']
{I'' : ModelWithCorners 𝕜 E'' H''}
{N' : Type u_9}
[TopologicalSpace N']
[ChartedSpace H'' N']
{V : Type u_10}
[NormedAddCommGroup V]
[NormedSpace 𝕜 V]
(r : 𝕜)
(g : C^⊤⟮I'', N'; 𝓘(𝕜, V), V⟯)
(h : C^⊤⟮I, N; I'', N'⟯)


@[to_additive]
theorem finprod_mem_eq_toFinset_prod (f : α → M) (s : Set α) [Fintype s] :
    ∏ᶠ i ∈ s, f i = ∏ i ∈ s.toFinset, f i

{α : Type u_1}
{M : Type u_5}
[CommMonoid M]
(f : α → M)
(s : Set α)
[Fintype ↑s]

∏ᶠ (i : α) (_ : i ∈ s), f i = ∏ i ∈ s.toFinset, f i


protected theorem uniformContinuous (f : NormedAddGroupHom V₁ V₂) : UniformContinuous f

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


theorem iIndep.iIndepSets {_mΩ : MeasurableSpace Ω}
    {κ : Kernel α Ω} {μ : Measure α} {m : ι → MeasurableSpace Ω}
    {s : ι → Set (Set Ω)} (hms : ∀ n, m n = generateFrom (s n)) (h_indep : iIndep m κ μ) :
    iIndepSets s κ μ

(hms : ∀ (n : ι), m n = MeasurableSpace.generateFrom (s n))

(h_indep : ProbabilityTheory.Kernel.iIndep m κ μ)

ProbabilityTheory.Kernel.iIndepSets s κ μ


@[simp]
theorem lift_root (h : IsAdjoinRoot S f) : h.lift i x hx h.root = x

{R : Type u}
{S : Type v}
[CommRing R]
[Ring S]
{f : R[X]}
[Algebra R S]
{T : Type u_1}
[CommRing T]
{i : R →+* T}
{x : T}
(hx : Polynomial.eval₂ i x f = 0)
(h : IsAdjoinRoot S f)


protected theorem map_sub : f (x - y) = f x - f y

{R : Type u_4}
{S : Type u_5}
[NonUnitalNonAssocRing R]
[NonUnitalNonAssocRing S]
(f : R ≃+* S)
(x y : R)


/-- Note: this lemma is specifically about `Fintype.ofIsEmpty`. For a statement about
arbitrary `Fintype` instances, use `Finset.univ_eq_empty`. -/
theorem univ_ofIsEmpty [IsEmpty α] : @univ α Fintype.ofIsEmpty = ∅


/-- If a function is differentiable and injective on a measurable set `s`, then its restriction
to `s` is a measurable embedding. -/
theorem measurableEmbedding_of_fderivWithin (hs : MeasurableSet s)
    (hf' : ∀ x ∈ s, HasFDerivWithinAt f (f' x) s x) (hf : InjOn f s) :
    MeasurableEmbedding (s.restrict f)


theorem principal_add_iff_add_left_eq_self {o : Ordinal} :
    Principal (· + ·) o ↔ ∀ a < o, a + o = o

Ordinal.Principal (fun x x_1 => x + x_1) o ↔ ∀ a < o, a + o = o


lemma mul_def (x y : ⨂[R] i, A i) : x * y = mul x y

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

[∀ (i : ι), SMulCommClass R (A i) (A i)]

[∀ (i : ι), IsScalarTower R (A i) (A i)]


/-- If we have `IsCofiltered C`, then for any functor `F : J ⥤ C` with `FinCategory J`,
there exists a cone over `F`.
-/
theorem cone_nonempty (F : J ⥤ C) : Nonempty (Cone F)

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.IsCofiltered C]
{J : Type w}
[CategoryTheory.SmallCategory J]
[CategoryTheory.FinCategory J]
(F : CategoryTheory.Functor J C)


theorem toSignedMeasure_eq_toSignedMeasure_iff {μ ν : Measure α} [IsFiniteMeasure μ]
    [IsFiniteMeasure ν] : μ.toSignedMeasure = ν.toSignedMeasure ↔ μ = ν

{α : Type u_1}
{m : MeasurableSpace α}
{μ ν : MeasureTheory.Measure α}
[MeasureTheory.IsFiniteMeasure μ]
[MeasureTheory.IsFiniteMeasure ν]


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

{α : Type u_3}
{β : Type u_4}
{γ : Type u_5}
[Inf α]
[Inf β]
[Inf γ]
(f : InfHom β γ)
(g : InfHom α β)


lemma oddKernel_zero (x : ℝ) : oddKernel 0 x = 0


lemma Module.Finite.exists_smul_of_comp_eq_of_isLocalizedModule
    [hM : Module.Finite R M] (g₁ g₂ : M →ₗ[R] N) (h : f.comp g₁ = f.comp g₂) :
    ∃ (s : S), s • g₁ = s • g₂

{R : Type u_1}
{M : Type u_2}
{N : Type u_3}
{N' : Type u_4}
[CommRing R]
[AddCommGroup M]
[Module R M]
[AddCommGroup N]
[Module R N]
[AddCommGroup N']
[Module R N']
(S : Submonoid R)
(f : N →ₗ[R] N')
[IsLocalizedModule S f]
[hM : Module.Finite R M]
(g₁ g₂ : M →ₗ[R] N)
(h : f ∘ₗ g₁ = f ∘ₗ g₂)


@[simp]
theorem rotation_apply (a : circle) (z : ℂ) : rotation a z = a * z


theorem sinh_sub : sinh (x - y) = sinh x * cosh y - cosh x * sinh y

Real.sinh (x - y) = Real.sinh x * Real.cosh y - Real.cosh x * Real.sinh y


@[simp]
theorem mem_pure : b ∈ pure a ↔ b = a

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


/-- If `n` has only one element, the determinant of an `n` by `n` matrix is just that element.
Although `Unique` implies `DecidableEq` and `Fintype`, the instances might
not be syntactically equal. Thus, we need to fill in the args explicitly. -/
@[simp]
theorem det_unique {n : Type*} [Unique n] [DecidableEq n] [Fintype n] (A : Matrix n n R) :
    det A = A default default

{R : Type v}
[CommRing R]
{n : Type u_3}
[Unique n]
[DecidableEq n]
[Fintype n]
(A : Matrix n n R)


theorem of_inter_eq_of_symmDiff_eq_zero_negative (hu : MeasurableSet u) (hv : MeasurableSet v)
    (hw : MeasurableSet w) (hsu : s ≤[u] 0) (hsv : s ≤[v] 0) (hs : s (u ∆ v) = 0) :
    s (w ∩ u) = s (w ∩ v)

(hsu : MeasureTheory.VectorMeasure.restrict s u ≤ MeasureTheory.VectorMeasure.restrict 0 u)

(hsv : MeasureTheory.VectorMeasure.restrict s v ≤ MeasureTheory.VectorMeasure.restrict 0 v)


/-- A function `f` maps upwards closed sets (atTop sets) to upwards closed sets when it is a
Galois insertion. The Galois "insertion" and "connection" is weakened to only require it to be an
insertion and a connection above `b'`. -/
theorem map_atTop_eq_of_gc [SemilatticeSup α] [SemilatticeSup β] {f : α → β} (g : β → α) (b' : β)
    (hf : Monotone f) (gc : ∀ a, ∀ b ≥ b', f a ≤ b ↔ a ≤ g b) (hgi : ∀ b ≥ b', b ≤ f (g b)) :
    map f atTop = atTop

(gc : ∀ (a : α), ∀ b ≥ b', f a ≤ b ↔ a ≤ g b)

Filter.map f Filter.atTop = Filter.atTop


theorem Nat.succ.inj {m n : Nat} : m.succ = n.succ → m = n


/-- The composition of an orthogonal family of subspaces with an injective function is also an
orthogonal family. -/
theorem OrthogonalFamily.comp {γ : Type*} {f : γ → ι} (hf : Function.Injective f) :
    OrthogonalFamily 𝕜 (fun g => G (f g)) fun g => V (f g)

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{ι : Type u_4}
{G : ι → Type u_5}
[(i : ι) → NormedAddCommGroup (G i)]
[(i : ι) → InnerProductSpace 𝕜 (G i)]
{V : (i : ι) → G i →ₗᵢ[𝕜] E}
(hV : OrthogonalFamily 𝕜 G V)
{γ : Type u_6}
{f : γ → ι}
(hf : Function.Injective f)


@[simp]
theorem colimit.post_desc (c : Cocone F) :
    colimit.post F G ≫ G.map (colimit.desc F c) = colimit.desc (F ⋙ G) (G.mapCocone c)

[CategoryTheory.Limits.HasColimit (F ⋙ G)]

CategoryTheory.Limits.colimit.post F G ≫ G.map (CategoryTheory.Limits.colimit.desc F c) =
  CategoryTheory.Limits.colimit.desc (F ⋙ G) (G.mapCocone c)


lemma cons_getVert {u v w n} (p : G.Walk v w) (h : G.Adj u v) (hn : n ≠ 0) :
    (p.cons h).getVert n = p.getVert (n - 1)

{V : Type u}
{G : SimpleGraph V}
{u v w : V}
{n : ℕ}
(p : G.Walk v w)
(h : G.Adj u v)
(hn : n ≠ 0)

(SimpleGraph.Walk.cons h p).getVert n = p.getVert (n - 1)


theorem _root_.LE.le.isOpenPosMeasure (h : μ ≤ ν) : IsOpenPosMeasure ν

{X : Type u_1}
[TopologicalSpace X]
{m : MeasurableSpace X}
{μ ν : MeasureTheory.Measure X}
[μ.IsOpenPosMeasure]
(h : μ ≤ ν)


@[simp]
theorem units_inv_apply_apply (f : CircleDeg1Liftˣ) (x : ℝ) :
    (f⁻¹ : CircleDeg1Liftˣ) (f x) = x


theorem Finite.encard_lt_top (h : s.Finite) : s.encard < ⊤

{α : Type u_1}
{s : Set α}
(h : s.Finite)


@[simp] theorem replicate_inj : replicate n a = replicate m b ↔ n = m ∧ (n = 0 ∨ a = b)

∀ {α : Type u_1} {a : α} {m : Nat} {b : α}, List.replicate n a = List.replicate m b ↔ n = m ∧ (n = 0 ∨ a = b)


@[simp]
theorem equiv_symm_snd (x : α × β) : ((WithLp.equiv p (α × β)).symm x).snd = x.snd

{p : ℝ≥0∞}
{α : Type u_2}
{β : Type u_3}
(x : α × β)

((WithLp.equiv p (α × β)).symm x).2 = x.2


theorem monic_zero_iff_subsingleton' :
    Monic (0 : R[X]) ↔ (∀ f g : R[X], f = g) ∧ ∀ a b : R, a = b

Polynomial.Monic 0 ↔ (∀ (f g : R[X]), f = g) ∧ ∀ (a b : R), a = b


theorem Sublist.erase (a : α) {l₁ l₂ : List α} (h : l₁ <+ l₂) : l₁.erase a <+ l₂.erase a

{α : Type u_1}
[BEq α]
(a : α)
{l₁ l₂ : List α}
(h : l₁ <+ l₂)


theorem Iio_subset_Iio_union_Ico : Iio b ⊆ Iio a ∪ Ico a b

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


theorem Sylow.smul_eq_of_normal {g : G} {P : Sylow p G} [h : (P : Subgroup G).Normal] :
    g • P = P

{p : ℕ}
{G : Type u_1}
[Group G]
{g : G}
{P : Sylow p G}
[h : (↑P).Normal]


protected theorem one_mul (x : A ⊗[R] B) : mul (1 ⊗ₜ 1) x = x

{R : Type uR}
{A : Type uA}
{B : Type uB}
[CommSemiring R]
[NonAssocSemiring A]
[Module R A]
[SMulCommClass R A A]
[IsScalarTower R A A]
[NonAssocSemiring B]
[Module R B]
[SMulCommClass R B B]
[IsScalarTower R B B]
(x : A ⊗[R] B)

(Algebra.TensorProduct.mul (1 ⊗ₜ[R] 1)) x = x


@[simp]
theorem coordChangeL_prod [e₁.IsLinear 𝕜] [e₁'.IsLinear 𝕜] [e₂.IsLinear 𝕜] [e₂'.IsLinear 𝕜] ⦃b⦄
    (hb : b ∈ (e₁.prod e₂).baseSet ∩ (e₁'.prod e₂').baseSet) :
    ((e₁.prod e₂).coordChangeL 𝕜 (e₁'.prod e₂') b : F₁ × F₂ →L[𝕜] F₁ × F₂) =
      (e₁.coordChangeL 𝕜 e₁' b : F₁ →L[𝕜] F₁).prodMap (e₂.coordChangeL 𝕜 e₂' b)

[TopologicalSpace (Bundle.TotalSpace F₁ E₁)]

[TopologicalSpace (Bundle.TotalSpace F₂ E₂)]

(e₁ e₁' : Trivialization F₁ Bundle.TotalSpace.proj)

(e₂ e₂' : Trivialization F₂ Bundle.TotalSpace.proj)

↑(Trivialization.coordChangeL 𝕜 (e₁.prod e₂) (e₁'.prod e₂') b) =
  (↑(Trivialization.coordChangeL 𝕜 e₁ e₁' b)).prodMap ↑(Trivialization.coordChangeL 𝕜 e₂ e₂' b)


lemma isIso_counit_of_iso (adj : L ⊣ R) (j : R ⋙ L ≅ 𝟭 D) : IsIso adj.counit

(j : R.comp L ≅ CategoryTheory.Functor.id D)


lemma zpow_eq_zero_iff {n : ℤ} (hn : n ≠ 0) : a ^ n = 0 ↔ a = 0

{G₀ : Type u_3}
[GroupWithZero G₀]
{a : G₀}
{n : ℤ}
(hn : n ≠ 0)


/-- The `AddEquiv` between spaces of matrices induced by an `AddEquiv` between their
coefficients. This is `Matrix.map` as an `AddEquiv`. -/
@[simps apply]
def mapMatrix (f : α ≃+ β) : Matrix m n α ≃+ Matrix m n β

{m : Type u_2}
{n : Type u_3}
{α : Type v}
{β : Type w}
[Add α]
[Add β]
(f : α ≃+ β)
(M : Matrix m n α)


@[simp, norm_cast]
theorem coe_eq_zero {f : α →₀ M} : (f : α → M) = 0 ↔ f = 0

{α : Type u_1}
{M : Type u_5}
[Zero M]
{f : α →₀ M}


theorem tendsto_ae (h : QuasiMeasurePreserving f μa μb) : Tendsto f (ae μa) (ae μb)

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

Filter.Tendsto f (MeasureTheory.ae μa) (MeasureTheory.ae μb)


@[simp, norm_cast] lemma natCast_natAbs (n : ℤ) : (n.natAbs : ℤ) = |n|


theorem convolutionExistsAt_flip :
    ConvolutionExistsAt g f x L.flip μ ↔ ConvolutionExistsAt f g x L μ

{𝕜 : Type u𝕜}
{G : Type uG}
{E : Type uE}
{E' : Type uE'}
{F : Type uF}
[NormedAddCommGroup E]
[NormedAddCommGroup E']
[NormedAddCommGroup F]
{f : G → E}
{g : G → E'}
{x : G}
[NontriviallyNormedField 𝕜]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜 E']
[NormedSpace 𝕜 F]
{L : E →L[𝕜] E' →L[𝕜] F}
[MeasurableSpace G]
{μ : MeasureTheory.Measure G}
[AddCommGroup G]
[MeasurableNeg G]
[μ.IsAddLeftInvariant]
[MeasurableAdd G]
[μ.IsNegInvariant]

MeasureTheory.ConvolutionExistsAt g f x L.flip μ ↔ MeasureTheory.ConvolutionExistsAt f g x L μ


theorem insert_ae_eq_self (a : α) (s : Set α) : (insert a s : Set α) =ᵐ[μ] s

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


theorem diam_thickening_le {α : Type*} [PseudoMetricSpace α] (s : Set α) (hε : 0 ≤ ε) :
    diam (thickening ε s) ≤ diam s + 2 * ε

{ε : ℝ}
{α : Type u_2}
[PseudoMetricSpace α]
(s : Set α)
(hε : 0 ≤ ε)

Metric.diam (Metric.thickening ε s) ≤ Metric.diam s + 2 * ε


@[simp] lemma map_negY : negY (W'.map f) (f ∘ P) = f (W'.negY P)

{R : Type u}
[CommRing R]
{W' : WeierstrassCurve.Jacobian R}
{S : Type u_1}
[CommRing S]
(f : R →+* S)
(P : Fin 3 → R)

WeierstrassCurve.Jacobian.negY (WeierstrassCurve.map W' f) (⇑f ∘ P) = f (W'.negY P)


theorem eq_sInf_of_mem_iff_exists_mem {S : Set (Filter α)} {l : Filter α}
    (h : ∀ {s}, s ∈ l ↔ ∃ f ∈ S, s ∈ f) : l = sInf S

(h : ∀ {s : Set α}, s ∈ l ↔ ∃ f ∈ S, s ∈ f)


protected theorem prod_mk {m : MeasurableSpace α} [TopologicalSpace β] [TopologicalSpace γ]
    {f : α → β} {g : α → γ} (hf : StronglyMeasurable f) (hg : StronglyMeasurable g) :
    StronglyMeasurable fun x => (f x, g x)

(hf : MeasureTheory.StronglyMeasurable f)

(hg : MeasureTheory.StronglyMeasurable g)

MeasureTheory.StronglyMeasurable fun x => (f x, g x)


/-- This structure permits to define a vector bundle when trivializations are given as local
equivalences but there is not yet a topology on the total space or the fibers.
The total space is hence given a topology in such a way that there is a fiber bundle structure for
which the partial equivalences are also partial homeomorphisms and hence vector bundle
trivializations. The topology on the fibers is induced from the one on the total space.

The field `exists_coordChange` is stated as an existential statement (instead of 3 separate
fields), since it depends on propositional information (namely `e e' ∈ pretrivializationAtlas`).
This makes it inconvenient to explicitly define a `coordChange` function when constructing a
`VectorPrebundle`. -/
-- Porting note(#5171): was @[nolint has_nonempty_instance]
structure VectorPrebundle where
  pretrivializationAtlas : Set (Pretrivialization F (π F E))
  pretrivialization_linear' : ∀ e, e ∈ pretrivializationAtlas → e.IsLinear R
  pretrivializationAt : B → Pretrivialization F (π F E)
  mem_base_pretrivializationAt : ∀ x : B, x ∈ (pretrivializationAt x).baseSet
  pretrivialization_mem_atlas : ∀ x : B, pretrivializationAt x ∈ pretrivializationAtlas
  exists_coordChange : ∀ᵉ (e ∈ pretrivializationAtlas) (e' ∈ pretrivializationAtlas),
    ∃ f : B → F →L[R] F, ContinuousOn f (e.baseSet ∩ e'.baseSet) ∧
      ∀ᵉ (b ∈ e.baseSet ∩ e'.baseSet) (v : F), f b v = (e' ⟨b, e.symm b v⟩).2
  totalSpaceMk_inducing : ∀ b : B, Inducing (pretrivializationAt b ∘ .mk b)

(e : Pretrivialization F Bundle.TotalSpace.proj)

e ∈ self.pretrivializationAtlas → Pretrivialization.IsLinear R e


@[to_additive (attr := simp)]
theorem coe_liftRight {f : M →* N} {g : M → Nˣ} (h : ∀ x, ↑(g x) = f x) (x) :
    (liftRight f g h x : N) = f x

{M : Type u}
{N : Type v}
[Monoid M]
[Monoid N]
{f : M →* N}
{g : M → Nˣ}
(h : ∀ (x : M), ↑(g x) = f x)
(x : M)


/-- The slit plane includes the open unit ball of radius `1` around `1`. -/
lemma ball_one_subset_slitPlane : Metric.ball 1 1 ⊆ slitPlane


theorem det_units_conj' (M : (Matrix m m R)ˣ) (N : Matrix m m R) :
    det ((↑M⁻¹ : Matrix _ _ _) * N * (↑M : Matrix _ _ _)) = det N

{m : Type u_1}
[DecidableEq m]
[Fintype m]
{R : Type v}
[CommRing R]
(M : (Matrix m m R)ˣ)
(N : Matrix m m R)


theorem disjoint_splitCenterBox (I : Box ι) {s t : Set ι} (h : s ≠ t) :
    Disjoint (I.splitCenterBox s : Set (ι → ℝ)) (I.splitCenterBox t)

{ι : Type u_1}
(I : BoxIntegral.Box ι)
{s t : Set ι}
(h : s ≠ t)

Disjoint ↑(I.splitCenterBox s) ↑(I.splitCenterBox t)


theorem eq_or_lt_of_not_lt {a b : α} (h : ¬a < b) : a = b ∨ b < a

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


@[to_additive]
theorem null_iff_of_isMulLeftInvariant [Regular μ] {s : Set G} (hs : IsOpen s) :
    μ s = 0 ↔ s = ∅ ∨ μ = 0

{G : Type u_2}
[MeasurableSpace G]
[TopologicalSpace G]
[BorelSpace G]
{μ : MeasureTheory.Measure G}
[AddGroup G]
[TopologicalAddGroup G]
[μ.IsAddLeftInvariant]
[μ.Regular]
{s : Set G}
(hs : IsOpen s)


/-- Sum of a multiset of elements in a `Subring` of a `Ring` is
in the `Subring`. -/
protected theorem multiset_sum_mem {R} [Ring R] (s : Subring R) (m : Multiset R) :
    (∀ a ∈ m, a ∈ s) → m.sum ∈ s

{R : Type u_1}
[Ring R]
(s : Subring R)
(m : Multiset R)


@[simp]
theorem superFactorial_zero : sf 0 = 1


theorem get?_of_valid (cs cs' : List Char) : get? ⟨cs ++ cs'⟩ ⟨utf8Len cs⟩ = cs'.head?

{ data := cs ++ cs' }.get? { byteIdx := String.utf8Len cs } = cs'.head?


@[simp] theorem toNat_concat (x : BitVec w) (b : Bool) :
    (concat x b).toNat = x.toNat * 2 + b.toNat

(x.concat b).toNat = x.toNat * 2 + b.toNat


theorem freeOn_restrict (h : R ⊆ E) : (freeOn E) ↾ R = freeOn R

{α : Type u_1}
{E R : Set α}
(h : R ⊆ E)

(Matroid.freeOn E).restrict R = Matroid.freeOn R


@[simp] protected lemma LinearOrder.supClosed (s : Set α) : SupClosed s

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


/-- The type of morphisms in the category `Φ.RightResolution X₂` (when `W₁` is multiplicative). -/
@[ext]
structure Hom (R R' : Φ.RightResolution X₂) where
  /-- a morphism in the source category -/
  f : R.X₁ ⟶ R'.X₁
  hf : W₁ f
  comm : R.w ≫ Φ.functor.map f = R'.w := by aesop_cat

{W₁ : CategoryTheory.MorphismProperty C₁}

{W₂ : CategoryTheory.MorphismProperty C₂}

{Φ : CategoryTheory.LocalizerMorphism W₁ W₂}

CategoryTheory.CategoryStruct.comp R.w (Φ.functor.map self.f) = R'.w


lemma _root_.Monotone.mapsTo_uIcc (hf : Monotone f) : MapsTo f (uIcc a b) (uIcc (f a) (f b))

{α : Type u_1}
{β : Type u_2}
[LinearOrder α]
[Lattice β]
{f : α → β}
{a b : α}
(hf : Monotone f)

Set.MapsTo f (Set.uIcc a b) (Set.uIcc (f a) (f b))


@[to_additive (attr := simp)]
theorem one_apply (G H : CommGrp) (g : G) : ((1 : G ⟶ H) : G → H) g = 1


/-- The `stepNormal` function respects the `then k'` homomorphism. Note that this is an exact
equality, not a simulation; the original and embedded machines move in lock-step until the
embedded machine reaches the halt state. -/
theorem stepNormal_then (c) (k k' : Cont) (v) :
    stepNormal c (k.then k') v = (stepNormal c k v).then k'

(c : Turing.ToPartrec.Code)
(k k' : Turing.ToPartrec.Cont)
(v : List ℕ)

Turing.ToPartrec.stepNormal c (k.then k') v = (Turing.ToPartrec.stepNormal c k v).then k'


lemma surjectiveOnStalks_of_exists_div (h : ∀ x : S, ∃ r s : R, IsUnit (f s) ∧ f s * x = f r) :
    SurjectiveOnStalks f

(h : ∀ (x : S), ∃ r s, IsUnit (f s) ∧ f s * x = f r)


@[simp]
protected theorem map_neg {S} [Ring S] (f : R →+* S) : (-p).map f = -p.map f

{R : Type u}
[Ring R]
{p : R[X]}
{S : Type u_1}
[Ring S]
(f : R →+* S)

Polynomial.map f (-p) = -Polynomial.map f p


theorem mk'_smul_mk (r : R) (m : M) (s s' : S) :
    IsLocalization.mk' T r s • mk m s' = mk (r • m) (s * s')

{R : Type u}
[CommSemiring R]
{S : Submonoid R}
{M : Type v}
[AddCommMonoid M]
[Module R M]
(T : Type u_1)
[CommSemiring T]
[Algebra R T]
[IsLocalization S T]
(r : R)
(m : M)
(s s' : ↥S)

IsLocalization.mk' T r s • LocalizedModule.mk m s' = LocalizedModule.mk (r • m) (s * s')


@[simp]
theorem toIcoMod_toIcoMod (a₁ a₂ b : α) : toIcoMod hp a₁ (toIcoMod hp a₂ b) = toIcoMod hp a₁ b

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


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

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


@[simp] lemma floorRoot_zero_left (a : ℕ) : floorRoot 0 a = 0


@[reassoc (attr := simp)]
theorem right_triangle_components :
    adj.unit.app (G.obj Y) ≫ G.map (adj.counit.app Y) = 𝟙 (G.obj Y)

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

CategoryTheory.CategoryStruct.comp (adj.unit.app (G.obj Y)) (G.map (adj.counit.app Y)) =
  CategoryTheory.CategoryStruct.id (G.obj Y)


theorem dropWhile (p : Char → Bool) : ∀ {s}, Valid s → Valid (s.dropWhile p)


theorem opNorm_ext [RingHomIsometric σ₁₃] (f : E →SL[σ₁₂] F) (g : E →SL[σ₁₃] G)
    (h : ∀ x, ‖f x‖ = ‖g x‖) : ‖f‖ = ‖g‖

{𝕜 : Type u_1}
{𝕜₂ : Type u_2}
{𝕜₃ : Type u_3}
{E : Type u_4}
{F : Type u_6}
{G : Type u_8}
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup F]
[SeminormedAddCommGroup G]
[NontriviallyNormedField 𝕜]
[NontriviallyNormedField 𝕜₂]
[NontriviallyNormedField 𝕜₃]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜₂ F]
[NormedSpace 𝕜₃ G]
{σ₁₂ : 𝕜 →+* 𝕜₂}
{σ₁₃ : 𝕜 →+* 𝕜₃}
[RingHomIsometric σ₁₃]
(f : E →SL[σ₁₂] F)
(g : E →SL[σ₁₃] G)
(h : ∀ (x : E), ‖f x‖ = ‖g x‖)


/-- A braided monoidal category is a monoidal category equipped with a braiding isomorphism
`β_ X Y : X ⊗ Y ≅ Y ⊗ X`
which is natural in both arguments,
and also satisfies the two hexagon identities.
-/
class BraidedCategory (C : Type u) [Category.{v} C] [MonoidalCategory.{v} C] where
  /-- The braiding natural isomorphism. -/
  braiding : ∀ X Y : C, X ⊗ Y ≅ Y ⊗ X
  braiding_naturality_right :
    ∀ (X : C) {Y Z : C} (f : Y ⟶ Z),
      X ◁ f ≫ (braiding X Z).hom = (braiding X Y).hom ≫ f ▷ X := by
    aesop_cat
  braiding_naturality_left :
    ∀ {X Y : C} (f : X ⟶ Y) (Z : C),
      f ▷ Z ≫ (braiding Y Z).hom = (braiding X Z).hom ≫ Z ◁ f := by
    aesop_cat
  /-- The first hexagon identity. -/
  hexagon_forward :
    ∀ X Y Z : C,
      (α_ X Y Z).hom ≫ (braiding X (Y ⊗ Z)).hom ≫ (α_ Y Z X).hom =
        ((braiding X Y).hom ▷ Z) ≫ (α_ Y X Z).hom ≫ (Y ◁ (braiding X Z).hom) := by
    aesop_cat
  /-- The second hexagon identity. -/
  hexagon_reverse :
    ∀ X Y Z : C,
      (α_ X Y Z).inv ≫ (braiding (X ⊗ Y) Z).hom ≫ (α_ Z X Y).inv =
        (X ◁ (braiding Y Z).hom) ≫ (α_ X Z Y).inv ≫ ((braiding X Z).hom ▷ Y) := by
    aesop_cat

[self : CategoryTheory.BraidedCategory C]

f ▷ Z ≫ (β_ Y Z).hom = (β_ X Z).hom ≫ Z ◁ f


/-- A morphism of schemes `X ⟶ Y` is affine if
the preimage of any affine open subset of `Y` is affine. -/
@[mk_iff]
class IsAffineHom {X Y : Scheme} (f : X ⟶ Y) : Prop where
  isAffine_preimage : ∀ U : Y.Opens, IsAffineOpen U → IsAffineOpen (f ⁻¹ᵁ U)

{X Y : AlgebraicGeometry.Scheme}
(f : X ⟶ Y)

AlgebraicGeometry.IsAffineHom f ↔
  ∀ (U : Y.Opens),
    AlgebraicGeometry.IsAffineOpen U → AlgebraicGeometry.IsAffineOpen ((TopologicalSpace.Opens.map f.val.base).obj U)


@[to_additive]
protected theorem ext_iff {a b : αˣ} : a = b ↔ (a : α) = b


@[simp]
theorem map_update_zero [DecidableEq ι] (m : ∀ i, M₁ i) (i : ι) : f (update m i 0) = 0

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


/-- If `G` acts isometrically on `X`, then the image of a bounded set in `X` under scalar
multiplication by `c : G` is bounded. See also `Bornology.IsBounded.smul₀` for a similar lemma about
normed spaces. -/
@[to_additive "Given an additive isometric action of `G` on `X`, the image of a bounded set in `X`
under translation by `c : G` is bounded"]
theorem Bornology.IsBounded.smul [PseudoMetricSpace X] [SMul G X] [IsometricSMul G X] {s : Set X}
    (hs : IsBounded s) (c : G) : IsBounded (c • s)

{G : Type v}
{X : Type w}
[PseudoMetricSpace X]
[SMul G X]
[IsometricSMul G X]
{s : Set X}
(hs : Bornology.IsBounded s)
(c : G)


@[to_additive (attr := simp)]
theorem preimage_mul_right_ball [IsometricSMul Gᵐᵒᵖ G] (a b : G) (r : ℝ) :
    (fun x => x * a) ⁻¹' ball b r = ball (b / a) r

{G : Type v}
[Group G]
[PseudoMetricSpace G]
[IsometricSMul Gᵐᵒᵖ G]
(a b : G)
(r : ℝ)

(fun x => x * a) ⁻¹' Metric.ball b r = Metric.ball (b / a) r


theorem wittStructureRat_vars [Fintype idx] (Φ : MvPolynomial idx ℚ) (n : ℕ) :
    (wittStructureRat p Φ n).vars ⊆ Finset.univ ×ˢ Finset.range (n + 1)

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


@[simp]
theorem toAddSubmonoid_eq : p.toAddSubmonoid = q.toAddSubmonoid ↔ p = q

{R : Type u}
{M : Type v}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{p q : Submodule R M}


theorem nat_div : Primrec₂ ((· / ·) : ℕ → ℕ → ℕ)


theorem disjoint_atTop_principal_Iio [Preorder α] (x : α) : Disjoint atTop (𝓟 (Iio x))


theorem condIndepSets_of_condIndepSets_of_le_left {s₁ s₂ s₃ : Set (Set Ω)}
    (h_indep : CondIndepSets m' hm' s₁ s₂ μ) (h31 : s₃ ⊆ s₁) :
    CondIndepSets m' hm' s₃ s₂ μ

(h_indep : ProbabilityTheory.CondIndepSets m' hm' s₁ s₂ μ)

ProbabilityTheory.CondIndepSets m' hm' s₃ s₂ μ


/-- Auxiliary definition:
the diagram whose limit gives the morphism space between two objects of the limit category. -/
@[simps]
def homDiagram {F : J ⥤ Cat.{v, v}} (X Y : limit (F ⋙ Cat.objects.{v, v})) : J ⥤ Type v

{F : CategoryTheory.Functor J CategoryTheory.Cat}

(X Y : CategoryTheory.Limits.limit (F.comp CategoryTheory.Cat.objects))

∀ {X_1 Y_1 : J} (f : X_1 ⟶ Y_1)
  (g :
    CategoryTheory.Limits.limit.π (F.comp CategoryTheory.Cat.objects) X_1 X ⟶
      CategoryTheory.Limits.limit.π (F.comp CategoryTheory.Cat.objects) X_1 Y),
  (CategoryTheory.Cat.HasLimits.homDiagram X Y).map f g =
    CategoryTheory.CategoryStruct.comp (CategoryTheory.eqToHom ⋯)
      (CategoryTheory.CategoryStruct.comp ((F.map f).map g) (CategoryTheory.eqToHom ⋯))


@[to_additive (attr := simp)]
theorem mul_left_inj (a : αˣ) {b c : α} : b * a = c * a ↔ b = c

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


nonrec theorem pi_univ : Measure.pi μ univ = ∏ i, μ i univ

(μ : (i : ι) → MeasureTheory.Measure (α i))

[∀ (i : ι), MeasureTheory.SigmaFinite (μ i)]

(MeasureTheory.Measure.pi μ) Set.univ = ∏ i : ι, (μ i) Set.univ


theorem isUnit_mk'_iff (x : R) (y : I.primeCompl) : IsUnit (mk' S x y) ↔ x ∈ I.primeCompl

{R : Type u_1}
[CommSemiring R]
(S : Type u_2)
[CommSemiring S]
[Algebra R S]
(I : Ideal R)
[hI : I.IsPrime]
[IsLocalization.AtPrime S I]
(x : R)
(y : ↥I.primeCompl)

IsUnit (IsLocalization.mk' S x y) ↔ x ∈ I.primeCompl


theorem isClosed_singleton [T1Space X] {x : X} : IsClosed ({x} : Set X)

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


@[simp]
theorem norm_iteratedFDerivWithin_zero : ‖iteratedFDerivWithin 𝕜 0 f s x‖ = ‖f x‖

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


/--
This is a variant of `GlueData` that only requires conditions on `V (i, j)` when `i ≠ j`.
See `GlueData.ofGlueData'`
-/
structure GlueData' where
  /-- Indexing type of a glue data. -/
  J : Type v
  /-- Objects of a glue data to be glued. -/
  U : J → C
  /-- Objects representing the intersections. -/
  V : ∀ (i j : J), i ≠ j → C
  /-- The inclusion maps of the intersection into the object. -/
  f : ∀ i j h, V i j h ⟶ U i
  f_mono : ∀ i j h, Mono (f i j h) := by infer_instance
  f_hasPullback : ∀ i j k hij hik, HasPullback (f i j hij) (f i k hik) := by infer_instance
  /-- The transition maps between the intersections. -/
  t : ∀ i j h, V i j h ⟶ V j i h.symm
  /-- The transition maps between the intersection of intersections. -/
  t' : ∀ i j k hij hik hjk,
    pullback (f i j hij) (f i k hik) ⟶ pullback (f j k hjk) (f j i hij.symm)
  t_fac : ∀ i j k hij hik hjk, t' i j k hij hik hjk ≫ pullback.snd _ _ =
    pullback.fst _ _ ≫ t i j hij
  t_inv : ∀ i j hij, t i j hij ≫ t j i hij.symm = 𝟙 _
  cocycle : ∀ i j k hij hik hjk, t' i j k hij hik hjk ≫
    t' j k i hjk hij.symm hik.symm ≫ t' k i j hik.symm hjk.symm hij = 𝟙 _

{C : Type u₁}
[CategoryTheory.Category.{v, u₁} C]
(self : CategoryTheory.GlueData' C)
(i j k : self.J)
(hij : i ≠ j)
(hik : i ≠ k)
(hjk : j ≠ k)

CategoryTheory.CategoryStruct.comp (self.t' i j k hij hik hjk)
    (CategoryTheory.Limits.pullback.snd (self.f j k hjk) (self.f j i ⋯)) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.Limits.pullback.fst (self.f i j hij) (self.f i k hik))
    (self.t i j hij)


@[simp, reassoc]
lemma Scheme.restrictRestrict_inv_restrict_restrict (X : Scheme.{u}) (U : X.Opens)
    (V : U.toScheme.Opens) :
    (X.restrictRestrict U V).inv ≫ V.ι ≫ U.ι = Opens.ι _

(X : AlgebraicGeometry.Scheme)
(U : X.Opens)
(V : (↑U).Opens)

(X.restrictRestrict U V).inv ≫ V.ι ≫ U.ι = ((AlgebraicGeometry.Scheme.Hom.opensFunctor U.ι).obj V).ι


theorem factorial_tendsto_atTop : Tendsto Nat.factorial atTop atTop

Filter.Tendsto Nat.factorial Filter.atTop Filter.atTop


/-- The Grothendieck construction applied to a functor to `Type`
(thought of as a functor to `Cat` by realising a type as a discrete category)
is the same as the 'category of elements' construction.
-/
-- See porting note on grothendieckTypeToCatInverse.
-- We just want to turn off grothendieckTypeToCat_inverse_map_fiber_down_down,
-- so have to list the complement here for `@[simps]`.
@[simps! functor_obj_fst functor_obj_snd functor_map_coe inverse_obj_base inverse_obj_fiber_as
  inverse_map_base unitIso_hom_app_base unitIso_hom_app_fiber unitIso_inv_app_base
  unitIso_inv_app_fiber counitIso_hom_app_coe counitIso_inv_app_coe]
def grothendieckTypeToCat : Grothendieck (G ⋙ typeToCat) ≌ G.Elements

(X : CategoryTheory.Grothendieck (G.comp CategoryTheory.typeToCat))

((CategoryTheory.Grothendieck.grothendieckTypeToCat G).unitIso.inv.app X).fiber = CategoryTheory.eqToHom ⋯


/-- Construct an equivalence from functions that are inverse to each other. -/
@[simps]
def ofRightInverseOfCardLE (hαβ : card α ≤ card β) (f : α → β) (g : β → α) (h : RightInverse g f) :
    α ≃ β

{α : Type u_1}
{β : Type u_2}
[Fintype α]
[Fintype β]
(hαβ : Fintype.card α ≤ Fintype.card β)
(f : α → β)
(g : β → α)
(h : Function.RightInverse g f)

∀ (a : β), (Equiv.ofRightInverseOfCardLE hαβ f g h).symm a = g a


theorem decide_false_eq_false (h : Decidable False) : @decide False h = false


theorem comap_id : comap (AlgHom.id R (MvPolynomial σ R)) = id

(σ : Type u_1)
(R : Type u_4)
[CommSemiring R]

MvPolynomial.comap (AlgHom.id R (MvPolynomial σ R)) = id


/-- Another version of `simply_connected_iff_paths_homotopic` -/
theorem simply_connected_iff_paths_homotopic' {Y : Type*} [TopologicalSpace Y] :
    SimplyConnectedSpace Y ↔
      PathConnectedSpace Y ∧ ∀ {x y : Y} (p₁ p₂ : Path x y), Path.Homotopic p₁ p₂

SimplyConnectedSpace Y ↔ PathConnectedSpace Y ∧ ∀ {x y : Y} (p₁ p₂ : Path x y), p₁.Homotopic p₂


lemma SuccOrder.forall_ne_bot_iff
    [Nontrivial α] [PartialOrder α] [OrderBot α] [SuccOrder α] [IsSuccArchimedean α]
    (P : α → Prop) :
    (∀ i, i ≠ ⊥ → P i) ↔ (∀ i, P (SuccOrder.succ i))

{α : Type u_1}
[Nontrivial α]
[PartialOrder α]
[OrderBot α]
[SuccOrder α]
[IsSuccArchimedean α]
(P : α → Prop)

(∀ (i : α), i ≠ ⊥ → P i) ↔ ∀ (i : α), P (SuccOrder.succ i)


@[simp]
theorem toMulBot_lt : toMulBot a < toMulBot b ↔ a < b

{α : Type u}
[Add α]
[Preorder α]
(a b : WithZero (Multiplicative α))

WithZero.toMulBot a < WithZero.toMulBot b ↔ a < b


theorem one_le_iff_zero_lt {x : WithBot ℕ} : 1 ≤ x ↔ 0 < x


lemma hInv_hInv (h : CatCommSq T.functor L R B.functor) :
    hInv T.symm R L B.symm (hInv T L R B h) = h

(h : CategoryTheory.CatCommSq T.functor L R B.functor)

CategoryTheory.CatCommSq.hInv T.symm R L B.symm (CategoryTheory.CatCommSq.hInv T L R B h) = h


@[simp]
theorem toDual_sup' [SemilatticeSup α] {s : Finset ι} (hs : s.Nonempty) (f : ι → α) :
    toDual (s.sup' hs f) = s.inf' hs (toDual ∘ f)

{α : Type u_2}
{ι : Type u_5}
[SemilatticeSup α]
{s : Finset ι}
(hs : s.Nonempty)
(f : ι → α)

OrderDual.toDual (s.sup' hs f) = s.inf' hs (⇑OrderDual.toDual ∘ f)


theorem isTheta_const_mul_left {c : 𝕜} {f : α → 𝕜} (hc : c ≠ 0) :
    (fun x ↦ c * f x) =Θ[l] g ↔ f =Θ[l] g

{α : Type u_1}
{F : Type u_4}
{𝕜 : Type u_14}
[Norm F]
[NormedField 𝕜]
{g : α → F}
{l : Filter α}
{c : 𝕜}
{f : α → 𝕜}
(hc : c ≠ 0)


/-- A typeclass saying that `(p : R × R) ↦ p.1 - p.2` maps any product of bounded sets to a bounded
set. This property automatically holds for seminormed additive groups, but it also holds, e.g.,
for `ℝ≥0`. -/
class BoundedSub (R : Type*) [Bornology R] [Sub R] : Prop where
  isBounded_sub : ∀ {s t : Set R},
    Bornology.IsBounded s → Bornology.IsBounded t → Bornology.IsBounded (s - t)

{R : Type u_1}
[Bornology R]
[Sub R]
[self : BoundedSub R]
{s t : Set R}


/-- The power series expansion of `Real.sin`. -/
theorem Real.hasSum_sin (r : ℝ) :
    HasSum (fun n : ℕ => (-1) ^ n * r ^ (2 * n + 1) / ↑(2 * n + 1)!) (Real.sin r)


theorem not_modEq_iff_ne_mod_zmultiples :
    ¬a ≡ b [PMOD p] ↔ (b : α ⧸ AddSubgroup.zmultiples p) ≠ a

{α : Type u_1}
[AddCommGroup α]
{p a b : α}


@[simp] lemma map_dblZ : dblZ (W'.map f) (f ∘ P) = f (W'.dblZ P)

{R : Type u}
[CommRing R]
{W' : WeierstrassCurve.Jacobian R}
{S : Type u_1}
[CommRing S]
(f : R →+* S)
(P : Fin 3 → R)

WeierstrassCurve.Jacobian.dblZ (WeierstrassCurve.map W' f) (⇑f ∘ P) = f (W'.dblZ P)


theorem natSize_to_nat (n) : natSize n = Nat.size n


@[simp]
theorem cancel_right {g₁ g₂ : β →Co γ} {f : α →Co β} (hf : Surjective f) :
    g₁.comp f = g₂.comp f ↔ g₁ = g₂

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[TopologicalSpace α]
[Preorder α]
[TopologicalSpace β]
[Preorder β]
[TopologicalSpace γ]
[Preorder γ]
{g₁ g₂ : β →Co γ}
{f : α →Co β}
(hf : Function.Surjective ⇑f)


theorem toSemiring_of (f : ∀ i, A i →+ R) (hone hmul) (i : ι) (x : A i) :
    toSemiring f hone hmul (of _ i x) = f _ x

(hone : (f 0) GradedMonoid.GOne.one = 1)

(hmul : ∀ {i j : ι} (ai : A i) (aj : A j), (f (i + j)) (GradedMonoid.GMul.mul ai aj) = (f i) ai * (f j) aj)

(DirectSum.toSemiring f hone hmul) ((DirectSum.of A i) x) = (f i) x


theorem not_mem_singleton_iff {a b : α} : a ∉ ({b} : Set α) ↔ a ≠ b


theorem LinearEquiv.isAssociatedPrime_iff (l : M ≃ₗ[R] M') :
    IsAssociatedPrime I M ↔ IsAssociatedPrime I M'

{R : Type u_1}
[CommRing R]
{I : Ideal R}
{M : Type u_2}
[AddCommGroup M]
[Module R M]
{M' : Type u_3}
[AddCommGroup M']
[Module R M']
(l : M ≃ₗ[R] M')


/-- To construct an isomorphism of algebras, it suffices to give an isomorphism of the As which
commutes with the structure morphisms.
-/
@[simps!]
def isoMk (h : A₀.1 ≅ A₁.1) (w : F.map h.hom ≫ A₁.str = A₀.str ≫ h.hom := by aesop_cat) :
    A₀ ≅ A₁

{A₀ A₁ : CategoryTheory.Endofunctor.Algebra F}

(w : CategoryTheory.CategoryStruct.comp (F.map h.hom) A₁.str = CategoryTheory.CategoryStruct.comp A₀.str h.hom := by
  aesop_cat)

(CategoryTheory.Endofunctor.Algebra.isoMk h w).inv.f = h.inv


theorem admissible_of_one_lt_sumInv {p q r : ℕ+} (H : 1 < sumInv {p, q, r}) :
    Admissible {p, q, r}

(H : 1 < ADEInequality.sumInv {p, q, r})


theorem transfer_eq_map_of_le (hp) (GH : G ≤ H) :
    p.transfer H hp = p.map (SimpleGraph.Hom.mapSpanningSubgraphs GH)

{V : Type u}
{G : SimpleGraph V}
{u v : V}
(p : G.Walk u v)
{H : SimpleGraph V}
(hp : ∀ e ∈ p.edges, e ∈ H.edgeSet)
(GH : G ≤ H)

p.transfer H hp = SimpleGraph.Walk.map (SimpleGraph.Hom.mapSpanningSubgraphs GH) p


theorem coeff_one (k : ℕ) : k.rawCast = (nat_lit 1).rawCast * k


@[simp]
theorem mem_prod {p : Submodule R M} {q : Submodule R M'} {x : M × M'} :
    x ∈ prod p q ↔ x.1 ∈ p ∧ x.2 ∈ q

{R : Type u_1}
{M : Type u_4}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{M' : Type u_9}
[AddCommMonoid M']
[Module R M']
{p : Submodule R M}
{q : Submodule R M'}
{x : M × M'}


lemma covBy_iff_card_sdiff_eq_one : t ⋖ s ↔ t ⊆ s ∧ (s \ t).card = 1

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


@[simp]
theorem zero_scaleRoots (s : R) : scaleRoots 0 s = 0


theorem inner_condexpL2_eq_inner_fun (hm : m ≤ m0) (f g : α →₂[μ] E)
    (hg : AEStronglyMeasurable' m g μ) :
    ⟪(condexpL2 E 𝕜 hm f : α →₂[μ] E), g⟫₂ = ⟪f, g⟫₂

(hg : MeasureTheory.AEStronglyMeasurable' m (↑↑g) μ)

⟪↑((MeasureTheory.condexpL2 E 𝕜 hm) f), g⟫_𝕜 = ⟪f, g⟫_𝕜


theorem toLp_val {f : α → E} (h : Memℒp f p μ) : (toLp f h).1 = AEEqFun.mk f h.1

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

↑(MeasureTheory.Memℒp.toLp f h) = MeasureTheory.AEEqFun.mk f ⋯


theorem T_eq_U_sub_X_mul_U (n : ℤ) : T R n = U R n - X * U R (n - 1)

Polynomial.Chebyshev.T R n = Polynomial.Chebyshev.U R n - Polynomial.X * Polynomial.Chebyshev.U R (n - 1)


@[to_additive]
lemma IsScalarTower.of_smul_one_mul {M N} [Monoid N] [SMul M N]
    (h : ∀ (x : M) (y : N), x • (1 : N) * y = x • y) : IsScalarTower M N N


@[simp]
theorem mk_dest (x : M F) : M.mk (dest x) = x


/-- Order isomorphism between an initial interval in `ℝ≥0∞` and an initial interval in `ℝ≥0`. -/
@[simps! apply_coe]
def orderIsoIicCoe (a : ℝ≥0) : Iic (a : ℝ≥0∞) ≃o Iic a

∀ (a_1 : ↑(Set.Iic ↑a)), ↑((ENNReal.orderIsoIicCoe a) a_1) = (↑a_1).toNNReal


@[simp]
theorem gcd_to_nat (a b) : (gcd a b : ℕ) = Int.gcd a b


/-- See `rank_subsingleton` for the reason that `Nontrivial R` is needed. -/
@[simp]
theorem Submodule.rank_eq_zero [Nontrivial R] [NoZeroSMulDivisors R M] {S : Submodule R M} :
    Module.rank R S = 0 ↔ S = ⊥

{R : Type u}
{M : Type v}
[Ring R]
[AddCommGroup M]
[Module R M]
[Nontrivial R]
[NoZeroSMulDivisors R M]
{S : Submodule R M}


@[simp]
theorem to_subring_eq_top {R A : Type*} [CommRing R] [Ring A] [Algebra R A]
    {S : NonUnitalSubalgebra R A} : S.toNonUnitalSubring = ⊤ ↔ S = ⊤

{R : Type u_2}
{A : Type u_3}
[CommRing R]
[Ring A]
[Algebra R A]
{S : NonUnitalSubalgebra R A}


@[norm_cast]
theorem one_coe : ((1 : ℕ+) : ℕ) = 1


/-- A morphism property `RespectsIso` if it still holds when composed with an isomorphism -/
class RespectsIso (P : MorphismProperty C) : Prop where
  precomp {X Y Z} (e : X ≅ Y) (f : Y ⟶ Z) (hf : P f) : P (e.hom ≫ f)
  postcomp {X Y Z} (e : Y ≅ Z) (f : X ⟶ Y) (hf : P f) : P (f ≫ e.hom)

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{P : CategoryTheory.MorphismProperty C}
[self : P.RespectsIso]
{X Y Z : C}
(e : X ≅ Y)
(f : Y ⟶ Z)
(hf : P f)


/-- If `P₁ x ↔ ... ↔ Pₙ x` for all `x`, then `(∃ x, P₁ x) ↔ ... ↔ (∃ x, Pₙ x)`.
Note: in concrete cases, Lean has trouble finding the list `[P₁, ..., Pₙ]` from the list
`[(∃ x, P₁ x), ..., (∃ x, Pₙ x)]`, but simply providing a list of underscores with the right
length makes it happier.

Example:
```lean
example (P₁ P₂ P₃ : ℕ → Prop) (H : ∀ n, [P₁ n, P₂ n, P₃ n].TFAE) :
    [∃ n, P₁ n, ∃ n, P₂ n, ∃ n, P₃ n].TFAE :=
  exists_tfae [_, _, _] H
```
-/
theorem exists_tfae {α : Type*} (l : List (α → Prop)) (H : ∀ a : α, (l.map (fun p ↦ p a)).TFAE) :
    (l.map (fun p ↦ ∃ a, p a)).TFAE

(H : ∀ (a : α), (List.map (fun p => p a) l).TFAE)


@[simp]
theorem left_inl (n : N) : (inl n : N ⋊[φ] G).left = n

{N : Type u_1}
{G : Type u_2}
[Group N]
[Group G]
{φ : G →* MulAut N}
(n : N)


@[to_additive]
theorem mul_ite {α} [Mul α] (P : Prop) [Decidable P] (a b c : α) :
    (a * if P then b else c) = if P then a * b else a * c

{α : Type u_1}
[Mul α]
(P : Prop)
[Decidable P]
(a b c : α)


theorem perm_replicate_append_replicate {l : List α} {a b : α} {m n : ℕ} (h : a ≠ b) :
    l ~ replicate m a ++ replicate n b ↔ count a l = m ∧ count b l = n ∧ l ⊆ [a, b]

{α : Type u_1}
[DecidableEq α]
{l : List α}
{a b : α}
{m n : ℕ}
(h : a ≠ b)

l.Perm (List.replicate m a ++ List.replicate n b) ↔ List.count a l = m ∧ List.count b l = n ∧ l ⊆ [a, b]


@[to_additive relindex_inf_mul_relindex]
theorem relindex_inf_mul_relindex : H.relindex (K ⊓ L) * K.relindex L = (H ⊓ K).relindex L

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


@[simp] lemma inv_addLeft : (Equiv.addLeft a)⁻¹ = Equiv.addLeft (-a)


@[simp, norm_cast] lemma coe_sInf (S : Set (Sublattice α)) : sInf S = ⋂ L ∈ S, (L : Set α)

{α : Type u_2}
[Lattice α]
(S : Set (Sublattice α))


/-- Convenience constructor for a closure operator using the weaker minimality axiom:
`x ≤ f y → f x ≤ f y`, which is sometimes easier to prove in practice. -/
@[simps]
def mk₂ (f : α → α) (hf : ∀ x, x ≤ f x) (hmin : ∀ ⦃x y⦄, x ≤ f y → f x ≤ f y) :
    ClosureOperator α

(hmin : ∀ ⦃x y : α⦄, x ≤ f y → f x ≤ f y)

(ClosureOperator.mk₂ f hf hmin).IsClosed x = (f x = x)


@[to_additive]
theorem mulSupport_comp_subset {g : M → N} (hg : g 1 = 1) (f : α → M) :
    mulSupport (g ∘ f) ⊆ mulSupport f

{α : Type u_1}
{M : Type u_5}
{N : Type u_7}
[Zero M]
[Zero N]
{g : M → N}
(hg : g 0 = 0)
(f : α → M)

Function.support (g ∘ f) ⊆ Function.support f


theorem sym2_map (f : α → β) (xs : List α) :
    (xs.map f).sym2 = xs.sym2.map (Sym2.map f)

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

(List.map f xs).sym2 = List.map (Sym2.map f) xs.sym2


@[simp]
theorem principal_le_iff : principal x ≤ I ↔ x ∈ I

{P : Type u_1}
[Preorder P]
{I : Order.Ideal P}
{x : P}


theorem chainHeight_image (f : α → β) (hf : ∀ {x y}, x < y ↔ f x < f y) (s : Set α) :
    (f '' s).chainHeight = s.chainHeight

{α : Type u_1}
{β : Type u_2}
[LT α]
[LT β]
(f : α → β)
(hf : ∀ {x y : α}, x < y ↔ f x < f y)
(s : Set α)


private theorem ne_self_add_add_csize : i ≠ i + (n + Char.utf8Size c)


theorem id_mem_of_nonempty_isotropy (c : C) : c ∈ objs S → 𝟙 c ∈ S.arrows c c

{C : Type u}
[CategoryTheory.Groupoid C]
(S : CategoryTheory.Subgroupoid C)
(c : C)

c ∈ S.objs → CategoryTheory.CategoryStruct.id c ∈ S.arrows c c


@[simp]
theorem ker_zero : ker (0 : M →ₛₗ[τ₁₂] M₂) = ⊤

{R : Type u_1}
{R₂ : Type u_3}
{M : Type u_6}
{M₂ : Type u_8}
[Semiring R]
[Semiring R₂]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R₂ M₂]
{τ₁₂ : R →+* R₂}


theorem smul_mat_empty {m' : Type*} (x : α) (A : Fin 0 → m' → α) : x • A = ![]

{α : Type u}
[NonUnitalNonAssocSemiring α]
{m' : Type u_1}
(x : α)
(A : Fin 0 → m' → α)


theorem Heap.WF.tail? (hwf : (s : Heap α).WF le n) : s.tail? le = some tl → tl.WF le 0

{tl : Batteries.BinomialHeap.Imp.Heap α}

(hwf : Batteries.BinomialHeap.Imp.Heap.WF le n s)

Batteries.BinomialHeap.Imp.Heap.tail? le s = some tl → Batteries.BinomialHeap.Imp.Heap.WF le 0 tl


theorem mk_neg {M : Type*} [AddCommGroup M] [Module R M] {m : M} {s : S} : mk (-m) s = -mk m s

{R : Type u}
[CommSemiring R]
{S : Submonoid R}
{M : Type u_2}
[AddCommGroup M]
[Module R M]
{m : M}
{s : ↥S}

LocalizedModule.mk (-m) s = -LocalizedModule.mk m s


/-- A simple function is McShane integrable w.r.t. any locally finite measure. -/
theorem hasBoxIntegral (f : SimpleFunc (ι → ℝ) E) (μ : Measure (ι → ℝ)) [IsLocallyFiniteMeasure μ]
    (I : Box ι) (l : IntegrationParams) (hl : l.bRiemann = false) :
    HasIntegral.{u, v, v} I l f μ.toBoxAdditive.toSMul (f.integral (μ.restrict I))

(f : MeasureTheory.SimpleFunc (ι → ℝ) E)

BoxIntegral.HasIntegral I l (↑f) μ.toBoxAdditive.toSMul (MeasureTheory.SimpleFunc.integral (μ.restrict ↑I) f)


theorem Eq.propIntro {a b : Prop} (h₁ : a → b) (h₂ : b → a) : a = b


@[simp]
theorem Ioo_eq_empty_of_le (h : b ≤ a) : Ioo a b = ∅

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


/-- If `f` is `O(x ^ (-a))` as `x → +∞`, then `log • f` is `O(x ^ (-b))` for every `b < a`. -/
theorem isBigO_rpow_top_log_smul [NormedSpace ℝ E] {a b : ℝ} {f : ℝ → E} (hab : b < a)
    (hf : f =O[atTop] (· ^ (-a))) :
    (fun t : ℝ => log t • f t) =O[atTop] (· ^ (-b))

(hf : f =O[Filter.atTop] fun x => x ^ (-a))

(fun t => Real.log t • f t) =O[Filter.atTop] fun x => x ^ (-b)


lemma monotone_map (F : C ⥤ D) :
    Monotone (map · F)

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{D : Type u_1}
[CategoryTheory.Category.{u_2, u_1} D]
(F : C ⥤ D)


theorem revzip_sublists' (l : List α) : ∀ l₁ l₂, (l₁, l₂) ∈ revzip l.sublists' → l₁ ++ l₂ ~ l

(l₁, l₂) ∈ l.sublists'.revzip → (l₁ ++ l₂).Perm l


theorem close_eq_self_of_isClosed {X : C} {S : Sieve X} (hS : J₁.IsClosed S) : J₁.close S = S

(J₁ : CategoryTheory.GrothendieckTopology C)


/-- If a monotone sequence of functions has an upper bound and the sequence of integrals of these
functions tends to the integral of the upper bound, then the sequence of functions converges
almost everywhere to the upper bound. -/
lemma tendsto_of_lintegral_tendsto_of_monotone {α : Type*} {mα : MeasurableSpace α}
    {f : ℕ → α → ℝ≥0∞} {F : α → ℝ≥0∞} {μ : Measure α}
    (hF_meas : AEMeasurable F μ)
    (hf_tendsto : Tendsto (fun i ↦ ∫⁻ a, f i a ∂μ) atTop (𝓝 (∫⁻ a, F a ∂μ)))
    (hf_mono : ∀ᵐ a ∂μ, Monotone (fun i ↦ f i a))
    (h_bound : ∀ᵐ a ∂μ, ∀ i, f i a ≤ F a) (h_int_finite : ∫⁻ a, F a ∂μ ≠ ∞) :
    ∀ᵐ a ∂μ, Tendsto (fun i ↦ f i a) atTop (𝓝 (F a))

{f : ℕ → α → ℝ≥0∞}

{F : α → ℝ≥0∞}

(hf_tendsto : Filter.Tendsto (fun i => ∫⁻ (a : α), f i a ∂μ) Filter.atTop (𝓝 (∫⁻ (a : α), F a ∂μ)))

(hf_mono : ∀ᵐ (a : α) ∂μ, Monotone fun i => f i a)

(h_bound : ∀ᵐ (a : α) ∂μ, ∀ (i : ℕ), f i a ≤ F a)

∀ᵐ (a : α) ∂μ, Filter.Tendsto (fun i => f i a) Filter.atTop (𝓝 (F a))


/-- A Dedekind domain is an integral domain that is Noetherian, and the
localization at every nonzero prime is a discrete valuation ring.

This is equivalent to `IsDedekindDomain`.
TODO: prove the equivalence.
-/
structure IsDedekindDomainDvr : Prop where
  isNoetherianRing : IsNoetherianRing A
  is_dvr_at_nonzero_prime : ∀ P ≠ (⊥ : Ideal A), ∀ _ : P.IsPrime,
    DiscreteValuationRing (Localization.AtPrime P)

{A : Type u_2}
[CommRing A]
[IsDomain A]
(self : IsDedekindDomainDvr A)


@[simp]
theorem spanExt_app_right : (spanExt iX iY iZ wf wg).app WalkingSpan.right = iZ

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X Y Z X' Y' Z' : C}
(iX : X ≅ X')
(iY : Y ≅ Y')
(iZ : Z ≅ Z')
{f : X ⟶ Y}
{g : X ⟶ Z}
{f' : X' ⟶ Y'}
{g' : X' ⟶ Z'}
(wf : iX.hom ≫ f' = f ≫ iY.hom)
(wg : iX.hom ≫ g' = g ≫ iZ.hom)

(CategoryTheory.Limits.spanExt iX iY iZ wf wg).app CategoryTheory.Limits.WalkingSpan.right = iZ


@[simp]
theorem sym_mono (h : s ⊆ t) (n : ℕ) : s.sym n ⊆ t.sym n

{α : Type u_1}
[DecidableEq α]
{s t : Finset α}
(h : s ⊆ t)
(n : ℕ)


@[simp]
theorem map_sub [DecidableEq ι] (i : ι) (x y : M') :
    g' (update v' i (x - y)) = g' (update v' i x) - g' (update v' i y)

{R : Type u_1}
[Semiring R]
{M' : Type u_5}
[AddCommGroup M']
[Module R M']
{N' : Type u_6}
[AddCommGroup N']
[Module R N']
{ι : Type u_7}
(g' : M' [⋀^ι]→ₗ[R] N')
(v' : ι → M')
[DecidableEq ι]
(i : ι)
(x y : M')

g' (Function.update v' i (x - y)) = g' (Function.update v' i x) - g' (Function.update v' i y)


theorem decide_iff (p : Prop) [d : Decidable p] : decide p = true ↔ p


theorem mk_eq_of_doset_eq {H K : Subgroup G} {a b : G} (h : doset a H K = doset b H K) :
    mk H K a = mk H K b

(h : Doset.doset a ↑H ↑K = Doset.doset b ↑H ↑K)


@[simp] lemma IsLowerSet.disjoint_upperClosure_left (ht : IsLowerSet t) :
    Disjoint ↑(upperClosure s) t ↔ Disjoint s t

{α : Type u_1}
[Preorder α]
{s t : Set α}
(ht : IsLowerSet t)

Disjoint (↑(upperClosure s)) t ↔ Disjoint s t


@[simp]
theorem natSumNatEquivNat_apply : ⇑natSumNatEquivNat = Sum.elim (2 * ·) (2 * · + 1)

⇑Equiv.natSumNatEquivNat = Sum.elim (fun x => 2 * x) fun x => 2 * x + 1