]> matita.cs.unibo.it Git - helm.git/commitdiff
some properties of NLE
authorFerruccio Guidi <ferruccio.guidi@unibo.it>
Thu, 24 Aug 2006 18:50:34 +0000 (18:50 +0000)
committerFerruccio Guidi <ferruccio.guidi@unibo.it>
Thu, 24 Aug 2006 18:50:34 +0000 (18:50 +0000)
helm/software/matita/contribs/RELATIONAL/NLE/dec.ma [new file with mode: 0644]
helm/software/matita/contribs/RELATIONAL/NLE/fwd.ma [new file with mode: 0644]
helm/software/matita/contribs/RELATIONAL/NLE/props.ma [new file with mode: 0644]

diff --git a/helm/software/matita/contribs/RELATIONAL/NLE/dec.ma b/helm/software/matita/contribs/RELATIONAL/NLE/dec.ma
new file mode 100644 (file)
index 0000000..6bdb819
--- /dev/null
@@ -0,0 +1,31 @@
+(**************************************************************************)
+(*       ___                                                              *)
+(*      ||M||                                                             *)
+(*      ||A||       A project by Andrea Asperti                           *)
+(*      ||T||                                                             *)
+(*      ||I||       Developers:                                           *)
+(*      ||T||         The HELM team.                                      *)
+(*      ||A||         http://helm.cs.unibo.it                             *)
+(*      \   /                                                             *)
+(*       \ /        This file is distributed under the terms of the       *)
+(*        v         GNU General Public License Version 2                  *)
+(*                                                                        *)
+(**************************************************************************)
+
+set "baseuri" "cic:/matita/RELATIONAL/NLE/dec".
+
+include "NLE/props.ma".
+
+theorem nat_dec_lt_ge: \forall x,y. x < y \lor y <= x.
+ intros 2; elim y; clear y;
+ [ auto
+ | decompose;
+   [ lapply linear nle_gen_succ_1 to H1. decompose.
+     rewrite > H1. clear H1 n. auto
+   | lapply linear nle_lt_or_eq to H1; decompose;
+     [ auto
+     | rewrite > H. clear H n. auto
+     ]
+   ]
+ ].
+qed.
diff --git a/helm/software/matita/contribs/RELATIONAL/NLE/fwd.ma b/helm/software/matita/contribs/RELATIONAL/NLE/fwd.ma
new file mode 100644 (file)
index 0000000..dd0a7ce
--- /dev/null
@@ -0,0 +1,62 @@
+(**************************************************************************)
+(*       ___                                                              *)
+(*      ||M||                                                             *)
+(*      ||A||       A project by Andrea Asperti                           *)
+(*      ||T||                                                             *)
+(*      ||I||       Developers:                                           *)
+(*      ||T||         The HELM team.                                      *)
+(*      ||A||         http://helm.cs.unibo.it                             *)
+(*      \   /                                                             *)
+(*       \ /        This file is distributed under the terms of the       *)
+(*        v         GNU General Public License Version 2                  *)
+(*                                                                        *)
+(**************************************************************************)
+
+set "baseuri" "cic:/matita/RELATIONAL/NLE/fwd".
+
+include "logic/connectives.ma".
+
+include "Nat/fwd.ma". 
+include "NLE/defs.ma".
+
+theorem nle_gen_succ_1: \forall x,y. x < y \to 
+                         \exists z. y = succ z \land x <= z.
+ intros. inversion H; clear H; intros;
+ [ apply (eq_gen_succ_zero ? ? H)
+ | lapply linear eq_gen_succ_succ to H2 as H0.
+   rewrite > H0. clear H0.
+   apply ex_intro; [|auto] (**)
+ ].
+qed.
+
+theorem nle_gen_succ_succ: \forall x,y. x < succ y \to x <= y.
+ intros; inversion H; clear H; intros;
+ [ apply (eq_gen_succ_zero ? ? H)
+ | lapply linear eq_gen_succ_succ to H2 as H0.
+   lapply linear eq_gen_succ_succ to H3 as H2.
+   rewrite > H0. rewrite > H2. clear H0 H2.
+   auto
+ ].
+qed.
+
+theorem nle_gen_succ_zero: \forall (P:Prop). \forall x. x < zero \to P.
+ intros.
+ lapply linear nle_gen_succ_1 to H. decompose.
+ apply (eq_gen_zero_succ ? ? H1).
+qed.
+
+theorem nle_gen_zero_2: \forall x. x <= zero \to x = zero.
+ intros 1. elim x; clear x; intros;
+ [ auto
+ | apply (nle_gen_succ_zero ? ? H1)
+ ].
+qed.
+
+theorem nle_gen_succ_2: \forall y,x. x <= succ y \to
+                         x = zero \lor \exists z. x = succ z \land z <= y.
+ intros 2; elim x; clear x; intros;
+ [ auto
+ | lapply linear nle_gen_succ_succ to H1.
+   right. apply ex_intro; [|auto] (**)
+ ].
+qed.
diff --git a/helm/software/matita/contribs/RELATIONAL/NLE/props.ma b/helm/software/matita/contribs/RELATIONAL/NLE/props.ma
new file mode 100644 (file)
index 0000000..e961f5a
--- /dev/null
@@ -0,0 +1,38 @@
+(**************************************************************************)
+(*       ___                                                              *)
+(*      ||M||                                                             *)
+(*      ||A||       A project by Andrea Asperti                           *)
+(*      ||T||                                                             *)
+(*      ||I||       Developers:                                           *)
+(*      ||T||         The HELM team.                                      *)
+(*      ||A||         http://helm.cs.unibo.it                             *)
+(*      \   /                                                             *)
+(*       \ /        This file is distributed under the terms of the       *)
+(*        v         GNU General Public License Version 2                  *)
+(*                                                                        *)
+(**************************************************************************)
+
+set "baseuri" "cic:/matita/RELATIONAL/NLE/props".
+
+include "NLE/fwd.ma".
+
+theorem nle_refl: \forall x. x <= x.
+ intros 1; elim x; clear x; intros; auto.
+qed.
+
+theorem nle_trans_succ: \forall x,y. x <= y \to x <= succ y.
+ intros. elim H; clear H x y; intros; auto.
+qed.
+
+theorem nle_lt_or_eq: \forall y,x. x <= y \to x < y \lor x = y.
+ intros 1. elim y; clear y; intros;
+ [ lapply linear nle_gen_zero_2 to H. auto
+ | lapply linear nle_gen_succ_2 to H1. decompose;
+   [ rewrite > H1. clear H1. auto
+   | lapply linear H to H3 as H0. decompose;
+     [ rewrite > H1. clear H1 x. auto
+     | rewrite < H. clear H n. auto
+     ]
+   ]
+ ].
+qed.