]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/ground_2/steps/rtc_max.ma
basic properties of cpr ...
[helm.git] / matita / matita / contribs / lambdadelta / ground_2 / steps / rtc_max.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/steps/rtc_shift.ma".
16
17 (* RT-TRANSITION COUNTER ****************************************************)
18
19 definition max (c1:rtc) (c2:rtc): rtc ≝ match c1 with [
20    mk_rtc ri1 rs1 ti1 ts1 ⇒ match c2 with [
21       mk_rtc ri2 rs2 ti2 ts2 ⇒ 〈ri1∨ri2, rs1∨rs2, ti1∨ti2, ts1∨ts2〉
22    ]
23 ].
24
25 interpretation "maximum (rtc)"
26    'or c1 c2 = (max c1 c2).
27
28 (* Basic properties *********************************************************)
29
30 lemma max_rew: ∀ri1,ri2,rs1,rs2,ti1,ti2,ts1,ts2.
31                  〈ri1∨ri2, rs1∨rs2, ti1∨ti2, ts1∨ts2〉 =
32                  (〈ri1,rs1,ti1,ts1〉 ∨ 〈ri2,rs2,ti2,ts2〉).
33 // qed.
34
35 lemma max_O_dx: ∀c. c = (c ∨ 𝟘𝟘).
36 * #ri #rs #ti #ts <max_rew //
37 qed.
38
39 (* Basic inversion properties ***********************************************)
40
41 lemma max_inv_dx: ∀ri,rs,ti,ts,c1,c2. 〈ri,rs,ti,ts〉 = (c1 ∨ c2) →
42                   ∃∃ri1,rs1,ti1,ts1,ri2,rs2,ti2,ts2.
43                   (ri1∨ri2) = ri & (rs1∨rs2) = rs & (ti1∨ti2) = ti & (ts1∨ts2) = ts &
44                   〈ri1,rs1,ti1,ts1〉 = c1 & 〈ri2,rs2,ti2,ts2〉 = c2.
45 #ri #rs #ti #ts * #ri1 #rs1 #ti1 #ts1 * #ri2 #rs2 #ti2 #ts2
46 <max_rew #H destruct /2 width=14 by ex6_8_intro/
47 qed-.
48
49 (* Properties with test for constrained rt-transition counter ***************)
50
51 lemma isrt_max: ∀n1,n2,c1,c2. 𝐑𝐓⦃n1, c1⦄ → 𝐑𝐓⦃n2, c2⦄ → 𝐑𝐓⦃n1∨n2, c1∨c2⦄.
52 #n1 #n2 #c1 #c2 * #ri1 #rs1 #H1 * #ri2 #rs2 #H2 destruct
53 /2 width=3 by ex1_2_intro/
54 qed.
55
56 lemma isrt_max_O1: ∀n,c1,c2. 𝐑𝐓⦃0, c1⦄ → 𝐑𝐓⦃n, c2⦄ → 𝐑𝐓⦃n, c1∨c2⦄.
57 /2 width=1 by isrt_max/ qed.
58
59 lemma isrt_max_O2: ∀n,c1,c2. 𝐑𝐓⦃n, c1⦄ → 𝐑𝐓⦃0, c2⦄ → 𝐑𝐓⦃n, c1∨c2⦄.
60 #n #c1 #c2 #H1 #H2 >(max_O2 n) /2 width=1 by isrt_max/
61 qed.
62
63 (* Inversion properties with test for constrained rt-transition counter *****)
64
65 lemma isrt_inv_max: ∀n,c1,c2. 𝐑𝐓⦃n, c1 ∨ c2⦄ →
66                     ∃∃n1,n2. 𝐑𝐓⦃n1, c1⦄ & 𝐑𝐓⦃n2, c2⦄ & (n1 ∨ n2) = n.
67 #n #c1 #c2 * #ri #rs #H
68 elim (max_inv_dx … H) -H #ri1 #rs1 #ti1 #ts1 #ri2 #rs2 #ti2 #ts2 #_ #_ #H1 #H2 #H3 #H4
69 elim (max_inv_O3 … H1) -H1 /3 width=5 by ex3_2_intro, ex1_2_intro/
70 qed-.
71
72 lemma isrt_inv_max_O_dx: ∀n,c1,c2. 𝐑𝐓⦃n, c1 ∨ c2⦄ → 𝐑𝐓⦃0, c2⦄ → 𝐑𝐓⦃n, c1⦄.
73 #n #c1 #c2 #H #H2
74 elim (isrt_inv_max … H) -H #n1 #n2 #Hn1 #Hn2 #H destruct
75 lapply (isrt_mono … Hn2 H2) -c2 #H destruct //
76 qed-.
77
78 (* Properties with shift ****************************************************)
79 (*
80 lemma max_shift: ∀c1,c2. (↓c1) ∨ (↓c2) = ↓(c1∨c2).
81 * #ri1 #rs1 #ti1 #ts1 * #ri2 #rs2 #ti2 #ts2
82 <shift_rew <shift_rew <shift_rew <max_rew //
83 qed.
84 *)