nat.bend checks
raw source on the hub · import 0xcea4c3f899099eb5eb7e6595eaa9971a/nat.bend as MNat
Nat.add — the first two lemmas: a + 0 == a, and (a + b) + c == a + (b + c).
Base ships a rich term library and no reasoning library; these are the two facts every proof over Nat.add ends up writing by hand. A lemma is a def whose return type is an equation; import this package and call one by name.
add_zero: a + 0 == a (Nat.add recurses on its first argument, so Nat.add(a, 0n) is stuck when a is a variable) add_assoc: (a + b) + c == a + (b + c)
1 import
import Base
Definitions
def add_zero source · line 13 · raw
@a:Nat -> {Nat.add(a, 0n) == a : Nat}
def add_assoc source · line 21 · raw
@a:Nat -> @-b:Nat -> @-c:Nat -> {Nat.add(Nat.add(a, b), c) == Nat.add(a, Nat.add(b, c)) : Nat}