Definition eqdec X := forall x y : X, { x = y } + { x <> y }.Definition swap {X Y} (c : X * Y) := let (x,y) := c in (y,x).

Theorem measure_rect X (m : X -> nat) (P : X -> Type) : (forall x, (forall y, m y < m x -> P y) -> P x) -> forall x, P x.