Skip to content

Commit 1f16fe5

Browse files
committed
adds Nat.add_simpl_l and Nat.add_add_simpl_l_l which mirror theorem by the
same name on Z
1 parent cbba1ca commit 1f16fe5

File tree

1 file changed

+15
-0
lines changed
  • theories/Numbers/Natural/Abstract

1 file changed

+15
-0
lines changed

theories/Numbers/Natural/Abstract/NSub.v

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,21 @@ intros n m. rewrite <- add_sub_assoc by (apply le_refl).
6666
rewrite sub_diag; now rewrite add_0_r.
6767
Qed.
6868

69+
Definition add_simpl_r := add_sub.
70+
71+
Theorem add_simpl_l : forall n m, (n + m) - n == m.
72+
Proof.
73+
intros n m. rewrite add_comm. apply add_sub.
74+
Qed.
75+
76+
Theorem add_add_simpl_l_l n m p : (n + m) - (n + p) == m - p.
77+
Proof.
78+
induct n.
79+
now rewrite 2!add_0_l.
80+
intros n Ih.
81+
rewrite 2!add_succ_l. now rewrite sub_succ.
82+
Qed.
83+
6984
Theorem sub_add : forall n m, n <= m -> (m - n) + n == m.
7085
Proof.
7186
intros n m H. rewrite add_comm. rewrite add_sub_assoc by assumption.

0 commit comments

Comments
 (0)