@[to_additive] lemma pow_inv_comm (a : G) (m n : ℕ) : a⁻¹ ^ m * a ^ n = a ^ n * a⁻¹ ^ m

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


@[to_additive (attr := simp)]
theorem inv_iSup {ι : Sort*} (S : ι → Submonoid G) : (⨆ i, S i)⁻¹ = ⨆ i, (S i)⁻¹

{G : Type u_2}
[Group G]
{ι : Sort u_6}
(S : ι → Submonoid G)


@[simp]
theorem equivCongr_refl : equivCongr AlgEquiv.refl AlgEquiv.refl = Equiv.refl (A₁ ≃ₐ[R] A₁')

{R : Type uR}
{A₁ : Type uA₁}
{A₁' : Type uA₁'}
[CommSemiring R]
[Semiring A₁]
[Semiring A₁']
[Algebra R A₁]
[Algebra R A₁']

AlgEquiv.refl.equivCongr AlgEquiv.refl = Equiv.refl (A₁ ≃ₐ[R] A₁')


lemma Odd.pow_add_pow_eq_zero [IsCancelAdd α] (hn : Odd n) (hab : a + b = 0) :
    a ^ n + b ^ n = 0

{α : Type u_2}
[Semiring α]
{a b : α}
{n : ℕ}
[IsCancelAdd α]
(hn : Odd n)
(hab : a + b = 0)


/-- If `I` is an additive monoid and `c : ComplexShape I`, `c.TensorSigns` contains the data of
map `ε : I → ℤˣ` and properties which allows the construction of a `TotalComplexShape c c c`. -/
class TensorSigns where
  /-- the signs which appear in the vertical differential of the total complex -/
  ε' : Multiplicative I →* ℤˣ
  rel_add (p q r : I) (hpq : c.Rel p q) : c.Rel (p + r) (q + r)
  add_rel (p q r : I) (hpq : c.Rel p q) : c.Rel (r + p) (r + q)
  ε'_succ (p q : I) (hpq : c.Rel p q) : ε' q = - ε' p

{I : Type u_4}
[AddMonoid I]
{c : ComplexShape I}
[self : c.TensorSigns]
(p q r : I)
(hpq : c.Rel p q)


/-- If `minimals r s` is included in but *shadows* the antichain `t`, then it is actually
equal to `t`. -/
theorem IsAntichain.max_minimals (ht : IsAntichain r t) (h : minimals r s ⊆ t)
    (hs : ∀ ⦃a⦄, a ∈ t → ∃ b ∈ minimals r s, r a b) : minimals r s = t

(hs : ∀ ⦃a : α⦄, a ∈ t → ∃ b ∈ minimals r s, r a b)


@[simp]
lemma re_eq_abs {z : ℂ} : z.re = abs z ↔ 0 ≤ z


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

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

TendstoUniformlyOn F f p s ↔ ∀ u ∈ 𝓝 0, ∀ᶠ (i : ι) in p, ∀ a ∈ s, F i a - f a ∈ u


theorem nhds_basis_Icc_pos [NoMaxOrder α] [DenselyOrdered α] (a : α) :
    (𝓝 a).HasBasis ((0 : α) < ·) fun ε ↦ Icc (a - ε) (a + ε)

{α : Type u_1}
[TopologicalSpace α]
[LinearOrderedAddCommGroup α]
[OrderTopology α]
[NoMaxOrder α]
[DenselyOrdered α]
(a : α)

(𝓝 a).HasBasis (fun x => 0 < x) fun ε => Set.Icc (a - ε) (a + ε)


theorem neg_neg_iff (x y : R) : IsRelPrime (-x) (-y) ↔ IsRelPrime x y


lemma injOn_genEigenspace [NoZeroSMulDivisors R M] (f : End R M) :
    InjOn (⨆ k, f.genEigenspace · k) {μ | ⨆ k, f.genEigenspace μ k ≠ ⊥}

{R : Type v}
{M : Type w}
[CommRing R]
[AddCommGroup M]
[Module R M]
[NoZeroSMulDivisors R M]
(f : Module.End R M)

Set.InjOn (fun x => ⨆ k, (f.genEigenspace x) k) {μ | ⨆ k, (f.genEigenspace μ) k ≠ ⊥}


/-- In a noetherian ring, every ideal contains a product of prime ideals
([samuel, § 3.3, Lemma 3])-/
theorem exists_primeSpectrum_prod_le (I : Ideal R) :
    ∃ Z : Multiset (PrimeSpectrum R), Multiset.prod (Z.map asIdeal) ≤ I

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

∃ Z, (Multiset.map PrimeSpectrum.asIdeal Z).prod ≤ I


theorem card_le_one_iff_subset_singleton [Nonempty α] : s.card ≤ 1 ↔ ∃ x : α, s ⊆ {x}

{α : Type u_1}
{s : Finset α}
[Nonempty α]


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

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

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


theorem insert_sdiff_of_not_mem (s : Finset α) {t : Finset α} {x : α} (h : x ∉ t) :
    insert x s \ t = insert x (s \ t)

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


theorem norm_deriv_le_aux [CompleteSpace F] {c : ℂ} {R C : ℝ} {f : ℂ → F} (hR : 0 < R)
    (hf : DiffContOnCl ℂ f (ball c R)) (hC : ∀ z ∈ sphere c R, ‖f z‖ ≤ C) :
    ‖deriv f c‖ ≤ C / R

(hf : DiffContOnCl ℂ f (Metric.ball c R))

(hC : ∀ z ∈ Metric.sphere c R, ‖f z‖ ≤ C)


theorem toLin_restrict_range_dualCoannihilator_eq_orthogonal (B : BilinForm K V)
    (W : Subspace K V) : (B.domRestrict W).range.dualCoannihilator = B.orthogonal W

{V : Type u_5}
{K : Type u_6}
[Field K]
[AddCommGroup V]
[Module K V]
(B : LinearMap.BilinForm K V)
(W : Subspace K V)

(LinearMap.range (LinearMap.domRestrict B W)).dualCoannihilator = B.orthogonal W


theorem convexOn_Gamma : ConvexOn ℝ (Ioi 0) Gamma


theorem mem_inter_of_mem {a : α} {s₁ s₂ : Finset α} : a ∈ s₁ → a ∈ s₂ → a ∈ s₁ ∩ s₂

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

a ∈ s₁ → a ∈ s₂ → a ∈ s₁ ∩ s₂


@[simp]
theorem tensor_v {X Y : Action V G} : (X ⊗ Y).V = X.V ⊗ Y.V

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

(CategoryTheory.MonoidalCategory.tensorObj X Y).V = CategoryTheory.MonoidalCategory.tensorObj X.V Y.V


theorem SplitMono.mono {X Y : C} {f : X ⟶ Y} (sm : SplitMono f) : Mono f

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


@[simp]
theorem toSchemeHom_val : (toSchemeHom Y f).val = f

{X : AlgebraicGeometry.PresheafedSpace CommRingCat}

[H : AlgebraicGeometry.PresheafedSpace.IsOpenImmersion f]

(AlgebraicGeometry.PresheafedSpace.IsOpenImmersion.toSchemeHom Y f).val = f


theorem c_mul_im_sq_le_normSq_denom (z : ℍ) (g : SL(2, ℝ)) :
    ((↑ₘg 1 0 : ℝ) * z.im) ^ 2 ≤ Complex.normSq (denom g z)

(↑↑(Matrix.SpecialLinearGroup.toGLPos g) 1 0 * z.im) ^ 2 ≤
  Complex.normSq (UpperHalfPlane.denom (Matrix.SpecialLinearGroup.toGLPos g) z)


@[simp] lemma log_le_log_iff {x y : ℝ≥0∞} : log x ≤ log y ↔ x ≤ y


@[simp]
theorem default_eq_empty : (default : Finpartition (⊥ : α)) = Finpartition.empty α


protected lemma Commute.pow_eq_pow_iff_of_coprime (hab : Commute a b) (hmn : m.Coprime n) :
    a ^ m = b ^ n ↔ ∃ c, a = c ^ n ∧ b = c ^ m

{α : Type u_1}
[GroupWithZero α]
{a b : α}
{m n : ℕ}
(hab : Commute a b)
(hmn : m.Coprime n)


lemma filter_sups_le [@DecidableRel α (· ≤ ·)] (s t : Finset α) (a : α) :
    (s ⊻ t).filter (· ≤ a) = s.filter (· ≤ a) ⊻ t.filter (· ≤ a)

{α : Type u_2}
[DecidableEq α]
[SemilatticeSup α]
[DecidableRel fun x x_1 => x ≤ x_1]
(s t : Finset α)
(a : α)

Finset.filter (fun x => x ≤ a) (s ⊻ t) = Finset.filter (fun x => x ≤ a) s ⊻ Finset.filter (fun x => x ≤ a) t


theorem den_smul_val (f : HomogeneousLocalization 𝒜 x) :
    f.den • f.val = algebraMap _ _ f.num

{ι : Type u_1}
{R : Type u_2}
{A : Type u_3}
[CommRing R]
[CommRing A]
[Algebra R A]
{𝒜 : ι → Submodule R A}
{x : Submonoid A}
(f : HomogeneousLocalization 𝒜 x)

f.den • f.val = (algebraMap A (at x)) f.num


@[simp]
theorem compMultilinearMap_domDomCongr (σ : ι₁ ≃ ι₂) (g : M₂ →ₗ[R] M₃)
    (f : MultilinearMap R (fun _ : ι₁ => M') M₂) :
    (g.compMultilinearMap f).domDomCongr σ = g.compMultilinearMap (f.domDomCongr σ)

{R : Type uR}
{M₂ : Type v₂}
{M₃ : Type v₃}
{M' : Type v'}
[Semiring R]
[AddCommMonoid M₂]
[AddCommMonoid M₃]
[AddCommMonoid M']
[Module R M₂]
[Module R M₃]
[Module R M']
{ι₁ : Type u_1}
{ι₂ : Type u_2}
(σ : ι₁ ≃ ι₂)
(g : M₂ →ₗ[R] M₃)
(f : MultilinearMap R (fun x => M') M₂)

MultilinearMap.domDomCongr σ (g.compMultilinearMap f) = g.compMultilinearMap (MultilinearMap.domDomCongr σ f)


theorem adjoin_toSubmodule_le {s : Set A} {t : Submodule R A} :
    Subalgebra.toSubmodule (adjoin R s) ≤ t ↔ ↑(Submonoid.closure s) ⊆ (t : Set A)

(R : Type uR)
{A : Type uA}
[CommSemiring R]
[Semiring A]
[Algebra R A]
{s : Set A}
{t : Submodule R A}

Subalgebra.toSubmodule (Algebra.adjoin R s) ≤ t ↔ ↑(Submonoid.closure s) ⊆ ↑t


lemma pullbackMk_surjective (x : (forget C).obj (pullback f₁ f₂)) :
    ∃ (x₁ : X₁) (x₂ : X₂) (h : f₁ x₁ = f₂ x₂), x = pullbackMk f₁ f₂ x₁ x₂ h

[CategoryTheory.Limits.PreservesLimit (CategoryTheory.Limits.cospan f₁ f₂) (CategoryTheory.forget C)]

(x : (CategoryTheory.forget C).obj (CategoryTheory.Limits.pullback f₁ f₂))

∃ x₁ x₂, ∃ (h : f₁ x₁ = f₂ x₂), x = CategoryTheory.Limits.Concrete.pullbackMk f₁ f₂ x₁ x₂ h


@[simp] theorem reverse_setRed {t : RBNode α} : (setRed t).reverse = setRed t.reverse


@[simp]
theorem trace_list_sum (l : List (Matrix n n R)) : trace l.sum = (l.map trace).sum

{n : Type u_3}
{R : Type u_6}
[Fintype n]
[AddCommMonoid R]
(l : List (Matrix n n R))

l.sum.trace = (List.map Matrix.trace l).sum


theorem Ici_mem_atTop [Preorder α] (a : α) : Ici a ∈ (atTop : Filter α)


theorem eventually_countable_forall [Countable ι] {p : α → ι → Prop} :
    (∀ᶠ x in l, ∀ i, p x i) ↔ ∀ i, ∀ᶠ x in l, p x i

{ι : Sort u_1}
{α : Type u_2}
{l : Filter α}
[CountableInterFilter l]
[Countable ι]
{p : α → ι → Prop}

(∀ᶠ (x : α) in l, ∀ (i : ι), p x i) ↔ ∀ (i : ι), ∀ᶠ (x : α) in l, p x i


theorem iteratedFDerivWithin_eventually_congr_set (h : s =ᶠ[𝓝 x] t) (n : ℕ) :
    iteratedFDerivWithin 𝕜 n f s =ᶠ[𝓝 x] iteratedFDerivWithin 𝕜 n f t

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{s t : Set E}
{f : E → F}
{x : E}
(h : s =ᶠ[𝓝 x] t)
(n : ℕ)


@[to_additive (attr := simp)]
theorem freeGroupCongr_refl : freeGroupCongr (Equiv.refl α) = MulEquiv.refl _

FreeGroup.freeGroupCongr (Equiv.refl α) = MulEquiv.refl (FreeGroup α)


/-- `AddChar A M` is the type of maps `A → M`, for `A` an additive monoid and `M` a multiplicative
monoid, which intertwine addition in `A` with multiplication in `M`.

We only put the typeclasses needed for the definition, although in practice we are usually
interested in much more specific cases (e.g. when `A` is a group and `M` a commutative ring).
 -/
structure AddChar where
  /-- The underlying function.

  Do not use this function directly. Instead use the coercion coming from the `FunLike`
  instance. -/
  toFun : A → M
  /-- The function maps `0` to `1`.

  Do not use this directly. Instead use `AddChar.map_zero_eq_one`. -/
  map_zero_eq_one' : toFun 0 = 1
  /-- The function maps addition in `A` to multiplication in `M`.

  Do not use this directly. Instead use `AddChar.map_add_eq_mul`. -/
  map_add_eq_mul' : ∀ a b : A, toFun (a + b) = toFun a * toFun b

{A : Type u_1}
[AddMonoid A]
{M : Type u_2}
[Monoid M]
(self : AddChar A M)
(a b : A)

self.toFun (a + b) = self.toFun a * self.toFun b


@[simp]
lemma comap_mk (φ : K →+* ℂ) (f : k →+* K) : (mk φ).comap f = mk (φ.comp f)

{k : Type u_1}
[Field k]
{K : Type u_2}
[Field K]
(φ : K →+* ℂ)
(f : k →+* K)

(NumberField.InfinitePlace.mk φ).comap f = NumberField.InfinitePlace.mk (φ.comp f)


theorem disjoint_ker' {p : Submodule R M} :
    Disjoint p (ker f) ↔ ∀ x ∈ p, ∀ y ∈ p, f x = f y → x = y

{R : Type u_1}
{R₂ : Type u_3}
{M : Type u_6}
{M₂ : Type u_8}
[Ring R]
[Ring R₂]
[AddCommGroup M]
[AddCommGroup M₂]
[Module R M]
[Module R₂ M₂]
{τ₁₂ : R →+* R₂}
{F : Type u_12}
[FunLike F M M₂]
[SemilinearMapClass F τ₁₂ M M₂]
{f : F}
{p : Submodule R M}

Disjoint p (LinearMap.ker f) ↔ ∀ x ∈ p, ∀ y ∈ p, f x = f y → x = y


@[simp, mfld_simps]
theorem localTriv_coordChange_eq {b : B} (hb : b ∈ Z.baseSet i ∩ Z.baseSet j) (v : F) :
    (Z.localTriv i).coordChangeL R (Z.localTriv j) b v = Z.coordChange i j b v

{R : Type u_1}
{B : Type u_2}
{F : Type u_3}
[NontriviallyNormedField R]
[NormedAddCommGroup F]
[NormedSpace R F]
[TopologicalSpace B]
{ι : Type u_5}
(Z : VectorBundleCore R B F ι)
(i j : ι)
{b : B}
(hb : b ∈ Z.baseSet i ∩ Z.baseSet j)
(v : F)

(Trivialization.coordChangeL R (Z.localTriv i) (Z.localTriv j) b) v = (Z.coordChange i j b) v


@[simps id comp]
instance Pseudofunctor.categoryStruct : CategoryStruct (Pseudofunctor B C)

(B : Type u₁)
[CategoryTheory.Bicategory B]
(C : Type u₂)
[CategoryTheory.Bicategory C]

∀ {X Y Z : CategoryTheory.Pseudofunctor B C} (η : CategoryTheory.StrongOplaxNatTrans X.toOplax Y.toOplax)
  (θ : CategoryTheory.StrongOplaxNatTrans Y.toOplax Z.toOplax), CategoryTheory.CategoryStruct.comp η θ = η.vcomp θ


theorem mellin_eq_fourierIntegral (f : ℝ → E) {s : ℂ} :
    mellin f s = 𝓕 (fun (u : ℝ) ↦ (Real.exp (-s.re * u) • f (Real.exp (-u)))) (s.im / (2 * π))

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
(f : ℝ → E)
{s : ℂ}

mellin f s = 𝓕 (fun u => rexp (-s.re * u) • f (rexp (-u))) (s.im / (2 * π))


@[simp]
theorem map_le_restrict_range {β} {ma : OuterMeasure α} {mb : OuterMeasure β} {f : α → β} :
    map f ma ≤ restrict (range f) mb ↔ map f ma ≤ mb

{α : Type u_1}
{β : Type u_3}
{ma : MeasureTheory.OuterMeasure α}
{mb : MeasureTheory.OuterMeasure β}
{f : α → β}

(MeasureTheory.OuterMeasure.map f) ma ≤ (MeasureTheory.OuterMeasure.restrict (Set.range f)) mb ↔
  (MeasureTheory.OuterMeasure.map f) ma ≤ mb


/-- The quotient norm satisfies the triangle inequality. -/
theorem quotient_norm_add_le (S : AddSubgroup M) (x y : M ⧸ S) : ‖x + y‖ ≤ ‖x‖ + ‖y‖

{M : Type u_1}
[SeminormedAddCommGroup M]
(S : AddSubgroup M)
(x y : M ⧸ S)

‖x + y‖ ≤ ‖x‖ + ‖y‖


theorem rescale_mul (a b : R) : rescale (a * b) = (rescale b).comp (rescale a)

{R : Type u_1}
[CommSemiring R]
(a b : R)

PowerSeries.rescale (a * b) = (PowerSeries.rescale b).comp (PowerSeries.rescale a)


/-- If the map `S ⟶ T` is mono, then there is a description of the image of `W ×ₛ X ⟶ Y ×ₜ Z`. -/
theorem range_pullback_map {W X Y Z S T : TopCat} (f₁ : W ⟶ S) (f₂ : X ⟶ S) (g₁ : Y ⟶ T)
    (g₂ : Z ⟶ T) (i₁ : W ⟶ Y) (i₂ : X ⟶ Z) (i₃ : S ⟶ T) [H₃ : Mono i₃] (eq₁ : f₁ ≫ i₃ = i₁ ≫ g₁)
    (eq₂ : f₂ ≫ i₃ = i₂ ≫ g₂) :
    Set.range (pullback.map f₁ f₂ g₁ g₂ i₁ i₂ i₃ eq₁ eq₂) =
      (pullback.fst g₁ g₂) ⁻¹' Set.range i₁ ∩ (pullback.snd g₁ g₂) ⁻¹' Set.range i₂

{W X Y Z S T : TopCat}
(f₁ : W ⟶ S)
(f₂ : X ⟶ S)
(g₁ : Y ⟶ T)
(g₂ : Z ⟶ T)
(i₁ : W ⟶ Y)
(i₂ : X ⟶ Z)
(i₃ : S ⟶ T)
[H₃ : CategoryTheory.Mono i₃]
(eq₁ : f₁ ≫ i₃ = i₁ ≫ g₁)
(eq₂ : f₂ ≫ i₃ = i₂ ≫ g₂)

Set.range ⇑(CategoryTheory.Limits.pullback.map f₁ f₂ g₁ g₂ i₁ i₂ i₃ eq₁ eq₂) =
  ⇑(CategoryTheory.Limits.pullback.fst g₁ g₂) ⁻¹' Set.range ⇑i₁ ∩
    ⇑(CategoryTheory.Limits.pullback.snd g₁ g₂) ⁻¹' Set.range ⇑i₂


@[simp] lemma slope_neg_fun (f : k → E) : slope (-f) = -slope f

{k : Type u_1}
{E : Type u_2}
[Field k]
[AddCommGroup E]
[Module k E]
(f : k → E)


/-- If `x` and `y` are on the same ray as `z`, then so is `x + y`. -/
theorem add_left (hx : SameRay R x z) (hy : SameRay R y z) : SameRay R (x + y) z

{R : Type u_1}
[StrictOrderedCommSemiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
{x y z : M}
(hx : SameRay R x z)
(hy : SameRay R y z)


theorem exists_linearIndependent :
    ∃ b ⊆ t, span K b = span K t ∧ LinearIndependent K ((↑) : b → V)

(K : Type u_3)
{V : Type u}
[DivisionRing K]
[AddCommGroup V]
[Module K V]
(t : Set V)

∃ b ⊆ t, Submodule.span K b = Submodule.span K t ∧ LinearIndependent (ι := { x // x ∈ b }) K Subtype.val


/-- Variant of `lt_mul_of_lt_one_right` for `a` negative instead of positive. -/
theorem mul_lt_of_one_lt_right [ExistsAddOfLE α] [PosMulStrictMono α]
    [CovariantClass α α (swap (· + ·)) (· < ·)] [ContravariantClass α α (swap (· + ·)) (· < ·)]
    (ha : a < 0) (h : 1 < b) : a * b < a

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

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


lemma deriv_mul_log {x : ℝ} (hx : x ≠ 0) : deriv (fun x ↦ x * log x) x = log x + 1

deriv (fun x => x * Real.log x) x = Real.log x + 1


@[simp]
lemma singleton_biUnion {a : α} : Finset.biUnion {a} t = t a

{α : Type u_1}
{β : Type u_2}
{t : α → Finset β}
[DecidableEq β]
{a : α}


@[to_additive]
theorem card_le_card_mul_left {s : Finset α} (hs : s.Nonempty) : t.card ≤ (s * t).card

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


lemma cauchy_iff_le {l : Filter α} [hl : l.NeBot] :
    Cauchy l ↔ l ×ˢ l ≤ 𝓤 α

{α : Type u}
[uniformSpace : UniformSpace α]
{l : Filter α}
[hl : l.NeBot]


@[simp]
theorem self_act_act_eq {x y : R} : (x ◃ x) ◃ y = x ◃ y


theorem mul_submatrix_one [Fintype n] [Finite o] [NonAssocSemiring α] [DecidableEq o] (e₁ : n ≃ o)
    (e₂ : l → o) (M : Matrix m n α) :
    M * (1 : Matrix o o α).submatrix e₁ e₂ = submatrix M id (e₁.symm ∘ e₂)

{l : Type u_1}
{m : Type u_2}
{n : Type u_3}
{o : Type u_4}
{α : Type v}
[Fintype n]
[Finite o]
[NonAssocSemiring α]
[DecidableEq o]
(e₁ : n ≃ o)
(e₂ : l → o)
(M : Matrix m n α)

M * Matrix.submatrix 1 (⇑e₁) e₂ = M.submatrix id (⇑e₁.symm ∘ e₂)


protected theorem cmpLT.flip (h₁ : cmpLT cmp x y) : cmpLT (flip cmp) y x

∀ {α : Sort u_1} {cmp : α → α → Ordering} {x y : α},
  Batteries.RBNode.cmpLT cmp x y → Batteries.RBNode.cmpLT (flip cmp) y x


/-- If both `a` and `b` commute with `c`, then their product commutes with `c`. -/
@[to_additive (attr := simp)
"If both `a` and `b` commute with `c`, then their product commutes with `c`."]
theorem mul_left (hac : Commute a c) (hbc : Commute b c) : Commute (a * b) c

{S : Type u_3}
[AddSemigroup S]
{a b c : S}
(hac : AddCommute a c)
(hbc : AddCommute b c)


@[simp]
theorem count_zero (a : α) : count a 0 = 0


/-- To get commutativity, we need the underlying multiplication to be commutative. -/
@[to_additive conv_comm]
theorem mconv_comm {M : Type*} [CommMonoid M] [MeasurableSpace M] [MeasurableMul₂ M] (μ : Measure M)
    (ν : Measure M) [SFinite μ] [SFinite ν] : μ ∗ ν = ν ∗ μ

{M : Type u_2}
[CommMonoid M]
[MeasurableSpace M]
[MeasurableMul₂ M]
(μ ν : MeasureTheory.Measure M)
[MeasureTheory.SFinite μ]
[MeasureTheory.SFinite ν]


theorem degree_C_ite [DecidableEq R] (a : R) : (C a).degree = if a = 0 then ⊥ else 0

{R : Type u_1}
[Semiring R]
[DecidableEq R]
(a : R)

(LaurentPolynomial.C a).degree = if a = 0 then ⊥ else 0


theorem hasFDerivWithinAt_iff_hasGradientWithinAt {frechet : F →L[𝕜] 𝕜} {s : Set F} :
    HasFDerivWithinAt f frechet s x ↔ HasGradientWithinAt f ((toDual 𝕜 F).symm frechet) s x

{𝕜 : Type u_1}
{F : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup F]
[InnerProductSpace 𝕜 F]
[CompleteSpace F]
{f : F → 𝕜}
{x : F}
{frechet : F →L[𝕜] 𝕜}
{s : Set F}

HasFDerivWithinAt f frechet s x ↔ HasGradientWithinAt f ((InnerProductSpace.toDual 𝕜 F).symm frechet) s x


@[simp]
lemma repr_map (f : Hom P P') (i j) :
    P'.cotangentSpaceBasis.repr (CotangentSpace.map f (P.cotangentSpaceBasis i)) j =
      aeval P'.val (pderiv j (f.val i))

{R : Type u}
{S : Type v}
[CommRing R]
[CommRing S]
[Algebra R S]
{P : Algebra.Generators R S}
{R' : Type u'}
{S' : Type v'}
[CommRing R']
[CommRing S']
[Algebra R' S']
{P' : Algebra.Generators R' S'}
[Algebra R R']
[Algebra S S']
[Algebra R S']
[IsScalarTower R R' S']
[IsScalarTower R S S']
(f : P.Hom P')
(i : P.vars)
(j : P'.vars)

(P'.cotangentSpaceBasis.repr ((Algebra.Generators.CotangentSpace.map f) (P.cotangentSpaceBasis i))) j =
  (MvPolynomial.aeval P'.val) ((MvPolynomial.pderiv j) (f.val i))


/-- The coproduct comparison morphism from `FA ⨿ F-` to `F(A ⨿ -)`, whose components are given by
`coprodComparison`.
-/
@[simps]
def coprodComparisonNatTrans [HasBinaryCoproducts C] [HasBinaryCoproducts D] (F : C ⥤ D) (A : C) :
    F ⋙ coprod.functor.obj (F.obj A) ⟶ coprod.functor.obj A ⋙ F

(CategoryTheory.Limits.coprodComparisonNatTrans F A).app B = CategoryTheory.Limits.coprodComparison F A B


theorem map_reverse_inits (l : List α) : map reverse l.inits = (reverse <| tails <| reverse l)

List.map List.reverse l.inits = l.reverse.tails.reverse


lemma Functor.reflects_preregular : Preregular C


lemma coe_rangeIcc (f g : ι →₀ α) : rangeIcc f g i = Icc (f i) (g i)

{ι : Type u_1}
{α : Type u_2}
[Zero α]
[PartialOrder α]
[LocallyFiniteOrder α]
{i : ι}
(f g : ι →₀ α)

(f.rangeIcc g) i = Finset.Icc (f i) (g i)


@[to_additive (attr := simp)]
lemma Subgroup.units_ofUnits_eq (S : Subgroup Mˣ) : S.ofUnits.units = S

{M : Type u_1}
[AddMonoid M]
(S : AddSubgroup (AddUnits M))


/-- A sequential space is compactly generated. -/
theorem compactlyGenerated_of_sequentialSpace [T2Space X] [SequentialSpace X] {s : Set X} :
    IsClosed s ↔ ∀ ⦃K⦄, IsCompact K → IsClosed (s ∩ K)

{X : Type u_1}
[TopologicalSpace X]
[T2Space X]
[SequentialSpace X]
{s : Set X}

IsClosed s ↔ ∀ ⦃K : Set X⦄, IsCompact K → IsClosed (s ∩ K)


/-- The tautological 1-pre-hypercover induced by `S : J.Cover X`. Its index type `I₀`
is given by `S.Arrow` (i.e. all the morphisms in the sieve `S`), while `I₁` is given
by all possible pullback cones. -/
@[simps]
def preOneHypercover : PreOneHypercover.{max u v} X

{J : CategoryTheory.GrothendieckTopology C}

∀ (x x_1 : S.Arrow) (r : x.Relation x_1), S.preOneHypercover.p₂ r = r.g₂


@[simp]
theorem closedBall_top (x : α) : closedBall x ∞ = univ

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


theorem card_interedges_div_card (s t : Finset α) :
    ((G.interedges s t).card : ℚ) / (s.card * t.card) = G.edgeDensity s t

{α : Type u_4}
(G : SimpleGraph α)
[DecidableRel G.Adj]
(s t : Finset α)

↑(G.interedges s t).card / (↑s.card * ↑t.card) = G.edgeDensity s t


theorem closure_iSup₂_closure (f : ∀ i, κ i → α) :
    u (l <| ⨆ (i) (j), u (l <| f i j)) = u (l <| ⨆ (i) (j), f i j)

{α : Type u_1}
{ι : Sort u_2}
{κ : ι → Sort u_3}
{β : Type u_4}
[CompleteLattice α]
[Preorder β]
{u : β → α}
(l : LowerAdjoint u)
(f : (i : ι) → κ i → α)

u (l.toFun (⨆ i, ⨆ j, u (l.toFun (f i j)))) = u (l.toFun (⨆ i, ⨆ j, f i j))


theorem mem_append_eq (a : α) (s t : List α) : (a ∈ s ++ t) = (a ∈ s ∨ a ∈ t)


lemma essSup_restrict_eq_of_support_subset {s : Set α} {f : α → ℝ≥0∞} (hsf : f.support ⊆ s) :
    essSup f (μ.restrict s) = essSup f μ

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s : Set α}
{f : α → ℝ≥0∞}
(hsf : Function.support f ⊆ s)


theorem linearMapAt_symmₗ (e : Trivialization F (π F E)) [e.IsLinear R] {b : B} (hb : b ∈ e.baseSet)
    (y : F) : e.linearMapAt R b (e.symmₗ R b y) = y

[TopologicalSpace (Bundle.TotalSpace F E)]

(e : Trivialization F Bundle.TotalSpace.proj)

(Trivialization.linearMapAt R e b) ((Trivialization.symmₗ R e b) y) = y


theorem map_sub_eq_of_lt_left {x y : R} (hx : v x < v y) :
    v (x - y) = v x

{R : Type u_3}
{Γ₀ : Type u_4}
[LinearOrderedAddCommGroupWithTop Γ₀]
[Ring R]
(v : AddValuation R Γ₀)
{x y : R}
(hx : v x < v y)


@[simp]
theorem pathComponentIn_univ (x : X) : pathComponentIn x univ = pathComponent x

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

pathComponentIn x Set.univ = pathComponent x


/-- Given an algebra morphism whose carrier part is an epimorphism, we get an algebra epimorphism.
-/
theorem algebra_epi_of_epi {X Y : Algebra T} (f : X ⟶ Y) [h : Epi f.f] : Epi f

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
(T : CategoryTheory.Monad C)
{X Y : T.Algebra}
(f : X ⟶ Y)
[h : CategoryTheory.Epi f.f]


protected theorem algebraMap_mem (r : R) : algebraMap R A r ∈ S

{R : Type u}
{A : Type v}
[CommSemiring R]
[Semiring A]
[Algebra R A]
(S : Subalgebra R A)
(r : R)


/-- In a topological vector space over a nontrivially normed field, any neighborhood of a point has
the same cardinality as the whole space. -/
theorem cardinal_eq_of_mem_nhds
    {E : Type*} (𝕜 : Type*) [NontriviallyNormedField 𝕜] [AddCommGroup E] [Module 𝕜 E]
    [TopologicalSpace E] [ContinuousAdd E] [ContinuousSMul 𝕜 E]
    {s : Set E} {x : E} (hs : s ∈ 𝓝 x) : #s = #E

{E : Type u_1}
(𝕜 : Type u_2)
[NontriviallyNormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[TopologicalSpace E]
[ContinuousAdd E]
[ContinuousSMul 𝕜 E]
{s : Set E}
{x : E}
(hs : s ∈ 𝓝 x)


{R : Type u}
{A : Type v}
[CommRing R]
[Ring A]
[Algebra R A]
(a : A)


/-- The relation between `χ₄`, `χ₈` and `χ₈'` -/
theorem χ₈'_eq_χ₄_mul_χ₈ : ∀ a : ZMod 8, χ₈' a = χ₄ (cast a) * χ₈ a


@[simp]
theorem norm_zero : ‖(0 : lp E p)‖ = 0

{α : Type u_1}
{E : α → Type u_2}
{p : ℝ≥0∞}
[(i : α) → NormedAddCommGroup (E i)]


theorem iInf_span_singleton_natCast {R : Type*} [CommRing R] {ι : Type*} [Fintype ι]
    {I : ι → ℕ} (hI : Pairwise fun i j => (I i).Coprime (I j)) :
    ⨅ (i : ι), span {(I i : R)} = span {((∏ i : ι, I i : ℕ) : R)}

⨅ i, Ideal.span {↑(I i)} = Ideal.span {↑(∏ i : ι, I i)}


/-- A subgraph is connected if it is connected when coerced to be a simple graph.

Note: This is a structure to make it so one can be precise about how dot notation resolves. -/
protected structure Connected (H : G.Subgraph) : Prop where
  protected coe : H.coe.Connected

{V : Type u}
{G : SimpleGraph V}
{H : G.Subgraph}
(self : H.Connected)


theorem iterateFrobenius_mul_apply :
    iterateFrobenius R p (m * n) x = (iterateFrobenius R p m)^[n] x

(R : Type u)
[CommSemiring R]
(p m n : ℕ)
[ExpChar R p]
(x : R)

(iterateFrobenius R p (m * n)) x = (⇑(iterateFrobenius R p m))^[n] x


theorem fourierCoeff.const_smul (f : AddCircle T → E) (c : ℂ) (n : ℤ) :
    fourierCoeff (c • f :) n = c • fourierCoeff f n

{T : ℝ}
[hT : Fact (0 < T)]
{E : Type}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
(f : AddCircle T → E)
(c : ℂ)
(n : ℤ)

fourierCoeff (c • f) n = c • fourierCoeff f n


theorem enumerate_mem (h_sel : ∀ s a, sel s = some a → a ∈ s) :
    ∀ {s n a}, enumerate sel s n = some a → a ∈ s

(h_sel : ∀ (s : Set α) (a : α), sel s = some a → a ∈ s)


@[to_additive]
theorem finprod_mem_inter_mulSupport_eq (f : α → M) (s t : Set α)
    (h : s ∩ mulSupport f = t ∩ mulSupport f) : ∏ᶠ i ∈ s, f i = ∏ᶠ i ∈ t, f i

(h : s ∩ Function.support f = t ∩ Function.support f)

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


theorem blocks_length : c.blocks.length = c.length


theorem rootMultiplicity_pos {p : R[X]} (hp : p ≠ 0) {x : R} :
    0 < rootMultiplicity x p ↔ IsRoot p x

{R : Type u}
[CommRing R]
{p : R[X]}
(hp : p ≠ 0)
{x : R}

0 < Polynomial.rootMultiplicity x p ↔ p.IsRoot x


@[simp]
theorem map₂_neBot_iff : (map₂ m f g).NeBot ↔ f.NeBot ∧ g.NeBot

{α : Type u_1}
{β : Type u_3}
{γ : Type u_5}
{m : α → β → γ}
{f : Filter α}
{g : Filter β}

(Filter.map₂ m f g).NeBot ↔ f.NeBot ∧ g.NeBot


protected theorem const (p : Prop) : NullMeasurableSet { _a : α | p } μ

{α : Type u_2}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
(p : Prop)

MeasureTheory.NullMeasurableSet {_a | p} μ


theorem ContDiffAt.exp {n} (hf : ContDiffAt ℝ n f x) : ContDiffAt ℝ n (fun x => Real.exp (f x)) x

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : E → ℝ}
{x : E}
{n : ℕ∞}
(hf : ContDiffAt ℝ n f x)


@[simp]
theorem Dart.edge_mk {p : V × V} (h : G.Adj p.1 p.2) : (Dart.mk p h).edge = Sym2.mk p

{V : Type u_1}
{G : SimpleGraph V}
{p : V × V}
(h : G.Adj p.1 p.2)

{ toProd := p, adj := h }.edge = Sym2.mk p


theorem IsMaxOn.add (hf : IsMaxOn f s a) (hg : IsMaxOn g s a) : IsMaxOn (fun x => f x + g x) s a

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


theorem map_mod (a : Fin n.succ → ℕ) : map d a % d = a 0 % d


/-- Two linearly equivalent vector spaces have the same dimension, a version with different
universes. -/
theorem LinearEquiv.lift_rank_eq (f : M ≃ₗ[R] M') :
    Cardinal.lift.{v'} (Module.rank R M) = Cardinal.lift.{v} (Module.rank R M')

{R : Type u}
{M : Type v}
{M' : Type v'}
[Ring R]
[AddCommGroup M]
[AddCommGroup M']
[Module R M]
[Module R M']
(f : M ≃ₗ[R] M')

Cardinal.lift.{v', v} (Module.rank R M) = Cardinal.lift.{v, v'} (Module.rank R M')


theorem vanishingIdeal_iUnion {ι : Sort*} (t : ι → Set (PrimeSpectrum R)) :
    vanishingIdeal (⋃ i, t i) = ⨅ i, vanishingIdeal (t i)

{R : Type u}
[CommSemiring R]
{ι : Sort u_1}
(t : ι → Set (PrimeSpectrum R))

PrimeSpectrum.vanishingIdeal (⋃ i, t i) = ⨅ i, PrimeSpectrum.vanishingIdeal (t i)


/-- The functor `(F ⋙ G, S) ⥤ (G, S)`. -/
@[simps!]
def pre (F : B ⥤ C) (G : C ⥤ D) (S : D) : CostructuredArrow (F ⋙ G) S ⥤ CostructuredArrow G S

(X : CategoryTheory.Comma (F.comp G) (CategoryTheory.Functor.fromPUnit S))

((CategoryTheory.CostructuredArrow.pre F G S).obj X).left = F.obj X.left


@[to_additive]
theorem mulSupport_update_eq_ite [DecidableEq α] [DecidableEq M] (f : α → M) (x : α) (y : M) :
    mulSupport (update f x y) = if y = 1 then mulSupport f \ {x} else insert x (mulSupport f)

{α : Type u_1}
{M : Type u_5}
[One M]
[DecidableEq α]
[DecidableEq M]
(f : α → M)
(x : α)
(y : M)

Function.mulSupport (Function.update f x y) =
  if y = 1 then Function.mulSupport f \ {x} else insert x (Function.mulSupport f)


theorem right_distrib (x y z : X q) : (x + y) * z = x * z + y * z


/-- In a linearly ordered additive commutative group with the order topology, if `f` tends to
`atTop` and `g` tends to `C` then `f + g` tends to `atTop`. -/
theorem Filter.Tendsto.atTop_add {C : α} (hf : Tendsto f l atTop) (hg : Tendsto g l (𝓝 C)) :
    Tendsto (fun x => f x + g x) l atTop

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[LinearOrderedAddCommGroup α]
[OrderTopology α]
{l : Filter β}
{f g : β → α}
{C : α}
(hf : Filter.Tendsto f l Filter.atTop)
(hg : Filter.Tendsto g l (𝓝 C))

Filter.Tendsto (fun x => f x + g x) l Filter.atTop


/--
An algebra homomorphism `f : A →ₐ[R] B` such that `f x` commutes with `f y` for all `x, y` defines
an algebra homomorphism from `Aᵐᵒᵖ`. -/
@[simps (config := .asFn)]
def fromOpposite (f : A →ₐ[R] B) (hf : ∀ x y, Commute (f x) (f y)) : Aᵐᵒᵖ →ₐ[R] B

{R : Type u_1}
{A : Type u_3}
{B : Type u_4}
[CommSemiring R]
[Semiring A]
[Semiring B]
[Algebra R A]
[Algebra R B]
(f : A →ₐ[R] B)
(hf : ∀ (x y : A), Commute (f x) (f y))

⇑(f.fromOpposite hf) = ⇑f ∘ MulOpposite.unop


lemma even_mul_pred_self (n : ℤ) : Even (n * (n - 1))


@[to_additive (attr := simp)]
theorem smul_def [SMul R M] (s : ULift R) (x : M) : s • x = s.down • x

{R : Type u}
{M : Type v}
[VAdd R M]
(s : ULift.{u_1, u} R)
(x : M)


@[reassoc (attr := simp)]
lemma cyclesIsoSc'_inv_iCycles :
    (K.cyclesIsoSc' i j k hi hk).inv ≫ K.iCycles j = (K.sc' i j k).iCycles


@[to_additive]
theorem exists_orderOf_eq_exponent (hG : ExponentExists G) : ∃ g : G, orderOf g = exponent G

{G : Type u}
[CommMonoid G]
(hG : Monoid.ExponentExists G)


theorem tsub_left_inj (h1 : c ≤ a) (h2 : c ≤ b) : a - c = b - c ↔ a = b

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


@[simp, norm_cast]
theorem one_lt_coe_iff : 1 < (↑p : ℝ≥0∞) ↔ 1 < p


/-- If the directions of two nonempty affine subspaces span the whole module, they have nonempty
intersection. -/
theorem inter_nonempty_of_nonempty_of_sup_direction_eq_top {s1 s2 : AffineSubspace k P}
    (h1 : (s1 : Set P).Nonempty) (h2 : (s2 : Set P).Nonempty)
    (hd : s1.direction ⊔ s2.direction = ⊤) : ((s1 : Set P) ∩ s2).Nonempty

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[S : AffineSpace V P]
{s1 s2 : AffineSubspace k P}
(h1 : (↑s1).Nonempty)
(h2 : (↑s2).Nonempty)
(hd : s1.direction ⊔ s2.direction = ⊤)


@[to_additive]
theorem prod_take_ofFn {n : ℕ} (f : Fin n → α) (i : ℕ) :
    ((ofFn f).take i).prod = ∏ j ∈ Finset.univ.filter fun j : Fin n => j.val < i, f j

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

(List.take i (List.ofFn f)).prod = ∏ j ∈ Finset.filter (fun j => ↑j < i) Finset.univ, f j


@[simp] theorem Bool.sizeOf_eq_one (b : Bool) : sizeOf b = 1


/-- The quadratic character takes the value `1` on nonzero squares. -/
theorem quadraticChar_sq_one' {a : F} (ha : a ≠ 0) : quadraticChar F (a ^ 2) = 1

{F : Type u_1}
[Field F]
[Fintype F]
[DecidableEq F]
{a : F}
(ha : a ≠ 0)


/-- A continuous map from a compact space to a Hausdorff space is a closed map. -/
protected theorem Continuous.isClosedMap [CompactSpace X] [T2Space Y] {f : X → Y}
    (h : Continuous f) : IsClosedMap f

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


/-- A version of `EulerProduct.summable_and_hasSum_smoothNumbers_prod_primesBelow_tsum`
in terms of the value of the series. -/
lemma prod_primesBelow_tsum_eq_tsum_smoothNumbers (hsum : Summable (‖f ·‖)) (N : ℕ) :
    ∏ p ∈ N.primesBelow, ∑' n : ℕ, f (p ^ n) = ∑' m : N.smoothNumbers, f m

(hmul : ∀ {m n : ℕ}, m.Coprime n → f (m * n) = f m * f n)

∏ p ∈ N.primesBelow, ∑' (n : ℕ), f (p ^ n) = ∑' (m : ↑N.smoothNumbers), f ↑m


@[simp] lemma comul_pow (a : A) (n : ℕ) : comul (R := R) (a ^ n) = comul a ^ n

{R : Type u}
{A : Type v}
[CommSemiring R]
[Semiring A]
[Bialgebra R A]
(a : A)
(n : ℕ)

Coalgebra.comul (a ^ n) = Coalgebra.comul a ^ n


theorem lt_nth_iff_count_lt (hp : (setOf p).Infinite) {a b : ℕ} : a < count p b ↔ nth p a < b

{p : ℕ → Prop}
[DecidablePred p]
(hp : (setOf p).Infinite)
{a b : ℕ}


@[simp]
theorem isCoatom_bot : IsCoatom (⊥ : α)

{α : Type u_2}
[PartialOrder α]
[BoundedOrder α]
[IsSimpleOrder α]


theorem mem_def {b a} {l : Lists' α b} : a ∈ l ↔ ∃ a' ∈ l.toList, a ~ a'

{α : Type u_1}
{b : Bool}
{a : Lists α}
{l : Lists' α b}


/-- A subgroup `H` of `G` determines a subgroup `H.op` of the opposite group `Gᵐᵒᵖ`. -/
@[to_additive (attr := simps) "An additive subgroup `H` of `G` determines an additive subgroup
`H.op` of the opposite additive group `Gᵃᵒᵖ`."]
def opEquiv : Subgroup G ≃o Subgroup Gᵐᵒᵖ

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


theorem contentRegular_exists_compact (H : ContentRegular μ) (K : TopologicalSpace.Compacts G)
    {ε : NNReal} (hε : ε ≠ 0) :
    ∃ K' : TopologicalSpace.Compacts G, K.carrier ⊆ interior K'.carrier ∧ μ K' ≤ μ K + ε

{G : Type w}
[TopologicalSpace G]
(μ : MeasureTheory.Content G)
(H : μ.ContentRegular)
(K : TopologicalSpace.Compacts G)
{ε : ℝ≥0}
(hε : ε ≠ 0)

∃ K', K.carrier ⊆ interior K'.carrier ∧ (fun s => ↑(μ.toFun s)) K' ≤ (fun s => ↑(μ.toFun s)) K + ↑ε


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

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


@[simp]
theorem restrictScalars_top : restrictScalars R (⊤ : Subalgebra S A) = ⊤

(R : Type u)
{S : Type v}
{A : Type w}
[CommSemiring R]
[CommSemiring S]
[Semiring A]
[Algebra R S]
[Algebra S A]
[Algebra R A]
[IsScalarTower R S A]


/-- The conditional expectation of `f` with respect to a σ-algebra `m` is almost everywhere equal to
the integral `∫ y, f y ∂(condexpKernel μ m ω)`. -/
theorem condexp_ae_eq_integral_condexpKernel [NormedAddCommGroup F] {f : Ω → F}
    [NormedSpace ℝ F] [CompleteSpace F] (hm : m ≤ mΩ) (hf_int : Integrable f μ) :
    μ[f|m] =ᵐ[μ] fun ω => ∫ y, f y ∂condexpKernel μ m ω

{Ω : Type u_1}
{F : Type u_2}
{m : MeasurableSpace Ω}
[mΩ : MeasurableSpace Ω]
[StandardBorelSpace Ω]
[Nonempty Ω]
{μ : MeasureTheory.Measure Ω}
[MeasureTheory.IsFiniteMeasure μ]
[NormedAddCommGroup F]
{f : Ω → F}
[NormedSpace ℝ F]
[CompleteSpace F]
(hm : m ≤ mΩ)
(hf_int : MeasureTheory.Integrable f μ)

μ[f|m] =ᵐ[μ] fun ω => ∫ (y : Ω), f y ∂(ProbabilityTheory.condexpKernel μ m) ω


@[simp] theorem findIdx?_cons :
    (x :: xs).findIdx? p i = if p x then some i else findIdx? p xs (i + 1)

∀ {α : Type u_1} {x : α} {xs : List α} {p : α → Bool} {i : Nat},
  List.findIdx? p (x :: xs) i = if p x = true then some i else List.findIdx? p xs (i + 1)


lemma BijOn.perm_inv (hf : BijOn f s s) : BijOn ↑(f⁻¹) s s

{α : Type u_1}
{f : Equiv.Perm α}
{s : Set α}
(hf : Set.BijOn (⇑f) s s)


/-- The binary product of measures. They are defined for arbitrary measures, but we basically
  prove all properties under the assumption that at least one of them is s-finite. -/
protected irreducible_def prod (μ : Measure α) (ν : Measure β) : Measure (α × β)

{α : Type u_7}
{β : Type u_8}
[MeasurableSpace α]
[MeasurableSpace β]
(μ : MeasureTheory.Measure α)
(ν : MeasureTheory.Measure β)

μ.prod ν = μ.bind fun x => MeasureTheory.Measure.map (Prod.mk x) ν


@[simp]
theorem hasFiniteIntegral_zero : HasFiniteIntegral (fun _ : α => (0 : β)) μ

(α : Type u_1)
(β : Type u_2)
{m : MeasurableSpace α}
(μ : MeasureTheory.Measure α)
[NormedAddCommGroup β]

MeasureTheory.HasFiniteIntegral (fun x => 0) μ


theorem card_boundaries_eq_succ_length : c.boundaries.card = c.length + 1


/-- Combinatorial viewpoint on a composition of `n`, by seeing it as non-empty blocks of
consecutive integers in `{0, ..., n-1}`. We register every block by its left end-point, yielding
a finset containing `0`. As this does not make sense for `n = 0`, we add `n` to this finset, and
get a finset of `{0, ..., n}` containing `0` and `n`. This is the data in the structure
`CompositionAsSet n`. -/
@[ext]
structure CompositionAsSet (n : ℕ) where
  /-- Combinatorial viewpoint on a composition of `n` as consecutive integers `{0, ..., n-1}`-/
  boundaries : Finset (Fin n.succ)
  /-- Proof that `0` is a member of `boundaries`-/
  zero_mem : (0 : Fin n.succ) ∈ boundaries
  /-- Last element of the composition-/
  getLast_mem : Fin.last n ∈ boundaries


@[simp] lemma in₁₀_iff : (graph t).Adj (in₁ b) (in₀ a) ↔ ∃ c, (a, b, c) ∈ t

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

(SimpleGraph.TripartiteFromTriangles.graph t).Adj (Sum3.in₁ b) (Sum3.in₀ a) ↔ ∃ c, (a, b, c) ∈ t


/-- The isomorphism between `F.op.unop` and `F`. -/
@[simps!]
def opUnopIso (F : C ⥤ D) : F.op.unop ≅ F

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

F.opUnopIso.inv.app X = CategoryTheory.CategoryStruct.id (F.obj X)


theorem bijective (f : M ≃[L] N) : Function.Bijective f

{L : FirstOrder.Language}
{M : Type w}
{N : Type w'}
[L.Structure M]
[L.Structure N]
(f : L.Equiv M N)


theorem eq_spanSingleton_of_principal (I : FractionalIdeal S P) [IsPrincipal (I : Submodule R P)] :
    I = spanSingleton S (generator (I : Submodule R P))

{R : Type u_1}
[CommRing R]
{S : Submonoid R}
{P : Type u_2}
[CommRing P]
[Algebra R P]
[loc : IsLocalization S P]
(I : FractionalIdeal S P)
[(↑I).IsPrincipal]

I = FractionalIdeal.spanSingleton S (Submodule.IsPrincipal.generator ↑I)


/-- The obvious map `PullbackCone f g → PushoutCocone f.unop g.unop` -/
@[simps!]
def unop {X Y Z : Cᵒᵖ} {f : X ⟶ Z} {g : Y ⟶ Z} (c : PullbackCone f g) :
    PushoutCocone f.unop g.unop

(c : CategoryTheory.Limits.PullbackCone f g)


@[to_additive]
theorem finprod_mem_inter_mulSupport_eq (f : α → M) (s t : Set α)
    (h : s ∩ mulSupport f = t ∩ mulSupport f) : ∏ᶠ i ∈ s, f i = ∏ᶠ i ∈ t, f i

(h : s ∩ Function.mulSupport f = t ∩ Function.mulSupport f)

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


protected theorem lt_ediv_iff_mul_lt {a b : Int} (c : Int) (H : 0 < c) (H' : c ∣ b) :
    a < b / c ↔ a * c < b


theorem sub_single_one_add {a : ι} {u u' : ι →₀ ℕ} (h : u a ≠ 0) :
    u - single a 1 + u' = u + u' - single a 1

{ι : Type u_1}
{a : ι}
{u u' : ι →₀ ℕ}
(h : u a ≠ 0)

u - Finsupp.single a 1 + u' = u + u' - Finsupp.single a 1


theorem cosh_sq : cosh x ^ 2 = sinh x ^ 2 + 1

Complex.cosh x ^ 2 = Complex.sinh x ^ 2 + 1


/--
Functorially postcompose a cone for `F` by a natural transformation `F ⟶ G` to give a cone for `G`.
-/
@[simps]
def postcompose {G : J ⥤ C} (α : F ⟶ G) : Cone F ⥤ Cone G

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{F G : J ⥤ C}
(α : F ⟶ G)
(c : CategoryTheory.Limits.Cone F)

((CategoryTheory.Limits.Cones.postcompose α).obj c).pt = c.pt


protected theorem Nonempty.sups : s.Nonempty → t.Nonempty → (s ⊻ t).Nonempty

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


@[nontriviality]
theorem factors_subsingleton [Subsingleton α] {a : Associates α} : a.factors = ⊤

{α : Type u_1}
[CancelCommMonoidWithZero α]
[UniqueFactorizationMonoid α]
[Subsingleton α]
{a : Associates α}


theorem integral_const' (c : E) :
    ∫ _ in a..b, c ∂μ = ((μ <| Ioc a b).toReal - (μ <| Ioc b a).toReal) • c

{E : Type u_3}
[NormedAddCommGroup E]
[CompleteSpace E]
[NormedSpace ℝ E]
{a b : ℝ}
{μ : MeasureTheory.Measure ℝ}
(c : E)

∫ (x : ℝ) in a..b, c ∂μ = ((μ (Set.Ioc a b)).toReal - (μ (Set.Ioc b a)).toReal) • c


@[simp]
theorem count_union (a : α) (s t : Multiset α) : count a (s ∪ t) = max (count a s) (count a t)

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

Multiset.count a (s ∪ t) = max (Multiset.count a s) (Multiset.count a t)


theorem tendsto_addHaar_inter_smul_zero_of_density_zero_aux1 (s : Set E) (x : E)
    (h : Tendsto (fun r => μ (s ∩ closedBall x r) / μ (closedBall x r)) (𝓝[>] 0) (𝓝 0)) (t : Set E)
    (u : Set E) (h'u : μ u ≠ 0) (t_bound : t ⊆ closedBall 0 1) :
    Tendsto (fun r : ℝ => μ (s ∩ ({x} + r • t)) / μ ({x} + r • u)) (𝓝[>] 0) (𝓝 0)

(h : Filter.Tendsto (fun r => μ (s ∩ Metric.closedBall x r) / μ (Metric.closedBall x r)) (𝓝[>] 0) (𝓝 0))

Filter.Tendsto (fun r => μ (s ∩ ({x} + r • t)) / μ ({x} + r • u)) (𝓝[>] 0) (𝓝 0)


@[to_additive]
theorem lift_one : lift f 1 = 1

{α : Type u}
{β : Type v}
[Add α]
[AddZeroClass β]
(f : AddHom α β)


@[simp] protected theorem min_self (a : Nat) : min a a = a


@[simp]
theorem aeval_id_eq_join₁ : aeval id = @join₁ σ R _

(σ : Type u_1)
(R : Type u_3)
[CommSemiring R]

MvPolynomial.aeval id = MvPolynomial.join₁


@[to_additive (attr := simp)]
lemma subgroupCongr_apply (h : H = K) (x) :
    (MulEquiv.subgroupCongr h x : G) = x

{G : Type u_1}
[Group G]
{H K : Subgroup G}
(h : H = K)
(x : ↥H)


@[simp]
theorem Ico_filter_lt (a b c : α) : ((Ico a b).filter fun x => x < c) = Ico a (min b c)

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

Multiset.filter (fun x => x < c) (Multiset.Ico a b) = Multiset.Ico a (min b c)


/-- The Gram operator T†T is symmetric. -/
theorem isSymmetric_adjoint_mul_self (T : E →ₗ[𝕜] E) : IsSymmetric (LinearMap.adjoint T * T)

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[FiniteDimensional 𝕜 E]
(T : E →ₗ[𝕜] E)


theorem integrable_toReal_condexpKernel {s : Set Ω} (hs : MeasurableSet s) :
    Integrable (fun ω => (condexpKernel μ m ω s).toReal) μ

{Ω : Type u_1}
{m : MeasurableSpace Ω}
[mΩ : MeasurableSpace Ω]
[StandardBorelSpace Ω]
[Nonempty Ω]
{μ : MeasureTheory.Measure Ω}
[MeasureTheory.IsFiniteMeasure μ]
{s : Set Ω}
(hs : MeasurableSet s)

MeasureTheory.Integrable (fun ω => (((ProbabilityTheory.condexpKernel μ m) ω) s).toReal) μ


@[to_additive]
theorem rightRel_eq : @Setoid.r _ (rightRel s) = fun x y => y * x⁻¹ ∈ s

{α : Type u_1}
[Group α]
(s : Subgroup α)


@[simp]
theorem mem_join {s : Set α} {f : Filter (Filter α)} : s ∈ join f ↔ { t | s ∈ t } ∈ f

{α : Type u}
{s : Set α}
{f : Filter (Filter α)}


@[simp]
theorem preimage_coe_Ioo : (some : α → WithTop α) ⁻¹' Ioo a b = Ioo a b

WithTop.some ⁻¹' Set.Ioo ↑a ↑b = Set.Ioo a b


@[to_additive]
theorem comap_sup_map_of_injective (S T : Subsemigroup M) : (S.map f ⊔ T.map f).comap f = S ⊔ T

{M : Type u_1}
{N : Type u_2}
[Mul M]
[Mul N]
{f : M →ₙ* N}
(hf : Function.Injective ⇑f)
(S T : Subsemigroup M)

Subsemigroup.comap f (Subsemigroup.map f S ⊔ Subsemigroup.map f T) = S ⊔ T


theorem decompId_p_toKaroubi (X : C) : decompId_p ((toKaroubi C).obj X) = 𝟙 _

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

((CategoryTheory.Idempotents.toKaroubi C).obj X).decompId_p =
  CategoryTheory.CategoryStruct.id
    { X := ((CategoryTheory.Idempotents.toKaroubi C).obj X).X,
      p := CategoryTheory.CategoryStruct.id ((CategoryTheory.Idempotents.toKaroubi C).obj X).X, idem := ⋯ }


@[simp]
theorem snd_exp (x : tsze R M) : snd (exp 𝕜 x) = exp 𝕜 x.fst • x.snd

(𝕜 : Type u_1)
{R : Type u_3}
{M : Type u_4}
[Field 𝕜]
[CharZero 𝕜]
[CommRing R]
[AddCommGroup M]
[Algebra 𝕜 R]
[Module 𝕜 M]
[Module R M]
[Module Rᵐᵒᵖ M]
[IsCentralScalar R M]
[IsScalarTower 𝕜 R M]
[TopologicalSpace R]
[TopologicalSpace M]
[TopologicalRing R]
[TopologicalAddGroup M]
[ContinuousSMul R M]
[ContinuousSMul Rᵐᵒᵖ M]
[T2Space R]
[T2Space M]
(x : tsze R M)

(NormedSpace.exp 𝕜 x).snd = NormedSpace.exp 𝕜 x.fst • x.snd


theorem algebraMap_apply {R : Type*} [CommSemiring R] [Algebra R K[X]] (x : R) :
    algebraMap R (RatFunc K) x = algebraMap _ _ (algebraMap R K[X] x) / algebraMap K[X] _ 1

{K : Type u}
[CommRing K]
[IsDomain K]
{R : Type u_1}
[CommSemiring R]
[Algebra R K[X]]
(x : R)

(algebraMap R (RatFunc K)) x = (algebraMap K[X] (RatFunc K)) ((algebraMap R K[X]) x) / (algebraMap K[X] (RatFunc K)) 1


lemma rotate_essImageDistTriang [Preadditive D] [L.Additive]
    [∀ (n : ℤ), (shiftFunctor D n).Additive] (T : Triangle D) :
  T ∈ L.essImageDistTriang ↔ T.rotate ∈ L.essImageDistTriang

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

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

(T : CategoryTheory.Pretriangulated.Triangle D)


/-- A variant of `incl_lift` with `Z` an initial object. -/
@[simps!]
def inclLiftToInitial {D : Type*} [Category D] {Z : D} (F : C ⥤ D) (hZ : Limits.IsInitial Z) :
    incl ⋙ liftToInitial F hZ ≅ F

(hZ : CategoryTheory.Limits.IsInitial Z)

(CategoryTheory.WithInitial.inclLiftToInitial F hZ).inv.app X = CategoryTheory.CategoryStruct.id (F.obj X)


/-- If `N` is flat, `M` is contained in `i(R)`, where `i : R → S` is the structure map,
then `M` and `N` are linearly disjoint. -/
theorem of_left_le_one_of_flat (h : M ≤ 1) [Module.Flat R N] :
    M.LinearDisjoint N

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


lemma isoTwoCocycles_hom_comp_subtype :
    (isoTwoCocycles A).hom ≫ ModuleCat.ofHom (twoCocycles A).subtype =
      iCocycles A 2 ≫ (twoCochainsLequiv A).toModuleIso.hom

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

(groupCohomology.isoTwoCocycles A).hom ≫ ModuleCat.ofHom (groupCohomology.twoCocycles A).subtype =
  groupCohomology.iCocycles A 2 ≫ (groupCohomology.twoCochainsLequiv A).toModuleIso.hom


theorem eq_zero_or_neZero (a : R) : a = 0 ∨ NeZero a


theorem lf_of_mk_le {x yl yr yL yR} : x ≤ mk yl yr yL yR → ∀ j, x ⧏ yR j

{x : SetTheory.PGame}
{yl yr : Type u_1}
{yL : yl → SetTheory.PGame}
{yR : yr → SetTheory.PGame}

x ≤ SetTheory.PGame.mk yl yr yL yR → ∀ (j : yr), x.LF (yR j)


theorem FG.map {N : Type*} [L.Structure N] (f : M →[L] N) {s : L.Substructure M} (hs : s.FG) :
    (s.map f).FG

{L : FirstOrder.Language}
{M : Type u_1}
[L.Structure M]
{N : Type u_2}
[L.Structure N]
(f : M →[L] N)
{s : L.Substructure M}
(hs : s.FG)


@[to_additive (attr := simp)]
theorem coe_singletonMonoidHom : (singletonMonoidHom : α → Finset α) = singleton

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


@[to_additive]
theorem MonoidHom.cancel_left [MulOneClass M] [MulOneClass N] [MulOneClass P]
    {g : N →* P} {f₁ f₂ : M →* N} (hg : Function.Injective g) : g.comp f₁ = g.comp f₂ ↔ f₁ = f₂

{M : Type u_4}
{N : Type u_5}
{P : Type u_6}
[MulOneClass M]
[MulOneClass N]
[MulOneClass P]
{g : N →* P}
{f₁ f₂ : M →* N}
(hg : Function.Injective ⇑g)


/-- A ring homomorphism from `R` to `S` induces a group homomorphism from
`SpecialLinearGroup n R` to `SpecialLinearGroup n S`. -/
@[simps]
def map (f : R →+* S) : SpecialLinearGroup n R →* SpecialLinearGroup n S

{n : Type u}
[DecidableEq n]
[Fintype n]
{R : Type v}
[CommRing R]
{S : Type u_1}
[CommRing S]
(f : R →+* S)
(g : Matrix.SpecialLinearGroup n R)

↑((Matrix.SpecialLinearGroup.map f) g) = f.mapMatrix ↑g


theorem eventually_ne_nhdsWithin [T1Space X] {a b : X} {s : Set X} (h : a ≠ b) :
    ∀ᶠ x in 𝓝[s] a, x ≠ b

{X : Type u_1}
[TopologicalSpace X]
[T1Space X]
{a b : X}
{s : Set X}
(h : a ≠ b)


@[simp]
theorem aroots_C_mul [CommRing S] [IsDomain S] [Algebra T S]
    [NoZeroSMulDivisors T S] {a : T} (p : T[X]) (ha : a ≠ 0) :
    (C a * p).aroots S = p.aroots S

{S : Type v}
{T : Type w}
[CommRing T]
[CommRing S]
[IsDomain S]
[Algebra T S]
[NoZeroSMulDivisors T S]
{a : T}
(p : Polynomial T)
(ha : a ≠ 0)

(Polynomial.C a * p).aroots S = p.aroots S


@[simp] lemma divInt_pow (num : ℕ) (den : ℤ) (n : ℕ) : (num /. den) ^ n = num ^ n /. den ^ n

Rat.divInt (↑num) den ^ n = Rat.divInt (↑num ^ n) (den ^ n)


@[simp]
theorem takeI_left (l₁ l₂ : List α) : takeI (length l₁) (l₁ ++ l₂) = l₁

{α : Type u}
[Inhabited α]
(l₁ l₂ : List α)


lemma eventually_prod_self_iff {r : α → α → Prop} :
    (∀ᶠ x in la ×ˢ la, r x.1 x.2) ↔ ∃ t ∈ la, ∀ x ∈ t, ∀ y ∈ t, r x y

{α : Type u_1}
{la : Filter α}
{r : α → α → Prop}

(∀ᶠ (x : α × α) in la ×ˢ la, r x.1 x.2) ↔ ∃ t ∈ la, ∀ x ∈ t, ∀ y ∈ t, r x y


/-- Composition of `AddConstEquiv`s, as an `AddConstEquiv`. -/
@[simps! (config := { simpRhs := true }) toEquiv apply]
def trans (e₁ : G ≃+c[a, b] H) (e₂ : H ≃+c[b, c] K) : G ≃+c[a, c] K

{G : Type u_1}
{H : Type u_2}
{K : Type u_3}
[Add G]
[Add H]
[Add K]
{a : G}
{b : H}
{c : K}
(e₁ : G ≃+c[a, b] H)
(e₂ : H ≃+c[b, c] K)

∀ (a_1 : G), (e₁.trans e₂) a_1 = e₂ (e₁ a_1)


theorem card_fintype_Ioc : Fintype.card (Set.Ioc a b) = (b - a).toNat

Fintype.card ↑(Set.Ioc a b) = (b - a).toNat


/-- The `Pi.prod` of two morphisms is a morphism. -/
@[simps!]
def prod (f : A →⋆ₐ[R] B) (g : A →⋆ₐ[R] C) : A →⋆ₐ[R] B × C

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
{C : Type u_4}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[Star A]
[Semiring B]
[Algebra R B]
[Star B]
[Semiring C]
[Algebra R C]
[Star C]
(f : A →⋆ₐ[R] B)
(g : A →⋆ₐ[R] C)
(x : A)


theorem isBounded_induced {α β : Type*} [Bornology β] {f : α → β} {s : Set α} :
    @IsBounded α (Bornology.induced f) s ↔ IsBounded (f '' s)

{α : Type u_5}
{β : Type u_6}
[Bornology β]
{f : α → β}
{s : Set α}

Bornology.IsBounded s ↔ Bornology.IsBounded (f '' s)


theorem Periodic.div_const [DivisionSemiring α] (h : Periodic f c) (a : α) :
    Periodic (fun x => f (x / a)) (c * a)

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

Function.Periodic (fun x => f (x / a)) (c * a)


/-- If `f` has a Taylor series up to `n`, then it is `C^n`. -/
theorem HasFTaylorSeriesUpTo.contDiff {f' : E → FormalMultilinearSeries 𝕜 E F}
    (hf : HasFTaylorSeriesUpTo n f f') : ContDiff 𝕜 n f


lemma ofUnits_le_ofUnits_iff {S T : Subgroup Mˣ} : S.ofUnits ≤ T.ofUnits ↔ S ≤ T

{M : Type u_1}
[Monoid M]
{S T : Subgroup Mˣ}


lemma forall_mem_diffs {p : α → Prop} : (∀ c ∈ s \\ t, p c) ↔ ∀ a ∈ s, ∀ b ∈ t, p (a \ b)

{α : Type u_2}
[DecidableEq α]
[GeneralizedBooleanAlgebra α]
{s t : Finset α}
{p : α → Prop}

(∀ c ∈ s.diffs t, p c) ↔ ∀ a ∈ s, ∀ b ∈ t, p (a \ b)


@[gcongr] protected theorem sub_left (c : ℤ) (h : a ≡ b [ZMOD n]) : c - a ≡ c - b [ZMOD n]

{n a b : ℤ}
(c : ℤ)
(h : a ≡ b [ZMOD n])


theorem lintegral_eq_lmarginal_univ [Fintype δ] {f : (∀ i, π i) → ℝ≥0∞} (x : ∀ i, π i) :
    ∫⁻ x, f x ∂Measure.pi μ = (∫⋯∫⁻_univ, f ∂μ) x

{μ : (i : δ) → MeasureTheory.Measure (π i)}

[∀ (i : δ), MeasureTheory.SigmaFinite (μ i)]

∫⁻ (x : (i : δ) → π i), f x ∂MeasureTheory.Measure.pi μ = (∫⋯∫⁻_Finset.univ, f ∂μ) x


@[simp]
lemma variableChange_b₂ : (W.variableChange C).b₂ = C.u⁻¹ ^ 2 * (W.b₂ + 12 * C.r)

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

(W.variableChange C).b₂ = ↑C.u⁻¹ ^ 2 * (W.b₂ + 12 * C.r)


/-- The **Cauchy-Davenport Theorem** for linearly ordered cancellative semigroups. The size of
`s * t` is lower-bounded by `|s| + |t| - 1`. -/
@[to_additive
"The **Cauchy-Davenport theorem** for linearly ordered additive cancellative semigroups. The size of
`s + t` is lower-bounded by `|s| + |t| - 1`."]
lemma Finset.card_add_card_sub_one_le_card_mul [LinearOrder α] [Semigroup α] [IsCancelMul α]
    [CovariantClass α α (· * ·) (· ≤ ·)] [CovariantClass α α (swap (· * ·)) (· ≤ ·)]
    {s t : Finset α} (hs : s.Nonempty) (ht : t.Nonempty) : s.card + t.card - 1 ≤ (s * t).card

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

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


@[simp]
theorem restrictScalars_neg (f : M →L[A] M₂) : (-f).restrictScalars R = -f.restrictScalars R

{A : Type u_1}
{M : Type u_2}
{M₂ : Type u_3}
[Ring A]
[AddCommGroup M]
[AddCommGroup M₂]
[Module A M]
[Module A M₂]
[TopologicalSpace M]
[TopologicalSpace M₂]
{R : Type u_4}
[Ring R]
[Module R M]
[Module R M₂]
[LinearMap.CompatibleSMul M M₂ R A]
[TopologicalAddGroup M₂]
(f : M →L[A] M₂)

ContinuousLinearMap.restrictScalars R (-f) = -ContinuousLinearMap.restrictScalars R f


theorem Filter.EventuallyEq.isExtrFilter_iff {α β : Type*} [Preorder β] {f g : α → β} {a : α}
    {l : Filter α} (heq : f =ᶠ[l] g) (hfga : f a = g a) : IsExtrFilter f l a ↔ IsExtrFilter g l a

{α : Type u_1}
{β : Type u_2}
[Preorder β]
{f g : α → β}
{a : α}
{l : Filter α}
(heq : f =ᶠ[l] g)
(hfga : f a = g a)


theorem Irreducible.dvd_iff [Monoid α] {x y : α} (hx : Irreducible x) :
    y ∣ x ↔ IsUnit y ∨ Associated x y

{α : Type u_1}
[Monoid α]
{x y : α}
(hx : Irreducible x)


@[to_additive]
theorem hasProd_prod_disjoint {ι} (s : Finset ι) {t : ι → Set β} {a : ι → α}
    (hs : (s : Set ι).Pairwise (Disjoint on t)) (hf : ∀ i ∈ s, HasProd (f ∘ (↑) : t i → α) (a i)) :
    HasProd (f ∘ (↑) : (⋃ i ∈ s, t i) → α) (∏ i ∈ s, a i)

(hf : ∀ i ∈ s, HasSum (f ∘ Subtype.val) (a i))


@[simp]
theorem zero_apply (x : M) : (0 : QuadraticMap R M N) x = 0

{R : Type u_3}
{M : Type u_4}
{N : Type u_5}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
[AddCommMonoid N]
[Module R N]
(x : M)


theorem covBy_congr_right (hab : AntisymmRel (· ≤ ·) a b) : c ⋖ a ↔ c ⋖ b

(hab : AntisymmRel (fun x x_1 => x ≤ x_1) a b)


@[simp] theorem congr_trans_lTensor (g' : Q ≃ₗ[R] S) (f : M ≃ₗ[R] P) (g : N ≃ₗ[R] Q) :
    TensorProduct.congr f g ≪≫ₗ g'.lTensor _ = TensorProduct.congr f (g ≪≫ₗ g')

{R : Type u_1}
[CommSemiring R]
(M : Type u_4)
{N : Type u_5}
{P : Type u_6}
{Q : Type u_7}
{S : Type u_8}
[AddCommMonoid M]
[AddCommMonoid N]
[AddCommMonoid P]
[AddCommMonoid Q]
[AddCommMonoid S]
[Module R M]
[Module R N]
[Module R P]
[Module R Q]
[Module R S]
(g' : Q ≃ₗ[R] S)
(f : M ≃ₗ[R] P)
(g : N ≃ₗ[R] Q)

TensorProduct.congr f g ≪≫ₗ LinearEquiv.lTensor P g' = TensorProduct.congr f (g ≪≫ₗ g')


theorem tendsto_sin_neg_pi_div_two : Tendsto sin (𝓝[>] (-(π / 2))) (𝓝 (-1))

Filter.Tendsto Real.sin (𝓝[>] (-(Real.pi / 2))) (𝓝 (-1))


@[to_additive]
lemma range_toContinuousMap :
    Set.range (toContinuousMap : ContinuousMonoidHom A B → C(A, B)) =
      {f : C(A, B) | f 1 = 1 ∧ ∀ x y, f (x * y) = f x * f y}

(A : Type u_2)
(B : Type u_3)
[Monoid A]
[Monoid B]
[TopologicalSpace A]
[TopologicalSpace B]

Set.range ContinuousMonoidHom.toContinuousMap = {f | f 1 = 1 ∧ ∀ (x y : A), f (x * y) = f x * f y}


@[simp]
theorem append_copy_copy {u v w u' v' w'} (p : G.Walk u v) (q : G.Walk v w)
    (hu : u = u') (hv : v = v') (hw : w = w') :
    (p.copy hu hv).append (q.copy hv hw) = (p.append q).copy hu hw

{V : Type u}
{G : SimpleGraph V}
{u v w u' v' w' : V}
(p : G.Walk u v)
(q : G.Walk v w)
(hu : u = u')
(hv : v = v')
(hw : w = w')


theorem integrableOn_Ioi_comp_mul_left_iff (f : ℝ → E) (c : ℝ) {a : ℝ} (ha : 0 < a) :
    IntegrableOn (fun x => f (a * x)) (Ioi c) ↔ IntegrableOn f (Ioi <| a * c)

{E : Type u_1}
[NormedAddCommGroup E]
(f : ℝ → E)
(c : ℝ)
{a : ℝ}
(ha : 0 < a)

MeasureTheory.IntegrableOn (fun x => f (a * x)) (Set.Ioi c) MeasureTheory.volume ↔
  MeasureTheory.IntegrableOn f (Set.Ioi (a * c)) MeasureTheory.volume


theorem addHaar_closedBall_mul_of_pos (x : E) {r : ℝ} (hr : 0 < r) (s : ℝ) :
    μ (closedBall x (r * s)) = ENNReal.ofReal (r ^ finrank ℝ E) * μ (closedBall 0 s)

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[MeasurableSpace E]
[BorelSpace E]
[FiniteDimensional ℝ E]
(μ : MeasureTheory.Measure E)
[μ.IsAddHaarMeasure]
(x : E)
{r : ℝ}
(hr : 0 < r)
(s : ℝ)

μ (Metric.closedBall x (r * s)) = ENNReal.ofReal (r ^ FiniteDimensional.finrank ℝ E) * μ (Metric.closedBall 0 s)


theorem isFiniteMeasure_iff_isFiniteMeasureOnCompacts_of_compactSpace [TopologicalSpace α]
    [MeasurableSpace α] {μ : Measure α} [CompactSpace α] :
    IsFiniteMeasure μ ↔ IsFiniteMeasureOnCompacts μ

{α : Type u_1}
[TopologicalSpace α]
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
[CompactSpace α]

MeasureTheory.IsFiniteMeasure μ ↔ MeasureTheory.IsFiniteMeasureOnCompacts μ


theorem martingale_of_setIntegral_eq_succ [IsFiniteMeasure μ] {f : ℕ → Ω → ℝ} (hadp : Adapted 𝒢 f)
    (hint : ∀ i, Integrable (f i) μ)
    (hf : ∀ i, ∀ s : Set Ω, MeasurableSet[𝒢 i] s → ∫ ω in s, f i ω ∂μ = ∫ ω in s, f (i + 1) ω ∂μ) :
    Martingale f 𝒢 μ

{f : ℕ → Ω → ℝ}

(hint : ∀ (i : ℕ), MeasureTheory.Integrable (f i) μ)

(hf : ∀ (i : ℕ) (s : Set Ω), MeasurableSet s → ∫ (ω : Ω) in s, f i ω ∂μ = ∫ (ω : Ω) in s, f (i + 1) ω ∂μ)


@[simp]
theorem opRingEquiv_op_C (a : R) : opRingEquiv R (op (C a)) = C (op a)

(Polynomial.opRingEquiv R) (MulOpposite.op (Polynomial.C a)) = Polynomial.C (MulOpposite.op a)


theorem coe_subtypeEquivCodomain_symm (f : { x' // x' ≠ x } → Y) :
    ((subtypeEquivCodomain f).symm : Y → _) = fun y =>
      ⟨fun x' => if h : x' ≠ x then f ⟨x', h⟩ else y, by
        funext x'
        simp only [ne_eq, dite_not, comp_apply, Subtype.coe_eta, dite_eq_ite, ite_eq_right_iff]
        intro w
        exfalso
        exact x'.property w⟩

{X : Sort u_2}
[DecidableEq X]
{x : X}
{Y : Sort u_1}
(f : { x' // x' ≠ x } → Y)

⇑(Equiv.subtypeEquivCodomain f).symm = fun y => ⟨fun x' => if h : x' ≠ x then f ⟨x', h⟩ else y, ⋯⟩


lemma IsLocalizedEquivalence.mk' [CatCommSq Φ.functor L₁ L₂ G] [G.IsEquivalence] :
    Φ.IsLocalizedEquivalence

{W₁ : CategoryTheory.MorphismProperty C₁}

{W₂ : CategoryTheory.MorphismProperty C₂}

(Φ : CategoryTheory.LocalizerMorphism W₁ W₂)

[CategoryTheory.CatCommSq Φ.functor L₁ L₂ G]


@[to_additive tsum_setProd_singleton_right]
lemma tprod_setProd_singleton_right (s : Set β) (c : γ) (f : β × γ → α) :
    (∏' x : s ×ˢ {c}, f x) = ∏' b : s, f (b, c)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[CommMonoid α]
[TopologicalSpace α]
(s : Set β)
(c : γ)
(f : β × γ → α)

∏' (x : ↑(s ×ˢ {c})), f ↑x = ∏' (b : ↑s), f (↑b, c)


theorem comap_reindex (f : α' → α) (g : σ ≃ σ') :
    (reindex g M).comap f = reindex g (M.comap f)

{α : Type u}
{σ : Type v}
(M : DFA α σ)
{α' : Type u_1}
{σ' : Type u_2}
(f : α' → α)
(g : σ ≃ σ')

DFA.comap f ((DFA.reindex g) M) = (DFA.reindex g) (DFA.comap f M)


/-- The gaussian pdf is nonnegative. -/
lemma gaussianPDFReal_nonneg (μ : ℝ) (v : ℝ≥0) (x : ℝ) : 0 ≤ gaussianPDFReal μ v x

0 ≤ ProbabilityTheory.gaussianPDFReal μ v x


@[simp]
theorem map_inv_map_hom_apply (f : X ≅ Y) (x : F.obj X) : F.map f.inv (F.map f.hom x) = x

{C : Type u}
[CategoryTheory.Category.{v, u} C]
(F : CategoryTheory.Functor C (Type w))
{X Y : C}
(f : X ≅ Y)
(x : F.obj X)


lemma eval_polynomialY (P : Fin 3 → R) :
    eval P W'.polynomialY = 2 * P y + W'.a₁ * P x * P z + W'.a₃ * P z ^ 3

{R : Type u}
[CommRing R]
{W' : WeierstrassCurve.Jacobian R}
(P : Fin 3 → R)

(MvPolynomial.eval P) W'.polynomialY = 2 * P y + W'.a₁ * P x * P z + W'.a₃ * P z ^ 3


@[simp]
theorem coe_int_neg (g : SpecialLinearGroup n ℤ) : ↑(-g) = (-↑g : SpecialLinearGroup n R)

{n : Type u}
[DecidableEq n]
[Fintype n]
{R : Type v}
[CommRing R]
[Fact (Even (Fintype.card n))]
(g : Matrix.SpecialLinearGroup n ℤ)

(Matrix.SpecialLinearGroup.map (Int.castRingHom R)) (-g) = -(Matrix.SpecialLinearGroup.map (Int.castRingHom R)) g


theorem unpaired {f : ℕ → ℕ → α} : Primrec (Nat.unpaired f) ↔ Primrec₂ f

{α : Type u_1}
[Primcodable α]
{f : ℕ → ℕ → α}


theorem lowerCrossingTime_stabilize (hnm : n ≤ m) (hn : lowerCrossingTime a b f N n ω = N) :
    lowerCrossingTime a b f N m ω = N

{f : ℕ → Ω → ℝ}

(hn : MeasureTheory.lowerCrossingTime a b f N n ω = N)

MeasureTheory.lowerCrossingTime a b f N m ω = N


@[to_additive]
lemma eq_mul_of_ne_all {x y z : G} (hx : x ≠ 1)
    (hy : y ≠ 1) (hxy : x ≠ y) (hz : z ≠ 1) (hzx : z ≠ x) (hzy : z ≠ y) : z = x * y

{G : Type u_1}
[Group G]
[IsKleinFour G]
{x y z : G}
(hx : x ≠ 1)
(hy : y ≠ 1)
(hxy : x ≠ y)
(hz : z ≠ 1)
(hzx : z ≠ x)
(hzy : z ≠ y)


theorem exists_large_sphere_aux (n d : ℕ) : ∃ k ∈ range (n * (d - 1) ^ 2 + 1),
    (↑(d ^ n) / ((n * (d - 1) ^ 2 :) + 1) : ℝ) ≤ (sphere n d k).card

∃ k ∈ Finset.range (n * (d - 1) ^ 2 + 1), ↑(d ^ n) / (↑(n * (d - 1) ^ 2) + 1) ≤ ↑(Behrend.sphere n d k).card


@[to_additive]
theorem Supports.mono (h : s ⊆ t) (hs : Supports G s b) : Supports G t b

{G : Type u_1}
{α : Type u_3}
{β : Type u_4}
[VAdd G α]
[VAdd G β]
{s t : Set α}
{b : β}
(h : s ⊆ t)
(hs : AddAction.Supports G s b)


{α : Type u}
[PartialOrder α]
[OrderTop α]
{a : α}
(h : ⊤ ≠ a)


@[simp]
theorem commensurator_mem_iff (H : Subgroup G) (g : G) :
    g ∈ commensurator H ↔ Commensurable (ConjAct.toConjAct g • H) H

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

g ∈ Commensurable.commensurator H ↔ Commensurable (ConjAct.toConjAct g • H) H


/-- Evaluation at a fixed point is uniformly continuous on `α →ᵤ β`. -/
theorem uniformContinuous_eval (x : α) :
    UniformContinuous (Function.eval x ∘ toFun : (α →ᵤ β) → β)

{α : Type u_1}
(β : Type u_2)
[UniformSpace β]
(x : α)

UniformContinuous (Function.eval x ∘ ⇑UniformFun.toFun)


theorem ofFractionRing_injective : Function.Injective (ofFractionRing : _ → RatFunc K)


/-- The kernel of the natural homomorphism from a monoid to its quotient by a congruence
    relation `c` equals `c`. -/
@[to_additive (attr := simp) "The kernel of the natural homomorphism from an `AddMonoid` to its
quotient by an additive congruence relation `c` equals `c`."]
theorem mk'_ker : ker c.mk' = c

{M : Type u_1}
[AddZeroClass M]
(c : AddCon M)


theorem deleteEdges_coe_eq (s : Set (Sym2 G'.verts)) :
    G'.coe.deleteEdges s = (G'.deleteEdges (Sym2.map (↑) '' s)).coe

{V : Type u}
{G : SimpleGraph V}
{G' : G.Subgraph}
(s : Set (Sym2 ↑G'.verts))

G'.coe.deleteEdges s = (G'.deleteEdges (Sym2.map Subtype.val '' s)).coe


theorem biprod.map_eq_map' {W X Y Z : C} [HasBinaryBiproduct W X] [HasBinaryBiproduct Y Z]
    (f : W ⟶ Y) (g : X ⟶ Z) : biprod.map f g = biprod.map' f g

CategoryTheory.Limits.biprod.map f g = CategoryTheory.Limits.biprod.map' f g


@[to_additive]
theorem map_eq_comap_of_inverse {f : G →* N} {g : N →* G} (hl : Function.LeftInverse g f)
    (hr : Function.RightInverse g f) (H : Subgroup G) : map f H = comap g H

{G : Type u_1}
[Group G]
{N : Type u_5}
[Group N]
{f : G →* N}
{g : N →* G}
(hl : Function.LeftInverse ⇑g ⇑f)
(hr : Function.RightInverse ⇑g ⇑f)
(H : Subgroup G)


theorem map_mem_minimals_iff (ha : a ∈ x) : f a ∈ minimals s (f '' x) ↔ a ∈ minimals r x

(hf : ∀ ⦃a a' : α⦄, a ∈ x → a' ∈ x → (r a a' ↔ s (f a) (f a')))


theorem restrictScalars_injective :
    Function.Injective (restrictScalars K : IntermediateField L' L → IntermediateField K L)

(K : Type u_1)
{L : Type u_2}
{L' : Type u_3}
[Field K]
[Field L]
[Field L']
[Algebra K L]
[Algebra K L']
[Algebra L' L]
[IsScalarTower K L' L]


@[to_additive]
theorem lowerClosure_mul : ↑(lowerClosure s) * t = lowerClosure (s * t)

{α : Type u_1}
[OrderedCommGroup α]
(s t : Set α)

↑(lowerClosure s) * t = ↑(lowerClosure (s * t))


@[simp, norm_cast] lemma coe_mul (f g : AddMonoid.End A) : (f * g : A → A) = f ∘ g

(A : Type u_10)
[AddZeroClass A]
(f g : AddMonoid.End A)


theorem comp_injective {g : ι' → ι} (hf : LocallyFinite f) (hg : Injective g) :
    LocallyFinite (f ∘ g)

{ι : Type u_1}
{ι' : Type u_2}
{X : Type u_4}
[TopologicalSpace X]
{f : ι → Set X}
{g : ι' → ι}
(hf : LocallyFinite f)
(hg : Function.Injective g)


@[simp]
theorem ofLists_moveLeft' {L R : List PGame} (i : (ofLists L R).LeftMoves) :
    (ofLists L R).moveLeft i = L.get (toOfListsLeftMoves.symm i)

(i : (SetTheory.PGame.ofLists L R).LeftMoves)

(SetTheory.PGame.ofLists L R).moveLeft i = L.get (SetTheory.PGame.toOfListsLeftMoves.symm i)


@[simp]
theorem toSubgraph_append (p : G.Walk u v) (q : G.Walk v w) :
    (p.append q).toSubgraph = p.toSubgraph ⊔ q.toSubgraph

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


@[to_additive measurePreserving_prod_add_right]
theorem measurePreserving_prod_mul_right [IsMulRightInvariant ν] :
    MeasurePreserving (fun z : G × G => (z.1, z.2 * z.1)) (μ.prod ν) (μ.prod ν)

{G : Type u_1}
[MeasurableSpace G]
[Group G]
[MeasurableMul₂ G]
(μ ν : MeasureTheory.Measure G)
[MeasureTheory.SFinite ν]
[MeasureTheory.SFinite μ]
[ν.IsMulRightInvariant]

MeasureTheory.MeasurePreserving (fun z => (z.1, z.2 * z.1)) (μ.prod ν) (μ.prod ν)


theorem ContinuousMultilinearMap.norm_map_init_le
    (f : ContinuousMultilinearMap 𝕜 (fun i : Fin n => Ei <| castSucc i) (Ei (last n) →L[𝕜] G))
    (m : ∀ i, Ei i) : ‖f (init m) (m (last n))‖ ≤ ‖f‖ * ∏ i, ‖m i‖

[(i : Fin n.succ) → NormedAddCommGroup (Ei i)]

[(i : Fin n.succ) → NormedSpace 𝕜 (Ei i)]

(f : ContinuousMultilinearMap 𝕜 (fun i => Ei i.castSucc) (Ei (Fin.last n) →L[𝕜] G))

‖(f (Fin.init m)) (m (Fin.last n))‖ ≤ ‖f‖ * ∏ i : Fin n.succ, ‖m i‖


/-- The square with `0 : 0 ⟶ 0` on the top and `𝟙 X` on the bottom is a pushout square. -/
@[simp]
theorem zero_top (X : C) : IsPushout (0 : (0 : C) ⟶ 0) (0 : 0 ⟶ X) (0 : 0 ⟶ X) (𝟙 X)


@[simp]
theorem top_adj (v w : V) : (⊤ : SimpleGraph V).Adj v w ↔ v ≠ w


@[simp]
theorem length_nonneg : ∀ s : Interval α, 0 ≤ s.length

{α : Type u_2}
[OrderedAddCommGroup α]
(s : Interval α)


theorem eq_σ_comp_of_not_injective {n : ℕ} {Δ' : SimplexCategory} (θ : mk (n + 1) ⟶ Δ')
    (hθ : ¬Function.Injective θ.toOrderHom) :
    ∃ (i : Fin (n + 1)) (θ' : mk n ⟶ Δ'), θ = σ i ≫ θ'

(hθ : ¬Function.Injective ⇑(SimplexCategory.Hom.toOrderHom θ))


theorem range_coe {s : Set α} : range ((↑) : s → α) = s


theorem setIntegral_nonpos_of_ae (hf : f ≤ᵐ[μ] 0) : ∫ x in s, f x ∂μ ≤ 0

{X : Type u_1}
[MeasurableSpace X]
{μ : MeasureTheory.Measure X}
{f : X → ℝ}
{s : Set X}
(hf : f ≤ᵐ[μ] 0)


theorem Sized.node' {l x r} (hl : @Sized α l) (hr : Sized r) : Sized (node' l x r)

{α : Type u_1}
{l : Ordnode α}
{x : α}
{r : Ordnode α}
(hl : l.Sized)
(hr : r.Sized)


theorem pow_div_pow_eventuallyEq_atBot {p q : ℕ} :
    (fun x : 𝕜 => x ^ p / x ^ q) =ᶠ[atBot] fun x => x ^ ((p : ℤ) - q)

{𝕜 : Type u_1}
[LinearOrderedField 𝕜]
{p q : ℕ}

(fun x => x ^ p / x ^ q) =ᶠ[Filter.atBot] fun x => x ^ (↑p - ↑q)


/-- The duality equivalence `WalkingSpanᵒᵖ ≌ WalkingCospan` -/
@[simps!]
def walkingSpanOpEquiv : WalkingSpanᵒᵖ ≌ WalkingCospan

(X : CategoryTheory.Limits.WidePullbackShape CategoryTheory.Limits.WalkingPair)

CategoryTheory.Limits.walkingSpanOpEquiv.counitIso.inv.app X = 𝟙 X


theorem Asymptotics.IsBigO.trans_tendsto_norm_atTop {α : Type*} {u v : α → 𝕜} {l : Filter α}
    (huv : u =O[l] v) (hu : Tendsto (fun x => ‖u x‖) l atTop) :
    Tendsto (fun x => ‖v x‖) l atTop

(hu : Filter.Tendsto (fun x => ‖u x‖) l Filter.atTop)

Filter.Tendsto (fun x => ‖v x‖) l Filter.atTop


theorem bound : ∃ C : ℝ, 0 < C ∧ ∀ m, ‖f m‖ ≤ C * ∏ i, ‖m i‖

[(i : ι) → SeminormedAddCommGroup (E i)]

∃ C, 0 < C ∧ ∀ (m : (i : ι) → E i), ‖f m‖ ≤ C * ∏ i : ι, ‖m i‖


/-- If `p ≠ 0` and `p ≠ 1`, then `padicValRat p p` is `1`. -/
theorem self (hp : 1 < p) : padicValRat p p = 1


theorem conj_tsum (f : α → 𝕜) : conj (∑' a, f a) = ∑' a, conj (f a)

{α : Type u_1}
{𝕜 : Type u_2}
[RCLike 𝕜]
(f : α → 𝕜)

(starRingEnd 𝕜) (∑' (a : α), f a) = ∑' (a : α), (starRingEnd 𝕜) (f a)


@[to_additive (attr := simp)] lemma mabs_eq_one : |a|ₘ = 1 ↔ a = 1

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

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


@[simp]
theorem getI_cons_succ : getI (x :: xs) (n + 1) = getI xs n

{α : Type u}
(x : α)
(xs : List α)
(n : ℕ)
[Inhabited α]


/-- Turning an edge in the spanning tree into a loop gives the identity loop. -/
theorem loopOfHom_eq_id {a b : Generators G} (e) (H : e ∈ wideSubquiverSymmetrify T a b) :
    loopOfHom T (of e) = 𝟙 (root' T)

(T : WideSubquiver (Quiver.Symmetrify (IsFreeGroupoid.Generators G)))

[Quiver.Arborescence (WideSubquiver.toType (Quiver.Symmetrify (IsFreeGroupoid.Generators G)) T)]

(H : e ∈ Quiver.wideSubquiverSymmetrify T a b)

IsFreeGroupoid.SpanningTree.loopOfHom T (IsFreeGroupoid.of e) = 𝟙 (IsFreeGroupoid.SpanningTree.root' T)


theorem Periodic.sub_const [AddCommGroup α] (h : Periodic f c) (a : α) :
    Periodic (fun x => f (x - a)) c

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

Function.Periodic (fun x => f (x - a)) c


@[simp, norm_cast]
theorem coe_filter (s : Finset α) : ↑(s.filter p) = ({ x ∈ ↑s | p x } : Set α)

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

↑(Finset.filter p s) = {x | x ∈ s ∧ p x}


/-- A consequence of the special adjoint functor theorem: if `C` is complete, well-powered and
    has a small coseparating set, then it is cocomplete. -/
theorem hasColimits_of_hasLimits_of_isCoseparating [HasLimits C] [WellPowered C] {𝒢 : Set C}
    [Small.{v} 𝒢] (h𝒢 : IsCoseparating 𝒢) : HasColimits C

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Limits.HasLimits C]
[CategoryTheory.WellPowered C]
{𝒢 : Set C}
[Small.{v, u} ↑𝒢]
(h𝒢 : CategoryTheory.IsCoseparating 𝒢)


@[simp] theorem size_mkArray (n : Nat) (v : α) : (mkArray n v).size = n


theorem evalAt_apply : evalAt g X f = (X f) g

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{G : Type u_4}
[TopologicalSpace G]
[ChartedSpace H G]
[Monoid G]
[SmoothMul I G]
(g : G)
(X : LeftInvariantDerivation I G)
(f : C^⊤⟮I, G; 𝓘(𝕜, 𝕜), 𝕜⟯)

((LeftInvariantDerivation.evalAt g) X) f = (X f) g


theorem noMaxOrder {c} (h : ℵ₀ ≤ c) : NoMaxOrder c.ord.out.α


@[simp]
theorem cyclicPermutations_eq_nil_iff {l : List α} : cyclicPermutations l = [[]] ↔ l = []


@[simp]
theorem span_int_eq {M : Type*} [AddCommGroup M] (s : AddSubgroup M) :
    (span ℤ (s : Set M)).toAddSubgroup = s

{M : Type u_9}
[AddCommGroup M]
(s : AddSubgroup M)


theorem tan_periodic : Function.Periodic tan π


theorem Ici_iSup₂ (f : ∀ i, κ i → α) : Ici (⨆ (i) (j), f i j) = ⋂ (i) (j), Ici (f i j)

{α : Type u_1}
{ι : Sort u_4}
{κ : ι → Sort u_7}
[CompleteLattice α]
(f : (i : ι) → κ i → α)

Set.Ici (⨆ i, ⨆ j, f i j) = ⋂ i, ⋂ j, Set.Ici (f i j)


@[simp]
theorem isoApp_trans {X Y Z : DifferentialObject S C} (f : X ≅ Y) (g : Y ≅ Z) :
    isoApp (f ≪≫ g) = isoApp f ≪≫ isoApp g

{X Y Z : CategoryTheory.DifferentialObject S C}

CategoryTheory.DifferentialObject.isoApp (f ≪≫ g) =
  CategoryTheory.DifferentialObject.isoApp f ≪≫ CategoryTheory.DifferentialObject.isoApp g


@[ext]
theorem ext {f g : L₁ ≃ₗ⁅R⁆ L₂} (h : ∀ x, f x = g x) : f = g

{R : Type u}
{L₁ : Type v}
{L₂ : Type w}
[CommRing R]
[LieRing L₁]
[LieRing L₂]
[LieAlgebra R L₁]
[LieAlgebra R L₂]
{f g : L₁ ≃ₗ⁅R⁆ L₂}
(h : ∀ (x : L₁), f x = g x)


@[simp] lemma op_f' (h : S.RightHomologyData) :
    h.op.f' = h.g'.op


@[simp]
theorem openSegment_same (x : E) : openSegment 𝕜 x x = {x}

(𝕜 : Type u_1)
{E : Type u_2}
[OrderedRing 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[Nontrivial 𝕜]
[DenselyOrdered 𝕜]
(x : E)


@[simp]
theorem FamilyOfElements.compPresheafMap_comp (x : FamilyOfElements P R) (f : P ⟶ Q)
    (g : Q ⟶ U) : (x.compPresheafMap f).compPresheafMap g = x.compPresheafMap (f ≫ g)

{P Q U : CategoryTheory.Functor Cᵒᵖ (Type w)}

(x : CategoryTheory.Presieve.FamilyOfElements P R)

CategoryTheory.Presieve.FamilyOfElements.compPresheafMap g
    (CategoryTheory.Presieve.FamilyOfElements.compPresheafMap f x) =
  CategoryTheory.Presieve.FamilyOfElements.compPresheafMap (CategoryTheory.CategoryStruct.comp f g) x


@[to_additive three_nsmul]
lemma pow_three (a : M) : a ^ 3 = a * (a * a)


@[simp]
theorem lift_mk (f : { f : α → α → β // ∀ a₁ a₂, f a₁ a₂ = f a₂ a₁ }) (a₁ a₂ : α) :
    lift f s(a₁, a₂) = (f : α → α → β) a₁ a₂

(f : { f // ∀ (a₁ a₂ : α), f a₁ a₂ = f a₂ a₁ })


theorem isOrderRightAdjoint_sSup [CompleteLattice α] [Preorder β] (f : α → β) :
    IsOrderRightAdjoint f fun y => sSup { x | f x ≤ y }

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

IsOrderRightAdjoint f fun y => sSup {x | f x ≤ y}


/-- Flip the arguments of a bifunctor. See also `Currying.lean`. -/
@[simps]
protected def flip (F : C ⥤ D ⥤ E) : D ⥤ C ⥤ E

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

∀ {X Y : C} (f : X ⟶ Y), (F.flip.obj k).map f = (F.map f).app k


/-- Invertibility on either side of a monoid hom with a left-inverse is equivalent. -/
@[simps]
def invertibleEquivOfLeftInverse {R : Type*} {S : Type*} {F G : Type*} [Monoid R] [Monoid S]
    [FunLike F R S] [MonoidHomClass F R S] [FunLike G S R] [MonoidHomClass G S R]
    (f : F) (g : G) (r : R) (h : Function.LeftInverse g f) : Invertible (f r) ≃ Invertible r

{R : Type u_1}
{S : Type u_2}
{F : Type u_3}
{G : Type u_4}
[Monoid R]
[Monoid S]
[FunLike F R S]
[MonoidHomClass F R S]
[FunLike G S R]
[MonoidHomClass G S R]
(f : F)
(g : G)
(r : R)
(h : Function.LeftInverse ⇑g ⇑f)

∀ (x : Invertible r), (invertibleEquivOfLeftInverse f g r h).symm x = Invertible.map f r


/-- Reindexing a simplex produces one with the same set of points. -/
@[simp]
theorem reindex_range_points {m n : ℕ} (s : Simplex k P m) (e : Fin (m + 1) ≃ Fin (n + 1)) :
    Set.range (s.reindex e).points = Set.range s.points

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{m n : ℕ}
(s : Affine.Simplex k P m)
(e : Fin (m + 1) ≃ Fin (n + 1))


@[to_additive]
theorem mulIndicator_mul' (s : Set α) (f g : α → M) :
    mulIndicator s (f * g) = mulIndicator s f * mulIndicator s g

{α : Type u_1}
{M : Type u_4}
[MulOneClass M]
(s : Set α)
(f g : α → M)

s.mulIndicator (f * g) = s.mulIndicator f * s.mulIndicator g


/-- The composition of isometries is an isometry. -/
theorem comp {g : β → γ} {f : α → β} (hg : Isometry g) (hf : Isometry f) : Isometry (g ∘ f)

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


theorem derivWithin_zero_of_nmem_closure (h : x ∉ closure s) : derivWithin f s x = 0

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : 𝕜 → F}
{x : 𝕜}
{s : Set 𝕜}
(h : x ∉ closure s)


theorem isUpperSet_Ici : IsUpperSet (Ici a)


@[simp]
lemma toRows₁_apply (A : Matrix (m₁ ⊕ m₂) n R) (i : m₁) (j : n) :
    (toRows₁ A) i j = A (Sum.inl i) j

{R : Type u_1}
{m₁ : Type u_3}
{m₂ : Type u_4}
{n : Type u_5}
(A : Matrix (m₁ ⊕ m₂) n R)
(i : m₁)
(j : n)


theorem Real.Angle.coe_expMapCircle (θ : Real.Angle) :
    (θ.expMapCircle : ℂ) = θ.cos + θ.sin * I

↑θ.expMapCircle = ↑θ.cos + ↑θ.sin * Complex.I


theorem abs_abv_sub_le_abv_sub (a b : R) : abs (abv a - abv b) ≤ abv (a - b)

{R : Type u_5}
{S : Type u_6}
[Ring R]
[LinearOrderedCommRing S]
(abv : AbsoluteValue R S)
(a b : R)


theorem mapIdxGo_length : ∀ (f : ℕ → α → β) (l : List α) (arr : Array β),
    length (mapIdx.go f l arr) = length l + arr.size

{α : Type u}
{β : Type v}
(f : ℕ → α → β)
(l : List α)
(arr : Array β)

(List.mapIdx.go f l arr).length = l.length + arr.size


lemma add_def (P Q : W.Point) : P.add Q = P + Q

{F : Type u}
[Field F]
{W : WeierstrassCurve.Affine F}
(P Q : W.Point)


theorem ManyOneEquiv.le_congr_left {α β γ} [Primcodable α] [Primcodable β] [Primcodable γ]
    {p : α → Prop} {q : β → Prop} {r : γ → Prop} (h : ManyOneEquiv p q) : p ≤₀ r ↔ q ≤₀ r

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

p ≤₀ r ↔ q ≤₀ r


theorem factorization_eq_zero_iff (n p : ℕ) :
    n.factorization p = 0 ↔ ¬p.Prime ∨ ¬p ∣ n ∨ n = 0

n.factorization p = 0 ↔ ¬Nat.Prime p ∨ ¬p ∣ n ∨ n = 0


/-- The product of `M`-regular elements is `M`-regular. -/
theorem smul (ra : IsSMulRegular M a) (rs : IsSMulRegular M s) : IsSMulRegular M (a • s)

{R : Type u_1}
{S : Type u_2}
{M : Type u_3}
{a : R}
{s : S}
[SMul R M]
[SMul R S]
[SMul S M]
[IsScalarTower R S M]
(ra : IsSMulRegular M a)
(rs : IsSMulRegular M s)


@[simp]
theorem pointwise_smul_le_pointwise_smul_iff {a : α} {S T : Submonoid M} : a • S ≤ a • T ↔ S ≤ T

{α : Type u_1}
{M : Type u_3}
[Monoid M]
[Group α]
[MulDistribMulAction α M]
{a : α}
{S T : Submonoid M}


@[to_additive]
lemma ofUnits_iSup₂ {ι : Sort*} {κ : ι → Sort*} (f : (i : ι) → κ i → Subgroup Mˣ) :
    (⨆ (i : ι), ⨆ (j : κ i), f i j).ofUnits = ⨆ (i : ι), ⨆ (j : κ i), (f i j).ofUnits

{M : Type u_1}
[Monoid M]
{ι : Sort u_2}
{κ : ι → Sort u_3}
(f : (i : ι) → κ i → Subgroup Mˣ)

(⨆ i, ⨆ j, f i j).ofUnits = ⨆ i, ⨆ j, (f i j).ofUnits


@[simp]
theorem basisFun_equivFun : (basisFun p 𝕜 ι).equivFun = WithLp.linearEquiv p 𝕜 (ι → 𝕜)

(p : ℝ≥0∞)
(𝕜 : Type u_1)
(ι : Type u_2)
[Finite ι]
[Ring 𝕜]

(PiLp.basisFun p 𝕜 ι).equivFun = WithLp.linearEquiv p 𝕜 (ι → 𝕜)


theorem Continuous.strictMono_of_inj_boundedOrder [BoundedOrder α] {f : α → δ}
    (hf_c : Continuous f) (hf : f ⊥ ≤ f ⊤) (hf_i : Injective f) : StrictMono f

{α : Type u}
[ConditionallyCompleteLinearOrder α]
[TopologicalSpace α]
[OrderTopology α]
[DenselyOrdered α]
{δ : Type u_1}
[LinearOrder δ]
[TopologicalSpace δ]
[OrderClosedTopology δ]
[BoundedOrder α]
{f : α → δ}
(hf_c : Continuous f)
(hf : f ⊥ ≤ f ⊤)
(hf_i : Function.Injective f)


/-- If `J(a | b)` is `-1`, then `a` is not a square modulo `b`. -/
theorem nonsquare_of_jacobiSym_eq_neg_one {a : ℤ} {b : ℕ} (h : J(a | b) = -1) :
    ¬IsSquare (a : ZMod b)

{a : ℤ}
{b : ℕ}
(h : jacobiSym a b = -1)


/-- Given `I : S.Arrow` and a morphism `g : Z ⟶ I.Y`, this is the obvious relation
from `I.precomp g` to `I`. -/
@[simps]
def Arrow.precompRelation {S : J.Cover X} (I : S.Arrow) {Z : C} (g : Z ⟶ I.Y) :
    (I.precomp g).Relation I

{J : CategoryTheory.GrothendieckTopology C}

(I.precompRelation g).g₁ = CategoryTheory.CategoryStruct.id (I.precomp g).Y


/-- Constructor for `Cover.Relation` which takes as an input
`r : I₁.Relation I₂` with `I₁ I₂ : S.Arrow`. -/
@[simps]
def Relation.mk' {S : J.Cover X} {fst snd : S.Arrow} (r : fst.Relation snd) :
    S.Relation

(CategoryTheory.GrothendieckTopology.Cover.Relation.mk' r).fst = fst


theorem Integrable.mono' {f : α → β} {g : α → ℝ} (hg : Integrable g μ)
    (hf : AEStronglyMeasurable f μ) (h : ∀ᵐ a ∂μ, ‖f a‖ ≤ g a) : Integrable f μ

(hf : MeasureTheory.AEStronglyMeasurable f μ)


@[simp]
theorem coe_vadd : ↑(x +ᵥ z) = (x + z : ℂ)


/-- Define a closure operator from a predicate that's preserved under infima. -/
@[simps!]
def ofCompletePred (p : α → Prop) (hsinf : ∀ s, (∀ a ∈ s, p a) → p (sInf s)) : ClosureOperator α

(hsinf : ∀ (s : Set α), (∀ a ∈ s, p a) → p (sInf s))

∀ (a : α), (ClosureOperator.ofCompletePred p hsinf).IsClosed a = p a


theorem Subsingleton.induction_on {p : Set α → Prop} (hs : s.Subsingleton) (he : p ∅)
    (h₁ : ∀ x, p {x}) : p s

{α : Type u}
{s : Set α}
{p : Set α → Prop}
(hs : s.Subsingleton)
(he : p ∅)
(h₁ : ∀ (x : α), p {x})


theorem mk_equiv_le_embedding : #(α ≃ β') ≤ #(α ↪ β')


/-- If the `n`th coefficient of a formal power series is nonzero,
then the order of the power series is less than or equal to `n`. -/
theorem order_le (n : ℕ) (h : coeff R n φ ≠ 0) : order φ ≤ n

{R : Type u_1}
[Semiring R]
{φ : PowerSeries R}
(n : ℕ)
(h : (PowerSeries.coeff R n) φ ≠ 0)


theorem comap_sigmaMk_nhds (i : ι) (x : σ i) : comap (Sigma.mk i) (𝓝 ⟨i, x⟩) = 𝓝 x

{ι : Type u_5}
{σ : ι → Type u_7}
[(i : ι) → TopologicalSpace (σ i)]
(i : ι)
(x : σ i)

Filter.comap (Sigma.mk i) (𝓝 ⟨i, x⟩) = 𝓝 x


theorem enum_type {α β} {r : α → α → Prop} {s : β → β → Prop} [IsWellOrder α r] [IsWellOrder β s]
    (f : s ≺i r) {h : type s < type r} : enum r (type s) h = f.top

{α β : Type u_3}
{r : α → α → Prop}
{s : β → β → Prop}
[IsWellOrder α r]
[IsWellOrder β s]
(f : s ≺i r)
{h : Ordinal.type s < Ordinal.type r}

Ordinal.enum r (Ordinal.type s) h = f.top


/-- Addition of rational functions. -/
protected irreducible_def add : RatFunc K → RatFunc K → RatFunc K

∀ (x x_1 : RatFunc K),
  x.add x_1 =
    match x, x_1 with
    | { toFractionRing := p }, { toFractionRing := q } => { toFractionRing := p + q }


theorem res_mk_eq_mk_pullback {Y X : C} {P : Cᵒᵖ ⥤ D} {S : J.Cover X} (x : Meq P S) (f : Y ⟶ X) :
    (J.plusObj P).map f.op (mk x) = mk (x.pullback f)

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

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

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

((J.plusObj P).map f.op) (CategoryTheory.GrothendieckTopology.Plus.mk x) =
  CategoryTheory.GrothendieckTopology.Plus.mk (x.pullback f)


protected theorem map_eq_zero_iff (hf : Function.Injective f) : p.map f = 0 ↔ p = 0

{R : Type u}
{S : Type v}
[Semiring R]
{p : R[X]}
[Semiring S]
{f : R →+* S}
(hf : Function.Injective ⇑f)


/-- **Ruzsa's triangle inequality**. Division version. -/
@[to_additive "**Ruzsa's triangle inequality**. Subtraction version."]
theorem ruzsa_triangle_inequality_div_div_div (A B C : Finset α) :
    (A / C).card * B.card ≤ (A / B).card * (B / C).card

{α : Type u_1}
[AddCommGroup α]
[DecidableEq α]
(A B C : Finset α)

(A - C).card * B.card ≤ (A - B).card * (B - C).card


@[simp]
theorem toList_one : toList (1 : Perm α) x = []

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


theorem range_comp (f : A →ₐ[R] B) (g : B →ₐ[R] C) : (g.comp f).range = f.range.map g

{R : Type u}
{A : Type v}
{B : Type w}
{C : Type w'}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[Semiring B]
[Algebra R B]
[Semiring C]
[Algebra R C]
(f : A →ₐ[R] B)
(g : B →ₐ[R] C)

(g.comp f).range = Subalgebra.map g f.range


theorem StrictMono.const_mul [PosMulStrictMono α]
    (hf : StrictMono f) (ha : 0 < a) : StrictMono fun x => a * f x

{α : Type u}
{β : Type u_1}
[Semiring α]
[PartialOrder α]
{a : α}
[Preorder β]
{f : β → α}
[PosMulStrictMono α]
(hf : StrictMono f)
(ha : 0 < a)


theorem Perm.fold_op_eq {l₁ l₂ : List α} {a : α} (h : l₁ ~ l₂) : (l₁ <*> a) = l₂ <*> a

{α : Type u_1}
{op : α → α → α}
[IA : Std.Associative op]
[IC : Std.Commutative op]
{l₁ l₂ : List α}
{a : α}
(h : l₁.Perm l₂)


@[simp]
theorem zipWith_single_single (f : M → N → P) (hf : f 0 0 = 0) (a : α) (m : M) (n : N) :
    zipWith f hf (single a m) (single a n) = single a (f m n)

{α : Type u_1}
{M : Type u_5}
{N : Type u_7}
{P : Type u_8}
[Zero M]
[Zero N]
[Zero P]
(f : M → N → P)
(hf : f 0 0 = 0)
(a : α)
(m : M)
(n : N)

Finsupp.zipWith f hf (Finsupp.single a m) (Finsupp.single a n) = Finsupp.single a (f m n)


@[simp]
theorem star_moveLeft (x) : star.moveLeft x = 0


@[to_additive]
theorem mem_smul_set : x ∈ a • t ↔ ∃ y, y ∈ t ∧ a • y = x

{α : Type u_2}
{β : Type u_3}
[VAdd α β]
{t : Set β}
{a : α}
{x : β}


protected theorem sup_eq_right {a b : CauSeq α abs} (h : a ≤ b) : a ⊔ b ≈ b

{α : Type u_1}
[LinearOrderedField α]
{a b : CauSeq α abs}
(h : a ≤ b)


theorem monotone_lam {f : α → β → γ} (hf : ∀ b, Monotone fun a ↦ f a b) : Monotone f

{f : α → β → γ}

(hf : ∀ (b : β), Monotone fun a => f a b)


lemma isLocallySurjective_whisker [H.IsCocontinuous J K] [IsLocallySurjective K f] :
    IsLocallySurjective J (whiskerLeft H.op f)

(J : CategoryTheory.GrothendieckTopology C)

(K : CategoryTheory.GrothendieckTopology D)

CategoryTheory.Presheaf.IsLocallySurjective J (CategoryTheory.whiskerLeft H.op f)


@[simp]
theorem map_one : map (one A B) = one (PontryaginDual B) (PontryaginDual A)

{A : Type u_1}
{B : Type u_2}
[Monoid A]
[Monoid B]
[TopologicalSpace A]
[TopologicalSpace B]

PontryaginDual.map (ContinuousMonoidHom.one A B) = ContinuousMonoidHom.one (PontryaginDual B) (PontryaginDual A)


@[to_additive]
theorem prod_map_eq_pow_single [DecidableEq ι] (i : ι)
    (hf : ∀ i' ≠ i, i' ∈ m → f i' = 1) : (m.map f).prod = f i ^ m.count i

(hf : ∀ (i' : ι), i' ≠ i → i' ∈ m → f i' = 0)

(Multiset.map f m).sum = Multiset.count i m • f i


theorem unbounded_le_inter_le [LinearOrder α] (a : α) :
    Unbounded (· ≤ ·) (s ∩ { b | a ≤ b }) ↔ Unbounded (· ≤ ·) s

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

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


@[simp]
theorem sSup_empty : sSup (∅ : Set ℝ) = 0


@[to_additive (attr := simp)]
theorem mulIndicator_univ (f : α → M) : mulIndicator (univ : Set α) f = f

{α : Type u_1}
{M : Type u_4}
[One M]
(f : α → M)


theorem fg_of_fg_map_injective (f : M →ₗ[R] P) (hf : Function.Injective f) {N : Submodule R M}
    (hfn : (N.map f).FG) : N.FG

{R : Type u_1}
{M : Type u_2}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{P : Type u_3}
[AddCommMonoid P]
[Module R P]
(f : M →ₗ[R] P)
(hf : Function.Injective ⇑f)
{N : Submodule R M}
(hfn : (Submodule.map f N).FG)


@[to_additive]
theorem eq_one_of_mul_le_one_left (ha : 1 ≤ a) (hb : 1 ≤ b) (hab : a * b ≤ 1) : a = 1

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


@[simp]
theorem toDual_sup [Sup α] (a b : α) : toDual (a ⊔ b) = toDual a ⊓ toDual b

OrderDual.toDual (a ⊔ b) = OrderDual.toDual a ⊓ OrderDual.toDual b


/-- Variant of `MeasureTheory.Integrable.mono` taking `f =O[⊤] (g)` instead of `‖f(x)‖ ≤ ‖g(x)‖` -/
theorem _root_.Asymptotics.IsBigO.integrable (hfm : AEStronglyMeasurable f μ)
    (hf : f =O[⊤] g) (hg : Integrable g μ) : Integrable f μ

(hfm : MeasureTheory.AEStronglyMeasurable f μ)


@[to_additive le_add_of_nonneg_left]
theorem le_mul_of_one_le_left' [CovariantClass α α (swap (· * ·)) (· ≤ ·)] {a b : α} (h : 1 ≤ b) :
    a ≤ b * a

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


@[to_additive (attr := simp) zero_mem_addCenter]
theorem one_mem_center : (1 : M) ∈ Set.center M


/-- If a sequence of functions is uniformly Cauchy on a set, then the values at each point form
a Cauchy sequence.  See `UniformCauchSeqOn.cauchy_map` for the non-`atTop` case. -/
theorem UniformCauchySeqOn.cauchySeq [Nonempty ι] [SemilatticeSup ι]
    (hf : UniformCauchySeqOn F atTop s) (hx : x ∈ s) :
    CauchySeq fun i ↦ F i x

{F : ι → α → β}

(hf : UniformCauchySeqOn F Filter.atTop s)


@[simp] theorem toFin_ofNat (x : Nat) : toFin (BitVec.ofNat w x) = Fin.ofNat' x (Nat.two_pow_pos w)

(BitVec.ofNat w x).toFin = Fin.ofNat' x ⋯


theorem smul_sup (a : α) (S T : Subgroup G) : a • (S ⊔ T) = a • S ⊔ a • T

{α : Type u_1}
{G : Type u_2}
[Group G]
[Monoid α]
[MulDistribMulAction α G]
(a : α)
(S T : Subgroup G)


theorem IsPrefix.length_le (h : l₁ <+: l₂) : l₁.length ≤ l₂.length

∀ {α : Type u_1} {l₁ l₂ : List α}, l₁ <+: l₂ → l₁.length ≤ l₂.length


theorem dvd_mul [DecompositionMonoid α] {k m n : α} :
    k ∣ m * n ↔ ∃ d₁ d₂, d₁ ∣ m ∧ d₂ ∣ n ∧ k = d₁ * d₂

{α : Type u_1}
[CommSemigroup α]
[DecompositionMonoid α]
{k m n : α}


theorem isFibAux_two_mul_done {n a b n' a' : ℕ} (H : IsFibAux n a b)
    (hn : 2 * n = n') (h : a * (2 * b - a) = a') : fib n' = a'

(H : Mathlib.Meta.NormNum.IsFibAux n a b)


/-- The pair `f g : A ⟶ B` is reflexive if there is a morphism `B ⟶ A` which is a section for both.
-/
class IsReflexivePair (f g : A ⟶ B) : Prop where
  common_section' : ∃ s : B ⟶ A, s ≫ f = 𝟙 B ∧ s ≫ g = 𝟙 B

[self : CategoryTheory.IsReflexivePair f g]

∃ s,
  CategoryTheory.CategoryStruct.comp s f = CategoryTheory.CategoryStruct.id B ∧
    CategoryTheory.CategoryStruct.comp s g = CategoryTheory.CategoryStruct.id B


theorem trunc_coe_eq_self {n} {f : R[X]} (hn : natDegree f < n) : trunc n (f : R⟦X⟧) = f

{R : Type u_2}
[CommSemiring R]
{n : ℕ}
{f : Polynomial R}
(hn : f.natDegree < n)


@[simp] lemma pow_eq_zero_iff (hn : n ≠ 0) : a ^ n = 0 ↔ a = 0

{M₀ : Type u_2}
[MonoidWithZero M₀]
{a : M₀}
{n : ℕ}
[NoZeroDivisors M₀]
(hn : n ≠ 0)


@[simp]
theorem nonempty_subtype {α} {p : α → Prop} : Nonempty (Subtype p) ↔ ∃ a : α, p a


@[simp]
theorem singletonSubgraph_le_iff (v : V) (H : G.Subgraph) :
    G.singletonSubgraph v ≤ H ↔ v ∈ H.verts

{V : Type u}
{G : SimpleGraph V}
(v : V)
(H : G.Subgraph)


protected theorem neg_add_cancel_right (a b : Int) : a + -b + b = a


/-- A set `s` is Lindelöf if and only if
for every open cover of `s`, there exists a countable subcover. -/
theorem isLindelof_iff_countable_subcover :
    IsLindelof s ↔ ∀ {ι : Type u} (U : ι → Set X),
      (∀ i, IsOpen (U i)) → (s ⊆ ⋃ i, U i) → ∃ t : Set ι, t.Countable ∧ s ⊆ ⋃ i ∈ t, U i

{X : Type u}
[TopologicalSpace X]
{s : Set X}

IsLindelof s ↔
  ∀ {ι : Type u} (U : ι → Set X), (∀ (i : ι), IsOpen (U i)) → s ⊆ ⋃ i, U i → ∃ t, t.Countable ∧ s ⊆ ⋃ i ∈ t, U i


@[simp] lemma isRegular_X : IsRegular (X n : MvPolynomial σ R)

{R : Type u}
{σ : Type u_1}
{n : σ}
[CommSemiring R]


theorem iSup₂_le_iSup (κ : ι → Sort*) (f : ι → α) : ⨆ (i) (_ : κ i), f i ≤ ⨆ i, f i

{α : Type u_1}
{ι : Sort u_5}
[CompleteLattice α]
(κ : ι → Sort u_9)
(f : ι → α)


@[simp]
theorem curryFinFinset_symm_apply {k l n : ℕ} {s : Finset (Fin n)} (hk : s.card = k)
    (hl : sᶜ.card = l)
    (f : MultilinearMap R (fun _ : Fin k => M') (MultilinearMap R (fun _ : Fin l => M') M₂))
    (m : Fin n → M') :
    (curryFinFinset R M₂ M' hk hl).symm f m =
      f (fun i => m <| finSumEquivOfFinset hk hl (Sum.inl i)) fun i =>
        m <| finSumEquivOfFinset hk hl (Sum.inr i)

(f : MultilinearMap R (fun x => M') (MultilinearMap R (fun x => M') M₂))

((MultilinearMap.curryFinFinset R M₂ M' hk hl).symm f) m =
  (f fun i => m ((finSumEquivOfFinset hk hl) (Sum.inl i))) fun i => m ((finSumEquivOfFinset hk hl) (Sum.inr i))


@[simp]
lemma dual_dual :
    dual A K (dual A K I) = I

(A : Type u_1)
(K : Type u_2)
{L : Type u}
{B : Type u_3}
[CommRing A]
[Field K]
[CommRing B]
[Field L]
[Algebra A K]
[Algebra B L]
[Algebra A B]
[Algebra K L]
[Algebra A L]
[IsScalarTower A K L]
[IsScalarTower A B L]
[IsDomain A]
[IsFractionRing A K]
[IsIntegralClosure B A L]
[IsFractionRing B L]
[FiniteDimensional K L]
[Algebra.IsSeparable K L]
[IsIntegrallyClosed A]
[IsDedekindDomain B]
(I : FractionalIdeal B⁰ L)

FractionalIdeal.dual A K (FractionalIdeal.dual A K I) = I


private theorem candidates_refl (fA : f ∈ candidates X Y) : f (x, x) = 0

(fA : f ∈ GromovHausdorff.candidates X Y)


theorem SmoothAt.inv₀ (hf : SmoothAt I' I f a) (ha : f a ≠ 0) :
    SmoothAt I' I (fun x => (f x)⁻¹) a

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{H : Type u_2}
[TopologicalSpace H]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{I : ModelWithCorners 𝕜 E H}
{G : Type u_4}
[TopologicalSpace G]
[ChartedSpace H G]
[Inv G]
[Zero G]
[SmoothInv₀ I G]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M : Type u_7}
[TopologicalSpace M]
[ChartedSpace H' M]
{f : M → G}
{a : M}
(hf : SmoothAt I' I f a)
(ha : f a ≠ 0)


theorem image_diff {f : α → β} (hf : Injective f) (s t : Set α) : f '' (s \ t) = f '' s \ f '' t

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


theorem toOption_eq_none_iff {a : Part α} [Decidable a.Dom] : a.toOption = Option.none ↔ ¬a.Dom

{α : Type u_1}
{a : Part α}
[Decidable a.Dom]


@[to_additive]
theorem Supports.smul (g : H) (h : Supports G s b) : Supports G (g • s) (g • b)

{G : Type u_1}
{H : Type u_2}
{α : Type u_3}
{β : Type u_4}
[Group H]
[SMul G α]
[SMul G β]
[MulAction H α]
[SMul H β]
[SMulCommClass G H β]
[SMulCommClass G H α]
{s : Set α}
{b : β}
(g : H)
(h : MulAction.Supports G s b)


theorem hasZeroObject_unop [HasZeroObject Cᵒᵖ] : HasZeroObject C


theorem ofReal_add {p q : ℝ} (hp : 0 ≤ p) (hq : 0 ≤ q) :
    ENNReal.ofReal (p + q) = ENNReal.ofReal p + ENNReal.ofReal q


/-- Bundles an embedding satisfying the Tarski-Vaught test as an elementary embedding. -/
@[simps]
def toElementaryEmbedding (f : M ↪[L] N)
    (htv :
      ∀ (n : ℕ) (φ : L.BoundedFormula Empty (n + 1)) (x : Fin n → M) (a : N),
        φ.Realize default (Fin.snoc (f ∘ x) a : _ → N) →
          ∃ b : M, φ.Realize default (Fin.snoc (f ∘ x) (f b) : _ → N)) :
    M ↪ₑ[L] N

(htv :
  ∀ (n : ℕ) (φ : L.BoundedFormula Empty (n + 1)) (x : Fin n → M) (a : N),
    φ.Realize default (Fin.snoc (⇑f ∘ x) a) → ∃ b, φ.Realize default (Fin.snoc (⇑f ∘ x) (f b)))


private lemma u₄_eq_one_or_neg_one : S.u₄ = 1 ∨ S.u₄ = -1

(S : FermatLastTheoremForThreeGen.Solution hζ)

FermatLastTheoremForThreeGen.Solution.u₄ S = 1 ∨ FermatLastTheoremForThreeGen.Solution.u₄ S = -1


@[simp]
lemma id_hom₂ (A : Triangle C) : TriangleMorphism.hom₂ (𝟙 A) = 𝟙 _

(A : CategoryTheory.Pretriangulated.Triangle C)


@[simp]
theorem frobeniusEquiv_symm_apply_frobenius (x : R) :
    (frobeniusEquiv R p).symm (frobenius R p x) = x

(R : Type u_1)
(p : ℕ)
[CommSemiring R]
[ExpChar R p]
[PerfectRing R p]
(x : R)

(frobeniusEquiv R p).symm ((frobenius R p) x) = x


theorem mem_Spec_essImage (X : Scheme) : X ∈ Scheme.Spec.essImage ↔ IsAffine X

X ∈ AlgebraicGeometry.Scheme.Spec.essImage ↔ AlgebraicGeometry.IsAffine X


theorem eLpNormEssSup_indicator_eq_eLpNormEssSup_restrict {f : α → F} (hs : MeasurableSet s) :
    eLpNormEssSup (s.indicator f) μ = eLpNormEssSup f (μ.restrict s)

{α : Type u_1}
{F : Type u_3}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup F]
{s : Set α}
{f : α → F}
(hs : MeasurableSet s)

MeasureTheory.eLpNormEssSup (s.indicator f) μ = MeasureTheory.eLpNormEssSup f (μ.restrict s)


theorem Perm.union_left (l : List α) {t₁ t₂ : List α} (h : t₁ ~ t₂) : l ∪ t₁ ~ l ∪ t₂

{α : Type u_1}
[DecidableEq α]
(l : List α)
{t₁ t₂ : List α}
(h : t₁ ~ t₂)


/-- In a space with an inner regular measure, the everywhere positive subset of a measurable set
is itself everywhere positive. This is not obvious as `μ.everywherePosSubset s` is defined as
the points whose neighborhoods intersect `s` along positive measure subsets, but this does not
say they also intersect `μ.everywherePosSubset s` along positive measure subsets. -/
lemma isEverywherePos_everywherePosSubset
    [OpensMeasurableSpace α] [InnerRegular μ] (hs : MeasurableSet s) :
    μ.IsEverywherePos (μ.everywherePosSubset s)

{α : Type u_1}
[TopologicalSpace α]
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
{s : Set α}
[OpensMeasurableSpace α]
[μ.InnerRegular]
(hs : MeasurableSet s)


theorem algebraMap_X_pow (n : ℕ) : algebraMap R[X] R[T;T⁻¹] (X ^ n) = T n

(algebraMap R[X] R[T;T⁻¹]) (Polynomial.X ^ n) = LaurentPolynomial.T ↑n


@[to_additive] lemma IsSquare.zpow (n : ℤ) : IsSquare a → IsSquare (a ^ n)

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


/--
This typeclass captures properties shared by ℝ and ℂ, with an API that closely matches that of ℂ.
-/
class RCLike (K : semiOutParam Type*) extends DenselyNormedField K, StarRing K,
    NormedAlgebra ℝ K, CompleteSpace K where
  re : K →+ ℝ
  im : K →+ ℝ
  /-- Imaginary unit in `K`. Meant to be set to `0` for `K = ℝ`. -/
  I : K
  I_re_ax : re I = 0
  I_mul_I_ax : I = 0 ∨ I * I = -1
  re_add_im_ax : ∀ z : K, 𝓚 (re z) + 𝓚 (im z) * I = z
  ofReal_re_ax : ∀ r : ℝ, re (𝓚 r) = r
  ofReal_im_ax : ∀ r : ℝ, im (𝓚 r) = 0
  mul_re_ax : ∀ z w : K, re (z * w) = re z * re w - im z * im w
  mul_im_ax : ∀ z w : K, im (z * w) = re z * im w + im z * re w
  conj_re_ax : ∀ z : K, re (conj z) = re z
  conj_im_ax : ∀ z : K, im (conj z) = -im z
  conj_I_ax : conj I = -I
  norm_sq_eq_def_ax : ∀ z : K, ‖z‖ ^ 2 = re z * re z + im z * im z
  mul_im_I_ax : ∀ z : K, im z * im I = im z
  /-- only an instance in the `ComplexOrder` locale -/
  [toPartialOrder : PartialOrder K]
  le_iff_re_im {z w : K} : z ≤ w ↔ re z ≤ re w ∧ im z = im w
  -- note we cannot put this in the `extends` clause
  [toDecidableEq : DecidableEq K]

{K : semiOutParam (Type u_1)}
[self : RCLike K]
(z : K)

RCLike.im z * RCLike.im RCLike.I = RCLike.im z


theorem norm_indicatorConstLp_le :
    ‖indicatorConstLp p hs hμs c‖ ≤ ‖c‖ * (μ s).toReal ^ (1 / p.toReal)

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup E]
{s : Set α}
{hs : MeasurableSet s}
{hμs : μ s ≠ ⊤}
{c : E}

‖MeasureTheory.indicatorConstLp p hs hμs c‖ ≤ ‖c‖ * (μ s).toReal ^ (1 / p.toReal)


theorem liftPropOn_of_liftProp (mono : ∀ ⦃s x t⦄ ⦃f : H → H'⦄, t ⊆ s → P f s x → P f t x)
    (h : LiftProp P g) : LiftPropOn P g s

(mono : ∀ ⦃s : Set H⦄ ⦃x : H⦄ ⦃t : Set H⦄ ⦃f : H → H'⦄, t ⊆ s → P f s x → P f t x)


/-- If `f` and `f'` commute with `g`, then `f ∘ f'` commutes with `g` as well. -/
nonrec theorem comp_left (h : Commute f g) (h' : Commute f' g) : Commute (f ∘ f') g

{α : Type u_1}
{f f' g : α → α}
(h : Function.Commute f g)
(h' : Function.Commute f' g)


theorem uncurry_injective : Function.Injective (uncurry : (Y ⟶ A ⟹ X) → (A ⨯ Y ⟶ X))


theorem zpow_le_one_of_nonpos (ha : 1 ≤ a) (hn : n ≤ 0) : a ^ n ≤ 1

{α : Type u_1}
[LinearOrderedSemifield α]
{a : α}
{n : ℤ}
(ha : 1 ≤ a)
(hn : n ≤ 0)


@[simp]
theorem linear_eq_sumCoords (i : ι) : (b.coord i).linear = -(b.basisOf i).sumCoords

{ι : Type u_1}
{k : Type u_3}
{V : Type u_4}
{P : Type u_5}
[AddCommGroup V]
[AffineSpace V P]
[Ring k]
[Module k V]
(b : AffineBasis ι k P)
(i : ι)


@[simp]
theorem fst_apply (x : M × M₂) : fst R M M₂ x = x.1

{R : Type u}
{M : Type v}
{M₂ : Type w}
[Semiring R]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R M₂]
(x : M × M₂)


/-- The functorial factorization axiom for two classes of morphisms `W₁` and `W₂` in a
category `C`. It asserts that any morphism can be factored in a functorial manner
as a morphism in `W₁` followed by a morphism in `W₂`. -/
class HasFunctorialFactorization : Prop where
  nonempty_functorialFactorizationData : Nonempty (FunctorialFactorizationData W₁ W₂)

{W₁ W₂ : CategoryTheory.MorphismProperty C}

[self : W₁.HasFunctorialFactorization W₂]


@[simp]
lemma KaehlerDifferential.polynomialEquiv_D (P) :
    polynomialEquiv R (D R R[X] P) = derivative P

(R : Type u)
[CommRing R]
(P : Polynomial R)

(KaehlerDifferential.polynomialEquiv R) ((KaehlerDifferential.D R (Polynomial R)) P) = Polynomial.derivative P


/-- The cofork map in the coequalizer diagram we will construct. -/
@[simps]
def FreeCoequalizer.π : (Monad.free T).obj X.A ⟶ X

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{T : CategoryTheory.Monad C}
(X : T.Algebra)

(CategoryTheory.Monad.FreeCoequalizer.π X).f = X.a


@[simp]
theorem neg_right_iff {N : Type*} [AddCommGroup N] [TopologicalSpace N] [TopologicalAddGroup N]
    {v : VectorMeasure α M} {w : VectorMeasure α N} : v ⟂ᵥ -w ↔ v ⟂ᵥ w

{α : Type u_1}
{m : MeasurableSpace α}
{M : Type u_4}
[AddCommMonoid M]
[TopologicalSpace M]
{N : Type u_6}
[AddCommGroup N]
[TopologicalSpace N]
[TopologicalAddGroup N]
{v : MeasureTheory.VectorMeasure α M}
{w : MeasureTheory.VectorMeasure α N}

v ⟂ᵥ -w ↔ v ⟂ᵥ w


theorem sameCycle_comm : SameCycle f x y ↔ SameCycle f y x

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


theorem C_mul_eq_smul {r : R} {x : HahnSeries Γ R} : C r * x = r • x

{Γ : Type u_1}
{R : Type u_3}
[OrderedCancelAddCommMonoid Γ]
[Semiring R]
{r : R}
{x : HahnSeries Γ R}


theorem lt_of_strongLT [Nonempty ι] (h : a ≺ b) : a < b

{ι : Type u_1}
{π : ι → Type u_4}
[(i : ι) → Preorder (π i)]
{a b : (i : ι) → π i}
[Nonempty ι]
(h : StrongLT a b)


theorem subset_seqClosure {s : Set X} : s ⊆ seqClosure s

{X : Type u_1}
[TopologicalSpace X]
{s : Set X}


/--
Shows that the partial numerators `aᵢ` of the continued fraction are equal to one and the partial
denominators `bᵢ` correspond to integers.
-/
theorem of_partNum_eq_one_and_exists_int_partDen_eq {gp : GenContFract.Pair K}
    (nth_s_eq : (of v).s.get? n = some gp) : gp.a = 1 ∧ ∃ z : ℤ, gp.b = (z : K)

(nth_s_eq : (GenContFract.of v).s.get? n = some gp)


theorem det_eq_elem_of_card_eq_one {A : Matrix n n R} (h : Fintype.card n = 1) (k : n) :
    det A = A k k

{n : Type u_2}
[DecidableEq n]
[Fintype n]
{R : Type v}
[CommRing R]
{A : Matrix n n R}
(h : Fintype.card n = 1)
(k : n)


@[simp]
theorem nodupKeys_cons {s : Sigma β} {l : List (Sigma β)} :
    NodupKeys (s :: l) ↔ s.1 ∉ l.keys ∧ NodupKeys l

{α : Type u}
{β : α → Type v}
{s : Sigma β}
{l : List (Sigma β)}

(s :: l).NodupKeys ↔ s.fst ∉ l.keys ∧ l.NodupKeys


lemma Exact.inr_fst : Function.Exact (LinearMap.inr R M N) (LinearMap.fst R M N)

{R : Type u_1}
{M : Type u_2}
{N : Type u_4}
[Semiring R]
[AddCommMonoid M]
[AddCommMonoid N]
[Module R M]
[Module R N]

Function.Exact ⇑(LinearMap.inr R M N) ⇑(LinearMap.fst R M N)