1 set "baseuri" "cic:/matita/tests/fguidi/".
3 alias id "O" = "cic:/Coq/Init/Datatypes/nat.ind#xpointer(1/1/1)".
4 alias id "nat" = "cic:/Coq/Init/Datatypes/nat.ind#xpointer(1/1)".
5 alias id "S" = "cic:/Coq/Init/Datatypes/nat.ind#xpointer(1/1/2)".
6 alias id "le" = "cic:/matita/fguidi/le.ind#xpointer(1/1)".
7 alias id "False_ind" = "cic:/Coq/Init/Logic/False_ind.con".
8 alias id "I" = "cic:/Coq/Init/Logic/True.ind#xpointer(1/1/1)".
9 alias id "ex_intro" = "cic:/Coq/Init/Logic/ex.ind#xpointer(1/1/1)".
10 alias id "False" = "cic:/Coq/Init/Logic/False.ind#xpointer(1/1)".
11 alias id "True" = "cic:/Coq/Init/Logic/True.ind#xpointer(1/1)".
13 alias symbol "and" (instance 0) = "logical and".
14 alias symbol "eq" (instance 0) = "leibnitz's equality".
15 alias symbol "exists" (instance 0) = "exists".
17 definition is_S: nat \to Prop \def
18 \lambda n. match n with
20 | (S n) \Rightarrow True
23 definition pred: nat \to nat \def
24 \lambda n. match n with
29 theorem eq_gen_S_O: \forall x. (S x = O) \to \forall P:Prop. P.
30 intros. apply False_ind. cut (is_S O). auto. elim H. exact I.
33 theorem eq_gen_S_O_cc: (\forall P:Prop. P) \to \forall x. (S x = O).
37 theorem eq_gen_S_S: \forall m,n. (S m) = (S n) \to m = n.
38 intros. cut (pred (S m)) = (pred (S n)).
39 assumption. elim H. auto.
42 theorem eq_gen_S_S_cc: \forall m,n. m = n \to (S m) = (S n).
46 inductive le: nat \to nat \to Prop \def
47 le_zero: \forall n. (le O n)
48 | le_succ: \forall m, n. (le m n) \to (le (S m) (S n)).
50 theorem le_refl: \forall x. (le x x).
51 intros. elim x. auto. auto.
54 theorem le_gen_x_O_aux: \forall x, y. (le x y) \to (y =O) \to
56 intros 3. elim H. auto. apply eq_gen_S_O. exact n1. auto.
59 theorem le_gen_x_O: \forall x. (le x O) \to (x = O).
60 intros. apply le_gen_x_O_aux. exact O. auto. auto.
63 theorem le_gen_x_O_cc: \forall x. (x = O) \to (le x O).
67 theorem le_gen_S_x_aux: \forall m,x,y. (le y x) \to (y = S m) \to
68 (\exists n. x = (S n) \land (le m n)).
70 apply eq_gen_S_O. exact m. elim H1. auto.
71 cut n = m. elim Hcut. apply ex_intro. exact n1. auto. auto.
74 theorem le_gen_S_x: \forall m,x. (le (S m) x) \to
75 (\exists n. x = (S n) \land (le m n)).
76 intros. apply le_gen_S_x_aux. exact (S m). auto. auto.
79 theorem le_gen_S_x_cc: \forall m,x. (\exists n. x = (S n) \land (le m n)) \to
81 intros. elim H. elim H1. cut (S x1) = x. elim Hcut. auto. elim H2. auto.
84 theorem le_gen_S_S: \forall m,n. (le (S m) (S n)) \to (le m n).
86 lapply le_gen_S_x to H using H0. elim H0. elim H1.
87 lapply eq_gen_S_S to H2 using H4. rewrite > H4. assumption.
90 theorem le_gen_S_S_cc: \forall m,n. (le m n) \to (le (S m) (S n)).
95 theorem le_trans: \forall x,y. (le x y) \to \forall z. (le y z) \to (le x z).
96 intros 1. elim x; clear H. clear x.
98 fwd H1 [H]. decompose H.