]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/ground_2/steps/rtc_plus.ma
update in ground_2, static_2, basic_2
[helm.git] / matita / matita / contribs / lambdadelta / ground_2 / steps / rtc_plus.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/xoa/ex_6_8.ma".
16 include "ground_2/steps/rtc.ma".
17
18 (* RT-TRANSITION COUNTER ****************************************************)
19
20 definition plus (c1:rtc) (c2:rtc): rtc ≝ match c1 with [
21    mk_rtc ri1 rs1 ti1 ts1 ⇒ match c2 with [
22       mk_rtc ri2 rs2 ti2 ts2 ⇒ 〈ri1+ri2,rs1+rs2,ti1+ti2,ts1+ts2〉
23    ]
24 ].
25
26 interpretation "plus (rtc)"
27    'plus c1 c2 = (plus c1 c2).
28
29 (* Basic properties *********************************************************)
30
31 (**) (* plus is not disambiguated parentheses *)
32 lemma plus_rew: ∀ri1,ri2,rs1,rs2,ti1,ti2,ts1,ts2.
33                  〈ri1+ri2,rs1+rs2,ti1+ti2,ts1+ts2〉 =
34                  (〈ri1,rs1,ti1,ts1〉) + (〈ri2,rs2,ti2,ts2〉).
35 // qed.
36
37 lemma plus_O_dx: ∀c. c = c + 𝟘𝟘.
38 * #ri #rs #ti #ts <plus_rew //
39 qed.
40
41 (* Basic inversion properties ***********************************************)
42
43 lemma plus_inv_dx: ∀ri,rs,ti,ts,c1,c2. 〈ri,rs,ti,ts〉 = c1 + c2 →
44                    ∃∃ri1,rs1,ti1,ts1,ri2,rs2,ti2,ts2.
45                    ri1+ri2 = ri & rs1+rs2 = rs & ti1+ti2 = ti & ts1+ts2 = ts &
46                    〈ri1,rs1,ti1,ts1〉 = c1 & 〈ri2,rs2,ti2,ts2〉 = c2.
47 #ri #rs #ti #ts * #ri1 #rs1 #ti1 #ts1 * #ri2 #rs2 #ti2 #ts2
48 <plus_rew #H destruct /2 width=14 by ex6_8_intro/
49 qed-.
50
51 (* Main Properties **********************************************************)
52
53 theorem plus_assoc: associative … plus.
54 * #ri1 #rs1 #ti1 #ts1 * #ri2 #rs2 #ti2 #ts2 * #ri3 #rs3 #ti3 #ts3
55 <plus_rew //
56 qed.