fact
stringlengths
6
3.84k
type
stringclasses
11 values
library
stringclasses
32 values
imports
listlengths
1
14
filename
stringlengths
20
95
symbolic_name
stringlengths
1
90
docstring
stringlengths
7
20k
SetLike.coe_gnpow {S : Type*} [SetLike S R] [Monoid R] [AddMonoid ι] (A : ι → S) [SetLike.GradedMonoid A] {i : ι} (x : A i) (n : ℕ) : ↑(@GradedMonoid.GMonoid.gnpow _ (fun i => A i) _ _ n _ x) = (x:R)^n := rfl
theorem
Algebra
[ "Mathlib.Algebra.BigOperators.Group.List.Lemmas", "Mathlib.Algebra.Group.Action.Hom", "Mathlib.Algebra.Group.Submonoid.Defs", "Mathlib.Data.List.FinRange", "Mathlib.Data.SetLike.Basic", "Mathlib.Data.Sigma.Basic", "Lean.Elab.Tactic", "Mathlib.Algebra.BigOperators.Group.Finset.Basic" ]
Mathlib/Algebra/GradedMonoid.lean
SetLike.coe_gnpow
null
SetLike.gCommMonoid {S : Type*} [SetLike S R] [CommMonoid R] [AddCommMonoid ι] (A : ι → S) [SetLike.GradedMonoid A] : GradedMonoid.GCommMonoid fun i => A i := { SetLike.gMonoid A with mul_comm := fun ⟨_, _, _⟩ ⟨_, _, _⟩ => Sigma.subtype_ext (add_comm _ _) (mul_comm _ _) }
instance
Algebra
[ "Mathlib.Algebra.BigOperators.Group.List.Lemmas", "Mathlib.Algebra.Group.Action.Hom", "Mathlib.Algebra.Group.Submonoid.Defs", "Mathlib.Data.List.FinRange", "Mathlib.Data.SetLike.Basic", "Mathlib.Data.Sigma.Basic", "Lean.Elab.Tactic", "Mathlib.Algebra.BigOperators.Group.Finset.Basic" ]
Mathlib/Algebra/GradedMonoid.lean
SetLike.gCommMonoid
Build a `GCommMonoid` instance for a collection of subobjects.
@[simp] SetLike.coe_list_dProd (A : ι → S) [SetLike.GradedMonoid A] (fι : α → ι) (fA : ∀ a, A (fι a)) (l : List α) : ↑(@List.dProd _ _ (fun i => ↥(A i)) _ _ l fι fA) = (List.prod (l.map fun a => fA a) : R) := by match l with | [] => rw [List.dProd_nil, coe_gOne, List.map_nil, List.prod_nil] | head::tail => rw [List.dProd_cons, coe_gMul, List.map_cons, List.prod_cons, SetLike.coe_list_dProd _ _ _ tail]
theorem
Algebra
[ "Mathlib.Algebra.BigOperators.Group.List.Lemmas", "Mathlib.Algebra.Group.Action.Hom", "Mathlib.Algebra.Group.Submonoid.Defs", "Mathlib.Data.List.FinRange", "Mathlib.Data.SetLike.Basic", "Mathlib.Data.Sigma.Basic", "Lean.Elab.Tactic", "Mathlib.Algebra.BigOperators.Group.Finset.Basic" ]
Mathlib/Algebra/GradedMonoid.lean
SetLike.coe_list_dProd
null
SetLike.list_dProd_eq (A : ι → S) [SetLike.GradedMonoid A] (fι : α → ι) (fA : ∀ a, A (fι a)) (l : List α) : (@List.dProd _ _ (fun i => ↥(A i)) _ _ l fι fA) = ⟨List.prod (l.map fun a => fA a), (l.dProdIndex_eq_map_sum fι).symm ▸ list_prod_map_mem_graded l _ _ fun i _ => (fA i).prop⟩ := Subtype.ext <| SetLike.coe_list_dProd _ _ _ _
theorem
Algebra
[ "Mathlib.Algebra.BigOperators.Group.List.Lemmas", "Mathlib.Algebra.Group.Action.Hom", "Mathlib.Algebra.Group.Submonoid.Defs", "Mathlib.Data.List.FinRange", "Mathlib.Data.SetLike.Basic", "Mathlib.Data.Sigma.Basic", "Lean.Elab.Tactic", "Mathlib.Algebra.BigOperators.Group.Finset.Basic" ]
Mathlib/Algebra/GradedMonoid.lean
SetLike.list_dProd_eq
A version of `List.coe_dProd_set_like` with `Subtype.mk`.
SetLike.IsHomogeneousElem (A : ι → S) (a : R) : Prop := ∃ i, a ∈ A i @[simp]
def
Algebra
[ "Mathlib.Algebra.BigOperators.Group.List.Lemmas", "Mathlib.Algebra.Group.Action.Hom", "Mathlib.Algebra.Group.Submonoid.Defs", "Mathlib.Data.List.FinRange", "Mathlib.Data.SetLike.Basic", "Mathlib.Data.Sigma.Basic", "Lean.Elab.Tactic", "Mathlib.Algebra.BigOperators.Group.Finset.Basic" ]
Mathlib/Algebra/GradedMonoid.lean
SetLike.IsHomogeneousElem
An element `a : R` is said to be homogeneous if there is some `i : ι` such that `a ∈ A i`.
SetLike.isHomogeneousElem_coe {A : ι → S} {i} (x : A i) : SetLike.IsHomogeneousElem A (x : R) := ⟨i, x.prop⟩
theorem
Algebra
[ "Mathlib.Algebra.BigOperators.Group.List.Lemmas", "Mathlib.Algebra.Group.Action.Hom", "Mathlib.Algebra.Group.Submonoid.Defs", "Mathlib.Data.List.FinRange", "Mathlib.Data.SetLike.Basic", "Mathlib.Data.Sigma.Basic", "Lean.Elab.Tactic", "Mathlib.Algebra.BigOperators.Group.Finset.Basic" ]
Mathlib/Algebra/GradedMonoid.lean
SetLike.isHomogeneousElem_coe
null
SetLike.isHomogeneousElem_one [Zero ι] [One R] (A : ι → S) [SetLike.GradedOne A] : SetLike.IsHomogeneousElem A (1 : R) := ⟨0, SetLike.one_mem_graded _⟩
theorem
Algebra
[ "Mathlib.Algebra.BigOperators.Group.List.Lemmas", "Mathlib.Algebra.Group.Action.Hom", "Mathlib.Algebra.Group.Submonoid.Defs", "Mathlib.Data.List.FinRange", "Mathlib.Data.SetLike.Basic", "Mathlib.Data.Sigma.Basic", "Lean.Elab.Tactic", "Mathlib.Algebra.BigOperators.Group.Finset.Basic" ]
Mathlib/Algebra/GradedMonoid.lean
SetLike.isHomogeneousElem_one
null
SetLike.IsHomogeneousElem.mul [Add ι] [Mul R] {A : ι → S} [SetLike.GradedMul A] {a b : R} : SetLike.IsHomogeneousElem A a → SetLike.IsHomogeneousElem A b → SetLike.IsHomogeneousElem A (a * b) | ⟨i, hi⟩, ⟨j, hj⟩ => ⟨i + j, SetLike.mul_mem_graded hi hj⟩
theorem
Algebra
[ "Mathlib.Algebra.BigOperators.Group.List.Lemmas", "Mathlib.Algebra.Group.Action.Hom", "Mathlib.Algebra.Group.Submonoid.Defs", "Mathlib.Data.List.FinRange", "Mathlib.Data.SetLike.Basic", "Mathlib.Data.Sigma.Basic", "Lean.Elab.Tactic", "Mathlib.Algebra.BigOperators.Group.Finset.Basic" ]
Mathlib/Algebra/GradedMonoid.lean
SetLike.IsHomogeneousElem.mul
null
SetLike.homogeneousSubmonoid [AddMonoid ι] [Monoid R] (A : ι → S) [SetLike.GradedMonoid A] : Submonoid R where carrier := { a | SetLike.IsHomogeneousElem A a } one_mem' := SetLike.isHomogeneousElem_one A mul_mem' a b := SetLike.IsHomogeneousElem.mul a b
def
Algebra
[ "Mathlib.Algebra.BigOperators.Group.List.Lemmas", "Mathlib.Algebra.Group.Action.Hom", "Mathlib.Algebra.Group.Submonoid.Defs", "Mathlib.Data.List.FinRange", "Mathlib.Data.SetLike.Basic", "Mathlib.Data.Sigma.Basic", "Lean.Elab.Tactic", "Mathlib.Algebra.BigOperators.Group.Finset.Basic" ]
Mathlib/Algebra/GradedMonoid.lean
SetLike.homogeneousSubmonoid
When `A` is a `SetLike.GradedMonoid A`, then the homogeneous elements forms a submonoid.
prod_mem_graded (hF : ∀ k ∈ F, g k ∈ A (i k)) : ∏ k ∈ F, g k ∈ A (∑ k ∈ F, i k) := by classical induction F using Finset.induction_on · simp [GradedOne.one_mem] · case insert j F' hF2 h3 => rw [Finset.prod_insert hF2, Finset.sum_insert hF2] apply SetLike.mul_mem_graded (by grind) grind
theorem
Algebra
[ "Mathlib.Algebra.BigOperators.Group.List.Lemmas", "Mathlib.Algebra.Group.Action.Hom", "Mathlib.Algebra.Group.Submonoid.Defs", "Mathlib.Data.List.FinRange", "Mathlib.Data.SetLike.Basic", "Mathlib.Data.Sigma.Basic", "Lean.Elab.Tactic", "Mathlib.Algebra.BigOperators.Group.Finset.Basic" ]
Mathlib/Algebra/GradedMonoid.lean
prod_mem_graded
null
prod_pow_mem_graded (n : κ → ℕ) (hF : ∀ k ∈ F, g k ∈ A (i k)) : ∏ k ∈ F, g k ^ n k ∈ A (∑ k ∈ F, n k • i k) := prod_mem_graded A _ _ fun k hk ↦ pow_mem_graded _ (hF k hk)
theorem
Algebra
[ "Mathlib.Algebra.BigOperators.Group.List.Lemmas", "Mathlib.Algebra.Group.Action.Hom", "Mathlib.Algebra.Group.Submonoid.Defs", "Mathlib.Data.List.FinRange", "Mathlib.Data.SetLike.Basic", "Mathlib.Data.Sigma.Basic", "Lean.Elab.Tactic", "Mathlib.Algebra.BigOperators.Group.Finset.Basic" ]
Mathlib/Algebra/GradedMonoid.lean
prod_pow_mem_graded
null
GSMul [VAdd ιA ιM] where /-- The homogeneous multiplication map `smul` -/ smul {i j} : A i → M j → M (i +ᵥ j)
class
Algebra
[ "Mathlib.Algebra.GradedMonoid" ]
Mathlib/Algebra/GradedMulAction.lean
GSMul
A graded version of `SMul`. Scalar multiplication combines grades additively, i.e. if `a ∈ A i` and `m ∈ M j`, then `a • b` must be in `M (i + j)`.
GMul.toGSMul [Add ιA] [GMul A] : GSMul A A where smul := GMul.mul
instance
Algebra
[ "Mathlib.Algebra.GradedMonoid" ]
Mathlib/Algebra/GradedMulAction.lean
GMul.toGSMul
A graded version of `Mul.toSMul`
GSMul.toSMul [VAdd ιA ιM] [GSMul A M] : SMul (GradedMonoid A) (GradedMonoid M) := ⟨fun x y ↦ ⟨_, GSMul.smul x.snd y.snd⟩⟩
instance
Algebra
[ "Mathlib.Algebra.GradedMonoid" ]
Mathlib/Algebra/GradedMulAction.lean
GSMul.toSMul
null
mk_smul_mk [VAdd ιA ιM] [GSMul A M] {i j} (a : A i) (b : M j) : mk i a • mk j b = mk (i +ᵥ j) (GSMul.smul a b) := rfl
theorem
Algebra
[ "Mathlib.Algebra.GradedMonoid" ]
Mathlib/Algebra/GradedMulAction.lean
mk_smul_mk
null
GMulAction [AddMonoid ιA] [VAdd ιA ιM] [GMonoid A] extends GSMul A M where /-- One is the neutral element for `•` -/ one_smul (b : GradedMonoid M) : (1 : GradedMonoid A) • b = b /-- Associativity of `•` and `*` -/ mul_smul (a a' : GradedMonoid A) (b : GradedMonoid M) : (a * a') • b = a • a' • b
class
Algebra
[ "Mathlib.Algebra.GradedMonoid" ]
Mathlib/Algebra/GradedMulAction.lean
GMulAction
A graded version of `MulAction`.
GMonoid.toGMulAction [AddMonoid ιA] [GMonoid A] : GMulAction A A := { GMul.toGSMul _ with one_smul := GMonoid.one_mul mul_smul := GMonoid.mul_assoc }
instance
Algebra
[ "Mathlib.Algebra.GradedMonoid" ]
Mathlib/Algebra/GradedMulAction.lean
GMonoid.toGMulAction
The graded version of `Monoid.toMulAction`.
GMulAction.toMulAction [AddMonoid ιA] [GMonoid A] [VAdd ιA ιM] [GMulAction A M] : MulAction (GradedMonoid A) (GradedMonoid M) where one_smul := GMulAction.one_smul mul_smul := GMulAction.mul_smul
instance
Algebra
[ "Mathlib.Algebra.GradedMonoid" ]
Mathlib/Algebra/GradedMulAction.lean
GMulAction.toMulAction
null
SetLike.GradedSMul {S R N M : Type*} [SetLike S R] [SetLike N M] [SMul R M] [VAdd ιA ιB] (A : ιA → S) (B : ιB → N) : Prop where /-- Multiplication is homogeneous -/ smul_mem : ∀ ⦃i : ιA⦄ ⦃j : ιB⦄ {ai bj}, ai ∈ A i → bj ∈ B j → ai • bj ∈ B (i +ᵥ j)
class
Algebra
[ "Mathlib.Algebra.GradedMonoid" ]
Mathlib/Algebra/GradedMulAction.lean
SetLike.GradedSMul
A version of `GradedMonoid.GSMul` for internally graded objects.
SetLike.toGSMul {S R N M : Type*} [SetLike S R] [SetLike N M] [SMul R M] [VAdd ιA ιB] (A : ιA → S) (B : ιB → N) [SetLike.GradedSMul A B] : GradedMonoid.GSMul (fun i ↦ A i) fun i ↦ B i where smul a b := ⟨a.1 • b.1, SetLike.GradedSMul.smul_mem a.2 b.2⟩ @[simp]
instance
Algebra
[ "Mathlib.Algebra.GradedMonoid" ]
Mathlib/Algebra/GradedMulAction.lean
SetLike.toGSMul
null
SetLike.coe_GSMul {S R N M : Type*} [SetLike S R] [SetLike N M] [SMul R M] [VAdd ιA ιB] (A : ιA → S) (B : ιB → N) [SetLike.GradedSMul A B] {i : ιA} {j : ιB} (x : A i) (y : B j) : (@GradedMonoid.GSMul.smul ιA ιB (fun i ↦ A i) (fun i ↦ B i) _ _ i j x y : M) = x.1 • y.1 := rfl
theorem
Algebra
[ "Mathlib.Algebra.GradedMonoid" ]
Mathlib/Algebra/GradedMulAction.lean
SetLike.coe_GSMul
null
SetLike.GradedMul.toGradedSMul [AddMonoid ιA] [Monoid R] {S : Type*} [SetLike S R] (A : ιA → S) [SetLike.GradedMonoid A] : SetLike.GradedSMul A A where smul_mem _ _ _ _ hi hj := SetLike.GradedMonoid.toGradedMul.mul_mem hi hj
instance
Algebra
[ "Mathlib.Algebra.GradedMonoid" ]
Mathlib/Algebra/GradedMulAction.lean
SetLike.GradedMul.toGradedSMul
Internally graded version of `Mul.toSMul`.
SetLike.IsHomogeneousElem.graded_smul [VAdd ιA ιB] [SMul R M] {A : ιA → S} {B : ιB → N} [SetLike.GradedSMul A B] {a : R} {b : M} : SetLike.IsHomogeneousElem A a → SetLike.IsHomogeneousElem B b → SetLike.IsHomogeneousElem B (a • b) | ⟨i, hi⟩, ⟨j, hj⟩ => ⟨i +ᵥ j, SetLike.GradedSMul.smul_mem hi hj⟩
theorem
Algebra
[ "Mathlib.Algebra.GradedMonoid" ]
Mathlib/Algebra/GradedMulAction.lean
SetLike.IsHomogeneousElem.graded_smul
null
SubY.toZ [Z α] : Z (SubY α) := coe_injective.Z coe ... ```
instance
Algebra
[ "Mathlib.Init", "Batteries.Util.LibraryNote" ]
Mathlib/Algebra/HierarchyDesign.lean
SubY.toZ
null
IsPrimePow : Prop := ∃ (p : R) (k : ℕ), Prime p ∧ 0 < k ∧ p ^ k = n
def
Algebra
[ "Mathlib.Algebra.Order.Ring.Nat", "Mathlib.Order.Nat", "Mathlib.Data.Nat.Prime.Basic", "Mathlib.Data.Nat.Log", "Mathlib.Data.Nat.Prime.Pow" ]
Mathlib/Algebra/IsPrimePow.lean
IsPrimePow
`n` is a prime power if there is a prime `p` and a positive natural `k` such that `n` can be written as `p^k`.
isPrimePow_def : IsPrimePow n ↔ ∃ (p : R) (k : ℕ), Prime p ∧ 0 < k ∧ p ^ k = n := Iff.rfl
theorem
Algebra
[ "Mathlib.Algebra.Order.Ring.Nat", "Mathlib.Order.Nat", "Mathlib.Data.Nat.Prime.Basic", "Mathlib.Data.Nat.Log", "Mathlib.Data.Nat.Prime.Pow" ]
Mathlib/Algebra/IsPrimePow.lean
isPrimePow_def
null
isPrimePow_iff_pow_succ : IsPrimePow n ↔ ∃ (p : R) (k : ℕ), Prime p ∧ p ^ (k + 1) = n := (isPrimePow_def _).trans ⟨fun ⟨p, k, hp, hk, hn⟩ => ⟨p, k - 1, hp, by rwa [Nat.sub_add_cancel hk]⟩, fun ⟨_, _, hp, hn⟩ => ⟨_, _, hp, Nat.succ_pos', hn⟩⟩
theorem
Algebra
[ "Mathlib.Algebra.Order.Ring.Nat", "Mathlib.Order.Nat", "Mathlib.Data.Nat.Prime.Basic", "Mathlib.Data.Nat.Log", "Mathlib.Data.Nat.Prime.Pow" ]
Mathlib/Algebra/IsPrimePow.lean
isPrimePow_iff_pow_succ
An equivalent definition for prime powers: `n` is a prime power iff there is a prime `p` and a natural `k` such that `n` can be written as `p^(k+1)`.
not_isPrimePow_zero [NoZeroDivisors R] : ¬IsPrimePow (0 : R) := by simp only [isPrimePow_def, not_exists, not_and', and_imp] intro x n _hn hx rw [pow_eq_zero hx] simp
theorem
Algebra
[ "Mathlib.Algebra.Order.Ring.Nat", "Mathlib.Order.Nat", "Mathlib.Data.Nat.Prime.Basic", "Mathlib.Data.Nat.Log", "Mathlib.Data.Nat.Prime.Pow" ]
Mathlib/Algebra/IsPrimePow.lean
not_isPrimePow_zero
null
IsPrimePow.not_unit {n : R} (h : IsPrimePow n) : ¬IsUnit n := let ⟨_p, _k, hp, hk, hn⟩ := h hn ▸ (isUnit_pow_iff hk.ne').not.mpr hp.not_unit
theorem
Algebra
[ "Mathlib.Algebra.Order.Ring.Nat", "Mathlib.Order.Nat", "Mathlib.Data.Nat.Prime.Basic", "Mathlib.Data.Nat.Log", "Mathlib.Data.Nat.Prime.Pow" ]
Mathlib/Algebra/IsPrimePow.lean
IsPrimePow.not_unit
null
IsUnit.not_isPrimePow {n : R} (h : IsUnit n) : ¬IsPrimePow n := fun h' => h'.not_unit h
theorem
Algebra
[ "Mathlib.Algebra.Order.Ring.Nat", "Mathlib.Order.Nat", "Mathlib.Data.Nat.Prime.Basic", "Mathlib.Data.Nat.Log", "Mathlib.Data.Nat.Prime.Pow" ]
Mathlib/Algebra/IsPrimePow.lean
IsUnit.not_isPrimePow
null
not_isPrimePow_one : ¬IsPrimePow (1 : R) := isUnit_one.not_isPrimePow
theorem
Algebra
[ "Mathlib.Algebra.Order.Ring.Nat", "Mathlib.Order.Nat", "Mathlib.Data.Nat.Prime.Basic", "Mathlib.Data.Nat.Log", "Mathlib.Data.Nat.Prime.Pow" ]
Mathlib/Algebra/IsPrimePow.lean
not_isPrimePow_one
null
Prime.isPrimePow {p : R} (hp : Prime p) : IsPrimePow p := ⟨p, 1, hp, zero_lt_one, by simp⟩
theorem
Algebra
[ "Mathlib.Algebra.Order.Ring.Nat", "Mathlib.Order.Nat", "Mathlib.Data.Nat.Prime.Basic", "Mathlib.Data.Nat.Log", "Mathlib.Data.Nat.Prime.Pow" ]
Mathlib/Algebra/IsPrimePow.lean
Prime.isPrimePow
null
IsPrimePow.pow {n : R} (hn : IsPrimePow n) {k : ℕ} (hk : k ≠ 0) : IsPrimePow (n ^ k) := let ⟨p, k', hp, hk', hn⟩ := hn ⟨p, k * k', hp, mul_pos hk.bot_lt hk', by rw [pow_mul', hn]⟩
theorem
Algebra
[ "Mathlib.Algebra.Order.Ring.Nat", "Mathlib.Order.Nat", "Mathlib.Data.Nat.Prime.Basic", "Mathlib.Data.Nat.Log", "Mathlib.Data.Nat.Prime.Pow" ]
Mathlib/Algebra/IsPrimePow.lean
IsPrimePow.pow
null
IsPrimePow.ne_zero [NoZeroDivisors R] {n : R} (h : IsPrimePow n) : n ≠ 0 := fun t => not_isPrimePow_zero (t ▸ h)
theorem
Algebra
[ "Mathlib.Algebra.Order.Ring.Nat", "Mathlib.Order.Nat", "Mathlib.Data.Nat.Prime.Basic", "Mathlib.Data.Nat.Log", "Mathlib.Data.Nat.Prime.Pow" ]
Mathlib/Algebra/IsPrimePow.lean
IsPrimePow.ne_zero
null
IsPrimePow.ne_one {n : R} (h : IsPrimePow n) : n ≠ 1 := fun t => not_isPrimePow_one (t ▸ h)
theorem
Algebra
[ "Mathlib.Algebra.Order.Ring.Nat", "Mathlib.Order.Nat", "Mathlib.Data.Nat.Prime.Basic", "Mathlib.Data.Nat.Log", "Mathlib.Data.Nat.Prime.Pow" ]
Mathlib/Algebra/IsPrimePow.lean
IsPrimePow.ne_one
null
isPrimePow_nat_iff (n : ℕ) : IsPrimePow n ↔ ∃ p k : ℕ, Nat.Prime p ∧ 0 < k ∧ p ^ k = n := by simp only [isPrimePow_def, Nat.prime_iff]
theorem
Algebra
[ "Mathlib.Algebra.Order.Ring.Nat", "Mathlib.Order.Nat", "Mathlib.Data.Nat.Prime.Basic", "Mathlib.Data.Nat.Log", "Mathlib.Data.Nat.Prime.Pow" ]
Mathlib/Algebra/IsPrimePow.lean
isPrimePow_nat_iff
null
Nat.Prime.isPrimePow {p : ℕ} (hp : p.Prime) : IsPrimePow p := _root_.Prime.isPrimePow (prime_iff.mp hp)
theorem
Algebra
[ "Mathlib.Algebra.Order.Ring.Nat", "Mathlib.Order.Nat", "Mathlib.Data.Nat.Prime.Basic", "Mathlib.Data.Nat.Log", "Mathlib.Data.Nat.Prime.Pow" ]
Mathlib/Algebra/IsPrimePow.lean
Nat.Prime.isPrimePow
null
isPrimePow_nat_iff_bounded (n : ℕ) : IsPrimePow n ↔ ∃ p : ℕ, p ≤ n ∧ ∃ k : ℕ, k ≤ n ∧ p.Prime ∧ 0 < k ∧ p ^ k = n := by rw [isPrimePow_nat_iff] refine Iff.symm ⟨fun ⟨p, _, k, _, hp, hk, hn⟩ => ⟨p, k, hp, hk, hn⟩, ?_⟩ rintro ⟨p, k, hp, hk, rfl⟩ refine ⟨p, ?_, k, (Nat.lt_pow_self hp.one_lt).le, hp, hk, rfl⟩ conv => { lhs; rw [← (pow_one p)] } exact Nat.pow_le_pow_right hp.one_lt.le hk
theorem
Algebra
[ "Mathlib.Algebra.Order.Ring.Nat", "Mathlib.Order.Nat", "Mathlib.Data.Nat.Prime.Basic", "Mathlib.Data.Nat.Log", "Mathlib.Data.Nat.Prime.Pow" ]
Mathlib/Algebra/IsPrimePow.lean
isPrimePow_nat_iff_bounded
null
isPrimePow_nat_iff_bounded_log (n : ℕ) : IsPrimePow n ↔ ∃ k : ℕ, k ≤ Nat.log 2 n ∧ 0 < k ∧ ∃ p : ℕ, p ≤ n ∧ n = p ^ k ∧ p.Prime := by rw [isPrimePow_nat_iff] constructor · rintro ⟨p, k, hp', hk', rfl⟩ refine ⟨k, ?_, hk', ⟨p, Nat.le_pow hk', rfl, hp'⟩⟩ · calc k = Nat.log 2 (2 ^ k) := by simp _ ≤ Nat.log 2 (p ^ k) := Nat.log_mono Nat.one_lt_two Nat.AtLeastTwo.prop (Nat.pow_le_pow_left (Nat.Prime.two_le hp') k) · rintro ⟨k, hk, hk', ⟨p, hp, rfl, hp'⟩⟩ exact ⟨p, k, hp', hk', rfl⟩
theorem
Algebra
[ "Mathlib.Algebra.Order.Ring.Nat", "Mathlib.Order.Nat", "Mathlib.Data.Nat.Prime.Basic", "Mathlib.Data.Nat.Log", "Mathlib.Data.Nat.Prime.Pow" ]
Mathlib/Algebra/IsPrimePow.lean
isPrimePow_nat_iff_bounded_log
null
isPrimePow_nat_iff_bounded_log_minFac (n : ℕ) : IsPrimePow n ↔ ∃ k : ℕ, k ≤ Nat.log 2 n ∧ 0 < k ∧ n = n.minFac ^ k := by rw [isPrimePow_nat_iff_bounded_log] obtain rfl | h := eq_or_ne n 1 · simp constructor · rintro ⟨k, hkle, hk_pos, p, hle, heq, hprime⟩ refine ⟨k, hkle, hk_pos, ?_⟩ rw [heq, hprime.pow_minFac hk_pos.ne'] · rintro ⟨k, hkle, hk_pos, heq⟩ refine ⟨k, hkle, hk_pos, n.minFac, Nat.minFac_le ?_, heq, ?_⟩ · grind [Nat.minFac_prime_iff, nonpos_iff_eq_zero, Nat.log_zero_right, lt_self_iff_false] · grind [Nat.minFac_prime_iff]
theorem
Algebra
[ "Mathlib.Algebra.Order.Ring.Nat", "Mathlib.Order.Nat", "Mathlib.Data.Nat.Prime.Basic", "Mathlib.Data.Nat.Log", "Mathlib.Data.Nat.Prime.Pow" ]
Mathlib/Algebra/IsPrimePow.lean
isPrimePow_nat_iff_bounded_log_minFac
null
IsPrimePow.dvd {n m : ℕ} (hn : IsPrimePow n) (hm : m ∣ n) (hm₁ : m ≠ 1) : IsPrimePow m := by grind [isPrimePow_nat_iff, Nat.dvd_prime_pow, Nat.pow_eq_one]
theorem
Algebra
[ "Mathlib.Algebra.Order.Ring.Nat", "Mathlib.Order.Nat", "Mathlib.Data.Nat.Prime.Basic", "Mathlib.Data.Nat.Log", "Mathlib.Data.Nat.Prime.Pow" ]
Mathlib/Algebra/IsPrimePow.lean
IsPrimePow.dvd
null
IsPrimePow.two_le : ∀ {n : ℕ}, IsPrimePow n → 2 ≤ n | 0, h => (not_isPrimePow_zero h).elim | 1, h => (not_isPrimePow_one h).elim | _n + 2, _ => le_add_self
theorem
Algebra
[ "Mathlib.Algebra.Order.Ring.Nat", "Mathlib.Order.Nat", "Mathlib.Data.Nat.Prime.Basic", "Mathlib.Data.Nat.Log", "Mathlib.Data.Nat.Prime.Pow" ]
Mathlib/Algebra/IsPrimePow.lean
IsPrimePow.two_le
null
IsPrimePow.pos {n : ℕ} (hn : IsPrimePow n) : 0 < n := pos_of_gt hn.two_le
theorem
Algebra
[ "Mathlib.Algebra.Order.Ring.Nat", "Mathlib.Order.Nat", "Mathlib.Data.Nat.Prime.Basic", "Mathlib.Data.Nat.Log", "Mathlib.Data.Nat.Prime.Pow" ]
Mathlib/Algebra/IsPrimePow.lean
IsPrimePow.pos
null
IsPrimePow.one_lt {n : ℕ} (h : IsPrimePow n) : 1 < n := h.two_le
theorem
Algebra
[ "Mathlib.Algebra.Order.Ring.Nat", "Mathlib.Order.Nat", "Mathlib.Data.Nat.Prime.Basic", "Mathlib.Data.Nat.Log", "Mathlib.Data.Nat.Prime.Pow" ]
Mathlib/Algebra/IsPrimePow.lean
IsPrimePow.one_lt
null
LinearRecurrence (R : Type*) [CommSemiring R] where /-- Order of the linear recurrence -/ order : ℕ /-- Coefficients of the linear recurrence -/ coeffs : Fin order → R
structure
Algebra
[ "Mathlib.Algebra.Polynomial.Eval.Defs", "Mathlib.LinearAlgebra.Dimension.Constructions" ]
Mathlib/Algebra/LinearRecurrence.lean
LinearRecurrence
A "linear recurrence relation" over a commutative semiring is given by its order `n` and `n` coefficients.
IsSolution (u : ℕ → R) := ∀ n, u (n + E.order) = ∑ i, E.coeffs i * u (n + i)
def
Algebra
[ "Mathlib.Algebra.Polynomial.Eval.Defs", "Mathlib.LinearAlgebra.Dimension.Constructions" ]
Mathlib/Algebra/LinearRecurrence.lean
IsSolution
We say that a sequence `u` is solution of `LinearRecurrence order coeffs` when we have `u (n + order) = ∑ i : Fin order, coeffs i * u (n + i)` for any `n`.
mkSol (init : Fin E.order → R) : ℕ → R | n => if h : n < E.order then init ⟨n, h⟩ else ∑ k : Fin E.order, have _ : n - E.order + k < n := by omega E.coeffs k * mkSol init (n - E.order + k)
def
Algebra
[ "Mathlib.Algebra.Polynomial.Eval.Defs", "Mathlib.LinearAlgebra.Dimension.Constructions" ]
Mathlib/Algebra/LinearRecurrence.lean
mkSol
A solution of a `LinearRecurrence` which satisfies certain initial conditions. We will prove this is the only such solution.
is_sol_mkSol (init : Fin E.order → R) : E.IsSolution (E.mkSol init) := by intro n rw [mkSol] simp
theorem
Algebra
[ "Mathlib.Algebra.Polynomial.Eval.Defs", "Mathlib.LinearAlgebra.Dimension.Constructions" ]
Mathlib/Algebra/LinearRecurrence.lean
is_sol_mkSol
`E.mkSol` indeed gives solutions to `E`.
mkSol_eq_init (init : Fin E.order → R) : ∀ n : Fin E.order, E.mkSol init n = init n := by intro n rw [mkSol] simp only [n.is_lt, dif_pos, Fin.mk_val]
theorem
Algebra
[ "Mathlib.Algebra.Polynomial.Eval.Defs", "Mathlib.LinearAlgebra.Dimension.Constructions" ]
Mathlib/Algebra/LinearRecurrence.lean
mkSol_eq_init
`E.mkSol init`'s first `E.order` terms are `init`.
eq_mk_of_is_sol_of_eq_init {u : ℕ → R} {init : Fin E.order → R} (h : E.IsSolution u) (heq : ∀ n : Fin E.order, u n = init n) : ∀ n, u n = E.mkSol init n := by intro n rw [mkSol] split_ifs with h' · exact mod_cast heq ⟨n, h'⟩ · dsimp only rw [← tsub_add_cancel_of_le (le_of_not_gt h'), h (n - E.order)] congr with k rw [eq_mk_of_is_sol_of_eq_init h heq (n - E.order + k)] simp
theorem
Algebra
[ "Mathlib.Algebra.Polynomial.Eval.Defs", "Mathlib.LinearAlgebra.Dimension.Constructions" ]
Mathlib/Algebra/LinearRecurrence.lean
eq_mk_of_is_sol_of_eq_init
If `u` is a solution to `E` and `init` designates its first `E.order` values, then `∀ n, u n = E.mkSol init n`.
eq_mk_of_is_sol_of_eq_init' {u : ℕ → R} {init : Fin E.order → R} (h : E.IsSolution u) (heq : ∀ n : Fin E.order, u n = init n) : u = E.mkSol init := funext (E.eq_mk_of_is_sol_of_eq_init h heq)
theorem
Algebra
[ "Mathlib.Algebra.Polynomial.Eval.Defs", "Mathlib.LinearAlgebra.Dimension.Constructions" ]
Mathlib/Algebra/LinearRecurrence.lean
eq_mk_of_is_sol_of_eq_init'
If `u` is a solution to `E` and `init` designates its first `E.order` values, then `u = E.mkSol init`. This proves that `E.mkSol init` is the only solution of `E` whose first `E.order` values are given by `init`.
solSpace : Submodule R (ℕ → R) where carrier := { u | E.IsSolution u } zero_mem' n := by simp add_mem' {u v} hu hv n := by simp [mul_add, sum_add_distrib, hu n, hv n] smul_mem' a u hu n := by simp [hu n, mul_sum]; congr; ext; ac_rfl
def
Algebra
[ "Mathlib.Algebra.Polynomial.Eval.Defs", "Mathlib.LinearAlgebra.Dimension.Constructions" ]
Mathlib/Algebra/LinearRecurrence.lean
solSpace
The space of solutions of `E`, as a `Submodule` over `R` of the module `ℕ → R`.
is_sol_iff_mem_solSpace (u : ℕ → R) : E.IsSolution u ↔ u ∈ E.solSpace := Iff.rfl
theorem
Algebra
[ "Mathlib.Algebra.Polynomial.Eval.Defs", "Mathlib.LinearAlgebra.Dimension.Constructions" ]
Mathlib/Algebra/LinearRecurrence.lean
is_sol_iff_mem_solSpace
Defining property of the solution space : `u` is a solution iff it belongs to the solution space.
toInit : E.solSpace ≃ₗ[R] Fin E.order → R where toFun u x := (u : ℕ → R) x map_add' u v := by ext simp map_smul' a u := by ext simp invFun u := ⟨E.mkSol u, E.is_sol_mkSol u⟩ left_inv u := by ext n; symm; apply E.eq_mk_of_is_sol_of_eq_init u.2; intro k; rfl right_inv u := funext_iff.mpr fun n ↦ E.mkSol_eq_init u n
def
Algebra
[ "Mathlib.Algebra.Polynomial.Eval.Defs", "Mathlib.LinearAlgebra.Dimension.Constructions" ]
Mathlib/Algebra/LinearRecurrence.lean
toInit
The function that maps a solution `u` of `E` to its first `E.order` terms as a `LinearEquiv`.
sol_eq_of_eq_init (u v : ℕ → R) (hu : E.IsSolution u) (hv : E.IsSolution v) : u = v ↔ Set.EqOn u v ↑(range E.order) := by refine Iff.intro (fun h x _ ↦ h ▸ rfl) ?_ intro h set u' : ↥E.solSpace := ⟨u, hu⟩ set v' : ↥E.solSpace := ⟨v, hv⟩ change u'.val = v'.val suffices h' : u' = v' from h' ▸ rfl rw [← E.toInit.toEquiv.apply_eq_iff_eq, LinearEquiv.coe_toEquiv] ext x exact mod_cast h (mem_range.mpr x.2) /-! `E.tupleSucc` maps `![s₀, s₁, ..., sₙ]` to `![s₁, ..., sₙ, ∑ (E.coeffs i) * sᵢ]`, where `n := E.order`. This operation is quite useful for determining closed-form solutions of `E`. -/
theorem
Algebra
[ "Mathlib.Algebra.Polynomial.Eval.Defs", "Mathlib.LinearAlgebra.Dimension.Constructions" ]
Mathlib/Algebra/LinearRecurrence.lean
sol_eq_of_eq_init
Two solutions are equal iff they are equal on `range E.order`.
tupleSucc : (Fin E.order → R) →ₗ[R] Fin E.order → R where toFun X i := if h : (i : ℕ) + 1 < E.order then X ⟨i + 1, h⟩ else ∑ i, E.coeffs i * X i map_add' x y := by ext i split_ifs with h <;> simp [h, mul_add, sum_add_distrib] map_smul' x y := by ext i split_ifs with h <;> simp [h, mul_sum] exact sum_congr rfl fun x _ ↦ by ac_rfl
def
Algebra
[ "Mathlib.Algebra.Polynomial.Eval.Defs", "Mathlib.LinearAlgebra.Dimension.Constructions" ]
Mathlib/Algebra/LinearRecurrence.lean
tupleSucc
`E.tupleSucc` maps `![s₀, s₁, ..., sₙ]` to `![s₁, ..., sₙ, ∑ (E.coeffs i) * sᵢ]`, where `n := E.order`.
solSpace_rank : Module.rank R E.solSpace = E.order := letI := nontrivial_of_invariantBasisNumber R @rank_fin_fun R _ _ E.order ▸ E.toInit.rank_eq
theorem
Algebra
[ "Mathlib.Algebra.Polynomial.Eval.Defs", "Mathlib.LinearAlgebra.Dimension.Constructions" ]
Mathlib/Algebra/LinearRecurrence.lean
solSpace_rank
The dimension of `E.solSpace` is `E.order`.
charPoly : R[X] := Polynomial.monomial E.order 1 - ∑ i : Fin E.order, Polynomial.monomial i (E.coeffs i)
def
Algebra
[ "Mathlib.Algebra.Polynomial.Eval.Defs", "Mathlib.LinearAlgebra.Dimension.Constructions" ]
Mathlib/Algebra/LinearRecurrence.lean
charPoly
The characteristic polynomial of `E` is `X ^ E.order - ∑ i : Fin E.order, (E.coeffs i) * X ^ i`.
geom_sol_iff_root_charPoly (q : R) : (E.IsSolution fun n ↦ q ^ n) ↔ E.charPoly.IsRoot q := by rw [charPoly, Polynomial.IsRoot.def, Polynomial.eval] simp only [Polynomial.eval₂_finset_sum, one_mul, RingHom.id_apply, Polynomial.eval₂_monomial, Polynomial.eval₂_sub] constructor · intro h simpa [sub_eq_zero] using h 0 · intro h n simp only [pow_add, sub_eq_zero.mp h, mul_sum] exact sum_congr rfl fun _ _ ↦ by ring
theorem
Algebra
[ "Mathlib.Algebra.Polynomial.Eval.Defs", "Mathlib.LinearAlgebra.Dimension.Constructions" ]
Mathlib/Algebra/LinearRecurrence.lean
geom_sol_iff_root_charPoly
The geometric sequence `q^n` is a solution of `E` iff `q` is a root of `E`'s characteristic polynomial.
ModEq (p a b : α) : Prop := ∃ z : ℤ, b - a = z • p @[inherit_doc] notation:50 a " ≡ " b " [PMOD " p "]" => ModEq p a b @[refl, simp]
def
Algebra
[ "Mathlib.Algebra.Field.Basic", "Mathlib.Algebra.NoZeroSMulDivisors.Basic", "Mathlib.Data.Int.ModEq", "Mathlib.GroupTheory.QuotientGroup.Defs", "Mathlib.Algebra.Group.Subgroup.ZPowers.Basic" ]
Mathlib/Algebra/ModEq.lean
ModEq
`a ≡ b [PMOD p]` means that `b` is congruent to `a` modulo `p`. Equivalently (as shown in `Algebra.Order.ToIntervalMod`), `b` does not lie in the open interval `(a, a + p)` modulo `p`, or `toIcoMod hp a` disagrees with `toIocMod hp a` at `b`, or `toIcoDiv hp a` disagrees with `toIocDiv hp a` at `b`.
modEq_refl (a : α) : a ≡ a [PMOD p] := ⟨0, by simp⟩
theorem
Algebra
[ "Mathlib.Algebra.Field.Basic", "Mathlib.Algebra.NoZeroSMulDivisors.Basic", "Mathlib.Data.Int.ModEq", "Mathlib.GroupTheory.QuotientGroup.Defs", "Mathlib.Algebra.Group.Subgroup.ZPowers.Basic" ]
Mathlib/Algebra/ModEq.lean
modEq_refl
null
modEq_rfl : a ≡ a [PMOD p] := modEq_refl _
theorem
Algebra
[ "Mathlib.Algebra.Field.Basic", "Mathlib.Algebra.NoZeroSMulDivisors.Basic", "Mathlib.Data.Int.ModEq", "Mathlib.GroupTheory.QuotientGroup.Defs", "Mathlib.Algebra.Group.Subgroup.ZPowers.Basic" ]
Mathlib/Algebra/ModEq.lean
modEq_rfl
null
modEq_comm : a ≡ b [PMOD p] ↔ b ≡ a [PMOD p] := (Equiv.neg _).exists_congr_left.trans <| by simp [ModEq, ← neg_eq_iff_eq_neg] alias ⟨ModEq.symm, _⟩ := modEq_comm attribute [symm] ModEq.symm @[trans]
theorem
Algebra
[ "Mathlib.Algebra.Field.Basic", "Mathlib.Algebra.NoZeroSMulDivisors.Basic", "Mathlib.Data.Int.ModEq", "Mathlib.GroupTheory.QuotientGroup.Defs", "Mathlib.Algebra.Group.Subgroup.ZPowers.Basic" ]
Mathlib/Algebra/ModEq.lean
modEq_comm
null
ModEq.trans : a ≡ b [PMOD p] → b ≡ c [PMOD p] → a ≡ c [PMOD p] := fun ⟨m, hm⟩ ⟨n, hn⟩ => ⟨m + n, by simp [add_smul, ← hm, ← hn]⟩
theorem
Algebra
[ "Mathlib.Algebra.Field.Basic", "Mathlib.Algebra.NoZeroSMulDivisors.Basic", "Mathlib.Data.Int.ModEq", "Mathlib.GroupTheory.QuotientGroup.Defs", "Mathlib.Algebra.Group.Subgroup.ZPowers.Basic" ]
Mathlib/Algebra/ModEq.lean
ModEq.trans
null
@[simp] neg_modEq_neg : -a ≡ -b [PMOD p] ↔ a ≡ b [PMOD p] := modEq_comm.trans <| by simp [ModEq, neg_add_eq_sub] alias ⟨ModEq.of_neg, ModEq.neg⟩ := neg_modEq_neg @[simp]
theorem
Algebra
[ "Mathlib.Algebra.Field.Basic", "Mathlib.Algebra.NoZeroSMulDivisors.Basic", "Mathlib.Data.Int.ModEq", "Mathlib.GroupTheory.QuotientGroup.Defs", "Mathlib.Algebra.Group.Subgroup.ZPowers.Basic" ]
Mathlib/Algebra/ModEq.lean
neg_modEq_neg
null
modEq_neg : a ≡ b [PMOD -p] ↔ a ≡ b [PMOD p] := modEq_comm.trans <| by simp [ModEq, ← neg_eq_iff_eq_neg] alias ⟨ModEq.of_neg', ModEq.neg'⟩ := modEq_neg
theorem
Algebra
[ "Mathlib.Algebra.Field.Basic", "Mathlib.Algebra.NoZeroSMulDivisors.Basic", "Mathlib.Data.Int.ModEq", "Mathlib.GroupTheory.QuotientGroup.Defs", "Mathlib.Algebra.Group.Subgroup.ZPowers.Basic" ]
Mathlib/Algebra/ModEq.lean
modEq_neg
null
modEq_sub (a b : α) : a ≡ b [PMOD b - a] := ⟨1, (one_smul _ _).symm⟩ @[simp]
theorem
Algebra
[ "Mathlib.Algebra.Field.Basic", "Mathlib.Algebra.NoZeroSMulDivisors.Basic", "Mathlib.Data.Int.ModEq", "Mathlib.GroupTheory.QuotientGroup.Defs", "Mathlib.Algebra.Group.Subgroup.ZPowers.Basic" ]
Mathlib/Algebra/ModEq.lean
modEq_sub
null
modEq_zero : a ≡ b [PMOD 0] ↔ a = b := by simp [ModEq, sub_eq_zero, eq_comm] @[simp]
theorem
Algebra
[ "Mathlib.Algebra.Field.Basic", "Mathlib.Algebra.NoZeroSMulDivisors.Basic", "Mathlib.Data.Int.ModEq", "Mathlib.GroupTheory.QuotientGroup.Defs", "Mathlib.Algebra.Group.Subgroup.ZPowers.Basic" ]
Mathlib/Algebra/ModEq.lean
modEq_zero
null
self_modEq_zero : p ≡ 0 [PMOD p] := ⟨-1, by simp⟩ @[simp]
theorem
Algebra
[ "Mathlib.Algebra.Field.Basic", "Mathlib.Algebra.NoZeroSMulDivisors.Basic", "Mathlib.Data.Int.ModEq", "Mathlib.GroupTheory.QuotientGroup.Defs", "Mathlib.Algebra.Group.Subgroup.ZPowers.Basic" ]
Mathlib/Algebra/ModEq.lean
self_modEq_zero
null
zsmul_modEq_zero (z : ℤ) : z • p ≡ 0 [PMOD p] := ⟨-z, by simp⟩
theorem
Algebra
[ "Mathlib.Algebra.Field.Basic", "Mathlib.Algebra.NoZeroSMulDivisors.Basic", "Mathlib.Data.Int.ModEq", "Mathlib.GroupTheory.QuotientGroup.Defs", "Mathlib.Algebra.Group.Subgroup.ZPowers.Basic" ]
Mathlib/Algebra/ModEq.lean
zsmul_modEq_zero
null
add_zsmul_modEq (z : ℤ) : a + z • p ≡ a [PMOD p] := ⟨-z, by simp⟩
theorem
Algebra
[ "Mathlib.Algebra.Field.Basic", "Mathlib.Algebra.NoZeroSMulDivisors.Basic", "Mathlib.Data.Int.ModEq", "Mathlib.GroupTheory.QuotientGroup.Defs", "Mathlib.Algebra.Group.Subgroup.ZPowers.Basic" ]
Mathlib/Algebra/ModEq.lean
add_zsmul_modEq
null
zsmul_add_modEq (z : ℤ) : z • p + a ≡ a [PMOD p] := ⟨-z, by simp⟩
theorem
Algebra
[ "Mathlib.Algebra.Field.Basic", "Mathlib.Algebra.NoZeroSMulDivisors.Basic", "Mathlib.Data.Int.ModEq", "Mathlib.GroupTheory.QuotientGroup.Defs", "Mathlib.Algebra.Group.Subgroup.ZPowers.Basic" ]
Mathlib/Algebra/ModEq.lean
zsmul_add_modEq
null
add_nsmul_modEq (n : ℕ) : a + n • p ≡ a [PMOD p] := ⟨-n, by simp⟩
theorem
Algebra
[ "Mathlib.Algebra.Field.Basic", "Mathlib.Algebra.NoZeroSMulDivisors.Basic", "Mathlib.Data.Int.ModEq", "Mathlib.GroupTheory.QuotientGroup.Defs", "Mathlib.Algebra.Group.Subgroup.ZPowers.Basic" ]
Mathlib/Algebra/ModEq.lean
add_nsmul_modEq
null
nsmul_add_modEq (n : ℕ) : n • p + a ≡ a [PMOD p] := ⟨-n, by simp⟩
theorem
Algebra
[ "Mathlib.Algebra.Field.Basic", "Mathlib.Algebra.NoZeroSMulDivisors.Basic", "Mathlib.Data.Int.ModEq", "Mathlib.GroupTheory.QuotientGroup.Defs", "Mathlib.Algebra.Group.Subgroup.ZPowers.Basic" ]
Mathlib/Algebra/ModEq.lean
nsmul_add_modEq
null
protected add_zsmul (z : ℤ) : a ≡ b [PMOD p] → a + z • p ≡ b [PMOD p] := (add_zsmul_modEq _).trans
theorem
Algebra
[ "Mathlib.Algebra.Field.Basic", "Mathlib.Algebra.NoZeroSMulDivisors.Basic", "Mathlib.Data.Int.ModEq", "Mathlib.GroupTheory.QuotientGroup.Defs", "Mathlib.Algebra.Group.Subgroup.ZPowers.Basic" ]
Mathlib/Algebra/ModEq.lean
add_zsmul
null
protected zsmul_add (z : ℤ) : a ≡ b [PMOD p] → z • p + a ≡ b [PMOD p] := (zsmul_add_modEq _).trans
theorem
Algebra
[ "Mathlib.Algebra.Field.Basic", "Mathlib.Algebra.NoZeroSMulDivisors.Basic", "Mathlib.Data.Int.ModEq", "Mathlib.GroupTheory.QuotientGroup.Defs", "Mathlib.Algebra.Group.Subgroup.ZPowers.Basic" ]
Mathlib/Algebra/ModEq.lean
zsmul_add
null
protected add_nsmul (n : ℕ) : a ≡ b [PMOD p] → a + n • p ≡ b [PMOD p] := (add_nsmul_modEq _).trans
theorem
Algebra
[ "Mathlib.Algebra.Field.Basic", "Mathlib.Algebra.NoZeroSMulDivisors.Basic", "Mathlib.Data.Int.ModEq", "Mathlib.GroupTheory.QuotientGroup.Defs", "Mathlib.Algebra.Group.Subgroup.ZPowers.Basic" ]
Mathlib/Algebra/ModEq.lean
add_nsmul
null
protected nsmul_add (n : ℕ) : a ≡ b [PMOD p] → n • p + a ≡ b [PMOD p] := (nsmul_add_modEq _).trans
theorem
Algebra
[ "Mathlib.Algebra.Field.Basic", "Mathlib.Algebra.NoZeroSMulDivisors.Basic", "Mathlib.Data.Int.ModEq", "Mathlib.GroupTheory.QuotientGroup.Defs", "Mathlib.Algebra.Group.Subgroup.ZPowers.Basic" ]
Mathlib/Algebra/ModEq.lean
nsmul_add
null
protected of_zsmul : a ≡ b [PMOD z • p] → a ≡ b [PMOD p] := fun ⟨m, hm⟩ => ⟨m * z, by rwa [mul_smul]⟩
theorem
Algebra
[ "Mathlib.Algebra.Field.Basic", "Mathlib.Algebra.NoZeroSMulDivisors.Basic", "Mathlib.Data.Int.ModEq", "Mathlib.GroupTheory.QuotientGroup.Defs", "Mathlib.Algebra.Group.Subgroup.ZPowers.Basic" ]
Mathlib/Algebra/ModEq.lean
of_zsmul
null
protected of_nsmul : a ≡ b [PMOD n • p] → a ≡ b [PMOD p] := fun ⟨m, hm⟩ => ⟨m * n, by rwa [mul_smul, natCast_zsmul]⟩
theorem
Algebra
[ "Mathlib.Algebra.Field.Basic", "Mathlib.Algebra.NoZeroSMulDivisors.Basic", "Mathlib.Data.Int.ModEq", "Mathlib.GroupTheory.QuotientGroup.Defs", "Mathlib.Algebra.Group.Subgroup.ZPowers.Basic" ]
Mathlib/Algebra/ModEq.lean
of_nsmul
null
protected zsmul : a ≡ b [PMOD p] → z • a ≡ z • b [PMOD z • p] := Exists.imp fun m hm => by rw [← smul_sub, hm, smul_comm]
theorem
Algebra
[ "Mathlib.Algebra.Field.Basic", "Mathlib.Algebra.NoZeroSMulDivisors.Basic", "Mathlib.Data.Int.ModEq", "Mathlib.GroupTheory.QuotientGroup.Defs", "Mathlib.Algebra.Group.Subgroup.ZPowers.Basic" ]
Mathlib/Algebra/ModEq.lean
zsmul
null
protected nsmul : a ≡ b [PMOD p] → n • a ≡ n • b [PMOD n • p] := Exists.imp fun m hm => by rw [← smul_sub, hm, smul_comm]
theorem
Algebra
[ "Mathlib.Algebra.Field.Basic", "Mathlib.Algebra.NoZeroSMulDivisors.Basic", "Mathlib.Data.Int.ModEq", "Mathlib.GroupTheory.QuotientGroup.Defs", "Mathlib.Algebra.Group.Subgroup.ZPowers.Basic" ]
Mathlib/Algebra/ModEq.lean
nsmul
null
@[simp] zsmul_modEq_zsmul [NoZeroSMulDivisors ℤ α] (hn : z ≠ 0) : z • a ≡ z • b [PMOD z • p] ↔ a ≡ b [PMOD p] := exists_congr fun m => by rw [← smul_sub, smul_comm, smul_right_inj hn] @[simp]
theorem
Algebra
[ "Mathlib.Algebra.Field.Basic", "Mathlib.Algebra.NoZeroSMulDivisors.Basic", "Mathlib.Data.Int.ModEq", "Mathlib.GroupTheory.QuotientGroup.Defs", "Mathlib.Algebra.Group.Subgroup.ZPowers.Basic" ]
Mathlib/Algebra/ModEq.lean
zsmul_modEq_zsmul
null
nsmul_modEq_nsmul [NoZeroSMulDivisors ℕ α] (hn : n ≠ 0) : n • a ≡ n • b [PMOD n • p] ↔ a ≡ b [PMOD p] := exists_congr fun m => by rw [← smul_sub, smul_comm, smul_right_inj hn] alias ⟨ModEq.zsmul_cancel, _⟩ := zsmul_modEq_zsmul alias ⟨ModEq.nsmul_cancel, _⟩ := nsmul_modEq_nsmul
theorem
Algebra
[ "Mathlib.Algebra.Field.Basic", "Mathlib.Algebra.NoZeroSMulDivisors.Basic", "Mathlib.Data.Int.ModEq", "Mathlib.GroupTheory.QuotientGroup.Defs", "Mathlib.Algebra.Group.Subgroup.ZPowers.Basic" ]
Mathlib/Algebra/ModEq.lean
nsmul_modEq_nsmul
null
@[simp] protected add_iff_left : a₁ ≡ b₁ [PMOD p] → (a₁ + a₂ ≡ b₁ + b₂ [PMOD p] ↔ a₂ ≡ b₂ [PMOD p]) := fun ⟨m, hm⟩ => (Equiv.addLeft m).symm.exists_congr_left.trans <| by simp [add_sub_add_comm, hm, add_smul, ModEq] @[simp]
theorem
Algebra
[ "Mathlib.Algebra.Field.Basic", "Mathlib.Algebra.NoZeroSMulDivisors.Basic", "Mathlib.Data.Int.ModEq", "Mathlib.GroupTheory.QuotientGroup.Defs", "Mathlib.Algebra.Group.Subgroup.ZPowers.Basic" ]
Mathlib/Algebra/ModEq.lean
add_iff_left
null
protected add_iff_right : a₂ ≡ b₂ [PMOD p] → (a₁ + a₂ ≡ b₁ + b₂ [PMOD p] ↔ a₁ ≡ b₁ [PMOD p]) := fun ⟨m, hm⟩ => (Equiv.addRight m).symm.exists_congr_left.trans <| by simp [add_sub_add_comm, hm, add_smul, ModEq] @[simp]
theorem
Algebra
[ "Mathlib.Algebra.Field.Basic", "Mathlib.Algebra.NoZeroSMulDivisors.Basic", "Mathlib.Data.Int.ModEq", "Mathlib.GroupTheory.QuotientGroup.Defs", "Mathlib.Algebra.Group.Subgroup.ZPowers.Basic" ]
Mathlib/Algebra/ModEq.lean
add_iff_right
null
protected sub_iff_left : a₁ ≡ b₁ [PMOD p] → (a₁ - a₂ ≡ b₁ - b₂ [PMOD p] ↔ a₂ ≡ b₂ [PMOD p]) := fun ⟨m, hm⟩ => (Equiv.subLeft m).symm.exists_congr_left.trans <| by simp [sub_sub_sub_comm, hm, sub_smul, ModEq] @[simp]
theorem
Algebra
[ "Mathlib.Algebra.Field.Basic", "Mathlib.Algebra.NoZeroSMulDivisors.Basic", "Mathlib.Data.Int.ModEq", "Mathlib.GroupTheory.QuotientGroup.Defs", "Mathlib.Algebra.Group.Subgroup.ZPowers.Basic" ]
Mathlib/Algebra/ModEq.lean
sub_iff_left
null
protected sub_iff_right : a₂ ≡ b₂ [PMOD p] → (a₁ - a₂ ≡ b₁ - b₂ [PMOD p] ↔ a₁ ≡ b₁ [PMOD p]) := fun ⟨m, hm⟩ => (Equiv.subRight m).symm.exists_congr_left.trans <| by simp [sub_sub_sub_comm, hm, sub_smul, ModEq] protected alias ⟨add_left_cancel, add⟩ := ModEq.add_iff_left protected alias ⟨add_right_cancel, _⟩ := ModEq.add_iff_right protected alias ⟨sub_left_cancel, sub⟩ := ModEq.sub_iff_left protected alias ⟨sub_right_cancel, _⟩ := ModEq.sub_iff_right
theorem
Algebra
[ "Mathlib.Algebra.Field.Basic", "Mathlib.Algebra.NoZeroSMulDivisors.Basic", "Mathlib.Data.Int.ModEq", "Mathlib.GroupTheory.QuotientGroup.Defs", "Mathlib.Algebra.Group.Subgroup.ZPowers.Basic" ]
Mathlib/Algebra/ModEq.lean
sub_iff_right
null
protected add_left (c : α) (h : a ≡ b [PMOD p]) : c + a ≡ c + b [PMOD p] := modEq_rfl.add h
theorem
Algebra
[ "Mathlib.Algebra.Field.Basic", "Mathlib.Algebra.NoZeroSMulDivisors.Basic", "Mathlib.Data.Int.ModEq", "Mathlib.GroupTheory.QuotientGroup.Defs", "Mathlib.Algebra.Group.Subgroup.ZPowers.Basic" ]
Mathlib/Algebra/ModEq.lean
add_left
null
protected sub_left (c : α) (h : a ≡ b [PMOD p]) : c - a ≡ c - b [PMOD p] := modEq_rfl.sub h
theorem
Algebra
[ "Mathlib.Algebra.Field.Basic", "Mathlib.Algebra.NoZeroSMulDivisors.Basic", "Mathlib.Data.Int.ModEq", "Mathlib.GroupTheory.QuotientGroup.Defs", "Mathlib.Algebra.Group.Subgroup.ZPowers.Basic" ]
Mathlib/Algebra/ModEq.lean
sub_left
null
protected add_right (c : α) (h : a ≡ b [PMOD p]) : a + c ≡ b + c [PMOD p] := h.add modEq_rfl
theorem
Algebra
[ "Mathlib.Algebra.Field.Basic", "Mathlib.Algebra.NoZeroSMulDivisors.Basic", "Mathlib.Data.Int.ModEq", "Mathlib.GroupTheory.QuotientGroup.Defs", "Mathlib.Algebra.Group.Subgroup.ZPowers.Basic" ]
Mathlib/Algebra/ModEq.lean
add_right
null
protected sub_right (c : α) (h : a ≡ b [PMOD p]) : a - c ≡ b - c [PMOD p] := h.sub modEq_rfl
theorem
Algebra
[ "Mathlib.Algebra.Field.Basic", "Mathlib.Algebra.NoZeroSMulDivisors.Basic", "Mathlib.Data.Int.ModEq", "Mathlib.GroupTheory.QuotientGroup.Defs", "Mathlib.Algebra.Group.Subgroup.ZPowers.Basic" ]
Mathlib/Algebra/ModEq.lean
sub_right
null
protected add_left_cancel' (c : α) : c + a ≡ c + b [PMOD p] → a ≡ b [PMOD p] := modEq_rfl.add_left_cancel
theorem
Algebra
[ "Mathlib.Algebra.Field.Basic", "Mathlib.Algebra.NoZeroSMulDivisors.Basic", "Mathlib.Data.Int.ModEq", "Mathlib.GroupTheory.QuotientGroup.Defs", "Mathlib.Algebra.Group.Subgroup.ZPowers.Basic" ]
Mathlib/Algebra/ModEq.lean
add_left_cancel'
null
protected add_right_cancel' (c : α) : a + c ≡ b + c [PMOD p] → a ≡ b [PMOD p] := modEq_rfl.add_right_cancel
theorem
Algebra
[ "Mathlib.Algebra.Field.Basic", "Mathlib.Algebra.NoZeroSMulDivisors.Basic", "Mathlib.Data.Int.ModEq", "Mathlib.GroupTheory.QuotientGroup.Defs", "Mathlib.Algebra.Group.Subgroup.ZPowers.Basic" ]
Mathlib/Algebra/ModEq.lean
add_right_cancel'
null
protected sub_left_cancel' (c : α) : c - a ≡ c - b [PMOD p] → a ≡ b [PMOD p] := modEq_rfl.sub_left_cancel
theorem
Algebra
[ "Mathlib.Algebra.Field.Basic", "Mathlib.Algebra.NoZeroSMulDivisors.Basic", "Mathlib.Data.Int.ModEq", "Mathlib.GroupTheory.QuotientGroup.Defs", "Mathlib.Algebra.Group.Subgroup.ZPowers.Basic" ]
Mathlib/Algebra/ModEq.lean
sub_left_cancel'
null
protected sub_right_cancel' (c : α) : a - c ≡ b - c [PMOD p] → a ≡ b [PMOD p] := modEq_rfl.sub_right_cancel
theorem
Algebra
[ "Mathlib.Algebra.Field.Basic", "Mathlib.Algebra.NoZeroSMulDivisors.Basic", "Mathlib.Data.Int.ModEq", "Mathlib.GroupTheory.QuotientGroup.Defs", "Mathlib.Algebra.Group.Subgroup.ZPowers.Basic" ]
Mathlib/Algebra/ModEq.lean
sub_right_cancel'
null
modEq_sub_iff_add_modEq' : a ≡ b - c [PMOD p] ↔ c + a ≡ b [PMOD p] := by simp [ModEq, sub_sub]
theorem
Algebra
[ "Mathlib.Algebra.Field.Basic", "Mathlib.Algebra.NoZeroSMulDivisors.Basic", "Mathlib.Data.Int.ModEq", "Mathlib.GroupTheory.QuotientGroup.Defs", "Mathlib.Algebra.Group.Subgroup.ZPowers.Basic" ]
Mathlib/Algebra/ModEq.lean
modEq_sub_iff_add_modEq'
null
modEq_sub_iff_add_modEq : a ≡ b - c [PMOD p] ↔ a + c ≡ b [PMOD p] := modEq_sub_iff_add_modEq'.trans <| by rw [add_comm]
theorem
Algebra
[ "Mathlib.Algebra.Field.Basic", "Mathlib.Algebra.NoZeroSMulDivisors.Basic", "Mathlib.Data.Int.ModEq", "Mathlib.GroupTheory.QuotientGroup.Defs", "Mathlib.Algebra.Group.Subgroup.ZPowers.Basic" ]
Mathlib/Algebra/ModEq.lean
modEq_sub_iff_add_modEq
null
sub_modEq_iff_modEq_add' : a - b ≡ c [PMOD p] ↔ a ≡ b + c [PMOD p] := modEq_comm.trans <| modEq_sub_iff_add_modEq'.trans modEq_comm
theorem
Algebra
[ "Mathlib.Algebra.Field.Basic", "Mathlib.Algebra.NoZeroSMulDivisors.Basic", "Mathlib.Data.Int.ModEq", "Mathlib.GroupTheory.QuotientGroup.Defs", "Mathlib.Algebra.Group.Subgroup.ZPowers.Basic" ]
Mathlib/Algebra/ModEq.lean
sub_modEq_iff_modEq_add'
null
sub_modEq_iff_modEq_add : a - b ≡ c [PMOD p] ↔ a ≡ c + b [PMOD p] := modEq_comm.trans <| modEq_sub_iff_add_modEq.trans modEq_comm @[simp]
theorem
Algebra
[ "Mathlib.Algebra.Field.Basic", "Mathlib.Algebra.NoZeroSMulDivisors.Basic", "Mathlib.Data.Int.ModEq", "Mathlib.GroupTheory.QuotientGroup.Defs", "Mathlib.Algebra.Group.Subgroup.ZPowers.Basic" ]
Mathlib/Algebra/ModEq.lean
sub_modEq_iff_modEq_add
null