1
Require Import Coq.Program.Program.
2
Require Import Coq.Arith.Compare_dec.
3
Notation "( x & y )" := (existS _ x y) : core_scope.
7
Program Fixpoint euclid (a : nat) (b : { b : nat | b <> O }) {wf lt a} :
8
{ q : nat & { r : nat | a = b * q + r /\ r < b } } :=
9
if le_lt_dec b a then let (q', r) := euclid (a - b) b in
14
assert(b * S q' = b * q' + b) by auto with arith ; omega.
17
Program Definition test_euclid : (prod nat nat) := let (q, r) := euclid 4 2 in (q, q).
19
Eval lazy beta zeta delta iota in test_euclid.
21
Program Definition testsig (a : nat) : { x : nat & { y : nat | x < y } } :=