1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| The HELM team. *)
8 (* ||A|| http://helm.cs.unibo.it *)
10 (* \ / This file is distributed under the terms of the *)
11 (* v GNU General Public License Version 2 *)
13 (**************************************************************************)
15 include "ground/xoa/ex_3_1.ma".
16 include "ground/notation/relations/rminus_3.ma".
17 include "ground/arith/nat_plus.ma".
18 include "ground/arith/nat_minus.ma".
19 include "ground/arith/nat_lt.ma".
20 include "ground/relocation/fr2_map.ma".
22 (* RELATIONAL SUBTRACTION FOR FINITE RELOCATION MAPS WITH PAIRS *************)
25 inductive fr2_minus: nat → relation fr2_map ≝
27 | fr2_minus_empty (i):
30 | fr2_minus_lt (f1) (f2) (d) (h) (i):
31 i < d → fr2_minus i f1 f2 → fr2_minus i (❨d,h❩◗f1) (❨d-i,h❩◗f2)
33 | fr2_minus_ge (f1) (f2) (d) (h) (i):
34 d ≤ i → fr2_minus (h+i) f1 f2 → fr2_minus i (❨d,h❩◗f1) f2
38 "minus (finite relocation maps with pairs)"
39 'RMinus f1 i f2 = (fr2_minus i f1 f2).
41 (* Basic inversions *********************************************************)
43 (*** minuss_inv_nil1 *)
44 lemma fr2_minus_inv_empty_sn (f2) (i):
46 #f2 #i @(insert_eq_1 … (𝐞))
49 | #f1 #f2 #d #h #i #_ #_ #H destruct
50 | #f1 #f2 #d #h #i #_ #_ #H destruct
54 (*** minuss_inv_cons1 *)
55 lemma fr2_minus_inv_lcons_sn (f1) (f2) (d) (h) (i):
57 ∨∨ ∧∧ d ≤ i & f1 ▭ h+i ≘ f2
58 | ∃∃f. i < d & f1 ▭ i ≘ f & f2 = ❨d-i,h❩◗f.
59 #g1 #f2 #d #h #i @(insert_eq_1 … (❨d,h❩◗g1))
62 | #f1 #f #d1 #h1 #i1 #Hid1 #Hf #H destruct /3 width=3 by ex3_intro, or_intror/
63 | #f1 #f #d1 #h1 #i1 #Hdi1 #Hf #H destruct /3 width=1 by or_introl, conj/
67 (*** minuss_inv_cons1_ge *)
68 lemma fr2_minus_inv_lcons_sn_ge (f1) (f2) (d) (h) (i):
69 ❨d, h❩◗f1 ▭ i ≘ f2 → d ≤ i → f1 ▭ h+i ≘ f2.
71 elim (fr2_minus_inv_lcons_sn … H) -H * // #f #Hid #_ #_ #Hdi
72 elim (nlt_ge_false … Hid Hdi)
75 (*** minuss_inv_cons1_lt *)
76 lemma fr2_minus_inv_lcons_sn_lt (f1) (f2) (d) (h) (i):
77 ❨d, h❩◗f1 ▭ i ≘ f2 → i < d →
78 ∃∃f. f1 ▭ i ≘ f & f2 = ❨d-i,h❩◗f.
79 #f1 #f2 #d #h #i #H elim (fr2_minus_inv_lcons_sn … H) -H *
80 [ #Hdi #_ #Hid elim (nlt_ge_false … Hid Hdi)
81 | /2 width=3 by ex2_intro/