theorem isInteger_or_isInteger [h : ValuationRing R] (x : K) :
    IsLocalization.IsInteger R x ∨ IsLocalization.IsInteger R x⁻¹

(R : Type u_1)
[CommRing R]
[IsDomain R]
{K : Type u_2}
[Field K]
[Algebra R K]
[IsFractionRing R K]
[h : ValuationRing R]
(x : K)


@[simp]
theorem frontier_setOf_lt_im (a : ℝ) : frontier { z : ℂ | a < z.im } = { z | z.im = a }

frontier {z | a < z.im} = {z | z.im = a}


@[simp]
theorem withTop_id : (LatticeHom.id α).withTop = LatticeHom.id _

(LatticeHom.id α).withTop = LatticeHom.id (WithTop α)


/-- If a function f has a derivative f' at x, a rescaled version of f around x converges to f',
i.e., `n (f (x + (1/n) v) - f x)` converges to `f' v`. More generally, if `c n` tends to infinity
and `c n * d n` tends to `v`, then `c n * (f (x + d n) - f x)` tends to `f' v`. This lemma expresses
this fact, for functions having a derivative within a set. Its specific formulation is useful for
tangent cone related discussions. -/
theorem HasFDerivWithinAt.lim (h : HasFDerivWithinAt f f' s x) {α : Type*} (l : Filter α)
    {c : α → 𝕜} {d : α → E} {v : E} (dtop : ∀ᶠ n in l, x + d n ∈ s)
    (clim : Tendsto (fun n => ‖c n‖) l atTop) (cdlim : Tendsto (fun n => c n • d n) l (𝓝 v)) :
    Tendsto (fun n => c n • (f (x + d n) - f x)) l (𝓝 (f' v))

(clim : Filter.Tendsto (fun n => ‖c n‖) l Filter.atTop)

(cdlim : Filter.Tendsto (fun n => c n • d n) l (𝓝 v))

Filter.Tendsto (fun n => c n • (f (x + d n) - f x)) l (𝓝 (f' v))


/-- Combine two `PartialHomeomorph`s using `Set.piecewise`. The source of the new
`PartialHomeomorph` is `s.ite e.source e'.source = e.source ∩ s ∪ e'.source \ s`, and similarly for
target.  The function sends `e.source ∩ s` to `e.target ∩ t` using `e` and
`e'.source \ s` to `e'.target \ t` using `e'`, and similarly for the inverse function.
To ensure the maps `toFun` and `invFun` are inverse of each other on the new `source` and `target`,
the definition assumes that the sets `s` and `t` are related both by `e.is_image` and `e'.is_image`.
To ensure that the new maps are continuous on `source`/`target`, it also assumes that `e.source` and
`e'.source` meet `frontier s` on the same set and `e x = e' x` on this intersection. -/
@[simps! (config := .asFn) toPartialEquiv apply]
def piecewise (e e' : PartialHomeomorph X Y) (s : Set X) (t : Set Y) [∀ x, Decidable (x ∈ s)]
    [∀ y, Decidable (y ∈ t)] (H : e.IsImage s t) (H' : e'.IsImage s t)
    (Hs : e.source ∩ frontier s = e'.source ∩ frontier s)
    (Heq : EqOn e e' (e.source ∩ frontier s)) : PartialHomeomorph X Y

(Heq : Set.EqOn (↑e) (↑e') (e.source ∩ frontier s))

↑(e.piecewise e' s t H H' Hs Heq) = s.piecewise ↑e ↑e'


theorem IsPrime.ne_top {I : Ideal α} (hI : I.IsPrime) : I ≠ ⊤

{α : Type u}
[Semiring α]
{I : Ideal α}
(hI : I.IsPrime)


@[simp]
theorem neLocus_zero_right : f.neLocus 0 = f.support

{α : Type u_1}
{N : Type u_3}
[DecidableEq α]
[DecidableEq N]
[Zero N]
(f : α →₀ N)


@[simp]
theorem sup_const {ι} [_hι : Nonempty ι] (o : Ordinal) : (sup fun _ : ι => o) = o

{ι : Type u_4}
[_hι : Nonempty ι]
(o : Ordinal.{max u_5 u_4})


theorem IsLinearMap.image_convexHull {f : E → F} (hf : IsLinearMap 𝕜 f) (s : Set E) :
    f '' convexHull 𝕜 s = convexHull 𝕜 (f '' s)

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[AddCommMonoid F]
[Module 𝕜 E]
[Module 𝕜 F]
{f : E → F}
(hf : IsLinearMap 𝕜 f)
(s : Set E)

f '' (convexHull 𝕜) s = (convexHull 𝕜) (f '' s)


theorem basicOpen_mul (f g : A) : basicOpen 𝒜 (f * g) = basicOpen 𝒜 f ⊓ basicOpen 𝒜 g

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

ProjectiveSpectrum.basicOpen 𝒜 (f * g) = ProjectiveSpectrum.basicOpen 𝒜 f ⊓ ProjectiveSpectrum.basicOpen 𝒜 g


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

(F : CategoryTheory.Functor C (CategoryTheory.Functor D E))

(CategoryTheory.currying.functor.obj F).map f =
  CategoryTheory.CategoryStruct.comp ((F.map f.1).app X.2) ((F.obj Y.1).map f.2)


@[simp]
theorem enumOrd_univ : enumOrd Set.univ = id


theorem card_support_eq_two :
    f.support.card = 2 ↔
      ∃ (k m : ℕ) (hkm : k < m) (x y : R) (hx : x ≠ 0) (hy : y ≠ 0),
        f = C x * X ^ k + C y * X ^ m

f.support.card = 2 ↔
  ∃ k m,
    ∃ (_ : k < m),
      ∃ x y, ∃ (_ : x ≠ 0) (_ : y ≠ 0), f = Polynomial.C x * Polynomial.X ^ k + Polynomial.C y * Polynomial.X ^ m


/-- To show two sigma pairs of tuples agree, it to show the second elements are related via
`Fin.cast`. -/
theorem sigma_eq_of_eq_comp_cast {α : Type*} :
    ∀ {a b : Σii, Fin ii → α} (h : a.fst = b.fst), a.snd = b.snd ∘ Fin.cast h → a = b

{α : Type u_1}
{a b : (ii : ℕ) × (Fin ii → α)}
(h : a.fst = b.fst)


@[to_additive]
theorem prod_eq_prod_Ico_succ_bot {a b : ℕ} (hab : a < b) (f : ℕ → M) :
    ∏ k ∈ Ico a b, f k = f a * ∏ k ∈ Ico (a + 1) b, f k

{M : Type u_2}
[CommMonoid M]
{a b : ℕ}
(hab : a < b)
(f : ℕ → M)

∏ k ∈ Finset.Ico a b, f k = f a * ∏ k ∈ Finset.Ico (a + 1) b, f k


@[simp]
theorem succ_le_iff : succ a ≤ b ↔ a < b

{α : Type u_1}
[Preorder α]
[SuccOrder α]
{a b : α}
[NoMaxOrder α]


protected theorem reindex_apply (b : OrthonormalBasis ι 𝕜 E) (e : ι ≃ ι') (i' : ι') :
    (b.reindex e) i' = b (e.symm i')

{ι : Type u_1}
{ι' : Type u_2}
{𝕜 : Type u_3}
[RCLike 𝕜]
{E : Type u_4}
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[Fintype ι]
[Fintype ι']
(b : OrthonormalBasis ι 𝕜 E)
(e : ι ≃ ι')
(i' : ι')


@[simp]
theorem pointwise_smul_toAddSubgroup {R M : Type*} [Ring R] [AddCommGroup M] [DistribMulAction α M]
    [Module R M] [SMulCommClass α R M] (a : α) (S : Submodule R M) :
    (a • S).toAddSubgroup = a • S.toAddSubgroup

{α : Type u_1}
[Monoid α]
{R : Type u_4}
{M : Type u_5}
[Ring R]
[AddCommGroup M]
[DistribMulAction α M]
[Module R M]
[SMulCommClass α R M]
(a : α)
(S : Submodule R M)


theorem setIntegral_const [CompleteSpace E] (c : E) : ∫ _ in s, c ∂μ = (μ s).toReal • c

{X : Type u_1}
{E : Type u_3}
[MeasurableSpace X]
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{s : Set X}
{μ : MeasureTheory.Measure X}
[CompleteSpace E]
(c : E)


theorem HasFPowerSeriesOnBall.eventually_eq_zero
    (hf : HasFPowerSeriesOnBall f (0 : FormalMultilinearSeries 𝕜 E F) x r) :
    ∀ᶠ z in 𝓝 x, f z = 0

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{x : E}
{r : ℝ≥0∞}
(hf : HasFPowerSeriesOnBall f 0 x r)


lemma nhds_inv₀ (hx : x ≠ 0) : 𝓝 x⁻¹ = (𝓝 x)⁻¹

{G₀ : Type u_3}
[GroupWithZero G₀]
[TopologicalSpace G₀]
[HasContinuousInv₀ G₀]
{x : G₀}
(hx : x ≠ 0)

𝓝 x⁻¹ = (𝓝 x)⁻¹


/-- A functor `G : C ⥤ D` sends cocones over `F` to cocones over `F ⋙ G` functorially. -/
@[simps]
def functoriality : Cocone F ⥤ Cocone (F ⋙ G)

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

((CategoryTheory.Limits.Cocones.functoriality F G).obj A).ι.app j = G.map (A.ι.app j)


@[simp]
theorem card_map (f : α ↪ β) : (s.map f).card = s.card

{α : Type u_1}
{β : Type u_2}
{s : Finset α}
(f : α ↪ β)


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

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


theorem ofBijective_apply {f : F} (hf : Function.Bijective f) (a : A) :
    (StarRingEquiv.ofBijective f hf) a = f a

{F : Type u_1}
{A : Type u_3}
{B : Type u_4}
[NonUnitalNonAssocSemiring A]
[Star A]
[NonUnitalNonAssocSemiring B]
[Star B]
[FunLike F A B]
[NonUnitalRingHomClass F A B]
[NonUnitalStarRingHomClass F A B]
{f : F}
(hf : Function.Bijective ⇑f)
(a : A)


lemma smul_eq_zero_iff_left (hx : x ≠ 0) : c • x = 0 ↔ c = 0

{R : Type u_2}
{M : Type u_5}
[Zero R]
[Zero M]
[SMulWithZero R M]
[NoZeroSMulDivisors R M]
{c : R}
{x : M}
(hx : x ≠ 0)


@[to_additive]
theorem Filter.Tendsto.zpow {α} {l : Filter α} {f : α → G} {x : G} (hf : Tendsto f l (𝓝 x))
    (z : ℤ) : Tendsto (fun x => f x ^ z) l (𝓝 (x ^ z))

{G : Type w}
[TopologicalSpace G]
[AddGroup G]
[TopologicalAddGroup G]
{α : Type u_1}
{l : Filter α}
{f : α → G}
{x : G}
(hf : Filter.Tendsto f l (𝓝 x))
(z : ℤ)

Filter.Tendsto (fun x => z • f x) l (𝓝 (z • x))


lemma coroot_root_two :
    P.toLin.flip (P.coroot i) (P.root i) = 2

{ι : Type u_1}
{R : Type u_2}
{M : Type u_3}
{N : Type u_4}
[CommRing R]
[AddCommGroup M]
[Module R M]
[AddCommGroup N]
[Module R N]
(P : RootPairing ι R M N)
(i : ι)

(P.toLin.flip (P.coroot i)) (P.root i) = 2


@[simp]
theorem ofIsCompl_left_apply (h : IsCompl p q) {φ : p →ₗ[R] F} {ψ : q →ₗ[R] F} (u : p) :
    ofIsCompl h φ ψ (u : E) = φ u

{R : Type u_1}
[Ring R]
{E : Type u_2}
[AddCommGroup E]
[Module R E]
{F : Type u_3}
[AddCommGroup F]
[Module R F]
{p q : Submodule R E}
(h : IsCompl p q)
{φ : ↥p →ₗ[R] F}
{ψ : ↥q →ₗ[R] F}
(u : ↥p)


lemma equation_zero : W'.Equation ![1, 1, 0]

{R : Type u}
[CommRing R]
{W' : WeierstrassCurve.Jacobian R}


/-- If distinct points `p₁` and `p₃` lie in `s` but `p₂` does not, the three points are affinely
independent. -/
theorem affineIndependent_of_ne_of_mem_of_not_mem_of_mem {s : AffineSubspace k P} {p₁ p₂ p₃ : P}
    (hp₁p₃ : p₁ ≠ p₃) (hp₁ : p₁ ∈ s) (hp₂ : p₂ ∉ s) (hp₃ : p₃ ∈ s) :
    AffineIndependent k ![p₁, p₂, p₃]

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[DivisionRing k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{s : AffineSubspace k P}
{p₁ p₂ p₃ : P}
(hp₁p₃ : p₁ ≠ p₃)
(hp₁ : p₁ ∈ s)
(hp₂ : p₂ ∉ s)
(hp₃ : p₃ ∈ s)


theorem of_rat_add (h : Irrational (q + x)) : Irrational x

(q : ℚ)
{x : ℝ}
(h : Irrational (↑q + x))


theorem leftUnitor_hom_hom {X : Action V G} : Hom.hom (λ_ X).hom = (λ_ X.V).hom

{V : Type (u + 1)}
[CategoryTheory.LargeCategory V]
{G : MonCat}
[CategoryTheory.MonoidalCategory V]
{X : Action V G}

(CategoryTheory.MonoidalCategory.leftUnitor X).hom.hom = (CategoryTheory.MonoidalCategory.leftUnitor X.V).hom


@[to_additive]
theorem isComplement'_bot_top : IsComplement' (⊥ : Subgroup G) ⊤


theorem inv_lt_one₀ (ha : a ≠ 0) : a⁻¹ < 1 ↔ 1 < a

{α : Type u_1}
[LinearOrderedCommGroupWithZero α]
{a : α}
(ha : a ≠ 0)


theorem inverse_mul_eq_iff_eq_mul (x y z : M₀) (h : IsUnit x) : inverse x * y = z ↔ y = x * z

{M₀ : Type u_2}
[MonoidWithZero M₀]
(x y z : M₀)
(h : IsUnit x)


theorem image_le_kernel (w : f ≫ g = 0) : imageSubobject f ≤ kernelSubobject g

CategoryTheory.Limits.imageSubobject f ≤ CategoryTheory.Limits.kernelSubobject g


@[simp]
theorem destutter_pair : destutter R [a, b] = if R a b then [a, b] else [a]

{α : Type u_1}
(R : α → α → Prop)
[DecidableRel R]
{a b : α}

List.destutter R [a, b] = if R a b then [a, b] else [a]


@[simp]
theorem aleph0_mul_eq {a : Cardinal} (ha : ℵ₀ ≤ a) : ℵ₀ * a = a


protected theorem le_add_mul {f : α → ℝ} {K : ℝ≥0} (h : LipschitzOnWith K f s) {x : α} (hx : x ∈ s)
    {y : α} (hy : y ∈ s) : f x ≤ f y + K * dist x y

{α : Type u}
[PseudoMetricSpace α]
{s : Set α}
{f : α → ℝ}
{K : ℝ≥0}
(h : LipschitzOnWith K f s)
{x : α}
(hx : x ∈ s)
{y : α}
(hy : y ∈ s)


@[to_additive (attr := simp)]
theorem casesOn_one {C : FreeMonoid α → Sort*} (h0 : C 1) (ih : ∀ x xs, C (of x * xs)) :
    @casesOn α C 1 h0 ih = h0

(ih : (x : α) → (xs : FreeMonoid α) → C (FreeMonoid.of x * xs))


theorem injective (e : M ≃ₗ⁅R,L⁆ N) : Function.Injective e

{R : Type u}
{L : Type v}
{M : Type w}
{N : Type w₁}
[CommRing R]
[LieRing L]
[AddCommGroup M]
[AddCommGroup N]
[Module R M]
[Module R N]
[LieRingModule L M]
[LieRingModule L N]
(e : M ≃ₗ⁅R,L⁆ N)


/-- The number of roots of a real polynomial is at most the number of roots of its derivative plus
one. -/
theorem card_roots_toFinset_le_derivative (p : ℝ[X]) :
    p.roots.toFinset.card ≤ p.derivative.roots.toFinset.card + 1

p.roots.toFinset.card ≤ (Polynomial.derivative p).roots.toFinset.card + 1


theorem some_mod_some [Mod α] (a b : α) : some a % some b = some (a % b)

Part.some a % Part.some b = Part.some (a % b)


@[reassoc (attr := simp)]
theorem pentagon_hom_hom_inv_inv_hom (f : a ⟶ b) (g : b ⟶ c) (h : c ⟶ d) (i : d ⟶ e) :
    (α_ f (g ≫ h) i).hom ≫ f ◁ (α_ g h i).hom ≫ (α_ f g (h ≫ i)).inv =
      (α_ f g h).inv ▷ i ≫ (α_ (f ≫ g) h i).hom

{B : Type u}
[CategoryTheory.Bicategory B]
{a b c d e : B}
(f : a ⟶ b)
(g : b ⟶ c)
(h : c ⟶ d)
(i : d ⟶ e)

CategoryTheory.CategoryStruct.comp
    (CategoryTheory.Bicategory.associator f (CategoryTheory.CategoryStruct.comp g h) i).hom
    (CategoryTheory.CategoryStruct.comp
      (CategoryTheory.Bicategory.whiskerLeft f (CategoryTheory.Bicategory.associator g h i).hom)
      (CategoryTheory.Bicategory.associator f g (CategoryTheory.CategoryStruct.comp h i)).inv) =
  CategoryTheory.CategoryStruct.comp
    (CategoryTheory.Bicategory.whiskerRight (CategoryTheory.Bicategory.associator f g h).inv i)
    (CategoryTheory.Bicategory.associator (CategoryTheory.CategoryStruct.comp f g) h i).hom


theorem comul_tensorObj :
    Coalgebra.comul (R := R) (A := (CoalgebraCat.of R M ⊗ CoalgebraCat.of R N : CoalgebraCat R))
      = Coalgebra.comul (A := M ⊗[R] N)

{R : Type u}
[CommRing R]
{M N : Type u}
[AddCommGroup M]
[AddCommGroup N]
[Module R M]
[Module R N]
[Coalgebra R M]
[Coalgebra R N]


@[to_additive]
theorem div_card_le : (s / t).card ≤ s.card * t.card

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


@[simp]
theorem top_apply [Top β] (a : α) : (⊤ : InfHom α β) a = ⊤

{α : Type u_3}
{β : Type u_4}
[Inf α]
[SemilatticeInf β]
[Top β]
(a : α)


theorem sub_dioph : DiophFn fun v => f v - g v

{α : Type}
{f g : (α → ℕ) → ℕ}
(df : Dioph.DiophFn f)
(dg : Dioph.DiophFn g)


theorem extChartAt_target_mem_nhdsWithin (x : M) :
    (extChartAt I x).target ∈ 𝓝[range I] extChartAt I x x

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

(extChartAt I x).target ∈ 𝓝[Set.range ↑I] ↑(extChartAt I x) x


@[simp]
theorem isOrtho_polarBilin {x y : M} : Q.polarBilin.IsOrtho x y ↔ IsOrtho Q x y

{R : Type u_3}
{M : Type u_4}
{N : Type u_5}
[CommRing R]
[AddCommGroup M]
[Module R M]
[AddCommGroup N]
[Module R N]
{Q : QuadraticMap R M N}
{x y : M}

LinearMap.IsOrtho Q.polarBilin x y ↔ Q.IsOrtho x y


theorem hexagon_forward (X Y Z : Dial C) :
    (associator X Y Z).hom ≫ (braiding X (Y ⊗ Z)).hom ≫ (associator Y Z X).hom =
      tensorHom (braiding X Y).hom (𝟙 Z) ≫ (associator Y X Z).hom ≫
      tensorHom (𝟙 Y) (braiding X Z).hom

CategoryTheory.CategoryStruct.comp (X.associator Y Z).hom
    (CategoryTheory.CategoryStruct.comp (X.braiding (CategoryTheory.MonoidalCategory.tensorObj Y Z)).hom
      (Y.associator Z X).hom) =
  CategoryTheory.CategoryStruct.comp
    (CategoryTheory.Dial.tensorHom (X.braiding Y).hom (CategoryTheory.CategoryStruct.id Z))
    (CategoryTheory.CategoryStruct.comp (Y.associator X Z).hom
      (CategoryTheory.Dial.tensorHom (CategoryTheory.CategoryStruct.id Y) (X.braiding Z).hom))


@[simp]
theorem Icc_succ_left (a b : α) : Icc (succ a) b = Ioc a b

{α : Type u_1}
[Preorder α]
[SuccOrder α]
[NoMaxOrder α]
(a b : α)


theorem uniqueMDiffWithinAt_iff_uniqueDiffWithinAt :
    UniqueMDiffWithinAt 𝓘(𝕜, E) s x ↔ UniqueDiffWithinAt 𝕜 s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{s : Set E}
{x : E}


theorem einfsep_insert_le : (insert x s).einfsep ≤ ⨅ (y ∈ s) (_ : x ≠ y), edist x y

{α : Type u_1}
[EDist α]
{x : α}
{s : Set α}

(insert x s).einfsep ≤ ⨅ y ∈ s, ⨅ (_ : x ≠ y), edist x y


theorem continuous_toAdd : Continuous (toAdd : Multiplicative X → X)


/-- If `f` is a monotone function on a right neighborhood of `a` and the image of this neighborhood
under `f` meets every interval `(f a, b)`, `b > f a`, then `f` is continuous at `a` from the right.

The assumption `hfs : ∀ b > f a, ∃ c ∈ s, f c ∈ Ioo (f a) b` cannot be replaced by the weaker
assumption `hfs : ∀ b > f a, ∃ c ∈ s, f c ∈ Ioc (f a) b` we use for strictly monotone functions
because otherwise the function `ceil : ℝ → ℤ` would be a counter-example at `a = 0`. -/
theorem continuousWithinAt_right_of_monotoneOn_of_exists_between {f : α → β} {s : Set α} {a : α}
    (h_mono : MonotoneOn f s) (hs : s ∈ 𝓝[≥] a) (hfs : ∀ b > f a, ∃ c ∈ s, f c ∈ Ioo (f a) b) :
    ContinuousWithinAt f (Ici a) a

(hfs : ∀ b > f a, ∃ c ∈ s, f c ∈ Set.Ioo (f a) b)


lemma cons {r : R} {rs : List R} (h1 : IsSMulRegular M r)
    (h2 : IsWeaklyRegular (QuotSMulTop r M) rs) : IsWeaklyRegular M (r :: rs)

(h2 : RingTheory.Sequence.IsWeaklyRegular (QuotSMulTop r M) rs)

RingTheory.Sequence.IsWeaklyRegular M (r :: rs)


/-- The higher derived functors vanish on injective objects. -/
lemma Functor.isZero_rightDerived_obj_injective_succ
    (F : C ⥤ D) [F.Additive] (n : ℕ) (X : C) [Injective X] :
    IsZero ((F.rightDerived (n+1)).obj X)

CategoryTheory.Limits.IsZero ((F.rightDerived (n + 1)).obj X)


@[simp, bv_toNat] theorem toNat_not {x : BitVec v} : (~~~x).toNat = 2^v - 1 - x.toNat


@[to_additive]
theorem le_centralizer_iff_isCommutative : K ≤ centralizer K ↔ K.IsCommutative

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

K ≤ AddSubgroup.centralizer ↑K ↔ K.IsCommutative


@[ext]
theorem ext (H : ∀ x, x ∈ I ↔ x ∈ J) : I = J

{ι : Type u_1}
{I J : BoxIntegral.Box ι}
(H : ∀ (x : ι → ℝ), x ∈ I ↔ x ∈ J)


/-- Any two `IsKleinFour` groups are isomorphic. -/
@[to_additive "Any two `IsAddKleinFour` groups are isomorphic."]
lemma nonempty_mulEquiv [IsKleinFour G₂] : Nonempty (G₁ ≃* G₂)

{G₁ : Type u_2}
{G₂ : Type u_3}
[AddGroup G₁]
[AddGroup G₂]
[IsAddKleinFour G₁]
[IsAddKleinFour G₂]


@[simp]
theorem constantCoeff_wittNSMul (m : ℕ) (n : ℕ) : constantCoeff (wittNSMul p m n) = 0

(p : ℕ)
[hp : Fact (Nat.Prime p)]
(m n : ℕ)

MvPolynomial.constantCoeff (WittVector.wittNSMul p m n) = 0


@[simp]
theorem aevalTower_id : aevalTower (AlgHom.id S S) = aeval

Polynomial.aevalTower (AlgHom.id S S) = Polynomial.aeval


/-- A model of a theory is a structure in which every sentence is realized as true. -/
class Theory.Model (T : L.Theory) : Prop where
  realize_of_mem : ∀ φ ∈ T, M ⊨ φ

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]
{T : L.Theory}
[self : M ⊨ T]
(φ : L.Sentence)

φ ∈ T → M ⊨ φ


@[simp]
theorem start_zero : (0 : εNFA α σ).start = ∅


theorem nat_gcd_helper_2' (x y a b : ℕ) (h : x * a = y * b + 1) :
    Nat.gcd x y = 1


theorem comap_sInf (s : Set (Ideal S)) : (sInf s).comap f = ⨅ I ∈ s, (I : Ideal S).comap f

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

Ideal.comap f (sInf s) = ⨅ I ∈ s, Ideal.comap f I


@[simp]
theorem aevalTower_comp_toAlgHom : (aevalTower g y).comp (IsScalarTower.toAlgHom S R R[X]) = g

{R : Type u}
{S : Type v}
{A' : Type u_1}
[CommSemiring R]
[CommSemiring A']
[CommSemiring S]
[Algebra S R]
[Algebra S A']
(g : R →ₐ[S] A')
(y : A')

(Polynomial.aevalTower g y).comp (IsScalarTower.toAlgHom S R R[X]) = g


theorem Classical.nonempty_pi {ι} {α : ι → Sort*} : Nonempty (∀ i, α i) ↔ ∀ i, Nonempty (α i)

Nonempty ((i : ι) → α i) ↔ ∀ (i : ι), Nonempty (α i)


@[reassoc (attr := simp)]
theorem e_assoc (W X Y Z : C) :
    (α_ _ _ _).inv ≫ eComp V W X Y ▷ _ ≫ eComp V W Y Z =
      _ ◁ eComp V X Y Z ≫ eComp V W X Z

(V : Type v)
[CategoryTheory.Category.{w, v} V]
[CategoryTheory.MonoidalCategory V]
{C : Type u₁}
[CategoryTheory.EnrichedCategory V C]
(W X Y Z : C)

CategoryTheory.CategoryStruct.comp
    (CategoryTheory.MonoidalCategory.associator (CategoryTheory.EnrichedCategory.Hom W X)
        (CategoryTheory.EnrichedCategory.Hom X Y) (CategoryTheory.EnrichedCategory.Hom Y Z)).inv
    (CategoryTheory.CategoryStruct.comp
      (CategoryTheory.MonoidalCategory.whiskerRight (CategoryTheory.eComp V W X Y)
        (CategoryTheory.EnrichedCategory.Hom Y Z))
      (CategoryTheory.eComp V W Y Z)) =
  CategoryTheory.CategoryStruct.comp
    (CategoryTheory.MonoidalCategory.whiskerLeft (CategoryTheory.EnrichedCategory.Hom W X)
      (CategoryTheory.eComp V X Y Z))
    (CategoryTheory.eComp V W X Z)


/-- An `OrderedCommMonoid` with one-sided 'division' in the sense that
if `a ≤ b`, there is some `c` for which `a * c = b`. This is a weaker version
of the condition on canonical orderings defined by `CanonicallyOrderedCommMonoid`. -/
class ExistsMulOfLE (α : Type u) [Mul α] [LE α] : Prop where
  /-- For `a ≤ b`, `a` left divides `b` -/
  exists_mul_of_le : ∀ {a b : α}, a ≤ b → ∃ c : α, b = a * c

{α : Type u}
[Mul α]
[LE α]
[self : ExistsMulOfLE α]
{a b : α}


/-- The `S`-torsion submodule, containing all elements `x` of `M` such that `a • x = 0` for some
`a` in `S`. -/
@[simps!]
def torsion' (S : Type*) [CommMonoid S] [DistribMulAction S M] [SMulCommClass S R M] :
    Submodule R M

(R : Type u_1)
(M : Type u_2)
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
(S : Type u_3)
[CommMonoid S]
[DistribMulAction S M]
[SMulCommClass S R M]

↑(Submodule.torsion' R M S) = {x | ∃ a, a • x = 0}


lemma unreduced_edges_subset :
    (A ×ˢ A).filter (fun (x, y) ↦ G.Adj x y ∧ ¬ (G.regularityReduced P (ε/8) (ε/4)).Adj x y) ⊆
      (P.nonUniforms G (ε/8)).biUnion (fun (U, V) ↦ U ×ˢ V) ∪ P.parts.biUnion offDiag ∪
        (P.sparsePairs G (ε/4)).biUnion fun (U, V) ↦ G.interedges U V

{α : Type u_1}
{𝕜 : Type u_2}
[LinearOrderedField 𝕜]
[DecidableEq α]
{A : Finset α}
{P : Finpartition A}
{G : SimpleGraph α}
[DecidableRel G.Adj]
{ε : 𝕜}

Finset.filter
    (fun x =>
      match x with
      | (x, y) => G.Adj x y ∧ ¬(SimpleGraph.regularityReduced P G (ε / 8) (ε / 4)).Adj x y)
    (A ×ˢ A) ⊆
  ((P.nonUniforms G (ε / 8)).biUnion fun x =>
        match x with
        | (U, V) => U ×ˢ V) ∪
      P.parts.biUnion Finset.offDiag ∪
    (P.sparsePairs G (ε / 4)).biUnion fun x =>
      match x with
      | (U, V) => G.interedges U V


/-- In principle this could be an instance, but in practice it causes performance issues. -/
@[to_additive]
theorem Subsingleton.of_oneHomClass [Subsingleton M] [OneHomClass F M N] :
    Subsingleton F

{M : Type u_4}
{N : Type u_5}
{F : Type u_9}
[Zero M]
[Zero N]
[FunLike F M N]
[Subsingleton M]
[ZeroHomClass F M N]


@[simp] lemma addSubmonoid_closure_one : closure ({1} : Set ℕ) = ⊤


theorem Matrix.Represents.mul {A A' : Matrix ι ι R} {f f' : Module.End R M} (h : A.Represents b f)
    (h' : Matrix.Represents b A' f') : (A * A').Represents b (f * f')

{ι : Type u_1}
[Fintype ι]
{M : Type u_2}
[AddCommGroup M]
{R : Type u_3}
[CommRing R]
[Module R M]
{b : ι → M}
[DecidableEq ι]
{A A' : Matrix ι ι R}
{f f' : Module.End R M}
(h : Matrix.Represents b A f)
(h' : Matrix.Represents b A' f')


@[to_additive]
protected lemma mul_div_cancel_left (h : IsUnit a) (b : α) : a * b / a = b

{α : Type u}
[SubtractionCommMonoid α]
{a : α}
(h : IsAddUnit a)
(b : α)


/-- An independence predicate satisfying the finite matroid axioms determines a matroid,
  provided independence is determined by its behaviour on finite sets.
  This fundamentally needs choice, since it can be used to prove that every vector space
  has a basis. -/
@[simps E] protected def ofFinitary (E : Set α) (Indep : Set α → Prop)
    (indep_empty : Indep ∅)
    (indep_subset : ∀ ⦃I J⦄, Indep J → I ⊆ J → Indep I)
    (indep_aug : ∀ ⦃I J⦄, Indep I → I.Finite → Indep J → J.Finite → I.ncard < J.ncard →
      ∃ e ∈ J, e ∉ I ∧ Indep (insert e I))
    (indep_compact : ∀ I, (∀ J, J ⊆ I → J.Finite → Indep J) → Indep I)
    (subset_ground : ∀ I, Indep I → I ⊆ E) : IndepMatroid α

(indep_subset : ∀ ⦃I J : Set α⦄, Indep J → I ⊆ J → Indep I)

(indep_aug :
  ∀ ⦃I J : Set α⦄, Indep I → I.Finite → Indep J → J.Finite → I.ncard < J.ncard → ∃ e ∈ J, e ∉ I ∧ Indep (insert e I))

(indep_compact : ∀ (I : Set α), (∀ J ⊆ I, J.Finite → Indep J) → Indep I)

(subset_ground : ∀ (I : Set α), Indep I → I ⊆ E)

(IndepMatroid.ofFinitary E Indep indep_empty indep_subset indep_aug indep_compact subset_ground).E = E


@[to_additive IsCompact.exists_bound_of_continuousOn]
lemma IsCompact.exists_bound_of_continuousOn' [TopologicalSpace α] {s : Set α} (hs : IsCompact s)
    {f : α → E} (hf : ContinuousOn f s) : ∃ C, ∀ x ∈ s, ‖f x‖ ≤ C

{α : Type u_1}
{E : Type u_3}
[SeminormedAddGroup E]
[TopologicalSpace α]
{s : Set α}
(hs : IsCompact s)
{f : α → E}
(hf : ContinuousOn f s)


theorem contMDiffAt_extend {x : M} (he : e ∈ maximalAtlas I M) (hx : x ∈ e.source) :
    ContMDiffAt I 𝓘(𝕜, E) n (e.extend I) x

(he : e ∈ SmoothManifoldWithCorners.maximalAtlas I M)

ContMDiffAt I 𝓘(𝕜, E) n (↑(e.extend I)) x


/-- Given a diagram of presheafed spaces,
we can push all the presheaves forward to the colimit `X` of the underlying topological spaces,
obtaining a diagram in `(Presheaf C X)ᵒᵖ`.
-/
@[simps]
def pushforwardDiagramToColimit (F : J ⥤ PresheafedSpace.{_, _, v} C) :
    J ⥤ (Presheaf C (colimit (F ⋙ PresheafedSpace.forget C)))ᵒᵖ

(F : J ⥤ AlgebraicGeometry.PresheafedSpace C)

(AlgebraicGeometry.PresheafedSpace.pushforwardDiagramToColimit F).map f =
  ((TopCat.Presheaf.pushforward C
            (CategoryTheory.Limits.colimit.ι (F ⋙ AlgebraicGeometry.PresheafedSpace.forget C) j')).map
        (F.map f).c ≫
      (TopCat.Presheaf.Pushforward.comp ((F ⋙ AlgebraicGeometry.PresheafedSpace.forget C).map f)
            (CategoryTheory.Limits.colimit.ι (F ⋙ AlgebraicGeometry.PresheafedSpace.forget C) j')
            (F.obj j).presheaf).inv ≫
        (TopCat.Presheaf.pushforwardEq ⋯ (F.obj j).presheaf).hom).op


lemma exists_compls_iff {p : α → Prop} : (∃ a ∈ sᶜˢ, p a) ↔ ∃ a ∈ s, p aᶜ

{α : Type u_2}
[BooleanAlgebra α]
{s : Finset α}
{p : α → Prop}


/-- The composition of the single functor `single j : C ⥤ GradedObject J C` and the
evaluation functor `eval j` identifies to the identity functor. -/
@[simps!]
noncomputable def singleCompEval (j : J) : single j ⋙ eval j ≅ 𝟭 C

{J : Type u_1}
(C : Type u_2)
[CategoryTheory.Category.{u_3, u_2} C]
[CategoryTheory.Limits.HasInitial C]
[DecidableEq J]
(j : J)
(X : C)

(CategoryTheory.GradedObject.singleCompEval C j).inv.app X = (CategoryTheory.GradedObject.singleObjApplyIso j X).inv


theorem map_inf_fixedPoints_le (x y : fixedPoints f) : f (x ⊓ y) ≤ x.val ⊓ y.val

{α : Type u}
[CompleteLattice α]
(f : α →o α)
(x y : ↑(Function.fixedPoints ⇑f))

f (↑x ⊓ ↑y) ≤ ↑x ⊓ ↑y


theorem sum_variance_truncation_le {X : Ω → ℝ} (hint : Integrable X) (hnonneg : 0 ≤ X) (K : ℕ) :
    ∑ j ∈ range K, ((j : ℝ) ^ 2)⁻¹ * 𝔼[truncation X j ^ 2] ≤ 2 * 𝔼[X]

{Ω : Type u_1}
[MeasureTheory.MeasureSpace Ω]
[MeasureTheory.IsProbabilityMeasure ℙ]
{X : Ω → ℝ}
(hint : MeasureTheory.Integrable X ℙ)
(hnonneg : 0 ≤ X)
(K : ℕ)

∑ j ∈ Finset.range K, (↑j ^ 2)⁻¹ * ∫ (a : Ω), (ProbabilityTheory.truncation X ↑j ^ 2) a ≤ 2 * ∫ (a : Ω), X a


theorem abs_pow (z : ℂ) (n : ℕ) : Complex.abs (z ^ n) = Complex.abs z ^ n


theorem mem_dlookup {a} {b : β a} {l : List (Sigma β)} (nd : l.NodupKeys) (h : Sigma.mk a b ∈ l) :
    b ∈ dlookup a l

{α : Type u}
{β : α → Type v}
[DecidableEq α]
{a : α}
{b : β a}
{l : List (Sigma β)}
(nd : l.NodupKeys)
(h : ⟨a, b⟩ ∈ l)


theorem HasGradientAt.gradient (h : HasGradientAt f f' x) : ∇ f x = f'

{𝕜 : Type u_1}
{F : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup F]
[InnerProductSpace 𝕜 F]
[CompleteSpace F]
{f : F → 𝕜}
{f' x : F}
(h : HasGradientAt f f' x)


@[fun_prop]
theorem DifferentiableOn.smul_const (hc : DifferentiableOn 𝕜 c s) (f : F) :
    DifferentiableOn 𝕜 (fun y => c y • f) s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{s : Set E}
{𝕜' : Type u_6}
[NontriviallyNormedField 𝕜']
[NormedAlgebra 𝕜 𝕜']
[NormedSpace 𝕜' F]
[IsScalarTower 𝕜 𝕜' F]
{c : E → 𝕜'}
(hc : DifferentiableOn 𝕜 c s)
(f : F)


@[simp]
theorem Real.Angle.expMapCircle_neg (θ : Real.Angle) :
    Real.Angle.expMapCircle (-θ) = (Real.Angle.expMapCircle θ)⁻¹


/-- Coefficients of a product of power series -/
theorem coeff_prod (f : ι → PowerSeries R) (d : ℕ) (s : Finset ι) :
    coeff R d (∏ j ∈ s, f j) = ∑ l ∈ finsuppAntidiag s d, ∏ i ∈ s, coeff R (l i) (f i)

{R : Type u_2}
[CommSemiring R]
{ι : Type u_3}
[DecidableEq ι]
(f : ι → PowerSeries R)
(d : ℕ)
(s : Finset ι)

(PowerSeries.coeff R d) (∏ j ∈ s, f j) = ∑ l ∈ s.finsuppAntidiag d, ∏ i ∈ s, (PowerSeries.coeff R (l i)) (f i)


@[to_additive (attr := simp)]
theorem coe_of (R : Type u) [CommGroup R] : (CommGrp.of R : Type u) = R


/-- Two measures which are finite on closed-open intervals are equal if they agree on all
open-closed intervals. -/
theorem ext_of_Ioc {α : Type*} [TopologicalSpace α] {_m : MeasurableSpace α}
    [SecondCountableTopology α] [ConditionallyCompleteLinearOrder α] [OrderTopology α]
    [BorelSpace α] [NoMinOrder α] (μ ν : Measure α) [IsLocallyFiniteMeasure μ]
    (h : ∀ ⦃a b⦄, a < b → μ (Ioc a b) = ν (Ioc a b)) : μ = ν

(h : ∀ ⦃a b : α⦄, a < b → μ (Set.Ioc a b) = ν (Set.Ioc a b))


theorem mem_pointwise_smul_iff_inv_smul_mem {a : M} {S : Subring R} {x : R} :
    x ∈ a • S ↔ a⁻¹ • x ∈ S

{M : Type u_1}
{R : Type u_2}
[Group M]
[Ring R]
[MulSemiringAction M R]
{a : M}
{S : Subring R}
{x : R}

x ∈ a • S ↔ a⁻¹ • x ∈ S


/-- `centroidWeights` equals a constant function. -/
theorem centroidWeights_eq_const : s.centroidWeights k = Function.const ι (card s : k)⁻¹

(k : Type u_1)
[DivisionRing k]
{ι : Type u_4}
(s : Finset ι)

Finset.centroidWeights k s = Function.const ι (↑s.card)⁻¹


/-- In an open set, the iterated derivative within this set coincides with the global iterated
derivative. -/
theorem iteratedFDerivWithin_of_isOpen (n : ℕ) (hs : IsOpen s) :
    EqOn (iteratedFDerivWithin 𝕜 n f s) (iteratedFDeriv 𝕜 n f) s

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{s : Set E}
{f : E → F}
(n : ℕ)
(hs : IsOpen s)

Set.EqOn (iteratedFDerivWithin 𝕜 n f s) (iteratedFDeriv 𝕜 n f) s


theorem convexBodySum_volume :
    volume (convexBodySum K B) = (convexBodySumFactor K) * (.ofReal B) ^ (finrank ℚ K)

(K : Type u_1)
[Field K]
[NumberField K]
(B : ℝ)

MeasureTheory.volume (NumberField.mixedEmbedding.convexBodySum K B) =
  ↑(NumberField.mixedEmbedding.convexBodySumFactor K) * ENNReal.ofReal B ^ FiniteDimensional.finrank ℚ K


@[to_additive]
theorem OneHomClass.bound_of_antilipschitz [OneHomClass 𝓕 E F] (f : 𝓕) {K : ℝ≥0}
    (h : AntilipschitzWith K f) (x) : ‖x‖ ≤ K * ‖f x‖

{𝓕 : Type u_1}
{E : Type u_3}
{F : Type u_4}
[SeminormedAddGroup E]
[SeminormedAddGroup F]
[FunLike 𝓕 E F]
[ZeroHomClass 𝓕 E F]
(f : 𝓕)
{K : ℝ≥0}
(h : AntilipschitzWith K ⇑f)
(x : E)

‖x‖ ≤ ↑K * ‖f x‖


/-- The angle between two vectors does not depend on their order. -/
theorem angle_comm (x y : V) : angle x y = angle y x

{V : Type u_1}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
(x y : V)

InnerProductGeometry.angle x y = InnerProductGeometry.angle y x


@[simp]
theorem encode_inl (a : α) : @encode (α ⊕ β) _ (Sum.inl a) = 2 * (encode a)

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

Encodable.encode (Sum.inl a) = 2 * Encodable.encode a


/-- A seminorm on a group `G` is a function `f : G → ℝ` that sends one to zero, is submultiplicative
and such that `f x⁻¹ = f x` for all `x`. -/
@[to_additive]
structure GroupSeminorm (G : Type*) [Group G] where
  /-- The bare function of a `GroupSeminorm`. -/
  protected toFun : G → ℝ
  /-- The image of one is zero. -/
  protected map_one' : toFun 1 = 0
  /-- The seminorm applied to a product is dominated by the sum of the seminorm applied to the
  factors. -/
  protected mul_le' : ∀ x y, toFun (x * y) ≤ toFun x + toFun y
  /-- The seminorm is invariant under inversion. -/
  protected inv' : ∀ x, toFun x⁻¹ = toFun x

{G : Type u_7}
[Group G]
(self : GroupSeminorm G)
(x : G)


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

(A₁ A₂ : CategoryTheory.Endofunctor.Algebra F)

CategoryTheory.Endofunctor.Algebra.Hom.f 0 = 0


@[field_simps]
theorem divp_sub_divp [CommRing α] (a b : α) (u₁ u₂ : αˣ) :
    a /ₚ u₁ - b /ₚ u₂ = (a * u₂ - u₁ * b) /ₚ (u₁ * u₂)

{α : Type u}
[CommRing α]
(a b : α)
(u₁ u₂ : αˣ)

a /ₚ u₁ - b /ₚ u₂ = (a * ↑u₂ - ↑u₁ * b) /ₚ (u₁ * u₂)


@[simp]
lemma leadingCoeff_Ψ₃ (h : (3 : R) ≠ 0) : W.Ψ₃.leadingCoeff = 3

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


/-- An induction principle for closure membership. If `p` holds for all elements of `s`, and
is preserved under multiplication, then `p` holds for all elements of the closure of `s`. -/
@[to_additive (attr := elab_as_elim) "An induction principle for additive closure membership. If `p`
  holds for all elements of `s`, and is preserved under addition, then `p` holds for all
  elements of the additive closure of `s`."]
theorem closure_induction {p : M → Prop} {x} (h : x ∈ closure s) (mem : ∀ x ∈ s, p x)
    (mul : ∀ x y, p x → p y → p (x * y)) : p x

(mul : ∀ (x y : M), p x → p y → p (x + y))


theorem eq_re_iff_mem_range_coe {a : ℍ[R,c₁,c₂]} :
    a = a.re ↔ a ∈ Set.range (coe : R → ℍ[R,c₁,c₂])

{R : Type u_3}
[CommRing R]
{c₁ c₂ : R}
{a : ℍ[R,c₁,c₂]}

a = ↑a.re ↔ a ∈ Set.range QuaternionAlgebra.coe


@[to_additive]
protected theorem mul_div_mul_comm (hcd : Commute c d) (hbc : Commute b c⁻¹) :
    a * b / (c * d) = a / c * (b / d)

{G : Type u_1}
[DivisionMonoid G]
{a b c d : G}
(hcd : Commute c d)
(hbc : Commute b c⁻¹)


theorem inf_eq_mul_of_isCoprime (coprime : IsCoprime I J) : I ⊓ J = I * J

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


theorem Pairwise.forall (H : Symmetric r) (hs : Pairwise r s) :
    ∀ ⦃a⦄, a ∈ s → ∀ ⦃b⦄, b ∈ s → a ≠ b → r a b

{α : Type u_1}
{r : α → α → Prop}
{s : Multiset α}
(H : Symmetric r)
(hs : Multiset.Pairwise r s)
⦃a : α⦄

a ∈ s → ∀ ⦃b : α⦄, b ∈ s → a ≠ b → r a b


@[simp]
theorem bit0_bits (n : ℕ) (hn : n ≠ 0) : (2 * n).bits = false :: n.bits


theorem isNat_natAbs_pos : {n : ℤ} → {a : ℕ} → IsNat n a → IsNat n.natAbs a

Mathlib.Meta.NormNum.IsNat n a → Mathlib.Meta.NormNum.IsNat n.natAbs a


@[simp]
theorem hom_apply {K L M N : ModuleCat.{u} R} (f : K ⟶ L) (g : M ⟶ N) (k : K) (m : M) :
    (f ⊗ g) (k ⊗ₜ m) = f k ⊗ₜ g m

{R : Type u}
[CommRing R]
{K L M N : ModuleCat R}
(f : K ⟶ L)
(g : M ⟶ N)
(k : ↑K)
(m : ↑M)

(CategoryTheory.MonoidalCategory.tensorHom f g) (k ⊗ₜ[R] m) = f k ⊗ₜ[R] g m


@[simp]
theorem toWithTop_ofNat (n : ℕ) [n.AtLeastTwo] {_ : Decidable (OfNat.ofNat n : PartENat).Dom} :
    toWithTop (no_index (OfNat.ofNat n : PartENat)) = OfNat.ofNat n

∀ {x : Decidable (Part.Dom (OfNat.ofNat n))}, (OfNat.ofNat n).toWithTop = OfNat.ofNat n


lemma _root_.minimalPrimes.finite_of_isNoetherianRing : (minimalPrimes R).Finite

(R : Type u)
[CommRing R]
[IsNoetherianRing R]


theorem LocallyIntegrableOn.aestronglyMeasurable [SecondCountableTopology X]
    (hf : LocallyIntegrableOn f s μ) : AEStronglyMeasurable f (μ.restrict s)

(hf : MeasureTheory.LocallyIntegrableOn f s μ)

MeasureTheory.AEStronglyMeasurable f (μ.restrict s)


theorem toFunLinear_mul_tmul_mul_aux_1 (p : R[X]) (k : ℕ) (h : Decidable ¬p.coeff k = 0) (a : A) :
    ite (¬coeff p k = 0) (a * (algebraMap R A) (coeff p k)) 0 =
    a * (algebraMap R A) (coeff p k)

(R : Type u_1)
(A : Type u_2)
[CommSemiring R]
[Semiring A]
[Algebra R A]
(p : R[X])
(k : ℕ)
(h : Decidable ¬p.coeff k = 0)
(a : A)

(if ¬p.coeff k = 0 then a * (algebraMap R A) (p.coeff k) else 0) = a * (algebraMap R A) (p.coeff k)


/-- The nilpotency class of the range of a surjective homomorphism from a
nilpotent group is less or equal the nilpotency class of the domain -/
theorem nilpotencyClass_le_of_surjective {G' : Type*} [Group G'] (f : G →* G')
    (hf : Function.Surjective f) [h : IsNilpotent G] :
    Group.nilpotencyClass (hG := nilpotent_of_surjective _ hf) ≤ Group.nilpotencyClass G

{G : Type u_1}
[Group G]
{G' : Type u_2}
[Group G']
(f : G →* G')
(hf : Function.Surjective ⇑f)
[h : Group.IsNilpotent G]

Group.nilpotencyClass G' ≤ Group.nilpotencyClass G


@[simp]
theorem castLE_comp_castLE {k m n} (km : k ≤ m) (mn : m ≤ n) :
    (BoundedFormula.castLE mn ∘ BoundedFormula.castLE km :
        L.BoundedFormula α k → L.BoundedFormula α n) =
      BoundedFormula.castLE (km.trans mn)

{L : FirstOrder.Language}
{α : Type u'}
{k m n : ℕ}
(km : k ≤ m)
(mn : m ≤ n)

FirstOrder.Language.BoundedFormula.castLE mn ∘ FirstOrder.Language.BoundedFormula.castLE km =
  FirstOrder.Language.BoundedFormula.castLE ⋯


@[simp]
theorem nnnorm_row (v : n → α) : ‖row ι v‖₊ = ‖v‖₊

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


theorem exists_gcd_eq_one_of_isOfFinAddOrder {u : AddCircle p} (h : IsOfFinAddOrder u) :
    ∃ m : ℕ, m.gcd (addOrderOf u) = 1 ∧ m < addOrderOf u ∧ ↑((m : 𝕜) / addOrderOf u * p) = u

{𝕜 : Type u_1}
[LinearOrderedField 𝕜]
[TopologicalSpace 𝕜]
[OrderTopology 𝕜]
{p : 𝕜}
[hp : Fact (0 < p)]
{u : AddCircle p}
(h : IsOfFinAddOrder u)

∃ m, m.gcd (addOrderOf u) = 1 ∧ m < addOrderOf u ∧ ↑(↑m / ↑(addOrderOf u) * p) = u


lemma of_equiv_equiv {A₁ B₁ A₂ B₂ : Type*} [CommRing A₁] [CommRing B₁]
    [CommRing A₂] [CommRing B₂] [Algebra A₁ B₁] [Algebra A₂ B₂] (e₁ : A₁ ≃+* A₂) (e₂ : B₁ ≃+* B₂)
    (he : RingHom.comp (algebraMap A₂ B₂) ↑e₁ = RingHom.comp ↑e₂ (algebraMap A₁ B₁))
    [Module.Finite A₁ B₁] : Module.Finite A₂ B₂

(he : (algebraMap A₂ B₂).comp ↑e₁ = (↑e₂).comp (algebraMap A₁ B₁))


/-- If `d` is a positive integer that is not a square, then there is a nontrivial solution
to the Pell equation `x^2 - d*y^2 = 1`. -/
theorem exists_of_not_isSquare (h₀ : 0 < d) (hd : ¬IsSquare d) :
    ∃ x y : ℤ, x ^ 2 - d * y ^ 2 = 1 ∧ y ≠ 0


/-- `Prod.map` as a relation embedding. -/
@[simps]
def prodLexMap (f : r ↪r s) (g : t ↪r u) : Prod.Lex r t ↪r Prod.Lex s u

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{δ : Type u_4}
{r : α → α → Prop}
{s : β → β → Prop}
{t : γ → γ → Prop}
{u : δ → δ → Prop}
(f : r ↪r s)
(g : t ↪r u)

∀ (a : α × γ), (f.prodLexMap g) a = Prod.map (⇑f) (⇑g) a


@[to_additive]
theorem zpow_trick_one' {G : Type*} [Group G] (a b : G) (n : ℤ) :
    a * b ^ n * b = a * b ^ (n + 1)

{G : Type u_1}
[Group G]
(a b : G)
(n : ℤ)


/-- `F.mapTriangle` commutes with the rotation of triangles. -/
@[simps!]
def mapTriangleRotateIso :
    F.mapTriangle ⋙ Pretriangulated.rotate D ≅
      Pretriangulated.rotate C ⋙ F.mapTriangle

(X : CategoryTheory.Pretriangulated.Triangle C)

(F.mapTriangleRotateIso.hom.app X).hom₂ = CategoryTheory.CategoryStruct.id (F.obj X.obj₃)


theorem map_ae (f : α ≃ᵐ β) (μ : Measure α) : Filter.map f (ae μ) = ae (map f μ)

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
[MeasurableSpace β]
(f : α ≃ᵐ β)
(μ : MeasureTheory.Measure α)

Filter.map (⇑f) (MeasureTheory.ae μ) = MeasureTheory.ae (MeasureTheory.Measure.map (⇑f) μ)


/-- The `sInf` function on a nonempty `OrdConnected` set `s` in a conditionally complete linear
order takes values within `s`, for all nonempty bounded-below subsets of `s`. -/
theorem sInf_within_of_ordConnected {s : Set α} [hs : OrdConnected s] ⦃t : Set s⦄ (ht : t.Nonempty)
    (h_bdd : BddBelow t) : sInf ((↑) '' t : Set α) ∈ s

{α : Type u_2}
[ConditionallyCompleteLinearOrder α]
{s : Set α}
[hs : s.OrdConnected]
⦃t : Set ↑s⦄
(ht : t.Nonempty)
(h_bdd : BddBelow t)


/-- Reinterpret a clopen as an open. -/
@[simps]
def toOpens (s : Clopens α) : Opens α

{α : Type u_2}
[TopologicalSpace α]
(s : TopologicalSpace.Clopens α)


theorem bind_assoc (x : Option α) (f : α → Option β) (g : β → Option γ) :
    (x.bind f).bind g = x.bind fun y => (f y).bind g

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
(x : Option α)
(f : α → Option β)
(g : β → Option γ)


theorem extend_image_source_inter :
    f.extend I '' (f.source ∩ f'.source) = ((f.extend I).symm ≫ f'.extend I).source

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

↑(f.extend I) '' (f.source ∩ f'.source) = ((f.extend I).symm ≫ f'.extend I).source


@[simp]
theorem rootsOfUnity.coe_mkOfPowEq {ζ : M} {n : ℕ+} (h : ζ ^ (n : ℕ) = 1) :
    ((rootsOfUnity.mkOfPowEq _ h : Mˣ) : M) = ζ

{M : Type u_1}
[CommMonoid M]
{ζ : M}
{n : ℕ+}
(h : ζ ^ ↑n = 1)


theorem UpperSemicontinuous.comp_continuous {f : α → β} {g : ι → α}
    (hf : UpperSemicontinuous f) (hg : Continuous g) : UpperSemicontinuous fun x ↦ f (g x)

{α : Type u_1}
[TopologicalSpace α]
{β : Type u_2}
[Preorder β]
{ι : Type u_5}
[TopologicalSpace ι]
{f : α → β}
{g : ι → α}
(hf : UpperSemicontinuous f)
(hg : Continuous g)


lemma liftCycles_homologyπ_eq_zero_of_boundary [S.HasHomology]
    (k : A ⟶ S.X₂) (x : A ⟶ S.X₁) (hx : k = x ≫ S.f) :
    S.liftCycles k (by rw [hx, assoc, S.zero, comp_zero]) ≫ S.homologyπ = 0

(hx : k = CategoryTheory.CategoryStruct.comp x S.f)

CategoryTheory.CategoryStruct.comp (S.liftCycles k ⋯) S.homologyπ = 0


/-- `log x` is bounded above by a multiple of every power of `x` with positive exponent. -/
lemma log_le_rpow_div {x ε : ℝ} (hx : 0 ≤ x) (hε : 0 < ε) : log x ≤ x ^ ε / ε


lemma eqOn_of_cfc_eq_cfc {f g : R → R} {a : A} (h : cfc f a = cfc g a)
    (hf : ContinuousOn f (spectrum R a) := by cfc_cont_tac)
    (hg : ContinuousOn g (spectrum R a) := by cfc_cont_tac) (ha : p a := by cfc_tac) :
    (spectrum R a).EqOn f g


theorem sup_sup_distrib_right (a b c : α) : a ⊔ b ⊔ c = a ⊔ c ⊔ (b ⊔ c)

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


theorem iInf_union {f : β → α} {s t : Set β} : ⨅ x ∈ s ∪ t, f x = (⨅ x ∈ s, f x) ⊓ ⨅ x ∈ t, f x

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


/-- Functional equation formulated for `Λ`. -/
theorem functional_equation (s : ℂ) :
    P.Λ (P.k - s) = P.ε • P.symm.Λ s

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
(P : WeakFEPair E)
(s : ℂ)


/-- The natural `ℝ`-linear isometry equivalence between `𝕜` satisfying `RCLike 𝕜` and `ℝ` when
`RCLike.I = 0`. -/
@[simps]
noncomputable def realLinearIsometryEquiv (h : I = (0 : K)) : K ≃ₗᵢ[ℝ] ℝ

{K : Type u_1}
[RCLike K]
(h : RCLike.I = 0)

∀ (a : K), (RCLike.realLinearIsometryEquiv h) a = (RCLike.realRingEquiv h).toFun a


@[simp] lemma flip_snd : t.flip.snd = t.fst

(t : CategoryTheory.Limits.PullbackCone f g)


@[simp]
theorem prod'_ε : (F.prod' G).ε = (F.ε, G.ε)

(F : CategoryTheory.LaxMonoidalFunctor C D)

(G : CategoryTheory.LaxMonoidalFunctor C E)


/-- A subgroup is either the trivial subgroup or nontrivial. -/
@[to_additive "A subgroup is either the trivial subgroup or nontrivial."]
theorem bot_or_nontrivial (H : Subgroup G) : H = ⊥ ∨ Nontrivial H

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


theorem HasFDerivWithinAt.continuousWithinAt (h : HasFDerivWithinAt f f' s x) :
    ContinuousWithinAt f s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{f' : E →L[𝕜] F}
{x : E}
{s : Set E}
(h : HasFDerivWithinAt f f' s x)


theorem subset_sUnion_of_mem {S : Set (Set α)} {t : Set α} (tS : t ∈ S) : t ⊆ ⋃₀S

{α : Type u_1}
{S : Set (Set α)}
{t : Set α}
(tS : t ∈ S)


theorem hasAntitoneBasis_atTop [Nonempty α] [Preorder α] [IsDirected α (· ≤ ·)] :
    (@atTop α _).HasAntitoneBasis Ici

{α : Type u_3}
[Nonempty α]
[Preorder α]
[IsDirected α fun x x_1 => x ≤ x_1]


@[simp]
theorem hasDerivWithinAt_Ioi_iff_Ici [PartialOrder 𝕜] :
    HasDerivWithinAt f f' (Ioi x) x ↔ HasDerivWithinAt f f' (Ici x) x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : 𝕜 → F}
{f' : F}
{x : 𝕜}
[PartialOrder 𝕜]

HasDerivWithinAt f f' (Set.Ioi x) x ↔ HasDerivWithinAt f f' (Set.Ici x) x


@[simp]
theorem coe_image_of_subset {s t : Set α} (h : t ⊆ s) : (↑) '' { x : ↥s | ↑x ∈ t } = t

{α : Type u_1}
{s t : Set α}
(h : t ⊆ s)


theorem limsup_eq_iInf_iSup_of_nat' {u : ℕ → α} : limsup u atTop = ⨅ n : ℕ, ⨆ i : ℕ, u (i + n)

{α : Type u_1}
[CompleteLattice α]
{u : ℕ → α}

Filter.limsup u Filter.atTop = ⨅ n, ⨆ i, u (i + n)


lemma UniformConcaveOn.concaveOn (hf : UniformConcaveOn s φ f) (hφ : 0 ≤ φ) : ConcaveOn ℝ s f

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{φ : ℝ → ℝ}
{s : Set E}
{f : E → ℝ}
(hf : UniformConcaveOn s φ f)
(hφ : 0 ≤ φ)


/-- If all elements of an infinite set have measure uniformly separated from zero,
then the set has infinite measure. -/
theorem _root_.Set.Infinite.meas_eq_top [MeasurableSingletonClass α]
    {s : Set α} (hs : s.Infinite) (h' : ∃ ε, ε ≠ 0 ∧ ∀ x ∈ s, ε ≤ μ {x}) : μ s = ∞

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[MeasurableSingletonClass α]
{s : Set α}
(hs : s.Infinite)
(h' : ∃ ε, ε ≠ 0 ∧ ∀ x ∈ s, ε ≤ μ {x})


@[simp]
theorem disjoint_insert_right : Disjoint s (insert a t) ↔ a ∉ s ∧ Disjoint s t

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


theorem nsmul_cons {s : Multiset α} (n : ℕ) (a : α) :
    n • (a ::ₘ s) = n • ({a} : Multiset α) + n • s

{α : Type u_1}
{s : Multiset α}
(n : ℕ)
(a : α)


lemma map_mem_map (P : MorphismProperty C) (F : C ⥤ D) {X Y : C} (f : X ⟶ Y) (hf : P f) :
    (P.map F) (F.map f)

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{D : Type u_1}
[CategoryTheory.Category.{u_2, u_1} D]
(P : CategoryTheory.MorphismProperty C)
(F : C ⥤ D)
{X Y : C}
(f : X ⟶ Y)
(hf : P f)


@[to_additive]
theorem closure_eq_of_le (h₁ : k ⊆ K) (h₂ : K ≤ closure k) : closure k = K

{G : Type u_1}
[Group G]
(K : Subgroup G)
{k : Set G}
(h₁ : k ⊆ ↑K)
(h₂ : K ≤ Subgroup.closure k)


protected theorem iterate {f : α → α} (hf : MeasurePreserving f μa μa) :
    ∀ n, MeasurePreserving f^[n] μa μa

(hf : MeasureTheory.MeasurePreserving f μa μa)

MeasureTheory.MeasurePreserving f^[n] μa μa


theorem contDiff_normed {n : ℕ∞} : ContDiff ℝ n (f.normed μ)

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[HasContDiffBump E]
[MeasurableSpace E]
{c : E}
(f : ContDiffBump c)
{μ : MeasureTheory.Measure E}
{n : ℕ∞}


theorem contDiffAt_const {c : F} : ContDiffAt 𝕜 n (fun _ : E => c) x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{x : E}
{n : ℕ∞}
{c : F}


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

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


theorem geometric_hahn_banach_point_closed (ht₁ : Convex ℝ t) (ht₂ : IsClosed t) (disj : x ∉ t) :
    ∃ (f : E →L[ℝ] ℝ) (u : ℝ), f x < u ∧ ∀ b ∈ t, u < f b

{E : Type u_2}
[TopologicalSpace E]
[AddCommGroup E]
[TopologicalAddGroup E]
[Module ℝ E]
[ContinuousSMul ℝ E]
{t : Set E}
{x : E}
[LocallyConvexSpace ℝ E]
(ht₁ : Convex ℝ t)
(ht₂ : IsClosed t)
(disj : x ∉ t)


@[simp]
theorem isTheta_norm_right : (f =Θ[l] fun x ↦ ‖g' x‖) ↔ f =Θ[l] g'

{α : Type u_1}
{E : Type u_3}
{F' : Type u_7}
[Norm E]
[SeminormedAddCommGroup F']
{f : α → E}
{g' : α → F'}
{l : Filter α}


theorem min_lt_min_left_iff : min a c < min b c ↔ a < b ∧ a < c

{α : Type u}
[LinearOrder α]
{a b c : α}


theorem liftEquiv_symm_apply : (liftEquiv M i p).symm f = f.comp i

{K : Type u_1}
{L : Type u_2}
{M : Type u_3}
[CommRing K]
[CommRing L]
[CommRing M]
(i : K →+* L)
(f : L →+* M)
(p : ℕ)
[ExpChar K p]
[ExpChar L p]
[ExpChar M p]
[PerfectRing M p]
[IsPRadical i p]

(PerfectRing.liftEquiv M i p).symm f = f.comp i


@[simp]
theorem preimage_inr_range_inl : Sum.inr ⁻¹' range (Sum.inl : α → α ⊕ β) = ∅


@[to_additive (attr := simp 1100, norm_cast)]
theorem val_finset_prod {ι G} [CommGroup G] (H : Subgroup G) (f : ι → H) (s : Finset ι) :
    ↑(∏ i ∈ s, f i) = (∏ i ∈ s, f i : G)

{ι : Type u_3}
{G : Type u_4}
[CommGroup G]
(H : Subgroup G)
(f : ι → ↥H)
(s : Finset ι)


theorem map_measurableSpace_eq [CountablySeparated Z]
    {f : X → Z} (hf : Measurable f)
    (hsurj : Surjective f) : MeasurableSpace.map f ‹MeasurableSpace X› = ‹MeasurableSpace Z›

{X : Type u_3}
{Z : Type u_5}
[MeasurableSpace X]
[StandardBorelSpace X]
[MeasurableSpace Z]
[MeasurableSpace.CountablySeparated Z]
{f : X → Z}
(hf : Measurable f)
(hsurj : Function.Surjective f)


theorem map_monic_ne_zero (hp : p.Monic) [Nontrivial S] : p.map f ≠ 0

{R : Type u}
{S : Type v}
[Semiring R]
{p : R[X]}
[Semiring S]
{f : R →+* S}
(hp : p.Monic)
[Nontrivial S]


theorem setLIntegral_iUnion_of_directed {ι : Type*} [Countable ι]
    (f : α → ℝ≥0∞) {s : ι → Set α} (hd : Directed (· ⊆ ·) s) :
    ∫⁻ x in ⋃ i, s i, f x ∂μ = ⨆ i, ∫⁻ x in s i, f x ∂μ

(f : α → ℝ≥0∞)

(hd : Directed (fun x x_1 => x ⊆ x_1) s)

∫⁻ (x : α) in ⋃ i, s i, f x ∂μ = ⨆ i, ∫⁻ (x : α) in s i, f x ∂μ


theorem Periodic.sub_eq [AddGroup α] (h : Periodic f c) (x : α) : f (x - c) = f x

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{c : α}
[AddGroup α]
(h : Function.Periodic f c)
(x : α)


@[simp] theorem ofFinitary_indep (E : Set α) (Indep : Set α → Prop)
    indep_empty indep_subset indep_aug indep_compact subset_ground : (IndepMatroid.ofFinitary
      E Indep indep_empty indep_subset indep_aug indep_compact subset_ground).Indep = Indep

(indep_subset : ∀ ⦃I J : Set α⦄, Indep J → I ⊆ J → Indep I)

(indep_aug :
  ∀ ⦃I J : Set α⦄, Indep I → I.Finite → Indep J → J.Finite → I.ncard < J.ncard → ∃ e ∈ J, e ∉ I ∧ Indep (insert e I))

(indep_compact : ∀ (I : Set α), (∀ J ⊆ I, J.Finite → Indep J) → Indep I)

(subset_ground : ∀ (I : Set α), Indep I → I ⊆ E)


theorem one_lt_succ_succ (a : Fin n) : (1 : Fin (n + 2)) < a.succ.succ


@[simp]
theorem one_le_floor_iff (x : α) : 1 ≤ ⌊x⌋₊ ↔ 1 ≤ x

{α : Type u_2}
[LinearOrderedSemiring α]
[FloorSemiring α]
(x : α)

1 ≤ ⌊x⌋₊ ↔ 1 ≤ x


/-- A natural isomorphism `R₁ ≅ R₂` induces an equivalence of categories
    `Comma L R₁ ≌ Comma L R₂`. -/
@[simps!]
def mapRightIso (i : R₁ ≅ R₂) : Comma L R₁ ≌ Comma L R₂

{A : Type u₁}
[CategoryTheory.Category.{v₁, u₁} A]
{B : Type u₂}
[CategoryTheory.Category.{v₂, u₂} B]
{T : Type u₃}
[CategoryTheory.Category.{v₃, u₃} T]
(L : CategoryTheory.Functor A T)
{R₁ R₂ : CategoryTheory.Functor B T}
(i : R₁ ≅ R₂)
(X : CategoryTheory.Comma L R₁)

((CategoryTheory.Comma.mapRightIso L i).unitIso.inv.app X).right = CategoryTheory.CategoryStruct.id X.right


@[simp, nolint simpNF]
theorem zero_apply (n : ℕ) : (0 : FormalMultilinearSeries 𝕜 E F) n = 0

{𝕜 : Type u}
{E : Type v}
{F : Type w}
[Ring 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[TopologicalSpace E]
[TopologicalAddGroup E]
[ContinuousConstSMul 𝕜 E]
[AddCommGroup F]
[Module 𝕜 F]
[TopologicalSpace F]
[TopologicalAddGroup F]
[ContinuousConstSMul 𝕜 F]
(n : ℕ)


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

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

∀ {X_1 Y : D} (g : X_1 ⟶ Y),
  ((CategoryTheory.currying.inverse.obj F).obj X).map g = F.map (CategoryTheory.CategoryStruct.id X, g)


@[simp]
theorem isSplitEpi_iff [Full F] [Faithful F] : IsSplitEpi (F.map f) ↔ IsSplitEpi f

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
(F : C ⥤ D)
{X Y : C}
(f : X ⟶ Y)
[F.Full]
[F.Faithful]

CategoryTheory.IsSplitEpi (F.map f) ↔ CategoryTheory.IsSplitEpi f


@[simp]
theorem mem_ker_map (h : IsAdjoinRoot S f) {p} : p ∈ RingHom.ker h.map ↔ f ∣ p

{R : Type u}
{S : Type v}
[CommRing R]
[Ring S]
{f : R[X]}
[Algebra R S]
(h : IsAdjoinRoot S f)
{p : R[X]}


@[to_additive]
theorem leftRel_apply {x y : α} : @Setoid.r _ (leftRel s) x y ↔ x⁻¹ * y ∈ s

{α : Type u_1}
[AddGroup α]
{s : AddSubgroup α}
{x y : α}


protected theorem comp_map {α β γ : Type u} (g : α → β) (h : β → γ) (x : t' α) :
    Equiv.map eqv (h ∘ g) x = Equiv.map eqv h (Equiv.map eqv g x)

{t t' : Type u → Type u}
(eqv : (α : Type u) → t α ≃ t' α)
[Functor t]
[LawfulFunctor t]
{α β γ : Type u}
(g : α → β)
(h : β → γ)
(x : t' α)


theorem comap_map {β} {f : α → β} (hf : Injective f) (m : OuterMeasure α) : comap f (map f m) = m

{α : Type u_1}
{β : Type u_3}
{f : α → β}
(hf : Function.Injective f)
(m : MeasureTheory.OuterMeasure α)

(MeasureTheory.OuterMeasure.comap f) ((MeasureTheory.OuterMeasure.map f) m) = m


@[simp] lemma shadow_iterate_empty (k : ℕ) : ∂^[k] (∅ : Finset (Finset α)) = ∅


@[simp]
theorem csSup_Ioc (h : a < b) : sSup (Ioc a b) = b

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


theorem geom_sum_eq_zero_iff_neg_one [LinearOrderedRing α] (hn : n ≠ 0) :
    ∑ i ∈ range n, x ^ i = 0 ↔ x = -1 ∧ Even n

{α : Type u}
{n : ℕ}
{x : α}
[LinearOrderedRing α]
(hn : n ≠ 0)

∑ i ∈ Finset.range n, x ^ i = 0 ↔ x = -1 ∧ Even n


theorem replicate_right_inj' {a b : α} : ∀ {n},
    replicate n a = replicate n b ↔ n = 0 ∨ a = b

List.replicate n a = List.replicate n b ↔ n = 0 ∨ a = b


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

{R : Type u_1}
{M : Type u_2}
{N : Type u_4}
{ι : Type u_6}
[Semiring R]
[AddCommMonoid M]
[Module R M]
[TopologicalSpace M]
[AddCommMonoid N]
[Module R N]
[TopologicalSpace N]
(f : M [⋀^ι]→L[R] N)
[DecidableEq ι]
(m : ι → M)
(i : ι)


/-- A single `List.map` of a composition of functions is equal to
composing a `List.map` with another `List.map`, fully applied.
This is the reverse direction of `List.map_map`.
-/
theorem comp_map (h : β → γ) (g : α → β) (l : List α) : map (h ∘ g) l = map h (map g l)

{α : Type u}
{β : Type v}
{γ : Type w}
(h : β → γ)
(g : α → β)
(l : List α)

List.map (h ∘ g) l = List.map h (List.map g l)


/-- A functor that preserves the pullbacks of `f i j` and `f i k` can map a family of glue data. -/
@[simps]
def mapGlueData : GlueData C'

[H : (i j k : D.J) → CategoryTheory.Limits.PreservesLimit (CategoryTheory.Limits.cospan (D.f i j) (D.f i k)) F]

(D.mapGlueData F).f i j = F.map (D.f i j)


/-- A `SuccOrder` is succ-archimedean if one can go from any two comparable elements by iterating
`succ` -/
class IsSuccArchimedean (α : Type*) [Preorder α] [SuccOrder α] : Prop where
  /-- If `a ≤ b` then one can get to `a` from `b` by iterating `succ` -/
  exists_succ_iterate_of_le {a b : α} (h : a ≤ b) : ∃ n, succ^[n] a = b

{α : Type u_3}
[Preorder α]
[SuccOrder α]
[self : IsSuccArchimedean α]
{a b : α}
(h : a ≤ b)


@[simp]
theorem compl_Ioi : (Ioi a)ᶜ = Iic a


@[simp]
theorem coe_toContinuousMap (F : Homotopy f₀ f₁) : ⇑F.toContinuousMap = F

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]
{f₀ f₁ : C(X, Y)}
(F : f₀.Homotopy f₁)


theorem unfolds_eq (g : α → β) (f : α → α) (a : α) : unfolds g f a = g a::unfolds g f (f a)

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

Stream'.unfolds g f a = Stream'.cons (g a) (Stream'.unfolds g f (f a))


@[simp]
theorem ofLex_toLex (a : α) : ofLex (toLex a) = a


theorem copy_eq (f : BoundedLatticeHom α β) (f' : α → β) (h : f' = f) : f.copy f' h = f

{α : Type u_3}
{β : Type u_4}
[Lattice α]
[Lattice β]
[BoundedOrder α]
[BoundedOrder β]
(f : BoundedLatticeHom α β)
(f' : α → β)
(h : f' = ⇑f)


theorem Valid'.node4L_lemma₁ {a b c d : ℕ} (lr₂ : 3 * (b + c + 1 + d) ≤ 16 * a + 9)
    (mr₂ : b + c + 1 ≤ 3 * d) (mm₁ : b ≤ 3 * c) : b < 3 * a + 1


/-- `F.mapLinearMap` is an `R`-linear map whose underlying function is `F.map`. -/
@[simps]
def mapLinearMap {X Y : C} : (X ⟶ Y) →ₗ[R] F.obj X ⟶ F.obj Y

(R : Type u_1)
[Semiring R]
{C : Type u_2}
{D : Type u_3}
[CategoryTheory.Category.{u_4, u_2} C]
[CategoryTheory.Category.{u_5, u_3} D]
[CategoryTheory.Preadditive C]
[CategoryTheory.Preadditive D]
[CategoryTheory.Linear R C]
[CategoryTheory.Linear R D]
(F : CategoryTheory.Functor C D)
[F.Additive]
[CategoryTheory.Functor.Linear R F]
{X Y : C}

∀ (a : X ⟶ Y), (CategoryTheory.Functor.mapLinearMap R F) a = (↑F.mapAddHom).toFun a


@[simp]
theorem mapDomain_id : mapDomain id v = v

{α : Type u_1}
{M : Type u_5}
[AddCommMonoid M]
{v : α →₀ M}


@[simp]
theorem inf_cons (a : α) (s : Multiset α) : (a ::ₘ s).inf = a ⊓ s.inf

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


/-- A morphism `φ : F₁ ⟶ F₂` of presheaves `Cᵒᵖ ⥤ D` (with `D` a concrete category)
is locally injective for a Grothendieck topology `J` on `C` if
whenever two sections of `F₁` are sent to the same section of `F₂`, then these two
sections coincide locally. -/
class IsLocallyInjective : Prop where
  equalizerSieve_mem {X : Cᵒᵖ} (x y : F₁.obj X) (h : φ.app X x = φ.app X y) :
    equalizerSieve x y ∈ J X.unop

{J : CategoryTheory.GrothendieckTopology C}

[self : CategoryTheory.Presheaf.IsLocallyInjective J φ]

(x y : (CategoryTheory.forget D).obj (F₁.obj X))

CategoryTheory.Presheaf.equalizerSieve x y ∈ J.sieves (Opposite.unop X)


theorem contMDiffAt_coordChangeL {x : B} (h : x ∈ e.baseSet) (h' : x ∈ e'.baseSet) :
    ContMDiffAt IB 𝓘(𝕜, F →L[𝕜] F) n (fun b : B => (e.coordChangeL 𝕜 e' b : F →L[𝕜] F)) x

[TopologicalSpace (Bundle.TotalSpace F E)]

{e e' : Trivialization F Bundle.TotalSpace.proj}

ContMDiffAt IB 𝓘(𝕜, F →L[𝕜] F) n (fun b => ↑(Trivialization.coordChangeL 𝕜 e e' b)) x


lemma List.range_succ_eq_map' {n nn n' : ℕ} (pn : NormNum.IsNat n nn) (pn' : nn = Nat.succ n') :
    List.range n = 0 :: List.map Nat.succ (List.range n')

{n nn n' : ℕ}
(pn : Mathlib.Meta.NormNum.IsNat n nn)
(pn' : nn = n'.succ)


theorem congr_left (h₁ : RightInvOn f₁' f t) (heq : EqOn f₁' f₂' t) :
    RightInvOn f₂' f t

{α : Type u_1}
{β : Type u_2}
{t : Set β}
{f : α → β}
{f₁' f₂' : β → α}
(h₁ : Set.RightInvOn f₁' f t)
(heq : Set.EqOn f₁' f₂' t)


/-- If `1 < |z|`, then `|S • z| < 1`. -/
theorem normSq_S_smul_lt_one (h : 1 < normSq z) : normSq ↑(S • z) < 1

Complex.normSq ↑(ModularGroup.S • z) < 1


@[simp]
theorem coe_mk (e : α ≃+* β) (h) : ⇑(⟨e, h⟩ : α ≃+*o β) = e

(h : ∀ {a b : α}, e.toFun a ≤ e.toFun b ↔ a ≤ b)

⇑{ toRingEquiv := e, map_le_map_iff' := h } = ⇑e


theorem jacobiTheta_S_smul (τ : ℍ) :
    jacobiTheta ↑(ModularGroup.S • τ) = (-I * τ) ^ (1 / 2 : ℂ) * jacobiTheta τ

jacobiTheta ↑(ModularGroup.S • τ) = (-Complex.I * ↑τ) ^ (1 / 2) * jacobiTheta ↑τ


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

{α : Type u_1}
{M : Type u_5}
[AddCommMonoid M]
{f : α → M}
{s t : Set α}
(hst : Disjoint s t)
(hs : (s ∩ Function.support f).Finite)
(ht : (t ∩ Function.support f).Finite)

∑ᶠ (i : α) (_ : i ∈ s ∪ t), f i = ∑ᶠ (i : α) (_ : i ∈ s), f i + ∑ᶠ (i : α) (_ : i ∈ t), f i


theorem tendsto_factorial_div_pow_self_atTop :
    Tendsto (fun n ↦ n ! / (n : ℝ) ^ n : ℕ → ℝ) atTop (𝓝 0)

Filter.Tendsto (fun n => ↑n ! / ↑n ^ n) Filter.atTop (𝓝 0)


theorem eq_none_iff' {o : Part α} : o = none ↔ ¬o.Dom


/-- The degree of a product of polynomials is equal to
the sum of the degrees.

See `Polynomial.natDegree_prod'` (with a `'`) for a version for commutative semirings,
where additionally, the product of the leading coefficients must be nonzero.
-/
theorem natDegree_prod (h : ∀ i ∈ s, f i ≠ 0) :
    (∏ i ∈ s, f i).natDegree = ∑ i ∈ s, (f i).natDegree

{R : Type u}
{ι : Type w}
(s : Finset ι)
[CommSemiring R]
[NoZeroDivisors R]
(f : ι → R[X])
(h : ∀ i ∈ s, f i ≠ 0)


theorem mapClusterPt_of_comp {F : Filter α} {φ : β → α} {p : Filter β}
    {u : α → X} [NeBot p] (h : Tendsto φ p F) (H : Tendsto (u ∘ φ) p (𝓝 x)) :
    MapClusterPt x F u

{X : Type u}
{α : Type u_1}
{β : Type u_2}
{x : X}
[TopologicalSpace X]
{F : Filter α}
{φ : β → α}
{p : Filter β}
{u : α → X}
[p.NeBot]
(h : Filter.Tendsto φ p F)
(H : Filter.Tendsto (u ∘ φ) p (𝓝 x))


/-- A lower modular lattice is a lattice where `a` and `b` both cover `a ⊓ b` if `a ⊔ b` covers
either `a` or `b`. -/
class IsLowerModularLattice (α : Type*) [Lattice α] : Prop where
/-- `a` and `b` both cover `a ⊓ b` if `a ⊔ b` covers either `a` or `b` -/
  inf_covBy_of_covBy_sup {a b : α} : a ⋖ a ⊔ b → a ⊓ b ⋖ b

{α : Type u_2}
[Lattice α]
[self : IsLowerModularLattice α]
{a b : α}


@[simp]
theorem rotate_singleton (x : α) (n : ℕ) : [x].rotate n = [x]


/-- We say that a type has `MeasurableDiv` if `(c / ·)` and `(· / c)` are measurable functions.
For a typeclass assuming measurability of `uncurry (· / ·)` see `MeasurableDiv₂`. -/
@[to_additive]
class MeasurableDiv (G₀ : Type*) [MeasurableSpace G₀] [Div G₀] : Prop where
  measurable_const_div : ∀ c : G₀, Measurable (c / ·)
  measurable_div_const : ∀ c : G₀, Measurable (· / c)

{G₀ : Type u_2}
[MeasurableSpace G₀]
[Div G₀]
[self : MeasurableDiv G₀]
(c : G₀)


lemma iIndep.meas_biInter (hμ : iIndep m κ μ) (hs : ∀ i, i ∈ S → MeasurableSet[m i] (s i)) :
    ∀ᵐ a ∂μ, κ a (⋂ i ∈ S, s i) = ∏ i ∈ S, κ a (s i)

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

∀ᵐ (a : α) ∂μ, (κ a) (⋂ i ∈ S, s i) = ∏ i ∈ S, (κ a) (s i)


@[reassoc (attr := simp)]
theorem triangle_assoc_comp_left_inv (f : a ⟶ b) (g : b ⟶ c) :
    f ◁ (λ_ g).inv ≫ (α_ f (𝟙 b) g).inv = (ρ_ f).inv ▷ g

{B : Type u}
[CategoryTheory.Bicategory B]
{a b c : B}
(f : a ⟶ b)
(g : b ⟶ c)

CategoryTheory.CategoryStruct.comp
    (CategoryTheory.Bicategory.whiskerLeft f (CategoryTheory.Bicategory.leftUnitor g).inv)
    (CategoryTheory.Bicategory.associator f (CategoryTheory.CategoryStruct.id b) g).inv =
  CategoryTheory.Bicategory.whiskerRight (CategoryTheory.Bicategory.rightUnitor f).inv g


theorem isSubring_iUnion_of_directed {ι : Type*} [Nonempty ι] {s : ι → Set R}
    (h : ∀ i, IsSubring (s i)) (directed : ∀ i j, ∃ k, s i ⊆ s k ∧ s j ⊆ s k) :
    IsSubring (⋃ i, s i)

(directed : ∀ (i j : ι), ∃ k, s i ⊆ s k ∧ s j ⊆ s k)


theorem iInf_union {f : α → β} {s t : Finset α} :
    ⨅ x ∈ s ∪ t, f x = (⨅ x ∈ s, f x) ⊓ ⨅ x ∈ t, f x

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


theorem nndist_smul_le (s : α) (x y : β) : nndist (s • x) (s • y) ≤ ‖s‖₊ * nndist x y

{α : Type u_1}
{β : Type u_2}
[SeminormedAddGroup α]
[SeminormedAddGroup β]
[SMulZeroClass α β]
[BoundedSMul α β]
(s : α)
(x y : β)


protected theorem iSup_le {ι : Sort*} {f : ι → ℝ} {a : ℝ} (hS : ∀ i, f i ≤ a) (ha : 0 ≤ a) :
    ⨆ i, f i ≤ a

{ι : Sort u_1}
{f : ι → ℝ}
{a : ℝ}
(hS : ∀ (i : ι), f i ≤ a)
(ha : 0 ≤ a)


theorem index_subset : ∀ p : α × Set α, p ∈ h.index → p.1 ∈ s

{α : Type u_1}
[MetricSpace α]
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{v : VitaliFamily μ}
{f : α → Set (Set α)}
{s : Set α}
(h : v.FineSubfamilyOn f s)
(p : α × Set α)


lemma IsConj.ext_iff {σ₁ σ₂ : K ≃ₐ[k] K} (h₁ : IsConj φ σ₁) : σ₁ = σ₂ ↔ IsConj φ σ₂

(h₁ : NumberField.ComplexEmbedding.IsConj φ σ₁)

σ₁ = σ₂ ↔ NumberField.ComplexEmbedding.IsConj φ σ₂


@[fun_prop]
theorem DifferentiableWithinAt.comp' {g : F → G} {t : Set F}
    (hg : DifferentiableWithinAt 𝕜 g t (f x)) (hf : DifferentiableWithinAt 𝕜 f s x) :
    DifferentiableWithinAt 𝕜 (g ∘ f) (s ∩ f ⁻¹' t) x


protected theorem one_sub : ∀ n, 1 - n = if n = 0 then 1 else 0


theorem ne_neg_of_mem_unit_sphere (x : sphere (0 : E) 1) : x ≠ -x

(𝕜 : Type u_1)
{E : Type u_3}
[NormedField 𝕜]
[SeminormedAddCommGroup E]
[NormedSpace 𝕜 E]
[CharZero 𝕜]
(x : ↑(Metric.sphere 0 1))


theorem smul_closedBall' {c : 𝕜} (hc : c ≠ 0) (x : E) (r : ℝ) :
    c • closedBall x r = closedBall (c • x) (‖c‖ * r)

{𝕜 : Type u_1}
{E : Type u_2}
[NormedField 𝕜]
[SeminormedAddCommGroup E]
[NormedSpace 𝕜 E]
{c : 𝕜}
(hc : c ≠ 0)
(x : E)
(r : ℝ)

c • Metric.closedBall x r = Metric.closedBall (c • x) (‖c‖ * r)


/-- For a module over a division ring, the span of a nonzero element is an atom of the
lattice of submodules. -/
theorem nonzero_span_atom (v : V) (hv : v ≠ 0) : IsAtom (span K {v} : Submodule K V)

{K : Type u_3}
{V : Type u_4}
[DivisionRing K]
[AddCommGroup V]
[Module K V]
(v : V)
(hv : v ≠ 0)


/-- Reinterpret `G ≃+ H` as `Multiplicative G ≃* Multiplicative H`. -/
@[simps]
def AddEquiv.toMultiplicative [AddZeroClass G] [AddZeroClass H] :
    G ≃+ H ≃ (Multiplicative G ≃* Multiplicative H)

{G : Type u_1}
{H : Type u_2}
[AddZeroClass G]
[AddZeroClass H]
(f : G ≃+ H)
(a : Multiplicative G)

(AddEquiv.toMultiplicative f) a = (AddMonoidHom.toMultiplicative f.toAddMonoidHom) a


@[simp]
theorem mk_lt {f g : CauSeq ℚ abs} : mk f < mk g ↔ f < g


@[reassoc (attr := simp)]
lemma ι_mapBifunctorMapMap {X₁ X₂ : GradedObject I C₁} (f : X₁ ⟶ X₂)
    {Y₁ Y₂ : GradedObject J C₂} (g : Y₁ ⟶ Y₂)
    [HasMap (((mapBifunctor F I J).obj X₁).obj Y₁) p]
    [HasMap (((mapBifunctor F I J).obj X₂).obj Y₂) p]
    (i : I) (j : J) (k : K) (h : p ⟨i, j⟩ = k) :
    ιMapBifunctorMapObj F p X₁ Y₁ i j k h ≫ mapBifunctorMapMap F p f g k =
      (F.map (f i)).app (Y₁ j) ≫ (F.obj (X₂ i)).map (g j) ≫
        ιMapBifunctorMapObj F p X₂ Y₂ i j k h

(F : CategoryTheory.Functor C₁ (CategoryTheory.Functor C₂ C₃))

{X₁ X₂ : CategoryTheory.GradedObject I C₁}

{Y₁ Y₂ : CategoryTheory.GradedObject J C₂}

[(((CategoryTheory.GradedObject.mapBifunctor F I J).obj X₁).obj Y₁).HasMap p]

[(((CategoryTheory.GradedObject.mapBifunctor F I J).obj X₂).obj Y₂).HasMap p]

CategoryTheory.CategoryStruct.comp (CategoryTheory.GradedObject.ιMapBifunctorMapObj F p X₁ Y₁ i j k h)
    (CategoryTheory.GradedObject.mapBifunctorMapMap F p f g k) =
  CategoryTheory.CategoryStruct.comp ((F.map (f i)).app (Y₁ j))
    (CategoryTheory.CategoryStruct.comp ((F.obj (X₂ i)).map (g j))
      (CategoryTheory.GradedObject.ιMapBifunctorMapObj F p X₂ Y₂ i j k h))


protected theorem Set.OrdConnected.strictConvex {s : Set β} (hs : OrdConnected s) :
    StrictConvex 𝕜 s

{𝕜 : Type u_1}
{β : Type u_5}
[OrderedSemiring 𝕜]
[TopologicalSpace β]
[LinearOrderedCancelAddCommMonoid β]
[OrderTopology β]
[Module 𝕜 β]
[OrderedSMul 𝕜 β]
{s : Set β}
(hs : s.OrdConnected)


@[simp]
theorem blsub_id : ∀ o, (blsub.{u, u} o fun x _ => x) = o


theorem add_rat (h : LiouvilleWith p x) (r : ℚ) : LiouvilleWith p (x + r)

{p x : ℝ}
(h : LiouvilleWith p x)
(r : ℚ)


@[simp] theorem UInt8.val_val_eq_toNat (x : UInt8) : x.val.val = x.toNat


lemma toFun_eq_coe (f : CompleteLatticeHom α β) : f.toFun = f

{α : Type u_2}
{β : Type u_3}
[CompleteLattice α]
[CompleteLattice β]
(f : CompleteLatticeHom α β)


/-- Let `u` be a unit in `(𝓞 K)ˣ`, then `u ∈ [1, -1, η, -η, η^2, -η^2]`. -/
-- Here `List` is more convenient than `Finset`, even if further from the informal statement.
-- For example, `fin_cases` below does not work with a `Finset`.
theorem Units.mem : u ∈ [1, -1, η, -η, η ^ 2, -η ^ 2]

{K : Type u_1}
[Field K]
[NumberField K]
[IsCyclotomicExtension {3} ℚ K]
{ζ : K}
(hζ : IsPrimitiveRoot ζ ↑3)
(u : (𝓞 K)ˣ)

u ∈ [1, -1, ⋯.unit, -⋯.unit, ⋯.unit ^ 2, -⋯.unit ^ 2]


theorem basisSets_smul_right (v : E) (U : Set E) (hU : U ∈ p.basisSets) :
    ∀ᶠ x : 𝕜 in 𝓝 0, x • v ∈ U

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


/-- The composition of two isometries between quadratic forms. -/
@[simps]
def comp (g : Q₂ →qᵢ Q₃) (f : Q₁ →qᵢ Q₂) : Q₁ →qᵢ Q₃

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


@[simp]
theorem coe_neg_linearMap (D : Derivation R A M) : ↑(-D) = (-D : A →ₗ[R] M)

{R : Type u_1}
[CommRing R]
{A : Type u_2}
[CommRing A]
[Algebra R A]
{M : Type u_3}
[AddCommGroup M]
[Module A M]
[Module R M]
(D : Derivation R A M)


/-- If a linear map has determinant different from `1`, then the space is finite-dimensional. -/
theorem finiteDimensional_of_det_ne_one {𝕜 : Type*} [Field 𝕜] [Module 𝕜 M] (f : M →ₗ[𝕜] M)
    (hf : LinearMap.det f ≠ 1) : FiniteDimensional 𝕜 M

{M : Type u_2}
[AddCommGroup M]
{𝕜 : Type u_7}
[Field 𝕜]
[Module 𝕜 M]
(f : M →ₗ[𝕜] M)
(hf : LinearMap.det f ≠ 1)


@[to_additive]
theorem noncommProd_mem (S : Submonoid M) {ι : Type*} (t : Finset ι) (f : ι → M) (comm)
    (h : ∀ c ∈ t, f c ∈ S) : t.noncommProd f comm ∈ S

(comm : (↑t).Pairwise fun a b => Commute (f a) (f b))


/-- This theorem is not intended to be used directly because it is rare for a set alone to
satisfy `[TietzeExtension t]`. For example, `Metric.ball` in `ℝ` only satisfies it when
the radius is strictly positive, so finding this as an instance will fail.

Instead, it is intended to be used as a constructor for theorems about sets which *do* satisfy
`[TietzeExtension t]` under some hypotheses. -/
theorem ContinuousMap.exists_extension_forall_mem {Y : Type v} [TopologicalSpace Y] (f : C(X₁, Y))
    {t : Set Y} (hf : ∀ x, f x ∈ t) [ht : TietzeExtension.{u, v} t] :
    ∃ (g : C(X, Y)), (∀ x, g x ∈ t) ∧ g.comp ⟨e, he.continuous⟩ = f

{X₁ : Type u₁}
[TopologicalSpace X₁]
{X : Type u}
[TopologicalSpace X]
[NormalSpace X]
{e : X₁ → X}
(he : ClosedEmbedding e)
{Y : Type v}
[TopologicalSpace Y]
(f : C(X₁, Y))
{t : Set Y}
(hf : ∀ (x : X₁), f x ∈ t)
[ht : TietzeExtension ↑t]

∃ g, (∀ (x : X), g x ∈ t) ∧ g.comp { toFun := e, continuous_toFun := ⋯ } = f


theorem isOpen_setOf_disjoint_nhds_nhds : IsOpen { p : X × X | Disjoint (𝓝 p.1) (𝓝 p.2) }


@[simp]
theorem cardinal_mk_lift_of_infinite [Infinite R] :
    Cardinal.lift.{u} #{ x : A // IsAlgebraic R x } = Cardinal.lift.{v} #R

(R : Type u)
(A : Type v)
[CommRing R]
[CommRing A]
[IsDomain A]
[Algebra R A]
[NoZeroSMulDivisors R A]
[Infinite R]

Cardinal.lift.{u, v} #{ x // IsAlgebraic R x } = Cardinal.lift.{v, u} #R


theorem IsTheta.inv {f : α → 𝕜} {g : α → 𝕜'} (h : f =Θ[l] g) :
    (fun x ↦ (f x)⁻¹) =Θ[l] fun x ↦ (g x)⁻¹

{α : Type u_1}
{𝕜 : Type u_14}
{𝕜' : Type u_15}
[NormedField 𝕜]
[NormedField 𝕜']
{l : Filter α}
{f : α → 𝕜}
{g : α → 𝕜'}
(h : f =Θ[l] g)

(fun x => (f x)⁻¹) =Θ[l] fun x => (g x)⁻¹


theorem Bounded.trans_left {t₁ t₂ : Ordnode α} {x : α} :
    ∀ {o₁ o₂}, Bounded t₁ o₁ x → Bounded t₂ x o₂ → Bounded t₂ o₁ o₂

{α : Type u_1}
[Preorder α]
{t₁ t₂ : Ordnode α}
{x : α}
{o₁ : WithBot α}
{o₂ : WithTop α}

t₁.Bounded o₁ ↑x → t₂.Bounded (↑x) o₂ → t₂.Bounded o₁ o₂


theorem continuousWithinAt_const_smul_iff₀ (hc : c ≠ 0) :
    ContinuousWithinAt (fun x => c • f x) s b ↔ ContinuousWithinAt f s b

{α : Type u_2}
{β : Type u_3}
{G₀ : Type u_4}
[TopologicalSpace α]
[GroupWithZero G₀]
[MulAction G₀ α]
[ContinuousConstSMul G₀ α]
[TopologicalSpace β]
{f : β → α}
{b : β}
{c : G₀}
{s : Set β}
(hc : c ≠ 0)


@[simp]
theorem invOf_one' [Monoid α] {_ : Invertible (1 : α)} : ⅟ (1 : α) = 1


theorem Arity.equiv_const {a : PSet.{u}} :
    ∀ n, Arity.Equiv (OfArity.const PSet.{u} a n) (OfArity.const PSet.{u} a n)

PSet.Arity.Equiv (Function.OfArity.const PSet a n) (Function.OfArity.const PSet a n)


@[simp]
theorem commutator_coe_derivation :
    ⇑⁅X, Y⁆ =
      (⁅(X : Derivation 𝕜 C^∞⟮I, G; 𝕜⟯ C^∞⟮I, G; 𝕜⟯), Y⁆ :
        Derivation 𝕜 C^∞⟮I, G; 𝕜⟯ C^∞⟮I, G; 𝕜⟯)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{G : Type u_4}
[TopologicalSpace G]
[ChartedSpace H G]
[Monoid G]
[SmoothMul I G]
(X Y : LeftInvariantDerivation I G)

⇑⁅X, Y⁆ = ⇑⁅↑X, ↑Y⁆


@[reassoc (attr := simp 1100)]
lemma shiftIso_inv_naturality {X Y : C} (n a a' : M) (ha' : n + a = a') (f : X ⟶ Y) :
    (shift F a').map f ≫ (shiftIso F n a a' ha').inv.app Y =
      (shiftIso F n a a' ha').inv.app X ≫ (shift F a).map (f⟦n⟧')

{C : Type u_1}
{A : Type u_2}
[CategoryTheory.Category.{u_5, u_1} C]
[CategoryTheory.Category.{u_6, u_2} A]
(F : C ⥤ A)
{M : Type u_3}
[AddMonoid M]
[CategoryTheory.HasShift C M]
[F.ShiftSequence M]
{X Y : C}
(n a a' : M)
(ha' : n + a = a')
(f : X ⟶ Y)

(F.shift a').map f ≫ (F.shiftIso n a a' ha').inv.app Y =
  (F.shiftIso n a a' ha').inv.app X ≫ (F.shift a).map ((CategoryTheory.shiftFunctor C n).map f)


theorem succ_le_iff_of_not_isMax (ha : ¬IsMax a) : succ a ≤ b ↔ a < b

{α : Type u_1}
[Preorder α]
[SuccOrder α]
{a b : α}
(ha : ¬IsMax a)


@[simp]
theorem closure_union_closure_left (x y : α) : l (l x ∪ y) = l (x ∪ y)

{α : Type u_1}
{β : Type u_4}
[SetLike α β]
(l : LowerAdjoint SetLike.coe)
(x y : α)

l.toFun (↑(l.toFun ↑x) ∪ ↑y) = l.toFun (↑x ∪ ↑y)


@[ext]
theorem ext {h h' : M ≃ₘ^n⟮I, I'⟯ M'} (Heq : ∀ x, h x = h' x) : h = h'

{𝕜 : 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]
{H' : Type u_6}
[TopologicalSpace H']
{I : ModelWithCorners 𝕜 E H}
{I' : ModelWithCorners 𝕜 E' H'}
{M : Type u_9}
[TopologicalSpace M]
[ChartedSpace H M]
{M' : Type u_10}
[TopologicalSpace M']
[ChartedSpace H' M']
{n : ℕ∞}
{h h' : M ≃ₘ^n⟮I, I'⟯ M'}
(Heq : ∀ (x : M), h x = h' x)


/-- Replace `rIn` with another value in the interval `(0, f.rOut)`. -/
@[simps rOut rIn]
def updateRIn (r : ℝ) (hr : r ∈ Ioo 0 f.rOut) : SmoothBumpFunction I c

{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{H : Type uH}
[TopologicalSpace H]
{I : ModelWithCorners ℝ E H}
{M : Type uM}
[TopologicalSpace M]
[ChartedSpace H M]
{c : M}
(f : SmoothBumpFunction I c)
(r : ℝ)
(hr : r ∈ Set.Ioo 0 f.rOut)


theorem ker_comp_of_ker_eq_bot (f : M →ₛₗ[τ₁₂] M₂) {g : M₂ →ₛₗ[τ₂₃] M₃} (hg : ker g = ⊥) :
    ker (g.comp f : M →ₛₗ[τ₁₃] M₃) = ker f

{R : Type u_1}
{R₂ : Type u_3}
{R₃ : Type u_4}
{M : Type u_6}
{M₂ : Type u_8}
{M₃ : Type u_9}
[Semiring R]
[Semiring R₂]
[Semiring R₃]
[AddCommMonoid M]
[AddCommMonoid M₂]
[AddCommMonoid M₃]
[Module R M]
[Module R₂ M₂]
[Module R₃ M₃]
{τ₁₂ : R →+* R₂}
{τ₂₃ : R₂ →+* R₃}
{τ₁₃ : R →+* R₃}
[RingHomCompTriple τ₁₂ τ₂₃ τ₁₃]
(f : M →ₛₗ[τ₁₂] M₂)
{g : M₂ →ₛₗ[τ₂₃] M₃}
(hg : LinearMap.ker g = ⊥)

LinearMap.ker (g.comp f) = LinearMap.ker f


theorem einfsep_le_edist_of_mem {x} (hx : x ∈ s) {y} (hy : y ∈ s) (hxy : x ≠ y) :
    s.einfsep ≤ edist x y

{α : Type u_1}
[EDist α]
{s : Set α}
{x : α}
(hx : x ∈ s)
{y : α}
(hy : y ∈ s)
(hxy : x ≠ y)


/-- `D : Derivation R A M` is an `R`-linear map from `A` to `M` that satisfies the `leibniz`
equality. We also require that `D 1 = 0`. See `Derivation.mk'` for a constructor that deduces this
assumption from the Leibniz rule when `M` is cancellative.

TODO: update this when bimodules are defined. -/
structure Derivation (R : Type*) (A : Type*) (M : Type*)
    [CommSemiring R] [CommSemiring A] [AddCommMonoid M] [Algebra R A] [Module A M] [Module R M]
    extends A →ₗ[R] M where
  protected map_one_eq_zero' : toLinearMap 1 = 0
  protected leibniz' (a b : A) : toLinearMap (a * b) = a • toLinearMap b + b • toLinearMap a

{R : Type u_1}
{A : Type u_2}
{M : Type u_3}
[CommSemiring R]
[CommSemiring A]
[AddCommMonoid M]
[Algebra R A]
[Module A M]
[Module R M]
(self : Derivation R A M)


theorem isOrtho_zero_right (B : M₁ →ₛₗ[I₁] M₂ →ₛₗ[I₂] M) (x) : IsOrtho B x (0 : M₂)

{R : Type u_1}
{R₁ : Type u_2}
{R₂ : Type u_3}
{M : Type u_5}
{M₁ : Type u_6}
{M₂ : Type u_7}
[CommSemiring R]
[CommSemiring R₁]
[AddCommMonoid M₁]
[Module R₁ M₁]
[CommSemiring R₂]
[AddCommMonoid M₂]
[Module R₂ M₂]
[AddCommMonoid M]
[Module R M]
{I₁ : R₁ →+* R}
{I₂ : R₂ →+* R}
(B : M₁ →ₛₗ[I₁] M₂ →ₛₗ[I₂] M)
(x : M₁)


@[to_additive (attr := simp)]
theorem div_nonempty : (s / t).Nonempty ↔ s.Nonempty ∧ t.Nonempty


@[to_additive (attr := simp)]
theorem coe_toEquiv_symm (f : M ≃* N) : ((f : M ≃ N).symm : N → M) = f.symm

{M : Type u_6}
{N : Type u_7}
[Add M]
[Add N]
(f : M ≃+ N)


theorem not_irreducible_of_aleph0_le (ha : ℵ₀ ≤ a) : ¬Irreducible a

{a : Cardinal.{u}}
(ha : Cardinal.aleph0 ≤ a)


/-- If a subgroup is generated by transpositions, then a transposition `swap x y` lies in the
  subgroup if and only if `x` lies in the same orbit as `y`. -/
theorem swap_mem_closure_isSwap {S : Set (Perm α)} (hS : ∀ f ∈ S, f.IsSwap) {x y : α} :
    swap x y ∈ closure S ↔ x ∈ orbit (closure S) y

{α : Type u_2}
[DecidableEq α]
{S : Set (Equiv.Perm α)}
(hS : ∀ f ∈ S, f.IsSwap)
{x y : α}

Equiv.swap x y ∈ Subgroup.closure S ↔ x ∈ MulAction.orbit (↥(Subgroup.closure S)) y


@[measurability]
theorem measurable_quotient_mk'' {s : Setoid α} : Measurable (Quotient.mk'' : α → Quotient s)

{α : Type u_1}
[MeasurableSpace α]
{s : Setoid α}


@[simp]
theorem log_zero_right (b : ℕ) : log b 0 = 0


/-- Any family is compressed along two identical elements. -/
theorem isCompressed_self (u : α) (s : Finset α) : IsCompressed u u s

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


@[simp]
theorem PrimeSpectrum.comap_residue (T : Type u) [CommRing T] [LocalRing T]
    (x : PrimeSpectrum (ResidueField T)) : PrimeSpectrum.comap (residue T) x = closedPoint T

(x : PrimeSpectrum (LocalRing.ResidueField T))

(PrimeSpectrum.comap (LocalRing.residue T)) x = LocalRing.closedPoint T


theorem map_mono {S₁ S₂ : NonUnitalSubalgebra R A} {f : F} :
    S₁ ≤ S₂ → (map f S₁ : NonUnitalSubalgebra R B) ≤ map f S₂

{F : Type v'}
{R : Type u}
{A : Type v}
{B : Type w}
[CommSemiring R]
[NonUnitalNonAssocSemiring A]
[NonUnitalNonAssocSemiring B]
[Module R A]
[Module R B]
[FunLike F A B]
[NonUnitalAlgHomClass F R A B]
{S₁ S₂ : NonUnitalSubalgebra R A}
{f : F}

S₁ ≤ S₂ → NonUnitalSubalgebra.map f S₁ ≤ NonUnitalSubalgebra.map f S₂


/-- The cones for `StructuredArrow.proj Y L ⋙ F`, as a functor from `RightExtension L F`. -/
@[simps]
def coneAtFunctor (Y : D) :
    RightExtension L F ⥤ Cone (StructuredArrow.proj Y L ⋙ F)

{C : Type u_1}
{D : Type u_2}
{H : Type u_3}
[CategoryTheory.Category.{u_4, u_1} C]
[CategoryTheory.Category.{u_5, u_2} D]
[CategoryTheory.Category.{u_6, u_3} H]
(L : CategoryTheory.Functor C D)
(F : CategoryTheory.Functor C H)
(Y : D)
{E E' : L.RightExtension F}
(φ : E ⟶ E')

((CategoryTheory.Functor.RightExtension.coneAtFunctor L F Y).map φ).hom = φ.left.app Y


/-- For a set `s` in a pseudo emetric space, if for every `ε > 0` there exists a countable
set that is `ε`-dense in `s`, then there exists a countable subset `t ⊆ s` that is dense in `s`. -/
theorem subset_countable_closure_of_almost_dense_set (s : Set α)
    (hs : ∀ ε > 0, ∃ t : Set α, t.Countable ∧ s ⊆ ⋃ x ∈ t, closedBall x ε) :
    ∃ t, t ⊆ s ∧ t.Countable ∧ s ⊆ closure t

(hs : ∀ ε > 0, ∃ t, t.Countable ∧ s ⊆ ⋃ x ∈ t, EMetric.closedBall x ε)


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

{f f' : CategoryTheory.StructuredArrow S T}

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

(CategoryTheory.StructuredArrow.isoMk g w).inv.right = g.inv


theorem Martingale.ae_not_tendsto_atTop_atBot [IsFiniteMeasure μ] (hf : Martingale f ℱ μ)
    (hbdd : ∀ᵐ ω ∂μ, ∀ i, |f (i + 1) ω - f i ω| ≤ R) :
    ∀ᵐ ω ∂μ, ¬Tendsto (fun n => f n ω) atTop atBot

{f : ℕ → Ω → ℝ}

(hbdd : ∀ᵐ (ω : Ω) ∂μ, ∀ (i : ℕ), |f (i + 1) ω - f i ω| ≤ ↑R)

∀ᵐ (ω : Ω) ∂μ, ¬Filter.Tendsto (fun n => f n ω) Filter.atTop Filter.atBot


protected theorem IsLocalMinOn.closure (h : IsLocalMinOn f s a) (hc : ContinuousOn f (closure s)) :
    IsLocalMinOn f (closure s) a

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
[Preorder Y]
[OrderClosedTopology Y]
{f : X → Y}
{s : Set X}
{a : X}
(h : IsLocalMinOn f s a)
(hc : ContinuousOn f (closure s))


@[simp]
theorem cardFactors_apply_prime_pow {p k : ℕ} (hp : p.Prime) : Ω (p ^ k) = k

ArithmeticFunction.cardFactors (p ^ k) = k


lemma changeLevel_one {d : ℕ} (h : d ∣ n) :
    changeLevel h (1 : DirichletCharacter R d) = 1

{R : Type u_1}
[CommMonoidWithZero R]
{n d : ℕ}
(h : d ∣ n)

(DirichletCharacter.changeLevel h) 1 = 1


theorem support_convolution_subset_swap : support (f ⋆[L, μ] g) ⊆ support g + support f

{𝕜 : 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'}
[NontriviallyNormedField 𝕜]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜 E']
[NormedSpace 𝕜 F]
(L : E →L[𝕜] E' →L[𝕜] F)
[MeasurableSpace G]
{μ : MeasureTheory.Measure G}
[NormedSpace ℝ F]
[AddGroup G]

Function.support (MeasureTheory.convolution f g L μ) ⊆ Function.support g + Function.support f


/-- The limit cone for the product over an index type with exactly one term. -/
@[simps]
def limitConeOfUnique : LimitCone (Discrete.functor f)

{β : Type w}
{C : Type u}
[CategoryTheory.Category.{v, u} C]
[Unique β]
(f : β → C)

(CategoryTheory.Limits.limitConeOfUnique f).cone.pt = f default


lemma IsAlgebraic.inv_iff {K} [Field K] [Algebra R K] {x : K} :
    IsAlgebraic R (x⁻¹) ↔ IsAlgebraic R x

{R : Type u}
[CommRing R]
{K : Type u_2}
[Field K]
[Algebra R K]
{x : K}


/-- This is a useful lemma to prove that a certain operation preserves functions being `C^n`.
When you do induction on `n`, this gives a useful characterization of a function being `C^(n+1)`,
assuming you have already computed the derivative. The advantage of this version over
`contDiff_succ_iff_fderiv` is that both occurrences of `ContDiff` are for functions with the same
domain and codomain (`E` and `F`). This is not the case for `contDiff_succ_iff_fderiv`, which
often requires an inconvenient need to generalize `F`, which results in universe issues
(see the discussion in the section of `ContDiff.comp`).

This lemma avoids these universe issues, but only applies for finite dimensional `E`. -/
theorem contDiff_succ_iff_fderiv_apply [FiniteDimensional 𝕜 E] {n : ℕ} {f : E → F} :
    ContDiff 𝕜 (n + 1 : ℕ) f ↔ Differentiable 𝕜 f ∧ ∀ y, ContDiff 𝕜 n fun x => fderiv 𝕜 f x y

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[CompleteSpace 𝕜]
[FiniteDimensional 𝕜 E]
{n : ℕ}
{f : E → F}

ContDiff 𝕜 (↑(n + 1)) f ↔ Differentiable 𝕜 f ∧ ∀ (y : E), ContDiff 𝕜 ↑n fun x => (fderiv 𝕜 f x) y


@[simp]
theorem val_one : (1 : HomogeneousLocalization 𝒜 x).val = 1

{ι : Type u_1}
{R : Type u_2}
{A : Type u_3}
[AddCommMonoid ι]
[DecidableEq ι]
[CommRing R]
[CommRing A]
[Algebra R A]
{𝒜 : ι → Submodule R A}
[GradedAlgebra 𝒜]
{x : Submonoid A}


protected theorem pointed (K : ProperCone ℝ E) : (K : ConvexCone ℝ E).Pointed

{E : Type u_1}
[NormedAddCommGroup E]
[InnerProductSpace ℝ E]
(K : ProperCone ℝ E)


/-- In a group with zero, an existential over a unit can be rewritten in terms of `Units.mk0`. -/
theorem exists0 {p : G₀ˣ → Prop} : (∃ g : G₀ˣ, p g) ↔ ∃ (g : G₀) (hg : g ≠ 0), p (Units.mk0 g hg)

{G₀ : Type u_3}
[GroupWithZero G₀]
{p : G₀ˣ → Prop}


lemma le_traceDual {I J : Submodule B L} :
    I ≤ Jᵛ ↔ I * J ≤ 1ᵛ

{A : Type u_1}
{K : Type u_2}
{L : Type u}
{B : Type u_3}
[CommRing A]
[Field K]
[CommRing B]
[Field L]
[Algebra A K]
[Algebra B L]
[Algebra A B]
[Algebra K L]
[Algebra A L]
[IsScalarTower A K L]
[IsScalarTower A B L]
{I J : Submodule B L}

I ≤ Submodule.traceDual A K J ↔ I * J ≤ Submodule.traceDual A K 1


theorem sup_prod (f₁ f₂ : Filter α) (g : Filter β) : (f₁ ⊔ f₂) ×ˢ g = (f₁ ×ˢ g) ⊔ (f₂ ×ˢ g)

{α : Type u_1}
{β : Type u_2}
(f₁ f₂ : Filter α)
(g : Filter β)

(f₁ ⊔ f₂) ×ˢ g = f₁ ×ˢ g ⊔ f₂ ×ˢ g


@[to_additive]
theorem mul_ne_mul_left (a : G) {b c : G} : b * a ≠ c * a ↔ b ≠ c

{G : Type u_3}
[Add G]
[IsRightCancelAdd G]
(a : G)
{b c : G}


@[to_additive]
theorem zpow_smul_eq_iff_period_dvd {j : ℤ} {g : G} {a : α} :
    g ^ j • a = a ↔ (period g a : ℤ) ∣ j

{α : Type v}
{G : Type u}
[AddGroup G]
[AddAction G α]
{j : ℤ}
{g : G}
{a : α}

j • g +ᵥ a = a ↔ ↑(AddAction.period g a) ∣ j


@[simp]
theorem intCast_coeff_zero {i : ℤ} {R : Type*} [Ring R] : (i : R[X]).coeff 0 = i


@[simp, aesop safe apply (rule_sets := [finsetNonempty])]
theorem nonempty_Icc : (Icc a b).Nonempty ↔ a ≤ b

{α : Type u_2}
[Preorder α]
[LocallyFiniteOrder α]
{a b : α}


/-- If the codomain of a topological embedding is a Hausdorff space, then so is its domain.
See also `T2Space.of_continuous_injective`. -/
theorem Embedding.t2Space [TopologicalSpace Y] [T2Space Y] {f : X → Y} (hf : Embedding f) :
    T2Space X

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
[T2Space Y]
{f : X → Y}
(hf : Embedding f)


/-- The essential image as a subcategory has a fully faithful inclusion into the target category. -/
@[simps!]
def essImageInclusion (F : C ⥤ D) : F.EssImageSubcategory ⥤ D

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

∀ {X Y : CategoryTheory.InducedCategory D CategoryTheory.FullSubcategory.obj} (f : X ⟶ Y), F.essImageInclusion.map f = f


/-- When `D` is a monoidal category,
monoid objects in `C ⥤ D` are the same thing
as functors from `C` into the monoid objects of `D`.
-/
@[simps]
def monFunctorCategoryEquivalence : Mon_ (C ⥤ D) ≌ C ⥤ Mon_ D

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

(CategoryTheory.Monoidal.monFunctorCategoryEquivalence C D).unitIso =
  CategoryTheory.Monoidal.MonFunctorCategoryEquivalence.unitIso


theorem lt_mul_left [MulPosStrictMono α]
    (hn : 0 < a) (hm : 1 < b) : a < b * a

{α : Type u}
[Semiring α]
[PartialOrder α]
{a b : α}
[MulPosStrictMono α]
(hn : 0 < a)
(hm : 1 < b)


/-- Two triangles with the same points have the same orthocenter. -/
theorem orthocenter_eq_of_range_eq {t₁ t₂ : Triangle ℝ P}
    (h : Set.range t₁.points = Set.range t₂.points) : t₁.orthocenter = t₂.orthocenter


theorem image₂_subset_iff_right : image₂ f s t ⊆ u ↔ ∀ b ∈ t, (s.image fun a => f a b) ⊆ u

{α : Type u_1}
{β : Type u_3}
{γ : Type u_5}
[DecidableEq γ]
{f : α → β → γ}
{s : Finset α}
{t : Finset β}
{u : Finset γ}

Finset.image₂ f s t ⊆ u ↔ ∀ b ∈ t, Finset.image (fun a => f a b) s ⊆ u


theorem continuousAt_tan {x : ℝ} : ContinuousAt tan x ↔ cos x ≠ 0

ContinuousAt Real.tan x ↔ Real.cos x ≠ 0


/-- If `f, g` are functions `α → 𝕜`, both continuous on a preconnected set `S`, with
`f ^ 2 = g ^ 2` on `S`, and `g z ≠ 0` all `z ∈ S`, then either `f = g` or `f = -g` on
`S`. -/
theorem IsPreconnected.eq_or_eq_neg_of_sq_eq [Field 𝕜] [HasContinuousInv₀ 𝕜] [ContinuousMul 𝕜]
    (hS : IsPreconnected S) (hf : ContinuousOn f S) (hg : ContinuousOn g S)
    (hsq : EqOn (f ^ 2) (g ^ 2) S) (hg_ne : ∀ {x : α}, x ∈ S → g x ≠ 0) :
    EqOn f g S ∨ EqOn f (-g) S

{α : Type u_2}
{𝕜 : Type u_3}
{f g : α → 𝕜}
{S : Set α}
[TopologicalSpace α]
[TopologicalSpace 𝕜]
[T1Space 𝕜]
[Field 𝕜]
[HasContinuousInv₀ 𝕜]
[ContinuousMul 𝕜]
(hS : IsPreconnected S)
(hf : ContinuousOn f S)
(hg : ContinuousOn g S)
(hsq : Set.EqOn (f ^ 2) (g ^ 2) S)
(hg_ne : ∀ {x : α}, x ∈ S → g x ≠ 0)


theorem mem_iff' : A ∈ symplecticGroup l R ↔ Aᵀ * J l R * A = J l R

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

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


lemma support_prod (s : Finset ι) (f : ι → κ → M₀) :
    support (fun j ↦ ∏ i ∈ s, f i j) = ⋂ i ∈ s, support (f i)

{ι : Type u_1}
{κ : Type u_2}
{M₀ : Type u_4}
[CommMonoidWithZero M₀]
[Nontrivial M₀]
[NoZeroDivisors M₀]
(s : Finset ι)
(f : ι → κ → M₀)

(Function.support fun j => ∏ i ∈ s, f i j) = ⋂ i ∈ s, Function.support (f i)


lemma isLocalAtSource
    (H : ∀ {X Y : Scheme.{u}} (f : X ⟶ Y) [IsAffine Y] (𝒰 : Scheme.OpenCover.{u} X),
        Q f ↔ ∀ i, Q (𝒰.map i ≫ f)) : IsLocalAtSource P

{P : CategoryTheory.MorphismProperty AlgebraicGeometry.Scheme}

(H :
  ∀ {X Y : AlgebraicGeometry.Scheme} (f : X ⟶ Y) [inst : AlgebraicGeometry.IsAffine Y] (𝒰 : X.OpenCover),
    Q f ↔ ∀ (i : 𝒰.J), Q (𝒰.map i ≫ f))


/-- **Number of Subsets of a Set** -/
@[simp]
theorem card_powerset (s : Finset α) : card (powerset s) = 2 ^ card s


/-- The Fourier transform converts right-translation into scalar multiplication by a phase
factor. -/
theorem fourierIntegral_comp_add_right [MeasurableAdd 𝕜] (e : AddChar 𝕜 𝕊) (μ : Measure 𝕜)
    [μ.IsAddRightInvariant] (f : 𝕜 → E) (v₀ : 𝕜) :
    fourierIntegral e μ (f ∘ fun v ↦ v + v₀) = fun w ↦ e (v₀ * w) • fourierIntegral e μ f w

{𝕜 : Type u_1}
[CommRing 𝕜]
[MeasurableSpace 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
[MeasurableAdd 𝕜]
(e : AddChar 𝕜 ↥𝕊)
(μ : MeasureTheory.Measure 𝕜)
[μ.IsAddRightInvariant]
(f : 𝕜 → E)
(v₀ : 𝕜)

Fourier.fourierIntegral e μ (f ∘ fun v => v + v₀) = fun w => e (v₀ * w) • Fourier.fourierIntegral e μ f w


lemma optionEquivRight_X_some (x : S₁) : optionEquivRight R S₁ (X (some x)) = X x

(R : Type u)
(S₁ : Type v)
[CommSemiring R]
(x : S₁)

(MvPolynomial.optionEquivRight R S₁) (MvPolynomial.X (some x)) = MvPolynomial.X x


theorem nth_lt_nth' {m n : ℕ} (hlt : m < n) (h : ∀ hf : (setOf p).Finite, n < hf.toFinset.card) :
    nth p m < nth p n

(h : ∀ (hf : (setOf p).Finite), n < hf.toFinset.card)


lemma eq_of_dvd_of_lt_two_mul (ha : a ≠ 0) (hdvd : b ∣ a) (hlt : a < 2 * b) : a = b

{a b : ℕ}
(ha : a ≠ 0)
(hdvd : b ∣ a)
(hlt : a < 2 * b)


protected theorem injective (e : P₁ ≃ᵃ[k] P₂) : Injective e

{k : Type u_1}
{P₁ : Type u_2}
{P₂ : Type u_3}
{V₁ : Type u_6}
{V₂ : Type u_7}
[Ring k]
[AddCommGroup V₁]
[Module k V₁]
[AffineSpace V₁ P₁]
[AddCommGroup V₂]
[Module k V₂]
[AffineSpace V₂ P₂]
(e : P₁ ≃ᵃ[k] P₂)


@[to_additive (attr := simp, norm_cast)]
theorem coe_le_coe : (p : E → ℝ) ≤ q ↔ p ≤ q

{E : Type u_4}
[Group E]
{p q : GroupSeminorm E}

⇑p ≤ ⇑q ↔ p ≤ q


theorem ofRat_one : (ofRat 1 : Cauchy abv) = 1

{α : Type u_1}
[LinearOrderedField α]
{β : Type u_2}
[Ring β]
{abv : β → α}
[IsAbsoluteValue abv]


lemma IsMeasurableRatCDF.stieltjesFunctionAux_unit_prod {f : α → ℚ → ℝ} (a : α) :
    IsMeasurableRatCDF.stieltjesFunctionAux (fun (p : Unit × α) ↦ f p.2) ((), a)
      = IsMeasurableRatCDF.stieltjesFunctionAux f a

ProbabilityTheory.IsMeasurableRatCDF.stieltjesFunctionAux (fun p => f p.2) ((), a) =
  ProbabilityTheory.IsMeasurableRatCDF.stieltjesFunctionAux f a


/-- If a left-invariant measure gives positive mass to a compact set, then it gives positive mass to
any open set. -/
@[to_additive
"If a left-invariant measure gives positive mass to a compact set, then it gives positive mass to
any open set."]
theorem isOpenPosMeasure_of_mulLeftInvariant_of_compact (K : Set G) (hK : IsCompact K)
    (h : μ K ≠ 0) : IsOpenPosMeasure μ

{G : Type u_2}
[MeasurableSpace G]
[TopologicalSpace G]
[BorelSpace G]
{μ : MeasureTheory.Measure G}
[AddGroup G]
[TopologicalAddGroup G]
[μ.IsAddLeftInvariant]
(K : Set G)
(hK : IsCompact K)
(h : μ K ≠ 0)


/-- The absolute value of `p` is `p ^ (-t)` for some positive real number `t`. -/
lemma exists_pos_mulRingNorm_eq_pow_neg : ∃ t : ℝ, 0 < t ∧ f p = p ^ (-t)

(hmin : ∀ (m : ℕ), 0 < f ↑m ∧ f ↑m < 1 → p ≤ m)


@[simp]
theorem rtakeWhile_eq_self_iff : rtakeWhile p l = l ↔ ∀ x ∈ l, p x

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

List.rtakeWhile p l = l ↔ ∀ (x : α), x ∈ l → p x = true


/-- Affine maps commute with affine combinations. -/
theorem map_affineCombination {V₂ P₂ : Type*} [AddCommGroup V₂] [Module k V₂] [AffineSpace V₂ P₂]
    (p : ι → P) (w : ι → k) (hw : s.sum w = 1) (f : P →ᵃ[k] P₂) :
    f (s.affineCombination k p w) = s.affineCombination k (f ∘ p) w

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[S : AffineSpace V P]
{ι : Type u_4}
(s : Finset ι)
{V₂ : Type u_6}
{P₂ : Type u_7}
[AddCommGroup V₂]
[Module k V₂]
[AffineSpace V₂ P₂]
(p : ι → P)
(w : ι → k)
(hw : s.sum w = 1)
(f : P →ᵃ[k] P₂)

f ((Finset.affineCombination k s p) w) = (Finset.affineCombination k s (⇑f ∘ p)) w


@[simps!]
instance : MonoidalCategoryStruct (Dial C)

(CategoryTheory.MonoidalCategory.associator X Y Z).hom.f =
  CategoryTheory.Limits.prod.lift
    (CategoryTheory.CategoryStruct.comp CategoryTheory.Limits.prod.fst CategoryTheory.Limits.prod.fst)
    (CategoryTheory.Limits.prod.lift
      (CategoryTheory.CategoryStruct.comp CategoryTheory.Limits.prod.fst CategoryTheory.Limits.prod.snd)
      CategoryTheory.Limits.prod.snd)


theorem hom_ext {X Y : UniformSpaceCat} {f g : X ⟶ Y} : (f : X → Y) = g → f = g

(CategoryTheory.forget UniformSpaceCat).map f = (CategoryTheory.forget UniformSpaceCat).map g → f = g


@[simp]
lemma cyclesMap_zero [HasLeftHomology S₁] [HasLeftHomology S₂] :
    cyclesMap (0 : S₁ ⟶ S₂) = 0

CategoryTheory.ShortComplex.cyclesMap 0 = 0


theorem toCoalgHom_injective : Function.Injective (toCoalgHom : (A ≃ₗc[R] B) → A →ₗc[R] B)

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
[CommSemiring R]
[AddCommMonoid A]
[AddCommMonoid B]
[Module R A]
[Module R B]
[CoalgebraStruct R A]
[CoalgebraStruct R B]


theorem prod_eq_top_iff {p₁ : Submodule R M} {p₂ : Submodule R M₂} :
    p₁.prod p₂ = ⊤ ↔ p₁ = ⊤ ∧ p₂ = ⊤

(R : Type u)
(M : Type v)
(M₂ : Type w)
[Semiring R]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R M₂]
{p₁ : Submodule R M}
{p₂ : Submodule R M₂}


@[simp]
theorem coe_smul (r : R) (v : VectorMeasure α M) : ⇑(r • v) = r • ⇑v

{α : Type u_1}
{m : MeasurableSpace α}
{M : Type u_3}
[AddCommMonoid M]
[TopologicalSpace M]
{R : Type u_4}
[Semiring R]
[DistribMulAction R M]
[ContinuousConstSMul R M]
(r : R)
(v : MeasureTheory.VectorMeasure α M)


lemma gammaPDF_of_neg {a r x : ℝ} (hx : x < 0) : gammaPDF a r x = 0


@[simp]
theorem continuousMultilinearCurryRightEquiv_symm_apply' (f : G[×n.succ]→L[𝕜] G')
    (v : Fin n → G) (x : G) :
    (continuousMultilinearCurryRightEquiv' 𝕜 n G G').symm f v x = f (snoc v x)

(f : ContinuousMultilinearMap 𝕜 (fun i => G) G')

(((continuousMultilinearCurryRightEquiv' 𝕜 n G G').symm f) v) x = f (Fin.snoc v x)


@[simp]
theorem hrecOn₂'_mk'' {φ : Quotient s₁ → Quotient s₂ → Sort*}
    (f : ∀ a b, φ (Quotient.mk'' a) (Quotient.mk'' b))
    (c : ∀ a₁ b₁ a₂ b₂, a₁ ≈ a₂ → b₁ ≈ b₂ → HEq (f a₁ b₁) (f a₂ b₂)) (x : α) (qb : Quotient s₂) :
    (Quotient.mk'' x).hrecOn₂' qb f c = qb.hrecOn' (f x) fun _ _ ↦ c _ _ _ _ (Setoid.refl _)

{φ : Quotient s₁ → Quotient s₂ → Sort u_5}

(f : (a : α) → (b : β) → φ (Quotient.mk'' a) (Quotient.mk'' b))

(c : ∀ (a₁ : α) (b₁ : β) (a₂ : α) (b₂ : β), a₁ ≈ a₂ → b₁ ≈ b₂ → HEq (f a₁ b₁) (f a₂ b₂))

(Quotient.mk'' x).hrecOn₂' qb f c = qb.hrecOn' (f x) ⋯


@[to_additive (attr := simp)]
theorem preimage_mul_sphere (a b : E) (r : ℝ) : (b * ·) ⁻¹' sphere a r = sphere (a / b) r

{E : Type u_6}
[SeminormedCommGroup E]
(a b : E)
(r : ℝ)

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


@[simp]
theorem le_sInf_iff : a ≤ sInf s ↔ ∀ b ∈ s, a ≤ b

{α : Type u_1}
[CompleteSemilatticeInf α]
{s : Set α}
{a : α}


theorem Ne.not_le_or_not_le [PartialOrder α] {a b : α} (h : a ≠ b) : ¬a ≤ b ∨ ¬b ≤ a

{α : Type u_2}
[PartialOrder α]
{a b : α}
(h : a ≠ b)

¬a ≤ b ∨ ¬b ≤ a


@[simp]
theorem carrier_eq_coe (s : Ideal P) : s.carrier = s

{P : Type u_1}
[LE P]
(s : Order.Ideal P)


@[simp]
theorem invariants_id : invariants (id : α → α) = ‹MeasurableSpace α›


theorem ext_iff {p q : R[X]} : p = q ↔ ∀ n, coeff p n = coeff q n

p = q ↔ ∀ (n : ℕ), p.coeff n = q.coeff n


theorem right_le_lineMap_iff_le (h : r < 1) : b ≤ lineMap a b r ↔ b ≤ a

{k : Type u_1}
{E : Type u_2}
[LinearOrderedField k]
[OrderedAddCommGroup E]
[Module k E]
[OrderedSMul k E]
{a b : E}
{r : k}
(h : r < 1)


protected theorem id : RightOrdContinuous (id : α → α)


theorem IsPRadical.comap_pNilradical [IsPRadical i p] :
    (pNilradical L p).comap i = pNilradical K p

{K : Type u_1}
{L : Type u_2}
[CommSemiring K]
[CommSemiring L]
(i : K →+* L)
(p : ℕ)
[IsPRadical i p]

Ideal.comap i (pNilradical L p) = pNilradical K p


@[to_additive (attr := norm_cast)] -- Porting note (#10685): dsimp can prove this
theorem coe_zpow (x : H) (n : ℤ) : ((x ^ n : H) : G) = (x : G) ^ n

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


@[simp] theorem bind_throw [Monad m] [LawfulMonad m] (f : α → ExceptT ε m β) : (throw e >>= f) = throw e

{m : Type u_1 → Type u_2}
{α ε β : Type u_1}
{e : ε}
[Monad m]
[LawfulMonad m]
(f : α → ExceptT ε m β)


theorem eq_of_mul_eq_mul_right {n m k : Nat} (hm : 0 < m) (h : n * m = k * m) : n = k


/-- An oriented angle is unchanged by replacing the first point with the midpoint of the segment
between it and the second point. -/
@[simp]
theorem oangle_midpoint_left (p₁ p₂ p₃ : P) : ∡ (midpoint ℝ p₁ p₂) p₂ p₃ = ∡ p₁ p₂ p₃

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


@[simp]
theorem toPrefunctor_symm_comp (f : SingleObj α ⥤q SingleObj β) (g : SingleObj β ⥤q SingleObj γ) :
    toPrefunctor.symm (f ⋙q g) = toPrefunctor.symm g ∘ toPrefunctor.symm f

(f : Quiver.SingleObj α ⥤q Quiver.SingleObj β)

(g : Quiver.SingleObj β ⥤q Quiver.SingleObj γ)

Quiver.SingleObj.toPrefunctor.symm (f ⋙q g) =
  Quiver.SingleObj.toPrefunctor.symm g ∘ Quiver.SingleObj.toPrefunctor.symm f


lemma map_surjective {f : M →ₗ[R] M'} (hf : Surjective f) : Surjective (map r f)

{R : Type u_2}
[CommRing R]
(r : R)
{M : Type u_1}
{M' : Type u_3}
[AddCommGroup M]
[Module R M]
[AddCommGroup M']
[Module R M']
{f : M →ₗ[R] M'}
(hf : Function.Surjective ⇑f)

Function.Surjective ⇑((QuotSMulTop.map r) f)


lemma stalkSpecializes_stalkMap_apply (x x' : X) (h : x ⤳ x') (y) :
    f.stalkMap x (Y.presheaf.stalkSpecializes (f.val.base.map_specializes h) y) =
      (X.presheaf.stalkSpecializes h (f.stalkMap x' y))

(y : ↑(Y.presheaf.stalk (f.val.base x')))

(AlgebraicGeometry.Scheme.Hom.stalkMap f x) ((Y.presheaf.stalkSpecializes ⋯) y) =
  (X.presheaf.stalkSpecializes h) ((AlgebraicGeometry.Scheme.Hom.stalkMap f x') y)


theorem integrable_compProd_iff ⦃f : β × γ → E⦄ (hf : AEStronglyMeasurable f ((κ ⊗ₖ η) a)) :
    Integrable f ((κ ⊗ₖ η) a) ↔
      (∀ᵐ x ∂κ a, Integrable (fun y => f (x, y)) (η (a, x))) ∧
        Integrable (fun x => ∫ y, ‖f (x, y)‖ ∂η (a, x)) (κ a)

{η : ProbabilityTheory.Kernel (α × β) γ}

⦃f : β × γ → E⦄

(hf : MeasureTheory.AEStronglyMeasurable f ((κ ⊗ₖ η) a))

MeasureTheory.Integrable f ((κ ⊗ₖ η) a) ↔
  (∀ᵐ (x : β) ∂κ a, MeasureTheory.Integrable (fun y => f (x, y)) (η (a, x))) ∧
    MeasureTheory.Integrable (fun x => ∫ (y : γ), ‖f (x, y)‖ ∂η (a, x)) (κ a)


theorem closedBall_ae_eq_ball {x : AddCircle T} {ε : ℝ} : closedBall x ε =ᵐ[volume] ball x ε

{T : ℝ}
[hT : Fact (0 < T)]
{x : AddCircle T}
{ε : ℝ}

Metric.closedBall x ε =ᵐ[MeasureTheory.volume] Metric.ball x ε


/-- If `f` is monic, the powers of `h.root` form a basis. -/
@[simps! gen dim basis]
def powerBasis (h : IsAdjoinRootMonic S f) : PowerBasis R S

{R : Type u}
{S : Type v}
[CommRing R]
[Ring S]
{f : R[X]}
[Algebra R S]
(h : IsAdjoinRootMonic S f)


/-- The forward direction for `functorProdFunctorEquiv` -/
@[simps]
def prodFunctorToFunctorProd : (A ⥤ B) × (A ⥤ C) ⥤ A ⥤ B × C

(F : CategoryTheory.Functor A B × CategoryTheory.Functor A C)

(CategoryTheory.prodFunctorToFunctorProd A B C).obj F = F.1.prod' F.2


@[simp]
theorem toMul_zsmul [DivInvMonoid α] (z : ℤ) (a : Additive α) : toMul (z • a) = toMul a ^ z

{α : Type u}
[DivInvMonoid α]
(z : ℤ)
(a : Additive α)

Additive.toMul (z • a) = Additive.toMul a ^ z


@[simp]
theorem asAlgebraHom_single (g : G) (r : k) : asAlgebraHom ρ (Finsupp.single g r) = r • ρ g

{k : Type u_1}
{G : Type u_2}
{V : Type u_3}
[CommSemiring k]
[Monoid G]
[AddCommMonoid V]
[Module k V]
(ρ : Representation k G V)
(g : G)
(r : k)

ρ.asAlgebraHom (Finsupp.single g r) = r • ρ g


@[to_additive]
theorem prod_Ico_eq_div {δ : Type*} [CommGroup δ] (f : ℕ → δ) {m n : ℕ} (h : m ≤ n) :
    ∏ k ∈ Ico m n, f k = (∏ k ∈ range n, f k) / ∏ k ∈ range m, f k

{δ : Type u_3}
[CommGroup δ]
(f : ℕ → δ)
{m n : ℕ}
(h : m ≤ n)

∏ k ∈ Finset.Ico m n, f k = (∏ k ∈ Finset.range n, f k) / ∏ k ∈ Finset.range m, f k