l3lab/ntp-mathlib huggingface dataset:
theorem valAux_add (f g : PreTilt K v O hv p) :
    valAux K v O hv p (f + g) ≤ max (valAux K v O hv p f) (valAux K v O hv p g) := by
  by_cases hf : f = 0
  · rw [hf, zero_add, valAux_zero, max_eq_right]; exact zero_le _
  by_cases hg : g = 0
  · rw [hg, add_zero, valAux_zero, max_eq_left]; exact zero_le _
  by_cases hfg : f + g = 0
  · rw [hfg, valAux_zero]; exact zero_le _
  replace hf : ∃ n, coeff _ _ n f ≠ 0 := not_forall.1 fun h => hf <| Perfection.ext h
  replace hg : ∃ n, coeff _ _ n g ≠ 0 := not_forall.1 fun h => hg <| Perfection.ext h
  replace hfg : ∃ n, coeff _ _ n (f + g) ≠ 0 := not_forall.1 fun h => hfg <| Perfection.ext h
  obtain ⟨m, hm⟩ := hf; obtain ⟨n, hn⟩ := hg; obtain ⟨k, hk⟩ := hfg
  replace hm := coeff_ne_zero_of_le hm (le_trans (le_max_left m n) (le_max_left _ k))
  replace hn := coeff_ne_zero_of_le hn (le_trans (le_max_right m n) (le_max_left _ k))
  replace hk := coeff_ne_zero_of_le hk (le_max_right (max m n) k)
  rw [valAux_eq hm, valAux_eq hn, valAux_eq hk, RingHom.map_add]
  cases' le_max_iff.1
      (ModP.preVal_add (coeff _ _ (max (max m n) k) f) (coeff _ _ (max (max m n) k) g)) with h h
  · exact le_max_of_le_left (pow_le_pow_left' h _)
  · 

Proof state:
case neg.intro.intro.intro.inr
K : Type u₁
inst✝² : Field K
v : Valuation K ℝ≥0
O : Type u₂
inst✝¹ : CommRing O
inst✝ : Algebra O K
hv : Valuation.Integers v O
p : ℕ
hp : Fact (Nat.Prime p)
hvp : Fact (v ↑p ≠ 1)
f g : PreTilt K v O hv p
m n k : ℕ
hm : (coeff (ModP K v O hv p) p (max (max m n) k)) f ≠ 0
hn : (coeff (ModP K v O hv p) p (max (max m n) k)) g ≠ 0
hk : (coeff (ModP K v O hv p) p (max (max m n) k)) (f + g) ≠ 0
h :
  ModP.preVal K v O hv p
      ((coeff (ModP K v O hv p) p (max (max m n) k)) f + (coeff (ModP K v O hv p) p (max (max m n) k)) g) ≤
    ModP.preVal K v O hv p ((coeff (ModP K v O hv p) p (max (max m n) k)) g)
⊢ ModP.preVal K v O hv p
        ((coeff (ModP K v O hv p) p (max (max m n) k)) f + (coeff (ModP K v O hv p) p (max (max m n) k)) g) ^
      p ^ max (max m n) k ≤
    max (ModP.preVal K v O hv p ((coeff (ModP K v O hv p) p (max (max m n) k)) f) ^ p ^ max (max m n) k)
      (ModP.preVal K v O hv p ((coeff (ModP K v O hv p) p (max (max m n) k)) g) ^ p ^ max (max m n) k)

Next tactic:
exact le_max_of_le_right (pow_le_pow_left' h _)
theorem map_eq_zero {f : PreTilt K v O hv p} : val K v O hv p f = 0 ↔ f = 0 := by
  

Proof state:
K : Type u₁
inst✝² : Field K
v : Valuation K ℝ≥0
O : Type u₂
inst✝¹ : CommRing O
inst✝ : Algebra O K
hv : Valuation.Integers v O
p : ℕ
hp : Fact (Nat.Prime p)
hvp : Fact (v ↑p ≠ 1)
f : PreTilt K v O hv p
⊢ (val K v O hv p) f = 0 ↔ f = 0

Next tactic:
by_cases hf0 : f = 0
theorem map_eq_zero {f : PreTilt K v O hv p} : val K v O hv p f = 0 ↔ f = 0 := by
  by_cases hf0 : f = 0
  · 

Proof state:
case pos
K : Type u₁
inst✝² : Field K
v : Valuation K ℝ≥0
O : Type u₂
inst✝¹ : CommRing O
inst✝ : Algebra O K
hv : Valuation.Integers v O
p : ℕ
hp : Fact (Nat.Prime p)
hvp : Fact (v ↑p ≠ 1)
f : PreTilt K v O hv p
hf0 : f = 0
⊢ (val K v O hv p) f = 0 ↔ f = 0

Next tactic:
rw [hf0]
theorem map_eq_zero {f : PreTilt K v O hv p} : val K v O hv p f = 0 ↔ f = 0 := by
  by_cases hf0 : f = 0
  · rw [hf0]; 

Proof state:
case pos
K : Type u₁
inst✝² : Field K
v : Valuation K ℝ≥0
O : Type u₂
inst✝¹ : CommRing O
inst✝ : Algebra O K
hv : Valuation.Integers v O
p : ℕ
hp : Fact (Nat.Prime p)
hvp : Fact (v ↑p ≠ 1)
f : PreTilt K v O hv p
hf0 : f = 0
⊢ (val K v O hv p) 0 = 0 ↔ 0 = 0

Next tactic:
exact iff_of_true (Valuation.map_zero _) rfl
theorem map_eq_zero {f : PreTilt K v O hv p} : val K v O hv p f = 0 ↔ f = 0 := by
  by_cases hf0 : f = 0
  · rw [hf0]; exact iff_of_true (Valuation.map_zero _) rfl
  

Proof state:
case neg
K : Type u₁
inst✝² : Field K
v : Valuation K ℝ≥0
O : Type u₂
inst✝¹ : CommRing O
inst✝ : Algebra O K
hv : Valuation.Integers v O
p : ℕ
hp : Fact (Nat.Prime p)
hvp : Fact (v ↑p ≠ 1)
f : PreTilt K v O hv p
hf0 : ¬f = 0
⊢ (val K v O hv p) f = 0 ↔ f = 0

Next tactic:
obtain ⟨n, hn⟩ : ∃ n, coeff _ _ n f ≠ 0 := not_forall.1 fun h => hf0 <| Perfection.ext h
theorem map_eq_zero {f : PreTilt K v O hv p} : val K v O hv p f = 0 ↔ f = 0 := by
  by_cases hf0 : f = 0
  · rw [hf0]; exact iff_of_true (Valuation.map_zero _) rfl
  obtain ⟨n, hn⟩ : ∃ n, coeff _ _ n f ≠ 0 := not_forall.1 fun h => hf0 <| Perfection.ext h
  

Proof state:
case neg.intro
K : Type u₁
inst✝² : Field K
v : Valuation K ℝ≥0
O : Type u₂
inst✝¹ : CommRing O
inst✝ : Algebra O K
hv : Valuation.Integers v O
p : ℕ
hp : Fact (Nat.Prime p)
hvp : Fact (v ↑p ≠ 1)
f : PreTilt K v O hv p
hf0 : ¬f = 0
n : ℕ
hn : (coeff (ModP K v O hv p) p n) f ≠ 0
⊢ (val K v O hv p) f = 0 ↔ f = 0

Next tactic:
show valAux K v O hv p f = 0 ↔ f = 0
theorem map_eq_zero {f : PreTilt K v O hv p} : val K v O hv p f = 0 ↔ f = 0 := by
  by_cases hf0 : f = 0
  · rw [hf0]; exact iff_of_true (Valuation.map_zero _) rfl
  obtain ⟨n, hn⟩ : ∃ n, coeff _ _ n f ≠ 0 := not_forall.1 fun h => hf0 <| Perfection.ext h
  show valAux K v O hv p f = 0 ↔ f = 0; 

Proof state:
case neg.intro
K : Type u₁
inst✝² : Field K
v : Valuation K ℝ≥0
O : Type u₂
inst✝¹ : CommRing O
inst✝ : Algebra O K
hv : Valuation.Integers v O
p : ℕ
hp : Fact (Nat.Prime p)
hvp : Fact (v ↑p ≠ 1)
f : PreTilt K v O hv p
hf0 : ¬f = 0
n : ℕ
hn : (coeff (ModP K v O hv p) p n) f ≠ 0
⊢ valAux K v O hv p f = 0 ↔ f = 0

Next tactic:
refine' iff_of_false (fun hvf => hn _) hf0
theorem map_eq_zero {f : PreTilt K v O hv p} : val K v O hv p f = 0 ↔ f = 0 := by
  by_cases hf0 : f = 0
  · rw [hf0]; exact iff_of_true (Valuation.map_zero _) rfl
  obtain ⟨n, hn⟩ : ∃ n, coeff _ _ n f ≠ 0 := not_forall.1 fun h => hf0 <| Perfection.ext h
  show valAux K v O hv p f = 0 ↔ f = 0; refine' iff_of_false (fun hvf => hn _) hf0
  

Proof state:
case neg.intro
K : Type u₁
inst✝² : Field K
v : Valuation K ℝ≥0
O : Type u₂
inst✝¹ : CommRing O
inst✝ : Algebra O K
hv : Valuation.Integers v O
p : ℕ
hp : Fact (Nat.Prime p)
hvp : Fact (v ↑p ≠ 1)
f : PreTilt K v O hv p
hf0 : ¬f = 0
n : ℕ
hn : (coeff (ModP K v O hv p) p n) f ≠ 0
hvf : valAux K v O hv p f = 0
⊢ (coeff (ModP K v O hv p) p n) f = 0

Next tactic:
rw [valAux_eq hn] at hvf
theorem map_eq_zero {f : PreTilt K v O hv p} : val K v O hv p f = 0 ↔ f = 0 := by
  by_cases hf0 : f = 0
  · rw [hf0]; exact iff_of_true (Valuation.map_zero _) rfl
  obtain ⟨n, hn⟩ : ∃ n, coeff _ _ n f ≠ 0 := not_forall.1 fun h => hf0 <| Perfection.ext h
  show valAux K v O hv p f = 0 ↔ f = 0; refine' iff_of_false (fun hvf => hn _) hf0
  rw [valAux_eq hn] at hvf; 

Proof state:
case neg.intro
K : Type u₁
inst✝² : Field K
v : Valuation K ℝ≥0
O : Type u₂
inst✝¹ : CommRing O
inst✝ : Algebra O K
hv : Valuation.Integers v O
p : ℕ
hp : Fact (Nat.Prime p)
hvp : Fact (v ↑p ≠ 1)
f : PreTilt K v O hv p
hf0 : ¬f = 0
n : ℕ
hn : (coeff (ModP K v O hv p) p n) f ≠ 0
hvf : ModP.preVal K v O hv p ((coeff (ModP K v O hv p) p n) f) ^ p ^ n = 0
⊢ (coeff (ModP K v O hv p) p n) f = 0

Next tactic:
replace hvf := pow_eq_zero hvf
theorem map_eq_zero {f : PreTilt K v O hv p} : val K v O hv p f = 0 ↔ f = 0 := by
  by_cases hf0 : f = 0
  · rw [hf0]; exact iff_of_true (Valuation.map_zero _) rfl
  obtain ⟨n, hn⟩ : ∃ n, coeff _ _ n f ≠ 0 := not_forall.1 fun h => hf0 <| Perfection.ext h
  show valAux K v O hv p f = 0 ↔ f = 0; refine' iff_of_false (fun hvf => hn _) hf0
  rw [valAux_eq hn] at hvf; replace hvf := pow_eq_zero hvf; 

Proof state:
case neg.intro
K : Type u₁
inst✝² : Field K
v : Valuation K ℝ≥0
O : Type u₂
inst✝¹ : CommRing O
inst✝ : Algebra O K
hv : Valuation.Integers v O
p : ℕ
hp : Fact (Nat.Prime p)
hvp : Fact (v ↑p ≠ 1)
f : PreTilt K v O hv p
hf0 : ¬f = 0
n : ℕ
hn : (coeff (ModP K v O hv p) p n) f ≠ 0
hvf : ModP.preVal K v O hv p ((coeff (ModP K v O hv p) p n) f) = 0
⊢ (coeff (ModP K v O hv p) p n) f = 0

Next tactic:
rwa [ModP.preVal_eq_zero] at hvf
instance : IsDomain (PreTilt K v O hv p) := by
  

Proof state:
K : Type u₁
inst✝² : Field K
v : Valuation K ℝ≥0
O : Type u₂
inst✝¹ : CommRing O
inst✝ : Algebra O K
hv : Valuation.Integers v O
p : ℕ
hp : Fact (Nat.Prime p)
hvp : Fact (v ↑p ≠ 1)
⊢ IsDomain (PreTilt K v O hv p)

Next tactic:
haveI : Nontrivial (PreTilt K v O hv p) := ⟨(CharP.nontrivial_of_char_ne_one hp.1.ne_one).1⟩
instance : IsDomain (PreTilt K v O hv p) := by
  haveI : Nontrivial (PreTilt K v O hv p) := ⟨(CharP.nontrivial_of_char_ne_one hp.1.ne_one).1⟩
  

Proof state:
K : Type u₁
inst✝² : Field K
v : Valuation K ℝ≥0
O : Type u₂
inst✝¹ : CommRing O
inst✝ : Algebra O K
hv : Valuation.Integers v O
p : ℕ
hp : Fact (Nat.Prime p)
hvp : Fact (v ↑p ≠ 1)
this : Nontrivial (PreTilt K v O hv p)
⊢ IsDomain (PreTilt K v O hv p)

Next tactic:
haveI : NoZeroDivisors (PreTilt K v O hv p) :=
    ⟨fun hfg => by
      simp_rw [← map_eq_zero] at hfg ⊢; contrapose! hfg; rw [Valuation.map_mul]
      exact mul_ne_zero hfg.1 hfg.2⟩
instance : IsDomain (PreTilt K v O hv p) := by
  haveI : Nontrivial (PreTilt K v O hv p) := ⟨(CharP.nontrivial_of_char_ne_one hp.1.ne_one).1⟩
  haveI : NoZeroDivisors (PreTilt K v O hv p) :=
    ⟨fun hfg => by
      

Proof state:
K : Type u₁
inst✝² : Field K
v : Valuation K ℝ≥0
O : Type u₂
inst✝¹ : CommRing O
inst✝ : Algebra O K
hv : Valuation.Integers v O
p : ℕ
hp : Fact (Nat.Prime p)
hvp : Fact (v ↑p ≠ 1)
this : Nontrivial (PreTilt K v O hv p)
a✝ b✝ : PreTilt K v O hv p
hfg : a✝ * b✝ = 0
⊢ a✝ = 0 ∨ b✝ = 0

Next tactic:
simp_rw [← map_eq_zero] at hfg ⊢
instance : IsDomain (PreTilt K v O hv p) := by
  haveI : Nontrivial (PreTilt K v O hv p) := ⟨(CharP.nontrivial_of_char_ne_one hp.1.ne_one).1⟩
  haveI : NoZeroDivisors (PreTilt K v O hv p) :=
    ⟨fun hfg => by
      simp_rw [← map_eq_zero] at hfg ⊢; 

Proof state:
K : Type u₁
inst✝² : Field K
v : Valuation K ℝ≥0
O : Type u₂
inst✝¹ : CommRing O
inst✝ : Algebra O K
hv : Valuation.Integers v O
p : ℕ
hp : Fact (Nat.Prime p)
hvp : Fact (v ↑p ≠ 1)
this : Nontrivial (PreTilt K v O hv p)
a✝ b✝ : PreTilt K v O hv p
hfg : (val K v O hv p) (a✝ * b✝) = 0
⊢ (val K v O hv p) a✝ = 0 ∨ (val K v O hv p) b✝ = 0

Next tactic:
contrapose! hfg
instance : IsDomain (PreTilt K v O hv p) := by
  haveI : Nontrivial (PreTilt K v O hv p) := ⟨(CharP.nontrivial_of_char_ne_one hp.1.ne_one).1⟩
  haveI : NoZeroDivisors (PreTilt K v O hv p) :=
    ⟨fun hfg => by
      simp_rw [← map_eq_zero] at hfg ⊢; contrapose! hfg; 

Proof state:
K : Type u₁
inst✝² : Field K
v : Valuation K ℝ≥0
O : Type u₂
inst✝¹ : CommRing O
inst✝ : Algebra O K
hv : Valuation.Integers v O
p : ℕ
hp : Fact (Nat.Prime p)
hvp : Fact (v ↑p ≠ 1)
this : Nontrivial (PreTilt K v O hv p)
a✝ b✝ : PreTilt K v O hv p
hfg : (val K v O hv p) a✝ ≠ 0 ∧ (val K v O hv p) b✝ ≠ 0
⊢ (val K v O hv p) (a✝ * b✝) ≠ 0

Next tactic:
rw [Valuation.map_mul]
instance : IsDomain (PreTilt K v O hv p) := by
  haveI : Nontrivial (PreTilt K v O hv p) := ⟨(CharP.nontrivial_of_char_ne_one hp.1.ne_one).1⟩
  haveI : NoZeroDivisors (PreTilt K v O hv p) :=
    ⟨fun hfg => by
      simp_rw [← map_eq_zero] at hfg ⊢; contrapose! hfg; rw [Valuation.map_mul]
      

Proof state:
K : Type u₁
inst✝² : Field K
v : Valuation K ℝ≥0
O : Type u₂
inst✝¹ : CommRing O
inst✝ : Algebra O K
hv : Valuation.Integers v O
p : ℕ
hp : Fact (Nat.Prime p)
hvp : Fact (v ↑p ≠ 1)
this : Nontrivial (PreTilt K v O hv p)
a✝ b✝ : PreTilt K v O hv p
hfg : (val K v O hv p) a✝ ≠ 0 ∧ (val K v O hv p) b✝ ≠ 0
⊢ (val K v O hv p) a✝ * (val K v O hv p) b✝ ≠ 0

Next tactic:
exact mul_ne_zero hfg.1 hfg.2
instance : IsDomain (PreTilt K v O hv p) := by
  haveI : Nontrivial (PreTilt K v O hv p) := ⟨(CharP.nontrivial_of_char_ne_one hp.1.ne_one).1⟩
  haveI : NoZeroDivisors (PreTilt K v O hv p) :=
    ⟨fun hfg => by
      simp_rw [← map_eq_zero] at hfg ⊢; contrapose! hfg; rw [Valuation.map_mul]
      exact mul_ne_zero hfg.1 hfg.2⟩
  

Proof state:
K : Type u₁
inst✝² : Field K
v : Valuation K ℝ≥0
O : Type u₂
inst✝¹ : CommRing O
inst✝ : Algebra O K
hv : Valuation.Integers v O
p : ℕ
hp : Fact (Nat.Prime p)
hvp : Fact (v ↑p ≠ 1)
this✝ : Nontrivial (PreTilt K v O hv p)
this : NoZeroDivisors (PreTilt K v O hv p)
⊢ IsDomain (PreTilt K v O hv p)

Next tactic:
exact NoZeroDivisors.to_isDomain _
/-- The composition of Frobenius and Verschiebung is multiplication by `p`. -/
theorem frobenius_verschiebung (x : 𝕎 R) : frobenius (verschiebung x) = x * p := by
  

Proof state:
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝ : CommRing R
x : 𝕎 R
⊢ frobenius (verschiebung x) = x * ↑p

Next tactic:
have : IsPoly p fun {R} [CommRing R] x ↦ frobenius (verschiebung x) :=
    IsPoly.comp (hg := frobenius_isPoly p) (hf := verschiebung_isPoly)
/-- The composition of Frobenius and Verschiebung is multiplication by `p`. -/
theorem frobenius_verschiebung (x : 𝕎 R) : frobenius (verschiebung x) = x * p := by
  have : IsPoly p fun {R} [CommRing R] x ↦ frobenius (verschiebung x) :=
    IsPoly.comp (hg := frobenius_isPoly p) (hf := verschiebung_isPoly)
  

Proof state:
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝ : CommRing R
x : 𝕎 R
this : IsPoly p fun {R} [CommRing R] x => frobenius (verschiebung x)
⊢ frobenius (verschiebung x) = x * ↑p

Next tactic:
have : IsPoly p fun {R} [CommRing R] x ↦ x * p := mulN_isPoly p p
/-- The composition of Frobenius and Verschiebung is multiplication by `p`. -/
theorem frobenius_verschiebung (x : 𝕎 R) : frobenius (verschiebung x) = x * p := by
  have : IsPoly p fun {R} [CommRing R] x ↦ frobenius (verschiebung x) :=
    IsPoly.comp (hg := frobenius_isPoly p) (hf := verschiebung_isPoly)
  have : IsPoly p fun {R} [CommRing R] x ↦ x * p := mulN_isPoly p p
  

Proof state:
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝ : CommRing R
x : 𝕎 R
this✝ : IsPoly p fun {R} [CommRing R] x => frobenius (verschiebung x)
this : IsPoly p fun {R} [CommRing R] x => x * ↑p
⊢ frobenius (verschiebung x) = x * ↑p

Next tactic:
ghost_calc x
/-- The composition of Frobenius and Verschiebung is multiplication by `p`. -/
theorem frobenius_verschiebung (x : 𝕎 R) : frobenius (verschiebung x) = x * p := by
  have : IsPoly p fun {R} [CommRing R] x ↦ frobenius (verschiebung x) :=
    IsPoly.comp (hg := frobenius_isPoly p) (hf := verschiebung_isPoly)
  have : IsPoly p fun {R} [CommRing R] x ↦ x * p := mulN_isPoly p p
  ghost_calc x
  

Proof state:
case refine_3
p : ℕ
hp : Fact (Nat.Prime p)
this✝ : IsPoly p fun {R} [CommRing R] x => frobenius (verschiebung x)
this : IsPoly p fun {R} [CommRing R] x => x * ↑p
R : Type u_1
R._inst : CommRing R
x : 𝕎 R
⊢ ∀ (n : ℕ), (ghostComponent n) (frobenius (verschiebung x)) = (ghostComponent n) (x * ↑p)

Next tactic:
ghost_simp [mul_comm]
/-- Verschiebung is the same as multiplication by `p` on the ring of Witt vectors of `ZMod p`. -/
theorem verschiebung_zmod (x : 𝕎 (ZMod p)) : verschiebung x = x * p := by
  

Proof state:
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝ : CommRing R
x : 𝕎 (ZMod p)
⊢ verschiebung x = x * ↑p

Next tactic:
rw [← frobenius_verschiebung, frobenius_zmodp]
theorem coeff_p_pow [CharP R p] (i : ℕ) : ((p : 𝕎 R) ^ i).coeff i = 1 := by
  

Proof state:
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝¹ : CommRing R
inst✝ : CharP R p
i : ℕ
⊢ coeff (↑p ^ i) i = 1

Next tactic:
induction' i with i h
theorem coeff_p_pow [CharP R p] (i : ℕ) : ((p : 𝕎 R) ^ i).coeff i = 1 := by
  induction' i with i h
  · 

Proof state:
case zero
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝¹ : CommRing R
inst✝ : CharP R p
⊢ coeff (↑p ^ Nat.zero) Nat.zero = 1

Next tactic:
simp only [Nat.zero_eq, one_coeff_zero, Ne.def, pow_zero]
theorem coeff_p_pow [CharP R p] (i : ℕ) : ((p : 𝕎 R) ^ i).coeff i = 1 := by
  induction' i with i h
  · simp only [Nat.zero_eq, one_coeff_zero, Ne.def, pow_zero]
  · 

Proof state:
case succ
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝¹ : CommRing R
inst✝ : CharP R p
i : ℕ
h : coeff (↑p ^ i) i = 1
⊢ coeff (↑p ^ Nat.succ i) (Nat.succ i) = 1

Next tactic:
rw [pow_succ', ← frobenius_verschiebung, coeff_frobenius_charP,
      verschiebung_coeff_succ, h, one_pow]
theorem coeff_p_pow_eq_zero [CharP R p] {i j : ℕ} (hj : j ≠ i) : ((p : 𝕎 R) ^ i).coeff j = 0 := by
  

Proof state:
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝¹ : CommRing R
inst✝ : CharP R p
i j : ℕ
hj : j ≠ i
⊢ coeff (↑p ^ i) j = 0

Next tactic:
induction' i with i hi generalizing j
theorem coeff_p_pow_eq_zero [CharP R p] {i j : ℕ} (hj : j ≠ i) : ((p : 𝕎 R) ^ i).coeff j = 0 := by
  induction' i with i hi generalizing j
  · 

Proof state:
case zero
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝¹ : CommRing R
inst✝ : CharP R p
j : ℕ
hj : j ≠ Nat.zero
⊢ coeff (↑p ^ Nat.zero) j = 0

Next tactic:
rw [Nat.zero_eq, pow_zero, one_coeff_eq_of_pos]
theorem coeff_p_pow_eq_zero [CharP R p] {i j : ℕ} (hj : j ≠ i) : ((p : 𝕎 R) ^ i).coeff j = 0 := by
  induction' i with i hi generalizing j
  · rw [Nat.zero_eq, pow_zero, one_coeff_eq_of_pos]
    

Proof state:
case zero.hn
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝¹ : CommRing R
inst✝ : CharP R p
j : ℕ
hj : j ≠ Nat.zero
⊢ 0 < j

Next tactic:
exact Nat.pos_of_ne_zero hj
theorem coeff_p_pow_eq_zero [CharP R p] {i j : ℕ} (hj : j ≠ i) : ((p : 𝕎 R) ^ i).coeff j = 0 := by
  induction' i with i hi generalizing j
  · rw [Nat.zero_eq, pow_zero, one_coeff_eq_of_pos]
    exact Nat.pos_of_ne_zero hj
  · 

Proof state:
case succ
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝¹ : CommRing R
inst✝ : CharP R p
i : ℕ
hi : ∀ {j : ℕ}, j ≠ i → coeff (↑p ^ i) j = 0
j : ℕ
hj : j ≠ Nat.succ i
⊢ coeff (↑p ^ Nat.succ i) j = 0

Next tactic:
rw [pow_succ', ← frobenius_verschiebung, coeff_frobenius_charP]
theorem coeff_p_pow_eq_zero [CharP R p] {i j : ℕ} (hj : j ≠ i) : ((p : 𝕎 R) ^ i).coeff j = 0 := by
  induction' i with i hi generalizing j
  · rw [Nat.zero_eq, pow_zero, one_coeff_eq_of_pos]
    exact Nat.pos_of_ne_zero hj
  · rw [pow_succ', ← frobenius_verschiebung, coeff_frobenius_charP]
    

Proof state:
case succ
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝¹ : CommRing R
inst✝ : CharP R p
i : ℕ
hi : ∀ {j : ℕ}, j ≠ i → coeff (↑p ^ i) j = 0
j : ℕ
hj : j ≠ Nat.succ i
⊢ coeff (verschiebung (↑p ^ i)) j ^ p = 0

Next tactic:
cases j
theorem coeff_p_pow_eq_zero [CharP R p] {i j : ℕ} (hj : j ≠ i) : ((p : 𝕎 R) ^ i).coeff j = 0 := by
  induction' i with i hi generalizing j
  · rw [Nat.zero_eq, pow_zero, one_coeff_eq_of_pos]
    exact Nat.pos_of_ne_zero hj
  · rw [pow_succ', ← frobenius_verschiebung, coeff_frobenius_charP]
    cases j
    · 

Proof state:
case succ.zero
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝¹ : CommRing R
inst✝ : CharP R p
i : ℕ
hi : ∀ {j : ℕ}, j ≠ i → coeff (↑p ^ i) j = 0
hj : Nat.zero ≠ Nat.succ i
⊢ coeff (verschiebung (↑p ^ i)) Nat.zero ^ p = 0

Next tactic:
rw [verschiebung_coeff_zero, zero_pow]
theorem coeff_p_pow_eq_zero [CharP R p] {i j : ℕ} (hj : j ≠ i) : ((p : 𝕎 R) ^ i).coeff j = 0 := by
  induction' i with i hi generalizing j
  · rw [Nat.zero_eq, pow_zero, one_coeff_eq_of_pos]
    exact Nat.pos_of_ne_zero hj
  · rw [pow_succ', ← frobenius_verschiebung, coeff_frobenius_charP]
    cases j
    · rw [verschiebung_coeff_zero, zero_pow]
      

Proof state:
case succ.zero
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝¹ : CommRing R
inst✝ : CharP R p
i : ℕ
hi : ∀ {j : ℕ}, j ≠ i → coeff (↑p ^ i) j = 0
hj : Nat.zero ≠ Nat.succ i
⊢ 0 < p

Next tactic:
exact Nat.Prime.pos hp.out
theorem coeff_p_pow_eq_zero [CharP R p] {i j : ℕ} (hj : j ≠ i) : ((p : 𝕎 R) ^ i).coeff j = 0 := by
  induction' i with i hi generalizing j
  · rw [Nat.zero_eq, pow_zero, one_coeff_eq_of_pos]
    exact Nat.pos_of_ne_zero hj
  · rw [pow_succ', ← frobenius_verschiebung, coeff_frobenius_charP]
    cases j
    · rw [verschiebung_coeff_zero, zero_pow]
      exact Nat.Prime.pos hp.out
    · 

Proof state:
case succ.succ
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝¹ : CommRing R
inst✝ : CharP R p
i : ℕ
hi : ∀ {j : ℕ}, j ≠ i → coeff (↑p ^ i) j = 0
n✝ : ℕ
hj : Nat.succ n✝ ≠ Nat.succ i
⊢ coeff (verschiebung (↑p ^ i)) (Nat.succ n✝) ^ p = 0

Next tactic:
rw [verschiebung_coeff_succ, hi, zero_pow]
theorem coeff_p_pow_eq_zero [CharP R p] {i j : ℕ} (hj : j ≠ i) : ((p : 𝕎 R) ^ i).coeff j = 0 := by
  induction' i with i hi generalizing j
  · rw [Nat.zero_eq, pow_zero, one_coeff_eq_of_pos]
    exact Nat.pos_of_ne_zero hj
  · rw [pow_succ', ← frobenius_verschiebung, coeff_frobenius_charP]
    cases j
    · rw [verschiebung_coeff_zero, zero_pow]
      exact Nat.Prime.pos hp.out
    · rw [verschiebung_coeff_succ, hi, zero_pow]
      · 

Proof state:
case succ.succ
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝¹ : CommRing R
inst✝ : CharP R p
i : ℕ
hi : ∀ {j : ℕ}, j ≠ i → coeff (↑p ^ i) j = 0
n✝ : ℕ
hj : Nat.succ n✝ ≠ Nat.succ i
⊢ 0 < p

Next tactic:
exact Nat.Prime.pos hp.out
theorem coeff_p_pow_eq_zero [CharP R p] {i j : ℕ} (hj : j ≠ i) : ((p : 𝕎 R) ^ i).coeff j = 0 := by
  induction' i with i hi generalizing j
  · rw [Nat.zero_eq, pow_zero, one_coeff_eq_of_pos]
    exact Nat.pos_of_ne_zero hj
  · rw [pow_succ', ← frobenius_verschiebung, coeff_frobenius_charP]
    cases j
    · rw [verschiebung_coeff_zero, zero_pow]
      exact Nat.Prime.pos hp.out
    · rw [verschiebung_coeff_succ, hi, zero_pow]
      · exact Nat.Prime.pos hp.out
      · 

Proof state:
case succ.succ
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝¹ : CommRing R
inst✝ : CharP R p
i : ℕ
hi : ∀ {j : ℕ}, j ≠ i → coeff (↑p ^ i) j = 0
n✝ : ℕ
hj : Nat.succ n✝ ≠ Nat.succ i
⊢ n✝ ≠ i

Next tactic:
exact ne_of_apply_ne (fun j : ℕ => j.succ) hj
theorem coeff_p [CharP R p] (i : ℕ) : (p : 𝕎 R).coeff i = if i = 1 then 1 else 0 := by
  

Proof state:
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝¹ : CommRing R
inst✝ : CharP R p
i : ℕ
⊢ coeff (↑p) i = if i = 1 then 1 else 0

Next tactic:
split_ifs with hi
theorem coeff_p [CharP R p] (i : ℕ) : (p : 𝕎 R).coeff i = if i = 1 then 1 else 0 := by
  split_ifs with hi
  · 

Proof state:
case pos
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝¹ : CommRing R
inst✝ : CharP R p
i : ℕ
hi : i = 1
⊢ coeff (↑p) i = 1

Next tactic:
simpa only [hi, pow_one] using coeff_p_pow p R 1
theorem coeff_p [CharP R p] (i : ℕ) : (p : 𝕎 R).coeff i = if i = 1 then 1 else 0 := by
  split_ifs with hi
  · simpa only [hi, pow_one] using coeff_p_pow p R 1
  · 

Proof state:
case neg
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝¹ : CommRing R
inst✝ : CharP R p
i : ℕ
hi : ¬i = 1
⊢ coeff (↑p) i = 0

Next tactic:
simpa only [pow_one] using coeff_p_pow_eq_zero p R hi
@[simp]
theorem coeff_p_zero [CharP R p] : (p : 𝕎 R).coeff 0 = 0 := by
  

Proof state:
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝¹ : CommRing R
inst✝ : CharP R p
⊢ coeff (↑p) 0 = 0

Next tactic:
rw [coeff_p, if_neg]
@[simp]
theorem coeff_p_zero [CharP R p] : (p : 𝕎 R).coeff 0 = 0 := by
  rw [coeff_p, if_neg]
  

Proof state:
case hnc
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝¹ : CommRing R
inst✝ : CharP R p
⊢ ¬0 = 1

Next tactic:
exact zero_ne_one
@[simp]
theorem coeff_p_one [CharP R p] : (p : 𝕎 R).coeff 1 = 1 := by 

Proof state:
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝¹ : CommRing R
inst✝ : CharP R p
⊢ coeff (↑p) 1 = 1

Next tactic:
rw [coeff_p, if_pos rfl]
theorem p_nonzero [Nontrivial R] [CharP R p] : (p : 𝕎 R) ≠ 0 := by
  

Proof state:
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝² : CommRing R
inst✝¹ : Nontrivial R
inst✝ : CharP R p
⊢ ↑p ≠ 0

Next tactic:
intro h
theorem p_nonzero [Nontrivial R] [CharP R p] : (p : 𝕎 R) ≠ 0 := by
  intro h
  

Proof state:
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝² : CommRing R
inst✝¹ : Nontrivial R
inst✝ : CharP R p
h : ↑p = 0
⊢ False

Next tactic:
simpa only [h, zero_coeff, zero_ne_one] using coeff_p_one p R
theorem FractionRing.p_nonzero [Nontrivial R] [CharP R p] : (p : FractionRing (𝕎 R)) ≠ 0 := by
  

Proof state:
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝² : CommRing R
inst✝¹ : Nontrivial R
inst✝ : CharP R p
⊢ ↑p ≠ 0

Next tactic:
simpa using (IsFractionRing.injective (𝕎 R) (FractionRing (𝕎 R))).ne (WittVector.p_nonzero _ _)
/-- The “projection formula” for Frobenius and Verschiebung. -/
theorem verschiebung_mul_frobenius (x y : 𝕎 R) :
    verschiebung (x * frobenius y) = verschiebung x * y := by
  

Proof state:
p : ℕ
R : Type u_1
hp : Fact (Nat.Prime p)
inst✝ : CommRing R
x y : 𝕎 R
⊢ verschiebung (x * frobenius y) = verschiebung x * y

Next tactic:
have : IsPoly₂ p fun {R} [Rcr : CommRing R] x y ↦ verschiebung (x * frobenius y) :=
    IsPoly.comp₂ (hg := verschiebung_isPoly)
      (hf := IsPoly₂.comp (hh := mulIsPoly₂) (hf := idIsPolyI' p) (hg := frobenius_isPoly p))