Additive NTT Correctness #
The stage-wise correctness argument and the final correctness theorem for the Additive NTT.
theorem
AdditiveNTT.initial_tiled_coeffs_correctness
{r : β}
[NeZero r]
{L : Type u}
[Field L]
[Fintype L]
[DecidableEq L]
(π½q : Type u)
[Field π½q]
[Fintype π½q]
[h_Fq_char_prime : Fact (Nat.Prime (ringChar π½q))]
[Algebra π½q L]
(Ξ² : Fin r β L)
[hΞ²_lin_indep : Fact (LinearIndependent π½q Ξ²)]
[h_Ξ²β_eq_1 : Fact (Ξ² 0 = 1)]
{β R_rate : β}
(h_β_add_R_rate : β + R_rate < r)
(h_β : β β€ r)
(a : Fin (2 ^ β) β L)
:
have b := tileCoeffs a;
additiveNTTInvariant π½q Ξ² h_β_add_R_rate b a β¨β, β―β©
theorem
AdditiveNTT.NTTStage_correctness
{r : β}
[NeZero r]
{L : Type u}
[Field L]
[Fintype L]
[DecidableEq L]
(π½q : Type u)
[Field π½q]
[Fintype π½q]
[h_Fq_char_prime : Fact (Nat.Prime (ringChar π½q))]
[Algebra π½q L]
(Ξ² : Fin r β L)
[hΞ²_lin_indep : Fact (LinearIndependent π½q Ξ²)]
{β R_rate : β}
(h_β_add_R_rate : β + R_rate < r)
(i : Fin β)
(input_buffer : Fin (2 ^ (β + R_rate)) β L)
(original_coeffs : Fin (2 ^ β) β L)
:
additiveNTTInvariant π½q Ξ² h_β_add_R_rate input_buffer original_coeffs β¨βi + 1, β―β© β
additiveNTTInvariant π½q Ξ² h_β_add_R_rate (NTTStage π½q Ξ² h_β_add_R_rate β¨βi, β―β© input_buffer) original_coeffs β¨βi, β―β©
theorem
AdditiveNTT.foldl_NTTStage_inductive_aux
{r : β}
[NeZero r]
{L : Type u}
[Field L]
[Fintype L]
[DecidableEq L]
(π½q : Type u)
[Field π½q]
[Fintype π½q]
[h_Fq_char_prime : Fact (Nat.Prime (ringChar π½q))]
[Algebra π½q L]
(Ξ² : Fin r β L)
[hΞ²_lin_indep : Fact (LinearIndependent π½q Ξ²)]
[h_Ξ²β_eq_1 : Fact (Ξ² 0 = 1)]
{β R_rate : β}
(h_β_add_R_rate : β + R_rate < r)
(h_β : β β€ r)
(k : Fin (β + 1))
(original_coeffs : Fin (2 ^ β) β L)
:
theorem
AdditiveNTT.additiveNTT_correctness
{r : β}
[NeZero r]
{L : Type u}
[Field L]
[Fintype L]
[DecidableEq L]
(π½q : Type u)
[Field π½q]
[Fintype π½q]
[h_Fq_char_prime : Fact (Nat.Prime (ringChar π½q))]
[Algebra π½q L]
(Ξ² : Fin r β L)
[hΞ²_lin_indep : Fact (LinearIndependent π½q Ξ²)]
[h_Ξ²β_eq_1 : Fact (Ξ² 0 = 1)]
{β R_rate : β}
(h_β_add_R_rate : β + R_rate < r)
(h_β : β β€ r)
(original_coeffs : Fin (2 ^ β) β L)
(output_buffer : Fin (2 ^ (β + R_rate)) β L)
(h_alg : output_buffer = additiveNTT π½q Ξ² h_β_add_R_rate original_coeffs)
:
have P := polynomialFromNovelCoeffs π½q Ξ² β h_β original_coeffs;
β (j : Fin (2 ^ (β + R_rate))), output_buffer j = Polynomial.eval (evaluationPointΟ π½q Ξ² h_β_add_R_rate β¨0, β―β© j) P