Last active
August 28, 2020 16:04
-
-
Save nkaretnikov/0627697c7e2e6ad401c6 to your computer and use it in GitHub Desktop.
plus_lt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Theorem Sx_le_Sx_y : forall x y, S x <= S (x + y). | |
Proof. | |
induction y as [|y']. | |
Case "y' = 0". | |
rewrite <- plus_n_O. | |
apply le_n. | |
Case "y' = S y". | |
apply le_S. | |
rewrite <- plus_n_Sm. | |
apply IHy'. | |
Qed. | |
Theorem plus_lt : forall n1 n2 m, | |
n1 + n2 < m -> | |
n1 < m /\ n2 < m. | |
Proof. | |
intros. | |
unfold "<" in H. | |
unfold "<". | |
induction H. | |
Case "S (n1 + n2) = m". | |
split. | |
SCase "S n1 <= S (n1 + n2)". | |
apply Sx_le_Sx_y. | |
SCase "S n2 <= S (n1 + n2)". | |
rewrite plus_comm. | |
apply Sx_le_Sx_y. | |
Case "S (n1 + n2) < m". | |
split. | |
SCase "S n1 <= S m". | |
apply le_S. | |
(* inversion IHle as [F G]. *) | |
apply IHle. | |
SCase "S n2 <= S m". | |
apply le_S. | |
apply IHle. | |
Qed. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
/\
means that both hypotheses hold. A more explicit way is to useinversion IHle as [F G]
first to split them apart.