PROOF.bend checks
raw source on the hub · import bendtorch@1.0.1.0/PROOF.bend as PROOF
The proofs of LAWS.bend. Every proof is plain Bend: no @unsafe, no ?TODO, no axioms. The arithmetic lemmas come from bend-ml-nat-lemmas; the division lemmas behind gqa_head are llama.bend's (MIT, same author).
7 imports
import Base import ./main.bend as T import ./spec.bend as Spec import ./tensor.bend as TT import ./LAWS.bend as Laws import bend-ml-nat-lemmas@0.1.1.0/main.bend as NL import bend-ml-tensor-array@0.1.14.0/main.bend as TA
Types
type L1R source · line 281 · raw
@-h:Nat -> @-dm:0xfc8448b10655d3efdb72c022131382f2/main.Dm -> @-xs:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS> -> @-acc:List<&1, Array<F32>> -> Type
L1R@-h:Nat -> @-dm:0xfc8448b10655d3efdb72c022131382f2/main.Dm -> @-xs:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS> -> @-acc:List<&1, Array<F32>> -> @ys:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS> -> @same:{ys == xs : List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS>} -> @fact:{0xfc8448b10655d3efdb72c022131382f2/main.fleaf(xs, h, dm, acc) == List.reverse.go(&1, Array<F32>, acc, fmap(h, dm, xs)) : List<&1, Array<F32>>} -> L1R<h, dm, xs, acc>
type MAR source · line 298 · raw
@-h:Nat -> @-dm:0xfc8448b10655d3efdb72c022131382f2/main.Dm -> @-a:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS> -> @-b:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS> -> Type
MAR@-h:Nat -> @-dm:0xfc8448b10655d3efdb72c022131382f2/main.Dm -> @-a:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS> -> @-b:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS> -> @ys:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS> -> @same:{ys == a : List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS>} -> @fact:{fmap(h, dm, List.append(&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS, a, b)) == List.append(&1, Array<F32>, fmap(h, dm, a), fmap(h, dm, b)) : List<&1, Array<F32>>} -> MAR<h, dm, a, b>
type GAR source · line 315 · raw
@-a:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS> -> @-b:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS> -> @-c:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS> -> Type
GAR@-a:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS> -> @-b:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS> -> @-c:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS> -> @ys:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS> -> @same:{ys == a : List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS>} -> @fact:{List.append(&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS, List.reverse.go(&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS, a, b), c) == List.reverse.go(&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS, a, List.append(&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS, b, c)) : List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS>} -> GAR<a, b, c>
type CGR source · line 332 · raw
@-k:Nat -> @-xs:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS> -> @-acc:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS> -> Type
CGR@-k:Nat -> @-xs:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS> -> @-acc:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS> -> @hh:0xfc8448b10655d3efdb72c022131382f2/main.Halves<0xfc8448b10655d3efdb72c022131382f2/main.FS> -> @same:{hh == 0xfc8448b10655d3efdb72c022131382f2/main.cut(0xfc8448b10655d3efdb72c022131382f2/main.FS, k, xs, acc) : 0xfc8448b10655d3efdb72c022131382f2/main.Halves<0xfc8448b10655d3efdb72c022131382f2/main.FS>} -> @cat:{0xfc8448b10655d3efdb72c022131382f2/main.hcat(0xfc8448b10655d3efdb72c022131382f2/main.FS, hh) == List.reverse.go(&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS, acc, xs) : List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS>} -> CGR<k, xs, acc>
type MR source · line 358 · raw
@-d:Nat -> @-gs:0xfc8448b10655d3efdb72c022131382f2/main.Halves<0xfc8448b10655d3efdb72c022131382f2/main.FS> -> @-n:Nat -> @-h:Nat -> @-dm:0xfc8448b10655d3efdb72c022131382f2/main.Dm -> Type
MR@-d:Nat -> @-gs:0xfc8448b10655d3efdb72c022131382f2/main.Halves<0xfc8448b10655d3efdb72c022131382f2/main.FS> -> @-n:Nat -> @-h:Nat -> @-dm:0xfc8448b10655d3efdb72c022131382f2/main.Dm -> @ys:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS> -> @same:{ys == 0xfc8448b10655d3efdb72c022131382f2/main.hcat(0xfc8448b10655d3efdb72c022131382f2/main.FS, gs) : List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS>} -> @fact:{0xfc8448b10655d3efdb72c022131382f2/main.fpar(d, gs, n, h, dm) == fmap(h, dm, 0xfc8448b10655d3efdb72c022131382f2/main.hcat(0xfc8448b10655d3efdb72c022131382f2/main.FS, gs)) : List<&1, Array<F32>>} -> MR<d, gs, n, h, dm>
type b_L1R source · line 442 · raw
@-h:Nat -> @-dm:0xfc8448b10655d3efdb72c022131382f2/main.Dm -> @-xs:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG> -> @-acc:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.DB> -> Type
b_L1R@-h:Nat -> @-dm:0xfc8448b10655d3efdb72c022131382f2/main.Dm -> @-xs:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG> -> @-acc:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.DB> -> @ys:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG> -> @same:{ys == xs : List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG>} -> @fact:{0xfc8448b10655d3efdb72c022131382f2/main.bleaf(xs, h, dm, acc) == List.reverse.go(&1, 0xfc8448b10655d3efdb72c022131382f2/main.DB, acc, b_fmap(h, dm, xs)) : List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.DB>} -> b_L1R<h, dm, xs, acc>
type b_MAR source · line 459 · raw
@-h:Nat -> @-dm:0xfc8448b10655d3efdb72c022131382f2/main.Dm -> @-a:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG> -> @-b:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG> -> Type
b_MAR@-h:Nat -> @-dm:0xfc8448b10655d3efdb72c022131382f2/main.Dm -> @-a:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG> -> @-b:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG> -> @ys:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG> -> @same:{ys == a : List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG>} -> @fact:{b_fmap(h, dm, List.append(&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG, a, b)) == List.append(&1, 0xfc8448b10655d3efdb72c022131382f2/main.DB, b_fmap(h, dm, a), b_fmap(h, dm, b)) : List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.DB>} -> b_MAR<h, dm, a, b>
type b_GAR source · line 476 · raw
@-a:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG> -> @-b:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG> -> @-c:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG> -> Type
b_GAR@-a:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG> -> @-b:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG> -> @-c:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG> -> @ys:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG> -> @same:{ys == a : List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG>} -> @fact:{List.append(&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG, List.reverse.go(&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG, a, b), c) == List.reverse.go(&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG, a, List.append(&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG, b, c)) : List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG>} -> b_GAR<a, b, c>
type b_CGR source · line 493 · raw
@-k:Nat -> @-xs:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG> -> @-acc:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG> -> Type
b_CGR@-k:Nat -> @-xs:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG> -> @-acc:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG> -> @hh:0xfc8448b10655d3efdb72c022131382f2/main.Halves<0xfc8448b10655d3efdb72c022131382f2/main.BG> -> @same:{hh == 0xfc8448b10655d3efdb72c022131382f2/main.cut(0xfc8448b10655d3efdb72c022131382f2/main.BG, k, xs, acc) : 0xfc8448b10655d3efdb72c022131382f2/main.Halves<0xfc8448b10655d3efdb72c022131382f2/main.BG>} -> @cat:{0xfc8448b10655d3efdb72c022131382f2/main.hcat(0xfc8448b10655d3efdb72c022131382f2/main.BG, hh) == List.reverse.go(&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG, acc, xs) : List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG>} -> b_CGR<k, xs, acc>
type b_MR source · line 519 · raw
@-d:Nat -> @-gs:0xfc8448b10655d3efdb72c022131382f2/main.Halves<0xfc8448b10655d3efdb72c022131382f2/main.BG> -> @-n:Nat -> @-h:Nat -> @-dm:0xfc8448b10655d3efdb72c022131382f2/main.Dm -> Type
b_MR@-d:Nat -> @-gs:0xfc8448b10655d3efdb72c022131382f2/main.Halves<0xfc8448b10655d3efdb72c022131382f2/main.BG> -> @-n:Nat -> @-h:Nat -> @-dm:0xfc8448b10655d3efdb72c022131382f2/main.Dm -> @ys:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG> -> @same:{ys == 0xfc8448b10655d3efdb72c022131382f2/main.hcat(0xfc8448b10655d3efdb72c022131382f2/main.BG, gs) : List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG>} -> @fact:{0xfc8448b10655d3efdb72c022131382f2/main.bpar(d, gs, n, h, dm) == b_fmap(h, dm, 0xfc8448b10655d3efdb72c022131382f2/main.hcat(0xfc8448b10655d3efdb72c022131382f2/main.BG, gs)) : List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.DB>} -> b_MR<d, gs, n, h, dm>
Definitions
def add4 source · line 17 · raw
@+a:Nat -> @+b:Nat -> @+c:Nat -> @+d:Nat -> {Nat.add(Nat.add(a, b), Nat.add(c, d)) == Nat.add(Nat.add(a, c), Nat.add(b, d)) : Nat}(a + b) + (c + d) == (a + c) + (b + d)
def mul_dist_l source · line 25 · raw
@+k:Nat -> @+a:Nat -> @+b:Nat -> {Nat.mul(k, Nat.add(a, b)) == Nat.add(Nat.mul(k, a), Nat.mul(k, b)) : Nat}k * (a + b) == k * a + k * b
def dot_vadd source · line 40 · raw
@a:List<&2, Nat> -> @b:List<&2, Nat> -> @v:List<&2, Nat> -> {0xfc8448b10655d3efdb72c022131382f2/spec.dotn(0xfc8448b10655d3efdb72c022131382f2/spec.vadd(a, b), v) == Nat.add(0xfc8448b10655d3efdb72c022131382f2/spec.dotn(a, v), 0xfc8448b10655d3efdb72c022131382f2/spec.dotn(b, v)) : Nat}dot(a + b, v) == dot(a, v) + dot(b, v): induction on the three vectors; at each entry (x + y)·z splits into x·z + y·z (distributivity) and add4 regroups the four terms
def dot_scale source · line 60 · raw
@+k:Nat -> @r:List<&2, Nat> -> @v:List<&2, Nat> -> {0xfc8448b10655d3efdb72c022131382f2/spec.dotn(0xfc8448b10655d3efdb72c022131382f2/spec.vscale(k, r), v) == Nat.mul(k, 0xfc8448b10655d3efdb72c022131382f2/spec.dotn(r, v)) : Nat}dot(k·r, v) == k · dot(r, v): at each entry (k·x)·z == k·(x·z) (associativity), then k factors out of the sum
def dot_comm source · line 75 · raw
@a:List<&2, Nat> -> @b:List<&2, Nat> -> {0xfc8448b10655d3efdb72c022131382f2/spec.dotn(a, b) == 0xfc8448b10655d3efdb72c022131382f2/spec.dotn(b, a) : Nat}dot(a, b) == dot(b, a)
def disc source · line 151 · raw
@b:Bool -> Type
def false_true source · line 159 · raw
@e:{False{} == True{} : Bool} -> EmptyFalse == True is impossible: rewriting the goal Empty = disc(False) with it gives disc(True) = Unit
def len_rcat source · line 164 · raw
@+xs:List<&2, F32> -> @+acc:List<&2, F32> -> {List.length(&2, F32, 0xfc8448b10655d3efdb72c022131382f2/main.rcat(xs, acc)) == Nat.add(List.length(&2, F32, xs), List.length(&2, F32, acc)) : Nat}xs reversed onto acc has the length of both
def len_drow source · line 172 · raw
@m:Nat -> @+hd:Nat -> @+ia:U32 -> @+ib:U32 -> @+bs:U32 -> @+acc:List<&2, F32> -> @r:0xfc8448b10655d3efdb72c022131382f2/main.D2 -> {List.length(&2, F32, 0xfc8448b10655d3efdb72c022131382f2/main.dr_row(0xfc8448b10655d3efdb72c022131382f2/main.drow(m, hd, ia, ib, bs, acc, r))) == Nat.add(1n+m, List.length(&2, F32, acc)) : Nat}drow's row has the current dot, the m after it, and acc: 1 + m + |acc| numbers
def sub0 source · line 184 · raw
@+n:Nat -> {Nat.sub(n, 0n) == n : Nat}n - 0 is n
def cnt_div source · line 192 · raw
@q:Array<F32> -> @k:Array<F32> -> @kk:Nat -> @+idx:U32 -> @+s:F32 -> @+c:Nat -> @r:Pair(Array<F32>, F32) -> {0xfc8448b10655d3efdb72c022131382f2/main.pr_n(0xfc8448b10655d3efdb72c022131382f2/main.pr_of(q, k, 0xfc8448b10655d3efdb72c022131382f2/main.pdiv(kk, idx, s, c, r))) == Nat.add(1n+kk, c) : Nat}the division loop of a softmax counts the 1 + k numbers it divides onto c (pr_of hands the count on as the row's)
def cnt_psm3 source · line 200 · raw
@q:Array<F32> -> @k:Array<F32> -> @+kk:Nat -> @+off:U32 -> @r:0xfc8448b10655d3efdb72c022131382f2/main.AS -> {0xfc8448b10655d3efdb72c022131382f2/main.pr_n(0xfc8448b10655d3efdb72c022131382f2/main.pr_of(q, k, 0xfc8448b10655d3efdb72c022131382f2/main.psm3(kk, off, r))) == 1n+kk : Nat}the whole softmax over 1 + kk numbers reports 1 + kk, whatever max and exp found (they are matched, not computed)
def cnt_psm2 source · line 205 · raw
@q:Array<F32> -> @k:Array<F32> -> @+kk:Nat -> @+off:U32 -> @r:0xfc8448b10655d3efdb72c022131382f2/main.AS -> {0xfc8448b10655d3efdb72c022131382f2/main.pr_n(0xfc8448b10655d3efdb72c022131382f2/main.pr_of(q, k, 0xfc8448b10655d3efdb72c022131382f2/main.psm2(kk, off, r))) == 1n+kk : Nat}
def cnt_pw source · line 211 · raw
@+xs:List<&2, F32> -> @+idx:U32 -> @+sc:F32 -> @+n:Nat -> @+off:U32 -> @q:Array<F32> -> @k:Array<F32> -> @p:Array<F32> -> {0xfc8448b10655d3efdb72c022131382f2/main.pr_n(0xfc8448b10655d3efdb72c022131382f2/main.prow3(off, q, k, 0xfc8448b10655d3efdb72c022131382f2/main.pw(xs, idx, sc, n, p))) == 1n+Nat.sub(Nat.add(List.length(&2, F32, xs), n), 1n) : Nat}pw writes xs and counts them from n; the softmax prow3 runs on them reports 1 + (|xs| + n - 1)
def cnt_drow source · line 219 · raw
@m:Nat -> @+hd:Nat -> @+ia:U32 -> @+ib:U32 -> @+bs:U32 -> @+acc:List<&2, F32> -> @r:0xfc8448b10655d3efdb72c022131382f2/main.D2 -> @+sc:F32 -> @+off:U32 -> @pa:Array<F32> -> {0xfc8448b10655d3efdb72c022131382f2/main.pr_n(0xfc8448b10655d3efdb72c022131382f2/main.prow2(sc, off, pa, 0xfc8448b10655d3efdb72c022131382f2/main.drow(m, hd, ia, ib, bs, acc, r))) == Nat.add(1n+m, List.length(&2, F32, acc)) : Nat}the count prow2 hands on for drow's row: 1 + m + |acc|, as len_drow, through cnt_pw
def cnt_gw source · line 240 · raw
@+xs:List<&2, F32> -> @+idx:U32 -> @+n:Nat -> @+sc:F32 -> @+off:U32 -> @d:Array<F32> -> @v:Array<F32> -> @p:Array<F32> -> @g:Array<F32> -> {0xfc8448b10655d3efdb72c022131382f2/main.gr_n(0xfc8448b10655d3efdb72c022131382f2/main.gr3(sc, off, d, v, p, 0xfc8448b10655d3efdb72c022131382f2/main.gw(xs, idx, n, g))) == Nat.add(List.length(&2, F32, xs), n) : Nat}gw writes xs and counts them from n: gr3 hands on |xs| + n (as cnt_pw for the forward pass)
def cnt_gdrow source · line 248 · raw
@m:Nat -> @+hd:Nat -> @+ia:U32 -> @+ib:U32 -> @+bs:U32 -> @+acc:List<&2, F32> -> @r:0xfc8448b10655d3efdb72c022131382f2/main.D2 -> @+sc:F32 -> @+off:U32 -> @pa:Array<F32> -> @ga:Array<F32> -> {0xfc8448b10655d3efdb72c022131382f2/main.gr_n(0xfc8448b10655d3efdb72c022131382f2/main.gr2(sc, off, pa, ga, 0xfc8448b10655d3efdb72c022131382f2/main.drow(m, hd, ia, ib, bs, acc, r))) == Nat.add(1n+m, List.length(&2, F32, acc)) : Nat}the count gr2 hands on for drow's row: 1 + m + |acc|, as len_drow, through cnt_gw (cnt_drow's twin)
def app2 source · line 267 · raw
@-A:Type -> @-a:List<&1, A> -> @-a2:List<&1, A> -> @-b:List<&1, A> -> @-b2:List<&1, A> -> @ea:{a == a2 : List<&1, A>} -> @eb:{b == b2 : List<&1, A>} -> {List.append(&1, A, a, b) == List.append(&1, A, a2, b2) : List<&1, A>}a ++ b == a2 ++ b2 from a == a2 and b == b2
def fmap source · line 272 · raw
@+h:Nat -> @+dm:0xfc8448b10655d3efdb72c022131382f2/main.Dm -> @xs:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS> -> List<&1, Array<F32>>
def l1_con source · line 284 · raw
@x:0xfc8448b10655d3efdb72c022131382f2/main.FS -> @-t:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS> -> @+h:Nat -> @+dm:0xfc8448b10655d3efdb72c022131382f2/main.Dm -> @-acc:List<&1, Array<F32>> -> @r:L1R<h, dm, t, 0xfc8448b10655d3efdb72c022131382f2/main.fs_o(0xfc8448b10655d3efdb72c022131382f2/main.fheads(h, 0n, dm, x)) <> acc> -> L1R<h, dm, x <> t, acc>
def l1 source · line 289 · raw
@xs:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS> -> @+h:Nat -> @+dm:0xfc8448b10655d3efdb72c022131382f2/main.Dm -> @-acc:List<&1, Array<F32>> -> L1R<h, dm, xs, acc>
def ma_con source · line 301 · raw
@x:0xfc8448b10655d3efdb72c022131382f2/main.FS -> @-t:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS> -> @+h:Nat -> @+dm:0xfc8448b10655d3efdb72c022131382f2/main.Dm -> @-b:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS> -> @r:MAR<h, dm, t, b> -> MAR<h, dm, x <> t, b>
def map_app source · line 306 · raw
@a:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS> -> @+h:Nat -> @+dm:0xfc8448b10655d3efdb72c022131382f2/main.Dm -> @-b:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS> -> MAR<h, dm, a, b>
def ga_con source · line 318 · raw
@x:0xfc8448b10655d3efdb72c022131382f2/main.FS -> @-t:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS> -> @-b:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS> -> @-c:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS> -> @r:GAR<t, x <> b, c> -> GAR<x <> t, b, c>
def go_app source · line 323 · raw
@a:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS> -> @-b:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS> -> @-c:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS> -> GAR<a, b, c>
def cg_base source · line 335 · raw
@-k:Nat -> @xs:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS> -> @-acc:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS> -> @e:{0xfc8448b10655d3efdb72c022131382f2/main.cut(0xfc8448b10655d3efdb72c022131382f2/main.FS, k, xs, acc) == 0xfc8448b10655d3efdb72c022131382f2/main.Halves{List.reverse(&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS, acc), xs} : 0xfc8448b10655d3efdb72c022131382f2/main.Halves<0xfc8448b10655d3efdb72c022131382f2/main.FS>} -> @r:GAR<acc, [], xs> -> CGR<k, xs, acc>
def cg_con source · line 342 · raw
@-m:Nat -> @-x:0xfc8448b10655d3efdb72c022131382f2/main.FS -> @-t:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS> -> @-acc:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS> -> @r:CGR<m, t, x <> acc> -> CGR<1n+m, x <> t, acc>
def cg source · line 347 · raw
@k:Nat -> @xs:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS> -> @acc:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS> -> CGR<k, xs, acc>
def m0c source · line 362 · raw
@-l:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS> -> @-r:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS> -> @-n:Nat -> @+h:Nat -> @+dm:0xfc8448b10655d3efdb72c022131382f2/main.Dm -> @-l1y:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS> -> @+sl:{l1y == l : List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS>} -> @fl:{0xfc8448b10655d3efdb72c022131382f2/main.fleaf(l, h, dm, []) == fmap(h, dm, l) : List<&1, Array<F32>>} -> @r1:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS> -> @sr:{r1 == r : List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS>} -> @fr:{0xfc8448b10655d3efdb72c022131382f2/main.fleaf(r, h, dm, []) == fmap(h, dm, r) : List<&1, Array<F32>>} -> @c:MAR<h, dm, l1y, r> -> MR<0n, 0xfc8448b10655d3efdb72c022131382f2/main.Halves{l, r}, n, h, dm>depth 0: the two leaves' loops, appended
def m0b source · line 371 · raw
@-l:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS> -> @-r:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS> -> @-n:Nat -> @+h:Nat -> @+dm:0xfc8448b10655d3efdb72c022131382f2/main.Dm -> @l1y:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS> -> @+sl:{l1y == l : List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS>} -> @fl:{0xfc8448b10655d3efdb72c022131382f2/main.fleaf(l, h, dm, []) == fmap(h, dm, l) : List<&1, Array<F32>>} -> @b:L1R<h, dm, r, []> -> MR<0n, 0xfc8448b10655d3efdb72c022131382f2/main.Halves{l, r}, n, h, dm>
def m0a source · line 376 · raw
@-l:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS> -> @r:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS> -> @-n:Nat -> @+h:Nat -> @+dm:0xfc8448b10655d3efdb72c022131382f2/main.Dm -> @a:L1R<h, dm, l, []> -> MR<0n, 0xfc8448b10655d3efdb72c022131382f2/main.Halves{l, r}, n, h, dm>
def m1c source · line 382 · raw
@-e:Nat -> @-l:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS> -> @-r:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS> -> @+n:Nat -> @+h:Nat -> @+dm:0xfc8448b10655d3efdb72c022131382f2/main.Dm -> @-hh1:0xfc8448b10655d3efdb72c022131382f2/main.Halves<0xfc8448b10655d3efdb72c022131382f2/main.FS> -> @s1:{hh1 == 0xfc8448b10655d3efdb72c022131382f2/main.cut(0xfc8448b10655d3efdb72c022131382f2/main.FS, 0x0f6479f09ada7ae614e64e31e8f5a730/main.half(0x0f6479f09ada7ae614e64e31e8f5a730/main.half(n)), l, []) : 0xfc8448b10655d3efdb72c022131382f2/main.Halves<0xfc8448b10655d3efdb72c022131382f2/main.FS>} -> @+cat1:{0xfc8448b10655d3efdb72c022131382f2/main.hcat(0xfc8448b10655d3efdb72c022131382f2/main.FS, hh1) == l : List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS>} -> @-hh2:0xfc8448b10655d3efdb72c022131382f2/main.Halves<0xfc8448b10655d3efdb72c022131382f2/main.FS> -> @s2:{hh2 == 0xfc8448b10655d3efdb72c022131382f2/main.cut(0xfc8448b10655d3efdb72c022131382f2/main.FS, 0x0f6479f09ada7ae614e64e31e8f5a730/main.half(Nat.sub(n, 0x0f6479f09ada7ae614e64e31e8f5a730/main.half(n))), r, []) : 0xfc8448b10655d3efdb72c022131382f2/main.Halves<0xfc8448b10655d3efdb72c022131382f2/main.FS>} -> @+cat2:{0xfc8448b10655d3efdb72c022131382f2/main.hcat(0xfc8448b10655d3efdb72c022131382f2/main.FS, hh2) == r : List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS>} -> @-y1:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS> -> @sy1:{y1 == 0xfc8448b10655d3efdb72c022131382f2/main.hcat(0xfc8448b10655d3efdb72c022131382f2/main.FS, hh1) : List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS>} -> @f1:{0xfc8448b10655d3efdb72c022131382f2/main.fpar(e, hh1, 0x0f6479f09ada7ae614e64e31e8f5a730/main.half(n), h, dm) == fmap(h, dm, 0xfc8448b10655d3efdb72c022131382f2/main.hcat(0xfc8448b10655d3efdb72c022131382f2/main.FS, hh1)) : List<&1, Array<F32>>} -> @y2:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS> -> @sy2:{y2 == 0xfc8448b10655d3efdb72c022131382f2/main.hcat(0xfc8448b10655d3efdb72c022131382f2/main.FS, hh2) : List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS>} -> @f2:{0xfc8448b10655d3efdb72c022131382f2/main.fpar(e, hh2, Nat.sub(n, 0x0f6479f09ada7ae614e64e31e8f5a730/main.half(n)), h, dm) == fmap(h, dm, 0xfc8448b10655d3efdb72c022131382f2/main.hcat(0xfc8448b10655d3efdb72c022131382f2/main.FS, hh2)) : List<&1, Array<F32>>} -> @ma:MAR<h, dm, y1, y2> -> MR<1n+e, 0xfc8448b10655d3efdb72c022131382f2/main.Halves{l, r}, n, h, dm>depth 1 + e: each half cut in two and its tree (the closures run main at depth e), then the two maps appended
def m1b source · line 393 · raw
@-e:Nat -> @-l:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS> -> @-r:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS> -> @+n:Nat -> @+h:Nat -> @+dm:0xfc8448b10655d3efdb72c022131382f2/main.Dm -> @-hh1:0xfc8448b10655d3efdb72c022131382f2/main.Halves<0xfc8448b10655d3efdb72c022131382f2/main.FS> -> @s1:{hh1 == 0xfc8448b10655d3efdb72c022131382f2/main.cut(0xfc8448b10655d3efdb72c022131382f2/main.FS, 0x0f6479f09ada7ae614e64e31e8f5a730/main.half(0x0f6479f09ada7ae614e64e31e8f5a730/main.half(n)), l, []) : 0xfc8448b10655d3efdb72c022131382f2/main.Halves<0xfc8448b10655d3efdb72c022131382f2/main.FS>} -> @cat1:{0xfc8448b10655d3efdb72c022131382f2/main.hcat(0xfc8448b10655d3efdb72c022131382f2/main.FS, hh1) == l : List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS>} -> @-hh2:0xfc8448b10655d3efdb72c022131382f2/main.Halves<0xfc8448b10655d3efdb72c022131382f2/main.FS> -> @s2:{hh2 == 0xfc8448b10655d3efdb72c022131382f2/main.cut(0xfc8448b10655d3efdb72c022131382f2/main.FS, 0x0f6479f09ada7ae614e64e31e8f5a730/main.half(Nat.sub(n, 0x0f6479f09ada7ae614e64e31e8f5a730/main.half(n))), r, []) : 0xfc8448b10655d3efdb72c022131382f2/main.Halves<0xfc8448b10655d3efdb72c022131382f2/main.FS>} -> @cat2:{0xfc8448b10655d3efdb72c022131382f2/main.hcat(0xfc8448b10655d3efdb72c022131382f2/main.FS, hh2) == r : List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS>} -> @r1:MR<e, hh1, 0x0f6479f09ada7ae614e64e31e8f5a730/main.half(n), h, dm> -> @r2:MR<e, hh2, Nat.sub(n, 0x0f6479f09ada7ae614e64e31e8f5a730/main.half(n)), h, dm> -> MR<1n+e, 0xfc8448b10655d3efdb72c022131382f2/main.Halves{l, r}, n, h, dm>
def m1a source · line 398 · raw
@-e:Nat -> @-l:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS> -> @-r:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS> -> @+n:Nat -> @+h:Nat -> @+dm:0xfc8448b10655d3efdb72c022131382f2/main.Dm -> @c1:CGR<0x0f6479f09ada7ae614e64e31e8f5a730/main.half(0x0f6479f09ada7ae614e64e31e8f5a730/main.half(n)), l, []> -> @c2:CGR<0x0f6479f09ada7ae614e64e31e8f5a730/main.half(Nat.sub(n, 0x0f6479f09ada7ae614e64e31e8f5a730/main.half(n))), r, []> -> @k1:(@g:0xfc8448b10655d3efdb72c022131382f2/main.Halves<0xfc8448b10655d3efdb72c022131382f2/main.FS> -> MR<e, g, 0x0f6479f09ada7ae614e64e31e8f5a730/main.half(n), h, dm>) -> @k2:(@g:0xfc8448b10655d3efdb72c022131382f2/main.Halves<0xfc8448b10655d3efdb72c022131382f2/main.FS> -> MR<e, g, Nat.sub(n, 0x0f6479f09ada7ae614e64e31e8f5a730/main.half(n)), h, dm>) -> MR<1n+e, 0xfc8448b10655d3efdb72c022131382f2/main.Halves{l, r}, n, h, dm>
def tree source · line 403 · raw
@d:Nat -> @gs:0xfc8448b10655d3efdb72c022131382f2/main.Halves<0xfc8448b10655d3efdb72c022131382f2/main.FS> -> @+n:Nat -> @+h:Nat -> @+dm:0xfc8448b10655d3efdb72c022131382f2/main.Dm -> MR<d, gs, n, h, dm>
def par_fin source · line 411 · raw
@-d:Nat -> @-gs:0xfc8448b10655d3efdb72c022131382f2/main.Halves<0xfc8448b10655d3efdb72c022131382f2/main.FS> -> @-n:Nat -> @+h:Nat -> @+dm:0xfc8448b10655d3efdb72c022131382f2/main.Dm -> @-ys:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS> -> @+sy:{ys == 0xfc8448b10655d3efdb72c022131382f2/main.hcat(0xfc8448b10655d3efdb72c022131382f2/main.FS, gs) : List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.FS>} -> @f:{0xfc8448b10655d3efdb72c022131382f2/main.fpar(d, gs, n, h, dm) == fmap(h, dm, 0xfc8448b10655d3efdb72c022131382f2/main.hcat(0xfc8448b10655d3efdb72c022131382f2/main.FS, gs)) : List<&1, Array<F32>>} -> @r:L1R<h, dm, ys, []> -> {0xfc8448b10655d3efdb72c022131382f2/main.fpar(d, gs, n, h, dm) == 0xfc8448b10655d3efdb72c022131382f2/main.fleaf(0xfc8448b10655d3efdb72c022131382f2/main.hcat(0xfc8448b10655d3efdb72c022131382f2/main.FS, gs), h, dm, []) : List<&1, Array<F32>>}the law: the tree gives what fleaf, the loop over the sequences one after another, gives
def par_mid source · line 419 · raw
@-d:Nat -> @-gs:0xfc8448b10655d3efdb72c022131382f2/main.Halves<0xfc8448b10655d3efdb72c022131382f2/main.FS> -> @-n:Nat -> @+h:Nat -> @+dm:0xfc8448b10655d3efdb72c022131382f2/main.Dm -> @r:MR<d, gs, n, h, dm> -> {0xfc8448b10655d3efdb72c022131382f2/main.fpar(d, gs, n, h, dm) == 0xfc8448b10655d3efdb72c022131382f2/main.fleaf(0xfc8448b10655d3efdb72c022131382f2/main.hcat(0xfc8448b10655d3efdb72c022131382f2/main.FS, gs), h, dm, []) : List<&1, Array<F32>>}
def b_fmap source · line 433 · raw
@+h:Nat -> @+dm:0xfc8448b10655d3efdb72c022131382f2/main.Dm -> @xs:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG> -> List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.DB>
def b_l1_con source · line 445 · raw
@x:0xfc8448b10655d3efdb72c022131382f2/main.BG -> @-t:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG> -> @+h:Nat -> @+dm:0xfc8448b10655d3efdb72c022131382f2/main.Dm -> @-acc:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.DB> -> @r:b_L1R<h, dm, t, 0xfc8448b10655d3efdb72c022131382f2/main.db_of(0xfc8448b10655d3efdb72c022131382f2/main.bgroups(h, 0n, dm, x)) <> acc> -> b_L1R<h, dm, x <> t, acc>
def b_l1 source · line 450 · raw
@xs:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG> -> @+h:Nat -> @+dm:0xfc8448b10655d3efdb72c022131382f2/main.Dm -> @-acc:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.DB> -> b_L1R<h, dm, xs, acc>
def b_ma_con source · line 462 · raw
@x:0xfc8448b10655d3efdb72c022131382f2/main.BG -> @-t:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG> -> @+h:Nat -> @+dm:0xfc8448b10655d3efdb72c022131382f2/main.Dm -> @-b:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG> -> @r:b_MAR<h, dm, t, b> -> b_MAR<h, dm, x <> t, b>
def b_map_app source · line 467 · raw
@a:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG> -> @+h:Nat -> @+dm:0xfc8448b10655d3efdb72c022131382f2/main.Dm -> @-b:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG> -> b_MAR<h, dm, a, b>
def b_ga_con source · line 479 · raw
@x:0xfc8448b10655d3efdb72c022131382f2/main.BG -> @-t:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG> -> @-b:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG> -> @-c:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG> -> @r:b_GAR<t, x <> b, c> -> b_GAR<x <> t, b, c>
def b_go_app source · line 484 · raw
@a:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG> -> @-b:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG> -> @-c:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG> -> b_GAR<a, b, c>
def b_cg_base source · line 496 · raw
@-k:Nat -> @xs:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG> -> @-acc:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG> -> @e:{0xfc8448b10655d3efdb72c022131382f2/main.cut(0xfc8448b10655d3efdb72c022131382f2/main.BG, k, xs, acc) == 0xfc8448b10655d3efdb72c022131382f2/main.Halves{List.reverse(&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG, acc), xs} : 0xfc8448b10655d3efdb72c022131382f2/main.Halves<0xfc8448b10655d3efdb72c022131382f2/main.BG>} -> @r:b_GAR<acc, [], xs> -> b_CGR<k, xs, acc>
def b_cg_con source · line 503 · raw
@-m:Nat -> @-x:0xfc8448b10655d3efdb72c022131382f2/main.BG -> @-t:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG> -> @-acc:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG> -> @r:b_CGR<m, t, x <> acc> -> b_CGR<1n+m, x <> t, acc>
def b_cg source · line 508 · raw
@k:Nat -> @xs:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG> -> @acc:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG> -> b_CGR<k, xs, acc>
def b_m0c source · line 523 · raw
@-l:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG> -> @-r:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG> -> @-n:Nat -> @+h:Nat -> @+dm:0xfc8448b10655d3efdb72c022131382f2/main.Dm -> @-l1y:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG> -> @+sl:{l1y == l : List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG>} -> @fl:{0xfc8448b10655d3efdb72c022131382f2/main.bleaf(l, h, dm, []) == b_fmap(h, dm, l) : List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.DB>} -> @r1:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG> -> @sr:{r1 == r : List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG>} -> @fr:{0xfc8448b10655d3efdb72c022131382f2/main.bleaf(r, h, dm, []) == b_fmap(h, dm, r) : List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.DB>} -> @c:b_MAR<h, dm, l1y, r> -> b_MR<0n, 0xfc8448b10655d3efdb72c022131382f2/main.Halves{l, r}, n, h, dm>depth 0: the two leaves' loops, appended
def b_m0b source · line 532 · raw
@-l:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG> -> @-r:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG> -> @-n:Nat -> @+h:Nat -> @+dm:0xfc8448b10655d3efdb72c022131382f2/main.Dm -> @l1y:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG> -> @+sl:{l1y == l : List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG>} -> @fl:{0xfc8448b10655d3efdb72c022131382f2/main.bleaf(l, h, dm, []) == b_fmap(h, dm, l) : List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.DB>} -> @b:b_L1R<h, dm, r, []> -> b_MR<0n, 0xfc8448b10655d3efdb72c022131382f2/main.Halves{l, r}, n, h, dm>
def b_m0a source · line 537 · raw
@-l:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG> -> @r:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG> -> @-n:Nat -> @+h:Nat -> @+dm:0xfc8448b10655d3efdb72c022131382f2/main.Dm -> @a:b_L1R<h, dm, l, []> -> b_MR<0n, 0xfc8448b10655d3efdb72c022131382f2/main.Halves{l, r}, n, h, dm>
def b_m1c source · line 543 · raw
@-e:Nat -> @-l:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG> -> @-r:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG> -> @+n:Nat -> @+h:Nat -> @+dm:0xfc8448b10655d3efdb72c022131382f2/main.Dm -> @-hh1:0xfc8448b10655d3efdb72c022131382f2/main.Halves<0xfc8448b10655d3efdb72c022131382f2/main.BG> -> @s1:{hh1 == 0xfc8448b10655d3efdb72c022131382f2/main.cut(0xfc8448b10655d3efdb72c022131382f2/main.BG, 0x0f6479f09ada7ae614e64e31e8f5a730/main.half(0x0f6479f09ada7ae614e64e31e8f5a730/main.half(n)), l, []) : 0xfc8448b10655d3efdb72c022131382f2/main.Halves<0xfc8448b10655d3efdb72c022131382f2/main.BG>} -> @+cat1:{0xfc8448b10655d3efdb72c022131382f2/main.hcat(0xfc8448b10655d3efdb72c022131382f2/main.BG, hh1) == l : List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG>} -> @-hh2:0xfc8448b10655d3efdb72c022131382f2/main.Halves<0xfc8448b10655d3efdb72c022131382f2/main.BG> -> @s2:{hh2 == 0xfc8448b10655d3efdb72c022131382f2/main.cut(0xfc8448b10655d3efdb72c022131382f2/main.BG, 0x0f6479f09ada7ae614e64e31e8f5a730/main.half(Nat.sub(n, 0x0f6479f09ada7ae614e64e31e8f5a730/main.half(n))), r, []) : 0xfc8448b10655d3efdb72c022131382f2/main.Halves<0xfc8448b10655d3efdb72c022131382f2/main.BG>} -> @+cat2:{0xfc8448b10655d3efdb72c022131382f2/main.hcat(0xfc8448b10655d3efdb72c022131382f2/main.BG, hh2) == r : List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG>} -> @-y1:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG> -> @sy1:{y1 == 0xfc8448b10655d3efdb72c022131382f2/main.hcat(0xfc8448b10655d3efdb72c022131382f2/main.BG, hh1) : List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG>} -> @f1:{0xfc8448b10655d3efdb72c022131382f2/main.bpar(e, hh1, 0x0f6479f09ada7ae614e64e31e8f5a730/main.half(n), h, dm) == b_fmap(h, dm, 0xfc8448b10655d3efdb72c022131382f2/main.hcat(0xfc8448b10655d3efdb72c022131382f2/main.BG, hh1)) : List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.DB>} -> @y2:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG> -> @sy2:{y2 == 0xfc8448b10655d3efdb72c022131382f2/main.hcat(0xfc8448b10655d3efdb72c022131382f2/main.BG, hh2) : List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG>} -> @f2:{0xfc8448b10655d3efdb72c022131382f2/main.bpar(e, hh2, Nat.sub(n, 0x0f6479f09ada7ae614e64e31e8f5a730/main.half(n)), h, dm) == b_fmap(h, dm, 0xfc8448b10655d3efdb72c022131382f2/main.hcat(0xfc8448b10655d3efdb72c022131382f2/main.BG, hh2)) : List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.DB>} -> @ma:b_MAR<h, dm, y1, y2> -> b_MR<1n+e, 0xfc8448b10655d3efdb72c022131382f2/main.Halves{l, r}, n, h, dm>depth 1 + e: each half cut in two and its b_tree (the closures run main at depth e), then the two maps appended
def b_m1b source · line 554 · raw
@-e:Nat -> @-l:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG> -> @-r:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG> -> @+n:Nat -> @+h:Nat -> @+dm:0xfc8448b10655d3efdb72c022131382f2/main.Dm -> @-hh1:0xfc8448b10655d3efdb72c022131382f2/main.Halves<0xfc8448b10655d3efdb72c022131382f2/main.BG> -> @s1:{hh1 == 0xfc8448b10655d3efdb72c022131382f2/main.cut(0xfc8448b10655d3efdb72c022131382f2/main.BG, 0x0f6479f09ada7ae614e64e31e8f5a730/main.half(0x0f6479f09ada7ae614e64e31e8f5a730/main.half(n)), l, []) : 0xfc8448b10655d3efdb72c022131382f2/main.Halves<0xfc8448b10655d3efdb72c022131382f2/main.BG>} -> @cat1:{0xfc8448b10655d3efdb72c022131382f2/main.hcat(0xfc8448b10655d3efdb72c022131382f2/main.BG, hh1) == l : List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG>} -> @-hh2:0xfc8448b10655d3efdb72c022131382f2/main.Halves<0xfc8448b10655d3efdb72c022131382f2/main.BG> -> @s2:{hh2 == 0xfc8448b10655d3efdb72c022131382f2/main.cut(0xfc8448b10655d3efdb72c022131382f2/main.BG, 0x0f6479f09ada7ae614e64e31e8f5a730/main.half(Nat.sub(n, 0x0f6479f09ada7ae614e64e31e8f5a730/main.half(n))), r, []) : 0xfc8448b10655d3efdb72c022131382f2/main.Halves<0xfc8448b10655d3efdb72c022131382f2/main.BG>} -> @cat2:{0xfc8448b10655d3efdb72c022131382f2/main.hcat(0xfc8448b10655d3efdb72c022131382f2/main.BG, hh2) == r : List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG>} -> @r1:b_MR<e, hh1, 0x0f6479f09ada7ae614e64e31e8f5a730/main.half(n), h, dm> -> @r2:b_MR<e, hh2, Nat.sub(n, 0x0f6479f09ada7ae614e64e31e8f5a730/main.half(n)), h, dm> -> b_MR<1n+e, 0xfc8448b10655d3efdb72c022131382f2/main.Halves{l, r}, n, h, dm>
def b_m1a source · line 559 · raw
@-e:Nat -> @-l:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG> -> @-r:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG> -> @+n:Nat -> @+h:Nat -> @+dm:0xfc8448b10655d3efdb72c022131382f2/main.Dm -> @c1:b_CGR<0x0f6479f09ada7ae614e64e31e8f5a730/main.half(0x0f6479f09ada7ae614e64e31e8f5a730/main.half(n)), l, []> -> @c2:b_CGR<0x0f6479f09ada7ae614e64e31e8f5a730/main.half(Nat.sub(n, 0x0f6479f09ada7ae614e64e31e8f5a730/main.half(n))), r, []> -> @k1:(@g:0xfc8448b10655d3efdb72c022131382f2/main.Halves<0xfc8448b10655d3efdb72c022131382f2/main.BG> -> b_MR<e, g, 0x0f6479f09ada7ae614e64e31e8f5a730/main.half(n), h, dm>) -> @k2:(@g:0xfc8448b10655d3efdb72c022131382f2/main.Halves<0xfc8448b10655d3efdb72c022131382f2/main.BG> -> b_MR<e, g, Nat.sub(n, 0x0f6479f09ada7ae614e64e31e8f5a730/main.half(n)), h, dm>) -> b_MR<1n+e, 0xfc8448b10655d3efdb72c022131382f2/main.Halves{l, r}, n, h, dm>
def b_tree source · line 564 · raw
@d:Nat -> @gs:0xfc8448b10655d3efdb72c022131382f2/main.Halves<0xfc8448b10655d3efdb72c022131382f2/main.BG> -> @+n:Nat -> @+h:Nat -> @+dm:0xfc8448b10655d3efdb72c022131382f2/main.Dm -> b_MR<d, gs, n, h, dm>
def b_par_fin source · line 572 · raw
@-d:Nat -> @-gs:0xfc8448b10655d3efdb72c022131382f2/main.Halves<0xfc8448b10655d3efdb72c022131382f2/main.BG> -> @-n:Nat -> @+h:Nat -> @+dm:0xfc8448b10655d3efdb72c022131382f2/main.Dm -> @-ys:List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG> -> @+sy:{ys == 0xfc8448b10655d3efdb72c022131382f2/main.hcat(0xfc8448b10655d3efdb72c022131382f2/main.BG, gs) : List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.BG>} -> @f:{0xfc8448b10655d3efdb72c022131382f2/main.bpar(d, gs, n, h, dm) == b_fmap(h, dm, 0xfc8448b10655d3efdb72c022131382f2/main.hcat(0xfc8448b10655d3efdb72c022131382f2/main.BG, gs)) : List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.DB>} -> @r:b_L1R<h, dm, ys, []> -> {0xfc8448b10655d3efdb72c022131382f2/main.bpar(d, gs, n, h, dm) == 0xfc8448b10655d3efdb72c022131382f2/main.bleaf(0xfc8448b10655d3efdb72c022131382f2/main.hcat(0xfc8448b10655d3efdb72c022131382f2/main.BG, gs), h, dm, []) : List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.DB>}the law: the b_tree gives what fleaf, the loop over the sequences one after another, gives
def b_par_mid source · line 580 · raw
@-d:Nat -> @-gs:0xfc8448b10655d3efdb72c022131382f2/main.Halves<0xfc8448b10655d3efdb72c022131382f2/main.BG> -> @-n:Nat -> @+h:Nat -> @+dm:0xfc8448b10655d3efdb72c022131382f2/main.Dm -> @r:b_MR<d, gs, n, h, dm> -> {0xfc8448b10655d3efdb72c022131382f2/main.bpar(d, gs, n, h, dm) == 0xfc8448b10655d3efdb72c022131382f2/main.bleaf(0xfc8448b10655d3efdb72c022131382f2/main.hcat(0xfc8448b10655d3efdb72c022131382f2/main.BG, gs), h, dm, []) : List<&1, 0xfc8448b10655d3efdb72c022131382f2/main.DB>}
def div_block source · line 594 · raw
@+m:Nat -> @-n:Nat -> @-d:Nat -> @-r:Nat -> {Nat.divmod.go(Nat.add(1n+m, n), m, d, r) == Nat.divmod.go(n, Nat.add(m, r), 1n+d, 0n) : Pair(Nat, Nat)}one block of 1 + m numbers adds 1 to the quotient (Nat.divmod.go counts down the remainder from m)
def div_blocks source · line 603 · raw
@+j:Nat -> @+s:Nat -> @+n:Nat -> @+d:Nat -> {Nat.divmod.go(Nat.add(Nat.mul(j, 1n+s), n), s, d, 0n) == Nat.divmod.go(n, s, Nat.add(j, d), 0n) : Pair(Nat, Nat)}j whole blocks of 1 + s numbers add j to the quotient
def div_rest source · line 615 · raw
@+i:Nat -> @-k:Nat -> @-d:Nat -> @-r:Nat -> {Pair.fst(Nat, Nat, Nat.divmod.go(i, Nat.add(i, k), d, r)) == d : Nat}fewer than 1 + s numbers after the last whole block leave the quotient alone
def or_comm source · line 642 · raw
@+a:Bool -> @+b:Bool -> {Bool.or(a, b) == Bool.or(b, a) : Bool}a || b == b || a, and a && b == b && a: every case computes
def and_comm source · line 653 · raw
@+a:Bool -> @+b:Bool -> {Bool.and(a, b) == Bool.and(b, a) : Bool}
def and_cong source · line 665 · raw
@+p:Bool -> @+p2:Bool -> @+q:Bool -> @+q2:Bool -> @e:{p == p2 : Bool} -> @f:{q == q2 : Bool} -> {Bool.and(p, q) == Bool.and(p2, q2) : Bool}equal operands give equal conjunctions and disjunctions
def or_cong source · line 668 · raw
@+p:Bool -> @+p2:Bool -> @+q:Bool -> @+q2:Bool -> @e:{p == p2 : Bool} -> @f:{q == q2 : Bool} -> {Bool.or(p, q) == Bool.or(p2, q2) : Bool}
def bc_dim_sym source · line 672 · raw
@+x:Nat -> @+y:Nat -> @+z:Nat -> {0xfc8448b10655d3efdb72c022131382f2/tensor.bc_dim(x, y, z) == 0xfc8448b10655d3efdb72c022131382f2/tensor.bc_dim(y, x, z) : Bool}one axis: bc_dim is written as pair(x, y) || pair(y, x), so swapping x and y only swaps the two sides of the ||
def bc_eq_sym source · line 677 · raw
@a:List<&2, Nat> -> @b:List<&2, Nat> -> @o:List<&2, Nat> -> {0xfc8448b10655d3efdb72c022131382f2/tensor.bc_eq(a, b, o) == 0xfc8448b10655d3efdb72c022131382f2/tensor.bc_eq(b, a, o) : Bool}axis by axis: the same on each axis (bc_dim_sym), and by induction on the rest; shapes of different ranks are False either way round
def bc_rank_sym source · line 697 · raw
@+la:Nat -> @+lb:Nat -> @+lo:Nat -> {0xfc8448b10655d3efdb72c022131382f2/tensor.bc_rank(la, lb, lo) == 0xfc8448b10655d3efdb72c022131382f2/tensor.bc_rank(lb, la, lo) : Bool}the ranks: the same two comparisons and the same two equalities, in the other order
def mul_swap source · line 707 · raw
@+h:Nat -> @+a:Nat -> @+r:Nat -> {Nat.mul(h, Nat.mul(a, r)) == Nat.mul(a, Nat.mul(h, r)) : Nat}h * (a * r) == a * (h * r): associativity, then commutativity of the first two factors, then associativity back
def pass_pair source · line 785 · raw
@+p:Nat -> @+k:Nat -> @+lo:Nat -> {0xfc8448b10655d3efdb72c022131382f2/spec.spass(0xfc8448b10655d3efdb72c022131382f2/spec.blocks(p, Nat.add(k, k), lo)) == 0xfc8448b10655d3efdb72c022131382f2/spec.blocks(1n+p, k, lo) : List<&2, 0xfc8448b10655d3efdb72c022131382f2/spec.Sum>}one pass over 2k blocks of 2^p cells gives the k blocks of 2^(p+1) cells: the pass adds blocks 2j and 2j+1, the two halves bal puts under one node. Induction on k; add_succ turns k + (k + 1) into 2 + (k + k), and add_assoc moves the next pair's start from (lo + 2^p) + 2^p to lo + 2^(p+1)
def cnt2 source · line 798 · raw
@+p:Nat -> @+k:Nat -> {Nat.mul(0xfc8448b10655d3efdb72c022131382f2/spec.pw(1n+p), k) == Nat.mul(0xfc8448b10655d3efdb72c022131382f2/spec.pw(p), Nat.add(k, k)) : Nat}2^(p+1) · k cells are 2^p · 2k: (a + a)·k == a·k + a·k == a·(k + k)
def blocks_passes source · line 806 · raw
@+p:Nat -> @+k:Nat -> @+lo:Nat -> {0xfc8448b10655d3efdb72c022131382f2/spec.passes(p, 0xfc8448b10655d3efdb72c022131382f2/spec.blocks(0n, Nat.mul(0xfc8448b10655d3efdb72c022131382f2/spec.pw(p), k), lo)) == 0xfc8448b10655d3efdb72c022131382f2/spec.blocks(p, k, lo) : List<&2, 0xfc8448b10655d3efdb72c022131382f2/spec.Sum>}the first p passes over a row of 2^p · k cells leave its k blocks, each summed as bal sums it. Induction on p: p passes over 2^(p+1)·k cells (= 2^p·2k, cnt2) leave 2k blocks of 2^p, and one more pass pairs them (pass_pair)
def passes_add source · line 818 · raw
@r:Nat -> @+p:Nat -> @+xs:List<&2, 0xfc8448b10655d3efdb72c022131382f2/spec.Sum> -> {0xfc8448b10655d3efdb72c022131382f2/spec.passes(Nat.add(r, p), xs) == 0xfc8448b10655d3efdb72c022131382f2/spec.passes(r, 0xfc8448b10655d3efdb72c022131382f2/spec.passes(p, xs)) : List<&2, 0xfc8448b10655d3efdb72c022131382f2/spec.Sum>}r + p passes are p passes, then r more
def main source · line 833 · raw
Unit