]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/static/frees_fqup.ma
- advances on drops
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / static / frees_fqup.ma
1 (**************************************************************************)
2 (*       ___                                                              *)
3 (*      ||M||                                                             *)
4 (*      ||A||       A project by Andrea Asperti                           *)
5 (*      ||T||                                                             *)
6 (*      ||I||       Developers:                                           *)
7 (*      ||T||         The HELM team.                                      *)
8 (*      ||A||         http://helm.cs.unibo.it                             *)
9 (*      \   /                                                             *)
10 (*       \ /        This file is distributed under the terms of the       *)
11 (*        v         GNU General Public License Version 2                  *)
12 (*                                                                        *)
13 (**************************************************************************)
14
15 include "ground_2/relocation/rtmap_id.ma".
16 include "basic_2/s_computation/fqup_weight.ma".
17 include "basic_2/static/frees.ma".
18
19 (* CONTEXT-SENSITIVE FREE VARIABLES *****************************************)
20
21 (* Advanced properties ******************************************************)
22
23 (* Notes: this replaces lemma 1400 concluding the "big tree" theorem *)
24 lemma frees_total: ∀L,T. ∃f. L ⊢ 𝐅*⦃T⦄ ≡ f.
25 #L #T @(fqup_wf_ind_eq … (⋆) L T) -L -T
26 #G0 #L0 #T0 #IH #G #L *
27 [ cases L -L /3 width=2 by frees_atom, ex_intro/
28   #L #I #V *
29   [ #s #HG #HL #HT destruct
30     elim (IH G L (⋆s)) -IH /3 width=2 by frees_sort_gen, fqu_fqup, fqu_drop, lifts_sort, ex_intro/
31   | * [2: #i ] #HG #HL #HT destruct
32     [ elim (IH G L (#i)) -IH /3 width=2 by frees_lref, fqu_fqup, ex_intro/
33     | elim (IH G L V) -IH /3 width=2 by frees_zero, fqu_fqup, fqu_lref_O, ex_intro/
34     ]
35   | #l #HG #HL #HT destruct
36     elim (IH G L (§l)) -IH /3 width=2 by frees_gref_gen, fqu_fqup, fqu_drop, lifts_gref, ex_intro/
37   ]
38 | * [ #p ] #I #V #T #HG #HL #HT destruct elim (IH G L V) // #f1 #HV
39   [ elim (IH G (L.ⓑ{I}V) T) -IH // #f2 #HT
40     elim (sor_isfin_ex f1 (⫱f2))
41     /3 width=6 by frees_fwd_isfin, frees_bind, isfin_tl, ex_intro/
42   | elim (IH G L T) -IH // #f2 #HT
43     elim (sor_isfin_ex f1 f2)
44     /3 width=6 by frees_fwd_isfin, frees_flat, ex_intro/ 
45   ]
46 ]
47 qed-.