[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
x y : TruncatedWittVector p n R
h : x = y
i : Fin n
⊢ coeff i x = coeff i y
[PROOFSTEP]
rw [h]
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
x : TruncatedWittVector p n R
⊢ (mk p fun i => coeff i x) = x
[PROOFSTEP]
ext i
[GOAL]
case h
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
x : TruncatedWittVector p n R
i : Fin n
⊢ coeff i (mk p fun i => coeff i x) = coeff i x
[PROOFSTEP]
rw [coeff_mk]
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝ : CommRing R
x : TruncatedWittVector p n R
i : Fin n
⊢ WittVector.coeff (out x) ↑i = coeff i x
[PROOFSTEP]
rw [out]
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝ : CommRing R
x : TruncatedWittVector p n R
i : Fin n
⊢ WittVector.coeff { coeff := fun i => if h : i < n then coeff { val := i, isLt := h } x else 0 } ↑i = coeff i x
[PROOFSTEP]
dsimp only
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝ : CommRing R
x : TruncatedWittVector p n R
i : Fin n
⊢ (if h : ↑i < n then coeff { val := ↑i, isLt := h } x else 0) = coeff i x
[PROOFSTEP]
rw [dif_pos i.is_lt, Fin.eta]
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝ : CommRing R
⊢ Injective out
[PROOFSTEP]
intro x y h
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝ : CommRing R
x y : TruncatedWittVector p n R
h : out x = out y
⊢ x = y
[PROOFSTEP]
ext i
[GOAL]
case h
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝ : CommRing R
x y : TruncatedWittVector p n R
h : out x = out y
i : Fin n
⊢ coeff i x = coeff i y
[PROOFSTEP]
rw [WittVector.ext_iff] at h 
[GOAL]
case h
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝ : CommRing R
x y : TruncatedWittVector p n R
h : ∀ (n_1 : ℕ), WittVector.coeff (out x) n_1 = WittVector.coeff (out y) n_1
i : Fin n
⊢ coeff i x = coeff i y
[PROOFSTEP]
simpa only [coeff_out] using h ↑i
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
x : 𝕎 R
i : Fin n
⊢ TruncatedWittVector.coeff i (truncateFun n x) = coeff x ↑i
[PROOFSTEP]
rw [truncateFun, TruncatedWittVector.coeff_mk]
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝ : CommRing R
x : 𝕎 R
⊢ TruncatedWittVector.out (truncateFun n x) = init n x
[PROOFSTEP]
ext i
[GOAL]
case h
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝ : CommRing R
x : 𝕎 R
i : ℕ
⊢ coeff (TruncatedWittVector.out (truncateFun n x)) i = coeff (init n x) i
[PROOFSTEP]
dsimp [TruncatedWittVector.out, init, select, coeff_mk]
[GOAL]
case h
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝ : CommRing R
x : 𝕎 R
i : ℕ
⊢ (if h : i < n then TruncatedWittVector.coeff { val := i, isLt := h } (truncateFun n x) else 0) =
    if i < n then coeff x i else 0
[PROOFSTEP]
split_ifs with hi
[GOAL]
case pos
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝ : CommRing R
x : 𝕎 R
i : ℕ
hi : i < n
⊢ TruncatedWittVector.coeff { val := i, isLt := hi } (truncateFun n x) = coeff x i
case neg p : ℕ hp : Fact (Nat.Prime p) n : ℕ R : Type u_1 inst✝ : CommRing R x : 𝕎 R i : ℕ hi : ¬i < n ⊢ 0 = 0
[PROOFSTEP]
swap
[GOAL]
case neg
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝ : CommRing R
x : 𝕎 R
i : ℕ
hi : ¬i < n
⊢ 0 = 0
[PROOFSTEP]
rfl
[GOAL]
case pos
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝ : CommRing R
x : 𝕎 R
i : ℕ
hi : i < n
⊢ TruncatedWittVector.coeff { val := i, isLt := hi } (truncateFun n x) = coeff x i
[PROOFSTEP]
rw [coeff_truncateFun, Fin.val_mk]
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝ : CommRing R
x : TruncatedWittVector p n R
⊢ WittVector.truncateFun n (out x) = x
[PROOFSTEP]
simp only [WittVector.truncateFun, coeff_out, mk_coeff]
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝ : CommRing R
i : Fin n
⊢ coeff i 0 = 0
[PROOFSTEP]
show coeff i (truncateFun _ 0 : TruncatedWittVector p n R) = 0
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝ : CommRing R
i : Fin n
⊢ coeff i (truncateFun n 0) = 0
[PROOFSTEP]
rw [coeff_truncateFun, WittVector.zero_coeff]
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝ : CommRing R
x y : 𝕎 R
⊢ truncateFun n (x + y) = truncateFun n x + truncateFun n y
[PROOFSTEP]
witt_truncateFun_tac
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝ : CommRing R
x y : 𝕎 R
⊢ truncateFun n (x * y) = truncateFun n x * truncateFun n y
[PROOFSTEP]
witt_truncateFun_tac
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝ : CommRing R
x : 𝕎 R
⊢ truncateFun n (-x) = -truncateFun n x
[PROOFSTEP]
witt_truncateFun_tac
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝ : CommRing R
x y : 𝕎 R
⊢ truncateFun n (x - y) = truncateFun n x - truncateFun n y
[PROOFSTEP]
witt_truncateFun_tac
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝ : CommRing R
x : 𝕎 R
m : ℕ
⊢ truncateFun n (m • x) = m • truncateFun n x
[PROOFSTEP]
witt_truncateFun_tac
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝ : CommRing R
x : 𝕎 R
m : ℤ
⊢ truncateFun n (m • x) = m • truncateFun n x
[PROOFSTEP]
witt_truncateFun_tac
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝ : CommRing R
x : 𝕎 R
m : ℕ
⊢ truncateFun n (x ^ m) = truncateFun n x ^ m
[PROOFSTEP]
witt_truncateFun_tac
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝ : CommRing R
x : 𝕎 R
⊢ x ∈ RingHom.ker (truncate n) ↔ ∀ (i : ℕ), i < n → coeff x i = 0
[PROOFSTEP]
simp only [RingHom.mem_ker, truncate, truncateFun, RingHom.coe_mk, TruncatedWittVector.ext_iff,
  TruncatedWittVector.coeff_mk, coeff_zero]
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝ : CommRing R
x : 𝕎 R
⊢ (∀ (i : Fin n),
      TruncatedWittVector.coeff i
          (↑{ toOneHom := { toFun := truncateFun n, map_one' := (_ : truncateFun n 1 = 1) },
                map_mul' := (_ : ∀ (x y : 𝕎 R), truncateFun n (x * y) = truncateFun n x * truncateFun n y) }
            x) =
        0) ↔
    ∀ (i : ℕ), i < n → coeff x i = 0
[PROOFSTEP]
exact Fin.forall_iff
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝ : CommRing R
f : ℕ → R
⊢ ↑(truncate n) { coeff := f } = TruncatedWittVector.mk p fun k => f ↑k
[PROOFSTEP]
ext i
[GOAL]
case h
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝ : CommRing R
f : ℕ → R
i : Fin n
⊢ TruncatedWittVector.coeff i (↑(truncate n) { coeff := f }) =
    TruncatedWittVector.coeff i (TruncatedWittVector.mk p fun k => f ↑k)
[PROOFSTEP]
simp only [coeff_truncate, TruncatedWittVector.coeff_mk]
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝ : CommRing R
m : ℕ
hm : n ≤ m
⊢ RingHom.ker (WittVector.truncate m) ≤ RingHom.ker (WittVector.truncate n)
[PROOFSTEP]
intro x
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝ : CommRing R
m : ℕ
hm : n ≤ m
x : 𝕎 R
⊢ x ∈ RingHom.ker (WittVector.truncate m) → x ∈ RingHom.ker (WittVector.truncate n)
[PROOFSTEP]
simp only [WittVector.mem_ker_truncate]
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝ : CommRing R
m : ℕ
hm : n ≤ m
x : 𝕎 R
⊢ (∀ (i : ℕ), i < m → WittVector.coeff x i = 0) → ∀ (i : ℕ), i < n → WittVector.coeff x i = 0
[PROOFSTEP]
intro h i hi
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝ : CommRing R
m : ℕ
hm : n ≤ m
x : 𝕎 R
h : ∀ (i : ℕ), i < m → WittVector.coeff x i = 0
i : ℕ
hi : i < n
⊢ WittVector.coeff x i = 0
[PROOFSTEP]
exact h i (lt_of_lt_of_le hi hm)
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝ : CommRing R
n₁ n₂ n₃ : ℕ
h1 : n₁ ≤ n₂
h2 : n₂ ≤ n₃
x : TruncatedWittVector p n₃ R
⊢ ↑(truncate h1) (↑(truncate h2) x) = ↑(truncate (_ : n₁ ≤ n₃)) x
[PROOFSTEP]
obtain ⟨x, rfl⟩ := @WittVector.truncate_surjective p _ n₃ R _ x
[GOAL]
case intro
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝ : CommRing R
n₁ n₂ n₃ : ℕ
h1 : n₁ ≤ n₂
h2 : n₂ ≤ n₃
x : 𝕎 R
⊢ ↑(truncate h1) (↑(truncate h2) (↑(WittVector.truncate n₃) x)) =
    ↑(truncate (_ : n₁ ≤ n₃)) (↑(WittVector.truncate n₃) x)
[PROOFSTEP]
simp only [truncate_wittVector_truncate]
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝ : CommRing R
n₁ n₂ n₃ : ℕ
h1 : n₁ ≤ n₂
h2 : n₂ ≤ n₃
⊢ RingHom.comp (truncate h1) (truncate h2) = truncate (_ : n₁ ≤ n₃)
[PROOFSTEP]
ext1 x
[GOAL]
case a
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝ : CommRing R
n₁ n₂ n₃ : ℕ
h1 : n₁ ≤ n₂
h2 : n₂ ≤ n₃
x : TruncatedWittVector p n₃ R
⊢ ↑(RingHom.comp (truncate h1) (truncate h2)) x = ↑(truncate (_ : n₁ ≤ n₃)) x
[PROOFSTEP]
simp only [truncate_truncate, Function.comp_apply, RingHom.coe_comp]
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝ : CommRing R
m : ℕ
hm : n ≤ m
⊢ Surjective ↑(truncate hm)
[PROOFSTEP]
intro x
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝ : CommRing R
m : ℕ
hm : n ≤ m
x : TruncatedWittVector p n R
⊢ ∃ a, ↑(truncate hm) a = x
[PROOFSTEP]
obtain ⟨x, rfl⟩ := @WittVector.truncate_surjective p _ _ R _ x
[GOAL]
case intro
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝ : CommRing R
m : ℕ
hm : n ≤ m
x : 𝕎 R
⊢ ∃ a, ↑(truncate hm) a = ↑(WittVector.truncate n) x
[PROOFSTEP]
exact ⟨WittVector.truncate _ x, truncate_wittVector_truncate _ _⟩
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝ : CommRing R
m : ℕ
hm : n ≤ m
i : Fin n
x : TruncatedWittVector p m R
⊢ coeff i (↑(truncate hm) x) = coeff (Fin.castLE hm i) x
[PROOFSTEP]
obtain ⟨y, rfl⟩ := @WittVector.truncate_surjective p _ _ _ _ x
[GOAL]
case intro
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝ : CommRing R
m : ℕ
hm : n ≤ m
i : Fin n
y : 𝕎 R
⊢ coeff i (↑(truncate hm) (↑(WittVector.truncate m) y)) = coeff (Fin.castLE hm i) (↑(WittVector.truncate m) y)
[PROOFSTEP]
simp only [truncate_wittVector_truncate, WittVector.coeff_truncate, Fin.coe_castLE]
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R✝ : Type u_1
inst✝¹ : CommRing R✝
R : Type u_2
inst✝ : Fintype R
⊢ Fintype.card (TruncatedWittVector p n R) = Fintype.card R ^ n
[PROOFSTEP]
simp only [TruncatedWittVector, Fintype.card_fin, Fintype.card_fun]
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝ : CommRing R
⊢ ⨅ (i : ℕ), RingHom.ker (WittVector.truncate i) = ⊥
[PROOFSTEP]
rw [Submodule.eq_bot_iff]
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝ : CommRing R
⊢ ∀ (x : 𝕎 R), x ∈ ⨅ (i : ℕ), RingHom.ker (WittVector.truncate i) → x = 0
[PROOFSTEP]
intro x hx
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝ : CommRing R
x : 𝕎 R
hx : x ∈ ⨅ (i : ℕ), RingHom.ker (WittVector.truncate i)
⊢ x = 0
[PROOFSTEP]
ext
[GOAL]
case h
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝ : CommRing R
x : 𝕎 R
hx : x ∈ ⨅ (i : ℕ), RingHom.ker (WittVector.truncate i)
n✝ : ℕ
⊢ WittVector.coeff x n✝ = WittVector.coeff 0 n✝
[PROOFSTEP]
simp only [WittVector.mem_ker_truncate, Ideal.mem_iInf, WittVector.zero_coeff] at hx ⊢
[GOAL]
case h
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝ : CommRing R
x : 𝕎 R
n✝ : ℕ
hx : ∀ (i i_1 : ℕ), i_1 < i → WittVector.coeff x i_1 = 0
⊢ WittVector.coeff x n✝ = 0
[PROOFSTEP]
exact hx _ _ (Nat.lt_succ_self _)
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝¹ : CommRing R
S : Type u_2
inst✝ : Semiring S
f : (k : ℕ) → S →+* TruncatedWittVector p k R
f_compat : ∀ (k₁ k₂ : ℕ) (hk : k₁ ≤ k₂), RingHom.comp (TruncatedWittVector.truncate hk) (f k₂) = f k₁
s : S
⊢ ↑(truncate n) (liftFun f s) = ↑(f n) s
[PROOFSTEP]
ext i
[GOAL]
case h
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝¹ : CommRing R
S : Type u_2
inst✝ : Semiring S
f : (k : ℕ) → S →+* TruncatedWittVector p k R
f_compat : ∀ (k₁ k₂ : ℕ) (hk : k₁ ≤ k₂), RingHom.comp (TruncatedWittVector.truncate hk) (f k₂) = f k₁
s : S
i : Fin n
⊢ TruncatedWittVector.coeff i (↑(truncate n) (liftFun f s)) = TruncatedWittVector.coeff i (↑(f n) s)
[PROOFSTEP]
simp only [liftFun, TruncatedWittVector.coeff_mk, WittVector.truncate_mk']
[GOAL]
case h
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝¹ : CommRing R
S : Type u_2
inst✝ : Semiring S
f : (k : ℕ) → S →+* TruncatedWittVector p k R
f_compat : ∀ (k₁ k₂ : ℕ) (hk : k₁ ≤ k₂), RingHom.comp (TruncatedWittVector.truncate hk) (f k₂) = f k₁
s : S
i : Fin n
⊢ TruncatedWittVector.coeff (Fin.last ↑i) (↑(f (↑i + 1)) s) = TruncatedWittVector.coeff i (↑(f n) s)
[PROOFSTEP]
rw [← f_compat (i + 1) n i.is_lt, RingHom.comp_apply, TruncatedWittVector.coeff_truncate]
[GOAL]
case h
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝¹ : CommRing R
S : Type u_2
inst✝ : Semiring S
f : (k : ℕ) → S →+* TruncatedWittVector p k R
f_compat : ∀ (k₁ k₂ : ℕ) (hk : k₁ ≤ k₂), RingHom.comp (TruncatedWittVector.truncate hk) (f k₂) = f k₁
s : S
i : Fin n
⊢ TruncatedWittVector.coeff (Fin.castLE (_ : ↑i < n) (Fin.last ↑i)) (↑(f n) s) = TruncatedWittVector.coeff i (↑(f n) s)
[PROOFSTEP]
congr 1 with _
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝¹ : CommRing R
S : Type u_2
inst✝ : Semiring S
f : (k : ℕ) → S →+* TruncatedWittVector p k R
f_compat : ∀ (k₁ k₂ : ℕ) (hk : k₁ ≤ k₂), RingHom.comp (TruncatedWittVector.truncate hk) (f k₂) = f k₁
⊢ S →+* 𝕎 R
[PROOFSTEP]
refine'
  { toFun := liftFun f
    map_zero' := _
    map_one' := _
    map_add' := _
    map_mul' := _ }
[GOAL]
case refine'_1
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝¹ : CommRing R
S : Type u_2
inst✝ : Semiring S
f : (k : ℕ) → S →+* TruncatedWittVector p k R
f_compat : ∀ (k₁ k₂ : ℕ) (hk : k₁ ≤ k₂), RingHom.comp (TruncatedWittVector.truncate hk) (f k₂) = f k₁
⊢ liftFun f 1 = 1
[PROOFSTEP]
intros
[GOAL]
case refine'_1
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝¹ : CommRing R
S : Type u_2
inst✝ : Semiring S
f : (k : ℕ) → S →+* TruncatedWittVector p k R
f_compat : ∀ (k₁ k₂ : ℕ) (hk : k₁ ≤ k₂), RingHom.comp (TruncatedWittVector.truncate hk) (f k₂) = f k₁
⊢ liftFun f 1 = 1
[PROOFSTEP]
dsimp only
[GOAL]
case refine'_1
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝¹ : CommRing R
S : Type u_2
inst✝ : Semiring S
f : (k : ℕ) → S →+* TruncatedWittVector p k R
f_compat : ∀ (k₁ k₂ : ℕ) (hk : k₁ ≤ k₂), RingHom.comp (TruncatedWittVector.truncate hk) (f k₂) = f k₁
⊢ liftFun f 1 = 1
[PROOFSTEP]
rw [← sub_eq_zero, ← Ideal.mem_bot, ← iInf_ker_truncate, Ideal.mem_iInf]
[GOAL]
case refine'_1
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝¹ : CommRing R
S : Type u_2
inst✝ : Semiring S
f : (k : ℕ) → S →+* TruncatedWittVector p k R
f_compat : ∀ (k₁ k₂ : ℕ) (hk : k₁ ≤ k₂), RingHom.comp (TruncatedWittVector.truncate hk) (f k₂) = f k₁
⊢ ∀ (i : ℕ), liftFun f 1 - 1 ∈ RingHom.ker (truncate i)
[PROOFSTEP]
simp [RingHom.mem_ker, f_compat]
[GOAL]
case refine'_2
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝¹ : CommRing R
S : Type u_2
inst✝ : Semiring S
f : (k : ℕ) → S →+* TruncatedWittVector p k R
f_compat : ∀ (k₁ k₂ : ℕ) (hk : k₁ ≤ k₂), RingHom.comp (TruncatedWittVector.truncate hk) (f k₂) = f k₁
⊢ ∀ (x y : S),
    OneHom.toFun { toFun := liftFun f, map_one' := (_ : liftFun f 1 = 1) } (x * y) =
      OneHom.toFun { toFun := liftFun f, map_one' := (_ : liftFun f 1 = 1) } x *
        OneHom.toFun { toFun := liftFun f, map_one' := (_ : liftFun f 1 = 1) } y
[PROOFSTEP]
intros
[GOAL]
case refine'_2
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝¹ : CommRing R
S : Type u_2
inst✝ : Semiring S
f : (k : ℕ) → S →+* TruncatedWittVector p k R
f_compat : ∀ (k₁ k₂ : ℕ) (hk : k₁ ≤ k₂), RingHom.comp (TruncatedWittVector.truncate hk) (f k₂) = f k₁
x✝ y✝ : S
⊢ OneHom.toFun { toFun := liftFun f, map_one' := (_ : liftFun f 1 = 1) } (x✝ * y✝) =
    OneHom.toFun { toFun := liftFun f, map_one' := (_ : liftFun f 1 = 1) } x✝ *
      OneHom.toFun { toFun := liftFun f, map_one' := (_ : liftFun f 1 = 1) } y✝
[PROOFSTEP]
dsimp only
[GOAL]
case refine'_2
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝¹ : CommRing R
S : Type u_2
inst✝ : Semiring S
f : (k : ℕ) → S →+* TruncatedWittVector p k R
f_compat : ∀ (k₁ k₂ : ℕ) (hk : k₁ ≤ k₂), RingHom.comp (TruncatedWittVector.truncate hk) (f k₂) = f k₁
x✝ y✝ : S
⊢ liftFun f (x✝ * y✝) = liftFun f x✝ * liftFun f y✝
[PROOFSTEP]
rw [← sub_eq_zero, ← Ideal.mem_bot, ← iInf_ker_truncate, Ideal.mem_iInf]
[GOAL]
case refine'_2
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝¹ : CommRing R
S : Type u_2
inst✝ : Semiring S
f : (k : ℕ) → S →+* TruncatedWittVector p k R
f_compat : ∀ (k₁ k₂ : ℕ) (hk : k₁ ≤ k₂), RingHom.comp (TruncatedWittVector.truncate hk) (f k₂) = f k₁
x✝ y✝ : S
⊢ ∀ (i : ℕ), liftFun f (x✝ * y✝) - liftFun f x✝ * liftFun f y✝ ∈ RingHom.ker (truncate i)
[PROOFSTEP]
simp [RingHom.mem_ker, f_compat]
[GOAL]
case refine'_3
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝¹ : CommRing R
S : Type u_2
inst✝ : Semiring S
f : (k : ℕ) → S →+* TruncatedWittVector p k R
f_compat : ∀ (k₁ k₂ : ℕ) (hk : k₁ ≤ k₂), RingHom.comp (TruncatedWittVector.truncate hk) (f k₂) = f k₁
⊢ OneHom.toFun
      (↑{ toOneHom := { toFun := liftFun f, map_one' := (_ : liftFun f 1 = 1) },
          map_mul' :=
            (_ :
              ∀ (x y : S),
                OneHom.toFun { toFun := liftFun f, map_one' := (_ : liftFun f 1 = 1) } (x * y) =
                  OneHom.toFun { toFun := liftFun f, map_one' := (_ : liftFun f 1 = 1) } x *
                    OneHom.toFun { toFun := liftFun f, map_one' := (_ : liftFun f 1 = 1) } y) })
      0 =
    0
[PROOFSTEP]
intros
[GOAL]
case refine'_3
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝¹ : CommRing R
S : Type u_2
inst✝ : Semiring S
f : (k : ℕ) → S →+* TruncatedWittVector p k R
f_compat : ∀ (k₁ k₂ : ℕ) (hk : k₁ ≤ k₂), RingHom.comp (TruncatedWittVector.truncate hk) (f k₂) = f k₁
⊢ OneHom.toFun
      (↑{ toOneHom := { toFun := liftFun f, map_one' := (_ : liftFun f 1 = 1) },
          map_mul' :=
            (_ :
              ∀ (x y : S),
                OneHom.toFun { toFun := liftFun f, map_one' := (_ : liftFun f 1 = 1) } (x * y) =
                  OneHom.toFun { toFun := liftFun f, map_one' := (_ : liftFun f 1 = 1) } x *
                    OneHom.toFun { toFun := liftFun f, map_one' := (_ : liftFun f 1 = 1) } y) })
      0 =
    0
[PROOFSTEP]
dsimp only
[GOAL]
case refine'_3
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝¹ : CommRing R
S : Type u_2
inst✝ : Semiring S
f : (k : ℕ) → S →+* TruncatedWittVector p k R
f_compat : ∀ (k₁ k₂ : ℕ) (hk : k₁ ≤ k₂), RingHom.comp (TruncatedWittVector.truncate hk) (f k₂) = f k₁
⊢ liftFun f 0 = 0
[PROOFSTEP]
rw [← sub_eq_zero, ← Ideal.mem_bot, ← iInf_ker_truncate, Ideal.mem_iInf]
[GOAL]
case refine'_3
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝¹ : CommRing R
S : Type u_2
inst✝ : Semiring S
f : (k : ℕ) → S →+* TruncatedWittVector p k R
f_compat : ∀ (k₁ k₂ : ℕ) (hk : k₁ ≤ k₂), RingHom.comp (TruncatedWittVector.truncate hk) (f k₂) = f k₁
⊢ ∀ (i : ℕ), liftFun f 0 - 0 ∈ RingHom.ker (truncate i)
[PROOFSTEP]
simp [RingHom.mem_ker, f_compat]
[GOAL]
case refine'_4
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝¹ : CommRing R
S : Type u_2
inst✝ : Semiring S
f : (k : ℕ) → S →+* TruncatedWittVector p k R
f_compat : ∀ (k₁ k₂ : ℕ) (hk : k₁ ≤ k₂), RingHom.comp (TruncatedWittVector.truncate hk) (f k₂) = f k₁
⊢ ∀ (x y : S),
    OneHom.toFun
        (↑{ toOneHom := { toFun := liftFun f, map_one' := (_ : liftFun f 1 = 1) },
            map_mul' :=
              (_ :
                ∀ (x y : S),
                  OneHom.toFun { toFun := liftFun f, map_one' := (_ : liftFun f 1 = 1) } (x * y) =
                    OneHom.toFun { toFun := liftFun f, map_one' := (_ : liftFun f 1 = 1) } x *
                      OneHom.toFun { toFun := liftFun f, map_one' := (_ : liftFun f 1 = 1) } y) })
        (x + y) =
      OneHom.toFun
          (↑{ toOneHom := { toFun := liftFun f, map_one' := (_ : liftFun f 1 = 1) },
              map_mul' :=
                (_ :
                  ∀ (x y : S),
                    OneHom.toFun { toFun := liftFun f, map_one' := (_ : liftFun f 1 = 1) } (x * y) =
                      OneHom.toFun { toFun := liftFun f, map_one' := (_ : liftFun f 1 = 1) } x *
                        OneHom.toFun { toFun := liftFun f, map_one' := (_ : liftFun f 1 = 1) } y) })
          x +
        OneHom.toFun
          (↑{ toOneHom := { toFun := liftFun f, map_one' := (_ : liftFun f 1 = 1) },
              map_mul' :=
                (_ :
                  ∀ (x y : S),
                    OneHom.toFun { toFun := liftFun f, map_one' := (_ : liftFun f 1 = 1) } (x * y) =
                      OneHom.toFun { toFun := liftFun f, map_one' := (_ : liftFun f 1 = 1) } x *
                        OneHom.toFun { toFun := liftFun f, map_one' := (_ : liftFun f 1 = 1) } y) })
          y
[PROOFSTEP]
intros
[GOAL]
case refine'_4
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝¹ : CommRing R
S : Type u_2
inst✝ : Semiring S
f : (k : ℕ) → S →+* TruncatedWittVector p k R
f_compat : ∀ (k₁ k₂ : ℕ) (hk : k₁ ≤ k₂), RingHom.comp (TruncatedWittVector.truncate hk) (f k₂) = f k₁
x✝ y✝ : S
⊢ OneHom.toFun
      (↑{ toOneHom := { toFun := liftFun f, map_one' := (_ : liftFun f 1 = 1) },
          map_mul' :=
            (_ :
              ∀ (x y : S),
                OneHom.toFun { toFun := liftFun f, map_one' := (_ : liftFun f 1 = 1) } (x * y) =
                  OneHom.toFun { toFun := liftFun f, map_one' := (_ : liftFun f 1 = 1) } x *
                    OneHom.toFun { toFun := liftFun f, map_one' := (_ : liftFun f 1 = 1) } y) })
      (x✝ + y✝) =
    OneHom.toFun
        (↑{ toOneHom := { toFun := liftFun f, map_one' := (_ : liftFun f 1 = 1) },
            map_mul' :=
              (_ :
                ∀ (x y : S),
                  OneHom.toFun { toFun := liftFun f, map_one' := (_ : liftFun f 1 = 1) } (x * y) =
                    OneHom.toFun { toFun := liftFun f, map_one' := (_ : liftFun f 1 = 1) } x *
                      OneHom.toFun { toFun := liftFun f, map_one' := (_ : liftFun f 1 = 1) } y) })
        x✝ +
      OneHom.toFun
        (↑{ toOneHom := { toFun := liftFun f, map_one' := (_ : liftFun f 1 = 1) },
            map_mul' :=
              (_ :
                ∀ (x y : S),
                  OneHom.toFun { toFun := liftFun f, map_one' := (_ : liftFun f 1 = 1) } (x * y) =
                    OneHom.toFun { toFun := liftFun f, map_one' := (_ : liftFun f 1 = 1) } x *
                      OneHom.toFun { toFun := liftFun f, map_one' := (_ : liftFun f 1 = 1) } y) })
        y✝
[PROOFSTEP]
dsimp only
[GOAL]
case refine'_4
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝¹ : CommRing R
S : Type u_2
inst✝ : Semiring S
f : (k : ℕ) → S →+* TruncatedWittVector p k R
f_compat : ∀ (k₁ k₂ : ℕ) (hk : k₁ ≤ k₂), RingHom.comp (TruncatedWittVector.truncate hk) (f k₂) = f k₁
x✝ y✝ : S
⊢ liftFun f (x✝ + y✝) = liftFun f x✝ + liftFun f y✝
[PROOFSTEP]
rw [← sub_eq_zero, ← Ideal.mem_bot, ← iInf_ker_truncate, Ideal.mem_iInf]
[GOAL]
case refine'_4
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝¹ : CommRing R
S : Type u_2
inst✝ : Semiring S
f : (k : ℕ) → S →+* TruncatedWittVector p k R
f_compat : ∀ (k₁ k₂ : ℕ) (hk : k₁ ≤ k₂), RingHom.comp (TruncatedWittVector.truncate hk) (f k₂) = f k₁
x✝ y✝ : S
⊢ ∀ (i : ℕ), liftFun f (x✝ + y✝) - (liftFun f x✝ + liftFun f y✝) ∈ RingHom.ker (truncate i)
[PROOFSTEP]
simp [RingHom.mem_ker, f_compat]
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝¹ : CommRing R
S : Type u_2
inst✝ : Semiring S
f : (k : ℕ) → S →+* TruncatedWittVector p k R
f_compat : ∀ (k₁ k₂ : ℕ) (hk : k₁ ≤ k₂), RingHom.comp (TruncatedWittVector.truncate hk) (f k₂) = f k₁
⊢ RingHom.comp (truncate n) (lift (fun k₂ => f k₂) f_compat) = f n
[PROOFSTEP]
ext1
[GOAL]
case a
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝¹ : CommRing R
S : Type u_2
inst✝ : Semiring S
f : (k : ℕ) → S →+* TruncatedWittVector p k R
f_compat : ∀ (k₁ k₂ : ℕ) (hk : k₁ ≤ k₂), RingHom.comp (TruncatedWittVector.truncate hk) (f k₂) = f k₁
x✝ : S
⊢ ↑(RingHom.comp (truncate n) (lift (fun k₂ => f k₂) f_compat)) x✝ = ↑(f n) x✝
[PROOFSTEP]
rw [RingHom.comp_apply, truncate_lift]
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝¹ : CommRing R
S : Type u_2
inst✝ : Semiring S
f : (k : ℕ) → S →+* TruncatedWittVector p k R
f_compat : ∀ (k₁ k₂ : ℕ) (hk : k₁ ≤ k₂), RingHom.comp (TruncatedWittVector.truncate hk) (f k₂) = f k₁
g : S →+* 𝕎 R
g_compat : ∀ (k : ℕ), RingHom.comp (truncate k) g = f k
⊢ lift (fun k₂ => f k₂) f_compat = g
[PROOFSTEP]
ext1 x
[GOAL]
case a
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝¹ : CommRing R
S : Type u_2
inst✝ : Semiring S
f : (k : ℕ) → S →+* TruncatedWittVector p k R
f_compat : ∀ (k₁ k₂ : ℕ) (hk : k₁ ≤ k₂), RingHom.comp (TruncatedWittVector.truncate hk) (f k₂) = f k₁
g : S →+* 𝕎 R
g_compat : ∀ (k : ℕ), RingHom.comp (truncate k) g = f k
x : S
⊢ ↑(lift (fun k₂ => f k₂) f_compat) x = ↑g x
[PROOFSTEP]
rw [← sub_eq_zero, ← Ideal.mem_bot, ← iInf_ker_truncate, Ideal.mem_iInf]
[GOAL]
case a
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝¹ : CommRing R
S : Type u_2
inst✝ : Semiring S
f : (k : ℕ) → S →+* TruncatedWittVector p k R
f_compat : ∀ (k₁ k₂ : ℕ) (hk : k₁ ≤ k₂), RingHom.comp (TruncatedWittVector.truncate hk) (f k₂) = f k₁
g : S →+* 𝕎 R
g_compat : ∀ (k : ℕ), RingHom.comp (truncate k) g = f k
x : S
⊢ ∀ (i : ℕ), ↑(lift (fun k₂ => f k₂) f_compat) x - ↑g x ∈ RingHom.ker (truncate i)
[PROOFSTEP]
intro i
[GOAL]
case a
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝¹ : CommRing R
S : Type u_2
inst✝ : Semiring S
f : (k : ℕ) → S →+* TruncatedWittVector p k R
f_compat : ∀ (k₁ k₂ : ℕ) (hk : k₁ ≤ k₂), RingHom.comp (TruncatedWittVector.truncate hk) (f k₂) = f k₁
g : S →+* 𝕎 R
g_compat : ∀ (k : ℕ), RingHom.comp (truncate k) g = f k
x : S
i : ℕ
⊢ ↑(lift (fun k₂ => f k₂) f_compat) x - ↑g x ∈ RingHom.ker (truncate i)
[PROOFSTEP]
simp only [RingHom.mem_ker, g_compat, ← RingHom.comp_apply, truncate_comp_lift, RingHom.map_sub, sub_self]
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝¹ : CommRing R
S : Type u_2
inst✝ : Semiring S
f : (k : ℕ) → S →+* TruncatedWittVector p k R
f_compat : ∀ (k₁ k₂ : ℕ) (hk : k₁ ≤ k₂), RingHom.comp (TruncatedWittVector.truncate hk) (f k₂) = f k₁
g : S →+* 𝕎 R
⊢ ∀ (k₁ k₂ : ℕ) (hk : k₁ ≤ k₂),
    RingHom.comp (TruncatedWittVector.truncate hk) ((fun k => RingHom.comp (truncate k) g) k₂) =
      (fun k => RingHom.comp (truncate k) g) k₁
[PROOFSTEP]
intro _ _ h
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝¹ : CommRing R
S : Type u_2
inst✝ : Semiring S
f : (k : ℕ) → S →+* TruncatedWittVector p k R
f_compat : ∀ (k₁ k₂ : ℕ) (hk : k₁ ≤ k₂), RingHom.comp (TruncatedWittVector.truncate hk) (f k₂) = f k₁
g : S →+* 𝕎 R
k₁✝ k₂✝ : ℕ
h : k₁✝ ≤ k₂✝
⊢ RingHom.comp (TruncatedWittVector.truncate h) ((fun k => RingHom.comp (truncate k) g) k₂✝) =
    (fun k => RingHom.comp (truncate k) g) k₁✝
[PROOFSTEP]
simp only [← RingHom.comp_assoc, truncate_comp_wittVector_truncate]
[GOAL]
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝¹ : CommRing R
S : Type u_2
inst✝ : Semiring S
f : (k : ℕ) → S →+* TruncatedWittVector p k R
f_compat : ∀ (k₁ k₂ : ℕ) (hk : k₁ ≤ k₂), RingHom.comp (TruncatedWittVector.truncate hk) (f k₂) = f k₁
⊢ Function.LeftInverse
    (fun g =>
      { val := fun k => RingHom.comp (truncate k) g,
        property :=
          (_ :
            ∀ (k₁ k₂ : ℕ) (h : k₁ ≤ k₂),
              RingHom.comp (RingHom.comp (TruncatedWittVector.truncate h) (truncate k₂)) g =
                RingHom.comp (truncate k₁) g) })
    fun f => lift ↑f (_ : ∀ (k₁ k₂ : ℕ) (hk : k₁ ≤ k₂), RingHom.comp (TruncatedWittVector.truncate hk) (↑f k₂) = ↑f k₁)
[PROOFSTEP]
rintro ⟨f, hf⟩
[GOAL]
case mk
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝¹ : CommRing R
S : Type u_2
inst✝ : Semiring S
f✝ : (k : ℕ) → S →+* TruncatedWittVector p k R
f_compat : ∀ (k₁ k₂ : ℕ) (hk : k₁ ≤ k₂), RingHom.comp (TruncatedWittVector.truncate hk) (f✝ k₂) = f✝ k₁
f : (k : ℕ) → S →+* TruncatedWittVector p k R
hf : ∀ (k₁ k₂ : ℕ) (hk : k₁ ≤ k₂), RingHom.comp (TruncatedWittVector.truncate hk) (f k₂) = f k₁
⊢ (fun g =>
        { val := fun k => RingHom.comp (truncate k) g,
          property :=
            (_ :
              ∀ (k₁ k₂ : ℕ) (h : k₁ ≤ k₂),
                RingHom.comp (RingHom.comp (TruncatedWittVector.truncate h) (truncate k₂)) g =
                  RingHom.comp (truncate k₁) g) })
      ((fun f =>
          lift ↑f (_ : ∀ (k₁ k₂ : ℕ) (hk : k₁ ≤ k₂), RingHom.comp (TruncatedWittVector.truncate hk) (↑f k₂) = ↑f k₁))
        { val := f, property := hf }) =
    { val := f, property := hf }
[PROOFSTEP]
simp only [truncate_comp_lift]
