2 ||M|| This file is part of HELM, an Hypertextual, Electronic
3 ||A|| Library of Mathematics, developed at the Computer Science
4 ||T|| Department of the University of Bologna, Italy.
7 ||A|| This file is distributed under the terms of the
8 \ / GNU General Public License Version 2
10 V_______________________________________________________________ *)
12 include "basics/relations.ma".
14 \ 5img class="anchor" src="icons/tick.png" id="nat"
\ 6inductive nat : Type[0] ≝
18 interpretation "Natural numbers" 'N = nat.
20 alias num (instance 0) = "natural number".
22 \ 5img class="anchor" src="icons/tick.png" id="pred"
\ 6definition pred ≝
23 λn. match n with [ O ⇒
\ 5a href="cic:/matita/arithmetics/nat/nat.con(0,1,0)"
\ 6O
\ 5/a
\ 6 | S p ⇒ p].
25 \ 5img class="anchor" src="icons/tick.png" id="pred_Sn"
\ 6theorem pred_Sn : ∀n.n
\ 5a title="leibnitz's equality" href="cic:/fakeuri.def(1)"
\ 6=
\ 5/a
\ 6 \ 5a href="cic:/matita/arithmetics/nat/pred.def(1)"
\ 6pred
\ 5/a
\ 6 (
\ 5a href="cic:/matita/arithmetics/nat/nat.con(0,2,0)"
\ 6S
\ 5/a
\ 6 n).
28 \ 5img class="anchor" src="icons/tick.png" id="injective_S"
\ 6theorem injective_S :
\ 5a href="cic:/matita/basics/relations/injective.def(1)"
\ 6injective
\ 5/a
\ 6 \ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6 \ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6 \ 5a href="cic:/matita/arithmetics/nat/nat.con(0,2,0)"
\ 6S
\ 5/a
\ 6.
32 theorem inj_S : \forall n,m:nat.(S n)=(S m) \to n=m.
35 \ 5img class="anchor" src="icons/tick.png" id="not_eq_S"
\ 6theorem not_eq_S: ∀n,m:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6. n
\ 5a title="leibnitz's non-equality" href="cic:/fakeuri.def(1)"
\ 6≠
\ 5/a
\ 6 m →
\ 5a href="cic:/matita/arithmetics/nat/nat.con(0,2,0)"
\ 6S
\ 5/a
\ 6 n
\ 5a title="leibnitz's non-equality" href="cic:/fakeuri.def(1)"
\ 6≠
\ 5/a
\ 6 \ 5a href="cic:/matita/arithmetics/nat/nat.con(0,2,0)"
\ 6S
\ 5/a
\ 6 m.
36 /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/basics/logic/not_to_not.def(3)"
\ 6not_to_not
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/ qed.
38 \ 5img class="anchor" src="icons/tick.png" id="not_zero"
\ 6definition not_zero:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6 → Prop ≝
39 λn:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6. match n with [ O ⇒
\ 5a href="cic:/matita/basics/logic/False.ind(1,0,0)"
\ 6False
\ 5/a
\ 6 | (S p) ⇒
\ 5a href="cic:/matita/basics/logic/True.ind(1,0,0)"
\ 6True
\ 5/a
\ 6 ].
41 \ 5img class="anchor" src="icons/tick.png" id="not_eq_O_S"
\ 6theorem not_eq_O_S : ∀n:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6.
\ 5a href="cic:/matita/arithmetics/nat/nat.con(0,1,0)"
\ 6O
\ 5/a
\ 6 \ 5a title="leibnitz's non-equality" href="cic:/fakeuri.def(1)"
\ 6≠
\ 5/a
\ 6 \ 5a href="cic:/matita/arithmetics/nat/nat.con(0,2,0)"
\ 6S
\ 5/a
\ 6 n.
42 #n @
\ 5a href="cic:/matita/basics/logic/Not.con(0,1,1)"
\ 6nmk
\ 5/a
\ 6 #eqOS (change with (
\ 5a href="cic:/matita/arithmetics/nat/not_zero.def(1)"
\ 6not_zero
\ 5/a
\ 6 \ 5a href="cic:/matita/arithmetics/nat/nat.con(0,1,0)"
\ 6O
\ 5/a
\ 6)) >eqOS // qed.
44 \ 5img class="anchor" src="icons/tick.png" id="not_eq_n_Sn"
\ 6theorem not_eq_n_Sn: ∀n:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6. n
\ 5a title="leibnitz's non-equality" href="cic:/fakeuri.def(1)"
\ 6≠
\ 5/a
\ 6 \ 5a href="cic:/matita/arithmetics/nat/nat.con(0,2,0)"
\ 6S
\ 5/a
\ 6 n.
45 #n (elim n) /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/not_eq_S.def(4)"
\ 6not_eq_S
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/ qed.
47 \ 5img class="anchor" src="icons/tick.png" id="nat_case"
\ 6theorem nat_case:
48 ∀n:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6.∀P:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6 → Prop.
49 (n
\ 5a title="leibnitz's equality" href="cic:/fakeuri.def(1)"
\ 6=
\ 5/a
\ 6\ 5a href="cic:/matita/arithmetics/nat/nat.con(0,1,0)"
\ 6O
\ 5/a
\ 6 → P
\ 5a href="cic:/matita/arithmetics/nat/nat.con(0,1,0)"
\ 6O
\ 5/a
\ 6) → (∀m:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6. n
\ 5a title="leibnitz's equality" href="cic:/fakeuri.def(1)"
\ 6=
\ 5/a
\ 6 \ 5a href="cic:/matita/arithmetics/nat/nat.con(0,2,0)"
\ 6S
\ 5/a
\ 6 m → P (
\ 5a href="cic:/matita/arithmetics/nat/nat.con(0,2,0)"
\ 6S
\ 5/a
\ 6 m)) → P n.
50 #n #P (elim n) /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5/span
\ 6\ 5/span
\ 6/ qed.
52 \ 5img class="anchor" src="icons/tick.png" id="nat_elim2"
\ 6theorem nat_elim2 :
53 ∀R:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6 →
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6 → Prop.
54 (∀n:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6. R
\ 5a href="cic:/matita/arithmetics/nat/nat.con(0,1,0)"
\ 6O
\ 5/a
\ 6 n)
55 → (∀n:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6. R (
\ 5a href="cic:/matita/arithmetics/nat/nat.con(0,2,0)"
\ 6S
\ 5/a
\ 6 n)
\ 5a href="cic:/matita/arithmetics/nat/nat.con(0,1,0)"
\ 6O
\ 5/a
\ 6)
56 → (∀n,m:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6. R n m → R (
\ 5a href="cic:/matita/arithmetics/nat/nat.con(0,2,0)"
\ 6S
\ 5/a
\ 6 n) (
\ 5a href="cic:/matita/arithmetics/nat/nat.con(0,2,0)"
\ 6S
\ 5/a
\ 6 m))
57 → ∀n,m:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6. R n m.
58 #R #ROn #RSO #RSS #n (elim n) // #n0 #Rn0m #m (cases m) /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5/span
\ 6\ 5/span
\ 6/ qed.
60 \ 5img class="anchor" src="icons/tick.png" id="decidable_eq_nat"
\ 6theorem decidable_eq_nat : ∀n,m:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6.
\ 5a href="cic:/matita/basics/logic/decidable.def(1)"
\ 6decidable
\ 5/a
\ 6 (n
\ 5a title="leibnitz's equality" href="cic:/fakeuri.def(1)"
\ 6=
\ 5/a
\ 6m).
61 @
\ 5a href="cic:/matita/arithmetics/nat/nat_elim2.def(2)"
\ 6nat_elim2
\ 5/a
\ 6 #n [ (cases n) /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/basics/logic/Or.con(0,1,2)"
\ 6or_introl
\ 5/a
\ 6,
\ 5a href="cic:/matita/basics/logic/Or.con(0,2,2)"
\ 6or_intror
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/ | /
\ 5span class="autotactic"
\ 63
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/basics/logic/Or.con(0,2,2)"
\ 6or_intror
\ 5/a
\ 6,
\ 5a href="cic:/matita/basics/logic/sym_not_eq.def(4)"
\ 6sym_not_eq
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/ | #m #Hind (cases Hind) /
\ 5span class="autotactic"
\ 63
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/basics/logic/Or.con(0,1,2)"
\ 6or_introl
\ 5/a
\ 6,
\ 5a href="cic:/matita/basics/logic/Or.con(0,2,2)"
\ 6or_intror
\ 5/a
\ 6,
\ 5a href="cic:/matita/arithmetics/nat/not_eq_S.def(4)"
\ 6not_eq_S
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/]
64 (*************************** plus ******************************)
66 \ 5img class="anchor" src="icons/tick.png" id="plus"
\ 6let rec plus n m ≝
67 match n with [ O ⇒ m | S p ⇒
\ 5a href="cic:/matita/arithmetics/nat/nat.con(0,2,0)"
\ 6S
\ 5/a
\ 6 (plus p m) ].
69 interpretation "natural plus" 'plus x y = (plus x y).
71 \ 5img class="anchor" src="icons/tick.png" id="plus_O_n"
\ 6theorem plus_O_n: ∀n:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6. n
\ 5a title="leibnitz's equality" href="cic:/fakeuri.def(1)"
\ 6=
\ 5/a
\ 6 \ 5a href="cic:/matita/arithmetics/nat/nat.con(0,1,0)"
\ 6O
\ 5/a
\ 6\ 5a title="natural plus" href="cic:/fakeuri.def(1)"
\ 6+
\ 5/a
\ 6n.
75 theorem plus_Sn_m: ∀n,m:nat. S (n + m) = S n + m.
79 \ 5img class="anchor" src="icons/tick.png" id="plus_n_O"
\ 6theorem plus_n_O: ∀n:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6. n
\ 5a title="leibnitz's equality" href="cic:/fakeuri.def(1)"
\ 6=
\ 5/a
\ 6 n
\ 5a title="natural plus" href="cic:/fakeuri.def(1)"
\ 6+
\ 5/a
\ 6\ 5a title="natural number" href="cic:/fakeuri.def(1)"
\ 60
\ 5/a
\ 6.
80 #n (elim n) normalize // qed.
82 \ 5img class="anchor" src="icons/tick.png" id="plus_n_Sm"
\ 6theorem plus_n_Sm : ∀n,m:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6.
\ 5a href="cic:/matita/arithmetics/nat/nat.con(0,2,0)"
\ 6S
\ 5/a
\ 6 (n
\ 5a title="natural plus" href="cic:/fakeuri.def(1)"
\ 6+
\ 5/a
\ 6m)
\ 5a title="leibnitz's equality" href="cic:/fakeuri.def(1)"
\ 6=
\ 5/a
\ 6 n
\ 5a title="natural plus" href="cic:/fakeuri.def(1)"
\ 6+
\ 5/a
\ 6 \ 5a href="cic:/matita/arithmetics/nat/nat.con(0,2,0)"
\ 6S
\ 5/a
\ 6 m.
83 #n (elim n) normalize // qed.
86 theorem plus_Sn_m1: ∀n,m:nat. S m + n = n + S m.
87 #n (elim n) normalize // qed.
91 theorem plus_n_1 : ∀n:nat. S n = n+1.
95 \ 5img class="anchor" src="icons/tick.png" id="commutative_plus"
\ 6theorem commutative_plus:
\ 5a href="cic:/matita/basics/relations/commutative.def(1)"
\ 6commutative
\ 5/a
\ 6 ?
\ 5a href="cic:/matita/arithmetics/nat/plus.fix(0,0,1)"
\ 6plus
\ 5/a
\ 6.
96 #n (elim n) normalize // qed.
98 \ 5img class="anchor" src="icons/tick.png" id="associative_plus"
\ 6theorem associative_plus :
\ 5a href="cic:/matita/basics/relations/associative.def(1)"
\ 6associative
\ 5/a
\ 6 \ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6 \ 5a href="cic:/matita/arithmetics/nat/plus.fix(0,0,1)"
\ 6plus
\ 5/a
\ 6.
99 #n (elim n) normalize // qed.
101 \ 5img class="anchor" src="icons/tick.png" id="assoc_plus1"
\ 6theorem assoc_plus1: ∀a,b,c. c
\ 5a title="natural plus" href="cic:/fakeuri.def(1)"
\ 6+
\ 5/a
\ 6 (b
\ 5a title="natural plus" href="cic:/fakeuri.def(1)"
\ 6+
\ 5/a
\ 6 a)
\ 5a title="leibnitz's equality" href="cic:/fakeuri.def(1)"
\ 6=
\ 5/a
\ 6 b
\ 5a title="natural plus" href="cic:/fakeuri.def(1)"
\ 6+
\ 5/a
\ 6 c
\ 5a title="natural plus" href="cic:/fakeuri.def(1)"
\ 6+
\ 5/a
\ 6 a.
104 \ 5img class="anchor" src="icons/tick.png" id="injective_plus_r"
\ 6theorem injective_plus_r: ∀n:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6.
\ 5a href="cic:/matita/basics/relations/injective.def(1)"
\ 6injective
\ 5/a
\ 6 \ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6 \ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6 (λm.n
\ 5a title="natural plus" href="cic:/fakeuri.def(1)"
\ 6+
\ 5/a
\ 6m).
105 #n (elim n) normalize /
\ 5span class="autotactic"
\ 63
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/injective_S.def(4)"
\ 6injective_S
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/ qed.
107 (* theorem inj_plus_r: \forall p,n,m:nat. p+n = p+m \to n=m
108 \def injective_plus_r.
110 theorem injective_plus_l: ∀m:nat.injective nat nat (λn.n+m).
113 (* theorem inj_plus_l: \forall p,n,m:nat. n+p = m+p \to n=m
114 \def injective_plus_l. *)
116 (*************************** times *****************************)
118 \ 5img class="anchor" src="icons/tick.png" id="times"
\ 6let rec times n m ≝
119 match n with [ O ⇒
\ 5a href="cic:/matita/arithmetics/nat/nat.con(0,1,0)"
\ 6O
\ 5/a
\ 6 | S p ⇒ m
\ 5a title="natural plus" href="cic:/fakeuri.def(1)"
\ 6+
\ 5/a
\ 6(times p m) ].
121 interpretation "natural times" 'times x y = (times x y).
123 \ 5img class="anchor" src="icons/tick.png" id="times_Sn_m"
\ 6theorem times_Sn_m: ∀n,m:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6. m
\ 5a title="natural plus" href="cic:/fakeuri.def(1)"
\ 6+
\ 5/a
\ 6n
\ 5a title="natural times" href="cic:/fakeuri.def(1)"
\ 6*
\ 5/a
\ 6m
\ 5a title="leibnitz's equality" href="cic:/fakeuri.def(1)"
\ 6=
\ 5/a
\ 6 \ 5a href="cic:/matita/arithmetics/nat/nat.con(0,2,0)"
\ 6S
\ 5/a
\ 6 n
\ 5a title="natural times" href="cic:/fakeuri.def(1)"
\ 6*
\ 5/a
\ 6m.
126 \ 5img class="anchor" src="icons/tick.png" id="times_O_n"
\ 6theorem times_O_n: ∀n:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6.
\ 5a href="cic:/matita/arithmetics/nat/nat.con(0,1,0)"
\ 6O
\ 5/a
\ 6 \ 5a title="leibnitz's equality" href="cic:/fakeuri.def(1)"
\ 6=
\ 5/a
\ 6 \ 5a href="cic:/matita/arithmetics/nat/nat.con(0,1,0)"
\ 6O
\ 5/a
\ 6\ 5a title="natural times" href="cic:/fakeuri.def(1)"
\ 6*
\ 5/a
\ 6n.
129 \ 5img class="anchor" src="icons/tick.png" id="times_n_O"
\ 6theorem times_n_O: ∀n:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6.
\ 5a href="cic:/matita/arithmetics/nat/nat.con(0,1,0)"
\ 6O
\ 5/a
\ 6 \ 5a title="leibnitz's equality" href="cic:/fakeuri.def(1)"
\ 6=
\ 5/a
\ 6 n
\ 5a title="natural times" href="cic:/fakeuri.def(1)"
\ 6*
\ 5/a
\ 6\ 5a href="cic:/matita/arithmetics/nat/nat.con(0,1,0)"
\ 6O
\ 5/a
\ 6.
132 \ 5img class="anchor" src="icons/tick.png" id="times_n_Sm"
\ 6theorem times_n_Sm : ∀n,m:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6. n
\ 5a title="natural plus" href="cic:/fakeuri.def(1)"
\ 6+
\ 5/a
\ 6(n
\ 5a title="natural times" href="cic:/fakeuri.def(1)"
\ 6*
\ 5/a
\ 6m)
\ 5a title="leibnitz's equality" href="cic:/fakeuri.def(1)"
\ 6=
\ 5/a
\ 6 n
\ 5a title="natural times" href="cic:/fakeuri.def(1)"
\ 6*
\ 5/a
\ 6(
\ 5a href="cic:/matita/arithmetics/nat/nat.con(0,2,0)"
\ 6S
\ 5/a
\ 6 m).
133 #n (elim n) normalize // qed.
135 \ 5img class="anchor" src="icons/tick.png" id="commutative_times"
\ 6theorem commutative_times :
\ 5a href="cic:/matita/basics/relations/commutative.def(1)"
\ 6commutative
\ 5/a
\ 6 \ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6 \ 5a href="cic:/matita/arithmetics/nat/times.fix(0,0,2)"
\ 6times
\ 5/a
\ 6.
136 #n (elim n) normalize // qed.
138 (* variant sym_times : \forall n,m:nat. n*m = m*n \def
141 \ 5img class="anchor" src="icons/tick.png" id="distributive_times_plus"
\ 6theorem distributive_times_plus :
\ 5a href="cic:/matita/basics/relations/distributive.def(1)"
\ 6distributive
\ 5/a
\ 6 \ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6 \ 5a href="cic:/matita/arithmetics/nat/times.fix(0,0,2)"
\ 6times
\ 5/a
\ 6 \ 5a href="cic:/matita/arithmetics/nat/plus.fix(0,0,1)"
\ 6plus
\ 5/a
\ 6.
142 #n (elim n) normalize // qed.
144 \ 5img class="anchor" src="icons/tick.png" id="distributive_times_plus_r"
\ 6theorem distributive_times_plus_r :
145 ∀a,b,c:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6. (b
\ 5a title="natural plus" href="cic:/fakeuri.def(1)"
\ 6+
\ 5/a
\ 6c)
\ 5a title="natural times" href="cic:/fakeuri.def(1)"
\ 6*
\ 5/a
\ 6a
\ 5a title="leibnitz's equality" href="cic:/fakeuri.def(1)"
\ 6=
\ 5/a
\ 6 b
\ 5a title="natural times" href="cic:/fakeuri.def(1)"
\ 6*
\ 5/a
\ 6a
\ 5a title="natural plus" href="cic:/fakeuri.def(1)"
\ 6+
\ 5/a
\ 6 c
\ 5a title="natural times" href="cic:/fakeuri.def(1)"
\ 6*
\ 5/a
\ 6a.
148 \ 5img class="anchor" src="icons/tick.png" id="associative_times"
\ 6theorem associative_times:
\ 5a href="cic:/matita/basics/relations/associative.def(1)"
\ 6associative
\ 5/a
\ 6 \ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6 \ 5a href="cic:/matita/arithmetics/nat/times.fix(0,0,2)"
\ 6times
\ 5/a
\ 6.
149 #n (elim n) normalize // qed.
151 \ 5img class="anchor" src="icons/tick.png" id="times_times"
\ 6lemma times_times: ∀x,y,z. x
\ 5a title="natural times" href="cic:/fakeuri.def(1)"
\ 6*
\ 5/a
\ 6(y
\ 5a title="natural times" href="cic:/fakeuri.def(1)"
\ 6*
\ 5/a
\ 6z)
\ 5a title="leibnitz's equality" href="cic:/fakeuri.def(1)"
\ 6=
\ 5/a
\ 6 y
\ 5a title="natural times" href="cic:/fakeuri.def(1)"
\ 6*
\ 5/a
\ 6(x
\ 5a title="natural times" href="cic:/fakeuri.def(1)"
\ 6*
\ 5/a
\ 6z).
154 \ 5img class="anchor" src="icons/tick.png" id="times_n_1"
\ 6theorem times_n_1 : ∀n:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6. n
\ 5a title="leibnitz's equality" href="cic:/fakeuri.def(1)"
\ 6=
\ 5/a
\ 6 n
\ 5a title="natural times" href="cic:/fakeuri.def(1)"
\ 6*
\ 5/a
\ 6 \ 5a title="natural number" href="cic:/fakeuri.def(1)"
\ 61
\ 5/a
\ 6.
157 (* ci servono questi risultati?
158 theorem times_O_to_O: ∀n,m:nat.n*m=O → n=O ∨ m=O.
160 #n #m #H normalize #H1 napply False_ind napply not_eq_O_S
163 theorem times_n_SO : ∀n:nat. n = n * S O.
166 theorem times_SSO_n : ∀n:nat. n + n = (S(S O)) * n.
169 nlemma times_SSO: \forall n.(S(S O))*(S n) = S(S((S(S O))*n)).
172 theorem or_eq_eq_S: \forall n.\exists m.
173 n = (S(S O))*m \lor n = S ((S(S O))*m).
176 ##|#a #H nelim H #b#ornelim or#aeq
183 (******************** ordering relations ************************)
185 \ 5img class="anchor" src="icons/tick.png" id="le"
\ 6inductive le (n:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6) :
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6 → Prop ≝
187 | le_S : ∀ m:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6. le n m → le n (
\ 5a href="cic:/matita/arithmetics/nat/nat.con(0,2,0)"
\ 6S
\ 5/a
\ 6 m).
189 interpretation "natural 'less or equal to'" 'leq x y = (le x y).
191 interpretation "natural 'neither less nor equal to'" 'nleq x y = (Not (le x y)).
193 \ 5img class="anchor" src="icons/tick.png" id="lt"
\ 6definition lt:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6 →
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6 → Prop ≝ λn,m.
\ 5a href="cic:/matita/arithmetics/nat/nat.con(0,2,0)"
\ 6S
\ 5/a
\ 6 n
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 m.
195 interpretation "natural 'less than'" 'lt x y = (lt x y).
196 interpretation "natural 'not less than'" 'nless x y = (Not (lt x y)).
198 (* lemma eq_lt: ∀n,m. (n < m) = (S n ≤ m).
201 \ 5img class="anchor" src="icons/tick.png" id="ge"
\ 6definition ge:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6 →
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6 → Prop ≝ λn,m.m
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 n.
203 interpretation "natural 'greater or equal to'" 'geq x y = (ge x y).
205 \ 5img class="anchor" src="icons/tick.png" id="gt"
\ 6definition gt:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6 →
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6 → Prop ≝ λn,m.m
\ 5a title="natural 'less than'" href="cic:/fakeuri.def(1)"
\ 6<
\ 5/a
\ 6n.
207 interpretation "natural 'greater than'" 'gt x y = (gt x y).
208 interpretation "natural 'not greater than'" 'ngtr x y = (Not (gt x y)).
210 \ 5img class="anchor" src="icons/tick.png" id="transitive_le"
\ 6theorem transitive_le :
\ 5a href="cic:/matita/basics/relations/transitive.def(2)"
\ 6transitive
\ 5/a
\ 6 \ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6 \ 5a href="cic:/matita/arithmetics/nat/le.ind(1,0,1)"
\ 6le
\ 5/a
\ 6.
211 #a #b #c #leab #lebc (elim lebc) /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/le.con(0,2,1)"
\ 6le_S
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/
215 theorem trans_le: \forall n,m,p:nat. n \leq m \to m \leq p \to n \leq p
216 \def transitive_le. *)
218 \ 5img class="anchor" src="icons/tick.png" id="transitive_lt"
\ 6theorem transitive_lt:
\ 5a href="cic:/matita/basics/relations/transitive.def(2)"
\ 6transitive
\ 5/a
\ 6 \ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6 \ 5a href="cic:/matita/arithmetics/nat/lt.def(1)"
\ 6lt
\ 5/a
\ 6.
219 #a #b #c #ltab #ltbc (elim ltbc) /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/le.con(0,2,1)"
\ 6le_S
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/qed.
222 theorem trans_lt: \forall n,m,p:nat. lt n m \to lt m p \to lt n p
223 \def transitive_lt. *)
225 \ 5img class="anchor" src="icons/tick.png" id="le_S_S"
\ 6theorem le_S_S: ∀n,m:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6. n
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 m →
\ 5a href="cic:/matita/arithmetics/nat/nat.con(0,2,0)"
\ 6S
\ 5/a
\ 6 n
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 \ 5a href="cic:/matita/arithmetics/nat/nat.con(0,2,0)"
\ 6S
\ 5/a
\ 6 m.
226 #n #m #lenm (elim lenm) /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/le.con(0,1,1)"
\ 6le_n
\ 5/a
\ 6,
\ 5a href="cic:/matita/arithmetics/nat/le.con(0,2,1)"
\ 6le_S
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/ qed.
228 \ 5img class="anchor" src="icons/tick.png" id="le_O_n"
\ 6theorem le_O_n : ∀n:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6.
\ 5a href="cic:/matita/arithmetics/nat/nat.con(0,1,0)"
\ 6O
\ 5/a
\ 6 \ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 n.
229 #n (elim n) /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/le.con(0,1,1)"
\ 6le_n
\ 5/a
\ 6,
\ 5a href="cic:/matita/arithmetics/nat/le.con(0,2,1)"
\ 6le_S
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/ qed.
231 \ 5img class="anchor" src="icons/tick.png" id="le_n_Sn"
\ 6theorem le_n_Sn : ∀n:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6. n
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 \ 5a href="cic:/matita/arithmetics/nat/nat.con(0,2,0)"
\ 6S
\ 5/a
\ 6 n.
232 /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/le.con(0,1,1)"
\ 6le_n
\ 5/a
\ 6,
\ 5a href="cic:/matita/arithmetics/nat/le.con(0,2,1)"
\ 6le_S
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/ qed.
234 \ 5img class="anchor" src="icons/tick.png" id="le_pred_n"
\ 6theorem le_pred_n : ∀n:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6.
\ 5a href="cic:/matita/arithmetics/nat/pred.def(1)"
\ 6pred
\ 5/a
\ 6 n
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 n.
237 \ 5img class="anchor" src="icons/tick.png" id="monotonic_pred"
\ 6theorem monotonic_pred:
\ 5a href="cic:/matita/basics/relations/monotonic.def(1)"
\ 6monotonic
\ 5/a
\ 6 ?
\ 5a href="cic:/matita/arithmetics/nat/le.ind(1,0,1)"
\ 6le
\ 5/a
\ 6 \ 5a href="cic:/matita/arithmetics/nat/pred.def(1)"
\ 6pred
\ 5/a
\ 6.
238 #n #m #lenm (elim lenm) /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/transitive_le.def(3)"
\ 6transitive_le
\ 5/a
\ 6,
\ 5a href="cic:/matita/arithmetics/nat/le.con(0,1,1)"
\ 6le_n
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/ qed.
240 \ 5img class="anchor" src="icons/tick.png" id="le_S_S_to_le"
\ 6theorem le_S_S_to_le: ∀n,m:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6.
\ 5a href="cic:/matita/arithmetics/nat/nat.con(0,2,0)"
\ 6S
\ 5/a
\ 6 n
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 \ 5a href="cic:/matita/arithmetics/nat/nat.con(0,2,0)"
\ 6S
\ 5/a
\ 6 m → n
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 m.
242 /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/monotonic_pred.def(4)"
\ 6monotonic_pred
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/ qed.
244 (* this are instances of the le versions
245 theorem lt_S_S_to_lt: ∀n,m. S n < S m → n < m.
248 theorem lt_to_lt_S_S: ∀n,m. n < m → S n < S m.
251 \ 5img class="anchor" src="icons/tick.png" id="lt_to_not_zero"
\ 6theorem lt_to_not_zero : ∀n,m:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6. n
\ 5a title="natural 'less than'" href="cic:/fakeuri.def(1)"
\ 6<
\ 5/a
\ 6 m →
\ 5a href="cic:/matita/arithmetics/nat/not_zero.def(1)"
\ 6not_zero
\ 5/a
\ 6 m.
252 #n #m #Hlt (elim Hlt) // qed.
256 \ 5img class="anchor" src="icons/tick.png" id="lt_to_le"
\ 6lemma lt_to_le: ∀n,m. n
\ 5a title="natural 'less than'" href="cic:/fakeuri.def(1)"
\ 6<
\ 5/a
\ 6 m → n
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 m.
257 #n #m #H @
\ 5a href="cic:/matita/arithmetics/nat/le_S_S_to_le.def(5)"
\ 6le_S_S_to_le
\ 5/a
\ 6 @
\ 5a href="cic:/matita/arithmetics/nat/le.con(0,2,1)"
\ 6le_S
\ 5/a
\ 6 @H qed-.
259 theorem not_le_Sn_O: ∀ n:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6.
\ 5a href="cic:/matita/arithmetics/nat/nat.con(0,2,0)"
\ 6S
\ 5/a
\ 6 n
\ 5a title="natural 'neither less nor equal to'" href="cic:/fakeuri.def(1)"
\ 6≰
\ 5/a
\ 6 \ 5a href="cic:/matita/arithmetics/nat/nat.con(0,1,0)"
\ 6O
\ 5/a
\ 6.
260 #n @
\ 5a href="cic:/matita/basics/logic/Not.con(0,1,1)"
\ 6nmk
\ 5/a
\ 6 #Hlen0 @(
\ 5a href="cic:/matita/arithmetics/nat/lt_to_not_zero.def(2)"
\ 6lt_to_not_zero
\ 5/a
\ 6 ?? Hlen0) qed.
262 theorem not_le_to_not_le_S_S: ∀ n,m:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6. n
\ 5a title="natural 'neither less nor equal to'" href="cic:/fakeuri.def(1)"
\ 6≰
\ 5/a
\ 6 m →
\ 5a href="cic:/matita/arithmetics/nat/nat.con(0,2,0)"
\ 6S
\ 5/a
\ 6 n
\ 5a title="natural 'neither less nor equal to'" href="cic:/fakeuri.def(1)"
\ 6≰
\ 5/a
\ 6 \ 5a href="cic:/matita/arithmetics/nat/nat.con(0,2,0)"
\ 6S
\ 5/a
\ 6 m.
263 /
\ 5span class="autotactic"
\ 63
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/basics/logic/not_to_not.def(3)"
\ 6not_to_not
\ 5/a
\ 6,
\ 5a href="cic:/matita/arithmetics/nat/monotonic_pred.def(4)"
\ 6monotonic_pred
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/ qed.
265 theorem not_le_S_S_to_not_le: ∀ n,m:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6.
\ 5a href="cic:/matita/arithmetics/nat/nat.con(0,2,0)"
\ 6S
\ 5/a
\ 6 n
\ 5a title="natural 'neither less nor equal to'" href="cic:/fakeuri.def(1)"
\ 6≰
\ 5/a
\ 6 \ 5a href="cic:/matita/arithmetics/nat/nat.con(0,2,0)"
\ 6S
\ 5/a
\ 6 m → n
\ 5a title="natural 'neither less nor equal to'" href="cic:/fakeuri.def(1)"
\ 6≰
\ 5/a
\ 6 m.
266 /
\ 5span class="autotactic"
\ 63
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/basics/logic/not_to_not.def(3)"
\ 6not_to_not
\ 5/a
\ 6,
\ 5a href="cic:/matita/arithmetics/nat/le_S_S.def(2)"
\ 6le_S_S
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/ qed.
268 theorem decidable_le: ∀n,m.
\ 5a href="cic:/matita/basics/logic/decidable.def(1)"
\ 6decidable
\ 5/a
\ 6 (n
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6m).
269 @
\ 5a href="cic:/matita/arithmetics/nat/nat_elim2.def(2)"
\ 6nat_elim2
\ 5/a
\ 6 #n /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/basics/logic/Or.con(0,1,2)"
\ 6or_introl
\ 5/a
\ 6,
\ 5a href="cic:/matita/basics/logic/Or.con(0,2,2)"
\ 6or_intror
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/ #m * /
\ 5span class="autotactic"
\ 63
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/basics/logic/Or.con(0,1,2)"
\ 6or_introl
\ 5/a
\ 6,
\ 5a href="cic:/matita/basics/logic/Or.con(0,2,2)"
\ 6or_intror
\ 5/a
\ 6,
\ 5a href="cic:/matita/arithmetics/nat/not_le_to_not_le_S_S.def(5)"
\ 6not_le_to_not_le_S_S
\ 5/a
\ 6,
\ 5a href="cic:/matita/arithmetics/nat/le_S_S.def(2)"
\ 6le_S_S
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/ qed.
271 theorem decidable_lt: ∀n,m.
\ 5a href="cic:/matita/basics/logic/decidable.def(1)"
\ 6decidable
\ 5/a
\ 6 (n
\ 5a title="natural 'less than'" href="cic:/fakeuri.def(1)"
\ 6<
\ 5/a
\ 6 m).
272 #n #m @
\ 5a href="cic:/matita/arithmetics/nat/decidable_le.def(6)"
\ 6decidable_le
\ 5/a
\ 6 qed.
274 theorem not_le_Sn_n: ∀n:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6.
\ 5a href="cic:/matita/arithmetics/nat/nat.con(0,2,0)"
\ 6S
\ 5/a
\ 6 n
\ 5a title="natural 'neither less nor equal to'" href="cic:/fakeuri.def(1)"
\ 6≰
\ 5/a
\ 6 n.
275 #n (elim n) /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/not_le_to_not_le_S_S.def(5)"
\ 6not_le_to_not_le_S_S
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/ qed.
277 (* this is le_S_S_to_le
278 theorem lt_S_to_le: ∀n,m:nat. n < S m → n ≤ m.
282 lemma le_gen: ∀P:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6 → Prop.∀n.(∀i. i
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 n → P i) → P n.
283 /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/le.con(0,1,1)"
\ 6le_n
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/ qed.
285 theorem not_le_to_lt: ∀n,m. n
\ 5a title="natural 'neither less nor equal to'" href="cic:/fakeuri.def(1)"
\ 6≰
\ 5/a
\ 6 m → m
\ 5a title="natural 'less than'" href="cic:/fakeuri.def(1)"
\ 6<
\ 5/a
\ 6 n.
286 @
\ 5a href="cic:/matita/arithmetics/nat/nat_elim2.def(2)"
\ 6nat_elim2
\ 5/a
\ 6 #n
287 [#abs @
\ 5a href="cic:/matita/basics/logic/False_ind.fix(0,1,1)"
\ 6False_ind
\ 5/a
\ 6 /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/basics/logic/absurd.def(2)"
\ 6absurd
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/
288 |/
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/le_S_S.def(2)"
\ 6le_S_S
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/
289 |#m #Hind #HnotleSS @
\ 5a href="cic:/matita/arithmetics/nat/le_S_S.def(2)"
\ 6le_S_S
\ 5/a
\ 6 /
\ 5span class="autotactic"
\ 63
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/not_le_S_S_to_not_le.def(4)"
\ 6not_le_S_S_to_not_le
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/
293 theorem lt_to_not_le: ∀n,m. n
\ 5a title="natural 'less than'" href="cic:/fakeuri.def(1)"
\ 6<
\ 5/a
\ 6 m → m
\ 5a title="natural 'neither less nor equal to'" href="cic:/fakeuri.def(1)"
\ 6≰
\ 5/a
\ 6 n.
294 #n #m #Hltnm (elim Hltnm) /
\ 5span class="autotactic"
\ 63
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/basics/logic/not_to_not.def(3)"
\ 6not_to_not
\ 5/a
\ 6,
\ 5a href="cic:/matita/arithmetics/nat/transitive_le.def(3)"
\ 6transitive_le
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/ qed.
296 theorem not_lt_to_le: ∀n,m:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6. n
\ 5a title="natural 'not less than'" href="cic:/fakeuri.def(1)"
\ 6≮
\ 5/a
\ 6 m → m
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 n.
297 /
\ 5span class="autotactic"
\ 64
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/basics/logic/not_to_not.def(3)"
\ 6not_to_not
\ 5/a
\ 6,
\ 5a href="cic:/matita/arithmetics/nat/not_le_to_lt.def(5)"
\ 6not_le_to_lt
\ 5/a
\ 6,
\ 5a href="cic:/matita/arithmetics/nat/monotonic_pred.def(4)"
\ 6monotonic_pred
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/ qed.
299 theorem le_to_not_lt: ∀n,m:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6. n
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 m → m
\ 5a title="natural 'not less than'" href="cic:/fakeuri.def(1)"
\ 6≮
\ 5/a
\ 6 n.
300 #n #m #H @
\ 5a href="cic:/matita/arithmetics/nat/lt_to_not_le.def(7)"
\ 6lt_to_not_le
\ 5/a
\ 6 /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/le_S_S.def(2)"
\ 6le_S_S
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/ (* /3/ *) qed.
302 (* lt and le trans *)
304 theorem lt_to_le_to_lt: ∀n,m,p:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6. n
\ 5a title="natural 'less than'" href="cic:/fakeuri.def(1)"
\ 6<
\ 5/a
\ 6 m → m
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 p → n
\ 5a title="natural 'less than'" href="cic:/fakeuri.def(1)"
\ 6<
\ 5/a
\ 6 p.
305 #n #m #p #H #H1 (elim H1) /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/transitive_lt.def(3)"
\ 6transitive_lt
\ 5/a
\ 6,
\ 5a href="cic:/matita/arithmetics/nat/le.con(0,1,1)"
\ 6le_n
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/ qed.
307 theorem le_to_lt_to_lt: ∀n,m,p:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6. n
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 m → m
\ 5a title="natural 'less than'" href="cic:/fakeuri.def(1)"
\ 6<
\ 5/a
\ 6 p → n
\ 5a title="natural 'less than'" href="cic:/fakeuri.def(1)"
\ 6<
\ 5/a
\ 6 p.
308 #n #m #p #H (elim H) /
\ 5span class="autotactic"
\ 63
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/transitive_lt.def(3)"
\ 6transitive_lt
\ 5/a
\ 6,
\ 5a href="cic:/matita/arithmetics/nat/le.con(0,1,1)"
\ 6le_n
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/ qed.
310 theorem lt_S_to_lt: ∀n,m.
\ 5a href="cic:/matita/arithmetics/nat/nat.con(0,2,0)"
\ 6S
\ 5/a
\ 6 n
\ 5a title="natural 'less than'" href="cic:/fakeuri.def(1)"
\ 6<
\ 5/a
\ 6 m → n
\ 5a title="natural 'less than'" href="cic:/fakeuri.def(1)"
\ 6<
\ 5/a
\ 6 m.
311 /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/transitive_lt.def(3)"
\ 6transitive_lt
\ 5/a
\ 6,
\ 5a href="cic:/matita/arithmetics/nat/le.con(0,1,1)"
\ 6le_n
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/ qed.
313 theorem ltn_to_ltO: ∀n,m:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6. n
\ 5a title="natural 'less than'" href="cic:/fakeuri.def(1)"
\ 6<
\ 5/a
\ 6 m →
\ 5a href="cic:/matita/arithmetics/nat/nat.con(0,1,0)"
\ 6O
\ 5/a
\ 6 \ 5a title="natural 'less than'" href="cic:/fakeuri.def(1)"
\ 6<
\ 5/a
\ 6 m.
314 /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/le_to_lt_to_lt.def(4)"
\ 6le_to_lt_to_lt
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/ qed.
316 theorem lt_O_n_elim: ∀n:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6.
\ 5a href="cic:/matita/arithmetics/nat/nat.con(0,1,0)"
\ 6O
\ 5/a
\ 6 \ 5a title="natural 'less than'" href="cic:/fakeuri.def(1)"
\ 6<
\ 5/a
\ 6 n →
317 ∀P:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6 → Prop.(∀m:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6.P (
\ 5a href="cic:/matita/arithmetics/nat/nat.con(0,2,0)"
\ 6S
\ 5/a
\ 6 m)) → P n.
318 #n (elim n) // #abs @
\ 5a href="cic:/matita/basics/logic/False_ind.fix(0,1,1)"
\ 6False_ind
\ 5/a
\ 6 /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/basics/logic/absurd.def(2)"
\ 6absurd
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/
321 theorem S_pred: ∀n.
\ 5a title="natural number" href="cic:/fakeuri.def(1)"
\ 60
\ 5/a
\ 6 \ 5a title="natural 'less than'" href="cic:/fakeuri.def(1)"
\ 6<
\ 5/a
\ 6 n →
\ 5a href="cic:/matita/arithmetics/nat/nat.con(0,2,0)"
\ 6S
\ 5/a
\ 6(
\ 5a href="cic:/matita/arithmetics/nat/pred.def(1)"
\ 6pred
\ 5/a
\ 6 n)
\ 5a title="leibnitz's equality" href="cic:/fakeuri.def(1)"
\ 6=
\ 5/a
\ 6 n.
322 #n #posn (cases posn) //
326 theorem le_to_or_lt_eq: ∀n,m:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6. n
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 m → n
\ 5a title="natural 'less than'" href="cic:/fakeuri.def(1)"
\ 6<
\ 5/a
\ 6 m
\ 5a title="logical or" href="cic:/fakeuri.def(1)"
\ 6∨
\ 5/a
\ 6 n
\ 5a title="leibnitz's equality" href="cic:/fakeuri.def(1)"
\ 6=
\ 5/a
\ 6 m.
327 #n #m #lenm (elim lenm) /
\ 5span class="autotactic"
\ 63
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/basics/logic/Or.con(0,1,2)"
\ 6or_introl
\ 5/a
\ 6,
\ 5a href="cic:/matita/basics/logic/Or.con(0,2,2)"
\ 6or_intror
\ 5/a
\ 6,
\ 5a href="cic:/matita/arithmetics/nat/le_to_lt_to_lt.def(4)"
\ 6le_to_lt_to_lt
\ 5/a
\ 6,
\ 5a href="cic:/matita/arithmetics/nat/le.con(0,1,1)"
\ 6le_n
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/ qed.
330 theorem lt_to_not_eq : ∀n,m:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6. n
\ 5a title="natural 'less than'" href="cic:/fakeuri.def(1)"
\ 6<
\ 5/a
\ 6 m → n
\ 5a title="leibnitz's non-equality" href="cic:/fakeuri.def(1)"
\ 6≠
\ 5/a
\ 6 m.
331 #n #m #H @
\ 5a href="cic:/matita/basics/logic/not_to_not.def(3)"
\ 6not_to_not
\ 5/a
\ 6 /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/basics/logic/absurd.def(2)"
\ 6absurd
\ 5/a
\ 6,
\ 5a href="cic:/matita/basics/logic/Not.con(0,1,1)"
\ 6nmk
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/ qed.
333 theorem not_eq_to_le_to_lt: ∀n,m. n
\ 5a title="leibnitz's non-equality" href="cic:/fakeuri.def(1)"
\ 6≠
\ 5/a
\ 6m → n
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6m → n
\ 5a title="natural 'less than'" href="cic:/fakeuri.def(1)"
\ 6<
\ 5/a
\ 6m.
334 #n #m #Hneq #Hle cases (
\ 5a href="cic:/matita/arithmetics/nat/le_to_or_lt_eq.def(5)"
\ 6le_to_or_lt_eq
\ 5/a
\ 6 ?? Hle) //
335 #Heq /
\ 5span class="autotactic"
\ 63
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/basics/logic/not_to_not.def(3)"
\ 6not_to_not
\ 5/a
\ 6,
\ 5a href="cic:/matita/arithmetics/nat/not_le_to_lt.def(5)"
\ 6not_le_to_lt
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/ qed.
337 nelim (Hneq Heq) qed. *)
340 theorem le_n_O_to_eq : ∀n:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6. n
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 \ 5a href="cic:/matita/arithmetics/nat/nat.con(0,1,0)"
\ 6O
\ 5/a
\ 6 →
\ 5a href="cic:/matita/arithmetics/nat/nat.con(0,1,0)"
\ 6O
\ 5/a
\ 6\ 5a title="leibnitz's equality" href="cic:/fakeuri.def(1)"
\ 6=
\ 5/a
\ 6n.
341 #n (cases n) // #a #abs @
\ 5a href="cic:/matita/basics/logic/False_ind.fix(0,1,1)"
\ 6False_ind
\ 5/a
\ 6 /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/basics/logic/absurd.def(2)"
\ 6absurd
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/ qed.
343 theorem le_n_O_elim: ∀n:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6. n
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 \ 5a href="cic:/matita/arithmetics/nat/nat.con(0,1,0)"
\ 6O
\ 5/a
\ 6 → ∀P:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6 →Prop. P
\ 5a href="cic:/matita/arithmetics/nat/nat.con(0,1,0)"
\ 6O
\ 5/a
\ 6 → P n.
344 #n (cases n) // #a #abs @
\ 5a href="cic:/matita/basics/logic/False_ind.fix(0,1,1)"
\ 6False_ind
\ 5/a
\ 6 /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/basics/logic/absurd.def(2)"
\ 6absurd
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/ qed.
346 theorem le_n_Sm_elim : ∀n,m:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6.n
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 \ 5a href="cic:/matita/arithmetics/nat/nat.con(0,2,0)"
\ 6S
\ 5/a
\ 6 m →
347 ∀P:Prop. (
\ 5a href="cic:/matita/arithmetics/nat/nat.con(0,2,0)"
\ 6S
\ 5/a
\ 6 n
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 \ 5a href="cic:/matita/arithmetics/nat/nat.con(0,2,0)"
\ 6S
\ 5/a
\ 6 m → P) → (n
\ 5a title="leibnitz's equality" href="cic:/fakeuri.def(1)"
\ 6=
\ 5/a
\ 6\ 5a href="cic:/matita/arithmetics/nat/nat.con(0,2,0)"
\ 6S
\ 5/a
\ 6 m → P) → P.
348 #n #m #Hle #P (elim Hle) /
\ 5span class="autotactic"
\ 63
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/le_S_S.def(2)"
\ 6le_S_S
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/ qed.
352 theorem le_to_le_to_eq: ∀n,m. n
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 m → m
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 n → n
\ 5a title="leibnitz's equality" href="cic:/fakeuri.def(1)"
\ 6=
\ 5/a
\ 6 m.
353 @
\ 5a href="cic:/matita/arithmetics/nat/nat_elim2.def(2)"
\ 6nat_elim2
\ 5/a
\ 6 /
\ 5span class="autotactic"
\ 64
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/basics/logic/eq_f.def(3)"
\ 6eq_f
\ 5/a
\ 6,
\ 5a href="cic:/matita/arithmetics/nat/le_n_O_to_eq.def(4)"
\ 6le_n_O_to_eq
\ 5/a
\ 6,
\ 5a href="cic:/matita/arithmetics/nat/monotonic_pred.def(4)"
\ 6monotonic_pred
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/
356 theorem lt_O_S : ∀n:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6.
\ 5a href="cic:/matita/arithmetics/nat/nat.con(0,1,0)"
\ 6O
\ 5/a
\ 6 \ 5a title="natural 'less than'" href="cic:/fakeuri.def(1)"
\ 6<
\ 5/a
\ 6 \ 5a href="cic:/matita/arithmetics/nat/nat.con(0,2,0)"
\ 6S
\ 5/a
\ 6 n.
357 /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/not_le_to_lt.def(5)"
\ 6not_le_to_lt
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/ qed.
360 (* other abstract properties *)
361 theorem antisymmetric_le : antisymmetric nat le.
362 unfold antisymmetric.intros 2.
363 apply (nat_elim2 (\lambda n,m.(n \leq m \to m \leq n \to n=m))).
364 intros.apply le_n_O_to_eq.assumption.
365 intros.apply False_ind.apply (not_le_Sn_O ? H).
366 intros.apply eq_f.apply H.
367 apply le_S_S_to_le.assumption.
368 apply le_S_S_to_le.assumption.
371 theorem antisym_le: \forall n,m:nat. n \leq m \to m \leq n \to n=m
372 \def antisymmetric_le.
374 theorem le_n_m_to_lt_m_Sn_to_eq_n_m: ∀n,m. n ≤ m → m < S n → n=m.
377 generalize in match (le_S_S_to_le ? ? H1)
384 (* well founded induction principles *)
386 theorem nat_elim1 : ∀n:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6.∀P:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6 → Prop.
387 (∀m.(∀p. p
\ 5a title="natural 'less than'" href="cic:/fakeuri.def(1)"
\ 6<
\ 5/a
\ 6 m → P p) → P m) → P n.
389 cut (∀q:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6. q
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 n → P q) /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/le.con(0,1,1)"
\ 6le_n
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/
391 [#q #HleO (* applica male *)
392 @(
\ 5a href="cic:/matita/arithmetics/nat/le_n_O_elim.def(4)"
\ 6le_n_O_elim
\ 5/a
\ 6 ? HleO)
393 @H #p #ltpO @
\ 5a href="cic:/matita/basics/logic/False_ind.fix(0,1,1)"
\ 6False_ind
\ 5/a
\ 6 /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/basics/logic/absurd.def(2)"
\ 6absurd
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/ (* 3 *)
395 @H #a #lta @Hind @
\ 5a href="cic:/matita/arithmetics/nat/le_S_S_to_le.def(5)"
\ 6le_S_S_to_le
\ 5/a
\ 6 /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/transitive_le.def(3)"
\ 6transitive_le
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/
399 (* some properties of functions *)
401 definition increasing ≝ λf:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6 →
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6. ∀n:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6. f n
\ 5a title="natural 'less than'" href="cic:/fakeuri.def(1)"
\ 6<
\ 5/a
\ 6 f (
\ 5a href="cic:/matita/arithmetics/nat/nat.con(0,2,0)"
\ 6S
\ 5/a
\ 6 n).
403 theorem increasing_to_monotonic: ∀f:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6 →
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6.
404 \ 5a href="cic:/matita/arithmetics/nat/increasing.def(2)"
\ 6increasing
\ 5/a
\ 6 f →
\ 5a href="cic:/matita/basics/relations/monotonic.def(1)"
\ 6monotonic
\ 5/a
\ 6 \ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6 \ 5a href="cic:/matita/arithmetics/nat/lt.def(1)"
\ 6lt
\ 5/a
\ 6 f.
405 #f #incr #n #m #ltnm (elim ltnm) /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/transitive_lt.def(3)"
\ 6transitive_lt
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/
408 theorem le_n_fn: ∀f:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6 →
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6.
409 \ 5a href="cic:/matita/arithmetics/nat/increasing.def(2)"
\ 6increasing
\ 5/a
\ 6 f → ∀n:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6. n
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 f n.
410 #f #incr #n (elim n) /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/le_to_lt_to_lt.def(4)"
\ 6le_to_lt_to_lt
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/
413 theorem increasing_to_le: ∀f:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6 →
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6.
414 \ 5a href="cic:/matita/arithmetics/nat/increasing.def(2)"
\ 6increasing
\ 5/a
\ 6 f → ∀m:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6.
\ 5a title="exists" href="cic:/fakeuri.def(1)"
\ 6∃
\ 5/a
\ 6i.m
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 f i.
415 #f #incr #m (elim m) /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/basics/logic/ex.con(0,1,2)"
\ 6ex_intro
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/#n * #a #lenfa
416 @(
\ 5a href="cic:/matita/basics/logic/ex.con(0,1,2)"
\ 6ex_intro
\ 5/a
\ 6 ?? (
\ 5a href="cic:/matita/arithmetics/nat/nat.con(0,2,0)"
\ 6S
\ 5/a
\ 6 a)) /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/le_to_lt_to_lt.def(4)"
\ 6le_to_lt_to_lt
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/
419 theorem increasing_to_le2: ∀f:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6 →
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6.
\ 5a href="cic:/matita/arithmetics/nat/increasing.def(2)"
\ 6increasing
\ 5/a
\ 6 f →
420 ∀m:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6. f
\ 5a title="natural number" href="cic:/fakeuri.def(1)"
\ 60
\ 5/a
\ 6 \ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 m →
\ 5a title="exists" href="cic:/fakeuri.def(1)"
\ 6∃
\ 5/a
\ 6i. f i
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 m
\ 5a title="logical and" href="cic:/fakeuri.def(1)"
\ 6∧
\ 5/a
\ 6 m
\ 5a title="natural 'less than'" href="cic:/fakeuri.def(1)"
\ 6<
\ 5/a
\ 6 f (
\ 5a href="cic:/matita/arithmetics/nat/nat.con(0,2,0)"
\ 6S
\ 5/a
\ 6 i).
421 #f #incr #m #lem (elim lem)
422 [@(
\ 5a href="cic:/matita/basics/logic/ex.con(0,1,2)"
\ 6ex_intro
\ 5/a
\ 6 ? ?
\ 5a href="cic:/matita/arithmetics/nat/nat.con(0,1,0)"
\ 6O
\ 5/a
\ 6) /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/basics/logic/And.con(0,1,2)"
\ 6conj
\ 5/a
\ 6,
\ 5a href="cic:/matita/arithmetics/nat/le.con(0,1,1)"
\ 6le_n
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/
423 |#n #len * #a * #len #ltnr (cases(
\ 5a href="cic:/matita/arithmetics/nat/le_to_or_lt_eq.def(5)"
\ 6le_to_or_lt_eq
\ 5/a
\ 6 … ltnr)) #H
424 [@(
\ 5a href="cic:/matita/basics/logic/ex.con(0,1,2)"
\ 6ex_intro
\ 5/a
\ 6 ? ? a) % /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/le.con(0,2,1)"
\ 6le_S
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/
425 |@(
\ 5a href="cic:/matita/basics/logic/ex.con(0,1,2)"
\ 6ex_intro
\ 5/a
\ 6 ? ? (
\ 5a href="cic:/matita/arithmetics/nat/nat.con(0,2,0)"
\ 6S
\ 5/a
\ 6 a)) % //
430 theorem increasing_to_injective: ∀f:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6 →
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6.
431 \ 5a href="cic:/matita/arithmetics/nat/increasing.def(2)"
\ 6increasing
\ 5/a
\ 6 f →
\ 5a href="cic:/matita/basics/relations/injective.def(1)"
\ 6injective
\ 5/a
\ 6 \ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6 \ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6 f.
432 #f #incr #n #m cases(
\ 5a href="cic:/matita/arithmetics/nat/decidable_le.def(6)"
\ 6decidable_le
\ 5/a
\ 6 n m)
433 [#lenm cases(
\ 5a href="cic:/matita/arithmetics/nat/le_to_or_lt_eq.def(5)"
\ 6le_to_or_lt_eq
\ 5/a
\ 6 … lenm) //
434 #lenm #eqf @
\ 5a href="cic:/matita/basics/logic/False_ind.fix(0,1,1)"
\ 6False_ind
\ 5/a
\ 6 @(
\ 5a href="cic:/matita/basics/logic/absurd.def(2)"
\ 6absurd
\ 5/a
\ 6 … eqf) @
\ 5a href="cic:/matita/arithmetics/nat/lt_to_not_eq.def(7)"
\ 6lt_to_not_eq
\ 5/a
\ 6
435 @
\ 5a href="cic:/matita/arithmetics/nat/increasing_to_monotonic.def(4)"
\ 6increasing_to_monotonic
\ 5/a
\ 6 //
436 |#nlenm #eqf @
\ 5a href="cic:/matita/basics/logic/False_ind.fix(0,1,1)"
\ 6False_ind
\ 5/a
\ 6 @(
\ 5a href="cic:/matita/basics/logic/absurd.def(2)"
\ 6absurd
\ 5/a
\ 6 … eqf) @
\ 5a href="cic:/matita/basics/logic/sym_not_eq.def(4)"
\ 6sym_not_eq
\ 5/a
\ 6
437 @
\ 5a href="cic:/matita/arithmetics/nat/lt_to_not_eq.def(7)"
\ 6lt_to_not_eq
\ 5/a
\ 6 @
\ 5a href="cic:/matita/arithmetics/nat/increasing_to_monotonic.def(4)"
\ 6increasing_to_monotonic
\ 5/a
\ 6 /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/not_le_to_lt.def(5)"
\ 6not_le_to_lt
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/
441 (*********************** monotonicity ***************************)
442 theorem monotonic_le_plus_r:
443 ∀n:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6.
\ 5a href="cic:/matita/basics/relations/monotonic.def(1)"
\ 6monotonic
\ 5/a
\ 6 \ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6 \ 5a href="cic:/matita/arithmetics/nat/le.ind(1,0,1)"
\ 6le
\ 5/a
\ 6 (λm.n
\ 5a title="natural plus" href="cic:/fakeuri.def(1)"
\ 6+
\ 5/a
\ 6 m).
444 #n #a #b (elim n) normalize //
445 #m #H #leab @
\ 5a href="cic:/matita/arithmetics/nat/le_S_S.def(2)"
\ 6le_S_S
\ 5/a
\ 6 /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5/span
\ 6\ 5/span
\ 6/ qed.
448 theorem le_plus_r: ∀p,n,m:nat. n ≤ m → p + n ≤ p + m
449 ≝ monotonic_le_plus_r. *)
451 theorem monotonic_le_plus_l:
452 ∀m:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6.
\ 5a href="cic:/matita/basics/relations/monotonic.def(1)"
\ 6monotonic
\ 5/a
\ 6 \ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6 \ 5a href="cic:/matita/arithmetics/nat/le.ind(1,0,1)"
\ 6le
\ 5/a
\ 6 (λn.n
\ 5a title="natural plus" href="cic:/fakeuri.def(1)"
\ 6+
\ 5/a
\ 6 m).
453 /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/monotonic_le_plus_r.def(3)"
\ 6monotonic_le_plus_r
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/ qed.
456 theorem le_plus_l: \forall p,n,m:nat. n \le m \to n + p \le m + p
457 \def monotonic_le_plus_l. *)
459 theorem le_plus: ∀n1,n2,m1,m2:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6. n1
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 n2 → m1
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 m2
460 → n1
\ 5a title="natural plus" href="cic:/fakeuri.def(1)"
\ 6+
\ 5/a
\ 6 m1
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 n2
\ 5a title="natural plus" href="cic:/fakeuri.def(1)"
\ 6+
\ 5/a
\ 6 m2.
461 #n1 #n2 #m1 #m2 #len #lem @(
\ 5a href="cic:/matita/arithmetics/nat/transitive_le.def(3)"
\ 6transitive_le
\ 5/a
\ 6 ? (n1
\ 5a title="natural plus" href="cic:/fakeuri.def(1)"
\ 6+
\ 5/a
\ 6m2))
462 /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/monotonic_le_plus_l.def(6)"
\ 6monotonic_le_plus_l
\ 5/a
\ 6,
\ 5a href="cic:/matita/arithmetics/nat/monotonic_le_plus_r.def(3)"
\ 6monotonic_le_plus_r
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/ qed.
464 theorem le_plus_n :∀n,m:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6. m
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 n
\ 5a title="natural plus" href="cic:/fakeuri.def(1)"
\ 6+
\ 5/a
\ 6 m.
465 /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/monotonic_le_plus_l.def(6)"
\ 6monotonic_le_plus_l
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/ qed.
467 lemma le_plus_a: ∀a,n,m. n
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 m → n
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 a
\ 5a title="natural plus" href="cic:/fakeuri.def(1)"
\ 6+
\ 5/a
\ 6 m.
468 /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/le_plus.def(7)"
\ 6le_plus
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/ qed.
470 lemma le_plus_b: ∀b,n,m. n
\ 5a title="natural plus" href="cic:/fakeuri.def(1)"
\ 6+
\ 5/a
\ 6 b
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 m → n
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 m.
471 /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/transitive_le.def(3)"
\ 6transitive_le
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/ qed.
473 theorem le_plus_n_r :∀n,m:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6. m
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 m
\ 5a title="natural plus" href="cic:/fakeuri.def(1)"
\ 6+
\ 5/a
\ 6 n.
474 /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5/span
\ 6\ 5/span
\ 6/ qed.
476 theorem eq_plus_to_le: ∀n,m,p:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6.n
\ 5a title="leibnitz's equality" href="cic:/fakeuri.def(1)"
\ 6=
\ 5/a
\ 6m
\ 5a title="natural plus" href="cic:/fakeuri.def(1)"
\ 6+
\ 5/a
\ 6p → m
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 n.
479 theorem le_plus_to_le: ∀a,n,m. a
\ 5a title="natural plus" href="cic:/fakeuri.def(1)"
\ 6+
\ 5/a
\ 6 n
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 a
\ 5a title="natural plus" href="cic:/fakeuri.def(1)"
\ 6+
\ 5/a
\ 6 m → n
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 m.
480 #a (elim a) normalize /
\ 5span class="autotactic"
\ 63
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/monotonic_pred.def(4)"
\ 6monotonic_pred
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/ qed.
482 theorem le_plus_to_le_r: ∀a,n,m. n
\ 5a title="natural plus" href="cic:/fakeuri.def(1)"
\ 6+
\ 5/a
\ 6 a
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 m
\ 5a title="natural plus" href="cic:/fakeuri.def(1)"
\ 6+
\ 5/a
\ 6a → n
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 m.
483 /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/le_plus_to_le.def(5)"
\ 6le_plus_to_le
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/ qed.
487 theorem monotonic_lt_plus_r:
488 ∀n:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6.
\ 5a href="cic:/matita/basics/relations/monotonic.def(1)"
\ 6monotonic
\ 5/a
\ 6 \ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6 \ 5a href="cic:/matita/arithmetics/nat/lt.def(1)"
\ 6lt
\ 5/a
\ 6 (λm.n
\ 5a title="natural plus" href="cic:/fakeuri.def(1)"
\ 6+
\ 5/a
\ 6m).
489 /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/increasing_to_monotonic.def(4)"
\ 6increasing_to_monotonic
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/ qed.
492 variant lt_plus_r: \forall n,p,q:nat. p < q \to n + p < n + q \def
493 monotonic_lt_plus_r. *)
495 theorem monotonic_lt_plus_l:
496 ∀n:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6.
\ 5a href="cic:/matita/basics/relations/monotonic.def(1)"
\ 6monotonic
\ 5/a
\ 6 \ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6 \ 5a href="cic:/matita/arithmetics/nat/lt.def(1)"
\ 6lt
\ 5/a
\ 6 (λm.m
\ 5a title="natural plus" href="cic:/fakeuri.def(1)"
\ 6+
\ 5/a
\ 6n).
497 (* /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/increasing_to_monotonic.def(4)"
\ 6increasing_to_monotonic
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/ *) #n @
\ 5a href="cic:/matita/arithmetics/nat/increasing_to_monotonic.def(4)"
\ 6increasing_to_monotonic
\ 5/a
\ 6 // qed.
500 variant lt_plus_l: \forall n,p,q:nat. p < q \to p + n < q + n \def
501 monotonic_lt_plus_l. *)
503 theorem lt_plus: ∀n,m,p,q:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6. n
\ 5a title="natural 'less than'" href="cic:/fakeuri.def(1)"
\ 6<
\ 5/a
\ 6 m → p
\ 5a title="natural 'less than'" href="cic:/fakeuri.def(1)"
\ 6<
\ 5/a
\ 6 q → n
\ 5a title="natural plus" href="cic:/fakeuri.def(1)"
\ 6+
\ 5/a
\ 6 p
\ 5a title="natural 'less than'" href="cic:/fakeuri.def(1)"
\ 6<
\ 5/a
\ 6 m
\ 5a title="natural plus" href="cic:/fakeuri.def(1)"
\ 6+
\ 5/a
\ 6 q.
504 #n #m #p #q #ltnm #ltpq
505 @(
\ 5a href="cic:/matita/arithmetics/nat/transitive_lt.def(3)"
\ 6transitive_lt
\ 5/a
\ 6 ? (n
\ 5a title="natural plus" href="cic:/fakeuri.def(1)"
\ 6+
\ 5/a
\ 6q))/
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/monotonic_le_plus_r.def(3)"
\ 6monotonic_le_plus_r
\ 5/a
\ 6,
\ 5a href="cic:/matita/arithmetics/nat/monotonic_lt_plus_l.def(9)"
\ 6monotonic_lt_plus_l
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/ qed.
507 theorem lt_plus_to_lt_l :∀n,p,q:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6. p
\ 5a title="natural plus" href="cic:/fakeuri.def(1)"
\ 6+
\ 5/a
\ 6n
\ 5a title="natural 'less than'" href="cic:/fakeuri.def(1)"
\ 6<
\ 5/a
\ 6 q
\ 5a title="natural plus" href="cic:/fakeuri.def(1)"
\ 6+
\ 5/a
\ 6n → p
\ 5a title="natural 'less than'" href="cic:/fakeuri.def(1)"
\ 6<
\ 5/a
\ 6q.
508 /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/le_plus_to_le.def(5)"
\ 6le_plus_to_le
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/ qed.
510 theorem lt_plus_to_lt_r :∀n,p,q:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6. n
\ 5a title="natural plus" href="cic:/fakeuri.def(1)"
\ 6+
\ 5/a
\ 6p
\ 5a title="natural 'less than'" href="cic:/fakeuri.def(1)"
\ 6<
\ 5/a
\ 6 n
\ 5a title="natural plus" href="cic:/fakeuri.def(1)"
\ 6+
\ 5/a
\ 6q → p
\ 5a title="natural 'less than'" href="cic:/fakeuri.def(1)"
\ 6<
\ 5/a
\ 6q.
511 /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/lt_plus_to_lt_l.def(6)"
\ 6lt_plus_to_lt_l
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/ qed.
514 theorem le_to_lt_to_lt_plus: ∀a,b,c,d:nat.
515 a ≤ c → b < d → a + b < c+d.
516 (* bello /2/ un po' lento *)
517 #a #b #c #d #leac #lebd
518 normalize napplyS le_plus // qed.
522 theorem monotonic_le_times_r:
523 ∀n:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6.
\ 5a href="cic:/matita/basics/relations/monotonic.def(1)"
\ 6monotonic
\ 5/a
\ 6 \ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6 \ 5a href="cic:/matita/arithmetics/nat/le.ind(1,0,1)"
\ 6le
\ 5/a
\ 6 (λm. n
\ 5a title="natural times" href="cic:/fakeuri.def(1)"
\ 6*
\ 5/a
\ 6 m).
524 #n #x #y #lexy (elim n) normalize//(* lento /2/*)
525 #a #lea @
\ 5a href="cic:/matita/arithmetics/nat/le_plus.def(7)"
\ 6le_plus
\ 5/a
\ 6 //
529 theorem le_times_r: \forall p,n,m:nat. n \le m \to p*n \le p*m
530 \def monotonic_le_times_r. *)
533 theorem monotonic_le_times_l:
534 ∀m:nat.monotonic nat le (λn.n*m).
539 theorem le_times_l: \forall p,n,m:nat. n \le m \to n*p \le m*p
540 \def monotonic_le_times_l. *)
542 theorem le_times: ∀n1,n2,m1,m2:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6.
543 n1
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 n2 → m1
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 m2 → n1
\ 5a title="natural times" href="cic:/fakeuri.def(1)"
\ 6*
\ 5/a
\ 6m1
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 n2
\ 5a title="natural times" href="cic:/fakeuri.def(1)"
\ 6*
\ 5/a
\ 6m2.
544 #n1 #n2 #m1 #m2 #len #lem @(
\ 5a href="cic:/matita/arithmetics/nat/transitive_le.def(3)"
\ 6transitive_le
\ 5/a
\ 6 ? (n1
\ 5a title="natural times" href="cic:/fakeuri.def(1)"
\ 6*
\ 5/a
\ 6m2)) /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/monotonic_le_times_r.def(8)"
\ 6monotonic_le_times_r
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/
548 theorem lt_times_n: ∀n,m:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6.
\ 5a href="cic:/matita/arithmetics/nat/nat.con(0,1,0)"
\ 6O
\ 5/a
\ 6 \ 5a title="natural 'less than'" href="cic:/fakeuri.def(1)"
\ 6<
\ 5/a
\ 6 n → m
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 n
\ 5a title="natural times" href="cic:/fakeuri.def(1)"
\ 6*
\ 5/a
\ 6m.
549 #n #m #H /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/monotonic_le_times_r.def(8)"
\ 6monotonic_le_times_r
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/ qed.
551 theorem le_times_to_le:
552 ∀a,n,m.
\ 5a href="cic:/matita/arithmetics/nat/nat.con(0,1,0)"
\ 6O
\ 5/a
\ 6 \ 5a title="natural 'less than'" href="cic:/fakeuri.def(1)"
\ 6<
\ 5/a
\ 6 a → a
\ 5a title="natural times" href="cic:/fakeuri.def(1)"
\ 6*
\ 5/a
\ 6 n
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 a
\ 5a title="natural times" href="cic:/fakeuri.def(1)"
\ 6*
\ 5/a
\ 6 m → n
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 m.
553 #a @
\ 5a href="cic:/matita/arithmetics/nat/nat_elim2.def(2)"
\ 6nat_elim2
\ 5/a
\ 6 normalize
556 @(
\ 5a href="cic:/matita/arithmetics/nat/transitive_le.def(3)"
\ 6transitive_le
\ 5/a
\ 6 ? (a
\ 5a title="natural times" href="cic:/fakeuri.def(1)"
\ 6*
\ 5/a
\ 6\ 5a href="cic:/matita/arithmetics/nat/nat.con(0,2,0)"
\ 6S
\ 5/a
\ 6 n)) /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/monotonic_le_times_r.def(8)"
\ 6monotonic_le_times_r
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/
558 @
\ 5a href="cic:/matita/arithmetics/nat/le_S_S.def(2)"
\ 6le_S_S
\ 5/a
\ 6 @H /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/le_plus_to_le.def(5)"
\ 6le_plus_to_le
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/
563 theorem le_S_times_2: ∀n,m.O < m → n ≤ m → S n ≤ 2*m.
564 #n #m #posm #lenm (* interessante *)
565 applyS (le_plus n m) // qed. *)
569 theorem lt_O_times_S_S: ∀n,m:nat.O < (S n)*(S m).
570 intros.simplify.unfold lt.apply le_S_S.apply le_O_n.
574 theorem lt_times_eq_O: \forall a,b:nat.
575 O < a → a * b = O → b = O.
582 rewrite > (S_pred a) in H1
584 apply (eq_to_not_lt O ((S (pred a))*(S m)))
587 | apply lt_O_times_S_S
594 theorem O_lt_times_to_O_lt: \forall a,c:nat.
595 O \lt (a * c) \to O \lt a.
607 lemma lt_times_to_lt_O: \forall i,n,m:nat. i < n*m \to O < m.
609 elim (le_to_or_lt_eq O ? (le_O_n m))
613 rewrite < times_n_O in H.
614 apply (not_le_Sn_O ? H)
619 theorem monotonic_lt_times_r:
620 ∀n:nat.monotonic nat lt (λm.(S n)*m).
624 simplify.rewrite < plus_n_O.rewrite < plus_n_O.assumption.
625 apply lt_plus.assumption.assumption.
628 theorem monotonic_lt_times_r:
629 ∀c:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6.
\ 5a href="cic:/matita/arithmetics/nat/nat.con(0,1,0)"
\ 6O
\ 5/a
\ 6 \ 5a title="natural 'less than'" href="cic:/fakeuri.def(1)"
\ 6<
\ 5/a
\ 6 c →
\ 5a href="cic:/matita/basics/relations/monotonic.def(1)"
\ 6monotonic
\ 5/a
\ 6 \ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6 \ 5a href="cic:/matita/arithmetics/nat/lt.def(1)"
\ 6lt
\ 5/a
\ 6 (λt.(c
\ 5a title="natural times" href="cic:/fakeuri.def(1)"
\ 6*
\ 5/a
\ 6t)).
631 (elim ltnm) normalize
632 [/
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/monotonic_lt_plus_l.def(9)"
\ 6monotonic_lt_plus_l
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/
633 |#a #_ #lt1 @(
\ 5a href="cic:/matita/arithmetics/nat/transitive_le.def(3)"
\ 6transitive_le
\ 5/a
\ 6 … lt1) //
637 theorem monotonic_lt_times_l:
638 ∀c:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6.
\ 5a href="cic:/matita/arithmetics/nat/nat.con(0,1,0)"
\ 6O
\ 5/a
\ 6 \ 5a title="natural 'less than'" href="cic:/fakeuri.def(1)"
\ 6<
\ 5/a
\ 6 c →
\ 5a href="cic:/matita/basics/relations/monotonic.def(1)"
\ 6monotonic
\ 5/a
\ 6 \ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6 \ 5a href="cic:/matita/arithmetics/nat/lt.def(1)"
\ 6lt
\ 5/a
\ 6 (λt.(t
\ 5a title="natural times" href="cic:/fakeuri.def(1)"
\ 6*
\ 5/a
\ 6c)).
639 /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/monotonic_lt_times_r.def(10)"
\ 6monotonic_lt_times_r
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/
642 theorem lt_to_le_to_lt_times:
643 ∀n,m,p,q:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6. n
\ 5a title="natural 'less than'" href="cic:/fakeuri.def(1)"
\ 6<
\ 5/a
\ 6 m → p
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 q →
\ 5a href="cic:/matita/arithmetics/nat/nat.con(0,1,0)"
\ 6O
\ 5/a
\ 6 \ 5a title="natural 'less than'" href="cic:/fakeuri.def(1)"
\ 6<
\ 5/a
\ 6 q → n
\ 5a title="natural times" href="cic:/fakeuri.def(1)"
\ 6*
\ 5/a
\ 6p
\ 5a title="natural 'less than'" href="cic:/fakeuri.def(1)"
\ 6<
\ 5/a
\ 6 m
\ 5a title="natural times" href="cic:/fakeuri.def(1)"
\ 6*
\ 5/a
\ 6q.
644 #n #m #p #q #ltnm #lepq #posq
645 @(
\ 5a href="cic:/matita/arithmetics/nat/le_to_lt_to_lt.def(4)"
\ 6le_to_lt_to_lt
\ 5/a
\ 6 ? (n
\ 5a title="natural times" href="cic:/fakeuri.def(1)"
\ 6*
\ 5/a
\ 6q))
646 [@
\ 5a href="cic:/matita/arithmetics/nat/monotonic_le_times_r.def(8)"
\ 6monotonic_le_times_r
\ 5/a
\ 6 //
647 |@
\ 5a href="cic:/matita/arithmetics/nat/monotonic_lt_times_l.def(11)"
\ 6monotonic_lt_times_l
\ 5/a
\ 6 //
651 theorem lt_times:∀n,m,p,q:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6. n
\ 5a title="natural 'less than'" href="cic:/fakeuri.def(1)"
\ 6<
\ 5/a
\ 6m → p
\ 5a title="natural 'less than'" href="cic:/fakeuri.def(1)"
\ 6<
\ 5/a
\ 6q → n
\ 5a title="natural times" href="cic:/fakeuri.def(1)"
\ 6*
\ 5/a
\ 6p
\ 5a title="natural 'less than'" href="cic:/fakeuri.def(1)"
\ 6<
\ 5/a
\ 6 m
\ 5a title="natural times" href="cic:/fakeuri.def(1)"
\ 6*
\ 5/a
\ 6q.
652 #n #m #p #q #ltnm #ltpq @
\ 5a href="cic:/matita/arithmetics/nat/lt_to_le_to_lt_times.def(12)"
\ 6lt_to_le_to_lt_times
\ 5/a
\ 6 /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/le_plus_b.def(8)"
\ 6le_plus_b
\ 5/a
\ 6,
\ 5a href="cic:/matita/arithmetics/nat/ltn_to_ltO.def(5)"
\ 6ltn_to_ltO
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/
655 theorem lt_times_n_to_lt_l:
656 ∀n,p,q:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6. p
\ 5a title="natural times" href="cic:/fakeuri.def(1)"
\ 6*
\ 5/a
\ 6n
\ 5a title="natural 'less than'" href="cic:/fakeuri.def(1)"
\ 6<
\ 5/a
\ 6 q
\ 5a title="natural times" href="cic:/fakeuri.def(1)"
\ 6*
\ 5/a
\ 6n → p
\ 5a title="natural 'less than'" href="cic:/fakeuri.def(1)"
\ 6<
\ 5/a
\ 6 q.
657 #n #p #q #Hlt (elim (
\ 5a href="cic:/matita/arithmetics/nat/decidable_lt.def(7)"
\ 6decidable_lt
\ 5/a
\ 6 p q)) //
658 #nltpq @
\ 5a href="cic:/matita/basics/logic/False_ind.fix(0,1,1)"
\ 6False_ind
\ 5/a
\ 6 @(
\ 5a href="cic:/matita/basics/logic/absurd.def(2)"
\ 6absurd
\ 5/a
\ 6 ? ? (
\ 5a href="cic:/matita/arithmetics/nat/lt_to_not_le.def(7)"
\ 6lt_to_not_le
\ 5/a
\ 6 ? ? Hlt))
659 applyS
\ 5a href="cic:/matita/arithmetics/nat/monotonic_le_times_r.def(8)"
\ 6monotonic_le_times_r
\ 5/a
\ 6 /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/not_lt_to_le.def(6)"
\ 6not_lt_to_le
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/
662 theorem lt_times_n_to_lt_r:
663 ∀n,p,q:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6. n
\ 5a title="natural times" href="cic:/fakeuri.def(1)"
\ 6*
\ 5/a
\ 6p
\ 5a title="natural 'less than'" href="cic:/fakeuri.def(1)"
\ 6<
\ 5/a
\ 6 n
\ 5a title="natural times" href="cic:/fakeuri.def(1)"
\ 6*
\ 5/a
\ 6q → p
\ 5a title="natural 'less than'" href="cic:/fakeuri.def(1)"
\ 6<
\ 5/a
\ 6 q.
664 /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/lt_times_n_to_lt_l.def(9)"
\ 6lt_times_n_to_lt_l
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/ qed.
667 theorem nat_compare_times_l : \forall n,p,q:nat.
668 nat_compare p q = nat_compare ((S n) * p) ((S n) * q).
669 intros.apply nat_compare_elim.intro.
670 apply nat_compare_elim.
673 apply (inj_times_r n).assumption.
674 apply lt_to_not_eq. assumption.
676 apply (lt_times_to_lt_r n).assumption.
677 apply le_to_not_lt.apply lt_to_le.assumption.
678 intro.rewrite < H.rewrite > nat_compare_n_n.reflexivity.
679 intro.apply nat_compare_elim.intro.
681 apply (lt_times_to_lt_r n).assumption.
682 apply le_to_not_lt.apply lt_to_le.assumption.
685 apply (inj_times_r n).assumption.
686 apply lt_to_not_eq.assumption.
691 theorem lt_times_plus_times: \forall a,b,n,m:nat.
692 a < n \to b < m \to a*m + b < n*m.
695 [intros.apply False_ind.apply (not_le_Sn_O ? H)
699 change with (S b+a*m1 \leq m1+m*m1).
703 [apply le_S_S_to_le.assumption
710 (************************** minus ******************************)
714 [ O ⇒
\ 5a href="cic:/matita/arithmetics/nat/nat.con(0,1,0)"
\ 6O
\ 5/a
\ 6
717 [ O ⇒
\ 5a href="cic:/matita/arithmetics/nat/nat.con(0,2,0)"
\ 6S
\ 5/a
\ 6 p
718 | S q ⇒ minus p q ]].
720 interpretation "natural minus" 'minus x y = (minus x y).
722 theorem minus_S_S: ∀n,m:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6.
\ 5a href="cic:/matita/arithmetics/nat/nat.con(0,2,0)"
\ 6S
\ 5/a
\ 6 n
\ 5a title="natural minus" href="cic:/fakeuri.def(1)"
\ 6-
\ 5/a
\ 6 \ 5a href="cic:/matita/arithmetics/nat/nat.con(0,2,0)"
\ 6S
\ 5/a
\ 6 m
\ 5a title="leibnitz's equality" href="cic:/fakeuri.def(1)"
\ 6=
\ 5/a
\ 6 n
\ 5a title="natural minus" href="cic:/fakeuri.def(1)"
\ 6-
\ 5/a
\ 6m.
725 theorem minus_O_n: ∀n:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6.
\ 5a href="cic:/matita/arithmetics/nat/nat.con(0,1,0)"
\ 6O
\ 5/a
\ 6\ 5a title="leibnitz's equality" href="cic:/fakeuri.def(1)"
\ 6=
\ 5/a
\ 6\ 5a href="cic:/matita/arithmetics/nat/nat.con(0,1,0)"
\ 6O
\ 5/a
\ 6\ 5a title="natural minus" href="cic:/fakeuri.def(1)"
\ 6-
\ 5/a
\ 6n.
728 theorem minus_n_O: ∀n:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6.n
\ 5a title="leibnitz's equality" href="cic:/fakeuri.def(1)"
\ 6=
\ 5/a
\ 6n
\ 5a title="natural minus" href="cic:/fakeuri.def(1)"
\ 6-
\ 5/a
\ 6\ 5a href="cic:/matita/arithmetics/nat/nat.con(0,1,0)"
\ 6O
\ 5/a
\ 6.
731 theorem minus_n_n: ∀n:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6.
\ 5a href="cic:/matita/arithmetics/nat/nat.con(0,1,0)"
\ 6O
\ 5/a
\ 6\ 5a title="leibnitz's equality" href="cic:/fakeuri.def(1)"
\ 6=
\ 5/a
\ 6n
\ 5a title="natural minus" href="cic:/fakeuri.def(1)"
\ 6-
\ 5/a
\ 6n.
734 theorem minus_Sn_n: ∀n:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6.
\ 5a href="cic:/matita/arithmetics/nat/nat.con(0,2,0)"
\ 6S
\ 5/a
\ 6 \ 5a href="cic:/matita/arithmetics/nat/nat.con(0,1,0)"
\ 6O
\ 5/a
\ 6 \ 5a title="leibnitz's equality" href="cic:/fakeuri.def(1)"
\ 6=
\ 5/a
\ 6 (
\ 5a href="cic:/matita/arithmetics/nat/nat.con(0,2,0)"
\ 6S
\ 5/a
\ 6 n)
\ 5a title="natural minus" href="cic:/fakeuri.def(1)"
\ 6-
\ 5/a
\ 6n.
735 #n (elim n) normalize // qed.
737 theorem minus_Sn_m: ∀m,n:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6. m
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 n →
\ 5a href="cic:/matita/arithmetics/nat/nat.con(0,2,0)"
\ 6S
\ 5/a
\ 6 n
\ 5a title="natural minus" href="cic:/fakeuri.def(1)"
\ 6-
\ 5/a
\ 6m
\ 5a title="leibnitz's equality" href="cic:/fakeuri.def(1)"
\ 6=
\ 5/a
\ 6 \ 5a href="cic:/matita/arithmetics/nat/nat.con(0,2,0)"
\ 6S
\ 5/a
\ 6 (n
\ 5a title="natural minus" href="cic:/fakeuri.def(1)"
\ 6-
\ 5/a
\ 6m).
738 (* qualcosa da capire qui
739 #n #m #lenm nelim lenm napplyS refl_eq. *)
740 @
\ 5a href="cic:/matita/arithmetics/nat/nat_elim2.def(2)"
\ 6nat_elim2
\ 5/a
\ 6
742 |#n #abs @
\ 5a href="cic:/matita/basics/logic/False_ind.fix(0,1,1)"
\ 6False_ind
\ 5/a
\ 6 /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/basics/logic/absurd.def(2)"
\ 6absurd
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/
743 |#n #m #Hind #c applyS Hind /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/monotonic_pred.def(4)"
\ 6monotonic_pred
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/
748 theorem not_eq_to_le_to_le_minus:
749 ∀n,m.n ≠ m → n ≤ m → n ≤ m - 1.
750 #n * #m (cases m// #m normalize
751 #H #H1 napply le_S_S_to_le
752 napplyS (not_eq_to_le_to_lt n (S m) H H1)
755 theorem eq_minus_S_pred: ∀n,m. n
\ 5a title="natural minus" href="cic:/fakeuri.def(1)"
\ 6-
\ 5/a
\ 6 (
\ 5a href="cic:/matita/arithmetics/nat/nat.con(0,2,0)"
\ 6S
\ 5/a
\ 6 m)
\ 5a title="leibnitz's equality" href="cic:/fakeuri.def(1)"
\ 6=
\ 5/a
\ 6 \ 5a href="cic:/matita/arithmetics/nat/pred.def(1)"
\ 6pred
\ 5/a
\ 6(n
\ 5a title="natural minus" href="cic:/fakeuri.def(1)"
\ 6-
\ 5/a
\ 6m).
756 @
\ 5a href="cic:/matita/arithmetics/nat/nat_elim2.def(2)"
\ 6nat_elim2
\ 5/a
\ 6 normalize //
760 ∀m,n,p:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6. m
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 n → (n
\ 5a title="natural minus" href="cic:/fakeuri.def(1)"
\ 6-
\ 5/a
\ 6m)
\ 5a title="natural plus" href="cic:/fakeuri.def(1)"
\ 6+
\ 5/a
\ 6p
\ 5a title="leibnitz's equality" href="cic:/fakeuri.def(1)"
\ 6=
\ 5/a
\ 6 (n
\ 5a title="natural plus" href="cic:/fakeuri.def(1)"
\ 6+
\ 5/a
\ 6p)
\ 5a title="natural minus" href="cic:/fakeuri.def(1)"
\ 6-
\ 5/a
\ 6m.
761 @
\ 5a href="cic:/matita/arithmetics/nat/nat_elim2.def(2)"
\ 6nat_elim2
\ 5/a
\ 6
763 |#n #p #abs @
\ 5a href="cic:/matita/basics/logic/False_ind.fix(0,1,1)"
\ 6False_ind
\ 5/a
\ 6 /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/basics/logic/absurd.def(2)"
\ 6absurd
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/
764 |normalize/
\ 5span class="autotactic"
\ 63
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/monotonic_pred.def(4)"
\ 6monotonic_pred
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/
768 theorem minus_plus_m_m: ∀n,m:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6.n
\ 5a title="leibnitz's equality" href="cic:/fakeuri.def(1)"
\ 6=
\ 5/a
\ 6 (n
\ 5a title="natural plus" href="cic:/fakeuri.def(1)"
\ 6+
\ 5/a
\ 6m)
\ 5a title="natural minus" href="cic:/fakeuri.def(1)"
\ 6-
\ 5/a
\ 6m.
769 /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/le.con(0,1,1)"
\ 6le_n
\ 5/a
\ 6,
\ 5a href="cic:/matita/arithmetics/nat/plus_minus.def(5)"
\ 6plus_minus
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/ qed.
771 theorem plus_minus_m_m: ∀n,m:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6.
772 m
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 n → n
\ 5a title="leibnitz's equality" href="cic:/fakeuri.def(1)"
\ 6=
\ 5/a
\ 6 (n
\ 5a title="natural minus" href="cic:/fakeuri.def(1)"
\ 6-
\ 5/a
\ 6m)
\ 5a title="natural plus" href="cic:/fakeuri.def(1)"
\ 6+
\ 5/a
\ 6m.
773 #n #m #lemn @
\ 5a href="cic:/matita/basics/logic/sym_eq.def(2)"
\ 6sym_eq
\ 5/a
\ 6 /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/plus_minus.def(5)"
\ 6plus_minus
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/ qed.
775 theorem le_plus_minus_m_m: ∀n,m:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6. n
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 (n
\ 5a title="natural minus" href="cic:/fakeuri.def(1)"
\ 6-
\ 5/a
\ 6m)
\ 5a title="natural plus" href="cic:/fakeuri.def(1)"
\ 6+
\ 5/a
\ 6m.
776 #n (elim n) // #a #Hind #m (cases m) // normalize #n/
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/le_S_S.def(2)"
\ 6le_S_S
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/
779 theorem minus_to_plus :∀n,m,p:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6.
780 m
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 n → n
\ 5a title="natural minus" href="cic:/fakeuri.def(1)"
\ 6-
\ 5/a
\ 6m
\ 5a title="leibnitz's equality" href="cic:/fakeuri.def(1)"
\ 6=
\ 5/a
\ 6 p → n
\ 5a title="leibnitz's equality" href="cic:/fakeuri.def(1)"
\ 6=
\ 5/a
\ 6 m
\ 5a title="natural plus" href="cic:/fakeuri.def(1)"
\ 6+
\ 5/a
\ 6p.
781 #n #m #p #lemn #eqp (applyS
\ 5a href="cic:/matita/arithmetics/nat/plus_minus_m_m.def(7)"
\ 6plus_minus_m_m
\ 5/a
\ 6) //
784 theorem plus_to_minus :∀n,m,p:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6.n
\ 5a title="leibnitz's equality" href="cic:/fakeuri.def(1)"
\ 6=
\ 5/a
\ 6 m
\ 5a title="natural plus" href="cic:/fakeuri.def(1)"
\ 6+
\ 5/a
\ 6p → n
\ 5a title="natural minus" href="cic:/fakeuri.def(1)"
\ 6-
\ 5/a
\ 6m
\ 5a title="leibnitz's equality" href="cic:/fakeuri.def(1)"
\ 6=
\ 5/a
\ 6 p.
785 #n #m #p #eqp @
\ 5a href="cic:/matita/basics/logic/sym_eq.def(2)"
\ 6sym_eq
\ 5/a
\ 6 (applyS (
\ 5a href="cic:/matita/arithmetics/nat/minus_plus_m_m.def(6)"
\ 6minus_plus_m_m
\ 5/a
\ 6 p m))
788 theorem minus_pred_pred : ∀n,m:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6.
\ 5a href="cic:/matita/arithmetics/nat/nat.con(0,1,0)"
\ 6O
\ 5/a
\ 6 \ 5a title="natural 'less than'" href="cic:/fakeuri.def(1)"
\ 6<
\ 5/a
\ 6 n →
\ 5a href="cic:/matita/arithmetics/nat/nat.con(0,1,0)"
\ 6O
\ 5/a
\ 6 \ 5a title="natural 'less than'" href="cic:/fakeuri.def(1)"
\ 6<
\ 5/a
\ 6 m →
789 \ 5a href="cic:/matita/arithmetics/nat/pred.def(1)"
\ 6pred
\ 5/a
\ 6 n
\ 5a title="natural minus" href="cic:/fakeuri.def(1)"
\ 6-
\ 5/a
\ 6 \ 5a href="cic:/matita/arithmetics/nat/pred.def(1)"
\ 6pred
\ 5/a
\ 6 m
\ 5a title="leibnitz's equality" href="cic:/fakeuri.def(1)"
\ 6=
\ 5/a
\ 6 n
\ 5a title="natural minus" href="cic:/fakeuri.def(1)"
\ 6-
\ 5/a
\ 6 m.
790 #n #m #posn #posm @(
\ 5a href="cic:/matita/arithmetics/nat/lt_O_n_elim.def(4)"
\ 6lt_O_n_elim
\ 5/a
\ 6 n posn) @(
\ 5a href="cic:/matita/arithmetics/nat/lt_O_n_elim.def(4)"
\ 6lt_O_n_elim
\ 5/a
\ 6 m posm) //.
796 theorem le_SO_minus: \forall n,m:nat.S n \leq m \to S O \leq m-n.
797 intros.elim H.elim (minus_Sn_n n).apply le_n.
798 rewrite > minus_Sn_m.
799 apply le_S.assumption.
800 apply lt_to_le.assumption.
803 theorem minus_le_S_minus_S: \forall n,m:nat. m-n \leq S (m-(S n)).
805 apply (nat_elim2 (\lambda n,m.m-n \leq S (m-(S n)))).
806 intro.elim n1.simplify.apply le_n_Sn.
807 simplify.rewrite < minus_n_O.apply le_n.
808 intros.simplify.apply le_n_Sn.
809 intros.simplify.apply H.
812 theorem lt_minus_S_n_to_le_minus_n : \forall n,m,p:nat. m-(S n) < p \to m-n \leq p.
815 (* end auto($Revision: 9739 $) proof: TIME=1.33 SIZE=100 DEPTH=100 *)
816 apply (trans_le (m-n) (S (m-(S n))) p).
817 apply minus_le_S_minus_S.
821 theorem le_minus_m: \forall n,m:nat. n-m \leq n.
822 intros.apply (nat_elim2 (\lambda m,n. n-m \leq n)).
823 intros.rewrite < minus_n_O.apply le_n.
824 intros.simplify.apply le_n.
825 intros.simplify.apply le_S.assumption.
828 theorem lt_minus_m: \forall n,m:nat. O < n \to O < m \to n-m \lt n.
829 intros.apply (lt_O_n_elim n H).intro.
830 apply (lt_O_n_elim m H1).intro.
831 simplify.unfold lt.apply le_S_S.apply le_minus_m.
834 theorem minus_le_O_to_le: \forall n,m:nat. n-m \leq O \to n \leq m.
836 apply (nat_elim2 (\lambda n,m:nat.n-m \leq O \to n \leq m)).
838 simplify.intros. assumption.
839 simplify.intros.apply le_S_S.apply H.assumption.
843 (* monotonicity and galois *)
845 theorem monotonic_le_minus_l:
846 ∀p,q,n:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6. q
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 p → q
\ 5a title="natural minus" href="cic:/fakeuri.def(1)"
\ 6-
\ 5/a
\ 6n
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 p
\ 5a title="natural minus" href="cic:/fakeuri.def(1)"
\ 6-
\ 5/a
\ 6n.
847 @
\ 5a href="cic:/matita/arithmetics/nat/nat_elim2.def(2)"
\ 6nat_elim2
\ 5/a
\ 6 #p #q
848 [#lePO @(
\ 5a href="cic:/matita/arithmetics/nat/le_n_O_elim.def(4)"
\ 6le_n_O_elim
\ 5/a
\ 6 ? lePO) //
850 |#Hind #n (cases n) // #a #leSS @Hind /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/monotonic_pred.def(4)"
\ 6monotonic_pred
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/
854 theorem le_minus_to_plus: ∀n,m,p. n
\ 5a title="natural minus" href="cic:/fakeuri.def(1)"
\ 6-
\ 5/a
\ 6m
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 p → n
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 p
\ 5a title="natural plus" href="cic:/fakeuri.def(1)"
\ 6+
\ 5/a
\ 6m.
855 #n #m #p #lep @
\ 5a href="cic:/matita/arithmetics/nat/transitive_le.def(3)"
\ 6transitive_le
\ 5/a
\ 6
856 [|@
\ 5a href="cic:/matita/arithmetics/nat/le_plus_minus_m_m.def(9)"
\ 6le_plus_minus_m_m
\ 5/a
\ 6 | @
\ 5a href="cic:/matita/arithmetics/nat/monotonic_le_plus_l.def(6)"
\ 6monotonic_le_plus_l
\ 5/a
\ 6 // ]
859 theorem le_minus_to_plus_r: ∀a,b,c. c
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 b → a
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 b
\ 5a title="natural minus" href="cic:/fakeuri.def(1)"
\ 6-
\ 5/a
\ 6 c → a
\ 5a title="natural plus" href="cic:/fakeuri.def(1)"
\ 6+
\ 5/a
\ 6 c
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 b.
860 #a #b #c #Hlecb #H >(
\ 5a href="cic:/matita/arithmetics/nat/plus_minus_m_m.def(7)"
\ 6plus_minus_m_m
\ 5/a
\ 6 … Hlecb) /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/le_minus_to_plus.def(10)"
\ 6le_minus_to_plus
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/
863 theorem le_plus_to_minus: ∀n,m,p. n
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 p
\ 5a title="natural plus" href="cic:/fakeuri.def(1)"
\ 6+
\ 5/a
\ 6m → n
\ 5a title="natural minus" href="cic:/fakeuri.def(1)"
\ 6-
\ 5/a
\ 6m
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 p.
864 #n #m #p #lep /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/monotonic_le_minus_l.def(9)"
\ 6monotonic_le_minus_l
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/ qed.
866 theorem le_plus_to_minus_r: ∀a,b,c. a
\ 5a title="natural plus" href="cic:/fakeuri.def(1)"
\ 6+
\ 5/a
\ 6 b
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 c → a
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 c
\ 5a title="natural minus" href="cic:/fakeuri.def(1)"
\ 6-
\ 5/a
\ 6b.
867 #a #b #c #H @(
\ 5a href="cic:/matita/arithmetics/nat/le_plus_to_le_r.def(6)"
\ 6le_plus_to_le_r
\ 5/a
\ 6 … b) /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/transitive_le.def(3)"
\ 6transitive_le
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/
870 theorem lt_minus_to_plus: ∀a,b,c. a
\ 5a title="natural minus" href="cic:/fakeuri.def(1)"
\ 6-
\ 5/a
\ 6 b
\ 5a title="natural 'less than'" href="cic:/fakeuri.def(1)"
\ 6<
\ 5/a
\ 6 c → a
\ 5a title="natural 'less than'" href="cic:/fakeuri.def(1)"
\ 6<
\ 5/a
\ 6 c
\ 5a title="natural plus" href="cic:/fakeuri.def(1)"
\ 6+
\ 5/a
\ 6 b.
871 #a #b #c #H @
\ 5a href="cic:/matita/arithmetics/nat/not_le_to_lt.def(5)"
\ 6not_le_to_lt
\ 5/a
\ 6
872 @(
\ 5a href="cic:/matita/basics/logic/not_to_not.def(3)"
\ 6not_to_not
\ 5/a
\ 6 … (
\ 5a href="cic:/matita/arithmetics/nat/lt_to_not_le.def(7)"
\ 6lt_to_not_le
\ 5/a
\ 6 …H)) /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/le_plus_to_minus_r.def(10)"
\ 6le_plus_to_minus_r
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/
875 theorem lt_minus_to_plus_r: ∀a,b,c. a
\ 5a title="natural 'less than'" href="cic:/fakeuri.def(1)"
\ 6<
\ 5/a
\ 6 b
\ 5a title="natural minus" href="cic:/fakeuri.def(1)"
\ 6-
\ 5/a
\ 6 c → a
\ 5a title="natural plus" href="cic:/fakeuri.def(1)"
\ 6+
\ 5/a
\ 6 c
\ 5a title="natural 'less than'" href="cic:/fakeuri.def(1)"
\ 6<
\ 5/a
\ 6 b.
876 #a #b #c #H @
\ 5a href="cic:/matita/arithmetics/nat/not_le_to_lt.def(5)"
\ 6not_le_to_lt
\ 5/a
\ 6 @(
\ 5a href="cic:/matita/basics/logic/not_to_not.def(3)"
\ 6not_to_not
\ 5/a
\ 6 … (
\ 5a href="cic:/matita/arithmetics/nat/le_plus_to_minus.def(10)"
\ 6le_plus_to_minus
\ 5/a
\ 6 …))
877 @
\ 5a href="cic:/matita/arithmetics/nat/lt_to_not_le.def(7)"
\ 6lt_to_not_le
\ 5/a
\ 6 //
880 theorem lt_plus_to_minus: ∀n,m,p. m
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 n → n
\ 5a title="natural 'less than'" href="cic:/fakeuri.def(1)"
\ 6<
\ 5/a
\ 6 p
\ 5a title="natural plus" href="cic:/fakeuri.def(1)"
\ 6+
\ 5/a
\ 6m → n
\ 5a title="natural minus" href="cic:/fakeuri.def(1)"
\ 6-
\ 5/a
\ 6m
\ 5a title="natural 'less than'" href="cic:/fakeuri.def(1)"
\ 6<
\ 5/a
\ 6 p.
881 #n #m #p #lenm #H normalize <
\ 5a href="cic:/matita/arithmetics/nat/minus_Sn_m.def(5)"
\ 6minus_Sn_m
\ 5/a
\ 6 // @
\ 5a href="cic:/matita/arithmetics/nat/le_plus_to_minus.def(10)"
\ 6le_plus_to_minus
\ 5/a
\ 6 //
884 theorem lt_plus_to_minus_r: ∀a,b,c. a
\ 5a title="natural plus" href="cic:/fakeuri.def(1)"
\ 6+
\ 5/a
\ 6 b
\ 5a title="natural 'less than'" href="cic:/fakeuri.def(1)"
\ 6<
\ 5/a
\ 6 c → a
\ 5a title="natural 'less than'" href="cic:/fakeuri.def(1)"
\ 6<
\ 5/a
\ 6 c
\ 5a title="natural minus" href="cic:/fakeuri.def(1)"
\ 6-
\ 5/a
\ 6 b.
885 #a #b #c #H @
\ 5a href="cic:/matita/arithmetics/nat/le_plus_to_minus_r.def(10)"
\ 6le_plus_to_minus_r
\ 5/a
\ 6 //
888 theorem monotonic_le_minus_r:
889 ∀p,q,n:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6. q
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 p → n
\ 5a title="natural minus" href="cic:/fakeuri.def(1)"
\ 6-
\ 5/a
\ 6p
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 n
\ 5a title="natural minus" href="cic:/fakeuri.def(1)"
\ 6-
\ 5/a
\ 6q.
890 #p #q #n #lepq @
\ 5a href="cic:/matita/arithmetics/nat/le_plus_to_minus.def(10)"
\ 6le_plus_to_minus
\ 5/a
\ 6
891 @(
\ 5a href="cic:/matita/arithmetics/nat/transitive_le.def(3)"
\ 6transitive_le
\ 5/a
\ 6 … (
\ 5a href="cic:/matita/arithmetics/nat/le_plus_minus_m_m.def(9)"
\ 6le_plus_minus_m_m
\ 5/a
\ 6 ? q)) /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/monotonic_le_plus_r.def(3)"
\ 6monotonic_le_plus_r
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/
894 theorem monotonic_lt_minus_l: ∀p,q,n. n ≤ q → q < p → q - n < p - n.
896 @lt_plus_to_minus_r <plus_minus_m_m //
899 theorem eq_minus_O: ∀n,m:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6.
900 n
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 m → n
\ 5a title="natural minus" href="cic:/fakeuri.def(1)"
\ 6-
\ 5/a
\ 6m
\ 5a title="leibnitz's equality" href="cic:/fakeuri.def(1)"
\ 6=
\ 5/a
\ 6 \ 5a href="cic:/matita/arithmetics/nat/nat.con(0,1,0)"
\ 6O
\ 5/a
\ 6.
901 #n #m #lenm @(
\ 5a href="cic:/matita/arithmetics/nat/le_n_O_elim.def(4)"
\ 6le_n_O_elim
\ 5/a
\ 6 (n
\ 5a title="natural minus" href="cic:/fakeuri.def(1)"
\ 6-
\ 5/a
\ 6m)) /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/monotonic_le_minus_r.def(11)"
\ 6monotonic_le_minus_r
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/
904 theorem distributive_times_minus:
\ 5a href="cic:/matita/basics/relations/distributive.def(1)"
\ 6distributive
\ 5/a
\ 6 ?
\ 5a href="cic:/matita/arithmetics/nat/times.fix(0,0,2)"
\ 6times
\ 5/a
\ 6 \ 5a href="cic:/matita/arithmetics/nat/minus.fix(0,0,1)"
\ 6minus
\ 5/a
\ 6.
906 (cases (
\ 5a href="cic:/matita/arithmetics/nat/decidable_lt.def(7)"
\ 6decidable_lt
\ 5/a
\ 6 b c)) #Hbc
907 [>
\ 5a href="cic:/matita/arithmetics/nat/eq_minus_O.def(12)"
\ 6eq_minus_O
\ 5/a
\ 6 /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/le_plus_b.def(8)"
\ 6le_plus_b
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/ >
\ 5a href="cic:/matita/arithmetics/nat/eq_minus_O.def(12)"
\ 6eq_minus_O
\ 5/a
\ 6 //
908 @
\ 5a href="cic:/matita/arithmetics/nat/monotonic_le_times_r.def(8)"
\ 6monotonic_le_times_r
\ 5/a
\ 6 /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/le_plus_b.def(8)"
\ 6le_plus_b
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/
909 |@
\ 5a href="cic:/matita/basics/logic/sym_eq.def(2)"
\ 6sym_eq
\ 5/a
\ 6 (applyS
\ 5a href="cic:/matita/arithmetics/nat/plus_to_minus.def(7)"
\ 6plus_to_minus
\ 5/a
\ 6) <
\ 5a href="cic:/matita/arithmetics/nat/distributive_times_plus.def(7)"
\ 6distributive_times_plus
\ 5/a
\ 6
910 @
\ 5a href="cic:/matita/basics/logic/eq_f.def(3)"
\ 6eq_f
\ 5/a
\ 6 (applyS
\ 5a href="cic:/matita/arithmetics/nat/plus_minus_m_m.def(7)"
\ 6plus_minus_m_m
\ 5/a
\ 6) /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/not_lt_to_le.def(6)"
\ 6not_lt_to_le
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/
913 theorem minus_plus: ∀n,m,p. n
\ 5a title="natural minus" href="cic:/fakeuri.def(1)"
\ 6-
\ 5/a
\ 6m
\ 5a title="natural minus" href="cic:/fakeuri.def(1)"
\ 6-
\ 5/a
\ 6p
\ 5a title="leibnitz's equality" href="cic:/fakeuri.def(1)"
\ 6=
\ 5/a
\ 6 n
\ 5a title="natural minus" href="cic:/fakeuri.def(1)"
\ 6-
\ 5/a
\ 6(m
\ 5a title="natural plus" href="cic:/fakeuri.def(1)"
\ 6+
\ 5/a
\ 6p).
915 cases (
\ 5a href="cic:/matita/arithmetics/nat/decidable_le.def(6)"
\ 6decidable_le
\ 5/a
\ 6 (m
\ 5a title="natural plus" href="cic:/fakeuri.def(1)"
\ 6+
\ 5/a
\ 6p) n) #Hlt
916 [@
\ 5a href="cic:/matita/arithmetics/nat/plus_to_minus.def(7)"
\ 6plus_to_minus
\ 5/a
\ 6 @
\ 5a href="cic:/matita/arithmetics/nat/plus_to_minus.def(7)"
\ 6plus_to_minus
\ 5/a
\ 6 <
\ 5a href="cic:/matita/arithmetics/nat/associative_plus.def(4)"
\ 6associative_plus
\ 5/a
\ 6
917 @
\ 5a href="cic:/matita/arithmetics/nat/minus_to_plus.def(8)"
\ 6minus_to_plus
\ 5/a
\ 6 //
918 |cut (n
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 m
\ 5a title="natural plus" href="cic:/fakeuri.def(1)"
\ 6+
\ 5/a
\ 6p) [@(
\ 5a href="cic:/matita/arithmetics/nat/transitive_le.def(3)"
\ 6transitive_le
\ 5/a
\ 6 … (
\ 5a href="cic:/matita/arithmetics/nat/le_n_Sn.def(1)"
\ 6le_n_Sn
\ 5/a
\ 6 …)) @
\ 5a href="cic:/matita/arithmetics/nat/not_le_to_lt.def(5)"
\ 6not_le_to_lt
\ 5/a
\ 6 //]
919 #H >
\ 5a href="cic:/matita/arithmetics/nat/eq_minus_O.def(12)"
\ 6eq_minus_O
\ 5/a
\ 6 /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/eq_minus_O.def(12)"
\ 6eq_minus_O
\ 5/a
\ 6,
\ 5a href="cic:/matita/arithmetics/nat/monotonic_le_minus_l.def(9)"
\ 6monotonic_le_minus_l
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/
924 theorem plus_minus: ∀n,m,p. p ≤ m → (n+m)-p = n +(m-p).
925 #n #m #p #lepm @plus_to_minus >(commutative_plus p)
926 >associative_plus <plus_minus_m_m //
929 theorem minus_minus: ∀n,m,p:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6. p
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 m → m
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 n →
930 p
\ 5a title="natural plus" href="cic:/fakeuri.def(1)"
\ 6+
\ 5/a
\ 6(n
\ 5a title="natural minus" href="cic:/fakeuri.def(1)"
\ 6-
\ 5/a
\ 6m)
\ 5a title="leibnitz's equality" href="cic:/fakeuri.def(1)"
\ 6=
\ 5/a
\ 6 n
\ 5a title="natural minus" href="cic:/fakeuri.def(1)"
\ 6-
\ 5/a
\ 6(m
\ 5a title="natural minus" href="cic:/fakeuri.def(1)"
\ 6-
\ 5/a
\ 6p).
932 @
\ 5a href="cic:/matita/basics/logic/sym_eq.def(2)"
\ 6sym_eq
\ 5/a
\ 6 @
\ 5a href="cic:/matita/arithmetics/nat/plus_to_minus.def(7)"
\ 6plus_to_minus
\ 5/a
\ 6 <
\ 5a href="cic:/matita/arithmetics/nat/associative_plus.def(4)"
\ 6associative_plus
\ 5/a
\ 6 <
\ 5a href="cic:/matita/arithmetics/nat/plus_minus_m_m.def(7)"
\ 6plus_minus_m_m
\ 5/a
\ 6 //
933 <
\ 5a href="cic:/matita/arithmetics/nat/commutative_plus.def(5)"
\ 6commutative_plus
\ 5/a
\ 6 <
\ 5a href="cic:/matita/arithmetics/nat/plus_minus_m_m.def(7)"
\ 6plus_minus_m_m
\ 5/a
\ 6 //
936 (*********************** boolean arithmetics ********************)
937 include "basics/bool.ma".
941 [ O ⇒ match m with [ O ⇒
\ 5a href="cic:/matita/basics/bool/bool.con(0,1,0)"
\ 6true
\ 5/a
\ 6 | S q ⇒
\ 5a href="cic:/matita/basics/bool/bool.con(0,2,0)"
\ 6false
\ 5/a
\ 6]
942 | S p ⇒ match m with [ O ⇒
\ 5a href="cic:/matita/basics/bool/bool.con(0,2,0)"
\ 6false
\ 5/a
\ 6 | S q ⇒ eqb p q]
945 theorem eqb_elim : ∀ n,m:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6.∀ P:
\ 5a href="cic:/matita/basics/bool/bool.ind(1,0,0)"
\ 6bool
\ 5/a
\ 6 → Prop.
946 (n
\ 5a title="leibnitz's equality" href="cic:/fakeuri.def(1)"
\ 6=
\ 5/a
\ 6m → (P
\ 5a href="cic:/matita/basics/bool/bool.con(0,1,0)"
\ 6true
\ 5/a
\ 6)) → (n
\ 5a title="leibnitz's non-equality" href="cic:/fakeuri.def(1)"
\ 6≠
\ 5/a
\ 6 m → (P
\ 5a href="cic:/matita/basics/bool/bool.con(0,2,0)"
\ 6false
\ 5/a
\ 6)) → (P (
\ 5a href="cic:/matita/arithmetics/nat/eqb.fix(0,0,1)"
\ 6eqb
\ 5/a
\ 6 n m)).
947 @
\ 5a href="cic:/matita/arithmetics/nat/nat_elim2.def(2)"
\ 6nat_elim2
\ 5/a
\ 6
948 [#n (cases n) normalize /
\ 5span class="autotactic"
\ 63
\ 5span class="autotrace"
\ 6 trace
\ 5/span
\ 6\ 5/span
\ 6/
949 |normalize /
\ 5span class="autotactic"
\ 63
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/basics/logic/sym_not_eq.def(4)"
\ 6sym_not_eq
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/
950 |normalize /
\ 5span class="autotactic"
\ 64
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/not_eq_S.def(4)"
\ 6not_eq_S
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/
954 theorem eqb_n_n: ∀n.
\ 5a href="cic:/matita/arithmetics/nat/eqb.fix(0,0,1)"
\ 6eqb
\ 5/a
\ 6 n n
\ 5a title="leibnitz's equality" href="cic:/fakeuri.def(1)"
\ 6=
\ 5/a
\ 6 \ 5a href="cic:/matita/basics/bool/bool.con(0,1,0)"
\ 6true
\ 5/a
\ 6.
955 #n (elim n) normalize // qed.
957 theorem eqb_true_to_eq: ∀n,m:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6.
\ 5a href="cic:/matita/arithmetics/nat/eqb.fix(0,0,1)"
\ 6eqb
\ 5/a
\ 6 n m
\ 5a title="leibnitz's equality" href="cic:/fakeuri.def(1)"
\ 6=
\ 5/a
\ 6 \ 5a href="cic:/matita/basics/bool/bool.con(0,1,0)"
\ 6true
\ 5/a
\ 6 → n
\ 5a title="leibnitz's equality" href="cic:/fakeuri.def(1)"
\ 6=
\ 5/a
\ 6 m.
958 #n #m @(
\ 5a href="cic:/matita/arithmetics/nat/eqb_elim.def(5)"
\ 6eqb_elim
\ 5/a
\ 6 n m) // #_ #abs @
\ 5a href="cic:/matita/basics/logic/False_ind.fix(0,1,1)"
\ 6False_ind
\ 5/a
\ 6 /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/basics/logic/absurd.def(2)"
\ 6absurd
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/ qed.
960 theorem eqb_false_to_not_eq: ∀n,m:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6.
\ 5a href="cic:/matita/arithmetics/nat/eqb.fix(0,0,1)"
\ 6eqb
\ 5/a
\ 6 n m
\ 5a title="leibnitz's equality" href="cic:/fakeuri.def(1)"
\ 6=
\ 5/a
\ 6 \ 5a href="cic:/matita/basics/bool/bool.con(0,2,0)"
\ 6false
\ 5/a
\ 6 → n
\ 5a title="leibnitz's non-equality" href="cic:/fakeuri.def(1)"
\ 6≠
\ 5/a
\ 6 m.
961 #n #m @(
\ 5a href="cic:/matita/arithmetics/nat/eqb_elim.def(5)"
\ 6eqb_elim
\ 5/a
\ 6 n m) /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/basics/logic/not_to_not.def(3)"
\ 6not_to_not
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/ qed.
963 theorem eq_to_eqb_true: ∀n,m:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6.n
\ 5a title="leibnitz's equality" href="cic:/fakeuri.def(1)"
\ 6=
\ 5/a
\ 6 m →
\ 5a href="cic:/matita/arithmetics/nat/eqb.fix(0,0,1)"
\ 6eqb
\ 5/a
\ 6 n m
\ 5a title="leibnitz's equality" href="cic:/fakeuri.def(1)"
\ 6=
\ 5/a
\ 6 \ 5a href="cic:/matita/basics/bool/bool.con(0,1,0)"
\ 6true
\ 5/a
\ 6.
966 theorem not_eq_to_eqb_false: ∀n,m:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6.
967 n
\ 5a title="leibnitz's non-equality" href="cic:/fakeuri.def(1)"
\ 6≠
\ 5/a
\ 6 m →
\ 5a href="cic:/matita/arithmetics/nat/eqb.fix(0,0,1)"
\ 6eqb
\ 5/a
\ 6 n m
\ 5a title="leibnitz's equality" href="cic:/fakeuri.def(1)"
\ 6=
\ 5/a
\ 6 \ 5a href="cic:/matita/basics/bool/bool.con(0,2,0)"
\ 6false
\ 5/a
\ 6.
968 #n #m #noteq @
\ 5a href="cic:/matita/arithmetics/nat/eqb_elim.def(5)"
\ 6eqb_elim
\ 5/a
\ 6// #Heq @
\ 5a href="cic:/matita/basics/logic/False_ind.fix(0,1,1)"
\ 6False_ind
\ 5/a
\ 6 /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/basics/logic/absurd.def(2)"
\ 6absurd
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/ qed.
972 [ O ⇒
\ 5a href="cic:/matita/basics/bool/bool.con(0,1,0)"
\ 6true
\ 5/a
\ 6
975 [ O ⇒
\ 5a href="cic:/matita/basics/bool/bool.con(0,2,0)"
\ 6false
\ 5/a
\ 6
978 theorem leb_elim: ∀n,m:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6. ∀P:
\ 5a href="cic:/matita/basics/bool/bool.ind(1,0,0)"
\ 6bool
\ 5/a
\ 6 → Prop.
979 (n
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 m → P
\ 5a href="cic:/matita/basics/bool/bool.con(0,1,0)"
\ 6true
\ 5/a
\ 6) → (n
\ 5a title="natural 'neither less nor equal to'" href="cic:/fakeuri.def(1)"
\ 6≰
\ 5/a
\ 6 m → P
\ 5a href="cic:/matita/basics/bool/bool.con(0,2,0)"
\ 6false
\ 5/a
\ 6) → P (
\ 5a href="cic:/matita/arithmetics/nat/leb.fix(0,0,1)"
\ 6leb
\ 5/a
\ 6 n m).
980 @
\ 5a href="cic:/matita/arithmetics/nat/nat_elim2.def(2)"
\ 6nat_elim2
\ 5/a
\ 6 normalize
981 [/
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5/span
\ 6\ 5/span
\ 6/
982 |/
\ 5span class="autotactic"
\ 63
\ 5span class="autotrace"
\ 6 trace
\ 5/span
\ 6\ 5/span
\ 6/
983 |#n #m #Hind #P #Pt #Pf @Hind
984 [#lenm @Pt @
\ 5a href="cic:/matita/arithmetics/nat/le_S_S.def(2)"
\ 6le_S_S
\ 5/a
\ 6 // |#nlenm @Pf /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/not_le_to_not_le_S_S.def(5)"
\ 6not_le_to_not_le_S_S
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/ ]
988 theorem leb_true_to_le:∀n,m.
\ 5a href="cic:/matita/arithmetics/nat/leb.fix(0,0,1)"
\ 6leb
\ 5/a
\ 6 n m
\ 5a title="leibnitz's equality" href="cic:/fakeuri.def(1)"
\ 6=
\ 5/a
\ 6 \ 5a href="cic:/matita/basics/bool/bool.con(0,1,0)"
\ 6true
\ 5/a
\ 6 → n
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 m.
989 #n #m @
\ 5a href="cic:/matita/arithmetics/nat/leb_elim.def(6)"
\ 6leb_elim
\ 5/a
\ 6 // #_ #abs @
\ 5a href="cic:/matita/basics/logic/False_ind.fix(0,1,1)"
\ 6False_ind
\ 5/a
\ 6 /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/basics/logic/absurd.def(2)"
\ 6absurd
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/ qed.
991 theorem leb_false_to_not_le:∀n,m.
992 \ 5a href="cic:/matita/arithmetics/nat/leb.fix(0,0,1)"
\ 6leb
\ 5/a
\ 6 n m
\ 5a title="leibnitz's equality" href="cic:/fakeuri.def(1)"
\ 6=
\ 5/a
\ 6 \ 5a href="cic:/matita/basics/bool/bool.con(0,2,0)"
\ 6false
\ 5/a
\ 6 → n
\ 5a title="natural 'neither less nor equal to'" href="cic:/fakeuri.def(1)"
\ 6≰
\ 5/a
\ 6 m.
993 #n #m @
\ 5a href="cic:/matita/arithmetics/nat/leb_elim.def(6)"
\ 6leb_elim
\ 5/a
\ 6 // #_ #abs @
\ 5a href="cic:/matita/basics/logic/False_ind.fix(0,1,1)"
\ 6False_ind
\ 5/a
\ 6 /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/basics/logic/absurd.def(2)"
\ 6absurd
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/ qed.
995 theorem le_to_leb_true: ∀n,m. n
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 m →
\ 5a href="cic:/matita/arithmetics/nat/leb.fix(0,0,1)"
\ 6leb
\ 5/a
\ 6 n m
\ 5a title="leibnitz's equality" href="cic:/fakeuri.def(1)"
\ 6=
\ 5/a
\ 6 \ 5a href="cic:/matita/basics/bool/bool.con(0,1,0)"
\ 6true
\ 5/a
\ 6.
996 #n #m @
\ 5a href="cic:/matita/arithmetics/nat/leb_elim.def(6)"
\ 6leb_elim
\ 5/a
\ 6 // #H #H1 @
\ 5a href="cic:/matita/basics/logic/False_ind.fix(0,1,1)"
\ 6False_ind
\ 5/a
\ 6 /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/basics/logic/absurd.def(2)"
\ 6absurd
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/ qed.
998 theorem not_le_to_leb_false: ∀n,m. n
\ 5a title="natural 'neither less nor equal to'" href="cic:/fakeuri.def(1)"
\ 6≰
\ 5/a
\ 6 m →
\ 5a href="cic:/matita/arithmetics/nat/leb.fix(0,0,1)"
\ 6leb
\ 5/a
\ 6 n m
\ 5a title="leibnitz's equality" href="cic:/fakeuri.def(1)"
\ 6=
\ 5/a
\ 6 \ 5a href="cic:/matita/basics/bool/bool.con(0,2,0)"
\ 6false
\ 5/a
\ 6.
999 #n #m @
\ 5a href="cic:/matita/arithmetics/nat/leb_elim.def(6)"
\ 6leb_elim
\ 5/a
\ 6 // #H #H1 @
\ 5a href="cic:/matita/basics/logic/False_ind.fix(0,1,1)"
\ 6False_ind
\ 5/a
\ 6 /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/basics/logic/absurd.def(2)"
\ 6absurd
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/ qed.
1001 theorem lt_to_leb_false: ∀n,m. m
\ 5a title="natural 'less than'" href="cic:/fakeuri.def(1)"
\ 6<
\ 5/a
\ 6 n →
\ 5a href="cic:/matita/arithmetics/nat/leb.fix(0,0,1)"
\ 6leb
\ 5/a
\ 6 n m
\ 5a title="leibnitz's equality" href="cic:/fakeuri.def(1)"
\ 6=
\ 5/a
\ 6 \ 5a href="cic:/matita/basics/bool/bool.con(0,2,0)"
\ 6false
\ 5/a
\ 6.
1002 /
\ 5span class="autotactic"
\ 63
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/lt_to_not_le.def(7)"
\ 6lt_to_not_le
\ 5/a
\ 6,
\ 5a href="cic:/matita/arithmetics/nat/not_le_to_leb_false.def(7)"
\ 6not_le_to_leb_false
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/ qed.
1005 ndefinition ltb ≝λn,m. leb (S n) m.
1007 theorem ltb_elim: ∀n,m:nat. ∀P:bool → Prop.
1008 (n < m → P true) → (n ≮ m → P false) → P (ltb n m).
1010 napply leb_elim /3/ qed.
1012 theorem ltb_true_to_lt:∀n,m.ltb n m = true → n < m.
1013 #n #m #Hltb napply leb_true_to_le nassumption
1016 theorem ltb_false_to_not_lt:∀n,m.
1017 ltb n m = false → n ≮ m.
1018 #n #m #Hltb napply leb_false_to_not_le nassumption
1021 theorem lt_to_ltb_true: ∀n,m. n < m → ltb n m = true.
1022 #n #m #Hltb napply le_to_leb_true nassumption
1025 theorem le_to_ltb_false: ∀n,m. m \le n → ltb n m = false.
1026 #n #m #Hltb napply lt_to_leb_false /2/
1030 definition min:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6 →
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6 →
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6 ≝
1031 λn.λm. if (
\ 5a href="cic:/matita/arithmetics/nat/leb.fix(0,0,1)"
\ 6leb
\ 5/a
\ 6 n m) then n else m.
1033 definition max:
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6 →
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6 →
\ 5a href="cic:/matita/arithmetics/nat/nat.ind(1,0,0)"
\ 6nat
\ 5/a
\ 6 ≝
1034 λn.λm. if (
\ 5a href="cic:/matita/arithmetics/nat/leb.fix(0,0,1)"
\ 6leb
\ 5/a
\ 6 n m) then m else n.
1036 lemma commutative_min:
\ 5a href="cic:/matita/basics/relations/commutative.def(1)"
\ 6commutative
\ 5/a
\ 6 ?
\ 5a href="cic:/matita/arithmetics/nat/min.def(2)"
\ 6min
\ 5/a
\ 6.
1037 #n #m normalize @
\ 5a href="cic:/matita/arithmetics/nat/leb_elim.def(6)"
\ 6leb_elim
\ 5/a
\ 6
1038 [@
\ 5a href="cic:/matita/arithmetics/nat/leb_elim.def(6)"
\ 6leb_elim
\ 5/a
\ 6 normalize /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/le_to_le_to_eq.def(5)"
\ 6le_to_le_to_eq
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/
1039 |#notle >(
\ 5a href="cic:/matita/arithmetics/nat/le_to_leb_true.def(7)"
\ 6le_to_leb_true
\ 5/a
\ 6 …) // @(
\ 5a href="cic:/matita/arithmetics/nat/transitive_le.def(3)"
\ 6transitive_le
\ 5/a
\ 6 ? (
\ 5a href="cic:/matita/arithmetics/nat/nat.con(0,2,0)"
\ 6S
\ 5/a
\ 6 m)) /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/not_le_to_lt.def(5)"
\ 6not_le_to_lt
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/
1042 lemma le_minr: ∀i,n,m. i
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 \ 5a href="cic:/matita/arithmetics/nat/min.def(2)"
\ 6min
\ 5/a
\ 6 n m → i
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 m.
1043 #i #n #m normalize @
\ 5a href="cic:/matita/arithmetics/nat/leb_elim.def(6)"
\ 6leb_elim
\ 5/a
\ 6 normalize /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/transitive_le.def(3)"
\ 6transitive_le
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/ qed.
1045 lemma le_minl: ∀i,n,m. i
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 \ 5a href="cic:/matita/arithmetics/nat/min.def(2)"
\ 6min
\ 5/a
\ 6 n m → i
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 n.
1046 /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/le_minr.def(7)"
\ 6le_minr
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/ qed.
1048 lemma to_min: ∀i,n,m. i
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 n → i
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 m → i
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 \ 5a href="cic:/matita/arithmetics/nat/min.def(2)"
\ 6min
\ 5/a
\ 6 n m.
1049 #i #n #m #lein #leim normalize (cases (
\ 5a href="cic:/matita/arithmetics/nat/leb.fix(0,0,1)"
\ 6leb
\ 5/a
\ 6 n m))
1052 lemma commutative_max:
\ 5a href="cic:/matita/basics/relations/commutative.def(1)"
\ 6commutative
\ 5/a
\ 6 ?
\ 5a href="cic:/matita/arithmetics/nat/max.def(2)"
\ 6max
\ 5/a
\ 6.
1053 #n #m normalize @
\ 5a href="cic:/matita/arithmetics/nat/leb_elim.def(6)"
\ 6leb_elim
\ 5/a
\ 6
1054 [@
\ 5a href="cic:/matita/arithmetics/nat/leb_elim.def(6)"
\ 6leb_elim
\ 5/a
\ 6 normalize /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/le_to_le_to_eq.def(5)"
\ 6le_to_le_to_eq
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/
1055 |#notle >(
\ 5a href="cic:/matita/arithmetics/nat/le_to_leb_true.def(7)"
\ 6le_to_leb_true
\ 5/a
\ 6 …) // @(
\ 5a href="cic:/matita/arithmetics/nat/transitive_le.def(3)"
\ 6transitive_le
\ 5/a
\ 6 ? (
\ 5a href="cic:/matita/arithmetics/nat/nat.con(0,2,0)"
\ 6S
\ 5/a
\ 6 m)) /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/not_le_to_lt.def(5)"
\ 6not_le_to_lt
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/
1058 lemma le_maxl: ∀i,n,m.
\ 5a href="cic:/matita/arithmetics/nat/max.def(2)"
\ 6max
\ 5/a
\ 6 n m
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 i → n
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 i.
1059 #i #n #m normalize @
\ 5a href="cic:/matita/arithmetics/nat/leb_elim.def(6)"
\ 6leb_elim
\ 5/a
\ 6 normalize /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/transitive_le.def(3)"
\ 6transitive_le
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/ qed.
1061 lemma le_maxr: ∀i,n,m.
\ 5a href="cic:/matita/arithmetics/nat/max.def(2)"
\ 6max
\ 5/a
\ 6 n m
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 i → m
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 i.
1062 /
\ 5span class="autotactic"
\ 62
\ 5span class="autotrace"
\ 6 trace
\ 5a href="cic:/matita/arithmetics/nat/le_maxl.def(7)"
\ 6le_maxl
\ 5/a
\ 6\ 5/span
\ 6\ 5/span
\ 6/ qed.
1064 lemma to_max: ∀i,n,m. n
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 i → m
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 i →
\ 5a href="cic:/matita/arithmetics/nat/max.def(2)"
\ 6max
\ 5/a
\ 6 n m
\ 5a title="natural 'less or equal to'" href="cic:/fakeuri.def(1)"
\ 6≤
\ 5/a
\ 6 i.
1065 #i #n #m #leni #lemi normalize (cases (
\ 5a href="cic:/matita/arithmetics/nat/leb.fix(0,0,1)"
\ 6leb
\ 5/a
\ 6 n m))