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/notation/relations/rfun_c_2.ma".
16 include "ground/arith/nat_succ.ma".
17 include "ground/relocation/gr_isi.ma".
19 (* FINITE COLENGTH ASSIGNMENT FOR GENERIC RELOCATION MAPS ***********************************************************)
22 inductive gr_fcla: relation2 gr_map nat ā
24 | gr_fcla_isi (f): šāŖfā« ā gr_fcla f (š)
26 | gr_fcla_push (f) (n): gr_fcla f n ā gr_fcla (ā«Æf) n
28 | gr_fcla_next (f) (n): gr_fcla f n ā gr_fcla (āf) (ān)
32 "finite colength assignment (generic relocation maps)"
33 'RFunC f n = (gr_fcla f n).
35 (* Basic inversion lemmas ***************************************************)
38 lemma gr_fcla_inv_push (g) (m): šāŖgā« ā m ā āf. ā«Æf = g ā šāŖfā« ā m.
40 [ /3 width=3 by gr_fcla_isi, gr_isi_inv_push/
41 | #g #m #Hg #f #H >(eq_inv_gr_push_bi ā¦ H) -f //
42 | #g #m #_ #f #H elim (eq_inv_gr_push_next ā¦ H)
47 lemma gr_fcla_inv_next (g) (m): šāŖgā« ā m ā āf. āf = g ā āān. šāŖfā« ā n & ān = m.
49 [ #g #Hg #f #H destruct
50 elim (gr_isi_inv_next ā¦ Hg) -Hg //
51 | #g #m #_ #f #H elim (eq_inv_gr_next_push ā¦ H)
52 | #g #m #Hg #f #H >(eq_inv_gr_next_bi ā¦ H) -f
53 /2 width=3 by ex2_intro/
57 (* Advanced inversion lemmas ************************************************)
60 lemma gr_cla_inv_next_succ (g) (m): šāŖgā« ā m ā āf,n. āf = g ā ān = m ā šāŖfā« ā n.
61 #g #m #H #f #n #H1 #H2 elim (gr_fcla_inv_next ā¦ H ā¦ H1) -g
62 #x #Hf #H destruct <(eq_inv_nsucc_bi ā¦ H) -n //
66 lemma gr_cla_inv_next_zero (g) (m): šāŖgā« ā m ā āf. āf = g ā š = m ā ā„.
67 #g #m #H #f #H1 elim (gr_fcla_inv_next ā¦ H ā¦ H1) -g
68 #x #_ #H1 #H2 destruct /2 width=2 by eq_inv_zero_nsucc/
72 lemma gr_fcla_inv_zero (g) (m): šāŖgā« ā m ā š = m ā šāŖgā«.
73 #g #m #H elim H -g -m /3 width=3 by gr_isi_push/
74 #g #m #_ #_ #H destruct elim (eq_inv_zero_nsucc ā¦ H)
78 lemma gr_fcla_inv_isi (g) (m): šāŖgā« ā m ā šāŖgā« ā š = m.
79 #f #n #H elim H -f -n /3 width=3 by gr_isi_inv_push/
80 #f #n #_ #_ #H elim (gr_isi_inv_next ā¦ H) -H //