def add_lt

stelliferous@0.0.2.0 · proofs/nat_order.bend:331

import stelliferous@0.0.2.0/proofs/nat_order.bend as NatOrder
import Base
import stelliferous@0.0.2.0/proofs/word_encoding.bend as WordEncoding

331# Order structure shared by padding, allocation and mixed-radix indexing.
332def add_lt(+a: Nat,+b: Nat,+c: Nat,h: {Nat.is_lt(a,b) == True{} : Bool}) -> {Nat.is_lt(Nat.add(a,c),Nat.add(b,c)) == True{} : Bool}:
333  match a b:
334    case 0n 0n:
335      Empty.absurd({Nat.is_lt(c,c) == True{} : Bool},WordEncoding.false_true(h))
336    case 0n 1n+ +b:
337      lt_succ(c,Nat.add(b,c),
338        %commutative(c,b) : {Nat.is_le(c,_) == True{} : Bool}
339        le_add(c,b))
340    case 1n+a 0n:
341      Empty.absurd({Nat.is_lt(Nat.add(1n+a,c),c) == True{} : Bool},WordEncoding.false_true(h))
342    case 1n+a 1n+b:
343      add_lt(a,b,c,h)

Uses (10)

Used by (0)

No other definition uses this definition.