def tl.nz

bend-osdev-gf@0.1.1.0 · PROOF.bend:7859

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

7859# both factors nonzero: the exp table's entry at log a + log b is the
7860# product, for a field f whose log list l gives log a and log b
7861def tl.nz(+f: G.Gf8Field, +l: List<&2, U32>, +a: U32, +b: U32, +hxa: {A.Arrays.nth(U32, l, A.Arrays.index(8n, G.Gf8.elt(a)), 0) == U32.from_nat(G.Gf8.log(f, a)) : U32}, +hxb: {A.Arrays.nth(U32, l, A.Arrays.index(8n, G.Gf8.elt(b)), 0) == U32.from_nat(G.Gf8.log(f, b)) : U32}, +ela: {G.Gf8.exp(f, G.Gf8.log(f, a)) == G.Gf8.elt(a) : U32}, +elb: {G.Gf8.exp(f, G.Gf8.log(f, b)) == G.Gf8.elt(b) : U32}) -> {A.Arrays.nth(U32, GT.gt.elist(510n, f, 0n), A.Arrays.index(9n, U32.add(A.Arrays.nth(U32, l, A.Arrays.index(8n, G.Gf8.elt(a)), 0), A.Arrays.nth(U32, l, A.Arrays.index(8n, G.Gf8.elt(b)), 0))), 0) == G.Gf8.mul(f, a, b) : U32}:
7862  %Equal.sym(U32, A.Arrays.nth(U32, l, A.Arrays.index(8n, G.Gf8.elt(a)), 0), U32.from_nat(G.Gf8.log(f, a)), hxa) : {A.Arrays.nth(U32, GT.gt.elist(510n, f, 0n), A.Arrays.index(9n, U32.add(_, A.Arrays.nth(U32, l, A.Arrays.index(8n, G.Gf8.elt(b)), 0))), 0) == G.Gf8.mul(f, a, b) : U32}
7863  %Equal.sym(U32, A.Arrays.nth(U32, l, A.Arrays.index(8n, G.Gf8.elt(b)), 0), U32.from_nat(G.Gf8.log(f, b)), hxb) : {A.Arrays.nth(U32, GT.gt.elist(510n, f, 0n), A.Arrays.index(9n, U32.add(U32.from_nat(G.Gf8.log(f, a)), _)), 0) == G.Gf8.mul(f, a, b) : U32}
7864  %Equal.sym(U32, U32.add(U32.from_nat(G.Gf8.log(f, a)), U32.from_nat(G.Gf8.log(f, b))), U32.from_nat(Nat.add(G.Gf8.log(f, b), G.Gf8.log(f, a))), GT.gt.add_nat(G.Gf8.log(f, a), G.Gf8.log(f, b))) : {A.Arrays.nth(U32, GT.gt.elist(510n, f, 0n), A.Arrays.index(9n, _), 0) == G.Gf8.mul(f, a, b) : U32}
7865  %Equal.sym(Nat, A.Arrays.index(9n, U32.from_nat(Nat.add(G.Gf8.log(f, b), G.Gf8.log(f, a)))), Nat.add(G.Gf8.log(f, b), G.Gf8.log(f, a)), AL.index_of_nat(9n, GT.gt.hd9(), Nat.add(G.Gf8.log(f, b), G.Gf8.log(f, a)), GT.gt.sum_lt(G.Gf8.log(f, b), G.Gf8.log(f, a), GT.gt.log_lt(f, b), GT.gt.log_lt(f, a)))) : {A.Arrays.nth(U32, GT.gt.elist(510n, f, 0n), _, 0) == G.Gf8.mul(f, a, b) : U32}
7866  %Equal.sym(U32, A.Arrays.nth(U32, GT.gt.elist(510n, f, 0n), Nat.add(G.Gf8.log(f, b), G.Gf8.log(f, a)), 0), G.Gf8.exp(f, Nat.add(Nat.add(G.Gf8.log(f, b), G.Gf8.log(f, a)), 0n)), GT.gt.elist_nth(510n, f, 0n, Nat.add(G.Gf8.log(f, b), G.Gf8.log(f, a)), GT.gt.lt_sum(G.Gf8.log(f, b), 255n, G.Gf8.log(f, a), 255n, GT.gt.log_lt(f, b), GT.gt.log_lt(f, a)))) : {_ == G.Gf8.mul(f, a, b) : U32}
7867  %Equal.sym(Nat, Nat.add(Nat.add(G.Gf8.log(f, b), G.Gf8.log(f, a)), 0n), Nat.add(G.Gf8.log(f, b), G.Gf8.log(f, a)), UL.nat_add_zero(Nat.add(G.Gf8.log(f, b), G.Gf8.log(f, a)))) : {G.Gf8.exp(f, _) == G.Gf8.mul(f, a, b) : U32}
7868  %Equal.sym(U32, G.Gf8.pow(f, G.Gf8.gen(f), Nat.add(G.Gf8.log(f, b), G.Gf8.log(f, a))), G.Gf8.mul(f, G.Gf8.pow(f, G.Gf8.gen(f), G.Gf8.log(f, b)), G.Gf8.pow(f, G.Gf8.gen(f), G.Gf8.log(f, a))), Laws.pow_add(f, G.Gf8.gen(f), G.Gf8.log(f, b), G.Gf8.log(f, a))) : {_ == G.Gf8.mul(f, a, b) : U32}
7869  %Equal.sym(U32, G.Gf8.exp(f, G.Gf8.log(f, b)), G.Gf8.elt(b), elb) : {G.Gf8.mul(f, _, G.Gf8.pow(f, G.Gf8.gen(f), G.Gf8.log(f, a))) == G.Gf8.mul(f, a, b) : U32}
7870  %Equal.sym(U32, G.Gf8.exp(f, G.Gf8.log(f, a)), G.Gf8.elt(a), ela) : {G.Gf8.mul(f, G.Gf8.elt(b), _) == G.Gf8.mul(f, a, b) : U32}
7871  Equal.trans(U32, G.Gf8.mul(f, G.Gf8.elt(b), G.Gf8.elt(a)), G.Gf8.mul(f, b, a), G.Gf8.mul(f, a, b), tl.mul_elt(f, b, a), Laws.mul_comm(f, b, a))

Uses (29)

Used by (1)