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
hasNatScalar : SMul ℕ (TruncatedWittVector p n R) := ⟨fun m x => truncateFun n (m • x.out)⟩
instance
RingTheory
[ "Mathlib.RingTheory.WittVector.InitTail" ]
Mathlib/RingTheory/WittVector/Truncated.lean
hasNatScalar
null
hasIntScalar : SMul ℤ (TruncatedWittVector p n R) := ⟨fun m x => truncateFun n (m • x.out)⟩
instance
RingTheory
[ "Mathlib.RingTheory.WittVector.InitTail" ]
Mathlib/RingTheory/WittVector/Truncated.lean
hasIntScalar
null
hasNatPow : Pow (TruncatedWittVector p n R) ℕ := ⟨fun x m => truncateFun n (x.out ^ m)⟩ @[simp]
instance
RingTheory
[ "Mathlib.RingTheory.WittVector.InitTail" ]
Mathlib/RingTheory/WittVector/Truncated.lean
hasNatPow
null
coeff_zero (i : Fin n) : (0 : TruncatedWittVector p n R).coeff i = 0 := by change coeff i (truncateFun _ 0 : TruncatedWittVector p n R) = 0 rw [coeff_truncateFun, WittVector.zero_coeff]
theorem
RingTheory
[ "Mathlib.RingTheory.WittVector.InitTail" ]
Mathlib/RingTheory/WittVector/Truncated.lean
coeff_zero
null
noncomputable truncate : 𝕎 R →+* TruncatedWittVector p n R where toFun := truncateFun n map_zero' := truncateFun_zero p n R map_add' := truncateFun_add n map_one' := truncateFun_one p n R map_mul' := truncateFun_mul n variable (p R)
def
RingTheory
[ "Mathlib.RingTheory.WittVector.InitTail" ]
Mathlib/RingTheory/WittVector/Truncated.lean
truncate
A macro tactic used to prove that `truncateFun` respects ring operations. -/ macro (name := witt_truncateFun_tac) "witt_truncateFun_tac" : tactic => `(tactic| { show _ = WittVector.truncateFun n _ apply TruncatedWittVector.out_injective iterate rw [WittVector.out_truncateFun] first | rw [WittVector.init_add] | rw [WittVector.init_mul] | rw [WittVector.init_neg] | rw [WittVector.init_sub] | rw [WittVector.init_nsmul] | rw [WittVector.init_zsmul] | rw [WittVector.init_pow]}) namespace WittVector variable (p n R) variable [CommRing R] theorem truncateFun_surjective : Surjective (@truncateFun p n R) := Function.RightInverse.surjective TruncatedWittVector.truncateFun_out variable [Fact p.Prime] @[simp] theorem truncateFun_zero : truncateFun n (0 : 𝕎 R) = 0 := rfl @[simp] theorem truncateFun_one : truncateFun n (1 : 𝕎 R) = 1 := rfl variable {p R} @[simp] theorem truncateFun_add (x y : 𝕎 R) : truncateFun n (x + y) = truncateFun n x + truncateFun n y := by witt_truncateFun_tac @[simp] theorem truncateFun_mul (x y : 𝕎 R) : truncateFun n (x * y) = truncateFun n x * truncateFun n y := by witt_truncateFun_tac theorem truncateFun_neg (x : 𝕎 R) : truncateFun n (-x) = -truncateFun n x := by witt_truncateFun_tac theorem truncateFun_sub (x y : 𝕎 R) : truncateFun n (x - y) = truncateFun n x - truncateFun n y := by witt_truncateFun_tac theorem truncateFun_nsmul (m : ℕ) (x : 𝕎 R) : truncateFun n (m • x) = m • truncateFun n x := by witt_truncateFun_tac theorem truncateFun_zsmul (m : ℤ) (x : 𝕎 R) : truncateFun n (m • x) = m • truncateFun n x := by witt_truncateFun_tac theorem truncateFun_pow (x : 𝕎 R) (m : ℕ) : truncateFun n (x ^ m) = truncateFun n x ^ m := by witt_truncateFun_tac theorem truncateFun_natCast (m : ℕ) : truncateFun n (m : 𝕎 R) = m := rfl theorem truncateFun_intCast (m : ℤ) : truncateFun n (m : 𝕎 R) = m := rfl end WittVector namespace TruncatedWittVector open WittVector variable (p n R) variable [CommRing R] variable [Fact p.Prime] instance instCommRing : CommRing (TruncatedWittVector p n R) := (truncateFun_surjective p n R).commRing _ (truncateFun_zero p n R) (truncateFun_one p n R) (truncateFun_add n) (truncateFun_mul n) (truncateFun_neg n) (truncateFun_sub n) (truncateFun_nsmul n) (truncateFun_zsmul n) (truncateFun_pow n) (truncateFun_natCast n) (truncateFun_intCast n) end TruncatedWittVector namespace WittVector open TruncatedWittVector variable (n) variable [CommRing R] variable [Fact p.Prime] /-- `truncate n` is a ring homomorphism that truncates `x` to its first `n` entries to obtain a `TruncatedWittVector`, which has the same base `p` as `x`.
truncate_surjective : Surjective (truncate n : 𝕎 R → TruncatedWittVector p n R) := truncateFun_surjective p n R variable {p n R} @[simp]
theorem
RingTheory
[ "Mathlib.RingTheory.WittVector.InitTail" ]
Mathlib/RingTheory/WittVector/Truncated.lean
truncate_surjective
null
coeff_truncate (x : 𝕎 R) (i : Fin n) : (truncate n x).coeff i = x.coeff i := coeff_truncateFun _ _ variable (n)
theorem
RingTheory
[ "Mathlib.RingTheory.WittVector.InitTail" ]
Mathlib/RingTheory/WittVector/Truncated.lean
coeff_truncate
null
mem_ker_truncate (x : 𝕎 R) : x ∈ RingHom.ker (truncate (p := p) n) ↔ ∀ i < n, x.coeff i = 0 := by simp only [RingHom.mem_ker, truncate, RingHom.coe_mk, TruncatedWittVector.ext_iff, coeff_zero] exact Fin.forall_iff variable (p) @[simp]
theorem
RingTheory
[ "Mathlib.RingTheory.WittVector.InitTail" ]
Mathlib/RingTheory/WittVector/Truncated.lean
mem_ker_truncate
null
truncate_mk' (f : ℕ → R) : truncate n (@mk' p _ f) = TruncatedWittVector.mk _ fun k => f k := by ext i simp only [coeff_truncate, TruncatedWittVector.coeff_mk]
theorem
RingTheory
[ "Mathlib.RingTheory.WittVector.InitTail" ]
Mathlib/RingTheory/WittVector/Truncated.lean
truncate_mk'
null
truncate {m : ℕ} (hm : n ≤ m) : TruncatedWittVector p m R →+* TruncatedWittVector p n R := RingHom.liftOfRightInverse (WittVector.truncate m) out truncateFun_out ⟨WittVector.truncate n, by intro x simp only [WittVector.mem_ker_truncate] intro h i hi exact h i (lt_of_lt_of_le hi hm)⟩ @[simp]
def
RingTheory
[ "Mathlib.RingTheory.WittVector.InitTail" ]
Mathlib/RingTheory/WittVector/Truncated.lean
truncate
A ring homomorphism that truncates a truncated Witt vector of length `m` to a truncated Witt vector of length `n`, for `n ≤ m`.
truncate_comp_wittVector_truncate {m : ℕ} (hm : n ≤ m) : (truncate (p := p) (R := R) hm).comp (WittVector.truncate m) = WittVector.truncate n := RingHom.liftOfRightInverse_comp _ _ _ _ @[simp]
theorem
RingTheory
[ "Mathlib.RingTheory.WittVector.InitTail" ]
Mathlib/RingTheory/WittVector/Truncated.lean
truncate_comp_wittVector_truncate
null
truncate_wittVector_truncate {m : ℕ} (hm : n ≤ m) (x : 𝕎 R) : truncate hm (WittVector.truncate m x) = WittVector.truncate n x := RingHom.liftOfRightInverse_comp_apply _ _ _ _ _ @[simp]
theorem
RingTheory
[ "Mathlib.RingTheory.WittVector.InitTail" ]
Mathlib/RingTheory/WittVector/Truncated.lean
truncate_wittVector_truncate
null
truncate_truncate {n₁ n₂ n₃ : ℕ} (h1 : n₁ ≤ n₂) (h2 : n₂ ≤ n₃) (x : TruncatedWittVector p n₃ R) : (truncate h1) (truncate h2 x) = truncate (h1.trans h2) x := by obtain ⟨x, rfl⟩ := WittVector.truncate_surjective (p := p) n₃ R x simp only [truncate_wittVector_truncate] @[simp]
theorem
RingTheory
[ "Mathlib.RingTheory.WittVector.InitTail" ]
Mathlib/RingTheory/WittVector/Truncated.lean
truncate_truncate
null
truncate_comp {n₁ n₂ n₃ : ℕ} (h1 : n₁ ≤ n₂) (h2 : n₂ ≤ n₃) : (truncate (p := p) (R := R) h1).comp (truncate h2) = truncate (h1.trans h2) := by ext1 x; simp only [truncate_truncate, Function.comp_apply, RingHom.coe_comp]
theorem
RingTheory
[ "Mathlib.RingTheory.WittVector.InitTail" ]
Mathlib/RingTheory/WittVector/Truncated.lean
truncate_comp
null
truncate_surjective {m : ℕ} (hm : n ≤ m) : Surjective (truncate (p := p) (R := R) hm) := by intro x obtain ⟨x, rfl⟩ := WittVector.truncate_surjective (p := p) _ R x exact ⟨WittVector.truncate _ x, truncate_wittVector_truncate _ _⟩ @[simp]
theorem
RingTheory
[ "Mathlib.RingTheory.WittVector.InitTail" ]
Mathlib/RingTheory/WittVector/Truncated.lean
truncate_surjective
null
coeff_truncate {m : ℕ} (hm : n ≤ m) (i : Fin n) (x : TruncatedWittVector p m R) : (truncate hm x).coeff i = x.coeff (Fin.castLE hm i) := by obtain ⟨y, rfl⟩ := @WittVector.truncate_surjective p _ _ _ _ x simp only [truncate_wittVector_truncate, WittVector.coeff_truncate, Fin.coe_castLE]
theorem
RingTheory
[ "Mathlib.RingTheory.WittVector.InitTail" ]
Mathlib/RingTheory/WittVector/Truncated.lean
coeff_truncate
null
card {R : Type*} [Fintype R] : Fintype.card (TruncatedWittVector p n R) = Fintype.card R ^ n := by simp only [TruncatedWittVector, Fintype.card_fin, Fintype.card_fun]
theorem
RingTheory
[ "Mathlib.RingTheory.WittVector.InitTail" ]
Mathlib/RingTheory/WittVector/Truncated.lean
card
null
iInf_ker_truncate : ⨅ i : ℕ, RingHom.ker (WittVector.truncate (p := p) (R := R) i) = ⊥ := by rw [Submodule.eq_bot_iff] intro x hx ext simp only [WittVector.mem_ker_truncate, Ideal.mem_iInf, WittVector.zero_coeff] at hx ⊢ exact hx _ _ (Nat.lt_succ_self _)
theorem
RingTheory
[ "Mathlib.RingTheory.WittVector.InitTail" ]
Mathlib/RingTheory/WittVector/Truncated.lean
iInf_ker_truncate
null
liftFun (s : S) : 𝕎 R := @WittVector.mk' p _ fun k => TruncatedWittVector.coeff (Fin.last k) (f (k + 1) s) variable {f} in include f_compat in @[simp]
def
RingTheory
[ "Mathlib.RingTheory.WittVector.InitTail" ]
Mathlib/RingTheory/WittVector/Truncated.lean
liftFun
Given a family `fₖ : S → TruncatedWittVector p k R` and `s : S`, we produce a Witt vector by defining the `k`th entry to be the final entry of `fₖ s`.
truncate_liftFun (s : S) : WittVector.truncate n (liftFun f s) = f n s := by ext i simp only [liftFun, TruncatedWittVector.coeff_mk, WittVector.truncate_mk'] rw [← f_compat (i + 1) n i.is_lt, RingHom.comp_apply, TruncatedWittVector.coeff_truncate] congr 1 with _
theorem
RingTheory
[ "Mathlib.RingTheory.WittVector.InitTail" ]
Mathlib/RingTheory/WittVector/Truncated.lean
truncate_liftFun
null
lift : S →+* 𝕎 R := by refine { toFun := liftFun f map_zero' := ?_ map_one' := ?_ map_add' := ?_ map_mul' := ?_ } <;> ( intros rw [← sub_eq_zero, ← Ideal.mem_bot, ← iInf_ker_truncate, Ideal.mem_iInf] simp [RingHom.mem_ker, f_compat]) variable {f} @[simp]
def
RingTheory
[ "Mathlib.RingTheory.WittVector.InitTail" ]
Mathlib/RingTheory/WittVector/Truncated.lean
lift
Given compatible ring homs from `S` into `TruncatedWittVector n` for each `n`, we can lift these to a ring hom `S → 𝕎 R`. `lift` defines the universal property of `𝕎 R` as the inverse limit of `TruncatedWittVector n`.
truncate_lift (s : S) : WittVector.truncate n (lift _ f_compat s) = f n s := truncate_liftFun _ f_compat s @[simp]
theorem
RingTheory
[ "Mathlib.RingTheory.WittVector.InitTail" ]
Mathlib/RingTheory/WittVector/Truncated.lean
truncate_lift
null
truncate_comp_lift : (WittVector.truncate n).comp (lift _ f_compat) = f n := by ext1; rw [RingHom.comp_apply, truncate_lift]
theorem
RingTheory
[ "Mathlib.RingTheory.WittVector.InitTail" ]
Mathlib/RingTheory/WittVector/Truncated.lean
truncate_comp_lift
null
lift_unique (g : S →+* 𝕎 R) (g_compat : ∀ k, (WittVector.truncate k).comp g = f k) : lift _ f_compat = g := by ext1 x rw [← sub_eq_zero, ← Ideal.mem_bot, ← iInf_ker_truncate, Ideal.mem_iInf] intro i simp only [RingHom.mem_ker, g_compat, ← RingHom.comp_apply, truncate_comp_lift, RingHom.map_sub, sub_self]
theorem
RingTheory
[ "Mathlib.RingTheory.WittVector.InitTail" ]
Mathlib/RingTheory/WittVector/Truncated.lean
lift_unique
The uniqueness part of the universal property of `𝕎 R`.
@[simps] liftEquiv : { f : ∀ k, S →+* TruncatedWittVector p k R // ∀ (k₁ k₂) (hk : k₁ ≤ k₂), (TruncatedWittVector.truncate hk).comp (f k₂) = f k₁ } ≃ (S →+* 𝕎 R) where toFun f := lift f.1 f.2 invFun g := ⟨fun k => (truncate k).comp g, by intro _ _ h simp only [← RingHom.comp_assoc, truncate_comp_wittVector_truncate]⟩ left_inv := by rintro ⟨f, hf⟩; simp only [truncate_comp_lift] right_inv _ := lift_unique _ _ fun _ => rfl
def
RingTheory
[ "Mathlib.RingTheory.WittVector.InitTail" ]
Mathlib/RingTheory/WittVector/Truncated.lean
liftEquiv
The universal property of `𝕎 R` as projective limit of truncated Witt vector rings.
hom_ext (g₁ g₂ : S →+* 𝕎 R) (h : ∀ k, (truncate k).comp g₁ = (truncate k).comp g₂) : g₁ = g₂ := liftEquiv.symm.injective <| Subtype.ext <| funext h
theorem
RingTheory
[ "Mathlib.RingTheory.WittVector.InitTail" ]
Mathlib/RingTheory/WittVector/Truncated.lean
hom_ext
null
verschiebungFun (x : 𝕎 R) : 𝕎 R := @mk' p _ fun n => if n = 0 then 0 else x.coeff (n - 1)
def
RingTheory
[ "Mathlib.RingTheory.WittVector.Basic", "Mathlib.RingTheory.WittVector.IsPoly" ]
Mathlib/RingTheory/WittVector/Verschiebung.lean
verschiebungFun
`verschiebungFun x` shifts the coefficients of `x` up by one, by inserting 0 as the 0th coefficient. `x.coeff i` then becomes `(verschiebungFun x).coeff (i + 1)`. `verschiebungFun` is the underlying function of the additive monoid hom `WittVector.verschiebung`.
verschiebungFun_coeff (x : 𝕎 R) (n : ℕ) : (verschiebungFun x).coeff n = if n = 0 then 0 else x.coeff (n - 1) := by simp only [verschiebungFun]
theorem
RingTheory
[ "Mathlib.RingTheory.WittVector.Basic", "Mathlib.RingTheory.WittVector.IsPoly" ]
Mathlib/RingTheory/WittVector/Verschiebung.lean
verschiebungFun_coeff
null
verschiebungFun_coeff_zero (x : 𝕎 R) : (verschiebungFun x).coeff 0 = 0 := by rw [verschiebungFun_coeff, if_pos rfl] @[simp]
theorem
RingTheory
[ "Mathlib.RingTheory.WittVector.Basic", "Mathlib.RingTheory.WittVector.IsPoly" ]
Mathlib/RingTheory/WittVector/Verschiebung.lean
verschiebungFun_coeff_zero
null
verschiebungFun_coeff_succ (x : 𝕎 R) (n : ℕ) : (verschiebungFun x).coeff n.succ = x.coeff n := rfl @[ghost_simps]
theorem
RingTheory
[ "Mathlib.RingTheory.WittVector.Basic", "Mathlib.RingTheory.WittVector.IsPoly" ]
Mathlib/RingTheory/WittVector/Verschiebung.lean
verschiebungFun_coeff_succ
null
ghostComponent_zero_verschiebungFun [hp : Fact p.Prime] (x : 𝕎 R) : ghostComponent 0 (verschiebungFun x) = 0 := by rw [ghostComponent_apply, aeval_wittPolynomial, Finset.range_one, Finset.sum_singleton, verschiebungFun_coeff_zero, pow_zero, pow_zero, pow_one, one_mul] @[ghost_simps]
theorem
RingTheory
[ "Mathlib.RingTheory.WittVector.Basic", "Mathlib.RingTheory.WittVector.IsPoly" ]
Mathlib/RingTheory/WittVector/Verschiebung.lean
ghostComponent_zero_verschiebungFun
null
ghostComponent_verschiebungFun [hp : Fact p.Prime] (x : 𝕎 R) (n : ℕ) : ghostComponent (n + 1) (verschiebungFun x) = p * ghostComponent n x := by simp only [ghostComponent_apply, aeval_wittPolynomial] rw [Finset.sum_range_succ', verschiebungFun_coeff, if_pos rfl, zero_pow (pow_ne_zero _ hp.1.ne_zero), mul_zero, add_zero, Finset.mul_sum, Finset.sum_congr rfl] rintro i - simp only [pow_succ', verschiebungFun_coeff_succ, Nat.succ_sub_succ_eq_sub, mul_assoc]
theorem
RingTheory
[ "Mathlib.RingTheory.WittVector.Basic", "Mathlib.RingTheory.WittVector.IsPoly" ]
Mathlib/RingTheory/WittVector/Verschiebung.lean
ghostComponent_verschiebungFun
null
verschiebungPoly (n : ℕ) : MvPolynomial ℕ ℤ := if n = 0 then 0 else X (n - 1) @[simp]
def
RingTheory
[ "Mathlib.RingTheory.WittVector.Basic", "Mathlib.RingTheory.WittVector.IsPoly" ]
Mathlib/RingTheory/WittVector/Verschiebung.lean
verschiebungPoly
The 0th Verschiebung polynomial is 0. For `n > 0`, the `n`th Verschiebung polynomial is the variable `X (n-1)`.
verschiebungPoly_zero : verschiebungPoly 0 = 0 := rfl
theorem
RingTheory
[ "Mathlib.RingTheory.WittVector.Basic", "Mathlib.RingTheory.WittVector.IsPoly" ]
Mathlib/RingTheory/WittVector/Verschiebung.lean
verschiebungPoly_zero
null
aeval_verschiebung_poly' (x : 𝕎 R) (n : ℕ) : aeval x.coeff (verschiebungPoly n) = (verschiebungFun x).coeff n := by rcases n with - | n · simp only [verschiebungPoly, ite_true, map_zero, verschiebungFun_coeff_zero] · rw [verschiebungPoly, verschiebungFun_coeff_succ, if_neg n.succ_ne_zero, aeval_X, add_tsub_cancel_right] variable (p)
theorem
RingTheory
[ "Mathlib.RingTheory.WittVector.Basic", "Mathlib.RingTheory.WittVector.IsPoly" ]
Mathlib/RingTheory/WittVector/Verschiebung.lean
aeval_verschiebung_poly'
null
verschiebungFun_isPoly : IsPoly p fun R _Rcr => @verschiebungFun p R _Rcr := by use verschiebungPoly simp only [aeval_verschiebung_poly', forall₃_true_iff]
instance
RingTheory
[ "Mathlib.RingTheory.WittVector.Basic", "Mathlib.RingTheory.WittVector.IsPoly" ]
Mathlib/RingTheory/WittVector/Verschiebung.lean
verschiebungFun_isPoly
`WittVector.verschiebung` has polynomial structure given by `WittVector.verschiebungPoly`.
noncomputable verschiebung : 𝕎 R →+ 𝕎 R where toFun := verschiebungFun map_zero' := by ext ⟨⟩ <;> rw [verschiebungFun_coeff] <;> simp only [zero_coeff, ite_self] map_add' := by ghost_calc _ _ rintro ⟨⟩ <;> ghost_simp
def
RingTheory
[ "Mathlib.RingTheory.WittVector.Basic", "Mathlib.RingTheory.WittVector.IsPoly" ]
Mathlib/RingTheory/WittVector/Verschiebung.lean
verschiebung
`verschiebung x` shifts the coefficients of `x` up by one, by inserting 0 as the 0th coefficient. `x.coeff i` then becomes `(verschiebung x).coeff (i + 1)`. This is an additive monoid hom with underlying function `verschiebung_fun`.
@[is_poly] verschiebung_isPoly : IsPoly p fun _ _ => verschiebung (p := p) := verschiebungFun_isPoly p
theorem
RingTheory
[ "Mathlib.RingTheory.WittVector.Basic", "Mathlib.RingTheory.WittVector.IsPoly" ]
Mathlib/RingTheory/WittVector/Verschiebung.lean
verschiebung_isPoly
`WittVector.verschiebung` is a polynomial function.
@[simp] map_verschiebung (f : R →+* S) (x : 𝕎 R) : map f (verschiebung x) = verschiebung (map f x) := by ext ⟨-, -⟩ · exact f.map_zero · rfl @[ghost_simps]
theorem
RingTheory
[ "Mathlib.RingTheory.WittVector.Basic", "Mathlib.RingTheory.WittVector.IsPoly" ]
Mathlib/RingTheory/WittVector/Verschiebung.lean
map_verschiebung
verschiebung is a natural transformation
ghostComponent_zero_verschiebung (x : 𝕎 R) : ghostComponent 0 (verschiebung x) = 0 := ghostComponent_zero_verschiebungFun _ @[ghost_simps]
theorem
RingTheory
[ "Mathlib.RingTheory.WittVector.Basic", "Mathlib.RingTheory.WittVector.IsPoly" ]
Mathlib/RingTheory/WittVector/Verschiebung.lean
ghostComponent_zero_verschiebung
null
ghostComponent_verschiebung (x : 𝕎 R) (n : ℕ) : ghostComponent (n + 1) (verschiebung x) = p * ghostComponent n x := ghostComponent_verschiebungFun _ _ @[simp]
theorem
RingTheory
[ "Mathlib.RingTheory.WittVector.Basic", "Mathlib.RingTheory.WittVector.IsPoly" ]
Mathlib/RingTheory/WittVector/Verschiebung.lean
ghostComponent_verschiebung
null
verschiebung_coeff_zero (x : 𝕎 R) : (verschiebung x).coeff 0 = 0 := rfl
theorem
RingTheory
[ "Mathlib.RingTheory.WittVector.Basic", "Mathlib.RingTheory.WittVector.IsPoly" ]
Mathlib/RingTheory/WittVector/Verschiebung.lean
verschiebung_coeff_zero
null
verschiebung_coeff_add_one (x : 𝕎 R) (n : ℕ) : (verschiebung x).coeff (n + 1) = x.coeff n := rfl @[simp]
theorem
RingTheory
[ "Mathlib.RingTheory.WittVector.Basic", "Mathlib.RingTheory.WittVector.IsPoly" ]
Mathlib/RingTheory/WittVector/Verschiebung.lean
verschiebung_coeff_add_one
null
verschiebung_coeff_succ (x : 𝕎 R) (n : ℕ) : (verschiebung x).coeff n.succ = x.coeff n := rfl variable (p R) in
theorem
RingTheory
[ "Mathlib.RingTheory.WittVector.Basic", "Mathlib.RingTheory.WittVector.IsPoly" ]
Mathlib/RingTheory/WittVector/Verschiebung.lean
verschiebung_coeff_succ
null
verschiebung_injective : Function.Injective (verschiebung : 𝕎 R → 𝕎 R) := by rw [injective_iff_map_eq_zero] intro w h ext n rw [← verschiebung_coeff_succ, h] simp only [zero_coeff]
theorem
RingTheory
[ "Mathlib.RingTheory.WittVector.Basic", "Mathlib.RingTheory.WittVector.IsPoly" ]
Mathlib/RingTheory/WittVector/Verschiebung.lean
verschiebung_injective
null
aeval_verschiebungPoly (x : 𝕎 R) (n : ℕ) : aeval x.coeff (verschiebungPoly n) = (verschiebung x).coeff n := aeval_verschiebung_poly' x n @[simp]
theorem
RingTheory
[ "Mathlib.RingTheory.WittVector.Basic", "Mathlib.RingTheory.WittVector.IsPoly" ]
Mathlib/RingTheory/WittVector/Verschiebung.lean
aeval_verschiebungPoly
null
bind₁_verschiebungPoly_wittPolynomial (n : ℕ) : bind₁ verschiebungPoly (wittPolynomial p ℤ n) = if n = 0 then 0 else p * wittPolynomial p ℤ (n - 1) := by apply MvPolynomial.funext intro x split_ifs with hn · simp only [hn, wittPolynomial_zero, bind₁_X_right, verschiebungPoly_zero, map_zero] · obtain ⟨n, rfl⟩ := Nat.exists_eq_succ_of_ne_zero hn rw [Nat.succ_eq_add_one, add_tsub_cancel_right] simp only [map_mul] rw [map_natCast, hom_bind₁] calc _ = ghostComponent (n + 1) (verschiebung <| mk p x) := by apply eval₂Hom_congr (RingHom.ext_int _ _) _ rfl funext k simp only [← aeval_verschiebungPoly] exact eval₂Hom_congr (RingHom.ext_int _ _) rfl rfl _ = _ := by rw [ghostComponent_verschiebung]; rfl
theorem
RingTheory
[ "Mathlib.RingTheory.WittVector.Basic", "Mathlib.RingTheory.WittVector.IsPoly" ]
Mathlib/RingTheory/WittVector/Verschiebung.lean
bind₁_verschiebungPoly_wittPolynomial
null
noncomputable wittPolynomial (n : ℕ) : MvPolynomial ℕ R := ∑ i ∈ range (n + 1), monomial (single i (p ^ (n - i))) ((p : R) ^ i)
def
RingTheory
[ "Mathlib.Algebra.CharP.Invertible", "Mathlib.Algebra.MvPolynomial.Variables", "Mathlib.Algebra.MvPolynomial.CommRing", "Mathlib.Algebra.MvPolynomial.Expand", "Mathlib.Algebra.Order.Ring.Rat", "Mathlib.Data.Fintype.BigOperators", "Mathlib.Data.ZMod.Basic" ]
Mathlib/RingTheory/WittVector/WittPolynomial.lean
wittPolynomial
`wittPolynomial p R n` is the `n`-th Witt polynomial with respect to a prime `p` with coefficients in a commutative ring `R`. It is defined as: `∑_{i ≤ n} p^i X_i^{p^{n-i}} ∈ R[X_0, X_1, X_2, …]`.
wittPolynomial_eq_sum_C_mul_X_pow (n : ℕ) : wittPolynomial p R n = ∑ i ∈ range (n + 1), C ((p : R) ^ i) * X i ^ p ^ (n - i) := by apply sum_congr rfl rintro i - rw [monomial_eq, Finsupp.prod_single_index] rw [pow_zero] /-! We set up notation locally to this file, to keep statements short and comprehensible. This allows us to simply write `W n` or `W_ ℤ n`. -/ set_option quotPrecheck false in @[inherit_doc] scoped[Witt] notation "W_" => wittPolynomial p set_option quotPrecheck false in @[inherit_doc] scoped[Witt] notation "W" => wittPolynomial p _ open Witt /-! The first observation is that the Witt polynomial doesn't really depend on the coefficient ring. If we map the coefficients through a ring homomorphism, we obtain the corresponding Witt polynomial over the target ring. -/
theorem
RingTheory
[ "Mathlib.Algebra.CharP.Invertible", "Mathlib.Algebra.MvPolynomial.Variables", "Mathlib.Algebra.MvPolynomial.CommRing", "Mathlib.Algebra.MvPolynomial.Expand", "Mathlib.Algebra.Order.Ring.Rat", "Mathlib.Data.Fintype.BigOperators", "Mathlib.Data.ZMod.Basic" ]
Mathlib/RingTheory/WittVector/WittPolynomial.lean
wittPolynomial_eq_sum_C_mul_X_pow
null
@[simp] map_wittPolynomial (f : R →+* S) (n : ℕ) : map f (W n) = W n := by rw [wittPolynomial, map_sum, wittPolynomial] refine sum_congr rfl fun i _ => ?_ rw [map_monomial, RingHom.map_pow, map_natCast] variable (R) @[simp]
theorem
RingTheory
[ "Mathlib.Algebra.CharP.Invertible", "Mathlib.Algebra.MvPolynomial.Variables", "Mathlib.Algebra.MvPolynomial.CommRing", "Mathlib.Algebra.MvPolynomial.Expand", "Mathlib.Algebra.Order.Ring.Rat", "Mathlib.Data.Fintype.BigOperators", "Mathlib.Data.ZMod.Basic" ]
Mathlib/RingTheory/WittVector/WittPolynomial.lean
map_wittPolynomial
null
constantCoeff_wittPolynomial [hp : Fact p.Prime] (n : ℕ) : constantCoeff (wittPolynomial p R n) = 0 := by simp only [wittPolynomial, map_sum, constantCoeff_monomial] rw [sum_eq_zero] rintro i _ rw [if_neg] rw [Finsupp.single_eq_zero] exact ne_of_gt (pow_pos hp.1.pos _) @[simp]
theorem
RingTheory
[ "Mathlib.Algebra.CharP.Invertible", "Mathlib.Algebra.MvPolynomial.Variables", "Mathlib.Algebra.MvPolynomial.CommRing", "Mathlib.Algebra.MvPolynomial.Expand", "Mathlib.Algebra.Order.Ring.Rat", "Mathlib.Data.Fintype.BigOperators", "Mathlib.Data.ZMod.Basic" ]
Mathlib/RingTheory/WittVector/WittPolynomial.lean
constantCoeff_wittPolynomial
null
wittPolynomial_zero : wittPolynomial p R 0 = X 0 := by simp only [wittPolynomial, X, sum_singleton, range_one, pow_zero, zero_add, tsub_self] @[simp]
theorem
RingTheory
[ "Mathlib.Algebra.CharP.Invertible", "Mathlib.Algebra.MvPolynomial.Variables", "Mathlib.Algebra.MvPolynomial.CommRing", "Mathlib.Algebra.MvPolynomial.Expand", "Mathlib.Algebra.Order.Ring.Rat", "Mathlib.Data.Fintype.BigOperators", "Mathlib.Data.ZMod.Basic" ]
Mathlib/RingTheory/WittVector/WittPolynomial.lean
wittPolynomial_zero
null
wittPolynomial_one : wittPolynomial p R 1 = C (p : R) * X 1 + X 0 ^ p := by simp only [wittPolynomial_eq_sum_C_mul_X_pow, sum_range_succ_comm, range_one, sum_singleton, one_mul, pow_one, C_1, pow_zero, tsub_self, tsub_zero]
theorem
RingTheory
[ "Mathlib.Algebra.CharP.Invertible", "Mathlib.Algebra.MvPolynomial.Variables", "Mathlib.Algebra.MvPolynomial.CommRing", "Mathlib.Algebra.MvPolynomial.Expand", "Mathlib.Algebra.Order.Ring.Rat", "Mathlib.Data.Fintype.BigOperators", "Mathlib.Data.ZMod.Basic" ]
Mathlib/RingTheory/WittVector/WittPolynomial.lean
wittPolynomial_one
null
aeval_wittPolynomial {A : Type*} [CommRing A] [Algebra R A] (f : ℕ → A) (n : ℕ) : aeval f (W_ R n) = ∑ i ∈ range (n + 1), (p : A) ^ i * f i ^ p ^ (n - i) := by simp [wittPolynomial, map_sum, aeval_monomial, Finsupp.prod_single_index]
theorem
RingTheory
[ "Mathlib.Algebra.CharP.Invertible", "Mathlib.Algebra.MvPolynomial.Variables", "Mathlib.Algebra.MvPolynomial.CommRing", "Mathlib.Algebra.MvPolynomial.Expand", "Mathlib.Algebra.Order.Ring.Rat", "Mathlib.Data.Fintype.BigOperators", "Mathlib.Data.ZMod.Basic" ]
Mathlib/RingTheory/WittVector/WittPolynomial.lean
aeval_wittPolynomial
null
@[simp] wittPolynomial_zmod_self (n : ℕ) : W_ (ZMod (p ^ (n + 1))) (n + 1) = expand p (W_ (ZMod (p ^ (n + 1))) n) := by simp only [wittPolynomial_eq_sum_C_mul_X_pow] rw [sum_range_succ, ← Nat.cast_pow, CharP.cast_eq_zero (ZMod (p ^ (n + 1))) (p ^ (n + 1)), C_0, zero_mul, add_zero, map_sum, sum_congr rfl] intro k hk rw [map_mul (expand p), map_pow (expand p), expand_X, algHom_C, ← pow_mul, ← pow_succ'] congr rw [mem_range] at hk rw [add_comm, add_tsub_assoc_of_le (Nat.lt_succ_iff.mp hk), ← add_comm]
theorem
RingTheory
[ "Mathlib.Algebra.CharP.Invertible", "Mathlib.Algebra.MvPolynomial.Variables", "Mathlib.Algebra.MvPolynomial.CommRing", "Mathlib.Algebra.MvPolynomial.Expand", "Mathlib.Algebra.Order.Ring.Rat", "Mathlib.Data.Fintype.BigOperators", "Mathlib.Data.ZMod.Basic" ]
Mathlib/RingTheory/WittVector/WittPolynomial.lean
wittPolynomial_zmod_self
Over the ring `ZMod (p^(n+1))`, we produce the `n+1`st Witt polynomial by expanding the `n`th Witt polynomial by `p`.
wittPolynomial_vars [CharZero R] (n : ℕ) : (wittPolynomial p R n).vars = range (n + 1) := by have : ∀ i, (monomial (Finsupp.single i (p ^ (n - i))) ((p : R) ^ i)).vars = {i} := by intro i refine vars_monomial_single i (pow_ne_zero _ hp.1) ?_ rw [← Nat.cast_pow, Nat.cast_ne_zero] exact pow_ne_zero i hp.1 rw [wittPolynomial, vars_sum_of_disjoint] · simp only [this, biUnion_singleton_eq_self] · simp only [this] intro a b h apply disjoint_singleton_left.mpr rwa [mem_singleton]
theorem
RingTheory
[ "Mathlib.Algebra.CharP.Invertible", "Mathlib.Algebra.MvPolynomial.Variables", "Mathlib.Algebra.MvPolynomial.CommRing", "Mathlib.Algebra.MvPolynomial.Expand", "Mathlib.Algebra.Order.Ring.Rat", "Mathlib.Data.Fintype.BigOperators", "Mathlib.Data.ZMod.Basic" ]
Mathlib/RingTheory/WittVector/WittPolynomial.lean
wittPolynomial_vars
null
wittPolynomial_vars_subset (n : ℕ) : (wittPolynomial p R n).vars ⊆ range (n + 1) := by rw [← map_wittPolynomial p (Int.castRingHom R), ← wittPolynomial_vars p ℤ] apply vars_map
theorem
RingTheory
[ "Mathlib.Algebra.CharP.Invertible", "Mathlib.Algebra.MvPolynomial.Variables", "Mathlib.Algebra.MvPolynomial.CommRing", "Mathlib.Algebra.MvPolynomial.Expand", "Mathlib.Algebra.Order.Ring.Rat", "Mathlib.Data.Fintype.BigOperators", "Mathlib.Data.ZMod.Basic" ]
Mathlib/RingTheory/WittVector/WittPolynomial.lean
wittPolynomial_vars_subset
null
noncomputable xInTermsOfW [Invertible (p : R)] : ℕ → MvPolynomial ℕ R | n => (X n - ∑ i : Fin n, C ((p : R) ^ (i : ℕ)) * xInTermsOfW i ^ p ^ (n - (i : ℕ))) * C ((⅟p : R) ^ n)
def
RingTheory
[ "Mathlib.Algebra.CharP.Invertible", "Mathlib.Algebra.MvPolynomial.Variables", "Mathlib.Algebra.MvPolynomial.CommRing", "Mathlib.Algebra.MvPolynomial.Expand", "Mathlib.Algebra.Order.Ring.Rat", "Mathlib.Data.Fintype.BigOperators", "Mathlib.Data.ZMod.Basic" ]
Mathlib/RingTheory/WittVector/WittPolynomial.lean
xInTermsOfW
The `xInTermsOfW p R n` is the polynomial on the basis of Witt polynomials that corresponds to the ordinary `X n`.
xInTermsOfW_eq [Invertible (p : R)] {n : ℕ} : xInTermsOfW p R n = (X n - ∑ i ∈ range n, C ((p : R) ^ i) * xInTermsOfW p R i ^ p ^ (n - i)) * C ((⅟p : R) ^ n) := by rw [xInTermsOfW, ← Fin.sum_univ_eq_sum_range] @[simp]
theorem
RingTheory
[ "Mathlib.Algebra.CharP.Invertible", "Mathlib.Algebra.MvPolynomial.Variables", "Mathlib.Algebra.MvPolynomial.CommRing", "Mathlib.Algebra.MvPolynomial.Expand", "Mathlib.Algebra.Order.Ring.Rat", "Mathlib.Data.Fintype.BigOperators", "Mathlib.Data.ZMod.Basic" ]
Mathlib/RingTheory/WittVector/WittPolynomial.lean
xInTermsOfW_eq
null
constantCoeff_xInTermsOfW [hp : Fact p.Prime] [Invertible (p : R)] (n : ℕ) : constantCoeff (xInTermsOfW p R n) = 0 := by induction n using Nat.strongRecOn with | ind n IH => ?_ rw [xInTermsOfW_eq, mul_comm, RingHom.map_mul, RingHom.map_sub, map_sum, constantCoeff_C, constantCoeff_X, zero_sub, mul_neg, neg_eq_zero, sum_eq_zero, mul_zero] intro m H rw [mem_range] at H simp only [RingHom.map_mul, RingHom.map_pow, map_natCast, IH m H] rw [zero_pow, mul_zero] exact pow_ne_zero _ hp.1.ne_zero @[simp]
theorem
RingTheory
[ "Mathlib.Algebra.CharP.Invertible", "Mathlib.Algebra.MvPolynomial.Variables", "Mathlib.Algebra.MvPolynomial.CommRing", "Mathlib.Algebra.MvPolynomial.Expand", "Mathlib.Algebra.Order.Ring.Rat", "Mathlib.Data.Fintype.BigOperators", "Mathlib.Data.ZMod.Basic" ]
Mathlib/RingTheory/WittVector/WittPolynomial.lean
constantCoeff_xInTermsOfW
null
xInTermsOfW_zero [Invertible (p : R)] : xInTermsOfW p R 0 = X 0 := by rw [xInTermsOfW_eq, range_zero, sum_empty, pow_zero, C_1, mul_one, sub_zero]
theorem
RingTheory
[ "Mathlib.Algebra.CharP.Invertible", "Mathlib.Algebra.MvPolynomial.Variables", "Mathlib.Algebra.MvPolynomial.CommRing", "Mathlib.Algebra.MvPolynomial.Expand", "Mathlib.Algebra.Order.Ring.Rat", "Mathlib.Data.Fintype.BigOperators", "Mathlib.Data.ZMod.Basic" ]
Mathlib/RingTheory/WittVector/WittPolynomial.lean
xInTermsOfW_zero
null
xInTermsOfW_vars_aux (n : ℕ) : n ∈ (xInTermsOfW p ℚ n).vars ∧ (xInTermsOfW p ℚ n).vars ⊆ range (n + 1) := by induction n using Nat.strongRecOn with | ind n ih => ?_ rw [xInTermsOfW_eq, mul_comm, vars_C_mul _ (Invertible.ne_zero _), vars_sub_of_disjoint, vars_X, range_add_one, insert_eq] on_goal 1 => simp only [true_and, true_or, mem_union, mem_singleton] intro i rw [mem_union, mem_union] apply Or.imp id on_goal 2 => rw [vars_X, disjoint_singleton_left] all_goals intro H replace H := vars_sum_subset _ _ H rw [mem_biUnion] at H rcases H with ⟨j, hj, H⟩ rw [vars_C_mul] at H swap · apply pow_ne_zero exact mod_cast hp.1.ne_zero rw [mem_range] at hj replace H := (ih j hj).2 (vars_pow _ _ H) rw [mem_range] at H · rw [mem_range] cutsat · cutsat
theorem
RingTheory
[ "Mathlib.Algebra.CharP.Invertible", "Mathlib.Algebra.MvPolynomial.Variables", "Mathlib.Algebra.MvPolynomial.CommRing", "Mathlib.Algebra.MvPolynomial.Expand", "Mathlib.Algebra.Order.Ring.Rat", "Mathlib.Data.Fintype.BigOperators", "Mathlib.Data.ZMod.Basic" ]
Mathlib/RingTheory/WittVector/WittPolynomial.lean
xInTermsOfW_vars_aux
null
xInTermsOfW_vars_subset (n : ℕ) : (xInTermsOfW p ℚ n).vars ⊆ range (n + 1) := (xInTermsOfW_vars_aux p n).2
theorem
RingTheory
[ "Mathlib.Algebra.CharP.Invertible", "Mathlib.Algebra.MvPolynomial.Variables", "Mathlib.Algebra.MvPolynomial.CommRing", "Mathlib.Algebra.MvPolynomial.Expand", "Mathlib.Algebra.Order.Ring.Rat", "Mathlib.Data.Fintype.BigOperators", "Mathlib.Data.ZMod.Basic" ]
Mathlib/RingTheory/WittVector/WittPolynomial.lean
xInTermsOfW_vars_subset
null
xInTermsOfW_aux [Invertible (p : R)] (n : ℕ) : xInTermsOfW p R n * C ((p : R) ^ n) = X n - ∑ i ∈ range n, C ((p : R) ^ i) * xInTermsOfW p R i ^ p ^ (n - i) := by rw [xInTermsOfW_eq, mul_assoc, ← C_mul, ← mul_pow, invOf_mul_self, one_pow, C_1, mul_one] @[simp]
theorem
RingTheory
[ "Mathlib.Algebra.CharP.Invertible", "Mathlib.Algebra.MvPolynomial.Variables", "Mathlib.Algebra.MvPolynomial.CommRing", "Mathlib.Algebra.MvPolynomial.Expand", "Mathlib.Algebra.Order.Ring.Rat", "Mathlib.Data.Fintype.BigOperators", "Mathlib.Data.ZMod.Basic" ]
Mathlib/RingTheory/WittVector/WittPolynomial.lean
xInTermsOfW_aux
null
bind₁_xInTermsOfW_wittPolynomial [Invertible (p : R)] (k : ℕ) : bind₁ (xInTermsOfW p R) (W_ R k) = X k := by rw [wittPolynomial_eq_sum_C_mul_X_pow, map_sum] simp only [map_pow, map_mul, algHom_C, algebraMap_eq] rw [sum_range_succ_comm, tsub_self, pow_zero, pow_one, bind₁_X_right, mul_comm, ← C_pow, xInTermsOfW_aux] simp only [C_pow, bind₁_X_right, sub_add_cancel] @[simp]
theorem
RingTheory
[ "Mathlib.Algebra.CharP.Invertible", "Mathlib.Algebra.MvPolynomial.Variables", "Mathlib.Algebra.MvPolynomial.CommRing", "Mathlib.Algebra.MvPolynomial.Expand", "Mathlib.Algebra.Order.Ring.Rat", "Mathlib.Data.Fintype.BigOperators", "Mathlib.Data.ZMod.Basic" ]
Mathlib/RingTheory/WittVector/WittPolynomial.lean
bind₁_xInTermsOfW_wittPolynomial
null
bind₁_wittPolynomial_xInTermsOfW [Invertible (p : R)] (n : ℕ) : bind₁ (W_ R) (xInTermsOfW p R n) = X n := by induction n using Nat.strongRecOn with | ind n H => ?_ rw [xInTermsOfW_eq, map_mul, map_sub, bind₁_X_right, algHom_C, map_sum, show X n = (X n * C ((p : R) ^ n)) * C ((⅟p : R) ^ n) by rw [mul_assoc, ← C_mul, ← mul_pow, mul_invOf_self, one_pow, map_one, mul_one]] congr 1 rw [wittPolynomial_eq_sum_C_mul_X_pow, sum_range_succ_comm, tsub_self, pow_zero, pow_one, mul_comm (X n), add_sub_assoc, add_eq_left, sub_eq_zero] apply sum_congr rfl intro i h rw [mem_range] at h rw [map_mul, map_pow (bind₁ _), algHom_C, H i h, algebraMap_eq]
theorem
RingTheory
[ "Mathlib.Algebra.CharP.Invertible", "Mathlib.Algebra.MvPolynomial.Variables", "Mathlib.Algebra.MvPolynomial.CommRing", "Mathlib.Algebra.MvPolynomial.Expand", "Mathlib.Algebra.Order.Ring.Rat", "Mathlib.Data.Fintype.BigOperators", "Mathlib.Data.ZMod.Basic" ]
Mathlib/RingTheory/WittVector/WittPolynomial.lean
bind₁_wittPolynomial_xInTermsOfW
null
rootsOfUnity_eq_top {p : ℕ} [Fact p.Prime] : (rootsOfUnity (p - 1) (ZMod p)) = ⊤ := by ext simpa [Units.ext_iff] using pow_card_sub_one_eq_one (Units.ne_zero _)
lemma
RingTheory
[ "Mathlib.RingTheory.RootsOfUnity.EnoughRootsOfUnity", "Mathlib.FieldTheory.Finite.Basic" ]
Mathlib/RingTheory/ZMod/Torsion.lean
rootsOfUnity_eq_top
null
isCyclic_units_zero : IsCyclic (ZMod 0)ˣ := inferInstance
theorem
RingTheory
[ "Mathlib.Algebra.Order.Star.Basic", "Mathlib.Analysis.Normed.Ring.Lemmas", "Mathlib.Data.Nat.Choose.Dvd", "Mathlib.Data.ZMod.Units", "Mathlib.FieldTheory.Finite.Basic" ]
Mathlib/RingTheory/ZMod/UnitsCyclic.lean
isCyclic_units_zero
null
isCyclic_units_one : IsCyclic (ZMod 1)ˣ := inferInstance
theorem
RingTheory
[ "Mathlib.Algebra.Order.Star.Basic", "Mathlib.Analysis.Normed.Ring.Lemmas", "Mathlib.Data.Nat.Choose.Dvd", "Mathlib.Data.ZMod.Units", "Mathlib.FieldTheory.Finite.Basic" ]
Mathlib/RingTheory/ZMod/UnitsCyclic.lean
isCyclic_units_one
null
isCyclic_units_two : IsCyclic (ZMod 2)ˣ := inferInstance
theorem
RingTheory
[ "Mathlib.Algebra.Order.Star.Basic", "Mathlib.Analysis.Normed.Ring.Lemmas", "Mathlib.Data.Nat.Choose.Dvd", "Mathlib.Data.ZMod.Units", "Mathlib.FieldTheory.Finite.Basic" ]
Mathlib/RingTheory/ZMod/UnitsCyclic.lean
isCyclic_units_two
null
isCyclic_units_four : IsCyclic (ZMod 4)ˣ := by apply isCyclic_of_prime_card (p := 2) simp only [Nat.card_eq_fintype_card, card_units_eq_totient] decide /- The multiplicative group of `ZMod p` is cyclic. -/
theorem
RingTheory
[ "Mathlib.Algebra.Order.Star.Basic", "Mathlib.Analysis.Normed.Ring.Lemmas", "Mathlib.Data.Nat.Choose.Dvd", "Mathlib.Data.ZMod.Units", "Mathlib.FieldTheory.Finite.Basic" ]
Mathlib/RingTheory/ZMod/UnitsCyclic.lean
isCyclic_units_four
null
isCyclic_units_prime {p : ℕ} (hp : p.Prime) : IsCyclic (ZMod p)ˣ := have : Fact (p.Prime) := ⟨hp⟩ inferInstance
theorem
RingTheory
[ "Mathlib.Algebra.Order.Star.Basic", "Mathlib.Analysis.Normed.Ring.Lemmas", "Mathlib.Data.Nat.Choose.Dvd", "Mathlib.Data.ZMod.Units", "Mathlib.FieldTheory.Finite.Basic" ]
Mathlib/RingTheory/ZMod/UnitsCyclic.lean
isCyclic_units_prime
null
not_isCyclic_units_eight : ¬ IsCyclic (ZMod 8)ˣ := by rw [IsCyclic.iff_exponent_eq_card, Nat.card_eq_fintype_card, card_units_eq_totient] have h : Monoid.exponent (ZMod 8)ˣ ∣ 2 := Monoid.exponent_dvd_of_forall_pow_eq_one (by decide) intro (h' : Monoid.exponent (ZMod 8)ˣ = 4) simp [h'] at h
theorem
RingTheory
[ "Mathlib.Algebra.Order.Star.Basic", "Mathlib.Analysis.Normed.Ring.Lemmas", "Mathlib.Data.Nat.Choose.Dvd", "Mathlib.Data.ZMod.Units", "Mathlib.FieldTheory.Finite.Basic" ]
Mathlib/RingTheory/ZMod/UnitsCyclic.lean
not_isCyclic_units_eight
null
exists_one_add_mul_pow_prime_eq (hp : p.Prime) (hvu : v ∣ u) (hpuv : p * u * v ∣ u ^ p) (x : R) : ∃ y, (1 + u * x) ^ p = 1 + p * u * (x + v * y) := by rw [add_comm, add_pow] rw [← Finset.add_sum_erase (a := 0) _ _ (by simp)] simp_rw [one_pow, pow_zero, Nat.choose_zero_right, Nat.cast_one, mul_one] rw [← Finset.add_sum_erase (a := 1) _ _ (by simp [hp.pos])] rw [← Finset.sum_erase_add (a := p) _ _ (by -- aesop works but is slow simp only [Finset.mem_erase] rw [← and_assoc, and_comm (a := ¬ _), ← Nat.two_le_iff] simp [hp.two_le])] obtain ⟨a, ha⟩ := hvu obtain ⟨b, hb⟩ := hpuv use a * x ^ 2 * ∑ i ∈ (((Finset.range (p + 1)).erase 0).erase 1).erase p, (u * x) ^ (i - 2) * (p.choose i / p : ℕ) + b * x ^ p rw [mul_add] congr 2 · rw [Nat.choose_one_right]; ring simp only [mul_add, Finset.mul_sum] congr 1 · congr! 1 with i hi simp only [Finset.mem_erase, ne_eq, Finset.mem_range] at hi have hi' : 2 ≤ i := by omega calc (u * x) ^ i * p.choose i = (u * x) ^ (2 + (i - 2)) * p.choose i := by rw [Nat.add_sub_of_le hi'] _ = u ^ 2 * x ^ 2 * (u * x) ^ (i - 2) * p.choose i := by ring_nf _ = u ^ 2 * x ^ 2 * (u * x) ^ (i - 2) * (p * (p.choose i / p) : ℕ) := by rw [Nat.mul_div_cancel' (hp.dvd_choose_self hi.2.2.1 <| by cutsat)] _ = u ^ 2 * x ^ 2 * (u * x) ^ (i - 2) * p * (p.choose i / p : ℕ) := by simp only [Nat.cast_mul]; ring_nf _ = p * u * (v * (a * x ^ 2 * ((u * x) ^ (i - 2) * (p.choose i / p : ℕ)))) := by rw [ha]; ring · calc (u * x) ^ p * (p.choose p) = u ^ p * x ^ p := by simp [Nat.choose_self, mul_pow] _ = p * u * v * b * x ^ p := by rw [hb] _ = p * u * (v * (b * x ^ p)) := by ring_nf
lemma
RingTheory
[ "Mathlib.Algebra.Order.Star.Basic", "Mathlib.Analysis.Normed.Ring.Lemmas", "Mathlib.Data.Nat.Choose.Dvd", "Mathlib.Data.ZMod.Units", "Mathlib.FieldTheory.Finite.Basic" ]
Mathlib/RingTheory/ZMod/UnitsCyclic.lean
exists_one_add_mul_pow_prime_eq
null
exists_one_add_mul_pow_prime_pow_eq {u v : R} (hp : p.Prime) (hvu : v ∣ u) (hpuv : p * u * v ∣ u ^ p) (x : R) (m : ℕ) : ∃ y, (1 + u * x) ^ (p ^ m) = 1 + p ^ m * u * (x + v * y) := match m with | 0 => ⟨0, by simp⟩ | m + 1 => by rw [pow_succ', pow_mul] obtain ⟨y, hy⟩ := exists_one_add_mul_pow_prime_eq hp hvu hpuv x rw [hy] obtain ⟨z, hz⟩ := exists_one_add_mul_pow_prime_pow_eq (u := p * u) (v := p * v) hp (mul_dvd_mul_left _ hvu) (by rw [mul_pow] simp only [← mul_assoc] rw [mul_assoc, mul_assoc, ← mul_assoc u, mul_comm u] apply mul_dvd_mul _ hpuv rw [← pow_two] exact pow_dvd_pow _ hp.two_le) (x + v * y) m use y + p * z rw [hz] ring
lemma
RingTheory
[ "Mathlib.Algebra.Order.Star.Basic", "Mathlib.Analysis.Normed.Ring.Lemmas", "Mathlib.Data.Nat.Choose.Dvd", "Mathlib.Data.ZMod.Units", "Mathlib.FieldTheory.Finite.Basic" ]
Mathlib/RingTheory/ZMod/UnitsCyclic.lean
exists_one_add_mul_pow_prime_pow_eq
null
orderOf_one_add_mul_prime_pow {p : ℕ} (hp : p.Prime) (m : ℕ) (hm0 : m ≠ 0) (hpm : m + 2 ≤ p * m) (a : ℤ) (ha : ¬ (p : ℤ) ∣ a) (n : ℕ) : orderOf (1 + p ^ m * a : ZMod (p ^ (n + m))) = p ^ n := by match n with | 0 => rw [← Nat.cast_pow, zero_add m, ZMod.natCast_self]; simp | n + 1 => have := Fact.mk hp have := exists_one_add_mul_pow_prime_pow_eq (R := ZMod (p ^ (n + 1 + m))) (u := p ^ m) (v := p) hp (dvd_pow_self _ hm0) ?_ a · apply orderOf_eq_prime_pow · obtain ⟨y, hy⟩ := this n rw [hy, ← pow_add, add_eq_left, mul_add, ← mul_assoc, ← pow_succ] simp_rw [add_right_comm n _ 1, ← Nat.cast_pow, ZMod.natCast_self, zero_mul, add_zero] rwa [← Int.cast_natCast, ← Int.cast_mul, ZMod.intCast_zmod_eq_zero_iff_dvd, add_right_comm, pow_succ, Nat.cast_mul, Int.mul_dvd_mul_iff_left (by simp [hp.ne_zero])] · obtain ⟨y, hy⟩ := this (n + 1) rw [hy, ← pow_add, ← Nat.cast_pow] simp · rw [← pow_succ', ← pow_succ, ← pow_mul, mul_comm] exact pow_dvd_pow _ hpm
theorem
RingTheory
[ "Mathlib.Algebra.Order.Star.Basic", "Mathlib.Analysis.Normed.Ring.Lemmas", "Mathlib.Data.Nat.Choose.Dvd", "Mathlib.Data.ZMod.Units", "Mathlib.FieldTheory.Finite.Basic" ]
Mathlib/RingTheory/ZMod/UnitsCyclic.lean
orderOf_one_add_mul_prime_pow
null
orderOf_one_add_mul_prime {p : ℕ} (hp : p.Prime) (hp2 : p ≠ 2) (a : ℤ) (ha : ¬ (p : ℤ) ∣ a) (n : ℕ) : orderOf (1 + p * a : ZMod (p ^ (n + 1))) = p ^ n := by convert orderOf_one_add_mul_prime_pow hp 1 one_ne_zero _ a ha n using 1 · rw [pow_one] · have := hp.two_le; cutsat
theorem
RingTheory
[ "Mathlib.Algebra.Order.Star.Basic", "Mathlib.Analysis.Normed.Ring.Lemmas", "Mathlib.Data.Nat.Choose.Dvd", "Mathlib.Data.ZMod.Units", "Mathlib.FieldTheory.Finite.Basic" ]
Mathlib/RingTheory/ZMod/UnitsCyclic.lean
orderOf_one_add_mul_prime
null
orderOf_one_add_prime {p : ℕ} (hp : p.Prime) (hp2 : p ≠ 2) (n : ℕ) : orderOf (1 + p : ZMod (p ^ (n + 1))) = p ^ n := by convert orderOf_one_add_mul_prime hp hp2 1 _ n · simp · intro H apply hp.ne_one simpa using Int.eq_one_of_dvd_one (Int.natCast_nonneg p) H
theorem
RingTheory
[ "Mathlib.Algebra.Order.Star.Basic", "Mathlib.Analysis.Normed.Ring.Lemmas", "Mathlib.Data.Nat.Choose.Dvd", "Mathlib.Data.ZMod.Units", "Mathlib.FieldTheory.Finite.Basic" ]
Mathlib/RingTheory/ZMod/UnitsCyclic.lean
orderOf_one_add_prime
null
isCyclic_units_of_prime_pow (p : ℕ) (hp : p.Prime) (hp2 : p ≠ 2) (n : ℕ) : IsCyclic (ZMod (p ^ n))ˣ := by have _ : NeZero (p ^ n) := ⟨pow_ne_zero n hp.ne_zero⟩ have := Fact.mk hp rcases n with _ | n · rw [pow_zero]; infer_instance set a := (1 + p : ZMod (p ^ (n + 1))) with ha_def have ha : IsUnit a := by rw [ha_def, ← Nat.cast_one (R := ZMod _), ← Nat.cast_add, ZMod.isUnit_iff_coprime] apply Nat.Coprime.pow_right simp only [Nat.coprime_add_self_left, Nat.coprime_one_left_eq_true] have ha' : orderOf ha.unit = p ^ n := by rw [← orderOf_injective _ Units.coeHom_injective ha.unit, Units.coeHom_apply, IsUnit.unit_spec] exact orderOf_one_add_prime hp hp2 n obtain ⟨c, hc⟩ := isCyclic_iff_exists_orderOf_eq_natCard.mp (isCyclic_units_prime hp) rw [Nat.card_eq_fintype_card, ZMod.card_units] at hc obtain ⟨(b : (ZMod (p ^ (n + 1)))ˣ), rfl⟩ := ZMod.unitsMap_surjective (Dvd.intro_left (p ^ n) rfl) c have : p - 1 ∣ orderOf b := hc ▸ orderOf_map_dvd _ b let k := orderOf b / (p - 1) have : orderOf (b ^ k) = p - 1 := orderOf_pow_orderOf_div (orderOf_pos b).ne' this rw [isCyclic_iff_exists_orderOf_eq_natCard] use ha.unit * b ^ k rw [(Commute.all _ _).orderOf_mul_eq_mul_orderOf_of_coprime, this, Nat.card_eq_fintype_card, ZMod.card_units_eq_totient, Nat.totient_prime_pow_succ hp, ← ha'] rw [ha', this] apply Nat.Coprime.pow_left rw [Nat.coprime_self_sub_right hp.pos] simp
theorem
RingTheory
[ "Mathlib.Algebra.Order.Star.Basic", "Mathlib.Analysis.Normed.Ring.Lemmas", "Mathlib.Data.Nat.Choose.Dvd", "Mathlib.Data.ZMod.Units", "Mathlib.FieldTheory.Finite.Basic" ]
Mathlib/RingTheory/ZMod/UnitsCyclic.lean
isCyclic_units_of_prime_pow
If `p` is an odd prime, then `(ZMod (p ^ n))ˣ` is cyclic for all n
isCyclic_units_two_pow_iff (n : ℕ) : IsCyclic (ZMod (2 ^ n))ˣ ↔ n ≤ 2 := by match n with | 0 => simp [isCyclic_units_one] | 1 => simp [isCyclic_units_prime Nat.prime_two] | 2 => simp [isCyclic_units_four] | n + 3 => simp only [Nat.reduceLeDiff, iff_false] intro H apply not_isCyclic_units_eight have h : 2 ^ 3 ∣ 2 ^ (n + 3) := pow_dvd_pow _ (by cutsat) exact isCyclic_of_surjective _ (unitsMap_surjective h)
theorem
RingTheory
[ "Mathlib.Algebra.Order.Star.Basic", "Mathlib.Analysis.Normed.Ring.Lemmas", "Mathlib.Data.Nat.Choose.Dvd", "Mathlib.Data.ZMod.Units", "Mathlib.FieldTheory.Finite.Basic" ]
Mathlib/RingTheory/ZMod/UnitsCyclic.lean
isCyclic_units_two_pow_iff
null
orderOf_one_add_four_mul (a : ℤ) (ha : Odd a) (n : ℕ) : orderOf (1 + 4 * a : ZMod (2 ^ (n + 2))) = 2 ^ n := by convert orderOf_one_add_mul_prime_pow Nat.prime_two 2 two_ne_zero le_rfl a ?_ n using 1 · norm_num · rwa [← Int.not_even_iff_odd, even_iff_two_dvd] at ha
lemma
RingTheory
[ "Mathlib.Algebra.Order.Star.Basic", "Mathlib.Analysis.Normed.Ring.Lemmas", "Mathlib.Data.Nat.Choose.Dvd", "Mathlib.Data.ZMod.Units", "Mathlib.FieldTheory.Finite.Basic" ]
Mathlib/RingTheory/ZMod/UnitsCyclic.lean
orderOf_one_add_four_mul
null
orderOf_five (n : ℕ) : orderOf (5 : ZMod (2 ^ (n + 2))) = 2 ^ n := by convert orderOf_one_add_four_mul 1 (by simp) n norm_num
theorem
RingTheory
[ "Mathlib.Algebra.Order.Star.Basic", "Mathlib.Analysis.Normed.Ring.Lemmas", "Mathlib.Data.Nat.Choose.Dvd", "Mathlib.Data.ZMod.Units", "Mathlib.FieldTheory.Finite.Basic" ]
Mathlib/RingTheory/ZMod/UnitsCyclic.lean
orderOf_five
null
isCyclic_units_four_mul_iff (n : ℕ) : IsCyclic (ZMod (4 * n))ˣ ↔ n = 0 ∨ n = 1 := by obtain rfl | hn0 := eq_or_ne n 0 · simp [isCyclic_units_zero] obtain rfl | hn1 := eq_or_ne n 1 · simp [isCyclic_units_four] refine iff_of_false ?_ (by simp [hn0, hn1]) obtain ⟨n, rfl⟩ | h2n := em (2 ∣ n) · rw [← mul_assoc] have : NeZero n := ⟨by simpa using hn0⟩ refine mt (fun _ ↦ ?_) not_isCyclic_units_eight exact isCyclic_of_surjective _ (ZMod.unitsMap_surjective (m := 4 * 2 * n) (dvd_mul_right 8 _)) have : Nat.Coprime 4 n := (Nat.prime_two.coprime_iff_not_dvd.mpr h2n).pow_left 2 rw [((Units.mapEquiv (chineseRemainder this).toMulEquiv).trans .prodUnits).isCyclic, Group.isCyclic_prod_iff] rintro ⟨-, -, h⟩ have : NeZero n := ⟨hn0⟩ have : Odd (φ n) := by simpa [show φ 4 = 2 from rfl] using h rw [Nat.odd_totient_iff] at this cutsat
theorem
RingTheory
[ "Mathlib.Algebra.Order.Star.Basic", "Mathlib.Analysis.Normed.Ring.Lemmas", "Mathlib.Data.Nat.Choose.Dvd", "Mathlib.Data.ZMod.Units", "Mathlib.FieldTheory.Finite.Basic" ]
Mathlib/RingTheory/ZMod/UnitsCyclic.lean
isCyclic_units_four_mul_iff
null
isCyclic_units_two_mul_iff_of_odd (n : ℕ) (hn : Odd n) : IsCyclic (ZMod (2 * n))ˣ ↔ IsCyclic (ZMod n)ˣ := by simp [((Units.mapEquiv (chineseRemainder <| Nat.coprime_two_left.mpr hn).toMulEquiv).trans .prodUnits).isCyclic, Group.isCyclic_prod_iff, isCyclic_units_two]
theorem
RingTheory
[ "Mathlib.Algebra.Order.Star.Basic", "Mathlib.Analysis.Normed.Ring.Lemmas", "Mathlib.Data.Nat.Choose.Dvd", "Mathlib.Data.ZMod.Units", "Mathlib.FieldTheory.Finite.Basic" ]
Mathlib/RingTheory/ZMod/UnitsCyclic.lean
isCyclic_units_two_mul_iff_of_odd
null
not_isCyclic_units_of_mul_coprime (m n : ℕ) (hm : Odd m) (hm1 : m ≠ 1) (hn : Odd n) (hn1 : n ≠ 1) (hmn : m.Coprime n) : ¬ IsCyclic (ZMod (m * n))ˣ := by classical have _ : NeZero m := ⟨Nat.ne_of_odd_add hm⟩ have _ : NeZero n := ⟨Nat.ne_of_odd_add hn⟩ let e := (Units.mapEquiv (chineseRemainder hmn).toMulEquiv).trans .prodUnits rw [e.isCyclic, Group.isCyclic_prod_iff] rintro ⟨-, -, h⟩ simp_rw [Nat.card_eq_fintype_card, card_units_eq_totient, Nat.totient_coprime_totient_iff, hm1, hn1, false_or] at h rcases h with (rfl | rfl) · simp [← Nat.not_even_iff_odd] at hm · simp [← Nat.not_even_iff_odd] at hn
theorem
RingTheory
[ "Mathlib.Algebra.Order.Star.Basic", "Mathlib.Analysis.Normed.Ring.Lemmas", "Mathlib.Data.Nat.Choose.Dvd", "Mathlib.Data.ZMod.Units", "Mathlib.FieldTheory.Finite.Basic" ]
Mathlib/RingTheory/ZMod/UnitsCyclic.lean
not_isCyclic_units_of_mul_coprime
null
isCyclic_units_iff_of_odd {n : ℕ} (hn : Odd n) : IsCyclic (ZMod n)ˣ ↔ ∃ (p m : ℕ), p.Prime ∧ Odd p ∧ n = p ^ m := by have hn0 : n ≠ 0 := by rintro rfl; exact Nat.not_odd_zero hn obtain rfl | h1 := eq_or_ne n 1 · simp_rw [isCyclic_units_one, true_iff] exact ⟨3, 0, Nat.prime_three, by simp [Nat.odd_iff], by rw [pow_zero]⟩ have ⟨p, hp, dvd⟩ := n.exists_prime_and_dvd h1 have odd := hn.of_dvd_nat dvd by_cases hnp : n = p ^ n.factorization p · exact hnp ▸ iff_of_true (isCyclic_units_of_prime_pow p hp (odd.ne_two_of_dvd_nat dvd_rfl) _) ⟨p, _, hp, odd, rfl⟩ refine iff_of_false ?_ (mt ?_ hnp) · have := n.ordProj_dvd p rw [← Nat.mul_div_cancel' this] refine not_isCyclic_units_of_mul_coprime _ _ (hn.of_dvd_nat this) ?_ (hn.of_dvd_nat (Nat.div_dvd_of_dvd this)) ?_ ((Nat.coprime_ordCompl hp hn0).pow_left ..) · simpa only [Ne, pow_eq_one_iff (hp.factorization_pos_of_dvd hn0 dvd).ne'] using hp.ne_one · contrapose! hnp conv_lhs => rw [← Nat.div_mul_cancel this, hnp, one_mul] rintro ⟨q, m, hq, -, rfl⟩ cases (Nat.prime_dvd_prime_iff_eq hp hq).mp (hp.dvd_of_dvd_pow dvd) simp [hp.factorization_self] at hnp
theorem
RingTheory
[ "Mathlib.Algebra.Order.Star.Basic", "Mathlib.Analysis.Normed.Ring.Lemmas", "Mathlib.Data.Nat.Choose.Dvd", "Mathlib.Data.ZMod.Units", "Mathlib.FieldTheory.Finite.Basic" ]
Mathlib/RingTheory/ZMod/UnitsCyclic.lean
isCyclic_units_iff_of_odd
null
isCyclic_units_iff (n : ℕ) : IsCyclic (ZMod n)ˣ ↔ n = 0 ∨ n = 1 ∨ n = 2 ∨ n = 4 ∨ ∃ (p m : ℕ), p.Prime ∧ Odd p ∧ 1 ≤ m ∧ (n = p ^ m ∨ n = 2 * p ^ m) := by by_cases h0 : n = 0 · rw [h0]; simp [isCyclic_units_zero] by_cases h1 : n = 1 · rw [h1]; simp [isCyclic_units_one] by_cases h2 : n = 2 · rw [h2]; simp [isCyclic_units_two] by_cases h4 : n = 4 · rw [h4]; simp [isCyclic_units_four] simp only [h0, h1, h2, h4, false_or, and_or_left, exists_or] rcases (n.even_or_odd).symm with hn | hn · rw [isCyclic_units_iff_of_odd hn, or_iff_left] · congr! with p m rw [and_iff_right_of_imp] rintro rfl contrapose! h1 cases Nat.lt_one_iff.mp h1 apply pow_zero · rintro ⟨p, m, -, -, -, rfl⟩ simp [← Nat.not_even_iff_odd] at hn obtain ⟨n, rfl⟩ := hn.two_dvd rcases (n.even_or_odd).symm with hn | hn · rw [isCyclic_units_two_mul_iff_of_odd _ hn, isCyclic_units_iff_of_odd hn, or_iff_right] · congr! with p m rw [Nat.mul_left_cancel_iff zero_lt_two, and_iff_right_of_imp] rintro rfl contrapose! h2 cases Nat.lt_one_iff.mp h2 rw [pow_zero, mul_one] · rintro ⟨p, m, -, odd, -, eq⟩ have := eq ▸ odd.pow simp [← Nat.not_even_iff_odd] at this obtain ⟨n, rfl⟩ := hn.two_dvd apply iff_of_false · rw [← mul_assoc, show 2 * 2 = 4 from rfl, isCyclic_units_four_mul_iff] cutsat rintro (⟨p, m, -, odd, -, eq⟩ | ⟨p, m, -, odd, -, eq⟩) on_goal 1 => have := eq ▸ odd.pow on_goal 2 => have := (Nat.mul_left_cancel_iff zero_lt_two).mp eq ▸ odd.pow all_goals simp [← Nat.not_even_iff_odd] at this
theorem
RingTheory
[ "Mathlib.Algebra.Order.Star.Basic", "Mathlib.Analysis.Normed.Ring.Lemmas", "Mathlib.Data.Nat.Choose.Dvd", "Mathlib.Data.ZMod.Units", "Mathlib.FieldTheory.Finite.Basic" ]
Mathlib/RingTheory/ZMod/UnitsCyclic.lean
isCyclic_units_iff
`(ZMod n)ˣ` is cyclic iff `n` is of the form `0`, `1`, `2`, `4`, `p ^ m`, or `2 * p ^ m`, where `p` is an odd prime and `1 ≤ m`.
IsDedekindDomainInv : Prop := ∀ I ≠ (⊥ : FractionalIdeal A⁰ (FractionRing A)), I * I⁻¹ = 1 open FractionalIdeal variable {R A K}
def
RingTheory
[ "Mathlib.Algebra.Algebra.Subalgebra.Pointwise", "Mathlib.RingTheory.DedekindDomain.Basic", "Mathlib.RingTheory.FractionalIdeal.Inverse", "Mathlib.RingTheory.Spectrum.Prime.Basic" ]
Mathlib/RingTheory/DedekindDomain/Ideal/Basic.lean
IsDedekindDomainInv
A Dedekind domain is an integral domain such that every fractional ideal has an inverse. This is equivalent to `IsDedekindDomain`. In particular we provide a `fractional_ideal.comm_group_with_zero` instance, assuming `IsDedekindDomain A`, which implies `IsDedekindDomainInv`. For **integral** ideals, `IsDedekindDomain`(`_inv`) implies only `Ideal.cancelCommMonoidWithZero`.
isDedekindDomainInv_iff [Algebra A K] [IsFractionRing A K] : IsDedekindDomainInv A ↔ ∀ I ≠ (⊥ : FractionalIdeal A⁰ K), I * I⁻¹ = 1 := by let h : FractionalIdeal A⁰ (FractionRing A) ≃+* FractionalIdeal A⁰ K := FractionalIdeal.mapEquiv (FractionRing.algEquiv A K) refine h.toEquiv.forall_congr (fun {x} => ?_) rw [← h.toEquiv.apply_eq_iff_eq] simp [h]
theorem
RingTheory
[ "Mathlib.Algebra.Algebra.Subalgebra.Pointwise", "Mathlib.RingTheory.DedekindDomain.Basic", "Mathlib.RingTheory.FractionalIdeal.Inverse", "Mathlib.RingTheory.Spectrum.Prime.Basic" ]
Mathlib/RingTheory/DedekindDomain/Ideal/Basic.lean
isDedekindDomainInv_iff
null
FractionalIdeal.adjoinIntegral_eq_one_of_isUnit [Algebra A K] [IsFractionRing A K] (x : K) (hx : IsIntegral A x) (hI : IsUnit (adjoinIntegral A⁰ x hx)) : adjoinIntegral A⁰ x hx = 1 := by set I := adjoinIntegral A⁰ x hx have mul_self : IsIdempotentElem I := by apply coeToSubmodule_injective simp only [coe_mul, adjoinIntegral_coe, I] rw [(Algebra.adjoin A {x}).isIdempotentElem_toSubmodule] convert congr_arg (· * I⁻¹) mul_self <;> simp only [(mul_inv_cancel_iff_isUnit K).mpr hI, mul_assoc, mul_one]
theorem
RingTheory
[ "Mathlib.Algebra.Algebra.Subalgebra.Pointwise", "Mathlib.RingTheory.DedekindDomain.Basic", "Mathlib.RingTheory.FractionalIdeal.Inverse", "Mathlib.RingTheory.Spectrum.Prime.Basic" ]
Mathlib/RingTheory/DedekindDomain/Ideal/Basic.lean
FractionalIdeal.adjoinIntegral_eq_one_of_isUnit
null
mul_inv_eq_one {I : FractionalIdeal A⁰ K} (hI : I ≠ 0) : I * I⁻¹ = 1 := isDedekindDomainInv_iff.mp h I hI
theorem
RingTheory
[ "Mathlib.Algebra.Algebra.Subalgebra.Pointwise", "Mathlib.RingTheory.DedekindDomain.Basic", "Mathlib.RingTheory.FractionalIdeal.Inverse", "Mathlib.RingTheory.Spectrum.Prime.Basic" ]
Mathlib/RingTheory/DedekindDomain/Ideal/Basic.lean
mul_inv_eq_one
null
inv_mul_eq_one {I : FractionalIdeal A⁰ K} (hI : I ≠ 0) : I⁻¹ * I = 1 := (mul_comm _ _).trans (h.mul_inv_eq_one hI)
theorem
RingTheory
[ "Mathlib.Algebra.Algebra.Subalgebra.Pointwise", "Mathlib.RingTheory.DedekindDomain.Basic", "Mathlib.RingTheory.FractionalIdeal.Inverse", "Mathlib.RingTheory.Spectrum.Prime.Basic" ]
Mathlib/RingTheory/DedekindDomain/Ideal/Basic.lean
inv_mul_eq_one
null
protected isUnit {I : FractionalIdeal A⁰ K} (hI : I ≠ 0) : IsUnit I := isUnit_of_mul_eq_one _ _ (h.mul_inv_eq_one hI)
theorem
RingTheory
[ "Mathlib.Algebra.Algebra.Subalgebra.Pointwise", "Mathlib.RingTheory.DedekindDomain.Basic", "Mathlib.RingTheory.FractionalIdeal.Inverse", "Mathlib.RingTheory.Spectrum.Prime.Basic" ]
Mathlib/RingTheory/DedekindDomain/Ideal/Basic.lean
isUnit
null
isNoetherianRing : IsNoetherianRing A := by refine isNoetherianRing_iff.mpr ⟨fun I : Ideal A => ?_⟩ by_cases hI : I = ⊥ · rw [hI]; apply Submodule.fg_bot have hI : (I : FractionalIdeal A⁰ (FractionRing A)) ≠ 0 := coeIdeal_ne_zero.mpr hI exact I.fg_of_isUnit (IsFractionRing.injective A (FractionRing A)) (h.isUnit hI)
theorem
RingTheory
[ "Mathlib.Algebra.Algebra.Subalgebra.Pointwise", "Mathlib.RingTheory.DedekindDomain.Basic", "Mathlib.RingTheory.FractionalIdeal.Inverse", "Mathlib.RingTheory.Spectrum.Prime.Basic" ]
Mathlib/RingTheory/DedekindDomain/Ideal/Basic.lean
isNoetherianRing
null
integrallyClosed : IsIntegrallyClosed A := by refine (isIntegrallyClosed_iff (FractionRing A)).mpr (fun {x hx} => ?_) rw [← Set.mem_range, ← Algebra.mem_bot, ← Subalgebra.mem_toSubmodule, Algebra.toSubmodule_bot, Submodule.one_eq_span, ← coe_spanSingleton A⁰ (1 : FractionRing A), spanSingleton_one, ← FractionalIdeal.adjoinIntegral_eq_one_of_isUnit x hx (h.isUnit _)] · exact mem_adjoinIntegral_self A⁰ x hx · exact fun h => one_ne_zero (eq_zero_iff.mp h 1 (Algebra.adjoin A {x}).one_mem) open Ring
theorem
RingTheory
[ "Mathlib.Algebra.Algebra.Subalgebra.Pointwise", "Mathlib.RingTheory.DedekindDomain.Basic", "Mathlib.RingTheory.FractionalIdeal.Inverse", "Mathlib.RingTheory.Spectrum.Prime.Basic" ]
Mathlib/RingTheory/DedekindDomain/Ideal/Basic.lean
integrallyClosed
null
dimensionLEOne : DimensionLEOne A := ⟨by rintro P P_ne hP refine Ideal.isMaximal_def.mpr ⟨hP.ne_top, fun M hM => ?_⟩ have P'_ne : (P : FractionalIdeal A⁰ (FractionRing A)) ≠ 0 := coeIdeal_ne_zero.mpr P_ne have M'_ne : (M : FractionalIdeal A⁰ (FractionRing A)) ≠ 0 := coeIdeal_ne_zero.mpr hM.ne_bot suffices (M⁻¹ : FractionalIdeal A⁰ (FractionRing A)) * P ≤ P by rw [eq_top_iff, ← coeIdeal_le_coeIdeal (FractionRing A), coeIdeal_top] calc (1 : FractionalIdeal A⁰ (FractionRing A)) = _ * _ * _ := ?_ _ ≤ _ * _ := mul_right_mono ((P : FractionalIdeal A⁰ (FractionRing A))⁻¹ * M : FractionalIdeal A⁰ (FractionRing A)) this _ = M := ?_ · rw [mul_assoc, ← mul_assoc (P : FractionalIdeal A⁰ (FractionRing A)), h.mul_inv_eq_one P'_ne, one_mul, h.inv_mul_eq_one M'_ne] · rw [← mul_assoc (P : FractionalIdeal A⁰ (FractionRing A)), h.mul_inv_eq_one P'_ne, one_mul] intro x hx have le_one : (M⁻¹ : FractionalIdeal A⁰ (FractionRing A)) * P ≤ 1 := by rw [← h.inv_mul_eq_one M'_ne] exact mul_left_mono _ ((coeIdeal_le_coeIdeal (FractionRing A)).mpr hM.le) obtain ⟨y, _hy, rfl⟩ := (mem_coeIdeal _).mp (le_one hx) obtain ⟨z, hzM, hzp⟩ := SetLike.exists_of_lt hM have zy_mem := mul_mem_mul (mem_coeIdeal_of_mem A⁰ hzM) hx rw [← RingHom.map_mul, ← mul_assoc, h.mul_inv_eq_one M'_ne, one_mul] at zy_mem obtain ⟨zy, hzy, zy_eq⟩ := (mem_coeIdeal A⁰).mp zy_mem rw [IsFractionRing.injective A (FractionRing A) zy_eq] at hzy exact mem_coeIdeal_of_mem A⁰ (Or.resolve_left (hP.mem_or_mem hzy) hzp)⟩
theorem
RingTheory
[ "Mathlib.Algebra.Algebra.Subalgebra.Pointwise", "Mathlib.RingTheory.DedekindDomain.Basic", "Mathlib.RingTheory.FractionalIdeal.Inverse", "Mathlib.RingTheory.Spectrum.Prime.Basic" ]
Mathlib/RingTheory/DedekindDomain/Ideal/Basic.lean
dimensionLEOne
null
isDedekindDomain : IsDedekindDomain A := { h.isNoetherianRing, h.dimensionLEOne, h.integrallyClosed with }
theorem
RingTheory
[ "Mathlib.Algebra.Algebra.Subalgebra.Pointwise", "Mathlib.RingTheory.DedekindDomain.Basic", "Mathlib.RingTheory.FractionalIdeal.Inverse", "Mathlib.RingTheory.Spectrum.Prime.Basic" ]
Mathlib/RingTheory/DedekindDomain/Ideal/Basic.lean
isDedekindDomain
Showing one side of the equivalence between the definitions `IsDedekindDomainInv` and `IsDedekindDomain` of Dedekind domains.
one_mem_inv_coe_ideal [IsDomain A] {I : Ideal A} (hI : I ≠ ⊥) : (1 : K) ∈ (I : FractionalIdeal A⁰ K)⁻¹ := by rw [FractionalIdeal.mem_inv_iff (FractionalIdeal.coeIdeal_ne_zero.mpr hI)] intro y hy rw [one_mul] exact FractionalIdeal.coeIdeal_le_one hy
theorem
RingTheory
[ "Mathlib.Algebra.Algebra.Subalgebra.Pointwise", "Mathlib.RingTheory.DedekindDomain.Basic", "Mathlib.RingTheory.FractionalIdeal.Inverse", "Mathlib.RingTheory.Spectrum.Prime.Basic" ]
Mathlib/RingTheory/DedekindDomain/Ideal/Basic.lean
one_mem_inv_coe_ideal
null
exists_multiset_prod_cons_le_and_prod_not_le [IsDedekindDomain A] (hNF : ¬IsField A) {I M : Ideal A} (hI0 : I ≠ ⊥) (hIM : I ≤ M) [hM : M.IsMaximal] : ∃ Z : Multiset (PrimeSpectrum A), (M ::ₘ Z.map PrimeSpectrum.asIdeal).prod ≤ I ∧ ¬Multiset.prod (Z.map PrimeSpectrum.asIdeal) ≤ I := by obtain ⟨Z₀, hZ₀⟩ := PrimeSpectrum.exists_primeSpectrum_prod_le_and_ne_bot_of_domain hNF hI0 obtain ⟨Z, ⟨hZI, hprodZ⟩, h_eraseZ⟩ := wellFounded_lt.has_min {Z | (Z.map PrimeSpectrum.asIdeal).prod ≤ I ∧ (Z.map PrimeSpectrum.asIdeal).prod ≠ ⊥} ⟨Z₀, hZ₀.1, hZ₀.2⟩ obtain ⟨_, hPZ', hPM⟩ := hM.isPrime.multiset_prod_le.mp (hZI.trans hIM) obtain ⟨P, hPZ, rfl⟩ := Multiset.mem_map.mp hPZ' classical have := Multiset.map_erase PrimeSpectrum.asIdeal (fun _ _ => PrimeSpectrum.ext) P Z obtain ⟨hP0, hZP0⟩ : P.asIdeal ≠ ⊥ ∧ ((Z.erase P).map PrimeSpectrum.asIdeal).prod ≠ ⊥ := by rwa [Ne, ← Multiset.cons_erase hPZ', Multiset.prod_cons, Ideal.mul_eq_bot, not_or, ← this] at hprodZ have hPM' := (P.isPrime.isMaximal hP0).eq_of_le hM.ne_top hPM subst hPM' refine ⟨Z.erase P, ?_, ?_⟩ · convert hZI rw [this, Multiset.cons_erase hPZ'] · refine fun h => h_eraseZ (Z.erase P) ⟨h, ?_⟩ (Multiset.erase_lt.mpr hPZ) exact hZP0
theorem
RingTheory
[ "Mathlib.Algebra.Algebra.Subalgebra.Pointwise", "Mathlib.RingTheory.DedekindDomain.Basic", "Mathlib.RingTheory.FractionalIdeal.Inverse", "Mathlib.RingTheory.Spectrum.Prime.Basic" ]
Mathlib/RingTheory/DedekindDomain/Ideal/Basic.lean
exists_multiset_prod_cons_le_and_prod_not_le
Specialization of `exists_primeSpectrum_prod_le_and_ne_bot_of_domain` to Dedekind domains: Let `I : Ideal A` be a nonzero ideal, where `A` is a Dedekind domain that is not a field. Then `exists_primeSpectrum_prod_le_and_ne_bot_of_domain` states we can find a product of prime ideals that is contained within `I`. This lemma extends that result by making the product minimal: let `M` be a maximal ideal that contains `I`, then the product including `M` is contained within `I` and the product excluding `M` is not contained within `I`.
not_inv_le_one_of_ne_bot [IsDedekindDomain A] {I : Ideal A} (hI0 : I ≠ ⊥) (hI1 : I ≠ ⊤) : ¬(I⁻¹ : FractionalIdeal A⁰ K) ≤ 1 := by have hNF : ¬IsField A := fun h ↦ letI := h.toField; (eq_bot_or_eq_top I).elim hI0 hI1 wlog hM : I.IsMaximal generalizing I · rcases I.exists_le_maximal hI1 with ⟨M, hmax, hIM⟩ have hMbot : M ≠ ⊥ := (M.bot_lt_of_maximal hNF).ne' refine mt (le_trans <| inv_anti_mono ?_ ?_ ?_) (this hMbot hmax.ne_top hmax) <;> simpa only [coeIdeal_ne_zero, coeIdeal_le_coeIdeal] have hI0 : ⊥ < I := I.bot_lt_of_maximal hNF obtain ⟨⟨a, haI⟩, ha0⟩ := Submodule.nonzero_mem_of_bot_lt hI0 replace ha0 : a ≠ 0 := Subtype.coe_injective.ne ha0 let J : Ideal A := Ideal.span {a} have hJ0 : J ≠ ⊥ := mt Ideal.span_singleton_eq_bot.mp ha0 have hJI : J ≤ I := I.span_singleton_le_iff_mem.2 haI obtain ⟨Z, hle, hnle⟩ := exists_multiset_prod_cons_le_and_prod_not_le hNF hJ0 hJI obtain ⟨b, hbZ, hbJ⟩ := SetLike.not_le_iff_exists.mp hnle have hnz_fa : algebraMap A K a ≠ 0 := mt ((injective_iff_map_eq_zero _).mp (IsFractionRing.injective A K) a) ha0 refine Set.not_subset.2 ⟨algebraMap A K b * (algebraMap A K a)⁻¹, (mem_inv_iff ?_).mpr ?_, ?_⟩ · exact coeIdeal_ne_zero.mpr hI0.ne' · rintro y₀ hy₀ obtain ⟨y, h_Iy, rfl⟩ := (mem_coeIdeal _).mp hy₀ rw [mul_comm, ← mul_assoc, ← RingHom.map_mul] have h_yb : y * b ∈ J := by apply hle rw [Multiset.prod_cons] exact Submodule.smul_mem_smul h_Iy hbZ rw [Ideal.mem_span_singleton'] at h_yb rcases h_yb with ⟨c, hc⟩ rw [← hc, RingHom.map_mul, mul_assoc, mul_inv_cancel₀ hnz_fa, mul_one] apply coe_mem_one · refine mt (mem_one_iff _).mp ?_ rintro ⟨x', h₂_abs⟩ rw [← div_eq_mul_inv, eq_div_iff_mul_eq hnz_fa, ← RingHom.map_mul] at h₂_abs have := Ideal.mem_span_singleton'.mpr ⟨x', IsFractionRing.injective A K h₂_abs⟩ contradiction
lemma
RingTheory
[ "Mathlib.Algebra.Algebra.Subalgebra.Pointwise", "Mathlib.RingTheory.DedekindDomain.Basic", "Mathlib.RingTheory.FractionalIdeal.Inverse", "Mathlib.RingTheory.Spectrum.Prime.Basic" ]
Mathlib/RingTheory/DedekindDomain/Ideal/Basic.lean
not_inv_le_one_of_ne_bot
null