def max_right

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

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

66def max_right(+a: Nat, +b: Nat, h: {Nat.is_le(a, b) == True{} : Bool}) -> {Nat.max(a, b) == b : Nat}:
67  match a b:
68    case 0n _:
69      {==}
70    case 1n+p 0n:
71      Empty.absurd({Nat.max(1n+p, 0n) == 0n : Nat}, Arith.clash(h))
72    case 1n+p 1n+q:
73      Equal.cong(Nat, Nat, x => 1n+x, Nat.max(p, q), q, max_right(p, q, h))

Uses (7)

Used by (2)