x y := match x, y with | p~1, q~1 => (pos_add_carry p q)~0 | p~1, q~0 => ( p q)~1 | p~1, 1 => (pos_succ p)~0 | p~0, q~1 => ( p q)~1 | p~0, q~0 => ( p q)~0 | p~0, 1 => p~1 | 1, q~1 => (pos_succ q)~0 | 1, q~0 => q~1 | 1, 1 => 1~0 end with pos_add_carry x y := match x, y with | p~1, q~1 => (pos_add_carry p q)~1 | p~1, q~0 => (pos_add_carry p q)~0 | p~1, 1 => (pos_succ p)~1 | p~0, q~1 => (pos_add_carry p q)~0 | p~0, q~0 => ( p q)~1 | p~0, 1 => (pos_succ p)~0 | 1, q~1 => (pos_succ q)~1 | 1, q~0 => (pos_succ q)~0 | 1, 1 => 1~1 end.
Require Import Basics.Overture Basics.Tactics Basics.Decidable