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 ⌀ |
|---|---|---|---|---|---|---|
Isocrystal (V : Type*) [AddCommGroup V] extends Module K(p, k) V where
frob : V ≃ᶠˡ[p, k] V
open WittVector
variable (V : Type*) [AddCommGroup V] [Isocrystal p k V]
variable (V₂ : Type*) [AddCommGroup V₂] [Isocrystal p k V₂]
variable {V} in | class | RingTheory | [
"Mathlib.RingTheory.WittVector.FrobeniusFractionField"
] | Mathlib/RingTheory/WittVector/Isocrystal.lean | Isocrystal | The Frobenius automorphism of `k`, as a linear map -/
scoped[Isocrystal]
notation3:50 M " →ᶠˡ[" p ", " k "] " M₂ =>
LinearMap (WittVector.FractionRing.frobeniusRingHom p k) M M₂
/-- The Frobenius automorphism of `k`, as a linear equivalence -/
scoped[Isocrystal]
notation3:50 M " ≃ᶠˡ[" p ", " k "] " M₂ =>
LinearEquiv (WittVector.FractionRing.frobeniusRingHom p k) M M₂
/-! ### Isocrystals -/
/-- An isocrystal is a vector space over the field `K(p, k)` additionally equipped with a
Frobenius-linear automorphism. |
Isocrystal.frobenius : V ≃ᶠˡ[p, k] V :=
Isocrystal.frob (p := p) (k := k) (V := V)
@[inherit_doc] scoped[Isocrystal] notation "Φ(" p ", " k ")" => WittVector.Isocrystal.frobenius p k | def | RingTheory | [
"Mathlib.RingTheory.WittVector.FrobeniusFractionField"
] | Mathlib/RingTheory/WittVector/Isocrystal.lean | Isocrystal.frobenius | Project the Frobenius automorphism from an isocrystal. Denoted by `Φ(p, k)` when V can be inferred. |
IsocrystalHom extends V →ₗ[K(p, k)] V₂ where
frob_equivariant : ∀ x : V, Φ(p, k) (toLinearMap x) = toLinearMap (Φ(p, k) x) | structure | RingTheory | [
"Mathlib.RingTheory.WittVector.FrobeniusFractionField"
] | Mathlib/RingTheory/WittVector/Isocrystal.lean | IsocrystalHom | A homomorphism between isocrystals respects the Frobenius map.
Notation `M →ᶠⁱ [p, k]` in the `Isocrystal` namespace. |
IsocrystalEquiv extends V ≃ₗ[K(p, k)] V₂ where
frob_equivariant : ∀ x : V, Φ(p, k) (toLinearEquiv x) = toLinearEquiv (Φ(p, k) x)
@[inherit_doc] scoped[Isocrystal]
notation:50 M " →ᶠⁱ[" p ", " k "] " M₂ => WittVector.IsocrystalHom p k M M₂
@[inherit_doc] scoped[Isocrystal]
notation:50 M " ≃ᶠⁱ[" p ", " k "] " M₂ => WittVector.IsocrystalEquiv p k M M₂ | structure | RingTheory | [
"Mathlib.RingTheory.WittVector.FrobeniusFractionField"
] | Mathlib/RingTheory/WittVector/Isocrystal.lean | IsocrystalEquiv | An isomorphism between isocrystals respects the Frobenius map.
Notation `M ≃ᶠⁱ [p, k]` in the `Isocrystal` namespace. |
@[nolint unusedArguments]
StandardOneDimIsocrystal (_m : ℤ) : Type _ :=
K(p, k)
deriving AddCommGroup, Module K(p, k) | def | RingTheory | [
"Mathlib.RingTheory.WittVector.FrobeniusFractionField"
] | Mathlib/RingTheory/WittVector/Isocrystal.lean | StandardOneDimIsocrystal | Type synonym for `K(p, k)` to carry the standard 1-dimensional isocrystal structure
of slope `m : ℤ`. |
isocrystal_classification (k : Type*) [Field k] [IsAlgClosed k] [CharP k p] (V : Type*)
[AddCommGroup V] [Isocrystal p k V] (h_dim : finrank K(p, k) V = 1) :
∃ m : ℤ, Nonempty (StandardOneDimIsocrystal p k m ≃ᶠⁱ[p, k] V) := by
haveI : Nontrivial V := Module.nontrivial_of_finrank_eq_succ h_dim
obtain ⟨x, hx⟩ : ∃ x : V, x ≠ 0 := exists_ne 0
have : Φ(p, k) x ≠ 0 := by simpa only [map_zero] using Φ(p, k).injective.ne hx
obtain ⟨a, ha, hax⟩ : ∃ a : K(p, k), a ≠ 0 ∧ Φ(p, k) x = a • x := by
rw [finrank_eq_one_iff_of_nonzero' x hx] at h_dim
obtain ⟨a, ha⟩ := h_dim (Φ(p, k) x)
refine ⟨a, ?_, ha.symm⟩
intro ha'
apply this
simp only [← ha, ha', zero_smul]
obtain ⟨b, hb, m, hmb⟩ := WittVector.exists_frobenius_solution_fractionRing p ha
replace hmb : φ(p, k) b * a = (p : K(p, k)) ^ m * b := by convert hmb
use m
let F₀ : StandardOneDimIsocrystal p k m →ₗ[K(p, k)] V := LinearMap.toSpanSingleton K(p, k) V x
let F : StandardOneDimIsocrystal p k m ≃ₗ[K(p, k)] V := by
refine LinearEquiv.ofBijective F₀ ⟨?_, ?_⟩
· rw [← LinearMap.ker_eq_bot]
exact LinearMap.ker_toSpanSingleton K(p, k) V hx
· rw [← LinearMap.range_eq_top]
rw [← (finrank_eq_one_iff_of_nonzero x hx).mp h_dim]
rw [LinearMap.span_singleton_eq_range]
refine ⟨⟨(LinearEquiv.smulOfNeZero K(p, k) _ _ hb).trans F, fun c ↦ ?_⟩⟩
rw [LinearEquiv.trans_apply, LinearEquiv.trans_apply, LinearEquiv.smulOfNeZero_apply,
LinearEquiv.smulOfNeZero_apply, LinearEquiv.map_smul, LinearEquiv.map_smul,
LinearEquiv.ofBijective_apply, LinearEquiv.ofBijective_apply,
StandardOneDimIsocrystal.frobenius_apply]
unfold StandardOneDimIsocrystal
rw [LinearMap.toSpanSingleton_apply K(p, k) V x c, LinearMap.toSpanSingleton_apply K(p, k) V x]
simp only [hax,
LinearEquiv.map_smulₛₗ, Algebra.id.smul_eq_mul]
simp only [← mul_smul]
congr 1
linear_combination φ(p, k) c * hmb | theorem | RingTheory | [
"Mathlib.RingTheory.WittVector.FrobeniusFractionField"
] | Mathlib/RingTheory/WittVector/Isocrystal.lean | isocrystal_classification | The standard one-dimensional isocrystal of slope `m : ℤ` is an isocrystal. -/
instance (m : ℤ) : Isocrystal p k (StandardOneDimIsocrystal p k m) where
frob :=
(FractionRing.frobenius p k).toSemilinearEquiv.trans
(LinearEquiv.smulOfNeZero _ _ _ (zpow_ne_zero m (WittVector.FractionRing.p_nonzero p k)))
@[simp]
theorem StandardOneDimIsocrystal.frobenius_apply (m : ℤ) (x : StandardOneDimIsocrystal p k m) :
Φ(p, k) x = (p : K(p, k)) ^ m • φ(p, k) x := rfl
end PerfectRing
/-- A one-dimensional isocrystal over an algebraically closed field
admits an isomorphism to one of the standard (indexed by `m : ℤ`) one-dimensional isocrystals. |
@[ghost_simps]
bind₁_frobenius_poly_wittPolynomial (n : ℕ) :
bind₁ (frobenius_poly p) (wittPolynomial p ℤ n) = (wittPolynomial p ℤ (n+1))
```
Proofs of identities between polynomial functions will often follow the pattern
```lean
ghost_calc _
<minor preprocessing>
ghost_simp
``` | lemma | RingTheory | [
"Mathlib.Algebra.MvPolynomial.Funext",
"Mathlib.Algebra.Ring.ULift",
"Mathlib.RingTheory.WittVector.Basic"
] | Mathlib/RingTheory/WittVector/IsPoly.lean | bind₁_frobenius_poly_wittPolynomial | null |
poly_eq_of_wittPolynomial_bind_eq' [Fact p.Prime] (f g : ℕ → MvPolynomial (idx × ℕ) ℤ)
(h : ∀ n, bind₁ f (wittPolynomial p _ n) = bind₁ g (wittPolynomial p _ n)) : f = g := by
ext1 n
apply MvPolynomial.map_injective (Int.castRingHom ℚ) Int.cast_injective
rw [← funext_iff] at h
replace h :=
congr_arg (fun fam => bind₁ (MvPolynomial.map (Int.castRingHom ℚ) ∘ fam) (xInTermsOfW p ℚ n)) h
simpa only [Function.comp_def, map_bind₁, map_wittPolynomial, ← bind₁_bind₁,
bind₁_wittPolynomial_xInTermsOfW, bind₁_X_right] using h | theorem | RingTheory | [
"Mathlib.Algebra.MvPolynomial.Funext",
"Mathlib.Algebra.Ring.ULift",
"Mathlib.RingTheory.WittVector.Basic"
] | Mathlib/RingTheory/WittVector/IsPoly.lean | poly_eq_of_wittPolynomial_bind_eq' | null |
poly_eq_of_wittPolynomial_bind_eq [Fact p.Prime] (f g : ℕ → MvPolynomial ℕ ℤ)
(h : ∀ n, bind₁ f (wittPolynomial p _ n) = bind₁ g (wittPolynomial p _ n)) : f = g := by
ext1 n
apply MvPolynomial.map_injective (Int.castRingHom ℚ) Int.cast_injective
rw [← funext_iff] at h
replace h :=
congr_arg (fun fam => bind₁ (MvPolynomial.map (Int.castRingHom ℚ) ∘ fam) (xInTermsOfW p ℚ n)) h
simpa only [Function.comp_def, map_bind₁, map_wittPolynomial, ← bind₁_bind₁,
bind₁_wittPolynomial_xInTermsOfW, bind₁_X_right] using h | theorem | RingTheory | [
"Mathlib.Algebra.MvPolynomial.Funext",
"Mathlib.Algebra.Ring.ULift",
"Mathlib.RingTheory.WittVector.Basic"
] | Mathlib/RingTheory/WittVector/IsPoly.lean | poly_eq_of_wittPolynomial_bind_eq | null |
IsPoly (f : ∀ ⦃R⦄ [CommRing R], WittVector p R → 𝕎 R) : Prop where mk' ::
poly :
∃ φ : ℕ → MvPolynomial ℕ ℤ,
∀ ⦃R⦄ [CommRing R] (x : 𝕎 R), (f x).coeff = fun n => aeval x.coeff (φ n) | class | RingTheory | [
"Mathlib.Algebra.MvPolynomial.Funext",
"Mathlib.Algebra.Ring.ULift",
"Mathlib.RingTheory.WittVector.Basic"
] | Mathlib/RingTheory/WittVector/IsPoly.lean | IsPoly | A function `f : Π R, 𝕎 R → 𝕎 R` that maps Witt vectors to Witt vectors over arbitrary base rings
is said to be *polynomial* if there is a family of polynomials `φₙ` over `ℤ` such that the `n`th
coefficient of `f x` is given by evaluating `φₙ` at the coefficients of `x`.
See also `WittVector.IsPoly₂` for the binary variant.
The `ghost_calc` tactic makes use of the `IsPoly` and `IsPoly₂` typeclass and its instances.
(In Lean 3, there was an `@[is_poly]` attribute to manage these instances,
because typeclass resolution did not play well with function composition.
This no longer seems to be an issue, so that such instances can be defined directly.) |
idIsPoly : IsPoly p fun _ _ => id :=
⟨⟨X, by intros; simp only [aeval_X, id]⟩⟩ | instance | RingTheory | [
"Mathlib.Algebra.MvPolynomial.Funext",
"Mathlib.Algebra.Ring.ULift",
"Mathlib.RingTheory.WittVector.Basic"
] | Mathlib/RingTheory/WittVector/IsPoly.lean | idIsPoly | The identity function on Witt vectors is a polynomial function. |
idIsPolyI' : IsPoly p fun _ _ a => a :=
WittVector.idIsPoly _ | instance | RingTheory | [
"Mathlib.Algebra.MvPolynomial.Funext",
"Mathlib.Algebra.Ring.ULift",
"Mathlib.RingTheory.WittVector.Basic"
] | Mathlib/RingTheory/WittVector/IsPoly.lean | idIsPolyI' | null |
ext [Fact p.Prime] {f g} (hf : IsPoly p f) (hg : IsPoly p g)
(h : ∀ (R : Type u) [_Rcr : CommRing R] (x : 𝕎 R) (n : ℕ),
ghostComponent n (f x) = ghostComponent n (g x)) :
∀ (R : Type u) [_Rcr : CommRing R] (x : 𝕎 R), f x = g x := by
obtain ⟨φ, hf⟩ := hf
obtain ⟨ψ, hg⟩ := hg
intros
ext n
rw [hf, hg, poly_eq_of_wittPolynomial_bind_eq p φ ψ]
intro k
apply MvPolynomial.funext
intro x
simp only [hom_bind₁]
specialize h (ULift ℤ) (mk p fun i => ⟨x i⟩) k
simp only [ghostComponent_apply, aeval_eq_eval₂Hom] at h
apply (ULift.ringEquiv.symm : ℤ ≃+* _).injective
simp only [← RingEquiv.coe_toRingHom, map_eval₂Hom]
convert h using 1
all_goals
simp only [hf, hg, MvPolynomial.eval, map_eval₂Hom]
apply eval₂Hom_congr (RingHom.ext_int _ _) _ rfl
ext1
apply eval₂Hom_congr (RingHom.ext_int _ _) _ rfl
simp only [coeff_mk]; rfl | theorem | RingTheory | [
"Mathlib.Algebra.MvPolynomial.Funext",
"Mathlib.Algebra.Ring.ULift",
"Mathlib.RingTheory.WittVector.Basic"
] | Mathlib/RingTheory/WittVector/IsPoly.lean | ext | null |
comp {g f} [hg : IsPoly p g] [hf : IsPoly p f] :
IsPoly p fun R _Rcr => @g R _Rcr ∘ @f R _Rcr := by
obtain ⟨φ, hf⟩ := hf
obtain ⟨ψ, hg⟩ := hg
use fun n => bind₁ φ (ψ n)
intros
simp only [aeval_bind₁, Function.comp, hg, hf] | instance | RingTheory | [
"Mathlib.Algebra.MvPolynomial.Funext",
"Mathlib.Algebra.Ring.ULift",
"Mathlib.RingTheory.WittVector.Basic"
] | Mathlib/RingTheory/WittVector/IsPoly.lean | comp | The composition of polynomial functions is polynomial. |
IsPoly₂ (f : ∀ ⦃R⦄ [CommRing R], WittVector p R → 𝕎 R → 𝕎 R) : Prop where mk' ::
poly :
∃ φ : ℕ → MvPolynomial (Fin 2 × ℕ) ℤ,
∀ ⦃R⦄ [CommRing R] (x y : 𝕎 R), (f x y).coeff = fun n => peval (φ n) ![x.coeff, y.coeff]
variable {p} | class | RingTheory | [
"Mathlib.Algebra.MvPolynomial.Funext",
"Mathlib.Algebra.Ring.ULift",
"Mathlib.RingTheory.WittVector.Basic"
] | Mathlib/RingTheory/WittVector/IsPoly.lean | IsPoly₂ | A binary function `f : Π R, 𝕎 R → 𝕎 R → 𝕎 R` on Witt vectors
is said to be *polynomial* if there is a family of polynomials `φₙ` over `ℤ` such that the `n`th
coefficient of `f x y` is given by evaluating `φₙ` at the coefficients of `x` and `y`.
See also `WittVector.IsPoly` for the unary variant.
The `ghost_calc` tactic makes use of the `IsPoly` and `IsPoly₂` typeclass and its instances.
(In Lean 3, there was an `@[is_poly]` attribute to manage these instances,
because typeclass resolution did not play well with function composition.
This no longer seems to be an issue, so that such instances can be defined directly.) |
IsPoly₂.comp {h f g} [hh : IsPoly₂ p h] [hf : IsPoly p f] [hg : IsPoly p g] :
IsPoly₂ p fun _ _Rcr x y => h (f x) (g y) := by
obtain ⟨φ, hf⟩ := hf
obtain ⟨ψ, hg⟩ := hg
obtain ⟨χ, hh⟩ := hh
refine ⟨⟨fun n ↦ bind₁ (uncurry <|
![fun k ↦ rename (Prod.mk (0 : Fin 2)) (φ k),
fun k ↦ rename (Prod.mk (1 : Fin 2)) (ψ k)]) (χ n), ?_⟩⟩
intros
funext n
simp +unfoldPartialApp only [peval, aeval_bind₁, hh, hf, hg,
uncurry]
apply eval₂Hom_congr rfl _ rfl
ext ⟨i, n⟩
fin_cases i <;> simp [aeval_eq_eval₂Hom, eval₂Hom_rename, Function.comp_def] | instance | RingTheory | [
"Mathlib.Algebra.MvPolynomial.Funext",
"Mathlib.Algebra.Ring.ULift",
"Mathlib.RingTheory.WittVector.Basic"
] | Mathlib/RingTheory/WittVector/IsPoly.lean | IsPoly₂.comp | The composition of polynomial functions is polynomial. |
IsPoly.comp₂ {g f} [hg : IsPoly p g] [hf : IsPoly₂ p f] :
IsPoly₂ p fun _ _Rcr x y => g (f x y) := by
obtain ⟨φ, hf⟩ := hf
obtain ⟨ψ, hg⟩ := hg
use fun n => bind₁ φ (ψ n)
intros
simp only [peval, aeval_bind₁, hg, hf] | instance | RingTheory | [
"Mathlib.Algebra.MvPolynomial.Funext",
"Mathlib.Algebra.Ring.ULift",
"Mathlib.RingTheory.WittVector.Basic"
] | Mathlib/RingTheory/WittVector/IsPoly.lean | IsPoly.comp₂ | The composition of a polynomial function with a binary polynomial function is polynomial. |
IsPoly₂.diag {f} [hf : IsPoly₂ p f] : IsPoly p fun _ _Rcr x => f x x := by
obtain ⟨φ, hf⟩ := hf
refine ⟨⟨fun n => bind₁ (uncurry ![X, X]) (φ n), ?_⟩⟩
intros; funext n
simp +unfoldPartialApp only [hf, peval, uncurry, aeval_bind₁]
apply eval₂Hom_congr rfl _ rfl
ext ⟨i, k⟩
fin_cases i <;> simp | instance | RingTheory | [
"Mathlib.Algebra.MvPolynomial.Funext",
"Mathlib.Algebra.Ring.ULift",
"Mathlib.RingTheory.WittVector.Basic"
] | Mathlib/RingTheory/WittVector/IsPoly.lean | IsPoly₂.diag | The diagonal `fun x ↦ f x x` of a polynomial function `f` is polynomial. |
negIsPoly [Fact p.Prime] : IsPoly p fun R _ => @Neg.neg (𝕎 R) _ :=
⟨⟨fun n => rename Prod.snd (wittNeg p n), by
intros; funext n
rw [neg_coeff, aeval_eq_eval₂Hom, eval₂Hom_rename]
apply eval₂Hom_congr rfl _ rfl
ext ⟨i, k⟩; fin_cases i; rfl⟩⟩ | instance | RingTheory | [
"Mathlib.Algebra.MvPolynomial.Funext",
"Mathlib.Algebra.Ring.ULift",
"Mathlib.RingTheory.WittVector.Basic"
] | Mathlib/RingTheory/WittVector/IsPoly.lean | negIsPoly | The additive negation is a polynomial function on Witt vectors. |
zeroIsPoly [Fact p.Prime] : IsPoly p fun _ _ _ => 0 :=
⟨⟨0, by intros; funext n; simp only [Pi.zero_apply, map_zero, zero_coeff]⟩⟩
@[simp] | instance | RingTheory | [
"Mathlib.Algebra.MvPolynomial.Funext",
"Mathlib.Algebra.Ring.ULift",
"Mathlib.RingTheory.WittVector.Basic"
] | Mathlib/RingTheory/WittVector/IsPoly.lean | zeroIsPoly | The function that is constantly zero on Witt vectors is a polynomial function. |
bind₁_zero_wittPolynomial [Fact p.Prime] (n : ℕ) :
bind₁ (0 : ℕ → MvPolynomial ℕ R) (wittPolynomial p R n) = 0 := by
rw [← aeval_eq_bind₁, aeval_zero, constantCoeff_wittPolynomial, RingHom.map_zero] | theorem | RingTheory | [
"Mathlib.Algebra.MvPolynomial.Funext",
"Mathlib.Algebra.Ring.ULift",
"Mathlib.RingTheory.WittVector.Basic"
] | Mathlib/RingTheory/WittVector/IsPoly.lean | bind₁_zero_wittPolynomial | null |
onePoly (n : ℕ) : MvPolynomial ℕ ℤ :=
if n = 0 then 1 else 0
@[simp] | def | RingTheory | [
"Mathlib.Algebra.MvPolynomial.Funext",
"Mathlib.Algebra.Ring.ULift",
"Mathlib.RingTheory.WittVector.Basic"
] | Mathlib/RingTheory/WittVector/IsPoly.lean | onePoly | The coefficients of `1 : 𝕎 R` as polynomials. |
bind₁_onePoly_wittPolynomial [hp : Fact p.Prime] (n : ℕ) :
bind₁ onePoly (wittPolynomial p ℤ n) = 1 := by
rw [wittPolynomial_eq_sum_C_mul_X_pow, map_sum, Finset.sum_eq_single 0]
· simp only [onePoly, one_pow, one_mul, map_pow, C_1, pow_zero, bind₁_X_right, if_true]
· intro i _hi hi0
simp only [onePoly, if_neg hi0, zero_pow (pow_ne_zero _ hp.1.ne_zero), mul_zero, map_pow,
bind₁_X_right, map_mul]
· simp | theorem | RingTheory | [
"Mathlib.Algebra.MvPolynomial.Funext",
"Mathlib.Algebra.Ring.ULift",
"Mathlib.RingTheory.WittVector.Basic"
] | Mathlib/RingTheory/WittVector/IsPoly.lean | bind₁_onePoly_wittPolynomial | null |
oneIsPoly [Fact p.Prime] : IsPoly p fun _ _ _ => 1 :=
⟨⟨onePoly, by
intros; funext n; cases n
· simp only [one_coeff_zero, onePoly, ite_true, map_one]
· simp only [Nat.succ_pos', one_coeff_eq_of_pos, onePoly, Nat.succ_ne_zero, ite_false,
map_zero]
⟩⟩ | instance | RingTheory | [
"Mathlib.Algebra.MvPolynomial.Funext",
"Mathlib.Algebra.Ring.ULift",
"Mathlib.RingTheory.WittVector.Basic"
] | Mathlib/RingTheory/WittVector/IsPoly.lean | oneIsPoly | The function that is constantly one on Witt vectors is a polynomial function. |
addIsPoly₂ [Fact p.Prime] : IsPoly₂ p fun _ _ => (· + ·) :=
⟨⟨wittAdd p, by intros; ext; exact add_coeff _ _ _⟩⟩ | instance | RingTheory | [
"Mathlib.Algebra.MvPolynomial.Funext",
"Mathlib.Algebra.Ring.ULift",
"Mathlib.RingTheory.WittVector.Basic"
] | Mathlib/RingTheory/WittVector/IsPoly.lean | addIsPoly₂ | Addition of Witt vectors is a polynomial function. |
mulIsPoly₂ [Fact p.Prime] : IsPoly₂ p fun _ _ => (· * ·) :=
⟨⟨wittMul p, by intros; ext; exact mul_coeff _ _ _⟩⟩ | instance | RingTheory | [
"Mathlib.Algebra.MvPolynomial.Funext",
"Mathlib.Algebra.Ring.ULift",
"Mathlib.RingTheory.WittVector.Basic"
] | Mathlib/RingTheory/WittVector/IsPoly.lean | mulIsPoly₂ | Multiplication of Witt vectors is a polynomial function. |
IsPoly.map [Fact p.Prime] {f} (hf : IsPoly p f) (g : R →+* S) (x : 𝕎 R) :
map g (f x) = f (map g x) := by
obtain ⟨φ, hf⟩ := hf
ext n
simp_rw [map_coeff, hf, map_aeval, funext (map_coeff g _), RingHom.ext_int _ (algebraMap ℤ S),
aeval_eq_eval₂Hom] | theorem | RingTheory | [
"Mathlib.Algebra.MvPolynomial.Funext",
"Mathlib.Algebra.Ring.ULift",
"Mathlib.RingTheory.WittVector.Basic"
] | Mathlib/RingTheory/WittVector/IsPoly.lean | IsPoly.map | null |
ext [Fact p.Prime] {f g} (hf : IsPoly₂ p f) (hg : IsPoly₂ p g)
(h : ∀ (R : Type u) [_Rcr : CommRing R] (x y : 𝕎 R) (n : ℕ),
ghostComponent n (f x y) = ghostComponent n (g x y)) :
∀ (R) [_Rcr : CommRing R] (x y : 𝕎 R), f x y = g x y := by
obtain ⟨φ, hf⟩ := hf
obtain ⟨ψ, hg⟩ := hg
intros
ext n
rw [hf, hg, poly_eq_of_wittPolynomial_bind_eq' p φ ψ]
intro k
apply MvPolynomial.funext
intro x
simp only [hom_bind₁]
specialize h (ULift ℤ) (mk p fun i => ⟨x (0, i)⟩) (mk p fun i => ⟨x (1, i)⟩) k
simp only [ghostComponent_apply, aeval_eq_eval₂Hom] at h
apply (ULift.ringEquiv.symm : ℤ ≃+* _).injective
simp only [← RingEquiv.coe_toRingHom, map_eval₂Hom]
convert h using 1
all_goals
simp only [hf, hg, MvPolynomial.eval, map_eval₂Hom]
apply eval₂Hom_congr (RingHom.ext_int _ _) _ rfl
ext1
apply eval₂Hom_congr (RingHom.ext_int _ _) _ rfl
ext ⟨b, _⟩
fin_cases b <;> simp only [coeff_mk, uncurry] <;> rfl | theorem | RingTheory | [
"Mathlib.Algebra.MvPolynomial.Funext",
"Mathlib.Algebra.Ring.ULift",
"Mathlib.RingTheory.WittVector.Basic"
] | Mathlib/RingTheory/WittVector/IsPoly.lean | ext | null |
map [Fact p.Prime] {f} (hf : IsPoly₂ p f) (g : R →+* S) (x y : 𝕎 R) :
map g (f x y) = f (map g x) (map g y) := by
obtain ⟨φ, hf⟩ := hf
ext n
simp +unfoldPartialApp only [map_coeff, hf, map_aeval, peval, uncurry]
apply eval₂Hom_congr (RingHom.ext_int _ _) _ rfl
ext ⟨i, k⟩
fin_cases i <;> simp | theorem | RingTheory | [
"Mathlib.Algebra.MvPolynomial.Funext",
"Mathlib.Algebra.Ring.ULift",
"Mathlib.RingTheory.WittVector.Basic"
] | Mathlib/RingTheory/WittVector/IsPoly.lean | map | null |
private runIntro (ref : Syntax) (n : Name) : TacticM FVarId := do
let fvarId ← liftMetaTacticAux fun g => do
let (fv, g') ← g.intro n
return (fv, [g'])
withMainContext do
Elab.Term.addLocalVarInfo ref (mkFVar fvarId)
return fvarId | def | RingTheory | [
"Mathlib.Algebra.MvPolynomial.Funext",
"Mathlib.Algebra.Ring.ULift",
"Mathlib.RingTheory.WittVector.Basic"
] | Mathlib/RingTheory/WittVector/IsPoly.lean | runIntro | null |
private getLocalOrIntro (t : Term) : TacticM FVarId := do
match t with
| `(_) => runIntro t `_
| `($id:ident) => getFVarId id <|> runIntro id id.getId
| _ => Elab.throwUnsupportedSyntax
elab_rules : tactic | `(tactic| ghost_calc $[$ids']*) => do
let ids ← ids'.mapM getLocalOrIntro
withMainContext do
let idsS ← ids.mapM (fun id => Elab.Term.exprToSyntax (.fvar id))
let some (α, lhs, rhs) := (← getMainTarget'').eq?
| throwError "ghost_calc expecting target to be an equality"
let (``WittVector, #[_, R]) := α.getAppFnArgs
| throwError "ghost_calc expecting target to be an equality of `WittVector`s"
let instR ← Meta.synthInstance (← Meta.mkAppM ``CommRing #[R])
unless instR.isFVar do
throwError "{← Meta.inferType instR} instance is not local"
let f ← Meta.mkLambdaFVars (#[R, instR] ++ ids.map .fvar) lhs
let g ← Meta.mkLambdaFVars (#[R, instR] ++ ids.map .fvar) rhs
let fS ← Elab.Term.exprToSyntax f
let gS ← Elab.Term.exprToSyntax g
match idsS with
| #[x] => evalTactic (← `(tactic| refine IsPoly.ext (f := $fS) (g := $gS) ?_ ?_ ?_ _ $x))
| #[x, y] => evalTactic (← `(tactic| refine IsPoly₂.ext (f := $fS) (g := $gS) ?_ ?_ ?_ _ $x $y))
| _ => throwError "ghost_calc takes either one or two arguments"
let nm ← withMainContext <|
if let .fvar fvarId := (R : Expr) then
fvarId.getUserName
else
Meta.getUnusedUserName `R
evalTactic <| ← `(tactic| iterate 2 infer_instance)
let R := mkIdent nm
evalTactic <| ← `(tactic| clear! $R)
evalTactic <| ← `(tactic| intro $(mkIdent nm):ident $(mkIdent (.str nm "_inst")):ident $ids'*) | def | RingTheory | [
"Mathlib.Algebra.MvPolynomial.Funext",
"Mathlib.Algebra.Ring.ULift",
"Mathlib.RingTheory.WittVector.Basic"
] | Mathlib/RingTheory/WittVector/IsPoly.lean | getLocalOrIntro | null |
wittPolyProd (n : ℕ) : 𝕄 :=
rename (Prod.mk (0 : Fin 2)) (wittPolynomial p ℤ n) *
rename (Prod.mk (1 : Fin 2)) (wittPolynomial p ℤ n) | def | RingTheory | [
"Mathlib.Algebra.MvPolynomial.Supported",
"Mathlib.RingTheory.WittVector.Truncated"
] | Mathlib/RingTheory/WittVector/MulCoeff.lean | wittPolyProd | ```
(∑ i ∈ range n, (y.coeff i)^(p^(n-i)) * p^i.val) *
(∑ i ∈ range n, (y.coeff i)^(p^(n-i)) * p^i.val)
``` |
wittPolyProd_vars (n : ℕ) : (wittPolyProd p n).vars ⊆ univ ×ˢ range (n + 1) := by
rw [wittPolyProd]
apply Subset.trans (vars_mul _ _)
refine union_subset ?_ ?_ <;>
· refine Subset.trans (vars_rename _ _) ?_
simp [wittPolynomial_vars, image_subset_iff] | theorem | RingTheory | [
"Mathlib.Algebra.MvPolynomial.Supported",
"Mathlib.RingTheory.WittVector.Truncated"
] | Mathlib/RingTheory/WittVector/MulCoeff.lean | wittPolyProd_vars | null |
wittPolyProdRemainder (n : ℕ) : 𝕄 :=
∑ i ∈ range n, (p : 𝕄) ^ i * wittMul p i ^ p ^ (n - i) | def | RingTheory | [
"Mathlib.Algebra.MvPolynomial.Supported",
"Mathlib.RingTheory.WittVector.Truncated"
] | Mathlib/RingTheory/WittVector/MulCoeff.lean | wittPolyProdRemainder | The "remainder term" of `WittVector.wittPolyProd`. See `mul_polyOfInterest_aux2`. |
wittPolyProdRemainder_vars (n : ℕ) :
(wittPolyProdRemainder p n).vars ⊆ univ ×ˢ range n := by
rw [wittPolyProdRemainder]
refine Subset.trans (vars_sum_subset _ _) ?_
rw [biUnion_subset]
intro x hx
apply Subset.trans (vars_mul _ _)
refine union_subset ?_ ?_
· apply Subset.trans (vars_pow _ _)
have : (p : 𝕄) = C (p : ℤ) := by simp only [Int.cast_natCast, eq_intCast]
rw [this, vars_C]
apply empty_subset
· apply Subset.trans (vars_pow _ _)
apply Subset.trans (wittMul_vars _ _)
apply product_subset_product (Subset.refl _)
simpa using hx | theorem | RingTheory | [
"Mathlib.Algebra.MvPolynomial.Supported",
"Mathlib.RingTheory.WittVector.Truncated"
] | Mathlib/RingTheory/WittVector/MulCoeff.lean | wittPolyProdRemainder_vars | null |
remainder (n : ℕ) : 𝕄 :=
(∑ x ∈ range (n + 1),
(rename (Prod.mk 0)) ((monomial (Finsupp.single x (p ^ (n + 1 - x)))) ((p : ℤ) ^ x))) *
∑ x ∈ range (n + 1),
(rename (Prod.mk 1)) ((monomial (Finsupp.single x (p ^ (n + 1 - x)))) ((p : ℤ) ^ x)) | def | RingTheory | [
"Mathlib.Algebra.MvPolynomial.Supported",
"Mathlib.RingTheory.WittVector.Truncated"
] | Mathlib/RingTheory/WittVector/MulCoeff.lean | remainder | `remainder p n` represents the remainder term from `mul_polyOfInterest_aux3`.
`wittPolyProd p (n+1)` will have variables up to `n+1`,
but `remainder` will only have variables up to `n`. |
remainder_vars (n : ℕ) : (remainder p n).vars ⊆ univ ×ˢ range (n + 1) := by
rw [remainder]
apply Subset.trans (vars_mul _ _)
refine union_subset ?_ ?_ <;>
· refine Subset.trans (vars_sum_subset _ _) ?_
rw [biUnion_subset]
intro x hx
rw [rename_monomial, vars_monomial, Finsupp.mapDomain_single]
· apply Subset.trans Finsupp.support_single_subset
simpa using mem_range.mp hx
· apply pow_ne_zero
exact mod_cast hp.out.ne_zero | theorem | RingTheory | [
"Mathlib.Algebra.MvPolynomial.Supported",
"Mathlib.RingTheory.WittVector.Truncated"
] | Mathlib/RingTheory/WittVector/MulCoeff.lean | remainder_vars | null |
polyOfInterest (n : ℕ) : 𝕄 :=
wittMul p (n + 1) + (p : 𝕄) ^ (n + 1) * X (0, n + 1) * X (1, n + 1) -
X (0, n + 1) * rename (Prod.mk (1 : Fin 2)) (wittPolynomial p ℤ (n + 1)) -
X (1, n + 1) * rename (Prod.mk (0 : Fin 2)) (wittPolynomial p ℤ (n + 1)) | def | RingTheory | [
"Mathlib.Algebra.MvPolynomial.Supported",
"Mathlib.RingTheory.WittVector.Truncated"
] | Mathlib/RingTheory/WittVector/MulCoeff.lean | polyOfInterest | This is the polynomial whose degree we want to get a handle on. |
mul_polyOfInterest_aux1 (n : ℕ) :
∑ i ∈ range (n + 1), (p : 𝕄) ^ i * wittMul p i ^ p ^ (n - i) = wittPolyProd p n := by
simp only [wittPolyProd]
convert wittStructureInt_prop p (X (0 : Fin 2) * X 1) n using 1
· simp only [wittPolynomial, wittMul]
rw [map_sum]
congr 1 with i
congr 1
have hsupp : (Finsupp.single i (p ^ (n - i))).support = {i} := by
rw [Finsupp.support_eq_singleton]
simp only [and_true, Finsupp.single_eq_same, Ne]
exact pow_ne_zero _ hp.out.ne_zero
simp only [bind₁_monomial, hsupp, Int.cast_natCast, prod_singleton, eq_intCast,
Finsupp.single_eq_same, Int.cast_pow]
· simp only [map_mul, bind₁_X_right] | theorem | RingTheory | [
"Mathlib.Algebra.MvPolynomial.Supported",
"Mathlib.RingTheory.WittVector.Truncated"
] | Mathlib/RingTheory/WittVector/MulCoeff.lean | mul_polyOfInterest_aux1 | null |
mul_polyOfInterest_aux2 (n : ℕ) :
(p : 𝕄) ^ n * wittMul p n + wittPolyProdRemainder p n = wittPolyProd p n := by
convert mul_polyOfInterest_aux1 p n
rw [sum_range_succ, add_comm, Nat.sub_self, pow_zero, pow_one]
rfl | theorem | RingTheory | [
"Mathlib.Algebra.MvPolynomial.Supported",
"Mathlib.RingTheory.WittVector.Truncated"
] | Mathlib/RingTheory/WittVector/MulCoeff.lean | mul_polyOfInterest_aux2 | null |
mul_polyOfInterest_aux3 (p n : ℕ) : wittPolyProd p (n + 1) =
-((p : 𝕄) ^ (n + 1) * X (0, n + 1)) * ((p : 𝕄) ^ (n + 1) * X (1, n + 1)) +
(p : 𝕄) ^ (n + 1) * X (0, n + 1) * rename (Prod.mk (1 : Fin 2)) (wittPolynomial p ℤ (n + 1)) +
(p : 𝕄) ^ (n + 1) * X (1, n + 1) * rename (Prod.mk (0 : Fin 2)) (wittPolynomial p ℤ (n + 1)) +
remainder p n := by
have mvpz : (p : 𝕄) ^ (n + 1) = MvPolynomial.C ((p : ℤ) ^ (n + 1)) := by norm_cast
rw [wittPolyProd, wittPolynomial, map_sum, map_sum]
conv_lhs =>
arg 1
rw [sum_range_succ, ← C_mul_X_pow_eq_monomial, tsub_self, pow_zero, pow_one, map_mul,
rename_C, rename_X, ← mvpz]
conv_lhs =>
arg 2
rw [sum_range_succ, ← C_mul_X_pow_eq_monomial, tsub_self, pow_zero, pow_one, map_mul,
rename_C, rename_X, ← mvpz]
conv_rhs =>
enter [1, 1, 2, 2]
rw [sum_range_succ, ← C_mul_X_pow_eq_monomial, tsub_self, pow_zero, pow_one, map_mul,
rename_C, rename_X, ← mvpz]
conv_rhs =>
enter [1, 2, 2]
rw [sum_range_succ, ← C_mul_X_pow_eq_monomial, tsub_self, pow_zero, pow_one, map_mul,
rename_C, rename_X, ← mvpz]
simp only [add_mul, mul_add]
rw [add_comm _ (remainder p n)]
simp only [add_assoc]
apply congrArg (Add.add _)
ring | theorem | RingTheory | [
"Mathlib.Algebra.MvPolynomial.Supported",
"Mathlib.RingTheory.WittVector.Truncated"
] | Mathlib/RingTheory/WittVector/MulCoeff.lean | mul_polyOfInterest_aux3 | null |
mul_polyOfInterest_aux4 (n : ℕ) :
(p : 𝕄) ^ (n + 1) * wittMul p (n + 1) =
-((p : 𝕄) ^ (n + 1) * X (0, n + 1)) * ((p : 𝕄) ^ (n + 1) * X (1, n + 1)) +
(p : 𝕄) ^ (n + 1) * X (0, n + 1) * rename (Prod.mk (1 : Fin 2)) (wittPolynomial p ℤ (n + 1)) +
(p : 𝕄) ^ (n + 1) * X (1, n + 1) * rename (Prod.mk (0 : Fin 2)) (wittPolynomial p ℤ (n + 1)) +
(remainder p n - wittPolyProdRemainder p (n + 1)) := by
rw [← add_sub_assoc, eq_sub_iff_add_eq, mul_polyOfInterest_aux2]
exact mul_polyOfInterest_aux3 _ _ | theorem | RingTheory | [
"Mathlib.Algebra.MvPolynomial.Supported",
"Mathlib.RingTheory.WittVector.Truncated"
] | Mathlib/RingTheory/WittVector/MulCoeff.lean | mul_polyOfInterest_aux4 | null |
mul_polyOfInterest_aux5 (n : ℕ) :
(p : 𝕄) ^ (n + 1) * polyOfInterest p n = remainder p n - wittPolyProdRemainder p (n + 1) := by
simp only [polyOfInterest, mul_sub, mul_add, sub_eq_iff_eq_add']
rw [mul_polyOfInterest_aux4 p n]
ring | theorem | RingTheory | [
"Mathlib.Algebra.MvPolynomial.Supported",
"Mathlib.RingTheory.WittVector.Truncated"
] | Mathlib/RingTheory/WittVector/MulCoeff.lean | mul_polyOfInterest_aux5 | null |
mul_polyOfInterest_vars (n : ℕ) :
((p : 𝕄) ^ (n + 1) * polyOfInterest p n).vars ⊆ univ ×ˢ range (n + 1) := by
rw [mul_polyOfInterest_aux5]
apply Subset.trans (vars_sub_subset _)
refine union_subset ?_ ?_
· apply remainder_vars
· apply wittPolyProdRemainder_vars | theorem | RingTheory | [
"Mathlib.Algebra.MvPolynomial.Supported",
"Mathlib.RingTheory.WittVector.Truncated"
] | Mathlib/RingTheory/WittVector/MulCoeff.lean | mul_polyOfInterest_vars | null |
polyOfInterest_vars_eq (n : ℕ) : (polyOfInterest p n).vars =
((p : 𝕄) ^ (n + 1) * (wittMul p (n + 1) + (p : 𝕄) ^ (n + 1) * X (0, n + 1) * X (1, n + 1) -
X (0, n + 1) * rename (Prod.mk (1 : Fin 2)) (wittPolynomial p ℤ (n + 1)) -
X (1, n + 1) * rename (Prod.mk (0 : Fin 2)) (wittPolynomial p ℤ (n + 1)))).vars := by
have : (p : 𝕄) ^ (n + 1) = C ((p : ℤ) ^ (n + 1)) := by norm_cast
rw [polyOfInterest, this, vars_C_mul]
apply pow_ne_zero
exact mod_cast hp.out.ne_zero | theorem | RingTheory | [
"Mathlib.Algebra.MvPolynomial.Supported",
"Mathlib.RingTheory.WittVector.Truncated"
] | Mathlib/RingTheory/WittVector/MulCoeff.lean | polyOfInterest_vars_eq | null |
polyOfInterest_vars (n : ℕ) : (polyOfInterest p n).vars ⊆ univ ×ˢ range (n + 1) := by
rw [polyOfInterest_vars_eq]; apply mul_polyOfInterest_vars | theorem | RingTheory | [
"Mathlib.Algebra.MvPolynomial.Supported",
"Mathlib.RingTheory.WittVector.Truncated"
] | Mathlib/RingTheory/WittVector/MulCoeff.lean | polyOfInterest_vars | null |
peval_polyOfInterest (n : ℕ) (x y : 𝕎 k) :
peval (polyOfInterest p n) ![fun i => x.coeff i, fun i => y.coeff i] =
(x * y).coeff (n + 1) + p ^ (n + 1) * x.coeff (n + 1) * y.coeff (n + 1) -
y.coeff (n + 1) * ∑ i ∈ range (n + 1 + 1), p ^ i * x.coeff i ^ p ^ (n + 1 - i) -
x.coeff (n + 1) * ∑ i ∈ range (n + 1 + 1), p ^ i * y.coeff i ^ p ^ (n + 1 - i) := by
simp only [polyOfInterest, peval,
Function.uncurry_apply_pair, aeval_X, Matrix.cons_val_one, map_mul, Matrix.cons_val_zero,
map_sub]
rw [sub_sub, add_comm (_ * _), ← sub_sub]
simp [wittPolynomial_eq_sum_C_mul_X_pow, aeval, mul_coeff, peval, map_natCast,
map_add, map_pow, map_mul]
variable [CharP k p] | theorem | RingTheory | [
"Mathlib.Algebra.MvPolynomial.Supported",
"Mathlib.RingTheory.WittVector.Truncated"
] | Mathlib/RingTheory/WittVector/MulCoeff.lean | peval_polyOfInterest | null |
peval_polyOfInterest' (n : ℕ) (x y : 𝕎 k) :
peval (polyOfInterest p n) ![fun i => x.coeff i, fun i => y.coeff i] =
(x * y).coeff (n + 1) - y.coeff (n + 1) * x.coeff 0 ^ p ^ (n + 1) -
x.coeff (n + 1) * y.coeff 0 ^ p ^ (n + 1) := by
rw [peval_polyOfInterest]
have : (p : k) = 0 := CharP.cast_eq_zero k p
simp only [this, ne_eq, add_eq_zero, and_false, zero_pow, zero_mul, add_zero,
not_false_eq_true, reduceCtorEq]
have sum_zero_pow_mul_pow_p (y : 𝕎 k) : ∑ x ∈ range (n + 1 + 1),
(0 : k) ^ x * y.coeff x ^ p ^ (n + 1 - x) = y.coeff 0 ^ p ^ (n + 1) := by
rw [Finset.sum_eq_single_of_mem 0] <;> simp +contextual
congr <;> apply sum_zero_pow_mul_pow_p
variable (k) | theorem | RingTheory | [
"Mathlib.Algebra.MvPolynomial.Supported",
"Mathlib.RingTheory.WittVector.Truncated"
] | Mathlib/RingTheory/WittVector/MulCoeff.lean | peval_polyOfInterest' | The characteristic `p` version of `peval_polyOfInterest` |
nth_mul_coeff' (n : ℕ) :
∃ f : TruncatedWittVector p (n + 1) k → TruncatedWittVector p (n + 1) k → k,
∀ x y : 𝕎 k, f (truncateFun (n + 1) x) (truncateFun (n + 1) y) =
(x * y).coeff (n + 1) - y.coeff (n + 1) * x.coeff 0 ^ p ^ (n + 1) -
x.coeff (n + 1) * y.coeff 0 ^ p ^ (n + 1) := by
simp only [← peval_polyOfInterest']
obtain ⟨f₀, hf₀⟩ := exists_restrict_to_vars k (polyOfInterest_vars p n)
have : ∀ (a : Multiset (Fin 2)) (b : Multiset ℕ), a ×ˢ b = a.product b := fun a b => rfl
let f : TruncatedWittVector p (n + 1) k → TruncatedWittVector p (n + 1) k → k := by
intro x y
apply f₀
rintro ⟨a, ha⟩
apply Function.uncurry ![x, y]
simp_rw [product_val, this, range_val, Multiset.range_succ] at ha
let S : Set (Fin 2 × ℕ) := (fun a => a.2 = n ∨ a.2 < n)
have ha' : a ∈ S := by
convert ha
dsimp [S]
congr!
simp
refine ⟨a.fst, ⟨a.snd, ?_⟩⟩
obtain ⟨ha, ha⟩ := ha' <;> omega
use f
intro x y
dsimp [f, peval]
rw [← hf₀]
congr
ext a
obtain ⟨a, ha⟩ := a
obtain ⟨i, m⟩ := a
fin_cases i <;> rfl -- surely this case split is not necessary | theorem | RingTheory | [
"Mathlib.Algebra.MvPolynomial.Supported",
"Mathlib.RingTheory.WittVector.Truncated"
] | Mathlib/RingTheory/WittVector/MulCoeff.lean | nth_mul_coeff' | null |
nth_mul_coeff (n : ℕ) :
∃ f : TruncatedWittVector p (n + 1) k → TruncatedWittVector p (n + 1) k → k,
∀ x y : 𝕎 k, (x * y).coeff (n + 1) =
x.coeff (n + 1) * y.coeff 0 ^ p ^ (n + 1) + y.coeff (n + 1) * x.coeff 0 ^ p ^ (n + 1) +
f (truncateFun (n + 1) x) (truncateFun (n + 1) y) := by
obtain ⟨f, hf⟩ := nth_mul_coeff' p k n
use f
intro x y
rw [hf x y]
ring
variable {k} | theorem | RingTheory | [
"Mathlib.Algebra.MvPolynomial.Supported",
"Mathlib.RingTheory.WittVector.Truncated"
] | Mathlib/RingTheory/WittVector/MulCoeff.lean | nth_mul_coeff | null |
nthRemainder (n : ℕ) : (Fin (n + 1) → k) → (Fin (n + 1) → k) → k :=
Classical.choose (nth_mul_coeff p k n) | def | RingTheory | [
"Mathlib.Algebra.MvPolynomial.Supported",
"Mathlib.RingTheory.WittVector.Truncated"
] | Mathlib/RingTheory/WittVector/MulCoeff.lean | nthRemainder | Produces the "remainder function" of the `n+1`st coefficient, which does not depend on the `n+1`st
coefficients of the inputs. |
nthRemainder_spec (n : ℕ) (x y : 𝕎 k) : (x * y).coeff (n + 1) =
x.coeff (n + 1) * y.coeff 0 ^ p ^ (n + 1) + y.coeff (n + 1) * x.coeff 0 ^ p ^ (n + 1) +
nthRemainder p n (truncateFun (n + 1) x) (truncateFun (n + 1) y) :=
Classical.choose_spec (nth_mul_coeff p k n) _ _ | theorem | RingTheory | [
"Mathlib.Algebra.MvPolynomial.Supported",
"Mathlib.RingTheory.WittVector.Truncated"
] | Mathlib/RingTheory/WittVector/MulCoeff.lean | nthRemainder_spec | null |
noncomputable wittMulN : ℕ → ℕ → MvPolynomial ℕ ℤ
| 0 => 0
| n + 1 => fun k => bind₁ (Function.uncurry <| ![wittMulN n, X]) (wittAdd p k) | def | RingTheory | [
"Mathlib.RingTheory.WittVector.IsPoly"
] | Mathlib/RingTheory/WittVector/MulP.lean | wittMulN | `wittMulN p n` is the family of polynomials that computes
the coefficients of `x * n` in terms of the coefficients of the Witt vector `x`. |
mulN_coeff (n : ℕ) (x : 𝕎 R) (k : ℕ) :
(x * n).coeff k = aeval x.coeff (wittMulN p n k) := by
induction n generalizing k with
| zero => simp only [Nat.cast_zero, mul_zero, zero_coeff, wittMulN, Pi.zero_apply, map_zero]
| succ n ih =>
rw [wittMulN, Nat.cast_add, Nat.cast_one, mul_add, mul_one, aeval_bind₁, add_coeff]
apply eval₂Hom_congr (RingHom.ext_int _ _) _ rfl
ext1 ⟨b, i⟩
fin_cases b
· simp [Function.uncurry, Matrix.cons_val_zero, ih]
· simp [Function.uncurry, Matrix.cons_val_one, aeval_X]
variable (p) | theorem | RingTheory | [
"Mathlib.RingTheory.WittVector.IsPoly"
] | Mathlib/RingTheory/WittVector/MulP.lean | mulN_coeff | null |
@[is_poly]
mulN_isPoly (n : ℕ) : IsPoly p fun _ _Rcr x => x * n :=
⟨⟨wittMulN p n, fun R _Rcr x => by funext k; exact mulN_coeff n x k⟩⟩
@[simp] | theorem | RingTheory | [
"Mathlib.RingTheory.WittVector.IsPoly"
] | Mathlib/RingTheory/WittVector/MulP.lean | mulN_isPoly | Multiplication by `n` is a polynomial function. |
bind₁_wittMulN_wittPolynomial (n k : ℕ) :
bind₁ (wittMulN p n) (wittPolynomial p ℤ k) = n * wittPolynomial p ℤ k := by
induction n with
| zero => simp [wittMulN, zero_mul, bind₁_zero_wittPolynomial]
| succ n ih =>
rw [wittMulN, ← bind₁_bind₁, wittAdd, wittStructureInt_prop]
simp only [map_add, Nat.cast_succ, bind₁_X_right]
rw [add_mul, one_mul, bind₁_rename, bind₁_rename]
simp only [ih, Function.uncurry, Function.comp_def, bind₁_X_left, AlgHom.id_apply,
Matrix.cons_val_zero, Matrix.cons_val_one] | theorem | RingTheory | [
"Mathlib.RingTheory.WittVector.IsPoly"
] | Mathlib/RingTheory/WittVector/MulP.lean | bind₁_wittMulN_wittPolynomial | null |
noncomputable wittStructureRat (Φ : MvPolynomial idx ℚ) (n : ℕ) : MvPolynomial (idx × ℕ) ℚ :=
bind₁ (fun k => bind₁ (fun i => rename (Prod.mk i) (W_ ℚ k)) Φ) (xInTermsOfW p ℚ n) | def | RingTheory | [
"Mathlib.FieldTheory.Finite.Polynomial",
"Mathlib.NumberTheory.Basic",
"Mathlib.RingTheory.WittVector.WittPolynomial"
] | Mathlib/RingTheory/WittVector/StructurePolynomial.lean | wittStructureRat | `wittStructureRat Φ` is a family of polynomials `ℕ → MvPolynomial (idx × ℕ) ℚ`
that are uniquely characterised by the property that
```
bind₁ (wittStructureRat p Φ) (wittPolynomial p ℚ n) =
bind₁ (fun i ↦ (rename (prod.mk i) (wittPolynomial p ℚ n))) Φ
```
In other words: evaluating the `n`-th Witt polynomial on the family `wittStructureRat Φ`
is the same as evaluating `Φ` on the (appropriately renamed) `n`-th Witt polynomials.
See `wittStructureRat_prop` for this property,
and `wittStructureRat_existsUnique` for the fact that `wittStructureRat`
gives the unique family of polynomials with this property.
These polynomials turn out to have integral coefficients,
but it requires some effort to show this.
See `wittStructureInt` for the version with integral coefficients,
and `map_wittStructureInt` for the fact that it is equal to `wittStructureRat`
when mapped to polynomials over the rationals. |
wittStructureRat_prop (Φ : MvPolynomial idx ℚ) (n : ℕ) :
bind₁ (wittStructureRat p Φ) (W_ ℚ n) = bind₁ (fun i => rename (Prod.mk i) (W_ ℚ n)) Φ :=
calc
bind₁ (wittStructureRat p Φ) (W_ ℚ n) =
bind₁ (fun k => bind₁ (fun i => (rename (Prod.mk i)) (W_ ℚ k)) Φ)
(bind₁ (xInTermsOfW p ℚ) (W_ ℚ n)) := by
rw [bind₁_bind₁]; exact eval₂Hom_congr (RingHom.ext_rat _ _) rfl rfl
_ = bind₁ (fun i => rename (Prod.mk i) (W_ ℚ n)) Φ := by
rw [bind₁_xInTermsOfW_wittPolynomial p _ n, bind₁_X_right] | theorem | RingTheory | [
"Mathlib.FieldTheory.Finite.Polynomial",
"Mathlib.NumberTheory.Basic",
"Mathlib.RingTheory.WittVector.WittPolynomial"
] | Mathlib/RingTheory/WittVector/StructurePolynomial.lean | wittStructureRat_prop | null |
wittStructureRat_existsUnique (Φ : MvPolynomial idx ℚ) :
∃! φ : ℕ → MvPolynomial (idx × ℕ) ℚ,
∀ n : ℕ, bind₁ φ (W_ ℚ n) = bind₁ (fun i => rename (Prod.mk i) (W_ ℚ n)) Φ := by
refine ⟨wittStructureRat p Φ, ?_, ?_⟩
· intro n; apply wittStructureRat_prop
· intro φ H
funext n
rw [show φ n = bind₁ φ (bind₁ (W_ ℚ) (xInTermsOfW p ℚ n)) by
rw [bind₁_wittPolynomial_xInTermsOfW p, bind₁_X_right]]
rw [bind₁_bind₁]
exact eval₂Hom_congr (RingHom.ext_rat _ _) (funext H) rfl | theorem | RingTheory | [
"Mathlib.FieldTheory.Finite.Polynomial",
"Mathlib.NumberTheory.Basic",
"Mathlib.RingTheory.WittVector.WittPolynomial"
] | Mathlib/RingTheory/WittVector/StructurePolynomial.lean | wittStructureRat_existsUnique | null |
wittStructureRat_rec_aux (Φ : MvPolynomial idx ℚ) (n : ℕ) :
wittStructureRat p Φ n * C ((p : ℚ) ^ n) =
bind₁ (fun b => rename (fun i => (b, i)) (W_ ℚ n)) Φ -
∑ i ∈ range n, C ((p : ℚ) ^ i) * wittStructureRat p Φ i ^ p ^ (n - i) := by
have := xInTermsOfW_aux p ℚ n
replace := congr_arg (bind₁ fun k : ℕ => bind₁ (fun i => rename (Prod.mk i) (W_ ℚ k)) Φ) this
rw [map_mul, bind₁_C_right] at this
rw [wittStructureRat, this]; clear this
conv_lhs => simp only [map_sub, bind₁_X_right]
rw [sub_right_inj]
simp only [map_sum, map_mul, bind₁_C_right, map_pow]
rfl | theorem | RingTheory | [
"Mathlib.FieldTheory.Finite.Polynomial",
"Mathlib.NumberTheory.Basic",
"Mathlib.RingTheory.WittVector.WittPolynomial"
] | Mathlib/RingTheory/WittVector/StructurePolynomial.lean | wittStructureRat_rec_aux | null |
wittStructureRat_rec (Φ : MvPolynomial idx ℚ) (n : ℕ) :
wittStructureRat p Φ n =
C (1 / (p : ℚ) ^ n) *
(bind₁ (fun b => rename (fun i => (b, i)) (W_ ℚ n)) Φ -
∑ i ∈ range n, C ((p : ℚ) ^ i) * wittStructureRat p Φ i ^ p ^ (n - i)) := by
calc
wittStructureRat p Φ n = C (1 / (p : ℚ) ^ n) * (wittStructureRat p Φ n * C ((p : ℚ) ^ n)) := ?_
_ = _ := by rw [wittStructureRat_rec_aux]
rw [mul_left_comm, ← C_mul, div_mul_cancel₀, C_1, mul_one]
exact pow_ne_zero _ (Nat.cast_ne_zero.2 hp.1.ne_zero) | theorem | RingTheory | [
"Mathlib.FieldTheory.Finite.Polynomial",
"Mathlib.NumberTheory.Basic",
"Mathlib.RingTheory.WittVector.WittPolynomial"
] | Mathlib/RingTheory/WittVector/StructurePolynomial.lean | wittStructureRat_rec | Write `wittStructureRat p φ n` in terms of `wittStructureRat p φ i` for `i < n`. |
noncomputable wittStructureInt (Φ : MvPolynomial idx ℤ) (n : ℕ) : MvPolynomial (idx × ℕ) ℤ :=
Finsupp.mapRange Rat.num (Rat.num_intCast 0) (wittStructureRat p (map (Int.castRingHom ℚ) Φ) n)
variable {p} | def | RingTheory | [
"Mathlib.FieldTheory.Finite.Polynomial",
"Mathlib.NumberTheory.Basic",
"Mathlib.RingTheory.WittVector.WittPolynomial"
] | Mathlib/RingTheory/WittVector/StructurePolynomial.lean | wittStructureInt | `wittStructureInt Φ` is a family of polynomials `ℕ → MvPolynomial (idx × ℕ) ℤ`
that are uniquely characterised by the property that
```
bind₁ (wittStructureInt p Φ) (wittPolynomial p ℤ n) =
bind₁ (fun i ↦ (rename (prod.mk i) (wittPolynomial p ℤ n))) Φ
```
In other words: evaluating the `n`-th Witt polynomial on the family `wittStructureInt Φ`
is the same as evaluating `Φ` on the (appropriately renamed) `n`-th Witt polynomials.
See `wittStructureInt_prop` for this property,
and `wittStructureInt_existsUnique` for the fact that `wittStructureInt`
gives the unique family of polynomials with this property. |
bind₁_rename_expand_wittPolynomial (Φ : MvPolynomial idx ℤ) (n : ℕ)
(IH :
∀ m : ℕ,
m < n + 1 →
map (Int.castRingHom ℚ) (wittStructureInt p Φ m) =
wittStructureRat p (map (Int.castRingHom ℚ) Φ) m) :
bind₁ (fun b => rename (fun i => (b, i)) (expand p (W_ ℤ n))) Φ =
bind₁ (fun i => expand p (wittStructureInt p Φ i)) (W_ ℤ n) := by
apply MvPolynomial.map_injective (Int.castRingHom ℚ) Int.cast_injective
simp only [map_bind₁, map_rename, map_expand, rename_expand, map_wittPolynomial]
have key := (wittStructureRat_prop p (map (Int.castRingHom ℚ) Φ) n).symm
apply_fun expand p at key
simp only [expand_bind₁] at key
rw [key]; clear key
apply eval₂Hom_congr' rfl _ rfl
rintro i hi -
rw [wittPolynomial_vars, Finset.mem_range] at hi
simp only [IH i hi] | theorem | RingTheory | [
"Mathlib.FieldTheory.Finite.Polynomial",
"Mathlib.NumberTheory.Basic",
"Mathlib.RingTheory.WittVector.WittPolynomial"
] | Mathlib/RingTheory/WittVector/StructurePolynomial.lean | bind₁_rename_expand_wittPolynomial | null |
C_p_pow_dvd_bind₁_rename_wittPolynomial_sub_sum (Φ : MvPolynomial idx ℤ) (n : ℕ)
(IH :
∀ m : ℕ,
m < n →
map (Int.castRingHom ℚ) (wittStructureInt p Φ m) =
wittStructureRat p (map (Int.castRingHom ℚ) Φ) m) :
(C ((p ^ n :) : ℤ) : MvPolynomial (idx × ℕ) ℤ) ∣
bind₁ (fun b : idx => rename (fun i => (b, i)) (wittPolynomial p ℤ n)) Φ -
∑ i ∈ range n, C ((p : ℤ) ^ i) * wittStructureInt p Φ i ^ p ^ (n - i) := by
rcases n with - | n
· simp only [isUnit_one, pow_zero, C_1, IsUnit.dvd,
Nat.cast_one]
have key := bind₁_rename_expand_wittPolynomial Φ n IH
apply_fun map (Int.castRingHom (ZMod (p ^ (n + 1)))) at key
conv_lhs at key => simp only [map_bind₁, map_rename, map_expand, map_wittPolynomial]
rw [C_dvd_iff_zmod, RingHom.map_sub, sub_eq_zero, map_bind₁]
simp only [map_rename, map_wittPolynomial, wittPolynomial_zmod_self]
rw [key]; clear key IH
rw [bind₁, aeval_wittPolynomial, map_sum, map_sum, Finset.sum_congr rfl]
intro k hk
rw [Finset.mem_range, Nat.lt_succ_iff] at hk
rw [← sub_eq_zero, ← RingHom.map_sub, ← C_dvd_iff_zmod, C_eq_coe_nat, ← Nat.cast_pow,
← Nat.cast_pow, C_eq_coe_nat, ← mul_sub]
have : p ^ (n + 1) = p ^ k * p ^ (n - k + 1) := by
rw [← pow_add, ← add_assoc]; congr 2; rw [add_comm, ← tsub_eq_iff_eq_add_of_le hk]
rw [this]
rw [Nat.cast_mul, Nat.cast_pow, Nat.cast_pow]
apply mul_dvd_mul_left ((p : MvPolynomial (idx × ℕ) ℤ) ^ k)
rw [show p ^ (n + 1 - k) = p * p ^ (n - k) by rw [← pow_succ', ← tsub_add_eq_add_tsub hk]]
rw [pow_mul]
apply dvd_sub_pow_of_dvd_sub
rw [← C_eq_coe_nat, C_dvd_iff_zmod, RingHom.map_sub, sub_eq_zero, map_expand, RingHom.map_pow,
MvPolynomial.expand_zmod]
variable (p)
@[simp] | theorem | RingTheory | [
"Mathlib.FieldTheory.Finite.Polynomial",
"Mathlib.NumberTheory.Basic",
"Mathlib.RingTheory.WittVector.WittPolynomial"
] | Mathlib/RingTheory/WittVector/StructurePolynomial.lean | C_p_pow_dvd_bind₁_rename_wittPolynomial_sub_sum | null |
map_wittStructureInt (Φ : MvPolynomial idx ℤ) (n : ℕ) :
map (Int.castRingHom ℚ) (wittStructureInt p Φ n) =
wittStructureRat p (map (Int.castRingHom ℚ) Φ) n := by
induction n using Nat.strong_induction_on with | h n IH => ?_
rw [wittStructureInt, map_mapRange_eq_iff, Int.coe_castRingHom]
intro c
rw [wittStructureRat_rec, coeff_C_mul, mul_comm, mul_div_assoc', mul_one]
have sum_induction_steps :
map (Int.castRingHom ℚ)
(∑ i ∈ range n, C ((p : ℤ) ^ i) * wittStructureInt p Φ i ^ p ^ (n - i)) =
∑ i ∈ range n,
C ((p : ℚ) ^ i) * wittStructureRat p (map (Int.castRingHom ℚ) Φ) i ^ p ^ (n - i) := by
rw [map_sum]
apply Finset.sum_congr rfl
intro i hi
rw [Finset.mem_range] at hi
simp only [IH i hi, RingHom.map_mul, RingHom.map_pow, map_C]
rfl
simp only [← sum_induction_steps, ← map_wittPolynomial p (Int.castRingHom ℚ), ← map_rename, ←
map_bind₁, ← RingHom.map_sub, coeff_map]
rw [show (p : ℚ) ^ n = ((↑(p ^ n) : ℤ) : ℚ) by norm_cast]
rw [← Rat.den_eq_one_iff, eq_intCast, Rat.den_div_intCast_eq_one_iff]
swap; · exact mod_cast pow_ne_zero n hp.1.ne_zero
revert c; rw [← C_dvd_iff_dvd_coeff]
exact C_p_pow_dvd_bind₁_rename_wittPolynomial_sub_sum Φ n IH | theorem | RingTheory | [
"Mathlib.FieldTheory.Finite.Polynomial",
"Mathlib.NumberTheory.Basic",
"Mathlib.RingTheory.WittVector.WittPolynomial"
] | Mathlib/RingTheory/WittVector/StructurePolynomial.lean | map_wittStructureInt | null |
wittStructureInt_prop (Φ : MvPolynomial idx ℤ) (n) :
bind₁ (wittStructureInt p Φ) (wittPolynomial p ℤ n) =
bind₁ (fun i => rename (Prod.mk i) (W_ ℤ n)) Φ := by
apply MvPolynomial.map_injective (Int.castRingHom ℚ) Int.cast_injective
have := wittStructureRat_prop p (map (Int.castRingHom ℚ) Φ) n
simpa only [map_bind₁, ← eval₂Hom_map_hom, eval₂Hom_C_left, map_rename, map_wittPolynomial,
AlgHom.coe_toRingHom, map_wittStructureInt] | theorem | RingTheory | [
"Mathlib.FieldTheory.Finite.Polynomial",
"Mathlib.NumberTheory.Basic",
"Mathlib.RingTheory.WittVector.WittPolynomial"
] | Mathlib/RingTheory/WittVector/StructurePolynomial.lean | wittStructureInt_prop | null |
eq_wittStructureInt (Φ : MvPolynomial idx ℤ) (φ : ℕ → MvPolynomial (idx × ℕ) ℤ)
(h : ∀ n, bind₁ φ (wittPolynomial p ℤ n) = bind₁ (fun i => rename (Prod.mk i) (W_ ℤ n)) Φ) :
φ = wittStructureInt p Φ := by
funext k
apply MvPolynomial.map_injective (Int.castRingHom ℚ) Int.cast_injective
rw [map_wittStructureInt]
revert k
refine congr_fun ?_
apply ExistsUnique.unique (wittStructureRat_existsUnique p (map (Int.castRingHom ℚ) Φ))
· intro n
specialize h n
apply_fun map (Int.castRingHom ℚ) at h
simpa only [map_bind₁, ← eval₂Hom_map_hom, eval₂Hom_C_left, map_rename, map_wittPolynomial,
AlgHom.coe_toRingHom] using h
· intro n; apply wittStructureRat_prop | theorem | RingTheory | [
"Mathlib.FieldTheory.Finite.Polynomial",
"Mathlib.NumberTheory.Basic",
"Mathlib.RingTheory.WittVector.WittPolynomial"
] | Mathlib/RingTheory/WittVector/StructurePolynomial.lean | eq_wittStructureInt | null |
wittStructureInt_existsUnique (Φ : MvPolynomial idx ℤ) :
∃! φ : ℕ → MvPolynomial (idx × ℕ) ℤ,
∀ n : ℕ,
bind₁ φ (wittPolynomial p ℤ n) = bind₁ (fun i : idx => rename (Prod.mk i) (W_ ℤ n)) Φ :=
⟨wittStructureInt p Φ, wittStructureInt_prop _ _, eq_wittStructureInt _ _⟩ | theorem | RingTheory | [
"Mathlib.FieldTheory.Finite.Polynomial",
"Mathlib.NumberTheory.Basic",
"Mathlib.RingTheory.WittVector.WittPolynomial"
] | Mathlib/RingTheory/WittVector/StructurePolynomial.lean | wittStructureInt_existsUnique | null |
witt_structure_prop (Φ : MvPolynomial idx ℤ) (n) :
aeval (fun i => map (Int.castRingHom R) (wittStructureInt p Φ i)) (wittPolynomial p ℤ n) =
aeval (fun i => rename (Prod.mk i) (W n)) Φ := by
convert congr_arg (map (Int.castRingHom R)) (wittStructureInt_prop p Φ n) using 1 <;>
rw [hom_bind₁] <;>
apply eval₂Hom_congr (RingHom.ext_int _ _) _ rfl
· rfl
· simp only [map_rename, map_wittPolynomial] | theorem | RingTheory | [
"Mathlib.FieldTheory.Finite.Polynomial",
"Mathlib.NumberTheory.Basic",
"Mathlib.RingTheory.WittVector.WittPolynomial"
] | Mathlib/RingTheory/WittVector/StructurePolynomial.lean | witt_structure_prop | null |
wittStructureInt_rename {σ : Type*} (Φ : MvPolynomial idx ℤ) (f : idx → σ) (n : ℕ) :
wittStructureInt p (rename f Φ) n = rename (Prod.map f id) (wittStructureInt p Φ n) := by
apply MvPolynomial.map_injective (Int.castRingHom ℚ) Int.cast_injective
simp only [map_rename, map_wittStructureInt, wittStructureRat, rename_bind₁, rename_rename,
bind₁_rename]
rfl
@[simp] | theorem | RingTheory | [
"Mathlib.FieldTheory.Finite.Polynomial",
"Mathlib.NumberTheory.Basic",
"Mathlib.RingTheory.WittVector.WittPolynomial"
] | Mathlib/RingTheory/WittVector/StructurePolynomial.lean | wittStructureInt_rename | null |
constantCoeff_wittStructureRat_zero (Φ : MvPolynomial idx ℚ) :
constantCoeff (wittStructureRat p Φ 0) = constantCoeff Φ := by
simp only [wittStructureRat, bind₁, map_aeval, xInTermsOfW_zero, constantCoeff_rename,
constantCoeff_wittPolynomial, aeval_X, constantCoeff_comp_algebraMap, eval₂Hom_zero'_apply,
RingHom.id_apply] | theorem | RingTheory | [
"Mathlib.FieldTheory.Finite.Polynomial",
"Mathlib.NumberTheory.Basic",
"Mathlib.RingTheory.WittVector.WittPolynomial"
] | Mathlib/RingTheory/WittVector/StructurePolynomial.lean | constantCoeff_wittStructureRat_zero | null |
constantCoeff_wittStructureRat (Φ : MvPolynomial idx ℚ) (h : constantCoeff Φ = 0) (n : ℕ) :
constantCoeff (wittStructureRat p Φ n) = 0 := by
simp only [wittStructureRat, eval₂Hom_zero'_apply, h, bind₁, map_aeval, constantCoeff_rename,
constantCoeff_wittPolynomial, constantCoeff_comp_algebraMap, RingHom.id_apply,
constantCoeff_xInTermsOfW]
@[simp] | theorem | RingTheory | [
"Mathlib.FieldTheory.Finite.Polynomial",
"Mathlib.NumberTheory.Basic",
"Mathlib.RingTheory.WittVector.WittPolynomial"
] | Mathlib/RingTheory/WittVector/StructurePolynomial.lean | constantCoeff_wittStructureRat | null |
constantCoeff_wittStructureInt_zero (Φ : MvPolynomial idx ℤ) :
constantCoeff (wittStructureInt p Φ 0) = constantCoeff Φ := by
have inj : Function.Injective (Int.castRingHom ℚ) := by intro m n; exact Int.cast_inj.mp
apply inj
rw [← constantCoeff_map, map_wittStructureInt, constantCoeff_wittStructureRat_zero,
constantCoeff_map] | theorem | RingTheory | [
"Mathlib.FieldTheory.Finite.Polynomial",
"Mathlib.NumberTheory.Basic",
"Mathlib.RingTheory.WittVector.WittPolynomial"
] | Mathlib/RingTheory/WittVector/StructurePolynomial.lean | constantCoeff_wittStructureInt_zero | null |
constantCoeff_wittStructureInt (Φ : MvPolynomial idx ℤ) (h : constantCoeff Φ = 0) (n : ℕ) :
constantCoeff (wittStructureInt p Φ n) = 0 := by
have inj : Function.Injective (Int.castRingHom ℚ) := by intro m n; exact Int.cast_inj.mp
apply inj
rw [← constantCoeff_map, map_wittStructureInt, constantCoeff_wittStructureRat, RingHom.map_zero]
rw [constantCoeff_map, h, RingHom.map_zero]
variable (R) | theorem | RingTheory | [
"Mathlib.FieldTheory.Finite.Polynomial",
"Mathlib.NumberTheory.Basic",
"Mathlib.RingTheory.WittVector.WittPolynomial"
] | Mathlib/RingTheory/WittVector/StructurePolynomial.lean | constantCoeff_wittStructureInt | null |
wittStructureRat_vars [Fintype idx] (Φ : MvPolynomial idx ℚ) (n : ℕ) :
(wittStructureRat p Φ n).vars ⊆ Finset.univ ×ˢ Finset.range (n + 1) := by
rw [wittStructureRat]
intro x hx
simp only [Finset.mem_product, true_and, Finset.mem_univ, Finset.mem_range]
obtain ⟨k, hk, hx'⟩ := mem_vars_bind₁ _ _ hx
obtain ⟨i, -, hx''⟩ := mem_vars_bind₁ _ _ hx'
obtain ⟨j, hj, rfl⟩ := mem_vars_rename _ _ hx''
rw [wittPolynomial_vars, Finset.mem_range] at hj
replace hk := xInTermsOfW_vars_subset p _ hk
grind | theorem | RingTheory | [
"Mathlib.FieldTheory.Finite.Polynomial",
"Mathlib.NumberTheory.Basic",
"Mathlib.RingTheory.WittVector.WittPolynomial"
] | Mathlib/RingTheory/WittVector/StructurePolynomial.lean | wittStructureRat_vars | null |
wittStructureInt_vars [Fintype idx] (Φ : MvPolynomial idx ℤ) (n : ℕ) :
(wittStructureInt p Φ n).vars ⊆ Finset.univ ×ˢ Finset.range (n + 1) := by
have : Function.Injective (Int.castRingHom ℚ) := Int.cast_injective
rw [← vars_map_of_injective _ this, map_wittStructureInt]
apply wittStructureRat_vars | theorem | RingTheory | [
"Mathlib.FieldTheory.Finite.Polynomial",
"Mathlib.NumberTheory.Basic",
"Mathlib.RingTheory.WittVector.WittPolynomial"
] | Mathlib/RingTheory/WittVector/StructurePolynomial.lean | wittStructureInt_vars | null |
teichmullerFun (r : R) : 𝕎 R :=
⟨fun n => if n = 0 then r else 0⟩
/-! | def | RingTheory | [
"Mathlib.RingTheory.WittVector.Basic"
] | Mathlib/RingTheory/WittVector/Teichmuller.lean | teichmullerFun | The underlying function of the monoid hom `WittVector.teichmuller`.
The `0`-th coefficient of `teichmullerFun p r` is `r`, and all others are `0`. |
private ghostComponent_teichmullerFun (r : R) (n : ℕ) :
ghostComponent n (teichmullerFun p r) = r ^ p ^ n := by
rw [ghostComponent_apply, aeval_wittPolynomial, Finset.sum_eq_single 0, pow_zero, one_mul,
tsub_zero]
· rfl
· intro i _ h0
simp [teichmullerFun, h0, hp.1.ne_zero]
· rw [Finset.mem_range]; intro h; exact (h (Nat.succ_pos n)).elim | theorem | RingTheory | [
"Mathlib.RingTheory.WittVector.Basic"
] | Mathlib/RingTheory/WittVector/Teichmuller.lean | ghostComponent_teichmullerFun | null |
private map_teichmullerFun (f : R →+* S) (r : R) :
map f (teichmullerFun p r) = teichmullerFun p (f r) := by
ext n; cases n
· rfl
· exact f.map_zero | theorem | RingTheory | [
"Mathlib.RingTheory.WittVector.Basic"
] | Mathlib/RingTheory/WittVector/Teichmuller.lean | map_teichmullerFun | null |
private teichmuller_mul_aux₁ {R : Type*} (x y : MvPolynomial R ℚ) :
teichmullerFun p (x * y) = teichmullerFun p x * teichmullerFun p y := by
apply (ghostMap.bijective_of_invertible p (MvPolynomial R ℚ)).1
rw [RingHom.map_mul]
ext1 n
simp only [Pi.mul_apply, ghostMap_apply, ghostComponent_teichmullerFun, mul_pow] | theorem | RingTheory | [
"Mathlib.RingTheory.WittVector.Basic"
] | Mathlib/RingTheory/WittVector/Teichmuller.lean | teichmuller_mul_aux₁ | null |
private teichmuller_mul_aux₂ {R : Type*} (x y : MvPolynomial R ℤ) :
teichmullerFun p (x * y) = teichmullerFun p x * teichmullerFun p y := by
refine map_injective (MvPolynomial.map (Int.castRingHom ℚ))
(MvPolynomial.map_injective _ Int.cast_injective) ?_
simp only [teichmuller_mul_aux₁, map_teichmullerFun, RingHom.map_mul] | theorem | RingTheory | [
"Mathlib.RingTheory.WittVector.Basic"
] | Mathlib/RingTheory/WittVector/Teichmuller.lean | teichmuller_mul_aux₂ | null |
teichmuller : R →* 𝕎 R where
toFun := teichmullerFun p
map_one' := by
ext ⟨⟩
· rw [one_coeff_zero]; rfl
· rw [one_coeff_eq_of_pos _ _ _ (Nat.succ_pos _)]; rfl
map_mul' := by
intro x y
rcases counit_surjective R x with ⟨x, rfl⟩
rcases counit_surjective R y with ⟨y, rfl⟩
simp only [← map_teichmullerFun, ← RingHom.map_mul, teichmuller_mul_aux₂]
@[simp] | def | RingTheory | [
"Mathlib.RingTheory.WittVector.Basic"
] | Mathlib/RingTheory/WittVector/Teichmuller.lean | teichmuller | The Teichmüller lift of an element of `R` to `𝕎 R`.
The `0`-th coefficient of `teichmuller p r` is `r`, and all others are `0`.
This is a monoid homomorphism. |
teichmuller_coeff_zero (r : R) : (teichmuller p r).coeff 0 = r :=
rfl
@[simp] | theorem | RingTheory | [
"Mathlib.RingTheory.WittVector.Basic"
] | Mathlib/RingTheory/WittVector/Teichmuller.lean | teichmuller_coeff_zero | null |
teichmuller_coeff_pos (r : R) : ∀ (n : ℕ) (_ : 0 < n), (teichmuller p r).coeff n = 0
| _ + 1, _ => rfl
@[simp] | theorem | RingTheory | [
"Mathlib.RingTheory.WittVector.Basic"
] | Mathlib/RingTheory/WittVector/Teichmuller.lean | teichmuller_coeff_pos | null |
teichmuller_zero : teichmuller p (0 : R) = 0 := by
ext ⟨⟩ <;> · rw [zero_coeff]; rfl | theorem | RingTheory | [
"Mathlib.RingTheory.WittVector.Basic"
] | Mathlib/RingTheory/WittVector/Teichmuller.lean | teichmuller_zero | null |
@[simp]
map_teichmuller (f : R →+* S) (r : R) : map f (teichmuller p r) = teichmuller p (f r) :=
map_teichmullerFun _ _ _ | theorem | RingTheory | [
"Mathlib.RingTheory.WittVector.Basic"
] | Mathlib/RingTheory/WittVector/Teichmuller.lean | map_teichmuller | `teichmuller` is a natural transformation. |
@[simp]
ghostComponent_teichmuller (r : R) (n : ℕ) :
ghostComponent n (teichmuller p r) = r ^ p ^ n :=
ghostComponent_teichmullerFun _ _ _ | theorem | RingTheory | [
"Mathlib.RingTheory.WittVector.Basic"
] | Mathlib/RingTheory/WittVector/Teichmuller.lean | ghostComponent_teichmuller | The `n`-th ghost component of `teichmuller p r` is `r ^ p ^ n`. |
@[nolint unusedArguments]
TruncatedWittVector (_ : ℕ) (n : ℕ) (R : Type*) :=
Fin n → R | def | RingTheory | [
"Mathlib.RingTheory.WittVector.InitTail"
] | Mathlib/RingTheory/WittVector/Truncated.lean | TruncatedWittVector | A truncated Witt vector over `R` is a vector of elements of `R`,
i.e., the first `n` coefficients of a Witt vector.
We will define operations on this type that are compatible with the (untruncated) Witt
vector operations.
`TruncatedWittVector p n R` takes a parameter `p : ℕ` that is not used in the definition.
In practice, this number `p` is assumed to be a prime number,
and under this assumption we construct a ring structure on `TruncatedWittVector p n R`.
(`TruncatedWittVector p₁ n R` and `TruncatedWittVector p₂ n R` are definitionally
equal as types but will have different ring operations.) |
mk (x : Fin n → R) : TruncatedWittVector p n R :=
x | def | RingTheory | [
"Mathlib.RingTheory.WittVector.InitTail"
] | Mathlib/RingTheory/WittVector/Truncated.lean | mk | Create a `TruncatedWittVector` from a vector `x`. |
coeff (i : Fin n) (x : TruncatedWittVector p n R) : R :=
x i
@[ext] | def | RingTheory | [
"Mathlib.RingTheory.WittVector.InitTail"
] | Mathlib/RingTheory/WittVector/Truncated.lean | coeff | `x.coeff i` is the `i`th entry of `x`. |
ext {x y : TruncatedWittVector p n R} (h : ∀ i, x.coeff i = y.coeff i) : x = y :=
funext h
@[simp] | theorem | RingTheory | [
"Mathlib.RingTheory.WittVector.InitTail"
] | Mathlib/RingTheory/WittVector/Truncated.lean | ext | null |
coeff_mk (x : Fin n → R) (i : Fin n) : (mk p x).coeff i = x i :=
rfl
@[simp] | theorem | RingTheory | [
"Mathlib.RingTheory.WittVector.InitTail"
] | Mathlib/RingTheory/WittVector/Truncated.lean | coeff_mk | null |
mk_coeff (x : TruncatedWittVector p n R) : (mk p fun i => x.coeff i) = x := by
ext i; rw [coeff_mk]
variable [CommRing R] | theorem | RingTheory | [
"Mathlib.RingTheory.WittVector.InitTail"
] | Mathlib/RingTheory/WittVector/Truncated.lean | mk_coeff | null |
out (x : TruncatedWittVector p n R) : 𝕎 R :=
@WittVector.mk' p _ fun i => if h : i < n then x.coeff ⟨i, h⟩ else 0
@[simp] | def | RingTheory | [
"Mathlib.RingTheory.WittVector.InitTail"
] | Mathlib/RingTheory/WittVector/Truncated.lean | out | We can turn a truncated Witt vector `x` into a Witt vector
by setting all coefficients after `x` to be 0. |
coeff_out (x : TruncatedWittVector p n R) (i : Fin n) : x.out.coeff i = x.coeff i := by
rw [out]; dsimp only; rw [dif_pos i.is_lt, Fin.eta] | theorem | RingTheory | [
"Mathlib.RingTheory.WittVector.InitTail"
] | Mathlib/RingTheory/WittVector/Truncated.lean | coeff_out | null |
out_injective : Injective (@out p n R _) := by
intro x y h
ext i
rw [WittVector.ext_iff] at h
simpa only [coeff_out] using h ↑i | theorem | RingTheory | [
"Mathlib.RingTheory.WittVector.InitTail"
] | Mathlib/RingTheory/WittVector/Truncated.lean | out_injective | null |
truncateFun (x : 𝕎 R) : TruncatedWittVector p n R :=
TruncatedWittVector.mk p fun i => x.coeff i | def | RingTheory | [
"Mathlib.RingTheory.WittVector.InitTail"
] | Mathlib/RingTheory/WittVector/Truncated.lean | truncateFun | `truncateFun n x` uses the first `n` entries of `x` to construct a `TruncatedWittVector`,
which has the same base `p` as `x`.
This function is bundled into a ring homomorphism in `WittVector.truncate` |
@[simp]
coeff_truncateFun (x : 𝕎 R) (i : Fin n) : (truncateFun n x).coeff i = x.coeff i := by
rw [truncateFun, TruncatedWittVector.coeff_mk]
variable [CommRing R]
@[simp] | theorem | RingTheory | [
"Mathlib.RingTheory.WittVector.InitTail"
] | Mathlib/RingTheory/WittVector/Truncated.lean | coeff_truncateFun | null |
out_truncateFun (x : 𝕎 R) : (truncateFun n x).out = init n x := by
ext i
dsimp [TruncatedWittVector.out, init, select, coeff_mk]
split_ifs with hi; swap; · rfl
rw [coeff_truncateFun, Fin.val_mk] | theorem | RingTheory | [
"Mathlib.RingTheory.WittVector.InitTail"
] | Mathlib/RingTheory/WittVector/Truncated.lean | out_truncateFun | null |
@[simp]
truncateFun_out (x : TruncatedWittVector p n R) : x.out.truncateFun n = x := by
simp only [WittVector.truncateFun, coeff_out, mk_coeff]
open WittVector
variable (p n R)
variable [Fact p.Prime] | theorem | RingTheory | [
"Mathlib.RingTheory.WittVector.InitTail"
] | Mathlib/RingTheory/WittVector/Truncated.lean | truncateFun_out | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.