Require Export bbv.Nomega.
Set Implicit Arguments.
Fixpoint mod2 (n : nat) : bool :=
match n with
| 0 => false
| 1 => true
| S (S n') => mod2 n'
end.
Ltac rethink :=
match goal with
| [ H : ?f ?n = _ |- ?f ?m = _ ] => replace m with n; simpl; auto
end.
induction n; simpl; intuition; rethink.
Qed.
induction n; simpl; intuition; rewrite <- plus_n_Sm; rethink.
Qed.
induction n; simpl; intuition; rewrite <- plus_n_Sm; f_equal; rethink.
Qed.
induction n; simpl; intuition; f_equal; rethink.
Qed.
Notation pow2 := (Nat.pow 2).
Fixpoint Npow2 (n : nat) : N :=
match n with
| O => 1
| S n' => 2 * Npow2 n'
end%N.

Theorem untimes2 : forall n, n + (n + 0) = 2 * n.