def below_true

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

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

166# 1 + b <= k gives b < k.
167def below_true(+b: Nat, +k: Nat, h: {Nat.is_le(1n+b, k) == True{} : Bool}) -> {Nat.is_lt(b, k) == True{} : Bool}:
168  match b k:
169    case 0n 0n:
170      Empty.absurd({Nat.is_lt(0n, 0n) == True{} : Bool}, Arith.clash(h))
171    case 0n 1n+q:
172      {==}
173    case 1n+p 0n:
174      Empty.absurd({Nat.is_lt(1n+p, 0n) == True{} : Bool}, Arith.clash(h))
175    case 1n+p 1n+q:
176      below_true(p, q, h)

Uses (6)

Used by (1)