Newer
Older
require open
personoj.encodings.cert_f
personoj.adlib.bootstrap
personoj.prelude.logic
require personoj.sandbox.nat as N
constant symbol Rat : Term uType
constant symbol zero : Term Rat
rule times (rat $a $b) (rat $c $d) ↪
let bv ≔ fst $b in
let dv ≔ fst $d in
symbol rateq : Term Rat → Term Rat → Term bool
rule rateq ($a / $b) ($c / $d) ↪
definition onz : Term N.Nznat ≔ N.nznat 1 N.one_not_zero
// NOTE: we use this rewriting rule because in the proof below, calling simpl
// causes protected [opair] to appear, and we cannot use refl since it requires
// the user to input the protected opair, which is forbidden.
// Perhaps using [hints] could help, using [refl Nat _] and the unification
// engine would instantiate _ accordingly, but it is not likely since it is
// based on non linearity, and hints are linear.
// We rather reduce the proof to the trivial proof
theorem right_cancellation (a: Term N.Nat) (b: Term N.Nznat):
Term (rateq (times (a / b) ((fst b) / onz)) (a / onz))
proof
assume a b
simpl
refine N.prod_comm a (fst b)
qed