]> matita.cs.unibo.it Git - helm.git/blobdiff - matita/matita/contribs/lambdadelta/ground/arith/nat_max.ma
update in ground
[helm.git] / matita / matita / contribs / lambdadelta / ground / arith / nat_max.ma
index 0032637b1d75bae73cb1322a59898b75969c9988..cb902736e1de5bbc7c1c02d33a2a79d4fadc4fad 100644 (file)
@@ -12,7 +12,6 @@
 (*                                                                        *)
 (**************************************************************************)
 
-include "ground/notation/functions/zero_0.ma".
 include "ground/arith/nat_succ_tri.ma".
 
 (* MAXIMUM FOR NON-NEGATIVE INTEGERS ****************************************)
@@ -25,7 +24,7 @@ interpretation
   "maximum (non-negative integers)"
   'or m n = (nmax m n).
 
-(* Basic rewrites ***********************************************************)
+(* Basic constructions ******************************************************)
 
 (*** max_O1 *)
 lemma nmax_zero_sn (n2): n2 = (๐ŸŽ โˆจ n2).
@@ -40,11 +39,11 @@ qed.
 (*** max_SS *)
 lemma nmax_succ_bi (n1) (n2): โ†‘(n1 โˆจ n2) = (โ†‘n1 โˆจ โ†‘n2).
 #n1 #n2
-@trans_eq [3: @ntri_succ_bi | skip ] (**) (* rewrite fails because ฮด-expansion  gets in the way *)
+@trans_eq [3: @ntri_succ_bi | skip ] (* * rewrite fails because ฮด-expansion gets in the way *)
 <ntri_f_tri //
 qed.
 
-(* Advanced rewrites ********************************************************)
+(* Advanced constructions ***************************************************)
 
 (*** idempotent_max *)
 lemma nmax_idem (n): n = (n โˆจ n).
@@ -52,22 +51,27 @@ lemma nmax_idem (n): n = (n โˆจ n).
 
 (*** commutative_max *)
 lemma nmax_comm: commutative โ€ฆ nmax.
-#m #n @(nat_ind_2 โ€ฆ m n) -m -n //
+#m #n @(nat_ind_2_succ โ€ฆ m n) -m -n //
 qed-.
 
 (*** associative_max *)
 lemma nmax_assoc: associative โ€ฆ nmax.
-#n1 elim n1 -n1 //
-#n1 #IH #n2 elim n2 -n2 //
-#n2 #_ #n3 elim n3 -n3 //
-qed-.
+#n1 #n2 @(nat_ind_2_succ โ€ฆ n1 n2) -n1 -n2 //
+#n1 #n2 #IH #n3 @(nat_ind_succ โ€ฆ n3) -n3 //
+qed.
+
+lemma nmax_max_comm_23 (o:nat) (m) (n): (o โˆจ m โˆจ n) = (o โˆจ n โˆจ m).
+#o #m #n >nmax_assoc >nmax_assoc <nmax_comm in โŠข (??(??%)?); //
+qed.
 
 (* Basic inversions *********************************************************)
 
-(*** max_inv_O3 *)
-lemma nmax_inv_zero (n1) (n2): ๐ŸŽ = (n1 โˆจ n2) โ†’ โˆงโˆง ๐ŸŽ = n1 & ๐ŸŽ = n2.
-#n1 elim n1 -n1 [ /2 width=1 by conj/ ]
-#n1 #_ #n2 elim n2 -n2 [ /2 width=1 by conj/ ]
-#n2 #_ <nmax_succ_bi #H
-elim (eq_inv_nzero_succ โ€ฆ H)
+lemma eq_inv_zero_nmax (n1) (n2): ๐ŸŽ = (n1 โˆจ n2) โ†’ โˆงโˆง ๐ŸŽ = n1 & ๐ŸŽ = n2.
+#n1 #n2 @(nat_ind_2_succ โ€ฆ n1 n2) -n1 -n2 /2 width=1 by conj/
+#n1 #n2 #_ <nmax_succ_bi #H
+elim (eq_inv_zero_nsucc โ€ฆ H)
 qed-.
+
+(*** max_inv_O3 *)
+lemma eq_inv_nmax_zero (n1) (n2): (n1 โˆจ n2) = ๐ŸŽ โ†’ โˆงโˆง ๐ŸŽ = n1 & ๐ŸŽ = n2.
+/2 width=1 by eq_inv_zero_nmax/ qed-.