def max_left

bendtorch-core@0.1.0.0 · src/tensor/slice_PROOF.bend:75

import bendtorch-core@0.1.0.0/src/tensor/slice_PROOF.bend as SlicePROOF
import Base
import bendtorch-core@0.1.0.0/src/storage/arith.bend as Arith

75def max_left(+a: Nat, +b: Nat, h: {Nat.is_le(b, a) == True{} : Bool}) -> {Nat.max(a, b) == a : Nat}:
76  match a b:
77    case 0n 0n:
78      {==}
79    case 0n 1n+q:
80      Empty.absurd({Nat.max(0n, 1n+q) == 0n : Nat}, Arith.clash(h))
81    case 1n+p 0n:
82      {==}
83    case 1n+p 1n+q:
84      Equal.cong(Nat, Nat, x => 1n+x, Nat.max(p, q), p, max_left(p, q, h))

Uses (7)

Used by (1)