author | tsewell@rubicon.NSW.bigpond.net.au |
Wed, 23 Sep 2009 19:17:48 +1000 | |
changeset 32752 | f65d74a264dd |
parent 32745 | 192d58483fdf |
child 32756 | fb32a99a7689 |
permissions | -rw-r--r-- |
4870
cc36acb5b114
Extensible records with structural subtyping in HOL. See
wenzelm
parents:
diff
changeset
|
1 |
(* Title: HOL/Record.thy |
32752
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
2 |
Authors: Wolfgang Naraschewski, Norbert Schirmer and Markus Wenzel, TU Muenchen |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
3 |
Thomas Sewell, NICTA |
4870
cc36acb5b114
Extensible records with structural subtyping in HOL. See
wenzelm
parents:
diff
changeset
|
4 |
*) |
cc36acb5b114
Extensible records with structural subtyping in HOL. See
wenzelm
parents:
diff
changeset
|
5 |
|
22817 | 6 |
header {* Extensible records with structural subtyping *} |
7 |
||
15131 | 8 |
theory Record |
32752
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
9 |
imports Product_Type |
32744
50406c4951d9
Record patch imported and working.
Thomas Sewell <tsewell@nicta.com.au>
parents:
32743
diff
changeset
|
10 |
uses ("Tools/record.ML") |
15131 | 11 |
begin |
4870
cc36acb5b114
Extensible records with structural subtyping in HOL. See
wenzelm
parents:
diff
changeset
|
12 |
|
14700
2f885b7e5ba7
reimplementation of HOL records; only one type is created for
schirmer
parents:
14080
diff
changeset
|
13 |
lemma prop_subst: "s = t \<Longrightarrow> PROP P t \<Longrightarrow> PROP P s" |
2f885b7e5ba7
reimplementation of HOL records; only one type is created for
schirmer
parents:
14080
diff
changeset
|
14 |
by simp |
11826 | 15 |
|
25705 | 16 |
lemma K_record_comp: "(\<lambda>x. c) \<circ> f = (\<lambda>x. c)" |
17 |
by (simp add: comp_def) |
|
11821 | 18 |
|
32743
c4e9a48bc50e
Initial attempt at porting record update to repository Isabelle.
tsewell@rubicon.NSW.bigpond.net.au
parents:
31723
diff
changeset
|
19 |
lemma meta_iffD2: |
c4e9a48bc50e
Initial attempt at porting record update to repository Isabelle.
tsewell@rubicon.NSW.bigpond.net.au
parents:
31723
diff
changeset
|
20 |
"\<lbrakk> PROP P \<equiv> PROP Q; PROP Q \<rbrakk> \<Longrightarrow> PROP P" |
c4e9a48bc50e
Initial attempt at porting record update to repository Isabelle.
tsewell@rubicon.NSW.bigpond.net.au
parents:
31723
diff
changeset
|
21 |
by simp |
c4e9a48bc50e
Initial attempt at porting record update to repository Isabelle.
tsewell@rubicon.NSW.bigpond.net.au
parents:
31723
diff
changeset
|
22 |
|
c4e9a48bc50e
Initial attempt at porting record update to repository Isabelle.
tsewell@rubicon.NSW.bigpond.net.au
parents:
31723
diff
changeset
|
23 |
lemma o_eq_dest_lhs: |
c4e9a48bc50e
Initial attempt at porting record update to repository Isabelle.
tsewell@rubicon.NSW.bigpond.net.au
parents:
31723
diff
changeset
|
24 |
"a o b = c \<Longrightarrow> a (b v) = c v" |
c4e9a48bc50e
Initial attempt at porting record update to repository Isabelle.
tsewell@rubicon.NSW.bigpond.net.au
parents:
31723
diff
changeset
|
25 |
by clarsimp |
c4e9a48bc50e
Initial attempt at porting record update to repository Isabelle.
tsewell@rubicon.NSW.bigpond.net.au
parents:
31723
diff
changeset
|
26 |
|
c4e9a48bc50e
Initial attempt at porting record update to repository Isabelle.
tsewell@rubicon.NSW.bigpond.net.au
parents:
31723
diff
changeset
|
27 |
lemma id_o_refl: |
c4e9a48bc50e
Initial attempt at porting record update to repository Isabelle.
tsewell@rubicon.NSW.bigpond.net.au
parents:
31723
diff
changeset
|
28 |
"id o f = f o id" |
c4e9a48bc50e
Initial attempt at porting record update to repository Isabelle.
tsewell@rubicon.NSW.bigpond.net.au
parents:
31723
diff
changeset
|
29 |
by simp |
c4e9a48bc50e
Initial attempt at porting record update to repository Isabelle.
tsewell@rubicon.NSW.bigpond.net.au
parents:
31723
diff
changeset
|
30 |
|
c4e9a48bc50e
Initial attempt at porting record update to repository Isabelle.
tsewell@rubicon.NSW.bigpond.net.au
parents:
31723
diff
changeset
|
31 |
lemma o_eq_id_dest: |
c4e9a48bc50e
Initial attempt at porting record update to repository Isabelle.
tsewell@rubicon.NSW.bigpond.net.au
parents:
31723
diff
changeset
|
32 |
"a o b = id o c \<Longrightarrow> a (b v) = c v" |
c4e9a48bc50e
Initial attempt at porting record update to repository Isabelle.
tsewell@rubicon.NSW.bigpond.net.au
parents:
31723
diff
changeset
|
33 |
by clarsimp |
22817 | 34 |
|
11833 | 35 |
subsection {* Concrete record syntax *} |
4870
cc36acb5b114
Extensible records with structural subtyping in HOL. See
wenzelm
parents:
diff
changeset
|
36 |
|
cc36acb5b114
Extensible records with structural subtyping in HOL. See
wenzelm
parents:
diff
changeset
|
37 |
nonterminals |
5198 | 38 |
ident field_type field_types field fields update updates |
4870
cc36acb5b114
Extensible records with structural subtyping in HOL. See
wenzelm
parents:
diff
changeset
|
39 |
syntax |
11821 | 40 |
"_constify" :: "id => ident" ("_") |
41 |
"_constify" :: "longid => ident" ("_") |
|
5198 | 42 |
|
11821 | 43 |
"_field_type" :: "[ident, type] => field_type" ("(2_ ::/ _)") |
44 |
"" :: "field_type => field_types" ("_") |
|
45 |
"_field_types" :: "[field_type, field_types] => field_types" ("_,/ _") |
|
46 |
"_record_type" :: "field_types => type" ("(3'(| _ |'))") |
|
10093 | 47 |
"_record_type_scheme" :: "[field_types, type] => type" ("(3'(| _,/ (2... ::/ _) |'))") |
5198 | 48 |
|
11821 | 49 |
"_field" :: "[ident, 'a] => field" ("(2_ =/ _)") |
50 |
"" :: "field => fields" ("_") |
|
51 |
"_fields" :: "[field, fields] => fields" ("_,/ _") |
|
52 |
"_record" :: "fields => 'a" ("(3'(| _ |'))") |
|
10093 | 53 |
"_record_scheme" :: "[fields, 'a] => 'a" ("(3'(| _,/ (2... =/ _) |'))") |
5198 | 54 |
|
10641 | 55 |
"_update_name" :: idt |
11821 | 56 |
"_update" :: "[ident, 'a] => update" ("(2_ :=/ _)") |
57 |
"" :: "update => updates" ("_") |
|
58 |
"_updates" :: "[update, updates] => updates" ("_,/ _") |
|
10093 | 59 |
"_record_update" :: "['a, updates] => 'b" ("_/(3'(| _ |'))" [900,0] 900) |
4870
cc36acb5b114
Extensible records with structural subtyping in HOL. See
wenzelm
parents:
diff
changeset
|
60 |
|
10331 | 61 |
syntax (xsymbols) |
11821 | 62 |
"_record_type" :: "field_types => type" ("(3\<lparr>_\<rparr>)") |
10093 | 63 |
"_record_type_scheme" :: "[field_types, type] => type" ("(3\<lparr>_,/ (2\<dots> ::/ _)\<rparr>)") |
64 |
"_record" :: "fields => 'a" ("(3\<lparr>_\<rparr>)") |
|
65 |
"_record_scheme" :: "[fields, 'a] => 'a" ("(3\<lparr>_,/ (2\<dots> =/ _)\<rparr>)") |
|
66 |
"_record_update" :: "['a, updates] => 'b" ("_/(3\<lparr>_\<rparr>)" [900,0] 900) |
|
9729 | 67 |
|
32752
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
68 |
subsection {* Operators and lemmas for types isomorphic to tuples *} |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
69 |
|
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
70 |
text {* |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
71 |
Records are isomorphic to compound tuple types. To implement efficient |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
72 |
records, we make this isomorphism explicit. Consider the record |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
73 |
access/update simplification "alpha (beta_update f rec) = alpha rec" for |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
74 |
distinct fields alpha and beta of some record rec with n fields. There |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
75 |
are n^2 such theorems, which prohibits storage of all of them for |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
76 |
large n. The rules can be proved on the fly by case decomposition and |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
77 |
simplification in O(n) time. By creating O(n) isomorphic-tuple types |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
78 |
while defining the record, however, we can prove the access/update |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
79 |
simplification in O(log(n)^2) time. |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
80 |
|
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
81 |
The O(n) cost of case decomposition is not because O(n) steps are taken, |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
82 |
but rather because the resulting rule must contain O(n) new variables and |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
83 |
an O(n) size concrete record construction. To sidestep this cost, we would |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
84 |
like to avoid case decomposition in proving access/update theorems. |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
85 |
|
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
86 |
Record types are defined as isomorphic to tuple types. For instance, a |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
87 |
record type with fields 'a, 'b, 'c and 'd might be introduced as |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
88 |
isomorphic to 'a \<times> ('b \<times> ('c \<times> 'd)). If we balance the tuple tree to |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
89 |
('a \<times> 'b) \<times> ('c \<times> 'd) then accessors can be defined by converting to |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
90 |
the underlying type then using O(log(n)) fst or snd operations. |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
91 |
Updators can be defined similarly, if we introduce a fst_update and |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
92 |
snd_update function. Furthermore, we can prove the access/update |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
93 |
theorem in O(log(n)) steps by using simple rewrites on fst, snd, |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
94 |
fst_update and snd_update. |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
95 |
|
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
96 |
The catch is that, although O(log(n)) steps were taken, the underlying |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
97 |
type we converted to is a tuple tree of size O(n). Processing this term |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
98 |
type wastes performance. We avoid this for large n by taking each |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
99 |
subtree of size K and defining a new type isomorphic to that tuple |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
100 |
subtree. A record can now be defined as isomorphic to a tuple tree |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
101 |
of these O(n/K) new types, or, if n > K*K, we can repeat the process, |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
102 |
until the record can be defined in terms of a tuple tree of complexity |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
103 |
less than the constant K. |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
104 |
|
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
105 |
If we prove the access/update theorem on this type with the analagous |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
106 |
steps to the tuple tree, we consume O(log(n)^2) time as the intermediate |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
107 |
terms are O(log(n)) in size and the types needed have size bounded by K. |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
108 |
To enable this analagous traversal, we define the functions seen below: |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
109 |
istuple_fst, istuple_snd, istuple_fst_update and istuple_snd_update. |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
110 |
These functions generalise tuple operations by taking a parameter that |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
111 |
encapsulates a tuple isomorphism. The rewrites needed on these functions |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
112 |
now need an additional assumption which is that the isomorphism works. |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
113 |
|
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
114 |
These rewrites are typically used in a structured way. They are here |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
115 |
presented as the introduction rule isomorphic_tuple.intros rather than |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
116 |
as a rewrite rule set. The introduction form is an optimisation, as net |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
117 |
matching can be performed at one term location for each step rather than |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
118 |
the simplifier searching the term for possible pattern matches. The rule |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
119 |
set is used as it is viewed outside the locale, with the locale assumption |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
120 |
(that the isomorphism is valid) left as a rule assumption. All rules are |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
121 |
structured to aid net matching, using either a point-free form or an |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
122 |
encapsulating predicate. |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
123 |
*} |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
124 |
|
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
125 |
typedef ('a, 'b, 'c) tuple_isomorphism |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
126 |
= "UNIV :: (('a \<Rightarrow> ('b \<times> 'c)) \<times> (('b \<times> 'c) \<Rightarrow> 'a)) set" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
127 |
by simp |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
128 |
|
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
129 |
definition |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
130 |
"TupleIsomorphism repr abst = Abs_tuple_isomorphism (repr, abst)" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
131 |
|
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
132 |
definition |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
133 |
istuple_fst :: "('a, 'b, 'c) tuple_isomorphism \<Rightarrow> 'a \<Rightarrow> 'b" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
134 |
where |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
135 |
"istuple_fst isom \<equiv> let (repr, abst) = Rep_tuple_isomorphism isom in fst \<circ> repr" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
136 |
|
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
137 |
definition |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
138 |
istuple_snd :: "('a, 'b, 'c) tuple_isomorphism \<Rightarrow> 'a \<Rightarrow> 'c" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
139 |
where |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
140 |
"istuple_snd isom \<equiv> let (repr, abst) = Rep_tuple_isomorphism isom in snd \<circ> repr" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
141 |
|
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
142 |
definition |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
143 |
istuple_fst_update :: "('a, 'b, 'c) tuple_isomorphism \<Rightarrow> ('b \<Rightarrow> 'b) \<Rightarrow> ('a \<Rightarrow> 'a)" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
144 |
where |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
145 |
"istuple_fst_update isom \<equiv> |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
146 |
let (repr, abst) = Rep_tuple_isomorphism isom in |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
147 |
(\<lambda>f v. abst (f (fst (repr v)), snd (repr v)))" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
148 |
|
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
149 |
definition |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
150 |
istuple_snd_update :: "('a, 'b, 'c) tuple_isomorphism \<Rightarrow> ('c \<Rightarrow> 'c) \<Rightarrow> ('a \<Rightarrow> 'a)" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
151 |
where |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
152 |
"istuple_snd_update isom \<equiv> |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
153 |
let (repr, abst) = Rep_tuple_isomorphism isom in |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
154 |
(\<lambda>f v. abst (fst (repr v), f (snd (repr v))))" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
155 |
|
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
156 |
definition |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
157 |
istuple_cons :: "('a, 'b, 'c) tuple_isomorphism \<Rightarrow> 'b \<Rightarrow> 'c \<Rightarrow> 'a" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
158 |
where |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
159 |
"istuple_cons isom \<equiv> let (repr, abst) = Rep_tuple_isomorphism isom in curry abst" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
160 |
|
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
161 |
text {* |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
162 |
These predicates are used in the introduction rule set to constrain |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
163 |
matching appropriately. The elimination rules for them produce the |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
164 |
desired theorems once they are proven. The final introduction rules are |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
165 |
used when no further rules from the introduction rule set can apply. |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
166 |
*} |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
167 |
|
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
168 |
definition |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
169 |
istuple_surjective_proof_assist :: "'a \<Rightarrow> 'b \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> bool" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
170 |
where |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
171 |
"istuple_surjective_proof_assist x y f \<equiv> (f x = y)" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
172 |
|
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
173 |
definition |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
174 |
istuple_update_accessor_cong_assist :: "(('b \<Rightarrow> 'b) \<Rightarrow> ('a \<Rightarrow> 'a)) |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
175 |
\<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> bool" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
176 |
where |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
177 |
"istuple_update_accessor_cong_assist upd acc |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
178 |
\<equiv> (\<forall>f v. upd (\<lambda>x. f (acc v)) v = upd f v) |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
179 |
\<and> (\<forall>v. upd id v = v)" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
180 |
|
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
181 |
definition |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
182 |
istuple_update_accessor_eq_assist :: "(('b \<Rightarrow> 'b) \<Rightarrow> ('a \<Rightarrow> 'a)) \<Rightarrow> ('a \<Rightarrow> 'b) |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
183 |
\<Rightarrow> 'a \<Rightarrow> ('b \<Rightarrow> 'b) \<Rightarrow> 'a \<Rightarrow> 'b \<Rightarrow> bool" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
184 |
where |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
185 |
"istuple_update_accessor_eq_assist upd acc v f v' x |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
186 |
\<equiv> upd f v = v' \<and> acc v = x |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
187 |
\<and> istuple_update_accessor_cong_assist upd acc" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
188 |
|
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
189 |
lemma update_accessor_congruence_foldE: |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
190 |
assumes uac: "istuple_update_accessor_cong_assist upd acc" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
191 |
and r: "r = r'" and v: "acc r' = v'" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
192 |
and f: "\<And>v. v' = v \<Longrightarrow> f v = f' v" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
193 |
shows "upd f r = upd f' r'" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
194 |
using uac r v[symmetric] |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
195 |
apply (subgoal_tac "upd (\<lambda>x. f (acc r')) r' = upd (\<lambda>x. f' (acc r')) r'") |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
196 |
apply (simp add: istuple_update_accessor_cong_assist_def) |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
197 |
apply (simp add: f) |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
198 |
done |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
199 |
|
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
200 |
lemma update_accessor_congruence_unfoldE: |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
201 |
"\<lbrakk> istuple_update_accessor_cong_assist upd acc; |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
202 |
r = r'; acc r' = v'; \<And>v. v = v' \<Longrightarrow> f v = f' v \<rbrakk> |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
203 |
\<Longrightarrow> upd f r = upd f' r'" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
204 |
apply (erule(2) update_accessor_congruence_foldE) |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
205 |
apply simp |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
206 |
done |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
207 |
|
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
208 |
lemma istuple_update_accessor_cong_assist_id: |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
209 |
"istuple_update_accessor_cong_assist upd acc \<Longrightarrow> upd id = id" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
210 |
by (rule ext, simp add: istuple_update_accessor_cong_assist_def) |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
211 |
|
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
212 |
lemma update_accessor_noopE: |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
213 |
assumes uac: "istuple_update_accessor_cong_assist upd acc" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
214 |
and acc: "f (acc x) = acc x" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
215 |
shows "upd f x = x" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
216 |
using uac |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
217 |
by (simp add: acc istuple_update_accessor_cong_assist_id[OF uac, unfolded id_def] |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
218 |
cong: update_accessor_congruence_unfoldE[OF uac]) |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
219 |
|
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
220 |
lemma update_accessor_noop_compE: |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
221 |
assumes uac: "istuple_update_accessor_cong_assist upd acc" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
222 |
assumes acc: "f (acc x) = acc x" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
223 |
shows "upd (g \<circ> f) x = upd g x" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
224 |
by (simp add: acc cong: update_accessor_congruence_unfoldE[OF uac]) |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
225 |
|
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
226 |
lemma update_accessor_cong_assist_idI: |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
227 |
"istuple_update_accessor_cong_assist id id" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
228 |
by (simp add: istuple_update_accessor_cong_assist_def) |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
229 |
|
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
230 |
lemma update_accessor_cong_assist_triv: |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
231 |
"istuple_update_accessor_cong_assist upd acc |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
232 |
\<Longrightarrow> istuple_update_accessor_cong_assist upd acc" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
233 |
by assumption |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
234 |
|
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
235 |
lemma update_accessor_accessor_eqE: |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
236 |
"\<lbrakk> istuple_update_accessor_eq_assist upd acc v f v' x \<rbrakk> \<Longrightarrow> acc v = x" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
237 |
by (simp add: istuple_update_accessor_eq_assist_def) |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
238 |
|
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
239 |
lemma update_accessor_updator_eqE: |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
240 |
"\<lbrakk> istuple_update_accessor_eq_assist upd acc v f v' x \<rbrakk> \<Longrightarrow> upd f v = v'" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
241 |
by (simp add: istuple_update_accessor_eq_assist_def) |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
242 |
|
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
243 |
lemma istuple_update_accessor_eq_assist_idI: |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
244 |
"v' = f v \<Longrightarrow> istuple_update_accessor_eq_assist id id v f v' v" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
245 |
by (simp add: istuple_update_accessor_eq_assist_def |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
246 |
update_accessor_cong_assist_idI) |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
247 |
|
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
248 |
lemma istuple_update_accessor_eq_assist_triv: |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
249 |
"istuple_update_accessor_eq_assist upd acc v f v' x |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
250 |
\<Longrightarrow> istuple_update_accessor_eq_assist upd acc v f v' x" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
251 |
by assumption |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
252 |
|
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
253 |
lemma istuple_update_accessor_cong_from_eq: |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
254 |
"istuple_update_accessor_eq_assist upd acc v f v' x |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
255 |
\<Longrightarrow> istuple_update_accessor_cong_assist upd acc" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
256 |
by (simp add: istuple_update_accessor_eq_assist_def) |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
257 |
|
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
258 |
lemma o_eq_dest: |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
259 |
"a o b = c o d \<Longrightarrow> a (b v) = c (d v)" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
260 |
apply (clarsimp simp: o_def) |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
261 |
apply (erule fun_cong) |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
262 |
done |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
263 |
|
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
264 |
lemma o_eq_elim: |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
265 |
"\<lbrakk> a o b = c o d; \<lbrakk> \<And>v. a (b v) = c (d v) \<rbrakk> \<Longrightarrow> R \<rbrakk> \<Longrightarrow> R" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
266 |
apply (erule meta_mp) |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
267 |
apply (erule o_eq_dest) |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
268 |
done |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
269 |
|
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
270 |
lemma istuple_surjective_proof_assistI: |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
271 |
"f x = y \<Longrightarrow> |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
272 |
istuple_surjective_proof_assist x y f" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
273 |
by (simp add: istuple_surjective_proof_assist_def) |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
274 |
|
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
275 |
lemma istuple_surjective_proof_assist_idE: |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
276 |
"istuple_surjective_proof_assist x y id \<Longrightarrow> x = y" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
277 |
by (simp add: istuple_surjective_proof_assist_def) |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
278 |
|
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
279 |
locale isomorphic_tuple = |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
280 |
fixes isom :: "('a, 'b, 'c) tuple_isomorphism" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
281 |
and repr and abst |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
282 |
defines "repr \<equiv> fst (Rep_tuple_isomorphism isom)" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
283 |
defines "abst \<equiv> snd (Rep_tuple_isomorphism isom)" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
284 |
assumes repr_inv: "\<And>x. abst (repr x) = x" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
285 |
assumes abst_inv: "\<And>y. repr (abst y) = y" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
286 |
|
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
287 |
begin |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
288 |
|
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
289 |
lemma repr_inj: |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
290 |
"(repr x = repr y) = (x = y)" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
291 |
apply (rule iffI, simp_all) |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
292 |
apply (drule_tac f=abst in arg_cong, simp add: repr_inv) |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
293 |
done |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
294 |
|
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
295 |
lemma abst_inj: |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
296 |
"(abst x = abst y) = (x = y)" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
297 |
apply (rule iffI, simp_all) |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
298 |
apply (drule_tac f=repr in arg_cong, simp add: abst_inv) |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
299 |
done |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
300 |
|
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
301 |
lemma split_Rep: |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
302 |
"split f (Rep_tuple_isomorphism isom) |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
303 |
= f repr abst" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
304 |
by (simp add: split_def repr_def abst_def) |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
305 |
|
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
306 |
lemmas simps = Let_def split_Rep repr_inv abst_inv repr_inj abst_inj |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
307 |
|
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
308 |
lemma istuple_access_update_fst_fst: |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
309 |
"\<lbrakk> f o h g = j o f \<rbrakk> \<Longrightarrow> |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
310 |
(f o istuple_fst isom) o (istuple_fst_update isom o h) g |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
311 |
= j o (f o istuple_fst isom)" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
312 |
by (clarsimp simp: istuple_fst_update_def istuple_fst_def simps |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
313 |
intro!: ext elim!: o_eq_elim) |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
314 |
|
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
315 |
lemma istuple_access_update_snd_snd: |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
316 |
"\<lbrakk> f o h g = j o f \<rbrakk> \<Longrightarrow> |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
317 |
(f o istuple_snd isom) o (istuple_snd_update isom o h) g |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
318 |
= j o (f o istuple_snd isom)" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
319 |
by (clarsimp simp: istuple_snd_update_def istuple_snd_def simps |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
320 |
intro!: ext elim!: o_eq_elim) |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
321 |
|
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
322 |
lemma istuple_access_update_fst_snd: |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
323 |
"(f o istuple_fst isom) o (istuple_snd_update isom o h) g |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
324 |
= id o (f o istuple_fst isom)" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
325 |
by (clarsimp simp: istuple_snd_update_def istuple_fst_def simps |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
326 |
intro!: ext elim!: o_eq_elim) |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
327 |
|
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
328 |
lemma istuple_access_update_snd_fst: |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
329 |
"(f o istuple_snd isom) o (istuple_fst_update isom o h) g |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
330 |
= id o (f o istuple_snd isom)" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
331 |
by (clarsimp simp: istuple_fst_update_def istuple_snd_def simps |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
332 |
intro!: ext elim!: o_eq_elim) |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
333 |
|
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
334 |
lemma istuple_update_swap_fst_fst: |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
335 |
"\<lbrakk> h f o j g = j g o h f \<rbrakk> \<Longrightarrow> |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
336 |
(istuple_fst_update isom o h) f o (istuple_fst_update isom o j) g |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
337 |
= (istuple_fst_update isom o j) g o (istuple_fst_update isom o h) f" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
338 |
by (clarsimp simp: istuple_fst_update_def simps |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
339 |
intro!: ext elim!: o_eq_elim) |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
340 |
|
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
341 |
lemma istuple_update_swap_snd_snd: |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
342 |
"\<lbrakk> h f o j g = j g o h f \<rbrakk> \<Longrightarrow> |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
343 |
(istuple_snd_update isom o h) f o (istuple_snd_update isom o j) g |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
344 |
= (istuple_snd_update isom o j) g o (istuple_snd_update isom o h) f" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
345 |
by (clarsimp simp: istuple_snd_update_def simps |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
346 |
intro!: ext elim!: o_eq_elim) |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
347 |
|
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
348 |
lemma istuple_update_swap_fst_snd: |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
349 |
"(istuple_snd_update isom o h) f o (istuple_fst_update isom o j) g |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
350 |
= (istuple_fst_update isom o j) g o (istuple_snd_update isom o h) f" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
351 |
by (clarsimp simp: istuple_fst_update_def istuple_snd_update_def simps |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
352 |
intro!: ext elim!: o_eq_elim) |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
353 |
|
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
354 |
lemma istuple_update_swap_snd_fst: |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
355 |
"(istuple_fst_update isom o h) f o (istuple_snd_update isom o j) g |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
356 |
= (istuple_snd_update isom o j) g o (istuple_fst_update isom o h) f" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
357 |
by (clarsimp simp: istuple_fst_update_def istuple_snd_update_def simps |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
358 |
intro!: ext elim!: o_eq_elim) |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
359 |
|
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
360 |
lemma istuple_update_compose_fst_fst: |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
361 |
"\<lbrakk> h f o j g = k (f o g) \<rbrakk> \<Longrightarrow> |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
362 |
(istuple_fst_update isom o h) f o (istuple_fst_update isom o j) g |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
363 |
= (istuple_fst_update isom o k) (f o g)" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
364 |
by (fastsimp simp: istuple_fst_update_def simps |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
365 |
intro!: ext elim!: o_eq_elim dest: fun_cong) |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
366 |
|
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
367 |
lemma istuple_update_compose_snd_snd: |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
368 |
"\<lbrakk> h f o j g = k (f o g) \<rbrakk> \<Longrightarrow> |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
369 |
(istuple_snd_update isom o h) f o (istuple_snd_update isom o j) g |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
370 |
= (istuple_snd_update isom o k) (f o g)" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
371 |
by (fastsimp simp: istuple_snd_update_def simps |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
372 |
intro!: ext elim!: o_eq_elim dest: fun_cong) |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
373 |
|
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
374 |
lemma istuple_surjective_proof_assist_step: |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
375 |
"\<lbrakk> istuple_surjective_proof_assist v a (istuple_fst isom o f); |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
376 |
istuple_surjective_proof_assist v b (istuple_snd isom o f) \<rbrakk> |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
377 |
\<Longrightarrow> istuple_surjective_proof_assist v (istuple_cons isom a b) f" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
378 |
by (clarsimp simp: istuple_surjective_proof_assist_def simps |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
379 |
istuple_fst_def istuple_snd_def istuple_cons_def) |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
380 |
|
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
381 |
lemma istuple_fst_update_accessor_cong_assist: |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
382 |
"istuple_update_accessor_cong_assist f g \<Longrightarrow> |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
383 |
istuple_update_accessor_cong_assist (istuple_fst_update isom o f) (g o istuple_fst isom)" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
384 |
by (clarsimp simp: istuple_update_accessor_cong_assist_def simps |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
385 |
istuple_fst_update_def istuple_fst_def) |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
386 |
|
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
387 |
lemma istuple_snd_update_accessor_cong_assist: |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
388 |
"istuple_update_accessor_cong_assist f g \<Longrightarrow> |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
389 |
istuple_update_accessor_cong_assist (istuple_snd_update isom o f) (g o istuple_snd isom)" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
390 |
by (clarsimp simp: istuple_update_accessor_cong_assist_def simps |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
391 |
istuple_snd_update_def istuple_snd_def) |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
392 |
|
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
393 |
lemma istuple_fst_update_accessor_eq_assist: |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
394 |
"istuple_update_accessor_eq_assist f g a u a' v \<Longrightarrow> |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
395 |
istuple_update_accessor_eq_assist (istuple_fst_update isom o f) (g o istuple_fst isom) |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
396 |
(istuple_cons isom a b) u (istuple_cons isom a' b) v" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
397 |
by (clarsimp simp: istuple_update_accessor_eq_assist_def istuple_fst_update_def istuple_fst_def |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
398 |
istuple_update_accessor_cong_assist_def istuple_cons_def simps) |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
399 |
|
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
400 |
lemma istuple_snd_update_accessor_eq_assist: |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
401 |
"istuple_update_accessor_eq_assist f g b u b' v \<Longrightarrow> |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
402 |
istuple_update_accessor_eq_assist (istuple_snd_update isom o f) (g o istuple_snd isom) |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
403 |
(istuple_cons isom a b) u (istuple_cons isom a b') v" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
404 |
by (clarsimp simp: istuple_update_accessor_eq_assist_def istuple_snd_update_def istuple_snd_def |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
405 |
istuple_update_accessor_cong_assist_def istuple_cons_def simps) |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
406 |
|
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
407 |
lemma istuple_cons_conj_eqI: |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
408 |
"\<lbrakk> (a = c \<and> b = d \<and> P) = Q \<rbrakk> \<Longrightarrow> |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
409 |
(istuple_cons isom a b = istuple_cons isom c d \<and> P) = Q" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
410 |
by (clarsimp simp: istuple_cons_def simps) |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
411 |
|
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
412 |
lemmas intros = |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
413 |
istuple_access_update_fst_fst |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
414 |
istuple_access_update_snd_snd |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
415 |
istuple_access_update_fst_snd |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
416 |
istuple_access_update_snd_fst |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
417 |
istuple_update_swap_fst_fst |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
418 |
istuple_update_swap_snd_snd |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
419 |
istuple_update_swap_fst_snd |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
420 |
istuple_update_swap_snd_fst |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
421 |
istuple_update_compose_fst_fst |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
422 |
istuple_update_compose_snd_snd |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
423 |
istuple_surjective_proof_assist_step |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
424 |
istuple_fst_update_accessor_eq_assist |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
425 |
istuple_snd_update_accessor_eq_assist |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
426 |
istuple_fst_update_accessor_cong_assist |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
427 |
istuple_snd_update_accessor_cong_assist |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
428 |
istuple_cons_conj_eqI |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
429 |
|
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
430 |
end |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
431 |
|
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
432 |
lemma isomorphic_tuple_intro: |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
433 |
assumes repr_inj: "\<And>x y. (repr x = repr y) = (x = y)" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
434 |
and abst_inv: "\<And>z. repr (abst z) = z" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
435 |
shows "v \<equiv> TupleIsomorphism repr abst \<Longrightarrow> isomorphic_tuple v" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
436 |
apply (rule isomorphic_tuple.intro, |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
437 |
simp_all add: TupleIsomorphism_def Abs_tuple_isomorphism_inverse |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
438 |
tuple_isomorphism_def abst_inv) |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
439 |
apply (cut_tac x="abst (repr x)" and y="x" in repr_inj) |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
440 |
apply (simp add: abst_inv) |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
441 |
done |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
442 |
|
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
443 |
definition |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
444 |
"tuple_istuple \<equiv> TupleIsomorphism id id" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
445 |
|
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
446 |
lemma tuple_istuple: |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
447 |
"isomorphic_tuple tuple_istuple" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
448 |
by (simp add: isomorphic_tuple_intro[OF _ _ reflexive] tuple_istuple_def) |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
449 |
|
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
450 |
lemma refl_conj_eq: |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
451 |
"Q = R \<Longrightarrow> (P \<and> Q) = (P \<and> R)" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
452 |
by simp |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
453 |
|
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
454 |
lemma meta_all_sameI: |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
455 |
"(\<And>x. PROP P x \<equiv> PROP Q x) \<Longrightarrow> (\<And>x. PROP P x) \<equiv> (\<And>x. PROP Q x)" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
456 |
by simp |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
457 |
|
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
458 |
lemma istuple_UNIV_I: "\<And>x. x\<in>UNIV \<equiv> True" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
459 |
by simp |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
460 |
|
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
461 |
lemma istuple_True_simp: "(True \<Longrightarrow> PROP P) \<equiv> PROP P" |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
462 |
by simp |
f65d74a264dd
Initial response to feedback from Norbert, Makarius on record patch
tsewell@rubicon.NSW.bigpond.net.au
parents:
32745
diff
changeset
|
463 |
|
32744
50406c4951d9
Record patch imported and working.
Thomas Sewell <tsewell@nicta.com.au>
parents:
32743
diff
changeset
|
464 |
use "Tools/record.ML" |
50406c4951d9
Record patch imported and working.
Thomas Sewell <tsewell@nicta.com.au>
parents:
32743
diff
changeset
|
465 |
setup Record.setup |
10641 | 466 |
|
4870
cc36acb5b114
Extensible records with structural subtyping in HOL. See
wenzelm
parents:
diff
changeset
|
467 |
end |