Theorem: WittVector.IsPoly₂.map
File: Mathlib/RingTheory/WittVector/IsPoly.lean

tactic: obtain ⟨φ, hf⟩ := hf
state_before: p : ℕ
R S : Type u
σ : Type ?u.1105645
idx : Type ?u.1105648
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : Fact (Nat.Prime p)
f : ⦃R : Type u⦄ → [inst : CommRing R] → 𝕎 R → 𝕎 R → 𝕎 R
hf : IsPoly₂ p f
g : R →+* S
x y : 𝕎 R
⊢ ↑(WittVector.map g) (f x y) = f (↑(WittVector.map g) x) (↑(WittVector.map g) y)

tactic: ext n
state_before: case mk'.intro
p : ℕ
R S : Type u
σ : Type ?u.1105645
idx : Type ?u.1105648
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : Fact (Nat.Prime p)
f : ⦃R : Type u⦄ → [inst : CommRing R] → 𝕎 R → 𝕎 R → 𝕎 R
g : R →+* S
x y : 𝕎 R
φ : ℕ → MvPolynomial (Fin 2 × ℕ) ℤ
hf : ∀ ⦃R : Type u⦄ [inst : CommRing R] (x y : 𝕎 R), (f x y).coeff = fun n => peval (φ n) ![x.coeff, y.coeff]
⊢ ↑(WittVector.map g) (f x y) = f (↑(WittVector.map g) x) (↑(WittVector.map g) y)

tactic: simp only [map_coeff, hf, map_aeval, peval, uncurry]
state_before: case mk'.intro.h
p : ℕ
R S : Type u
σ : Type ?u.1105645
idx : Type ?u.1105648
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : Fact (Nat.Prime p)
f : ⦃R : Type u⦄ → [inst : CommRing R] → 𝕎 R → 𝕎 R → 𝕎 R
g : R →+* S
x y : 𝕎 R
φ : ℕ → MvPolynomial (Fin 2 × ℕ) ℤ
hf : ∀ ⦃R : Type u⦄ [inst : CommRing R] (x y : 𝕎 R), (f x y).coeff = fun n => peval (φ n) ![x.coeff, y.coeff]
n : ℕ
⊢ coeff (↑(WittVector.map g) (f x y)) n = coeff (f (↑(WittVector.map g) x) (↑(WittVector.map g) y)) n

tactic: apply eval₂Hom_congr (RingHom.ext_int _ _) _ rfl
state_before: case mk'.intro.h
p : ℕ
R S : Type u
σ : Type ?u.1105645
idx : Type ?u.1105648
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : Fact (Nat.Prime p)
f : ⦃R : Type u⦄ → [inst : CommRing R] → 𝕎 R → 𝕎 R → 𝕎 R
g : R →+* S
x y : 𝕎 R
φ : ℕ → MvPolynomial (Fin 2 × ℕ) ℤ
hf : ∀ ⦃R : Type u⦄ [inst : CommRing R] (x y : 𝕎 R), (f x y).coeff = fun n => peval (φ n) ![x.coeff, y.coeff]
n : ℕ
⊢ ↑(eval₂Hom (RingHom.comp g (algebraMap ℤ R)) fun i => ↑g (Matrix.vecCons x.coeff ![y.coeff] i.fst i.snd)) (φ n) =
    ↑(aeval fun a => Matrix.vecCons (↑(WittVector.map g) x).coeff ![(↑(WittVector.map g) y).coeff] a.fst a.snd) (φ n)

tactic: try ext ⟨i, k⟩; fin_cases i
state_before: p : ℕ
R S : Type u
σ : Type ?u.1105645
idx : Type ?u.1105648
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : Fact (Nat.Prime p)
f : ⦃R : Type u⦄ → [inst : CommRing R] → 𝕎 R → 𝕎 R → 𝕎 R
g : R →+* S
x y : 𝕎 R
φ : ℕ → MvPolynomial (Fin 2 × ℕ) ℤ
hf : ∀ ⦃R : Type u⦄ [inst : CommRing R] (x y : 𝕎 R), (f x y).coeff = fun n => peval (φ n) ![x.coeff, y.coeff]
n : ℕ
⊢ (fun i => ↑g (Matrix.vecCons x.coeff ![y.coeff] i.fst i.snd)) = fun a =>
    Matrix.vecCons (↑(WittVector.map g) x).coeff ![(↑(WittVector.map g) y).coeff] a.fst a.snd

tactic: all_goals simp only [map_coeff, Matrix.cons_val_zero, Matrix.head_cons, Matrix.cons_val_one]
state_before: case h.mk.head
p : ℕ
R S : Type u
σ : Type ?u.1105645
idx : Type ?u.1105648
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : Fact (Nat.Prime p)
f : ⦃R : Type u⦄ → [inst : CommRing R] → 𝕎 R → 𝕎 R → 𝕎 R
g : R →+* S
x y : 𝕎 R
φ : ℕ → MvPolynomial (Fin 2 × ℕ) ℤ
hf : ∀ ⦃R : Type u⦄ [inst : CommRing R] (x y : 𝕎 R), (f x y).coeff = fun n => peval (φ n) ![x.coeff, y.coeff]
n k : ℕ
⊢ ↑g
      (Matrix.vecCons x.coeff ![y.coeff] ({ val := 0, isLt := (_ : 0 < 2) }, k).fst
        ({ val := 0, isLt := (_ : 0 < 2) }, k).snd) =
    Matrix.vecCons (↑(WittVector.map g) x).coeff ![(↑(WittVector.map g) y).coeff]
      ({ val := 0, isLt := (_ : 0 < 2) }, k).fst ({ val := 0, isLt := (_ : 0 < 2) }, k).snd

case h.mk.tail.head
p : ℕ
R S : Type u
σ : Type ?u.1105645
idx : Type ?u.1105648
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : Fact (Nat.Prime p)
f : ⦃R : Type u⦄ → [inst : CommRing R] → 𝕎 R → 𝕎 R → 𝕎 R
g : R →+* S
x y : 𝕎 R
φ : ℕ → MvPolynomial (Fin 2 × ℕ) ℤ
hf : ∀ ⦃R : Type u⦄ [inst : CommRing R] (x y : 𝕎 R), (f x y).coeff = fun n => peval (φ n) ![x.coeff, y.coeff]
n k : ℕ
⊢ ↑g
      (Matrix.vecCons x.coeff ![y.coeff] ({ val := 1, isLt := (_ : (fun a => a < 2) 1) }, k).fst
        ({ val := 1, isLt := (_ : (fun a => a < 2) 1) }, k).snd) =
    Matrix.vecCons (↑(WittVector.map g) x).coeff ![(↑(WittVector.map g) y).coeff]
      ({ val := 1, isLt := (_ : (fun a => a < 2) 1) }, k).fst ({ val := 1, isLt := (_ : (fun a => a < 2) 1) }, k).snd

tactic: all_goals
  simp only [Fin.mk_zero, Fin.mk_one, Matrix.cons_val', Matrix.empty_val', Matrix.cons_val_one,
    Matrix.cons_val_fin_one, Matrix.cons_val_zero, map_coeff, Matrix.head_fin_const]
state_before: case h.mk.head
p : ℕ
R S : Type u
σ : Type ?u.1105645
idx : Type ?u.1105648
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : Fact (Nat.Prime p)
f : ⦃R : Type u⦄ → [inst : CommRing R] → 𝕎 R → 𝕎 R → 𝕎 R
g : R →+* S
x y : 𝕎 R
φ : ℕ → MvPolynomial (Fin 2 × ℕ) ℤ
hf : ∀ ⦃R : Type u⦄ [inst : CommRing R] (x y : 𝕎 R), (f x y).coeff = fun n => peval (φ n) ![x.coeff, y.coeff]
n k : ℕ
⊢ ↑g (Matrix.vecCons x.coeff ![y.coeff] { val := 0, isLt := (_ : 0 < 2) } k) =
    Matrix.vecCons (↑(WittVector.map g) x).coeff ![(↑(WittVector.map g) y).coeff] { val := 0, isLt := (_ : 0 < 2) } k

case h.mk.tail.head
p : ℕ
R S : Type u
σ : Type ?u.1105645
idx : Type ?u.1105648
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : Fact (Nat.Prime p)
f : ⦃R : Type u⦄ → [inst : CommRing R] → 𝕎 R → 𝕎 R → 𝕎 R
g : R →+* S
x y : 𝕎 R
φ : ℕ → MvPolynomial (Fin 2 × ℕ) ℤ
hf : ∀ ⦃R : Type u⦄ [inst : CommRing R] (x y : 𝕎 R), (f x y).coeff = fun n => peval (φ n) ![x.coeff, y.coeff]
n k : ℕ
⊢ ↑g (Matrix.vecCons x.coeff ![y.coeff] { val := 1, isLt := (_ : (fun a => a < 2) 1) } k) =
    Matrix.vecCons (↑(WittVector.map g) x).coeff ![(↑(WittVector.map g) y).coeff]
      { val := 1, isLt := (_ : (fun a => a < 2) 1) } k

tactic: ext ⟨i, k⟩
state_before: p : ℕ
R S : Type u
σ : Type ?u.1105645
idx : Type ?u.1105648
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : Fact (Nat.Prime p)
f : ⦃R : Type u⦄ → [inst : CommRing R] → 𝕎 R → 𝕎 R → 𝕎 R
g : R →+* S
x y : 𝕎 R
φ : ℕ → MvPolynomial (Fin 2 × ℕ) ℤ
hf : ∀ ⦃R : Type u⦄ [inst : CommRing R] (x y : 𝕎 R), (f x y).coeff = fun n => peval (φ n) ![x.coeff, y.coeff]
n : ℕ
⊢ (fun i => ↑g (Matrix.vecCons x.coeff ![y.coeff] i.fst i.snd)) = fun a =>
    Matrix.vecCons (↑(WittVector.map g) x).coeff ![(↑(WittVector.map g) y).coeff] a.fst a.snd

tactic: fin_cases i
state_before: case h.mk
p : ℕ
R S : Type u
σ : Type ?u.1105645
idx : Type ?u.1105648
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : Fact (Nat.Prime p)
f : ⦃R : Type u⦄ → [inst : CommRing R] → 𝕎 R → 𝕎 R → 𝕎 R
g : R →+* S
x y : 𝕎 R
φ : ℕ → MvPolynomial (Fin 2 × ℕ) ℤ
hf : ∀ ⦃R : Type u⦄ [inst : CommRing R] (x y : 𝕎 R), (f x y).coeff = fun n => peval (φ n) ![x.coeff, y.coeff]
n : ℕ
i : Fin 2
k : ℕ
⊢ ↑g (Matrix.vecCons x.coeff ![y.coeff] (i, k).fst (i, k).snd) =
    Matrix.vecCons (↑(WittVector.map g) x).coeff ![(↑(WittVector.map g) y).coeff] (i, k).fst (i, k).snd

tactic: simp only [map_coeff, Matrix.cons_val_zero, Matrix.head_cons, Matrix.cons_val_one]
state_before: case h.mk.tail.head
p : ℕ
R S : Type u
σ : Type ?u.1105645
idx : Type ?u.1105648
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : Fact (Nat.Prime p)
f : ⦃R : Type u⦄ → [inst : CommRing R] → 𝕎 R → 𝕎 R → 𝕎 R
g : R →+* S
x y : 𝕎 R
φ : ℕ → MvPolynomial (Fin 2 × ℕ) ℤ
hf : ∀ ⦃R : Type u⦄ [inst : CommRing R] (x y : 𝕎 R), (f x y).coeff = fun n => peval (φ n) ![x.coeff, y.coeff]
n k : ℕ
⊢ ↑g
      (Matrix.vecCons x.coeff ![y.coeff] ({ val := 1, isLt := (_ : (fun a => a < 2) 1) }, k).fst
        ({ val := 1, isLt := (_ : (fun a => a < 2) 1) }, k).snd) =
    Matrix.vecCons (↑(WittVector.map g) x).coeff ![(↑(WittVector.map g) y).coeff]
      ({ val := 1, isLt := (_ : (fun a => a < 2) 1) }, k).fst ({ val := 1, isLt := (_ : (fun a => a < 2) 1) }, k).snd

tactic: simp only [Fin.mk_zero, Fin.mk_one, Matrix.cons_val', Matrix.empty_val', Matrix.cons_val_one,
  Matrix.cons_val_fin_one, Matrix.cons_val_zero, map_coeff, Matrix.head_fin_const]
state_before: case h.mk.tail.head
p : ℕ
R S : Type u
σ : Type ?u.1105645
idx : Type ?u.1105648
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : Fact (Nat.Prime p)
f : ⦃R : Type u⦄ → [inst : CommRing R] → 𝕎 R → 𝕎 R → 𝕎 R
g : R →+* S
x y : 𝕎 R
φ : ℕ → MvPolynomial (Fin 2 × ℕ) ℤ
hf : ∀ ⦃R : Type u⦄ [inst : CommRing R] (x y : 𝕎 R), (f x y).coeff = fun n => peval (φ n) ![x.coeff, y.coeff]
n k : ℕ
⊢ ↑g (Matrix.vecCons x.coeff ![y.coeff] { val := 1, isLt := (_ : (fun a => a < 2) 1) } k) =
    Matrix.vecCons (↑(WittVector.map g) x).coeff ![(↑(WittVector.map g) y).coeff]
      { val := 1, isLt := (_ : (fun a => a < 2) 1) } k