lemma eq_finite_iUnion_of_isTopologicalBasis_of_isCompact_open (b : ι → Set X)
    (hb : IsTopologicalBasis (Set.range b)) (U : Set X) (hUc : IsCompact U) (hUo : IsOpen U) :
    ∃ s : Set ι, s.Finite ∧ U = ⋃ i ∈ s, b i

(hb : TopologicalSpace.IsTopologicalBasis (Set.range b))


@[simp]
theorem Prefunctor.mapPath_comp' (F : V ⥤q W) {X Y Z : Paths V} (f : X ⟶ Y) (g : Y ⟶ Z) :
    F.mapPath (f ≫ g) = (F.mapPath f).comp (F.mapPath g)

(V : Type u₁)
[Quiver V]
(W : Type u₂)
[Quiver W]
(F : V ⥤q W)
{X Y Z : CategoryTheory.Paths V}
(f : X ⟶ Y)
(g : Y ⟶ Z)

F.mapPath (CategoryTheory.CategoryStruct.comp f g) = (F.mapPath f).comp (F.mapPath g)


@[to_additive (attr := simp)]
theorem map.id' (x : FreeGroup α) : map (fun z => z) x = x


@[simp]
theorem ExpChar.pow_prime_pow_mul_eq_one_iff (p k m : ℕ) [ExpChar R p] (x : R) :
    x ^ (p ^ k * m) = 1 ↔ x ^ m = 1

{R : Type u_1}
[CommRing R]
[IsReduced R]
(p k m : ℕ)
[ExpChar R p]
(x : R)


@[simp] theorem Bool.or_false (b : Bool) : (b || false) = b


/-- A matroid as defined by the independence axioms. This is the same thing as a `Matroid`,
  and so does not need its own API; it exists to make it easier to construct a matroid from its
  independent sets. The constructed `IndepMatroid` can then be converted into a matroid
  with `IndepMatroid.matroid`. -/
structure IndepMatroid (α : Type*) where
  /-- The ground set -/
  (E : Set α)
  /-- The independence predicate -/
  (Indep : Set α → Prop)
  (indep_empty : Indep ∅)
  (indep_subset : ∀ ⦃I J⦄, Indep J → I ⊆ J → Indep I)
  (indep_aug : ∀⦃I B⦄, Indep I → I ∉ maximals (· ⊆ ·) {I | Indep I} →
      B ∈ maximals (· ⊆ ·) {I | Indep I} → ∃ x ∈ B \ I, Indep (insert x I))
  (indep_maximal : ∀ X, X ⊆ E → ExistsMaximalSubsetProperty Indep X)
  (subset_ground : ∀ I, Indep I → I ⊆ E)


@[simp]
theorem hasFiniteIntegral_add_measure {f : α → β} :
    HasFiniteIntegral f (μ + ν) ↔ HasFiniteIntegral f μ ∧ HasFiniteIntegral f ν

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{μ ν : MeasureTheory.Measure α}
[NormedAddCommGroup β]
{f : α → β}

MeasureTheory.HasFiniteIntegral f (μ + ν) ↔ MeasureTheory.HasFiniteIntegral f μ ∧ MeasureTheory.HasFiniteIntegral f ν


@[simp]
theorem coe_empty : ↑(∅ : Subtype (MeasurableSet : Set α → Prop)) = (∅ : Set α)


/-- For any `x : M ⧸ S` and any `0 < ε`, there is `m : M` such that `Submodule.Quotient.mk m = x`
and `‖m‖ < ‖x‖ + ε`. -/
nonrec theorem Submodule.Quotient.norm_mk_lt {S : Submodule R M} (x : M ⧸ S) {ε : ℝ} (hε : 0 < ε) :
    ∃ m : M, Submodule.Quotient.mk m = x ∧ ‖m‖ < ‖x‖ + ε

{M : Type u_1}
[SeminormedAddCommGroup M]
{R : Type u_3}
[Ring R]
[Module R M]
{S : Submodule R M}
(x : M ⧸ S)
{ε : ℝ}
(hε : 0 < ε)

∃ m, Submodule.Quotient.mk m = x ∧ ‖m‖ < ‖x‖ + ε


theorem toMeasurable_iff {X : Ω → E} {s : Set E} :
    IsUniform X (toMeasurable μ s) ℙ μ ↔ IsUniform X s ℙ μ

{E : Type u_1}
[MeasurableSpace E]
{μ : MeasureTheory.Measure E}
{Ω : Type u_2}

∀ {x : MeasurableSpace Ω} {ℙ : MeasureTheory.Measure Ω} {X : Ω → E} {s : Set E},
  MeasureTheory.pdf.IsUniform X (MeasureTheory.toMeasurable μ s) ℙ μ ↔ MeasureTheory.pdf.IsUniform X s ℙ μ


/-- The reverse direction of the equivalence `F.Elementsᵒᵖ ≅ (yoneda, F)`,
given by `CategoryTheory.yonedaEquiv`.
-/
@[simps]
def fromCostructuredArrow (F : Cᵒᵖ ⥤ Type v) : (CostructuredArrow yoneda F)ᵒᵖ ⥤ F.Elements

(F : CategoryTheory.Functor Cᵒᵖ (Type v))

{X Y : (CategoryTheory.CostructuredArrow CategoryTheory.yoneda F)ᵒᵖ}

↑((CategoryTheory.CategoryOfElements.fromCostructuredArrow F).map f) = f.unop.left.op


@[to_additive (attr := simp)]
theorem empty_mul : ∅ * s = ∅


/-- Direct products of torsion free groups are torsion free. -/
@[to_additive AddMonoid.IsTorsionFree.prod
      "Direct products of additive torsion free groups are torsion free."]
theorem IsTorsionFree.prod {η : Type*} {Gs : η → Type*} [∀ i, Group (Gs i)]
    (tfGs : ∀ i, IsTorsionFree (Gs i)) : IsTorsionFree <| ∀ i, Gs i

(tfGs : ∀ (i : η), Monoid.IsTorsionFree (Gs i))


theorem eLpNorm'_eq_zero_iff (hq0_lt : 0 < q) {f : α → E} (hf : AEStronglyMeasurable f μ) :
    eLpNorm' f q μ = 0 ↔ f =ᵐ[μ] 0

(hf : MeasureTheory.AEStronglyMeasurable f μ)

MeasureTheory.eLpNorm' f q μ = 0 ↔ f =ᵐ[μ] 0


@[simp]
theorem disjoint_principal_left {f : Filter α} {s : Set α} : Disjoint (𝓟 s) f ↔ sᶜ ∈ f

{α : Type u_1}
{f : Filter α}
{s : Set α}


lemma LSeries.abscissaOfAbsConv_congr {f g : ℕ → ℂ} (h : ∀ {n}, n ≠ 0 → f n = g n) :
    abscissaOfAbsConv f = abscissaOfAbsConv g

{f g : ℕ → ℂ}
(h : ∀ {n : ℕ}, n ≠ 0 → f n = g n)

LSeries.abscissaOfAbsConv f = LSeries.abscissaOfAbsConv g


lemma length_sigma {σ : α → Type*} (l₁ : List α) (l₂ : ∀ a, List (σ a)) :
    length (l₁.sigma l₂) = (l₁.map fun a ↦ length (l₂ a)).sum

{α : Type u_2}
{σ : α → Type u_8}
(l₁ : List α)
(l₂ : (a : α) → List (σ a))

(l₁.sigma l₂).length = (List.map (fun a => (l₂ a).length) l₁).sum


theorem eventuallyEq_of_mem {l : Filter α} {f g : α → β} {s : Set α} (hs : s ∈ l) (h : EqOn f g s) :
    f =ᶠ[l] g

{α : Type u}
{β : Type v}
{l : Filter α}
{f g : α → β}
{s : Set α}
(hs : s ∈ l)
(h : Set.EqOn f g s)


/-- A countable union of analytic sets is analytic. -/
theorem AnalyticSet.iUnion [Countable ι] {s : ι → Set α} (hs : ∀ n, AnalyticSet (s n)) :
    AnalyticSet (⋃ n, s n)

(hs : ∀ (n : ι), MeasureTheory.AnalyticSet (s n))


/-- If `R` and `A` have a bijective `algebraMap R A` and act identically on `M`,
then a basis for `M` as `R`-module is also a basis for `M` as `R'`-module. -/
@[simps! repr_apply_support_val repr_apply_toFun]
noncomputable def Basis.algebraMapCoeffs : Basis ι A M

(h : Function.Bijective ⇑(algebraMap R A))

∀ (a : M),
  ((Basis.algebraMapCoeffs A b h).repr a).support.val =
    Multiset.filter (fun x => ¬(RingEquiv.ofBijective (algebraMap R A) h).symm.symm ((b.repr a) x) = 0)
      (b.repr a).support.val


/-- If two formal multilinear series have positive radius of convergence, then the terms appearing
in the definition of their composition are also summable (when multiplied by a suitable positive
geometric term). -/
theorem comp_summable_nnreal (q : FormalMultilinearSeries 𝕜 F G) (p : FormalMultilinearSeries 𝕜 E F)
    (hq : 0 < q.radius) (hp : 0 < p.radius) :
    ∃ r > (0 : ℝ≥0),
      Summable fun i : Σ n, Composition n => ‖q.compAlongComposition p i.2‖₊ * r ^ i.1

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
{G : Type u_4}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
(q : FormalMultilinearSeries 𝕜 F G)
(p : FormalMultilinearSeries 𝕜 E F)
(hq : 0 < q.radius)
(hp : 0 < p.radius)

∃ r > 0, Summable fun i => ‖q.compAlongComposition p i.snd‖₊ * r ^ i.fst


@[to_additive]
theorem tprod_congr_subtype (f : β → α) {P Q : β → Prop} (h : ∀ x, P x ↔ Q x) :
    ∏' x : {x // P x}, f x = ∏' x : {x // Q x}, f x

{α : Type u_1}
{β : Type u_2}
[AddCommMonoid α]
[TopologicalSpace α]
(f : β → α)
{P Q : β → Prop}
(h : ∀ (x : β), P x ↔ Q x)


theorem infs_union_left : (s₁ ∪ s₂) ⊼ t = s₁ ⊼ t ∪ s₂ ⊼ t

{α : Type u_2}
[DecidableEq α]
[SemilatticeInf α]
{s₁ s₂ t : Finset α}


lemma weightSpace_ne_bot (χ : Weight R L M) : weightSpace M χ ≠ ⊥

{R : Type u_2}
{L : Type u_3}
(M : Type u_4)
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[LieAlgebra.IsNilpotent R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
(χ : LieModule.Weight R L M)


theorem isLowerSet_iUnion₂ {f : ∀ i, κ i → Set α} (hf : ∀ i j, IsLowerSet (f i j)) :
    IsLowerSet (⋃ (i) (j), f i j)

(hf : ∀ (i : ι) (j : κ i), IsLowerSet (f i j))


/-- Given an equivalence `e : R ≃+* S` of non-unital semirings and a non-unital subsemiring
`s` of `R`, `non_unital_subsemiring_map e s` is the induced equivalence between `s` and
`s.map e` -/
@[simps!]
def nonUnitalSubsemiringMap (e : R ≃+* S) (s : NonUnitalSubsemiring R) :
    s ≃+* NonUnitalSubsemiring.map e.toNonUnitalRingHom s

(y : ↑(⇑↑e.toAddEquiv '' ↑s.toAddSubmonoid))

↑((e.nonUnitalSubsemiringMap s).symm y) = (↑e).symm ↑y


@[simp]
theorem mem_fieldRange {f : K →+* L} {y : L} : y ∈ f.fieldRange ↔ ∃ x, f x = y

{K : Type u}
{L : Type v}
[DivisionRing K]
[DivisionRing L]
{f : K →+* L}
{y : L}


@[simp, norm_cast]
theorem toENNReal_sub (m n : ℕ∞) : ↑(m - n) = (m - n : ℝ≥0∞)


@[to_additive]
theorem TopologicalGroup.tendstoLocallyUniformlyOn_iff {ι α : Type*} [TopologicalSpace α]
    (F : ι → α → G) (f : α → G) (p : Filter ι) (s : Set α) :
    @TendstoLocallyUniformlyOn α G ι (TopologicalGroup.toUniformSpace G) _ F f p s ↔
      ∀ u ∈ 𝓝 (1 : G), ∀ x ∈ s, ∃ t ∈ 𝓝[s] x, ∀ᶠ i in p, ∀ a ∈ t, F i a / f a ∈ u

{G : Type u_1}
[AddGroup G]
[TopologicalSpace G]
[TopologicalAddGroup G]
{ι : Type u_2}
{α : Type u_3}
[TopologicalSpace α]
(F : ι → α → G)
(f : α → G)
(p : Filter ι)
(s : Set α)

TendstoLocallyUniformlyOn F f p s ↔ ∀ u ∈ 𝓝 0, ∀ x ∈ s, ∃ t ∈ 𝓝[s] x, ∀ᶠ (i : ι) in p, ∀ a ∈ t, F i a - f a ∈ u


{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
{B : LinearMap.BilinForm R M}
(x : M)


theorem biproduct.mapBiproduct_hom_desc (g : ∀ j, f j ⟶ W) :
    ((F.mapBiproduct f).hom ≫ biproduct.desc fun j => F.map (g j)) = F.map (biproduct.desc g)

((F.mapBiproduct f).hom ≫ CategoryTheory.Limits.biproduct.desc fun j => F.map (g j)) =
  F.map (CategoryTheory.Limits.biproduct.desc g)


@[to_additive]
theorem prod_eq_pow_single [DecidableEq α] (a : α) (h : ∀ a' ≠ a, a' ∈ s → a' = 1) :
    s.prod = a ^ s.count a

(h : ∀ (a' : α), a' ≠ a → a' ∈ s → a' = 1)


theorem widePushout_exists_rep {B : C} {α : Type _} {X : α → C} (f : ∀ j : α, B ⟶ X j)
    [HasWidePushout.{v} B X f] [PreservesColimit (wideSpan B X f) (forget C)]
    (x : ↑(widePushout B X f)) : (∃ y : B, head f y = x) ∨ ∃ (i : α) (y : X i), ι f i y = x

[CategoryTheory.Limits.HasWidePushout B X f]

[CategoryTheory.Limits.PreservesColimit (CategoryTheory.Limits.WidePushoutShape.wideSpan B X f)
    (CategoryTheory.forget C)]

(x : (CategoryTheory.forget C).obj (CategoryTheory.Limits.widePushout B X f))

(∃ y, (CategoryTheory.Limits.WidePushout.head f) y = x) ∨ ∃ i y, (CategoryTheory.Limits.WidePushout.ι f i) y = x


theorem isBridge_iff_mem_and_forall_cycle_not_mem {e : Sym2 V} :
    G.IsBridge e ↔ e ∈ G.edgeSet ∧ ∀ ⦃u : V⦄ (p : G.Walk u u), p.IsCycle → e ∉ p.edges

{V : Type u}
{G : SimpleGraph V}
{e : Sym2 V}


protected theorem lawfulMonad : LawfulMonad Filter


@[simp]
theorem deriv_id' : deriv (@id 𝕜) = fun _ => 1

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]


@[simp]
lemma add_val {M N : SheafOfModules.{v} R} (f g : M ⟶ N) :
    (f + g).val = f.val + g.val

{J : CategoryTheory.GrothendieckTopology C}


/-- The unit iso in the equivalence of sheaf categories. -/
@[simps!]
def sheafCongr.unitIso : 𝟭 (Sheaf J A) ≅ functor J K e A ⋙ inverse J K e A

(J : CategoryTheory.GrothendieckTopology C)

(K : CategoryTheory.GrothendieckTopology D)

[CategoryTheory.Equivalence.TransportsGrothendieckTopology J K e]

∀ (X_1 : Cᵒᵖ),
  ((CategoryTheory.Equivalence.sheafCongr.unitIso J K e A).hom.app X).val.app X_1 =
    X.val.map (e.unitIso.inv.app (Opposite.unop X_1)).op


/-- The inclusion of a quiver `V` into its path category, as a prefunctor.
-/
@[simps]
def of : V ⥤q Paths V

∀ {X Y : V} (f : X ⟶ Y), CategoryTheory.Paths.of.map f = f.toPath


@[ext]
theorem leftDistributor_ext₂_right {J : Type} [Fintype J]
    {X Y Z : C} {f : J → C} {g h : X ⟶ Y ⊗ (Z ⊗ ⨁ f)}
    (w : ∀ j, g ≫ (Y ◁ (Z ◁ biproduct.π f j)) = h ≫ (Y ◁ (Z ◁ biproduct.π f j))) :
    g = h

{g h : X ⟶ CategoryTheory.MonoidalCategory.tensorObj Y (CategoryTheory.MonoidalCategory.tensorObj Z (⨁ f))}

(w :
  ∀ (j : J),
    CategoryTheory.CategoryStruct.comp g
        (CategoryTheory.MonoidalCategory.whiskerLeft Y
          (CategoryTheory.MonoidalCategory.whiskerLeft Z (CategoryTheory.Limits.biproduct.π f j))) =
      CategoryTheory.CategoryStruct.comp h
        (CategoryTheory.MonoidalCategory.whiskerLeft Y
          (CategoryTheory.MonoidalCategory.whiskerLeft Z (CategoryTheory.Limits.biproduct.π f j))))


theorem le_limsup_of_frequently_le {α β} [ConditionallyCompleteLinearOrder β] {f : Filter α}
    {u : α → β} {b : β} (hu_le : ∃ᶠ x in f, b ≤ u x)
    (hu : f.IsBoundedUnder (· ≤ ·) u := by isBoundedDefault) :
    b ≤ limsup u f

(hu : Filter.IsBoundedUnder (fun x x_1 => x ≤ x_1) f u := by isBoundedDefault)


/-- If a function has a finite power series on a ball, then so does its derivative.
This is a variant of `HasFiniteFPowerSeriesOnBall.fderiv` where the degree of `f` is `< n`
and not `< n + 1`. -/
theorem HasFiniteFPowerSeriesOnBall.fderiv' (h : HasFiniteFPowerSeriesOnBall f p x n r) :
    HasFiniteFPowerSeriesOnBall (fderiv 𝕜 f) p.derivSeries x (n - 1) r


/-- The composition of `C^n` functions within domains at points is `C^n`. -/
theorem ContMDiffWithinAt.comp' {t : Set M'} {g : M' → M''} (x : M)
    (hg : ContMDiffWithinAt I' I'' n g t (f x)) (hf : ContMDiffWithinAt I I' n f s x) :
    ContMDiffWithinAt I I'' n (g ∘ f) (s ∩ f ⁻¹' t) x


@[simp] theorem matPolyEquiv_diagonal_X :
    matPolyEquiv (diagonal fun _ : n => (X : R[X])) = X

{R : Type u_1}
[CommSemiring R]
{n : Type w}
[DecidableEq n]
[Fintype n]

matPolyEquiv (Matrix.diagonal fun x => Polynomial.X) = Polynomial.X


@[simp]
lemma leftShift_add (a n' : ℤ) (hn' : n + a = n') :
    (γ₁ + γ₂).leftShift a n' hn' = γ₁.leftShift a n' hn' + γ₂.leftShift a n' hn'

(γ₁ γ₂ : CochainComplex.HomComplex.Cochain K L n)


theorem IsRotated.perm (h : l ~r l') : l ~ l'

{α : Type u}
{l l' : List α}
(h : l ~r l')


@[simp]
theorem range_familyOfBFamily' {ι : Type u} (r : ι → ι → Prop) [IsWellOrder ι r] {o}
    (ho : type r = o) (f : ∀ a < o, α) : range (familyOfBFamily' r ho f) = brange o f

{α : Type u_1}
{ι : Type u}
(r : ι → ι → Prop)
[IsWellOrder ι r]
{o : Ordinal.{u}}
(ho : Ordinal.type r = o)
(f : (a : Ordinal.{u}) → a < o → α)

Set.range (Ordinal.familyOfBFamily' r ho f) = o.brange f


theorem le_or_le [LinearOrder α] {a b : α} (h : a ≤ b) (c : α) : a ≤ c ∨ c ≤ b

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


/-- `g ∘ f` is `C^n` within `s` at `x` if `g` is `C^n` at `f x` and
`f` is `C^n` within `s` at `x`. -/
theorem ContMDiffAt.comp_contMDiffWithinAt {g : M' → M''} (x : M)
    (hg : ContMDiffAt I' I'' n g (f x)) (hf : ContMDiffWithinAt I I' n f s x) :
    ContMDiffWithinAt I I'' n (g ∘ f) s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M' : Type u_7}
[TopologicalSpace M']
[ChartedSpace H' M']
{E'' : Type u_8}
[NormedAddCommGroup E'']
[NormedSpace 𝕜 E'']
{H'' : Type u_9}
[TopologicalSpace H'']
{I'' : ModelWithCorners 𝕜 E'' H''}
{M'' : Type u_10}
[TopologicalSpace M'']
[ChartedSpace H'' M'']
{f : M → M'}
{s : Set M}
{n : ℕ∞}
{g : M' → M''}
(x : M)
(hg : ContMDiffAt I' I'' n g (f x))
(hf : ContMDiffWithinAt I I' n f s x)


@[to_additive]
theorem coe_eq_singleton {H : Subgroup G} : (∃ g : G, (H : Set G) = {g}) ↔ H = ⊥

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


theorem mk_lf_of_le {xl xr y j} (xL) {xR : xr → PGame} : xR j ≤ y → mk xl xr xL xR ⧏ y

{xl xr : Type u_1}
{y : SetTheory.PGame}
{j : xr}
(xL : xl → SetTheory.PGame)
{xR : xr → SetTheory.PGame}

xR j ≤ y → (SetTheory.PGame.mk xl xr xL xR).LF y


@[simp]
theorem inv_left [IsIso sq] : (inv sq).left = inv sq.left

{T : Type u}
[CategoryTheory.Category.{v, u} T]
{f g : CategoryTheory.Arrow T}
(sq : f ⟶ g)
[CategoryTheory.IsIso sq]

(CategoryTheory.inv sq).left = CategoryTheory.inv sq.left


@[simp]
theorem mapIso_symm (F : C ⥤ D) {X Y : C} (i : X ≅ Y) : F.mapIso i.symm = (F.mapIso i).symm

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


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

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


theorem order_finite_iff_ne_zero : (order φ).Dom ↔ φ ≠ 0

{R : Type u_1}
[Semiring R]
{φ : PowerSeries R}


@[simp] theorem add_imK : (a + b).imK = a.imK + b.imK

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


theorem mem_toList_iff {y : α} : y ∈ toList p x ↔ SameCycle p x y ∧ x ∈ p.support

{α : Type u_1}
[Fintype α]
[DecidableEq α]
{p : Equiv.Perm α}
{x y : α}

y ∈ p.toList x ↔ p.SameCycle x y ∧ x ∈ p.support


theorem Nonempty.zero_mul (hs : s.Nonempty) : 0 * s = 0

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


/-- Coercion to a function as a `MonoidHom`. Similar to `MonoidHom.coeFn`. -/
@[to_additive (attr := simps) "Coercion to a function as an `AddMonoidHom`.
  Similar to `AddMonoidHom.coeFn`."]
def coeFnMonoidHom {G : Type*} [Monoid G] [TopologicalSpace G] [ChartedSpace H' G]
    [SmoothMul I' G] : C^∞⟮I, N; I', G⟯ →* N → G

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{E' : Type u_3}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H : Type u_4}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{H' : Type u_5}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{N : Type u_6}
[TopologicalSpace N]
[ChartedSpace H N]
{G : Type u_10}
[AddMonoid G]
[TopologicalSpace G]
[ChartedSpace H' G]
[SmoothAdd I' G]

∀ (a : C^⊤⟮I, N; I', G⟯) (a_1 : N), SmoothMap.coeFnAddMonoidHom a a_1 = a a_1


theorem heq_of_heq_of_eq (h₁ : HEq a b) (h₂ : b = b') : HEq a b'

{α β : Sort u}
{a : α}
{b b' : β}
(h₁ : HEq a b)
(h₂ : b = b')


theorem sigma_zero_apply_prime_pow {p i : ℕ} (hp : p.Prime) : σ 0 (p ^ i) = i + 1

(ArithmeticFunction.sigma 0) (p ^ i) = i + 1


@[simp]
theorem self_symm_id_assoc (α : X ≅ Y) (β : X ≅ Z) : α ≪≫ α.symm ≪≫ β = β

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X Y Z : C}
(α : X ≅ Y)
(β : X ≅ Z)

α ≪≫ α.symm ≪≫ β = β


@[simp]
theorem round_add_ofNat (x : α) (n : ℕ) [n.AtLeastTwo] :
    round (x + (no_index (OfNat.ofNat n))) = round x + OfNat.ofNat n

{α : Type u_2}
[LinearOrderedRing α]
[FloorRing α]
(x : α)
(n : ℕ)
[n.AtLeastTwo]

round (x + OfNat.ofNat n) = round x + OfNat.ofNat n


theorem le.dest : ∀ {n m : Nat}, n ≤ m → Exists (fun k => n + k = m)


@[to_additive (attr := simp)]
theorem prod_zero : @prod α _ 0 = 1


theorem extend_of_empty [IsEmpty α] (f : α ↪ δ) (g : α →ᵇ β) (h : δ →ᵇ β) : extend f g h = h

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[PseudoMetricSpace β]
{δ : Type u_2}
[TopologicalSpace δ]
[DiscreteTopology δ]
[IsEmpty α]
(f : α ↪ δ)
(g : BoundedContinuousFunction α β)
(h : BoundedContinuousFunction δ β)

BoundedContinuousFunction.extend f g h = h


theorem mk_neg {f : CauSeq ℚ abs} : mk (-f) = -mk f


theorem expand_eq_zero {p : ℕ} (hp : 0 < p) {f : R[X]} : expand R p f = 0 ↔ f = 0

{R : Type u}
[CommSemiring R]
{p : ℕ}
(hp : 0 < p)
{f : R[X]}


@[simp] theorem length_erase_add_one {a : α} {l : List α} (h : a ∈ l) :
    (l.erase a).length + 1 = l.length

{α : Type u}
[DecidableEq α]
{a : α}
{l : List α}
(h : a ∈ l)


@[simp]
theorem preimage_const_add_Ico : (fun x => a + x) ⁻¹' Ico b c = Ico (b - a) (c - a)

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

(fun x => a + x) ⁻¹' Set.Ico b c = Set.Ico (b - a) (c - a)


protected theorem enlarge {T} (hS : RestrictGenTopology S) (hT : ∀ s ∈ S, ∃ t ∈ T, s ⊆ t) :
    RestrictGenTopology T

{X : Type u_1}
[TopologicalSpace X]
{S T : Set (Set X)}
(hS : RestrictGenTopology S)
(hT : ∀ s ∈ S, ∃ t ∈ T, s ⊆ t)


theorem convexJoin_assoc (s t u : Set E) :
    convexJoin 𝕜 (convexJoin 𝕜 s t) u = convexJoin 𝕜 s (convexJoin 𝕜 t u)

{𝕜 : Type u_2}
{E : Type u_3}
[LinearOrderedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
(s t u : Set E)


theorem EventuallyLE.cardinal_bUnion {S : Set ι} (hS : #S < c)
    {s t : ∀ i ∈ S, Set α} (h : ∀ i hi, s i hi ≤ᶠ[l] t i hi) :
    ⋃ i ∈ S, s i ‹_› ≤ᶠ[l] ⋃ i ∈ S, t i ‹_›

(h : ∀ (i : ι) (hi : i ∈ S), s i hi ≤ᶠ[l] t i hi)

⋃ i, ⋃ (h : i ∈ S), s i h ≤ᶠ[l] ⋃ i, ⋃ (h : i ∈ S), t i h


@[simp] theorem mapM'_cons [Monad m] {f : α → m β} :
    mapM' f (a :: l) = return ((← f a) :: (← l.mapM' f))

{m : Type u_1 → Type u_2}
{α : Type u_3}
{β : Type u_1}
{a : α}
{l : List α}
[Monad m]
{f : α → m β}

List.mapM' f (a :: l) = do
  let __do_lift ← f a
  let __do_lift_1 ← List.mapM' f l
  pure (__do_lift :: __do_lift_1)


@[to_additive neg_nonneg_of_nonpos]
theorem one_le_inv_of_le_one : a ≤ 1 → 1 ≤ a⁻¹

{α : Type u}
[OrderedCommGroup α]
{a : α}

a ≤ 1 → 1 ≤ a⁻¹


theorem average_pair {f : α → E} {g : α → F} (hfi : Integrable f μ) (hgi : Integrable g μ) :
    ⨍ x, (f x, g x) ∂μ = (⨍ x, f x ∂μ, ⨍ x, g x ∂μ)

{α : Type u_1}
{E : Type u_2}
{F : Type u_3}
{m0 : MeasurableSpace α}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[CompleteSpace E]
[NormedAddCommGroup F]
[NormedSpace ℝ F]
[CompleteSpace F]
{μ : MeasureTheory.Measure α}
{f : α → E}
{g : α → F}
(hfi : MeasureTheory.Integrable f μ)
(hgi : MeasureTheory.Integrable g μ)

⨍ (x : α), (f x, g x) ∂μ = (⨍ (x : α), f x ∂μ, ⨍ (x : α), g x ∂μ)


theorem HasSum.mul_left (a₂) (h : HasSum f a₁) : HasSum (fun i ↦ a₂ * f i) (a₂ * a₁)

{ι : Type u_1}
{α : Type u_4}
[NonUnitalNonAssocSemiring α]
[TopologicalSpace α]
[TopologicalSemiring α]
{f : ι → α}
{a₁ : α}
(a₂ : α)
(h : HasSum f a₁)


theorem support_smul_subset_vadd_support' [MulZeroClass R] [SMulWithZero R V] {x : HahnSeries Γ R}
    {y : HahnModule Γ' R V} :
    ((of R).symm (x • y)).support ⊆ x.support +ᵥ ((of R).symm y).support

{Γ : Type u_1}
{Γ' : Type u_2}
{R : Type u_3}
{V : Type u_4}
[PartialOrder Γ]
[PartialOrder Γ']
[VAdd Γ Γ']
[IsOrderedCancelVAdd Γ Γ']
[AddCommMonoid V]
[MulZeroClass R]
[SMulWithZero R V]
{x : HahnSeries Γ R}
{y : HahnModule Γ' R V}

((HahnModule.of R).symm (x • y)).support ⊆ x.support +ᵥ ((HahnModule.of R).symm y).support


@[simp]
theorem toList_singleton : ∀ a, ({a} : Finset α).toList = [a]


theorem explicitCokernelDesc_norm_le_of_norm_le {X Y Z : SemiNormedGrp.{u}} {f : X ⟶ Y}
    {g : Y ⟶ Z} (w : f ≫ g = 0) (c : ℝ≥0) (h : ‖g‖ ≤ c) : ‖explicitCokernelDesc w‖ ≤ c

{X Y Z : SemiNormedGrp}
{f : X ⟶ Y}
{g : Y ⟶ Z}
(w : f ≫ g = 0)
(c : NNReal)
(h : ‖g‖ ≤ ↑c)

‖SemiNormedGrp.explicitCokernelDesc w‖ ≤ ↑c


lemma tsum_riemannZetaSummand (hs : 1 < s.re) :
    ∑' (n : ℕ), riemannZetaSummandHom (ne_zero_of_one_lt_re hs) n = riemannZeta s

∑' (n : ℕ), (riemannZetaSummandHom ⋯) n = riemannZeta s


/-- The vertical composition of 2-squares. -/
@[simps!]
def vComp : TwoSquare H₁ (L₁ ⋙ L₂) (R₁ ⋙ R₂) H₃

(w : CategoryTheory.TwoSquare H₁ L₁ R₁ H₂)

(w' : CategoryTheory.TwoSquare H₂ L₂ R₂ H₃)

(w.vComp w').app X = CategoryTheory.CategoryStruct.comp (R₂.map (w.app X)) (w'.app (L₁.obj X))


theorem zero_apply (x : L₁) : (0 : L₁ →ₗ⁅R⁆ L₂) x = 0

{R : Type u}
{L₁ : Type v}
{L₂ : Type w}
[CommRing R]
[LieRing L₁]
[LieAlgebra R L₁]
[LieRing L₂]
[LieAlgebra R L₂]
(x : L₁)


theorem choose_eq_asc_factorial_div_factorial' (n k : ℕ) :
    (n + k - 1).choose k = n.ascFactorial k / k !


theorem nadd_right_cancel : ∀ {a b c}, a ♯ b = c ♯ b → a = c


/-- If `α` is a preorder with no maximal elements, then there exists a strictly antitone function
`ℕ → α` with any prescribed value of `f 0`. -/
theorem exists_strictAnti' [NoMinOrder α] (a : α) : ∃ f : ℕ → α, StrictAnti f ∧ f 0 = a

{α : Type u}
[Preorder α]
[NoMinOrder α]
(a : α)


@[simp]
theorem countable_coe_iff {s : Set α} : Countable s ↔ s.Countable


lemma polyCharpoly_coeff_nilRank_ne_zero :
    (polyCharpoly φ b).coeff (nilRank φ) ≠ 0

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


theorem IsCoseparating.isCodetecting [Balanced C] {𝒢 : Set C} :
    IsCoseparating 𝒢 → IsCodetecting 𝒢

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.Balanced C]
{𝒢 : Set C}

CategoryTheory.IsCoseparating 𝒢 → CategoryTheory.IsCodetecting 𝒢


theorem specializes_iff_forall_open : x ⤳ y ↔ ∀ s : Set X, IsOpen s → y ∈ s → x ∈ s

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

x ⤳ y ↔ ∀ (s : Set X), IsOpen s → y ∈ s → x ∈ s


theorem gcd_dvd_gcd_mul_right_right (m n k : Nat) : gcd m n ∣ gcd m (n * k)


/-- The L-series of the twist of the von Mangoldt function `Λ` by a Dirichlet character `χ`
converges at `s` when `re s > 1`. -/
lemma LSeriesSummable_twist_vonMangoldt {N : ℕ} (χ : DirichletCharacter ℂ N) {s : ℂ}
    (hs : 1 < s.re) :
    LSeriesSummable (↗χ * ↗Λ) s

LSeriesSummable ((fun n => χ ↑n) * fun n => ↑(ArithmeticFunction.vonMangoldt n)) s


@[simp]
theorem dist_equiv_symm_snd (y₁ y₂ : β) :
    dist ((WithLp.equiv p (α × β)).symm (0, y₁)) ((WithLp.equiv p (α × β)).symm (0, y₂)) =
      dist y₁ y₂

(p : ℝ≥0∞)
(α : Type u_2)
(β : Type u_3)
[hp : Fact (1 ≤ p)]
[SeminormedAddCommGroup α]
[SeminormedAddCommGroup β]
(y₁ y₂ : β)


@[simp]
theorem setValue_eq {α β} (f : α ↪ β) (a : α) (b : β) [∀ a', Decidable (a' = a)]
    [∀ a', Decidable (f a' = b)] : setValue f a b a = b

{α : Sort u_1}
{β : Sort u_2}
(f : α ↪ β)
(a : α)
(b : β)
[(a' : α) → Decidable (a' = a)]
[(a' : α) → Decidable (f a' = b)]


theorem eval₂_C_mk_eq_zero {I : Ideal R} {a : MvPolynomial σ R}
    (ha : a ∈ (Ideal.map (C : R →+* MvPolynomial σ R) I : Ideal (MvPolynomial σ R))) :
    eval₂Hom (C.comp (Ideal.Quotient.mk I)) X a = 0

{R : Type u_1}
{σ : Type u_2}
[CommRing R]
{I : Ideal R}
{a : MvPolynomial σ R}
(ha : a ∈ Ideal.map MvPolynomial.C I)

(MvPolynomial.eval₂Hom (MvPolynomial.C.comp (Ideal.Quotient.mk I)) MvPolynomial.X) a = 0


theorem comap_ne_bot_of_algebraic_mem [IsDomain S] {x : S} (x_ne_zero : x ≠ 0) (x_mem : x ∈ I)
    (hx : IsAlgebraic R x) : I.comap (algebraMap R S) ≠ ⊥

{R : Type u_1}
[CommRing R]
{S : Type u_2}
[CommRing S]
{I : Ideal S}
[Algebra R S]
[IsDomain S]
{x : S}
(x_ne_zero : x ≠ 0)
(x_mem : x ∈ I)
(hx : IsAlgebraic R x)


theorem map_conjAut (F : C ⥤ D) {X Y : C} (α : X ≅ Y) (f : Aut X) :
    F.mapIso (α.conjAut f) = (F.mapIso α).conjAut (F.mapIso f)

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{D : Type u₁}
[CategoryTheory.Category.{v₁, u₁} D]
(F : CategoryTheory.Functor C D)
{X Y : C}
(α : X ≅ Y)
(f : CategoryTheory.Aut X)


theorem HasDerivAt.tendsto_slope_zero_right [PartialOrder 𝕜] (h : HasDerivAt f f' x) :
    Tendsto (fun t ↦ t⁻¹ • (f (x + t) - f x)) (𝓝[>] 0) (𝓝 f')

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

Filter.Tendsto (fun t => t⁻¹ • (f (x + t) - f x)) (𝓝[>] 0) (𝓝 f')


@[simp]
theorem natDegree_toSubring : (toSubring p T hp).natDegree = p.natDegree

{R : Type u}
[Ring R]
(p : R[X])
(T : Subring R)
(hp : ↑p.coeffs ⊆ ↑T)

(p.toSubring T hp).natDegree = p.natDegree


/-- The Hasse derivative of Laurent series, as a linear map. -/
@[simps]
def hasseDeriv (R : Type*) {V : Type*} [AddCommGroup V] [Semiring R] [Module R V] (k : ℕ) :
    LaurentSeries V →ₗ[R] LaurentSeries V

(R : Type u_2)
{V : Type u_3}
[AddCommGroup V]
[Semiring R]
[Module R V]
(k : ℕ)
(f : LaurentSeries V)

(LaurentSeries.hasseDeriv R k) f = HahnSeries.ofSuppBddBelow (fun n => Ring.choose (n + ↑k) k • f.coeff (n + ↑k)) ⋯


theorem nonneg_mul {a b : ℤ√d} (ha : Nonneg a) (hb : Nonneg b) : Nonneg (a * b)

{d : ℕ}
{a b : ℤ√↑d}
(ha : a.Nonneg)
(hb : b.Nonneg)


/-- A measurable set `s` is a *fundamental domain* for an action of a group `G` on a measurable
space `α` with respect to a measure `α` if the sets `g • s`, `g : G`, are pairwise a.e. disjoint and
cover the whole space. -/
@[to_additive IsAddFundamentalDomain]
structure IsFundamentalDomain (G : Type*) {α : Type*} [One G] [SMul G α] [MeasurableSpace α]
    (s : Set α) (μ : Measure α := by volume_tac) : Prop where
  protected nullMeasurableSet : NullMeasurableSet s μ
  protected ae_covers : ∀ᵐ x ∂μ, ∃ g : G, g • x ∈ s
  protected aedisjoint : Pairwise <| (AEDisjoint μ on fun g : G => g • s)

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

(self : MeasureTheory.IsFundamentalDomain G s μ)

Pairwise (MeasureTheory.AEDisjoint μ on fun g => g • s)


theorem IsWeightedHomogeneous.weightedHomogeneousComponent_ne {m : M} (n : M)
    {p : MvPolynomial σ R} (hp : IsWeightedHomogeneous w p m) :
    n ≠ m → weightedHomogeneousComponent w n p = 0

(hp : MvPolynomial.IsWeightedHomogeneous w p m)

n ≠ m → (MvPolynomial.weightedHomogeneousComponent w n) p = 0


theorem naturality {G H : Type _ → Type _} [Applicative G] [Applicative H] [CommApplicative G]
    [CommApplicative H] (eta : ApplicativeTransformation G H) {α β : Type _} (f : α → G β)
    (x : Multiset α) : eta (traverse f x) = traverse (@eta _ ∘ f) x

{G H : Type u_1 → Type u_1}
[Applicative G]
[Applicative H]
[CommApplicative G]
[CommApplicative H]
(eta : ApplicativeTransformation G H)
{α β : Type u_1}
(f : α → G β)
(x : Multiset α)

(fun {α} => eta.app α) (Multiset.traverse f x) = Multiset.traverse ((fun {α} => eta.app α) ∘ f) x


theorem rightInverse_bijInv (f_bij : Bijective f) : RightInverse (bijInv f_bij) f

{α : Type u_1}
{β : Type u_2}
[Fintype α]
[DecidableEq β]
{f : α → β}
(f_bij : Function.Bijective f)

Function.RightInverse (Fintype.bijInv f_bij) f


@[simp, norm_cast] lemma coe_sdiff (s t : CompactOpens α) : ↑(s \ t) = (s \ t : Set α)

{α : Type u_1}
[TopologicalSpace α]
[T2Space α]
(s t : TopologicalSpace.CompactOpens α)


theorem wbtw_smul_vadd_smul_vadd_of_nonneg_of_le (x : P) (v : V) {r₁ r₂ : R} (hr₁ : 0 ≤ r₁)
    (hr₂ : r₁ ≤ r₂) : Wbtw R x (r₁ • v +ᵥ x) (r₂ • v +ᵥ x)

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[LinearOrderedField R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
(x : P)
(v : V)
{r₁ r₂ : R}
(hr₁ : 0 ≤ r₁)
(hr₂ : r₁ ≤ r₂)


theorem le_max_of_eq {s : Finset α} {a b : α} (h₁ : a ∈ s) (h₂ : s.max = b) : a ≤ b

{α : Type u_2}
[LinearOrder α]
{s : Finset α}
{a b : α}
(h₁ : a ∈ s)
(h₂ : s.max = ↑b)


@[to_additive Iio_add_Iic_subset]
theorem Iio_mul_Iic_subset' [LocallyFiniteOrderBot α] (a b : α) : Iio a * Iic b ⊆ Iio (a * b)

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

[CovariantClass α α (Function.swap HAdd.hAdd) LT.lt]

Finset.Iio a + Finset.Iic b ⊆ Finset.Iio (a + b)


@[congr]
theorem card_congr' {α β} [Fintype α] [Fintype β] (h : α = β) : card α = card β

{α β : Type u_4}
[Fintype α]
[Fintype β]
(h : α = β)


theorem right_mem_Ioc : b ∈ Ioc a b ↔ a < b

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


theorem IsBigOWith.trans (hfg : IsBigOWith c l f g) (hgk : IsBigOWith c' l g k) (hc : 0 ≤ c) :
    IsBigOWith (c * c') l f k

{α : Type u_1}
{E : Type u_3}
{F : Type u_4}
{G : Type u_5}
[Norm E]
[Norm F]
[Norm G]
{c c' : ℝ}
{f : α → E}
{g : α → F}
{k : α → G}
{l : Filter α}
(hfg : Asymptotics.IsBigOWith c l f g)
(hgk : Asymptotics.IsBigOWith c' l g k)
(hc : 0 ≤ c)


theorem mem_range_of_measure_ne_zero {f : α →ₛ β} {x : β} {μ : Measure α} (H : μ (f ⁻¹' {x}) ≠ 0) :
    x ∈ f.range

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
{f : MeasureTheory.SimpleFunc α β}
{x : β}
{μ : MeasureTheory.Measure α}
(H : μ (↑f ⁻¹' {x}) ≠ 0)


theorem singleton_injective : Function.Injective (@singleton ZFSet ZFSet _)


theorem bounded_le_inter_not_le [SemilatticeSup α] (a : α) :
    Bounded (· ≤ ·) (s ∩ { b | ¬b ≤ a }) ↔ Bounded (· ≤ ·) s

{α : Type u_1}
{s : Set α}
[SemilatticeSup α]
(a : α)

Set.Bounded (fun x x_1 => x ≤ x_1) (s ∩ {b | ¬b ≤ a}) ↔ Set.Bounded (fun x x_1 => x ≤ x_1) s


theorem mk_val (i : Fin n) : (⟨i, i.isLt⟩ : Fin n) = i


theorem coe_neg_one : ((-1 : (𝓞 K)ˣ) : K) = (-1 : K)


protected theorem IsOpenMap.prod {f : X → Y} {g : Z → W} (hf : IsOpenMap f) (hg : IsOpenMap g) :
    IsOpenMap fun p : X × Z => (f p.1, g p.2)

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


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

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

ContinuousWithinAt (fun x => z • f x) s x


theorem smooth_inclusion {U V : Opens M} (h : U ≤ V) : Smooth I I (Set.inclusion h : U → V)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{U V : TopologicalSpace.Opens M}
(h : U ≤ V)


@[simp]
theorem ofNat_nat (n) : ofNat ℕ n = n


theorem HasFDerivAt.norm_sq {f : G → F} {f' : G →L[ℝ] F} (hf : HasFDerivAt f f' x) :
    HasFDerivAt (‖f ·‖ ^ 2) (2 • (innerSL ℝ (f x)).comp f') x

{F : Type u_3}
[NormedAddCommGroup F]
[InnerProductSpace ℝ F]
{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace ℝ G]
{x : G}
{f : G → F}
{f' : G →L[ℝ] F}
(hf : HasFDerivAt f f' x)

HasFDerivAt (fun x => ‖f x‖ ^ 2) (2 • ((innerSL ℝ) (f x)).comp f') x


theorem Algebra.isSeparable_tower_top_of_isSeparable [Algebra.IsSeparable F E] :
    Algebra.IsSeparable K E

(F : Type u_1)
(K : Type u_2)
(E : Type u_3)
[Field F]
[Field K]
[Field E]
[Algebra F K]
[Algebra F E]
[Algebra K E]
[IsScalarTower F K E]
[Algebra.IsSeparable F E]


@[to_additive]
theorem mul_inv_le_inv_mul_iff : a * b⁻¹ ≤ d⁻¹ * c ↔ d * a ≤ c * b

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

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


theorem mul_lt_one_of_nonneg_of_lt_one_left [PosMulMono α]
    (ha₀ : 0 ≤ a) (ha : a < 1) (hb : b ≤ 1) : a * b < 1

{α : Type u}
[Semiring α]
[Preorder α]
{a b : α}
[PosMulMono α]
(ha₀ : 0 ≤ a)
(ha : a < 1)
(hb : b ≤ 1)


theorem isPrimitiveRoot_iff' {k : ℕ+} {ζ ξ : Rˣ} (h : IsPrimitiveRoot ζ k) :
    IsPrimitiveRoot ξ k ↔ ∃ i < (k : ℕ), i.Coprime k ∧ ζ ^ i = ξ

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

IsPrimitiveRoot ξ ↑k ↔ ∃ i < ↑k, i.Coprime ↑k ∧ ζ ^ i = ξ


@[to_additive]
theorem nmem_mulSupport {f : α → M} {x : α} : x ∉ mulSupport f ↔ f x = 1

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


/-- The additive version of `finsupp.toFinsupp`. Note that this is `noncomputable` because
`Finsupp.add` is noncomputable. -/
@[simps (config := .asFn)]
def finsuppAddEquivDFinsupp [DecidableEq ι] [AddZeroClass M] [∀ m : M, Decidable (m ≠ 0)] :
    (ι →₀ M) ≃+ Π₀ _ : ι, M

{ι : Type u_1}
{M : Type u_3}
[DecidableEq ι]
[AddZeroClass M]
[(m : M) → Decidable (m ≠ 0)]


theorem linearIndependent_image {ι} {s : Set ι} {f : ι → M} (hf : Set.InjOn f s) :
    (LinearIndependent R fun x : s => f x) ↔ LinearIndependent R fun x : f '' s => (x : M)

{R : Type u_2}
{M : Type u_4}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{ι : Type u_8}
{s : Set ι}
{f : ι → M}
(hf : Set.InjOn f s)

(LinearIndependent R fun (x : ↑s) => f ↑x) ↔ LinearIndependent R fun (x : ↑(f '' s)) => ↑x


@[to_additive]
theorem map_comap_le {S : Subsemigroup N} {f : M →ₙ* N} : (S.comap f).map f ≤ S

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

AddSubsemigroup.map f (AddSubsemigroup.comap f S) ≤ S


theorem karoubiUniversal₂_functor_eq : (karoubiUniversal₂ C D).functor = functorExtension₂ C D

(C : Type u_1)
(D : Type u_2)
[CategoryTheory.Category.{u_4, u_1} C]
[CategoryTheory.Category.{u_5, u_2} D]
[CategoryTheory.IsIdempotentComplete D]

(CategoryTheory.Idempotents.karoubiUniversal₂ C D).functor = CategoryTheory.Idempotents.functorExtension₂ C D


@[to_additive (attr := simp)]
theorem unop_le_unop_iff {S₁ S₂ : Submonoid Mᵐᵒᵖ} : S₁.unop ≤ S₂.unop ↔ S₁ ≤ S₂

{M : Type u_2}
[AddZeroClass M]
{S₁ S₂ : AddSubmonoid Mᵃᵒᵖ}


/-- The inclusion map `ℍ → ℂ` is a differentiable map of manifolds. -/
theorem mdifferentiable_coe : MDifferentiable 𝓘(ℂ) 𝓘(ℂ) ((↑) : ℍ → ℂ)

MDifferentiable 𝓘(ℂ, ℂ) 𝓘(ℂ, ℂ) UpperHalfPlane.coe


/-- Reinterpret a supremum homomorphism as an infimum homomorphism between the dual lattices. -/
@[simps]
protected def dual : SupHom α β ≃ InfHom αᵒᵈ βᵒᵈ

{α : Type u_3}
{β : Type u_4}
[Sup α]
[Sup β]
(f : InfHom αᵒᵈ βᵒᵈ)
(a : αᵒᵈ)


lemma Hom.toAlgHom_C (f : Hom P P') (r) : f.toAlgHom (.C r) = .C (algebraMap _ _ r)

{R : Type u}
{S : Type v}
[CommRing R]
[CommRing S]
[Algebra R S]
{P : Algebra.Generators R S}
{R' : Type u_1}
{S' : Type u_2}
[CommRing R']
[CommRing S']
[Algebra R' S']
{P' : Algebra.Generators R' S'}
[Algebra R R']
[Algebra S S']
(f : P.Hom P')
(r : R)

f.toAlgHom (MvPolynomial.C r) = MvPolynomial.C ((algebraMap R R') r)


theorem algHom_ext ⦃f g : (⨁ i, A i) →ₐ[R] B⦄ (h : ∀ i x, f (of A i x) = g (of A i x)) : f = g

⦃f g : (DirectSum ι fun i => A i) →ₐ[R] B⦄

(h : ∀ (i : ι) (x : A i), f ((DirectSum.of A i) x) = g ((DirectSum.of A i) x))


protected theorem ContMDiffWithinAt.coordChange
    (hf : ContMDiffWithinAt IM IB n f s x) (hg : ContMDiffWithinAt IM 𝓘(𝕜, F) n g s x)
    (he : f x ∈ e.baseSet) (he' : f x ∈ e'.baseSet) :
    ContMDiffWithinAt IM 𝓘(𝕜, F) n (fun y ↦ e.coordChange e' (f y) (g y)) s x

[TopologicalSpace (Bundle.TotalSpace F E)]

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

ContMDiffWithinAt IM 𝓘(𝕜, F) n (fun y => e.coordChange e' (f y) (g y)) s x


@[simp]
theorem LieIdeal.coe_bracket_of_module {R L : Type*} [CommRing R] [LieRing L] [LieAlgebra R L]
    (I : LieIdeal R L) [LieRingModule L M] (x : I) (m : M) : ⁅x, m⁆ = ⁅(↑x : L), m⁆

(M : Type w)
[AddCommGroup M]
{R : Type u_1}
{L : Type u_2}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
(I : LieIdeal R L)
[LieRingModule L M]
(x : ↥I)
(m : M)


theorem Ne.lt_of_le' : b ≠ a → a ≤ b → a < b

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


@[simp]
theorem map_fst_prod (I : Ideal R) (J : Ideal S) : map (RingHom.fst R S) (prod I J) = I

{R : Type u}
{S : Type v}
[Semiring R]
[Semiring S]
(I : Ideal R)
(J : Ideal S)

Ideal.map (RingHom.fst R S) (I.prod J) = I


@[simp] theorem getLsb_ofFin (x : Fin (2^n)) (i : Nat) :
  getLsb (BitVec.ofFin x) i = x.val.testBit i

{ toFin := x }.getLsb i = (↑x).testBit i


@[gcongr]
protected lemma div_le_div_right (h : a ≤ b) : a / c ≤ b / c


@[simp]
theorem op_unop (S : Subring Rᵐᵒᵖ) : S.unop.op = S

{R : Type u_2}
[Ring R]
(S : Subring Rᵐᵒᵖ)


theorem IsBigO.smul_isLittleO (h₁ : k₁ =O[l] k₂) (h₂ : f' =o[l] g') :
    (fun x => k₁ x • f' x) =o[l] fun x => k₂ x • g' x

{α : Type u_1}
{E' : Type u_6}
{F' : Type u_7}
{R : Type u_13}
{𝕜' : Type u_16}
[SeminormedAddCommGroup E']
[SeminormedAddCommGroup F']
[SeminormedRing R]
[NormedDivisionRing 𝕜']
{f' : α → E'}
{g' : α → F'}
{l : Filter α}
[Module R E']
[BoundedSMul R E']
[Module 𝕜' F']
[BoundedSMul 𝕜' F']
{k₁ : α → R}
{k₂ : α → 𝕜'}
(h₁ : k₁ =O[l] k₂)
(h₂ : f' =o[l] g')


theorem gcd_dvd_left {a b : Int} : (gcd a b : Int) ∣ a


/-- On pseudometric spaces, a map is an isometry if and only if it preserves nonnegative
distances. -/
theorem isometry_iff_nndist_eq [PseudoMetricSpace α] [PseudoMetricSpace β] {f : α → β} :
    Isometry f ↔ ∀ x y, nndist (f x) (f y) = nndist x y

{α : Type u}
{β : Type v}
[PseudoMetricSpace α]
[PseudoMetricSpace β]
{f : α → β}

Isometry f ↔ ∀ (x y : α), nndist (f x) (f y) = nndist x y


/-- Given `S' : Solution'`, we may assume that `λ ^ 2` divides `S'.a + S'.b ∨ λ ^ 2` (see also the
result below). -/
lemma ex_cube_add_cube_eq_and_isCoprime_and_not_dvd_and_dvd :
    ∃ (a' b' : 𝓞 K), a' ^ 3 + b' ^ 3 = S'.u * S'.c ^ 3 ∧ IsCoprime a' b' ∧ ¬ λ ∣ a' ∧
      ¬ λ ∣ b' ∧ λ ^ 2 ∣ a' + b'

(S' : FermatLastTheoremForThreeGen.Solution' hζ)

∃ a' b',
  a' ^ 3 + b' ^ 3 = ↑S'.u * S'.c ^ 3 ∧
    IsCoprime a' b' ∧ ¬hζ.toInteger - 1 ∣ a' ∧ ¬hζ.toInteger - 1 ∣ b' ∧ (hζ.toInteger - 1) ^ 2 ∣ a' + b'


@[simp]
theorem mem_splitCenter : J ∈ splitCenter I ↔ ∃ s, I.splitCenterBox s = J

{ι : Type u_1}
[Fintype ι]
{I J : BoxIntegral.Box ι}

J ∈ BoxIntegral.Prepartition.splitCenter I ↔ ∃ s, I.splitCenterBox s = J


theorem aecover_Ioc_of_Ioo (ha : Tendsto a l (𝓝 A)) (hb : Tendsto b l (𝓝 B)) :
    AECover (μ.restrict <| Ioc A B) l fun i => Ioo (a i) (b i)

{α : Type u_1}
{ι : Type u_2}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
{l : Filter ι}
[LinearOrder α]
[TopologicalSpace α]
[OrderClosedTopology α]
[OpensMeasurableSpace α]
{a b : ι → α}
{A B : α}
[MeasureTheory.NoAtoms μ]
(ha : Filter.Tendsto a l (𝓝 A))
(hb : Filter.Tendsto b l (𝓝 B))

MeasureTheory.AECover (μ.restrict (Set.Ioc A B)) l fun i => Set.Ioo (a i) (b i)


@[simp]
theorem unop_op (S : Subring R) : S.op.unop = S


theorem of_constant (f : X → Y) (h : ∀ x y, f x = f y) : IsLocallyConstant f

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
(f : X → Y)
(h : ∀ (x y : X), f x = f y)


@[simp]
theorem right_inv_of_invOfMemRange (a : α) : hf.invOfMemRange ⟨f a, Set.mem_range_self a⟩ = a

{α : Type u_1}
{β : Type u_2}
[Fintype α]
[DecidableEq β]
{f : α → β}
(hf : Function.Injective f)
(a : α)


theorem limit_ext [HasLimit F] (x y : ↑(limit F)) :
    (∀ j, limit.π F j x = limit.π F j y) → x = y

[CategoryTheory.Limits.PreservesLimit F (CategoryTheory.forget C)]

(x y : (CategoryTheory.forget C).obj (CategoryTheory.Limits.limit F))

(∀ (j : J), (CategoryTheory.Limits.limit.π F j) x = (CategoryTheory.Limits.limit.π F j) y) → x = y


@[to_additive (attr := simp, to_additive) (reorder := 1 2, 4 5) toDual_smul]
theorem toDual_pow [Pow α β] (a : α) (b : β) : toDual (a ^ b) = toDual a ^ b

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

OrderDual.toDual (a ^ b) = OrderDual.toDual a ^ b


theorem ExistsUnique.intro₂ {α : Sort*} {p : α → Sort*} [∀ x, Subsingleton (p x)]
    {q : ∀ (x : α) (_ : p x), Prop} (w : α) (hp : p w) (hq : q w hp)
    (H : ∀ (y) (hy : p y), q y hy → y = w) : ∃! x, ∃! hx : p x, q x hx

(H : ∀ (y : α) (hy : p y), q y hy → y = w)


@[simp]
theorem toList_empty : "".toList = []


@[simps]
instance tensorRight' (f : a ⟶ b) (g : b ⟶ b)
    [BicategoricalCoherence g (𝟙 b)] : BicategoricalCoherence (f ≫ g) f

[CategoryTheory.BicategoricalCoherence g (𝟙 b)]


/-- By definition, a proper map is continuous. -/
@[fun_prop]
lemma IsProperMap.continuous (h : IsProperMap f) : Continuous f

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
{f : X → Y}
(h : IsProperMap f)


theorem inj_on_of_nodup_map {f : α → β} {l : List α} (d : Nodup (map f l)) :
    ∀ ⦃x⦄, x ∈ l → ∀ ⦃y⦄, y ∈ l → f x = f y → x = y

{α : Type u}
{β : Type v}
{f : α → β}
{l : List α}
(d : (List.map f l).Nodup)
⦃x : α⦄

x ∈ l → ∀ ⦃y : α⦄, y ∈ l → f x = f y → x = y


/-- An Akra-Bazzi recurrence is a function that satisfies the recurrence
`T n = (∑ i, a i * T (r i n)) + g n`. -/
structure AkraBazziRecurrence {α : Type*} [Fintype α] [Nonempty α]
    (T : ℕ → ℝ) (g : ℝ → ℝ) (a : α → ℝ) (b : α → ℝ) (r : α → ℕ → ℕ) where
  /-- Point below which the recurrence is in the base case -/
  n₀ : ℕ
  /-- `n₀` is always `> 0` -/
  n₀_gt_zero : 0 < n₀
  /-- The `a`'s are nonzero -/
  a_pos : ∀ i, 0 < a i
  /-- The `b`'s are nonzero -/
  b_pos : ∀ i, 0 < b i
  /-- The b's are less than 1 -/
  b_lt_one : ∀ i, b i < 1
  /-- `g` is nonnegative -/
  g_nonneg : ∀ x ≥ 0, 0 ≤ g x
  /-- `g` grows polynomially -/
  g_grows_poly : AkraBazziRecurrence.GrowsPolynomially g
  /-- The actual recurrence -/
  h_rec (n : ℕ) (hn₀ : n₀ ≤ n) : T n = (∑ i, a i * T (r i n)) + g n
  /-- Base case: `T(n) > 0` whenever `n < n₀` -/
  T_gt_zero' (n : ℕ) (hn : n < n₀) : 0 < T n
  /-- The `r`'s always reduce `n` -/
  r_lt_n : ∀ i n, n₀ ≤ n → r i n < n
  /-- The `r`'s approximate the `b`'s -/
  dist_r_b : ∀ i, (fun n => (r i n : ℝ) - b i * n) =o[atTop] fun n => n / (log n) ^ 2

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


theorem exists_fixed_point_of_prime {p n : ℕ} [hp : Fact p.Prime] (hα : ¬p ∣ Fintype.card α)
    {σ : Perm α} (hσ : σ ^ p ^ n = 1) : ∃ a : α, σ a = a

{α : Type u_1}
[Fintype α]
{p n : ℕ}
[hp : Fact (Nat.Prime p)]
(hα : ¬p ∣ Fintype.card α)
{σ : Equiv.Perm α}
(hσ : σ ^ p ^ n = 1)


@[simp]
theorem toIocDiv_add_right' (a b : α) : toIocDiv hp (a + p) b = toIocDiv hp a b - 1

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


theorem smeval_neg_nat (S : Type*) [NonAssocRing S] [Pow S ℕ] [NatPowAssoc S] (q : ℕ[X])
    (n : ℕ) : q.smeval (-(n : S)) = q.smeval (-n : ℤ)

(S : Type u_3)
[NonAssocRing S]
[Pow S ℕ]
[NatPowAssoc S]
(q : Polynomial ℕ)
(n : ℕ)


/-- Decomposes the coefficient of the product `p * q` as a sum
over `antidiagonal`. A version which sums over `range (n + 1)` can be obtained
by using `Finset.Nat.sum_antidiagonal_eq_sum_range_succ`. -/
theorem coeff_mul (p q : R[X]) (n : ℕ) :
    coeff (p * q) n = ∑ x ∈ antidiagonal n, coeff p x.1 * coeff q x.2

{R : Type u}
[Semiring R]
(p q : R[X])
(n : ℕ)

(p * q).coeff n = ∑ x ∈ Finset.antidiagonal n, p.coeff x.1 * q.coeff x.2


theorem mem_iUnion₂_of_mem {s : ∀ i, κ i → Set α} {a : α} {i : ι} (j : κ i) (ha : a ∈ s i j) :
    a ∈ ⋃ (i) (j), s i j

{α : Type u_1}
{ι : Sort u_4}
{κ : ι → Sort u_7}
{s : (i : ι) → κ i → Set α}
{a : α}
{i : ι}
(j : κ i)
(ha : a ∈ s i j)


@[simp]
theorem symm_symm (f : α ≃. β) : f.symm.symm = f


/-- Two block matrices are equal if their blocks are equal. -/
theorem ext_iff_blocks {A B : Matrix (n ⊕ o) (l ⊕ m) α} :
    A = B ↔
      A.toBlocks₁₁ = B.toBlocks₁₁ ∧
        A.toBlocks₁₂ = B.toBlocks₁₂ ∧ A.toBlocks₂₁ = B.toBlocks₂₁ ∧ A.toBlocks₂₂ = B.toBlocks₂₂

{l : Type u_1}
{m : Type u_2}
{n : Type u_3}
{o : Type u_4}
{α : Type u_12}
{A B : Matrix (n ⊕ o) (l ⊕ m) α}


@[simp]
theorem colimit.isColimit_desc {F : J ⥤ C} [HasColimit F] (c : Cocone F) :
    (colimit.isColimit F).desc c = colimit.desc F c

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u}
[CategoryTheory.Category.{v, u} C]
{F : J ⥤ C}
[CategoryTheory.Limits.HasColimit F]
(c : CategoryTheory.Limits.Cocone F)

(CategoryTheory.Limits.colimit.isColimit F).desc c = CategoryTheory.Limits.colimit.desc F c


theorem mul_associator {M N P : Mon_ C} :
    (tensor_μ C (M.X ⊗ N.X, P.X) (M.X ⊗ N.X, P.X) ≫
          (tensor_μ C (M.X, N.X) (M.X, N.X) ≫ (M.mul ⊗ N.mul) ⊗ P.mul)) ≫
        (α_ M.X N.X P.X).hom =
      ((α_ M.X N.X P.X).hom ⊗ (α_ M.X N.X P.X).hom) ≫
        tensor_μ C (M.X, N.X ⊗ P.X) (M.X, N.X ⊗ P.X) ≫
          (M.mul ⊗ tensor_μ C (N.X, P.X) (N.X, P.X) ≫ (N.mul ⊗ P.mul))

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.MonoidalCategory C]
[CategoryTheory.BraidedCategory C]
{M N P : Mon_ C}

(CategoryTheory.tensor_μ C (M.X ⊗ N.X, P.X) (M.X ⊗ N.X, P.X) ≫
      (CategoryTheory.tensor_μ C (M.X, N.X) (M.X, N.X) ≫ (M.mul ⊗ N.mul) ⊗ P.mul)) ≫
    (α_ M.X N.X P.X).hom =
  ((α_ M.X N.X P.X).hom ⊗ (α_ M.X N.X P.X).hom) ≫
    CategoryTheory.tensor_μ C (M.X, N.X ⊗ P.X) (M.X, N.X ⊗ P.X) ≫
      (M.mul ⊗ CategoryTheory.tensor_μ C (N.X, P.X) (N.X, P.X) ≫ (N.mul ⊗ P.mul))


@[simp]
theorem Matrix.toLinearMapₛₗ₂'_symm :
    ((Matrix.toLinearMapₛₗ₂' R σ₁ σ₂).symm : _ ≃ₗ[R] Matrix n m N₂) = LinearMap.toMatrixₛₗ₂' R

{R : Type u_1}
{R₁ : Type u_2}
{S₁ : Type u_3}
{R₂ : Type u_4}
{S₂ : Type u_5}
{N₂ : Type u_11}
{n : Type u_12}
{m : Type u_13}
[CommSemiring R]
[AddCommMonoid N₂]
[Module R N₂]
[Semiring R₁]
[Semiring R₂]
[Semiring S₁]
[Semiring S₂]
[Module S₁ N₂]
[Module S₂ N₂]
[SMulCommClass S₁ R N₂]
[SMulCommClass S₂ R N₂]
[SMulCommClass S₂ S₁ N₂]
(σ₁ : R₁ →+* S₁)
(σ₂ : R₂ →+* S₂)
[Fintype n]
[Fintype m]
[DecidableEq n]
[DecidableEq m]

(Matrix.toLinearMapₛₗ₂' R σ₁ σ₂).symm = LinearMap.toMatrixₛₗ₂' R


theorem Coloring.colorable [Fintype α] (C : G.Coloring α) : G.Colorable (Fintype.card α)

{V : Type u}
{G : SimpleGraph V}
{α : Type u_1}
[Fintype α]
(C : G.Coloring α)


theorem HasFPowerSeriesAt.eventually_hasSum_sub (hf : HasFPowerSeriesAt f p x) :
    ∀ᶠ y in 𝓝 x, HasSum (fun n : ℕ => p n fun _ : Fin n => y - x) (f y)

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{p : FormalMultilinearSeries 𝕜 E F}
{x : E}
(hf : HasFPowerSeriesAt f p x)

∀ᶠ (y : E) in 𝓝 x, HasSum (fun n => (p n) fun x_1 => y - x) (f y)


@[elab_as_elim]
protected theorem Antisymmetrization.ind {p : Antisymmetrization α r → Prop} :
    (∀ a, p <| toAntisymmetrization r a) → ∀ q, p q

{α : Type u_1}
(r : α → α → Prop)
[IsPreorder α r]
{p : Antisymmetrization α r → Prop}

(∀ (a : α), p (toAntisymmetrization r a)) → ∀ (q : Antisymmetrization α r), p q


theorem foldr_succ (f : Fin (n+1) → α → α) (x) :
    foldr (n+1) f x = f 0 (foldr n (fun i => f i.succ) x)

{n : Nat}
{α : Sort u_1}
(f : Fin (n + 1) → α → α)
(x : α)

Fin.foldr (n + 1) f x = f 0 (Fin.foldr n (fun i => f i.succ) x)


@[simp]
theorem imageSubobject_zero_arrow : (imageSubobject (0 : X ⟶ Y)).arrow = 0

(CategoryTheory.Limits.imageSubobject 0).arrow = 0


theorem mul_apply (x) : (f * g) x = f (g x)


lemma isHamiltonianCycle_isCycle_and_isHamiltonian_tail  :
    p.IsHamiltonianCycle ↔ ∃ h : p.IsCycle, (p.tail h.not_nil).IsHamiltonian

{α : Type u_1}
[DecidableEq α]
{G : SimpleGraph α}
{a : α}
{p : G.Walk a a}

p.IsHamiltonianCycle ↔ ∃ (h : p.IsCycle), (p.tail ⋯).IsHamiltonian


/-- Pointwise inversion of submonoids as an order isomorphism. -/
@[to_additive (attr := simps!) "Pointwise negation of additive submonoids as an order isomorphism"]
def invOrderIso : Submonoid G ≃o Submonoid G

∀ (a : Submonoid G), ↑(Submonoid.invOrderIso a) = (↑a)⁻¹


@[to_additive]
theorem prod_fintype [Fintype α] (f : α →₀ M) (g : α → M → N) (h : ∀ i, g i 0 = 1) :
    f.prod g = ∏ i, g i (f i)

{α : Type u_1}
{M : Type u_8}
{N : Type u_10}
[Zero M]
[AddCommMonoid N]
[Fintype α]
(f : α →₀ M)
(g : α → M → N)
(h : ∀ (i : α), g i 0 = 0)


theorem disjoin_le {α β γ} [Primcodable α] [Primcodable β] [Primcodable γ] {p : α → Prop}
    {q : β → Prop} {r : γ → Prop} : (p ⊕' q) ≤₀ r ↔ p ≤₀ r ∧ q ≤₀ r

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

p ⊕' q ≤₀ r ↔ p ≤₀ r ∧ q ≤₀ r


/-- If the `affineSpan` of a finite affinely independent family lies
in an affine subspace whose direction has dimension one less than its
cardinality, it equals that subspace. -/
theorem AffineIndependent.affineSpan_eq_of_le_of_card_eq_finrank_add_one [Fintype ι] {p : ι → P}
    (hi : AffineIndependent k p) {sp : AffineSubspace k P} [FiniteDimensional k sp.direction]
    (hle : affineSpan k (Set.range p) ≤ sp) (hc : Fintype.card ι = finrank k sp.direction + 1) :
    affineSpan k (Set.range p) = sp

(hc : Fintype.card ι = FiniteDimensional.finrank k ↥sp.direction + 1)


@[simp]
lemma unmop_inv_braiding (X Y : Cᴹᵒᵖ) : (β_ X Y).inv.unmop = (β_ (unmop Y) (unmop X)).inv

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

(β_ X Y).inv.unmop = (β_ Y.unmop X.unmop).inv


@[simp]
theorem withTopCongr_symm (e : α ≃o β) : e.withTopCongr.symm = e.symm.withTopCongr

{α : Type u_2}
{β : Type u_3}
[PartialOrder α]
[PartialOrder β]
(e : α ≃o β)


/-- Typeclass for multiplicative actions on additive structures. This generalizes group modules. -/
@[ext]
class DistribMulAction (M A : Type*) [Monoid M] [AddMonoid A] extends MulAction M A where
  /-- Multiplying `0` by a scalar gives `0` -/
  smul_zero : ∀ a : M, a • (0 : A) = 0
  /-- Scalar multiplication distributes across addition -/
  smul_add : ∀ (a : M) (x y : A), a • (x + y) = a • x + a • y

{M : Type u_10}
{A : Type u_11}
[Monoid M]
[AddMonoid A]
[self : DistribMulAction M A]
(a : M)


/-- The anti-equivalence between cosimplicial objects and simplicial objects. -/
@[simps!]
def cosimplicialSimplicialEquiv : (CosimplicialObject C)ᵒᵖ ≌ SimplicialObject Cᵒᵖ

(C : Type u)
[CategoryTheory.Category.{v, u} C]
(X : (SimplexCategory ⥤ C)ᵒᵖ)

(CategoryTheory.cosimplicialSimplicialEquiv C).unitIso.inv.app X = (Opposite.unop X).opUnopIso.inv.op


theorem add_lintegral (f g : α →ₛ ℝ≥0∞) : (f + g).lintegral μ = f.lintegral μ + g.lintegral μ

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


theorem paste_vert_iff {X₁₁ X₁₂ X₂₁ X₂₂ X₃₁ X₃₂ : C} {h₁₁ : X₁₁ ⟶ X₁₂} {h₂₁ : X₂₁ ⟶ X₂₂}
    {h₃₁ : X₃₁ ⟶ X₃₂} {v₁₁ : X₁₁ ⟶ X₂₁} {v₁₂ : X₁₂ ⟶ X₂₂} {v₂₁ : X₂₁ ⟶ X₃₁} {v₂₂ : X₂₂ ⟶ X₃₂}
    (s : IsPushout h₁₁ v₁₁ v₁₂ h₂₁) (e : h₂₁ ≫ v₂₂ = v₂₁ ≫ h₃₁) :
    IsPushout h₁₁ (v₁₁ ≫ v₂₁) (v₁₂ ≫ v₂₂) h₃₁ ↔ IsPushout h₂₁ v₂₁ v₂₂ h₃₁

{X₁₁ X₁₂ X₂₁ X₂₂ X₃₁ X₃₂ : C}

{h₁₁ : X₁₁ ⟶ X₁₂}

{h₂₁ : X₂₁ ⟶ X₂₂}

{h₃₁ : X₃₁ ⟶ X₃₂}

{v₁₁ : X₁₁ ⟶ X₂₁}

{v₁₂ : X₁₂ ⟶ X₂₂}

{v₂₁ : X₂₁ ⟶ X₃₁}

{v₂₂ : X₂₂ ⟶ X₃₂}

(s : CategoryTheory.IsPushout h₁₁ v₁₁ v₁₂ h₂₁)

(e : h₂₁ ≫ v₂₂ = v₂₁ ≫ h₃₁)

CategoryTheory.IsPushout h₁₁ (v₁₁ ≫ v₂₁) (v₁₂ ≫ v₂₂) h₃₁ ↔ CategoryTheory.IsPushout h₂₁ v₂₁ v₂₂ h₃₁


@[simp]
theorem mk_id : Quot.mk _ (Hom₂.id f) = 𝟙 f

{B : Type u}
[Quiver B]
{a b : CategoryTheory.FreeBicategory B}
(f : a ⟶ b)

Quot.mk CategoryTheory.FreeBicategory.Rel (CategoryTheory.FreeBicategory.Hom₂.id f) = CategoryTheory.CategoryStruct.id f


/-- Isometry between the tangent space `V` of a (semi)normed add torsor `P` and `P` given by
subtraction from `x : P`. -/
@[simps!]
def IsometryEquiv.constVSub (x : P) : P ≃ᵢ V

{V : Type u_2}
{P : Type u_3}
[SeminormedAddCommGroup V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]
(x : P)

∀ (x_1 : V), (IsometryEquiv.constVSub x).invFun x_1 = -x_1 +ᵥ x


@[simp]
theorem sigmaCurry_smul [Monoid γ] [∀ i j, AddMonoid (δ i j)] [∀ i j, DistribMulAction γ (δ i j)]
    (r : γ) (f : Π₀ (i : Σ _, _), δ i.1 i.2) :
    sigmaCurry (r • f) = r • sigmaCurry f

[(i : ι) → (j : α i) → AddMonoid (δ i j)]

[(i : ι) → (j : α i) → DistribMulAction γ (δ i j)]

(f : Π₀ (i : (x : ι) × α x), δ i.fst i.snd)


/-- The pretopology associated to a space is the largest pretopology that
    generates the Grothendieck topology associated to the space. -/
@[simp]
theorem pretopology_ofGrothendieck :
    Pretopology.ofGrothendieck _ (Opens.grothendieckTopology T) = Opens.pretopology T

CategoryTheory.Pretopology.ofGrothendieck (TopologicalSpace.Opens T) (Opens.grothendieckTopology T) =
  Opens.pretopology T


theorem toContinuousMap_injective :
    Function.Injective (toContinuousMap : LocallyConstant X Y → C(X, Y))

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


/-- For `f : Lp E p μ`, we can define an element of `Lp E p (μ.restrict s)` by
`(Lp.memℒp f).restrict s).toLp f`. This map is non-expansive. -/
theorem norm_Lp_toLp_restrict_le (s : Set X) (f : Lp E p μ) :
    ‖((Lp.memℒp f).restrict s).toLp f‖ ≤ ‖f‖

{X : Type u_1}
{E : Type u_3}
[MeasurableSpace X]
[NormedAddCommGroup E]
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure X}
(s : Set X)
(f : ↥(MeasureTheory.Lp E p μ))


@[simp]
lemma trace_toEnd_weightSpace [IsDomain R] [IsPrincipalIdealRing R]
    [Module.Free R M] [Module.Finite R M] (χ : L → R) (x : L) :
    trace R _ (toEnd R L (weightSpace M χ) x) = finrank R (weightSpace M χ) • χ x

(R : Type u_2)
(L : Type u_3)
(M : Type u_4)
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[LieAlgebra.IsNilpotent R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
[IsDomain R]
[IsPrincipalIdealRing R]
[Module.Free R M]
[Module.Finite R M]
(χ : L → R)
(x : L)

(LinearMap.trace R ↥↑(LieModule.weightSpace M χ)) ((LieModule.toEnd R L ↥↑(LieModule.weightSpace M χ)) x) =
  FiniteDimensional.finrank R ↥↑(LieModule.weightSpace M χ) • χ x


/-- For a pair of functors `L : C ⥤ D`, `R : D ⥤ C`, an adjunction `h : L ⊣ R` induces a monad on
the category `C`.
-/
-- Porting note: Specifying simps projections manually to match mathlib3 behavior.
@[simps! coe η μ]
def toMonad (h : L ⊣ R) : Monad C

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


theorem IsBoundedUnder.isCoboundedUnder_ge {u : γ → α} {l : Filter γ} [Preorder α] [NeBot l]
    (h : l.IsBoundedUnder (· ≤ ·) u) : l.IsCoboundedUnder (· ≥ ·) u

(h : Filter.IsBoundedUnder (fun x x_1 => x ≤ x_1) l u)

Filter.IsCoboundedUnder (fun x x_1 => x ≥ x_1) l u


@[to_additive] lemma eq_one_iff (h : SemiconjBy a x y): x = 1 ↔ y = 1

{G : Type u_1}
[Group G]
(a : G)
{x y : G}
(h : SemiconjBy a x y)


theorem tsub_lt_of_lt (h : a < b) : a - c < b

{α : Type u_1}
[CanonicallyOrderedAddCommMonoid α]
[Sub α]
[OrderedSub α]
{a b c : α}
(h : a < b)


theorem finish_isReduced : u.finish.IsReduced


theorem algHom_ext {A} [Semiring A] [Algebra R' A] ⦃f g : tsze R' M →ₐ[R'] A⦄
    (h : ∀ m, f (inr m) = g (inr m)) : f = g

(h : ∀ (m : M), f (TrivSqZeroExt.inr m) = g (TrivSqZeroExt.inr m))


theorem encard_eq_encard_iff_encard_diff_eq_encard_diff (h : (s ∩ t).Finite) :
    s.encard = t.encard ↔ (s \ t).encard = (t \ s).encard

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


/-- Together with transitivity, this shows UnivLE "IsTotalPreorder". -/
theorem univLE_total : UnivLE.{u, v} ∨ UnivLE.{v, u}


lemma subperm_iff : l₁ <+~ l₂ ↔ ∃ l, l ~ l₂ ∧ l₁ <+ l

l₁.Subperm l₂ ↔ ∃ l, l.Perm l₂ ∧ l₁.Sublist l


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

{m : Type u_2}
{R : Type u_7}
{α : Type v}
{β : Type w}
[Fintype m]
[DecidableEq m]
[CommSemiring R]
[Semiring α]
[Semiring β]
[Algebra R α]
[Algebra R β]
(f : α ≃ₐ[R] β)
(M : Matrix m m α)


@[reassoc (attr := simp 1100)]
theorem wideEqualizer.lift_ι [Nonempty J] {W : C} (k : W ⟶ X)
    (h : ∀ j₁ j₂, k ≫ f j₁ = k ≫ f j₂) :
    wideEqualizer.lift k h ≫ wideEqualizer.ι f = k

(h : ∀ (j₁ j₂ : J), CategoryTheory.CategoryStruct.comp k (f j₁) = CategoryTheory.CategoryStruct.comp k (f j₂))

CategoryTheory.CategoryStruct.comp (CategoryTheory.Limits.wideEqualizer.lift k h)
    (CategoryTheory.Limits.wideEqualizer.ι f) =
  k


theorem tan_add_nat_mul_pi (x : ℂ) (n : ℕ) : tan (x + n * π) = tan x

Complex.tan (x + ↑n * ↑Real.pi) = Complex.tan x


@[to_additive (attr := measurability)]
theorem AEMeasurable.const_smul (hf : AEMeasurable g μ) (c : M) : AEMeasurable (c • g) μ

{M : Type u_2}
{β : Type u_3}
{α : Type u_4}
[MeasurableSpace M]
[MeasurableSpace β]
[VAdd M β]
{m : MeasurableSpace α}
{g : α → β}
[MeasurableVAdd M β]
{μ : MeasureTheory.Measure α}
(hf : AEMeasurable g μ)
(c : M)


/-- Dirac delta measures at two points are different if and only if there is a measurable set
containing one of the points but not the other. -/
lemma dirac_ne_dirac_iff_exists_measurableSet {x y : α} :
    Measure.dirac x ≠ Measure.dirac y ↔ ∃ A, MeasurableSet A ∧ x ∈ A ∧ y ∉ A

{α : Type u_1}
[MeasurableSpace α]
{x y : α}

MeasureTheory.Measure.dirac x ≠ MeasureTheory.Measure.dirac y ↔ ∃ A, MeasurableSet A ∧ x ∈ A ∧ y ∉ A


theorem trans {R : Type*} (A M : Type*) [Semiring R] [Semiring A] [Module R A]
    [AddCommMonoid M] [Module R M] [Module A M] [IsScalarTower R A M] :
    ∀ [Finite R A] [Finite A M], Finite R M

{R : Type u_6}
(A : Type u_7)
(M : Type u_8)
[Semiring R]
[Semiring A]
[Module R A]
[AddCommMonoid M]
[Module R M]
[Module A M]
[IsScalarTower R A M]
[Module.Finite R A]
[Module.Finite A M]


@[simp]
theorem RestrictScalars.ringEquiv_algebraMap (r : R) :
    RestrictScalars.ringEquiv R S A (algebraMap R (RestrictScalars R S A) r) =
      algebraMap S A (algebraMap R S r)

(R : Type u_1)
(S : Type u_2)
(A : Type u_4)
[Semiring A]
[CommSemiring S]
[Algebra S A]
[CommSemiring R]
[Algebra R S]
(r : R)

(RestrictScalars.ringEquiv R S A) ((algebraMap R (RestrictScalars R S A)) r) = (algebraMap S A) ((algebraMap R S) r)


@[simp]
theorem diff_singleton_sSubset {s : Set α} {a : α} : s \ {a} ⊂ s ↔ a ∈ s


/-- In a preconnected space, given a transitive relation `P`, if `P x y` and `P y x` are true
for `y` close enough to `x`, then `P x y` holds for all `x, y`. This is a version of the fact
that, if an equivalence relation has open classes, then it has a single equivalence class. -/
lemma PreconnectedSpace.induction₂' [PreconnectedSpace α] (P : α → α → Prop)
    (h : ∀ x, ∀ᶠ y in 𝓝 x, P x y ∧ P y x) (h' : Transitive P) (x y : α) :
    P x y

(h : ∀ (x : α), ∀ᶠ (y : α) in 𝓝 x, P x y ∧ P y x)


theorem interval_average_eq (f : ℝ → E) (a b : ℝ) :
    (⨍ x in a..b, f x) = (b - a)⁻¹ • ∫ x in a..b, f x

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
(f : ℝ → E)
(a b : ℝ)

⨍ (x : ℝ) in a..b, f x = (b - a)⁻¹ • ∫ (x : ℝ) in a..b, f x


theorem ae_restrict_mem (hs : MeasurableSet s) : ∀ᵐ x ∂μ.restrict s, x ∈ s

{α : Type u_2}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s : Set α}
(hs : MeasurableSet s)


/-- The short complex `Fun(G, A) --dOne--> Fun(G × G, A) --dTwo--> Fun(G × G × G, A)` is
isomorphic to the 2nd short complex associated to the complex of inhomogeneous cochains of `A`. -/
@[simps! hom inv]
def shortComplexH2Iso :
    (inhomogeneousCochains A).sc' 1 2 3 ≅ shortComplexH2 A

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

(groupCohomology.shortComplexH2Iso A).inv =
  CategoryTheory.ShortComplex.homMk ↑(groupCohomology.oneCochainsLequiv A).symm
    ↑(groupCohomology.twoCochainsLequiv A).symm ↑(groupCohomology.threeCochainsLequiv A).symm ⋯ ⋯


theorem aemeasurable_deriv_with_param [LocallyCompactSpace 𝕜] [MeasurableSpace 𝕜]
    [OpensMeasurableSpace 𝕜] [MeasurableSpace F]
    [BorelSpace F] {f : α → 𝕜 → F} (hf : Continuous f.uncurry) (μ : Measure (α × 𝕜)) :
    AEMeasurable (fun (p : α × 𝕜) ↦ deriv (f p.1) p.2) μ

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{α : Type u_4}
[TopologicalSpace α]
[MeasurableSpace α]
[OpensMeasurableSpace α]
[CompleteSpace F]
[LocallyCompactSpace 𝕜]
[MeasurableSpace 𝕜]
[OpensMeasurableSpace 𝕜]
[MeasurableSpace F]
[BorelSpace F]
{f : α → 𝕜 → F}
(hf : Continuous (Function.uncurry f))
(μ : MeasureTheory.Measure (α × 𝕜))

AEMeasurable (fun p => deriv (f p.1) p.2) μ


theorem Semiconj₂.iterate {f : α → α} {op : α → α → α} (hf : Semiconj₂ f op op) (n : ℕ) :
    Semiconj₂ f^[n] op op

{α : Type u}
{f : α → α}
{op : α → α → α}
(hf : Function.Semiconj₂ f op op)
(n : ℕ)


theorem fst_apply' (κ : Kernel α (β × γ)) (a : α) {s : Set β} (hs : MeasurableSet s) :
    fst κ a s = κ a {p | p.1 ∈ s}

(κ : ProbabilityTheory.Kernel α (β × γ))


/-- Adding a vector to a point in a subspace produces a point in the subspace if and only if the
vector is in the direction. -/
theorem vadd_mem_iff_mem_direction {s : AffineSubspace k P} (v : V) {p : P} (hp : p ∈ s) :
    v +ᵥ p ∈ s ↔ v ∈ s.direction

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{s : AffineSubspace k P}
(v : V)
{p : P}
(hp : p ∈ s)


protected theorem tendsto_atBot : Tendsto f atBot atBot

Filter.Tendsto (⇑f) Filter.atBot Filter.atBot


theorem bind₁_comp_rename {υ : Type*} (f : τ → MvPolynomial υ R) (g : σ → τ) :
    (bind₁ f).comp (rename g) = bind₁ (f ∘ g)

{σ : Type u_1}
{τ : Type u_2}
{R : Type u_3}
[CommSemiring R]
{υ : Type u_6}
(f : τ → MvPolynomial υ R)
(g : σ → τ)

(MvPolynomial.bind₁ f).comp (MvPolynomial.rename g) = MvPolynomial.bind₁ (f ∘ g)


@[to_additive]
lemma prod_eq_one (h : ∀ x ∈ s, x = (1 : α)) : s.prod = 1

{α : Type u_3}
[CommMonoid α]
{s : Multiset α}
(h : ∀ x ∈ s, x = 1)


@[simp]
theorem disjoint_preimage_iff (hf : Surjective f) {s t : Set β} :
    Disjoint (f ⁻¹' s) (f ⁻¹' t) ↔ Disjoint s t

{α : Type u_1}
{β : Type u_2}
{f : α → β}
(hf : Function.Surjective f)
{s t : Set β}


@[simp]
theorem bilinFormOfRealInner_orthogonal {E} [NormedAddCommGroup E] [InnerProductSpace ℝ E]
    (K : Submodule ℝ E) : K.orthogonalBilin bilinFormOfRealInner = Kᗮ

{E : Type u_4}
[NormedAddCommGroup E]
[InnerProductSpace ℝ E]
(K : Submodule ℝ E)


@[simp]
theorem op_bot : (⊥ : Subring R).op = ⊥


theorem nadd_nmul (a b c) : (a ♯ b) ⨳ c = a ⨳ c ♯ b ⨳ c


/-- **Fundamental theorem of arithmetic**-/
theorem primeFactorsList_unique {n : ℕ} {l : List ℕ} (h₁ : prod l = n) (h₂ : ∀ p ∈ l, Prime p) :
    l ~ primeFactorsList n

{n : ℕ}
{l : List ℕ}
(h₁ : l.prod = n)
(h₂ : ∀ p ∈ l, Nat.Prime p)


@[to_additive FS_iter_tail_sub_FS]
theorem FP_drop_subset_FP {M} [Semigroup M] (a : Stream' M) (n : ℕ) : FP (a.drop n) ⊆ FP a

{M : Type u_1}
[AddSemigroup M]
(a : Stream' M)
(n : ℕ)

Hindman.FS (Stream'.drop n a) ⊆ Hindman.FS a


theorem support_symmDiff_support_subset_support_add [DecidableEq σ] (p q : MvPolynomial σ R) :
    p.support ∆ q.support ⊆ (p + q).support

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

symmDiff p.support q.support ⊆ (p + q).support


@[simp]
theorem card_prod (α β : Type*) : Nat.card (α × β) = Nat.card α * Nat.card β


theorem MeasurePreserving.integrable_comp {ν : Measure δ} {g : δ → β} {f : α → δ}
    (hf : MeasurePreserving f μ ν) (hg : AEStronglyMeasurable g ν) :
    Integrable (g ∘ f) μ ↔ Integrable g ν

(hf : MeasureTheory.MeasurePreserving f μ ν)

(hg : MeasureTheory.AEStronglyMeasurable g ν)

MeasureTheory.Integrable (g ∘ f) μ ↔ MeasureTheory.Integrable g ν


/-- A satellite configuration is a configuration of `N+1` points that shows up in the inductive
construction for the Besicovitch covering theorem. It depends on some parameter `τ ≥ 1`.

This is a family of balls (indexed by `i : Fin N.succ`, with center `c i` and radius `r i`) such
that the last ball intersects all the other balls (condition `inter`),
and given any two balls there is an order between them, ensuring that the first ball does not
contain the center of the other one, and the radius of the second ball can not be larger than
the radius of the first ball (up to a factor `τ`). This order corresponds to the order of choice
in the inductive construction: otherwise, the second ball would have been chosen before.
This is the condition `h`.

Finally, the last ball is chosen after all the other ones, meaning that `h` can be strengthened
by keeping only one side of the alternative in `hlast`.
-/
structure Besicovitch.SatelliteConfig (α : Type*) [MetricSpace α] (N : ℕ) (τ : ℝ) where
  c : Fin N.succ → α
  r : Fin N.succ → ℝ
  rpos : ∀ i, 0 < r i
  h : Pairwise fun i j =>
    r i ≤ dist (c i) (c j) ∧ r j ≤ τ * r i ∨ r j ≤ dist (c j) (c i) ∧ r i ≤ τ * r j
  hlast : ∀ i < last N, r i ≤ dist (c i) (c (last N)) ∧ r (last N) ≤ τ * r i
  inter : ∀ i < last N, dist (c i) (c (last N)) ≤ r i + r (last N)

(self : Besicovitch.SatelliteConfig α N τ)

Pairwise fun i j =>
  self.r i ≤ dist (self.c i) (self.c j) ∧ self.r j ≤ τ * self.r i ∨
    self.r j ≤ dist (self.c j) (self.c i) ∧ self.r i ≤ τ * self.r j


/-- A functor `F : C ⥤ D` which commutes with shift functors on `C` and `D` and preserves zero
morphisms can be lifted to a functor `DifferentialObject S C ⥤ DifferentialObject S D`. -/
@[simps]
def mapDifferentialObject (F : C ⥤ D)
    (η : (shiftFunctor C (1 : S)).comp F ⟶ F.comp (shiftFunctor D (1 : S)))
    (hF : ∀ c c', F.map (0 : c ⟶ c') = 0) : DifferentialObject S C ⥤ DifferentialObject S D

(η : (CategoryTheory.shiftFunctor C 1).comp F ⟶ F.comp (CategoryTheory.shiftFunctor D 1))

(X : CategoryTheory.DifferentialObject S C)

((CategoryTheory.Functor.mapDifferentialObject D F η hF).obj X).d =
  CategoryTheory.CategoryStruct.comp (F.map X.d) (η.app X.obj)


theorem get_eq_get? (l : List α) (i : Fin l.length) :
    l.get i = (l.get? i).get (by simp [getElem?_eq_getElem])

{α : Type u}
(l : List α)
(i : Fin l.length)


@[to_additive]
theorem card_dvd_of_surjective (f : G →* G') (hf : Function.Surjective f) :
    Nat.card G' ∣ Nat.card G

{G : Type u_1}
{G' : Type u_2}
[AddGroup G]
[AddGroup G']
(f : G →+ G')
(hf : Function.Surjective ⇑f)


@[to_additive]
theorem mul_lt_of_le_of_lt_one [CovariantClass α α (· * ·) (· < ·)] {a b c : α} (hbc : b ≤ c)
    (ha : a < 1) :
    b * a < c

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


/-- If a function `f` tends to infinity along a filter,
then `f` multiplied by a negative constant (on the right) tends to negative infinity. -/
theorem Tendsto.atTop_mul_const_of_neg (hr : r < 0) (hf : Tendsto f l atTop) :
    Tendsto (fun x => f x * r) l atBot

{α : Type u_3}
{β : Type u_4}
[LinearOrderedField α]
{l : Filter β}
{f : β → α}
{r : α}
(hr : r < 0)
(hf : Filter.Tendsto f l Filter.atTop)

Filter.Tendsto (fun x => f x * r) l Filter.atBot


@[simp]
theorem id_f : (𝟙 _ : V ⟶ V).1 = 𝟙 V.1

(V : CategoryTheory.Endofunctor.Coalgebra F)

(CategoryTheory.CategoryStruct.id V).f = CategoryTheory.CategoryStruct.id V.V


lemma isCancelMulZero_iff_isDomain_or_subsingleton [Semiring α] :
    IsCancelMulZero α ↔ IsDomain α ∨ Subsingleton α


@[simp]
theorem Orientation.reindex_symm (e : ι ≃ ι') :
    (Orientation.reindex R M e).symm = Orientation.reindex R M e.symm

(R : Type u_1)
[StrictOrderedCommSemiring R]
(M : Type u_2)
[AddCommMonoid M]
[Module R M]
{ι : Type u_4}
{ι' : Type u_5}
(e : ι ≃ ι')


@[simp]
theorem graph.card (f : Fin n → α) : (graph f).card = n

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


theorem succ_nmul (a b) : succ a ⨳ b = a ⨳ b ♯ b


@[simp]
theorem coe_sInf (S : Set (ConvexCone 𝕜 E)) : ↑(sInf S) = ⋂ s ∈ S, (s : Set E)

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[SMul 𝕜 E]
(S : Set (ConvexCone 𝕜 E))


theorem eq_of_inner_left (hK : Dense (K : Set E)) (h : ∀ v : K, ⟪x, v⟫ = ⟪y, v⟫) : x = y

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{K : Submodule 𝕜 E}
{x y : E}
(hK : Dense ↑K)
(h : ∀ (v : ↥K), ⟪x, ↑v⟫_𝕜 = ⟪y, ↑v⟫_𝕜)


/-- The parameters of a strongly regular graph with at least one vertex satisfy
`k * (k - ℓ - 1) = (n - k - 1) * μ`. -/
theorem IsSRGWith.param_eq (h : G.IsSRGWith n k ℓ μ) (hn : 0 < n) :
    k * (k - ℓ - 1) = (n - k - 1) * μ

{V : Type u}
[Fintype V]
{G : SimpleGraph V}
[DecidableRel G.Adj]
{n k ℓ μ : ℕ}
(h : G.IsSRGWith n k ℓ μ)
(hn : 0 < n)


@[to_additive (attr := simp)]
lemma UniformFun.toFun_inv [Inv β] (f : α →ᵤ β) : toFun (f⁻¹) = (toFun f)⁻¹

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

UniformFun.toFun f⁻¹ = (UniformFun.toFun f)⁻¹


theorem evariance_eq {f : α → ℝ} {g : β → ℝ} (h : IdentDistrib f g μ ν) :
    evariance f μ = evariance g ν

(h : ProbabilityTheory.IdentDistrib f g μ ν)

ProbabilityTheory.evariance f μ = ProbabilityTheory.evariance g ν


protected theorem add_neg {a b : Int} (ha : a < 0) (hb : b < 0) : a + b < 0


theorem pow_lt_pow_iff_right_of_lt_one (h₀ : 0 < a) (h₁ : a < 1) : a ^ m < a ^ n ↔ n < m

{R : Type u_3}
[StrictOrderedSemiring R]
{a : R}
{n m : ℕ}
(h₀ : 0 < a)
(h₁ : a < 1)


@[simp]
theorem cast_trans {i j k} (h : i = j) (h' : j = k) :
    (cast R M h).trans (cast R M h') = cast R M (h.trans h')

(R : Type u_1)
(M : Type u_2)
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
{i j k : ℕ}
(h : i = j)
(h' : j = k)

TensorPower.cast R M h ≪≫ₗ TensorPower.cast R M h' = TensorPower.cast R M ⋯


@[reassoc (attr := simp, nolint simpNF)]
theorem d_eqToHom (X : HomologicalComplex V (ComplexShape.up' b)) {x y z : β} (h : y = z) :
    X.d x y ≫ eqToHom (congr_arg X.X h) = X.d x z

X.d x y ≫ CategoryTheory.eqToHom ⋯ = X.d x z


/-- An isomorphism of short complexes `S₁ ≅ S₂` induces an isomorphism on the `H` fields
of right homology data of `S₁` and `S₂`. -/
@[simps]
def rightHomologyMapIso' (e : S₁ ≅ S₂) (h₁ : S₁.RightHomologyData)
    (h₂ : S₂.RightHomologyData) : h₁.H ≅ h₂.H

(CategoryTheory.ShortComplex.rightHomologyMapIso' e h₁ h₂).inv =
  CategoryTheory.ShortComplex.rightHomologyMap' e.inv h₂ h₁


@[simp]
theorem nextOr_nil (x d : α) : nextOr [] x d = d

{α : Type u_1}
[DecidableEq α]
(x d : α)


theorem trPosNum_natEnd : ∀ (n), ∀ x ∈ trPosNum n, natEnd x = false

(n : PosNum)
(x : Turing.PartrecToTM2.Γ')

x ∈ Turing.PartrecToTM2.trPosNum n → Turing.PartrecToTM2.natEnd x = false


@[simp]
theorem _root_.MeasureTheory.Measure.toENNRealVectorMeasure_ennrealToMeasure
    (μ : VectorMeasure α ℝ≥0∞) :
    toENNRealVectorMeasure (ennrealToMeasure μ) = μ

(μ : MeasureTheory.VectorMeasure α ℝ≥0∞)


/-- The uniqueness part of the universal property for quotients of monoids. -/
@[to_additive "The uniqueness part of the universal property for quotients of `AddMonoid`s."]
theorem lift_unique (H : c ≤ ker f) (g : c.Quotient →* P) (Hg : g.comp c.mk' = f) :
    g = c.lift f H

{M : Type u_1}
{P : Type u_3}
[AddZeroClass M]
[AddZeroClass P]
{c : AddCon M}
{f : M →+ P}
(H : c ≤ AddCon.ker f)
(g : c.Quotient →+ P)
(Hg : g.comp c.mk' = f)


theorem lowerSemicontinuous_iSup {f : ι → α → δ} (h : ∀ i, LowerSemicontinuous (f i)) :
    LowerSemicontinuous fun x' => ⨆ i, f i x'

{f : ι → α → δ}

(h : ∀ (i : ι), LowerSemicontinuous (f i))


@[simp]
theorem cocompact_eq_atBot [NoMinOrder α] [OrderTop α]
    [ClosedIicTopology α] [CompactIccSpace α] : cocompact α = atBot

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


theorem mul_self_kstar_comm (l : Language α) : l∗ * l = l * l∗


theorem MonoidHom.map_dvd [Monoid M] [Monoid N] (f : M →* N) {a b} : a ∣ b → f a ∣ f b

{M : Type u_2}
{N : Type u_3}
[Monoid M]
[Monoid N]
(f : M →* N)
{a b : M}


@[gcongr]
theorem diff_subset_diff {s₁ s₂ t₁ t₂ : Set α} : s₁ ⊆ s₂ → t₂ ⊆ t₁ → s₁ \ t₁ ⊆ s₂ \ t₂

s₁ ⊆ s₂ → t₂ ⊆ t₁ → s₁ \ t₁ ⊆ s₂ \ t₂


@[simp]
theorem _root_.Algebra.adjoin.powerBasis'_dim (hx : IsIntegral R x) :
    (Algebra.adjoin.powerBasis' hx).dim = (minpoly R x).natDegree

{R : Type u_1}
{S : Type u_2}
[CommRing R]
[CommRing S]
[IsDomain R]
[Algebra R S]
[IsDomain S]
[NoZeroSMulDivisors R S]
[IsIntegrallyClosed R]
{x : S}
(hx : IsIntegral R x)


/-- Every equalizer of `(f, f)` is an isomorphism. -/
theorem isIso_limit_cone_parallelPair_of_self {c : Fork f f} (h : IsLimit c) : IsIso c.ι

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X Y : C}
{f : X ⟶ Y}
{c : CategoryTheory.Limits.Fork f f}
(h : CategoryTheory.Limits.IsLimit c)


@[to_additive]
theorem comap_normalizer_eq_of_injective_of_le_range {N : Type*} [Group N] (H : Subgroup G)
    {f : N →* G} (hf : Function.Injective f) (h : H.normalizer ≤ f.range) :
    comap f H.normalizer = (comap f H).normalizer

{G : Type u_1}
[Group G]
{N : Type u_6}
[Group N]
(H : Subgroup G)
{f : N →* G}
(hf : Function.Injective ⇑f)
(h : H.normalizer ≤ f.range)

Subgroup.comap f H.normalizer = (Subgroup.comap f H).normalizer


/-- Let `E` be a linear subspace in a real vector space.
If `E` has codimension at least two, its complement is path-connected. -/
theorem isPathConnected_compl_of_one_lt_codim {E : Submodule ℝ F}
    (hcodim : 1 < Module.rank ℝ (F ⧸ E)) : IsPathConnected (Eᶜ : Set F)

{F : Type u_1}
[AddCommGroup F]
[Module ℝ F]
[TopologicalSpace F]
[TopologicalAddGroup F]
[ContinuousSMul ℝ F]
{E : Submodule ℝ F}
(hcodim : 1 < Module.rank ℝ (F ⧸ E))


/-- Any `K`-Lipschitz map from a subset `s` of a metric space `α` to a finite-dimensional real
vector space `E'` can be extended to a Lipschitz map on the whole space `α`, with a slightly worse
constant `lipschitzExtensionConstant E' * K`. -/
theorem LipschitzOnWith.extend_finite_dimension {α : Type*} [PseudoMetricSpace α] {E' : Type*}
    [NormedAddCommGroup E'] [NormedSpace ℝ E'] [FiniteDimensional ℝ E'] {s : Set α} {f : α → E'}
    {K : ℝ≥0} (hf : LipschitzOnWith K f s) :
    ∃ g : α → E', LipschitzWith (lipschitzExtensionConstant E' * K) g ∧ EqOn f g s

{α : Type u_1}
[PseudoMetricSpace α]
{E' : Type u_2}
[NormedAddCommGroup E']
[NormedSpace ℝ E']
[FiniteDimensional ℝ E']
{s : Set α}
{f : α → E'}
{K : ℝ≥0}
(hf : LipschitzOnWith K f s)

∃ g, LipschitzWith (lipschitzExtensionConstant E' * K) g ∧ Set.EqOn f g s


lemma card_isUnramified_compl [NumberField k] [IsGalois k K] :
    Finset.card (univ.filter <| IsUnramified k (K := K))ᶜ =
      Finset.card (univ.filter <| IsUnramifiedIn K (k := k))ᶜ * (finrank k K / 2)

(k : Type u_1)
[Field k]
(K : Type u_2)
[Field K]
[NumberField K]
[Algebra k K]
[NumberField k]
[IsGalois k K]

(Finset.filter (NumberField.InfinitePlace.IsUnramified k) Finset.univ)ᶜ.card =
  (Finset.filter (NumberField.InfinitePlace.IsUnramifiedIn K) Finset.univ)ᶜ.card * (FiniteDimensional.finrank k K / 2)


theorem linearMapAt_apply (e : Trivialization F (π F E)) [e.IsLinear R] {b : B} (y : E b) :
    e.linearMapAt R b y = if b ∈ e.baseSet then (e ⟨b, y⟩).2 else 0

[TopologicalSpace (Bundle.TotalSpace F E)]

(e : Trivialization F Bundle.TotalSpace.proj)

(Trivialization.linearMapAt R e b) y = if b ∈ e.baseSet then (↑e { proj := b, snd := y }).2 else 0


@[simp]
theorem inducedMap_inducedMap (a : α) : inducedMap β γ (inducedMap α β a) = inducedMap α γ a

LinearOrderedField.inducedMap β γ (LinearOrderedField.inducedMap α β a) = LinearOrderedField.inducedMap α γ a


/-- If two functions `g` and `f` have power series `q` and `p` respectively at `f x` and `x`, then
`g ∘ f` admits the power series `q.comp p` at `x`. -/
theorem HasFPowerSeriesAt.comp {g : F → G} {f : E → F} {q : FormalMultilinearSeries 𝕜 F G}
    {p : FormalMultilinearSeries 𝕜 E F} {x : E} (hg : HasFPowerSeriesAt g q (f x))
    (hf : HasFPowerSeriesAt f p x) : HasFPowerSeriesAt (g ∘ f) (q.comp p) x

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
{G : Type u_4}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{g : F → G}
{f : E → F}
{q : FormalMultilinearSeries 𝕜 F G}
{p : FormalMultilinearSeries 𝕜 E F}
{x : E}
(hg : HasFPowerSeriesAt g q (f x))
(hf : HasFPowerSeriesAt f p x)


@[to_additive] lemma Antivary.pow_right (hfg : Antivary f g) (n : ℕ) : Antivary f (g ^ n)

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[OrderedCommGroup α]
[LinearOrderedCommGroup β]
{f : ι → α}
{g : ι → β}
(hfg : Antivary f g)
(n : ℕ)


@[reassoc (attr := simp, nolint unusedHavesSuffices)]
lemma Exact.liftFromProjective_comp
    (hS : S.Exact) {P : C} (f : P ⟶ S.X₂) [Projective P] (hf : f ≫ S.g = 0) :
    hS.liftFromProjective f hf ≫ S.f = f

(hf : CategoryTheory.CategoryStruct.comp f S.g = 0)

CategoryTheory.CategoryStruct.comp (hS.liftFromProjective f hf) S.f = f


theorem subgroup_mul_singleton {H : Subgroup G} {h : G} (hh : h ∈ H) : (H : Set G) * {h} = H

{G : Type u_2}
[Group G]
{H : Subgroup G}
{h : G}
(hh : h ∈ H)


@[measurability]
theorem Measurable.sqrt : Measurable fun x => √(f x)

{α : Type u_1}
{m : MeasurableSpace α}
{f : α → ℝ}
(hf : Measurable f)


/-- If elements of a list commute with each other, then their product does not
depend on the order of elements. -/
@[to_additive "If elements of a list additively commute with each other, then their sum does not
depend on the order of elements."]
lemma Perm.prod_eq' (h : l₁ ~ l₂) (hc : l₁.Pairwise Commute) : l₁.prod = l₂.prod

{M : Type u_4}
[Monoid M]
{l₁ l₂ : List M}
(h : l₁ ~ l₂)
(hc : List.Pairwise Commute l₁)


@[to_additive (attr := simp)]
theorem inv_mk [Inv G] [Inv H] (a : G) (b : H) : (a, b)⁻¹ = (a⁻¹, b⁻¹)

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


theorem finite_iUnion [Finite ι] {f : ι → Set α} (H : ∀ i, (f i).Finite) : (⋃ i, f i).Finite

{α : Type u}
{ι : Sort w}
[Finite ι]
{f : ι → Set α}
(H : ∀ (i : ι), (f i).Finite)


@[simp]
theorem isBigO_zero_right_iff : (f'' =O[l] fun _x => (0 : F')) ↔ f'' =ᶠ[l] 0

{α : Type u_1}
{F' : Type u_7}
{E'' : Type u_9}
[SeminormedAddCommGroup F']
[NormedAddCommGroup E'']
{f'' : α → E''}
{l : Filter α}


theorem BijOn.subset_left {r : Set α} (hf : BijOn f s t) (hrs : r ⊆ s) :
    BijOn f r (f '' r)

{α : Type u_1}
{β : Type u_2}
{s : Set α}
{t : Set β}
{f : α → β}
{r : Set α}
(hf : Set.BijOn f s t)
(hrs : r ⊆ s)


theorem inf_arrow_factors_right {B : C} (X Y : Subobject B) : Y.Factors (X ⊓ Y).arrow

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


theorem measure_eq_measure_of_between_null_diff {s₁ s₂ s₃ : Set α} (h12 : s₁ ⊆ s₂) (h23 : s₂ ⊆ s₃)
    (h_nulldiff : μ (s₃ \ s₁) = 0) : μ s₁ = μ s₂ ∧ μ s₂ = μ s₃

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s₁ s₂ s₃ : Set α}
(h12 : s₁ ⊆ s₂)
(h23 : s₂ ⊆ s₃)
(h_nulldiff : μ (s₃ \ s₁) = 0)

μ s₁ = μ s₂ ∧ μ s₂ = μ s₃


/-- We construct an open cover from another, by providing the needed fields and showing that the
provided fields are isomorphic with the original open cover. -/
@[simps J obj map]
def OpenCover.copy {X : Scheme.{u}} (𝒰 : OpenCover X) (J : Type*) (obj : J → Scheme)
    (map : ∀ i, obj i ⟶ X) (e₁ : J ≃ 𝒰.J) (e₂ : ∀ i, obj i ≅ 𝒰.obj (e₁ i))
    (e₂ : ∀ i, map i = (e₂ i).hom ≫ 𝒰.map (e₁ i)) : OpenCover X

{X : AlgebraicGeometry.Scheme}
(𝒰 : X.OpenCover)
(J : Type u_1)
(obj : J → AlgebraicGeometry.Scheme)
(map : (i : J) → obj i ⟶ X)
(e₁ : J ≃ 𝒰.J)
(e₂ : (i : J) → obj i ≅ 𝒰.obj (e₁ i))

∀ (e₂_1 : ∀ (i : J), map i = (e₂ i).hom ≫ 𝒰.map (e₁ i)), (𝒰.copy J obj map e₁ e₂ e₂_1).J = J


theorem mul_def (xs ys : IntList) : xs * ys = List.zipWith (· * ·) xs ys

xs * ys = List.zipWith (fun x x_1 => x * x_1) xs ys


theorem support_eq_cons {u v : V} (p : G.Walk u v) : p.support = u :: p.support.tail

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


@[simp]
theorem think_append (s t : WSeq α) : append (think s) t = think (append s t)


/-- The anti-equivalence between simplicial objects and cosimplicial objects. -/
@[simps!]
def simplicialCosimplicialEquiv : (SimplicialObject C)ᵒᵖ ≌ CosimplicialObject Cᵒᵖ

(C : Type u)
[CategoryTheory.Category.{v, u} C]
(X : (SimplexCategoryᵒᵖ ⥤ C)ᵒᵖ)

(CategoryTheory.simplicialCosimplicialEquiv C).unitIso.inv.app X = (Opposite.unop X).rightOpLeftOpIso.inv.op


@[simp]
theorem natDegree_coe_units (u : R[X]ˣ) : natDegree (u : R[X]) = 0

{R : Type u}
[CommRing R]
[IsDomain R]
(u : R[X]ˣ)


theorem tendsto_iInf_iInf {f : α → β} {x : ι → Filter α} {y : ι → Filter β}
    (h : ∀ i, Tendsto f (x i) (y i)) : Tendsto f (iInf x) (iInf y)

(h : ∀ (i : ι), Filter.Tendsto f (x i) (y i))


theorem mem_image (y : β) (s : Set α) : y ∈ f.image s ↔ ∃ x ∈ s, y ∈ f x

{α : Type u_1}
{β : Type u_2}
(f : α →. β)
(y : β)
(s : Set α)


@[to_additive (attr := simp)]
lemma stabilizer_subgroup_op (s : Subgroup Gᵐᵒᵖ) : stabilizer G (s : Set Gᵐᵒᵖ) = s.unop

{G : Type u_1}
[AddGroup G]
(s : AddSubgroup Gᵃᵒᵖ)


/-- Euler's product formula for the totient function. -/
theorem totient_eq_mul_prod_factors (n : ℕ) :
    (φ n : ℚ) = n * ∏ p ∈ n.primeFactors, (1 - (p : ℚ)⁻¹)

↑n.totient = ↑n * ∏ p ∈ n.primeFactors, (1 - (↑p)⁻¹)


/-- The functor `RightExtension L' F ⥤ RightExtension L F`
induced by a natural transformation `L ⋙ G ⟶ L'`. -/
@[simps!]
def RightExtension.postcomp₁ (f : L ⋙ G ⟶ L') (F : C ⥤ H) :
    RightExtension L' F ⥤ RightExtension L F

(X : CategoryTheory.Comma ((CategoryTheory.whiskeringLeft C D' H).obj L') (CategoryTheory.Functor.fromPUnit F))

((CategoryTheory.Functor.RightExtension.postcomp₁ G f F).obj X).right = X.right


@[to_additive]
theorem of_injective : Function.Injective (@of α)


/-- The angle ∠AAB at a point is always `π / 2`. -/
@[simp] lemma angle_self_left (p₀ p : P) : ∠ p₀ p₀ p = π / 2

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
(p₀ p : P)


/-- The ring `HahnSeries (σ →₀ ℕ) R` is isomorphic to `MvPowerSeries σ R` for a `Finite` `σ`.
We take the index set of the hahn series to be `Finsupp` rather than `pi`,
even though we assume `Finite σ` as this is more natural for alignment with `MvPowerSeries`.
After importing `Algebra.Order.Pi` the ring `HahnSeries (σ → ℕ) R` could be constructed instead.
 -/
@[simps]
def toMvPowerSeries {σ : Type*} [Finite σ] : HahnSeries (σ →₀ ℕ) R ≃+* MvPowerSeries σ R

{R : Type u_2}
[Semiring R]
{σ : Type u_3}
[Finite σ]
(f : MvPowerSeries σ R)

(HahnSeries.toMvPowerSeries.symm f).coeff = f


theorem Contravariant.flip (h : Contravariant M N μ r) : Contravariant M N μ (flip r)

{M : Type u_1}
{N : Type u_2}
{μ : M → N → N}
{r : N → N → Prop}
(h : Contravariant M N μ r)


@[simp]
theorem clog_inv (b : ℕ) (r : R) : clog b r⁻¹ = -log b r

{R : Type u_1}
[LinearOrderedSemifield R]
[FloorSemiring R]
(b : ℕ)
(r : R)


@[simp]
theorem iUnion_source_chartAt : (⋃ x : M, (chartAt H x).source) = (univ : Set M)

(H : Type u)
(M : Type u_2)
[TopologicalSpace H]
[TopologicalSpace M]
[ChartedSpace H M]


@[to_additive exists_zero_lt]
theorem exists_one_lt' [Nontrivial α] : ∃ a : α, 1 < a

{α : Type u}
[LinearOrderedCommGroup α]
[Nontrivial α]


theorem pow_dvd_pow_iff_le_right' {b k l : Nat} : (b + 2) ^ k ∣ (b + 2) ^ l ↔ k ≤ l


theorem norm_eq_sqrt_real_inner (x : F) : ‖x‖ = √⟪x, x⟫_ℝ

{F : Type u_3}
[NormedAddCommGroup F]
[InnerProductSpace ℝ F]
(x : F)

‖x‖ = √⟪x, x⟫_ℝ


/-- *Rademacher's theorem*: a Lipschitz function between finite-dimensional real vector spaces is
differentiable almost everywhere. -/
theorem LipschitzWith.ae_differentiableAt {f : E → F} (h : LipschitzWith C f) :
    ∀ᵐ x ∂μ, DifferentiableAt ℝ f x

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


theorem prim_iff {n f} : @Primrec' n f ↔ Primrec f


/-- If `M` is `R`-finite, then `Supp M = Z(Ann(M))`. -/
lemma Module.support_eq_zeroLocus [Module.Finite R M] :
    Module.support R M = PrimeSpectrum.zeroLocus (Module.annihilator R M)

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
[Module.Finite R M]

Module.support R M = PrimeSpectrum.zeroLocus ↑(Module.annihilator R M)


theorem gcd_rel_right' : gcdW a b * gcdB' a b = succPNat (gcdY a b * gcdA' a b)

a.gcdW b * a.gcdB' b = (a.gcdY b * ↑(a.gcdA' b)).succPNat


@[to_additive zsmul_zero_sub]
lemma one_div_zpow (a : α) (n : ℤ) : (1 / a) ^ n = 1 / a ^ n

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


@[simp]
theorem uncurry_curry (f : ((i : Fin n) → p i) → τ) :
    uncurry (curry f) = f

{n : ℕ}
{p : Fin n → Type u}
{τ : Type u}
(f : ((i : Fin n) → p i) → τ)

(Function.FromTypes.curry f).uncurry = f


theorem Orthonormal.codRestrict {ι : Type*} {v : ι → E} (hv : Orthonormal 𝕜 v) (s : Submodule 𝕜 E)
    (hvs : ∀ i, v i ∈ s) : @Orthonormal 𝕜 s _ _ _ ι (Set.codRestrict v s hvs)

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{ι : Type u_4}
{v : ι → E}
(hv : Orthonormal 𝕜 v)
(s : Submodule 𝕜 E)
(hvs : ∀ (i : ι), v i ∈ s)

Orthonormal 𝕜 (Set.codRestrict v (↑s) hvs)


theorem inclusion_apply (h : p ≤ p') (x : p) : inclusion h x = ⟨x, h x.2⟩

{R : Type u_1}
{M : Type u_2}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{p p' : Submodule R M}
(h : p ≤ p')
(x : ↥p)


lemma CstarRing.norm_mem_spectrum_of_nonneg [Nontrivial A] {a : A} (ha : 0 ≤ a := by cfc_tac) :
    ‖a‖ ∈ spectrum ℝ a

{A : Type u_1}
[NormedRing A]
[StarRing A]
[CstarRing A]
[CompleteSpace A]
[NormedAlgebra ℂ A]
[StarModule ℂ A]
[PartialOrder A]
[StarOrderedRing A]
[Nontrivial A]
{a : A}
(ha : 0 ≤ a := by cfc_tac)


/-- Pigeonhole principle for a cardinality below the cardinality of the domain -/
theorem infinite_pigeonhole_card {β α : Type u} (f : β → α) (θ : Cardinal) (hθ : θ ≤ #β)
    (h₁ : ℵ₀ ≤ θ) (h₂ : #α < θ.ord.cof) : ∃ a : α, θ ≤ #(f ⁻¹' {a})

{β α : Type u}
(f : β → α)
(θ : Cardinal.{u})
(hθ : θ ≤ #β)
(h₁ : ℵ₀ ≤ θ)
(h₂ : #α < θ.ord.cof)


@[simp] -- Porting note (#10618): was @[simp]
theorem inv_smul_integral_comp_div (c) :
    (c⁻¹ • ∫ x in a..b, f (x / c)) = ∫ x in a / c..b / c, f x

{E : Type u_3}
[NormedAddCommGroup E]
[CompleteSpace E]
[NormedSpace ℝ E]
{a b : ℝ}
(f : ℝ → E)
(c : ℝ)

c⁻¹ • ∫ (x : ℝ) in a..b, f (x / c) = ∫ (x : ℝ) in a / c..b / c, f x


theorem div_neg_iff : a / b < 0 ↔ 0 < a ∧ b < 0 ∨ a < 0 ∧ 0 < b

{α : Type u_2}
[LinearOrderedField α]
{a b : α}


@[to_additive]
theorem ne_one_of_nnnorm_ne_zero {a : E} : ‖a‖₊ ≠ 0 → a ≠ 1

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

‖a‖₊ ≠ 0 → a ≠ 0


/--
The map `fun x => a * x + b`, as a homeomorphism from `𝕜` (a topological field) to itself,
when `a ≠ 0`.
-/
@[simps]
def affineHomeomorph (a b : 𝕜) (h : a ≠ 0) : 𝕜 ≃ₜ 𝕜

{𝕜 : Type u_2}
[Field 𝕜]
[TopologicalSpace 𝕜]
[TopologicalRing 𝕜]
(a b : 𝕜)
(h : a ≠ 0)
(y : 𝕜)

(affineHomeomorph a b h).symm y = (y - b) / a


theorem HasDerivWithinAt.comp (hh₂ : HasDerivWithinAt h₂ h₂' s' (h x))
    (hh : HasDerivWithinAt h h' s x) (hst : MapsTo h s s') :
    HasDerivWithinAt (h₂ ∘ h) (h₂' * h') s x


theorem one_le_dist_of_ne {i j : ι} (h : i ≠ j) (x : E i) (y : E j) :
    1 ≤ dist (⟨i, x⟩ : Σk, E k) ⟨j, y⟩

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


theorem bddBelow_range_of_tendsto_atTop_atTop [IsDirected α (· ≥ ·)] {u : ℕ → α}
    (hx : Tendsto u atTop atTop) : BddBelow (Set.range u)

(hx : Filter.Tendsto u Filter.atTop Filter.atTop)


theorem semiconj₂_conj : Semiconj₂ e f (e.arrowCongr e.conj f)

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

Function.Semiconj₂ (⇑e) f ((e.arrowCongr e.conj) f)


/-- The bijection `(X ⟶ Z) ≃ (Y ⟶ Z)` induced by `α : X ≅ Y`. -/
@[simps]
def homFromEquiv (α : X ≅ Y) {Z : C} : (X ⟶ Z) ≃ (Y ⟶ Z)

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

α.homFromEquiv.symm g = CategoryTheory.CategoryStruct.comp α.hom g


@[to_additive]
theorem mem_normalizer_iff' {g : G} : g ∈ H.normalizer ↔ ∀ n, n * g ∈ H ↔ g * n ∈ H

{G : Type u_1}
[Group G]
{H : Subgroup G}
{g : G}

g ∈ H.normalizer ↔ ∀ (n : G), n * g ∈ H ↔ g * n ∈ H


protected theorem tsum_le_tsum (h : ∀ a, f a ≤ g a) : ∑' a, f a ≤ ∑' a, g a

{α : Type u_1}
{f g : α → ℝ≥0∞}
(h : ∀ (a : α), f a ≤ g a)


@[reassoc (attr := simp)]
theorem ιPi_π (a) : ιPi I ≫ Pi.π I.left a = ι I a

(I : CategoryTheory.Limits.MulticospanIndex C)

CategoryTheory.CategoryStruct.comp (CategoryTheory.Limits.Multiequalizer.ιPi I) (CategoryTheory.Limits.Pi.π I.left a) =
  CategoryTheory.Limits.Multiequalizer.ι I a


/-- A sum of finite numbers is still finite -/
theorem sum_lt_top_iff {s : Finset α} {f : α → ℝ≥0∞} : ∑ a ∈ s, f a < ∞ ↔ ∀ a ∈ s, f a < ∞

{α : Type u_1}
{s : Finset α}
{f : α → ℝ≥0∞}


@[simp]
theorem max'_lt_iff {x} : s.max' H < x ↔ ∀ y ∈ s, y < x

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


lemma Function.Bijective.pairwise_comp_iff {f : β → α} (hf : Bijective f) :
    Pairwise (r on f) ↔ Pairwise r

{α : Type u_1}
{β : Type u_2}
{r : α → α → Prop}
{f : β → α}
(hf : Function.Bijective f)


theorem emod_negSucc (m : Nat) (n : Int) :
  (Int.negSucc m) % n = Int.subNatNat (Int.natAbs n) (Nat.succ (m % Int.natAbs n))

-[m+1] % n = Int.subNatNat n.natAbs (m % n.natAbs).succ


@[measurability]
theorem Measurable.re (hf : Measurable f) : Measurable fun x => RCLike.re (f x)

{α : Type u_1}
{𝕜 : Type u_2}
[RCLike 𝕜]
{m : MeasurableSpace α}
{f : α → 𝕜}
(hf : Measurable f)


theorem mem_inf_iff_superset {f g : Filter α} {s : Set α} :
    s ∈ f ⊓ g ↔ ∃ t₁ ∈ f, ∃ t₂ ∈ g, t₁ ∩ t₂ ⊆ s

{α : Type u}
{f g : Filter α}
{s : Set α}


/-- If `K₁/E/F` is a tower of fields with `E/F` normal then `AlgHom.restrictNormal'` is an
 equivalence. -/
@[simps]
def Normal.algHomEquivAut [Normal F E] : (E →ₐ[F] K₁) ≃ E ≃ₐ[F] E

(F : Type u_1)
(K₁ : Type u_3)
[Field F]
[Field K₁]
[Algebra F K₁]
(E : Type u_6)
[Field E]
[Algebra F E]
[Algebra E K₁]
[IsScalarTower F E K₁]
[Normal F E]
(σ : E →ₐ[F] K₁)

(Normal.algHomEquivAut F K₁ E) σ = σ.restrictNormal' E


theorem coeff_iterate_frobenius' (f : Ring.Perfection R p) (n m : ℕ) (hmn : m ≤ n) :
    coeff R p n ((frobenius _ p)^[m] f) = coeff R p (n - m) f

{R : Type u₁}
[CommSemiring R]
{p : ℕ}
[hp : Fact (Nat.Prime p)]
[CharP R p]
(f : Ring.Perfection R p)
(n m : ℕ)
(hmn : m ≤ n)

(Perfection.coeff R p n) ((⇑(frobenius (Ring.Perfection R p) p))^[m] f) = (Perfection.coeff R p (n - m)) f


@[simp]
theorem realize_functions_apply₁ {f : L.Functions 1} {t : L.Term α} {v : α → M} :
    (f.apply₁ t).realize v = funMap f ![t.realize v]

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]
{α : Type u'}
{f : L.Functions 1}
{t : L.Term α}
{v : α → M}

FirstOrder.Language.Term.realize v (f.apply₁ t) =
  FirstOrder.Language.Structure.funMap f ![FirstOrder.Language.Term.realize v t]


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

{H : Type x}
[TopologicalSpace H]
[OrderedCommGroup H]
[ContinuousInv H]
{a : H}

Filter.Tendsto Inv.inv (𝓝[<] a⁻¹) (𝓝[>] a)


theorem aleph_one_le_continuum : aleph 1 ≤ 𝔠


/-- For `f : Lp E p μ`, we can define an element of `Lp E p (μ.restrict s)` by
`(Lp.memℒp f).restrict s).toLp f`. This map commutes with scalar multiplication. -/
theorem Lp_toLp_restrict_smul (c : 𝕜) (f : Lp F p μ) (s : Set X) :
    ((Lp.memℒp (c • f)).restrict s).toLp (⇑(c • f)) = c • ((Lp.memℒp f).restrict s).toLp f

{X : Type u_1}
{F : Type u_4}
[MeasurableSpace X]
{𝕜 : Type u_5}
[NormedField 𝕜]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure X}
(c : 𝕜)
(f : ↥(MeasureTheory.Lp F p μ))
(s : Set X)

MeasureTheory.Memℒp.toLp ↑↑(c • f) ⋯ = c • MeasureTheory.Memℒp.toLp ↑↑f ⋯


lemma map_add_of_iInf_genEigenspace_ne_bot_of_commute [NoZeroSMulDivisors R M]
    {L F : Type*} [Add L] [FunLike F L (End R M)] [AddHomClass F L (End R M)] (f : F)
    (μ : L → R) (h_ne : ⨅ x, ⨆ k, (f x).genEigenspace (μ x) k ≠ ⊥)
    (h : ∀ x y, Commute (f x) (f y)) (x y : L) :
    μ (x + y) = μ x + μ y

(h_ne : ⨅ x, ⨆ k, ((f x).genEigenspace (μ x)) k ≠ ⊥)


@[to_additive]
lemma mulIndicator_le_one (h : ∀ a ∈ s, f a ≤ 1) (a : α) : mulIndicator s f a ≤ 1

{α : Type u_2}
{M : Type u_4}
[Preorder M]
[Zero M]
{s : Set α}
{f : α → M}
(h : ∀ a ∈ s, f a ≤ 0)
(a : α)


theorem den_eq_one_iff (r : ℚ) : r.den = 1 ↔ ↑r.num = r


/-- Every identity matrix is diagonal. -/
@[simp]
theorem isDiag_one [DecidableEq n] [Zero α] [One α] : (1 : Matrix n n α).IsDiag

{α : Type u_1}
{n : Type u_4}
[DecidableEq n]
[Zero α]
[One α]


@[reassoc]
theorem condition (b) :
    Multiequalizer.ι I (I.fstTo b) ≫ I.fst b = Multiequalizer.ι I (I.sndTo b) ≫ I.snd b

CategoryTheory.CategoryStruct.comp (CategoryTheory.Limits.Multiequalizer.ι I (I.fstTo b)) (I.fst b) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.Limits.Multiequalizer.ι I (I.sndTo b)) (I.snd b)


theorem Icc_mem_nhdsWithin_Ici' (H : a < b) : Icc a b ∈ 𝓝[≥] a

{α : Type u}
[TopologicalSpace α]
[LinearOrder α]
[ClosedIciTopology α]
{a b : α}
(H : a < b)


theorem comap_surjective_of_injective : Function.Surjective (comap f)

{R : Type u_1}
{R₂ : Type u_3}
{M : Type u_5}
{M₂ : Type u_7}
[Semiring R]
[Semiring R₂]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R₂ M₂]
{σ₁₂ : R →+* R₂}
{F : Type u_9}
[FunLike F M M₂]
[SemilinearMapClass F σ₁₂ M M₂]
[RingHomSurjective σ₁₂]
{f : F}
(hf : Function.Injective ⇑f)


/-- The fundamental property of the operator norm: `‖f x‖ ≤ ‖f‖ * ‖x‖`. -/
theorem le_opNorm : ‖f x‖ ≤ ‖f‖ * ‖x‖

{𝕜 : Type u_1}
{𝕜₂ : Type u_2}
{E : Type u_4}
{F : Type u_6}
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup F]
[NontriviallyNormedField 𝕜]
[NontriviallyNormedField 𝕜₂]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜₂ F]
{σ₁₂ : 𝕜 →+* 𝕜₂}
[RingHomIsometric σ₁₂]
(f : E →SL[σ₁₂] F)
(x : E)

‖f x‖ ≤ ‖f‖ * ‖x‖


theorem Surjective.sum_map {f : α → β} {g : α' → β'} (hf : Surjective f) (hg : Surjective g) :
    Surjective (Sum.map f g)

{α : Type u}
{α' : Type w}
{β : Type v}
{β' : Type x}
{f : α → β}
{g : α' → β'}
(hf : Function.Surjective f)
(hg : Function.Surjective g)


/-- When a homology data `h` of a short complex `S` is such that both `h.left` and
`h.right` are preserved by a functor `F`, this is the induced homology data
`h.map F` for the short complex `S.map F`. -/
@[simps]
noncomputable def HomologyData.map (h : S.HomologyData) (F : C ⥤ D) [F.PreservesZeroMorphisms]
    [h.left.IsPreservedBy F] [h.right.IsPreservedBy F] :
    (S.map F).HomologyData


@[mono]
theorem flag_mono (b : Basis (Fin n) R M) : Monotone b.flag

{R : Type u_1}
{M : Type u_2}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{n : ℕ}
(b : Basis (Fin n) R M)


theorem mem_carrier {s : NonUnitalSubring R} {x : R} : x ∈ s.toNonUnitalSubsemiring ↔ x ∈ s

{R : Type u}
[NonUnitalNonAssocRing R]
{s : NonUnitalSubring R}
{x : R}


@[simp]
theorem exists_succ_eq {x : Fin (n + 1)} : (∃ y, Fin.succ y = x) ↔ x ≠ 0


/-- Precompose a partial homeomorphism with a homeomorphism.
We modify the source and target to have better definitional behavior. -/
@[simps! (config := .asFn)]
def transPartialHomeomorph (e : X ≃ₜ Y) (f' : PartialHomeomorph Y Z) : PartialHomeomorph X Z

{X : Type u_1}
{Y : Type u_3}
{Z : Type u_5}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
(e : X ≃ₜ Y)
(f' : PartialHomeomorph Y Z)

↑(e.transPartialHomeomorph f') = ↑f' ∘ ⇑e


@[to_additive]
theorem isZero_of_subsingleton (G : CommGrp) [Subsingleton G] : IsZero G


/-- A uniform space is a generalization of the "uniform" topological aspects of a
  metric space. It consists of a filter on `α × α` called the "uniformity", which
  satisfies properties analogous to the reflexivity, symmetry, and triangle properties
  of a metric.

  A metric space has a natural uniformity, and a uniform space has a natural topology.
  A topological group also has a natural uniformity, even when it is not metrizable. -/
class UniformSpace (α : Type u) extends TopologicalSpace α where
  /-- The uniformity filter. -/
  protected uniformity : Filter (α × α)
  /-- If `s ∈ uniformity`, then `Prod.swap ⁻¹' s ∈ uniformity`. -/
  protected symm : Tendsto Prod.swap uniformity uniformity
  /-- For every set `u ∈ uniformity`, there exists `v ∈ uniformity` such that `v ○ v ⊆ u`. -/
  protected comp : (uniformity.lift' fun s => s ○ s) ≤ uniformity
  /-- The uniformity agrees with the topology: the neighborhoods filter of each point `x`
  is equal to `Filter.comap (Prod.mk x) (𝓤 α)`. -/
  protected nhds_eq_comap_uniformity (x : α) : 𝓝 x = comap (Prod.mk x) uniformity

Filter.Tendsto Prod.swap UniformSpace.uniformity UniformSpace.uniformity


@[simp]
theorem num_C (c : K) : num (C c) = Polynomial.C c


theorem isPrecomplete_iff :
    IsPrecomplete I M ↔
      ∀ f : ℕ → M,
        (∀ {m n}, m ≤ n → f m ≡ f n [SMOD (I ^ m • ⊤ : Submodule R M)]) →
          ∃ L : M, ∀ n, f n ≡ L [SMOD (I ^ n • ⊤ : Submodule R M)]

{R : Type u_1}
[CommRing R]
{I : Ideal R}
{M : Type u_2}
[AddCommGroup M]
[Module R M]

IsPrecomplete I M ↔
  ∀ (f : ℕ → M), (∀ {m n : ℕ}, m ≤ n → f m ≡ f n [SMOD I ^ m • ⊤]) → ∃ L, ∀ (n : ℕ), f n ≡ L [SMOD I ^ n • ⊤]


theorem finStronglyMeasurable_iff_stronglyMeasurable_and_exists_set_sigmaFinite {α β} {f : α → β}
    [TopologicalSpace β] [T2Space β] [Zero β] {_ : MeasurableSpace α} {μ : Measure α} :
    FinStronglyMeasurable f μ ↔
      StronglyMeasurable f ∧
        ∃ t, MeasurableSet t ∧ (∀ x ∈ tᶜ, f x = 0) ∧ SigmaFinite (μ.restrict t)

{α : Type u_5}
{β : Type u_6}
{f : α → β}
[TopologicalSpace β]
[T2Space β]
[Zero β]

∀ {x : MeasurableSpace α} {μ : MeasureTheory.Measure α},
  MeasureTheory.FinStronglyMeasurable f μ ↔
    MeasureTheory.StronglyMeasurable f ∧
      ∃ t, MeasurableSet t ∧ (∀ x ∈ tᶜ, f x = 0) ∧ MeasureTheory.SigmaFinite (μ.restrict t)


theorem rangeS_eq_map (f : R →+* S) : f.rangeS = (⊤ : Subsemiring R).map f

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


/--
Giving a continuous map out of a disjoint union is the same as giving a continuous map out of
each term
-/
@[simps]
def piEquiv : (∀ i, C(A, X i)) ≃ C(A, ∀ i, X i)

{I : Type u_5}
(A : Type u_6)
(X : I → Type u_7)
[TopologicalSpace A]
[(i : I) → TopologicalSpace (X i)]
(f : (i : I) → C(A, X i))

(ContinuousMap.piEquiv A X) f = ContinuousMap.pi f


theorem neg_lt_iff_neg_lt {a b : EReal} : -a < b ↔ -b < a