def le_trans

bendtorch-core@0.1.0.0 · src/tensor/contracts/matmul_parallel_proof.bend:198

import bendtorch-core@0.1.0.0/src/tensor/contracts/matmul_parallel_proof.bend as MatmulParallelProof
import Base
import bendtorch-core@0.1.0.0/src/storage/arith.bend as Arith

198def le_trans(+a: Nat, +b: Nat, +c: Nat, ab: {Nat.is_le(a, b) == True{} : Bool}, bc: {Nat.is_le(b, c) == True{} : Bool}) ->
199  {Nat.is_le(a, c) == True{} : Bool}:
200  match a b c:
201    case 0n _ _:
202      Arith.le_zero(c)
203    case 1n+p 0n _:
204      Empty.absurd({Nat.is_le(1n+p, c) == True{} : Bool}, Arith.clash(ab))
205    case 1n+p 1n+q 0n:
206      Empty.absurd({Nat.is_le(1n+p, 0n) == True{} : Bool}, Arith.clash(bc))
207    case 1n+p 1n+q 1n+r:
208      le_trans(p, q, r, ab, bc)

Uses (6)

Used by (2)