1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| A.Asperti, C.Sacerdoti Coen, *)
8 (* ||A|| E.Tassi, S.Zacchiroli *)
10 (* \ / Matita is distributed under the terms of the *)
11 (* v GNU Lesser General Public License Version 2.1 *)
13 (**************************************************************************)
17 include "nat/times.ma".
18 include "nat/minus.ma".
22 \forall P:nat \to Prop.
23 \forall H:P (S (S O)).
24 \forall H:P (S (S (S O))).
25 \forall H1: \forall x.P x \to O = x.
26 O = S (S (S (S (S O)))).
32 \forall x: nat. (x+S O)*(x-S O) = x*x - S O.
35 [ autobatch timeout = 1.|intro.autobatch timeout = 1.]
38 theorem irratsqrt2_byhand:
40 \forall m:A \to A \to A.
41 \forall divides: A \to A \to Prop.
43 \forall H1:\forall x.m o x = x.
44 \forall H1:\forall x.m x o = x.
45 \forall H1:\forall x,y,z.m x (m y z) = m (m x y) z.
46 \forall H1:\forall x.m x o = x.
47 \forall H2:\forall x,y.m x y = m y x.
48 \forall H3:\forall x,y,z. m x y = m x z \to y = z.
49 (* \forall H4:\forall x,y.(\exists z.m x z = y) \to divides x y. *)
50 \forall H4:\forall x,y.(divides x y \to (\exists z.m x z = y)).
51 \forall H4:\forall x,y,z.m x z = y \to divides x y.
52 \forall H4:\forall x,y.divides two (m x y) \to divides two x ∨ divides two y.
53 \forall H5:m a a = m two (m b b).
54 \forall H6:\forall x.divides x a \to divides x b \to x = o.
58 [2:elim (H8 a a);[assumption.|assumption|rewrite > H9.autobatch.]
61 [ apply (H10 ? Hcut Hcut1).
62 | elim (H8 b b);[assumption.|assumption|
63 apply (H7 ? ? (m a1 a1));
64 apply (H5 two ? ?);rewrite < H9.
65 rewrite < H11.rewrite < H2.
66 apply eq_f.rewrite > H2.rewrite > H4.reflexivity.
72 theorem irratsqrt2_byhand':
74 \forall m,f:A \to A \to A.
75 \forall divides: A \to A \to Prop.
77 \forall H1:\forall x.m o x = x.
78 \forall H1:\forall x.m x o = x.
79 \forall H1:\forall x,y,z.m x (m y z) = m (m x y) z.
80 \forall H1:\forall x.m x o = x.
81 \forall H2:\forall x,y.m x y = m y x.
82 \forall H3:\forall x,y,z. m x y = m x z \to y = z.
83 (* \forall H4:\forall x,y.(\exists z.m x z = y) \to divides x y. *)
84 \forall H4:\forall x,y.(divides x y \to m x (f x y) = y).
85 \forall H4:\forall x,y,z.m x z = y \to divides x y.
86 \forall H4:\forall x,y.divides two (m x y) \to divides two x ∨ divides two y.
87 \forall H5:m a a = m two (m b b).
88 \forall H6:\forall x.divides x a \to divides x b \to x = o.
92 [2:elim (H8 a a);[assumption.|assumption|rewrite > H9.autobatch.]
93 |(*elim (H6 ? ? Hcut). *)
95 [ apply (H10 ? Hcut Hcut1).
96 | elim (H8 b b);[assumption.|assumption|
98 apply (H7 ? ? (m (f two a) (f two a)));
101 rewrite < (H6 two a Hcut) in \vdash (? ? ? %).
102 rewrite < H2.apply eq_f.
103 rewrite < H4 in \vdash (? ? ? %).
104 rewrite > H2.reflexivity.
112 \forall m,f:A \to A \to A.
113 \forall divides: A \to A \to Prop.
115 \forall H1:\forall x.m o x = x.
116 \forall H1:\forall x.m x o = x.
117 \forall H1:\forall x,y,z.m x (m y z) = m (m x y) z.
118 \forall H1:\forall x.m x o = x.
119 \forall H2:\forall x,y.m x y = m y x.
120 \forall H3:\forall x,y,z. m x y = m x z \to y = z.
121 (* \forall H4:\forall x,y.(\exists z.m x z = y) \to divides x y. *)
122 \forall H4:\forall x,y.(divides x y \to m x (f x y) = y).
123 \forall H4:\forall x,y,z.m x z = y \to divides x y.
124 \forall H4:\forall x.divides two (m x x) \to divides two x.
125 \forall H5:m a a = m two (m b b).
126 \forall H6:\forall x.divides x a \to divides x b \to x = o.
129 autobatch depth = 5 timeout = 180.
135 (* intermediate attempts
137 cut (divides two a);[|
138 (* apply H8;apply (H7 two (m a a) (m b b));symmetry;assumption. *)
139 autobatch depth = 4 width = 3 use_paramod = false. ]
140 (*autobatch depth = 5.*)
144 |(*autobatch depth = 4.*) apply H8;
146 apply (H7 ? ? (m (f two a) (f two a)));
148 cut ((\lambda x:A.m x (m two ?)=m x (m b b))?);
150 autobatch paramodulation.
153 rewrite < (H6 two a Hcut) in \vdash (? ? ? %).
154 rewrite < H2.apply eq_f.
155 rewrite < H4 in \vdash (? ? ? %).
156 rewrite > H2.reflexivity.