PROOF.tl.pick: def of bend-osdev-gf@0.1.1.0 Import: import bend-osdev-gf@0.1.1.0/PROOF.bend as PROOF Lines 7895-7905 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=7895&end_line=7905 import Base import bend-osdev-gf@0.1.1.0/gf.bend as G import bend-osdev-gf@0.1.1.0/tables.bend as T import bend-osdev-array@0.1.0.1/array.bend as A import bend-osdev-gf@0.1.1.0/proof_tab.bend as GT import bend-osdev-gf@0.1.1.0/proof_tab_cases.bend as GC import bend-osdev-gf@0.1.1.0/LAWS.bend as Laws # the product through the table, by whether each factor is zero def tl.pick(+f: G.Gf8Field, +l: List<&2, U32>, zx: Bool, zy: Bool, +a: U32, +b: U32, +ex: {U32.is_eq(G.Gf8.elt(a), 0) == zx : Bool}, +ey: {U32.is_eq(G.Gf8.elt(b), 0) == zy : Bool}, +hl: {List.length(&2, U32, l) == A.Arrays.slots(8n) : Nat}, +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.is_zero(a) == False{} : Bool} -> {G.Gf8.exp(f, G.Gf8.log(f, a)) == G.Gf8.elt(a) : U32}, elb: {G.Gf8.is_zero(b) == False{} : Bool} -> {G.Gf8.exp(f, G.Gf8.log(f, b)) == G.Gf8.elt(b) : U32}) -> {T.gf8tab.two.pick(Bool.or(zx, zy), GT.gt.tab(f, l), G.Gf8.elt(a), G.Gf8.elt(b), False{}) == (GT.gt.tab(f, l), G.Gf8.mul(f, a, b)) : T.Gf8Tab & U32}: match zx zy: case True{} _: %Equal.sym(U32, G.Gf8.mul(f, a, b), 0, tl.zero_l(f, a, b, ex)) : {(GT.gt.tab(f, l), 0) == (GT.gt.tab(f, l), _) : T.Gf8Tab & U32} {==} case False{} True{}: %Equal.sym(U32, G.Gf8.mul(f, a, b), 0, Equal.trans(U32, G.Gf8.mul(f, a, b), G.Gf8.mul(f, b, a), 0, Laws.mul_comm(f, a, b), tl.zero_l(f, b, a, ey))) : {(GT.gt.tab(f, l), 0) == (GT.gt.tab(f, l), _) : T.Gf8Tab & U32} {==} case False{} False{}: tl.nzpick(f, l, a, b, hl, hxa, hxb, ela(Equal.trans(Bool, G.Gf8.is_zero(a), U32.is_eq(G.Gf8.elt(a), 0), False{}, Equal.sym(Bool, U32.is_eq(G.Gf8.elt(a), 0), G.Gf8.is_zero(a), GC.gc.isz(a)), ex)), elb(Equal.trans(Bool, G.Gf8.is_zero(b), U32.is_eq(G.Gf8.elt(b), 0), False{}, Equal.sym(Bool, U32.is_eq(G.Gf8.elt(b), 0), G.Gf8.is_zero(b), GC.gc.isz(b)), ey))) Uses (28): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.or 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=List.length https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Pair https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Sigma https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.from_nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_eq 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-array@0.1.0.1/array.bend&name=Arrays.slots 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/PROOF.bend&name=tl.nzpick https://jend.leeeet.dev/definition.txt?path=bend-osdev-gf@0.1.1.0/PROOF.bend&name=tl.zero_l 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.is_zero 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=Gf8Field https://jend.leeeet.dev/definition.txt?path=bend-osdev-gf@0.1.1.0/proof_tab.bend&name=gt.tab https://jend.leeeet.dev/definition.txt?path=bend-osdev-gf@0.1.1.0/proof_tab_cases.bend&name=gc.isz https://jend.leeeet.dev/definition.txt?path=bend-osdev-gf@0.1.1.0/tables.bend&name=Gf8Tab https://jend.leeeet.dev/definition.txt?path=bend-osdev-gf@0.1.1.0/tables.bend&name=gf8tab.two.pick