@[simp]
theorem val_mul : ∀ y1 y2 : HomogeneousLocalization 𝒜 x, (y1 * y2).val = y1.val * y2.val

{ι : Type u_1}
{R : Type u_2}
{A : Type u_3}
[AddCommMonoid ι]
[DecidableEq ι]
[CommRing R]
[CommRing A]
[Algebra R A]
{𝒜 : ι → Submodule R A}
[GradedAlgebra 𝒜]
{x : Submonoid A}
(y1 y2 : HomogeneousLocalization 𝒜 x)


theorem sZMod_eq_sMod (p : ℕ) (i : ℕ) : sZMod p i = (sMod p i : ZMod (2 ^ p - 1))

LucasLehmer.sZMod p i = ↑(LucasLehmer.sMod p i)


/-- Precomposing `f` with `Prod.fst` is continuous at `x : X × Y` -/
theorem ContinuousAt.fst'' {f : X → Z} {x : X × Y} (hf : ContinuousAt f x.fst) :
    ContinuousAt (fun x : X × Y => f x.fst) x

{X : Type u}
{Y : Type v}
{Z : Type u_1}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
{f : X → Z}
{x : X × Y}
(hf : ContinuousAt f x.1)


theorem cancel_factors_ne {α} [Field α] {a b ad bd a' b' gcd : α} (ha : ad * a = a')
    (hb : bd * b = b') (had : ad ≠ 0) (hbd : bd ≠ 0) (hgcd : gcd ≠ 0) :
    (a ≠ b) = (1 / gcd * (bd * a') ≠ 1 / gcd * (ad * b'))

{α : Type u_1}
[Field α]
{a b ad bd a' b' gcd : α}
(ha : ad * a = a')
(hb : bd * b = b')
(had : ad ≠ 0)
(hbd : bd ≠ 0)
(hgcd : gcd ≠ 0)


/-- A ring is a Jacobson ring if for every radical ideal `I`,
 the Jacobson radical of `I` is equal to `I`.
 See `isJacobson_iff_prime_eq` and `isJacobson_iff_sInf_maximal` for equivalent definitions. -/
class IsJacobson (R : Type*) [CommRing R] : Prop where
  out' : ∀ I : Ideal R, I.IsRadical → I.jacobson = I

{R : Type u_3}
[CommRing R]
[self : Ideal.IsJacobson R]
(I : Ideal R)


theorem IsOpen.mem_nhdsSet (hU : IsOpen s) : s ∈ 𝓝ˢ t ↔ t ⊆ s

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

s ∈ 𝓝ˢ t ↔ t ⊆ s


theorem map_iInf_comap_of_surjective (S : ι → L.Substructure N) :
    (⨅ i, (S i).comap f).map f = iInf S

{L : FirstOrder.Language}
{M : Type w}
{N : Type u_1}
[L.Structure M]
[L.Structure N]
{ι : Type u_3}
{f : L.Hom M N}
(hf : Function.Surjective ⇑f)
(S : ι → L.Substructure N)

FirstOrder.Language.Substructure.map f (⨅ i, FirstOrder.Language.Substructure.comap f (S i)) = iInf S


@[simp, norm_cast] theorem ext_iff' {a b : ℍ} : (a : ℂ) = b ↔ a = b


theorem dualAnnihilator_iSup_eq {ι : Sort*} (U : ι → Submodule R M) :
    (⨆ i : ι, U i).dualAnnihilator = ⨅ i : ι, (U i).dualAnnihilator

{R : Type u}
{M : Type v}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
{ι : Sort u_1}
(U : ι → Submodule R M)

(⨆ i, U i).dualAnnihilator = ⨅ i, (U i).dualAnnihilator


@[measurability]
theorem Measurable.coe_real_ereal {f : α → ℝ} (hf : Measurable f) :
    Measurable fun x => (f x : EReal)

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


theorem getElem?_len_le (a : Array α) {i : Nat} (h : a.size ≤ i) : a[i]? = none

{α : Type u_1}
(a : Array α)
{i : Nat}
(h : a.size ≤ i)


nonrec theorem SmoothWithinAt.mdifferentiableWithinAt (hf : SmoothWithinAt I I' f s x) :
    MDifferentiableWithinAt I I' f s x

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


lemma tendsto_integral_gaussian_smul (hf : Integrable f) (h'f : Integrable (𝓕 f)) (v : V) :
    Tendsto (fun (c : ℝ) ↦
      ∫ w : V, ((π * c) ^ (finrank ℝ V / 2 : ℂ) * cexp (-π ^ 2 * c * ‖v - w‖ ^ 2)) • f w)
    atTop (𝓝 (𝓕⁻ (𝓕 f) v))

(hf : MeasureTheory.Integrable f MeasureTheory.volume)

(h'f : MeasureTheory.Integrable (𝓕 f) MeasureTheory.volume)

Filter.Tendsto
  (fun c => ∫ (w : V), ((↑π * ↑c) ^ (↑(FiniteDimensional.finrank ℝ V) / 2) * cexp (-↑π ^ 2 * ↑c * ↑‖v - w‖ ^ 2)) • f w)
  Filter.atTop (𝓝 (𝓕⁻ (𝓕 f) v))


theorem top_lie_le_iff_le_normalizer (N' : LieSubmodule R L M) :
    ⁅(⊤ : LieIdeal R L), N⁆ ≤ N' ↔ N ≤ N'.normalizer

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


@[simp] lemma ofIsColimitCokernelCofork_g' (hg : S.g = 0) (c : CokernelCofork S.f)
  (hc : IsColimit c) : (ofIsColimitCokernelCofork S hg c hc).g' = 0

(c : CategoryTheory.Limits.CokernelCofork S.f)

(hc : CategoryTheory.Limits.IsColimit c)

(CategoryTheory.ShortComplex.RightHomologyData.ofIsColimitCokernelCofork S hg c hc).g' = 0


theorem IsSwap.sign_eq {f : Perm α} (h : f.IsSwap) : sign f = -1

{α : Type u}
[DecidableEq α]
[Fintype α]
{f : Equiv.Perm α}
(h : f.IsSwap)


@[to_additive]
theorem tendsto_norm_div_self (x : E) : Tendsto (fun a => ‖a / x‖) (𝓝 x) (𝓝 0)

{E : Type u_6}
[SeminormedGroup E]
(x : E)

Filter.Tendsto (fun a => ‖a / x‖) (𝓝 x) (𝓝 0)


/-- The quotient map by a group action is open, i.e. the quotient by a group action is an open
  quotient. -/
@[to_additive "The quotient map by a group action is open, i.e. the quotient by a group
action is an open quotient. "]
theorem isOpenMap_quotient_mk'_mul [ContinuousConstSMul Γ T] :
    letI := MulAction.orbitRel Γ T
    IsOpenMap (Quotient.mk' : T → Quotient (MulAction.orbitRel Γ T))

{Γ : Type u_4}
[Group Γ]
{T : Type u_5}
[TopologicalSpace T]
[MulAction Γ T]
[ContinuousConstSMul Γ T]


theorem decomposeAux_single (m : M) (r : R) :
    decomposeAux f (Finsupp.single m r) =
      DirectSum.of (fun i : ι => gradeBy R f i) (f m)
        ⟨Finsupp.single m r, single_mem_gradeBy _ _ _⟩

{M : Type u_1}
{ι : Type u_2}
{R : Type u_3}
[AddMonoid M]
[DecidableEq ι]
[AddMonoid ι]
[CommSemiring R]
(f : M →+ ι)
(m : M)
(r : R)

(AddMonoidAlgebra.decomposeAux f) (Finsupp.single m r) =
  (DirectSum.of (fun i => ↥(AddMonoidAlgebra.gradeBy R (⇑f) i)) (f m)) ⟨Finsupp.single m r, ⋯⟩


theorem mem_adjoinIntegral_self : x ∈ adjoinIntegral S x hx

{R : Type u_1}
[CommRing R]
(S : Submonoid R)
{P : Type u_2}
[CommRing P]
[Algebra R P]
[loc : IsLocalization S P]
(x : P)
(hx : IsIntegral R x)

x ∈ FractionalIdeal.adjoinIntegral S x hx


/-- Assumes right covariance.
The lemma assuming left covariance is `Left.mul_lt_one_of_lt_of_le`. -/
@[to_additive Right.add_neg_of_neg_of_nonpos
      "Assumes right covariance.
      The lemma assuming left covariance is `Left.add_neg_of_neg_of_nonpos`."]
theorem Right.mul_lt_one_of_lt_of_le [CovariantClass α α (swap (· * ·)) (· < ·)] {a b : α}
    (ha : a < 1) (hb : b ≤ 1) :
    a * b < 1

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


@[simp]
theorem prodCongr_symm (h₁ : X ≃ₜ X') (h₂ : Y ≃ₜ Y') :
    (h₁.prodCongr h₂).symm = h₁.symm.prodCongr h₂.symm

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
{X' : Type u_4}
{Y' : Type u_5}
[TopologicalSpace X']
[TopologicalSpace Y']
(h₁ : X ≃ₜ X')
(h₂ : Y ≃ₜ Y')


/-- If `m₁, m₂` are independent σ-algebras and `f` is `m₁`-measurable, then `𝔼[f | m₂] = 𝔼[f]`
almost everywhere. -/
theorem condexp_indep_eq (hle₁ : m₁ ≤ m) (hle₂ : m₂ ≤ m) [SigmaFinite (μ.trim hle₂)]
    (hf : StronglyMeasurable[m₁] f) (hindp : Indep m₁ m₂ μ) : μ[f|m₂] =ᵐ[μ] fun _ => μ[f]

(hf : MeasureTheory.StronglyMeasurable f)

(hindp : ProbabilityTheory.Indep m₁ m₂ μ)

μ[f|m₂] =ᵐ[μ] fun x => ∫ (x : Ω), f x ∂μ


@[simp]
theorem realize_termOfFreeCommRing (p : FreeCommRing α) (v : α → R) :
    (termOfFreeCommRing p).realize v = FreeCommRing.lift v p

{α : Type u_1}
{R : Type u_2}
[CommRing R]
[FirstOrder.Ring.CompatibleRing R]
(p : FreeCommRing α)
(v : α → R)

FirstOrder.Language.Term.realize v (FirstOrder.Ring.termOfFreeCommRing p) = (FreeCommRing.lift v) p


@[to_additive] lemma op_smul_eq_mul [Mul α] {a a' : α} : op a • a' = a' * a


/-- Multiplying the products of a function over `s` and over `sᶜ` gives the whole product.
For a version expressed with subtypes, see `Fintype.prod_subtype_mul_prod_subtype`. -/
@[to_additive "Adding the sums of a function over `s` and over `sᶜ` gives the whole sum.
For a version expressed with subtypes, see `Fintype.sum_subtype_add_sum_subtype`. "]
theorem prod_mul_prod_compl [Fintype α] [DecidableEq α] (s : Finset α) (f : α → β) :
    (∏ i ∈ s, f i) * ∏ i ∈ sᶜ, f i = ∏ i, f i

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

∑ i ∈ s, f i + ∑ i ∈ sᶜ, f i = ∑ i : α, f i


@[functor_norm]
theorem preserves_map {α β} (x : α → β) (y : F α) : η (x <$> y) = x <$> η y

{F : Type u → Type v}
[Applicative F]
[LawfulApplicative F]
{G : Type u → Type w}
[Applicative G]
[LawfulApplicative G]
(η : ApplicativeTransformation F G)
{α β : Type u}
(x : α → β)
(y : F α)


lemma liminf_add_top_of_ne_bot (h : liminf u f = ⊤) (h' : liminf v f ≠ ⊥) :
    liminf (u + v) f = ⊤

{α : Type u_2}
{f : Filter α}
{u v : α → EReal}
(h : Filter.liminf u f = ⊤)
(h' : Filter.liminf v f ≠ ⊥)


theorem mdifferentiableWithinAt_inter (ht : t ∈ 𝓝 x) :
    MDifferentiableWithinAt I I' f (s ∩ t) x ↔ MDifferentiableWithinAt I I' f s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M' : Type u_7}
[TopologicalSpace M']
[ChartedSpace H' M']
{f : M → M'}
{x : M}
{s t : Set M}
(ht : t ∈ 𝓝 x)


theorem modifyNth_eq_set (f : α → α) :
    ∀ (n) (l : List α), modifyNth f n l = ((fun a => set l n (f a)) <$> l[n]?).getD l

{α : Type u}
(f : α → α)
(n : ℕ)
(l : List α)

List.modifyNth f n l = ((fun a => l.set n (f a)) <$> l[n]?).getD l


@[simp]
protected theorem up_down (s : SetSemiring α) : Set.up (SetSemiring.down s) = s


theorem neg_insertLeft_neg (x x' : PGame.{u}) : (-x).insertLeft (-x') = -x.insertRight x'


@[to_additive]
theorem OneHom.comp_apply [One M] [One N] [One P] (g : OneHom N P) (f : OneHom M N) (x : M) :
    g.comp f x = g (f x)

{M : Type u_4}
{N : Type u_5}
{P : Type u_6}
[One M]
[One N]
[One P]
(g : OneHom N P)
(f : OneHom M N)
(x : M)


theorem single_injective (a : Γ) : Function.Injective (single a : R → HahnSeries Γ R)

{Γ : Type u_1}
{R : Type u_2}
[PartialOrder Γ]
[Zero R]
(a : Γ)


/-- Given two compact sets in a noncompact topological group, there is a translate of the second
one that is disjoint from the first one. -/
@[to_additive
  "Given two compact sets in a noncompact additive topological group, there is a
  translate of the second one that is disjoint from the first one."]
theorem exists_disjoint_smul_of_isCompact [NoncompactSpace G] {K L : Set G} (hK : IsCompact K)
    (hL : IsCompact L) : ∃ g : G, Disjoint K (g • L)

{G : Type w}
[TopologicalSpace G]
[Group G]
[TopologicalGroup G]
[NoncompactSpace G]
{K L : Set G}
(hK : IsCompact K)
(hL : IsCompact L)


theorem HasFDerivWithinAt.congr_fderiv (h : HasFDerivWithinAt f f' s x) (h' : f' = g') :
    HasFDerivWithinAt f g' s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{f' g' : E →L[𝕜] F}
{x : E}
{s : Set E}
(h : HasFDerivWithinAt f f' s x)
(h' : f' = g')


@[simp]
theorem comp_apply {M N K : Mat_ C} (f : M ⟶ N) (g : N ⟶ K) (i k) :
    (f ≫ g) i k = ∑ j : N.ι, f i j ≫ g j k

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.Preadditive C]
{M N K : CategoryTheory.Mat_ C}
(f : M ⟶ N)
(g : N ⟶ K)
(i : M.ι)
(k : K.ι)


@[to_additive]
theorem haarContent_outerMeasure_self_pos (K₀ : PositiveCompacts G) :
    0 < (haarContent K₀).outerMeasure K₀

(K₀ : TopologicalSpace.PositiveCompacts G)

0 < (MeasureTheory.Measure.haar.addHaarContent K₀).outerMeasure ↑K₀


lemma isClosed_preimage_val {s t : Set X} : IsClosed (s ↓∩ t) ↔ s ∩ closure (s ∩ t) ⊆ t

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

IsClosed (Subtype.val ⁻¹' t) ↔ s ∩ closure (s ∩ t) ⊆ t


@[simp] lemma div_pos_iff_of_pos_left (ha : 0 < a) : 0 < a / b ↔ 0 < b

{α : Type u_2}
[LinearOrderedSemifield α]
{a b : α}
(ha : 0 < a)


protected theorem Associated.dvd_dvd [Monoid α] {a b : α} (h : a ~ᵤ b) : a ∣ b ∧ b ∣ a

{α : Type u_1}
[Monoid α]
{a b : α}
(h : a ~ᵤ b)


/-- If `f` is unsatisfiable, and every `v` which agrees with `ps` implies `¬⟦f⟧_v → p`, then `p`.
Equivalently, there exists a valuation `v` which agrees with `ps`,
and every such valuation yields `¬⟦f⟧_v` because `f` is unsatisfiable. -/
theorem Fmla.refute {p : Prop} {ps} (f : Fmla) (hf : f.proof [])
    (hv : ∀ v, Valuation.implies v (Fmla.reify v f p) ps 0) : p

(hv : ∀ (v : Sat.Valuation), v.implies (Sat.Fmla.reify v f p) ps 0)


lemma exists_weightSpace_smul_add_eq_bot :
    ∃ k > 0, weightSpace M (k • χ₁ + χ₂) = ⊥

{R : Type u_1}
{L : Type u_2}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
(M : Type u_3)
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
[LieAlgebra.IsNilpotent R L]
(χ₁ χ₂ : L → R)
[NoZeroSMulDivisors ℤ R]
[NoZeroSMulDivisors R M]
[IsNoetherian R M]
(hχ₁ : χ₁ ≠ 0)

∃ k > 0, LieModule.weightSpace M (k • χ₁ + χ₂) = ⊥


protected theorem Periodic.funext [Add α] (h : Periodic f c) : (fun x => f (x + c)) = f

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


@[simp]
theorem map_join (f : α → β) (S) : map f (join S) = join (map (map f) S)

{α : Type u}
{β : Type v}
(f : α → β)
(S : Stream'.WSeq (Stream'.WSeq α))

Stream'.WSeq.map f S.join = (Stream'.WSeq.map (Stream'.WSeq.map f) S).join


theorem attach_map_val' (l : List α) (f : α → β) : (l.attach.map fun i => f i.val) = l.map f

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

List.map (fun i => f ↑i) l.attach = List.map f l


theorem succ_eq_one_add (n) : succ n = 1 + n


@[to_additive]
theorem IsOpen.div_closure (hs : IsOpen s) (t : Set G) : s / closure t = s / t

{G : Type w}
[TopologicalSpace G]
[Group G]
[TopologicalGroup G]
{s : Set G}
(hs : IsOpen s)
(t : Set G)


theorem Differentiable.rpow_const (hf : Differentiable ℝ f) (h : ∀ x, f x ≠ 0 ∨ 1 ≤ p) :
    Differentiable ℝ fun x => f x ^ p

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : E → ℝ}
{p : ℝ}
(hf : Differentiable ℝ f)
(h : ∀ (x : E), f x ≠ 0 ∨ 1 ≤ p)


@[to_additive]
theorem singleton_div_closedBall_one : {x} / closedBall 1 δ = closedBall x δ

{E : Type u_1}
[SeminormedCommGroup E]
(δ : ℝ)
(x : E)

{x} / Metric.closedBall 1 δ = Metric.closedBall x δ


theorem Products.max_eq_o_cons_tail [Inhabited I] (l : Products I) (hl : l.val ≠ [])
    (hlh : l.val.head! = term I ho) : l.val = term I ho :: l.Tail.val

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

(l : Profinite.NobelingProof.Products I)

(hlh : (↑l).head! = Profinite.NobelingProof.term I ho)

↑l = Profinite.NobelingProof.term I ho :: ↑l.Tail


@[to_additive]
protected theorem mul [Mul β] [ContinuousMul β] (hu : ProgMeasurable f u)
    (hv : ProgMeasurable f v) : ProgMeasurable f fun i ω => u i ω * v i ω

{Ω : Type u_1}
{β : Type u_2}
{ι : Type u_3}
{m : MeasurableSpace Ω}
[TopologicalSpace β]
[Preorder ι]
{u v : ι → Ω → β}
{f : MeasureTheory.Filtration ι m}
[MeasurableSpace ι]
[Mul β]
[ContinuousMul β]
(hu : MeasureTheory.ProgMeasurable f u)
(hv : MeasureTheory.ProgMeasurable f v)

MeasureTheory.ProgMeasurable f fun i ω => u i ω * v i ω


theorem Sheaf.Hom.mono_iff_presheaf_mono {F G : Sheaf J D} (f : F ⟶ G) : Mono f ↔ Mono f.1

(J : CategoryTheory.GrothendieckTopology C)

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

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

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

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

CategoryTheory.Mono f ↔ CategoryTheory.Mono f.val


/-- A nonzero morphism `f` to a simple object is an epimorphism
(assuming `f` has an image, and `C` has equalizers).
-/
theorem epi_of_nonzero_to_simple [HasEqualizers C] {X Y : C} [Simple Y] {f : X ⟶ Y} [HasImage f]
    (w : f ≠ 0) : Epi f


@[simp]
theorem coe_comp (f : M ⟶ N) (g : N ⟶ U) : (f ≫ g : M → U) = g ∘ f

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


@[to_additive]
theorem mrangeRestrict_surjective (f : M →* N) : Function.Surjective f.mrangeRestrict

{M : Type u_1}
{N : Type u_2}
[MulOneClass M]
[MulOneClass N]
(f : M →* N)


/-- Given a `k`-linear `G`-representation `A`, `diagonalHomEquiv` is a `k`-linear isomorphism of
the set of representation morphisms `Hom(k[Gⁿ⁺¹], A)` with `Fun(Gⁿ, A)`. This lemma says that the
inverse map sends a function `f : Gⁿ → A` to the representation morphism sending
`(g₀, ... gₙ) ↦ ρ(g₀)(f(g₀⁻¹g₁, g₁⁻¹g₂, ..., gₙ₋₁⁻¹gₙ))`, where `ρ` is the representation attached
to `A`. -/
theorem diagonalHomEquiv_symm_apply (f : (Fin n → G) → A) (x : Fin (n + 1) → G) :
    ((diagonalHomEquiv n A).symm f).hom (Finsupp.single x 1) =
      A.ρ (x 0) (f fun i : Fin n => (x (Fin.castSucc i))⁻¹ * x i.succ)

{k G : Type u}
[CommRing k]
{n : ℕ}
[Group G]
{A : Rep k G}
(f : (Fin n → G) → CoeSort.coe A)
(x : Fin (n + 1) → G)

((Rep.diagonalHomEquiv n A).symm f).hom (Finsupp.single x 1) = (A.ρ (x 0)) (f fun i => (x i.castSucc)⁻¹ * x i.succ)


/-- The multicospan associated to `I : MulticospanIndex`. -/
@[simps]
def multicospan : WalkingMulticospan I.fstTo I.sndTo ⥤ C

(I : CategoryTheory.Limits.MulticospanIndex C)

{x y : CategoryTheory.Limits.WalkingMulticospan I.fstTo I.sndTo}

I.multicospan.map f =
  match x, y, f with
  | x, .(x), CategoryTheory.Limits.WalkingMulticospan.Hom.id .(x) =>
    CategoryTheory.CategoryStruct.id
      ((fun x =>
          match x with
          | CategoryTheory.Limits.WalkingMulticospan.left a => I.left a
          | CategoryTheory.Limits.WalkingMulticospan.right b => I.right b)
        x)
  | .(CategoryTheory.Limits.WalkingMulticospan.left (I.fstTo b)), .(CategoryTheory.Limits.WalkingMulticospan.right b),
    CategoryTheory.Limits.WalkingMulticospan.Hom.fst b => I.fst b
  | .(CategoryTheory.Limits.WalkingMulticospan.left (I.sndTo b)), .(CategoryTheory.Limits.WalkingMulticospan.right b),
    CategoryTheory.Limits.WalkingMulticospan.Hom.snd b => I.snd b


@[simp]
theorem countP_cons_of_pos {a : α} (s) : p a → countP p (a ::ₘ s) = countP p s + 1

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

p a → Multiset.countP p (a ::ₘ s) = Multiset.countP p s + 1


theorem Basis.basis_iUnion {ι : Type _} [Nonempty ι] (X : ι → Set α)
    (hI : ∀ i, M.Basis I (X i)) : M.Basis I (⋃ i, X i)

{α : Type u_1}
{M : Matroid α}
{I : Set α}
{ι : Type u_2}
[Nonempty ι]
(X : ι → Set α)
(hI : ∀ (i : ι), M.Basis I (X i))


@[simp]
lemma image_coe_Ioc (x y : ℝ) : Real.toEReal '' Ioc x y = Ioc ↑x ↑y

Real.toEReal '' Set.Ioc x y = Set.Ioc ↑x ↑y


theorem reverse.termination {i j : Nat} (h : i < j) : j - 1 - (i + 1) < j - i


/-- Given three nonzero vectors, the angle between the first and the second plus the angle
between the second and the third equals the angle between the first and the third. -/
@[simp]
theorem oangle_add {x y z : V} (hx : x ≠ 0) (hy : y ≠ 0) (hz : z ≠ 0) :
    o.oangle x y + o.oangle y z = o.oangle x z

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


@[to_additive]
lemma prod_ite_of_false {p : α → Prop} {_ : DecidablePred p} (h : ∀ x ∈ s, ¬p x) (f g : α → β) :
    ∏ x ∈ s, (if p x then f x else g x) = ∏ x ∈ s, g x

{α : Type u_3}
{β : Type u_4}
{s : Finset α}
[CommMonoid β]
{p : α → Prop}

∀ {x : DecidablePred p}, (∀ x ∈ s, ¬p x) → ∀ (f g : α → β), (∏ x_1 ∈ s, if p x_1 then f x_1 else g x_1) = ∏ x ∈ s, g x


@[to_additive]
theorem UniformCauchySeqOn.div (hf : UniformCauchySeqOn f l s) (hf' : UniformCauchySeqOn f' l s) :
    UniformCauchySeqOn (f / f') l s

{α : Type u_1}
{β : Type u_2}
[UniformSpace α]
[Group α]
[UniformGroup α]
{ι : Type u_3}
{l : Filter ι}
{f f' : ι → β → α}
{s : Set β}
(hf : UniformCauchySeqOn f l s)
(hf' : UniformCauchySeqOn f' l s)


/-- Auxiliary definition for `mapBifunctorShift₂Iso`. -/
@[simps! hom_f_f inv_f_f]
def mapBifunctorHomologicalComplexShift₂Iso :
    ((F.mapBifunctorHomologicalComplex _ _).obj K₁).obj (K₂⟦y⟧) ≅
    (HomologicalComplex₂.shiftFunctor₂ D y).obj
      (((F.mapBifunctorHomologicalComplex _ _).obj K₁).obj K₂)

∀ (i_1 : ℤ),
  ((K₁.mapBifunctorHomologicalComplexShift₂Iso K₂ F y).hom.f i).f i_1 = 𝟙 ((F.obj (K₁.X i)).obj (K₂.X (i_1 + y)))


/-- Radon-Nikodym derivative of a sum of two measures.
See also `rnDeriv_add`, which has no hypothesis on `μ` but requires finite `ν₁` and `ν₂`. -/
lemma rnDeriv_add' (ν₁ ν₂ μ : Measure α) [SigmaFinite ν₁] [SigmaFinite ν₂] [SigmaFinite μ] :
    (ν₁ + ν₂).rnDeriv μ =ᵐ[μ] ν₁.rnDeriv μ + ν₂.rnDeriv μ

{α : Type u_1}
{m : MeasurableSpace α}
(ν₁ ν₂ μ : MeasureTheory.Measure α)
[MeasureTheory.SigmaFinite ν₁]
[MeasureTheory.SigmaFinite ν₂]
[MeasureTheory.SigmaFinite μ]


private lemma noAccidental (hs : IsCornerFree (A : Set (G × G))) :
    NoAccidental (triangleIndices A)

{G : Type u_1}
[AddCommGroup G]
{A : Finset (G × G)}
(hs : IsCornerFree ↑A)


theorem Set.finite_iff_bddBelow [SemilatticeInf α] [LocallyFiniteOrder α] [OrderTop α] :
    s.Finite ↔ BddBelow s

{α : Type u_3}
{s : Set α}
[SemilatticeInf α]
[LocallyFiniteOrder α]
[OrderTop α]


/--
The functor from `C` to `Over X` which sends `Y : C` to `π₁ : X ⨯ Y ⟶ X`, sometimes denoted `X*`.
-/
@[simps! obj_left obj_hom map_left]
def star [HasBinaryProducts C] : C ⥤ Over X

∀ (X_1 : C), ((CategoryTheory.Over.star X).obj X_1).hom = CategoryTheory.Limits.prod.fst


protected lemma pow_lt_pow_left (h : a < b) : ∀ {n : ℕ}, n ≠ 0 → a ^ n < b ^ n


theorem EventuallyLE.cardinal_iUnion {s t : ι → Set α} (hic : #ι < c)
    (h : ∀ i, s i ≤ᶠ[l] t i) : ⋃ i, s i ≤ᶠ[l] ⋃ i, t i

{ι α : Type u}
{c : Cardinal.{u}}
{l : Filter α}
[CardinalInterFilter l c]
{s t : ι → Set α}
(hic : #ι < c)
(h : ∀ (i : ι), s i ≤ᶠ[l] t i)


theorem Int.associated_iff_natAbs {a b : ℤ} : Associated a b ↔ a.natAbs = b.natAbs


@[to_additive]
lemma div_inf (a b c : α) : c / (a ⊓ b) = c / a ⊔ c / b

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

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


/-- This right homology map data expresses compatibilities of the right homology data
constructed by `RightHomologyData.ofEpiOfIsIsoOfMono'` -/
@[simps]
noncomputable def ofEpiOfIsIsoOfMono' (φ : S₁ ⟶ S₂) (h : RightHomologyData S₂)
    [Epi φ.τ₁] [IsIso φ.τ₂] [Mono φ.τ₃] :
    RightHomologyMapData φ (RightHomologyData.ofEpiOfIsIsoOfMono' φ h) h

(CategoryTheory.ShortComplex.RightHomologyMapData.ofEpiOfIsIsoOfMono' φ h).φQ =
  CategoryTheory.CategoryStruct.id (CategoryTheory.ShortComplex.RightHomologyData.ofEpiOfIsIsoOfMono' φ h).Q


@[to_additive]
theorem pi_mem_of_mulSingle_mem [Finite η] [DecidableEq η] {H : Subgroup (∀ i, f i)} (x : ∀ i, f i)
    (h : ∀ i, Pi.mulSingle i (x i) ∈ H) : x ∈ H

(h : ∀ (i : η), Pi.mulSingle i (x i) ∈ H)


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

{G : Type u_1}
[Group G]
(s : Subgroup Gᵐᵒᵖ)


@[norm_cast]
theorem coe_neg (x : R) : (↑(-x : R) : A) = -↑x

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


theorem Set.Subsingleton.isPreconnected {s : Set α} (hs : s.Subsingleton) : IsPreconnected s

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


theorem Iio_mem_nhds (h : γ₁ < γ₂) : Iio γ₂ ∈ 𝓝 γ₁

{Γ₀ : Type u_2}
[LinearOrderedCommGroupWithZero Γ₀]
{γ₁ γ₂ : Γ₀}
(h : γ₁ < γ₂)


/-- A special case of `ContDiffWithinAt.fderivWithin'` where we require that `x₀ ∈ s` and there
are unique derivatives everywhere within `t`. -/
protected theorem ContDiffWithinAt.fderivWithin {f : E → F → G} {g : E → F} {t : Set F} {n : ℕ∞}
    (hf : ContDiffWithinAt 𝕜 n (Function.uncurry f) (s ×ˢ t) (x₀, g x₀))
    (hg : ContDiffWithinAt 𝕜 m g s x₀) (ht : UniqueDiffOn 𝕜 t) (hmn : m + 1 ≤ n) (hx₀ : x₀ ∈ s)
    (hst : s ⊆ g ⁻¹' t) : ContDiffWithinAt 𝕜 m (fun x => fderivWithin 𝕜 (f x) t (g x)) s x₀


/-- If the terms in the sum `∑' (i : ι), F i` are uniformly bounded on `U` by a
summable function, and each term in the sum is differentiable on `U`, then so is the sum. -/
theorem differentiableOn_tsum_of_summable_norm {u : ι → ℝ} (hu : Summable u)
    (hf : ∀ i : ι, DifferentiableOn ℂ (F i) U) (hU : IsOpen U)
    (hF_le : ∀ (i : ι) (w : ℂ), w ∈ U → ‖F i w‖ ≤ u i) :
    DifferentiableOn ℂ (fun w : ℂ => ∑' i : ι, F i w) U

(hf : ∀ (i : ι), DifferentiableOn ℂ (F i) U)

(hF_le : ∀ (i : ι), ∀ w ∈ U, ‖F i w‖ ≤ u i)

DifferentiableOn ℂ (fun w => ∑' (i : ι), F i w) U


theorem iIndepSet.iIndepFun_indicator [Zero β] [One β] {m : MeasurableSpace β} {s : ι → Set Ω}
    (hs : iIndepSet s μ) :
    iIndepFun (fun _n => m) (fun n => (s n).indicator fun _ω => 1) μ

{Ω : Type u_1}
{ι : Type u_2}
{β : Type u_6}
{_mΩ : MeasurableSpace Ω}
{μ : MeasureTheory.Measure Ω}
[Zero β]
[One β]
{m : MeasurableSpace β}
{s : ι → Set Ω}
(hs : ProbabilityTheory.iIndepSet s μ)

ProbabilityTheory.iIndepFun (fun _n => m) (fun n => (s n).indicator fun _ω => 1) μ


/-- If a set `S` generates an additive monoid `M`, then the image of `M` generates, as algebra,
`R[M]`. -/
theorem freeAlgebra_lift_of_surjective_of_closure [CommSemiring R] {S : Set M}
    (hS : closure S = ⊤) :
    Function.Surjective
      (FreeAlgebra.lift R fun s : S => of' R M ↑s : FreeAlgebra R S → R[M])

{R : Type u_1}
{M : Type u_2}
[AddMonoid M]
[CommSemiring R]
{S : Set M}
(hS : AddSubmonoid.closure S = ⊤)

Function.Surjective ⇑((FreeAlgebra.lift R) fun s => AddMonoidAlgebra.of' R M ↑s)


protected theorem pos {x : R} (hx : x ≠ 0) : 0 < abv x

{R : Type u_5}
{S : Type u_6}
[Semiring R]
[OrderedSemiring S]
(abv : AbsoluteValue R S)
{x : R}
(hx : x ≠ 0)


theorem fderiv.comp_deriv_of_eq (hl : DifferentiableAt 𝕜 l y) (hf : DifferentiableAt 𝕜 f x)
    (hy : y = f x) :
    deriv (l ∘ f) x = (fderiv 𝕜 l (f x) : F → E) (deriv f x)

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{E : Type w}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{f : 𝕜 → F}
(x : 𝕜)
{l : F → E}
{y : F}
(hl : DifferentiableAt 𝕜 l y)
(hf : DifferentiableAt 𝕜 f x)
(hy : y = f x)

deriv (l ∘ f) x = (fderiv 𝕜 l (f x)) (deriv f x)


theorem inf_iInf_nat_succ (u : ℕ → α) : (u 0 ⊓ ⨅ i, u (i + 1)) = ⨅ i, u i

{α : Type u_1}
[CompleteLattice α]
(u : ℕ → α)


@[to_additive]
theorem continuousSMul_sInf {ts : Set (TopologicalSpace X)}
    (h : ∀ t ∈ ts, @ContinuousSMul M X _ _ t) : @ContinuousSMul M X _ _ (sInf ts)

{M : Type u_2}
{X : Type u_3}
[TopologicalSpace M]
[VAdd M X]
{ts : Set (TopologicalSpace X)}
(h : ∀ t ∈ ts, ContinuousVAdd M X)


@[simp, nolint simpNF] -- Porting note: false positive, this lemma can prove itself
theorem cons_eta {m : Multiset α} {a : α} (f : ∀ a' ∈ a ::ₘ m, δ a') :
    (cons m a (f _ (mem_cons_self _ _)) fun a' ha' => f a' (mem_cons_of_mem ha')) = f

{α : Type u_1}
[DecidableEq α]
{δ : α → Sort u_2}
{m : Multiset α}
{a : α}
(f : (a' : α) → a' ∈ a ::ₘ m → δ a')

(Multiset.Pi.cons m a (f a ⋯) fun a' ha' => f a' ⋯) = f


/-- Adjoins a `⊤` to the codomain of a `SupHom`. -/
@[simps]
def withTop' [OrderTop β] (f : SupHom α β) : SupHom (WithTop α) β

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


@[simp]
theorem orderIsoSumLexPUnit_symm_inl (a : α) : orderIsoSumLexPUnit.symm (toLex <| inl a) = a

WithTop.orderIsoSumLexPUnit.symm (toLex (Sum.inl a)) = ↑a


@[simp]
theorem round_one : round (1 : α) = 1

{α : Type u_2}
[LinearOrderedRing α]
[FloorRing α]


@[simp] lemma ofLowerSet_toLowerSet (a : α) : ofLowerSet (toLowerSet a) = a

Topology.WithLowerSet.ofLowerSet (Topology.WithLowerSet.toLowerSet a) = a


/-- A dependent version of `Submonoid.closure_induction`.  -/
@[to_additive (attr := elab_as_elim) "A dependent version of `AddSubmonoid.closure_induction`. "]
theorem closure_induction' (s : Set M) {p : ∀ x, x ∈ closure s → Prop}
    (mem : ∀ (x) (h : x ∈ s), p x (subset_closure h)) (one : p 1 (one_mem _))
    (mul : ∀ x hx y hy, p x hx → p y hy → p (x * y) (mul_mem hx hy)) {x} (hx : x ∈ closure s) :
    p x hx

{p : (x : M) → x ∈ Submonoid.closure s → Prop}

(mul : ∀ (x : M) (hx : x ∈ Submonoid.closure s) (y : M) (hy : y ∈ Submonoid.closure s), p x hx → p y hy → p (x * y) ⋯)


/-- If `A` is a family of enough low-degree polynomials over a finite field,
there is a pair of elements in `A` (with different indices but not necessarily
distinct), such that the difference of their remainders is close together. -/
theorem exists_approx_polynomial {b : Fq[X]} (hb : b ≠ 0) {ε : ℝ} (hε : 0 < ε)
    (A : Fin (Fintype.card Fq ^ ⌈-log ε / log (Fintype.card Fq)⌉₊).succ → Fq[X]) :
    ∃ i₀ i₁, i₀ ≠ i₁ ∧ (cardPowDegree (A i₁ % b - A i₀ % b) : ℝ) < cardPowDegree b • ε

(A : Fin (Fintype.card Fq ^ ⌈-Real.log ε / Real.log ↑(Fintype.card Fq)⌉₊).succ → Polynomial Fq)

∃ i₀ i₁, i₀ ≠ i₁ ∧ ↑(Polynomial.cardPowDegree (A i₁ % b - A i₀ % b)) < Polynomial.cardPowDegree b • ε


@[simp]
theorem constantCoeff_X (s : σ) : constantCoeff σ R (X s) = 0

{σ : Type u_1}
{R : Type u_2}
[Semiring R]
(s : σ)

(MvPowerSeries.constantCoeff σ R) (MvPowerSeries.X s) = 0


@[simp]
theorem quotientEquivAlgOfEq_symm {I J : Ideal A} (h : I = J) :
    (quotientEquivAlgOfEq R₁ h).symm = quotientEquivAlgOfEq R₁ h.symm

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

(Ideal.quotientEquivAlgOfEq R₁ h).symm = Ideal.quotientEquivAlgOfEq R₁ ⋯


lemma mono_iff_isIso_snd (hc : IsLimit c) : Mono f ↔ IsIso c.snd

{c : CategoryTheory.Limits.PullbackCone f f}

CategoryTheory.Mono f ↔ CategoryTheory.IsIso c.snd


@[simp]
theorem toReal_ofReal_eq_iff {a : ℝ} : (ENNReal.ofReal a).toReal = a ↔ 0 ≤ a


/-- Given a monoid homomorphism `f : N → M` and a congruence relation `c` on `M`, the congruence
    relation induced on `N` by `f` equals the kernel of `c`'s quotient homomorphism composed with
    `f`. -/
@[to_additive "Given an `AddMonoid` homomorphism `f : N → M` and an additive congruence relation
`c` on `M`, the additive congruence relation induced on `N` by `f` equals the kernel of `c`'s
quotient homomorphism composed with `f`."]
theorem comap_eq {f : N →* M} : comap f f.map_mul c = ker (c.mk'.comp f)

{M : Type u_1}
{N : Type u_2}
[MulOneClass M]
[MulOneClass N]
{c : Con M}
{f : N →* M}

Con.comap ⇑f ⋯ c = Con.ker (c.mk'.comp f)


theorem sublists_reverse (l : List α) : sublists (reverse l) = map reverse (sublists' l)

l.reverse.sublists = List.map List.reverse l.sublists'


/-- If there is an element with norm different from `0`, then the norm of the identity equals `1`.
(Since we are working with seminorms supposing that the space is non-trivial is not enough.) -/
theorem norm_id_of_nontrivial_seminorm (h : ∃ x : E, ‖x‖ ≠ 0) : ‖id 𝕜 E‖ = 1

{𝕜 : Type u_1}
{E : Type u_4}
[SeminormedAddCommGroup E]
[NontriviallyNormedField 𝕜]
[NormedSpace 𝕜 E]
(h : ∃ x, ‖x‖ ≠ 0)


@[to_additive]
theorem tprod_ne_one_iff (hf : Multipliable f) : ∏' i, f i ≠ 1 ↔ ∃ x, f x ≠ 1

{ι : Type u_1}
{α : Type u_3}
[CanonicallyOrderedCommMonoid α]
[TopologicalSpace α]
[OrderClosedTopology α]
{f : ι → α}
(hf : Multipliable f)


private theorem mlt {b : Nat} : {a : Nat} → a < n → b % n < n


private lemma div_nonneg_of_pos_of_nonneg (ha : 0 < a) (hb : 0 ≤ b) : 0 ≤ a / b

{α : Type u_4}
[LinearOrderedSemifield α]
{a b : α}
(ha : 0 < a)
(hb : 0 ≤ b)


theorem IsSymm.pow [CommSemiring α] [Fintype n] [DecidableEq n] {A : Matrix n n α} (h : A.IsSymm)
    (k : ℕ) :
    (A ^ k).IsSymm

{α : Type u_1}
{n : Type u_3}
[CommSemiring α]
[Fintype n]
[DecidableEq n]
{A : Matrix n n α}
(h : A.IsSymm)
(k : ℕ)


theorem StrictMono.strictMonoOn_IciExtend {f : Ici a → β} (hf : StrictMono f) :
    StrictMonoOn (IciExtend f) (Ici a)

{α : Type u_1}
{β : Type u_2}
[LinearOrder α]
[Preorder β]
{a : α}
{f : ↑(Set.Ici a) → β}
(hf : StrictMono f)

StrictMonoOn (Set.IciExtend f) (Set.Ici a)


/-- If two global sections agree after restriction to each member of an open cover, then
they agree globally. -/
lemma OpenCover.ext_elem {X : Scheme.{u}} {U : X.Opens} (f g : Γ(X, U)) (𝒰 : X.OpenCover)
    (h : ∀ i : 𝒰.J, (𝒰.map i).app U f = (𝒰.map i).app U g) : f = g

(f g : ↑(X.presheaf.obj (Opposite.op U)))

(h : ∀ (i : 𝒰.J), (AlgebraicGeometry.Scheme.Hom.app (𝒰.map i) U) f = (AlgebraicGeometry.Scheme.Hom.app (𝒰.map i) U) g)


/-- The functor `HomologicalComplex C c ⥤ ShortComplex C` which sends a homological
complex `K` to the short complex `K.X (c.prev i) ⟶ K.X i ⟶ K.X (c.next i)`. -/
@[simps!]
noncomputable def shortComplexFunctor (i : ι)

((HomologicalComplex.shortComplexFunctor C c i).obj K).X₂ = K.X i


theorem IsChain.total (h : IsChain r s) (hx : x ∈ s) (hy : y ∈ s) : x ≺ y ∨ y ≺ x

{α : Type u_1}
{r : α → α → Prop}
{s : Set α}
{x y : α}
[IsRefl α r]
(h : IsChain r s)
(hx : x ∈ s)
(hy : y ∈ s)


theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn 𝕜 f s ↔
    AnalyticOn 𝕜 g s

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f g : E → F}
{s : Set E}
(hs : IsOpen s)
(h : Set.EqOn f g s)


@[to_additive (attr := simp, nolint simpNF)]
theorem mulEquivOfQuotient_mk' (x y) : mulEquivOfQuotient f ((monoidOf S).mk' x y) = f.mk' x y

{M : Type u_1}
[AddCommMonoid M]
{S : AddSubmonoid M}
{N : Type u_2}
[AddCommMonoid N]
{f : S.LocalizationMap N}
(x : M)
(y : ↥S)

(AddLocalization.addEquivOfQuotient f) ((AddLocalization.addMonoidOf S).mk' x y) = f.mk' x y


@[to_additive]
theorem multipliable_nat_add_iff {f : ℕ → G} (k : ℕ) :
    (Multipliable fun n ↦ f (n + k)) ↔ Multipliable f

{G : Type u_2}
[CommGroup G]
[TopologicalSpace G]
[TopologicalGroup G]
{f : ℕ → G}
(k : ℕ)

(Multipliable fun n => f (n + k)) ↔ Multipliable f


/-- Preliminary lemma for the strong law of large numbers for vector-valued random variables:
the composition of the random variables with a simple function satisfies the strong law of large
numbers. -/
lemma strong_law_ae_simpleFunc_comp (X : ℕ → Ω → E) (h' : Measurable (X 0))
    (hindep : Pairwise (fun i j ↦ IndepFun (X i) (X j))) (hident : ∀ i, IdentDistrib (X i) (X 0))
    (φ : SimpleFunc E E) : ∀ᵐ ω,
      Tendsto (fun n : ℕ ↦ (n : ℝ) ⁻¹ • (∑ i ∈ range n, φ (X i ω))) atTop (𝓝 𝔼[φ ∘ (X 0)])

(hindep : Pairwise fun i j => ProbabilityTheory.IndepFun (X i) (X j) ℙ)

(hident : ∀ (i : ℕ), ProbabilityTheory.IdentDistrib (X i) (X 0) ℙ ℙ)

∀ᵐ (ω : Ω),
  Filter.Tendsto (fun n => (↑n)⁻¹ • ∑ i ∈ Finset.range n, ↑φ (X i ω)) Filter.atTop (𝓝 (∫ (a : Ω), (↑φ ∘ X 0) a))


@[simp]
theorem eraseNone_none : eraseNone ({none} : Finset (Option α)) = ∅


theorem set_comm (a b : α) : ∀ {n m : Nat} (l : List α), n ≠ m →
    (l.set n a).set m b = (l.set m b).set n a

{α : Type u_1}
(a b : α)
{n m : Nat}
(l : List α)


/-- In finite dimensions, if the generalized eigenspaces of a linear endomorphism span the whole
space then the same is true of its restriction to any invariant submodule. -/
theorem Module.End.iSup_genEigenspace_restrict_eq_top
    {p : Submodule K V} {f : Module.End K V} [FiniteDimensional K V]
    (h : ∀ x ∈ p, f x ∈ p) (h' : ⨆ μ, ⨆ k, f.genEigenspace μ k = ⊤) :
    ⨆ μ, ⨆ k, Module.End.genEigenspace (LinearMap.restrict f h) μ k = ⊤

(h' : ⨆ μ, ⨆ k, (f.genEigenspace μ) k = ⊤)

⨆ μ, ⨆ k, (Module.End.genEigenspace (LinearMap.restrict f h) μ) k = ⊤


/-- An irreducible polynomial over a field must have positive degree. -/
theorem Irreducible.natDegree_pos {F : Type*} [Field F] {f : F[X]} (h : Irreducible f) :
    0 < f.natDegree

{F : Type u_1}
[Field F]
{f : F[X]}
(h : Irreducible f)


theorem inv_intCast_den_of_pos {a : ℤ} (ha0 : 0 < a) : ((a : ℚ)⁻¹.den : ℤ) = a


/-- If `F : J ⥤ C` then `F.cones` is the functor assigning to an object `X : C` the
type of natural transformations from the constant functor with value `X` to `F`.
An object representing this functor is a limit of `F`.
-/
@[simps!]
def cones : Cᵒᵖ ⥤ Type max u₁ v₃

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
(F : J ⥤ C)
(X : Cᵒᵖ)

F.cones.obj X = ((CategoryTheory.Functor.const J).obj (Opposite.unop X) ⟶ F)


/-- In a multiplicative group action, the points fixed by `g` are also fixed by `g⁻¹` -/
@[to_additive (attr := simp)
  "In an additive group action, the points fixed by `g` are also fixed by `g⁻¹`"]
theorem fixedBy_inv (g : G) : fixedBy α g⁻¹ = fixedBy α g

(α : Type u_1)
{G : Type u_2}
[AddGroup G]
[AddAction G α]
(g : G)

AddAction.fixedBy α (-g) = AddAction.fixedBy α g


theorem le_cof {r : α → α → Prop} [IsRefl α r] (c : Cardinal) :
    c ≤ cof r ↔ ∀ {S : Set α}, (∀ a, ∃ b ∈ S, r a b) → c ≤ #S

{α : Type u_1}
{r : α → α → Prop}
[IsRefl α r]
(c : Cardinal.{u_1})

c ≤ Order.cof r ↔ ∀ {S : Set α}, (∀ (a : α), ∃ b ∈ S, r a b) → c ≤ #↑S


theorem isClosed_iff_clusterPt : IsClosed s ↔ ∀ a, ClusterPt a (𝓟 s) → a ∈ s

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

IsClosed s ↔ ∀ (a : X), ClusterPt a (𝓟 s) → a ∈ s


theorem bot_rel_eq_leftRel (H : Subgroup G) :
    (setoid ↑(⊥ : Subgroup G) ↑H).Rel = (QuotientGroup.leftRel H).Rel

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

(Doset.setoid ↑⊥ ↑H).Rel = (QuotientGroup.leftRel H).Rel


@[simp]
theorem finInsepDegree_top : finInsepDegree F (⊤ : IntermediateField E K) = finInsepDegree F K

{F : Type u}
(E : Type v)
[Field F]
[Field E]
[Algebra F E]
(K : Type w)
[Field K]
[Algebra F K]
[Algebra E K]
[IsScalarTower F E K]

Field.finInsepDegree F ↥⊤ = Field.finInsepDegree F K


/-- The unit for the equivalence `Mon_ (C ⥤ D) ≌ C ⥤ Mon_ D`.
-/
@[simps!]
def unitIso : 𝟭 (Mon_ (C ⥤ D)) ≅ functor ⋙ inverse

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

∀ (x : C), (CategoryTheory.Monoidal.MonFunctorCategoryEquivalence.unitIso.hom.app X).hom.app x = 𝟙 (X.X.obj x)


@[to_additive]
theorem smul_def (c : M) (x : Completion X) : c • x = Completion.map (c • ·) x

(M : Type v)
(X : Type x)
[UniformSpace X]
[VAdd M X]
(c : M)
(x : UniformSpace.Completion X)

c +ᵥ x = UniformSpace.Completion.map (fun x => c +ᵥ x) x


lemma rnDeriv_def' (κ η : Kernel α γ) :
    rnDeriv κ η = fun a x ↦ ENNReal.ofReal (rnDerivAux κ (κ + η) a x)
      / ENNReal.ofReal (1 - rnDerivAux κ (κ + η) a x)

[hαγ : MeasurableSpace.CountableOrCountablyGenerated α γ]

κ.rnDeriv η = fun a x => ENNReal.ofReal (κ.rnDerivAux (κ + η) a x) / ENNReal.ofReal (1 - κ.rnDerivAux (κ + η) a x)


theorem div_lt_iff_of_neg (hc : c < 0) : b / c < a ↔ a * c < b

{α : Type u_2}
[LinearOrderedField α]
{a b c : α}
(hc : c < 0)


theorem Ideal.count_normalizedFactors_eq {p x : Ideal R} [hp : p.IsPrime] {n : ℕ} (hle : x ≤ p ^ n)
    [DecidableEq (Ideal R)] (hlt : ¬x ≤ p ^ (n + 1)) : (normalizedFactors x).count p = n

{R : Type u_1}
[CommRing R]
[IsDedekindDomain R]
{p x : Ideal R}
[hp : p.IsPrime]
{n : ℕ}
(hle : x ≤ p ^ n)
[DecidableEq (Ideal R)]
(hlt : ¬x ≤ p ^ (n + 1))

Multiset.count p (UniqueFactorizationMonoid.normalizedFactors x) = n


@[simp] theorem disjoint_cons_left : Disjoint (a::l₁) l₂ ↔ (a ∉ l₂) ∧ Disjoint l₁ l₂

∀ {α : Type u_1} {a : α} {l₁ l₂ : List α}, (a :: l₁).Disjoint l₂ ↔ ¬a ∈ l₂ ∧ l₁.Disjoint l₂


theorem MonotoneOn.integrableOn_isCompact [IsFiniteMeasureOnCompacts μ] (hs : IsCompact s)
    (hmono : MonotoneOn f s) : IntegrableOn f s μ


theorem exists_of_eraseP : ∀ {l : List α} {a} (al : a ∈ l) (pa : p a),
    ∃ a l₁ l₂, (∀ b ∈ l₁, ¬p b) ∧ p a ∧ l = l₁ ++ a :: l₂ ∧ l.eraseP p = l₁ ++ l₂

{α : Type u_1}
{p : α → Bool}
{l : List α}
{a : α}
(al : a ∈ l)
(pa : p a = true)

∃ a l₁ l₂, (∀ (b : α), b ∈ l₁ → ¬p b = true) ∧ p a = true ∧ l = l₁ ++ a :: l₂ ∧ List.eraseP p l = l₁ ++ l₂


theorem mul_sq_le_sum_sq (hst : s ⊆ t) (f : ι → 𝕜) (hs : x ^ 2 ≤ ((∑ i ∈ s, f i) / s.card) ^ 2)
    (hs' : (s.card : 𝕜) ≠ 0) : (s.card : 𝕜) * x ^ 2 ≤ ∑ i ∈ t, f i ^ 2

(hs : x ^ 2 ≤ ((∑ i ∈ s, f i) / ↑s.card) ^ 2)


@[reassoc (attr := simp)]
lemma inr_desc : inr φ ≫ desc φ α β eq = β

(α : CochainComplex.HomComplex.Cochain F K (-1))

(eq : CochainComplex.HomComplex.δ (-1) 0 α = CochainComplex.HomComplex.Cochain.ofHom (φ ≫ β))

CochainComplex.mappingCone.inr φ ≫ CochainComplex.mappingCone.desc φ α β eq = β


@[to_additive (attr := simp)]
theorem map_mk_ofList (f : M →* M') (g : N →* N') (l : List (M ⊕ N)) :
    map f g (mk (ofList l)) = mk (ofList (l.map (Sum.map f g)))

{M : Type u_1}
{N : Type u_2}
{M' : Type u_3}
{N' : Type u_4}
[AddZeroClass M]
[AddZeroClass N]
[AddZeroClass M']
[AddZeroClass N']
(f : M →+ M')
(g : N →+ N')
(l : List (M ⊕ N))

(AddMonoid.Coprod.map f g) (AddMonoid.Coprod.mk (FreeAddMonoid.ofList l)) =
  AddMonoid.Coprod.mk (FreeAddMonoid.ofList (List.map (Sum.map ⇑f ⇑g) l))


theorem prefix_concat_iff {l₁ l₂ : List α} {a : α} :
    l₁ <+: l₂ ++ [a] ↔ l₁ = l₂ ++ [a] ∨ l₁ <+: l₂


theorem norm_eq_sqrt_inner (x : F) : ‖x‖ = √(re ⟪x, x⟫)

{𝕜 : Type u_1}
{F : Type u_3}
[RCLike 𝕜]
[AddCommGroup F]
[Module 𝕜 F]
[c : InnerProductSpace.Core 𝕜 F]
(x : F)


theorem integral_deriv_comp_mul_deriv' {f f' g g' : ℝ → ℝ} (hf : ContinuousOn f [[a, b]])
    (hff' : ∀ x ∈ Ioo (min a b) (max a b), HasDerivWithinAt f (f' x) (Ioi x) x)
    (hf' : ContinuousOn f' [[a, b]]) (hg : ContinuousOn g [[f a, f b]])
    (hgg' : ∀ x ∈ Ioo (min (f a) (f b)) (max (f a) (f b)), HasDerivWithinAt g (g' x) (Ioi x) x)
    (hg' : ContinuousOn g' (f '' [[a, b]])) :
    (∫ x in a..b, (g' ∘ f) x * f' x) = (g ∘ f) b - (g ∘ f) a

(hff' : ∀ x ∈ Set.Ioo (min a b) (max a b), HasDerivWithinAt f (f' x) (Set.Ioi x) x)

(hgg' : ∀ x ∈ Set.Ioo (min (f a) (f b)) (max (f a) (f b)), HasDerivWithinAt g (g' x) (Set.Ioi x) x)

∫ (x : ℝ) in a..b, (g' ∘ f) x * f' x = (g ∘ f) b - (g ∘ f) a


@[simp] theorem add_imJ : (a + b).imJ = a.imJ + b.imJ

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


/-- See `List.count_join` for the corresponding statement using `List.sum`. -/
lemma count_join' [BEq α] (L : List (List α)) (a : α) :
    L.join.count a = Nat.sum (L.map (count a))

{α : Type u_1}
[BEq α]
(L : List (List α))
(a : α)

List.count a L.join = Nat.sum (List.map (List.count a) L)


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

{α : Type u_2}
[DecidableEq α]
[Add α]
(a : α)


lemma map_add_eq_map_add_linearDeriv_add [DecidableEq ι] [Fintype ι] (x h : (i : ι) → M₁ i) :
    f (x + h) = f x + f.linearDeriv x h +
      ∑ s ∈ univ.powerset.filter (2 ≤ ·.card), f (s.piecewise h x)

{R : Type uR}
{ι : Type uι}
{M₁ : ι → Type v₁}
{M₂ : Type v₂}
[Semiring R]
[(i : ι) → AddCommGroup (M₁ i)]
[AddCommGroup M₂]
[(i : ι) → Module R (M₁ i)]
[Module R M₂]
(f : MultilinearMap R M₁ M₂)
[DecidableEq ι]
[Fintype ι]
(x h : (i : ι) → M₁ i)

f (x + h) =
  f x + (f.linearDeriv x) h + ∑ s ∈ Finset.filter (fun x => 2 ≤ x.card) Finset.univ.powerset, f (s.piecewise h x)


/-- Isometries preserve the diameter in pseudoemetric spaces. -/
theorem ediam_image (hf : Isometry f) (s : Set α) : EMetric.diam (f '' s) = EMetric.diam s

{α : Type u}
{β : Type v}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
{f : α → β}
(hf : Isometry f)
(s : Set α)


theorem IsPerfectClosure.ker_eq [PerfectRing L p] [IsPerfectClosure i p] :
    RingHom.ker i = pNilradical K p

{K : Type u_1}
{L : Type u_2}
[CommSemiring K]
[CommSemiring L]
(i : K →+* L)
(p : ℕ)
[ExpChar L p]
[PerfectRing L p]
[IsPerfectClosure i p]


@[simp] lemma mop_tensorUnit : mop (𝟙_ C) = 𝟙_ Cᴹᵒᵖ

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


theorem set_biInter_insert_update {x : α} {t : Finset α} (f : α → Set β) {s : Set β} (hx : x ∉ t) :
    ⋂ i ∈ insert x t, @update _ _ _ f x s i = s ∩ ⋂ i ∈ t, f i

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

⋂ i ∈ insert x t, Function.update f x s i = s ∩ ⋂ i ∈ t, f i


@[simp] theorem toList_mapVal (f : α → β → δ) (l : AssocList α β) :
    (mapVal f l).toList = l.toList.map (fun (a, b) => (a, f a b))

{α : Type u_1}
{β : Type u_2}
{δ : Type u_3}
(f : α → β → δ)
(l : Batteries.AssocList α β)

(Batteries.AssocList.mapVal f l).toList =
  List.map
    (fun x =>
      match x with
      | (a, b) => (a, f a b))
    l.toList


/-- `sInf s < b` when there is an element `a` in `s` with `a < b`, when `s` is bounded below.
This is essentially an iff, except that the assumptions for the two implications are
slightly different (one needs boundedness below for one direction, nonemptiness and linear
order for the other one), so we formulate separately the two implications, contrary to
the `CompleteLattice` case. -/
theorem csInf_lt_of_lt : BddBelow s → a ∈ s → a < b → sInf s < b

{α : Type u_1}
[ConditionallyCompleteLattice α]
{s : Set α}
{a b : α}


theorem pow_left_iff (hm : 0 < m) : IsRelPrime (x ^ m) y ↔ IsRelPrime x y

{α : Type u_1}
[CommMonoid α]
[DecompositionMonoid α]
{x y : α}
{m : ℕ}
(hm : 0 < m)


@[ext]
lemma hom_ext {M N : CoalgebraCat.{v} R} (f g : M ⟶ N) (h : f.toCoalgHom = g.toCoalgHom) :
    f = g

{R : Type u}
[CommRing R]
{M N : CoalgebraCat R}
(f g : M ⟶ N)
(h : f.toCoalgHom = g.toCoalgHom)


@[simp] theorem bnot_isLeft (x : α ⊕ β) : !x.isLeft = x.isRight

{α : Type u_1}
{β : Type u_2}
(x : α ⊕ β)


@[simp]
theorem moebius_mul_coe_zeta : (μ * ζ : ArithmeticFunction ℤ) = 1

ArithmeticFunction.moebius * ↑ArithmeticFunction.zeta = 1


theorem integral_deriv_eq_sub' (f) (hderiv : deriv f = f')
    (hdiff : ∀ x ∈ uIcc a b, DifferentiableAt ℝ f x) (hcont : ContinuousOn f' (uIcc a b)) :
    ∫ y in a..b, f' y = f b - f a

(hdiff : ∀ x ∈ [[a, b]], DifferentiableAt ℝ f x)


theorem mk_surjective_eq_arrow_of_lift_le (lle : lift.{u} #β' ≤ lift.{v} #α) :
    #{f : α → β' | Surjective f} = #(α → β')

(lle : Cardinal.lift.{u, v} #β' ≤ Cardinal.lift.{v, u} #α)

#↑{f | Function.Surjective f} = #(α → β')


@[to_additive (attr := simp)]
theorem mulSupport_one' : mulSupport (1 : α → M) = ∅


theorem closure_sup_closure_right (x y : α) : u (l (x ⊔ u (l y))) = u (l (x ⊔ y))

{α : Type u_1}
{β : Type u_4}
[SemilatticeSup α]
[Preorder β]
{u : β → α}
(l : LowerAdjoint u)
(x y : α)

u (l.toFun (x ⊔ u (l.toFun y))) = u (l.toFun (x ⊔ y))


theorem eq_top_of_bot_isCompl (h : IsCompl ⊥ x) : x = ⊤

{α : Type u_1}
[Lattice α]
[BoundedOrder α]
{x : α}
(h : IsCompl ⊥ x)


@[to_additive (attr := simp, nolint simpNF)]
theorem one_apply [∀ i, One <| f i] : (1 : ∀ i, f i) i = 1

{I : Type u}
{f : I → Type v₁}
(i : I)
[(i : I) → One (f i)]


theorem liftOn_ofMem (q : Semiquot α) (f : α → β)
    (h : ∀ a ∈ q, ∀ b ∈ q, f a = f b) (a : α) (aq : a ∈ q) : liftOn q f h = f a

{α : Type u_1}
{β : Type u_2}
(q : Semiquot α)
(f : α → β)
(h : ∀ a ∈ q, ∀ b ∈ q, f a = f b)
(a : α)
(aq : a ∈ q)


@[simp 1100, nolint simpNF]
theorem mem_map_of_injective {f : α → β} (H : Function.Injective f) {a : α} {s : Multiset α} :
    f a ∈ map f s ↔ a ∈ s

{α : Type u_1}
{β : Type v}
{f : α → β}
(H : Function.Injective f)
{a : α}
{s : Multiset α}


/-- Finsets form an order-connected suborder of multisets. -/
lemma ordConnected_range_val : Set.OrdConnected (Set.range val : Set <| Multiset α)


@[parity_simps] lemma even_add_one : Even (n + 1) ↔ ¬Even n


theorem cauchy_mul : ∀ a b, (a * b : ℝ).cauchy = a.cauchy * b.cauchy


@[simp]
theorem mk'_one (h : IsIntegral R (1 : B) := isIntegral_one) : mk' A 1 h = 1

{R : Type u_1}
(A : Type u_2)
{B : Type u_3}
[CommRing R]
[CommRing A]
[CommRing B]
[Algebra R B]
[Algebra A B]
[IsIntegralClosure A R B]
(h : IsIntegral R 1 := ⋯)


/-- The diagonal matrix `diagonal v` is symmetric. -/
@[simp]
theorem isSymm_diagonal [DecidableEq n] [Zero α] (v : n → α) : (diagonal v).IsSymm

{α : Type u_1}
{n : Type u_3}
[DecidableEq n]
[Zero α]
(v : n → α)


/-- `Matrix.trace` as an `AddMonoidHom` -/
@[simps]
def traceAddMonoidHom : Matrix n n R →+ R

(n : Type u_3)
(R : Type u_6)
[Fintype n]
[AddCommMonoid R]
(A : Matrix n n R)

(Matrix.traceAddMonoidHom n R) A = A.trace


lemma homMk'_mk_id (f : S ⟶ T.obj Y) : homMk' (mk f) (𝟙 Y) = eqToHom (by aesop_cat)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{S : D}
{Y : C}
{T : CategoryTheory.Functor C D}
(f : S ⟶ T.obj Y)

(CategoryTheory.StructuredArrow.mk f).homMk' (CategoryTheory.CategoryStruct.id Y) = CategoryTheory.eqToHom ⋯


/-- Twice the angle between the negation of a vector and that vector is 0. -/
-- @[simp] -- Porting note (#10618): simp can prove this
theorem two_zsmul_oangle_neg_self_left (x : V) : (2 : ℤ) • o.oangle (-x) x = 0

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


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

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

∀ (X_1 : D), ((CategoryTheory.Functor.RightExtension.postcomp₁ G f F).map φ).left.app X_1 = φ.left.app (G.obj X_1)


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


@[to_additive]
theorem ne_one_iff_exists {x : WithOne α} : x ≠ 1 ↔ ∃ a : α, ↑a = x


theorem HasDerivAtFilter.mono (h : HasDerivAtFilter f f' x L₂) (hst : L₁ ≤ L₂) :
    HasDerivAtFilter f f' x L₁

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : 𝕜 → F}
{f' : F}
{x : 𝕜}
{L₁ L₂ : Filter 𝕜}
(h : HasDerivAtFilter f f' x L₂)
(hst : L₁ ≤ L₂)


@[simp] lemma finsetEquivSet_apply (s : Finset α) : finsetEquivSet s = s

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


@[to_additive]
protected theorem _root_.IsUnit.finset : IsUnit a → IsUnit ({a} : Finset α)

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


theorem mul_swap_eq_iff {i j : α} {σ : Perm α} : σ * swap i j = σ ↔ i = j

{α : Type u}
[DecidableEq α]
{i j : α}
{σ : Equiv.Perm α}


theorem imp_eq_of_eq_true_right {a b : Prop} (h : b = True) : (a → b) = True


theorem _root_.SemiconjBy.tmul {a₁ a₂ a₃ : A} {b₁ b₂ b₃ : B}
    (ha : SemiconjBy a₁ a₂ a₃) (hb : SemiconjBy b₁ b₂ b₃) :
    SemiconjBy (a₁ ⊗ₜ[R] b₁) (a₂ ⊗ₜ[R] b₂) (a₃ ⊗ₜ[R] b₃)

{R : Type uR}
{A : Type uA}
{B : Type uB}
[CommSemiring R]
[NonUnitalNonAssocSemiring A]
[Module R A]
[SMulCommClass R A A]
[IsScalarTower R A A]
[NonUnitalNonAssocSemiring B]
[Module R B]
[SMulCommClass R B B]
[IsScalarTower R B B]
{a₁ a₂ a₃ : A}
{b₁ b₂ b₃ : B}
(ha : SemiconjBy a₁ a₂ a₃)
(hb : SemiconjBy b₁ b₂ b₃)


theorem ge {x y : PGame} (r : x ≡r y) : y ≤ x

{x y : SetTheory.PGame}
(r : x.Relabelling y)


@[simp]
lemma _root_.NonUnitalAlgHom.toAlgHom_zero :
    ⇑(0 : A →ₙₐ[R] R).toAlgHom = Unitization.fst

{R : Type u_2}
{A : Type u_3}
[CommSemiring R]
[NonUnitalSemiring A]
[Module R A]
[SMulCommClass R A A]
[IsScalarTower R A A]

⇑(NonUnitalAlgHom.toAlgHom 0) = Unitization.fst


@[simp, norm_cast]
theorem coe_energy {𝕜 : Type*} [LinearOrderedField 𝕜] : (P.energy G : 𝕜) =
    (∑ uv ∈ P.parts.offDiag, (G.edgeDensity uv.1 uv.2 : 𝕜) ^ 2) / (P.parts.card : 𝕜) ^ 2

{α : Type u_1}
[DecidableEq α]
{s : Finset α}
(P : Finpartition s)
(G : SimpleGraph α)
[DecidableRel G.Adj]
{𝕜 : Type u_2}
[LinearOrderedField 𝕜]

↑(P.energy G) = (∑ uv ∈ P.parts.offDiag, ↑(G.edgeDensity uv.1 uv.2) ^ 2) / ↑P.parts.card ^ 2


@[ext]
theorem ext {φ₁ φ₂ : (⨂[R] i, s i) →ₗ[R] E}
    (H : φ₁.compMultilinearMap (tprod R) = φ₂.compMultilinearMap (tprod R)) : φ₁ = φ₂

{φ₁ φ₂ : (PiTensorProduct R fun i => s i) →ₗ[R] E}

(H : φ₁.compMultilinearMap (PiTensorProduct.tprod R) = φ₂.compMultilinearMap (PiTensorProduct.tprod R))


/-- Two 2-morphisms out of a left Kan extension are equal if their compositions with
each triangle 2-morphism are equal. -/
theorem hom_ext (H : IsKan t) {k : b ⟶ c} {τ τ' : t.extension ⟶ k}
    (w : t.unit ≫ f ◁ τ = t.unit ≫ f ◁ τ') : τ = τ'

{t : CategoryTheory.Bicategory.LeftExtension f g}

(w :
  CategoryTheory.CategoryStruct.comp t.unit (CategoryTheory.Bicategory.whiskerLeft f τ) =
    CategoryTheory.CategoryStruct.comp t.unit (CategoryTheory.Bicategory.whiskerLeft f τ'))


lemma Set.Finite.isCompact_exterior (hs : s.Finite) : IsCompact (exterior s)

{α : Type u_3}
[TopologicalSpace α]
{s : Set α}
(hs : s.Finite)


/-- If `m` and `n` are equal mod `k`, `m - n` is zero mod `k`. -/
lemma sub_mod_eq_zero_of_mod_eq (h : m % k = n % k) : (m - n) % k = 0


@[simp]
theorem abs_toZNum : ∀ n : Num, abs n.toZNum = n


lemma hasSum_int_sinKernel (a : ℝ) {t : ℝ} (ht : 0 < t) : HasSum
    (fun n : ℤ ↦ -I * n * cexp (2 * π * I * a * n) * rexp (-π * n ^ 2 * t)) ↑(sinKernel a t)

HasSum (fun n => -Complex.I * ↑n * cexp (2 * ↑π * Complex.I * ↑a * ↑n) * ↑(rexp (-π * ↑n ^ 2 * t)))
  ↑(HurwitzZeta.sinKernel (↑a) t)


/-- If `f : ι → Filter α` is directed, `α` is not empty, and `∀ i, f i ≠ ⊥`, then `iInf f ≠ ⊥`.
See also `iInf_neBot_of_directed'` for a version assuming `Nonempty ι` instead of `Nonempty α`. -/
theorem iInf_neBot_of_directed {f : ι → Filter α} [hn : Nonempty α] (hd : Directed (· ≥ ·) f)
    (hb : ∀ i, NeBot (f i)) : NeBot (iInf f)

(hd : Directed (fun x x_1 => x ≥ x_1) f)


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

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

1 ≤ a → a⁻¹ ≤ 1


lemma one_le_two' [LE α] [ZeroLEOneClass α] [CovariantClass α α (swap (·+·)) (·≤·)] :
    (1 : α) ≤ 2

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


theorem classNumber_eq : NumberField.classNumber ℚ = 1


theorem sSup_image {s : Set β} {f : β → α} : sSup (f '' s) = ⨆ a ∈ s, f a

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


@[to_additive]
lemma IsCompact.mul_closure_one_eq_closure {K : Set G} (hK : IsCompact K) :
    K * (closure {1} : Set G) = closure K

{G : Type w}
[TopologicalSpace G]
[Group G]
[TopologicalGroup G]
{K : Set G}
(hK : IsCompact K)


theorem foldl_eq_of_comm_of_assoc (hcomm : Commutative f) (hassoc : Associative f) :
    ∀ a b l, foldl f a (b :: l) = f b (foldl f a l)

{α : Type u}
{f : α → α → α}
(hcomm : Commutative f)
(hassoc : Associative f)
(a b : α)
(l : List α)

List.foldl f a (b :: l) = f b (List.foldl f a l)


theorem lt_blsub {o} (f : ∀ a < o, Ordinal) (i h) : f i h < blsub o f

(f : (a : Ordinal.{u_4}) → a < o → Ordinal.{max u_5 u_4})


protected theorem IsPredLimit.isMin (h : IsPredLimit (pred a)) : IsMin a

{α : Type u_1}
[Preorder α]
{a : α}
[PredOrder α]
(h : Order.IsPredLimit (Order.pred a))


theorem support_comp_inv_smul₀ [Zero γ] {c : α} (hc : c ≠ 0) (f : β → γ) :
    (support fun x ↦ f (c⁻¹ • x)) = c • support f

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[GroupWithZero α]
[MulAction α β]
[Zero γ]
{c : α}
(hc : c ≠ 0)
(f : β → γ)

(Function.support fun x => f (c⁻¹ • x)) = c • Function.support f


theorem _root_.Disjoint.inter_eq : Disjoint s t → s ∩ t = ∅


private lemma triangle_removal_aux (hε : 0 < ε) (hP₁ : P.IsEquipartition)
    (hP₃ : P.parts.card ≤ bound (ε / 8) ⌈4/ε⌉₊)
    (ht : t ∈ (G.regularityReduced P (ε/8) (ε/4)).cliqueFinset 3) :
    triangleRemovalBound ε * card α ^ 3 ≤ (G.cliqueFinset 3).card

(hP₃ : P.parts.card ≤ SzemerediRegularity.bound (ε / 8) ⌈4 / ε⌉₊)

(ht : t ∈ (SimpleGraph.regularityReduced P G (ε / 8) (ε / 4)).cliqueFinset 3)

SimpleGraph.triangleRemovalBound ε * ↑(Fintype.card α) ^ 3 ≤ ↑(G.cliqueFinset 3).card


/-- The `MonoidHom` from a submonoid to its image.
See `MulEquiv.SubmonoidMap` for a variant for `MulEquiv`s. -/
@[to_additive (attr := simps)
      "the `AddMonoidHom` from an additive submonoid to its image. See
      `AddEquiv.AddSubmonoidMap` for a variant for `AddEquiv`s."]
def submonoidMap (f : M →* N) (M' : Submonoid M) : M' →* M'.map f

{M : Type u_1}
{N : Type u_2}
[MulOneClass M]
[MulOneClass N]
(f : M →* N)
(M' : Submonoid M)
(x : ↥M')


@[to_additive]
theorem inv_mem_iff : a⁻¹ ∈ s ↔ a ∈ s

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


theorem toRel_fromRel (sym : Symmetric r) : ToRel (fromRel sym) = r

{α : Type u_1}
{r : α → α → Prop}
(sym : Symmetric r)


theorem disjSum_mono_left (t : Multiset β) : Monotone fun s : Multiset α => s.disjSum t

{α : Type u_1}
{β : Type u_2}
(t : Multiset β)


@[to_additive]
theorem map_mul_right_ae (μ : Measure G) [IsMulRightInvariant μ] (x : G) :
    Filter.map (fun h => h * x) (ae μ) = ae μ

{G : Type u_2}
[MeasurableSpace G]
[AddGroup G]
[MeasurableAdd G]
(μ : MeasureTheory.Measure G)
[μ.IsAddRightInvariant]
(x : G)

Filter.map (fun h => h + x) (MeasureTheory.ae μ) = MeasureTheory.ae μ


/-- `Invertible a` gives a two-sided multiplicative inverse of `a`. -/
class Invertible [Mul α] [One α] (a : α) : Type u where
  /-- The inverse of an `Invertible` element -/
  invOf : α
  /-- `invOf a` is a left inverse of `a` -/
  invOf_mul_self : invOf * a = 1
  /-- `invOf a` is a right inverse of `a` -/
  mul_invOf_self : a * invOf = 1

{α : Type u}
[Mul α]
[One α]
{a : α}
[self : Invertible a]


lemma add_pow_dvd_pow_of_pow_eq_zero_right (hp : n + m ≤ p + 1) (h_comm : Commute x y)
    (hx : x ^ n = 0) : (x + y) ^ m ∣ y ^ p

{R : Type u_1}
{x y : R}
{n m p : ℕ}
[Ring R]
(hp : n + m ≤ p + 1)
(h_comm : Commute x y)
(hx : x ^ n = 0)


theorem dvd_iff_prime_pow_dvd_dvd (n d : ℕ) :
    d ∣ n ↔ ∀ p k : ℕ, Prime p → p ^ k ∣ d → p ^ k ∣ n

d ∣ n ↔ ∀ (p k : ℕ), Nat.Prime p → p ^ k ∣ d → p ^ k ∣ n


@[gcongr]
theorem exp_lt_exp_of_lt {x y : ℝ} (h : x < y) : exp x < exp y


@[reassoc]
theorem associator_naturality_middle (f : a ⟶ b) {g g' : b ⟶ c} (η : g ⟶ g') (h : c ⟶ d) :
    (f ◁ η) ▷ h ≫ (α_ f g' h).hom = (α_ f g h).hom ≫ f ◁ η ▷ h

{B : Type u}
[CategoryTheory.Bicategory B]
{a b c d : B}
(f : a ⟶ b)
{g g' : b ⟶ c}
(η : g ⟶ g')
(h : c ⟶ d)

CategoryTheory.CategoryStruct.comp
    (CategoryTheory.Bicategory.whiskerRight (CategoryTheory.Bicategory.whiskerLeft f η) h)
    (CategoryTheory.Bicategory.associator f g' h).hom =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.associator f g h).hom
    (CategoryTheory.Bicategory.whiskerLeft f (CategoryTheory.Bicategory.whiskerRight η h))


theorem mem_ndinsert_self (a : α) (s : Multiset α) : a ∈ ndinsert a s

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


@[simp]
theorem cos_sub_pi (θ : Angle) : cos (θ - π) = -cos θ


theorem if_eq_of_eq_true {c : Prop} [d : Decidable c] {α : Sort u} (t e : α) (h : c = True) :
    @ite α c d t e = t


/-- Inserting then erasing an element that is absent is the identity. -/
theorem erase_orderedInsert_of_not_mem [DecidableEq α]
    {x : α} {xs : List α} (hx : x ∉ xs) :
    (xs.orderedInsert r x).erase x = xs

{α : Type u}
{r : α → α → Prop}
[DecidableRel r]
[DecidableEq α]
{x : α}
{xs : List α}
(hx : x ∉ xs)

(List.orderedInsert r x xs).erase x = xs


theorem bit_add' : ∀ (b : Bool) (n m : ℕ), bit b (n + m) = bit b n + bit false m

Nat.bit b (n + m) = Nat.bit b n + Nat.bit false m


theorem content_C_mul (r : R) (p : R[X]) : (C r * p).content = normalize r * p.content

{R : Type u_1}
[CommRing R]
[IsDomain R]
[NormalizedGCDMonoid R]
(r : R)
(p : Polynomial R)

(Polynomial.C r * p).content = normalize r * p.content


theorem coeff_mul_monomial (p : R[X]) (n d : ℕ) (r : R) :
    coeff (p * monomial n r) (d + n) = coeff p d * r

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

(p * (Polynomial.monomial n) r).coeff (d + n) = p.coeff d * r


@[to_additive]
theorem div_mem_div [Div α] (a b : Part α) (ma mb : α) (ha : ma ∈ a) (hb : mb ∈ b) :
    ma / mb ∈ a / b

{α : Type u_1}
[Sub α]
(a b : Part α)
(ma mb : α)
(ha : ma ∈ a)
(hb : mb ∈ b)


@[to_additive (attr := simp)]
theorem prod_div_prod_filter [CommGroup G] (g : α → M → G) :
    f.prod g / (f.filter p).prod g = (f.filter fun a => ¬p a).prod g

{α : Type u_1}
{M : Type u_5}
{G : Type u_9}
[Zero M]
(p : α → Prop)
[DecidablePred p]
(f : α →₀ M)
[CommGroup G]
(g : α → M → G)

f.prod g / (Finsupp.filter p f).prod g = (Finsupp.filter (fun a => ¬p a) f).prod g


@[reassoc (attr := simp)]
lemma π_comp_leftHomologyIso_inv :
    h.π ≫ h.leftHomologyIso.inv = h.cyclesIso.inv ≫ S.leftHomologyπ

CategoryTheory.CategoryStruct.comp h.π h.leftHomologyIso.inv =
  CategoryTheory.CategoryStruct.comp h.cyclesIso.inv S.leftHomologyπ


theorem entry_norm_bound_of_unitary {U : Matrix n n 𝕜} (hU : U ∈ Matrix.unitaryGroup n 𝕜)
    (i j : n) : ‖U i j‖ ≤ 1

{𝕜 : Type u_1}
{n : Type u_3}
[RCLike 𝕜]
[Fintype n]
[DecidableEq n]
{U : Matrix n n 𝕜}
(hU : U ∈ Matrix.unitaryGroup n 𝕜)
(i j : n)


theorem toIocDiv_apply_right (a : α) : toIocDiv hp a (a + p) = 0

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


/-- This can be use to prove
```lean
example (P : Matrix (Fin 2) (Fin 3) α → Prop) :
  (∀ x, P x) ↔ ∀ a b c d e f, P !![a, b, c; d, e, f] :=
(forall_iff _).symm
```
-/
theorem forall_iff : ∀ {m n} (P : Matrix (Fin m) (Fin n) α → Prop), Forall P ↔ ∀ x, P x

{α : Type u_1}
{m n : ℕ}
(P : Matrix (Fin m) (Fin n) α → Prop)

Matrix.Forall P ↔ ∀ (x : Matrix (Fin m) (Fin n) α), P x


theorem derivWithin_sub (hxs : UniqueDiffWithinAt 𝕜 s x) (hf : DifferentiableWithinAt 𝕜 f s x)
    (hg : DifferentiableWithinAt 𝕜 g s x) :
    derivWithin (fun y => f y - g y) s x = derivWithin f s x - derivWithin g s x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f g : 𝕜 → F}
{x : 𝕜}
{s : Set 𝕜}
(hxs : UniqueDiffWithinAt 𝕜 s x)
(hf : DifferentiableWithinAt 𝕜 f s x)
(hg : DifferentiableWithinAt 𝕜 g s x)


lemma isComplex₂_mk (S : ComposableArrows C 2) (w : S.map' 0 1 ≫ S.map' 1 2 = 0) :
    S.IsComplex

(S : CategoryTheory.ComposableArrows C 2)

(w : CategoryTheory.CategoryStruct.comp (S.map' 0 1 ⋯ ⋯) (S.map' 1 2 ⋯ ⋯) = 0)


@[simp]
theorem ofRealCLM_norm : ‖ofRealCLM‖ = 1


/-- The composition of maps which preserve multiplication, also preserves multiplication. -/
@[to_additive "The composition of addition preserving maps also preserves addition"]
theorem comp {f : α → β} {g : β → γ} (hf : IsMulHom f) (hg : IsMulHom g) : IsMulHom (g ∘ f)

{α : Type u}
{β : Type v}
[Add α]
[Add β]
{γ : Type u_1}
[Add γ]
{f : α → β}
{g : β → γ}
(hf : IsAddHom f)
(hg : IsAddHom g)


theorem keys_union {s₁ s₂ : Finmap β} : (s₁ ∪ s₂).keys = s₁.keys ∪ s₂.keys

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


@[simp]
theorem aevalTower_C (x : R) : aevalTower g y (C x) = g x

{R : Type u}
{S : Type v}
{A' : Type u_1}
[CommSemiring R]
[CommSemiring A']
[CommSemiring S]
[Algebra S R]
[Algebra S A']
(g : R →ₐ[S] A')
(y : A')
(x : R)

(Polynomial.aevalTower g y) (Polynomial.C x) = g x


@[simp] lemma le_of_subsingleton [Subsingleton α] : a ≤ b

{α : Type u_2}
[Preorder α]
{a b : α}
[Subsingleton α]


theorem ext_iff {f g : A →ₑ+[φ] B} : f = g ↔ ∀ x, f x = g x

{M : Type u_1}
[Monoid M]
{N : Type u_2}
[Monoid N]
{φ : M →* N}
{A : Type u_4}
[AddMonoid A]
[DistribMulAction M A]
{B : Type u_5}
[AddMonoid B]
[DistribMulAction N B]
{f g : A →ₑ+[φ] B}


theorem Metric.finite_isBounded_inter_isClosed [ProperSpace α] {K s : Set α} [DiscreteTopology s]
    (hK : IsBounded K) (hs : IsClosed s) : Set.Finite (K ∩ s)

{α : Type u}
[PseudoMetricSpace α]
[ProperSpace α]
{K s : Set α}
[DiscreteTopology ↑s]
(hK : Bornology.IsBounded K)
(hs : IsClosed s)


/-- Construct an isomorphism of chain complexes from isomorphism of the objects
which commute with the differentials. -/
@[simps]
def isoOfComponents (f : ∀ i, C₁.X i ≅ C₂.X i)
    (hf : ∀ i j, c.Rel i j → (f i).hom ≫ C₂.d i j = C₁.d i j ≫ (f j).hom := by aesop_cat) :
    C₁ ≅ C₂

(hf : ∀ (i j : ι), c.Rel i j → (f i).hom ≫ C₂.d i j = C₁.d i j ≫ (f j).hom := by aesop_cat)

(HomologicalComplex.Hom.isoOfComponents f hf).inv.f i = (f i).inv


/-- The abscissa of absolute convergence of the L-series of a Dirichlet character mod `N > 0`
is `1`. -/
lemma absicssaOfAbsConv_eq_one {N : ℕ} (hn : N ≠ 0) (χ : DirichletCharacter ℂ N) :
    abscissaOfAbsConv ↗χ = 1

(LSeries.abscissaOfAbsConv fun n => χ ↑n) = 1


theorem covBy_iff : x ⋖ y ↔ x.1 ⋖ y.1 ∧ x.2 = y.2 ∨ x.2 ⋖ y.2 ∧ x.1 = y.1

{α : Type u_1}
{β : Type u_2}
[PartialOrder α]
[PartialOrder β]
{x y : α × β}


/-- For a self-adjoint operator `T`, a maximum of the Rayleigh quotient of `T` on a sphere centred
at the origin is an eigenvector of `T`, with eigenvalue the global supremum of the Rayleigh
quotient. -/
theorem hasEigenvector_of_isMaxOn (hT : IsSelfAdjoint T) {x₀ : E} (hx₀ : x₀ ≠ 0)
    (hextr : IsMaxOn T.reApplyInnerSelf (sphere (0 : E) ‖x₀‖) x₀) :
    HasEigenvector (T : E →ₗ[𝕜] E) (↑(⨆ x : { x : E // x ≠ 0 }, T.rayleighQuotient x)) x₀

(hextr : IsMaxOn T.reApplyInnerSelf (Metric.sphere 0 ‖x₀‖) x₀)

Module.End.HasEigenvector (↑T) (↑(⨆ x, T.rayleighQuotient ↑x)) x₀


theorem opow_mul_add_pos {b v : Ordinal} (hb : b ≠ 0) (u : Ordinal) (hv : v ≠ 0) (w : Ordinal) :
    0 < b ^ u * v + w

{b v : Ordinal.{u_1}}
(hb : b ≠ 0)
(u : Ordinal.{u_1})
(hv : v ≠ 0)
(w : Ordinal.{u_1})


/-- A limit of a.e.-measurable `ℝ≥0∞` valued functions is a.e.-measurable. -/
lemma aemeasurable_of_tendsto {f : ℕ → α → ℝ≥0∞} {g : α → ℝ≥0∞} {μ : Measure α}
    (hf : ∀ i, AEMeasurable (f i) μ) (hlim : ∀ᵐ a ∂μ, Tendsto (fun i ↦ f i a) atTop (𝓝 (g a))) :
    AEMeasurable g μ

{f : ℕ → α → ℝ≥0∞}

{g : α → ℝ≥0∞}

(hlim : ∀ᵐ (a : α) ∂μ, Filter.Tendsto (fun i => f i a) Filter.atTop (𝓝 (g a)))


/-- `cyclotomic' n K` splits. -/
theorem cyclotomic'_splits (n : ℕ) : Splits (RingHom.id K) (cyclotomic' n K)

Polynomial.Splits (RingHom.id K) (Polynomial.cyclotomic' n K)


@[simp]
theorem sum_smul_index_linearMap' [Semiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid M₂]
    [Module R M₂] {v : α →₀ M} {c : R} {h : α → M →ₗ[R] M₂} :
    ((c • v).sum fun a => h a) = c • v.sum fun a => h a

{α : Type u_1}
{R : Type u_3}
{M : Type u_4}
{M₂ : Type u_5}
[Semiring R]
[AddCommMonoid M]
[Module R M]
[AddCommMonoid M₂]
[Module R M₂]
{v : α →₀ M}
{c : R}
{h : α → M →ₗ[R] M₂}

((c • v).sum fun a => ⇑(h a)) = c • v.sum fun a => ⇑(h a)


/-- `yoneda'` induces an equivalence of category between `Type u` and
`SheafOfTypes typesGrothendieckTopology`. -/
@[simps!]
noncomputable def typeEquiv : Type u ≌ SheafOfTypes typesGrothendieckTopology

(X : CategoryTheory.SheafOfTypes CategoryTheory.typesGrothendieckTopology)

CategoryTheory.typeEquiv.inverse.obj X = X.val.obj (Opposite.op PUnit.{u + 1})


@[simp] lemma support_one : support (1 : ι → R) = univ

{ι : Type u_1}
(R : Type u_5)
[Zero R]
[One R]
[NeZero 1]


@[to_additive (attr := nontriviality)]
theorem isUnit_of_subsingleton [Monoid M] [Subsingleton M] (a : M) : IsUnit a

{M : Type u_1}
[Monoid M]
[Subsingleton M]
(a : M)


theorem Set.Nonempty.csInf_mem (h : s.Nonempty) (hs : s.Finite) : sInf s ∈ s

{α : Type u_2}
[ConditionallyCompleteLinearOrder α]
{s : Set α}
(h : s.Nonempty)
(hs : s.Finite)


theorem Disjoint.zpow_disjoint_zpow {σ τ : Perm α} (hστ : Disjoint σ τ) (m n : ℤ) :
    Disjoint (σ ^ m) (τ ^ n)

{α : Type u_1}
{σ τ : Equiv.Perm α}
(hστ : σ.Disjoint τ)
(m n : ℤ)


@[to_additive (attr := simp)]
theorem mulRight_symm [IsometricSMul Gᵐᵒᵖ G] (x : G) : (mulRight x).symm = mulRight x⁻¹

{G : Type v}
[AddGroup G]
[PseudoEMetricSpace G]
[IsometricVAdd Gᵃᵒᵖ G]
(x : G)

(IsometryEquiv.addRight x).symm = IsometryEquiv.addRight (-x)


@[to_additive]
theorem Group.rank_range_le [Group.FG G] {f : G →* G'} : Group.rank f.range ≤ Group.rank G

{G : Type u_3}
[Group G]
{G' : Type u_5}
[Group G']
[Group.FG G]
{f : G →* G'}


/-- Class expressing the fact that a `RingHom` is surjective. This is needed in the context
of semilinear maps, where some lemmas require this. -/
class RingHomSurjective (σ : R₁ →+* R₂) : Prop where
  /-- The ring homomorphism is surjective -/
  is_surjective : Function.Surjective σ

{R₁ : Type u_1}
{R₂ : Type u_2}
[Semiring R₁]
[Semiring R₂]
{σ : R₁ →+* R₂}
[self : RingHomSurjective σ]


/-- A quaternion basis contains the information both sufficient and necessary to construct an
`R`-algebra homomorphism from `ℍ[R,c₁,c₂]` to `A`; or equivalently, a surjective
`R`-algebra homomorphism from `ℍ[R,c₁,c₂]` to an `R`-subalgebra of `A`.

Note that for definitional convenience, `k` is provided as a field even though `i_mul_j` fully
determines it. -/
structure Basis {R : Type*} (A : Type*) [CommRing R] [Ring A] [Algebra R A] (c₁ c₂ : R) where
  (i j k : A)
  i_mul_i : i * i = c₁ • (1 : A)
  j_mul_j : j * j = c₂ • (1 : A)
  i_mul_j : i * j = k
  j_mul_i : j * i = -k

(self : QuaternionAlgebra.Basis A c₁ c₂)


/-- `SpecΓIdentity` is iso so these are mutually two-sided inverses. -/
theorem right_triangle (R : CommRingCat) :
    identityToΓSpec.app (Spec.toLocallyRingedSpace.obj <| op R) ≫
        Spec.toLocallyRingedSpace.map (SpecΓIdentity.inv.app R).op =
      𝟙 _

CategoryTheory.CategoryStruct.comp
    (AlgebraicGeometry.identityToΓSpec.app (AlgebraicGeometry.Spec.toLocallyRingedSpace.obj (Opposite.op R)))
    (AlgebraicGeometry.Spec.toLocallyRingedSpace.map
      (AlgebraicGeometry.LocallyRingedSpace.SpecΓIdentity.inv.app R).op) =
  CategoryTheory.CategoryStruct.id
    ((CategoryTheory.Functor.id AlgebraicGeometry.LocallyRingedSpace).obj
      (AlgebraicGeometry.Spec.toLocallyRingedSpace.obj (Opposite.op R)))


@[simp] lemma zeckendorf_zero : zeckendorf 0 = []


theorem toNNReal_pow {x : ℝ} (hx : 0 ≤ x) (n : ℕ) : (x ^ n).toNNReal = x.toNNReal ^ n


@[to_additive (attr := simp, norm_cast)]
protected theorem val_smul_of_tower (r : M) (x : s) : (↑(r • x) : α) = r • (x : α)

{S : Type u'}
{M : Type v}
{N : Type u_1}
{α : Type u_2}
[SetLike S α]
[VAdd M N]
[VAdd M α]
[AddMonoid N]
[AddAction N α]
[VAddMemClass S N α]
[VAddAssocClass M N α]
(s : S)
(r : M)
(x : ↥s)


@[fun_prop]
theorem HasFDerivWithinAt.list_prod' {l : List ι} {x : E}
    (h : ∀ i ∈ l, HasFDerivWithinAt (f i ·) (f' i) s x) :
    HasFDerivWithinAt (fun x ↦ (l.map (f · x)).prod)
      (∑ i : Fin l.length, ((l.take i).map (f · x)).prod •
        smulRight (f' (l.get i)) ((l.drop (.succ i)).map (f · x)).prod) s x

(h : ∀ i ∈ l, HasFDerivWithinAt (fun x => f i x) (f' i) s x)

HasFDerivWithinAt (fun x => (List.map (fun x_1 => f x_1 x) l).prod)
  (∑ i : Fin l.length,
    (List.map (fun x_1 => f x_1 x) (List.take (↑i) l)).prod •
      (f' (l.get i)).smulRight (List.map (fun x_1 => f x_1 x) (List.drop (↑i).succ l)).prod)
  s x


lemma P24_of_ih (ihxy : IH1 x y) (i j) : P24 (x.moveLeft i) (x.moveLeft j) y

{x y : SetTheory.PGame}
(ihxy : Surreal.Multiplication.IH1 x y)
(i j : x.LeftMoves)

Surreal.Multiplication.P24 (x.moveLeft i) (x.moveLeft j) y


@[simp]
theorem left_eq_id {X Y : StructuredArrow S T} (f : X ⟶ Y) : f.left = 𝟙 _

{X Y : CategoryTheory.StructuredArrow S T}

f.left = CategoryTheory.CategoryStruct.id X.left


/-- The pigeonhole principle for finitely many pigeons counted by heads: there is a pigeonhole with
at least as many pigeons as the ceiling of the average number of pigeons across all pigeonholes.
("The maximum is at least the mean" specialized to integers.)

More formally, given a function between finite sets `s` and `t` and a natural number `n` such that
`card t * n < card s`, there exists `y ∈ t` such that its preimage in `s` has more than `n`
elements. -/
theorem exists_lt_card_fiber_of_mul_lt_card_of_maps_to (hf : ∀ a ∈ s, f a ∈ t)
    (hn : t.card * n < s.card) : ∃ y ∈ t, n < (s.filter fun x => f x = y).card

{α : Type u}
{β : Type v}
[DecidableEq β]
{s : Finset α}
{t : Finset β}
{f : α → β}
{n : ℕ}
(hf : ∀ a ∈ s, f a ∈ t)
(hn : t.card * n < s.card)

∃ y ∈ t, n < (Finset.filter (fun x => f x = y) s).card


/-- The subpresheaf of dependent functions on `X` satisfying the "pre-local" predicate `P`.
-/
@[simps!]
def subpresheafToTypes (P : PrelocalPredicate T) : Presheaf (Type v) X

{X : TopCat}
{T : ↑X → Type v}
(P : TopCat.PrelocalPredicate T)
(U : (TopologicalSpace.Opens ↑X)ᵒᵖ)

(TopCat.subpresheafToTypes P).obj U = { f // P.pred f }


/-- Pointwise scalar multiplication of `f : G →+c[a, b] H` as a map `G →+c[a, c • b] H`. -/
@[simps (config := .asFn)]
def smul [DistribSMul K H] (c : K) (f : G →+c[a, b] H) : G →+c[a, c • b] H

{G : Type u_1}
{H : Type u_2}
{K : Type u_3}
[Add G]
[AddZeroClass H]
{a : G}
{b : H}
[DistribSMul K H]
(c : K)
(f : AddConstMap G H a b)


theorem sub_sub_cancel (h : a ≠ ∞) (h2 : b ≤ a) : a - (a - b) = b


theorem mem_closure {x : R} {s : Set R} : x ∈ closure s ↔ ∀ S : Subring R, s ⊆ S → x ∈ S

{R : Type u}
[Ring R]
{x : R}
{s : Set R}

x ∈ Subring.closure s ↔ ∀ (S : Subring R), s ⊆ ↑S → x ∈ S


theorem exists_maximal_algebraicIndependent (s t : Set A) (hst : s ⊆ t)
    (hs : AlgebraicIndependent R ((↑) : s → A)) :
    ∃ u : Set A, AlgebraicIndependent R ((↑) : u → A) ∧ s ⊆ u ∧ u ⊆ t ∧
      ∀ x : Set A, AlgebraicIndependent R ((↑) : x → A) → u ⊆ x → x ⊆ t → x = u

(hs : AlgebraicIndependent R Subtype.val)

∃ u,
  AlgebraicIndependent R Subtype.val ∧
    s ⊆ u ∧ u ⊆ t ∧ ∀ (x : Set A), AlgebraicIndependent R Subtype.val → u ⊆ x → x ⊆ t → x = u


theorem ContDiffAt.restrict_scalars (h : ContDiffAt 𝕜' n f x) : ContDiffAt 𝕜 n f x

(𝕜 : Type u_1)
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{x : E}
{n : ℕ∞}
{𝕜' : Type u_3}
[NontriviallyNormedField 𝕜']
[NormedAlgebra 𝕜 𝕜']
[NormedSpace 𝕜' E]
[IsScalarTower 𝕜 𝕜' E]
[NormedSpace 𝕜' F]
[IsScalarTower 𝕜 𝕜' F]
(h : ContDiffAt 𝕜' n f x)


theorem ker_prodMap (f : M →ₗ[R] M₂) (g : M₃ →ₗ[R] M₄) :
    ker (LinearMap.prodMap f g) = Submodule.prod (ker f) (ker g)

{R : Type u}
{M : Type v}
{M₂ : Type w}
{M₃ : Type y}
{M₄ : Type z}
[Semiring R]
[AddCommMonoid M]
[AddCommMonoid M₂]
[AddCommMonoid M₃]
[AddCommMonoid M₄]
[Module R M]
[Module R M₂]
[Module R M₃]
[Module R M₄]
(f : M →ₗ[R] M₂)
(g : M₃ →ₗ[R] M₄)

LinearMap.ker (f.prodMap g) = (LinearMap.ker f).prod (LinearMap.ker g)


@[simp]
theorem cosh_add_sinh : cosh x + sinh x = exp x

Complex.cosh x + Complex.sinh x = Complex.exp x


/-- A distributive lattice is a lattice that satisfies any of four
equivalent distributive properties (of `sup` over `inf` or `inf` over `sup`,
on the left or right).

The definition here chooses `le_sup_inf`: `(x ⊔ y) ⊓ (x ⊔ z) ≤ x ⊔ (y ⊓ z)`. To prove distributivity
from the dual law, use `DistribLattice.of_inf_sup_le`.

A classic example of a distributive lattice
is the lattice of subsets of a set, and in fact this example is
generic in the sense that every distributive lattice is realizable
as a sublattice of a powerset lattice. -/
class DistribLattice (α) extends Lattice α where
  /-- The infimum distributes over the supremum -/
  protected le_sup_inf : ∀ x y z : α, (x ⊔ y) ⊓ (x ⊔ z) ≤ x ⊔ y ⊓ z

{α : Type u_1}
[self : DistribLattice α]
(x y z : α)


lemma cfc_apply_of_not_continuousOn {f : R → R} (a : A) (hf : ¬ ContinuousOn f (spectrum R a)) :
    cfc f a = 0

{R : Type u_1}
{A : Type u_2}
{p : A → Prop}
[CommSemiring R]
[StarRing R]
[MetricSpace R]
[TopologicalSemiring R]
[ContinuousStar R]
[TopologicalSpace A]
[Ring A]
[StarRing A]
[Algebra R A]
[ContinuousFunctionalCalculus R p]
{f : R → R}
(a : A)
(hf : ¬ContinuousOn f (spectrum R a))


@[simp]
theorem piEquivFin_apply (n : ℕ) (x : AdicCompletion I (Fin n → R)) :
    piEquivFin I n x = pi I (fun _ : Fin n ↦ R) x

{R : Type u_1}
[CommRing R]
(I : Ideal R)
(n : ℕ)
(x : AdicCompletion I (Fin n → R))

(AdicCompletion.piEquivFin I n) x = (AdicCompletion.pi I fun x => R) x


theorem mul_mem_mul (hm : m ∈ M) (hn : n ∈ N) : m * n ∈ M * N

{R : Type u}
[CommSemiring R]
{A : Type v}
[Semiring A]
[Algebra R A]
{M N : Submodule R A}
{m n : A}
(hm : m ∈ M)
(hn : n ∈ N)


@[simp]
theorem map_inv (v : AddValuation K Γ₀) {x : K} : v x⁻¹ = - (v x)

{K : Type u_1}
[DivisionRing K]
{Γ₀ : Type u_4}
[LinearOrderedAddCommGroupWithTop Γ₀]
(v : AddValuation K Γ₀)
{x : K}


@[simp] theorem swap_swap {o : Ordering} : o.swap.swap = o


theorem toEuclideanLin_eq_toLin [Finite m] :
    (toEuclideanLin : Matrix m n 𝕜 ≃ₗ[𝕜] _) =
      Matrix.toLin (PiLp.basisFun _ _ _) (PiLp.basisFun _ _ _)

{𝕜 : Type u_3}
[RCLike 𝕜]
{m : Type u_8}
{n : Type u_9}
[Fintype n]
[DecidableEq n]
[Finite m]

Matrix.toEuclideanLin = Matrix.toLin (PiLp.basisFun 2 𝕜 n) (PiLp.basisFun 2 𝕜 m)


/-- An equivalence between categories gives an equivalence between the opposite categories.
-/
@[simps]
def op (e : C ≌ D) : Cᵒᵖ ≌ Dᵒᵖ

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

e.op.counitIso = (CategoryTheory.NatIso.op e.counitIso).symm


theorem ModularForm.toFun_eq_coe (f : ModularForm Γ k) : f.toFun = (f : ℍ → ℂ)

{Γ : Subgroup SL(2, ℤ)}
{k : ℤ}
(f : ModularForm Γ k)


theorem endPos_eq_zero : ∀ (s : String), endPos s = 0 ↔ s = ""


protected theorem tsub_right_inj (ha : AddLECancellable a) (hb : AddLECancellable b)
    (hc : AddLECancellable c) (hba : b ≤ a) (hca : c ≤ a) : a - b = a - c ↔ b = c

{α : Type u_1}
[CanonicallyOrderedAddCommMonoid α]
[Sub α]
[OrderedSub α]
{a b c : α}
(ha : AddLECancellable a)
(hb : AddLECancellable b)
(hc : AddLECancellable c)
(hba : b ≤ a)
(hca : c ≤ a)


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

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

Filter.Tendsto Inv.inv (𝓝[≥] a⁻¹) (𝓝[≤] a)


theorem mul_upcrossingsBefore_le (hf : a ≤ f N ω) (hab : a < b) :
    (b - a) * upcrossingsBefore a b f N ω ≤
    ∑ k ∈ Finset.range N, upcrossingStrat a b f N k ω * (f (k + 1) - f k) ω

{Ω : Type u_1}
{a b : ℝ}
{f : ℕ → Ω → ℝ}
{N : ℕ}
{ω : Ω}
(hf : a ≤ f N ω)
(hab : a < b)

(b - a) * ↑(MeasureTheory.upcrossingsBefore a b f N ω) ≤
  ∑ k ∈ Finset.range N, MeasureTheory.upcrossingStrat a b f N k ω * (f (k + 1) - f k) ω


theorem copy_eq (f : EsakiaHom α β) (f' : α → β) (h : f' = f) : f.copy f' h = f

{α : Type u_2}
{β : Type u_3}
[TopologicalSpace α]
[Preorder α]
[TopologicalSpace β]
[Preorder β]
(f : EsakiaHom α β)
(f' : α → β)
(h : f' = ⇑f)


/-- The `p`-adic norm is multiplicative. -/
@[simp]
protected theorem mul (q r : ℚ) : padicNorm p (q * r) = padicNorm p q * padicNorm p r

{p : ℕ}
[hp : Fact (Nat.Prime p)]
(q r : ℚ)


/-- Casting a `Homotopy p₀ p₁` to a `Homotopy q₀ q₁` where `p₀ = q₀` and `p₁ = q₁`. -/
@[simps!]
def cast {p₀ p₁ q₀ q₁ : Path x₀ x₁} (F : Homotopy p₀ p₁) (h₀ : p₀ = q₀) (h₁ : p₁ = q₁) :
    Homotopy q₀ q₁

{X : Type u}
[TopologicalSpace X]
{x₀ x₁ : X}
{p₀ p₁ q₀ q₁ : Path x₀ x₁}
(F : p₀.Homotopy p₁)
(h₀ : p₀ = q₀)
(h₁ : p₁ = q₁)
(a : ↑I × ↑I)


theorem addOrderOf_div_of_gcd_eq_one {m n : ℕ} (hn : 0 < n) (h : m.gcd n = 1) :
    addOrderOf (↑(↑m / ↑n * p) : AddCircle p) = n

{𝕜 : Type u_1}
[LinearOrderedField 𝕜]
{p : 𝕜}
[hp : Fact (0 < p)]
{m n : ℕ}
(hn : 0 < n)
(h : m.gcd n = 1)


@[to_additive]
theorem ae_measure_preimage_mul_right_lt_top (hμs : μ' s ≠ ∞) :
    ∀ᵐ x ∂μ', ν' ((· * x) ⁻¹' s) < ∞

{G : Type u_1}
[MeasurableSpace G]
[Group G]
[MeasurableMul₂ G]
{s : Set G}
[MeasurableInv G]
(μ' ν' : MeasureTheory.Measure G)
[MeasureTheory.SigmaFinite μ']
[MeasureTheory.SigmaFinite ν']
[μ'.IsMulLeftInvariant]
[ν'.IsMulLeftInvariant]
(hμs : μ' s ≠ ⊤)


lemma AntitoneOn.mapsTo_Icc (h : AntitoneOn f (Icc a b)) : MapsTo f (Icc a b) (Icc (f b) (f a))

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

Set.MapsTo f (Set.Icc a b) (Set.Icc (f b) (f a))


@[simp]
theorem pellZd_succ (n : ℕ) : pellZd a1 (n + 1) = pellZd a1 n * ⟨a, 1⟩

Pell.pellZd a1 (n + 1) = Pell.pellZd a1 n * { re := ↑a, im := 1 }


theorem eventually_no_roots (hP : P ≠ 0) : ∀ᶠ x in atTop, ¬P.IsRoot x

{𝕜 : Type u_1}
[NormedLinearOrderedField 𝕜]
(P : 𝕜[X])
(hP : P ≠ 0)


@[to_additive ofReal_norm_eq_coe_nnnorm]
theorem ofReal_norm_eq_coe_nnnorm' (a : E) : ENNReal.ofReal ‖a‖ = ‖a‖₊

{E : Type u_6}
[SeminormedGroup E]
(a : E)


theorem irreducible_of_span_eq_maximalIdeal {R : Type*} [CommRing R] [LocalRing R] [IsDomain R]
    (ϖ : R) (hϖ : ϖ ≠ 0) (h : maximalIdeal R = Ideal.span {ϖ}) : Irreducible ϖ

(h : LocalRing.maximalIdeal R = Ideal.span {ϖ})


/-- This structure contains the data and axioms in order to
produce a `PresheafOfModules R` from a collection of objects
of type `ModuleCat (R.obj X)` for all `X`, and restriction
maps expressed as linear maps to restriction of scalars.
(See the constructor `PresheafOfModules.mk''`.) -/
structure BundledCorePresheafOfModules where
  /-- the datum of a `ModuleCat (R.obj X)` for each object in `Cᵒᵖ` -/
  obj (X : Cᵒᵖ) : ModuleCat.{v} (R.obj X)
  /-- the restriction maps as linear maps to restriction of scalars -/
  map {X Y : Cᵒᵖ} (f : X ⟶ Y) : obj X ⟶ (ModuleCat.restrictScalars (R.map f)).obj (obj Y)
  /-- `map` is compatible with the identities -/
  map_id (X : Cᵒᵖ) :
    map (𝟙 X) = (ModuleCat.restrictScalarsId' (R.map (𝟙 X)) (R.map_id X)).inv.app (obj X) := by
      aesop
  /-- `map` is compatible with the composition -/
  map_comp {X Y Z : Cᵒᵖ} (f : X ⟶ Y) (g : Y ⟶ Z) :
    map (f ≫ g) = map f ≫ (ModuleCat.restrictScalars (R.map f)).map (map g) ≫
      (ModuleCat.restrictScalarsComp' (R.map f) (R.map g) (R.map (f ≫ g))
        (R.map_comp f g)).inv.app (obj Z) := by aesop

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{R : Cᵒᵖ ⥤ RingCat}
(self : BundledCorePresheafOfModules R)
(X : Cᵒᵖ)

self.map (𝟙 X) = (ModuleCat.restrictScalarsId' (R.map (𝟙 X)) ⋯).inv.app (self.obj X)


lemma prod_sum_left {ι : Type*} (m : ι → Measure α) (μ : Measure β) [SFinite μ] :
    (Measure.sum m).prod μ = Measure.sum (fun i ↦ (m i).prod μ)

{α : Type u_1}
{β : Type u_3}
[MeasurableSpace α]
[MeasurableSpace β]
{ι : Type u_7}
(m : ι → MeasureTheory.Measure α)
(μ : MeasureTheory.Measure β)
[MeasureTheory.SFinite μ]

(MeasureTheory.Measure.sum m).prod μ = MeasureTheory.Measure.sum fun i => (m i).prod μ


@[to_additive (attr := simp, norm_cast)]
theorem coe_iInf {ι : Sort*} {S : ι → Subgroup G} : (↑(⨅ i, S i) : Set G) = ⋂ i, S i

{G : Type u_1}
[Group G]
{ι : Sort u_5}
{S : ι → Subgroup G}


theorem iInter_ge_eq_iInter_nat_add (u : ℕ → Set α) (n : ℕ) : ⋂ i ≥ n, u i = ⋂ i, u (i + n)

⋂ i, ⋂ (_ : i ≥ n), u i = ⋂ i, u (i + n)


/--
The substitution principle for equality. If `a = b ` and `P a` holds,
then `P b` also holds. We conventionally use the name `motive` for `P` here,
so that you can specify it explicitly using e.g.
`Eq.subst (motive := fun x => x < 5)` if it is not otherwise inferred correctly.

This theorem is the underlying mechanism behind the `rw` tactic, which is
essentially a fancy algorithm for finding good `motive` arguments to usefully
apply this theorem to replace occurrences of `a` with `b` in the goal or
hypotheses.

For more information: [Equality](https://lean-lang.org/theorem_proving_in_lean4/quantifiers_and_equality.html#equality)
-/
theorem Eq.subst {α : Sort u} {motive : α → Prop} {a b : α} (h₁ : Eq a b) (h₂ : motive a) : motive b


/-- Construct limit data for a binary product in `AddCommGrp`, using
`AddCommGrp.of (G × H)`.
-/
@[simps cone_pt isLimit_lift]
def binaryProductLimitCone (G H : AddCommGrp.{u}) : Limits.LimitCone (pair G H)

(s : CategoryTheory.Limits.Cone (CategoryTheory.Limits.pair G H))

(G.binaryProductLimitCone H).isLimit.lift s =
  AddMonoidHom.prod (s.π.app { as := CategoryTheory.Limits.WalkingPair.left })
    (s.π.app { as := CategoryTheory.Limits.WalkingPair.right })


theorem IsLittleO.prod_rightl (h : f =o[l] g') : f =o[l] fun x => (g' x, k' x)

{α : Type u_1}
{E : Type u_3}
{F' : Type u_7}
{G' : Type u_8}
[Norm E]
[SeminormedAddCommGroup F']
[SeminormedAddCommGroup G']
{f : α → E}
{g' : α → F'}
(k' : α → G')
{l : Filter α}
(h : f =o[l] g')


@[to_additive]
protected theorem mul_one (x : R[S⁻¹]) : x * 1 = x

{R : Type u_1}
[Monoid R]
{S : Submonoid R}
[OreLocalization.OreSet S]
(x : OreLocalization S R)


theorem Filter.Tendsto.cauchySeq [SemilatticeSup β] [Nonempty β] {f : β → α} {x}
    (hx : Tendsto f atTop (𝓝 x)) : CauchySeq f

(hx : Filter.Tendsto f Filter.atTop (𝓝 x))


theorem Gamma_mul_Gamma_add_half (s : ℂ) :
    Gamma s * Gamma (s + 1 / 2) = Gamma (2 * s) * (2 : ℂ) ^ (1 - 2 * s) * ↑(√π)

Complex.Gamma s * Complex.Gamma (s + 1 / 2) = Complex.Gamma (2 * s) * 2 ^ (1 - 2 * s) * ↑√π


theorem strictMono_of_le_iff_le [Preorder α] [Preorder β] {f : α → β}
    (h : ∀ x y, x ≤ y ↔ f x ≤ f y) : StrictMono f

{α : Type u}
{β : Type v}
[Preorder α]
[Preorder β]
{f : α → β}
(h : ∀ (x y : α), x ≤ y ↔ f x ≤ f y)


theorem differentiable_polynomial_eval_inv_mul (p : ℝ[X]) :
    Differentiable ℝ (fun x ↦ p.eval x⁻¹ * expNegInvGlue x)

Differentiable ℝ fun x => Polynomial.eval x⁻¹ p * expNegInvGlue x


@[simp] theorem shiftLeft_zero : n <<< 0 = n


theorem lineDifferentiableWithinAt_univ :
    LineDifferentiableWithinAt 𝕜 f univ x v ↔ LineDifferentiableAt 𝕜 f x v

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type u_2}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{E : Type u_3}
[AddCommGroup E]
[Module 𝕜 E]
{f : E → F}
{x v : E}

LineDifferentiableWithinAt 𝕜 f Set.univ x v ↔ LineDifferentiableAt 𝕜 f x v


/-- The functor `Arrow (Arrow C) ⥤ Square C` which sends
a morphism `Arrow.mk f ⟶ Arrow.mk g` to the commutative square
with `f` on the top side and `g` on the bottom side. -/
@[simps!]
def fromArrowArrowFunctor' : Arrow (Arrow C) ⥤ Square C

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

∀ {X Y : CategoryTheory.Arrow (CategoryTheory.Arrow C)} (φ : X ⟶ Y),
  (CategoryTheory.Square.fromArrowArrowFunctor'.map φ).τ₁ = φ.left.left


@[simp] lemma natAbs_of_isUnit (hu : IsUnit u) : natAbs u = 1


@[to_additive]
protected theorem mul_right_cancel (h : IsUnit b) : a * b = c * b → a = c

{M : Type u_1}
[AddMonoid M]
{a b c : M}
(h : IsAddUnit b)


@[reassoc]
theorem comp_whiskerLeft_symm (f : a ⟶ b) (g : b ⟶ c) {h h' : c ⟶ d} (η : h ⟶ h') :
    f ◁ g ◁ η = (α_ f g h).inv ≫ (f ≫ g) ◁ η ≫ (α_ f g h').hom

{B : Type u}
[CategoryTheory.Bicategory B]
{a b c d : B}
(f : a ⟶ b)
(g : b ⟶ c)
{h h' : c ⟶ d}
(η : h ⟶ h')

CategoryTheory.Bicategory.whiskerLeft f (CategoryTheory.Bicategory.whiskerLeft g η) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.associator f g h).inv
    (CategoryTheory.CategoryStruct.comp
      (CategoryTheory.Bicategory.whiskerLeft (CategoryTheory.CategoryStruct.comp f g) η)
      (CategoryTheory.Bicategory.associator f g h').hom)


theorem card_filter_le (s : Finset α) (p : α → Prop) [DecidablePred p] :
    (s.filter p).card ≤ s.card

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


theorem ordConnected_iInter {ι : Sort*} {s : ι → Set α} (hs : ∀ i, OrdConnected (s i)) :
    OrdConnected (⋂ i, s i)

{α : Type u_1}
[Preorder α]
{ι : Sort u_3}
{s : ι → Set α}
(hs : ∀ (i : ι), (s i).OrdConnected)


lemma fourierIntegral_comp_linearIsometry (A : W ≃ₗᵢ[ℝ] V) (f : V → E) (w : W) :
    𝓕 (f ∘ A) w = (𝓕 f) (A w)

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
{V : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MeasurableSpace V]
[BorelSpace V]
[FiniteDimensional ℝ V]
{W : Type u_3}
[NormedAddCommGroup W]
[InnerProductSpace ℝ W]
[MeasurableSpace W]
[BorelSpace W]
[FiniteDimensional ℝ W]
(A : W ≃ₗᵢ[ℝ] V)
(f : V → E)
(w : W)

Real.fourierIntegral (f ∘ ⇑A) w = Real.fourierIntegral f (A w)


@[to_additive]
lemma prod_mul_prod_comm (f g h i : α → β) :
    (∏ a ∈ s, f a * g a) * ∏ a ∈ s, h a * i a = (∏ a ∈ s, f a * h a) * ∏ a ∈ s, g a * i a

{α : Type u_3}
{β : Type u_4}
{s : Finset α}
[CommMonoid β]
(f g h i : α → β)


theorem Summable.matrix_blockDiagonal' [DecidableEq l] {f : X → ∀ i, Matrix (m' i) (n' i) R}
    (hf : Summable f) : Summable fun x => blockDiagonal' (f x)

{f : X → (i : l) → Matrix (m' i) (n' i) R}

Summable fun x => Matrix.blockDiagonal' (f x)


lemma fromColumns_inj : Function.Injective2 (@fromColumns R m n₁ n₂)

{R : Type u_1}
{m : Type u_2}
{n₁ : Type u_6}
{n₂ : Type u_7}


theorem toCycle_eq_toList (f : Perm α) (hf : IsCycle f) (x : α) (hx : f x ≠ x) :
    toCycle f hf = toList f x

{α : Type u_1}
[Fintype α]
[DecidableEq α]
(f : Equiv.Perm α)
(hf : f.IsCycle)
(x : α)
(hx : f x ≠ x)


/-- The functor which sends a triangle `X ⟶ Y ⟶ Z ⟶ X⟦1⟧` in `C` to the triangle
`op Z ⟶ op Y ⟶ op X ⟶ (op Z)⟦1⟧` in `Cᵒᵖ` (without introducing signs). -/
@[simps]
noncomputable def functor : (Triangle C)ᵒᵖ ⥤ Triangle Cᵒᵖ

{T₁ T₂ : (CategoryTheory.Pretriangulated.Triangle C)ᵒᵖ}

((CategoryTheory.Pretriangulated.TriangleOpEquivalence.functor C).map φ).hom₃ = φ.unop.hom₁.op


/-- Finitely generated submodules are precisely compact elements in the submodule lattice. -/
theorem fg_iff_compact (s : Submodule R M) : s.FG ↔ CompleteLattice.IsCompactElement s

{R : Type u_1}
{M : Type u_2}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(s : Submodule R M)


@[to_additive]
theorem div_inter_subset : s / (t₁ ∩ t₂) ⊆ s / t₁ ∩ (s / t₂)

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


/-- If a scheme `X` has a cover by affine opens whose sections are Noetherian rings,
then `X` is locally Noetherian. -/
theorem isLocallyNoetherian_of_affine_cover {ι} {S : ι → X.affineOpens}
    (hS : (⨆ i, S i : X.Opens) = ⊤)
    (hS' : ∀ i, IsNoetherianRing Γ(X, S i)) : IsLocallyNoetherian X

(hS' : ∀ (i : ι), IsNoetherianRing ↑Γ(X, ↑(S i)))


theorem sin_eq (z : ℂ) : sin z = sin z.re * cosh z.im + cos z.re * sinh z.im * I

Complex.sin z = Complex.sin ↑z.re * Complex.cosh ↑z.im + Complex.cos ↑z.re * Complex.sinh ↑z.im * Complex.I


/-- Identity isomorphism. -/
@[refl, simps]
def refl (X : C) : X ≅ X

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

(CategoryTheory.Iso.refl X).hom = CategoryTheory.CategoryStruct.id X


theorem Nontrivial.ne_singleton {x} (hs : s.Nontrivial) : s ≠ {x}

{α : Type u}
{s : Set α}
{x : α}
(hs : s.Nontrivial)


@[simp]
theorem bot_arrow {X : C} : (⊥ : MonoOver X).arrow = initial.to X

⊥.arrow = CategoryTheory.Limits.initial.to X


theorem abs_sub_eq_iff : abs (x - y) = |abs x - abs y| ↔ x = 0 ∨ y = 0 ∨ x.arg = y.arg

Complex.abs (x - y) = |Complex.abs x - Complex.abs y| ↔ x = 0 ∨ y = 0 ∨ x.arg = y.arg


theorem eq_of_prodExtendRight_ne {e : Perm β₁} {a a' : α₁} {b : β₁}
    (h : prodExtendRight a e (a', b) ≠ (a', b)) : a' = a

(h : (Equiv.Perm.prodExtendRight a e) (a', b) ≠ (a', b))


/-- The set of all permutations of `Fin (n + 1)` can be constructed by augmenting the set of
permutations of `Fin n` by each element of `Fin (n + 1)` in turn. -/
theorem Finset.univ_perm_fin_succ {n : ℕ} :
    @Finset.univ (Perm <| Fin n.succ) _ =
      (Finset.univ : Finset <| Fin n.succ × Perm (Fin n)).map
        Equiv.Perm.decomposeFin.symm.toEmbedding

Finset.univ = Finset.map Equiv.Perm.decomposeFin.symm.toEmbedding Finset.univ


/-- The inclusion of the image sheaf to the target. -/
@[simps]
def imageSheafι {F F' : Sheaf J (Type w)} (f : F ⟶ F') : imageSheaf f ⟶ F'

{J : CategoryTheory.GrothendieckTopology C}

{F F' : CategoryTheory.Sheaf J (Type w)}

(CategoryTheory.GrothendieckTopology.imageSheafι f).val =
  (CategoryTheory.GrothendieckTopology.Subpresheaf.sheafify J
      (CategoryTheory.GrothendieckTopology.imagePresheaf f.val)).ι


/-- Concatenating the first element of a tuple with its tail gives back the original tuple -/
@[simp]
theorem snoc_init_self : snoc (init q) (q (last n)) = q

{n : ℕ}
{α : Fin (n + 1) → Type u}
(q : (i : Fin (n + 1)) → α i)

Fin.snoc (Fin.init q) (q (Fin.last n)) = q


@[simp] lemma coe_birkhoffFinset (a : α) : birkhoffFinset a = birkhoffSet a

{α : Type u_1}
[DistribLattice α]
[Fintype α]
[DecidablePred SupIrred]
(a : α)

↑(OrderEmbedding.birkhoffFinset a) = OrderEmbedding.birkhoffSet a


/-- The antidiagonal of `n` does not contain duplicate entries. -/
theorem nodup_antidiagonal (n : ℕ) : Nodup (antidiagonal n)


theorem image_eq_iUnion (f : α → β) (s : Set α) : f '' s = ⋃ i ∈ s, {f i}

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


lemma toFun_eq_coe (f : FrameHom α β) : f.toFun = f

{α : Type u_2}
{β : Type u_3}
[CompleteLattice α]
[CompleteLattice β]
(f : FrameHom α β)


theorem aeval_algebraMap_eq_zero_iff [NoZeroSMulDivisors A B] [Nontrivial B] (x : σ → A)
    (p : MvPolynomial σ R) : aeval (algebraMap A B ∘ x) p = 0 ↔ aeval x p = 0

{R : Type u_1}
{A : Type u_2}
(B : Type u_3)
{σ : Type u_4}
[CommSemiring R]
[CommSemiring A]
[CommSemiring B]
[Algebra R A]
[Algebra A B]
[Algebra R B]
[IsScalarTower R A B]
[NoZeroSMulDivisors A B]
[Nontrivial B]
(x : σ → A)
(p : MvPolynomial σ R)

(MvPolynomial.aeval (⇑(algebraMap A B) ∘ x)) p = 0 ↔ (MvPolynomial.aeval x) p = 0


/-- **Fundamental theorem of calculus-1**, strict differentiability at filter in both endpoints.

If `f` is a measurable function integrable on `a..b`, `(la, la')` is an `intervalIntegral.FTCFilter`
pair around `a`, and `(lb, lb')` is an `intervalIntegral.FTCFilter` pair around `b`, and `f` has
finite limits `ca` and `cb` almost surely at `la'` and `lb'`, respectively, then
`(∫ x in va..vb, f x) - ∫ x in ua..ub, f x = (vb - ub) • cb - (va - ua) • ca +
  o(‖va - ua‖ + ‖vb - ub‖)` as `ua` and `va` tend to `la` while `ub` and `vb` tend to `lb`.

This lemma could've been formulated using `HasStrictFDerivAtFilter` if we had this
definition. -/
theorem integral_sub_integral_sub_linear_isLittleO_of_tendsto_ae
    (hab : IntervalIntegrable f volume a b) (hmeas_a : StronglyMeasurableAtFilter f la')
    (hmeas_b : StronglyMeasurableAtFilter f lb') (ha_lim : Tendsto f (la' ⊓ ae volume) (𝓝 ca))
    (hb_lim : Tendsto f (lb' ⊓ ae volume) (𝓝 cb)) (hua : Tendsto ua lt la) (hva : Tendsto va lt la)
    (hub : Tendsto ub lt lb) (hvb : Tendsto vb lt lb) :
    (fun t =>
        ((∫ x in va t..vb t, f x) - ∫ x in ua t..ub t, f x) -
          ((vb t - ub t) • cb - (va t - ua t) • ca)) =o[lt]
      fun t => ‖va t - ua t‖ + ‖vb t - ub t‖

(hab : IntervalIntegrable f MeasureTheory.volume a b)

(hmeas_a : StronglyMeasurableAtFilter f la' MeasureTheory.volume)

(hmeas_b : StronglyMeasurableAtFilter f lb' MeasureTheory.volume)

(ha_lim : Filter.Tendsto f (la' ⊓ MeasureTheory.ae MeasureTheory.volume) (𝓝 ca))

(hb_lim : Filter.Tendsto f (lb' ⊓ MeasureTheory.ae MeasureTheory.volume) (𝓝 cb))

(fun t =>
    ((∫ (x : ℝ) in va t..vb t, f x) - ∫ (x : ℝ) in ua t..ub t, f x) - ((vb t - ub t) • cb - (va t - ua t) • ca)) =o[lt]
  fun t => ‖va t - ua t‖ + ‖vb t - ub t‖


lemma dft_def (Φ : ZMod N → ℂ) : 𝓕 Φ = fun k ↦ ∑ j : ZMod N, toCircle (-(j * k)) • Φ j

𝓕 Φ = fun k => ∑ j : ZMod N, ZMod.toCircle (-(j * k)) • Φ j


lemma normal_iff_forall_map_eq : Normal F K ↔ ∀ σ : L →ₐ[F] L, K.map σ = K

{F : Type u_1}
{L : Type u_3}
[Field F]
[Field L]
[Algebra F L]
[Normal F L]
{K : IntermediateField F L}

Normal F ↥K ↔ ∀ (σ : L →ₐ[F] L), IntermediateField.map σ K = K


@[simp]
lemma piecewise_erase_univ [DecidableEq ι] (i : ι) (f g : ∀ i, π i) :
    (Finset.univ.erase i).piecewise f g = Function.update f i (g i)

{ι : Type u_1}
{π : ι → Sort u_2}
[Fintype ι]
[DecidableEq ι]
(i : ι)
(f g : (i : ι) → π i)


@[to_additive]
theorem DenseRange.topologicalClosure_map_subgroup [Group H] [TopologicalSpace H]
    [TopologicalGroup H] {f : G →* H} (hf : Continuous f) (hf' : DenseRange f) {s : Subgroup G}
    (hs : s.topologicalClosure = ⊤) : (s.map f).topologicalClosure = ⊤

{G : Type w}
{H : Type x}
[TopologicalSpace G]
[Group G]
[TopologicalGroup G]
[Group H]
[TopologicalSpace H]
[TopologicalGroup H]
{f : G →* H}
(hf : Continuous ⇑f)
(hf' : DenseRange ⇑f)
{s : Subgroup G}
(hs : s.topologicalClosure = ⊤)

(Subgroup.map f s).topologicalClosure = ⊤


lemma inv_smul_le_iff_of_pos [PosSMulMono α β] [PosSMulReflectLE α β] (ha : 0 < a) :
    a⁻¹ • b₁ ≤ b₂ ↔ b₁ ≤ a • b₂

{α : Type u_1}
{β : Type u_2}
{a : α}
{b₁ b₂ : β}
[GroupWithZero α]
[Preorder α]
[Preorder β]
[MulAction α β]
[PosSMulMono α β]
[PosSMulReflectLE α β]
(ha : 0 < a)

a⁻¹ • b₁ ≤ b₂ ↔ b₁ ≤ a • b₂


lemma norm_iteratedFDerivComponent_le {α : Type*} [Fintype α]
    (f : ContinuousMultilinearMap 𝕜 E₁ G) {s : Set ι} (e : α ≃ s) [DecidablePred (· ∈ s)]
    (x : (i : ι) → E₁ i) :
    ‖f.iteratedFDerivComponent e (x ·)‖ ≤ ‖f‖ * ‖x‖ ^ (Fintype.card ι - Fintype.card α)

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

‖(f.iteratedFDerivComponent e) fun x_1 => x ↑x_1‖ ≤ ‖f‖ * ‖x‖ ^ (Fintype.card ι - Fintype.card α)


theorem finite_cover_nhds [CompactSpace X] {U : X → Set X} (hU : ∀ x, U x ∈ 𝓝 x) :
    ∃ t : Finset X, ⋃ x ∈ t, U x = univ

{X : Type u}
[TopologicalSpace X]
[CompactSpace X]
{U : X → Set X}
(hU : ∀ (x : X), U x ∈ 𝓝 x)


theorem le_sum_condensed' (hf : ∀ ⦃m n⦄, 0 < m → m ≤ n → f n ≤ f m) (n : ℕ) :
    (∑ k ∈ Ico 1 (2 ^ n), f k) ≤ ∑ k ∈ range n, 2 ^ k • f (2 ^ k)

(hf : ∀ ⦃m n : ℕ⦄, 0 < m → m ≤ n → f n ≤ f m)

∑ k ∈ Finset.Ico 1 (2 ^ n), f k ≤ ∑ k ∈ Finset.range n, 2 ^ k • f (2 ^ k)


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

{α : Type u_2}
[DecidableEq α]
[DivisionMonoid α]
{s : Finset α}


@[simp]
theorem toElementaryEmbedding_toEmbedding (f : M ≃[L] N) :
    f.toElementaryEmbedding.toEmbedding = f.toEmbedding

{L : FirstOrder.Language}
{M : Type u_1}
{N : Type u_2}
[L.Structure M]
[L.Structure N]
(f : M ≃[L] N)


/-- Given `n+1` objects of `C`, a cofan for the last `n` with point `c₁.pt`
and a binary cofan on `c₁.X` and `f 0`, we can build a cofan for all `n+1`.

In `extendCofanIsColimit` we show that if the two given cofans are colimits,
then this cofan is also a colimit.
-/

@[simps!] -- Porting note: removed semireducible config
def extendCofan {n : ℕ} {f : Fin (n + 1) → C} (c₁ : Cofan fun i : Fin n => f i.succ)
    (c₂ : BinaryCofan (f 0) c₁.pt) : Cofan f

(c₁ : CategoryTheory.Limits.Cofan fun i => f i.succ)

(c₂ : CategoryTheory.Limits.BinaryCofan (f 0) c₁.pt)

(X : CategoryTheory.Discrete (Fin (n + 1)))

(CategoryTheory.extendCofan c₁ c₂).ι.app X = Fin.cases c₂.inl (fun i => c₁.ι.app { as := i } ≫ c₂.inr) X.as


@[simp]
lemma coreflection_apply_self :
    P.coreflection i (P.coroot i) = - P.coroot i

{ι : Type u_1}
{R : Type u_2}
{M : Type u_3}
{N : Type u_4}
[CommRing R]
[AddCommGroup M]
[Module R M]
[AddCommGroup N]
[Module R N]
(P : RootPairing ι R M N)
(i : ι)

(P.coreflection i) (P.coroot i) = -P.coroot i


{α : Type u_1}
[Preorder α]
[AddCommMonoid α]
[Sub α]
[OrderedSub α]
{a b : α}


lemma ΓSpecIso_inv : (ΓSpecIso R).inv = StructureSheaf.toOpen R ⊤

(AlgebraicGeometry.Scheme.ΓSpecIso R).inv = AlgebraicGeometry.StructureSheaf.toOpen ↑R ⊤


@[to_additive]
theorem mk'_mul (x₁ x₂ : M) (y₁ y₂ : S) : f.mk' (x₁ * x₂) (y₁ * y₂) = f.mk' x₁ y₁ * f.mk' x₂ y₂

{M : Type u_1}
[AddCommMonoid M]
{S : AddSubmonoid M}
{N : Type u_2}
[AddCommMonoid N]
(f : S.LocalizationMap N)
(x₁ x₂ : M)
(y₁ y₂ : ↥S)

f.mk' (x₁ + x₂) (y₁ + y₂) = f.mk' x₁ y₁ + f.mk' x₂ y₂


theorem mk_ne_zero_of_natDegree_lt (hf : Monic f) {g : R[X]} (h0 : g ≠ 0)
    (hd : natDegree g < natDegree f) : mk f g ≠ 0

{R : Type u}
[CommRing R]
{f : R[X]}
(hf : f.Monic)
{g : R[X]}
(h0 : g ≠ 0)
(hd : g.natDegree < f.natDegree)


lemma shiftShortComplexFunctorIso_zero_add_hom_app (a : ℤ) (K : CochainComplex C ℤ) :
    (shiftShortComplexFunctorIso C 0 a a (zero_add a)).hom.app K =
      (shortComplexFunctor C (ComplexShape.up ℤ) a).map
        ((shiftFunctorZero (CochainComplex C ℤ) ℤ).hom.app K)

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Preadditive C]
(a : ℤ)
(K : CochainComplex C ℤ)

(CochainComplex.shiftShortComplexFunctorIso C 0 a a ⋯).hom.app K =
  (HomologicalComplex.shortComplexFunctor C (ComplexShape.up ℤ) a).map
    ((CategoryTheory.shiftFunctorZero (CochainComplex C ℤ) ℤ).hom.app K)


@[norm_cast]
theorem coe_add (a b : α) : ((a + b : α) : Completion α) = a + b

{α : Type u_3}
[UniformSpace α]
[AddGroup α]
[UniformAddGroup α]
(a b : α)


@[simp]
theorem head_fin_const (a : α) : (vecHead fun _ : Fin (n + 1) => a) = a


/-- `MulAction.period m a` is definitionally equal to `Function.minimalPeriod (m • ·) a`. -/
@[to_additive "`AddAction.period m a` is definitionally equal to
`Function.minimalPeriod (m +ᵥ ·) a`"]
theorem period_eq_minimalPeriod {m : M} {a : α} :
    MulAction.period m a = minimalPeriod (fun x => m • x) a

{α : Type v}
{M : Type u}
[Monoid M]
[MulAction M α]
{m : M}
{a : α}

MulAction.period m a = Function.minimalPeriod (fun x => m • x) a


@[simp]
theorem append_prod {i j k l} {w₁ : NeWord M i j} {hne : j ≠ k} {w₂ : NeWord M k l} :
    (append w₁ hne w₂).prod = w₁.prod * w₂.prod

{ι : Type u_1}
{M : ι → Type u_2}
[(i : ι) → Monoid (M i)]
{i j k l : ι}
{w₁ : Monoid.CoprodI.NeWord M i j}
{hne : j ≠ k}
{w₂ : Monoid.CoprodI.NeWord M k l}

(w₁.append hne w₂).prod = w₁.prod * w₂.prod