ring_theory.witt_vector.mul_coeff
β·
Mathlib.RingTheory.WittVector.MulCoeff
The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(last sync)
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -87,7 +87,8 @@ theorem wittPolyProdRemainder_vars (n : β) : (wittPolyProdRemainder p n).vars
apply subset.trans (vars_mul _ _)
refine' union_subset _ _
Β· apply subset.trans (vars_pow _ _)
- have : (p : MvPolynomial (Fin 2 Γ β) β€) = C (p : β€) := by simp only [Int.cast_ofNat, eq_intCast]
+ have : (p : MvPolynomial (Fin 2 Γ β) β€) = C (p : β€) := by
+ simp only [Int.cast_natCast, eq_intCast]
rw [this, vars_C]
apply empty_subset
Β· apply subset.trans (vars_pow _ _)
@@ -154,7 +155,7 @@ theorem mul_polyOfInterest_aux1 (n : β) :
rw [Finsupp.support_eq_singleton]
simp only [and_true_iff, Finsupp.single_eq_same, eq_self_iff_true, Ne.def]
exact pow_ne_zero _ hp.out.ne_zero
- simp only [bindβ_monomial, hsupp, Int.cast_ofNat, prod_singleton, eq_intCast,
+ simp only [bindβ_monomial, hsupp, Int.cast_natCast, prod_singleton, eq_intCast,
Finsupp.single_eq_same, C_pow, mul_eq_mul_left_iff, true_or_iff, eq_self_iff_true]
Β· simp only [map_mul, bindβ_X_right]
#align witt_vector.mul_poly_of_interest_aux1 WittVector.mul_polyOfInterest_aux1
@@ -181,7 +182,7 @@ theorem mul_polyOfInterest_aux3 (n : β) :
by
-- a useful auxiliary fact
have mvpz : (p ^ (n + 1) : MvPolynomial (Fin 2 Γ β) β€) = MvPolynomial.C (βp ^ (n + 1)) := by
- simp only [Int.cast_ofNat, eq_intCast, C_pow, eq_self_iff_true]
+ simp only [Int.cast_natCast, eq_intCast, C_pow, eq_self_iff_true]
-- unfold definitions and peel off the last entries of the sums.
rw [witt_poly_prod, wittPolynomial, AlgHom.map_sum, AlgHom.map_sum, sum_range_succ]
-- these are sums up to `n+2`, so be careful to only unfold to `n+1`.
@@ -197,7 +198,7 @@ theorem mul_polyOfInterest_aux3 (n : β) :
conv_rhs => rw [sum_range_succ]
-- the rest is equal with proper unfolding and `ring`
simp only [rename_monomial, β C_mul_X_pow_eq_monomial, map_mul, rename_C, pow_one, rename_X]
- simp only [mvpz, Int.cast_ofNat, map_pow, eq_intCast, rename_X, pow_one, tsub_self, pow_zero]
+ simp only [mvpz, Int.cast_natCast, map_pow, eq_intCast, rename_X, pow_one, tsub_self, pow_zero]
ring1
#align witt_vector.mul_poly_of_interest_aux3 WittVector.mul_polyOfInterest_aux3
-/
@@ -249,7 +250,7 @@ theorem polyOfInterest_vars_eq (n : β) :
X (1, n + 1) * rename (Prod.mk (0 : Fin 2)) (wittPolynomial p β€ (n + 1)))).vars :=
by
have : (p ^ (n + 1) : MvPolynomial (Fin 2 Γ β) β€) = C (p ^ (n + 1) : β€) := by
- simp only [Int.cast_ofNat, eq_intCast, C_pow, eq_self_iff_true]
+ simp only [Int.cast_natCast, eq_intCast, C_pow, eq_self_iff_true]
rw [poly_of_interest, this, vars_C_mul]
apply pow_ne_zero
exact_mod_cast hp.out.ne_zero
@@ -274,7 +275,7 @@ theorem peval_polyOfInterest (n : β) (x y : π k) :
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]
- have mvpz : (p : MvPolynomial β β€) = MvPolynomial.C βp := by rw [eq_intCast, Int.cast_ofNat]
+ have mvpz : (p : MvPolynomial β β€) = MvPolynomial.C βp := by rw [eq_intCast, Int.cast_natCast]
have : β (f : β€ β+* k) (g : β β k), evalβ f g p = f p := by intros;
rw [mvpz, MvPolynomial.evalβ_C]
simp [wittPolynomial_eq_sum_C_mul_X_pow, aeval, evalβ_rename, this, mul_coeff, peval, map_natCast,
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Robert Y. Lewis, Heather Macbeth
-/
import RingTheory.WittVector.Truncated
-import Data.MvPolynomial.Supported
+import Algebra.MvPolynomial.Supported
#align_import ring_theory.witt_vector.mul_coeff from "leanprover-community/mathlib"@"9240e8be927a0955b9a82c6c85ef499ee3a626b8"
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -328,7 +328,7 @@ theorem nth_mul_coeff' (n : β) :
rintro β¨a, haβ©
apply Function.uncurry ![x, y]
simp only [true_and_iff, Multiset.mem_cons, range_val, product_val, Multiset.mem_range,
- Multiset.mem_product, Multiset.range_succ, mem_univ_val] at ha
+ Multiset.mem_product, Multiset.range_succ, mem_univ_val] at ha
refine' β¨a.fst, β¨a.snd, _β©β©
cases' ha with ha ha <;> linarith only [ha]
use f
@@ -341,7 +341,7 @@ theorem nth_mul_coeff' (n : β) :
cases' a with a ha
cases' a with i m
simp only [true_and_iff, Multiset.mem_cons, range_val, product_val, Multiset.mem_range,
- Multiset.mem_product, Multiset.range_succ, mem_univ_val] at ha
+ Multiset.mem_product, Multiset.range_succ, mem_univ_val] at ha
have ha' : m < n + 1 := by cases' ha with ha ha <;> linarith only [ha]
fin_cases i <;>-- surely this case split is not necessary
Β· simpa only using x.coeff_truncate_fun β¨m, ha'β©
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -294,7 +294,7 @@ theorem peval_polyOfInterest' (n : β) (x y : π k) :
rw [peval_poly_of_interest]
have : (p : k) = 0 := CharP.cast_eq_zero k p
simp only [this, add_zero, MulZeroClass.zero_mul, Nat.succ_ne_zero, Ne.def, not_false_iff,
- zero_pow']
+ zero_pow]
have sum_zero_pow_mul_pow_p :
β y : π k,
β x : β in range (n + 1 + 1), 0 ^ x * y.coeff x ^ p ^ (n + 1 - x) = y.coeff 0 ^ p ^ (n + 1) :=
mathlib commit https://github.com/leanprover-community/mathlib/commit/ce64cd319bb6b3e82f31c2d38e79080d377be451
@@ -3,8 +3,8 @@ Copyright (c) 2022 Robert Y. Lewis. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Robert Y. Lewis, Heather Macbeth
-/
-import Mathbin.RingTheory.WittVector.Truncated
-import Mathbin.Data.MvPolynomial.Supported
+import RingTheory.WittVector.Truncated
+import Data.MvPolynomial.Supported
#align_import ring_theory.witt_vector.mul_coeff from "leanprover-community/mathlib"@"9240e8be927a0955b9a82c6c85ef499ee3a626b8"
mathlib commit https://github.com/leanprover-community/mathlib/commit/8ea5598db6caeddde6cb734aa179cc2408dbd345
@@ -2,15 +2,12 @@
Copyright (c) 2022 Robert Y. Lewis. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Robert Y. Lewis, Heather Macbeth
-
-! This file was ported from Lean 3 source module ring_theory.witt_vector.mul_coeff
-! leanprover-community/mathlib commit 9240e8be927a0955b9a82c6c85ef499ee3a626b8
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathbin.RingTheory.WittVector.Truncated
import Mathbin.Data.MvPolynomial.Supported
+#align_import ring_theory.witt_vector.mul_coeff from "leanprover-community/mathlib"@"9240e8be927a0955b9a82c6c85ef499ee3a626b8"
+
/-!
# Leading terms of Witt vector multiplication
mathlib commit https://github.com/leanprover-community/mathlib/commit/9240e8be927a0955b9a82c6c85ef499ee3a626b8
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Robert Y. Lewis, Heather Macbeth
! This file was ported from Lean 3 source module ring_theory.witt_vector.mul_coeff
-! leanprover-community/mathlib commit 2f5b500a507264de86d666a5f87ddb976e2d8de4
+! leanprover-community/mathlib commit 9240e8be927a0955b9a82c6c85ef499ee3a626b8
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
@@ -14,6 +14,9 @@ import Mathbin.Data.MvPolynomial.Supported
/-!
# Leading terms of Witt vector multiplication
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
The goal of this file is to study the leading terms of the formula for the `n+1`st coefficient
of a product of Witt vectors `x` and `y` over a ring of characteristic `p`.
We aim to isolate the `n+1`st coefficients of `x` and `y`, and express the rest of the product
mathlib commit https://github.com/leanprover-community/mathlib/commit/8b981918a93bc45a8600de608cde7944a80d92b9
@@ -45,6 +45,7 @@ open Finset MvPolynomial
open scoped BigOperators
+#print WittVector.wittPolyProd /-
/-- ```
(β i in range n, (y.coeff i)^(p^(n-i)) * p^i.val) *
(β i in range n, (y.coeff i)^(p^(n-i)) * p^i.val)
@@ -54,8 +55,10 @@ def wittPolyProd (n : β) : MvPolynomial (Fin 2 Γ β) β€ :=
rename (Prod.mk (0 : Fin 2)) (wittPolynomial p β€ n) *
rename (Prod.mk (1 : Fin 2)) (wittPolynomial p β€ n)
#align witt_vector.witt_poly_prod WittVector.wittPolyProd
+-/
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
+#print WittVector.wittPolyProd_vars /-
theorem wittPolyProd_vars (n : β) : (wittPolyProd p n).vars β univ ΓΛ’ range (n + 1) :=
by
rw [witt_poly_prod]
@@ -64,13 +67,17 @@ theorem wittPolyProd_vars (n : β) : (wittPolyProd p n).vars β univ ΓΛ’ rang
Β· refine' subset.trans (vars_rename _ _) _
simp [wittPolynomial_vars, image_subset_iff]
#align witt_vector.witt_poly_prod_vars WittVector.wittPolyProd_vars
+-/
+#print WittVector.wittPolyProdRemainder /-
/-- The "remainder term" of `witt_vector.witt_poly_prod`. See `mul_poly_of_interest_aux2`. -/
def wittPolyProdRemainder (n : β) : MvPolynomial (Fin 2 Γ β) β€ :=
β i in range n, p ^ i * wittMul p i ^ p ^ (n - i)
#align witt_vector.witt_poly_prod_remainder WittVector.wittPolyProdRemainder
+-/
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
+#print WittVector.wittPolyProdRemainder_vars /-
theorem wittPolyProdRemainder_vars (n : β) : (wittPolyProdRemainder p n).vars β univ ΓΛ’ range n :=
by
rw [witt_poly_prod_remainder]
@@ -89,7 +96,9 @@ theorem wittPolyProdRemainder_vars (n : β) : (wittPolyProdRemainder p n).vars
simp only [mem_range, range_subset] at hx β’
exact hx
#align witt_vector.witt_poly_prod_remainder_vars WittVector.wittPolyProdRemainder_vars
+-/
+#print WittVector.remainder /-
/-- `remainder p n` represents the remainder term from `mul_poly_of_interest_aux3`.
`witt_poly_prod p (n+1)` will have variables up to `n+1`,
but `remainder` will only have variables up to `n`.
@@ -100,8 +109,10 @@ def remainder (n : β) : MvPolynomial (Fin 2 Γ β) β€ :=
β x : β in range (n + 1),
(rename (Prod.mk 1)) ((monomial (Finsupp.single x (p ^ (n + 1 - x)))) (βp ^ x))
#align witt_vector.remainder WittVector.remainder
+-/
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
+#print WittVector.remainder_vars /-
theorem remainder_vars (n : β) : (remainder p n).vars β univ ΓΛ’ range (n + 1) :=
by
rw [remainder]
@@ -116,15 +127,19 @@ theorem remainder_vars (n : β) : (remainder p n).vars β univ ΓΛ’ range (n +
Β· apply pow_ne_zero
exact_mod_cast hp.out.ne_zero
#align witt_vector.remainder_vars WittVector.remainder_vars
+-/
+#print WittVector.polyOfInterest /-
/-- This is the polynomial whose degree we want to get a handle on. -/
def polyOfInterest (n : β) : MvPolynomial (Fin 2 Γ β) β€ :=
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))
#align witt_vector.poly_of_interest WittVector.polyOfInterest
+-/
-theorem mul_poly_of_interest_aux1 (n : β) :
+#print WittVector.mul_polyOfInterest_aux1 /-
+theorem mul_polyOfInterest_aux1 (n : β) :
(β i in range (n + 1), p ^ i * wittMul p i ^ p ^ (n - i) : MvPolynomial (Fin 2 Γ β) β€) =
wittPolyProd p n :=
by
@@ -142,18 +157,22 @@ theorem mul_poly_of_interest_aux1 (n : β) :
simp only [bindβ_monomial, hsupp, Int.cast_ofNat, prod_singleton, eq_intCast,
Finsupp.single_eq_same, C_pow, mul_eq_mul_left_iff, true_or_iff, eq_self_iff_true]
Β· simp only [map_mul, bindβ_X_right]
-#align witt_vector.mul_poly_of_interest_aux1 WittVector.mul_poly_of_interest_aux1
+#align witt_vector.mul_poly_of_interest_aux1 WittVector.mul_polyOfInterest_aux1
+-/
-theorem mul_poly_of_interest_aux2 (n : β) :
+#print WittVector.mul_polyOfInterest_aux2 /-
+theorem mul_polyOfInterest_aux2 (n : β) :
(p ^ n * wittMul p n : MvPolynomial (Fin 2 Γ β) β€) + wittPolyProdRemainder p n =
wittPolyProd p n :=
by
convert mul_poly_of_interest_aux1 p n
rw [sum_range_succ, add_comm, Nat.sub_self, pow_zero, pow_one]
rfl
-#align witt_vector.mul_poly_of_interest_aux2 WittVector.mul_poly_of_interest_aux2
+#align witt_vector.mul_poly_of_interest_aux2 WittVector.mul_polyOfInterest_aux2
+-/
-theorem mul_poly_of_interest_aux3 (n : β) :
+#print WittVector.mul_polyOfInterest_aux3 /-
+theorem mul_polyOfInterest_aux3 (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)) +
@@ -180,9 +199,11 @@ theorem mul_poly_of_interest_aux3 (n : β) :
simp only [rename_monomial, β C_mul_X_pow_eq_monomial, map_mul, rename_C, pow_one, rename_X]
simp only [mvpz, Int.cast_ofNat, map_pow, eq_intCast, rename_X, pow_one, tsub_self, pow_zero]
ring1
-#align witt_vector.mul_poly_of_interest_aux3 WittVector.mul_poly_of_interest_aux3
+#align witt_vector.mul_poly_of_interest_aux3 WittVector.mul_polyOfInterest_aux3
+-/
-theorem mul_poly_of_interest_aux4 (n : β) :
+#print WittVector.mul_polyOfInterest_aux4 /-
+theorem mul_polyOfInterest_aux4 (n : β) :
(p ^ (n + 1) * wittMul p (n + 1) : MvPolynomial (Fin 2 Γ β) β€) =
-(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)) +
@@ -191,8 +212,10 @@ theorem mul_poly_of_interest_aux4 (n : β) :
by
rw [β add_sub_assoc, eq_sub_iff_add_eq, mul_poly_of_interest_aux2]
exact mul_poly_of_interest_aux3 _ _
-#align witt_vector.mul_poly_of_interest_aux4 WittVector.mul_poly_of_interest_aux4
+#align witt_vector.mul_poly_of_interest_aux4 WittVector.mul_polyOfInterest_aux4
+-/
+#print WittVector.mul_polyOfInterest_aux5 /-
theorem mul_polyOfInterest_aux5 (n : β) :
(p ^ (n + 1) : MvPolynomial (Fin 2 Γ β) β€) * polyOfInterest p n =
remainder p n - wittPolyProdRemainder p (n + 1) :=
@@ -201,8 +224,10 @@ theorem mul_polyOfInterest_aux5 (n : β) :
rw [mul_poly_of_interest_aux4 p n]
ring
#align witt_vector.mul_poly_of_interest_aux5 WittVector.mul_polyOfInterest_aux5
+-/
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
+#print WittVector.mul_polyOfInterest_vars /-
theorem mul_polyOfInterest_vars (n : β) :
((p ^ (n + 1) : MvPolynomial (Fin 2 Γ β) β€) * polyOfInterest p n).vars β
univ ΓΛ’ range (n + 1) :=
@@ -213,7 +238,9 @@ theorem mul_polyOfInterest_vars (n : β) :
Β· apply remainder_vars
Β· apply witt_poly_prod_remainder_vars
#align witt_vector.mul_poly_of_interest_vars WittVector.mul_polyOfInterest_vars
+-/
+#print WittVector.polyOfInterest_vars_eq /-
theorem polyOfInterest_vars_eq (n : β) :
(polyOfInterest p n).vars =
((p ^ (n + 1) : MvPolynomial (Fin 2 Γ β) β€) *
@@ -227,12 +254,16 @@ theorem polyOfInterest_vars_eq (n : β) :
apply pow_ne_zero
exact_mod_cast hp.out.ne_zero
#align witt_vector.poly_of_interest_vars_eq WittVector.polyOfInterest_vars_eq
+-/
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
+#print WittVector.polyOfInterest_vars /-
theorem polyOfInterest_vars (n : β) : (polyOfInterest p n).vars β univ ΓΛ’ range (n + 1) := by
rw [poly_of_interest_vars_eq] <;> apply mul_poly_of_interest_vars
#align witt_vector.poly_of_interest_vars WittVector.polyOfInterest_vars
+-/
+#print WittVector.peval_polyOfInterest /-
theorem 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) -
@@ -246,14 +277,16 @@ theorem peval_polyOfInterest (n : β) (x y : π k) :
have mvpz : (p : MvPolynomial β β€) = MvPolynomial.C βp := by rw [eq_intCast, Int.cast_ofNat]
have : β (f : β€ β+* k) (g : β β k), evalβ f g p = f p := by intros;
rw [mvpz, MvPolynomial.evalβ_C]
- simp [wittPolynomial_eq_sum_c_mul_x_pow, aeval, evalβ_rename, this, mul_coeff, peval, map_natCast,
+ simp [wittPolynomial_eq_sum_C_mul_X_pow, aeval, evalβ_rename, this, mul_coeff, peval, map_natCast,
map_add, map_pow, map_mul]
#align witt_vector.peval_poly_of_interest WittVector.peval_polyOfInterest
+-/
variable [CharP k p]
+#print WittVector.peval_polyOfInterest' /-
/-- The characteristic `p` version of `peval_poly_of_interest` -/
-theorem peval_poly_of_interest' (n : β) (x y : π k) :
+theorem 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) :=
@@ -273,10 +306,12 @@ theorem peval_poly_of_interest' (n : β) (x y : π k) :
Β· intro j _ hj
simp [zero_pow (zero_lt_iff.mpr hj)]
congr <;> apply sum_zero_pow_mul_pow_p
-#align witt_vector.peval_poly_of_interest' WittVector.peval_poly_of_interest'
+#align witt_vector.peval_poly_of_interest' WittVector.peval_polyOfInterest'
+-/
variable (k)
+#print WittVector.nth_mul_coeff' /-
theorem nth_mul_coeff' (n : β) :
β f : TruncatedWittVector p (n + 1) k β TruncatedWittVector p (n + 1) k β k,
β x y : π k,
@@ -311,7 +346,9 @@ theorem nth_mul_coeff' (n : β) :
fin_cases i <;>-- surely this case split is not necessary
Β· simpa only using x.coeff_truncate_fun β¨m, ha'β©
#align witt_vector.nth_mul_coeff' WittVector.nth_mul_coeff'
+-/
+#print WittVector.nth_mul_coeff /-
theorem nth_mul_coeff (n : β) :
β f : TruncatedWittVector p (n + 1) k β TruncatedWittVector p (n + 1) k β k,
β x y : π k,
@@ -325,22 +362,27 @@ theorem nth_mul_coeff (n : β) :
rw [hf x y]
ring
#align witt_vector.nth_mul_coeff WittVector.nth_mul_coeff
+-/
variable {k}
+#print WittVector.nthRemainder /-
/--
Produces the "remainder function" of the `n+1`st coefficient, which does not depend on the `n+1`st
coefficients of the inputs. -/
def nthRemainder (n : β) : (Fin (n + 1) β k) β (Fin (n + 1) β k) β k :=
Classical.choose (nth_mul_coeff p k n)
#align witt_vector.nth_remainder WittVector.nthRemainder
+-/
+#print WittVector.nthRemainder_spec /-
theorem 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) _ _
#align witt_vector.nth_remainder_spec WittVector.nthRemainder_spec
+-/
end WittVector
mathlib commit https://github.com/leanprover-community/mathlib/commit/9fb8964792b4237dac6200193a0d533f1b3f7423
@@ -39,7 +39,6 @@ variable (p : β) [hp : Fact p.Prime]
variable {k : Type _} [CommRing k]
--- mathport name: exprπ
local notation "π" => WittVector p
open Finset MvPolynomial
@@ -56,8 +55,6 @@ def wittPolyProd (n : β) : MvPolynomial (Fin 2 Γ β) β€ :=
rename (Prod.mk (1 : Fin 2)) (wittPolynomial p β€ n)
#align witt_vector.witt_poly_prod WittVector.wittPolyProd
-include hp
-
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
theorem wittPolyProd_vars (n : β) : (wittPolyProd p n).vars β univ ΓΛ’ range (n + 1) :=
by
@@ -93,8 +90,6 @@ theorem wittPolyProdRemainder_vars (n : β) : (wittPolyProdRemainder p n).vars
exact hx
#align witt_vector.witt_poly_prod_remainder_vars WittVector.wittPolyProdRemainder_vars
-omit hp
-
/-- `remainder p n` represents the remainder term from `mul_poly_of_interest_aux3`.
`witt_poly_prod p (n+1)` will have variables up to `n+1`,
but `remainder` will only have variables up to `n`.
@@ -106,8 +101,6 @@ def remainder (n : β) : MvPolynomial (Fin 2 Γ β) β€ :=
(rename (Prod.mk 1)) ((monomial (Finsupp.single x (p ^ (n + 1 - x)))) (βp ^ x))
#align witt_vector.remainder WittVector.remainder
-include hp
-
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
theorem remainder_vars (n : β) : (remainder p n).vars β univ ΓΛ’ range (n + 1) :=
by
@@ -160,8 +153,6 @@ theorem mul_poly_of_interest_aux2 (n : β) :
rfl
#align witt_vector.mul_poly_of_interest_aux2 WittVector.mul_poly_of_interest_aux2
-omit hp
-
theorem mul_poly_of_interest_aux3 (n : β) :
wittPolyProd p (n + 1) =
-(p ^ (n + 1) * X (0, n + 1)) * (p ^ (n + 1) * X (1, n + 1)) +
@@ -191,8 +182,6 @@ theorem mul_poly_of_interest_aux3 (n : β) :
ring1
#align witt_vector.mul_poly_of_interest_aux3 WittVector.mul_poly_of_interest_aux3
-include hp
-
theorem mul_poly_of_interest_aux4 (n : β) :
(p ^ (n + 1) * wittMul p (n + 1) : MvPolynomial (Fin 2 Γ β) β€) =
-(p ^ (n + 1) * X (0, n + 1)) * (p ^ (n + 1) * X (1, n + 1)) +
mathlib commit https://github.com/leanprover-community/mathlib/commit/a3e83f0fa4391c8740f7d773a7a9b74e311ae2a3
@@ -246,8 +246,8 @@ theorem polyOfInterest_vars (n : β) : (polyOfInterest p n).vars β univ ΓΛ’
theorem 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 in range (n + 1 + 1), p ^ i * x.coeff i ^ p ^ (n + 1 - i)) -
+ (x * y).coeff (n + 1) + p ^ (n + 1) * x.coeff (n + 1) * y.coeff (n + 1) -
+ y.coeff (n + 1) * β i in range (n + 1 + 1), p ^ i * x.coeff i ^ p ^ (n + 1 - i) -
x.coeff (n + 1) * β i in range (n + 1 + 1), p ^ i * y.coeff i ^ p ^ (n + 1 - i) :=
by
simp only [poly_of_interest, peval, map_natCast, Matrix.head_cons, map_pow,
@@ -275,8 +275,7 @@ theorem peval_poly_of_interest' (n : β) (x y : π k) :
zero_pow']
have sum_zero_pow_mul_pow_p :
β y : π k,
- (β x : β in range (n + 1 + 1), 0 ^ x * y.coeff x ^ p ^ (n + 1 - x)) =
- y.coeff 0 ^ p ^ (n + 1) :=
+ β x : β in range (n + 1 + 1), 0 ^ x * y.coeff x ^ p ^ (n + 1 - x) = y.coeff 0 ^ p ^ (n + 1) :=
by
intro y
rw [Finset.sum_eq_single_of_mem 0]
mathlib commit https://github.com/leanprover-community/mathlib/commit/cca40788df1b8755d5baf17ab2f27dacc2e17acb
@@ -89,7 +89,7 @@ theorem wittPolyProdRemainder_vars (n : β) : (wittPolyProdRemainder p n).vars
Β· apply subset.trans (vars_pow _ _)
apply subset.trans (witt_mul_vars _ _)
apply product_subset_product (subset.refl _)
- simp only [mem_range, range_subset] at hxβ’
+ simp only [mem_range, range_subset] at hx β’
exact hx
#align witt_vector.witt_poly_prod_remainder_vars WittVector.wittPolyProdRemainder_vars
@@ -255,7 +255,7 @@ theorem peval_polyOfInterest (n : β) (x y : π k) :
map_sub]
rw [sub_sub, add_comm (_ * _), β sub_sub]
have mvpz : (p : MvPolynomial β β€) = MvPolynomial.C βp := by rw [eq_intCast, Int.cast_ofNat]
- have : β (f : β€ β+* k) (g : β β k), evalβ f g p = f p := by intros ;
+ have : β (f : β€ β+* k) (g : β β k), evalβ f g p = f p := by intros;
rw [mvpz, MvPolynomial.evalβ_C]
simp [wittPolynomial_eq_sum_c_mul_x_pow, aeval, evalβ_rename, this, mul_coeff, peval, map_natCast,
map_add, map_pow, map_mul]
@@ -305,7 +305,7 @@ theorem nth_mul_coeff' (n : β) :
rintro β¨a, haβ©
apply Function.uncurry ![x, y]
simp only [true_and_iff, Multiset.mem_cons, range_val, product_val, Multiset.mem_range,
- Multiset.mem_product, Multiset.range_succ, mem_univ_val] at ha
+ Multiset.mem_product, Multiset.range_succ, mem_univ_val] at ha
refine' β¨a.fst, β¨a.snd, _β©β©
cases' ha with ha ha <;> linarith only [ha]
use f
@@ -318,7 +318,7 @@ theorem nth_mul_coeff' (n : β) :
cases' a with a ha
cases' a with i m
simp only [true_and_iff, Multiset.mem_cons, range_val, product_val, Multiset.mem_range,
- Multiset.mem_product, Multiset.range_succ, mem_univ_val] at ha
+ Multiset.mem_product, Multiset.range_succ, mem_univ_val] at ha
have ha' : m < n + 1 := by cases' ha with ha ha <;> linarith only [ha]
fin_cases i <;>-- surely this case split is not necessary
Β· simpa only using x.coeff_truncate_fun β¨m, ha'β©
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -44,7 +44,7 @@ local notation "π" => WittVector p
open Finset MvPolynomial
-open BigOperators
+open scoped BigOperators
/-- ```
(β i in range n, (y.coeff i)^(p^(n-i)) * p^i.val) *
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -255,9 +255,7 @@ theorem peval_polyOfInterest (n : β) (x y : π k) :
map_sub]
rw [sub_sub, add_comm (_ * _), β sub_sub]
have mvpz : (p : MvPolynomial β β€) = MvPolynomial.C βp := by rw [eq_intCast, Int.cast_ofNat]
- have : β (f : β€ β+* k) (g : β β k), evalβ f g p = f p :=
- by
- intros
+ have : β (f : β€ β+* k) (g : β β k), evalβ f g p = f p := by intros ;
rw [mvpz, MvPolynomial.evalβ_C]
simp [wittPolynomial_eq_sum_c_mul_x_pow, aeval, evalβ_rename, this, mul_coeff, peval, map_natCast,
map_add, map_pow, map_mul]
mathlib commit https://github.com/leanprover-community/mathlib/commit/0b9eaaa7686280fad8cce467f5c3c57ee6ce77f8
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Robert Y. Lewis, Heather Macbeth
! This file was ported from Lean 3 source module ring_theory.witt_vector.mul_coeff
-! leanprover-community/mathlib commit 43a289b563d533cfb00f58b812d222371f6f6fac
+! leanprover-community/mathlib commit 2f5b500a507264de86d666a5f87ddb976e2d8de4
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
@@ -63,8 +63,8 @@ theorem wittPolyProd_vars (n : β) : (wittPolyProd p n).vars β univ ΓΛ’ rang
by
rw [witt_poly_prod]
apply subset.trans (vars_mul _ _)
- apply union_subset <;>
- Β· apply subset.trans (vars_rename _ _)
+ refine' union_subset _ _ <;>
+ Β· refine' subset.trans (vars_rename _ _) _
simp [wittPolynomial_vars, image_subset_iff]
#align witt_vector.witt_poly_prod_vars WittVector.wittPolyProd_vars
@@ -77,11 +77,11 @@ def wittPolyProdRemainder (n : β) : MvPolynomial (Fin 2 Γ β) β€ :=
theorem wittPolyProdRemainder_vars (n : β) : (wittPolyProdRemainder p n).vars β univ ΓΛ’ range n :=
by
rw [witt_poly_prod_remainder]
- apply subset.trans (vars_sum_subset _ _)
+ refine' subset.trans (vars_sum_subset _ _) _
rw [bUnion_subset]
intro x hx
apply subset.trans (vars_mul _ _)
- apply union_subset
+ refine' union_subset _ _
Β· apply subset.trans (vars_pow _ _)
have : (p : MvPolynomial (Fin 2 Γ β) β€) = C (p : β€) := by simp only [Int.cast_ofNat, eq_intCast]
rw [this, vars_C]
@@ -113,8 +113,8 @@ theorem remainder_vars (n : β) : (remainder p n).vars β univ ΓΛ’ range (n +
by
rw [remainder]
apply subset.trans (vars_mul _ _)
- apply union_subset <;>
- Β· apply subset.trans (vars_sum_subset _ _)
+ refine' union_subset _ _ <;>
+ Β· refine' subset.trans (vars_sum_subset _ _) _
rw [bUnion_subset]
intro x hx
rw [rename_monomial, vars_monomial, Finsupp.mapDomain_single]
@@ -220,7 +220,7 @@ theorem mul_polyOfInterest_vars (n : β) :
by
rw [mul_poly_of_interest_aux5]
apply subset.trans (vars_sub_subset _ _)
- apply union_subset
+ refine' union_subset _ _
Β· apply remainder_vars
Β· apply witt_poly_prod_remainder_vars
#align witt_vector.mul_poly_of_interest_vars WittVector.mul_polyOfInterest_vars
mathlib commit https://github.com/leanprover-community/mathlib/commit/1a313d8bba1bad05faba71a4a4e9742ab5bd9efd
@@ -126,9 +126,9 @@ theorem remainder_vars (n : β) : (remainder p n).vars β univ ΓΛ’ range (n +
/-- This is the polynomial whose degree we want to get a handle on. -/
def polyOfInterest (n : β) : MvPolynomial (Fin 2 Γ β) β€ :=
- 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))
+ 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))
#align witt_vector.poly_of_interest WittVector.polyOfInterest
theorem mul_poly_of_interest_aux1 (n : β) :
@@ -164,13 +164,13 @@ omit hp
theorem mul_poly_of_interest_aux3 (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)) +
+ -(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
-- a useful auxiliary fact
- have mvpz : (p ^ (n + 1) : MvPolynomial (Fin 2 Γ β) β€) = MvPolynomial.c (βp ^ (n + 1)) := by
+ have mvpz : (p ^ (n + 1) : MvPolynomial (Fin 2 Γ β) β€) = MvPolynomial.C (βp ^ (n + 1)) := by
simp only [Int.cast_ofNat, eq_intCast, C_pow, eq_self_iff_true]
-- unfold definitions and peel off the last entries of the sums.
rw [witt_poly_prod, wittPolynomial, AlgHom.map_sum, AlgHom.map_sum, sum_range_succ]
@@ -195,9 +195,9 @@ include hp
theorem mul_poly_of_interest_aux4 (n : β) :
(p ^ (n + 1) * wittMul p (n + 1) : MvPolynomial (Fin 2 Γ β) β€) =
- -(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)) +
+ -(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_poly_of_interest_aux2]
@@ -228,9 +228,9 @@ theorem mul_polyOfInterest_vars (n : β) :
theorem polyOfInterest_vars_eq (n : β) :
(polyOfInterest p n).vars =
((p ^ (n + 1) : MvPolynomial (Fin 2 Γ β) β€) *
- (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 :=
+ (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) : MvPolynomial (Fin 2 Γ β) β€) = C (p ^ (n + 1) : β€) := by
simp only [Int.cast_ofNat, eq_intCast, C_pow, eq_self_iff_true]
@@ -254,11 +254,11 @@ theorem peval_polyOfInterest (n : β) (x y : π k) :
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]
- have mvpz : (p : MvPolynomial β β€) = MvPolynomial.c βp := by rw [eq_intCast, Int.cast_ofNat]
+ have mvpz : (p : MvPolynomial β β€) = MvPolynomial.C βp := by rw [eq_intCast, Int.cast_ofNat]
have : β (f : β€ β+* k) (g : β β k), evalβ f g p = f p :=
by
intros
- rw [mvpz, MvPolynomial.evalβ_c]
+ rw [mvpz, MvPolynomial.evalβ_C]
simp [wittPolynomial_eq_sum_c_mul_x_pow, aeval, evalβ_rename, this, mul_coeff, peval, map_natCast,
map_add, map_pow, map_mul]
#align witt_vector.peval_poly_of_interest WittVector.peval_polyOfInterest
mathlib commit https://github.com/leanprover-community/mathlib/commit/3180fab693e2cee3bff62675571264cb8778b212
@@ -273,7 +273,8 @@ theorem peval_poly_of_interest' (n : β) (x y : π k) :
by
rw [peval_poly_of_interest]
have : (p : k) = 0 := CharP.cast_eq_zero k p
- simp only [this, add_zero, zero_mul, Nat.succ_ne_zero, Ne.def, not_false_iff, zero_pow']
+ simp only [this, add_zero, MulZeroClass.zero_mul, Nat.succ_ne_zero, Ne.def, not_false_iff,
+ zero_pow']
have sum_zero_pow_mul_pow_p :
β y : π k,
(β x : β in range (n + 1 + 1), 0 ^ x * y.coeff x ^ p ^ (n + 1 - x)) =
mathlib commit https://github.com/leanprover-community/mathlib/commit/bd9851ca476957ea4549eb19b40e7b5ade9428cc
OfNat
and Nat.cast
lemmas (#11861)
This renames
Int.cast_ofNat
to Int.cast_natCast
Int.int_cast_ofNat
to Int.cast_ofNat
I think the history here is that this lemma was previously about Int.ofNat
, before we globally fixed the simp-normal form to be Nat.cast
.
Since the Int.cast_ofNat
name is repurposed, it can't be deprecated. Int.int_cast_ofNat
is such a wonky name that it was probably never used.
@@ -77,7 +77,7 @@ theorem wittPolyProdRemainder_vars (n : β) :
apply Subset.trans (vars_mul _ _)
refine' union_subset _ _
Β· apply Subset.trans (vars_pow _ _)
- have : (p : π) = C (p : β€) := by simp only [Int.cast_ofNat, eq_intCast]
+ have : (p : π) = C (p : β€) := by simp only [Int.cast_natCast, eq_intCast]
rw [this, vars_C]
apply empty_subset
Β· apply Subset.trans (vars_pow _ _)
@@ -131,7 +131,7 @@ theorem mul_polyOfInterest_aux1 (n : β) :
rw [Finsupp.support_eq_singleton]
simp only [and_true_iff, Finsupp.single_eq_same, eq_self_iff_true, Ne]
exact pow_ne_zero _ hp.out.ne_zero
- simp only [bindβ_monomial, hsupp, Int.cast_ofNat, prod_singleton, eq_intCast,
+ simp only [bindβ_monomial, hsupp, Int.cast_natCast, prod_singleton, eq_intCast,
Finsupp.single_eq_same, C_pow, mul_eq_mul_left_iff, true_or_iff, eq_self_iff_true,
Int.cast_pow]
Β· simp only [map_mul, bindβ_X_right]
Data
(#11751)
Polynomial
and MvPolynomial
are algebraic objects, hence should be under Algebra
(or at least not under Data
)
@@ -3,8 +3,8 @@ Copyright (c) 2022 Robert Y. Lewis. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Robert Y. Lewis, Heather Macbeth
-/
+import Mathlib.Algebra.MvPolynomial.Supported
import Mathlib.RingTheory.WittVector.Truncated
-import Mathlib.Data.MvPolynomial.Supported
#align_import ring_theory.witt_vector.mul_coeff from "leanprover-community/mathlib"@"2f5b500a507264de86d666a5f87ddb976e2d8de4"
@@ -129,7 +129,7 @@ theorem mul_polyOfInterest_aux1 (n : β) :
congr 1
have hsupp : (Finsupp.single i (p ^ (n - i))).support = {i} := by
rw [Finsupp.support_eq_singleton]
- simp only [and_true_iff, Finsupp.single_eq_same, eq_self_iff_true, Ne.def]
+ simp only [and_true_iff, Finsupp.single_eq_same, eq_self_iff_true, Ne]
exact pow_ne_zero _ hp.out.ne_zero
simp only [bindβ_monomial, hsupp, Int.cast_ofNat, prod_singleton, eq_intCast,
Finsupp.single_eq_same, C_pow, mul_eq_mul_left_iff, true_or_iff, eq_self_iff_true,
Empty lines were removed by executing the following Python script twice
import os
import re
# Loop through each file in the repository
for dir_path, dirs, files in os.walk('.'):
for filename in files:
if filename.endswith('.lean'):
file_path = os.path.join(dir_path, filename)
# Open the file and read its contents
with open(file_path, 'r') as file:
content = file.read()
# Use a regular expression to replace sequences of "variable" lines separated by empty lines
# with sequences without empty lines
modified_content = re.sub(r'(variable.*\n)\n(variable(?! .* in))', r'\1\2', content)
# Write the modified content back to the file
with open(file_path, 'w') as file:
file.write(modified_content)
@@ -33,7 +33,6 @@ noncomputable section
namespace WittVector
variable (p : β) [hp : Fact p.Prime]
-
variable {k : Type*} [CommRing k]
local notation "π" => WittVector p
I ran tryAtEachStep on all files under Mathlib
to find all locations where omega
succeeds. For each that was a linarith
without an only
, I tried replacing it with omega
, and I verified that elaboration time got smaller. (In almost all cases, there was a noticeable speedup.) I also replaced some slow aesop
s along the way.
@@ -267,7 +267,7 @@ theorem nth_mul_coeff' (n : β) :
simp_rw [product_val, this, Multiset.mem_product, mem_univ_val, true_and_iff, range_val,
Multiset.range_succ, Multiset.mem_cons, Multiset.mem_range] at ha
refine' β¨a.fst, β¨a.snd, _β©β©
- cases' ha with ha ha <;> linarith only [ha]
+ cases' ha with ha ha <;> omega
use f
intro x y
dsimp [f, peval]
@@ -270,7 +270,7 @@ theorem nth_mul_coeff' (n : β) :
cases' ha with ha ha <;> linarith only [ha]
use f
intro x y
- dsimp [peval]
+ dsimp [f, peval]
rw [β hfβ]
congr
ext a
f ^ n
(#9617)
This involves moving lemmas from Algebra.GroupPower.Ring
to Algebra.GroupWithZero.Basic
and changing some 0 < n
assumptions to n β 0
.
From LeanAPAP
@@ -241,16 +241,11 @@ theorem peval_polyOfInterest' (n : β) (x y : π k) :
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, Nat.cast_pow, ne_eq, add_eq_zero, and_false, zero_pow', zero_mul, add_zero,
+ simp only [this, Nat.cast_pow, ne_eq, add_eq_zero, and_false, zero_pow, zero_mul, add_zero,
not_false_eq_true]
- have sum_zero_pow_mul_pow_p : β y : π k, β x : β in range (n + 1 + 1),
+ have sum_zero_pow_mul_pow_p (y : π k) : β x : β in range (n + 1 + 1),
(0 : k) ^ x * y.coeff x ^ p ^ (n + 1 - x) = y.coeff 0 ^ p ^ (n + 1) := by
- intro y
- rw [Finset.sum_eq_single_of_mem 0]
- Β· simp
- Β· simp
- Β· intro j _ hj
- simp [zero_pow (zero_lt_iff.mpr hj)]
+ rw [Finset.sum_eq_single_of_mem 0] <;> simp (config := { contextual := true })
congr <;> apply sum_zero_pow_mul_pow_p
#align witt_vector.peval_poly_of_interest' WittVector.peval_polyOfInterest'
exact_mod_cast
tactic with mod_cast
elaborator where possible (#8404)
We still have the exact_mod_cast
tactic, used in a few places, which somehow (?) works a little bit harder to prevent the expected type influencing the elaboration of the term. I would like to get to the bottom of this, and it will be easier once the only usages of exact_mod_cast
are the ones that don't work using the term elaborator by itself.
Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
@@ -110,7 +110,7 @@ theorem remainder_vars (n : β) : (remainder p n).vars β univ ΓΛ’ range (n +
Β· apply Subset.trans Finsupp.support_single_subset
simpa using mem_range.mp hx
Β· apply pow_ne_zero
- exact_mod_cast hp.out.ne_zero
+ exact mod_cast hp.out.ne_zero
#align witt_vector.remainder_vars WittVector.remainder_vars
/-- This is the polynomial whose degree we want to get a handle on. -/
@@ -212,7 +212,7 @@ theorem polyOfInterest_vars_eq (n : β) : (polyOfInterest p n).vars =
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
+ exact mod_cast hp.out.ne_zero
#align witt_vector.poly_of_interest_vars_eq WittVector.polyOfInterest_vars_eq
theorem polyOfInterest_vars (n : β) : (polyOfInterest p n).vars β univ ΓΛ’ range (n + 1) := by
This is the supremum of
along with some minor fixes from failures on nightly-testing as Mathlib master
is merged into it.
Note that some PRs for changes that are already compatible with the current toolchain and will be necessary have already been split out: #8380.
I am hopeful that in future we will be able to progressively merge adaptation PRs into a bump/v4.X.0
branch, so we never end up with a "big merge" like this. However one of these adaptation PRs (#8056) predates my new scheme for combined CI, and it wasn't possible to keep that PR viable in the meantime.
In particular this includes adjustments for the Lean PRs
We can get rid of all the
local macro_rules | `($x ^ $y) => `(HPow.hPow $x $y) -- Porting note: See issue [lean4#2220](https://github.com/leanprover/lean4/pull/2220)
macros across Mathlib (and in any projects that want to write natural number powers of reals).
Changes the default behaviour of simp
to (config := {decide := false})
. This makes simp
(and consequentially norm_num
) less powerful, but also more consistent, and less likely to blow up in long failures. This requires a variety of changes: changing some previously by simp
or norm_num
to decide
or rfl
, or adding (config := {decide := true})
.
This changed the behaviour of simp
so that simp [f]
will only unfold "fully applied" occurrences of f
. The old behaviour can be recovered with simp (config := { unfoldPartialApp := true })
. We may in future add a syntax for this, e.g. simp [!f]
; please provide feedback! In the meantime, we have made the following changes:
(config := { unfoldPartialApp := true })
in some places, to recover the old behaviour@[eqns]
to manually adjust the equation lemmas for a particular definition, recovering the old behaviour just for that definition. See #8371, where we do this for Function.comp
and Function.flip
.This change in Lean may require further changes down the line (e.g. adding the !f
syntax, and/or upstreaming the special treatment for Function.comp
and Function.flip
, and/or removing this special treatment). Please keep an open and skeptical mind about these changes!
Co-authored-by: leanprover-community-mathlib4-bot <leanprover-community-mathlib4-bot@users.noreply.github.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Mauricio Collares <mauricio@collares.org>
@@ -30,8 +30,6 @@ that needs to happen in characteristic 0.
noncomputable section
-local macro_rules | `($x ^ $y) => `(HPow.hPow $x $y) -- Porting note: See issue lean4#2220
-
namespace WittVector
variable (p : β) [hp : Fact p.Prime]
@@ -243,7 +241,8 @@ theorem peval_polyOfInterest' (n : β) (x y : π k) :
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, Nat.cast_pow, ne_eq, add_eq_zero, and_false, zero_pow', zero_mul, add_zero]
+ simp only [this, Nat.cast_pow, ne_eq, add_eq_zero, and_false, zero_pow', zero_mul, add_zero,
+ not_false_eq_true]
have sum_zero_pow_mul_pow_p : β y : π k, β x : β in range (n + 1 + 1),
(0 : k) ^ x * y.coeff x ^ p ^ (n + 1 - x) = y.coeff 0 ^ p ^ (n + 1) := by
intro y
@@ -153,7 +153,7 @@ theorem mul_polyOfInterest_aux3 (n : β) : wittPolyProd p (n + 1) =
(p : π) ^ (n + 1) * X (1, n + 1) * rename (Prod.mk (0 : Fin 2)) (wittPolynomial p β€ (n + 1)) +
remainder p n := by
-- a useful auxiliary fact
- have mvpz : (p : π) ^ (n + 1) = MvPolynomial.C ((p : β€) ^ (n + 1)) := by simp only; norm_cast
+ have mvpz : (p : π) ^ (n + 1) = MvPolynomial.C ((p : β€) ^ (n + 1)) := by norm_cast
-- Porting note: the original proof applies `sum_range_succ` through a non-`conv` rewrite,
-- but this does not work in Lean 4; the whole proof also times out very badly. The proof has been
-- nearly totally rewritten here and now finishes quite fast.
@@ -211,7 +211,7 @@ theorem 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 simp only; norm_cast
+ 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
@@ -230,10 +230,7 @@ theorem peval_polyOfInterest (n : β) (x y : π k) :
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]
- have mvpz : (p : MvPolynomial β β€) = MvPolynomial.C βp := by rw [eq_intCast, Int.cast_ofNat]
- have : β (f : β€ β+* k) (g : β β k), evalβ f g p = f p := by
- intros; rw [mvpz, MvPolynomial.evalβ_C]
- simp [wittPolynomial_eq_sum_C_mul_X_pow, aeval, evalβ_rename, this, mul_coeff, peval, map_natCast,
+ simp [wittPolynomial_eq_sum_C_mul_X_pow, aeval, evalβ_rename, mul_coeff, peval, map_natCast,
map_add, map_pow, map_mul]
#align witt_vector.peval_poly_of_interest WittVector.peval_polyOfInterest
@@ -281,7 +281,6 @@ theorem nth_mul_coeff' (n : β) :
intro x y
dsimp [peval]
rw [β hfβ]
- simp only [Function.uncurry_apply_pair]
congr
ext a
cases' a with a ha
Type _
and Sort _
(#6499)
We remove all possible occurences of Type _
and Sort _
in favor of Type*
and Sort*
.
This has nice performance benefits.
@@ -36,7 +36,7 @@ namespace WittVector
variable (p : β) [hp : Fact p.Prime]
-variable {k : Type _} [CommRing k]
+variable {k : Type*} [CommRing k]
local notation "π" => WittVector p
@@ -30,7 +30,7 @@ that needs to happen in characteristic 0.
noncomputable section
-local macro_rules | `($x ^ $y) => `(HPow.hPow $x $y) -- Porting note: See issue #2220
+local macro_rules | `($x ^ $y) => `(HPow.hPow $x $y) -- Porting note: See issue lean4#2220
namespace WittVector
@@ -2,15 +2,12 @@
Copyright (c) 2022 Robert Y. Lewis. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Robert Y. Lewis, Heather Macbeth
-
-! This file was ported from Lean 3 source module ring_theory.witt_vector.mul_coeff
-! leanprover-community/mathlib commit 2f5b500a507264de86d666a5f87ddb976e2d8de4
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathlib.RingTheory.WittVector.Truncated
import Mathlib.Data.MvPolynomial.Supported
+#align_import ring_theory.witt_vector.mul_coeff from "leanprover-community/mathlib"@"2f5b500a507264de86d666a5f87ddb976e2d8de4"
+
/-!
# Leading terms of Witt vector multiplication
The unported dependencies are