src/Util/ZUtil/Lnot.v
raw| 1 | From Coq Require Import ZArith. |
| 2 | From Coq Require Import Lia. |
| 3 | Local Open Scope Z_scope. |
| 4 | |
| 5 | Module Z. |
| 6 | Lemma lnot_equiv n : Z.lnot n = Z.pred (-n). |
| 7 | Proof. reflexivity. Qed. |
| 8 | |
| 9 | Lemma lnot_sub1 n : Z.lnot (n-1) = -n. |
| 10 | Proof. rewrite lnot_equiv; lia. Qed. |
| 11 | |
| 12 | Lemma lnot_opp x : Z.lnot (- x) = x-1. |
| 13 | Proof. |
| 14 | rewrite <-Z.lnot_involutive, lnot_sub1; reflexivity. |
| 15 | Qed. |
| 16 | End Z. |