def gt.elist_nth

bend-osdev-gf@0.1.1.0 · proof_tab.bend:273

import bend-osdev-gf@0.1.1.0/proof_tab.bend as ProofTab
import Base
import bend-osdev-array@0.1.0.1/array.bend as A
import bend-osdev-gf@0.1.1.0/gf.bend as G
import bend-osdev-u32@0.1.0.0/LAWS.bend as UL

273# entry j of the exp table's list is gen^j, for j < 510
274def gt.elist_nth(+n: Nat, +f: G.Gf8Field, +k: Nat, +j: Nat, h: {Nat.is_lt(j, n) == True{} : Bool}) -> {A.Arrays.nth(U32, gt.elist(n, f, k), j, 0) == G.Gf8.exp(f, Nat.add(j, k)) : U32}:
275  match n j:
276    case 0n 0n:
277      Empty.absurd({A.Arrays.nth(U32, gt.elist(0n, f, k), 0n, 0) == G.Gf8.exp(f, Nat.add(0n, k)) : U32}, gt.ft(h))
278    case 0n 1n+i:
279      Empty.absurd({A.Arrays.nth(U32, gt.elist(0n, f, k), 1n+i, 0) == G.Gf8.exp(f, Nat.add(1n+i, k)) : U32}, gt.ft(h))
280    case 1n+m 0n:
281      {==}
282    case 1n+m 1n+i:
283      %UL.nat_add_succ(i, k) : {A.Arrays.nth(U32, gt.elist(m, f, 1n+k), i, 0) == G.Gf8.exp(f, _) : U32}
284      gt.elist_nth(m, f, 1n+k, i, h)

Uses (12)

Used by (2)