/-- An additive `n`-Freiman homomorphism from a set `A` to a set `B` is a map which preserves sums
of `n` elements. -/
structure IsAddFreimanHom [AddCommMonoid α] [AddCommMonoid β] (n : ℕ) (A : Set α) (B : Set β)
    (f : α → β) : Prop where
  mapsTo : MapsTo f A B
  /-- An additive `n`-Freiman homomorphism preserves sums of `n` elements. -/
  map_sum_eq_map_sum ⦃s t : Multiset α⦄ (hsA : ∀ ⦃x⦄, x ∈ s → x ∈ A) (htA : ∀ ⦃x⦄, x ∈ t → x ∈ A)
    (hs : Multiset.card s = n) (ht : Multiset.card t = n) (h : s.sum = t.sum) :
    (s.map f).sum = (t.map f).sum

{α : Type u_2}
{β : Type u_3}
[AddCommMonoid α]
[AddCommMonoid β]
{n : ℕ}
{A : Set α}
{B : Set β}
{f : α → β}
(self : IsAddFreimanHom n A B f)
⦃s t : Multiset α⦄
(hsA : ∀ ⦃x : α⦄, x ∈ s → x ∈ A)
(htA : ∀ ⦃x : α⦄, x ∈ t → x ∈ A)
(hs : Multiset.card s = n)
(ht : Multiset.card t = n)
(h : s.sum = t.sum)

(Multiset.map f s).sum = (Multiset.map f t).sum


theorem hasMFDerivWithinAt_snd (s : Set (M × M')) (x : M × M') :
    HasMFDerivWithinAt (I.prod I') I' Prod.snd s x
      (ContinuousLinearMap.snd 𝕜 (TangentSpace I x.1) (TangentSpace I' x.2))

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
(I : ModelWithCorners 𝕜 E H)
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
[SmoothManifoldWithCorners I M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
(I' : ModelWithCorners 𝕜 E' H')
{M' : Type u_7}
[TopologicalSpace M']
[ChartedSpace H' M']
[SmoothManifoldWithCorners I' M']
(s : Set (M × M'))
(x : M × M')


theorem single_zero (a : G) : (single a 0 : k[G]) = 0

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


/-- A sequence of functions `(fₙ)` is uniformly integrable in the probability sense if for all
`ε > 0`, there exists some `C` such that `∫ x in {|fₙ| ≥ C}, fₙ x ∂μ ≤ ε` for all `n`. -/
theorem uniformIntegrable_of [IsFiniteMeasure μ] (hp : 1 ≤ p) (hp' : p ≠ ∞)
    (hf : ∀ i, AEStronglyMeasurable (f i) μ)
    (h : ∀ ε : ℝ, 0 < ε → ∃ C : ℝ≥0,
      ∀ i, eLpNorm ({ x | C ≤ ‖f i x‖₊ }.indicator (f i)) p μ ≤ ENNReal.ofReal ε) :
    UniformIntegrable f p μ

{f : ι → α → β}

(hf : ∀ (i : ι), MeasureTheory.AEStronglyMeasurable (f i) μ)

(h :
  ∀ (ε : ℝ), 0 < ε → ∃ C, ∀ (i : ι), MeasureTheory.eLpNorm ({x | C ≤ ‖f i x‖₊}.indicator (f i)) p μ ≤ ENNReal.ofReal ε)


theorem rel_add_left {as₀ as₁} :
    ∀ {bs}, Rel r (as₀ + as₁) bs ↔ ∃ bs₀ bs₁, Rel r as₀ bs₀ ∧ Rel r as₁ bs₁ ∧ bs = bs₀ + bs₁

{α : Type u_1}
{β : Type v}
{r : α → β → Prop}
{as₀ as₁ : Multiset α}
{bs : Multiset β}

Multiset.Rel r (as₀ + as₁) bs ↔ ∃ bs₀ bs₁, Multiset.Rel r as₀ bs₀ ∧ Multiset.Rel r as₁ bs₁ ∧ bs = bs₀ + bs₁


theorem map_val_atTop_of_Ici_subset [SemilatticeSup α] {a : α} {s : Set α} (h : Ici a ⊆ s) :
    map ((↑) : s → α) atTop = atTop

{α : Type u_3}
[SemilatticeSup α]
{a : α}
{s : Set α}
(h : Set.Ici a ⊆ s)

Filter.map Subtype.val Filter.atTop = Filter.atTop


/-- The forgetful functor from `Scheme` to `TopCat`. -/
@[simps!]
def forgetToTop : Scheme ⥤ TopCat

∀ {X Y : AlgebraicGeometry.Scheme} (f : X ⟶ Y),
  AlgebraicGeometry.Scheme.forgetToTop.map f = (AlgebraicGeometry.SheafedSpace.forget CommRingCat).map f.val


theorem count_true_le_count_false_add_one (hl : Chain' (· ≠ ·) l) :
    count true l ≤ count false l + 1

(hl : List.Chain' (fun x x_1 => x ≠ x_1) l)

List.count true l ≤ List.count false l + 1


theorem card_biUnion_lt_iff_forall_of_isRegular {α β : Type u} {s : Set α} {t : ∀ a ∈ s, Set β}
    {c : Cardinal} (hc : c.IsRegular) (hs : #s < c) :
    #(⋃ a ∈ s, t a ‹_›) < c ↔ ∀ a (ha : a ∈ s), # (t a ha) < c

{α β : Type u}
{s : Set α}
{t : (a : α) → a ∈ s → Set β}
{c : Cardinal.{u}}
(hc : c.IsRegular)
(hs : #↑s < c)

#↑(⋃ a, ⋃ (h : a ∈ s), t a h) < c ↔ ∀ (a : α) (ha : a ∈ s), #↑(t a ha) < c


lemma isLittleO_deriv_smoothingFn : deriv ε =o[atTop] fun x => x⁻¹

deriv AkraBazziRecurrence.smoothingFn =o[Filter.atTop] fun x => x⁻¹


@[simp]
theorem mem_diag : x ∈ s.diag ↔ x.1 ∈ s ∧ x.1 = x.2

{α : Type u_1}
[DecidableEq α]
{s : Finset α}
{x : α × α}


theorem cos_eq_sqrt_one_sub_sin_sq {x : ℝ} (hl : -(π / 2) ≤ x) (hu : x ≤ π / 2) :
    cos x = √(1 - sin x ^ 2)

{x : ℝ}
(hl : -(Real.pi / 2) ≤ x)
(hu : x ≤ Real.pi / 2)


@[to_additive (attr := simp)]
theorem swap_eq_one {x : M ∗ N} : swap M N x = 1 ↔ x = 1

{M : Type u_1}
{N : Type u_2}
[MulOneClass M]
[MulOneClass N]
{x : Monoid.Coprod M N}


@[simp]
theorem round_add_int (x : α) (y : ℤ) : round (x + y) = round x + y

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


@[to_additive (attr := simp)]
theorem nontrivial_iff : Nontrivial (Submonoid M) ↔ Nontrivial M

Nontrivial (AddSubmonoid M) ↔ Nontrivial M


theorem mod_lt_of_pos (a : Int) {b : Int} (H : 0 < b) : mod a b < b


/--
This lemma follows from the preexisting `Unique` instance, but
it is often convenient to use it directly as `apply toUnit_unique` forcing
lean to do the necessary elaboration.
-/
lemma toUnit_unique {X : C} (f g : X ⟶ 𝟙_ _) : f = g

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.ChosenFiniteProducts C]
{X : C}
(f g : X ⟶ 𝟙_ C)


@[to_additive]
theorem min_mul_mul_left (a b c : α) : min (a * b) (a * c) = a * min b c

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


@[to_additive]
theorem closure_inv (s : Set G) : closure s⁻¹ = (closure s)⁻¹

AddSubmonoid.closure (-s) = -AddSubmonoid.closure s


/-- If a function applied at a point is 1, a product is unchanged by
removing that point, if present, from a `Finset`. -/
@[to_additive "If a function applied at a point is 0, a sum is unchanged by
removing that point, if present, from a `Finset`."]
theorem prod_erase [DecidableEq α] (s : Finset α) {f : α → β} {a : α} (h : f a = 1) :
    ∏ x ∈ s.erase a, f x = ∏ x ∈ s, f x

{α : Type u_3}
{β : Type u_4}
[CommMonoid β]
[DecidableEq α]
(s : Finset α)
{f : α → β}
{a : α}
(h : f a = 1)


theorem WfDvdMonoid.of_wellFounded_associates [CancelCommMonoidWithZero α]
    (h : WellFounded ((· < ·) : Associates α → Associates α → Prop)) : WfDvdMonoid α

{α : Type u_1}
[CancelCommMonoidWithZero α]
(h : WellFounded fun x x_1 => x < x_1)


@[reassoc (attr := simp)]
lemma toSheafify_plusPlusIsoSheafify_hom (P : Cᵒᵖ ⥤ D) :
    J.toSheafify P ≫ (plusPlusIsoSheafify J D P).hom = toSheafify J P

(J : CategoryTheory.GrothendieckTopology C)

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

[∀ (P : Cᵒᵖ ⥤ D) (X : C) (S : J.Cover X), CategoryTheory.Limits.HasMultiequalizer (S.index P)]

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

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

J.toSheafify P ≫ (CategoryTheory.plusPlusIsoSheafify J D P).hom = CategoryTheory.toSheafify J P


@[to_additive (attr := simp)]
theorem singletonMulHom_apply (a : α) : singletonMulHom a = {a}


/-- The subsemiring generated by a set includes the set. -/
@[simp, aesop safe 20 apply (rule_sets := [SetLike])]
theorem subset_closure {s : Set R} : s ⊆ closure s

{R : Type u}
[NonAssocSemiring R]
{s : Set R}


lemma isNilpotent_of_pos_nilpotencyClass (hx : 0 < nilpotencyClass x) :
    IsNilpotent x

{R : Type u_1}
{x : R}
[Zero R]
[Pow R ℕ]
(hx : 0 < nilpotencyClass x)


@[to_additive]
theorem prod_map_one : prod (m.map fun _ => (1 : α)) = 1

{ι : Type u_2}
{α : Type u_3}
[CommMonoid α]
{m : Multiset ι}


theorem res_univ (f : α → β) : PFun.res f Set.univ = f

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


@[simp]
theorem neg_iff : LiouvilleWith p (-x) ↔ LiouvilleWith p x


theorem sInf_adj_of_nonempty {s : Set G.Subgraph} (hs : s.Nonempty) :
    (sInf s).Adj a b ↔ ∀ G' ∈ s, Adj G' a b

{V : Type u}
{G : SimpleGraph V}
{a b : V}
{s : Set G.Subgraph}
(hs : s.Nonempty)


theorem _root_.Submodule.annihilator_top_inter_nonZeroDivisors [Module.Finite R M]
    (hM : Module.IsTorsion R M) : ((⊤ : Submodule R M).annihilator : Set R) ∩ R⁰ ≠ ∅

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
[Module.Finite R M]
(hM : Module.IsTorsion R M)


theorem choose_mono (b : ℕ) : Monotone fun a => choose a b


/-- Every separable polynomial splits in the field extension `f : k →+* K` if `k` is
separably closed.

See also `IsSepClosed.splits_codomain` for the case where `k` is separably closed.
-/
theorem IsSepClosed.splits_domain [IsSepClosed k] {f : k →+* K}
    (p : k[X]) (h : p.Separable) : p.Splits f

{k : Type u}
[Field k]
{K : Type v}
[Field K]
[IsSepClosed k]
{f : k →+* K}
(p : k[X])
(h : p.Separable)


theorem componentComplMk_mem (G : SimpleGraph V) {v : V} (vK : v ∉ K) : v ∈ G.componentComplMk vK

{V : Type u}
{K : Set V}
(G : SimpleGraph V)
{v : V}
(vK : v ∉ K)


@[to_additive]
theorem image_mulSingle_Ico_right (i : ι) (b : α i) :
    Pi.mulSingle i '' Ico 1 b = Ico 1 (Pi.mulSingle i b)

{ι : Type u_1}
{α : ι → Type u_2}
[DecidableEq ι]
[(i : ι) → PartialOrder (α i)]
[(i : ι) → Zero (α i)]
(i : ι)
(b : α i)

Pi.single i '' Set.Ico 0 b = Set.Ico 0 (Pi.single i b)


@[simp]
theorem commutatorElement_one_right : ⁅g, (1 : G)⁆ = 1


@[simp]
theorem quot_mk_to_coe (l : List α) : @Eq (Multiset α) ⟦l⟧ l


protected lemma lt_of_lt_of_le (h₁ : x.1 < y.1) (h₂ : x.2 ≤ y.2) : x < y

{α : Type u_2}
{β : Type u_3}
[Preorder α]
[Preorder β]
{x y : α × β}
(h₁ : x.1 < y.1)
(h₂ : x.2 ≤ y.2)


/-- We prove that `seminormFromConst' hf1 hc hpm x` is the limit of the sequence
  `seminormFromConst_seq c f x` as `n` tends to infinity. -/
theorem seminormFromConst_isLimit (x : R) :
    Tendsto (seminormFromConst_seq c f x) atTop (𝓝 (seminormFromConst' hf1 hc hpm x))

{R : Type u_1}
[CommRing R]
{c : R}
{f : RingSeminorm R}
(hf1 : f 1 ≤ 1)
(hc : f c ≠ 0)
(hpm : IsPowMul ⇑f)
(x : R)

Filter.Tendsto (seminormFromConst_seq c f x) Filter.atTop (𝓝 (seminormFromConst' hf1 hc hpm x))


/-- Characterization the map `descSet hc`: the image of an element in a vertex of the original
  diagram in the cocone point lies in `descSet hc ls` if and only if the image of the corresponding
  element in the lifted diagram lie in `ls`. -/
lemma descSet_spec (s : Set c.pt) (ls : Set lc.pt) :
    descSet hc ls = s ↔ ∀ j x, lc.ι.app j ⟨x⟩ ∈ ls ↔ c.ι.app j x ∈ s

(hc : CategoryTheory.Limits.IsColimit c)

{lc : CategoryTheory.Limits.Cocone (K.comp CategoryTheory.uliftFunctor.{v, u})}

CategoryTheory.Limits.Types.descSet hc ls = s ↔ ∀ (j : J) (x : K.obj j), lc.ι.app j { down := x } ∈ ls ↔ c.ι.app j x ∈ s


@[simp]
theorem coe_mk'_linearMap (D : A →ₗ[R] M) (h) : (mk' D h : A →ₗ[R] M) = D

(h : ∀ (a b : A), D (a * b) = a • D b + b • D a)


theorem Memℒp.of_bound [IsFiniteMeasure μ] {f : α → E} (hf : AEStronglyMeasurable f μ) (C : ℝ)
    (hfC : ∀ᵐ x ∂μ, ‖f x‖ ≤ C) : Memℒp f p μ

(hf : MeasureTheory.AEStronglyMeasurable f μ)


@[simp, norm_cast]
theorem ofReal_re (r : ℝ) : Complex.re (r : ℂ) = r


/-- The point of the augmentation. -/
@[simps!]
def point : Augmented C ⥤ C

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

∀ {X Y : CategoryTheory.Comma (CategoryTheory.CosimplicialObject.const C) (𝟭 (CategoryTheory.CosimplicialObject C))}
  (f : X ⟶ Y), CategoryTheory.CosimplicialObject.Augmented.point.map f = f.left


theorem LinearOrderedAddCommGroup.tendsto_nhds {x : Filter β} {a : α} :
    Tendsto f x (𝓝 a) ↔ ∀ ε > (0 : α), ∀ᶠ b in x, |f b - a| < ε

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[LinearOrderedAddCommGroup α]
[OrderTopology α]
{f : β → α}
{x : Filter β}
{a : α}

Filter.Tendsto f x (𝓝 a) ↔ ∀ ε > 0, ∀ᶠ (b : β) in x, |f b - a| < ε


@[to_additive]
theorem Integrable.comp_div_right {f : G → F} [IsMulRightInvariant μ] (hf : Integrable f μ)
    (g : G) : Integrable (fun t => f (t / g)) μ

{G : Type u_4}
{F : Type u_6}
[MeasurableSpace G]
[NormedAddCommGroup F]
{μ : MeasureTheory.Measure G}
[Group G]
[MeasurableMul G]
{f : G → F}
[μ.IsMulRightInvariant]
(hf : MeasureTheory.Integrable f μ)
(g : G)

MeasureTheory.Integrable (fun t => f (t / g)) μ


theorem Filter.EventuallyEq.differentiableAt_iff (h : f₀ =ᶠ[𝓝 x] f₁) :
    DifferentiableAt 𝕜 f₀ x ↔ DifferentiableAt 𝕜 f₁ x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f₀ f₁ : E → F}
{x : E}
(h : f₀ =ᶠ[𝓝 x] f₁)


theorem apply_eq_iff_eq_symm_apply (e : P₁ ≃ᵃ[k] P₂) {p₁ p₂} : e p₁ = p₂ ↔ p₁ = e.symm p₂

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


theorem card_nthRoots (n : ℕ) (a : R) : Multiset.card (nthRoots n a) ≤ n

{R : Type u}
[CommRing R]
[IsDomain R]
(n : ℕ)
(a : R)

Multiset.card (Polynomial.nthRoots n a) ≤ n


@[to_additive]
theorem pow_mem_pow (hs : s ∈ f) : ∀ n : ℕ, s ^ n ∈ f ^ n

{α : Type u_2}
[Monoid α]
{f : Filter α}
{s : Set α}
(hs : s ∈ f)
(n : ℕ)


lemma reflectRoot_isNonZero (α β : Weight K H L) (hβ : β.IsNonZero) :
    (reflectRoot α β).IsNonZero

{K : Type u_1}
{L : Type u_2}
[Field K]
[CharZero K]
[LieRing L]
[LieAlgebra K L]
[LieAlgebra.IsKilling K L]
[FiniteDimensional K L]
{H : LieSubalgebra K L}
[H.IsCartanSubalgebra]
[LieModule.IsTriangularizable K (↥H) L]
(α β : LieModule.Weight K (↥H) L)
(hβ : β.IsNonZero)


/-- Alternative version of `norm_le_sSupNormIm` with a strict inequality and a positive `ε`. -/
lemma norm_lt_sSupNormIm_eps (f : ℂ → E) (ε : ℝ) (hε : ε > 0) (z : ℂ)
    (hD : z ∈ verticalClosedStrip 0 1) (hB : BddAbove ((norm ∘ f) '' (verticalClosedStrip 0 1))) :
    ‖f z‖ < ε + sSupNormIm f (z.re)

(hD : z ∈ Complex.HadamardThreeLines.verticalClosedStrip 0 1)

(hB : BddAbove (norm ∘ f '' Complex.HadamardThreeLines.verticalClosedStrip 0 1))

‖f z‖ < ε + Complex.HadamardThreeLines.sSupNormIm f z.re


theorem bound (hN : 4096 ≤ N) : (N : ℝ) ^ (nValue N : ℝ)⁻¹ / exp 1 < dValue N

↑N ^ (↑(Behrend.nValue N))⁻¹ / rexp 1 < ↑(Behrend.dValue N)


@[simp]
theorem matPolyEquiv_coeff_apply (m : Matrix n n R[X]) (k : ℕ) (i j : n) :
    coeff (matPolyEquiv m) k i j = coeff (m i j) k

{R : Type u_1}
[CommSemiring R]
{n : Type w}
[DecidableEq n]
[Fintype n]
(m : Matrix n n R[X])
(k : ℕ)
(i j : n)

(matPolyEquiv m).coeff k i j = (m i j).coeff k


lemma prod_apply_symm (s : Set (α × β)) (s_mble : MeasurableSet s) :
    μ.prod ν s = ENNReal.toNNReal (∫⁻ y, μ.toMeasure ((fun x ↦ ⟨x, y⟩) ⁻¹' s) ∂ν)

{α : Type u_1}
[MeasurableSpace α]
{β : Type u_2}
[MeasurableSpace β]
(μ : MeasureTheory.FiniteMeasure α)
(ν : MeasureTheory.FiniteMeasure β)
(s : Set (α × β))
(s_mble : MeasurableSet s)

(μ.prod ν) s = (∫⁻ (y : β), ↑μ ((fun x => (x, y)) ⁻¹' s) ∂↑ν).toNNReal


theorem _root_.HasCompactSupport.continuous_convolution_left
    (hcf : HasCompactSupport f) (hf : Continuous f) (hg : LocallyIntegrable g μ) :
    Continuous (f ⋆[L, μ] g)

(hg : MeasureTheory.LocallyIntegrable g μ)

Continuous (MeasureTheory.convolution f g L μ)


theorem bipartiteBelow_swap : t.bipartiteBelow (swap r) a = t.bipartiteAbove r a

{α : Type u_1}
{β : Type u_2}
(r : α → β → Prop)
(t : Finset β)
(a : α)
[DecidablePred (r a)]

Finset.bipartiteBelow (Function.swap r) t a = Finset.bipartiteAbove r t a


@[to_additive (attr := simp, norm_cast)]
theorem inv_coe_set [InvolutiveInv G] [SetLike S G] [InvMemClass S G] {H : S} : (H : Set G)⁻¹ = H

{G : Type u_2}
{S : Type u_4}
[InvolutiveInv G]
[SetLike S G]
[InvMemClass S G]
{H : S}


theorem toRingEquiv_symm (f : A₁ ≃ₐ[R] A₁) : (f : A₁ ≃+* A₁).symm = f.symm

{R : Type uR}
{A₁ : Type uA₁}
[CommSemiring R]
[Semiring A₁]
[Algebra R A₁]
(f : A₁ ≃ₐ[R] A₁)


/-- Test for convergence of the `p`-series: the real-valued series `∑' n : ℕ, (n ^ p)⁻¹` converges
if and only if `1 < p`. -/
@[simp]
theorem summable_nat_rpow_inv {p : ℝ} :
    Summable (fun n => ((n : ℝ) ^ p)⁻¹ : ℕ → ℝ) ↔ 1 < p


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

{M : Type u_1}
{P : Type u_3}
[AddZeroClass M]
[AddZeroClass P]
{c : AddCon M}
{f : M →+ P}
(H : c ≤ AddCon.ker f)
(x : M)


theorem lift_of (f : M →ₗ[R] N) (x : M) : lift I f (of I M x) = f x

{R : Type u_1}
[CommRing R]
(I : Ideal R)
{M : Type u_2}
[AddCommGroup M]
[Module R M]
{N : Type u_3}
[AddCommGroup N]
[Module R N]
[h : IsHausdorff I N]
(f : M →ₗ[R] N)
(x : M)

(Hausdorffification.lift I f) ((Hausdorffification.of I M) x) = f x


theorem tail_support_append {u v w : V} (p : G.Walk u v) (p' : G.Walk v w) :
    (p.append p').support.tail = p.support.tail ++ p'.support.tail

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


@[reassoc (attr := simp)]
theorem sigmaComparison_map_desc [HasCoproduct f] [HasCoproduct fun b => G.obj (f b)] (P : C)
    (g : ∀ j, f j ⟶ P) :
    sigmaComparison G f ≫ G.map (Sigma.desc g) = Sigma.desc fun j => G.map (g j)

[CategoryTheory.Limits.HasCoproduct fun b => G.obj (f b)]

CategoryTheory.Limits.sigmaComparison G f ≫ G.map (CategoryTheory.Limits.Sigma.desc g) =
  CategoryTheory.Limits.Sigma.desc fun j => G.map (g j)


/-- If `e` is also a permutation, we can write `permCongr`
completely in terms of the group structure. -/
@[simp]
theorem permCongr_eq_mul (e p : Perm α) : e.permCongr p = e * p * e⁻¹


theorem min_associative : Associative (α := α) min


/-- If `s` is a compact set and `μ` is a locally finite measure, then `s` admits an open superset of
finite measure. -/
theorem exists_open_superset_measure_lt_top (h : IsCompact s) (μ : Measure α)
    [IsLocallyFiniteMeasure μ] : ∃ U ⊇ s, IsOpen U ∧ μ U < ∞


@[simp] lemma IsLeftRegular.mul_left_eq_zero_iff (hb : IsLeftRegular b) : b * a = 0 ↔ a = 0

{R : Type u_1}
[MulZeroClass R]
{a b : R}
(hb : IsLeftRegular b)


{α : Type u}
[LE α]
[OrderTop α]
{a : α}


theorem set_biInter_coe (s : Finset α) (t : α → Set β) : ⋂ x ∈ (↑s : Set α), t x = ⋂ x ∈ s, t x

{α : Type u_2}
{β : Type u_3}
(s : Finset α)
(t : α → Set β)


theorem det_one_smulRight {𝕜 : Type*} [NormedField 𝕜] (v : 𝕜) :
    ((1 : 𝕜 →L[𝕜] 𝕜).smulRight v).det = v

(ContinuousLinearMap.smulRight 1 v).det = v


theorem dvd_ofDigits_sub_ofDigits {α : Type*} [CommRing α] {a b k : α} (h : k ∣ a - b)
    (L : List ℕ) : k ∣ ofDigits a L - ofDigits b L

{α : Type u_1}
[CommRing α]
{a b k : α}
(h : k ∣ a - b)
(L : List ℕ)


@[to_additive Birkhoff_inequalities]
lemma m_Birkhoff_inequalities (a b c : α) :
    |(a ⊔ c) / (b ⊔ c)|ₘ ⊔ |(a ⊓ c) / (b ⊓ c)|ₘ ≤ |a / b|ₘ

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

mabs ((a ⊔ c) / (b ⊔ c)) ⊔ mabs ((a ⊓ c) / (b ⊓ c)) ≤ mabs (a / b)


theorem natDegree_mul_leadingCoeff_inv (p : K[X]) {q : K[X]} (h : q ≠ 0) :
    natDegree (p * C (leadingCoeff q)⁻¹) = natDegree p

{K : Type u_1}
[DivisionRing K]
(p : K[X])
{q : K[X]}
(h : q ≠ 0)

(p * Polynomial.C q.leadingCoeff⁻¹).natDegree = p.natDegree


/-- The mates equivalence commutes with horizontal composition of squares. -/
theorem mateEquiv_hcomp
    (α : G ⋙ L₂ ⟶ L₁ ⋙ H) (β : H ⋙ L₄ ⟶ L₃ ⋙ K) :
    (mateEquiv (adj₁.comp adj₃) (adj₂.comp adj₄)) (leftAdjointSquare.hcomp α β) =
      rightAdjointSquare.hcomp (mateEquiv adj₁ adj₂ α) (mateEquiv adj₃ adj₄ β)

{A : Type u₁}
{B : Type u₂}
{C : Type u₃}
{D : Type u₄}
{E : Type u₅}
{F : Type u₆}
[CategoryTheory.Category.{v₁, u₁} A]
[CategoryTheory.Category.{v₂, u₂} B]
[CategoryTheory.Category.{v₃, u₃} C]
[CategoryTheory.Category.{v₄, u₄} D]
[CategoryTheory.Category.{v₅, u₅} E]
[CategoryTheory.Category.{v₆, u₆} F]
{G : CategoryTheory.Functor A D}
{H : CategoryTheory.Functor B E}
{K : CategoryTheory.Functor C F}
{L₁ : CategoryTheory.Functor A B}
{R₁ : CategoryTheory.Functor B A}
{L₂ : CategoryTheory.Functor D E}
{R₂ : CategoryTheory.Functor E D}
{L₃ : CategoryTheory.Functor B C}
{R₃ : CategoryTheory.Functor C B}
{L₄ : CategoryTheory.Functor E F}
{R₄ : CategoryTheory.Functor F E}
(adj₁ : L₁ ⊣ R₁)
(adj₂ : L₂ ⊣ R₂)
(adj₃ : L₃ ⊣ R₃)
(adj₄ : L₄ ⊣ R₄)
(α : G.comp L₂ ⟶ L₁.comp H)
(β : H.comp L₄ ⟶ L₃.comp K)

(CategoryTheory.mateEquiv (adj₁.comp adj₃) (adj₂.comp adj₄)) (CategoryTheory.leftAdjointSquare.hcomp α β) =
  CategoryTheory.rightAdjointSquare.hcomp ((CategoryTheory.mateEquiv adj₁ adj₂) α)
    ((CategoryTheory.mateEquiv adj₃ adj₄) β)


@[simp]
theorem mk'_spec'_mk (x) (y : R) (hy : y ∈ M) :
    algebraMap R S y * mk' S x ⟨y, hy⟩ = algebraMap R S x

{R : Type u_1}
[CommSemiring R]
{M : Submonoid R}
(S : Type u_2)
[CommSemiring S]
[Algebra R S]
[IsLocalization M S]
(x y : R)
(hy : y ∈ M)

(algebraMap R S) y * IsLocalization.mk' S x ⟨y, hy⟩ = (algebraMap R S) x


/-- The `p`-primary component is a `p` group. -/
theorem primaryComponent.isPGroup : IsPGroup p <| primaryComponent G p

{G : Type u_1}
[CommGroup G]
{p : ℕ}
[hp : Fact (Nat.Prime p)]

IsPGroup p ↥(CommGroup.primaryComponent G p)


theorem uniq (h : IsUniversal f) (η : f ⟶ g) : η = h.to g

{f g : CategoryTheory.StructuredArrow S T}

η = CategoryTheory.Limits.IsInitial.to h g


theorem mem_div_iff_smul_subset {x : A} {I J : Submodule R A} : x ∈ I / J ↔ x • (J : Set A) ⊆ I

{R : Type u}
[CommSemiring R]
{A : Type v}
[CommSemiring A]
[Algebra R A]
{x : A}
{I J : Submodule R A}


theorem _root_.IsOpen.measure_ne_zero (hU : IsOpen U) (hne : U.Nonempty) : μ U ≠ 0

{X : Type u_1}
[TopologicalSpace X]
{m : MeasurableSpace X}
(μ : MeasureTheory.Measure X)
[μ.IsOpenPosMeasure]
{U : Set X}
(hU : IsOpen U)
(hne : U.Nonempty)


@[ext]
theorem ext ⦃f g : r ≃r s⦄ (h : ∀ x, f x = g x) : f = g

{α : Type u_1}
{β : Type u_2}
{r : α → α → Prop}
{s : β → β → Prop}
⦃f g : r ≃r s⦄
(h : ∀ (x : α), f x = g x)


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


/-- A finite partition of `a : α` is a pairwise disjoint finite set of elements whose supremum is
`a`. We forbid `⊥` as a part. -/
@[ext]
structure Finpartition [Lattice α] [OrderBot α] (a : α) where
  -- Porting note: Docstrings added
  /-- The elements of the finite partition of `a` -/
  parts : Finset α
  /-- The partition is supremum-independent -/
  supIndep : parts.SupIndep id
  /-- The supremum of the partition is `a` -/
  sup_parts : parts.sup id = a
  /-- No element of the partition is bottom-/
  not_bot_mem : ⊥ ∉ parts
  deriving DecidableEq

{α : Type u_1}
[Lattice α]
[OrderBot α]
{a : α}
(self : Finpartition a)


lemma cpow_ofNat_mul' {x : ℂ} {n : ℕ} [n.AtLeastTwo] (hlt : -π < OfNat.ofNat n * x.arg)
    (hle : OfNat.ofNat n * x.arg ≤ π) (y : ℂ) :
    x ^ (OfNat.ofNat n * y) = (x ^ (OfNat.ofNat n : ℕ)) ^ y

x ^ (OfNat.ofNat n * y) = (x ^ OfNat.ofNat n) ^ y


theorem minimals_eq_minimals_of_subset_of_forall [IsTrans α r] (hts : t ⊆ s)
    (h : ∀ x ∈ s, ∃ y ∈ t, r y x) : minimals r s = minimals r t

{α : Type u_1}
{r : α → α → Prop}
{s t : Set α}
[IsAntisymm α r]
[IsTrans α r]
(hts : t ⊆ s)
(h : ∀ x ∈ s, ∃ y ∈ t, r y x)


theorem vanishingIdeal_anti_mono {s t : Set (PrimeSpectrum R)} (h : s ⊆ t) :
    vanishingIdeal t ≤ vanishingIdeal s

{R : Type u}
[CommSemiring R]
{s t : Set (PrimeSpectrum R)}
(h : s ⊆ t)

PrimeSpectrum.vanishingIdeal t ≤ PrimeSpectrum.vanishingIdeal s


@[simp]
theorem toMonoidHom_eq_coe (f : α →+* β) : f.toMonoidHom = f

∀ {x : NonAssocSemiring α} {x_1 : NonAssocSemiring β} (f : α →+* β), ↑f = ↑f


protected theorem mdifferentiable' (s : Cₛ^n⟮I; F, V⟯) (hn : 1 ≤ n) :
    MDifferentiable I (I.prod 𝓘(𝕜, F)) fun x => TotalSpace.mk' F x (s x : V x)

[TopologicalSpace (Bundle.TotalSpace F V)]

MDifferentiable I (I.prod 𝓘(𝕜, F)) fun x => Bundle.TotalSpace.mk' F x (s x)


theorem image_mem_functorPushforward (R : Presieve X) {f : Y ⟶ X} (h : R f) :
    R.functorPushforward F (F.map f)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
(F : CategoryTheory.Functor C D)
{X Y : C}
(R : CategoryTheory.Presieve X)
{f : Y ⟶ X}
(h : R f)

CategoryTheory.Presieve.functorPushforward F R (F.map f)


theorem card_Ico : (Ico a b).card = if h : a.1 = b.1 then (Ico (h.rec a.2) b.2).card else 0

{ι : Type u_1}
{α : ι → Type u_2}
[DecidableEq ι]
[(i : ι) → Preorder (α i)]
[(i : ι) → LocallyFiniteOrder (α i)]
(a b : (i : ι) × α i)

(Finset.Ico a b).card = if h : a.fst = b.fst then (Finset.Ico (h ▸ a.snd) b.snd).card else 0


theorem HasDerivAtFilter.comp (hh₂ : HasDerivAtFilter h₂ h₂' (h x) L')
    (hh : HasDerivAtFilter h h' x L) (hL : Tendsto h L L') :
    HasDerivAtFilter (h₂ ∘ h) (h₂' * h') x L


/-- If a function is differentiable around `x`, and has two derivatives at `x`, then the second
derivative is symmetric. -/
theorem second_derivative_symmetric_of_eventually {f : E → F} {f' : E → E →L[ℝ] F}
    {f'' : E →L[ℝ] E →L[ℝ] F} (hf : ∀ᶠ y in 𝓝 x, HasFDerivAt f (f' y) y) (hx : HasFDerivAt f' f'' x)
    (v w : E) : f'' v w = f'' w v

(hf : ∀ᶠ (y : E) in 𝓝 x, HasFDerivAt f (f' y) y)


theorem iInf_eq_bot (f : ι → α) : iInf f = ⊥ ↔ ∀ b > ⊥, ∃ i, f i < b

{α : Type u_1}
{ι : Sort u_5}
[CompleteLinearOrder α]
(f : ι → α)


@[simp]
nonrec theorem extend_comp (f : α ↪ δ) (g : α →ᵇ β) (h : δ →ᵇ β) : extend f g h ∘ f = g

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

⇑(BoundedContinuousFunction.extend f g h) ∘ ⇑f = ⇑g


theorem exists_locallyConstant_finite_nonempty {α : Type*} [Finite α] [Nonempty α]
    (hC : IsLimit C) (f : LocallyConstant C.pt α) :
    ∃ (j : J) (g : LocallyConstant (F.obj j) α), f = g.comap (C.π.app _)

{F : CategoryTheory.Functor J Profinite}

∃ j g, f = LocallyConstant.comap (C.π.app j) g


@[to_additive]
theorem not_one_mem_div_iff : (1 : α) ∉ s / t ↔ Disjoint s t

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


theorem lt_size {m n : ℕ} : m < size n ↔ 2 ^ m ≤ n


@[simp]
theorem map_punctured_nhds_eq (h : X ≃ₜ Y) (x : X) : map h (𝓝[≠] x) = 𝓝[≠] (h x)

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
(h : X ≃ₜ Y)
(x : X)


@[simp]
theorem update_inl_comp_inl [DecidableEq α] [DecidableEq (α ⊕ β)] {f : α ⊕ β → γ} {i : α}
    {x : γ} : update f (inl i) x ∘ inl = update (f ∘ inl) i x

{α : Type u}
{β : Type v}
{γ : Type u_1}
[DecidableEq α]
[DecidableEq (α ⊕ β)]
{f : α ⊕ β → γ}
{i : α}
{x : γ}

Function.update f (Sum.inl i) x ∘ Sum.inl = Function.update (f ∘ Sum.inl) i x


theorem instLinearOrder.dual_dual (α : Type*) [H : LinearOrder α] :
    OrderDual.instLinearOrder αᵒᵈ = H


@[to_additive] lemma snd_prod (s : Multiset (α × β)) : s.prod.2 = (s.map Prod.snd).prod

{α : Type u_3}
{β : Type u_4}
[AddCommMonoid α]
[AddCommMonoid β]
(s : Multiset (α × β))


theorem abs_sin_eq_of_two_nsmul_eq {θ ψ : Angle} (h : (2 : ℕ) • θ = (2 : ℕ) • ψ) :
    |sin θ| = |sin ψ|


theorem comap_inf : comap f (K ⊓ L) = comap f K ⊓ comap f L

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

Ideal.comap f (K ⊓ L) = Ideal.comap f K ⊓ Ideal.comap f L


@[simp]
theorem map_pure (f : α → β) (x : α) : f <$> (pure x : FreeAbelianGroup α) = pure (f x)


@[simp]
theorem card_sum (α β : Type*) :
    PartENat.card (α ⊕ β) = PartENat.card α + PartENat.card β


/-- The category of coalgebras over an additive comonad on a preadditive category is preadditive. -/
@[simps]
instance Comonad.coalgebraPreadditive : Preadditive (Comonad.Coalgebra U)

(C : Type u₁)
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.Preadditive C]
(U : CategoryTheory.Comonad C)
[U.Additive]
(F G : U.Coalgebra)

CategoryTheory.Comonad.Coalgebra.Hom.f 0 = 0


theorem findMin_dual : ∀ t : Ordnode α, findMin (dual t) = findMax t


theorem le_toDual_iff {a : WithTop αᵒᵈ} {b : WithBot α} :
    a ≤ WithBot.toDual b ↔ b ≤ WithTop.ofDual a

{α : Type u_1}
[LE α]
{a : WithTop αᵒᵈ}
{b : WithBot α}


@[simp]
theorem sigma_univ : s.sigma (fun _ ↦ univ : ∀ i, Set (α i)) = Sigma.fst ⁻¹' s

{ι : Type u_1}
{α : ι → Type u_3}
{s : Set ι}

(s.sigma fun x => Set.univ) = Sigma.fst ⁻¹' s


theorem equiv_iff {x y : Σˣ f} {i : ι} (hx : x.1 ≤ i) (hy : y.1 ≤ i) :
    x ≈ y ↔ (f x.1 i hx) x.2 = (f y.1 i hy) y.2

[DirectedSystem G fun i j h => ⇑(f i j h)]

{x y : FirstOrder.Language.Structure.Sigma f}

x ≈ y ↔ (f x.fst i hx) x.snd = (f y.fst i hy) y.snd


/--
The maximum degree of a nonempty graph is less than the number of vertices. Note that the assumption
that `V` is nonempty is necessary, as otherwise this would assert the existence of a
natural number less than zero. -/
theorem maxDegree_lt_card_verts [DecidableRel G.Adj] [Nonempty V] :
    G.maxDegree < Fintype.card V

{V : Type u_1}
(G : SimpleGraph V)
[Fintype V]
[DecidableRel G.Adj]
[Nonempty V]


@[to_additive (attr := simp)]
theorem mul_comp [Mul γ] [ContinuousMul γ] (f₁ f₂ : C(β, γ)) (g : C(α, β)) :
    (f₁ * f₂).comp g = f₁.comp g * f₂.comp g

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[TopologicalSpace α]
[TopologicalSpace β]
[TopologicalSpace γ]
[Add γ]
[ContinuousAdd γ]
(f₁ f₂ : C(β, γ))
(g : C(α, β))

(f₁ + f₂).comp g = f₁.comp g + f₂.comp g


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

CommGrp.toAddCommGrp.obj X = AddCommGrp.of (Additive ↑X)


@[simp, norm_cast]
theorem coeIdeal_top : ((⊤ : Ideal R) : FractionalIdeal S P) = 1

{R : Type u_1}
[CommRing R]
(S : Submonoid R)
{P : Type u_2}
[CommRing P]
[Algebra R P]


protected theorem contDiff {n} : ContDiff ℝ n smoothTransition


@[to_additive]
theorem map_div_le_add : f (x / y) ≤ f x + f y

{F : Type u_2}
{α : Type u_3}
{β : Type u_4}
[FunLike F α β]
[AddGroup α]
[OrderedAddCommMonoid β]
[AddGroupSeminormClass F α β]
(f : F)
(x y : α)


@[simp]
theorem sum.map_mul : sum (x * y) = sum x + sum y

{α : Type u}
[AddGroup α]
{x y : FreeGroup α}


/-- For any non-zero `n` less than the period of `m` on `a`, `a` is moved by `m ^ n`. -/
@[to_additive "For any non-zero `n` less than the period of `m` on `a`, `a` is moved by `n • m`."]
theorem pow_smul_ne_of_lt_period {m : M} {a : α} {n : ℕ} (n_pos : 0 < n)
    (n_lt_period : n < period m a) : m ^ n • a ≠ a

(n_lt_period : n < MulAction.period m a)


@[simp]
lemma bit_mod_two_eq_zero_iff (a x) :
    bit a x % 2 = 0 ↔ !a


/-- A pseudometric space is totally bounded if one can reconstruct up to any ε>0 any element of the
space from finitely many data. -/
theorem totallyBounded_of_finite_discretization {s : Set α}
    (H : ∀ ε > (0 : ℝ),
        ∃ (β : Type u) (_ : Fintype β) (F : s → β), ∀ x y, F x = F y → dist (x : α) y < ε) :
    TotallyBounded s

(H : ∀ ε > 0, ∃ β x F, ∀ (x y : ↑s), F x = F y → dist ↑x ↑y < ε)


theorem eq_msb_cons_truncate (x : BitVec (w+1)) : x = (cons x.msb (x.truncate w))

x = BitVec.cons x.msb (BitVec.truncate w x)


@[simp]
theorem natDegree_eq_zero_iff_eq_one (hp : p.Monic) : p.natDegree = 0 ↔ p = 1

{R : Type u}
[Semiring R]
{p : R[X]}
(hp : p.Monic)


/-- **Chebyshev's Sum Inequality**: When `f` and `g` monovary together (eg they are both
monotone/antitone), the scalar product of their sum is less than the size of the set times their
scalar product. -/
theorem MonovaryOn.sum_smul_sum_le_card_smul_sum (hfg : MonovaryOn f g s) :
    ((∑ i ∈ s, f i) • ∑ i ∈ s, g i) ≤ s.card • ∑ i ∈ s, f i • g i

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[LinearOrderedRing α]
[LinearOrderedAddCommGroup β]
[Module α β]
[OrderedSMul α β]
{s : Finset ι}
{f : ι → α}
{g : ι → β}
(hfg : MonovaryOn f g ↑s)

(∑ i ∈ s, f i) • ∑ i ∈ s, g i ≤ s.card • ∑ i ∈ s, f i • g i


theorem tsupport_smul_subset_left {M α} [TopologicalSpace X] [Zero M] [Zero α] [SMulWithZero M α]
    (f : X → M) (g : X → α) : (tsupport fun x => f x • g x) ⊆ tsupport f

{X : Type u_1}
{M : Type u_10}
{α : Type u_11}
[TopologicalSpace X]
[Zero M]
[Zero α]
[SMulWithZero M α]
(f : X → M)
(g : X → α)


@[simp]
theorem mem_Ici : x ∈ Ici a ↔ a ≤ x

{α : Type u_1}
[Preorder α]
[LocallyFiniteOrderTop α]
{a x : α}


/-- A category "has enough projectives" if for every object `X` there is a projective object `P` and
    an epimorphism `P ↠ X`. -/
class EnoughProjectives : Prop where
  presentation : ∀ X : C, Nonempty (ProjectivePresentation X)

[self : CategoryTheory.EnoughProjectives C]


theorem atBot_atTop_le_cocompact [NoMinOrder α] [NoMaxOrder α]
    [OrderClosedTopology α] : atBot ⊔ atTop ≤ cocompact α

{α : Type u_2}
[LinearOrder α]
[TopologicalSpace α]
[NoMinOrder α]
[NoMaxOrder α]
[OrderClosedTopology α]

Filter.atBot ⊔ Filter.atTop ≤ Filter.cocompact α


@[simp]
theorem lift_lt_aleph0 {c : Cardinal.{u}} : lift.{v} c < ℵ₀ ↔ c < ℵ₀

Cardinal.lift.{v, u} c < Cardinal.aleph0 ↔ c < Cardinal.aleph0


theorem sign_bij [DecidableEq β] [Fintype β] {f : Perm α} {g : Perm β} (i : ∀ x : α, f x ≠ x → β)
    (h : ∀ x hx hx', i (f x) hx' = g (i x hx)) (hi : ∀ x₁ x₂ hx₁ hx₂, i x₁ hx₁ = i x₂ hx₂ → x₁ = x₂)
    (hg : ∀ y, g y ≠ y → ∃ x hx, i x hx = y) : sign f = sign g

(h : ∀ (x : α) (hx : f x ≠ x) (hx' : f (f x) ≠ f x), i (f x) hx' = g (i x hx))

(hi : ∀ (x₁ x₂ : α) (hx₁ : f x₁ ≠ x₁) (hx₂ : f x₂ ≠ x₂), i x₁ hx₁ = i x₂ hx₂ → x₁ = x₂)

(hg : ∀ (y : β), g y ≠ y → ∃ x, ∃ (hx : f x ≠ x), i x hx = y)


@[reassoc, elementwise, simp, nolint simpNF] -- see std4#365 for the simpNF issue
theorem stalkSpecializes_stalkMap {X Y : PresheafedSpace.{_, _, v} C}
    (f : X ⟶ Y) {x y : X} (h : x ⤳ y) :
    Y.presheaf.stalkSpecializes (f.base.map_specializes h) ≫ f.stalkMap x =
      f.stalkMap y ≫ X.presheaf.stalkSpecializes h

{X Y : AlgebraicGeometry.PresheafedSpace C}

Y.presheaf.stalkSpecializes ⋯ ≫ AlgebraicGeometry.PresheafedSpace.Hom.stalkMap f x =
  AlgebraicGeometry.PresheafedSpace.Hom.stalkMap f y ≫ X.presheaf.stalkSpecializes h


theorem opNorm_le_of_lipschitz {f : E →SL[σ₁₂] F} {K : ℝ≥0} (hf : LipschitzWith K f) : ‖f‖ ≤ K

{𝕜 : Type u_1}
{𝕜₂ : Type u_2}
{E : Type u_4}
{F : Type u_6}
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup F]
[NontriviallyNormedField 𝕜]
[NontriviallyNormedField 𝕜₂]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜₂ F]
{σ₁₂ : 𝕜 →+* 𝕜₂}
{f : E →SL[σ₁₂] F}
{K : ℝ≥0}
(hf : LipschitzWith K ⇑f)


@[to_additive addCHaar_self]
theorem chaar_self (K₀ : PositiveCompacts G) : chaar K₀ K₀.toCompacts = 1

(K₀ : TopologicalSpace.PositiveCompacts G)

MeasureTheory.Measure.haar.chaar K₀ K₀.toCompacts = 1


lemma one_add_div_two_mul_two_of_odd (h : Odd n) : 1 + n / 2 * 2 = n


nonrec theorem _root_.IsClosed.cthickening_eq_biUnion_closedBall {α : Type*} [PseudoMetricSpace α]
    [ProperSpace α] {E : Set α} (hE : IsClosed E) (hδ : 0 ≤ δ) :
    cthickening δ E = ⋃ x ∈ E, closedBall x δ

{δ : ℝ}
{α : Type u_2}
[PseudoMetricSpace α]
[ProperSpace α]
{E : Set α}
(hE : IsClosed E)
(hδ : 0 ≤ δ)

Metric.cthickening δ E = ⋃ x ∈ E, Metric.closedBall x δ


/-- Let `M` be a σ-compact Hausdorff finite dimensional topological manifold. Let `t : M → Set F` be
a family of convex sets. Suppose that for each point `x : M` there exists a vector `c : F` such that
for all `y` in a neighborhood of `x` we have `c ∈ t y`. Then there exists a smooth function
`g : C^∞⟮I, M; 𝓘(ℝ, F), F⟯` such that `g x ∈ t x` for all `x`.  See also
`exists_contMDiffOn_forall_mem_convex_of_local` and `exists_smooth_forall_mem_convex_of_local`. -/
theorem exists_smooth_forall_mem_convex_of_local_const (ht : ∀ x, Convex ℝ (t x))
    (Hloc : ∀ x : M, ∃ c : F, ∀ᶠ y in 𝓝 x, c ∈ t y) : ∃ g : C^∞⟮I, M; 𝓘(ℝ, F), F⟯, ∀ x, g x ∈ t x

(Hloc : ∀ (x : M), ∃ c, ∀ᶠ (y : M) in 𝓝 x, c ∈ t y)


@[to_additive]
theorem _root_.measurableEmbedding_mulLeft (g : G) : MeasurableEmbedding (g * ·)

{G : Type u_1}
[MeasurableSpace G]
[AddGroup G]
[MeasurableAdd G]
(g : G)


protected theorem lt_add_of_neg_add_lt_right {a b c : Int} (h : -c + a < b) : a < b + c


/-- A subobject is simple iff it is an atom in the subobject lattice. -/
theorem subobject_simple_iff_isAtom {X : C} (Y : Subobject X) : Simple (Y : C) ↔ IsAtom Y

CategoryTheory.Simple (CategoryTheory.Subobject.underlying.obj Y) ↔ IsAtom Y


/-- The augmented Čech nerve associated to an arrow. -/
@[simps]
def augmentedCechNerve : SimplicialObject.Augmented C

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


theorem IsLimit.nat_lt {o : Ordinal} (h : IsLimit o) : ∀ n : ℕ, (n : Ordinal) < o

{o : Ordinal.{u_4}}
(h : o.IsLimit)
(n : ℕ)


theorem univ_pi_update [DecidableEq ι] {β : ι → Type*} (i : ι) (f : ∀ j, α j) (a : α i)
    (t : ∀ j, α j → Set (β j)) :
    (pi univ fun j => t j (update f i a j)) = { x | x i ∈ t i a } ∩ pi {i}ᶜ fun j => t j (f j)

{ι : Type u_1}
{α : ι → Type u_2}
[DecidableEq ι]
{β : ι → Type u_4}
(i : ι)
(f : (j : ι) → α j)
(a : α i)
(t : (j : ι) → α j → Set (β j))

(Set.univ.pi fun j => t j (Function.update f i a j)) = {x | x i ∈ t i a} ∩ {i}ᶜ.pi fun j => t j (f j)


theorem isωSup_ωSup {α} [OmegaCompletePartialOrder α] (c : Chain α) : IsωSup c (ωSup c)

{α : Type u_1}
[OmegaCompletePartialOrder α]
(c : OmegaCompletePartialOrder.Chain α)

Scott.IsωSup c (OmegaCompletePartialOrder.ωSup c)


/-- A oplax monoidal functor takes comonoid objects to comonoid objects.

That is, a oplax monoidal functor `F : C ⥤ D` induces a functor `Comon_ C ⥤ Comon_ D`.
-/
@[simps]
def mapComon (F : OplaxMonoidalFunctor C D) : Comon_ C ⥤ Comon_ D

(F : CategoryTheory.OplaxMonoidalFunctor C D)

∀ {X Y : Comon_ C} (f : X ⟶ Y), (F.mapComon.map f).hom = F.map f.hom


theorem realize_toPrenexImpRight {φ ψ : L.BoundedFormula α n} (hφ : IsQF φ) (hψ : IsPrenex ψ)
    {v : α → M} {xs : Fin n → M} :
    (φ.toPrenexImpRight ψ).Realize v xs ↔ (φ.imp ψ).Realize v xs

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]
{α : Type u'}
{n : ℕ}
[Nonempty M]
{φ ψ : L.BoundedFormula α n}
(hφ : φ.IsQF)
(hψ : ψ.IsPrenex)
{v : α → M}
{xs : Fin n → M}


/-- Smooth is stable under composition. -/
theorem comp [Algebra A B] [IsScalarTower R A B] [Smooth R A] [Smooth A B] : Smooth R B

(R : Type u)
[CommRing R]
(A B : Type u)
[CommRing A]
[Algebra R A]
[CommRing B]
[Algebra R B]
[Algebra A B]
[IsScalarTower R A B]
[Algebra.Smooth R A]
[Algebra.Smooth A B]


theorem linearIndependent_stdBasis [Ring R] [∀ i, AddCommGroup (Ms i)] [∀ i, Module R (Ms i)]
    [DecidableEq η] (v : ∀ j, ιs j → Ms j) (hs : ∀ i, LinearIndependent R (v i)) :
    LinearIndependent R fun ji : Σj, ιs j => stdBasis R Ms ji.1 (v ji.1 ji.2)

(hs : ∀ (i : η), LinearIndependent R (v i))

LinearIndependent R fun ji => (LinearMap.stdBasis R Ms ji.fst) (v ji.fst ji.snd)


/-- The sieve generated by the image of `R` under `F`. -/
@[simps]
def functorPushforward (R : Sieve X) : Sieve (F.obj X)

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

(CategoryTheory.Sieve.functorPushforward F R).arrows = CategoryTheory.Presieve.functorPushforward F R.arrows


theorem adjoin.finrank {x : L} (hx : IsIntegral K x) :
    FiniteDimensional.finrank K K⟮x⟯ = (minpoly K x).natDegree

{K : Type u}
[Field K]
{L : Type u_3}
[Field L]
[Algebra K L]
{x : L}
(hx : IsIntegral K x)

FiniteDimensional.finrank K ↥K⟮x⟯ = (minpoly K x).natDegree


@[simp]
theorem rtake_concat_succ (x : α) : rtake (l ++ [x]) (n + 1) = rtake l n ++ [x]

{α : Type u_1}
(l : List α)
(n : ℕ)
(x : α)


@[simp] theorem toFin_xor (x y : BitVec v) :
    BitVec.toFin (x ^^^ y) = BitVec.toFin x ^^^ BitVec.toFin y


@[simp]
protected theorem compl_iInf (f : ι → UpperSet α) : (⨅ i, f i).compl = ⨅ i, (f i).compl

{α : Type u_1}
{ι : Sort u_4}
[LE α]
(f : ι → UpperSet α)


/-- The equivalence between the endomorphisms of the single object
when we promote a monoidal category to a single object bicategory,
and the original monoidal category.
-/
@[simps functor inverse_obj inverse_map unitIso counitIso]
noncomputable def endMonoidalStarFunctorEquivalence :
    EndMonoidal (MonoidalSingleObj.star C) ≌ C

(C : Type u_1)
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.MonoidalCategory C]

(CategoryTheory.MonoidalSingleObj.endMonoidalStarFunctorEquivalence C).unitIso =
  CategoryTheory.Iso.refl
    (CategoryTheory.Functor.id (CategoryTheory.EndMonoidal (CategoryTheory.MonoidalSingleObj.star C)))


theorem jd_transform [Fintype l] : (PD l R)ᵀ * JD l R * PD l R = (2 : R) • S l R

(l : Type u_4)
(R : Type u₂)
[DecidableEq l]
[CommRing R]
[Fintype l]

(LieAlgebra.Orthogonal.PD l R).transpose * LieAlgebra.Orthogonal.JD l R * LieAlgebra.Orthogonal.PD l R =
  2 • LieAlgebra.Orthogonal.S l R


@[simp]
theorem totalDegree_X_pow [Nontrivial R] (s : σ) (n : ℕ) :
    (X s ^ n : MvPolynomial σ R).totalDegree = n

{R : Type u}
{σ : Type u_1}
[CommSemiring R]
[Nontrivial R]
(s : σ)
(n : ℕ)


@[to_additive (attr := simp)]
theorem prod_disj_sum (s : Finset α) (t : Finset γ) (f : α ⊕ γ → β) :
    ∏ x ∈ s.disjSum t, f x = (∏ x ∈ s, f (Sum.inl x)) * ∏ x ∈ t, f (Sum.inr x)

{α : Type u_3}
{β : Type u_4}
{γ : Type u_5}
[AddCommMonoid β]
(s : Finset α)
(t : Finset γ)
(f : α ⊕ γ → β)

∑ x ∈ s.disjSum t, f x = ∑ x ∈ s, f (Sum.inl x) + ∑ x ∈ t, f (Sum.inr x)


/-- A product taken over a conditional whose condition is an equality test on the index and whose
alternative is `1` has value either the term at that index or `1`.

The difference with `Finset.prod_ite_eq` is that the arguments to `Eq` are swapped. -/
@[to_additive (attr := simp) "A sum taken over a conditional whose condition is an equality
test on the index and whose alternative is `0` has value either the term at that index or `0`.

The difference with `Finset.sum_ite_eq` is that the arguments to `Eq` are swapped."]
theorem prod_ite_eq' [DecidableEq α] (s : Finset α) (a : α) (b : α → β) :
    (∏ x ∈ s, ite (x = a) (b x) 1) = ite (a ∈ s) (b a) 1

{α : Type u_3}
{β : Type u_4}
[AddCommMonoid β]
[DecidableEq α]
(s : Finset α)
(a : α)
(b : α → β)

(∑ x ∈ s, if x = a then b x else 0) = if a ∈ s then b a else 0


@[simp]
theorem card_unique [Unique α] [h : Fintype α] : Fintype.card α = 1

{α : Type u_1}
[Unique α]
[h : Fintype α]


/-- `autGalois.π` is surjective for every pointed Galois object. -/
theorem AutGalois.π_surjective (A : PointedGaloisObject F) :
    Function.Surjective (AutGalois.π F A)

(F : CategoryTheory.Functor C FintypeCat)

(A : CategoryTheory.PreGaloisCategory.PointedGaloisObject F)

Function.Surjective ⇑(CategoryTheory.PreGaloisCategory.AutGalois.π F A)


@[to_additive (attr := simp)]
theorem univ_mul_univ [Fintype α] : (univ : Finset α) * univ = univ

{α : Type u_2}
[DecidableEq α]
[AddMonoid α]
[Fintype α]


@[simp]
theorem re_add_im : ↑a.re + a.im = a

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


theorem comap_comap {W : Type*} [TopologicalSpace W] (f : C(W, X)) (g : C(X, Y))
    (x : LocallyConstant Y Z) : comap f (comap g x) = comap (g.comp f) x

{X : Type u_1}
{Y : Type u_2}
{Z : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
{W : Type u_5}
[TopologicalSpace W]
(f : C(W, X))
(g : C(X, Y))
(x : LocallyConstant Y Z)

LocallyConstant.comap f (LocallyConstant.comap g x) = LocallyConstant.comap (g.comp f) x


@[simp]
theorem kronecker_apply [Mul α] (A : Matrix l m α) (B : Matrix n p α) (i₁ i₂ j₁ j₂) :
    (A ⊗ₖ B) (i₁, i₂) (j₁, j₂) = A i₁ j₁ * B i₂ j₂

{α : Type u_2}
{l : Type u_8}
{m : Type u_9}
{n : Type u_10}
{p : Type u_11}
[Mul α]
(A : Matrix l m α)
(B : Matrix n p α)
(i₁ : l)
(i₂ : n)
(j₁ : m)
(j₂ : p)

Matrix.kroneckerMap (fun x x_1 => x * x_1) A B (i₁, i₂) (j₁, j₂) = A i₁ j₁ * B i₂ j₂


theorem left_lt_lineMap_iff_lt (h : 0 < r) : a < lineMap a b r ↔ a < b

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


protected theorem contMDiffWithinAt (h : M ≃ₘ^n⟮I, I'⟯ M') {s x} : ContMDiffWithinAt I I' n h s x

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


/-- Baby version of the Whitney weak embedding theorem: if `M` admits a finite covering by
supports of bump functions, then for some `n` it can be embedded into the `n`-dimensional
Euclidean space. -/
theorem exists_embedding_euclidean_of_compact [T2Space M] [CompactSpace M] :
    ∃ (n : ℕ) (e : M → EuclideanSpace ℝ (Fin n)),
      Smooth I (𝓡 n) e ∧ ClosedEmbedding e ∧ ∀ x : M, Injective (mfderiv I (𝓡 n) e x)

{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[FiniteDimensional ℝ E]
{H : Type uH}
[TopologicalSpace H]
{I : ModelWithCorners ℝ E H}
{M : Type uM}
[TopologicalSpace M]
[ChartedSpace H M]
[SmoothManifoldWithCorners I M]
[T2Space M]
[CompactSpace M]

∃ n e,
  Smooth I 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) e ∧
    ClosedEmbedding e ∧ ∀ (x : M), Function.Injective ⇑(mfderiv I 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) e x)


@[to_additive]
theorem smoothWithinAt_finset_prod' (h : ∀ i ∈ t, SmoothWithinAt I' I (f i) s x) :
    SmoothWithinAt I' I (∏ i ∈ t, f i) s x


theorem adjunction_counit_app' {R : CommRingCatᵒᵖ} :
    ΓSpec.adjunction.counit.app R = locallyRingedSpaceAdjunction.counit.app R

AlgebraicGeometry.ΓSpec.adjunction.counit.app R = AlgebraicGeometry.ΓSpec.locallyRingedSpaceAdjunction.counit.app R


theorem comp₂Measurable_eq_pair (g : β → γ → δ) (hg : Measurable (uncurry g)) (f₁ : α →ₘ[μ] β)
    (f₂ : α →ₘ[μ] γ) : comp₂Measurable g hg f₁ f₂ = compMeasurable _ hg (f₁.pair f₂)

(g : β → γ → δ)

(f₁ : α →ₘ[μ] β)

(f₂ : α →ₘ[μ] γ)

MeasureTheory.AEEqFun.comp₂Measurable g hg f₁ f₂ =
  MeasureTheory.AEEqFun.compMeasurable (Function.uncurry g) hg (f₁.pair f₂)


theorem disjSups_union_left : (s₁ ∪ s₂) ○ t = s₁ ○ t ∪ s₂ ○ t

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

(s₁ ∪ s₂).disjSups t = s₁.disjSups t ∪ s₂.disjSups t


@[to_additive mul_nsmul']
lemma pow_mul' (a : M) (m n : ℕ) : a ^ (m * n) = (a ^ n) ^ m

{M : Type u_2}
[Monoid M]
(a : M)
(m n : ℕ)


protected theorem mul_comm (a b : Fin n) : a * b = b * a


theorem closed (s : Closeds α) : IsClosed (s : Set α)

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


theorem isBigOWith_pi {ι : Type*} [Fintype ι] {E' : ι → Type*} [∀ i, NormedAddCommGroup (E' i)]
    {f : α → ∀ i, E' i} {C : ℝ} (hC : 0 ≤ C) :
    IsBigOWith C l f g' ↔ ∀ i, IsBigOWith C l (fun x => f x i) g'

{α : Type u_1}
{F' : Type u_7}
[SeminormedAddCommGroup F']
{g' : α → F'}
{l : Filter α}
{ι : Type u_17}
[Fintype ι]
{E' : ι → Type u_18}
[(i : ι) → NormedAddCommGroup (E' i)]
{f : α → (i : ι) → E' i}
{C : ℝ}
(hC : 0 ≤ C)

Asymptotics.IsBigOWith C l f g' ↔ ∀ (i : ι), Asymptotics.IsBigOWith C l (fun x => f x i) g'


@[simp, norm_cast]
theorem coe_Icc (a b : α) : (Icc a b : Set α) = Set.Icc a b

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


@[to_additive (attr := deprecated (since := "2024-01-27"))]
theorem exponent_dvd_of_forall_orderOf_dvd (n : ℕ) (h : ∀ g : G, orderOf g ∣ n) : exponent G ∣ n

(G : Type u)
[AddMonoid G]
(n : ℕ)
(h : ∀ (g : G), addOrderOf g ∣ n)


theorem le_csInf_image {s : Set α} (hs : s.Nonempty) {B : α} (hB : B ∈ lowerBounds s) :
    f B ≤ sInf (f '' s)

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[ConditionallyCompleteLattice β]
{f : α → β}
(h_mono : Monotone f)
{s : Set α}
(hs : s.Nonempty)
{B : α}
(hB : B ∈ lowerBounds s)


/-- Construct a cone on `F` from an object of the category `(Δ ↓ F)`. This is part of an
    equivalence, see `Cone.equivCostructuredArrow`. -/
@[simps]
def Cone.fromCostructuredArrow (F : J ⥤ C) : CostructuredArrow (const J) F ⥤ Cone F

(c : CategoryTheory.CostructuredArrow (CategoryTheory.Functor.const J) F)

((CategoryTheory.Limits.Cone.fromCostructuredArrow F).obj c).π = c.hom


@[simp, norm_cast]
theorem coeFn_coe (f : LieDerivation R L M) : ⇑(f : L →ₗ[R] M) = f

{R : Type u_1}
{L : Type u_2}
{M : Type u_3}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
(f : LieDerivation R L M)


@[mono]
theorem EventuallyLE.diff {s t s' t' : Set α} {l : Filter α} (h : s ≤ᶠ[l] t) (h' : t' ≤ᶠ[l] s') :
    (s \ s' : Set α) ≤ᶠ[l] (t \ t' : Set α)

{α : Type u}
{s t s' t' : Set α}
{l : Filter α}
(h : s ≤ᶠ[l] t)
(h' : t' ≤ᶠ[l] s')


/-- `cyclotomic n ℤ` is irreducible. -/
theorem cyclotomic.irreducible {n : ℕ} (hpos : 0 < n) : Irreducible (cyclotomic n ℤ)


theorem mem_lpMeas_self {m0 : MeasurableSpace α} (μ : Measure α) (f : Lp F p μ) :
    f ∈ lpMeas F 𝕜 m0 p μ

{α : Type u_1}
{F : Type u_3}
{𝕜 : Type u_5}
{p : ℝ≥0∞}
[RCLike 𝕜]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{m0 : MeasurableSpace α}
(μ : MeasureTheory.Measure α)
(f : ↥(MeasureTheory.Lp F p μ))


theorem coe_sSup_of_directedOn {S : Set (Subfield K)} (Sne : S.Nonempty)
    (hS : DirectedOn (· ≤ ·) S) : (↑(sSup S) : Set K) = ⋃ s ∈ S, ↑s

(hS : DirectedOn (fun x x_1 => x ≤ x_1) S)


theorem natDegree_list_prod_le (l : List S[X]) : natDegree l.prod ≤ (l.map natDegree).sum

{S : Type u_1}
[Semiring S]
(l : List S[X])

l.prod.natDegree ≤ (List.map Polynomial.natDegree l).sum


lemma withDensity_rnDeriv_eq_zero_iff_mutuallySingular (κ η : Kernel α γ)
    [IsFiniteKernel κ] [IsFiniteKernel η] (a : α) :
    withDensity η (rnDeriv κ η) a = 0 ↔ κ a ⟂ₘ η a

[hαγ : MeasurableSpace.CountableOrCountablyGenerated α γ]

(η.withDensity (κ.rnDeriv η)) a = 0 ↔ κ a ⟂ₘ η a


lemma natDegree_Ψ₃_le : W.Ψ₃.natDegree ≤ 4

{R : Type u}
[CommRing R]
(W : WeierstrassCurve R)


@[simp]
theorem quot_zero : Quot.mk Setoid.r zero = (0 : ColimitType F)

{J : Type v}
[CategoryTheory.SmallCategory J]
(F : J ⥤ RingCat)

Quot.mk Setoid.r RingCat.Colimits.Prequotient.zero = 0


@[to_additive zsmul_strictMono_left]
lemma zpow_right_strictMono (ha : 1 < a) : StrictMono fun n : ℤ ↦ a ^ n

{α : Type u_1}
[OrderedCommGroup α]
{a : α}
(ha : 1 < a)


theorem eventuallyEq_of_left_inv_of_right_inv {f : α → β} {g₁ g₂ : β → α} {fa : Filter α}
    {fb : Filter β} (hleft : ∀ᶠ x in fa, g₁ (f x) = x) (hright : ∀ᶠ y in fb, f (g₂ y) = y)
    (htendsto : Tendsto g₂ fb fa) : g₁ =ᶠ[fb] g₂

{g₁ g₂ : β → α}

(hleft : ∀ᶠ (x : α) in fa, g₁ (f x) = x)

(hright : ∀ᶠ (y : β) in fb, f (g₂ y) = y)


lemma uzpow_add (s : ℤˣ) (x y : R) : s ^ (x + y) = s ^ x * s ^ y

{R : Type u_1}
[CommSemiring R]
[Module R (Additive ℤˣ)]
(s : ℤˣ)
(x y : R)


theorem DirectSum.IsInternal.collectedOrthonormalBasis_mem [DecidableEq ι]
    (h : DirectSum.IsInternal A) {α : ι → Type*} [∀ i, Fintype (α i)]
    (hV : OrthogonalFamily 𝕜 (fun i => A i) fun i => (A i).subtypeₗᵢ)
    (v : ∀ i, OrthonormalBasis (α i) 𝕜 (A i)) (a : Σi, α i) :
    h.collectedOrthonormalBasis hV v a ∈ A a.1

(hV : OrthogonalFamily 𝕜 (fun i => ↥(A i)) fun i => (A i).subtypeₗᵢ)

(v : (i : ι) → OrthonormalBasis (α i) 𝕜 ↥(A i))

(DirectSum.IsInternal.collectedOrthonormalBasis hV h v) a ∈ A a.fst


@[simp]
theorem coe_map (f : R →+* S) (s : Subsemiring R) : (s.map f : Set S) = f '' s

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


@[to_additive const_sub]
theorem Filter.Tendsto.const_div' (b : G) {c : G} {f : α → G} {l : Filter α}
    (h : Tendsto f l (𝓝 c)) : Tendsto (fun k : α => b / f k) l (𝓝 (b / c))

{G : Type w}
{α : Type u}
[TopologicalSpace G]
[Sub G]
[ContinuousSub G]
(b : G)
{c : G}
{f : α → G}
{l : Filter α}
(h : Filter.Tendsto f l (𝓝 c))

Filter.Tendsto (fun k => b - f k) l (𝓝 (b - c))


@[simp]
theorem le_last {s : CompositionSeries X} (i : Fin (s.length + 1)) : s i ≤ s.last

{X : Type u}
[Lattice X]
[JordanHolderLattice X]
{s : CompositionSeries X}
(i : Fin (s.length + 1))


theorem ContinuousOn.comp_fract {s : β → α} {f : β → α → γ}
    (h : ContinuousOn (uncurry f) <| univ ×ˢ Icc 0 1) (hs : Continuous s)
    (hf : ∀ s, f s 0 = f s 1) : Continuous fun x : β => f x <| Int.fract (s x)

{f : β → α → γ}

(h : ContinuousOn (Function.uncurry f) (Set.univ ×ˢ Set.Icc 0 1))

Continuous fun x => f x (Int.fract (s x))


theorem LinearMap.toMatrixAlgEquiv_id : LinearMap.toMatrixAlgEquiv v₁ id = 1

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

(LinearMap.toMatrixAlgEquiv v₁) LinearMap.id = 1


@[to_additive]
theorem exists_leftTransversal_of_FiniteIndex
    {D H : Subgroup G} [D.FiniteIndex] (hD_le_H : D ≤ H) :
    ∃ t : Finset H,
      (t : Set H) ∈ leftTransversals (D.subgroupOf H) ∧
        ⋃ g ∈ t, (g : G) • (D : Set G) = H

{G : Type u_1}
[AddGroup G]
{D H : AddSubgroup G}
[D.FiniteIndex]
(hD_le_H : D ≤ H)

∃ t, ↑t ∈ AddSubgroup.leftTransversals ↑(D.addSubgroupOf H) ∧ ⋃ g ∈ t, ↑g +ᵥ ↑D = ↑H


/-- A normed group is a group endowed with a norm for which `dist x y = ‖x / y‖` defines a metric
space structure. -/
@[to_additive]
class NormedGroup (E : Type*) extends Norm E, Group E, MetricSpace E where
  dist := fun x y => ‖x / y‖
  /-- The distance function is induced by the norm. -/
  dist_eq : ∀ x y, dist x y = ‖x / y‖ := by aesop

{E : Type u_9}
[self : NormedGroup E]
(x y : E)


/-- Note that while this lemma cannot be easily generalized to a type class, it holds for ℤ as
well. See `Int.image_Ico_emod` for the ℤ version. -/
theorem image_Ico_mod (n a : ℕ) : (Ico n (n + a)).image (· % a) = range a

Finset.image (fun x => x % a) (Finset.Ico n (n + a)) = Finset.range a


theorem closure_subset_span {s : Set M} : (AddSubmonoid.closure s : Set M) ⊆ span R s

{R : Type u_1}
{M : Type u_4}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{s : Set M}

↑(AddSubmonoid.closure s) ⊆ ↑(Submodule.span R s)


@[to_additive (attr := simp, norm_cast)]
theorem coe_list_prod (s : List (Finset α)) : (↑s.prod : Set α) = (s.map (↑)).prod

{α : Type u_2}
[DecidableEq α]
[Monoid α]
(s : List (Finset α))

↑s.prod = (List.map Finset.toSet s).prod


@[simp] protected theorem lt_irrefl : ∀ (x : Bool), ¬ x < x


theorem isSheafFor_arrows_iff : (ofArrows X π).IsSheafFor P ↔
    (∀ (x : (i : I) → P.obj (op (X i))), Arrows.Compatible P π x →
    ∃! t, ∀ i, P.map (π i).op t = x i)

(P : CategoryTheory.Functor Cᵒᵖ (Type w))

CategoryTheory.Presieve.IsSheafFor P (CategoryTheory.Presieve.ofArrows X π) ↔
  ∀ (x : (i : I) → P.obj (Opposite.op (X i))),
    CategoryTheory.Presieve.Arrows.Compatible P π x → ∃! t, ∀ (i : I), P.map (π i).op t = x i


/-- Integral sum of `f` over a tagged prepartition `π` such that `π.Union = π₀.Union` tends to the
sum of integrals of `f` over the boxes of `π₀`. -/
theorem tendsto_integralSum_sum_integral (h : Integrable I l f vol) (π₀ : Prepartition I) :
    Tendsto (integralSum f vol) (l.toFilteriUnion I π₀)
      (𝓝 <| ∑ J ∈ π₀.boxes, integral J l f vol)

{ι : Type u}
{E : Type v}
{F : Type w}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[NormedAddCommGroup F]
[NormedSpace ℝ F]
{I : BoxIntegral.Box ι}
[Fintype ι]
{l : BoxIntegral.IntegrationParams}
{f : (ι → ℝ) → E}
{vol : ι →ᵇᵃ[⊤] E →L[ℝ] F}
[CompleteSpace F]
(h : BoxIntegral.Integrable I l f vol)
(π₀ : BoxIntegral.Prepartition I)

Filter.Tendsto (BoxIntegral.integralSum f vol) (l.toFilteriUnion I π₀)
  (𝓝 (∑ J ∈ π₀.boxes, BoxIntegral.integral J l f vol))


theorem BilinForm.mul_toMatrix (B : BilinForm R₂ M₂) (M : Matrix n n R₂) :
    M * BilinForm.toMatrix b B = BilinForm.toMatrix b (B.compLeft (Matrix.toLin b b Mᵀ))

{R₂ : Type u_5}
{M₂ : Type u_6}
[CommSemiring R₂]
[AddCommMonoid M₂]
[Module R₂ M₂]
{n : Type u_11}
[Fintype n]
[DecidableEq n]
(b : Basis n R₂ M₂)
(B : LinearMap.BilinForm R₂ M₂)
(M : Matrix n n R₂)

M * (BilinForm.toMatrix b) B = (BilinForm.toMatrix b) (B.compLeft ((Matrix.toLin b b) M.transpose))


@[to_additive]
lemma iCondIndepFun.indepFun_mul_left (hf_indep : iCondIndepFun m' hm' (fun _ ↦ m) f μ)
    (hf_meas : ∀ i, Measurable (f i)) (i j k : ι) (hik : i ≠ k) (hjk : j ≠ k) :
    CondIndepFun m' hm' (f i * f j) (f k) μ

{f : ι → Ω → β}

(hf_indep : ProbabilityTheory.iCondIndepFun m' hm' (fun x => m) f μ)

ProbabilityTheory.CondIndepFun m' hm' (f i + f j) (f k) μ


/-- This is a special case of `WithTop.sub_top` in the `ENNReal` namespace -/
theorem sub_top : a - ∞ = 0


theorem abs_cos_eq_sqrt_one_sub_sin_sq (x : ℝ) : |cos x| = √(1 - sin x ^ 2)


theorem toZ_iterate_succ_le (n : ℕ) : toZ i0 (succ^[n] i0) ≤ n

{ι : Type u_1}
[LinearOrder ι]
[SuccOrder ι]
[IsSuccArchimedean ι]
[PredOrder ι]
{i0 : ι}
(n : ℕ)


theorem invOneSubPow_val_zero_eq_invUnitSub_one :
    (invOneSubPow 0).val = invUnitsSub (1 : Sˣ)

↑(PowerSeries.invOneSubPow 0) = PowerSeries.invUnitsSub 1


@[simp] lemma algebraMap_le_algebraMap : algebraMap α β a₁ ≤ algebraMap α β a₂ ↔ a₁ ≤ a₂

{α : Type u_1}
{β : Type u_2}
[OrderedCommSemiring α]
[StrictOrderedSemiring β]
[Algebra α β]
[SMulPosMono α β]
[SMulPosReflectLE α β]
{a₁ a₂ : α}

(algebraMap α β) a₁ ≤ (algebraMap α β) a₂ ↔ a₁ ≤ a₂


/-- All points lie in the circumsphere. -/
theorem mem_circumsphere {n : ℕ} (s : Simplex ℝ P n) (i : Fin (n + 1)) :
    s.points i ∈ s.circumsphere

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{n : ℕ}
(s : Affine.Simplex ℝ P n)
(i : Fin (n + 1))


protected lemma isCoatom_iff : IsCoatom s ↔ ∃ a, s = {a}ᶜ

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


@[to_additive]
lemma elim_le_one_iff : Sum.elim v₁ v₂ ≤ 1 ↔ v₁ ≤ 1 ∧ v₂ ≤ 1

{α₁ : Type u_1}
{α₂ : Type u_2}
{β : Type u_3}
[LE β]
[Zero β]
{v₁ : α₁ → β}
{v₂ : α₂ → β}


theorem exists_square_le' [PosMulStrictMono α] (a0 : 0 < a) : ∃ b : α, b * b ≤ a

{α : Type u_1}
{a : α}
[MulOneClass α]
[Zero α]
[LinearOrder α]
[PosMulStrictMono α]
(a0 : 0 < a)


@[to_additive]
theorem dist_div_div_le_of_le (h₁ : dist a₁ b₁ ≤ r₁) (h₂ : dist a₂ b₂ ≤ r₂) :
    dist (a₁ / a₂) (b₁ / b₂) ≤ r₁ + r₂

{E : Type u_3}
[SeminormedAddCommGroup E]
{a₁ a₂ b₁ b₂ : E}
{r₁ r₂ : ℝ}
(h₁ : dist a₁ b₁ ≤ r₁)
(h₂ : dist a₂ b₂ ≤ r₂)


theorem geom_sum_zero (x : α) : ∑ i ∈ range 0, x ^ i = 0


/-- Formula for `Λ 1`. Note that mathematically `Λ 1` is undefined, but our construction ascribes
this particular value to it. -/
lemma _root_.completedRiemannZeta_one :
    completedRiemannZeta 1 = (γ - Complex.log (4 * ↑π)) / 2

completedRiemannZeta 1 = (↑γ - Complex.log (4 * ↑π)) / 2


theorem and_or_distrib_left  : ∀ (x y z : Bool), (x && (y || z)) = (x && y || x && z)


@[simp]
theorem Ioi_succ (i : Fin n) : Ioi i.succ = (Ioi i).map (Fin.succEmb _)

Finset.Ioi i.succ = Finset.map (Fin.succEmb n) (Finset.Ioi i)


@[simp]
theorem Iic_disjoint_Ioc (h : a ≤ b) : Disjoint (Iic a) (Ioc b c)

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


@[simp]
theorem parallelPair_obj_one (f g : X ⟶ Y) : (parallelPair f g).obj one = Y

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

(CategoryTheory.Limits.parallelPair f g).obj CategoryTheory.Limits.WalkingParallelPair.one = Y


theorem mul_subset_mul : (↑M : Set A) * (↑N : Set A) ⊆ (↑(M * N) : Set A)

{R : Type u}
[CommSemiring R]
{A : Type v}
[Semiring A]
[Algebra R A]
(M N : Submodule R A)


theorem getElem?_concat_length (l : List α) (a : α) : (l ++ [a])[l.length]? = some a


protected lemma forall_congr_left : (∀ a, p a) ↔ ∀ b, p (e.symm b)

{α : Sort u}
{β : Sort v}
{p : α → Prop}
(e : α ≃ β)

(∀ (a : α), p a) ↔ ∀ (b : β), p (e.symm b)


theorem biUnion_union (s t : Set α) (u : α → Set β) :
    ⋃ x ∈ s ∪ t, u x = (⋃ x ∈ s, u x) ∪ ⋃ x ∈ t, u x

{α : Type u_1}
{β : Type u_2}
(s t : Set α)
(u : α → Set β)


theorem map_sup (S T : L.Substructure M) (f : M →[L] N) : (S ⊔ T).map f = S.map f ⊔ T.map f

{L : FirstOrder.Language}
{M : Type w}
{N : Type u_1}
[L.Structure M]
[L.Structure N]
(S T : L.Substructure M)
(f : L.Hom M N)

FirstOrder.Language.Substructure.map f (S ⊔ T) =
  FirstOrder.Language.Substructure.map f S ⊔ FirstOrder.Language.Substructure.map f T


theorem Subtype.volume_def : (volume : Measure u) = volume.comap Subtype.val

{δ : Type u_4}
{u : Set δ}
[MeasureTheory.MeasureSpace δ]

MeasureTheory.volume = MeasureTheory.Measure.comap Subtype.val MeasureTheory.volume


protected theorem absorbs (hs : Absorbent M s) {x : α} : Absorbs M s {x}

{M : Type u_1}
{α : Type u_2}
[Bornology M]
[SMul M α]
{s : Set α}
(hs : Absorbent M s)
{x : α}


/-- A morphism of schemes `f : X ⟶ Y` is universally closed if the base change `X ×[Y] Y' ⟶ Y'`
along any morphism `Y' ⟶ Y` is (topologically) a closed map.
-/
@[mk_iff]
class UniversallyClosed (f : X ⟶ Y) : Prop where
  out : universally (topologically @IsClosedMap) f

[self : AlgebraicGeometry.UniversallyClosed f]


theorem mem_space_iff : x ∈ K.space ↔ ∃ s ∈ K.faces, x ∈ convexHull 𝕜 (s : Set E)

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedRing 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{K : Geometry.SimplicialComplex 𝕜 E}
{x : E}

x ∈ K.space ↔ ∃ s ∈ K.faces, x ∈ (convexHull 𝕜) ↑s


/-- Composition of morphisms in `Factorisation f`. -/
@[simps]
protected def Hom.comp {d₁ d₂ d₃ : Factorisation f}
    (f : Factorisation.Hom d₁ d₂) (g : Factorisation.Hom d₂ d₃) : Factorisation.Hom d₁ d₃

{d₁ d₂ d₃ : CategoryTheory.Factorisation f}

∀ (f_1 : d₁.Hom d₂) (g : d₂.Hom d₃), (f_1.comp g).h = CategoryTheory.CategoryStruct.comp f_1.h g.h


theorem leadingCoeff_one : leadingCoeff (1 : R[X]) = 1


theorem ucs_eq_top_iff (k : ℕ) : N.ucs k = ⊤ ↔ LieModule.lowerCentralSeries R L M k ≤ N

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

LieSubmodule.ucs k N = ⊤ ↔ LieModule.lowerCentralSeries R L M k ≤ N


lemma tensorQuotEquivQuotSMul_comp_mkQ_lTensor (I : Ideal R) :
    tensorQuotEquivQuotSMul M I ∘ₗ I.mkQ.lTensor M =
      (I • ⊤ : Submodule R M).mkQ ∘ₗ TensorProduct.rid R M

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

↑(tensorQuotEquivQuotSMul M I) ∘ₗ LinearMap.lTensor M (Submodule.mkQ I) = (I • ⊤).mkQ ∘ₗ ↑(TensorProduct.rid R M)


theorem tendsto_atTop_isGLB (h_anti : Antitone f) (ha : IsGLB (Set.range f) a) :
    Tendsto f atTop (𝓝 a)

{α : Type u_1}
{ι : Type u_3}
[Preorder ι]
[TopologicalSpace α]
[Preorder α]
[InfConvergenceClass α]
{f : ι → α}
{a : α}
(h_anti : Antitone f)
(ha : IsGLB (Set.range f) a)


@[simp]
theorem rel_zero_right {a : Multiset α} : Rel r a 0 ↔ a = 0

{α : Type u_1}
{β : Type v}
{r : α → β → Prop}
{a : Multiset α}


theorem inv_eq_iff_eq {f : Perm α} {x y : α} : f⁻¹ x = y ↔ x = f y

{α : Type u}
{f : Equiv.Perm α}
{x y : α}


@[reassoc (attr := simp)]
theorem kernel.condition : kernel.ι f ≫ f = 0

CategoryTheory.Limits.kernel.ι f ≫ f = 0


@[simp]
theorem degree_zero : degree (0 : R[T;T⁻¹]) = ⊥


/-- Let `L` be a topological space and let `L×L` be equipped with the product topology and let
`⊓:L×L → L` be a supremum. Then `L` is said to have *(jointly) continuous supremum* if the map
`⊓:L×L → L` is continuous.
-/
class ContinuousSup (L : Type*) [TopologicalSpace L] [Sup L] : Prop where
  /-- The supremum is continuous -/
  continuous_sup : Continuous fun p : L × L => p.1 ⊔ p.2

{L : Type u_1}
[TopologicalSpace L]
[Sup L]
[self : ContinuousSup L]


@[to_additive (attr := mono, gcongr) nsmul_le_nsmul_right]
theorem pow_le_pow_left' [CovariantClass M M (swap (· * ·)) (· ≤ ·)] {a b : M} (hab : a ≤ b) :
    ∀ i : ℕ, a ^ i ≤ b ^ i

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

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


@[simp]
theorem le_max_iff : a ≤ max b c ↔ a ≤ b ∨ a ≤ c

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


@[simp]
lemma single₀ObjXSelf (X : V) :
    HomologicalComplex.singleObjXSelf (ComplexShape.up ℕ) 0 X = Iso.refl _

HomologicalComplex.singleObjXSelf (ComplexShape.up ℕ) 0 X =
  CategoryTheory.Iso.refl (((HomologicalComplex.single V (ComplexShape.up ℕ) 0).obj X).X 0)


theorem cos_eq_zero_iff {θ : ℝ} : cos θ = 0 ↔ ∃ k : ℤ, θ = (2 * k + 1) * π / 2

Real.cos θ = 0 ↔ ∃ k, θ = (2 * ↑k + 1) * Real.pi / 2


theorem Sigma.ι_comp_toFiniteCoproduct (a : α) :
    (Limits.Sigma.ι X a) ≫ (coproductIsoCoproduct X).inv = finiteCoproduct.ι X a

{α : Type w}
[Finite α]
(X : α → Profinite)
(a : α)

CategoryTheory.CategoryStruct.comp (CategoryTheory.Limits.Sigma.ι X a) (Profinite.coproductIsoCoproduct X).inv =
  Profinite.finiteCoproduct.ι X a


lemma slope_lt_derivWithin (hfc : StrictConvexOn ℝ S f) (hx : x ∈ S) (hy : y ∈ S) (hxy : x < y)
    (hfd : DifferentiableWithinAt ℝ f S y) :
    slope f x y < derivWithin f S y

{S : Set ℝ}
{f : ℝ → ℝ}
{x y : ℝ}
(hfc : StrictConvexOn ℝ S f)
(hx : x ∈ S)
(hy : y ∈ S)
(hxy : x < y)
(hfd : DifferentiableWithinAt ℝ f S y)


@[to_additive (attr := simp) nsmul_eq_smul]
theorem npow_eq_pow (n : ℕ) (x : M) : Monoid.npow n x = x ^ n

{M : Type u_2}
[AddMonoid M]
(n : ℕ)
(x : M)


theorem unbounded_gt_of_unbounded_ge [Preorder α] (h : Unbounded (· ≥ ·) s) : Unbounded (· > ·) s

(h : Set.Unbounded (fun x x_1 => x ≥ x_1) s)


@[simp]
theorem comap_inf {N₂' : LieSubmodule R L M'} :
    (N' ⊓ N₂').comap f = N'.comap f ⊓ N₂'.comap f

{R : Type u}
{L : Type v}
{M : Type w}
{M' : Type w₁}
[CommRing R]
[LieRing L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[AddCommGroup M']
[Module R M']
[LieRingModule L M']
{f : M →ₗ⁅R,L⁆ M'}
{N' N₂' : LieSubmodule R L M'}

LieSubmodule.comap f (N' ⊓ N₂') = LieSubmodule.comap f N' ⊓ LieSubmodule.comap f N₂'


@[simp] theorem RingHom.comp_id_ringCat
    {G : RingCat.{u}} {H : Type u} [Ring H] (f : G →+* H) : f.comp (𝟙 G) = f

{G : RingCat}
{H : Type u}
[Ring H]
(f : ↑G →+* H)


theorem trNat_default : trNat default = []


theorem foldrIdx_eq_foldrIdxSpec (f : ℕ → α → β → β) (b as start) :
    foldrIdx f b as start = foldrIdxSpec f b as start

{α : Type u}
{β : Type v}
(f : ℕ → α → β → β)
(b : β)
(as : List α)
(start : ℕ)

List.foldrIdx f b as start = List.foldrIdxSpec f b as start


@[to_additive]
theorem isUnit_pure (a : α) : IsUnit (pure a : Filter α)


@[simp] lemma coe_toInfTopHom (f : BoundedLatticeHom α β) : ⇑f.toInfTopHom = f

{α : Type u_3}
{β : Type u_4}
[Lattice α]
[Lattice β]
[BoundedOrder α]
[BoundedOrder β]
(f : BoundedLatticeHom α β)


/-- A version of `Con.induction_on` for predicates which take two arguments. -/
@[to_additive (attr := elab_as_elim) "A version of `AddCon.induction_on` for predicates which take
two arguments."]
protected theorem induction_on₂ {d : Con N} {C : c.Quotient → d.Quotient → Prop} (p : c.Quotient)
    (q : d.Quotient) (H : ∀ (x : M) (y : N), C x y) : C p q

{M : Type u_1}
{N : Type u_2}
[Mul M]
[Mul N]
{c : Con M}
{d : Con N}
{C : c.Quotient → d.Quotient → Prop}
(p : c.Quotient)
(q : d.Quotient)
(H : ∀ (x : M) (y : N), C ↑x ↑y)


nonrec
theorem ContinuousWithinAt.cexp (h : ContinuousWithinAt f s x) :
    ContinuousWithinAt (fun y => exp (f y)) s x

{α : Type u_1}
[TopologicalSpace α]
{f : α → ℂ}
{s : Set α}
{x : α}
(h : ContinuousWithinAt f s x)

ContinuousWithinAt (fun y => Complex.exp (f y)) s x


@[simp]
theorem skewProd_apply (e : M ≃L[R] M₂) (e' : M₃ ≃L[R] M₄) (f : M →L[R] M₄) (x) :
    e.skewProd e' f x = (e x.1, e' x.2 + f x.1)

{R : Type u_1}
[Semiring R]
{M : Type u_2}
[TopologicalSpace M]
[AddCommGroup M]
{M₂ : Type u_3}
[TopologicalSpace M₂]
[AddCommGroup M₂]
{M₃ : Type u_4}
[TopologicalSpace M₃]
[AddCommGroup M₃]
{M₄ : Type u_5}
[TopologicalSpace M₄]
[AddCommGroup M₄]
[Module R M]
[Module R M₂]
[Module R M₃]
[Module R M₄]
[TopologicalAddGroup M₄]
(e : M ≃L[R] M₂)
(e' : M₃ ≃L[R] M₄)
(f : M →L[R] M₄)
(x : M × M₃)

(e.skewProd e' f) x = (e x.1, e' x.2 + f x.1)


@[simp]
theorem mem_pmap (f : α →. β) (l : Filter α) (s : Set β) : s ∈ l.pmap f ↔ f.core s ∈ l

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


theorem lintegral_eq {f : α → ℝ≥0∞} {g : β → ℝ≥0∞} (h : IdentDistrib f g μ ν) :
    ∫⁻ x, f x ∂μ = ∫⁻ x, g x ∂ν

{f : α → ℝ≥0∞}

{g : β → ℝ≥0∞}

(h : ProbabilityTheory.IdentDistrib f g μ ν)


@[to_additive (attr := mono, gcongr) nsmul_lt_nsmul_right]
lemma pow_lt_pow_left' (hn : n ≠ 0) {a b : M} (hab : a < b) : a ^ n < b ^ n

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

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


theorem mul_def (a b : Fin n) : a * b = Fin.mk ((a * b) % n) (Nat.mod_lt _ a.size_pos)


nonrec theorem ContinuousWithinAt.zpow₀ (hf : ContinuousWithinAt f s a) (m : ℤ)
    (h : f a ≠ 0 ∨ 0 ≤ m) : ContinuousWithinAt (fun x => f x ^ m) s a

{G₀ : Type u_3}
[GroupWithZero G₀]
[TopologicalSpace G₀]
[HasContinuousInv₀ G₀]
[ContinuousMul G₀]
{X : Type u_4}
[TopologicalSpace X]
{a : X}
{s : Set X}
{f : X → G₀}
(hf : ContinuousWithinAt f s a)
(m : ℤ)
(h : f a ≠ 0 ∨ 0 ≤ m)


/-- To show a property is true on the odd parts, it suffices to show it is true on the
vectors, closed under addition, and under left-multiplication by a pair of vectors. -/
@[elab_as_elim]
theorem odd_induction {P : ∀ x, x ∈ evenOdd Q 1 → Prop}
    (ι : ∀ v, P (ι Q v) (ι_mem_evenOdd_one _ _))
    (add : ∀ x y hx hy, P x hx → P y hy → P (x + y) (Submodule.add_mem _ hx hy))
    (ι_mul_ι_mul :
      ∀ m₁ m₂ x hx,
        P x hx →
          P (CliffordAlgebra.ι Q m₁ * CliffordAlgebra.ι Q m₂ * x)
            (zero_add (1 : ZMod 2) ▸ SetLike.mul_mem_graded (ι_mul_ι_mem_evenOdd_zero Q m₁ m₂) hx))
    (x : CliffordAlgebra Q) (hx : x ∈ evenOdd Q 1) : P x hx

{P : (x : CliffordAlgebra Q) → x ∈ CliffordAlgebra.evenOdd Q 1 → Prop}

(ι : ∀ (v : M), P ((CliffordAlgebra.ι Q) v) ⋯)

(add :
  ∀ (x y : CliffordAlgebra Q) (hx : x ∈ CliffordAlgebra.evenOdd Q 1) (hy : y ∈ CliffordAlgebra.evenOdd Q 1),
    P x hx → P y hy → P (x + y) ⋯)

(ι_mul_ι_mul :
  ∀ (m₁ m₂ : M) (x : CliffordAlgebra Q) (hx : x ∈ CliffordAlgebra.evenOdd Q 1),
    P x hx → P ((CliffordAlgebra.ι Q) m₁ * (CliffordAlgebra.ι Q) m₂ * x) ⋯)


@[simp]
theorem comp_app {F G H : C ⥤ D} (α : F ⟶ G) (β : G ⟶ H) (X : C) :
    (α ≫ β).app X = α.app X ≫ β.app X

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

(CategoryTheory.CategoryStruct.comp α β).app X = CategoryTheory.CategoryStruct.comp (α.app X) (β.app X)


/-- An orthonormal set is linearly independent. -/
theorem Orthonormal.linearIndependent {v : ι → E} (hv : Orthonormal 𝕜 v) :
    LinearIndependent 𝕜 v

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{ι : Type u_4}
{v : ι → E}
(hv : Orthonormal 𝕜 v)


@[simp]
theorem aleph'_alephIdx (c : Cardinal) : aleph' c.alephIdx = c


@[simp, norm_cast]
theorem coe_natCast (n : ℕ) : ((n : ℤ_[p]) : ℚ_[p]) = n


/-- The composition of two language homomorphisms. -/
@[simps]
def comp (g : L' →ᴸ L'') (f : L →ᴸ L') : L →ᴸ L''

{L : FirstOrder.Language}
{L' : FirstOrder.Language}
{L'' : FirstOrder.Language}
(g : L' →ᴸ L'')
(f : L →ᴸ L')

∀ (x : ℕ) (R : L.Relations x), (g.comp f).onRelation R = g.onRelation (f.onRelation R)


theorem integral_eq_integral_of_support_subset {a b} (h : support f ⊆ Ioc a b) :
    ∫ x in a..b, f x ∂μ = ∫ x, f x ∂μ

{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : ℝ → E}
{μ : MeasureTheory.Measure ℝ}
{a b : ℝ}
(h : Function.support f ⊆ Set.Ioc a b)

∫ (x : ℝ) in a..b, f x ∂μ = ∫ (x : ℝ), f x ∂μ


theorem ciSup_le' {f : ι → α} {a : α} (h : ∀ i, f i ≤ a) : ⨆ i, f i ≤ a

{α : Type u_1}
{ι : Sort u_4}
[ConditionallyCompleteLinearOrderBot α]
{f : ι → α}
{a : α}
(h : ∀ (i : ι), f i ≤ a)


theorem nadd_def (a b : Ordinal) :
    a ♯ b = max (blsub.{u, u} a fun a' _ => a' ♯ b) (blsub.{u, u} b fun b' _ => a ♯ b')

a ♯ b = max (a.blsub fun a' x => a' ♯ b) (b.blsub fun b' x => a ♯ b')


@[simp]
theorem setOfIdeal_ofSet_eq_interior (s : Set X) : setOfIdeal (idealOfSet 𝕜 s) = interior s

{X : Type u_1}
(𝕜 : Type u_2)
[RCLike 𝕜]
[TopologicalSpace X]
[CompactSpace X]
[T2Space X]
(s : Set X)

ContinuousMap.setOfIdeal (ContinuousMap.idealOfSet 𝕜 s) = interior s


private lemma aux (x : α) (p : α → Prop) :
    (∃ a : α, p a ∧ WithTop.some a = WithTop.some x) ↔ p x


theorem pairwise_disjoint_nhds [T2Space X] : Pairwise (Disjoint on (𝓝 : X → Filter X))

{X : Type u_1}
[TopologicalSpace X]
[T2Space X]


/-- On square matrices, `mul_right_comm` applies under `det`. -/
theorem det_mul_right_comm (M N P : Matrix m m R) : det (M * N * P) = det (M * P * N)

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


lemma strictMono_castPred_comp (hf : ∀ a, f a ≠ last n) (hf₂ : StrictMono f) :
    StrictMono (fun a => castPred (f a) (hf a))

{n : ℕ}
{α : Type u_1}
[Preorder α]
{f : α → Fin (n + 1)}
(hf : ∀ (a : α), f a ≠ Fin.last n)
(hf₂ : StrictMono f)


@[simp, norm_cast]
theorem coe_multilinearMap : ⇑(f : MultilinearMap R (fun _ : ι => M) N) = f

{R : Type u_1}
[Semiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
{N : Type u_3}
[AddCommMonoid N]
[Module R N]
{ι : Type u_7}
(f : M [⋀^ι]→ₗ[R] N)


theorem UInt64.toNat_modn (x : UInt64) (n) : (x.modn n).toNat = x.toNat % n


@[to_additive (attr := simp)]
theorem topEquiv_toMonoidHom : ((topEquiv : _ ≃* M) : _ →* M) = (⊤ : Submonoid M).subtype


@[to_additive]
theorem closure.isSubmonoid (s : Set M) : IsSubmonoid (Closure s)


theorem Integrable.of_measure_le_smul {μ' : Measure α} (c : ℝ≥0∞) (hc : c ≠ ∞) (hμ'_le : μ' ≤ c • μ)
    {f : α → β} (hf : Integrable f μ) : Integrable f μ'

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup β]
{μ' : MeasureTheory.Measure α}
(c : ℝ≥0∞)
(hc : c ≠ ⊤)
(hμ'_le : μ' ≤ c • μ)
{f : α → β}
(hf : MeasureTheory.Integrable f μ)


@[simp]
theorem smul_apply [IsScalarTower R ℝ≥0 ℝ≥0] (c : R) (μ : FiniteMeasure Ω) (s : Set Ω) :
    (c • μ) s = c • μ s

{Ω : Type u_1}
[MeasurableSpace Ω]
{R : Type u_2}
[SMul R ℝ≥0]
[SMul R ℝ≥0∞]
[IsScalarTower R ℝ≥0 ℝ≥0∞]
[IsScalarTower R ℝ≥0∞ ℝ≥0∞]
[IsScalarTower R ℝ≥0 ℝ≥0]
(c : R)
(μ : MeasureTheory.FiniteMeasure Ω)
(s : Set Ω)


theorem incMatrix_of_not_mem_incidenceSet (h : e ∉ G.incidenceSet a) : G.incMatrix R a e = 0

{R : Type u_1}
{α : Type u_2}
(G : SimpleGraph α)
[MulZeroOneClass R]
{a : α}
{e : Sym2 α}
(h : e ∉ G.incidenceSet a)


@[to_additive (attr := simp)]
theorem ofDual_mul [Mul α] (a b : αᵒᵈ) : ofDual (a * b) = ofDual a * ofDual b

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


theorem measurable_invariants_of_semiconj {fa : α → α} {fb : β → β} {g : α → β} (hg : Measurable g)
    (hfg : Semiconj g fa fb) : @Measurable _ _ (invariants fa) (invariants fb) g

{α : Type u_1}
[MeasurableSpace α]
{β : Type u_2}
[MeasurableSpace β]
{fa : α → α}
{fb : β → β}
{g : α → β}
(hg : Measurable g)
(hfg : Function.Semiconj g fa fb)


theorem sbtw_cyclic_right {a b c : α} (h : sbtw a b c) : sbtw c a b

{α : Type u_1}
[CircularPreorder α]
{a b c : α}
(h : sbtw a b c)


/-- The left unitor isomorphism for binary coproducts with the initial object. -/
@[simps]
def coprod.leftUnitor (P : C) : (⊥_ C) ⨿ P ≅ P

(CategoryTheory.Limits.coprod.leftUnitor P).inv = CategoryTheory.Limits.coprod.inr


@[simp, norm_cast]
lemma filterMap_coe (f : α → Option β) (l : List α) : filterMap f l = l.filterMap f

{α : Type u_1}
{β : Type v}
(f : α → Option β)
(l : List α)

Multiset.filterMap f ↑l = ↑(List.filterMap f l)


lemma cosKernel_undef (a : UnitAddCircle) {x : ℝ} (hx : x ≤ 0) : cosKernel a x = 0


theorem nnnorm_lt_iff {M : ℝ≥0} (M0 : 0 < M) : ‖f‖₊ < M ↔ ∀ x : α, ‖f x‖₊ < M

{α : Type u_1}
{E : Type u_3}
[TopologicalSpace α]
[CompactSpace α]
[NormedAddCommGroup E]
(f : C(α, E))
{M : ℝ≥0}
(M0 : 0 < M)


/-- The `modify` function preserves the balance invariants. -/
protected theorem Balanced.modify {t : RBNode α}
    (h : t.Balanced c n) : ∃ c n, (t.modify cut f).Balanced c n

{α : Type u_1}
{c : Batteries.RBColor}
{n : Nat}
{cut : α → Ordering}
{f : α → α}
{t : Batteries.RBNode α}
(h : t.Balanced c n)

∃ c n, (Batteries.RBNode.modify cut f t).Balanced c n


@[simp 1100, nolint simpNF]
theorem mem_map_iff_mem_of_injective {f : P₁ →ᵃ[k] P₂} {x : P₁} {s : AffineSubspace k P₁}
    (hf : Function.Injective f) : f x ∈ s.map f ↔ x ∈ 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₂}
{x : P₁}
{s : AffineSubspace k P₁}
(hf : Function.Injective ⇑f)


theorem accPt_sup (x : X) (F G : Filter X) :
    AccPt x (F ⊔ G) ↔ AccPt x F ∨ AccPt x G

{X : Type u}
[TopologicalSpace X]
(x : X)
(F G : Filter X)


theorem range_coe (h : α ≃ᵤ β) : range h = univ

{α : Type u}
{β : Type u_1}
[UniformSpace α]
[UniformSpace β]
(h : α ≃ᵤ β)


protected theorem Sorted.gt_of_ge [PartialOrder α] {l : List α} (h₁ : l.Sorted (· ≥ ·))
    (h₂ : l.Nodup) : l.Sorted (· > ·)

(h₁ : List.Sorted (fun x x_1 => x ≥ x_1) l)


/-- The kernel of `A →ₐ[R₁] I.quotient` is `I`. -/
@[simp]
theorem Quotient.mkₐ_ker (I : Ideal A) : RingHom.ker (Quotient.mkₐ R₁ I : A →+* A ⧸ I) = I

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

RingHom.ker ↑(Ideal.Quotient.mkₐ R₁ I) = I


lemma RingHom.OfLocalizationSpanTarget.ofIsLocalization
    (hP : RingHom.OfLocalizationSpanTarget P) (hP' : RingHom.RespectsIso P)
    {R S : Type u} [CommRing R] [CommRing S] (f : R →+* S) (s : Set S) (hs : Ideal.span s = ⊤)
    (hT : ∀ r : s, ∃ (T : Type u) (_ : CommRing T) (_ : Algebra S T)
      (_ : IsLocalization.Away (r : S) T), P ((algebraMap S T).comp f)) : P f

{P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop}

(hP : RingHom.OfLocalizationSpanTarget fun {R S} [CommRing R] [CommRing S] => P)

(hP' : RingHom.RespectsIso fun {R S} [CommRing R] [CommRing S] => P)

(hT : ∀ (r : ↑s), ∃ T x x_1, ∃ (_ : IsLocalization.Away (↑r) T), P ((algebraMap S T).comp f))


theorem castNum_eq_bitwise {f : Num → Num → Num} {g : Bool → Bool → Bool}
    (p : PosNum → PosNum → Num)
    (gff : g false false = false) (f00 : f 0 0 = 0)
    (f0n : ∀ n, f 0 (pos n) = cond (g false true) (pos n) 0)
    (fn0 : ∀ n, f (pos n) 0 = cond (g true false) (pos n) 0)
    (fnn : ∀ m n, f (pos m) (pos n) = p m n) (p11 : p 1 1 = cond (g true true) 1 0)
    (p1b : ∀ b n, p 1 (PosNum.bit b n) = bit (g true b) (cond (g false true) (pos n) 0))
    (pb1 : ∀ a m, p (PosNum.bit a m) 1 = bit (g a true) (cond (g true false) (pos m) 0))
    (pbb : ∀ a b m n, p (PosNum.bit a m) (PosNum.bit b n) = bit (g a b) (p m n)) :
    ∀ m n : Num, (f m n : ℕ) = Nat.bitwise g m n

(f0n : ∀ (n : PosNum), f 0 (Num.pos n) = bif g false true then Num.pos n else 0)

(fn0 : ∀ (n : PosNum), f (Num.pos n) 0 = bif g true false then Num.pos n else 0)

(fnn : ∀ (m n : PosNum), f (Num.pos m) (Num.pos n) = p m n)

(p11 : p 1 1 = bif g true true then 1 else 0)

(p1b : ∀ (b : Bool) (n : PosNum), p 1 (PosNum.bit b n) = Num.bit (g true b) (bif g false true then Num.pos n else 0))

(pb1 : ∀ (a : Bool) (m : PosNum), p (PosNum.bit a m) 1 = Num.bit (g a true) (bif g true false then Num.pos m else 0))

(pbb : ∀ (a b : Bool) (m n : PosNum), p (PosNum.bit a m) (PosNum.bit b n) = Num.bit (g a b) (p m n))


@[simp] theorem Name.num.sizeOf_spec (p : Name) (n : Nat) : sizeOf (num p n) = 1 + sizeOf p + sizeOf n

sizeOf (p.num n) = 1 + sizeOf p + sizeOf n


@[simp]
theorem irrational_nat_add_iff : Irrational (n + x) ↔ Irrational x


lemma diffs_union_left : (s₁ ∪ s₂) \\ t = s₁ \\ t ∪ s₂ \\ t

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

(s₁ ∪ s₂).diffs t = s₁.diffs t ∪ s₂.diffs t


theorem abs_toReal_measure_sub_le_measure_symmDiff'
    (hs : MeasurableSet s) (ht : MeasurableSet t) (hs' : μ s ≠ ∞) (ht' : μ t ≠ ∞) :
    |(μ s).toReal - (μ t).toReal| ≤ (μ (s ∆ t)).toReal

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s t : Set α}
(hs : MeasurableSet s)
(ht : MeasurableSet t)
(hs' : μ s ≠ ⊤)
(ht' : μ t ≠ ⊤)

|(μ s).toReal - (μ t).toReal| ≤ (μ (symmDiff s t)).toReal


/-- `InvMemClass S G` states `S` is a type of subsets `s ⊆ G` closed under inverses. -/
class InvMemClass (S G : Type*) [Inv G] [SetLike S G] : Prop where
  /-- `s` is closed under inverses -/
  inv_mem : ∀ {s : S} {x}, x ∈ s → x⁻¹ ∈ s

{S : Type u_5}
{G : Type u_6}
[Inv G]
[SetLike S G]
[self : InvMemClass S G]
{s : S}
{x : G}

x ∈ s → x⁻¹ ∈ s


@[simp]
theorem coe_toEquiv_symm : e.toEquiv.symm = e.symm

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
[CommSemiring R]
[AddCommMonoid A]
[AddCommMonoid B]
[Module R A]
[Module R B]
[CoalgebraStruct R A]
[CoalgebraStruct R B]
(e : A ≃ₗc[R] B)


/-- Converting a bundled algebra to a monoid object in `ModuleCat R`.
-/
@[simps]
def inverseObj (A : AlgebraCat.{u} R) : Mon_ (ModuleCat.{u} R)

{R : Type u}
[CommRing R]
(A : AlgebraCat R)

(ModuleCat.MonModuleEquivalenceAlgebra.inverseObj A).mul = LinearMap.mul' R ↑A


@[continuity, fun_prop]
theorem Continuous.inv₀ (hf : Continuous f) (h0 : ∀ x, f x ≠ 0) : Continuous fun x => (f x)⁻¹

{α : Type u_1}
{G₀ : Type u_3}
[Zero G₀]
[Inv G₀]
[TopologicalSpace G₀]
[HasContinuousInv₀ G₀]
{f : α → G₀}
[TopologicalSpace α]
(hf : Continuous f)
(h0 : ∀ (x : α), f x ≠ 0)


@[simp]
theorem bot_coe : ((⊥ : LieSubmodule R L M) : Set M) = {0}

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


theorem subperm_of_subset (d : Nodup l₁) (H : l₁ ⊆ l₂) : l₁ <+~ l₂

∀ {α : Type u_1} {l₁ l₂ : List α}, l₁.Nodup → l₁ ⊆ l₂ → l₁ <+~ l₂


theorem kroneckerTMul_diagonal [DecidableEq n] (A : Matrix l m α) (b : n → α) :
    A ⊗ₖₜ[R] diagonal b = blockDiagonal fun i => A.map fun a => a ⊗ₜ[R] b i

(R : Type u_1)
{α : Type u_2}
{l : Type u_8}
{m : Type u_9}
{n : Type u_10}
[CommSemiring R]
[AddCommMonoid α]
[Module R α]
[DecidableEq n]
(A : Matrix l m α)
(b : n → α)

Matrix.kroneckerMap (TensorProduct.tmul R) A (Matrix.diagonal b) =
  Matrix.blockDiagonal fun i => A.map fun a => a ⊗ₜ[R] b i


/-- Arithmetic progressions of length three are preserved under `2`-Freiman isomorphisms. -/
@[to_additive]
lemma IsMulFreimanIso.threeGPFree_congr (hf : IsMulFreimanIso 2 s t f) :
    ThreeGPFree s ↔ ThreeGPFree t

{α : Type u_2}
{β : Type u_3}
[CommMonoid α]
[CommMonoid β]
{s : Set α}
{t : Set β}
{f : α → β}
(hf : IsMulFreimanIso 2 s t f)


theorem isFractional_of_le {I : Submodule R P} {J : FractionalIdeal S P} (hIJ : I ≤ J) :
    IsFractional S I

{R : Type u_1}
[CommRing R]
{S : Submonoid R}
{P : Type u_2}
[CommRing P]
[Algebra R P]
{I : Submodule R P}
{J : FractionalIdeal S P}
(hIJ : I ≤ ↑J)


@[simp]
theorem add_left [Distrib R] {a b x y : R} (ha : SemiconjBy a x y) (hb : SemiconjBy b x y) :
    SemiconjBy (a + b) x y

{R : Type x}
[Distrib R]
{a b x y : R}
(ha : SemiconjBy a x y)
(hb : SemiconjBy b x y)


theorem zero_tprodCoeff' (z : R) (f : Π i, s i) (i : ι) (hf : f i = 0) : tprodCoeff R z f = 0

{ι : Type u_1}
{R : Type u_4}
[CommSemiring R]
{s : ι → Type u_7}
[(i : ι) → AddCommMonoid (s i)]
[(i : ι) → Module R (s i)]
(z : R)
(f : (i : ι) → s i)
(i : ι)
(hf : f i = 0)


@[reassoc]
lemma stalkMap_congr_hom (f g : X ⟶ Y) (hfg : f = g) (x : X) :
    f.stalkMap x = Y.presheaf.stalkSpecializes (specializes_of_eq <| hfg ▸ rfl) ≫
      g.stalkMap x

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

AlgebraicGeometry.Scheme.Hom.stalkMap f x = Y.presheaf.stalkSpecializes ⋯ ≫ AlgebraicGeometry.Scheme.Hom.stalkMap g x


theorem disjoint_nhds_cobounded (x : α) : Disjoint (𝓝 x) (cobounded α)

{α : Type u}
[PseudoMetricSpace α]
(x : α)


@[simp]
theorem whiskerRight_apply {L M : ModuleCat.{u} R} (f : L ⟶ M) (N : ModuleCat.{u} R)
    (l : L) (n : N) :
    (f ▷ N) (l ⊗ₜ n) = f l ⊗ₜ n

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

(CategoryTheory.MonoidalCategory.whiskerRight f N) (l ⊗ₜ[R] n) = f l ⊗ₜ[R] n


@[to_additive (attr := simp)]
theorem closure_subgroup {s : Set G} (hs : IsSubgroup s) : closure s = s

{G : Type u_1}
[AddGroup G]
{s : Set G}
(hs : IsAddSubgroup s)


@[simp] lemma lift_lt_ofENat {x : Cardinal.{v}} {m : ℕ∞} : lift.{u} x < m ↔ x < m


theorem isAlgebraic_iff_not_injective {x : A} :
    IsAlgebraic R x ↔ ¬Function.Injective (Polynomial.aeval x : R[X] →ₐ[R] A)

{R : Type u}
{A : Type v}
[CommRing R]
[Ring A]
[Algebra R A]
{x : A}

IsAlgebraic R x ↔ ¬Function.Injective ⇑(Polynomial.aeval x)


@[simp]
theorem image_empty (f : α → β) : (∅ : Finset α).image f = ∅

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


theorem HasDerivAt.sqrt (hf : HasDerivAt f f' x) (hx : f x ≠ 0) :
    HasDerivAt (fun y => √(f y)) (f' / (2 * √(f x))) x

{f : ℝ → ℝ}
{f' x : ℝ}
(hf : HasDerivAt f f' x)
(hx : f x ≠ 0)


theorem destutter'_cons :
    (b :: l).destutter' R a = if R a b then a :: destutter' R b l else destutter' R a l

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

List.destutter' R a (b :: l) = if R a b then a :: List.destutter' R b l else List.destutter' R a l


theorem IsRightRegular.isSMulRegular [Mul R] {c : R} (h : IsRightRegular c) :
    IsSMulRegular R (MulOpposite.op c)

{R : Type u_1}
[Mul R]
{c : R}
(h : IsRightRegular c)


lemma Inducing.isCompact_preimage_iff {f : X → Y} (hf : Inducing f) {K : Set Y}
    (Kf : K ⊆ range f) : IsCompact (f ⁻¹' K) ↔ IsCompact K

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]
{f : X → Y}
(hf : Inducing f)
{K : Set Y}
(Kf : K ⊆ Set.range f)


@[reassoc (attr := simp)]
lemma inl_v_descShortComplex_f (i j : ℤ) (h : i + (-1) = j) :
    (inl S.f).v i j h ≫ (descShortComplex S).f j = 0

(S : CategoryTheory.ShortComplex (CochainComplex C ℤ))

(CochainComplex.mappingCone.inl S.f).v i j h ≫ (CochainComplex.mappingCone.descShortComplex S).f j = 0


/-- If `n` is positive, then `(χ ^ n) a = (χ a) ^ n`. -/
theorem pow_apply' (χ : MulChar R R') {n : ℕ} (hn : n ≠ 0) (a : R) : (χ ^ n) a = χ a ^ n

{R : Type u_1}
[CommMonoid R]
{R' : Type u_2}
[CommMonoidWithZero R']
(χ : MulChar R R')
{n : ℕ}
(hn : n ≠ 0)
(a : R)


private theorem deriv_norm_ne_zero : ‖F.derivative.eval a‖ ≠ 0

(hnorm : ‖Polynomial.eval a F‖ < ‖Polynomial.eval a (Polynomial.derivative F)‖ ^ 2)

‖Polynomial.eval a (Polynomial.derivative F)‖ ≠ 0


theorem inv_cpow (x : ℂ) (n : ℂ) (hx : x.arg ≠ π) : x⁻¹ ^ n = (x ^ n)⁻¹


/-- `ContinuousSemilinearEquivClass F σ M M₂` asserts `F` is a type of bundled continuous
`σ`-semilinear equivs `M → M₂`.  See also `ContinuousLinearEquivClass F R M M₂` for the case
where `σ` is the identity map on `R`.  A map `f` between an `R`-module and an `S`-module over a ring
homomorphism `σ : R →+* S` is semilinear if it satisfies the two properties `f (x + y) = f x + f y`
and `f (c • x) = (σ c) • f x`. -/
class ContinuousSemilinearEquivClass (F : Type*) {R : outParam Type*} {S : outParam Type*}
    [Semiring R] [Semiring S] (σ : outParam <| R →+* S) {σ' : outParam <| S →+* R}
    [RingHomInvPair σ σ'] [RingHomInvPair σ' σ] (M : outParam Type*) [TopologicalSpace M]
    [AddCommMonoid M] (M₂ : outParam Type*) [TopologicalSpace M₂] [AddCommMonoid M₂] [Module R M]
    [Module S M₂] [EquivLike F M M₂] extends SemilinearEquivClass F σ M M₂ : Prop where
  map_continuous : ∀ f : F, Continuous f := by continuity
  inv_continuous : ∀ f : F, Continuous (EquivLike.inv f) := by continuity

[self : ContinuousSemilinearEquivClass F σ M M₂]


theorem biproduct.fromSubtype_eq_lift [DecidablePred p] :
    biproduct.fromSubtype f p =
      biproduct.lift fun j => if h : p j then biproduct.π (Subtype.restrict p f) ⟨j, h⟩ else 0

[CategoryTheory.Limits.HasBiproduct (Subtype.restrict p f)]

CategoryTheory.Limits.biproduct.fromSubtype f p =
  CategoryTheory.Limits.biproduct.lift fun j =>
    if h : p j then CategoryTheory.Limits.biproduct.π (Subtype.restrict p f) ⟨j, h⟩ else 0


theorem smul_left (x₀ : R) {U : Set M} (hU : U ∈ B) : ∃ V ∈ B, V ⊆ (fun x ↦ x₀ • x) ⁻¹' U

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[TopologicalSpace R]
[AddCommGroup M]
[Module R M]
(B : ModuleFilterBasis R M)
(x₀ : R)
{U : Set M}
(hU : U ∈ B)


@[measurability, fun_prop]
theorem Measurable.indicator [Zero β] (hf : Measurable f) (hs : MeasurableSet s) :
    Measurable (s.indicator f)

{α : Type u_1}
{β : Type u_2}
{s : Set α}
{f : α → β}
{m : MeasurableSpace α}
{mβ : MeasurableSpace β}
[Zero β]
(hf : Measurable f)
(hs : MeasurableSet s)


@[to_additive (attr := simp)]
lemma UniformOnFun.toFun_mul [Mul β] (f g : α →ᵤ[𝔖] β) :
    toFun 𝔖 (f * g) = toFun 𝔖 f * toFun 𝔖 g

{α : Type u_1}
{β : Type u_2}
{𝔖 : Set (Set α)}
[Add β]
(f g : α →ᵤ[𝔖] β)

(UniformOnFun.toFun 𝔖) (f + g) = (UniformOnFun.toFun 𝔖) f + (UniformOnFun.toFun 𝔖) g


lemma coeff_Ψ₃_ne_zero (h : (3 : R) ≠ 0) : W.Ψ₃.coeff 4 ≠ 0

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


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

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


/-- A clique is a set of vertices whose induced graph is complete. -/
theorem isClique_iff_induce_eq : G.IsClique s ↔ G.induce s = ⊤

{α : Type u_1}
(G : SimpleGraph α)
{s : Set α}

G.IsClique s ↔ SimpleGraph.induce s G = ⊤


protected theorem HasFPowerSeriesAt.continuousAt (hf : HasFPowerSeriesAt f p x) :
    ContinuousAt f x

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


theorem sphere_subset_preimage_metric_sphere : (sphere n d k : Set (Fin n → ℕ)) ⊆
    (fun x : Fin n → ℕ => (WithLp.equiv 2 _).symm ((↑) ∘ x : Fin n → ℝ)) ⁻¹'
      Metric.sphere (0 : PiLp 2 fun _ : Fin n => ℝ) (√↑k)

↑(Behrend.sphere n d k) ⊆ (fun x => (WithLp.equiv 2 (Fin n → ℝ)).symm (Nat.cast ∘ x)) ⁻¹' Metric.sphere 0 √↑k


theorem dist_smul₀ (s : α) (x y : β) : dist (s • x) (s • y) = ‖s‖ * dist x y

{α : Type u_1}
{β : Type u_2}
[NormedDivisionRing α]
[SeminormedAddCommGroup β]
[Module α β]
[BoundedSMul α β]
(s : α)
(x y : β)


@[to_additive]
nonrec theorem SmoothAt.div {f g : M → G} {x₀ : M} (hf : SmoothAt I' I f x₀)
    (hg : SmoothAt I' I g x₀) : SmoothAt I' I (fun x => f x / g x) x₀

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{H : Type u_2}
[TopologicalSpace H]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{I : ModelWithCorners 𝕜 E H}
{G : Type u_5}
[TopologicalSpace G]
[ChartedSpace H G]
[AddGroup G]
[LieAddGroup I G]
{E' : Type u_6}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_7}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M : Type u_8}
[TopologicalSpace M]
[ChartedSpace H' M]
{f g : M → G}
{x₀ : M}
(hf : SmoothAt I' I f x₀)
(hg : SmoothAt I' I g x₀)


@[simp]
theorem mem_bot (x : L) : x ∈ (⊥ : LieSubalgebra R L) ↔ x = 0

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


theorem le_sup_toSubalgebra : E1.toSubalgebra ⊔ E2.toSubalgebra ≤ (E1 ⊔ E2).toSubalgebra

{K : Type u_3}
{L : Type u_4}
[Field K]
[Field L]
[Algebra K L]
(E1 E2 : IntermediateField K L)


theorem normNoninc_of_isometry (hf : Isometry f) : f.NormNoninc

{V : Type u_1}
{W : Type u_2}
[SeminormedAddCommGroup V]
[SeminormedAddCommGroup W]
{f : NormedAddGroupHom V W}
(hf : Isometry ⇑f)


theorem HasImage.mk {f : X ⟶ Y} (F : ImageFactorisation f) : HasImage f

(F : CategoryTheory.Limits.ImageFactorisation f)


/-- An `AddTorsor G P` gives a structure to the nonempty type `P`,
acted on by an `AddGroup G` with a transitive and free action given
by the `+ᵥ` operation and a corresponding subtraction given by the
`-ᵥ` operation. In the case of a vector space, it is an affine
space. -/
class AddTorsor (G : outParam Type*) (P : Type*) [AddGroup G] extends AddAction G P,
  VSub G P where
  [nonempty : Nonempty P]
  /-- Torsor subtraction and addition with the same element cancels out. -/
  vsub_vadd' : ∀ p₁ p₂ : P, (p₁ -ᵥ p₂ : G) +ᵥ p₂ = p₁
  /-- Torsor addition and subtraction with the same element cancels out. -/
  vadd_vsub' : ∀ (g : G) (p : P), g +ᵥ p -ᵥ p = g

{G : outParam (Type u_1)}
{P : Type u_2}
[AddGroup G]
[self : AddTorsor G P]


@[simp]
theorem mem_replace {a a' : α} {b : β a} {s : AList β} : a' ∈ replace a b s ↔ a' ∈ s

{α : Type u}
{β : α → Type v}
[DecidableEq α]
{a a' : α}
{b : β a}
{s : AList β}


theorem infinitesimal_neg_iff_infiniteNeg_inv {x : ℝ*} :
    InfiniteNeg x⁻¹ ↔ Infinitesimal x ∧ x < 0

x⁻¹.InfiniteNeg ↔ x.Infinitesimal ∧ x < 0


theorem subset_inter {s t r : Set α} (rs : r ⊆ s) (rt : r ⊆ t) : r ⊆ s ∩ t

{α : Type u}
{s t r : Set α}
(rs : r ⊆ s)
(rt : r ⊆ t)


/-- When the function `f` is bounded above on a vertical strip, then so is `F`. -/
lemma F_BddAbove (f : ℂ → E) (ε : ℝ) (hε : ε > 0)
    (hB : BddAbove ((norm ∘ f) '' (verticalClosedStrip 0 1))) :
    BddAbove ((norm ∘ (F f ε)) '' (verticalClosedStrip 0 1))

(hB : BddAbove (norm ∘ f '' Complex.HadamardThreeLines.verticalClosedStrip 0 1))

BddAbove (norm ∘ Complex.HadamardThreeLines.F f ε '' Complex.HadamardThreeLines.verticalClosedStrip 0 1)


@[to_additive]
theorem Subgroup.pow_index_mem {G : Type*} [Group G] (H : Subgroup G) [Normal H] (g : G) :
    g ^ index H ∈ H

{G : Type u_6}
[Group G]
(H : Subgroup G)
[H.Normal]
(g : G)


theorem pred_mono : Monotone (pred : α → α)

{α : Type u_1}
[Preorder α]
[PredOrder α]


/-- A space is quasi sober if it can be covered by open quasi sober subsets. -/
theorem quasiSober_of_open_cover (S : Set (Set α)) (hS : ∀ s : S, IsOpen (s : Set α))
    [hS' : ∀ s : S, QuasiSober s] (hS'' : ⋃₀ S = ⊤) : QuasiSober α

{α : Type u_1}
[TopologicalSpace α]
(S : Set (Set α))
(hS : ∀ (s : ↑S), IsOpen ↑s)
[hS' : ∀ (s : ↑S), QuasiSober ↑↑s]
(hS'' : ⋃₀ S = ⊤)


theorem toDirectSum_comp_ofDirectSum :
    toDirectSum.comp ofDirectSum = AlgHom.id R (⨁ n, ⨂[R]^n M)

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

TensorAlgebra.toDirectSum.comp TensorAlgebra.ofDirectSum = AlgHom.id R (⨁ (n : ℕ), ⨂[R]^n M)


@[to_additive]
theorem map_strictMono_of_injective : StrictMono (map f)

{M : Type u_1}
{N : Type u_2}
[Add M]
[Add N]
{f : AddHom M N}
(hf : Function.Injective ⇑f)


@[reassoc (attr := simp)]
lemma coyonedaOpColimitIsoLimitCoyoneda_inv_comp_π (i : I) :
    (coyonedaOpColimitIsoLimitCoyoneda F).inv ≫ coyoneda.map (colimit.ι F i).op
      = limit.π (F.op.comp coyoneda) ⟨i⟩

{C : Type u₁}
[CategoryTheory.Category.{u₂, u₁} C]
{I : Type v₁}
[CategoryTheory.Category.{v₂, v₁} I]
(F : CategoryTheory.Functor I C)
[CategoryTheory.Limits.HasColimit F]
(i : I)

CategoryTheory.CategoryStruct.comp (CategoryTheory.Limits.coyonedaOpColimitIsoLimitCoyoneda F).inv
    (CategoryTheory.coyoneda.map (CategoryTheory.Limits.colimit.ι F i).op) =
  CategoryTheory.Limits.limit.π (F.op.comp CategoryTheory.coyoneda) (Opposite.op i)


@[simp]
protected theorem sup_apply {C : β → Type*} [∀ b : β, SemilatticeSup (C b)]
    [∀ b : β, OrderBot (C b)] (s : Finset α) (f : α → ∀ b : β, C b) (b : β) :
    s.sup f b = s.sup fun a => f a b

{α : Type u_2}
{β : Type u_3}
{C : β → Type u_7}
[(b : β) → SemilatticeSup (C b)]
[(b : β) → OrderBot (C b)]
(s : Finset α)
(f : α → (b : β) → C b)
(b : β)


theorem findMin'_all {P : α → Prop} : ∀ (t) (x : α), All P t → P x → P (findMin' t x)

{α : Type u_1}
{P : α → Prop}
(t : Ordnode α)
(x : α)

Ordnode.All P t → P x → P (t.findMin' x)


@[to_additive]
theorem Submonoid.coe_topologicalClosure (s : Submonoid M) :
    (s.topologicalClosure : Set M) = _root_.closure (s : Set M)

{M : Type u_3}
[TopologicalSpace M]
[AddMonoid M]
[ContinuousAdd M]
(s : AddSubmonoid M)


lemma exists_unique_section (hx : x.IsCompatible) (hY : J.CoversTop Y) (hF : IsSheaf J F) :
    ∃! (s : F.sections), ∀ (i : I), s.1 (Opposite.op (Y i)) = x i

{J : CategoryTheory.GrothendieckTopology C}

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

{x : CategoryTheory.Presheaf.FamilyOfElementsOnObjects F Y}

(hF : CategoryTheory.Presheaf.IsSheaf J F)

∃! s, ∀ (i : I), ↑s (Opposite.op (Y i)) = x i


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

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

((CategoryTheory.Limits.Cones.functoriality F G).obj A).π.app j = G.map (A.π.app j)


@[ext]
lemma Cotangent.ext {x y : P.Cotangent} (e : x.val = y.val) : x = y

{R : Type u}
{S : Type v}
[CommRing R]
[CommRing S]
[Algebra R S]
{P : Algebra.Generators R S}
{x y : P.Cotangent}
(e : x.val = y.val)


theorem IntegrableOn.congr_set_ae (h : IntegrableOn f t μ) (hst : s =ᵐ[μ] t) : IntegrableOn f s μ

{α : Type u_1}
{E : Type u_3}
[MeasurableSpace α]
[NormedAddCommGroup E]
{f : α → E}
{s t : Set α}
{μ : MeasureTheory.Measure α}
(h : MeasureTheory.IntegrableOn f t μ)
(hst : s =ᵐ[μ] t)


/-- Wrapper for adding elementary propositions to the type class systems.
Warning: this can easily be abused. See the rest of this docstring for details.

Certain propositions should not be treated as a class globally,
but sometimes it is very convenient to be able to use the type class system
in specific circumstances.

For example, `ZMod p` is a field if and only if `p` is a prime number.
In order to be able to find this field instance automatically by type class search,
we have to turn `p.prime` into an instance implicit assumption.

On the other hand, making `Nat.prime` a class would require a major refactoring of the library,
and it is questionable whether making `Nat.prime` a class is desirable at all.
The compromise is to add the assumption `[Fact p.prime]` to `ZMod.field`.

In particular, this class is not intended for turning the type class system
into an automated theorem prover for first order logic. -/
class Fact (p : Prop) : Prop where
  /-- `Fact.out` contains the unwrapped witness for the fact represented by the instance of
  `Fact p`. -/
  out : p


@[to_additive (attr := simp)]
lemma UniformOnFun.one_apply [One β] : ofFun 𝔖 (1 : α → β) = 1

{α : Type u_1}
{β : Type u_2}
{𝔖 : Set (Set α)}
[Zero β]


lemma MorphismProperty.top_eq : (⊤ : MorphismProperty C) = fun _ _ _ => True

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


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

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


theorem toZNum_inj {m n : Num} : m.toZNum = n.toZNum ↔ m = n


@[simp] lemma iInf_ulift {ι : Type*} [InfSet α] (f : ULift ι → α) :
    ⨅ i : ULift ι, f i = ⨅ i, f (.up i)

{α : Type u_1}
{ι : Type u_9}
[InfSet α]
(f : ULift.{u_10, u_9} ι → α)


theorem comap_comp {W : Type*} [TopologicalSpace W] (f : C(W, X)) (g : C(X, Y)) :
    comap (Z := Z) (g.comp f) = comap f ∘ comap g

{X : Type u_1}
{Y : Type u_2}
{Z : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
{W : Type u_5}
[TopologicalSpace W]
(f : C(W, X))
(g : C(X, Y))

LocallyConstant.comap (g.comp f) = LocallyConstant.comap f ∘ LocallyConstant.comap g


lemma continuousOn_term (n : ℕ) :
    ContinuousOn (fun x ↦ term (n + 1) x) (Ici 1)

ContinuousOn (fun x => ZetaAsymptotics.term (n + 1) x) (Set.Ici 1)


theorem length_splitWrtCompositionAux (l : List α) (ns) :
    length (l.splitWrtCompositionAux ns) = ns.length

{α : Type u_1}
(l : List α)
(ns : List ℕ)

(l.splitWrtCompositionAux ns).length = ns.length


/-- The continuous homomorphism given by projection onto the second factor. -/
@[to_additive (attr := simps!)
  "The continuous homomorphism given by projection onto the second factor."]
def snd : ContinuousMonoidHom (A × B) B

(A : Type u_2)
(B : Type u_3)
[Monoid A]
[Monoid B]
[TopologicalSpace A]
[TopologicalSpace B]
(self : A × B)

(ContinuousMonoidHom.snd A B) self = self.2


@[simp]
theorem dickson_add_two (n : ℕ) :
    dickson k a (n + 2) = X * dickson k a (n + 1) - C a * dickson k a n

{R : Type u_1}
[CommRing R]
(k : ℕ)
(a : R)
(n : ℕ)

Polynomial.dickson k a (n + 2) =
  Polynomial.X * Polynomial.dickson k a (n + 1) - Polynomial.C a * Polynomial.dickson k a n


theorem replicate_succ (a : α) (n) : replicate (n+1) a = a :: replicate n a

List.replicate (n + 1) a = a :: List.replicate n a


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


theorem val_add_le {n : ℕ} (a b : ZMod n) : (a + b).val ≤ a.val + b.val