def le_trans

bendtorch-core@0.1.0.0 · src/autograd/reduce_fiber_proof.bend:125

import bendtorch-core@0.1.0.0/src/autograd/reduce_fiber_proof.bend as ReduceFiberProof
import Base
import bendtorch-core@0.1.0.0/src/storage/arith.bend as Arith

125def le_trans(+a: Nat, +b: Nat, +c: Nat, ab: {Nat.is_le(a, b) == True{} : Bool}, bc: {Nat.is_le(b, c) == True{} : Bool}) ->
126  {Nat.is_le(a, c) == True{} : Bool}:
127  match a b c:
128    case 0n b c:
129      Arith.le_zero(c)
130    case 1n+p 0n c:
131      Empty.absurd({Nat.is_le(1n+p, c) == True{} : Bool}, Arith.clash(ab))
132    case 1n+p 1n+q 0n:
133      Empty.absurd({Nat.is_le(1n+p, 0n) == True{} : Bool}, Arith.clash(bc))
134    case 1n+p 1n+q 1n+r:
135      le_trans(p, q, r, ab, bc)

Uses (6)

Used by (2)