(* *)
(**************************************************************************)
+include "ground_2/lib/bool.ma".
include "ground_2/lib/arith.ma".
(* ITEMS ********************************************************************)
(* Basic properties *********************************************************)
-axiom eq_item0_dec: ∀I1,I2:item0. Decidable (I1 = I2).
+lemma eq_item0_dec: ∀I1,I2:item0. Decidable (I1 = I2).
+* #i1 * #i2 [2,3,4,6,7,8: @or_intror #H destruct ]
+elim (eq_nat_dec i1 i2) /2 width=1 by or_introl/
+#Hni12 @or_intror #H destruct /2 width=1 by/
+qed-.
(* Basic_1: was: bind_dec *)
-axiom eq_bind2_dec: ∀I1,I2:bind2. Decidable (I1 = I2).
+lemma eq_bind2_dec: ∀I1,I2:bind2. Decidable (I1 = I2).
+* * /2 width=1 by or_introl/
+@or_intror #H destruct
+qed-.
(* Basic_1: was: flat_dec *)
-axiom eq_flat2_dec: ∀I1,I2:flat2. Decidable (I1 = I2).
+lemma eq_flat2_dec: ∀I1,I2:flat2. Decidable (I1 = I2).
+* * /2 width=1 by or_introl/
+@or_intror #H destruct
+qed-.
(* Basic_1: was: kind_dec *)
-axiom eq_item2_dec: ∀I1,I2:item2. Decidable (I1 = I2).
+lemma eq_item2_dec: ∀I1,I2:item2. Decidable (I1 = I2).
+* [ #a1 ] #I1 * [1,3: #a2 ] #I2
+[2,3: @or_intror #H destruct
+| elim (eq_bool_dec a1 a2) #Ha
+ [ elim (eq_bind2_dec I1 I2) /2 width=1 by or_introl/ #HI ]
+ @or_intror #H destruct /2 width=1 by/
+| elim (eq_flat2_dec I1 I2) /2 width=1 by or_introl/ #HI
+ @or_intror #H destruct /2 width=1 by/
+]
+qed-.
(* Basic_1: removed theorems 21:
s_S s_plus s_plus_sym s_minus minus_s_s s_le s_lt s_inj s_inc
(* Basic inversion lemmas ***************************************************)
fact lift_inv_O2_aux: ∀d,e,T1,T2. ⇧[d, e] T1 ≡ T2 → e = 0 → T1 = T2.
-#d #e #T1 #T2 #H elim H -d -e -T1 -T2 // /3 width=1/
+#d #e #T1 #T2 #H elim H -d -e -T1 -T2 /3 width=1 by eq_f2/
qed-.
lemma lift_inv_O2: ∀d,T1,T2. ⇧[d, 0] T1 ≡ T2 → T1 = T2.
(i < d ∧ T2 = #i) ∨ (d ≤ i ∧ T2 = #(i + e)).
#d #e #T1 #T2 * -d -e -T1 -T2
[ #k #d #e #i #H destruct
-| #j #d #e #Hj #i #Hi destruct /3 width=1/
-| #j #d #e #Hj #i #Hi destruct /3 width=1/
+| #j #d #e #Hj #i #Hi destruct /3 width=1 by or_introl, conj/
+| #j #d #e #Hj #i #Hi destruct /3 width=1 by or_intror, conj/
| #p #d #e #i #H destruct
| #a #I #V1 #V2 #T1 #T2 #d #e #_ #_ #i #H destruct
| #I #V1 #V2 #T1 #T2 #d #e #_ #_ #i #H destruct
| #i #d #e #_ #a #I #V1 #U1 #H destruct
| #i #d #e #_ #a #I #V1 #U1 #H destruct
| #p #d #e #a #I #V1 #U1 #H destruct
-| #b #J #W1 #W2 #T1 #T2 #d #e #HW #HT #a #I #V1 #U1 #H destruct /2 width=5/
+| #b #J #W1 #W2 #T1 #T2 #d #e #HW #HT #a #I #V1 #U1 #H destruct /2 width=5 by ex3_2_intro/
| #J #W1 #W2 #T1 #T2 #d #e #_ #HT #a #I #V1 #U1 #H destruct
]
qed-.
| #i #d #e #_ #I #V1 #U1 #H destruct
| #p #d #e #I #V1 #U1 #H destruct
| #a #J #W1 #W2 #T1 #T2 #d #e #_ #_ #I #V1 #U1 #H destruct
-| #J #W1 #W2 #T1 #T2 #d #e #HW #HT #I #V1 #U1 #H destruct /2 width=5/
+| #J #W1 #W2 #T1 #T2 #d #e #HW #HT #I #V1 #U1 #H destruct /2 width=5 by ex3_2_intro/
]
qed-.
(i < d ∧ T1 = #i) ∨ (d + e ≤ i ∧ T1 = #(i - e)).
#d #e #T1 #T2 * -d -e -T1 -T2
[ #k #d #e #i #H destruct
-| #j #d #e #Hj #i #Hi destruct /3 width=1/
-| #j #d #e #Hj #i #Hi destruct <minus_plus_m_m /4 width=1/
+| #j #d #e #Hj #i #Hi destruct /3 width=1 by or_introl, conj/
+| #j #d #e #Hj #i #Hi destruct <minus_plus_m_m /4 width=1 by monotonic_le_plus_l, or_intror, conj/
| #p #d #e #i #H destruct
| #a #I #V1 #V2 #T1 #T2 #d #e #_ #_ #i #H destruct
| #I #V1 #V2 #T1 #T2 #d #e #_ #_ #i #H destruct
| #i #d #e #_ #a #I #V2 #U2 #H destruct
| #i #d #e #_ #a #I #V2 #U2 #H destruct
| #p #d #e #a #I #V2 #U2 #H destruct
-| #b #J #W1 #W2 #T1 #T2 #d #e #HW #HT #a #I #V2 #U2 #H destruct /2 width=5/
+| #b #J #W1 #W2 #T1 #T2 #d #e #HW #HT #a #I #V2 #U2 #H destruct /2 width=5 by ex3_2_intro/
| #J #W1 #W2 #T1 #T2 #d #e #_ #_ #a #I #V2 #U2 #H destruct
]
qed-.
| #i #d #e #_ #I #V2 #U2 #H destruct
| #p #d #e #I #V2 #U2 #H destruct
| #a #J #W1 #W2 #T1 #T2 #d #e #_ #_ #I #V2 #U2 #H destruct
-| #J #W1 #W2 #T1 #T2 #d #e #HW #HT #I #V2 #U2 #H destruct /2 width=5/
+| #J #W1 #W2 #T1 #T2 #d #e #HW #HT #I #V2 #U2 #H destruct /2 width=5 by ex3_2_intro/
]
qed-.
| lapply (lift_inv_gref2 … H) -H #H destruct
]
| * [ #a ] #I #W2 #U2 #IHW2 #_ #T #H
- [ elim (lift_inv_bind2 … H) -H #W1 #U1 #HW12 #_ #H destruct /2 width=2/
- | elim (lift_inv_flat2 … H) -H #W1 #U1 #HW12 #_ #H destruct /2 width=2/
+ [ elim (lift_inv_bind2 … H) -H #W1 #U1 #HW12 #_ #H destruct /2 width=2 by/
+ | elim (lift_inv_flat2 … H) -H #W1 #U1 #HW12 #_ #H destruct /2 width=2 by/
]
]
qed-.
| lapply (lift_inv_gref2 … H) -H #H destruct
]
| * [ #a ] #I #W2 #U2 #_ #IHU2 #V #d #e #H
- [ elim (lift_inv_bind2 … H) -H #W1 #U1 #_ #HU12 #H destruct /2 width=4/
- | elim (lift_inv_flat2 … H) -H #W1 #U1 #_ #HU12 #H destruct /2 width=4/
+ [ elim (lift_inv_bind2 … H) -H #W1 #U1 #_ #HU12 #H destruct /2 width=4 by/
+ | elim (lift_inv_flat2 … H) -H #W1 #U1 #_ #HU12 #H destruct /2 width=4 by/
]
]
qed-.
lemma lift_fwd_pair1: ∀I,T2,V1,U1,d,e. ⇧[d,e] ②{I}V1.U1 ≡ T2 →
∃∃V2,U2. ⇧[d,e] V1 ≡ V2 & T2 = ②{I}V2.U2.
* [ #a ] #I #T2 #V1 #U1 #d #e #H
-[ elim (lift_inv_bind1 … H) -H /2 width=4/
-| elim (lift_inv_flat1 … H) -H /2 width=4/
+[ elim (lift_inv_bind1 … H) -H /2 width=4 by ex2_2_intro/
+| elim (lift_inv_flat1 … H) -H /2 width=4 by ex2_2_intro/
]
qed-.
lemma lift_fwd_pair2: ∀I,T1,V2,U2,d,e. ⇧[d,e] T1 ≡ ②{I}V2.U2 →
∃∃V1,U1. ⇧[d,e] V1 ≡ V2 & T1 = ②{I}V1.U1.
* [ #a ] #I #T1 #V2 #U2 #d #e #H
-[ elim (lift_inv_bind2 … H) -H /2 width=4/
-| elim (lift_inv_flat2 … H) -H /2 width=4/
+[ elim (lift_inv_bind2 … H) -H /2 width=4 by ex2_2_intro/
+| elim (lift_inv_flat2 … H) -H /2 width=4 by ex2_2_intro/
]
qed-.
(* Basic_1: was: lift_lref_gt *)
lemma lift_lref_ge_minus: ∀d,e,i. d + e ≤ i → ⇧[d, e] #(i - e) ≡ #i.
-#d #e #i #H >(plus_minus_m_m i e) in ⊢ (? ? ? ? %); /2 width=2/ /3 width=2/
+#d #e #i #H >(plus_minus_m_m i e) in ⊢ (? ? ? ? %); /3 width=2 by lift_lref_ge, le_plus_to_minus_r, le_plus_b/
qed.
lemma lift_lref_ge_minus_eq: ∀d,e,i,j. d + e ≤ i → j = i - e → ⇧[d, e] #j ≡ #i.
(* Basic_1: was: lift_r *)
lemma lift_refl: ∀T,d. ⇧[d, 0] T ≡ T.
#T elim T -T
-[ * #i // #d elim (lt_or_ge i d) /2 width=1/
-| * /2 width=1/
+[ * #i // #d elim (lt_or_ge i d) /2 width=1 by lift_lref_lt, lift_lref_ge/
+| * /2 width=1 by lift_bind, lift_flat/
]
qed.
lemma lift_total: ∀T1,d,e. ∃T2. ⇧[d,e] T1 ≡ T2.
#T1 elim T1 -T1
-[ * #i /2 width=2/ #d #e elim (lt_or_ge i d) /3 width=2/
+[ * #i /2 width=2/ #d #e elim (lt_or_ge i d) /3 width=2 by lift_lref_lt, lift_lref_ge, ex_intro/
| * [ #a ] #I #V1 #T1 #IHV1 #IHT1 #d #e
elim (IHV1 d e) -IHV1 #V2 #HV12
- [ elim (IHT1 (d+1) e) -IHT1 /3 width=2/
- | elim (IHT1 d e) -IHT1 /3 width=2/
+ [ elim (IHT1 (d+1) e) -IHT1 /3 width=2 by lift_bind, ex_intro/
+ | elim (IHT1 d e) -IHT1 /3 width=2 by lift_flat, ex_intro/
]
]
qed.
#d1 #e2 #T1 #T2 #H elim H -d1 -e2 -T1 -T2
[ /3 width=3/
| #i #d1 #e2 #Hid1 #d2 #e1 #Hd12 #_ #_
- lapply (lt_to_le_to_lt … Hid1 Hd12) -Hd12 #Hid2 /4 width=3/
+ lapply (lt_to_le_to_lt … Hid1 Hd12) -Hd12 #Hid2 /4 width=3 by lift_lref_lt, ex2_intro/
| #i #d1 #e2 #Hid1 #d2 #e1 #_ #Hd21 #He12
- lapply (transitive_le … (i+e1) Hd21 ?) /2 width=1/ -Hd21 #Hd21
- >(plus_minus_m_m e2 e1 ?) // /3 width=3/
+ lapply (transitive_le … (i+e1) Hd21 ?) /2 width=1 by monotonic_le_plus_l/ -Hd21 #Hd21
+ >(plus_minus_m_m e2 e1 ?) /3 width=3 by lift_lref_ge, ex2_intro/
| /3 width=3/
| #a #I #V1 #V2 #T1 #T2 #d1 #e2 #_ #_ #IHV #IHT #d2 #e1 #Hd12 #Hd21 #He12
elim (IHV … Hd12 Hd21 He12) -IHV #V0 #HV0a #HV0b
- elim (IHT (d2+1) … ? ? He12) /2 width=1/ /3 width=5/
+ elim (IHT (d2+1) … ? ? He12) /3 width=5 by lift_bind, le_S_S, ex2_intro/
| #I #V1 #V2 #T1 #T2 #d1 #e2 #_ #_ #IHV #IHT #d2 #e1 #Hd12 #Hd21 #He12
elim (IHV … Hd12 Hd21 He12) -IHV #V0 #HV0a #HV0b
- elim (IHT d2 … ? ? He12) // /3 width=5/
+ elim (IHT d2 … ? ? He12) /3 width=5 by lift_flat, ex2_intro/
]
qed.
(* Basic_1: was only: dnf_dec2 dnf_dec *)
lemma is_lift_dec: ∀T2,d,e. Decidable (∃T1. ⇧[d,e] T1 ≡ T2).
#T1 elim T1 -T1
-[ * [1,3: /3 width=2/ ] #i #d #e
- elim (lt_dec i d) #Hid
- [ /4 width=2/
- | lapply (false_lt_to_le … Hid) -Hid #Hid
- elim (lt_dec i (d + e)) #Hide
- [ @or_intror * #T1 #H
- elim (lift_inv_lref2_be … H Hid Hide)
- | lapply (false_lt_to_le … Hide) -Hide /4 width=2/
+[ * [1,3: /3 width=2 by lift_sort, lift_gref, ex_intro, or_introl/ ] #i #d #e
+ elim (lt_or_ge i d) #Hdi
+ [ /4 width=3 by lift_lref_lt, ex_intro, or_introl/
+ | elim (lt_or_ge i (d + e)) #Hide
+ [ @or_intror * #T1 #H elim (lift_inv_lref2_be … H Hdi Hide)
+ | -Hdi /4 width=2 by lift_lref_ge_minus, ex_intro, or_introl/
]
]
| * [ #a ] #I #V2 #T2 #IHV2 #IHT2 #d #e
[ elim (IHV2 d e) -IHV2
[ * #V1 #HV12 elim (IHT2 (d+1) e) -IHT2
- [ * #T1 #HT12 @or_introl /3 width=2/
+ [ * #T1 #HT12 @or_introl /3 width=2 by lift_bind, ex_intro/
| -V1 #HT2 @or_intror * #X #H
- elim (lift_inv_bind2 … H) -H /3 width=2/
+ elim (lift_inv_bind2 … H) -H /3 width=2 by ex_intro/
]
| -IHT2 #HV2 @or_intror * #X #H
- elim (lift_inv_bind2 … H) -H /3 width=2/
+ elim (lift_inv_bind2 … H) -H /3 width=2 by ex_intro/
]
| elim (IHV2 d e) -IHV2
[ * #V1 #HV12 elim (IHT2 d e) -IHT2
[ * #T1 #HT12 /4 width=2/
| -V1 #HT2 @or_intror * #X #H
- elim (lift_inv_flat2 … H) -H /3 width=2/
+ elim (lift_inv_flat2 … H) -H /3 width=2 by ex_intro/
]
| -IHT2 #HV2 @or_intror * #X #H
- elim (lift_inv_flat2 … H) -H /3 width=2/
+ elim (lift_inv_flat2 … H) -H /3 width=2 by ex_intro/
]
]
]