def add_le

stelliferous@0.0.2.0 · proofs/nat_order.bend:317

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

317# Order structure shared by padding, allocation and mixed-radix indexing.
318def add_le(+a: Nat,+b: Nat,+c: Nat,h: {Nat.is_le(a,b) == True{} : Bool}) -> {Nat.is_le(Nat.add(a,c),Nat.add(b,c)) == True{} : Bool}:
319  match a b:
320    case 0n 0n:
321      reflexive(c)
322    case 0n 1n+ +b:
323      successor(c,Nat.add(b,c),
324        %commutative(c,b) : {Nat.is_le(c,_) == True{} : Bool}
325        le_add(c,b))
326    case 1n+a 0n:
327      Empty.absurd({Nat.is_le(Nat.add(1n+a,c),c) == True{} : Bool},WordEncoding.false_true(h))
328    case 1n+a 1n+b:
329      add_le(a,b,c,h)

Uses (10)

Used by (0)

No other definition uses this definition.