Skip to content

Commit b5d5002

Browse files
klausnatquangvdao
andauthored
feat(SplitFold): add splitNth_eval_comp_pow evaluation lemma (#452)
* extract splitNth * fix style guide violation --------- Co-authored-by: Quang Dao <qvd@andrew.cmu.edu>
1 parent 507ba69 commit b5d5002

2 files changed

Lines changed: 16 additions & 10 deletions

File tree

ArkLib/Data/Polynomial/SplitFold.lean

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,4 +313,19 @@ lemma foldNth_zero {s : ℕ} {α : 𝔽} : foldNth (2 ^ s) 0 α = 0 := by
313313
(0 : 𝔽[X]) := by rfl
314314
simp [this]
315315

316+
omit [NoZeroDivisors 𝔽] in
317+
/--
318+
Lemma bridges the coefficient-level identity `splitNth_def` and
319+
evaluation-level reasoning about `splitNth` and `foldNth`.
320+
-/
321+
lemma splitNth_eval_comp_pow {n : ℕ} [NeZero n] (f : 𝔽[X]) (x : 𝔽) (i : Fin n) :
322+
(eval₂ C (X ^ n) (splitNth f n i)).eval x = (splitNth f n i).eval (x ^ n) := by
323+
rw [eval₂_eq_sum]
324+
unfold Polynomial.eval
325+
rw [Polynomial.eval₂_sum, eval₂_eq_sum]
326+
congr
327+
ext e a
328+
rw [← eval]
329+
simp
330+
316331
end Polynomial

ArkLib/ProofSystem/Fri/RoundConsistency.lean

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,6 @@ lemma generalised_round_consistency_completeness
9191
rw [splitNth_def n f]
9292
rw [Polynomial.eval_finset_sum]
9393
simp only [eval_mul, eval_C, eval_pow]
94-
have eval_eval₂_pow_eq_eval_pow {s : 𝔽} (i) :
95-
eval s (eval₂ C (X ^ n) (splitNth f n i)) = (splitNth f n i).eval (s ^ n) := by
96-
rw [eval₂_eq_sum]
97-
unfold Polynomial.eval
98-
rw [Polynomial.eval₂_sum, eval₂_eq_sum]
99-
congr
100-
ext e a
101-
rw [←eval]
102-
simp
10394
conv =>
10495
left
10596
congr
@@ -110,7 +101,7 @@ lemma generalised_round_consistency_completeness
110101
congr
111102
· skip
112103
ext j
113-
rw [eval_mul, eval_pow, eval_X, eval_eval₂_pow_eq_eval_pow]
104+
rw [eval_mul, eval_pow, eval_X, splitNth_eval_comp_pow]
114105
rhs
115106
rw [mul_pow, h, one_mul]
116107
generalize heq : @Lagrange.interpolate 𝔽 inst1 (Fin _) _ _ _ _ = p'

0 commit comments

Comments
 (0)