/-- A discrete valuation ring `R` is not a field. -/
theorem not_isField : ¬IsField R

(R : Type u)
[CommRing R]
[IsDomain R]
[DiscreteValuationRing R]


@[simp]
theorem map_constants (φ : M ↪ₑ[L] N) (c : L.Constants) : φ c = c

{L : FirstOrder.Language}
{M : Type u_1}
{N : Type u_2}
[L.Structure M]
[L.Structure N]
(φ : M ↪ₑ[L] N)
(c : L.Constants)


@[simp] theorem Prod.map_fst (f : α → β) (g : γ → δ) (x) : (Prod.map f g x).1 = f x.1

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


@[simp]
lemma leftHomologyMap_add : leftHomologyMap (φ + φ') = leftHomologyMap φ + leftHomologyMap φ'

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

CategoryTheory.ShortComplex.leftHomologyMap (φ + φ') =
  CategoryTheory.ShortComplex.leftHomologyMap φ + CategoryTheory.ShortComplex.leftHomologyMap φ'


@[simp]
theorem map_subset_map {s₁ s₂ : Finset α} : s₁.map f ⊆ s₂.map f ↔ s₁ ⊆ s₂

{α : Type u_1}
{β : Type u_2}
{f : α ↪ β}
{s₁ s₂ : Finset α}

Finset.map f s₁ ⊆ Finset.map f s₂ ↔ s₁ ⊆ s₂


theorem sups_inter_subset_left : (s₁ ∩ s₂) ⊻ t ⊆ s₁ ⊻ t ∩ s₂ ⊻ t

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

(s₁ ∩ s₂) ⊻ t ⊆ s₁ ⊻ t ∩ s₂ ⊻ t


@[to_additive]
lemma orbitRel.Quotient.orbit_injective :
    Injective (orbitRel.Quotient.orbit : orbitRel.Quotient G α → Set α)

{G : Type u_1}
{α : Type u_2}
[Group G]
[MulAction G α]


@[simp]
theorem mk_left_unitor_inv : Quot.mk _ (Hom₂.left_unitor_inv f) = (λ_ f).inv

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

Quot.mk CategoryTheory.FreeBicategory.Rel (CategoryTheory.FreeBicategory.Hom₂.left_unitor_inv f) =
  (CategoryTheory.Bicategory.leftUnitor f).inv


lemma dens_sdiff (h : s ⊆ t) : dens (t \ s) = dens t - dens s

{α : Type u_2}
[Fintype α]
{s t : Finset α}
[DecidableEq α]
(h : s ⊆ t)


/-- Given two points on a circle, the radius of that circle may be expressed explicitly as half
the distance between those two points divided by the cosine of the angle between the chord and
the radius at one of those points. -/
theorem dist_div_cos_oangle_center_div_two_eq_radius {s : Sphere P} {p₁ p₂ : P} (hp₁ : p₁ ∈ s)
    (hp₂ : p₂ ∈ s) (h : p₁ ≠ p₂) :
    dist p₁ p₂ / Real.Angle.cos (∡ p₂ p₁ s.center) / 2 = s.radius

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

dist p₁ p₂ / (∡ p₂ p₁ s.center).cos / 2 = s.radius


/-- For a quasi ergodic map, sets that are almost invariant (rather than strictly invariant) are
still either almost empty or full. -/
theorem ae_empty_or_univ' (hf : QuasiErgodic f μ) (hs : MeasurableSet s) (hs' : f ⁻¹' s =ᵐ[μ] s) :
    s =ᵐ[μ] (∅ : Set α) ∨ s =ᵐ[μ] univ

{α : Type u_1}
{m : MeasurableSpace α}
{f : α → α}
{s : Set α}
{μ : MeasureTheory.Measure α}
(hf : QuasiErgodic f μ)
(hs : MeasurableSet s)
(hs' : f ⁻¹' s =ᵐ[μ] s)


@[reassoc]
lemma homMap_apply (G : D₁ ⥤ D₂) (e : Φ.functor ⋙ L₂ ≅ L₁ ⋙ G) (f : L₁.obj X ⟶ L₁.obj Y) :
    Φ.homMap L₁ L₂ f = e.hom.app X ≫ G.map f ≫ e.inv.app Y

{W₁ : CategoryTheory.MorphismProperty C₁}

{W₂ : CategoryTheory.MorphismProperty C₂}

(Φ : CategoryTheory.LocalizerMorphism W₁ W₂)

Φ.homMap L₁ L₂ f =
  CategoryTheory.CategoryStruct.comp (e.hom.app X) (CategoryTheory.CategoryStruct.comp (G.map f) (e.inv.app Y))


@[simp]
theorem toIcoMod_apply_left (a : α) : toIcoMod hp a a = a

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


theorem edist_approxOn_mono {f : β → α} (hf : Measurable f) {s : Set α} {y₀ : α} (h₀ : y₀ ∈ s)
    [SeparableSpace s] (x : β) {m n : ℕ} (h : m ≤ n) :
    edist (approxOn f hf s y₀ h₀ n x) (f x) ≤ edist (approxOn f hf s y₀ h₀ m x) (f x)

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
[PseudoEMetricSpace α]
[OpensMeasurableSpace α]
[MeasurableSpace β]
{f : β → α}
(hf : Measurable f)
{s : Set α}
{y₀ : α}
(h₀ : y₀ ∈ s)
[TopologicalSpace.SeparableSpace ↑s]
(x : β)
{m n : ℕ}
(h : m ≤ n)

edist (↑(MeasureTheory.SimpleFunc.approxOn f hf s y₀ h₀ n) x) (f x) ≤
  edist (↑(MeasureTheory.SimpleFunc.approxOn f hf s y₀ h₀ m) x) (f x)


@[simp] theorem nndist_toDual (a b : X) : nndist (toDual a) (toDual b) = nndist a b

{X : Type u_1}
[PseudoMetricSpace X]
(a b : X)

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


lemma Measurable.exists [Countable ι] {p : ι → α → Prop} (hp : ∀ i, Measurable (p i)) :
    Measurable fun a ↦ ∃ i, p i a

{α : Type u_1}
{ι : Sort uι}
[MeasurableSpace α]
[Countable ι]
{p : ι → α → Prop}
(hp : ∀ (i : ι), Measurable (p i))


@[simp]
theorem extentClosure_empty : extentClosure r ∅ = univ

{α : Type u_2}
{β : Type u_3}
(r : α → β → Prop)


@[simp]
theorem coe_copy {μ : YoungDiagram} (T : SemistandardYoungTableau μ) (entry' : ℕ → ℕ → ℕ)
    (h : entry' = T) : ⇑(T.copy entry' h) = entry'

{μ : YoungDiagram}
(T : SemistandardYoungTableau μ)
(entry' : ℕ → ℕ → ℕ)
(h : entry' = ⇑T)


@[norm_cast]
theorem coe_ennreal_ne_one {x : ℝ≥0∞} : (x : EReal) ≠ 1 ↔ x ≠ 1

↑x ≠ 1 ↔ x ≠ 1


lemma exp_sub_sum_range_succ_isLittleO_pow (n : ℕ) :
    (fun x ↦ exp x - ∑ i ∈ Finset.range (n + 1), x ^ i / i !) =o[𝓝 0] (· ^ n)

(fun x => Complex.exp x - ∑ i ∈ Finset.range (n + 1), x ^ i / ↑i !) =o[𝓝 0] fun x => x ^ n


@[simp]
theorem verts_sSup (s : Set G.Subgraph) : (sSup s).verts = ⋃ G' ∈ s, verts G'

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


theorem revzip_powersetAux' {l : List α} ⦃x⦄ (h : x ∈ revzip (powersetAux' l)) :
    x.1 + x.2 = ↑l

(h : x ∈ (Multiset.powersetAux' l).revzip)


/-- When `A : Rep k G` is a trivial representation of `G`, `Z¹(G, A)` is isomorphic to the
group homs `G → A`. -/
@[simps] def oneCocyclesLequivOfIsTrivial [hA : A.IsTrivial] :
    oneCocycles A ≃ₗ[k] Additive G →+ A

{k G : Type u}
[CommRing k]
[Group G]
(A : Rep k G)
[hA : A.IsTrivial]
(f : Additive G →+ CoeSort.coe A)
(a : Additive G)

↑((groupCohomology.oneCocyclesLequivOfIsTrivial A).symm f) a = f a


@[simp]
theorem foldr_zero (f : α → β → β) (H b) : foldr f H b 0 = b

{α : Type u_1}
{β : Type v}
(f : α → β → β)
(H : LeftCommutative f)
(b : β)


@[simp] theorem gcd_cons : gcd (x :: xs) = Nat.gcd x.natAbs (gcd xs)

Lean.Omega.IntList.gcd (x :: xs) = x.natAbs.gcd (Lean.Omega.IntList.gcd xs)


theorem hasDerivWithinAt_arccos_Iic {x : ℝ} (h : x ≠ 1) :
    HasDerivWithinAt arccos (-(1 / √(1 - x ^ 2))) (Iic x) x

HasDerivWithinAt Real.arccos (-(1 / √(1 - x ^ 2))) (Set.Iic x) x


@[simp, norm_cast]
theorem coe_one : ((1 : s) : R) = 1


@[simp]
theorem toAffineMap_linear : f.toAffineMap.linear = f

{k : Type u_1}
{V₁ : Type u_2}
{V₂ : Type u_3}
[Ring k]
[AddCommGroup V₁]
[Module k V₁]
[AddCommGroup V₂]
[Module k V₂]
(f : V₁ →ₗ[k] V₂)


@[to_additive]
theorem prod_antidiagonal_eq_prod_range_succ_mk {M : Type*} [CommMonoid M] (f : ℕ × ℕ → M)
    (n : ℕ) : ∏ ij ∈ antidiagonal n, f ij = ∏ k ∈ range n.succ, f (k, n - k)

{M : Type u_3}
[AddCommMonoid M]
(f : ℕ × ℕ → M)
(n : ℕ)

∑ ij ∈ Finset.antidiagonal n, f ij = ∑ k ∈ Finset.range n.succ, f (k, n - k)


theorem image_coe_Icc : (some : α → WithBot α) '' Icc a b = Icc (a : WithBot α) b

WithBot.some '' Set.Icc a b = Set.Icc ↑a ↑b


theorem IsLocalMin.comp_continuousOn [TopologicalSpace δ] {s : Set δ} {g : δ → α} {b : δ}
    (hf : IsLocalMin f (g b)) (hg : ContinuousOn g s) (hb : b ∈ s) : IsLocalMinOn (f ∘ g) s b

{α : Type u}
{β : Type v}
{δ : Type x}
[TopologicalSpace α]
[Preorder β]
{f : α → β}
[TopologicalSpace δ]
{s : Set δ}
{g : δ → α}
{b : δ}
(hf : IsLocalMin f (g b))
(hg : ContinuousOn g s)
(hb : b ∈ s)


theorem mem_diff_shiftr_find (x : X) : x ∈ K.shiftr (K.find x + 1) \ K.shiftr (K.find x)

{X : Type u_1}
[TopologicalSpace X]
(K : CompactExhaustion X)
(x : X)


lemma IsUpperSet.erase (hs : IsUpperSet s) (has : ∀ b ∈ s, b ≤ a → b = a) : IsUpperSet (s \ {a})

{α : Type u_1}
[LE α]
{s : Set α}
{a : α}
(hs : IsUpperSet s)
(has : ∀ b ∈ s, b ≤ a → b = a)


lemma tendsto_atTop_r (i : α) : Tendsto (r i) atTop atTop

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

Filter.Tendsto (r i) Filter.atTop Filter.atTop


theorem nfp_le_fp {f} (H : Monotone f) {a b} (ab : a ≤ b) (h : f b ≤ b) : nfp f a ≤ b

{f : Ordinal.{u_1} → Ordinal.{u_1}}
(H : Monotone f)
{a b : Ordinal.{u_1}}
(ab : a ≤ b)
(h : f b ≤ b)


theorem iget_mem [Inhabited α] : ∀ {o : Option α}, isSome o → o.iget ∈ o

{α : Type u_1}
[Inhabited α]
{o : Option α}


protected theorem specializes (h : IsGenericPoint x S) (h' : y ∈ S) : x ⤳ y

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


/-- If a function is countably sub-multiplicative then it is sub-multiplicative on finite sets -/
@[to_additive "If a function is countably sub-additive then it is sub-additive on finite sets"]
theorem rel_iSup_prod [CompleteLattice α] (m : α → M) (m0 : m ⊥ = 1) (R : M → M → Prop)
    (m_iSup : ∀ s : ℕ → α, R (m (⨆ i, s i)) (∏' i, m (s i))) (s : γ → α) (t : Finset γ) :
    R (m (⨆ d ∈ t, s d)) (∏ d ∈ t, m (s d))

(m_iSup : ∀ (s : ℕ → α), R (m (⨆ i, s i)) (∑' (i : ℕ), m (s i)))


theorem dlookup_isSome {a : α} : ∀ {l : List (Sigma β)}, (dlookup a l).isSome ↔ a ∈ l.keys

{α : Type u}
{β : α → Type v}
[DecidableEq α]
{a : α}
{l : List (Sigma β)}

(List.dlookup a l).isSome = true ↔ a ∈ l.keys


/-- The cocone on `constPUnitFunctor` with cone point `PUnit`. -/
@[simps]
def pUnitCocone : Cocone (constPUnitFunctor.{w} C)

(a : (CategoryTheory.Limits.Types.constPUnitFunctor C).obj X)

(CategoryTheory.Limits.Types.pUnitCocone C).ι.app X a = id a


theorem le_comap_of_map_le : I.map f ≤ K → I ≤ K.comap f

{R : Type u}
{S : Type v}
{F : Type u_1}
[Semiring R]
[Semiring S]
[FunLike F R S]
[rc : RingHomClass F R S]
{f : F}
{I : Ideal R}
{K : Ideal S}


theorem IsColimit.hom_ext {t : PushoutCocone f g} (ht : IsColimit t) {W : C} {k l : t.pt ⟶ W}
    (h₀ : inl t ≫ k = inl t ≫ l) (h₁ : inr t ≫ k = inr t ≫ l) : k = l

{t : CategoryTheory.Limits.PushoutCocone f g}

(ht : CategoryTheory.Limits.IsColimit t)


protected theorem AntitoneOn.Icc (hf : AntitoneOn f s) (hg : MonotoneOn g s) :
    MonotoneOn (fun x => Icc (f x) (g x)) s

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
{f g : α → β}
{s : Set α}
(hf : AntitoneOn f s)
(hg : MonotoneOn g s)

MonotoneOn (fun x => Set.Icc (f x) (g x)) s


theorem coe_algHom_ofAlgHom (f : A₁ →ₐ[R] A₂) (g : A₂ →ₐ[R] A₁) (h₁ h₂) :
    ↑(ofAlgHom f g h₁ h₂) = f

{R : Type uR}
{A₁ : Type uA₁}
{A₂ : Type uA₂}
[CommSemiring R]
[Semiring A₁]
[Semiring A₂]
[Algebra R A₁]
[Algebra R A₂]
(f : A₁ →ₐ[R] A₂)
(g : A₂ →ₐ[R] A₁)
(h₁ : f.comp g = AlgHom.id R A₂)
(h₂ : g.comp f = AlgHom.id R A₁)


@[simp]
theorem zero_fuzzy_neg_iff {x : PGame} : 0 ‖ -x ↔ 0 ‖ x

SetTheory.PGame.Fuzzy 0 (-x) ↔ SetTheory.PGame.Fuzzy 0 x


/-- Given a bifunctor `F : C₁ ⥤ C₂ ⥤ C₃` and types `I` and `J`, this is the obvious
functor `GradedObject I C₁ ⥤ GradedObject J C₂ ⥤ GradedObject (I × J) C₃`. -/
@[simps]
def mapBifunctor (I J : Type*) :
    GradedObject I C₁ ⥤ GradedObject J C₂ ⥤ GradedObject (I × J) C₃

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

∀ {X Y : CategoryTheory.GradedObject I C₁} (φ : X ⟶ Y) (Y_1 : CategoryTheory.GradedObject J C₂) (ij : I × J),
  ((CategoryTheory.GradedObject.mapBifunctor F I J).map φ).app Y_1 ij = (F.map (φ ij.1)).app (Y_1 ij.2)


/-- If Cᵒᵖ is cofiltered or empty, then C is filtered or empty. -/
lemma isFilteredOrEmpty_of_isCofilteredOrEmpty_op [IsCofilteredOrEmpty Cᵒᵖ] : IsFilteredOrEmpty C


/-- The preimage of a compact set by a proper map is again compact. See also
`isProperMap_iff_isCompact_preimage` which proves that this property completely characterizes
proper map when the codomain is compactly generated and Hausdorff. -/
lemma IsProperMap.isCompact_preimage (h : IsProperMap f) {K : Set Y} (hK : IsCompact K) :
    IsCompact (f ⁻¹' K)

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


@[simp]
theorem braiding_naturality {X₁ X₂ Y₁ Y₂ : ModuleCat.{u} R} (f : X₁ ⟶ Y₁) (g : X₂ ⟶ Y₂) :
    (f ⊗ g) ≫ (Y₁.braiding Y₂).hom = (X₁.braiding X₂).hom ≫ (g ⊗ f)

{R : Type u}
[CommRing R]
{X₁ X₂ Y₁ Y₂ : ModuleCat R}
(f : X₁ ⟶ Y₁)
(g : X₂ ⟶ Y₂)


theorem Subtype.encode_eq (a : Subtype P) : encode a = encode a.val

{α : Type u_1}
{P : α → Prop}
[encA : Encodable α]
[decP : DecidablePred P]
(a : Subtype P)

Encodable.encode a = Encodable.encode ↑a


@[simp]
theorem pointwise_smul_toSubmodule (m : R') (S : Subalgebra R A) :
    Subalgebra.toSubmodule (m • S) = m • Subalgebra.toSubmodule S

{R : Type u_1}
{A : Type u_2}
[CommSemiring R]
[Semiring A]
[Algebra R A]
{R' : Type u_3}
[Semiring R']
[MulSemiringAction R' A]
[SMulCommClass R' R A]
(m : R')
(S : Subalgebra R A)


theorem Matrix.toLin_apply (M : Matrix m n R) (v : M₁) :
    Matrix.toLin v₁ v₂ M v = ∑ j, (M *ᵥ v₁.repr v) j • v₂ j

{R : Type u_1}
[CommSemiring R]
{m : Type u_3}
{n : Type u_4}
[Fintype n]
[Fintype m]
[DecidableEq n]
{M₁ : Type u_5}
{M₂ : Type u_6}
[AddCommMonoid M₁]
[AddCommMonoid M₂]
[Module R M₁]
[Module R M₂]
(v₁ : Basis n R M₁)
(v₂ : Basis m R M₂)
(M : Matrix m n R)
(v : M₁)

((Matrix.toLin v₁ v₂) M) v = ∑ j : m, (M *ᵥ ⇑(v₁.repr v)) j • v₂ j


@[simp]
theorem blockDiagonal_pow [DecidableEq m] [Fintype o] [Fintype m] [Semiring α]
    (M : o → Matrix m m α) (n : ℕ) : blockDiagonal (M ^ n) = blockDiagonal M ^ n

{m : Type u_2}
{o : Type u_4}
{α : Type u_12}
[DecidableEq o]
[DecidableEq m]
[Fintype o]
[Fintype m]
[Semiring α]
(M : o → Matrix m m α)
(n : ℕ)

Matrix.blockDiagonal (M ^ n) = Matrix.blockDiagonal M ^ n


/-- A variant of `app_inv_app` that gives an `eqToHom` instead of `homOfLe`. -/
@[reassoc]
theorem app_inv_app' (U : Opens Y) (hU : (U : Set Y) ⊆ Set.range f.base) :
    f.c.app (op U) ≫ invApp f ((Opens.map f.base).obj U) =
      Y.presheaf.map
        (eqToHom <|
            le_antisymm (Set.image_preimage_subset f.base U.1) <|
              (Set.image_preimage_eq_inter_range (f := f.base) (t := U.1)).symm ▸
                Set.subset_inter_iff.mpr ⟨fun _ h => h, hU⟩).op

{X Y : AlgebraicGeometry.SheafedSpace C}

[H : AlgebraicGeometry.SheafedSpace.IsOpenImmersion f]

(U : TopologicalSpace.Opens ↑↑Y.toPresheafedSpace)

f.c.app (Opposite.op U) ≫
    AlgebraicGeometry.SheafedSpace.IsOpenImmersion.invApp f ((TopologicalSpace.Opens.map f.base).obj U) =
  Y.presheaf.map (CategoryTheory.eqToHom ⋯).op


theorem lipschitzWith_equiv [∀ i, PseudoEMetricSpace (β i)] :
    LipschitzWith 1 (WithLp.equiv p (∀ i, β i))

(p : ℝ≥0∞)
{ι : Type u_2}
(β : ι → Type u_4)
[Fact (1 ≤ p)]
[Fintype ι]
[(i : ι) → PseudoEMetricSpace (β i)]

LipschitzWith 1 ⇑(WithLp.equiv p ((i : ι) → β i))


/-- The ray given by a positive multiple of a nonzero vector. -/
@[simp]
theorem ray_pos_smul {v : M} (h : v ≠ 0) {r : R} (hr : 0 < r) (hrv : r • v ≠ 0) :
    rayOfNeZero R (r • v) hrv = rayOfNeZero R v h

{R : Type u_1}
[StrictOrderedCommSemiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
{v : M}
(h : v ≠ 0)
{r : R}
(hr : 0 < r)
(hrv : r • v ≠ 0)


/-- For any `s : S`, there is an `R`-linear map given by `a/b ↦ a/(b*s)`.
-/
@[simps]
def divBy (s : S) : LocalizedModule S M →ₗ[R] LocalizedModule S M

{R : Type u}
[CommSemiring R]
{S : Submonoid R}
{M : Type v}
[AddCommMonoid M]
[Module R M]
(s : ↥S)
(p : LocalizedModule S M)

(LocalizedModule.divBy s) p = p.liftOn (fun p => LocalizedModule.mk p.1 (p.2 * s)) ⋯


@[to_additive]
nonrec theorem SmoothWithinAt.mul (hf : SmoothWithinAt I' I f s x)
    (hg : SmoothWithinAt I' I g s x) : SmoothWithinAt I' I (f * g) s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{H : Type u_2}
[TopologicalSpace H]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{I : ModelWithCorners 𝕜 E H}
{G : Type u_4}
[Mul G]
[TopologicalSpace G]
[ChartedSpace H G]
[SmoothMul I G]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M : Type u_7}
[TopologicalSpace M]
[ChartedSpace H' M]
{f g : M → G}
{s : Set M}
{x : M}
(hf : SmoothWithinAt I' I f s x)
(hg : SmoothWithinAt I' I g s x)


theorem le_min_of_forall_le (l : List α) (a : α) (h : ∀ x ∈ l, a ≤ x) : a ≤ l.foldr min ⊤

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


theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ζ : B} {n : ℕ+}
    (hζ : IsPrimitiveRoot ζ n) :
    adjoin A ((cyclotomic n A).rootSet B) =
      adjoin A {b : B | ∃ a : ℕ+, a ∈ ({n} : Set ℕ+) ∧ b ^ (a : ℕ) = 1}

{A : Type u}
{B : Type v}
[CommRing A]
[CommRing B]
[Algebra A B]
[IsDomain B]
{ζ : B}
{n : ℕ+}
(hζ : IsPrimitiveRoot ζ ↑n)

Algebra.adjoin A ((Polynomial.cyclotomic (↑n) A).rootSet B) = Algebra.adjoin A {b | ∃ a ∈ {n}, b ^ ↑a = 1}


theorem lt_card_ge_iff_apply_ge_of_antitone [PartialOrder α] [DecidableRel (α := α) LE.le]
    {m : ℕ} (f : Fin m → α) (a : α) (h_sorted : Antitone f) (j : Fin m) :
    j < Fintype.card {i // a ≤ f i} ↔ a ≤ f j

{α : Type u_1}
[PartialOrder α]
[DecidableRel LE.le]
{m : ℕ}
(f : Fin m → α)
(a : α)
(h_sorted : Antitone f)
(j : Fin m)

↑j < Fintype.card { i // a ≤ f i } ↔ a ≤ f j


@[simp]
theorem mem_inf {π₁ π₂ : Prepartition I} :
    J ∈ π₁ ⊓ π₂ ↔ ∃ J₁ ∈ π₁, ∃ J₂ ∈ π₂, (J : WithBot (Box ι)) = ↑J₁ ⊓ ↑J₂

{ι : Type u_1}
{I J : BoxIntegral.Box ι}
{π₁ π₂ : BoxIntegral.Prepartition I}

J ∈ π₁ ⊓ π₂ ↔ ∃ J₁ ∈ π₁, ∃ J₂ ∈ π₂, ↑J = ↑J₁ ⊓ ↑J₂


theorem toBoolUsing_eq_true {p : Prop} (d : Decidable p) (h : p) : toBoolUsing d = true


lemma complex_exp_eq_normedSpace_exp {a : A} (ha : p a := by cfc_tac) :
    cfc Complex.exp a = exp ℂ a

{A : Type u_1}
{p : A → Prop}
[NormedRing A]
[StarRing A]
[TopologicalRing A]
[NormedAlgebra ℂ A]
[CompleteSpace A]
[ContinuousFunctionalCalculus ℂ p]
{a : A}
(ha : p a := by cfc_tac)


lemma Pi.induced_precomp [TopologicalSpace Y] {ι' : Type*} (φ : ι' → ι) :
    induced (· ∘ φ) Pi.topologicalSpace =
    ⨅ i', induced (eval (φ i')) ‹TopologicalSpace Y›

{Y : Type v}
{ι : Type u_5}
[TopologicalSpace Y]
{ι' : Type u_8}
(φ : ι' → ι)

TopologicalSpace.induced (fun x => x ∘ φ) Pi.topologicalSpace =
  ⨅ i', TopologicalSpace.induced (Function.eval (φ i')) inst✝


@[simp, norm_cast]
theorem coe_one : ↑(1 : Icc (0 : α) 1) = (1 : α)


/-- The equivalence of categories expressing left unity of products of categories.  -/
@[simps]
def leftUnitorEquivalence : Discrete (PUnit : Type w) × C ≌ C

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

(CategoryTheory.prod.leftUnitorEquivalence C).unitIso =
  CategoryTheory.Iso.refl (𝟭 (CategoryTheory.Discrete PUnit.{w + 1} × C))


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


@[reassoc (attr := simp)]
theorem cofan_inj_πSummand_eq_zero [HasZeroMorphisms C] {Δ : SimplexCategoryᵒᵖ} (A B : IndexSet Δ)
    (h : B ≠ A) : (s.cofan Δ).inj A ≫ s.πSummand B = 0

(A B : SimplicialObject.Splitting.IndexSet Δ)


@[simp]
theorem prodProdProdComm_symm : (prodProdProdComm R R' S S').symm = prodProdProdComm R S R' S'

(R : Type u_3)
(R' : Type u_4)
(S : Type u_5)
(S' : Type u_6)
[NonAssocSemiring R]
[NonAssocSemiring S]
[NonAssocSemiring R']
[NonAssocSemiring S']

(RingEquiv.prodProdProdComm R R' S S').symm = RingEquiv.prodProdProdComm R S R' S'


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

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]


theorem second_contAux_eq {gp : Pair K} (zeroth_s_eq : g.s.get? 0 = some gp) :
    g.contsAux 2 = ⟨gp.b * g.h + gp.a, gp.b⟩

{K : Type u_1}
{g : GenContFract K}
[DivisionRing K]
{gp : GenContFract.Pair K}
(zeroth_s_eq : g.s.get? 0 = some gp)

g.contsAux 2 = { a := gp.b * g.h + gp.a, b := gp.b }


@[simp]
theorem union_left_idem (s t : Finset α) : s ∪ (s ∪ t) = s ∪ t

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


theorem lift_spec [HasReverse V'] (φ : Prefunctor V V') :
    Symmetrify.of.comp (Symmetrify.lift φ) = φ

{V : Type u_2}
[Quiver V]
{V' : Type u_4}
[Quiver V']
[Quiver.HasReverse V']
(φ : V ⥤q V')

Quiver.Symmetrify.of ⋙q Quiver.Symmetrify.lift φ = φ


theorem proj_symm_apply {x : B × F} (hx : x ∈ e.target) : proj (e.toPartialEquiv.symm x) = x.1

{B : Type u_2}
{F : Type u_3}
{Z : Type u_5}
[TopologicalSpace B]
[TopologicalSpace F]
{proj : Z → B}
(e : Pretrivialization F proj)
{x : B × F}
(hx : x ∈ e.target)


/-- Bijective affine maps are affine isomorphisms. -/
@[simps! linear apply]
noncomputable def ofBijective {φ : P₁ →ᵃ[k] P₂} (hφ : Function.Bijective φ) : P₁ ≃ᵃ[k] P₂

{k : Type u_1}
{P₁ : Type u_2}
{P₂ : Type u_3}
{V₁ : Type u_6}
{V₂ : Type u_7}
[Ring k]
[AddCommGroup V₁]
[Module k V₁]
[AffineSpace V₁ P₁]
[AddCommGroup V₂]
[Module k V₂]
[AffineSpace V₂ P₂]
{φ : P₁ →ᵃ[k] P₂}
(hφ : Function.Bijective ⇑φ)
(a : P₁)


@[simp]
theorem decompose_mul (x y : A) : decompose 𝒜 (x * y) = decompose 𝒜 x * decompose 𝒜 y

{ι : Type u_1}
{A : Type u_3}
{σ : Type u_4}
[DecidableEq ι]
[AddMonoid ι]
[Semiring A]
[SetLike σ A]
[AddSubmonoidClass σ A]
(𝒜 : ι → σ)
[GradedRing 𝒜]
(x y : A)

(DirectSum.decompose 𝒜) (x * y) = (DirectSum.decompose 𝒜) x * (DirectSum.decompose 𝒜) y


theorem differentiableOn_compl_singleton_and_continuousAt_iff {f : ℂ → E} {s : Set ℂ} {c : ℂ}
    (hs : s ∈ 𝓝 c) :
    DifferentiableOn ℂ f (s \ {c}) ∧ ContinuousAt f c ↔ DifferentiableOn ℂ f s

{E : Type u}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
[CompleteSpace E]
{f : ℂ → E}
{s : Set ℂ}
{c : ℂ}
(hs : s ∈ 𝓝 c)


@[reassoc (attr := simp)]
theorem biproduct.ι_map {f g : J → C} [HasBiproduct f] [HasBiproduct g] (p : ∀ j, f j ⟶ g j)
    (j : J) : biproduct.ι f j ≫ biproduct.map p = p j ≫ biproduct.ι g j

CategoryTheory.Limits.biproduct.ι f j ≫ CategoryTheory.Limits.biproduct.map p =
  p j ≫ CategoryTheory.Limits.biproduct.ι g j


@[simp]
theorem card_toMultiset (s : Cycle α) : Multiset.card s.toMultiset = s.length


/-- The isomorphism between the short complex attached to
two isomorphic distinguished triangles. -/
@[simps!]
def shortComplexOfDistTriangleIsoOfIso {T T' : Triangle C} (e : T ≅ T') (hT : T ∈ distTriang C) :
    shortComplexOfDistTriangle T hT ≅ shortComplexOfDistTriangle T'
      (isomorphic_distinguished _ hT _ e.symm)

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

{T T' : CategoryTheory.Pretriangulated.Triangle C}

(hT : T ∈ CategoryTheory.Pretriangulated.distinguishedTriangles)

(CategoryTheory.Pretriangulated.shortComplexOfDistTriangleIsoOfIso e hT).inv.τ₂ = e.inv.hom₂


/-- A bi-Heyting algebra is a Heyting algebra that is also a co-Heyting algebra. -/
class BiheytingAlgebra (α : Type*) extends HeytingAlgebra α, SDiff α, HNot α where
  /-- `\ a` is right adjoint to `⊔ a` -/
  sdiff_le_iff (a b c : α) : a \ b ≤ c ↔ a ≤ b ⊔ c
  /-- `⊤ \ a` is `￢a` -/
  top_sdiff (a : α) : ⊤ \ a = ￢a

{α : Type u_4}
[self : BiheytingAlgebra α]
(a : α)


theorem isRotated_iff_mem_map_range : l ~r l' ↔ l' ∈ (List.range (l.length + 1)).map l.rotate

l ~r l' ↔ l' ∈ List.map l.rotate (List.range (l.length + 1))


theorem isOpenMap_prod_of_discrete_left [DiscreteTopology α] {f : α × β → γ} :
    IsOpenMap f ↔ ∀ a, IsOpenMap (f ⟨a, ·⟩)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[TopologicalSpace α]
[TopologicalSpace β]
[TopologicalSpace γ]
[DiscreteTopology α]
{f : α × β → γ}

IsOpenMap f ↔ ∀ (a : α), IsOpenMap fun x => f (a, x)


theorem eq_zero_of_out_empty (o : Ordinal) [h : IsEmpty o.out.α] : o = 0

(o : Ordinal.{u_3})
[h : IsEmpty (Quotient.out o).α]


/-- In a σ-compact space, `univ` is σ-compact. -/
lemma isSigmaCompact_univ [h : SigmaCompactSpace X] : IsSigmaCompact (univ : Set X)

{X : Type u_1}
[TopologicalSpace X]
[h : SigmaCompactSpace X]


theorem List.smul_prod {r : α} {l : List β} : r • l.prod = (l.map (r • ·)).prod

{α : Type u_1}
{β : Type u_2}
[Monoid α]
[Monoid β]
[MulDistribMulAction α β]
{r : α}
{l : List β}

r • l.prod = (List.map (fun x => r • x) l).prod


@[simp, norm_cast]
theorem coe_comp (h : M₂ →SL[σ₂₃] M₃) (f : M₁ →SL[σ₁₂] M₂) :
    (h.comp f : M₁ →ₛₗ[σ₁₃] M₃) = (h : M₂ →ₛₗ[σ₂₃] M₃).comp (f : M₁ →ₛₗ[σ₁₂] M₂)

{R₁ : Type u_1}
{R₂ : Type u_2}
{R₃ : Type u_3}
[Semiring R₁]
[Semiring R₂]
[Semiring R₃]
{σ₁₂ : R₁ →+* R₂}
{σ₂₃ : R₂ →+* R₃}
{σ₁₃ : R₁ →+* R₃}
{M₁ : Type u_4}
[TopologicalSpace M₁]
[AddCommMonoid M₁]
{M₂ : Type u_6}
[TopologicalSpace M₂]
[AddCommMonoid M₂]
{M₃ : Type u_7}
[TopologicalSpace M₃]
[AddCommMonoid M₃]
[Module R₁ M₁]
[Module R₂ M₂]
[Module R₃ M₃]
[RingHomCompTriple σ₁₂ σ₂₃ σ₁₃]
(h : M₂ →SL[σ₂₃] M₃)
(f : M₁ →SL[σ₁₂] M₂)


/-- Given `f(A) = f(B)`, `ker f ≤ A`, and `ker f ≤ B`, deduce that `A = B`. -/
@[to_additive "Given `f(A) = f(B)`, `ker f ≤ A`, and `ker f ≤ B`, deduce that `A = B`."]
theorem map_injective_of_ker_le {H K : Subgroup G} (hH : f.ker ≤ H) (hK : f.ker ≤ K)
    (hf : map f H = map f K) : H = K

(hf : AddSubgroup.map f H = AddSubgroup.map f K)


/-- The same-universe version of `Field.lift_sepDegree_mul_lift_sepDegree_of_isAlgebraic`. -/
theorem sepDegree_mul_sepDegree_of_isAlgebraic (K : Type v) [Field K] [Algebra F K]
    [Algebra E K] [IsScalarTower F E K] [Algebra.IsAlgebraic F E] :
    sepDegree F E * sepDegree E K = sepDegree F K

(F : Type u)
(E : Type v)
[Field F]
[Field E]
[Algebra F E]
(K : Type v)
[Field K]
[Algebra F K]
[Algebra E K]
[IsScalarTower F E K]
[Algebra.IsAlgebraic F E]

Field.sepDegree F E * Field.sepDegree E K = Field.sepDegree F K


theorem val_ne_iff {a b : Fin n} : a.1 ≠ b.1 ↔ a ≠ b

↑a ≠ ↑b ↔ a ≠ b


theorem inversion_def :
    inversion = fun (c : P) (R : ℝ) (x : P) => (R / dist x c) ^ 2 • (x -ᵥ c) +ᵥ c

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]

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


@[to_additive]
theorem rangeRestrict_surjective (f : G →* N) : Function.Surjective f.rangeRestrict

{G : Type u_1}
[Group G]
{N : Type u_5}
[Group N]
(f : G →* N)


theorem _root_.Set.Countable.isSeparable {s : Set α} (hs : s.Countable) : IsSeparable s

{α : Type u}
[t : TopologicalSpace α]
{s : Set α}
(hs : s.Countable)


lemma ofGrothendieck_iff {X : C} {S : Presieve X} (J : GrothendieckTopology C) :
    S ∈ ofGrothendieck _ J X ↔ Sieve.generate S ∈ J X

(J : CategoryTheory.GrothendieckTopology C)

S ∈ (CategoryTheory.Coverage.ofGrothendieck C J).covering X ↔ CategoryTheory.Sieve.generate S ∈ J.sieves X


theorem sdiff_sdiff_sup_sdiff : z \ (x \ y ⊔ y \ x) = z ⊓ (z \ x ⊔ y) ⊓ (z \ y ⊔ x)

{α : Type u}
{x y z : α}
[GeneralizedBooleanAlgebra α]


@[simp]
theorem contMDiffWithinAt_transDiffeomorph_right {f : M' → M} {x s} :
    ContMDiffWithinAt I' (I.transDiffeomorph e) n f s x ↔ ContMDiffWithinAt I' I n f s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{E' : Type u_3}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{F : Type u_4}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{H : Type u_5}
[TopologicalSpace H]
{H' : Type u_6}
[TopologicalSpace H']
{I : ModelWithCorners 𝕜 E H}
{I' : ModelWithCorners 𝕜 E' H'}
{M : Type u_9}
[TopologicalSpace M]
[ChartedSpace H M]
{M' : Type u_10}
[TopologicalSpace M']
[ChartedSpace H' M']
{n : ℕ∞}
(e : E ≃ₘ⟮𝓘(𝕜, E), 𝓘(𝕜, F)⟯ F)
{f : M' → M}
{x : M'}
{s : Set M'}


theorem valuation_lt_one_or_eq_one (a : A) : A.valuation a < 1 ∨ A.valuation a = 1

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


theorem IsExtrOn.isLocalExtr (hf : IsExtrOn f s a) (hs : s ∈ 𝓝 a) : IsLocalExtr f a

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[Preorder β]
{f : α → β}
{s : Set α}
{a : α}
(hf : IsExtrOn f s a)
(hs : s ∈ 𝓝 a)


/-- A commuting square of isomorphisms induces an isomorphism of cokernels. -/
@[simps]
def cokernel.mapIso {X' Y' : C} (f' : X' ⟶ Y') [HasCokernel f'] (p : X ≅ X') (q : Y ≅ Y')
    (w : f ≫ q.hom = p.hom ≫ f') : cokernel f ≅ cokernel f'

(CategoryTheory.Limits.cokernel.mapIso f f' p q w).hom = CategoryTheory.Limits.cokernel.map f f' p.hom q.hom w


/-- A set is a neighborhood of `a` within `(a, +∞)` if and only if it contains an interval `(a, u)`
with `a < u < u'`, provided `a` is not a top element. -/
theorem mem_nhdsWithin_Ioi_iff_exists_Ioo_subset' {a u' : α} {s : Set α} (hu' : a < u') :
    s ∈ 𝓝[>] a ↔ ∃ u ∈ Ioi a, Ioo a u ⊆ s

{α : Type u_1}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
{a u' : α}
{s : Set α}
(hu' : a < u')

s ∈ 𝓝[>] a ↔ ∃ u ∈ Set.Ioi a, Set.Ioo a u ⊆ s


theorem univ_finite_iff_nonempty_fintype : (univ : Set α).Finite ↔ Nonempty (Fintype α)


theorem image_subset_image {s₁ s₂ : Finset α} (h : s₁ ⊆ s₂) : s₁.image f ⊆ s₂.image f

{α : Type u_1}
{β : Type u_2}
[DecidableEq β]
{f : α → β}
{s₁ s₂ : Finset α}
(h : s₁ ⊆ s₂)


/-- Inversion on a group is a `MulEquiv` to the opposite group. When `G` is commutative, there is
`MulEquiv.inv`. -/
@[to_additive (attr := simps! (config := { fullyApplied := false, simpRhs := true }))
      "Negation on an additive group is an `AddEquiv` to the opposite group. When `G`
      is commutative, there is `AddEquiv.inv`."]
def MulEquiv.inv' (G : Type*) [DivisionMonoid G] : G ≃* Gᵐᵒᵖ

⇑(AddEquiv.neg' G) = AddOpposite.op ∘ Neg.neg


theorem Quotient.mkₐ_toRingHom (I : Ideal A) :
    (Quotient.mkₐ R₁ I).toRingHom = Ideal.Quotient.mk I

(R₁ : Type u_1)
{A : Type u_3}
[CommSemiring R₁]
[CommRing A]
[Algebra R₁ A]
(I : Ideal A)

(Ideal.Quotient.mkₐ R₁ I).toRingHom = Ideal.Quotient.mk I


theorem h_apply_fromCoset_nin_range (x : B) (hx : x ∈ f.range) (b : B) (hb : b ∉ f.range) :
    h x (fromCoset ⟨b • f.range, b, rfl⟩) = fromCoset ⟨(x * b) • ↑f.range, x * b, rfl⟩

{A B : Grp}
(f : A ⟶ B)
(x : ↑B)
(hx : x ∈ MonoidHom.range f)
(b : ↑B)
(hb : b ∉ MonoidHom.range f)

((Grp.SurjectiveOfEpiAuxs.h f) x) (Grp.SurjectiveOfEpiAuxs.XWithInfinity.fromCoset ⟨b • ↑(MonoidHom.range f), ⋯⟩) =
  Grp.SurjectiveOfEpiAuxs.XWithInfinity.fromCoset ⟨(x * b) • ↑(MonoidHom.range f), ⋯⟩


theorem disjoint_pure_atTop [Preorder α] [NoMaxOrder α] (x : α) : Disjoint (pure x) atTop

{α : Type u_3}
[Preorder α]
[NoMaxOrder α]
(x : α)


nonrec theorem ContMDiffAt.prod_mk {f : M → M'} {g : M → N'} (hf : ContMDiffAt I I' n f x)
    (hg : ContMDiffAt I J' n g x) : ContMDiffAt I (I'.prod J') n (fun x => (f x, g x)) x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M' : Type u_7}
[TopologicalSpace M']
[ChartedSpace H' M']
{F' : Type u_14}
[NormedAddCommGroup F']
[NormedSpace 𝕜 F']
{G' : Type u_15}
[TopologicalSpace G']
{J' : ModelWithCorners 𝕜 F' G'}
{N' : Type u_16}
[TopologicalSpace N']
[ChartedSpace G' N']
{x : M}
{n : ℕ∞}
{f : M → M'}
{g : M → N'}
(hf : ContMDiffAt I I' n f x)
(hg : ContMDiffAt I J' n g x)


theorem union_sdiff_self (s t : Finset α) : (s ∪ t) \ t = s \ t

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


theorem IsMinOn.max (hf : IsMinOn f s a) (hg : IsMinOn g s a) :
    IsMinOn (fun x => max (f x) (g x)) s a

{α : Type u}
{β : Type v}
[LinearOrder β]
{f g : α → β}
{a : α}
{s : Set α}
(hf : IsMinOn f s a)
(hg : IsMinOn g s a)


theorem disjoint_iff [∀ i, OrderBot (α' i)] {f g : ∀ i, α' i} :
    Disjoint f g ↔ ∀ i, Disjoint (f i) (g i)

{ι : Type u_1}
{α' : ι → Type u_2}
[(i : ι) → PartialOrder (α' i)]
[(i : ι) → OrderBot (α' i)]
{f g : (i : ι) → α' i}

Disjoint f g ↔ ∀ (i : ι), Disjoint (f i) (g i)


@[simp]
theorem refl_symm : (refl : L₁ ≃ₗ⁅R⁆ L₁).symm = refl

{R : Type u}
{L₁ : Type v}
[CommRing R]
[LieRing L₁]
[LieAlgebra R L₁]


@[simp, norm_cast]
theorem coe_lt_coe {a b : Regular α} : (a : α) < b ↔ a < b

{α : Type u_1}
[HeytingAlgebra α]
{a b : Heyting.Regular α}


theorem Iic_union_Icc (h : min c d ≤ b) : Iic b ∪ Icc c d = Iic (max b d)

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

Set.Iic b ∪ Set.Icc c d = Set.Iic (max b d)


@[simp]
theorem coe_copy (f : BoundedLatticeHom α β) (f' : α → β) (h : f' = f) : ⇑(f.copy f' h) = f'

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


theorem iUnion_Iio_eq_univ_iff : ⋃ i, Iio (f i) = univ ↔ (¬ BddAbove (range f))

{ι : Sort u}
{α : Type v}
[LinearOrder α]
{f : ι → α}

⋃ i, Set.Iio (f i) = Set.univ ↔ ¬BddAbove (Set.range f)


lemma infClosure_idem (s : Set α) : infClosure (infClosure s) = infClosure s

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


@[simp]
theorem Cofork.ofCocone_ι {F : WalkingParallelPair ⥤ C} (t : Cocone F) (j) :
    (Cofork.ofCocone t).ι.app j = eqToHom (by aesop) ≫ t.ι.app j

{F : CategoryTheory.Functor CategoryTheory.Limits.WalkingParallelPair C}

(CategoryTheory.Limits.Cofork.ofCocone t).ι.app j =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.eqToHom ⋯) (t.ι.app j)


@[to_additive (attr := simp, to_additive) (reorder := 1 2, 4 5) ofDual_smul]
theorem ofDual_pow [Pow α β] (a : αᵒᵈ) (b : β) : ofDual (a ^ b) = ofDual a ^ b

{β : Type u_2}
{α : Type u_1}
[SMul β α]
(b : β)
(a : αᵒᵈ)

OrderDual.ofDual (b • a) = b • OrderDual.ofDual a


theorem rightUnitor_naturality {M N : ModuleCat R} (f : M ⟶ N) :
    tensorHom f (𝟙 (ModuleCat.of R R)) ≫ (rightUnitor N).hom = (rightUnitor M).hom ≫ f

{R : Type u}
[CommRing R]
{M N : ModuleCat R}
(f : M ⟶ N)

ModuleCat.MonoidalCategory.tensorHom f (𝟙 (ModuleCat.of R R)) ≫ (ModuleCat.MonoidalCategory.rightUnitor N).hom =
  (ModuleCat.MonoidalCategory.rightUnitor M).hom ≫ f


theorem filter_mem_image_eq_image (f : α → β) (s : Finset α) (t : Finset β) (h : ∀ x ∈ s, f x ∈ t) :
    (t.filter fun y => y ∈ s.image f) = s.image f

{α : Type u_1}
{β : Type u_2}
[DecidableEq β]
(f : α → β)
(s : Finset α)
(t : Finset β)
(h : ∀ x ∈ s, f x ∈ t)

Finset.filter (fun y => y ∈ Finset.image f s) t = Finset.image f s


@[simp]
theorem coe_toRelHom {f : r ↪r s} : ((f : r ↪r s).toRelHom : α → β) = f

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


/-- The product map gives a homomorphism from the additive monoid
of multisets to the multiplicative monoid ℕ+. -/
theorem prod_zero : (0 : PrimeMultiset).prod = 1


/-- If `f₀, f₁, f₂, ...` and `g₀, g₁, g₂, ...` have products `a`, `b` respectively, then
the `ℤ`-indexed sequence: `..., g₂, g₁, g₀, f₀, f₁, f₂, ...` (with `f₀` at the `0`-th position) has
product `a + b`. -/
@[to_additive "If `f₀, f₁, f₂, ...` and `g₀, g₁, g₂, ...` have sums `a`, `b` respectively, then
the `ℤ`-indexed sequence: `..., g₂, g₁, g₀, f₀, f₁, f₂, ...` (with `f₀` at the `0`-th position) has
sum `a + b`."]
lemma HasProd.int_rec {f g : ℕ → M} (hf : HasProd f m) (hg : HasProd g m') :
    HasProd (Int.rec f g) (m * m')

{M : Type u_1}
[AddCommMonoid M]
[TopologicalSpace M]
{m m' : M}
[ContinuousAdd M]
{f g : ℕ → M}
(hf : HasSum f m)
(hg : HasSum g m')

HasSum (fun t => Int.rec f g t) (m + m')


@[continuity, fun_prop]
theorem Continuous.sqrt (h : Continuous f) : Continuous fun x => √(f x)

{α : Type u_1}
[TopologicalSpace α]
{f : α → ℝ}
(h : Continuous f)


@[deprecated measure_empty (since := "2024-05-14")]
theorem empty' (m : OuterMeasure α) : m ∅ = 0

{α : Type u_1}
(m : MeasureTheory.OuterMeasure α)


@[simp]
theorem Int.comap_cast_atBot [StrictOrderedRing R] [Archimedean R] :
    comap ((↑) : ℤ → R) atBot = atBot

{R : Type u_2}
[StrictOrderedRing R]
[Archimedean R]

Filter.comap Int.cast Filter.atBot = Filter.atBot


theorem eval_πs {l : Products I} {o : Ordinal} (hlt : ∀ i ∈ l.val, ord I i < o) :
    πs C o (l.eval (π C (ord I · < o))) = l.eval C

{l : Profinite.NobelingProof.Products I}

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

(Profinite.NobelingProof.πs C o)
    (Profinite.NobelingProof.Products.eval (Profinite.NobelingProof.π C fun x => Profinite.NobelingProof.ord I x < o)
      l) =
  Profinite.NobelingProof.Products.eval C l


/-- Reinterpret an order isomorphism as a morphism of complete lattices. -/
@[simps] def OrderIso.toCompleteLatticeHom [CompleteLattice α] [CompleteLattice β]
    (f : OrderIso α β) : CompleteLatticeHom α β

{α : Type u_2}
{β : Type u_3}
[CompleteLattice α]
[CompleteLattice β]
(f : α ≃o β)
(a : α)


@[to_additive] lemma ne_iff_ne_of_mul_eq_mul (h : a * b = c * d) : a ≠ c ↔ b ≠ d

{α : Type u_1}
[CancelCommMonoid α]
{a b c d : α}
(h : a * b = c * d)


theorem coe_comp_sup_hom (f : LatticeHom β γ) (g : LatticeHom α β) :
    (f.comp g : SupHom α γ) = (f : SupHom β γ).comp g

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

{ toFun := ⇑(f.comp g), map_sup' := ⋯ } = { toFun := ⇑f, map_sup' := ⋯ }.comp { toFun := ⇑g, map_sup' := ⋯ }


/-- The equivalence between the category of elements `F.Elements`
    and the comma category `(*, F)`. -/
@[simps! functor_obj functor_map inverse_obj inverse_map unitIso_hom
  unitIso_inv counitIso_hom counitIso_inv]
def structuredArrowEquivalence : F.Elements ≌ StructuredArrow PUnit F

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

(CategoryTheory.CategoryOfElements.structuredArrowEquivalence F).unitIso.hom =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.NatIso.ofComponents (fun X => CategoryTheory.Iso.refl X) ⋯).hom
    (CategoryTheory.CategoryStruct.comp
      (CategoryTheory.whiskerLeft (CategoryTheory.CategoryOfElements.toStructuredArrow F)
        (CategoryTheory.CategoryOfElements.fromStructuredArrow F).leftUnitor.inv)
      (CategoryTheory.CategoryStruct.comp
        (CategoryTheory.whiskerLeft (CategoryTheory.CategoryOfElements.toStructuredArrow F)
          (CategoryTheory.whiskerRight
            (CategoryTheory.NatIso.ofComponents
                (fun X => CategoryTheory.StructuredArrow.isoMk (CategoryTheory.Iso.refl X.right) ⋯) ⋯).inv
            (CategoryTheory.CategoryOfElements.fromStructuredArrow F)))
        (CategoryTheory.CategoryStruct.comp
          (CategoryTheory.whiskerLeft (CategoryTheory.CategoryOfElements.toStructuredArrow F)
            ((CategoryTheory.CategoryOfElements.fromStructuredArrow F).associator
                (CategoryTheory.CategoryOfElements.toStructuredArrow F)
                (CategoryTheory.CategoryOfElements.fromStructuredArrow F)).hom)
          (CategoryTheory.CategoryStruct.comp
            ((CategoryTheory.CategoryOfElements.toStructuredArrow F).associator
                (CategoryTheory.CategoryOfElements.fromStructuredArrow F)
                ((CategoryTheory.CategoryOfElements.toStructuredArrow F).comp
                  (CategoryTheory.CategoryOfElements.fromStructuredArrow F))).inv
            (CategoryTheory.CategoryStruct.comp
              (CategoryTheory.whiskerRight
                (CategoryTheory.NatIso.ofComponents (fun X => CategoryTheory.Iso.refl X) ⋯).inv
                ((CategoryTheory.CategoryOfElements.toStructuredArrow F).comp
                  (CategoryTheory.CategoryOfElements.fromStructuredArrow F)))
              ((CategoryTheory.CategoryOfElements.toStructuredArrow F).comp
                    (CategoryTheory.CategoryOfElements.fromStructuredArrow F)).leftUnitor.hom)))))


theorem eq_zero_of_one_div_eq_zero {a : G₀} (h : 1 / a = 0) : a = 0

{G₀ : Type u_3}
[GroupWithZero G₀]
{a : G₀}
(h : 1 / a = 0)


@[to_additive (attr := simp)]
theorem snd_inv [Inv G] [Inv H] (p : G × H) : p⁻¹.2 = p.2⁻¹

{G : Type u_3}
{H : Type u_4}
[Neg G]
[Neg H]
(p : G × H)


@[simp]
lemma add_inv_add_mul_eq_zero (u : (PreQuasiregular R)ˣ) :
    u.val.val + u⁻¹.val.val + u⁻¹.val.val * u.val.val = 0

{R : Type u_1}
[NonUnitalSemiring R]
(u : (PreQuasiregular R)ˣ)

(↑u).val + (↑u⁻¹).val + (↑u⁻¹).val * (↑u).val = 0


@[simp] theorem getLastD_concat (a b l) : @getLastD α (l ++ [b]) a = b


lemma erase_le_erase (ha : a ∈ s) (hb : b ∈ s) :
    toColex (s.erase a) ≤ toColex (s.erase b) ↔ b ≤ a

{α : Type u_1}
[PartialOrder α]
{s : Finset α}
{a b : α}
[DecidableEq α]
(ha : a ∈ s)
(hb : b ∈ s)

{ ofColex := s.erase a } ≤ { ofColex := s.erase b } ↔ b ≤ a


/-- Isomorphism obtained by separating the term of index `none` of a direct sum over `Option ι`. -/
@[simps!]
noncomputable def addEquivProdDirectSum : (⨁ i, α i) ≃+ α none × ⨁ i, α (some i)

(f : (fun i => α i) none × Π₀ (i : ι), (fun i => α i) (some i))

(DirectSum.addEquivProdDirectSum.symm f).support' = Trunc.map (fun s => ⟨none ::ₘ Multiset.map some ↑s, ⋯⟩) f.2.support'


/-- If `x` is a letter and `w` is a word such that `xw` reduces to the empty word, then `w` reduces
to `x⁻¹` -/
@[to_additive
  "If `x` is a letter and `w` is a word such that `x + w` reduces to the empty word, then `w`
  reduces to `-x`."]
theorem cons_nil_iff_singleton {x b} : Red ((x, b) :: L) [] ↔ Red L [(x, not b)]

{α : Type u}
{L : List (α × Bool)}
{x : α}
{b : Bool}

FreeGroup.Red ((x, b) :: L) [] ↔ FreeGroup.Red L [(x, !b)]


@[to_additive (attr := simp)]
lemma inf'_inv [SemilatticeInf β] {s : Finset α} (hs : s⁻¹.Nonempty) (f : α → β) :
    inf' s⁻¹ hs f = inf' s hs.of_inv (f ·⁻¹)

{α : Type u_2}
{β : Type u_3}
[DecidableEq α]
[Inv α]
[SemilatticeInf β]
{s : Finset α}
(hs : s⁻¹.Nonempty)
(f : α → β)


theorem sublists_cons (a : α) (l : List α) :
    sublists (a :: l) = sublists l >>= (fun x => [x, a :: x])

(a :: l).sublists = do
  let x ← l.sublists
  [x, a :: x]


/-- Equivalence between linear maps `M₂ →ₗ[R] M₃` and one-multilinear maps. -/
@[simps]
def ofSubsingleton [Subsingleton ι] (i : ι) :
    (M₂ →ₗ[R] M₃) ≃ MultilinearMap R (fun _ : ι ↦ M₂) M₃

(R : Type uR)
{ι : Type uι}
(M₂ : Type v₂)
(M₃ : Type v₃)
[Semiring R]
[AddCommMonoid M₂]
[AddCommMonoid M₃]
[Module R M₂]
[Module R M₃]
[Subsingleton ι]
(i : ι)
(f : M₂ →ₗ[R] M₃)
(x : ι → M₂)

((MultilinearMap.ofSubsingleton R M₂ M₃ i) f) x = f (x i)


lemma ker_restrict_eq_of_codisjoint {p q : Submodule R M} (hpq : Codisjoint p q)
    {B : LinearMap.BilinForm R M} (hB : ∀ x ∈ p, ∀ y ∈ q, B x y = 0) :
    LinearMap.ker (B.restrict p) = (LinearMap.ker B).comap p.subtype

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
{p q : Submodule R M}
(hpq : Codisjoint p q)
{B : LinearMap.BilinForm R M}
(hB : ∀ x ∈ p, ∀ y ∈ q, (B x) y = 0)

LinearMap.ker (B.restrict p) = Submodule.comap p.subtype (LinearMap.ker B)


@[to_additive]
theorem Filter.HasBasis.uniformity_of_nhds_one_inv_mul_swapped {ι} {p : ι → Prop} {U : ι → Set α}
    (h : (𝓝 (1 : α)).HasBasis p U) :
    (𝓤 α).HasBasis p fun i => { x : α × α | x.2⁻¹ * x.1 ∈ U i }

{α : Type u_1}
[UniformSpace α]
[Group α]
[UniformGroup α]
{ι : Sort u_3}
{p : ι → Prop}
{U : ι → Set α}
(h : (𝓝 1).HasBasis p U)

(𝓤 α).HasBasis p fun i => {x | x.2⁻¹ * x.1 ∈ U i}


@[simp]
theorem isAlt_zero : (0 : BilinForm R M).IsAlt

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


theorem hom_eq_desc (g : widePushout _ _ arrows ⟶ X) :
    g =
      desc (head arrows ≫ g) (fun j => ι arrows j ≫ g) fun j => by
        rw [← Category.assoc]
        simp

[CategoryTheory.Limits.HasWidePushout B objs arrows]

(g : CategoryTheory.Limits.widePushout B objs arrows ⟶ X)

g =
  CategoryTheory.Limits.WidePushout.desc (CategoryTheory.Limits.WidePushout.head arrows ≫ g)
    (fun j => CategoryTheory.Limits.WidePushout.ι arrows j ≫ g) ⋯


protected theorem dvd_trans {a b c : Nat} (h₁ : a ∣ b) (h₂ : b ∣ c) : a ∣ c


@[simp]
theorem cospanExt_app_one : (cospanExt iX iY iZ wf wg).app WalkingCospan.one = iZ

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

(CategoryTheory.Limits.cospanExt iX iY iZ wf wg).app CategoryTheory.Limits.WalkingCospan.one = iZ


(G : Type u)
[Group G]
(F : Type v)
[Field F]
[MulSemiringAction G F]
[Fintype G]
(x : F)


protected theorem sub_mem : x ∈ p → y ∈ p → x - y ∈ p

{R : Type u}
{M : Type v}
[Ring R]
[AddCommGroup M]
{module_M : Module R M}
(p : Submodule R M)
{x y : M}


lemma cosKernel_def (a x : ℝ) : ↑(cosKernel ↑a x) = jacobiTheta₂ a (I * x)

↑(HurwitzZeta.cosKernel (↑a) x) = jacobiTheta₂ (↑a) (Complex.I * ↑x)


/-- Every exponent in the Cantor normal form `CNF b o` is less or equal to `log b o`. -/
theorem CNF_fst_le_log {b o : Ordinal.{u}} {x : Ordinal × Ordinal} :
    x ∈ CNF b o → x.1 ≤ log b o

{b o : Ordinal.{u}}
{x : Ordinal.{u} × Ordinal.{u}}

x ∈ Ordinal.CNF b o → x.1 ≤ Ordinal.log b o


theorem lt_congr {x₁ y₁ x₂ y₂ : PGame} (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ < y₁ ↔ x₂ < y₂

{x₁ y₁ x₂ y₂ : SetTheory.PGame}
(hx : x₁ ≈ x₂)
(hy : y₁ ≈ y₂)


protected theorem sub_eq_zero_of_eq {a b : Int} (h : a = b) : a - b = 0


/-- A class asserting the existence of a left adjoint. -/
class IsRightAdjoint (right : D ⥤ C) : Prop where
  exists_leftAdjoint : ∃ (left : C ⥤ D), Nonempty (left ⊣ right)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{right : CategoryTheory.Functor D C}
[self : right.IsRightAdjoint]


theorem forall_iff_forall_finsupp (P : R[X] → Prop) :
    (∀ p, P p) ↔ ∀ q : R[ℕ], P ⟨q⟩

{R : Type u}
[Semiring R]
(P : R[X] → Prop)

(∀ (p : R[X]), P p) ↔ ∀ (q : R[ℕ]), P { toFinsupp := q }


(α : Type u_1)
[Preorder α]
[TopologicalSpace α]
[Topology.IsScott α]


theorem liftRel_map {δ} (R : α → β → Prop) (S : γ → δ → Prop) {s1 : WSeq α} {s2 : WSeq β}
    {f1 : α → γ} {f2 : β → δ} (h1 : LiftRel R s1 s2) (h2 : ∀ {a b}, R a b → S (f1 a) (f2 b)) :
    LiftRel S (map f1 s1) (map f2 s2)

Stream'.WSeq.LiftRel S (Stream'.WSeq.map f1 s1) (Stream'.WSeq.map f2 s2)


/-- **Intermediate Value Theorem** for continuous functions on connected sets. -/
theorem IsPreconnected.intermediate_value {s : Set X} (hs : IsPreconnected s) {a b : X} (ha : a ∈ s)
    (hb : b ∈ s) {f : X → α} (hf : ContinuousOn f s) : Icc (f a) (f b) ⊆ f '' s

{X : Type u}
{α : Type v}
[TopologicalSpace X]
[LinearOrder α]
[TopologicalSpace α]
[OrderClosedTopology α]
{s : Set X}
(hs : IsPreconnected s)
{a b : X}
(ha : a ∈ s)
(hb : b ∈ s)
{f : X → α}
(hf : ContinuousOn f s)


theorem mk_symm (e : Trivialization F (π F E)) {b : B} (hb : b ∈ e.baseSet) (y : F) :
    TotalSpace.mk b (e.symm b y) = e.toPartialHomeomorph.symm (b, y)

[TopologicalSpace (Bundle.TotalSpace F E)]

(e : Trivialization F Bundle.TotalSpace.proj)

{ proj := b, snd := e.symm b y } = ↑e.symm (b, y)


@[to_additive (attr := aesop safe -100 (rule_sets := [Continuous]), fun_prop)]
theorem Continuous.pow {f : X → M} (h : Continuous f) (n : ℕ) : Continuous fun b => f b ^ n

{M : Type u_3}
{X : Type u_5}
[TopologicalSpace X]
[TopologicalSpace M]
[Monoid M]
[ContinuousMul M]
{f : X → M}
(h : Continuous f)
(n : ℕ)


lemma superset_of_eq [IsRefl α (· ⊆ ·)] : a = b → b ⊆ a

{α : Type u}
[HasSubset α]
{a b : α}
[IsRefl α fun x x_1 => x ⊆ x_1]


/-- Prefunctors between two `SingleObj` quivers correspond to functions between the corresponding
arrows types.
-/
@[simps]
def toPrefunctor : (α → β) ≃ SingleObj α ⥤q SingleObj β

{α : Type u_1}
{β : Type u_2}
(f : α → β)
(a : Quiver.SingleObj α)

(Quiver.SingleObj.toPrefunctor f).obj a = id a


@[simp]
theorem polyEquivTensor_symm_apply_tmul (a : A) (p : R[X]) :
    (polyEquivTensor R A).symm (a ⊗ₜ p) = p.sum fun n r => monomial n (a * algebraMap R A r)

(R : Type u_1)
(A : Type u_2)
[CommSemiring R]
[Semiring A]
[Algebra R A]
(a : A)
(p : R[X])

(polyEquivTensor R A).symm (a ⊗ₜ[R] p) = p.sum fun n r => (Polynomial.monomial n) (a * (algebraMap R A) r)


lemma ev_symm (γ : OneCocycle G U) (i j : I) ⦃T : C⦄ (a : T ⟶ U i) (b : T ⟶ U j) :
    γ.ev i j a b = (γ.ev j i b a)⁻¹

(γ : CategoryTheory.PresheafOfGroups.OneCocycle G U)


lemma ShortExact.unop {S : ShortComplex Cᵒᵖ} (h : S.ShortExact) : S.unop.ShortExact


theorem ext_iff {inst₁ inst₂ : NonUnitalNonAssocCommRing R} :
    inst₁ = inst₂ ↔
      (local_hAdd[R, inst₁] = local_hAdd[R, inst₂]) ∧
      (local_hMul[R, inst₁] = local_hMul[R, inst₂])

inst₁ = inst₂ ↔ HAdd.hAdd = HAdd.hAdd ∧ HMul.hMul = HMul.hMul


@[simp]
theorem transpose_submatrix (A : Matrix m n α) (r_reindex : l → m) (c_reindex : o → n) :
    (A.submatrix r_reindex c_reindex)ᵀ = Aᵀ.submatrix c_reindex r_reindex

{l : Type u_1}
{m : Type u_2}
{n : Type u_3}
{o : Type u_4}
{α : Type v}
(A : Matrix m n α)
(r_reindex : l → m)
(c_reindex : o → n)


theorem lintegral_prodMkRight (κ : Kernel α β) (ca : α × γ) (g : β → ℝ≥0∞) :
    ∫⁻ b, g b ∂prodMkRight γ κ ca = ∫⁻ b, g b ∂κ ca.fst

{α : Type u_1}
{β : Type u_2}
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}
{γ : Type u_5}
{mγ : MeasurableSpace γ}
(κ : ProbabilityTheory.Kernel α β)
(ca : α × γ)
(g : β → ℝ≥0∞)

∫⁻ (b : β), g b ∂(ProbabilityTheory.Kernel.prodMkRight γ κ) ca = ∫⁻ (b : β), g b ∂κ ca.1


@[simp] lemma primeFactors_eq_empty : n.primeFactors = ∅ ↔ n = 0 ∨ n = 1


/-- The `vectorSpan` is the span of the pairwise subtractions with a given point on the right. -/
theorem vectorSpan_eq_span_vsub_set_right {s : Set P} {p : P} (hp : p ∈ s) :
    vectorSpan k s = Submodule.span k ((· -ᵥ p) '' s)

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

vectorSpan k s = Submodule.span k ((fun x => x -ᵥ p) '' s)


theorem type_eq_zero_of_empty (r) [IsWellOrder α r] [IsEmpty α] : type r = 0

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


/-- If a map is continuous on a separable set `s`, then the image of `s` is also separable. -/
theorem _root_.ContinuousOn.isSeparable_image [TopologicalSpace β] {f : α → β} {s : Set α}
    (hf : ContinuousOn f s) (hs : IsSeparable s) : IsSeparable (f '' s)

{α : Type u}
{β : Type v}
[PseudoMetricSpace α]
[TopologicalSpace β]
{f : α → β}
{s : Set α}
(hf : ContinuousOn f s)
(hs : TopologicalSpace.IsSeparable s)


lemma rightUnitor_inv_apply (i : I) :
    (rightUnitor X).inv i = (ρ_ (X i)).inv ≫ (X i) ◁ tensorUnit₀.inv ≫
      ιTensorObj X tensorUnit i 0 i (add_zero i)

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

(CategoryTheory.GradedObject.Monoidal.rightUnitor X).inv i =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.rightUnitor (X i)).inv
    (CategoryTheory.CategoryStruct.comp
      (CategoryTheory.MonoidalCategory.whiskerLeft (X i) CategoryTheory.GradedObject.Monoidal.tensorUnit₀.inv)
      (CategoryTheory.GradedObject.Monoidal.ιTensorObj X CategoryTheory.GradedObject.Monoidal.tensorUnit i 0 i ⋯))


@[to_additive]
theorem ker_eq_bot_of_mono [Mono f] : f.ker = ⊥

{A B : AddGrp}
(f : A ⟶ B)
[CategoryTheory.Mono f]


@[to_additive (attr := simp)]
theorem mem_prehaar_empty {K₀ : Set G} {f : Compacts G → ℝ} :
    f ∈ haarProduct K₀ ↔ ∀ K : Compacts G, f K ∈ Icc (0 : ℝ) (index (K : Set G) K₀)

{G : Type u_1}
[AddGroup G]
[TopologicalSpace G]
{K₀ : Set G}
{f : TopologicalSpace.Compacts G → ℝ}

f ∈ MeasureTheory.Measure.haar.addHaarProduct K₀ ↔
  ∀ (K : TopologicalSpace.Compacts G), f K ∈ Set.Icc 0 ↑(MeasureTheory.Measure.haar.addIndex (↑K) K₀)


@[to_additive mem_closedBall_iff_norm]
theorem mem_closedBall_iff_norm'' : b ∈ closedBall a r ↔ ‖b / a‖ ≤ r

{E : Type u_6}
[SeminormedGroup E]
{a b : E}
{r : ℝ}


@[ext]
theorem ext (x y : HahnModule Γ R V) (h : ((of R).symm x).coeff = ((of R).symm y).coeff) : x = y

(h : ((HahnModule.of R).symm x).coeff = ((HahnModule.of R).symm y).coeff)


theorem comap_ne_top (hK : K ≠ ⊤) : comap f K ≠ ⊤

{R : Type u}
{S : Type v}
{F : Type u_1}
[Semiring R]
[Semiring S]
[FunLike F R S]
[rc : RingHomClass F R S]
(f : F)
{K : Ideal S}
(hK : K ≠ ⊤)


/-- `Matrix.diagonal` as a `RingHom`. -/
@[simps]
def diagonalRingHom [Fintype n] [DecidableEq n] : (n → α) →+* Matrix n n α

(n : Type u_3)
(α : Type v)
[NonAssocSemiring α]
[Fintype n]
[DecidableEq n]
(d : n → α)

(Matrix.diagonalRingHom n α) d = Matrix.diagonal d


/-- If a set of functions is uniformly equicontinuous on a set `S`, the same is true for its
closure in *any* topology for which evaluation at any `x ∈ S` i continuous. Since this will be
applied to `DFunLike` types, we state it for any topological space whith a map to `β → α` satisfying
the right continuity conditions. See also `Set.UniformEquicontinuousOn.closure` for a more familiar
(but weaker) statement. -/
theorem UniformEquicontinuousOn.closure' {A : Set Y} {u : Y → β → α} {S : Set β}
    (hA : UniformEquicontinuousOn (u ∘ (↑) : A → β → α) S) (hu : Continuous (S.restrict ∘ u)) :
    UniformEquicontinuousOn (u ∘ (↑) : closure A → β → α) S

(hA : UniformEquicontinuousOn (u ∘ Subtype.val) S)


theorem Pairwise.filter (p : α → Bool) : Pairwise R l → Pairwise R (filter p l)

{α : Type u_1}
{R : α → α → Prop}
{l : List α}
(p : α → Bool)

List.Pairwise R l → List.Pairwise R (List.filter p l)


theorem setLIntegral_withDensity_eq_setLIntegral_mul_non_measurable (μ : Measure α) {f : α → ℝ≥0∞}
    (f_meas : Measurable f) (g : α → ℝ≥0∞) {s : Set α} (hs : MeasurableSet s)
    (hf : ∀ᵐ x ∂μ.restrict s, f x < ∞) :
    ∫⁻ a in s, g a ∂μ.withDensity f = ∫⁻ a in s, (f * g) a ∂μ

{f : α → ℝ≥0∞}

(g : α → ℝ≥0∞)

(hf : ∀ᵐ (x : α) ∂μ.restrict s, f x < ⊤)

∫⁻ (a : α) in s, g a ∂μ.withDensity f = ∫⁻ (a : α) in s, (f * g) a ∂μ


lemma norm_natCast_cpow_le_norm_natCast_cpow_of_pos {n : ℕ} (hn : 0 < n) {w z : ℂ}
    (h : w.re ≤ z.re) :
    ‖(n : ℂ) ^ w‖ ≤ ‖(n : ℂ) ^ z‖

‖↑n ^ w‖ ≤ ‖↑n ^ z‖


@[simp]
lemma iso_hom_val_base_inv_val_base {X Y : LocallyRingedSpace.{u}} (e : X ≅ Y) :
    e.hom.val.base ≫ e.inv.val.base = 𝟙 _

{X Y : AlgebraicGeometry.LocallyRingedSpace}

e.hom.val.base ≫ e.inv.val.base = 𝟙 ↑X.toPresheafedSpace


lemma optionSubtypeNe_symm_of_ne (hba : b ≠ a) : (optionSubtypeNe a).symm b = some ⟨b, hba⟩

{α : Type u_1}
[DecidableEq α]
{a b : α}
(hba : b ≠ a)

(Equiv.optionSubtypeNe a).symm b = some ⟨b, hba⟩


/-- A Lie subalgebra `H` is an ideal of any Lie subalgebra `K` containing `H` and contained in the
normalizer of `H`. -/
theorem exists_nested_lieIdeal_ofLe_normalizer {K : LieSubalgebra R L} (h₁ : H ≤ K)
    (h₂ : K ≤ H.normalizer) : ∃ I : LieIdeal R K, (I : LieSubalgebra R K) = ofLe h₁

{R : Type u_1}
{L : Type u_2}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
{H K : LieSubalgebra R L}
(h₁ : H ≤ K)
(h₂ : K ≤ H.normalizer)

∃ I, lieIdealSubalgebra R (↥K) I = LieSubalgebra.ofLe h₁


theorem IsUnit.not_isPrimePow {n : R} (h : IsUnit n) : ¬IsPrimePow n

{R : Type u_1}
[CommMonoidWithZero R]
{n : R}
(h : IsUnit n)


theorem contDiffOn_arcsin {n : ℕ∞} : ContDiffOn ℝ n arcsin {-1, 1}ᶜ


/-- The right inclusion of `G` into `coprod F G`. -/
@[simps]
def coprod.inr : G ⟶ coprod F G

{F G : CategoryTheory.Functor C (Type w)}

∀ (x : C) (x_1 : G.obj x), CategoryTheory.FunctorToTypes.coprod.inr.app x x_1 = Sum.inr x_1


@[simp 500, norm_cast]
theorem cast_succ [AddMonoidWithOne α] (n : PosNum) : (succ n : α) = n + 1

{α : Type u_1}
[AddMonoidWithOne α]
(n : PosNum)


@[simp]
theorem Ioo_union_Ico_eq_Ioo (h₁ : a < b) (h₂ : b ≤ c) : Ioo a b ∪ Ico b c = Ioo a c

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


@[deprecated isLt (since := "2024-03-12")]
theorem toNat_lt (x : BitVec n) : x.toNat < 2^n


@[simp] lemma not_in₀₀ : ¬ (graph t).Adj (in₀ a) (in₀ a')

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{t : Finset (α × β × γ)}
{a a' : α}

¬(SimpleGraph.TripartiteFromTriangles.graph t).Adj (Sum3.in₀ a) (Sum3.in₀ a')


theorem smallSets_inf (l₁ l₂ : Filter α) : (l₁ ⊓ l₂).smallSets = l₁.smallSets ⊓ l₂.smallSets


/-- The Jacobi symbol is multiplicative in its second argument. -/
theorem mul_right (a : ℤ) (b₁ b₂ : ℕ) [NeZero b₁] [NeZero b₂] :
    J(a | b₁ * b₂) = J(a | b₁) * J(a | b₂)

jacobiSym a (b₁ * b₂) = jacobiSym a b₁ * jacobiSym a b₂


theorem Quotient.rep_spec (q : Quotient s) : ⟦q.rep⟧ = q

{α : Type u_1}
{s : Setoid α}
[DecidableRel fun x x_1 => x ≈ x_1]
[Encodable α]
(q : Quotient s)


/-- Extra simp lemma that `dsimp` can use. `simp` will never use this. -/
@[to_additive "Extra simp lemma that `dsimp` can use. `simp` will never use this.",
  simp, nolint simpNF]
theorem mulLeft_symm_apply (a : G) : ((Equiv.mulLeft a).symm : G → G) = (a⁻¹ * ·)

⇑(Equiv.symm (Equiv.addLeft a)) = fun x => -a + x


@[simp]
theorem xn_succ (n : ℕ) : xn a1 (n + 1) = xn a1 n * a + d a1 * yn a1 n

Pell.xn a1 (n + 1) = Pell.xn a1 n * a + Pell.d a1 * Pell.yn a1 n


/-- The orthogonal projection is the unique point in `K` with the
orthogonality property. -/
theorem eq_orthogonalProjection_of_mem_of_inner_eq_zero {u v : E} (hvm : v ∈ K)
    (hvo : ∀ w ∈ K, ⟪u - v, w⟫ = 0) : (orthogonalProjection K u : E) = v

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{K : Submodule 𝕜 E}
[HasOrthogonalProjection K]
{u v : E}
(hvm : v ∈ K)
(hvo : ∀ w ∈ K, ⟪u - v, w⟫_𝕜 = 0)


theorem continuousWithinAt_of_dominated {F : X → α → G} {x₀ : X} {bound : α → ℝ} {s : Set X}
    (hF_meas : ∀ᶠ x in 𝓝[s] x₀, AEStronglyMeasurable (F x) μ)
    (h_bound : ∀ᶠ x in 𝓝[s] x₀, ∀ᵐ a ∂μ, ‖F x a‖ ≤ bound a) (bound_integrable : Integrable bound μ)
    (h_cont : ∀ᵐ a ∂μ, ContinuousWithinAt (fun x => F x a) s x₀) :
    ContinuousWithinAt (fun x => ∫ a, F x a ∂μ) s x₀

(hF_meas : ∀ᶠ (x : X) in 𝓝[s] x₀, MeasureTheory.AEStronglyMeasurable (F x) μ)

(h_bound : ∀ᶠ (x : X) in 𝓝[s] x₀, ∀ᵐ (a : α) ∂μ, ‖F x a‖ ≤ bound a)

(bound_integrable : MeasureTheory.Integrable bound μ)

(h_cont : ∀ᵐ (a : α) ∂μ, ContinuousWithinAt (fun x => F x a) s x₀)

ContinuousWithinAt (fun x => ∫ (a : α), F x a ∂μ) s x₀


lemma StrictMonoOn.image_Iio_subset (h : StrictMonoOn f (Iic b)) : f '' Iio b ⊆ Iio (f b)

{α : Type u_1}
{β : Type u_2}
{f : α → β}
[Preorder α]
[Preorder β]
{b : α}
(h : StrictMonoOn f (Set.Iic b))


theorem pullback_top (f : X ⟶ Y) : (pullback f).obj ⊤ = ⊤

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

(CategoryTheory.Subobject.pullback f).obj ⊤ = ⊤


protected lemma _root_.Set.Sized.compls (h𝒜 : (𝒜 : Set (Finset α)).Sized n) :
    (𝒜ᶜˢ : Set (Finset α)).Sized (Fintype.card α - n)

{α : Type u_2}
[DecidableEq α]
[Fintype α]
{𝒜 : Finset (Finset α)}
{n : ℕ}
(h𝒜 : Set.Sized n ↑𝒜)

Set.Sized (Fintype.card α - n) ↑𝒜.compls


theorem comp_continuous_iff {γ} [TopologicalSpace γ] (hf : Isometry f) {g : γ → α} :
    Continuous (f ∘ g) ↔ Continuous g

{α : Type u}
{β : Type v}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
{f : α → β}
{γ : Type u_2}
[TopologicalSpace γ]
(hf : Isometry f)
{g : γ → α}


theorem IsInternal.addSubgroup_independent {M : Type*} [AddCommGroup M] {A : ι → AddSubgroup M}
    (h : IsInternal A) : CompleteLattice.Independent A

{ι : Type v}
[dec_ι : DecidableEq ι]
{M : Type u_2}
[AddCommGroup M]
{A : ι → AddSubgroup M}
(h : DirectSum.IsInternal A)


@[simp]
theorem fract_sub_self (a : α) : fract a - a = -⌊a⌋

{α : Type u_2}
[LinearOrderedRing α]
[FloorRing α]
(a : α)


@[simp]
theorem symmDiff_bot : a ∆ ⊥ = a

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


/-- If `f : G → H` is an `AddConstMap`, then so is `fun x ↦ -f (-x)`. -/
@[simps! apply_coe]
def conjNeg : (G →+c[a, b] H) ≃ (G →+c[a, b] H)

{G : Type u_1}
{H : Type u_2}
[AddCommGroup G]
[AddCommGroup H]
{a : G}
{b : H}
(f : AddConstMap G H a b)
(x : G)


@[reassoc]
theorem rightUnitor_monoidal (X₁ X₂ : C) :
    (ρ_ X₁).hom ⊗ (ρ_ X₂).hom =
      tensor_μ C (X₁, 𝟙_ C) (X₂, 𝟙_ C) ≫ ((X₁ ⊗ X₂) ◁ (λ_ (𝟙_ C)).hom) ≫ (ρ_ (X₁ ⊗ X₂)).hom

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

(ρ_ X₁).hom ⊗ (ρ_ X₂).hom =
  CategoryTheory.tensor_μ C (X₁, 𝟙_ C) (X₂, 𝟙_ C) ≫ (X₁ ⊗ X₂) ◁ (λ_ (𝟙_ C)).hom ≫ (ρ_ (X₁ ⊗ X₂)).hom


nonrec theorem IsLocalMin.sub (hf : IsLocalMin f a) (hg : IsLocalMax g a) :
    IsLocalMin (fun x => f x - g x) a

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[OrderedAddCommGroup β]
{f g : α → β}
{a : α}
(hf : IsLocalMin f a)
(hg : IsLocalMax g a)


@[simp]
private theorem snd_fFold_fFold (m₁ m₂ m₃ : M) (x : A × S f) :
    ((fFold f m₁ (fFold f m₂ x)).snd : M →ₗ[R] A) m₃ = f.bilin m₃ m₁ * (x.snd : M →ₗ[R] A) m₂

(x : A × ↥(CliffordAlgebra.even.lift.S f))

↑(((CliffordAlgebra.even.lift.fFold f) m₁) (((CliffordAlgebra.even.lift.fFold f) m₂) x)).2 m₃ =
  (f.bilin m₃) m₁ * ↑x.2 m₂


/-- The inverse in the group is equal to the inverse given by `CategoryTheory.inv`. -/
theorem vertexGroup.inv_eq_inv (c : C) (γ : c ⟶ c) : γ⁻¹ = CategoryTheory.inv γ

{C : Type u}
[CategoryTheory.Groupoid C]
(c : C)
(γ : c ⟶ c)


@[simp]
theorem floor_intCast (z : ℤ) : ⌊(z : α)⌋ = z

{α : Type u_2}
[LinearOrderedRing α]
[FloorRing α]
(z : ℤ)


@[simp]
theorem coe_mk' {s : Set R} {sm : Submonoid R} (hm : ↑sm = s) {sa : AddSubmonoid R} (ha : ↑sa = s) :
    (Subsemiring.mk' s sm hm sa ha : Set R) = s

{R : Type u}
[NonAssocSemiring R]
{s : Set R}
{sm : Submonoid R}
(hm : ↑sm = s)
{sa : AddSubmonoid R}
(ha : ↑sa = s)


theorem isSupported_of {p} {s : Set α} : IsSupported (of p) s ↔ p ∈ s

(FreeCommRing.of p).IsSupported s ↔ p ∈ s


/-- The canonical natural transformation `𝟭 (Over S) ⟶ functor f S`. -/
@[simps! app]
noncomputable def ε : 𝟭 (Over S) ⟶ functor f S

[∀ {X : C} (πX : X ⟶ S),
    CategoryTheory.Limits.HasColimitsOfShape (CategoryTheory.Discrete (CategoryTheory.SmallObject.FunctorObjIndex f πX))
      C]

(CategoryTheory.SmallObject.ε f S).app w = CategoryTheory.Over.homMk (CategoryTheory.SmallObject.ιFunctorObj f w.hom) ⋯


@[simp] theorem mem_pi : f ∈ s.pi t ↔ ∀ i ∈ s, f i ∈ t i

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

f ∈ s.pi t ↔ ∀ (i : ι), i ∈ s → f i ∈ t i


@[simp, norm_cast]
theorem coe_prodMap [Module R₁ M₂] [Module R₁ M₃] [Module R₁ M₄] (f₁ : M₁ →L[R₁] M₂)
    (f₂ : M₃ →L[R₁] M₄) : ↑(f₁.prodMap f₂) = (f₁ : M₁ →ₗ[R₁] M₂).prodMap (f₂ : M₃ →ₗ[R₁] M₄)

{R₁ : Type u_1}
[Semiring R₁]
{M₁ : Type u_4}
[TopologicalSpace M₁]
[AddCommMonoid M₁]
{M₂ : Type u_6}
[TopologicalSpace M₂]
[AddCommMonoid M₂]
{M₃ : Type u_7}
[TopologicalSpace M₃]
[AddCommMonoid M₃]
{M₄ : Type u_8}
[TopologicalSpace M₄]
[AddCommMonoid M₄]
[Module R₁ M₁]
[Module R₁ M₂]
[Module R₁ M₃]
[Module R₁ M₄]
(f₁ : M₁ →L[R₁] M₂)
(f₂ : M₃ →L[R₁] M₄)


theorem hasLimit_of_reflective (F : J ⥤ D) (R : D ⥤ C) [HasLimit (F ⋙ R)] [Reflective R] :
    HasLimit F


theorem Nat.Prime.irrational_sqrt {p : ℕ} (hp : Nat.Prime p) : Irrational (√p)


theorem add_one_le_iff {a b : Int} : a + 1 ≤ b ↔ a < b


theorem bmex_lt_ord_succ_card {o : Ordinal.{u}} (f : ∀ a < o, Ordinal.{u}) :
    bmex.{_, u} o f < (succ o.card).ord

(f : (a : Ordinal.{u}) → a < o → Ordinal.{u})


@[to_additive (attr := simp)]
theorem mk_eq_one [One M] [One N] {x : M} {y : N} : (x, y) = 1 ↔ x = 1 ∧ y = 1

{M : Type u_5}
{N : Type u_6}
[Zero M]
[Zero N]
{x : M}
{y : N}


@[simp]
theorem right_eq_midpoint_iff {x y : P} : y = midpoint R x y ↔ x = y

(R : Type u_1)
{V : Type u_2}
{P : Type u_4}
[Ring R]
[Invertible 2]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
{x y : P}


@[simp]
theorem constantCoeff_wittMul (n : ℕ) : constantCoeff (wittMul p n) = 0

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

MvPolynomial.constantCoeff (WittVector.wittMul p n) = 0


@[simp]
theorem Basis.toMatrix_reindex (b : Basis ι R M) (v : ι' → M) (e : ι ≃ ι') :
    (b.reindex e).toMatrix v = (b.toMatrix v).submatrix e.symm _root_.id

{ι : Type u_1}
{ι' : Type u_2}
{R : Type u_5}
{M : Type u_6}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
(b : Basis ι R M)
(v : ι' → M)
(e : ι ≃ ι')

(b.reindex e).toMatrix v = (b.toMatrix v).submatrix (⇑e.symm) id


theorem StrictMonoOn.injOn [LinearOrder α] [Preorder β] {f : α → β} {s : Set α}
    (H : StrictMonoOn f s) : s.InjOn f

{α : Type u_1}
{β : Type u_2}
[LinearOrder α]
[Preorder β]
{f : α → β}
{s : Set α}
(H : StrictMonoOn f s)


@[to_additive (attr := simp)]
theorem liftOfRightInverseAux_comp_apply (hf : Function.RightInverse f_inv f) (g : G₁ →* G₃)
    (hg : f.ker ≤ g.ker) (x : G₁) : (f.liftOfRightInverseAux f_inv hf g hg) (f x) = g x

{G₁ : Type u_5}
{G₂ : Type u_6}
{G₃ : Type u_7}
[AddGroup G₁]
[AddGroup G₂]
[AddGroup G₃]
(f : G₁ →+ G₂)
(f_inv : G₂ → G₁)
(hf : Function.RightInverse f_inv ⇑f)
(g : G₁ →+ G₃)
(hg : f.ker ≤ g.ker)
(x : G₁)


@[simp]
theorem range_comp_incl_top : (f.comp (incl (⊤ : AddSubgroup V₁))).range = f.range

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

(f.comp (NormedAddGroupHom.incl ⊤)).range = f.range


@[simp]
theorem prodCongrRight_trans_prodComm :
    (prodCongrRight e).trans (prodComm _ _) = (prodComm _ _).trans (prodCongrLeft e)

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

(Equiv.prodCongrRight e).trans (Equiv.prodComm α₁ β₂) = (Equiv.prodComm α₁ β₁).trans (Equiv.prodCongrLeft e)


theorem Monotone.isChain_range [LinearOrder α] [Preorder β] {f : α → β} (hf : Monotone f) :
    IsChain (· ≤ ·) (range f)

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

IsChain (fun x x_1 => x ≤ x_1) (Set.range f)


@[simp]
theorem const_le_const : const β a ≤ const β b ↔ a ≤ b

{α : Type u_2}
{β : Type u_3}
[Preorder α]
[Nonempty β]
{a b : α}

Function.const β a ≤ Function.const β b ↔ a ≤ b


@[to_additive]
theorem div_subset_div_right : s₁ ⊆ s₂ → s₁ / t ⊆ s₂ / t

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


@[simp, norm_cast]
theorem coe_mul (x y : ℝ) : ↑(x * y) = (x * y : ℝ*)


@[simp] theorem of_symm_add (x y : HahnModule Γ R V) :
  (of R).symm (x + y) = (of R).symm x + (of R).symm y

{Γ : Type u_1}
{R : Type u_3}
{V : Type u_4}
[PartialOrder Γ]
[AddCommMonoid V]
[SMul R V]
(x y : HahnModule Γ R V)

(HahnModule.of R).symm (x + y) = (HahnModule.of R).symm x + (HahnModule.of R).symm y


theorem Icc_eq_finset_subtype : Icc a b = (Icc (a : ℕ) b).fin n

Finset.Icc a b = Finset.fin n (Finset.Icc ↑a ↑b)


@[to_additive]
lemma isMulFreimanHom_const {b : β} (hb : b ∈ B) : IsMulFreimanHom n A B fun _ ↦ b

{α : Type u_2}
{β : Type u_3}
[CommMonoid α]
[CommMonoid β]
{A : Set α}
{B : Set β}
{n : ℕ}
{b : β}
(hb : b ∈ B)


lemma cfcₙ_nonpos (f : R → R) (a : A) (h : ∀ x ∈ σₙ R a, f x ≤ 0) :
    cfcₙ f a ≤ 0

[∀ (α : Type u_1) [inst : Zero α] [inst_1 : TopologicalSpace α], StarOrderedRing C(α, R)₀]


theorem iInf_insert_update {x : α} {t : Finset α} (f : α → β) {s : β} (hx : x ∉ t) :
    ⨅ i ∈ insert x t, update f x s i = s ⊓ ⨅ i ∈ t, f i

{α : Type u_2}
{β : Type u_3}
[CompleteLattice β]
[DecidableEq α]
{x : α}
{t : Finset α}
(f : α → β)
{s : β}
(hx : x ∉ t)

⨅ i ∈ insert x t, Function.update f x s i = s ⊓ ⨅ i ∈ t, f i


@[simp] theorem isPrefixOf_replicate {a : α} :
    isPrefixOf l (replicate n a) = (decide (l.length ≤ n) && l.all (· == a))

{α : Type u_1}
[BEq α]
{l : List α}
{n : Nat}
{a : α}

l.isPrefixOf (List.replicate n a) = (decide (l.length ≤ n) && l.all fun x => x == a)


theorem InftyValuation.map_one' : inftyValuationDef Fq 1 = 1

(Fq : Type)
[Field Fq]
[DecidableEq (RatFunc Fq)]

FunctionField.inftyValuationDef Fq 1 = 1


/-- Given a point in an affine subspace, the set of vectors in its direction equals the set of
vectors subtracting that point on the left. -/
theorem coe_direction_eq_vsub_set_left {s : AffineSubspace k P} {p : P} (hp : p ∈ s) :
    (s.direction : Set V) = (p -ᵥ ·) '' s

{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}
{p : P}
(hp : p ∈ s)


theorem spanFinset_ne_zero {ι : Type*} {s : Finset ι} {f : ι → K} :
    spanFinset R₁ s f ≠ 0 ↔ ∃ j ∈ s, f j ≠ 0

{R₁ : Type u_3}
[CommRing R₁]
{K : Type u_4}
[Field K]
[Algebra R₁ K]
[IsFractionRing R₁ K]
{ι : Type u_5}
{s : Finset ι}
{f : ι → K}

FractionalIdeal.spanFinset R₁ s f ≠ 0 ↔ ∃ j ∈ s, f j ≠ 0


theorem variance_le_expectation_sq [@IsProbabilityMeasure Ω _ ℙ] {X : Ω → ℝ}
    (hm : AEStronglyMeasurable X ℙ) : Var[X] ≤ 𝔼[X ^ 2]

(hm : MeasureTheory.AEStronglyMeasurable X ℙ)

ProbabilityTheory.variance X ℙ ≤ ∫ (a : Ω), (X ^ 2) a


@[simp]
lemma rightHomologyMap'_smul :
    rightHomologyMap' (a • φ) h₁ h₂ = a • rightHomologyMap' φ h₁ h₂

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

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


theorem Filter.EventuallyEq.hasDerivWithinAt_iff (h₁ : f₁ =ᶠ[𝓝[s] x] f) (hx : f₁ x = f x) :
    HasDerivWithinAt f₁ f' s x ↔ HasDerivWithinAt f f' s x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f f₁ : 𝕜 → F}
{f' : F}
{x : 𝕜}
{s : Set 𝕜}
(h₁ : f₁ =ᶠ[𝓝[s] x] f)
(hx : f₁ x = f x)


/-- Distance from the image of a point under inversion to the center. This formula accidentally
works for `x = c`. -/
theorem dist_inversion_center (c x : P) (R : ℝ) : dist (inversion c R x) c = R ^ 2 / dist x c

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

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


theorem derivative_X_add_C (c : R) : derivative (X + C c) = 1

Polynomial.derivative (Polynomial.X + Polynomial.C c) = 1


@[to_additive (attr := simp)]
theorem Ici_one : Ici (1 : α) = 1


@[to_additive]
theorem LipschitzOnWith.norm_div_le_of_le {f : E → F} {C : ℝ≥0} (h : LipschitzOnWith C f s)
    (ha : a ∈ s) (hb : b ∈ s) (hr : ‖a / b‖ ≤ r) : ‖f a / f b‖ ≤ C * r

{E : Type u_3}
{F : Type u_4}
[SeminormedAddGroup E]
[SeminormedAddGroup F]
{s : Set E}
{a b : E}
{r : ℝ}
{f : E → F}
{C : ℝ≥0}
(h : LipschitzOnWith C f s)
(ha : a ∈ s)
(hb : b ∈ s)
(hr : ‖a - b‖ ≤ r)


/-- If `𝓕 : ι → X → α` tends to `f : X → α` *pointwise on `S ∪ {x₀} : Set X`* along some nontrivial
filter, and if the family `𝓕` is equicontinuous at `x₀ : X` within `S`, then the limit is
continuous at `x₀` within `S`. -/
theorem Filter.Tendsto.continuousWithinAt_of_equicontinuousWithinAt {l : Filter ι} [l.NeBot]
    {F : ι → X → α} {f : X → α} {S : Set X} {x₀ : X} (h₁ : ∀ x ∈ S, Tendsto (F · x) l (𝓝 (f x)))
    (h₂ : Tendsto (F · x₀) l (𝓝 (f x₀))) (h₃ : EquicontinuousWithinAt F S x₀) :
    ContinuousWithinAt f S x₀

(h₁ : ∀ x ∈ S, Filter.Tendsto (fun x_1 => F x_1 x) l (nhds (f x)))

(h₂ : Filter.Tendsto (fun x => F x x₀) l (nhds (f x₀)))


/-- The opposite morphism in `ShortComplex Cᵒᵖ` associated to a morphism in `ShortComplex C` -/
@[simps]
def opMap (φ : S₁ ⟶ S₂) : S₂.op ⟶ S₁.op

(CategoryTheory.ShortComplex.opMap φ).τ₃ = φ.τ₁.op


@[to_additive]
theorem tprod_eq_zero_mul'
    {f : ℕ → M} (hf : Multipliable (fun n ↦ f (n + 1))) :
    ∏' b, f b = f 0 * ∏' b, f (b + 1)

{M : Type u_1}
[AddCommMonoid M]
[TopologicalSpace M]
[T2Space M]
[ContinuousAdd M]
{f : ℕ → M}
(hf : Summable fun n => f (n + 1))


/-- The diagram describing the universal property for quotients of monoids commutes. -/
@[to_additive (attr := simp) "The diagram describing the universal property for quotients of
`AddMonoid`s commutes."]
theorem lift_comp_mk' (H : c ≤ ker f) : (c.lift f H).comp c.mk' = f

{M : Type u_1}
{P : Type u_3}
[MulOneClass M]
[MulOneClass P]
{c : Con M}
{f : M →* P}
(H : c ≤ Con.ker f)


theorem continuousOn_log : ContinuousOn log {0}ᶜ


theorem WCovBy.Ico_subset (h : a ⩿ b) : Ico a b ⊆ {a}

{α : Type u_1}
[PartialOrder α]
{a b : α}
(h : a ⩿ b)


theorem zero_eq_zero' {P Q R : C} :
    (⟦((0 : Q ⟶ P) : Over P)⟧ : Pseudoelement P) = ⟦((0 : R ⟶ P) : Over P)⟧

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Abelian C]
{P Q R : C}

⟦CategoryTheory.Over.mk 0⟧ = ⟦CategoryTheory.Over.mk 0⟧


lemma biUnion_image_inf_right : t.biUnion (fun b ↦ s.image (· ⊓ b)) = s ⊼ t

{α : Type u_2}
[DecidableEq α]
[SemilatticeInf α]
(s t : Finset α)

(t.biUnion fun b => Finset.image (fun x => x ⊓ b) s) = s ⊼ t


theorem mem_chart_target (x : M) : chartAt H x x ∈ (chartAt H x).target

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


lemma le_three_of_sqrt_eq_one (h : sqrt n = 1) : n ≤ 3


theorem range_fromOpenSubsetsGlue : Set.range (fromOpenSubsetsGlue U) = ⋃ i, (U i : Set α)

{α : Type u}
[TopologicalSpace α]
{J : Type u}
(U : J → TopologicalSpace.Opens α)

Set.range ⇑(TopCat.GlueData.fromOpenSubsetsGlue U) = ⋃ i, ↑(U i)


theorem sin_mem_Icc (x : ℝ) : sin x ∈ Icc (-1 : ℝ) 1


@[simp]
theorem ceil_one : ⌈(1 : α)⌉₊ = 1

{α : Type u_2}
[LinearOrderedSemiring α]
[FloorSemiring α]


theorem noncommProd_erase_mul [DecidableEq α] (s : Finset α) {a : α} (h : a ∈ s) (f : α → β) (comm)
    (comm' := fun x hx y hy hxy ↦ comm (s.mem_of_mem_erase hx) (s.mem_of_mem_erase hy) hxy) :
    (s.erase a).noncommProd f comm' * f a = s.noncommProd f comm

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

(comm' : ∀ x ∈ ↑(s.erase a), ∀ y ∈ ↑(s.erase a), x ≠ y → (fun a b => Commute (f a) (f b)) x y := ⋯)


@[simp]
theorem dropn_cons (a : α) (s) (n) : drop (cons a s) (n + 1) = drop s n

{α : Type u}
(a : α)
(s : Stream'.WSeq α)
(n : ℕ)

(Stream'.WSeq.cons a s).drop (n + 1) = s.drop n


@[to_additive (attr := elab_as_elim, induction_eliminator)]
protected theorem induction_on {C : FreeGroup α → Prop} (z : FreeGroup α) (C1 : C 1)
    (Cp : ∀ x, C <| pure x) (Ci : ∀ x, C (pure x) → C (pure x)⁻¹)
    (Cm : ∀ x y, C x → C y → C (x * y)) : C z

(Ci : ∀ (x : α), C (pure x) → C (-pure x))

(Cm : ∀ (x y : FreeAddGroup α), C x → C y → C (x + y))


theorem setLIntegral_map [MeasurableSpace β] {f : β → ℝ≥0∞} {g : α → β} {s : Set β}
    (hs : MeasurableSet s) (hf : Measurable f) (hg : Measurable g) :
    ∫⁻ y in s, f y ∂map g μ = ∫⁻ x in g ⁻¹' s, f (g x) ∂μ

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[MeasurableSpace β]
{f : β → ℝ≥0∞}
{g : α → β}
{s : Set β}
(hs : MeasurableSet s)
(hf : Measurable f)
(hg : Measurable g)

∫⁻ (y : β) in s, f y ∂MeasureTheory.Measure.map g μ = ∫⁻ (x : α) in g ⁻¹' s, f (g x) ∂μ


theorem eq_equivalence {α : Sort*} : Equivalence (@Eq α)


/-- There are only two filters on a `Subsingleton`: `⊥` and `⊤`. If the type is empty, then they are
equal. -/
theorem eq_top_of_neBot [Subsingleton α] (l : Filter α) [NeBot l] : l = ⊤

{α : Type u}
[Subsingleton α]
(l : Filter α)
[l.NeBot]


lemma mul_eq_mkRat (q r : ℚ) : q * r = mkRat (q.num * r.num) (q.den * r.den)


theorem minFacHelper_2 {n k k' : ℕ} (e : k + 2 = k') (nk : ¬ Nat.Prime k)
    (h : MinFacHelper n k) : MinFacHelper n k'

(h : Mathlib.Meta.NormNum.MinFacHelper n k)


theorem isNat_gcd : {x y nx ny z : ℕ} →
    IsNat x nx → IsNat y ny → Nat.gcd nx ny = z → IsNat (Nat.gcd x y) z

Mathlib.Meta.NormNum.IsNat x nx →
  Mathlib.Meta.NormNum.IsNat y ny → nx.gcd ny = z → Mathlib.Meta.NormNum.IsNat (x.gcd y) z


theorem le_toNNReal_of_coe_le (h : p ≤ a) (ha : a ≠ ∞) : p ≤ a.toNNReal

{a : ℝ≥0∞}
{p : ℝ≥0}
(h : ↑p ≤ a)
(ha : a ≠ ⊤)


/-- If the counit of an adjunction is an isomorphism, then its inverse on the image of R is given
by R whiskered with the unit. -/
@[simp]
theorem inv_counit_map {X : D} [IsIso (h.counit.app X)] :
    inv (R.map (h.counit.app X)) = h.unit.app (R.obj X)

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

CategoryTheory.inv (R.map (h.counit.app X)) = h.unit.app (R.obj X)


/-- A Hopf algebra over a commutative (semi)ring `R` is a bialgebra over `R` equipped with an
`R`-linear endomorphism `antipode` satisfying the antipode axioms. -/
class HopfAlgebra (R : Type u) (A : Type v) [CommSemiring R] [Semiring A] extends
    Bialgebra R A where
  /-- The antipode of the Hopf algebra. -/
  antipode : A →ₗ[R] A
  /-- One of the antipode axioms for a Hopf algebra. -/
  mul_antipode_rTensor_comul :
    LinearMap.mul' R A ∘ₗ antipode.rTensor A ∘ₗ comul = (Algebra.linearMap R A) ∘ₗ counit
  /-- One of the antipode axioms for a Hopf algebra. -/
  mul_antipode_lTensor_comul :
    LinearMap.mul' R A ∘ₗ antipode.lTensor A ∘ₗ comul = (Algebra.linearMap R A) ∘ₗ counit

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

LinearMap.mul' R A ∘ₗ LinearMap.rTensor A HopfAlgebra.antipode ∘ₗ Coalgebra.comul =
  Algebra.linearMap R A ∘ₗ Coalgebra.counit


@[simp]
theorem Ico_inter_Ico_of_le [DecidableEq α] {a b c d : α} (h : b ≤ c) : Ico a b ∩ Ico c d = 0

{α : Type u_1}
[PartialOrder α]
[LocallyFiniteOrder α]
[DecidableEq α]
{a b c d : α}
(h : b ≤ c)


theorem exists_of_isLeft_left (h₁ : LiftRel r s x y) (h₂ : x.isLeft) :
    ∃ a c, r a c ∧ x = inl a ∧ y = inl c

{α : Type u}
{β : Type v}
{γ : Type u_1}
{δ : Type u_2}
{r : α → γ → Prop}
{s : β → δ → Prop}
{x : α ⊕ β}
{y : γ ⊕ δ}
(h₁ : Sum.LiftRel r s x y)
(h₂ : x.isLeft = true)

∃ a c, r a c ∧ x = Sum.inl a ∧ y = Sum.inl c


theorem not_mem_uIcc_of_gt : a < c → b < c → c ∉ [[a, b]]

{α : Type u_2}
[LinearOrder α]
[LocallyFiniteOrder α]
{a b c : α}


protected lemma ContinuousOn.partialSups (hf : ∀ k ≤ n, ContinuousOn (f k) s) :
    ContinuousOn (partialSups f n) s

{L : Type u_1}
[SemilatticeSup L]
[TopologicalSpace L]
[ContinuousSup L]
{X : Type u_2}
[TopologicalSpace X]
{f : ℕ → X → L}
{n : ℕ}
{s : Set X}
(hf : ∀ k ≤ n, ContinuousOn (f k) s)


/-- An induction principle for elements of `⨆ i, p i`.
If `C` holds for `0` and all elements of `p i` for all `i`, and is preserved under addition,
then it holds for all elements of the supremum of `p`. -/
@[elab_as_elim]
theorem iSup_induction {ι : Sort*} (p : ι → Submodule R M) {C : M → Prop} {x : M}
    (hx : x ∈ ⨆ i, p i) (hp : ∀ (i), ∀ x ∈ p i, C x) (h0 : C 0)
    (hadd : ∀ x y, C x → C y → C (x + y)) : C x

(hadd : ∀ (x y : M), C x → C y → C (x + y))


/-- `slope f a c` is an affine combination of `slope f a b` and `slope f b c`. This version uses
`lineMap` to express this property. -/
theorem lineMap_slope_slope_sub_div_sub (f : k → PE) (a b c : k) (h : a ≠ c) :
    lineMap (slope f a b) (slope f b c) ((c - b) / (c - a)) = slope f a c

{k : Type u_1}
{E : Type u_2}
{PE : Type u_3}
[Field k]
[AddCommGroup E]
[Module k E]
[AddTorsor E PE]
(f : k → PE)
(a b c : k)
(h : a ≠ c)

(AffineMap.lineMap (slope f a b) (slope f b c)) ((c - b) / (c - a)) = slope f a c


theorem ediam_image_inter_le (hf : HolderOnWith C r f s) (t : Set X) :
    EMetric.diam (f '' (t ∩ s)) ≤ (C : ℝ≥0∞) * EMetric.diam t ^ (r : ℝ)

{X : Type u_1}
{Y : Type u_2}
[PseudoEMetricSpace X]
[PseudoEMetricSpace Y]
{C r : ℝ≥0}
{f : X → Y}
{s : Set X}
(hf : HolderOnWith C r f s)
(t : Set X)

EMetric.diam (f '' (t ∩ s)) ≤ ↑C * EMetric.diam t ^ ↑r


protected nonrec theorem Smooth.coordChangeL
    (hf : Smooth IM IB f) (he : ∀ x, f x ∈ e.baseSet) (he' : ∀ x, f x ∈ e'.baseSet) :
    Smooth IM 𝓘(𝕜, F →L[𝕜] F) (fun y ↦ (e.coordChangeL 𝕜 e' (f y) : F →L[𝕜] F))

[TopologicalSpace (Bundle.TotalSpace F E)]

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

Smooth IM 𝓘(𝕜, F →L[𝕜] F) fun y => ↑(Trivialization.coordChangeL 𝕜 e e' (f y))


theorem eq_of_comp_right_eq {f g : Y ⟶ Z} (w : ∀ {X : C} (h : X ⟶ Y), h ≫ f = h ≫ g) :
    f = g

(w : ∀ {X : C} (h : X ⟶ Y), CategoryTheory.CategoryStruct.comp h f = CategoryTheory.CategoryStruct.comp h g)


@[simp]
theorem tanh_neg : tanh (-x) = -tanh x


@[simp]
theorem negSucc_shiftRight (m n : Nat) :
    -[m+1] >>> n = -[m >>>n +1]

Int.negSucc m >>> n = Int.negSucc (m >>> n)


theorem totallyBounded_iff_ultrafilter {s : Set α} :
    TotallyBounded s ↔ ∀ f : Ultrafilter α, ↑f ≤ 𝓟 s → Cauchy (f : Filter α)

{α : Type u}
[uniformSpace : UniformSpace α]
{s : Set α}

TotallyBounded s ↔ ∀ (f : Ultrafilter α), ↑f ≤ 𝓟 s → Cauchy ↑f


@[ext]
theorem ext {φ₁ φ₂ : A →ₐ[R] B} (H : ∀ x, φ₁ x = φ₂ x) : φ₁ = φ₂

{R : Type u}
{A : Type v}
{B : Type w}
[CommSemiring R]
[Semiring A]
[Semiring B]
[Algebra R A]
[Algebra R B]
{φ₁ φ₂ : A →ₐ[R] B}
(H : ∀ (x : A), φ₁ x = φ₂ x)


theorem AntitoneOn.quasiconcaveOn (hf : AntitoneOn f s) (hs : Convex 𝕜 s) : QuasiconcaveOn 𝕜 s f

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_4}
[OrderedSemiring 𝕜]
[LinearOrderedAddCommMonoid E]
[OrderedAddCommMonoid β]
[Module 𝕜 E]
[OrderedSMul 𝕜 E]
{s : Set E}
{f : E → β}
(hf : AntitoneOn f s)
(hs : Convex 𝕜 s)


/-- The `tsupport`s of a smooth partition of unity are locally finite. -/
theorem finite_tsupport : {i | x₀ ∈ tsupport (ρ i)}.Finite

{ι : Type uι}
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{H : Type uH}
[TopologicalSpace H]
{I : ModelWithCorners ℝ E H}
{M : Type uM}
[TopologicalSpace M]
[ChartedSpace H M]
{s : Set M}
(ρ : SmoothPartitionOfUnity ι I M s)
(x₀ : M)


theorem fg_induction (R M : Type*) [Semiring R] [AddCommMonoid M] [Module R M]
    (P : Submodule R M → Prop) (h₁ : ∀ x, P (Submodule.span R {x}))
    (h₂ : ∀ M₁ M₂, P M₁ → P M₂ → P (M₁ ⊔ M₂)) (N : Submodule R M) (hN : N.FG) : P N

(h₁ : ∀ (x : M), P (Submodule.span R {x}))

(h₂ : ∀ (M₁ M₂ : Submodule R M), P M₁ → P M₂ → P (M₁ ⊔ M₂))


@[simp] theorem sup_neBot {f g : Filter α} : NeBot (f ⊔ g) ↔ NeBot f ∨ NeBot g


@[simp]
theorem yz_succ (n : ℕ) : yz a1 (n + 1) = xz a1 n + yz a1 n * az a

Pell.yz a1 (n + 1) = Pell.xz a1 n + Pell.yz a1 n * Pell.az a


lemma mk_inj_left {a : α} {b₁ b₂ : β} : (a, b₁) = (a, b₂) ↔ b₁ = b₂

{α : Type u_1}
{β : Type u_2}
{a : α}
{b₁ b₂ : β}


@[simp]
theorem linHom_apply (g : G) (f : V →ₗ[k] W) : (linHom ρV ρW) g f = ρW g ∘ₗ f ∘ₗ ρV g⁻¹

{k : Type u_1}
{G : Type u_2}
{V : Type u_3}
{W : Type u_4}
[CommSemiring k]
[Group G]
[AddCommMonoid V]
[Module k V]
[AddCommMonoid W]
[Module k W]
(ρV : Representation k G V)
(ρW : Representation k G W)
(g : G)
(f : V →ₗ[k] W)

((ρV.linHom ρW) g) f = ρW g ∘ₗ f ∘ₗ ρV g⁻¹


/-- The category of sheaves taking values in Type is the same as the category of set-valued sheaves.
-/
@[simps]
def sheafEquivSheafOfTypes : Sheaf J (Type w) ≌ SheafOfTypes J

(J : CategoryTheory.GrothendieckTopology C)

((CategoryTheory.sheafEquivSheafOfTypes J).inverse.obj S).val = S.val


theorem map_map (g : L →+* M) (f : K →+* L) : (s.map f).map g = s.map (g.comp f)

{K : Type u}
{L : Type v}
{M : Type w}
[DivisionRing K]
[DivisionRing L]
[DivisionRing M]
(s : Subfield K)
(g : L →+* M)
(f : K →+* L)

Subfield.map g (Subfield.map f s) = Subfield.map (g.comp f) s


/-- Adjoins a `⊥` to the domain and codomain of a `SupHom`. -/
@[simps]
protected def withBot (f : SupHom α β) : SupBotHom (WithBot α) (WithBot β)

{α : Type u_3}
{β : Type u_4}
[SemilatticeSup α]
[SemilatticeSup β]
(f : SupHom α β)

∀ (a : Option α), f.withBot.toSupHom a = Option.map (⇑f) a


protected theorem id [pα : Preorder α] : @GaloisConnection α α pα pα id id


/-- It is equivalent to compute the product of a function over `Fin n` or `Finset.range n`. -/
@[to_additive "It is equivalent to sum a function over `fin n` or `finset.range n`."]
theorem Fin.prod_univ_eq_prod_range [CommMonoid α] (f : ℕ → α) (n : ℕ) :
    ∏ i : Fin n, f i = ∏ i ∈ range n, f i

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

∑ i : Fin n, f ↑i = ∑ i ∈ Finset.range n, f i


lemma not_isUnramified_iff_card_stabilizer_eq_two [IsGalois k K] :
    ¬ IsUnramified k w ↔ Nat.card (Stab w) = 2

{k : Type u_1}
[Field k]
{K : Type u_2}
[Field K]
[Algebra k K]
{w : NumberField.InfinitePlace K}
[IsGalois k K]

¬NumberField.InfinitePlace.IsUnramified k w ↔ Nat.card ↥(MulAction.stabilizer (K ≃ₐ[k] K) w) = 2


/-- A mixin for right cancellative multiplication by nonzero elements. -/
class IsRightCancelMulZero (M₀ : Type u) [Mul M₀] [Zero M₀] : Prop where
  /-- Multiplicatin by a nonzero element is right cancellative. -/
  protected mul_right_cancel_of_ne_zero : ∀ {a b c : M₀}, b ≠ 0 → a * b = c * b → a = c

{M₀ : Type u}
[Mul M₀]
[Zero M₀]
[self : IsRightCancelMulZero M₀]
{a b c : M₀}


@[simp]
lemma of_counit {X : Type v} [AddCommGroup X] [Module R X] [Coalgebra R X] :
    Coalgebra.counit (A := of R X) = Coalgebra.counit (R := R) (A := X)

{R : Type u}
[CommRing R]
{X : Type v}
[AddCommGroup X]
[Module R X]
[Coalgebra R X]


theorem Integrable.inf {β} [NormedLatticeAddCommGroup β] {f g : α → β} (hf : Integrable f μ)
    (hg : Integrable g μ) : Integrable (f ⊓ g) μ

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{β : Type u_5}
[NormedLatticeAddCommGroup β]
{f g : α → β}
(hf : MeasureTheory.Integrable f μ)
(hg : MeasureTheory.Integrable g μ)


@[simp]
theorem inner_zero_right (x : E) : ⟪x, 0⟫ = 0

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
(x : E)


@[to_additive]
theorem lcm_orderOf_eq_exponent [Fintype G] : (Finset.univ : Finset G).lcm orderOf = exponent G

Finset.univ.lcm addOrderOf = AddMonoid.exponent G


lemma isEquivalent_one_sub_smoothingFn_one : (fun x => 1 - ε x) ~[atTop] (fun _ => (1 : ℝ))

(fun x => 1 - AkraBazziRecurrence.smoothingFn x) ~[Filter.atTop] fun x => 1


theorem ι_mul_prod_list {n : ℕ} (f : Fin n → M) (i : Fin n) :
    (ι R <| f i) * (List.ofFn fun i => ι R <| f i).prod = 0

{R : Type u1}
[CommRing R]
{M : Type u2}
[AddCommGroup M]
[Module R M]
{n : ℕ}
(f : Fin n → M)
(i : Fin n)

(ExteriorAlgebra.ι R) (f i) * (List.ofFn fun i => (ExteriorAlgebra.ι R) (f i)).prod = 0


@[to_additive (attr := simp)]
theorem singletonMonoidHom_apply (a : α) : singletonMonoidHom a = {a}


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

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


/-- Restriction of partial homeomorphisms respects equivalence -/
theorem EqOnSource.restr {e e' : PartialHomeomorph X Y} (he : e ≈ e') (s : Set X) :
    e.restr s ≈ e'.restr s

{X : Type u_1}
{Y : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
{e e' : PartialHomeomorph X Y}
(he : e ≈ e')
(s : Set X)


lemma subset_closure_of_subset (M : Matroid α) (hXY : X ⊆ Y) (hY : Y ⊆ M.E := by aesop_mat) :
    X ⊆ M.closure Y

{α : Type u_2}
{X Y : Set α}
(M : Matroid α)
(hXY : X ⊆ Y)
(hY : Y ⊆ M.E := by aesop_mat)


@[continuity, fun_prop]
theorem continuous_algebraMap [ContinuousSMul R A] : Continuous (algebraMap R A)

(R : Type u_1)
(A : Type u)
[CommSemiring R]
[Semiring A]
[Algebra R A]
[TopologicalSpace R]
[TopologicalSpace A]
[ContinuousSMul R A]


/-- If a closed set has a thickening with finite measure, then the measure of its
`r`-thickenings converge to its measure as `r > 0` tends to `0`. -/
theorem tendsto_measure_thickening_of_isClosed {μ : Measure α} {s : Set α}
    (hs : ∃ R > 0, μ (thickening R s) ≠ ∞) (h's : IsClosed s) :
    Tendsto (fun r => μ (thickening r s)) (𝓝[>] 0) (𝓝 (μ s))

(hs : ∃ R > 0, μ (Metric.thickening R s) ≠ ⊤)

Filter.Tendsto (fun r => μ (Metric.thickening r s)) (𝓝[>] 0) (𝓝 (μ s))


@[simp]
protected theorem coe_mkOfOrthogonalEqBot (hsp : (span 𝕜 (Set.range v))ᗮ = ⊥) :
    ⇑(HilbertBasis.mkOfOrthogonalEqBot hv hsp) = v

(hsp : (Submodule.span 𝕜 (Set.range v))ᗮ = ⊥)

(fun i => (HilbertBasis.mkOfOrthogonalEqBot hv hsp).repr.symm (lp.single 2 i 1)) = v


/-- The augmented Čech conerve construction, as a functor from `Arrow C`. -/
@[simps]
def augmentedCechConerve : Arrow C ⥤ CosimplicialObject.Augmented C

[∀ (n : ℕ) (f : CategoryTheory.Arrow C), CategoryTheory.Limits.HasWidePushout f.left (fun x => f.right) fun x => f.hom]

∀ {X Y : CategoryTheory.Arrow C} (F : X ⟶ Y),
  CategoryTheory.CosimplicialObject.augmentedCechConerve.map F = CategoryTheory.Arrow.mapAugmentedCechConerve F


@[to_additive (attr := simp, nolint simpNF)]
theorem mul_map_seq (x y : FreeMagma α) :
    ((· * ·) <$> x <*> y : Id (FreeMagma α)) = (x * y : FreeMagma α)

(Seq.seq ((fun x x_1 => x + x_1) <$> x) fun x => y) = x + y


theorem logEmbedding_component_le {r : ℝ} {x : (𝓞 K)ˣ} (hr : 0 ≤ r) (h : ‖logEmbedding K x‖ ≤ r)
    (w : {w : InfinitePlace K // w ≠ w₀}) : |logEmbedding K x w| ≤ r

(h : ‖(NumberField.Units.logEmbedding K) x‖ ≤ r)

(w : { w // w ≠ NumberField.Units.dirichletUnitTheorem.w₀ })

|(NumberField.Units.logEmbedding K) x w| ≤ r


theorem pi_univ_Ioc_update_union (x y : ∀ i, α i) (i₀ : ι) (m : α i₀) (hm : m ∈ Icc (x i₀) (y i₀)) :
    ((pi univ fun i ↦ Ioc (x i) (update y i₀ m i)) ∪
        pi univ fun i ↦ Ioc (update x i₀ m i) (y i)) =
      pi univ fun i ↦ Ioc (x i) (y i)

{ι : Type u_1}
{α : ι → Type u_2}
[DecidableEq ι]
[(i : ι) → LinearOrder (α i)]
(x y : (i : ι) → α i)
(i₀ : ι)
(m : α i₀)
(hm : m ∈ Set.Icc (x i₀) (y i₀))

((Set.univ.pi fun i => Set.Ioc (x i) (Function.update y i₀ m i)) ∪
    Set.univ.pi fun i => Set.Ioc (Function.update x i₀ m i) (y i)) =
  Set.univ.pi fun i => Set.Ioc (x i) (y i)


theorem sin_sub_nat_mul_pi (x : ℝ) (n : ℕ) : sin (x - n * π) = (-1) ^ n * sin x

Real.sin (x - ↑n * Real.pi) = (-1) ^ n * Real.sin x


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

{M : Type u_1}
{N : Type u_2}
[Add M]
[Add N]
{f : AddHom M N}
{S : AddSubsemigroup N}
(h : S ≤ f.srange)

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


protected lemma IsMono.reindex {eη : η ≃ η'} {eα : α ≃ α'} {eι : ι ≃ ι'} {C : (ι → α) → κ}
    (hl : l.IsMono C) : (l.reindex eη eα eι).IsMono fun x ↦ C <| eα.symm ∘ x ∘ eι

(hl : Combinatorics.Subspace.IsMono C l)

Combinatorics.Subspace.IsMono (fun x => C (⇑eα.symm ∘ x ∘ ⇑eι)) (l.reindex eη eα eι)


/-- Characterization of continuous functions (at a point, within a set) into a fiber bundle. -/
theorem continuousWithinAt_totalSpace (f : X → TotalSpace F E) {s : Set X} {x₀ : X} :
    ContinuousWithinAt f s x₀ ↔
      ContinuousWithinAt (fun x => (f x).proj) s x₀ ∧
        ContinuousWithinAt (fun x => ((trivializationAt F E (f x₀).proj) (f x)).2) s x₀

[TopologicalSpace (Bundle.TotalSpace F E)]

ContinuousWithinAt f s x₀ ↔
  ContinuousWithinAt (fun x => (f x).proj) s x₀ ∧
    ContinuousWithinAt (fun x => (↑(trivializationAt F E (f x₀).proj) (f x)).2) s x₀


theorem count_finset_sup [DecidableEq β] (s : Finset α) (f : α → Multiset β) (b : β) :
    count b (s.sup f) = s.sup fun a => count b (f a)

{α : Type u_2}
{β : Type u_3}
[DecidableEq β]
(s : Finset α)
(f : α → Multiset β)
(b : β)

Multiset.count b (s.sup f) = s.sup fun a => Multiset.count b (f a)


theorem fract_add (a b : α) : ∃ z : ℤ, fract (a + b) - fract a - fract b = z

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

∃ z, Int.fract (a + b) - Int.fract a - Int.fract b = ↑z


theorem det_le {A : Matrix n n R} {abv : AbsoluteValue R S} {x : S} (hx : ∀ i j, abv (A i j) ≤ x) :
    abv A.det ≤ Nat.factorial (Fintype.card n) • x ^ Fintype.card n

{R : Type u_1}
{S : Type u_2}
[CommRing R]
[Nontrivial R]
[LinearOrderedCommRing S]
{n : Type u_3}
[Fintype n]
[DecidableEq n]
{A : Matrix n n R}
{abv : AbsoluteValue R S}
{x : S}
(hx : ∀ (i j : n), abv (A i j) ≤ x)

abv A.det ≤ (Fintype.card n).factorial • x ^ Fintype.card n


/-- If a family is convex independent, so is any subfamily given by composition of an embedding into
index type with the original family. -/
theorem ConvexIndependent.comp_embedding {ι' : Type*} (f : ι' ↪ ι) {p : ι → E}
    (hc : ConvexIndependent 𝕜 p) : ConvexIndependent 𝕜 (p ∘ f)

{𝕜 : Type u_1}
{E : Type u_2}
{ι : Type u_3}
[OrderedSemiring 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{ι' : Type u_4}
(f : ι' ↪ ι)
{p : ι → E}
(hc : ConvexIndependent 𝕜 p)


theorem div_lt {a b c : Ordinal} (b0 : b ≠ 0) : a / b < c ↔ a < b * c


@[simp]
theorem const_inj [Nonempty α] {y₁ y₂ : β} : const α y₁ = const α y₂ ↔ y₁ = y₂

{α : Sort u_1}
{β : Sort u_2}
[Nonempty α]
{y₁ y₂ : β}

Function.const α y₁ = Function.const α y₂ ↔ y₁ = y₂


/-- We now define `MetricSpace`, extending `PseudoMetricSpace`. -/
class MetricSpace (α : Type u) extends PseudoMetricSpace α : Type u where
  eq_of_dist_eq_zero : ∀ {x y : α}, dist x y = 0 → x = y

{α : Type u}
[self : MetricSpace α]
{x y : α}


@[simp]
theorem content_C {r : R} : (C r).content = normalize r

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


@[simp]
theorem fderiv_exp (hc : DifferentiableAt ℝ f x) :
    fderiv ℝ (fun x => Real.exp (f x)) x = Real.exp (f x) • fderiv ℝ f x

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : E → ℝ}
{x : E}
(hc : DifferentiableAt ℝ f x)


theorem testBit_land : ∀ m n k, testBit (m &&& n) k = (testBit m k && testBit n k)

(m &&& n).testBit k = (m.testBit k && n.testBit k)


theorem isTransitive_iff_sUnion_subset : x.IsTransitive ↔ (⋃₀ x : ZFSet) ⊆ x


theorem ωSup_apply_ωSup (c₀ : Chain (α →𝒄 β)) (c₁ : Chain α) :
    ωSup c₀ (ωSup c₁) = Prod.apply (ωSup (c₀.zip c₁))

(c₀ : OmegaCompletePartialOrder.Chain (α →𝒄 β))

(c₁ : OmegaCompletePartialOrder.Chain α)

(OmegaCompletePartialOrder.ωSup c₀) (OmegaCompletePartialOrder.ωSup c₁) =
  OmegaCompletePartialOrder.ContinuousHom.Prod.apply (OmegaCompletePartialOrder.ωSup (c₀.zip c₁))


@[simp]
theorem right_sub_midpoint (v₁ v₂ : V) : v₂ - midpoint R v₁ v₂ = (⅟ 2 : R) • (v₂ - v₁)

{R : Type u_1}
{V : Type u_2}
[Ring R]
[Invertible 2]
[AddCommGroup V]
[Module R V]
(v₁ v₂ : V)


theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf x r) (v : Fin 0 → E) :
    pf 0 v = f x

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


/-- If a family is anisotropic then its components must be. The converse is not true. -/
theorem anisotropic_of_pi [Fintype ι]
    {Q : ∀ i, QuadraticMap R (Mᵢ i) P} (h : (pi Q).Anisotropic) : ∀ i, (Q i).Anisotropic

{ι : Type u_1}
{R : Type u_2}
{P : Type u_7}
{Mᵢ : ι → Type u_8}
[CommSemiring R]
[(i : ι) → AddCommMonoid (Mᵢ i)]
[AddCommMonoid P]
[(i : ι) → Module R (Mᵢ i)]
[Module R P]
[Fintype ι]
{Q : (i : ι) → QuadraticMap R (Mᵢ i) P}
(h : (QuadraticMap.pi Q).Anisotropic)
(i : ι)


/-- An `affineCombination` equals a point if that point is in the set
and has weight 1 and the other points in the set have weight 0. -/
@[simp]
theorem affineCombination_of_eq_one_of_eq_zero (w : ι → k) (p : ι → P) {i : ι} (his : i ∈ s)
    (hwi : w i = 1) (hw0 : ∀ i2 ∈ s, i2 ≠ i → w i2 = 0) : s.affineCombination k p w = p i

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[S : AffineSpace V P]
{ι : Type u_4}
(s : Finset ι)
(w : ι → k)
(p : ι → P)
{i : ι}
(his : i ∈ s)
(hwi : w i = 1)
(hw0 : ∀ i2 ∈ s, i2 ≠ i → w i2 = 0)

(Finset.affineCombination k s p) w = p i


lemma isIso₂_of_shortExact_of_isIso₁₃ [Balanced C] {S₁ S₂ : ShortComplex C} (φ : S₁ ⟶ S₂)
    (h₁ : S₁.ShortExact) (h₂ : S₂.ShortExact) [IsIso φ.τ₁] [IsIso φ.τ₃] : IsIso φ.τ₂

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Preadditive C]
[CategoryTheory.Balanced C]
{S₁ S₂ : CategoryTheory.ShortComplex C}
(φ : S₁ ⟶ S₂)
(h₁ : S₁.ShortExact)
(h₂ : S₂.ShortExact)
[CategoryTheory.IsIso φ.τ₁]
[CategoryTheory.IsIso φ.τ₃]


@[reassoc]
lemma rightHomologyMap'_comp (φ₁ : S₁ ⟶ S₂) (φ₂ : S₂ ⟶ S₃)
    (h₁ : S₁.RightHomologyData) (h₂ : S₂.RightHomologyData) (h₃ : S₃.RightHomologyData) :
    rightHomologyMap' (φ₁ ≫ φ₂) h₁ h₃ = rightHomologyMap' φ₁ h₁ h₂ ≫
      rightHomologyMap' φ₂ h₂ h₃

{S₁ S₂ S₃ : CategoryTheory.ShortComplex C}

(φ₁ : S₁ ⟶ S₂)

(φ₂ : S₂ ⟶ S₃)

CategoryTheory.ShortComplex.rightHomologyMap' (CategoryTheory.CategoryStruct.comp φ₁ φ₂) h₁ h₃ =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.ShortComplex.rightHomologyMap' φ₁ h₁ h₂)
    (CategoryTheory.ShortComplex.rightHomologyMap' φ₂ h₂ h₃)


{α : Type u_1}
[CanonicallyOrderedAddCommMonoid α]
[Sub α]
[OrderedSub α]
(a : α)


theorem chain'_cons' {x l} : Chain' R (x :: l) ↔ (∀ y ∈ head? l, R x y) ∧ Chain' R l

{α : Type u}
{R : α → α → Prop}
{x : α}
{l : List α}

List.Chain' R (x :: l) ↔ (∀ (y : α), y ∈ l.head? → R x y) ∧ List.Chain' R l


@[to_additive]
protected theorem zpow_mem {x : G} (hx : x ∈ K) : ∀ n : ℤ, x ^ n ∈ K

{G : Type u_1}
[Group G]
(K : Subgroup G)
{x : G}
(hx : x ∈ K)
(n : ℤ)


@[simp] theorem countable_empty : (∅ : Set α).Countable


theorem swapCore_self (r a : α) : swapCore a a r = r

{α : Sort u_1}
[DecidableEq α]
(r a : α)


/-- A functor between preorder categories is monotone.
-/
@[mono]
theorem Functor.monotone (f : X ⥤ Y) : Monotone f.obj

{X : Type u}
{Y : Type v}
[Preorder X]
[Preorder Y]
(f : CategoryTheory.Functor X Y)


theorem not_mem_union : a ∉ s ∪ t ↔ a ∉ s ∧ a ∉ t

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


theorem comm (s t : Set X) : SeparatedNhds s t ↔ SeparatedNhds t s

{X : Type u_1}
[TopologicalSpace X]
(s t : Set X)


/-- `Fin.snoc` is the same as appending a one-tuple -/
theorem snoc_eq_append {α : Type*} (xs : Fin n → α) (x : α) :
    snoc xs x = append xs (cons x Fin.elim0)

{n : ℕ}
{α : Type u_1}
(xs : Fin n → α)
(x : α)

Fin.snoc xs x = Fin.append xs (Fin.cons x Fin.elim0)


protected theorem insert (hs : IsAntichain r s) (hl : ∀ ⦃b⦄, b ∈ s → a ≠ b → ¬r b a)
    (hr : ∀ ⦃b⦄, b ∈ s → a ≠ b → ¬r a b) : IsAntichain r (insert a s)

(hl : ∀ ⦃b : α⦄, b ∈ s → a ≠ b → ¬r b a)

(hr : ∀ ⦃b : α⦄, b ∈ s → a ≠ b → ¬r a b)


lemma segment_inter_eq_endpoint_of_linearIndependent_sub
    {c x y : E} (h : LinearIndependent 𝕜 ![x - c, y - c]) :
    [c -[𝕜] x] ∩ [c -[𝕜] y] = {c}


/-- Flipping arguments of monoid morphisms (`MonoidHom.flip`) as a monoid morphism. -/
@[to_additive (attr := simps)
      "Flipping arguments of additive monoid morphisms (`AddMonoidHom.flip`)
      as an additive monoid morphism."]
def flipHom {_ : MulOneClass M} {_ : MulOneClass N} {_ : CommMonoid P} :
    (M →* N →* P) →* N →* M →* P

{M : Type uM}
{N : Type uN}
{P : Type uP}

∀ {x : MulOneClass M} {x_1 : MulOneClass N} {x_2 : CommMonoid P} (f : M →* N →* P), MonoidHom.flipHom f = f.flip


/-- The product of a neighborhood of `s` and a neighborhood of `t` is a neighborhood of `s ×ˢ t`,
formulated in terms of a filter inequality. -/
theorem nhdsSet_prod_le (s : Set X) (t : Set Y) : 𝓝ˢ (s ×ˢ t) ≤ 𝓝ˢ s ×ˢ 𝓝ˢ t

{X : Type u_5}
{Y : Type u_6}
[TopologicalSpace X]
[TopologicalSpace Y]
(s : Set X)
(t : Set Y)

𝓝ˢ (s ×ˢ t) ≤ 𝓝ˢ s ×ˢ 𝓝ˢ t


theorem natDegree_mul (hp : p ≠ 0) (hq : q ≠ 0) : (p*q).natDegree = p.natDegree + q.natDegree

{R : Type u}
[Semiring R]
[NoZeroDivisors R]
{p q : R[X]}
(hp : p ≠ 0)
(hq : q ≠ 0)

(p * q).natDegree = p.natDegree + q.natDegree


@[simp] lemma to_WithUpperSet_symm_eq : (@toUpperSet α).symm = ofUpperSet


@[to_additive (attr := simp)]
theorem inv_ae : (ae μ)⁻¹ = ae μ

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

(MeasureTheory.ae μ)⁻¹ = MeasureTheory.ae μ


/-- **Roth's theorem** for `ℕ` as an asymptotic statement.

The maximum density of a 3AP-free set in `{1, ..., n}` goes to zero as `n` tends to infinity. -/
theorem rothNumberNat_isLittleO_id :
    IsLittleO atTop (fun N ↦ (rothNumberNat N : ℝ)) (fun N ↦ (N : ℝ))

(fun N => ↑(rothNumberNat N)) =o[Filter.atTop] fun N => ↑N


/-- Class `ProperlyDiscontinuousVAdd Γ T` says that the additive action `(+ᵥ) : Γ → T → T`
is properly discontinuous, that is, for any pair of compact sets `K, L` in `T`, only finitely many
`γ:Γ` move `K` to have nontrivial intersection with `L`.
-/
class ProperlyDiscontinuousVAdd (Γ : Type*) (T : Type*) [TopologicalSpace T] [VAdd Γ T] :
  Prop where
  /-- Given two compact sets `K` and `L`, `γ +ᵥ K ∩ L` is nonempty for finitely many `γ`. -/
  finite_disjoint_inter_image :
    ∀ {K L : Set T}, IsCompact K → IsCompact L → Set.Finite { γ : Γ | (γ +ᵥ ·) '' K ∩ L ≠ ∅ }

{Γ : Type u_4}
{T : Type u_5}
[TopologicalSpace T]
[VAdd Γ T]
[self : ProperlyDiscontinuousVAdd Γ T]
{K L : Set T}

IsCompact K → IsCompact L → {γ | (fun x => γ +ᵥ x) '' K ∩ L ≠ ∅}.Finite


theorem mem_nil_iff (a : α) : a ∈ ([] : List α) ↔ False


/-- If `i : K →+* L` is a ring homomorphism of characteristic `p` rings, then it is called
`p`-radical if the following conditions are satisfied:

- For any element `x` of `L` there is `n : ℕ` such that `x ^ (p ^ n)` is contained in `K`.
- The kernel of `i` is contained in the `p`-nilradical of `K`.

It is a generalization of purely inseparable extension for fields. -/
@[mk_iff]
class IsPRadical : Prop where
  pow_mem' : ∀ x : L, ∃ (n : ℕ) (y : K), i y = x ^ p ^ n
  ker_le' : RingHom.ker i ≤ pNilradical K p

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

IsPRadical i p ↔ (∀ (x : L), ∃ n y, i y = x ^ p ^ n) ∧ RingHom.ker i ≤ pNilradical K p