@[simp] lemma image_add_right_Ico (a b c : α) : (Ico a b).image (· + c) = Ico (a + c) (b + c)

{α : Type u_2}
[OrderedCancelAddCommMonoid α]
[ExistsAddOfLE α]
[LocallyFiniteOrder α]
[DecidableEq α]
(a b c : α)

Finset.image (fun x => x + c) (Finset.Ico a b) = Finset.Ico (a + c) (b + c)


/-- The centroid of a single point. -/
@[simp]
theorem centroid_singleton (p : ι → P) (i : ι) : ({i} : Finset ι).centroid k p = p i

(k : Type u_1)
{V : Type u_2}
{P : Type u_3}
[DivisionRing k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{ι : Type u_4}
(p : ι → P)
(i : ι)


theorem mem_iff_one_sub_mem {t : β} : t ∈ Ioo (0 : β) 1 ↔ 1 - t ∈ Ioo (0 : β) 1


@[to_additive]
theorem finprod_set_coe_eq_finprod_mem (s : Set α) : ∏ᶠ j : s, f j = ∏ᶠ i ∈ s, f i

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

∏ᶠ (j : ↑s), f ↑j = ∏ᶠ (i : α) (_ : i ∈ s), f i


@[simp]
theorem sin_pi_div_two : sin (π / 2) = 1


theorem card_fintype_Icc_of_le (h : a ≤ b + 1) : (Fintype.card (Set.Icc a b) : ℤ) = b + 1 - a

↑(Fintype.card ↑(Set.Icc a b)) = b + 1 - a


@[simp]
theorem levenshtein_nil_cons (y) (ys) :
    levenshtein C [] (y :: ys) = C.insert y + levenshtein C [] ys

{α : Type u_1}
{β : Type u_2}
{δ : Type u_3}
[AddZeroClass δ]
[Min δ]
{C : Levenshtein.Cost α β δ}
(y : β)
(ys : List β)


theorem IsGreatest.dual (h : IsGreatest s a) : IsLeast (ofDual ⁻¹' s) (toDual a)

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

IsLeast (⇑OrderDual.ofDual ⁻¹' s) (OrderDual.toDual a)


/-- If `φ : S₁ ⟶ S₂` is a morphism of short complexes such that `φ.τ₁` is epi, `φ.τ₂` is an iso
and `φ.τ₃` is mono, then a left homology data for `S₂` induces a left homology data for `S₁` with
the same `K` and `H` fields. The inverse construction is `ofEpiOfIsIsoOfMono`. -/
@[simps]
noncomputable def ofEpiOfIsIsoOfMono' (φ : S₁ ⟶ S₂) (h : LeftHomologyData S₂)
    [Epi φ.τ₁] [IsIso φ.τ₂] [Mono φ.τ₃] : LeftHomologyData S₁

(CategoryTheory.ShortComplex.LeftHomologyData.ofEpiOfIsIsoOfMono' φ h).H = h.H


@[simp]
theorem nil_toMultiset : nil.toMultiset = (0 : Multiset α)


@[simp]
lemma _root_.finCongr_refl (h : n = n := rfl) : finCongr h = Equiv.refl (Fin n)


theorem condexpL1_congr_ae (hm : m ≤ m0) [SigmaFinite (μ.trim hm)] (h : f =ᵐ[μ] g) :
    condexpL1 hm μ f = condexpL1 hm μ g

{α : Type u_1}
{F' : Type u_4}
[NormedAddCommGroup F']
[NormedSpace ℝ F']
[CompleteSpace F']
{m m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f g : α → F'}
(hm : m ≤ m0)
[MeasureTheory.SigmaFinite (μ.trim hm)]
(h : f =ᵐ[μ] g)

MeasureTheory.condexpL1 hm μ f = MeasureTheory.condexpL1 hm μ g


theorem coe_fn_injective : @Function.Injective (A →ₐc[R] B) (A → B) (↑)

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[Semiring B]
[Algebra R B]
[CoalgebraStruct R A]
[CoalgebraStruct R B]


theorem connectedComponentIn_mem_nhds [LocallyConnectedSpace α] {F : Set α} {x : α} (h : F ∈ 𝓝 x) :
    connectedComponentIn F x ∈ 𝓝 x

{α : Type u}
[TopologicalSpace α]
[LocallyConnectedSpace α]
{F : Set α}
{x : α}
(h : F ∈ 𝓝 x)


@[simp]
theorem rTensorHomToHomRTensor_apply (f : M →ₗ[R] P) (q : Q) (m : M) :
    rTensorHomToHomRTensor R M P Q (f ⊗ₜ q) m = f m ⊗ₜ q

{R : Type u_1}
[CommSemiring R]
{M : Type u_4}
{P : Type u_6}
{Q : Type u_7}
[AddCommMonoid M]
[AddCommMonoid P]
[AddCommMonoid Q]
[Module R M]
[Module R P]
[Module R Q]
(f : M →ₗ[R] P)
(q : Q)
(m : M)

((TensorProduct.rTensorHomToHomRTensor R M P Q) (f ⊗ₜ[R] q)) m = f m ⊗ₜ[R] q


/-- This is basically just `yoneda.obj η : (Over A)ᵒᵖ ⥤ Type (max u v)` restricted along the
    forgetful functor `CostructuredArrow yoneda A ⥤ Over A`, but done in a way that we land in a
    smaller universe. -/
@[simps]
def restrictedYonedaObj {F : Cᵒᵖ ⥤ Type v} (η : F ⟶ A) :
    (CostructuredArrow yoneda A)ᵒᵖ ⥤ Type v

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

(s : (CategoryTheory.CostructuredArrow CategoryTheory.yoneda A)ᵒᵖ)

(CategoryTheory.OverPresheafAux.restrictedYonedaObj η).obj s =
  CategoryTheory.OverPresheafAux.OverArrows η (Opposite.unop s).hom


@[to_additive (attr := simp)]
lemma insertNth_one_right [∀ j, One (α j)] (i : Fin (n + 1)) (x : α i) :
    i.insertNth x 1 = Pi.mulSingle i x

{n : ℕ}
{α : Fin (n + 1) → Type u_1}
[(j : Fin (n + 1)) → Zero (α j)]
(i : Fin (n + 1))
(x : α i)


/-- The composition of two bundled monotone functions, a fully bundled version. -/
@[simps! (config := .asFn)]
def compₘ : (β →o γ) →o (α →o β) →o α →o γ

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[Preorder α]
[Preorder β]
[Preorder γ]
(x : β →o γ)

∀ (a : α →o β), ⇑((OrderHom.compₘ x) a) = ⇑x ∘ ⇑a


theorem coe_ringHom_injective : Function.Injective ((↑) : (A →ₐ[R] B) → A →+* B)

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


theorem inter_def [Inter α] (a b : Part α) : a ∩ b = bind a fun y => map (y ∩ ·) b

a ∩ b = do
  let y ← a
  Part.map (fun x => y ∩ x) b


@[simp]
theorem range_im : range im = univ


lemma ConcaveOn.mul_convexOn' (hf : ConcaveOn 𝕜 s f) (hg : ConvexOn 𝕜 s g)
    (hf₀ : ∀ ⦃x⦄, x ∈ s → f x ≤ 0) (hg₀ : ∀ ⦃x⦄, x ∈ s → 0 ≤ g x) (hfg : AntivaryOn f g s) :
    ConcaveOn 𝕜 s (f • g)

{𝕜 : Type u_1}
{E : Type u_2}
[LinearOrderedCommRing 𝕜]
[LinearOrderedCommRing E]
[Module 𝕜 E]
[OrderedSMul 𝕜 E]
{s : Set 𝕜}
[IsScalarTower 𝕜 E E]
[SMulCommClass 𝕜 E E]
{f g : 𝕜 → E}
(hf : ConcaveOn 𝕜 s f)
(hg : ConvexOn 𝕜 s g)
(hf₀ : ∀ ⦃x : 𝕜⦄, x ∈ s → f x ≤ 0)
(hg₀ : ∀ ⦃x : 𝕜⦄, x ∈ s → 0 ≤ g x)
(hfg : AntivaryOn f g s)


/-- `WithLp.equiv` bundled as an algebra isomorphism with `Unitization 𝕜 A`. -/
@[simps!]
def unitizationAlgEquiv (R : Type*) [CommSemiring R] [Algebra R 𝕜] [DistribMulAction R A]
    [IsScalarTower R 𝕜 A] : WithLp 1 (Unitization 𝕜 A) ≃ₐ[R] Unitization 𝕜 A

{𝕜 : Type u_1}
{A : Type u_2}
[NormedField 𝕜]
[NonUnitalNormedRing A]
[NormedSpace 𝕜 A]
[IsScalarTower 𝕜 A A]
[SMulCommClass 𝕜 A A]
(R : Type u_3)
[CommSemiring R]
[Algebra R 𝕜]
[DistribMulAction R A]
[IsScalarTower R 𝕜 A]
(a : WithLp 1 (Unitization 𝕜 A))

(WithLp.unitizationAlgEquiv R).symm a = a


theorem map_pi_map_coprodᵢ_le :
    map (fun k : ∀ i, α i => fun i => m i (k i)) (Filter.coprodᵢ f) ≤
      Filter.coprodᵢ fun i => map (m i) (f i)

{ι : Type u_1}
{α : ι → Type u_2}
{f : (i : ι) → Filter (α i)}
{β : ι → Type u_3}
{m : (i : ι) → α i → β i}

Filter.map (fun k i => m i (k i)) (Filter.coprodᵢ f) ≤ Filter.coprodᵢ fun i => Filter.map (m i) (f i)


@[to_additive] lemma Perm.prod_eq (h : Perm l₁ l₂) : prod l₁ = prod l₂

{M : Type u_4}
[AddCommMonoid M]
{l₁ l₂ : List M}
(h : l₁ ~ l₂)


@[simp]
theorem εIso_hom : F.εIso.hom = F.ε

(F : CategoryTheory.MonoidalFunctor C D)


theorem modByMonic_eq_mod (p : R[X]) (hq : Monic q) : p %ₘ q = p % q

{R : Type u}
[Field R]
{q : R[X]}
(p : R[X])
(hq : q.Monic)


/-- Structure recording good behavior of a property of a triple `(f, s, x)` where `f` is a function,
`s` a set and `x` a point. Good behavior here means locality and invariance under given groupoids
(both in the source and in the target). Given such a good behavior, the lift of this property
to charted spaces admitting these groupoids will inherit the good behavior. -/
structure LocalInvariantProp (P : (H → H') → Set H → H → Prop) : Prop where
  is_local : ∀ {s x u} {f : H → H'}, IsOpen u → x ∈ u → (P f s x ↔ P f (s ∩ u) x)
  right_invariance' : ∀ {s x f} {e : PartialHomeomorph H H},
    e ∈ G → x ∈ e.source → P f s x → P (f ∘ e.symm) (e.symm ⁻¹' s) (e x)
  congr_of_forall : ∀ {s x} {f g : H → H'}, (∀ y ∈ s, f y = g y) → f x = g x → P f s x → P g s x
  left_invariance' : ∀ {s x f} {e' : PartialHomeomorph H' H'},
    e' ∈ G' → s ⊆ f ⁻¹' e'.source → f x ∈ e'.source → P f s x → P (e' ∘ f) s x

{H : Type u_1}
{H' : Type u_3}
[TopologicalSpace H]
[TopologicalSpace H']
{G : StructureGroupoid H}
{G' : StructureGroupoid H'}
{P : (H → H') → Set H → H → Prop}
(self : G.LocalInvariantProp G' P)
{s : Set H}
{x : H}
{f g : H → H'}


lemma ofColex_toColex (s : Finset α) : ofColex (toColex s) = s


theorem count_of_forall {n : ℕ} (hp : ∀ n' < n, p n') : count p n = n

{p : ℕ → Prop}
[DecidablePred p]
{n : ℕ}
(hp : ∀ n' < n, p n')


/-- A class saying that the equivalence `e` transports the Grothendieck topology `J` to `K`. -/
class TransportsGrothendieckTopology : Prop where
  /-- `K` is equal to the induced topology. -/
  eq_inducedTopology : K = e.inverse.inducedTopology J

{J : CategoryTheory.GrothendieckTopology C}

{K : CategoryTheory.GrothendieckTopology D}

[self : CategoryTheory.Equivalence.TransportsGrothendieckTopology J K e]


@[simp] theorem isClosed_empty : IsClosed (∅ : Set X)


@[to_additive (attr := simp)]
theorem toDual_div [Div α] (a b : α) : toDual (a / b) = toDual a / toDual b

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


theorem IsBlock.def_one {B : Set X} :
    IsBlock G B ↔ ∀ g : G, g • B = B ∨ Disjoint (g • B) B

{G : Type u_1}
[Group G]
{X : Type u_2}
[MulAction G X]
{B : Set X}

MulAction.IsBlock G B ↔ ∀ (g : G), g • B = B ∨ Disjoint (g • B) B


lemma hasRightHomology_of_iso {S₁ S₂ : ShortComplex C}
    (e : S₁ ≅ S₂) [HasRightHomology S₁] : HasRightHomology S₂


theorem coe_strictMono : StrictMono (fun a : α => (a : WithTop α))


/-- The snake input in the opposite category that is deduced from a snake input. -/
@[simps]
noncomputable def op : SnakeInput Cᵒᵖ

(S : CategoryTheory.ShortComplex.SnakeInput C)


theorem conjTranspose_list_sum [AddMonoid α] [StarAddMonoid α] (l : List (Matrix m n α)) :
    l.sumᴴ = (l.map conjTranspose).sum

{m : Type u_2}
{n : Type u_3}
{α : Type v}
[AddMonoid α]
[StarAddMonoid α]
(l : List (Matrix m n α))

l.sumᴴ = (List.map Matrix.conjTranspose l).sum


@[to_additive (attr := simp)]
lemma units_bot : (⊥ : Submonoid M).units = ⊥


theorem eq_of_quickCmp {n n' : Name} : n.quickCmp n' = .eq → n = n'


theorem sigma_mono (hs : s₁ ⊆ s₂) (ht : ∀ i, t₁ i ⊆ t₂ i) : s₁.sigma t₁ ⊆ s₂.sigma t₂

{ι : Type u_1}
{α : ι → Type u_3}
{s₁ s₂ : Set ι}
{t₁ t₂ : (i : ι) → Set (α i)}
(hs : s₁ ⊆ s₂)
(ht : ∀ (i : ι), t₁ i ⊆ t₂ i)


/-- The functor `(C ⥤ D) ⥤ (Arrow C ⥤ Arrow D)` which sends
a functor `F : C ⥤ D` to `F.mapArrow`. -/
@[simps]
def mapArrowFunctor : (C ⥤ D) ⥤ (Arrow C ⥤ Arrow D)

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

∀ {X Y : CategoryTheory.Functor C D} (τ : X ⟶ Y) (f : CategoryTheory.Arrow C),
  (((CategoryTheory.Functor.mapArrowFunctor C D).map τ).app f).left = τ.app f.left


/-- The trace of an endomorphism of a direct sum is the sum of the traces on each component.

Note that it is important the statement gives the user definitional control over `p` since the
_type_ of the term `trace R p (f.restrict hp')` depends on `p`. -/
lemma trace_eq_sum_trace_restrict_of_eq_biSup
    [∀ i, Module.Finite R (N i)] [∀ i, Module.Free R (N i)]
    (s : Finset ι) (h : CompleteLattice.Independent <| fun i : s ↦ N i)
    {f : Module.End R M} (hf : ∀ i, MapsTo f (N i) (N i))
    (p : Submodule R M) (hp : p = ⨆ i ∈ s, N i)
    (hp' : MapsTo f p p := hp ▸ mapsTo_biSup_of_mapsTo (s : Set ι) hf) :
    trace R p (f.restrict hp') = ∑ i ∈ s, trace R (N i) (f.restrict (hf i))

(h : CompleteLattice.Independent fun i => N ↑i)

(hf : ∀ (i : ι), Set.MapsTo ⇑f ↑(N i) ↑(N i))

(LinearMap.trace R ↥p) (LinearMap.restrict f hp') = ∑ i ∈ s, (LinearMap.trace R ↥(N i)) (LinearMap.restrict f ⋯)


@[simp]
theorem LHom.setOf_realize_onFormula [L'.Structure M] (φ : L →ᴸ L') [φ.IsExpansionOn M]
    (ψ : L.Formula α) : (setOf (φ.onFormula ψ).Realize : Set (α → M)) = setOf ψ.Realize

{L : FirstOrder.Language}
{L' : FirstOrder.Language}
{M : Type w}
[L.Structure M]
{α : Type u'}
[L'.Structure M]
(φ : L →ᴸ L')
[φ.IsExpansionOn M]
(ψ : L.Formula α)

setOf (φ.onFormula ψ).Realize = setOf ψ.Realize


/-- Cardinality of an `Ioc` of finsets. -/
theorem card_Ioc_finset (h : s ⊆ t) : (Ioc s t).card = 2 ^ (t.card - s.card) - 1

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

(Finset.Ioc s t).card = 2 ^ (t.card - s.card) - 1


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


theorem normSq_eq_def' (z : K) : normSq z = ‖z‖ ^ 2


@[to_additive (attr := simp)]
theorem map_mk_nhds (x : M) : map (mk : M → Mᵈᵐᵃ) (𝓝 x) = 𝓝 (mk x)

{M : Type u_1}
[TopologicalSpace M]
(x : M)

Filter.map (⇑DomAddAct.mk) (𝓝 x) = 𝓝 (DomAddAct.mk x)


theorem image_const {s : Finset α} (h : s.Nonempty) (b : β) : (s.image fun _ => b) = singleton b

{α : Type u_1}
{β : Type u_2}
[DecidableEq β]
{s : Finset α}
(h : s.Nonempty)
(b : β)


@[to_additive (attr := simp)]
theorem map₂_mul : map₂ (· * ·) f g = f * g

Filter.map₂ (fun x x_1 => x + x_1) f g = f + g


@[simp]
theorem normUnit_mul_normUnit (a : α) : normUnit (a * normUnit a) = 1

{α : Type u_1}
[CancelCommMonoidWithZero α]
[NormalizationMonoid α]
(a : α)


@[gcongr] theorem rpow_le_rpow {x y : ℝ≥0} {z : ℝ} (h₁ : x ≤ y) (h₂ : 0 ≤ z) : x ^ z ≤ y ^ z


theorem mem_def : x ∈ s ↔ x ∈ Set.range s

{α : Type u_1}
{r : Rel α α}
{s : RelSeries r}
{x : α}


theorem rootSet_C_mul_X_pow [CommRing S] [IsDomain S] [Algebra R S] {n : ℕ} (hn : n ≠ 0) {a : R}
    (ha : a ≠ 0) : rootSet (C a * X ^ n) S = {0}

{R : Type u}
{S : Type v}
[Field R]
[CommRing S]
[IsDomain S]
[Algebra R S]
{n : ℕ}
(hn : n ≠ 0)
{a : R}
(ha : a ≠ 0)

(Polynomial.C a * Polynomial.X ^ n).rootSet S = {0}


theorem p_nonnunit : (p : ℤ_[p]) ∈ nonunits ℤ_[p]


lemma StrictAntiOn.image_Ico_subset (h : StrictAntiOn f (Icc a b)) :
    f '' Ico a b ⊆ Ioc (f b) (f a)

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


@[simp]
theorem range_list_get : range l.get = { x | x ∈ l }


theorem inf_right_eq_bot_iff (h : IsCompl y z) : x ⊓ z = ⊥ ↔ x ≤ y

{α : Type u_1}
[DistribLattice α]
[BoundedOrder α]
{x y z : α}
(h : IsCompl y z)


@[to_additive (attr := simp)]
theorem clift_apply_inl (f : FreeMonoid (M ⊕ N) →* P) (hM₁ hN₁ hM hN) (x : M) :
    clift f hM₁ hN₁ hM hN (inl x) = f (of (.inl x))

(hM₁ : f (FreeAddMonoid.of (Sum.inl 0)) = 0)

(hN₁ : f (FreeAddMonoid.of (Sum.inr 0)) = 0)

(hM :
  ∀ (x y : M), f (FreeAddMonoid.of (Sum.inl (x + y))) = f (FreeAddMonoid.of (Sum.inl x) + FreeAddMonoid.of (Sum.inl y)))

(hN :
  ∀ (x y : N), f (FreeAddMonoid.of (Sum.inr (x + y))) = f (FreeAddMonoid.of (Sum.inr x) + FreeAddMonoid.of (Sum.inr y)))

(AddMonoid.Coprod.clift f hM₁ hN₁ hM hN) (AddMonoid.Coprod.inl x) = f (FreeAddMonoid.of (Sum.inl x))


protected theorem map_mul (f : R →ₑ+*[φ] S) (x y : R) : f (x * y) = f x * f y

{M : Type u_1}
[Monoid M]
{N : Type u_2}
[Monoid N]
{φ : M →* N}
{R : Type u_10}
[Semiring R]
[MulSemiringAction M R]
{S : Type u_12}
[Semiring S]
[MulSemiringAction N S]
(f : R →ₑ+*[φ] S)
(x y : R)


theorem finset_sup_apply (p : ι → Seminorm 𝕜 E) (s : Finset ι) (x : E) :
    s.sup p x = ↑(s.sup fun i => ⟨p i x, apply_nonneg (p i) x⟩ : ℝ≥0)

{𝕜 : Type u_3}
{E : Type u_7}
{ι : Type u_12}
[SeminormedRing 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
(p : ι → Seminorm 𝕜 E)
(s : Finset ι)
(x : E)

(s.sup p) x = ↑(s.sup fun i => ⟨(p i) x, ⋯⟩)


theorem of_forall_separating_mem_iff (p : Set β → Prop)
    [HasCountableSeparatingOn β p univ] (h : ∀ U : Set β, p U → ∀ᶠ x in l, f x ∈ U ↔ g x ∈ U) :
    f =ᶠ[l] g

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


@[reassoc (attr := simp)]
theorem inl_pushoutAssoc_inv [HasPushout (g₃ ≫ (pushout.inr _ _ : X₂ ⟶ Y₁)) g₄]
    [HasPushout g₁ (g₂ ≫ (pushout.inl _ _ : X₂ ⟶ Y₂))] :
    pushout.inl _ _ ≫ (pushoutAssoc g₁ g₂ g₃ g₄).inv = pushout.inl _ _ ≫ pushout.inl _ _

[CategoryTheory.Limits.HasPushout (g₃ ≫ CategoryTheory.Limits.pushout.inr g₁ g₂) g₄]

[CategoryTheory.Limits.HasPushout g₁ (g₂ ≫ CategoryTheory.Limits.pushout.inl g₃ g₄)]

CategoryTheory.Limits.pushout.inl g₁ (g₂ ≫ CategoryTheory.Limits.pushout.inl g₃ g₄) ≫
    (CategoryTheory.Limits.pushoutAssoc g₁ g₂ g₃ g₄).inv =
  CategoryTheory.Limits.pushout.inl g₁ g₂ ≫
    CategoryTheory.Limits.pushout.inl (g₃ ≫ CategoryTheory.Limits.pushout.inr g₁ g₂) g₄


@[to_additive]
-- Porting note (#11119): removed `simp` attribute because `simpNF` says it can prove it.
theorem pure_smul_pure : (pure a : Filter α) • (pure b : Filter β) = pure (a • b)

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


lemma t2space_iff_isSeparatedMap (y : Y) : T2Space X ↔ IsSeparatedMap fun _ : X ↦ y

{X : Type u_1}
{Y : Sort u_2}
[TopologicalSpace X]
(y : Y)


lemma ContinuousOn.sup' (hf : ContinuousOn f s) (hg : ContinuousOn g s) :
    ContinuousOn (f ⊔ g) s

{L : Type u_1}
{X : Type u_2}
[TopologicalSpace L]
[TopologicalSpace X]
[Sup L]
[ContinuousSup L]
{f g : X → L}
{s : Set X}
(hf : ContinuousOn f s)
(hg : ContinuousOn g s)


@[simp]
theorem coe_mulHom_id : (NonUnitalRingHom.id α : α →ₙ* α) = MulHom.id α

{α : Type u_2}
[NonUnitalNonAssocSemiring α]


theorem dlookup_eq_none {a : α} {l : List (Sigma β)} : dlookup a l = none ↔ a ∉ l.keys

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


theorem range_subtype_map {p : α → Prop} {q : β → Prop} (f : α → β) (h : ∀ x, p x → q (f x)) :
    range (Subtype.map f h) = (↑) ⁻¹' (f '' { x | p x })

{α : Type u_1}
{β : Type u_2}
{p : α → Prop}
{q : β → Prop}
(f : α → β)
(h : ∀ (x : α), p x → q (f x))

Set.range (Subtype.map f h) = Subtype.val ⁻¹' (f '' {x | p x})


theorem Valid'.merge_aux₁ {o₁ o₂ ls ll lx lr rs rl rx rr t}
    (hl : Valid' o₁ (@Ordnode.node α ls ll lx lr) o₂) (hr : Valid' o₁ (.node rs rl rx rr) o₂)
    (h : delta * ls < rs) (v : Valid' o₁ t rx) (e : size t = ls + size rl) :
    Valid' o₁ (.balanceL t rx rr) o₂ ∧ size (.balanceL t rx rr) = ls + rs

(hl : Ordnode.Valid' o₁ (Ordnode.node ls ll lx lr) o₂)

(hr : Ordnode.Valid' o₁ (Ordnode.node rs rl rx rr) o₂)

Ordnode.Valid' o₁ (t.balanceL rx rr) o₂ ∧ (t.balanceL rx rr).size = ls + rs


@[simp]
lemma sumLexLift_inl_inr (a : α₁) (b : β₂) :
    sumLexLift f₁ f₂ g₁ g₂ (inl a) (inr b) = (g₁ a b).disjSum (g₂ a b)

{α₁ : Type u_1}
{α₂ : Type u_2}
{β₁ : Type u_3}
{β₂ : Type u_4}
{γ₁ : Type u_5}
{γ₂ : Type u_6}
(f₁ : α₁ → β₁ → Finset γ₁)
(f₂ : α₂ → β₂ → Finset γ₂)
(g₁ : α₁ → β₂ → Finset γ₁)
(g₂ : α₁ → β₂ → Finset γ₂)
(a : α₁)
(b : β₂)

Finset.sumLexLift f₁ f₂ g₁ g₂ (Sum.inl a) (Sum.inr b) = (g₁ a b).disjSum (g₂ a b)


@[to_additive]
theorem multipliable_subtype_iff_mulIndicator {s : Set β} :
    Multipliable (f ∘ (↑) : s → α) ↔ Multipliable (s.mulIndicator f)

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

Summable (f ∘ Subtype.val) ↔ Summable (s.indicator f)


theorem minpoly_dvd_charpoly {K : Type*} [Field K] (M : Matrix n n K) : minpoly K M ∣ M.charpoly

{n : Type v}
[DecidableEq n]
[Fintype n]
{K : Type u_1}
[Field K]
(M : Matrix n n K)


@[to_additive]
theorem prod_antidiagonal_swap {n : ℕ} {f : ℕ × ℕ → M} :
    ∏ p ∈ antidiagonal n, f p.swap = ∏ p ∈ antidiagonal n, f p

{M : Type u_1}
[CommMonoid M]
{n : ℕ}
{f : ℕ × ℕ → M}

∏ p ∈ Finset.antidiagonal n, f p.swap = ∏ p ∈ Finset.antidiagonal n, f p


theorem Lp.ae_eq_of_forall_setIntegral_eq (f g : Lp E p μ) (hp_ne_zero : p ≠ 0) (hp_ne_top : p ≠ ∞)
    (hf_int_finite : ∀ s, MeasurableSet s → μ s < ∞ → IntegrableOn f s μ)
    (hg_int_finite : ∀ s, MeasurableSet s → μ s < ∞ → IntegrableOn g s μ)
    (hfg : ∀ s : Set α, MeasurableSet s → μ s < ∞ → ∫ x in s, f x ∂μ = ∫ x in s, g x ∂μ) :
    f =ᵐ[μ] g

(hf_int_finite : ∀ (s : Set α), MeasurableSet s → μ s < ⊤ → MeasureTheory.IntegrableOn (↑↑f) s μ)

(hg_int_finite : ∀ (s : Set α), MeasurableSet s → μ s < ⊤ → MeasureTheory.IntegrableOn (↑↑g) s μ)

(hfg : ∀ (s : Set α), MeasurableSet s → μ s < ⊤ → ∫ (x : α) in s, ↑↑f x ∂μ = ∫ (x : α) in s, ↑↑g x ∂μ)

↑↑f =ᵐ[μ] ↑↑g


@[to_additive]
theorem comap_comap {P : Type*} [Group P] [TopologicalSpace P] (K : OpenSubgroup P) (f₂ : N →* P)
    (hf₂ : Continuous f₂) (f₁ : G →* N) (hf₁ : Continuous f₁) :
    (K.comap f₂ hf₂).comap f₁ hf₁ = K.comap (f₂.comp f₁) (hf₂.comp hf₁)

{G : Type u_1}
[AddGroup G]
[TopologicalSpace G]
{N : Type u_2}
[AddGroup N]
[TopologicalSpace N]
{P : Type u_3}
[AddGroup P]
[TopologicalSpace P]
(K : OpenAddSubgroup P)
(f₂ : N →+ P)
(hf₂ : Continuous ⇑f₂)
(f₁ : G →+ N)
(hf₁ : Continuous ⇑f₁)

OpenAddSubgroup.comap f₁ hf₁ (OpenAddSubgroup.comap f₂ hf₂ K) = OpenAddSubgroup.comap (f₂.comp f₁) ⋯ K


theorem C0_projOrd {x : I → Bool} (hx : x ∈ C0 C ho) : Proj (ord I · < o) x = x

(hsC : Profinite.NobelingProof.contained C (Order.succ o))

(ho : o < Ordinal.type fun x x_1 => x < x_1)

(hx : x ∈ Profinite.NobelingProof.C0 C ho)

Profinite.NobelingProof.Proj (fun x => Profinite.NobelingProof.ord I x < o) x = x


@[simp]
theorem csInf_pair (a b : α) : sInf {a, b} = a ⊓ b

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


theorem IsPrime.of_mem_or_mem [IsProper I] (hI : ∀ {x y : P}, x ⊓ y ∈ I → x ∈ I ∨ y ∈ I) :
    IsPrime I


/-- The convolution `f * g` is `C^n` when `f` is locally integrable and `g` is `C^n` and compactly
supported. Version where `g` depends on an additional parameter in an open subset `s` of a
parameter space `P` (and the compact support `k` is independent of the parameter in `s`),
given in terms of composition with an additional smooth function. -/
theorem contDiffOn_convolution_right_with_param_comp {n : ℕ∞} (L : E →L[𝕜] E' →L[𝕜] F) {s : Set P}
    {v : P → G} (hv : ContDiffOn 𝕜 n v s) {f : G → E} {g : P → G → E'} {k : Set G} (hs : IsOpen s)
    (hk : IsCompact k) (hgs : ∀ p, ∀ x, p ∈ s → x ∉ k → g p x = 0) (hf : LocallyIntegrable f μ)
    (hg : ContDiffOn 𝕜 n (↿g) (s ×ˢ univ)) : ContDiffOn 𝕜 n (fun x => (f ⋆[L, μ] g x) (v x)) s

(hgs : ∀ (p : P) (x : G), p ∈ s → x ∉ k → g p x = 0)

(hf : MeasureTheory.LocallyIntegrable f μ)

(hg : ContDiffOn 𝕜 n (↿g) (s ×ˢ Set.univ))

ContDiffOn 𝕜 n (fun x => MeasureTheory.convolution f (g x) L μ (v x)) s


/-- The **Erdős–Ginzburg–Ziv theorem** for `ℤ/nℤ`.

Any sequence of at least `2 * n - 1` elements of `ZMod n` contains a subsequence of `n` elements
whose sum is zero. -/
theorem ZMod.erdos_ginzburg_ziv (a : ι → ZMod n) (hs : 2 * n - 1 ≤ s.card) :
    ∃ t ⊆ s, t.card = n ∧ ∑ i ∈ t, a i = 0

{ι : Type u_1}
{n : ℕ}
{s : Finset ι}
(a : ι → ZMod n)
(hs : 2 * n - 1 ≤ s.card)


/-- Given a collection of isomorphisms between corresponding summands of a pair of biproducts
indexed by the same type, we obtain an isomorphism between the biproducts. -/
@[simps]
def biproduct.mapIso {f g : J → C} [HasBiproduct f] [HasBiproduct g] (p : ∀ b, f b ≅ g b) :
    ⨁ f ≅ ⨁ g

(CategoryTheory.Limits.biproduct.mapIso p).hom = CategoryTheory.Limits.biproduct.map fun b => (p b).hom


protected theorem mul_neg_one (a : Int) : a * -1 = -a


theorem mem_decode₂ [Encodable α] {n : ℕ} {a : α} : a ∈ decode₂ α n ↔ encode a = n

{α : Type u_1}
[Encodable α]
{n : ℕ}
{a : α}

a ∈ Encodable.decode₂ α n ↔ Encodable.encode a = n


theorem covBy_iff_coatom_Iic (h : a ≤ b) : a ⋖ b ↔ IsCoatom (⟨a, h⟩ : Set.Iic b)

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


theorem basis'_iff_basis (hX : X ⊆ M.E := by aesop_mat) : M.Basis' I X ↔ M.Basis I X

{α : Type u_1}
{M : Matroid α}
{I X : Set α}
(hX : X ⊆ M.E := by aesop_mat)


/-- Given a fiber functor `F` and a connected object `X` of `C`. Then `X` is Galois if and only if
the natural action of `Aut X` on `F.obj X` is transitive. -/
theorem isGalois_iff_pretransitive (X : C) [IsConnected X] :
    IsGalois X ↔ MulAction.IsPretransitive (Aut X) (F.obj X)

(F : CategoryTheory.Functor C FintypeCat)

CategoryTheory.PreGaloisCategory.IsGalois X ↔ MulAction.IsPretransitive (CategoryTheory.Aut X) ↑(F.obj X)


@[simp]
theorem toList_eq_singleton_iff {a : α} {m : Multiset α} : m.toList = [a] ↔ m = {a}


theorem det_toBlock (M : Matrix m m R) (p : m → Prop) [DecidablePred p] :
    M.det =
      (fromBlocks (toBlock M p p) (toBlock M p fun j => ¬p j) (toBlock M (fun j => ¬p j) p) <|
          toBlock M (fun j => ¬p j) fun j => ¬p j).det

{m : Type u_3}
{R : Type v}
[CommRing R]
[DecidableEq m]
[Fintype m]
(M : Matrix m m R)
(p : m → Prop)
[DecidablePred p]

M.det =
  (Matrix.fromBlocks (M.toBlock p p) (M.toBlock p fun j => ¬p j) (M.toBlock (fun j => ¬p j) p)
      (M.toBlock (fun j => ¬p j) fun j => ¬p j)).det


@[simp]
theorem mul_re (z w : ℂ) : (z * w).re = z.re * w.re - z.im * w.im


@[simp]
theorem algebraMap_eval_T (x : R) (n : ℤ) :
    algebraMap R A ((T R n).eval x) = (T A n).eval (algebraMap R A x)

{R : Type u_1}
{A : Type u_2}
[CommRing R]
[CommRing A]
[Algebra R A]
(x : R)
(n : ℤ)

(algebraMap R A) (Polynomial.eval x (Polynomial.Chebyshev.T R n)) =
  Polynomial.eval ((algebraMap R A) x) (Polynomial.Chebyshev.T A n)


theorem act_rel_act_of_rel_of_rel (ab : r a b) (cd : r c d) : r (mu a c) (mu b d)

[i' : CovariantClass N N (Function.swap mu) r]


theorem setToL1SCLM_mono_left' {T T' : Set α → E →L[ℝ] G''} {C C' : ℝ}
    (hT : DominatedFinMeasAdditive μ T C) (hT' : DominatedFinMeasAdditive μ T' C')
    (hTT' : ∀ s, MeasurableSet s → μ s < ∞ → ∀ x, T s x ≤ T' s x) (f : α →₁ₛ[μ] E) :
    setToL1SCLM α E μ hT f ≤ setToL1SCLM α E μ hT' f

(hT : MeasureTheory.DominatedFinMeasAdditive μ T C)

(hT' : MeasureTheory.DominatedFinMeasAdditive μ T' C')

(hTT' : ∀ (s : Set α), MeasurableSet s → μ s < ⊤ → ∀ (x : E), (T s) x ≤ (T' s) x)

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

(MeasureTheory.L1.SimpleFunc.setToL1SCLM α E μ hT) f ≤ (MeasureTheory.L1.SimpleFunc.setToL1SCLM α E μ hT') f


/-- The map sending a binary relation to the smallest congruence relation in which it is
    contained is idempotent. -/
@[to_additive addConGen_idem "The map sending a binary relation to the smallest additive
congruence relation in which it is contained is idempotent."]
theorem conGen_idem (r : M → M → Prop) : conGen (conGen r) = conGen r

{M : Type u_1}
[Mul M]
(r : M → M → Prop)


@[simp] lemma mem_mk {s : Set α} (hs) {a : α} : a ∈ mk s hs ↔ a ∈ s

{α : Type u_1}
[LE α]
{s : Set α}
(hs : IsUpperSet s)
{a : α}

a ∈ { carrier := s, upper' := hs } ↔ a ∈ s


@[simp]
lemma compares_lt [LT α] (a b : α) : Compares lt a b = (a < b)


theorem bliminf_eq_iSup_biInf {f : Filter β} {p : β → Prop} {u : β → α} :
    bliminf u f p = ⨆ s ∈ f, ⨅ (b) (_ : p b ∧ b ∈ s), u b

{α : Type u_1}
{β : Type u_2}
[CompleteLattice α]
{f : Filter β}
{p : β → Prop}
{u : β → α}

Filter.bliminf u f p = ⨆ s ∈ f, ⨅ b, ⨅ (_ : p b ∧ b ∈ s), u b


/-- Construct an adjunction between functors `F` and `G` given a unit and counit for the adjunction
satisfying the triangle identities. -/

@[simps!]
def mkOfUnitCounit (adj : CoreUnitCounit F G) : F ⊣ G

(adj : CategoryTheory.Adjunction.CoreUnitCounit F G)

((CategoryTheory.Adjunction.mkOfUnitCounit adj).homEquiv X Y).symm g =
  CategoryTheory.CategoryStruct.comp (F.map g) (adj.counit.app Y)


/-- An irreducible polynomial of prime degree with 1-3 non-real roots has full Galois group. -/
theorem galActionHom_bijective_of_prime_degree' {p : ℚ[X]} (p_irr : Irreducible p)
    (p_deg : p.natDegree.Prime)
    (p_roots1 : Fintype.card (p.rootSet ℝ) + 1 ≤ Fintype.card (p.rootSet ℂ))
    (p_roots2 : Fintype.card (p.rootSet ℂ) ≤ Fintype.card (p.rootSet ℝ) + 3) :
    Function.Bijective (galActionHom p ℂ)

(p_roots1 : Fintype.card ↑(p.rootSet ℝ) + 1 ≤ Fintype.card ↑(p.rootSet ℂ))

(p_roots2 : Fintype.card ↑(p.rootSet ℂ) ≤ Fintype.card ↑(p.rootSet ℝ) + 3)

Function.Bijective ⇑(Polynomial.Gal.galActionHom p ℂ)


/-- Version of `SequentialSpace.isProperMap_iff_isCompact_preimage` in terms of `cocompact`. -/
lemma SequentialSpace.isProperMap_iff_tendsto_cocompact [T2Space Y] [SequentialSpace Y] :
    IsProperMap f ↔ Continuous f ∧ Tendsto f (cocompact X) (cocompact Y)

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

IsProperMap f ↔ Continuous f ∧ Filter.Tendsto f (Filter.cocompact X) (Filter.cocompact Y)


@[to_additive]
lemma finite_mul : (s * t).Finite ↔ s.Finite ∧ t.Finite ∨ s = ∅ ∨ t = ∅

{α : Type u_2}
[Add α]
[IsLeftCancelAdd α]
[IsRightCancelAdd α]
{s t : Set α}

(s + t).Finite ↔ s.Finite ∧ t.Finite ∨ s = ∅ ∨ t = ∅


@[simp]
theorem subset_support_append_right {V : Type u} {G : SimpleGraph V} {u v w : V}
    (p : G.Walk u v) (q : G.Walk v w) : q.support ⊆ (p.append q).support


@[simp]
protected theorem one_mul [Fintype m] [DecidableEq m] (M : Matrix m n α) :
    (1 : Matrix m m α) * M = M

{m : Type u_2}
{n : Type u_3}
{α : Type v}
[NonAssocSemiring α]
[Fintype m]
[DecidableEq m]
(M : Matrix m n α)


protected theorem CliqueFree.cliqueFreeOn (hG : G.CliqueFree n) : G.CliqueFreeOn s n

{α : Type u_1}
(G : SimpleGraph α)
{s : Set α}
{n : ℕ}
(hG : G.CliqueFree n)


/-- Prefer `imageToKernel`. -/
@[simp]
theorem subobject_ofLE_as_imageToKernel (w : f ≫ g = 0) (h) :
    Subobject.ofLE (imageSubobject f) (kernelSubobject g) h = imageToKernel f g w

(h : CategoryTheory.Limits.imageSubobject f ≤ CategoryTheory.Limits.kernelSubobject g)

(CategoryTheory.Limits.imageSubobject f).ofLE (CategoryTheory.Limits.kernelSubobject g) h = imageToKernel f g w


theorem ι_jointly_surjective (x : 𝖣.glued) : ∃ (i : _) (y : D.U i), 𝖣.ι i y = x


protected theorem bind {f : α →. β} {g : α → β →. σ} (hf : Partrec f) (hg : Partrec₂ g) :
    Partrec fun a => (f a).bind (g a)

{α : Type u_1}
{β : Type u_2}
{σ : Type u_4}
[Primcodable α]
[Primcodable β]
[Primcodable σ]
{f : α →. β}
{g : α → β →. σ}
(hf : Partrec f)
(hg : Partrec₂ g)


/-- A **corner** of a set `A` in an abelian group is a triple of points of the form
`(x, y), (x + d, y), (x, y + d)`. It is **nontrivial** if `d ≠ 0`.

Here we define it as triples `(x₁, y₁), (x₂, y₁), (x₁, y₂)` where `x₁ + y₂ = x₂ + y₁` in order for
the definition to make sense in commutative monoids, the motivating example being `ℕ`. -/
@[mk_iff]
structure IsCorner (A : Set (G × G)) (x₁ y₁ x₂ y₂ : G) : Prop where
  fst_fst_mem : (x₁, y₁) ∈ A
  fst_snd_mem : (x₁, y₂) ∈ A
  snd_fst_mem : (x₂, y₁) ∈ A
  add_eq_add : x₁ + y₂ = x₂ + y₁

{G : Type u_1}
[AddCommMonoid G]
{A : Set (G × G)}
{x₁ y₁ x₂ y₂ : G}
(self : IsCorner A x₁ y₁ x₂ y₂)


@[simp]
theorem inclusion_mk {S T : Subalgebra R A} (h : S ≤ T) (x : A) (hx : x ∈ S) :
    inclusion h ⟨x, hx⟩ = ⟨x, h hx⟩

{R : Type u}
{A : Type v}
[CommSemiring R]
[Semiring A]
[Algebra R A]
{S T : Subalgebra R A}
(h : S ≤ T)
(x : A)
(hx : x ∈ S)

(Subalgebra.inclusion h) ⟨x, hx⟩ = ⟨x, ⋯⟩


@[simp]
theorem card_insertNone (s : Finset α) : s.insertNone.card = s.card + 1


@[simp, mfld_simps]
theorem restr_source (s : Set α) : (e.restr s).source = e.source ∩ s

{α : Type u_1}
{β : Type u_2}
(e : PartialEquiv α β)
(s : Set α)


theorem quotient (R : Type u) [CommRing R] (p : ℕ) [hp1 : Fact p.Prime] (hp2 : ↑p ∈ nonunits R) :
    CharP (R ⧸ (Ideal.span ({(p : R)} : Set R) : Ideal R)) p

(R : Type u)
[CommRing R]
(p : ℕ)
[hp1 : Fact (Nat.Prime p)]
(hp2 : ↑p ∈ nonunits R)


lemma annihilator_eq_ker_aeval [FaithfulSMul A M] :
    annihilator R[X] (AEval R M a) = RingHom.ker (aeval a)

{R : Type u_3}
{A : Type u_1}
{M : Type u_2}
[CommSemiring R]
[Semiring A]
(a : A)
[Algebra R A]
[AddCommMonoid M]
[Module A M]
[Module R M]
[IsScalarTower R A M]
[FaithfulSMul A M]

Module.annihilator R[X] (Module.AEval R M a) = RingHom.ker (Polynomial.aeval a)


/-- A type is `Small.{w}` if there exists an equivalence to some `S : Type w`.
-/
@[mk_iff, pp_with_univ]
class Small (α : Type v) : Prop where
  /-- If a type is `Small.{w}`, then there exists an equivalence with some `S : Type w` -/
  equiv_small : ∃ S : Type w, Nonempty (α ≃ S)


@[simp]
theorem _root_.Subalgebra.coe_valA' (p : Subalgebra R A) : ⇑p.valA = p.subtype

{R : Type u_1}
[CommSemiring R]
{A : Type u_2}
[Semiring A]
[TopologicalSpace A]
[Algebra R A]
(p : Subalgebra R A)


lemma closure_iUnion_closure_eq_closure_iUnion (M : Matroid α) (Xs : ι → Set α) :
    M.closure (⋃ i, M.closure (Xs i)) = M.closure (⋃ i, Xs i)

{ι : Type u_1}
{α : Type u_2}
(M : Matroid α)
(Xs : ι → Set α)


theorem coe_lieSpan_submodule_eq_iff {p : Submodule R L} :
    (lieSpan R L (p : Set L) : Submodule R L) = p ↔ ∃ K : LieSubalgebra R L, ↑K = p

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

(LieSubalgebra.lieSpan R L ↑p).toSubmodule = p ↔ ∃ K, K.toSubmodule = p


@[to_additive (attr := simp)]
theorem coe_coeMonoidHom : (coeMonoidHom : Finset α → Set α) = CoeTC.coe

{α : Type u_2}
[DecidableEq α]
[AddZeroClass α]


protected lemma _root_.sSupHom.continuous (f : sSupHom α β) : Continuous f

{α : Type u_1}
{β : Type u_2}
[CompleteLattice α]
[CompleteLattice β]
[TopologicalSpace α]
[Topology.IsUpper α]
[TopologicalSpace β]
[Topology.IsUpper β]
(f : sSupHom α β)


@[to_additive (attr := simp) mod_card_nsmul]
lemma pow_mod_card (a : G) (n : ℕ) : a ^ (n % card G) = a ^ n

{G : Type u_1}
[AddGroup G]
[Fintype G]
(a : G)
(n : ℕ)


theorem le_pointwise_smul_iff₀ {a : α} (ha : a ≠ 0) {S T : AddSubmonoid A} :
    S ≤ a • T ↔ a⁻¹ • S ≤ T

{α : Type u_1}
{A : Type u_5}
[AddMonoid A]
[GroupWithZero α]
[DistribMulAction α A]
{a : α}
(ha : a ≠ 0)
{S T : AddSubmonoid A}

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


theorem lcm_eq_lcm_image [DecidableEq α] : s.lcm f = (s.image f).lcm id

{α : Type u_2}
{β : Type u_3}
[CancelCommMonoidWithZero α]
[NormalizedGCDMonoid α]
{s : Finset β}
{f : β → α}
[DecidableEq α]


/-- **Fundamental theorem of calculus-1**: if `f : ℝ → E` is integrable on `a..b` and `f x` has
finite limits `ca` and `cb` almost surely as `x` tends to `a` and `b`, respectively, then `fderiv`
derivative of `(u, v) ↦ ∫ x in u..v, f x` at `(a, b)` equals `(u, v) ↦ v • cb - u • ca`. -/
theorem fderiv_integral_of_tendsto_ae (hf : IntervalIntegrable f volume a b)
    (hmeas_a : StronglyMeasurableAtFilter f (𝓝 a)) (hmeas_b : StronglyMeasurableAtFilter f (𝓝 b))
    (ha : Tendsto f (𝓝 a ⊓ ae volume) (𝓝 ca)) (hb : Tendsto f (𝓝 b ⊓ ae volume) (𝓝 cb)) :
    fderiv ℝ (fun p : ℝ × ℝ => ∫ x in p.1..p.2, f x) (a, b) =
      (snd ℝ ℝ ℝ).smulRight cb - (fst ℝ ℝ ℝ).smulRight ca

(hf : IntervalIntegrable f MeasureTheory.volume a b)

(hmeas_a : StronglyMeasurableAtFilter f (𝓝 a) MeasureTheory.volume)

(hmeas_b : StronglyMeasurableAtFilter f (𝓝 b) MeasureTheory.volume)

(ha : Filter.Tendsto f (𝓝 a ⊓ MeasureTheory.ae MeasureTheory.volume) (𝓝 ca))

(hb : Filter.Tendsto f (𝓝 b ⊓ MeasureTheory.ae MeasureTheory.volume) (𝓝 cb))

fderiv ℝ (fun p => ∫ (x : ℝ) in p.1 ..p.2, f x) (a, b) =
  (ContinuousLinearMap.snd ℝ ℝ ℝ).smulRight cb - (ContinuousLinearMap.fst ℝ ℝ ℝ).smulRight ca


@[simp] theorem dZero_eq_zero [A.IsTrivial] : dZero A = 0

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


theorem of_sections
    (h : ∀ x, ∃ g : Y → X, ContinuousAt g (f x) ∧ g (f x) = x ∧ RightInverse g f) : IsOpenMap f

(h : ∀ (x : X), ∃ g, ContinuousAt g (f x) ∧ g (f x) = x ∧ Function.RightInverse g f)


lemma StarAlgebra.adjoin_nonUnitalStarSubalgebra_eq_span (s : NonUnitalStarSubalgebra R A) :
    Subalgebra.toSubmodule (adjoin R (s : Set A)).toSubalgebra = span R {1} ⊔ s.toSubmodule

{R : Type u_1}
{A : Type u_2}
[CommSemiring R]
[StarRing R]
[Semiring A]
[StarRing A]
[Algebra R A]
[StarModule R A]
(s : NonUnitalStarSubalgebra R A)

Subalgebra.toSubmodule (StarAlgebra.adjoin R ↑s).toSubalgebra = Submodule.span R {1} ⊔ s.toSubmodule


@[simp]
theorem dualTensorHom_prodMap_zero (f : Module.Dual R M) (p : P) :
    ((dualTensorHom R M P) (f ⊗ₜ[R] p)).prodMap (0 : N →ₗ[R] Q) =
      dualTensorHom R (M × N) (P × Q) ((f ∘ₗ fst R M N) ⊗ₜ inl R P Q p)

{R : Type u}
{M : Type v₁}
{N : Type v₂}
{P : Type v₃}
{Q : Type v₄}
[CommSemiring R]
[AddCommMonoid M]
[AddCommMonoid N]
[AddCommMonoid P]
[AddCommMonoid Q]
[Module R M]
[Module R N]
[Module R P]
[Module R Q]
(f : Module.Dual R M)
(p : P)

((dualTensorHom R M P) (f ⊗ₜ[R] p)).prodMap 0 =
  (dualTensorHom R (M × N) (P × Q)) ((f ∘ₗ LinearMap.fst R M N) ⊗ₜ[R] (LinearMap.inl R P Q) p)


theorem Icc_eq_range' : Icc a b = ⟨List.range' a (b + 1 - a), List.nodup_range' _ _⟩

Finset.Icc a b = { val := ↑(List.range' a (b + 1 - a)), nodup := ⋯ }


lemma GeneralizingMap_iff_stableUnderGeneralization_image :
    GeneralizingMap f ↔ ∀ s, StableUnderGeneralization s → StableUnderGeneralization (f '' s)

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

GeneralizingMap f ↔ ∀ (s : Set X), StableUnderGeneralization s → StableUnderGeneralization (f '' s)


@[refl]
theorem Equiv.refl : ∀ s : WSeq α, s ~ʷ s


/-- The constant map is multilinear when `ι` is empty. -/
@[simps! toMultilinearMap apply]
def constOfIsEmpty [IsEmpty ι] (m : M₂) : ContinuousMultilinearMap R M₁ M₂

(R : Type u)
{ι : Type v}
(M₁ : ι → Type w₁)
{M₂ : Type w₂}
[Semiring R]
[(i : ι) → AddCommMonoid (M₁ i)]
[AddCommMonoid M₂]
[(i : ι) → Module R (M₁ i)]
[Module R M₂]
[(i : ι) → TopologicalSpace (M₁ i)]
[TopologicalSpace M₂]
[IsEmpty ι]
(m : M₂)

(ContinuousMultilinearMap.constOfIsEmpty R M₁ m).toMultilinearMap = MultilinearMap.constOfIsEmpty R M₁ m


theorem UInt16.toNat_add (x y : UInt16) : (x + y).toNat = (x.toNat + y.toNat) % UInt16.size


protected theorem lt_top_of_tsum_ne_top {a : α → ℝ≥0∞} (tsum_ne_top : ∑' i, a i ≠ ∞) (j : α) :
    a j < ∞

{α : Type u_1}
{a : α → ℝ≥0∞}
(tsum_ne_top : ∑' (i : α), a i ≠ ⊤)
(j : α)


theorem noZeroSMulDivisors_of_prime_of_degree_ne_zero [IsDomain R] (hf : Prime f)
    (hf' : f.degree ≠ 0) : NoZeroSMulDivisors R (AdjoinRoot f)

{R : Type u}
[CommRing R]
{f : R[X]}
[IsDomain R]
(hf : Prime f)
(hf' : f.degree ≠ 0)


@[simp]
theorem card (n : ℕ) [Fintype (ZMod n)] : Fintype.card (ZMod n) = n


lemma alexandrovDiscrete_coinduced {β : Type*} {f : α → β} :
    @AlexandrovDiscrete β (coinduced f ‹_›)

{α : Type u_3}
[TopologicalSpace α]
[AlexandrovDiscrete α]
{β : Type u_5}
{f : α → β}


@[simp]
theorem preimage_cast_Ioo (p q : ℚ) : (↑) ⁻¹' Ioo (p : K) q = Ioo p q

{K : Type u_5}
[LinearOrderedField K]
(p q : ℚ)

Rat.cast ⁻¹' Set.Ioo ↑p ↑q = Set.Ioo p q


/-- Extending a cocone by the identity does nothing. -/
@[simps!]
def extendId (s : Cocone F) : s ≅ s.extend (𝟙 s.pt)

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

(CategoryTheory.Limits.Cocones.extendId s).inv.hom = 𝟙 s.pt


/-- For a pair of functors `L : C ⥤ D`, `R : D ⥤ C`, an adjunction `h : L ⊣ R` induces a comonad on
the category `D`.
-/
-- Porting note: Specifying simps projections manually to match mathlib3 behavior.
@[simps coe ε δ]
def toComonad (h : L ⊣ R) : Comonad D

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


@[to_additive (attr := simp)]
theorem _root_.MulEquiv.withOneCongr_refl : (MulEquiv.refl α).withOneCongr = MulEquiv.refl _

(MulEquiv.refl α).withOneCongr = MulEquiv.refl (WithOne α)


theorem map_jacobson_of_bijective {f : R →+* S} (hf : Function.Bijective f) :
    map f I.jacobson = (map f I).jacobson

{R : Type u}
{S : Type v}
[Ring R]
[Ring S]
{I : Ideal R}
{f : R →+* S}
(hf : Function.Bijective ⇑f)

Ideal.map f I.jacobson = (Ideal.map f I).jacobson


lemma le_induce_union_left : G'.induce s ≤ G'.induce (s ∪ s')

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


theorem Filter.HasBasis.disjoint_cobounded_iff [Bornology α] {ι : Sort*} {p : ι → Prop}
    {s : ι → Set α} {l : Filter α} (h : l.HasBasis p s) :
    Disjoint l (cobounded α) ↔ ∃ i, p i ∧ IsBounded (s i)

{α : Type u_2}
[Bornology α]
{ι : Sort u_4}
{p : ι → Prop}
{s : ι → Set α}
{l : Filter α}
(h : l.HasBasis p s)

Disjoint l (Bornology.cobounded α) ↔ ∃ i, p i ∧ Bornology.IsBounded (s i)


@[simp]
lemma isFiniteAdele_iff (x : K_hat R K) :
    x.IsFiniteAdele ↔ {v | x v ∉ adicCompletionIntegers K v}.Finite

(x : DedekindDomain.ProdAdicCompletions R K)

x.IsFiniteAdele ↔ {v | x v ∉ IsDedekindDomain.HeightOneSpectrum.adicCompletionIntegers K v}.Finite


/-- The matrix representation of `rotation a` is equal to the conformal matrix
`!![re a, -im a; im a, re a]`. -/
theorem toMatrix_rotation (a : circle) :
    LinearMap.toMatrix basisOneI basisOneI (rotation a).toLinearEquiv =
      Matrix.planeConformalMatrix (re a) (im a) (by simp [pow_two, ← normSq_apply])

(LinearMap.toMatrix Complex.basisOneI Complex.basisOneI) ↑(rotation a).toLinearEquiv =
  ↑(Matrix.planeConformalMatrix (↑a).re (↑a).im ⋯)


theorem aleph0_le_aleph (o : Ordinal) : ℵ₀ ≤ aleph o


theorem div_le_div_left_of_le {a b c : ℝ≥0} (c0 : c ≠ 0) (cb : c ≤ b) :
    a / b ≤ a / c


/-- The pair of functions `toDual ∘ leftDual` and `rightDual ∘ ofDual` forms a Galois connection. -/
theorem gc_leftDual_rightDual : GaloisConnection (toDual ∘ R.leftDual) (R.rightDual ∘ ofDual)

{α : Type u_1}
{β : Type u_2}
(R : Rel α β)

GaloisConnection (⇑OrderDual.toDual ∘ R.leftDual) (R.rightDual ∘ ⇑OrderDual.ofDual)


theorem leadingCoeffNth_mono {m n : ℕ} (H : m ≤ n) : I.leadingCoeffNth m ≤ I.leadingCoeffNth n

{R : Type u}
[CommSemiring R]
(I : Ideal R[X])
{m n : ℕ}
(H : m ≤ n)


theorem isBounded_iff_eventually {s : Set α} :
    IsBounded s ↔ ∀ᶠ C in atTop, ∀ ⦃x⦄, x ∈ s → ∀ ⦃y⦄, y ∈ s → dist x y ≤ C

{α : Type u}
[PseudoMetricSpace α]
{s : Set α}

Bornology.IsBounded s ↔ ∀ᶠ (C : ℝ) in Filter.atTop, ∀ ⦃x : α⦄, x ∈ s → ∀ ⦃y : α⦄, y ∈ s → dist x y ≤ C


@[simp]
theorem cardPowDegree_nonzero (p : Fq[X]) (hp : p ≠ 0) :
    cardPowDegree p = (Fintype.card Fq : ℤ) ^ p.natDegree

{Fq : Type u_1}
[Field Fq]
[Fintype Fq]
(p : Polynomial Fq)
(hp : p ≠ 0)

Polynomial.cardPowDegree p = ↑(Fintype.card Fq) ^ p.natDegree


@[simp]
theorem coe_opLinearEquiv_symm_toLinearMap :
    ((opLinearEquiv R).symm.toLinearMap : Mᵐᵒᵖ → M) = unop

(R : Type u)
{M : Type v}
[Semiring R]
[AddCommMonoid M]
[Module R M]

⇑↑(MulOpposite.opLinearEquiv R).symm = MulOpposite.unop


@[to_additive]
lemma _root_.IsUnit.inv_smul [Monoid α] {a : α} (h : IsUnit a) : h.unit⁻¹ • a = 1

{α : Type u_5}
[Monoid α]
{a : α}
(h : IsUnit a)


@[reassoc]
theorem pullback.lift_snd {W X Y Z : C} {f : X ⟶ Z} {g : Y ⟶ Z} [HasPullback f g] (h : W ⟶ X)
    (k : W ⟶ Y) (w : h ≫ f = k ≫ g) : pullback.lift h k w ≫ pullback.snd f g = k

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{W X Y Z : C}
{f : X ⟶ Z}
{g : Y ⟶ Z}
[CategoryTheory.Limits.HasPullback f g]
(h : W ⟶ X)
(k : W ⟶ Y)
(w : h ≫ f = k ≫ g)

CategoryTheory.Limits.pullback.lift h k w ≫ CategoryTheory.Limits.pullback.snd f g = k


theorem uniformEmbedding_toUniformOnFunIsCompact :
    UniformEmbedding (toUniformOnFunIsCompact : C(α, β) → α →ᵤ[{K | IsCompact K}] β)

{α : Type u₁}
{β : Type u₂}
[TopologicalSpace α]
[UniformSpace β]


@[simp]
theorem IsHermitian.submatrix {A : Matrix n n α} (h : A.IsHermitian) (f : m → n) :
    (A.submatrix f f).IsHermitian

{α : Type u_1}
{m : Type u_3}
{n : Type u_4}
[Star α]
{A : Matrix n n α}
(h : A.IsHermitian)
(f : m → n)


/-- An abelian Lie algebra with trivial radical is trivial. -/
theorem subsingleton_of_hasTrivialRadical_lie_abelian [HasTrivialRadical R L] [h : IsLieAbelian L] :
    Subsingleton L

(R : Type u_1)
(L : Type u_2)
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[LieAlgebra.HasTrivialRadical R L]
[h : IsLieAbelian L]


@[simp]
theorem ofBijective_symm_apply_apply [RingHomInvPair σ₁₂ σ₂₁] [RingHomInvPair σ₂₁ σ₁₂] {h} (x : M) :
    (ofBijective f h).symm (f x) = x

{R : Type u_1}
{R₂ : Type u_3}
{M : Type u_5}
{M₂ : Type u_7}
[Semiring R]
[Semiring R₂]
[AddCommMonoid M]
[AddCommMonoid M₂]
{module_M : Module R M}
{module_M₂ : Module R₂ M₂}
{σ₁₂ : R →+* R₂}
{σ₂₁ : R₂ →+* R}
(f : M →ₛₗ[σ₁₂] M₂)
[RingHomInvPair σ₁₂ σ₂₁]
[RingHomInvPair σ₂₁ σ₁₂]
{h : Function.Bijective ⇑f}
(x : M)

(LinearEquiv.ofBijective f h).symm (f x) = x


@[to_additive]
theorem mul_subset_mul_left : t₁ ⊆ t₂ → s * t₁ ⊆ s * t₂

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


theorem integral_countable [MeasurableSingletonClass α] (f : α → E) {s : Set α} (hs : s.Countable)
    (hf : Integrable f (μ.restrict s)) :
    ∫ a in s, f a ∂μ = ∑' a : s, (μ {(a : α)}).toReal • f a

(hf : MeasureTheory.Integrable f (μ.restrict s))

∫ (a : α) in s, f a ∂μ = ∑' (a : ↑s), (μ {↑a}).toReal • f ↑a


@[simp]
theorem map_uncurry (f : α → β → γ) (x : Option (α × β)) :
    x.map (uncurry f) = map₂ f (x.map Prod.fst) (x.map Prod.snd)

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

Option.map (Function.uncurry f) x = Option.map₂ f (Option.map Prod.fst x) (Option.map Prod.snd x)


/-- An equivalence of first-order structures is an equivalence that commutes with the
  interpretations of functions and relations. -/
structure Equiv extends M ≃ N where
  map_fun' : ∀ {n} (f : L.Functions n) (x), toFun (funMap f x) = funMap f (toFun ∘ x) := by
    -- Porting note: see porting note on `Hom.map_fun'`
    intros; trivial
  map_rel' : ∀ {n} (r : L.Relations n) (x), RelMap r (toFun ∘ x) ↔ RelMap r x := by
    -- Porting note: see porting note on `Hom.map_fun'`
    intros; trivial

{L : FirstOrder.Language}
{M : Type w}
{N : Type w'}
[L.Structure M]
[L.Structure N]
(self : L.Equiv M N)
{n : ℕ}
(r : L.Relations n)
(x : Fin n → M)

FirstOrder.Language.Structure.RelMap r (self.toFun ∘ x) ↔ FirstOrder.Language.Structure.RelMap r x


lemma natDegree_eraseLead_add_one (h : f.nextCoeff ≠ 0) :
    f.eraseLead.natDegree + 1 = f.natDegree

{R : Type u_1}
[Semiring R]
{f : R[X]}
(h : f.nextCoeff ≠ 0)


/-- Any compact set contained in `s \ μ.everywherePosSubset s` has zero measure. -/
lemma measure_eq_zero_of_subset_diff_everywherePosSubset
    (hk : IsCompact k) (h'k : k ⊆ s \ μ.everywherePosSubset s) : μ k = 0

{α : Type u_1}
[TopologicalSpace α]
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
{s k : Set α}
(hk : IsCompact k)
(h'k : k ⊆ s \ μ.everywherePosSubset s)


theorem constant_of_has_deriv_right_zero (hcont : ContinuousOn f (Icc a b))
    (hderiv : ∀ x ∈ Ico a b, HasDerivWithinAt f 0 (Ici x) x) : ∀ x ∈ Icc a b, f x = f a

(hderiv : ∀ x ∈ Set.Ico a b, HasDerivWithinAt f 0 (Set.Ici x) x)


/-- A constructive version of `Classical.axiom_of_choice` for `Encodable` types. -/
theorem axiom_of_choice {α : Type*} {β : α → Type*} {R : ∀ x, β x → Prop} [∀ a, Encodable (β a)]
    [∀ x y, Decidable (R x y)] (H : ∀ x, ∃ y, R x y) : ∃ f : ∀ a, β a, ∀ x, R x (f x)

[(x : α) → (y : β x) → Decidable (R x y)]


theorem setToFun_undef (hT : DominatedFinMeasAdditive μ T C) (hf : ¬Integrable f μ) :
    setToFun μ T hT f = 0

(hT : MeasureTheory.DominatedFinMeasAdditive μ T C)


/-- A scheme is Noetherian if and only if it is covered by finitely many affine opens whose
sections are noetherian rings. -/
theorem isNoetherian_iff_of_finite_iSup_eq_top {ι} [Finite ι] {S : ι → X.affineOpens}
    (hS : (⨆ i, S i : X.Opens) = ⊤) :
    IsNoetherian X ↔ ∀ i, IsNoetherianRing Γ(X, S i)

{X : AlgebraicGeometry.Scheme}
{ι : Sort u_1}
[Finite ι]
{S : ι → ↑X.affineOpens}
(hS : ⨆ i, ↑(S i) = ⊤)

AlgebraicGeometry.IsNoetherian X ↔ ∀ (i : ι), IsNoetherianRing ↑Γ(X, ↑(S i))


@[to_additive]
theorem tendsto_inv_nhdsWithin_Ici {a : H} : Tendsto Inv.inv (𝓝[≥] a) (𝓝[≤] a⁻¹)

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

Filter.Tendsto Neg.neg (𝓝[≥] a) (𝓝[≤] (-a))


theorem interior_Iic [NoMaxOrder α] {a : α} : interior (Iic a) = Iio a

{α : Type u_1}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
[DenselyOrdered α]
[NoMaxOrder α]
{a : α}


theorem aeval_def (p : R[X]) : aeval x p = eval₂ (algebraMap R A) x p

{R : Type u}
{A : Type z}
[CommSemiring R]
[Semiring A]
[Algebra R A]
(x : A)
(p : R[X])

(Polynomial.aeval x) p = Polynomial.eval₂ (algebraMap R A) x p


/-- If the angle between three points is nonzero, the first and third points are not equal. -/
theorem left_ne_right_of_oangle_ne_zero {p₁ p₂ p₃ : P} (h : ∡ p₁ p₂ p₃ ≠ 0) : p₁ ≠ p₃

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


lemma stalkMap_comp {X Y Z : Scheme.{u}} (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) :
    (f ≫ g : X ⟶ Z).stalkMap x = g.stalkMap (f.val.base x) ≫ f.stalkMap x

{X Y Z : AlgebraicGeometry.Scheme}
(f : X ⟶ Y)
(g : Y ⟶ Z)
(x : ↑↑X.toPresheafedSpace)

AlgebraicGeometry.Scheme.Hom.stalkMap (f ≫ g) x =
  AlgebraicGeometry.Scheme.Hom.stalkMap g (f.val.base x) ≫ AlgebraicGeometry.Scheme.Hom.stalkMap f x


theorem prod_comm' : f ×ˢ g = comap Prod.swap (g ×ˢ f)

{α : Type u_1}
{β : Type u_2}
{f : Filter α}
{g : Filter β}

f ×ˢ g = Filter.comap Prod.swap (g ×ˢ f)


theorem Bijective.of_comp_iff' {f : α → β} (hf : Bijective f) (g : γ → α) :
    Function.Bijective (f ∘ g) ↔ Function.Bijective g

{α : Sort u_1}
{β : Sort u_2}
{γ : Sort u_3}
{f : α → β}
(hf : Function.Bijective f)
(g : γ → α)


@[simp]
theorem insert_eq_self : insert a s = s ↔ a ∈ s

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


/-- **Removable singularity** theorem: if `s` is a punctured neighborhood of `c : ℂ`, a function
`f : ℂ → E` is complex differentiable on `s`, and $f(z) - f(c)=o((z-c)^{-1})$, then `f` redefined to
be equal to `limUnder (𝓝[≠] c) f` at `c` is complex differentiable on `{c} ∪ s`. -/
theorem differentiableOn_update_limUnder_insert_of_isLittleO {f : ℂ → E} {s : Set ℂ} {c : ℂ}
    (hc : s ∈ 𝓝[≠] c) (hd : DifferentiableOn ℂ f s)
    (ho : (fun z => f z - f c) =o[𝓝[≠] c] fun z => (z - c)⁻¹) :
    DifferentiableOn ℂ (update f c (limUnder (𝓝[≠] c) f)) (insert c s)

DifferentiableOn ℂ (Function.update f c (limUnder (𝓝[≠] c) f)) (insert c s)


theorem mapsTo_image (f : α → β) (s : Set α) : MapsTo f s (f '' s)

{α : Type u}
{β : Type v}
(f : α → β)
(s : Set α)


/-- The associator isomorphism for binary products. -/
@[simps]
def prod.associator [HasBinaryProducts C] (P Q R : C) : (P ⨯ Q) ⨯ R ≅ P ⨯ Q ⨯ R

(CategoryTheory.Limits.prod.associator P Q R).inv =
  CategoryTheory.Limits.prod.lift
    (CategoryTheory.Limits.prod.lift CategoryTheory.Limits.prod.fst
      (CategoryTheory.Limits.prod.snd ≫ CategoryTheory.Limits.prod.fst))
    (CategoryTheory.Limits.prod.snd ≫ CategoryTheory.Limits.prod.snd)


@[simp]
lemma rec_zero {C : ℕ → Sort*} (h0 : C 0) (h : ∀ n, C n → C (n + 1)) : Nat.rec h0 h 0 = h0


theorem aemeasurable_of_re_im (hre : AEMeasurable (fun x => RCLike.re (f x)) μ)
    (him : AEMeasurable (fun x => RCLike.im (f x)) μ) : AEMeasurable f μ


theorem pushforward_comp {f : Y ⟶ X} {g : Z ⟶ Y} (R : Sieve Z) :
    R.pushforward (g ≫ f) = (R.pushforward g).pushforward f

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{X Y Z : C}
{f : Y ⟶ X}
{g : Z ⟶ Y}
(R : CategoryTheory.Sieve Z)

CategoryTheory.Sieve.pushforward (CategoryTheory.CategoryStruct.comp g f) R =
  CategoryTheory.Sieve.pushforward f (CategoryTheory.Sieve.pushforward g R)


@[simp]
theorem mod_one (a : R) : a % 1 = 0

{R : Type u}
[EuclideanDomain R]
(a : R)


@[simp] lemma closure_empty_union_closure_eq (M : Matroid α) (X : Set α) :
    M.closure ∅ ∪ M.closure X = M.closure X

{α : Type u_2}
(M : Matroid α)
(X : Set α)


@[simp]
lemma cochain_ofHom_homOf_eq_coe (z : Cocycle F G 0) :
    Cochain.ofHom (homOf z) = (z : Cochain F G 0)

(z : CochainComplex.HomComplex.Cocycle F G 0)

CochainComplex.HomComplex.Cochain.ofHom z.homOf = ↑z


/-- The functor `StructuredArrow L R ⥤ StructuredArrow L' R'` that is deduced from
a natural transformation `R ⋙ G ⟶ F ⋙ R'` and a morphism `L' ⟶ G.obj L.` -/
@[simps!]
def map₂ : StructuredArrow L R ⥤ StructuredArrow L' R'

(X : CategoryTheory.Comma (CategoryTheory.Functor.fromPUnit L) R)

((CategoryTheory.StructuredArrow.map₂ α β).obj X).right = F.obj X.right


theorem diagonal_iff {X Y : C} {f : X ⟶ Y} : P.diagonal f ↔ P (pullback.diagonal f)

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Limits.HasPullbacks C]
{P : CategoryTheory.MorphismProperty C}
{X Y : C}
{f : X ⟶ Y}

P.diagonal f ↔ P (CategoryTheory.Limits.pullback.diagonal f)


/-- Converting an augmented simplicial object to an augmented cosimplicial
object and back is isomorphic to the given object. -/
@[simps!]
def SimplicialObject.Augmented.rightOpLeftOpIso (X : SimplicialObject.Augmented C) :
    X.rightOp.leftOp ≅ X

(X : CategoryTheory.SimplicialObject.Augmented C)

∀ (X_1 : SimplexCategoryᵒᵖ), X.rightOpLeftOpIso.inv.left.app X_1 = 𝟙 (X.left.obj X_1)


/-- This is really an auxiliary result, en route to
`Polynomial.exists_unique_nilpotent_sub_and_aeval_eq_zero`. -/
theorem aeval_pow_two_pow_dvd_aeval_iterate_newtonMap
    (h : IsNilpotent (aeval x P)) (h' : IsUnit (aeval x <| derivative P)) (n : ℕ) :
    (aeval x P) ^ (2 ^ n) ∣ aeval (P.newtonMap^[n] x) P

(h : IsNilpotent ((Polynomial.aeval x) P))

(h' : IsUnit ((Polynomial.aeval x) (Polynomial.derivative P)))

(Polynomial.aeval x) P ^ 2 ^ n ∣ (Polynomial.aeval (P.newtonMap^[n] x)) P


@[simp] theorem mul_mod_left (m n : Nat) : (m * n) % n = 0


theorem uniqueBaseOn_inter_ground_eq (I E : Set α) :
    uniqueBaseOn (I ∩ E) E = uniqueBaseOn I E

Matroid.uniqueBaseOn (I ∩ E) E = Matroid.uniqueBaseOn I E


theorem forall_iff_succAbove {p : Fin (n + 1) → Prop} (i : Fin (n + 1)) :
    (∀ j, p j) ↔ p i ∧ ∀ j, p (i.succAbove j)

{n : ℕ}
{p : Fin (n + 1) → Prop}
(i : Fin (n + 1))

(∀ (j : Fin (n + 1)), p j) ↔ p i ∧ ∀ (j : Fin n), p (i.succAbove j)


lemma smul_neg_of_pos_of_neg [PosSMulStrictMono α β] (ha : 0 < a) (hb : b < 0) : a • b < 0

{α : Type u_1}
{β : Type u_2}
{a : α}
{b : β}
[Zero α]
[Zero β]
[SMulZeroClass α β]
[Preorder α]
[Preorder β]
[PosSMulStrictMono α β]
(ha : 0 < a)
(hb : b < 0)


lemma card_strictMono : StrictMono (card : Finset α → ℕ)


@[to_additive]
theorem mulIndicator_const (h : EventuallyConst s l) (c : β) :
    EventuallyConst (s.mulIndicator fun _ ↦ c) l

{α : Type u_1}
{β : Type u_2}
{l : Filter α}
[Zero β]
{s : Set α}
(h : Filter.EventuallyConst s l)
(c : β)

Filter.EventuallyConst (s.indicator fun x => c) l


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

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


/-- The presheaf valued in `Unit` over any topological space is a sheaf.
-/
theorem isSheaf_unit (F : Presheaf (CategoryTheory.Discrete Unit) X) : F.IsSheaf

(F : TopCat.Presheaf (CategoryTheory.Discrete Unit) X)


/-- `val : αˣ → α` as an order embedding. -/
@[to_additive (attr := simps (config := .asFn))
  "`val : add_units α → α` as an order embedding."]
def orderEmbeddingVal [Monoid α] [LinearOrder α] : αˣ ↪o α

{α : Type u_1}
[AddMonoid α]
[LinearOrder α]


/-- The composition of right adjoint mates is the adjoint mate of the composition. -/
@[reassoc]
theorem comp_rightAdjointMate {X Y Z : C} [HasRightDual X] [HasRightDual Y] [HasRightDual Z]
    {f : X ⟶ Y} {g : Y ⟶ Z} : (f ≫ g)ᘁ = gᘁ ≫ fᘁ

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.MonoidalCategory C]
{X Y Z : C}
[CategoryTheory.HasRightDual X]
[CategoryTheory.HasRightDual Y]
[CategoryTheory.HasRightDual Z]
{f : X ⟶ Y}
{g : Y ⟶ Z}


@[simp]
theorem snd_kstar (a : α × β) : a∗.2 = a.2∗

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


theorem norm_sum_le {ι E} [SeminormedAddCommGroup E] (s : Finset ι) (f : ι → E) :
    ‖∑ i ∈ s, f i‖ ≤ ∑ i ∈ s, ‖f i‖

{ι : Type u_9}
{E : Type u_10}
[SeminormedAddCommGroup E]
(s : Finset ι)
(f : ι → E)


@[simp] theorem get_cons_zero : get (x :: xs) 0 = x


@[to_additive]
theorem period_pos_of_orderOf_pos {m : M} (order_pos : 0 < orderOf m) (a : α) :
    0 < period m a

{α : Type v}
{M : Type u}
[Monoid M]
[MulAction M α]
{m : M}
(order_pos : 0 < orderOf m)
(a : α)


theorem mulLeft_injective [NoZeroDivisors A] {x : A} (hx : x ≠ 0) :
    Function.Injective (mulLeft R x)

{R : Type u_1}
{A : Type u_2}
[CommSemiring R]
[Ring A]
[Algebra R A]
[NoZeroDivisors A]
{x : A}
(hx : x ≠ 0)

Function.Injective ⇑(LinearMap.mulLeft R x)


@[simp]
theorem preimage_coe_top : (some : α → WithTop α) ⁻¹' {⊤} = (∅ : Set α)


theorem IsUnit.nonempty_invertible [Monoid α] {a : α} (h : IsUnit a) : Nonempty (Invertible a)

{α : Type u}
[Monoid α]
{a : α}
(h : IsUnit a)


@[measurability, fun_prop]
theorem AEMeasurable.coe_ereal_ennreal {f : α → ℝ≥0∞} {μ : Measure α} (hf : AEMeasurable f μ) :
    AEMeasurable (fun x => (f x : EReal)) μ

{α : Type u_1}
[MeasurableSpace α]
{f : α → ℝ≥0∞}
{μ : MeasureTheory.Measure α}
(hf : AEMeasurable f μ)


/-- The order of the sum of two formal power series
 is the minimum of their orders if their orders differ. -/
theorem order_add_of_order_eq (φ ψ : R⟦X⟧) (h : order φ ≠ order ψ) :
    order (φ + ψ) = order φ ⊓ order ψ

{R : Type u_1}
[Semiring R]
(φ ψ : PowerSeries R)
(h : φ.order ≠ ψ.order)


@[to_additive]
theorem prod_subsingleton {α β : Type*} [CommMonoid β] [Subsingleton α] [Fintype α] (f : α → β)
    (a : α) : ∏ x : α, f x = f a

{α : Type u_9}
{β : Type u_10}
[CommMonoid β]
[Subsingleton α]
[Fintype α]
(f : α → β)
(a : α)


theorem bernoulli'_spec' (n : ℕ) :
    (∑ k ∈ antidiagonal n, ((k.1 + k.2).choose k.2 : ℚ) / (k.2 + 1) * bernoulli' k.1) = 1

∑ k ∈ Finset.antidiagonal n, ↑((k.1 + k.2).choose k.2) / (↑k.2 + 1) * bernoulli' k.1 = 1


@[to_additive (attr := simp)]
theorem noncommCoprod_comp_inr : (f.noncommCoprod g comm).comp (inr M N) = g

(comm : ∀ (m : M) (n : N), Commute (f m) (g n))

(f.noncommCoprod g comm).comp (MonoidHom.inr M N) = g


protected theorem mono (h : t.WellFoundedOn r') (hle : r ≤ r') (hst : s ⊆ t) :
    s.WellFoundedOn r

{α : Type u_2}
{r r' : α → α → Prop}
{s t : Set α}
(h : t.WellFoundedOn r')
(hle : r ≤ r')
(hst : s ⊆ t)


@[simp] theorem associator_hom_apply_2_1 {X Y Z : Type u} {x} :
    (((α_ X Y Z).hom : (X ⊗ Y) ⊗ Z → X ⊗ Y ⊗ Z) x).2.1 = x.1.2


/-- The type of monoid homomorphisms satisfying the characteristic predicate: if `f : M →* N`
satisfies this predicate, then `N` is isomorphic to the localization of `M` at `S`. -/
-- Porting note(#5171): this linter isn't ported yet.
-- @[nolint has_nonempty_instance]
structure LocalizationMap extends MonoidHom M N where
  map_units' : ∀ y : S, IsUnit (toFun y)
  surj' : ∀ z : N, ∃ x : M × S, z * toFun x.2 = toFun x.1
  exists_of_eq : ∀ x y, toFun x = toFun y → ∃ c : S, ↑c * x = c * y

{M : Type u_1}
[CommMonoid M]
{S : Submonoid M}
{N : Type u_2}
[CommMonoid N]
(self : S.LocalizationMap N)
(y : ↥S)


theorem mem_cylinder_comm (x y : ∀ n, E n) (n : ℕ) : y ∈ cylinder x n ↔ x ∈ cylinder y n

{E : ℕ → Type u_1}
(x y : (n : ℕ) → E n)
(n : ℕ)

y ∈ PiNat.cylinder x n ↔ x ∈ PiNat.cylinder y n


/-- In a Noetherian space, every closed set is a finite union of irreducible closed sets. -/
theorem NoetherianSpace.exists_finite_set_isClosed_irreducible [NoetherianSpace α]
    {s : Set α} (hs : IsClosed s) : ∃ S : Set (Set α), S.Finite ∧
      (∀ t ∈ S, IsClosed t) ∧ (∀ t ∈ S, IsIrreducible t) ∧ s = ⋃₀ S

{α : Type u_1}
[TopologicalSpace α]
[TopologicalSpace.NoetherianSpace α]
{s : Set α}
(hs : IsClosed s)

∃ S, S.Finite ∧ (∀ t ∈ S, IsClosed t) ∧ (∀ t ∈ S, IsIrreducible t) ∧ s = ⋃₀ S


theorem ContDiffWithinAt.congr' (h : ContDiffWithinAt 𝕜 n f s x) (h₁ : ∀ y ∈ s, f₁ y = f y)
    (hx : x ∈ s) : ContDiffWithinAt 𝕜 n f₁ s x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{s : Set E}
{f f₁ : E → F}
{x : E}
{n : ℕ∞}
(h : ContDiffWithinAt 𝕜 n f s x)
(h₁ : ∀ y ∈ s, f₁ y = f y)
(hx : x ∈ s)


lemma KaehlerDifferential.range_mapBaseChange :
    LinearMap.range (mapBaseChange R A B) = LinearMap.ker (map R A B B)

(R : Type u)
[CommRing R]
(A : Type u_2)
(B : Type u_3)
[CommRing A]
[CommRing B]
[Algebra R A]
[Algebra R B]
[Algebra A B]
[IsScalarTower R A B]

LinearMap.range (KaehlerDifferential.mapBaseChange R A B) = LinearMap.ker (KaehlerDifferential.map R A B B)


@[simp]
theorem denom_X : denom (X : RatFunc K) = 1


@[simp]
theorem coeff_ofFinsupp (p) : coeff (⟨p⟩ : R[X]) = p


lemma div_lt_div_right_of_neg {a a' b : EReal} (h₁ : b < 0) (h₂ : b ≠ ⊥)
    (h₃ : a < a') : a' / b < a / b


theorem Convex.smul (hs : Convex 𝕜 s) (c : 𝕜) : Convex 𝕜 (c • s)

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedCommSemiring 𝕜]
[AddCommMonoid E]
[Module 𝕜 E]
{s : Set E}
(hs : Convex 𝕜 s)
(c : 𝕜)


theorem process_difference_le (s : ℕ → Set Ω) (ω : Ω) (n : ℕ) :
    |process s (n + 1) ω - process s n ω| ≤ (1 : ℝ≥0)

{Ω : Type u_1}
(s : ℕ → Set Ω)
(ω : Ω)
(n : ℕ)

|MeasureTheory.BorelCantelli.process s (n + 1) ω - MeasureTheory.BorelCantelli.process s n ω| ≤ ↑1


protected theorem AnalyticOn.continuousOn {s : Set E} (hf : AnalyticOn 𝕜 f s) : ContinuousOn f s

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{s : Set E}
(hf : AnalyticOn 𝕜 f s)


/-- The forgetful functor from `Factorisation f` to the underlying category `C`. -/
@[simps]
def forget : Factorisation f ⥤ C

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

∀ {X_1 Y_1 : CategoryTheory.Factorisation f} (f_1 : X_1 ⟶ Y_1), CategoryTheory.Factorisation.forget.map f_1 = f_1.h


@[to_additive]
lemma le_minOrder_iff_forall_subgroup {n : ℕ∞} :
    n ≤ minOrder α ↔ ∀ ⦃s : Subgroup α⦄, s ≠ ⊥ → (s : Set α).Finite → n ≤ Nat.card s

n ≤ Monoid.minOrder α ↔ ∀ ⦃s : Subgroup α⦄, s ≠ ⊥ → (↑s).Finite → n ≤ ↑(Nat.card ↥s)


@[simp]
theorem logb_le_logb (h : 0 < x) (h₁ : 0 < y) : logb b x ≤ logb b y ↔ x ≤ y


@[simp]
theorem sigma_singleton {a : ∀ i, α i} :
    s.sigma (fun i ↦ ({a i} : Set (α i))) = (fun i ↦ Sigma.mk i <| a i) '' s

{ι : Type u_1}
{α : ι → Type u_3}
{s : Set ι}
{a : (i : ι) → α i}

(s.sigma fun i => {a i}) = (fun i => ⟨i, a i⟩) '' s


/-- The mean value theorem on a convex set: if the derivative of a function is bounded by `C`,
then the function is `C`-Lipschitz. Version with `fderiv`. -/
theorem norm_image_sub_le_of_norm_fderiv_le (hf : ∀ x ∈ s, DifferentiableAt 𝕜 f x)
    (bound : ∀ x ∈ s, ‖fderiv 𝕜 f x‖ ≤ C) (hs : Convex ℝ s) (xs : x ∈ s) (ys : y ∈ s) :
    ‖f y - f x‖ ≤ C * ‖y - x‖

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{𝕜 : Type u_3}
{G : Type u_4}
[RCLike 𝕜]
[NormedSpace 𝕜 E]
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{f : E → G}
{C : ℝ}
{s : Set E}
{x y : E}
(hf : ∀ x ∈ s, DifferentiableAt 𝕜 f x)
(bound : ∀ x ∈ s, ‖fderiv 𝕜 f x‖ ≤ C)
(hs : Convex ℝ s)
(xs : x ∈ s)
(ys : y ∈ s)


theorem funext₂ {β : α → Sort _} {γ : ∀ a, β a → Sort _}
    {f g : ∀ a b, γ a b} (h : ∀ a b, f a b = g a b) : f = g

(h : ∀ (a : α) (b : β a), f a b = g a b)


protected theorem add_le_add_iff_left {n : Nat} : n + m ≤ n + k ↔ m ≤ k


@[simp]
theorem mk_sup_mk {a b : α} (ha : IsComplemented a) (hb : IsComplemented b) :
    (⟨a, ha⟩ ⊔ ⟨b, hb⟩ : Complementeds α) = ⟨a ⊔ b, ha.sup hb⟩

{α : Type u_1}
[DistribLattice α]
[BoundedOrder α]
{a b : α}
(ha : IsComplemented a)
(hb : IsComplemented b)


@[reassoc (attr := simp)]
lemma restrictStalkIso_hom_eq_germ :
    (X.restrict h).presheaf.germ ⟨x, hx⟩ ≫ (X.restrictStalkIso h x).hom =
      X.presheaf.germ ⟨f x, show f x ∈ h.isOpenMap.functor.obj V from ⟨x, hx, rfl⟩⟩

(X.restrict h).presheaf.germ ⟨x, hx⟩ ≫ (X.restrictStalkIso h x).hom = X.presheaf.germ ⟨f x, ⋯⟩


theorem einfsep_of_fintype [DecidableEq α] [Fintype s] :
    s.einfsep = s.offDiag.toFinset.inf (uncurry edist)

{α : Type u_1}
[EDist α]
{s : Set α}
[DecidableEq α]
[Fintype ↑s]

s.einfsep = s.offDiag.toFinset.inf (Function.uncurry edist)


theorem reflTransGen_closed {p : α → α → Prop} :
    (∀ a b, r a b → ReflTransGen p a b) → ReflTransGen r a b → ReflTransGen p a b

{α : Type u_1}
{r : α → α → Prop}
{a b : α}
{p : α → α → Prop}

(∀ (a b : α), r a b → Relation.ReflTransGen p a b) → Relation.ReflTransGen r a b → Relation.ReflTransGen p a b


@[simp]
lemma baseChange_bot : (⊥ : LieSubmodule R L M).baseChange A = ⊥

(R : Type u_1)
(A : Type u_2)
(L : Type u_3)
(M : Type u_4)
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
[CommRing A]
[Algebra R A]


theorem balancedSz_up {l r₁ r₂ : ℕ} (h₁ : r₁ ≤ r₂) (h₂ : l + r₂ ≤ 1 ∨ r₂ ≤ delta * l)
    (H : BalancedSz l r₁) : BalancedSz l r₂

(h₂ : l + r₂ ≤ 1 ∨ r₂ ≤ Ordnode.delta * l)


theorem condCount_of_univ (hs : s.Finite) (hs' : s.Nonempty) : condCount s Set.univ = 1

{Ω : Type u_1}
[MeasurableSpace Ω]
[MeasurableSingletonClass Ω]
{s : Set Ω}
(hs : s.Finite)
(hs' : s.Nonempty)

(ProbabilityTheory.condCount s) Set.univ = 1


theorem ofBoolAlg_inj {a b : AsBoolAlg α} : ofBoolAlg a = ofBoolAlg b ↔ a = b


@[simp]
theorem ofDual_inf [SemilatticeSup α] [OrderBot α] (s : Finset β) (f : β → αᵒᵈ) :
    ofDual (s.inf f) = s.sup (ofDual ∘ f)

{α : Type u_2}
{β : Type u_3}
[SemilatticeSup α]
[OrderBot α]
(s : Finset β)
(f : β → αᵒᵈ)

OrderDual.ofDual (s.inf f) = s.sup (⇑OrderDual.ofDual ∘ f)


@[simp]
theorem nodup_coe_iff {l : List α} : Nodup (l : Cycle α) ↔ l.Nodup


theorem primorial_add_dvd {m n : ℕ} (h : n ≤ m) : (m + n)# ∣ m# * choose (m + n) m


theorem alternatization_apply_apply (v : ι → M) :
    alternatization f v = ∑ σ : Equiv.Perm ι, Equiv.Perm.sign σ • f (v ∘ σ)

(f : ContinuousMultilinearMap R (fun x => M) N)

(ContinuousMultilinearMap.alternatization f) v = ∑ σ : Equiv.Perm ι, Equiv.Perm.sign σ • f (v ∘ ⇑σ)


theorem Lp.norm_const_le : ‖Lp.const p μ c‖ ≤ ‖c‖ * (μ Set.univ).toReal ^ (1 / p.toReal)

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
(p : ℝ≥0∞)
(μ : MeasureTheory.Measure α)
[NormedAddCommGroup E]
[MeasureTheory.IsFiniteMeasure μ]
(c : E)

‖(MeasureTheory.Lp.const p μ) c‖ ≤ ‖c‖ * (μ Set.univ).toReal ^ (1 / p.toReal)


private irreducible_def sub {R : Type uR} [Ring R] (r : R → R → Prop) :
  RingQuot r → RingQuot r → RingQuot r

{R : Type u_1}
[Ring R]
(r : R → R → Prop)

∀ (x x_1 : RingQuot r),
  RingQuot.sub r x x_1 =
    match x, x_1 with
    | { toQuot := a }, { toQuot := b } => { toQuot := Quot.map₂ Sub.sub ⋯ ⋯ a b }


theorem iterate_add (m : ℕ) : ∀ n : ℕ, f^[m + n] = f^[m] ∘ f^[n]


protected lemma le_of_eq (hab : a = b) : a ≤ b


@[simp]
theorem quot_neg_mul (x y : PGame) : (⟦-x * y⟧ : Game) = -⟦x * y⟧


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

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

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


/-- A submonoid `S` of a monoid `R` is (left) Ore if common factors on the right can be turned
into common factors on the left, and if each pair of `r : R` and `s : S` admits an Ore numerator
`v : R` and an Ore denominator `u : S` such that `u * r = v * s`. -/
@[to_additive AddOreLocalization.AddOreSet]
class OreSet {R : Type*} [Monoid R] (S : Submonoid R) where
  /-- Common factors on the right can be turned into common factors on the left, a weak form of
cancellability. -/
  ore_right_cancel : ∀ (r₁ r₂ : R) (s : S), r₁ * s = r₂ * s → ∃ s' : S, s' * r₁ = s' * r₂
  /-- The Ore numerator of a fraction. -/
  oreNum : R → S → R
  /-- The Ore denominator of a fraction. -/
  oreDenom : R → S → S
  /-- The Ore condition of a fraction, expressed in terms of `oreNum` and `oreDenom`. -/
  ore_eq : ∀ (r : R) (s : S), oreDenom r s * r = oreNum r s * s

{R : Type u_1}
[Monoid R]
{S : Submonoid R}
[self : OreLocalization.OreSet S]
(r₁ r₂ : R)
(s : ↥S)

r₁ * ↑s = r₂ * ↑s → ∃ s', ↑s' * r₁ = ↑s' * r₂


@[simp]
theorem coe_map (s : AffineSubspace k P₁) : (s.map f : Set P₂) = f '' s

{k : Type u_1}
{V₁ : Type u_2}
{P₁ : Type u_3}
{V₂ : Type u_4}
{P₂ : Type u_5}
[Ring k]
[AddCommGroup V₁]
[Module k V₁]
[AffineSpace V₁ P₁]
[AddCommGroup V₂]
[Module k V₂]
[AffineSpace V₂ P₂]
(f : P₁ →ᵃ[k] P₂)
(s : AffineSubspace k P₁)


lemma eq_if_stoneCechUnit_eq {a b : α} {f : α → β} (hcf : Continuous f)
    (h : stoneCechUnit a = stoneCechUnit b) : f a = f b

{α : Type u}
[TopologicalSpace α]
{β : Type v}
[TopologicalSpace β]
[T2Space β]
[CompactSpace β]
{a b : α}
{f : α → β}
(hcf : Continuous f)
(h : stoneCechUnit a = stoneCechUnit b)


@[simp]
theorem det_fromBlocks_one₂₂ (A : Matrix m m α) (B : Matrix m n α) (C : Matrix n m α) :
    (Matrix.fromBlocks A B C 1).det = det (A - B * C)

{m : Type u_2}
{n : Type u_3}
{α : Type u_4}
[Fintype m]
[Fintype n]
[DecidableEq m]
[DecidableEq n]
[CommRing α]
(A : Matrix m m α)
(B : Matrix m n α)
(C : Matrix n m α)

(Matrix.fromBlocks A B C 1).det = (A - B * C).det


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

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


/-- An `AddGroup` is simple when it has exactly two normal `AddSubgroup`s. -/
class IsSimpleAddGroup extends Nontrivial A : Prop where
  /-- Any normal additive subgroup is either `⊥` or `⊤` -/
  eq_bot_or_eq_top_of_normal : ∀ H : AddSubgroup A, H.Normal → H = ⊥ ∨ H = ⊤

{A : Type u_2}
[AddGroup A]
[self : IsSimpleAddGroup A]
(H : AddSubgroup A)


@[fun_prop]
theorem DifferentiableOn.add (hf : DifferentiableOn 𝕜 f s) (hg : DifferentiableOn 𝕜 g s) :
    DifferentiableOn 𝕜 (fun y => f y + g y) s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f g : E → F}
{s : Set E}
(hf : DifferentiableOn 𝕜 f s)
(hg : DifferentiableOn 𝕜 g s)


theorem norm_sq_eq_def {z : K} : ‖z‖ ^ 2 = re z * re z + im z * im z

‖z‖ ^ 2 = RCLike.re z * RCLike.re z + RCLike.im z * RCLike.im z


@[simp] theorem run_throw [Monad m] : run (throw e : ExceptT ε m β) = pure (Except.error e)

{m : Type u_1 → Type u_2}
{ε β : Type u_1}
{e : ε}
[Monad m]


/-- If `M` and `N` are linearly disjoint, if `M` is flat, then for any submodule `N'` of `N`,
`M` and `N'` are also linearly disjoint. -/
theorem of_le_right_of_flat (H : M.LinearDisjoint N) {N' : Submodule R S}
    (h : N' ≤ N) [Module.Flat R M] : M.LinearDisjoint N'

{R : Type u}
{S : Type v}
[CommRing R]
[Ring S]
[Algebra R S]
{M N : Submodule R S}
(H : M.LinearDisjoint N)
{N' : Submodule R S}
(h : N' ≤ N)
[Module.Flat R ↥M]


@[to_additive]
theorem units_of_val {a x y : Mˣ} (h : SemiconjBy (a : M) x y) : SemiconjBy a x y

{M : Type u_1}
[AddMonoid M]
{a x y : AddUnits M}
(h : AddSemiconjBy ↑a ↑x ↑y)


@[to_additive]
theorem smulAntidiagonal_mono_right {a : P} {hs : s.IsPWO} {ht : t.IsPWO} (h : v ⊆ t) :
    SMulAntidiagonal hs hv a ⊆ SMulAntidiagonal hs ht a

{G : Type u_1}
{P : Type u_2}
[PartialOrder G]
[PartialOrder P]
[VAdd G P]
[IsOrderedCancelVAdd G P]
{s : Set G}
{t v : Set P}
{hv : v.IsPWO}
{a : P}
{hs : s.IsPWO}
{ht : t.IsPWO}
(h : v ⊆ t)

Finset.VAddAntidiagonal hs hv a ⊆ Finset.VAddAntidiagonal hs ht a


theorem _root_.PrimrecPred.or {p q : α → Prop} [DecidablePred p] [DecidablePred q]
    (hp : PrimrecPred p) (hq : PrimrecPred q) : PrimrecPred fun a => p a ∨ q a

{α : Type u_1}
[Primcodable α]
{p q : α → Prop}
[DecidablePred p]
[DecidablePred q]
(hp : PrimrecPred p)
(hq : PrimrecPred q)


lemma map_image_base_iff {hf} {B : Set α} (hB : B ⊆ M.E) :
    (M.map f hf).Base (f '' B) ↔ M.Base B

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{M : Matroid α}
{hf : Set.InjOn f M.E}
{B : Set α}
(hB : B ⊆ M.E)


theorem fderivWithin_fst {s : Set (E × F)} (hs : UniqueDiffWithinAt 𝕜 s p) :
    fderivWithin 𝕜 Prod.fst s p = fst 𝕜 E F

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{p : E × F}
{s : Set (E × F)}
(hs : UniqueDiffWithinAt 𝕜 s p)

fderivWithin 𝕜 Prod.fst s p = ContinuousLinearMap.fst 𝕜 E F


@[to_additive (attr := simp)]
theorem map_unop_nhds (x : Mᵐᵒᵖ) : map (unop : Mᵐᵒᵖ → M) (𝓝 x) = 𝓝 (unop x)

{M : Type u_1}
[TopologicalSpace M]
(x : Mᵐᵒᵖ)

Filter.map MulOpposite.unop (𝓝 x) = 𝓝 (MulOpposite.unop x)


@[to_additive] lemma Right.min_le_max_of_mul_le_mul
    [CovariantClass α α (· * ·) (· ≤ ·)] [CovariantClass α α (swap (· * ·)) (· < ·)]
    (h : a * b ≤ c * d) : min a b ≤ max c d

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

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


@[mono]
theorem toFilter_mono (I : Box ι) {l₁ l₂ : IntegrationParams} (h : l₁ ≤ l₂) :
    l₁.toFilter I ≤ l₂.toFilter I

{ι : Type u_1}
[Fintype ι]
(I : BoxIntegral.Box ι)
{l₁ l₂ : BoxIntegral.IntegrationParams}
(h : l₁ ≤ l₂)


lemma inf_image₂_left (g : γ → δ) : inf (image₂ f s t) g = inf s fun x ↦ inf t (g ∘ f x)

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

(Finset.image₂ f s t).inf g = s.inf fun x => t.inf (g ∘ f x)


theorem iIndepSet_iff_meas_biInter {f : ι → Set Ω} (hf : ∀ i, MeasurableSet (f i)) :
    iIndepSet f μ ↔ ∀ s, μ (⋂ i ∈ s, f i) = ∏ i ∈ s, μ (f i)

{Ω : Type u_1}
{ι : Type u_2}
{_mΩ : MeasurableSpace Ω}
{μ : MeasureTheory.Measure Ω}
[MeasureTheory.IsProbabilityMeasure μ]
{f : ι → Set Ω}
(hf : ∀ (i : ι), MeasurableSet (f i))

ProbabilityTheory.iIndepSet f μ ↔ ∀ (s : Finset ι), μ (⋂ i ∈ s, f i) = ∏ i ∈ s, μ (f i)


/--
The category of subterminal objects is equivalent to the category of monomorphisms to the terminal
object (which is in turn equivalent to the subobjects of the terminal object).
-/
@[simps]
def subterminalsEquivMonoOverTerminal [HasTerminal C] : Subterminals C ≌ MonoOver (⊤_ C)

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

(CategoryTheory.subterminalsEquivMonoOverTerminal C).counitIso =
  CategoryTheory.NatIso.ofComponents
    (fun X =>
      CategoryTheory.MonoOver.isoMk
        (CategoryTheory.Iso.refl
          (({ obj := fun X => { obj := X.obj.left, property := ⋯ }, map := fun {X Y} f => f.left, map_id := ⋯,
                        map_comp := ⋯ }.comp
                    {
                      obj := fun X =>
                        { obj := CategoryTheory.Over.mk (CategoryTheory.Limits.terminal.from X.obj), property := ⋯ },
                      map := fun {X Y} f => CategoryTheory.MonoOver.homMk f ⋯, map_id := ⋯, map_comp := ⋯ }).obj
                X).obj.left)
        ⋯)
    ⋯


theorem PartiallyWellOrderedOn.union (hs : s.PartiallyWellOrderedOn r)
    (ht : t.PartiallyWellOrderedOn r) : (s ∪ t).PartiallyWellOrderedOn r

{α : Type u_2}
{r : α → α → Prop}
{s t : Set α}
(hs : s.PartiallyWellOrderedOn r)
(ht : t.PartiallyWellOrderedOn r)


@[simp]
theorem toAffineIsometryEquiv_toAffineIsometry :
    e.toAffineIsometryEquiv.toAffineIsometry = e.toLinearIsometry.toAffineIsometry

{𝕜 : Type u_1}
{V : Type u_2}
{V₂ : Type u_5}
[NormedField 𝕜]
[SeminormedAddCommGroup V]
[NormedSpace 𝕜 V]
[SeminormedAddCommGroup V₂]
[NormedSpace 𝕜 V₂]
(e : V ≃ₗᵢ[𝕜] V₂)


/-- If `b` is a basis of a finite separable field extension `L/K`, then `Algebra.discr K b ≠ 0`. -/
theorem discr_not_zero_of_basis [Algebra.IsSeparable K L] (b : Basis ι K L) :
    discr K b ≠ 0

{ι : Type w}
[DecidableEq ι]
[Fintype ι]
(K : Type u)
{L : Type v}
[Field K]
[Field L]
[Algebra K L]
[Module.Finite K L]
[Algebra.IsSeparable K L]
(b : Basis ι K L)


theorem gcdA'_coe : (gcdA' a b : ℕ) = gcdW a b + gcdX a b


theorem not_mem_of_not_mem_closure {s : Set β} {P : β} (hP : P ∉ l s) : P ∉ s

{α : Type u_1}
{β : Type u_4}
[SetLike α β]
(l : LowerAdjoint SetLike.coe)
{s : Set β}
{P : β}
(hP : P ∉ l.toFun s)


@[simp] lemma dual_uIcc (a b : α) : [[toDual a, toDual b]] = ofDual ⁻¹' [[a, b]]

Set.uIcc (OrderDual.toDual a) (OrderDual.toDual b) = ⇑OrderDual.ofDual ⁻¹' Set.uIcc a b


/-- `mongePointVSubFaceCentroidWeightsWithCircumcenter` sums to 0. -/
@[simp]
theorem sum_mongePointVSubFaceCentroidWeightsWithCircumcenter {n : ℕ} {i₁ i₂ : Fin (n + 3)}
    (h : i₁ ≠ i₂) : ∑ i, mongePointVSubFaceCentroidWeightsWithCircumcenter i₁ i₂ i = 0

∑ i : Affine.Simplex.PointsWithCircumcenterIndex (n + 2),
    Affine.Simplex.mongePointVSubFaceCentroidWeightsWithCircumcenter i₁ i₂ i =
  0


theorem empty_ssubset_singleton : (∅ : Finset α) ⊂ {a}


theorem isLittleO_norm_norm : ((fun x => ‖f' x‖) =o[l] fun x => ‖g' x‖) ↔ f' =o[l] g'

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


lemma comapOn_base_iff :
    (N.comapOn E f).Base B ↔ N.Basis' (f '' B) (f '' E) ∧ B.InjOn f ∧ B ⊆ E

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{N : Matroid β}
{E B : Set α}

(N.comapOn E f).Base B ↔ N.Basis' (f '' B) (f '' E) ∧ Set.InjOn f B ∧ B ⊆ E


/-- Identity map as a `CoalgHom`. -/
@[simps!] protected def id : A →ₗc[R] A

(R : Type u_1)
(A : Type u_2)
[CommSemiring R]
[AddCommMonoid A]
[Module R A]
[CoalgebraStruct R A]
(a : A)


theorem IsSeqCompact.exists_tendsto_of_frequently_mem (hs : IsSeqCompact s) {u : ℕ → X}
    (hu : ∃ᶠ n in atTop, u n ∈ s) (huc : CauchySeq u) : ∃ x ∈ s, Tendsto u atTop (𝓝 x)

(hu : ∃ᶠ (n : ℕ) in Filter.atTop, u n ∈ s)

∃ x ∈ s, Filter.Tendsto u Filter.atTop (𝓝 x)


theorem AEStronglyMeasurable.convolution_integrand_swap_snd
    (hf : AEStronglyMeasurable f μ) (hg : AEStronglyMeasurable g μ) (x : G) :
    AEStronglyMeasurable (fun t => L (f (x - t)) (g t)) μ

(hf : MeasureTheory.AEStronglyMeasurable f μ)

(hg : MeasureTheory.AEStronglyMeasurable g μ)

MeasureTheory.AEStronglyMeasurable (fun t => (L (f (x - t))) (g t)) μ


/-- Any closed ball `Metric.closedBall x r`, `0 ≤ r` is the image of the unit closed ball under
`fun y ↦ x + r • y`. -/
theorem affinity_unitClosedBall {r : ℝ} (hr : 0 ≤ r) (x : E) :
    x +ᵥ r • closedBall (0 : E) 1 = closedBall x r

{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{r : ℝ}
(hr : 0 ≤ r)
(x : E)

x +ᵥ r • Metric.closedBall 0 1 = Metric.closedBall x r


@[simp]
theorem down_eq_down {a b : α} : down a = down b ↔ a = b


@[to_additive]
theorem mul_div_mul_comm : a * b / (c * d) = a / c * (b / d)

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


@[to_additive indicator_diff']
theorem mulIndicator_diff (h : s ⊆ t) (f : α → G) :
    mulIndicator (t \ s) f = mulIndicator t f * (mulIndicator s f)⁻¹

{α : Type u_1}
{G : Type u_6}
[AddGroup G]
{s t : Set α}
(h : s ⊆ t)
(f : α → G)

(t \ s).indicator f = t.indicator f + -s.indicator f


/-- The isomorphism between `P⁺ ⋙ F` and `(P ⋙ F)⁺`, functorially in `F`. -/
@[simps! hom_app inv_app]
def plusFunctorWhiskerLeftIso (P : Cᵒᵖ ⥤ D)
    [∀ (F : D ⥤ E) (X : C), PreservesColimitsOfShape (J.Cover X)ᵒᵖ F]
    [∀ (F : D ⥤ E) (X : C) (W : J.Cover X) (P : Cᵒᵖ ⥤ D),
        PreservesLimit (W.index P).multicospan F] :
    (whiskeringLeft _ _ E).obj (J.plusObj P) ≅ (whiskeringLeft _ _ _).obj P ⋙ J.plusFunctor E

(J : CategoryTheory.GrothendieckTopology C)

[CategoryTheory.Category.{max v u, w₁} D]

[CategoryTheory.Category.{max v u, w₂} E]

[∀ (α β : Type (max v u)) (fst snd : β → α),
    CategoryTheory.Limits.HasLimitsOfShape (CategoryTheory.Limits.WalkingMulticospan fst snd) D]

[∀ (α β : Type (max v u)) (fst snd : β → α),
    CategoryTheory.Limits.HasLimitsOfShape (CategoryTheory.Limits.WalkingMulticospan fst snd) E]

[∀ (X : C), CategoryTheory.Limits.HasColimitsOfShape (J.Cover X)ᵒᵖ D]

[∀ (X : C), CategoryTheory.Limits.HasColimitsOfShape (J.Cover X)ᵒᵖ E]

[(F : CategoryTheory.Functor D E) → (X : C) → CategoryTheory.Limits.PreservesColimitsOfShape (J.Cover X)ᵒᵖ F]

[(F : CategoryTheory.Functor D E) →
    (X : C) →
      (W : J.Cover X) →
        (P : CategoryTheory.Functor Cᵒᵖ D) → CategoryTheory.Limits.PreservesLimit (W.index P).multicospan F]

(J.plusFunctorWhiskerLeftIso P).hom.app X = (J.plusCompIso X P).hom


@[simp]
theorem coe_trans (h₁ : M ≃ₘ^n⟮I, I'⟯ M') (h₂ : M' ≃ₘ^n⟮I', J⟯ N) : ⇑(h₁.trans h₂) = h₂ ∘ h₁

{𝕜 : 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']
{G : Type u_7}
[TopologicalSpace G]
{I : ModelWithCorners 𝕜 E H}
{I' : ModelWithCorners 𝕜 E' H'}
{J : ModelWithCorners 𝕜 F G}
{M : Type u_9}
[TopologicalSpace M]
[ChartedSpace H M]
{M' : Type u_10}
[TopologicalSpace M']
[ChartedSpace H' M']
{N : Type u_11}
[TopologicalSpace N]
[ChartedSpace G N]
{n : ℕ∞}
(h₁ : M ≃ₘ^n⟮I, I'⟯ M')
(h₂ : M' ≃ₘ^n⟮I', J⟯ N)


theorem differentiableWithinAt_zpow (m : ℤ) (x : 𝕜) (h : x ≠ 0 ∨ 0 ≤ m) :
    DifferentiableWithinAt 𝕜 (fun x => x ^ m) s x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{s : Set 𝕜}
(m : ℤ)
(x : 𝕜)
(h : x ≠ 0 ∨ 0 ≤ m)


@[simp] theorem comap_inf : comap m (g₁ ⊓ g₂) = comap m g₁ ⊓ comap m g₂

{α : Type u}
{β : Type v}
{g₁ g₂ : Filter β}
{m : α → β}

Filter.comap m (g₁ ⊓ g₂) = Filter.comap m g₁ ⊓ Filter.comap m g₂


theorem toEquiv_injective : Function.Injective (toEquiv : (A ≃ₐc[R] B) → A ≃ B)

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


theorem isLimit_iff_bijective_sectionOfCone (c : Cone F) :
    Nonempty (IsLimit c) ↔ (Types.sectionOfCone c).Bijective

{J : Type v}
[CategoryTheory.Category.{w, v} J]
{F : J ⥤ Type u}
(c : CategoryTheory.Limits.Cone F)

Nonempty (CategoryTheory.Limits.IsLimit c) ↔ Function.Bijective (CategoryTheory.Limits.Types.sectionOfCone c)


lemma Exact.iff_of_ladder_linearEquiv
    (h₁₂ : g₁₂ ∘ₗ e₁ = e₂ ∘ₗ f₁₂) (h₂₃ : g₂₃ ∘ₗ e₂ = e₃ ∘ₗ f₂₃) :
    Exact g₁₂ g₂₃ ↔ Exact f₁₂ f₂₃

{R : Type u_1}
{M : Type u_2}
{M' : Type u_3}
{N : Type u_4}
{N' : Type u_5}
{P : Type u_6}
{P' : Type u_7}
[Semiring R]
[AddCommMonoid M]
[AddCommMonoid M']
[AddCommMonoid N]
[AddCommMonoid N']
[AddCommMonoid P]
[AddCommMonoid P']
[Module R M]
[Module R M']
[Module R N]
[Module R N']
[Module R P]
[Module R P']
{f₁₂ : M →ₗ[R] N}
{f₂₃ : N →ₗ[R] P}
{g₁₂ : M' →ₗ[R] N'}
{g₂₃ : N' →ₗ[R] P'}
{e₁ : M ≃ₗ[R] M'}
{e₂ : N ≃ₗ[R] N'}
{e₃ : P ≃ₗ[R] P'}
(h₁₂ : g₁₂ ∘ₗ ↑e₁ = ↑e₂ ∘ₗ f₁₂)
(h₂₃ : g₂₃ ∘ₗ ↑e₂ = ↑e₃ ∘ₗ f₂₃)

Function.Exact ⇑g₁₂ ⇑g₂₃ ↔ Function.Exact ⇑f₁₂ ⇑f₂₃


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

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

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


@[to_additive (attr := simp)]
protected theorem mul_cancel {r : R} {s t : S} : ((s : R) /ₒ t) * (r /ₒ s) = r /ₒ t

{R : Type u_1}
[Monoid R]
{S : Submonoid R}
[OreLocalization.OreSet S]
{r : R}
{s t : ↥S}


theorem quot_mul_comm (x y : PGame.{u}) : (⟦x * y⟧ : Game) = ⟦y * x⟧


protected theorem neg_mem_iff : -x ∈ p ↔ x ∈ p

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


lemma find_add {hₘ : ∃ m, p (m + n)} {hₙ : ∃ n, p n} (hn : n ≤ Nat.find hₙ) :
    Nat.find hₘ + n = Nat.find hₙ

{n : ℕ}
{p : ℕ → Prop}
[DecidablePred p]
{hₘ : ∃ m, p (m + n)}
{hₙ : ∃ n, p n}
(hn : n ≤ Nat.find hₙ)


@[simp 1100]
theorem mod_mul_right_mod (a b c : Nat) : a % (b * c) % b = a % b


@[simp, norm_cast]
theorem coe_inj {s₁ s₂ : Sym α n} : (s₁ : Multiset α) = s₂ ↔ s₁ = s₂

{α : Type u_1}
{n : ℕ}
{s₁ s₂ : Sym α n}

↑s₁ = ↑s₂ ↔ s₁ = s₂


@[simp] -- Porting note (#10618): was @[simp]
theorem integral_comp_mul_right (hc : c ≠ 0) :
    (∫ x in a..b, f (x * c)) = c⁻¹ • ∫ x in a * c..b * c, f x

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

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


@[simp]
theorem coe_toWeakDual (x' : Dual 𝕜 E) : toWeakDual x' = x'

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


theorem injective_incl : Function.Injective N.incl

{R : Type u}
{L : Type v}
{M : Type w}
[CommRing R]
[LieRing L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
(N : LieSubmodule R L M)


@[simp]
theorem sin_pi_over_two_pow_succ (n : ℕ) :
    sin (π / 2 ^ (n + 2)) = √(2 - sqrtTwoAddSeries 0 n) / 2

Real.sin (Real.pi / 2 ^ (n + 2)) = √(2 - Real.sqrtTwoAddSeries 0 n) / 2


@[to_additive (attr := simp)]
theorem units_inv_symm_left_iff {a : Mˣ} {x y : M} : SemiconjBy (↑a⁻¹) y x ↔ SemiconjBy (↑a) x y

{M : Type u_1}
[Monoid M]
{a : Mˣ}
{x y : M}


theorem not_prime_mul' {a b n : ℕ} (h : a * b = n) (h₁ : a ≠ 1) (h₂ : b ≠ 1) : ¬Prime n


@[simp] theorem castSucc_one {n : Nat} : castSucc (1 : Fin (n + 2)) = 1


@[simp]
theorem sort_toFinset [DecidableEq α] (s : Finset α) : (sort r s).toFinset = s

{α : Type u_1}
(r : α → α → Prop)
[DecidableRel r]
[IsTrans α r]
[IsAntisymm α r]
[IsTotal α r]
[DecidableEq α]
(s : Finset α)


@[simp]
theorem toList_eq_nil {s : Multiset α} : s.toList = [] ↔ s = 0


@[simp] theorem domCongr_symm (e : G ≃* H) : (domCongr k A e).symm = domCongr k A e.symm

(k : Type u₁)
{G : Type u₂}
{H : Type u_1}
[CommSemiring k]
[Monoid G]
[Monoid H]
(A : Type u₃)
[Semiring A]
[Algebra k A]
(e : G ≃* H)

(MonoidAlgebra.domCongr k A e).symm = MonoidAlgebra.domCongr k A e.symm


/-- Every finite convergent corresponds to a rational number. -/
theorem exists_rat_eq_nth_conv : ∃ q : ℚ, (of v).convs n = (q : K)

{K : Type u_1}
[LinearOrderedField K]
[FloorRing K]
(v : K)
(n : ℕ)


lemma Spec.map_app (U) :
    (Spec.map f).app U = StructureSheaf.comap f U (Spec.map f ⁻¹ᵁ U) le_rfl

{R S : CommRingCat}
(f : R ⟶ S)
(U : (AlgebraicGeometry.Spec R).Opens)

AlgebraicGeometry.Scheme.Hom.app (AlgebraicGeometry.Spec.map f) U =
  AlgebraicGeometry.StructureSheaf.comap f U
    ((TopologicalSpace.Opens.map (AlgebraicGeometry.Spec.map f).val.base).obj U) ⋯


@[to_additive]
theorem smul_def (r : R) (x : s) : r • x = ⟨r • x, smul_mem r x.2⟩

{S : Type u'}
{R : Type u}
{M : Type v}
[VAdd R M]
[SetLike S M]
[hS : VAddMemClass S R M]
(s : S)
(r : R)
(x : ↥s)


/-- The functor `AddCommGroup ⥤ CommGroup` by sending `X ↦ multiplicative Y` and `f ↦ f`.
-/
@[simps]
def toCommGrp : AddCommGrp ⥤ CommGrp

AddCommGrp.toCommGrp.map a = AddMonoidHom.toMultiplicative a


@[to_additive]
theorem prod_subtypeDomain_index [∀ i, Zero (β i)] [∀ (i) (x : β i), Decidable (x ≠ 0)]
    [CommMonoid γ] {v : Π₀ i, β i} {p : ι → Prop} [DecidablePred p] {h : ∀ i, β i → γ}
    (hp : ∀ x ∈ v.support, p x) : (v.subtypeDomain p).prod (fun i b => h i b) = v.prod h

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

((DFinsupp.subtypeDomain p v).sum fun i b => h (↑i) b) = v.sum h


@[to_additive]
protected theorem map_list_prod (f : M →* N) (l : List M) : f l.prod = (l.map f).prod

{M : Type u_4}
{N : Type u_5}
[Monoid M]
[Monoid N]
(f : M →* N)
(l : List M)


@[reassoc (attr := simp)]
theorem limit.w (F : J ⥤ C) [HasLimit F] {j j' : J} (f : j ⟶ j') :
    limit.π F j ≫ F.map f = limit.π F j'

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u}
[CategoryTheory.Category.{v, u} C]
(F : J ⥤ C)
[CategoryTheory.Limits.HasLimit F]
{j j' : J}
(f : j ⟶ j')

CategoryTheory.Limits.limit.π F j ≫ F.map f = CategoryTheory.Limits.limit.π F j'


@[reassoc (attr := simp)]
theorem Fork.IsLimit.lift_ι {s t : Fork f g} (hs : IsLimit s) : hs.lift t ≫ s.ι = t.ι

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X Y : C}
{f g : X ⟶ Y}
{s t : CategoryTheory.Limits.Fork f g}
(hs : CategoryTheory.Limits.IsLimit s)

CategoryTheory.CategoryStruct.comp (hs.lift t) s.ι = t.ι


theorem snd_map_prod_mk {X : α → β} {Y : α → γ} {μ : Measure α} (hX : Measurable X) :
    (μ.map fun a => (X a, Y a)).snd = μ.map Y

{α : Type u_1}
{β : Type u_3}
{γ : Type u_5}
[MeasurableSpace α]
[MeasurableSpace β]
[MeasurableSpace γ]
{X : α → β}
{Y : α → γ}
{μ : MeasureTheory.Measure α}
(hX : Measurable X)

(MeasureTheory.Measure.map (fun a => (X a, Y a)) μ).snd = MeasureTheory.Measure.map Y μ


@[mono]
theorem restrict_mono {π₁ π₂ : Prepartition I} (Hle : π₁ ≤ π₂) : π₁.restrict J ≤ π₂.restrict J

{ι : Type u_1}
{I J : BoxIntegral.Box ι}
{π₁ π₂ : BoxIntegral.Prepartition I}
(Hle : π₁ ≤ π₂)


/-- Given an alternating map `f` in `n+1` variables, split the first variable to obtain
a linear map into alternating maps in `n` variables, given by `x ↦ (m ↦ f (Matrix.vecCons x m))`.
It can be thought of as a map $Hom(\bigwedge^{n+1} M, N) \to Hom(M, Hom(\bigwedge^n M, N))$.

This is `MultilinearMap.curryLeft` for `AlternatingMap`. See also
`AlternatingMap.curryLeftLinearMap`. -/
@[simps]
def curryLeft {n : ℕ} (f : M'' [⋀^Fin n.succ]→ₗ[R'] N'') :
    M'' →ₗ[R'] M'' [⋀^Fin n]→ₗ[R'] N''

{R' : Type u_10}
{M'' : Type u_11}
{N'' : Type u_13}
[CommSemiring R']
[AddCommMonoid M'']
[AddCommMonoid N'']
[Module R' M'']
[Module R' N'']
{n : ℕ}
(f : M'' [⋀^Fin n.succ]→ₗ[R'] N'')
(m : M'')
(v : Fin n → M'')

(f.curryLeft m) v = f (Matrix.vecCons m v)


@[simp]
theorem equivToUnitHom_symm_coe (f : Rˣ →* R'ˣ) (a : Rˣ) : equivToUnitHom.symm f ↑a = f a

{R : Type u_1}
[CommMonoid R]
{R' : Type u_2}
[CommMonoidWithZero R']
(f : Rˣ →* R'ˣ)
(a : Rˣ)

(MulChar.equivToUnitHom.symm f) ↑a = ↑(f a)


theorem eq_of_associated_right {a b c : α} (h : Associated b c) :
    multiplicity a b = multiplicity a c

{α : Type u_1}
[Monoid α]
[DecidableRel fun x x_1 => x ∣ x_1]
{a b c : α}
(h : Associated b c)


/-- Less general version of `lift`. -/
private noncomputable irreducible_def lift_aux : L →ₐ[K] M

(K : Type u_1)
[Field K]
(L : Type u_2)
(M : Type u_3)
[Field L]
[Algebra K L]
[Field M]
[Algebra K M]
[IsAlgClosed M]
[Algebra.IsAlgebraic K L]

IsAlgClosed.lift_aux K L M = Classical.choice ⋯


theorem formPerm_eq_self_of_not_mem (l : List α) (x : α) (h : x ∉ l) : formPerm l x = x

{α : Type u_1}
[DecidableEq α]
(l : List α)
(x : α)
(h : x ∉ l)


@[simp]
protected theorem zero : expNegInvGlue 0 = 0


@[simp]
theorem Real.cobounded_eq : cobounded ℝ = atBot ⊔ atTop

Bornology.cobounded ℝ = Filter.atBot ⊔ Filter.atTop


/-- Pull a subsemiring back to an opposite subsemiring along `MulOpposite.unop` -/
@[simps toSubmonoid]
protected def op (S : Subsemiring R) : Subsemiring Rᵐᵒᵖ

{R : Type u_2}
[NonAssocSemiring R]
(S : Subsemiring R)


/-- Two natural numbers are equal if and only if they have the same divisors. -/
lemma dvd_left_iff_eq : (∀ a : ℕ, a ∣ m ↔ a ∣ n) ↔ m = n


@[to_additive (attr := simp)]
theorem subgroupOf_eq_top {H K : Subgroup G} : H.subgroupOf K = ⊤ ↔ K ≤ H

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


theorem IsGLB.isGLB_of_tendsto [Preorder γ] [TopologicalSpace γ] [OrderClosedTopology γ] {f : α → γ}
    {s : Set α} {a : α} {b : γ} (hf : MonotoneOn f s) :
    IsGLB s a → s.Nonempty → Tendsto f (𝓝[s] a) (𝓝 b) → IsGLB (f '' s) b

{α : Type u_1}
{γ : Type u_3}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
[Preorder γ]
[TopologicalSpace γ]
[OrderClosedTopology γ]
{f : α → γ}
{s : Set α}
{a : α}
{b : γ}
(hf : MonotoneOn f s)

IsGLB s a → s.Nonempty → Filter.Tendsto f (𝓝[s] a) (𝓝 b) → IsGLB (f '' s) b


@[simp]
theorem ker_incl : I.incl.ker = ⊥

{R : Type u}
{L : Type v}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
(I : LieIdeal R L)


theorem polynomialFunctions.starClosure_le_equalizer {A : Type*} [StarRing R] [ContinuousStar R]
    [Semiring A] [StarRing A] [Algebra R A] (s : Set R) (φ ψ : C(s, R) →⋆ₐ[R] A)
    (h : φ (toContinuousMapOnAlgHom s X) = ψ (toContinuousMapOnAlgHom s X)) :
    (polynomialFunctions s).starClosure ≤ StarAlgHom.equalizer φ ψ

(h : φ ((Polynomial.toContinuousMapOnAlgHom s) Polynomial.X) = ψ ((Polynomial.toContinuousMapOnAlgHom s) Polynomial.X))


theorem Disjoint.inf_left (h : Disjoint a b) : Disjoint (a ⊓ c) b

{α : Type u_1}
[SemilatticeInf α]
[OrderBot α]
{a b : α}
(c : α)
(h : Disjoint a b)


@[simp]
theorem neg_fuzzy_neg_iff {x y : PGame} : -x ‖ -y ↔ x ‖ y


/-- A trivial bundle is equivalent to the product `B × F`. -/
@[simps (config := { attrs := [`mfld_simps] })]
def TotalSpace.toProd (B F : Type*) : (TotalSpace F fun _ : B => F) ≃ B × F

(B : Type u_4)
(F : Type u_5)
(x : Bundle.TotalSpace F fun x => F)

(Bundle.TotalSpace.toProd B F) x = (x.proj, x.snd)


theorem cauchySeq_iff_tendsto [Nonempty β] [SemilatticeSup β] {u : β → α} :
    CauchySeq u ↔ Tendsto (Prod.map u u) atTop (𝓤 α)

{α : Type u}
{β : Type v}
[uniformSpace : UniformSpace α]
[Nonempty β]
[SemilatticeSup β]
{u : β → α}

CauchySeq u ↔ Filter.Tendsto (Prod.map u u) Filter.atTop (𝓤 α)


theorem insert_union {a} {b : β a} {s₁ s₂ : Finmap β} : insert a b (s₁ ∪ s₂) = insert a b s₁ ∪ s₂

{α : Type u}
{β : α → Type v}
[DecidableEq α]
{a : α}
{b : β a}
{s₁ s₂ : Finmap β}

Finmap.insert a b (s₁ ∪ s₂) = Finmap.insert a b s₁ ∪ s₂


theorem image_update_uIcc_left (f : ∀ i, α i) (i : ι) (a : α i) :
    update f i '' uIcc a (f i) = uIcc (update f i a) f

{ι : Type u_1}
{α : ι → Type u_2}
[(i : ι) → Lattice (α i)]
[DecidableEq ι]
(f : (i : ι) → α i)
(i : ι)
(a : α i)

Function.update f i '' Set.uIcc a (f i) = Set.uIcc (Function.update f i a) f


theorem filter_comm (s : Finset α) : (s.filter p).filter q = (s.filter q).filter p

{α : Type u_1}
(p q : α → Prop)
[DecidablePred p]
[DecidablePred q]
(s : Finset α)

Finset.filter q (Finset.filter p s) = Finset.filter p (Finset.filter q s)


theorem id_hcomp_app {H : E ⥤ C} (α : F ⟶ G) (X : E) : (𝟙 H ◫ α).app X = α.app _

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{E : Type u₃}
[CategoryTheory.Category.{v₃, u₃} E]
{F G : CategoryTheory.Functor C D}
{H : CategoryTheory.Functor E C}
(α : F ⟶ G)
(X : E)

(CategoryTheory.CategoryStruct.id H ◫ α).app X = α.app (H.obj X)


@[simp]
theorem ofNat_comp (n : ℕ) [n.AtLeastTwo] : (no_index (OfNat.ofNat n) : R[X]).comp p = n

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


theorem tendsto_atTop_atBot [Nonempty α] [SemilatticeSup α] [Preorder β] {f : α → β} :
    Tendsto f atTop atBot ↔ ∀ b : β, ∃ i : α, ∀ a : α, i ≤ a → f a ≤ b

{α : Type u_3}
{β : Type u_4}
[Nonempty α]
[SemilatticeSup α]
[Preorder β]
{f : α → β}

Filter.Tendsto f Filter.atTop Filter.atBot ↔ ∀ (b : β), ∃ i, ∀ (a : α), i ≤ a → f a ≤ b


/-- For coprime `a` and `b`, the power of `p` in `a * b` is the sum of the powers in `a` and `b` -/
theorem factorization_mul_apply_of_coprime {p a b : ℕ} (hab : Coprime a b) :
    (a * b).factorization p = a.factorization p + b.factorization p


theorem lift.unique {g : M ⊗[R] N →ₗ[R] P} (H : ∀ x y, g (x ⊗ₜ y) = f x y) : g = lift f


theorem ext_get?' {l₁ l₂ : List α} (h' : ∀ n < max l₁.length l₂.length, l₁.get? n = l₂.get? n) :
    l₁ = l₂

(h' : ∀ (n : ℕ), n < max l₁.length l₂.length → l₁.get? n = l₂.get? n)


theorem dedup_eq_self {l : List α} : dedup l = l ↔ Nodup l

{α : Type u_1}
[DecidableEq α]
{l : List α}


/-- A structure requiring that a scalar product is positive definite and symmetric, from which one
can construct an `InnerProductSpace` instance in `InnerProductSpace.ofCore`. -/
-- @[nolint HasNonemptyInstance] porting note: I don't think we have this linter anymore
structure InnerProductSpace.Core (𝕜 : Type*) (F : Type*) [RCLike 𝕜] [AddCommGroup F]
  [Module 𝕜 F] extends Inner 𝕜 F where
  /-- The inner product is *hermitian*, taking the `conj` swaps the arguments. -/
  conj_symm : ∀ x y, conj (inner y x) = inner x y
  /-- The inner product is positive (semi)definite. -/
  nonneg_re : ∀ x, 0 ≤ re (inner x x)
  /-- The inner product is positive definite. -/
  definite : ∀ x, inner x x = 0 → x = 0
  /-- The inner product is additive in the first coordinate. -/
  add_left : ∀ x y z, inner (x + y) z = inner x z + inner y z
  /-- The inner product is conjugate linear in the first coordinate. -/
  smul_left : ∀ x y r, inner (r • x) y = conj r * inner x y

{𝕜 : Type u_4}
{F : Type u_5}
[RCLike 𝕜]
[AddCommGroup F]
[Module 𝕜 F]
(self : InnerProductSpace.Core 𝕜 F)
(x y z : F)


/-- The product of a strictly antitone function and an antitone function is strictly antitone. -/
@[to_additive add_antitone "The sum of a strictly antitone function and an antitone function is
strictly antitone."]
theorem StrictAntiOn.mul_antitone' (hf : StrictAntiOn f s) (hg : AntitoneOn g s) :
    StrictAntiOn (fun x => f x * g x) s

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

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


@[simp] theorem dual_ground : M✶.E = M.E


@[elab_as_elim]
theorem case_strong_induction_on [DecidableEq α] {p : Finset α → Prop} (s : Finset α) (h₀ : p ∅)
    (h₁ : ∀ a s, a ∉ s → (∀ t ⊆ s, p t) → p (insert a s)) : p s

(h₁ : ∀ (a : α) (s : Finset α), a ∉ s → (∀ t ⊆ s, p t) → p (insert a s))


/-- This lemma will be key to establishing good simp normal forms. -/
lemma map_mkPrecomp_eqToHom {F : (CostructuredArrow yoneda A)ᵒᵖ ⥤ Type v} {X Y : C} {f : X ⟶ Y}
    {g g' : yoneda.obj Y ⟶ A} (h : g = g') {x : F.obj (op (CostructuredArrow.mk g'))} :
    F.map (CostructuredArrow.mkPrecomp g f).op (F.map (eqToHom (by rw [h])) x) =
      F.map (eqToHom (by rw [h])) (F.map (CostructuredArrow.mkPrecomp g' f).op x)

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

{F : CategoryTheory.Functor (CategoryTheory.CostructuredArrow CategoryTheory.yoneda A)ᵒᵖ (Type v)}

{g g' : CategoryTheory.yoneda.obj Y ⟶ A}

{x : F.obj (Opposite.op (CategoryTheory.CostructuredArrow.mk g'))}

F.map (CategoryTheory.CostructuredArrow.mkPrecomp g f).op (F.map (CategoryTheory.eqToHom ⋯) x) =
  F.map (CategoryTheory.eqToHom ⋯) (F.map (CategoryTheory.CostructuredArrow.mkPrecomp g' f).op x)


theorem continuous_testAgainstNN_eval (f : Ω →ᵇ ℝ≥0) :
    Continuous fun μ : ProbabilityMeasure Ω => μ.toFiniteMeasure.testAgainstNN f

{Ω : Type u_1}
[MeasurableSpace Ω]
[TopologicalSpace Ω]
[OpensMeasurableSpace Ω]
(f : Ω →ᵇ ℝ≥0)

Continuous fun μ => μ.toFiniteMeasure.testAgainstNN f


/-- The cokernel of `g.unop` is the opposite of `kernel g`. -/
@[simps!]
def cokernelUnopUnop : cokernel g.unop ≅ (kernel g).unop

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Abelian C]
{A B : Cᵒᵖ}
(g : A ⟶ B)

(CategoryTheory.cokernelUnopUnop g).inv =
  (CategoryTheory.Limits.kernel.lift g (CategoryTheory.Limits.cokernel.π g.unop).op ⋯).unop


@[to_additive (attr := simp)]
theorem isUnit_iff_singleton : IsUnit s ↔ ∃ a, s = {a}


@[simp]
theorem coe_inf (p p' : NonUnitalSubring R) :
    ((p ⊓ p' : NonUnitalSubring R) : Set R) = (p : Set R) ∩ p'

{R : Type u}
[NonUnitalNonAssocRing R]
(p p' : NonUnitalSubring R)


theorem IsIntegral.map {B C F : Type*} [Ring B] [Ring C] [Algebra R B] [Algebra A B] [Algebra R C]
    [IsScalarTower R A B] [Algebra A C] [IsScalarTower R A C] {b : B}
    [FunLike F B C] [AlgHomClass F A B C] (f : F)
    (hb : IsIntegral R b) : IsIntegral R (f b)

{R : Type u_1}
{A : Type u_2}
[CommRing R]
[CommRing A]
[Algebra R A]
{B : Type u_5}
{C : Type u_6}
{F : Type u_7}
[Ring B]
[Ring C]
[Algebra R B]
[Algebra A B]
[Algebra R C]
[IsScalarTower R A B]
[Algebra A C]
[IsScalarTower R A C]
{b : B}
[FunLike F B C]
[AlgHomClass F A B C]
(f : F)
(hb : IsIntegral R b)


@[to_additive AddMonoid.one_lt_exponent]
lemma one_lt_exponent [Nontrivial G] : 1 < Monoid.exponent G

{G : Type u}
[AddLeftCancelMonoid G]
[Finite G]
[Nontrivial G]


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

{α : Type u_3}
{β : Type u_4}
[Sup α]
[Bot α]
[Sup β]
[Bot β]
(f : SupBotHom α β)


theorem divisors_prime_pow {p : ℕ} (pp : p.Prime) (k : ℕ) :
    divisors (p ^ k) = (Finset.range (k + 1)).map ⟨(p ^ ·), Nat.pow_right_injective pp.two_le⟩

(p ^ k).divisors = Finset.map { toFun := fun x => p ^ x, inj' := ⋯ } (Finset.range (k + 1))


@[simp]
theorem count_nth_zero : count p (nth p 0) = 0


theorem iInter₂_comm (s : ∀ i₁, κ₁ i₁ → ∀ i₂, κ₂ i₂ → Set α) :
    ⋂ (i₁) (j₁) (i₂) (j₂), s i₁ j₁ i₂ j₂ = ⋂ (i₂) (j₂) (i₁) (j₁), s i₁ j₁ i₂ j₂

(s : (i₁ : ι) → κ₁ i₁ → (i₂ : ι) → κ₂ i₂ → Set α)

⋂ i₁, ⋂ j₁, ⋂ i₂, ⋂ j₂, s i₁ j₁ i₂ j₂ = ⋂ i₂, ⋂ j₂, ⋂ i₁, ⋂ j₁, s i₁ j₁ i₂ j₂


theorem res_const' (f g : R) (V hv) :
    (structureSheaf R).1.map (homOfLE hv).op (const R f g (PrimeSpectrum.basicOpen g) fun _ => id) =
      const R f g V hv

(V : TopologicalSpace.Opens ↑(AlgebraicGeometry.PrimeSpectrum.Top R))

((AlgebraicGeometry.Spec.structureSheaf R).val.map (CategoryTheory.homOfLE hv).op)
    (AlgebraicGeometry.StructureSheaf.const R f g (PrimeSpectrum.basicOpen g) ⋯) =
  AlgebraicGeometry.StructureSheaf.const R f g V hv


@[simp]
theorem isLeast_bot_iff [OrderBot α] : IsLeast s ⊥ ↔ ⊥ ∈ s

{α : Type u}
[Preorder α]
{s : Set α}
[OrderBot α]


@[to_additive (attr := simp)]
theorem unsym_eq_one_iff [One α] (a : αˢʸᵐ) : unsym a = 1 ↔ a = 1


theorem pred_to_nat {n : PosNum} (h : 1 < n) : (pred n : ℕ) = Nat.pred n


lemma addX_neg {P : Fin 3 → R} (hP : W'.Equation P) : W'.addX P (W'.neg P) = W'.dblZ P ^ 2

{R : Type u}
[CommRing R]
{W' : WeierstrassCurve.Jacobian R}
{P : Fin 3 → R}
(hP : W'.Equation P)