apply fle_plusr; assumption;
qed.
-lemma ge_pow: ∀G:todgroup.∀x:G.∀n.0 < pow ? x n → 0 < x.
+lemma gt_pow: ∀G:todgroup.∀x:G.∀n.0 < pow ? x n → 0 < x.
intros 3; elim n; [
simplify in l; cases (lt_coreflexive ?? l);]
simplify in l;
cut (0+0<x+(x)\sup(n1));[2:
apply (lt_rewl ??? 0 (zero_neutral ??)); assumption].
-cases (pippo4 ????? Hcut); [assumption]
+cases (ltplus_orlt ????? Hcut); [assumption]
apply f; assumption;
qed.
+lemma gt_pow2: ∀G:dgroup.∀x,y:G.∀n.pow ? x n + pow ? y n ≈ pow ? (x+y) n.
+intros (G x y n); elim n; [apply (Eq≈ 0 (zero_neutral ??)); apply eq_reflexive]
+simplify; apply (Eq≈ (x+y+((x)\sup(n1)+(y)\sup(n1)))); [
+ apply (Eq≈ (x+((x)\sup(n1)+(y+(y)\sup(n1))))); [
+ apply eq_sym; apply plus_assoc;]
+ apply (Eq≈ (x+((x)\sup(n1)+y+(y)\sup(n1)))); [
+ apply feq_plusl; apply plus_assoc;]
+ apply (Eq≈ (x+(y+(x)\sup(n1)+(y)\sup(n1)))); [
+ apply feq_plusl; apply feq_plusr; apply plus_comm;]
+ apply (Eq≈ (x+(y+((x)\sup(n1)+(y)\sup(n1))))); [
+ apply feq_plusl; apply eq_sym; apply plus_assoc;]
+ apply plus_assoc;]
+apply feq_plusl; assumption;
+qed.
+
+lemma xxxx: ∀E:abelian_group.∀x,a,y,b:E.x + a # y + b → x # y ∨ a # b.
+intros; cases (ap_cotransitive ??? (y+a) a1); [left|right]
+[apply (plus_cancr_ap ??? a)|apply (plus_cancl_ap ??? y)]
+assumption;
+qed.
+
+lemma pow_gt0: ∀G:todgroup.∀y:G.∀n.0 < y → 0 < pow ? y (S n).
+intros (G y n H); elim n; [apply (lt_rewr ??? (0+y) (plus_comm ???)); apply (lt_rewr ??? y (zero_neutral ??)); apply H]
+simplify; apply (lt_rewl ? 0 ? (0+0) (zero_neutral ? 0));
+apply ltplus; assumption;
+qed.
+
lemma divide_preserves_lt: ∀G:todgroup.∀e:G.∀n.0<e → 0 < e/n.
intros; elim n; [apply (lt_rewr ???? (div1 ??));assumption]
unfold divide; elim (dg_prop G e (S n1)); simplify; simplify in f;
-apply (ge_pow ?? (S (S n1))); apply (lt_rewr ???? f); assumption;
+apply (gt_pow ?? (S (S n1))); apply (lt_rewr ???? f); assumption;
+qed.
+
+
+lemma bar1: ∀G:togroup.∀x,y:G.∀n.pow ? x (S n) # pow ? y (S n) → x # y.
+intros 4 (G x y n); elim n; [2:
+ simplify in a;
+ cases (xxxx ????? a); [assumption]
+ apply f; assumption;]
+apply (plus_cancr_ap ??? 0); assumption;
+qed.
+
+
+lemma foo: ∀G:todgroup.∀x,y:G.∀n.
+x < y → x\sup (S n) < y\sup (S n).
+intros; elim n; [simplify; apply flt_plusr; assumption]
+simplify; apply (ltplus); [assumption] assumption;
+qed.
+
+lemma foo1: ∀G:todgroup.∀x,y:G.∀n.
+x\sup (S n) < y\sup (S n) → x < y.
+intros 4; elim n; [apply (plus_cancr_lt ??? 0); assumption]
+simplify in l; cases (ltplus_orlt ????? l); [assumption]
+apply f; assumption;
+qed.
+
+alias num (instance 0) = "natural number".
+lemma foo3: ∀G:todgroup.∀x,y:G.
+ 0<x → 0<y → x\sup 3 ≈ y\sup 4 → y < x.
+intros (G x y H1 H2 H3); apply (foo1 ??? 2); apply (lt_rewr ???? H3);
+simplify; repeat apply flt_plusl; apply (lt_rewr ???? (plus_comm ???));
+apply (lt_rewr ???? (zero_neutral ??)); assumption;
qed.
alias num (instance 0) = "natural number".
-axiom core1: ∀G:todgroup.∀e:G.0<e → e/3 + e/2 + e/2 < e.
+lemma core1: ∀G:todgroup.∀e:G.0<e → e/3 + e/2 + e/2 < e.
+intro G; cases G; unfold divide; intro e;
+cases (dg_prop (mk_todgroup todg_order todg_division_ H) e 3) 0;
+cases (dg_prop (mk_todgroup todg_order todg_division_ H) e 2) 0; simplify;
+intro H3;
+cut (0<w1\sup 3); [2: apply (lt_rewr ???? H2); assumption]
+cut (0<w\sup 4); [2: apply (lt_rewr ???? H1); assumption]
+lapply (gt_pow ??? Hcut) as H4;
+lapply (gt_pow ??? Hcut1) as H5;
+(* elim (eq_le_le ??? H1); elim (eq_le_le ??? H2); *)
+cut (w<w1);[2: apply foo3; try assumption; apply (Eq≈ ? H2 H1);]
+apply (plus_cancr_lt ??? w1);
+apply (lt_rewl ??? (w+e)); [
+ apply (Eq≈ (w+w1\sup 3) ? H2);
+ apply (Eq≈ (w+w1+(w1+w1)) (plus_assoc ??w1 w1));
+ apply (Eq≈ (w+(w1+(w1+w1))) (plus_assoc ?w w1 ?));
+ simplify; repeat apply feq_plusl; apply eq_sym;
+ apply (Eq≈ ? (plus_comm ???)); apply zero_neutral;]
+apply (lt_rewl ???? (plus_comm ???));
+apply flt_plusl; assumption;
+qed.
+
+
+
record pogroup : Type ≝ {
og_carr:> pogroup_;
- canc_plusr_exc: ∀f,g,h:og_carr. f+h ≰ g+h → f ≰ g
+ plus_cancr_exc: ∀f,g,h:og_carr. f+h ≰ g+h → f ≰ g
}.
lemma fexc_plusr:
∀G:pogroup.∀x,y,z:G. x ≰ y → x+z ≰ y + z.
-intros 5 (G x y z L); apply (canc_plusr_exc ??? (-z));
+intros 5 (G x y z L); apply (plus_cancr_exc ??? (-z));
apply (Ex≪ (x + (z + -z)) (plus_assoc ????));
apply (Ex≪ (x + (-z + z)) (plus_comm ??z));
apply (Ex≪ (x+0) (opp_inverse ??));
coercion cic:/matita/ordered_group/fexc_plusr.con nocomposites.
-lemma canc_plusl_exc: ∀G:pogroup.∀f,g,h:G. h+f ≰ h+g → f ≰ g.
-intros 5 (G x y z L); apply (canc_plusr_exc ??? z);
+lemma plus_cancl_exc: ∀G:pogroup.∀f,g,h:G. h+f ≰ h+g → f ≰ g.
+intros 5 (G x y z L); apply (plus_cancr_exc ??? z);
apply (exc_rewl ??? (z+x) (plus_comm ???));
apply (exc_rewr ??? (z+y) (plus_comm ???) L);
qed.
lemma fexc_plusl:
∀G:pogroup.∀x,y,z:G. x ≰ y → z+x ≰ z+y.
-intros 5 (G x y z L); apply (canc_plusl_exc ??? (-z));
+intros 5 (G x y z L); apply (plus_cancl_exc ??? (-z));
apply (exc_rewl ???? (plus_assoc ??z x));
apply (exc_rewr ???? (plus_assoc ??z y));
apply (exc_rewl ??? (0+x) (opp_inverse ??));
apply (le_rewr ??? (y+(-z+z)) (opp_inverse ??));
apply (le_rewr ??? (y+(z+ -z)) (plus_comm ??z));
apply (le_rewr ??? (y+z+ -z) (plus_assoc ????));
-intro H; apply L; clear L; apply (canc_plusr_exc ??? (-z) H);
+intro H; apply L; clear L; apply (plus_cancr_exc ??? (-z) H);
qed.
lemma fle_plusl: ∀G:pogroup. ∀f,g,h:G. f≤g → h+f≤h+g.
lemma exc_opp_x_zero_to_exc_zero_x:
∀G:pogroup.∀x:G.-x ≰ 0 → 0 ≰ x.
-intros (G x H); apply (canc_plusr_exc ??? (-x));
+intros (G x H); apply (plus_cancr_exc ??? (-x));
apply (exc_rewr ???? (plus_comm ???));
apply (exc_rewr ???? (opp_inverse ??));
apply (exc_rewl ???? (zero_neutral ??) H);
lemma exc_zero_opp_x_to_exc_x_zero:
∀G:pogroup.∀x:G. 0 ≰ -x → x ≰ 0.
-intros (G x H); apply (canc_plusl_exc ??? (-x));
+intros (G x H); apply (plus_cancl_exc ??? (-x));
apply (exc_rewr ???? (plus_comm ???));
apply (exc_rewl ???? (opp_inverse ??));
apply (exc_rewr ???? (zero_neutral ??) H);
apply lexxyy_lexy; assumption;
qed.
-lemma bar: ∀G:abelian_group. ∀x,y:G. 0 # x + y → 0 #x ∨ 0#y.
+lemma applus_orap: ∀G:abelian_group. ∀x,y:G. 0 # x + y → 0 #x ∨ 0#y.
intros; cases (ap_cotransitive ??? y a); [right; assumption]
left; apply (plus_cancr_ap ??? y); apply (ap_rewl ???y (zero_neutral ??));
assumption;
qed.
-lemma pippo: ∀G:pogroup.∀a,b,c,d:G. a < b → c < d → a+c < b + d.
+lemma ltplus: ∀G:pogroup.∀a,b,c,d:G. a < b → c < d → a+c < b + d.
intros (G a b c d H1 H2);
lapply (flt_plusr ??? c H1) as H3;
apply (lt_transitive ???? H3);
apply flt_plusl; assumption;
qed.
-lemma pippo2: ∀G:pogroup.∀a,b,c,d:G. a+c ≰ b + d → a ≰ b ∨ c ≰ d.
+lemma excplus_orexc: ∀G:pogroup.∀a,b,c,d:G. a+c ≰ b + d → a ≰ b ∨ c ≰ d.
intros (G a b c d H1 H2);
cases (exc_cotransitive ??? (a + d) H1); [
- right; apply (canc_plusl_exc ??? a); assumption]
-left; apply (canc_plusr_exc ??? d); assumption;
+ right; apply (plus_cancl_exc ??? a); assumption]
+left; apply (plus_cancr_exc ??? d); assumption;
qed.
-lemma pippo3: ∀G:pogroup.∀a,b,c,d:G. a ≤ b → c ≤ d → a+c ≤ b + d.
-intros (G a b c d H1 H2); intro H3; cases (pippo2 ????? H3);
+lemma leplus: ∀G:pogroup.∀a,b,c,d:G. a ≤ b → c ≤ d → a+c ≤ b + d.
+intros (G a b c d H1 H2); intro H3; cases (excplus_orexc ????? H3);
[apply H1|apply H2] assumption;
qed.
-lemma foo: ∀G:togroup.∀x,y:G. 0 ≤ x + y → x < 0 → 0 ≤ y.
+lemma leplus_lt_le: ∀G:togroup.∀x,y:G. 0 ≤ x + y → x < 0 → 0 ≤ y.
intros; intro; apply H; lapply (lt_to_excede ??? l);
lapply (tog_total ??? e);
lapply (tog_total ??? Hletin);
-lapply (pippo ????? Hletin2 Hletin1);
+lapply (ltplus ????? Hletin2 Hletin1);
apply (exc_rewl ??? (0+0)); [apply eq_sym; apply zero_neutral]
apply lt_to_excede; assumption;
qed.
-lemma pippo4: ∀G:togroup.∀a,b,c,d:G. a+c < b + d → a < b ∨ c < d.
+lemma ltplus_orlt: ∀G:togroup.∀a,b,c,d:G. a+c < b + d → a < b ∨ c < d.
intros (G a b c d H1 H2); lapply (lt_to_excede ??? H1);
-cases (pippo2 ????? Hletin); [left|right] apply tog_total; assumption;
+cases (excplus_orexc ????? Hletin); [left|right] apply tog_total; assumption;
+qed.
+
+lemma excplus: ∀G:togroup.∀a,b,c,d:G.a ≰ b → c ≰ d → a + c ≰ b + d.
+intros (G a b c d L1 L2);
+lapply (fexc_plusr ??? (c) L1) as L3;
+elim (exc_cotransitive ??? (b+d) L3); [assumption]
+lapply (plus_cancl_exc ???? t); lapply (tog_total ??? Hletin);
+cases Hletin1; cases (H L2);
qed.