PROOF.tl.nz: def of bend-osdev-gf@0.1.1.0 Import: import bend-osdev-gf@0.1.1.0/PROOF.bend as PROOF Lines 7859-7871 of bend-osdev-gf@0.1.1.0/PROOF.bend: https://jend.leeeet.dev/read.txt?path=bend-osdev-gf@0.1.1.0/PROOF.bend&start_line=7859&end_line=7871 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 # both factors nonzero: the exp table's entry at log a + log b is the # product, for a field f whose log list l gives log a and log b def 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}: %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} %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} %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} %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} %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} %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} %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} %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} %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} 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): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Equal.sym https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Equal.trans https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.from_nat https://jend.leeeet.dev/definition.txt?path=bend-osdev-array@0.1.0.1/LAWS.bend&name=index_of_nat https://jend.leeeet.dev/definition.txt?path=bend-osdev-array@0.1.0.1/array.bend&name=Arrays.index https://jend.leeeet.dev/definition.txt?path=bend-osdev-array@0.1.0.1/array.bend&name=Arrays.nth https://jend.leeeet.dev/definition.txt?path=bend-osdev-gf@0.1.1.0/LAWS.bend&name=mul_comm https://jend.leeeet.dev/definition.txt?path=bend-osdev-gf@0.1.1.0/LAWS.bend&name=pow_add https://jend.leeeet.dev/definition.txt?path=bend-osdev-gf@0.1.1.0/PROOF.bend&name=tl.mul_elt https://jend.leeeet.dev/definition.txt?path=bend-osdev-gf@0.1.1.0/gf.bend&name=Gf8.elt https://jend.leeeet.dev/definition.txt?path=bend-osdev-gf@0.1.1.0/gf.bend&name=Gf8.exp https://jend.leeeet.dev/definition.txt?path=bend-osdev-gf@0.1.1.0/gf.bend&name=Gf8.gen https://jend.leeeet.dev/definition.txt?path=bend-osdev-gf@0.1.1.0/gf.bend&name=Gf8.log https://jend.leeeet.dev/definition.txt?path=bend-osdev-gf@0.1.1.0/gf.bend&name=Gf8.mul https://jend.leeeet.dev/definition.txt?path=bend-osdev-gf@0.1.1.0/gf.bend&name=Gf8.pow https://jend.leeeet.dev/definition.txt?path=bend-osdev-gf@0.1.1.0/gf.bend&name=Gf8Field https://jend.leeeet.dev/definition.txt?path=bend-osdev-gf@0.1.1.0/proof_tab.bend&name=gt.add_nat https://jend.leeeet.dev/definition.txt?path=bend-osdev-gf@0.1.1.0/proof_tab.bend&name=gt.elist https://jend.leeeet.dev/definition.txt?path=bend-osdev-gf@0.1.1.0/proof_tab.bend&name=gt.elist_nth https://jend.leeeet.dev/definition.txt?path=bend-osdev-gf@0.1.1.0/proof_tab.bend&name=gt.hd9 https://jend.leeeet.dev/definition.txt?path=bend-osdev-gf@0.1.1.0/proof_tab.bend&name=gt.log_lt https://jend.leeeet.dev/definition.txt?path=bend-osdev-gf@0.1.1.0/proof_tab.bend&name=gt.lt_sum https://jend.leeeet.dev/definition.txt?path=bend-osdev-gf@0.1.1.0/proof_tab.bend&name=gt.sum_lt https://jend.leeeet.dev/definition.txt?path=bend-osdev-u32@0.1.0.0/LAWS.bend&name=nat_add_zero