src/HOL/Word/Misc_Typedef.thy
author wenzelm
Thu, 15 Feb 2018 12:11:00 +0100
changeset 67613 ce654b0e6d69
parent 67408 4a4c14b24800
child 71942 d2654b30f7bd
permissions -rw-r--r--
more symbols;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
65363
5eb619751b14 misc tuning and modernization;
wenzelm
parents: 61941
diff changeset
     1
(*
44939
5930d35c976d removed unused legacy lemma names, some comment cleanup.
kleing
parents: 39302
diff changeset
     2
  Author:     Jeremy Dawson and Gerwin Klein, NICTA
24333
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
     3
53062
3af1a6020014 some vague grouping of related theorems, with slight tuning of headings and sorting out of dubious lemmas into separate theory
haftmann
parents: 49739
diff changeset
     4
  Consequences of type definition theorems, and of extended type definition.
24333
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
     5
*)
24350
4d74f37c6367 headers for document generation
huffman
parents: 24333
diff changeset
     6
61799
4cf66f21b764 isabelle update_cartouches -c -t;
wenzelm
parents: 59807
diff changeset
     7
section \<open>Type Definition Theorems\<close>
24350
4d74f37c6367 headers for document generation
huffman
parents: 24333
diff changeset
     8
37655
f4d616d41a59 more speaking theory names
haftmann
parents: 30971
diff changeset
     9
theory Misc_Typedef
67120
491fd7f0b5df misc tuning and modernization;
wenzelm
parents: 65363
diff changeset
    10
  imports Main
26560
haftmann
parents: 25262
diff changeset
    11
begin
24333
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
    12
25262
d0928156e326 Added reference to Jeremy Dawson's paper on the word library.
kleing
parents: 24350
diff changeset
    13
section "More lemmas about normal type definitions"
d0928156e326 Added reference to Jeremy Dawson's paper on the word library.
kleing
parents: 24350
diff changeset
    14
67120
491fd7f0b5df misc tuning and modernization;
wenzelm
parents: 65363
diff changeset
    15
lemma tdD1: "type_definition Rep Abs A \<Longrightarrow> \<forall>x. Rep x \<in> A"
491fd7f0b5df misc tuning and modernization;
wenzelm
parents: 65363
diff changeset
    16
  and tdD2: "type_definition Rep Abs A \<Longrightarrow> \<forall>x. Abs (Rep x) = x"
491fd7f0b5df misc tuning and modernization;
wenzelm
parents: 65363
diff changeset
    17
  and tdD3: "type_definition Rep Abs A \<Longrightarrow> \<forall>y. y \<in> A \<longrightarrow> Rep (Abs y) = y"
24333
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
    18
  by (auto simp: type_definition_def)
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
    19
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 67120
diff changeset
    20
lemma td_nat_int: "type_definition int nat (Collect ((\<le>) 0))"
24333
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
    21
  unfolding type_definition_def by auto
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
    22
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
    23
context type_definition
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
    24
begin
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
    25
45538
1fffa81b9b83 eliminated slightly odd Rep' with dynamically-scoped [simplified];
wenzelm
parents: 44939
diff changeset
    26
declare Rep [iff] Rep_inverse [simp] Rep_inject [simp]
24333
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
    27
67120
491fd7f0b5df misc tuning and modernization;
wenzelm
parents: 65363
diff changeset
    28
lemma Abs_eqD: "Abs x = Abs y \<Longrightarrow> x \<in> A \<Longrightarrow> y \<in> A \<Longrightarrow> x = y"
24333
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
    29
  by (simp add: Abs_inject)
65363
5eb619751b14 misc tuning and modernization;
wenzelm
parents: 61941
diff changeset
    30
67120
491fd7f0b5df misc tuning and modernization;
wenzelm
parents: 65363
diff changeset
    31
lemma Abs_inverse': "r \<in> A \<Longrightarrow> Abs r = a \<Longrightarrow> Rep a = r"
24333
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
    32
  by (safe elim!: Abs_inverse)
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
    33
67120
491fd7f0b5df misc tuning and modernization;
wenzelm
parents: 65363
diff changeset
    34
lemma Rep_comp_inverse: "Rep \<circ> f = g \<Longrightarrow> Abs \<circ> g = f"
45538
1fffa81b9b83 eliminated slightly odd Rep' with dynamically-scoped [simplified];
wenzelm
parents: 44939
diff changeset
    35
  using Rep_inverse by auto
24333
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
    36
67120
491fd7f0b5df misc tuning and modernization;
wenzelm
parents: 65363
diff changeset
    37
lemma Rep_eqD [elim!]: "Rep x = Rep y \<Longrightarrow> x = y"
24333
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
    38
  by simp
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
    39
67120
491fd7f0b5df misc tuning and modernization;
wenzelm
parents: 65363
diff changeset
    40
lemma Rep_inverse': "Rep a = r \<Longrightarrow> Abs r = a"
24333
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
    41
  by (safe intro!: Rep_inverse)
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
    42
67120
491fd7f0b5df misc tuning and modernization;
wenzelm
parents: 65363
diff changeset
    43
lemma comp_Abs_inverse: "f \<circ> Abs = g \<Longrightarrow> g \<circ> Rep = f"
45538
1fffa81b9b83 eliminated slightly odd Rep' with dynamically-scoped [simplified];
wenzelm
parents: 44939
diff changeset
    44
  using Rep_inverse by auto
24333
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
    45
67120
491fd7f0b5df misc tuning and modernization;
wenzelm
parents: 65363
diff changeset
    46
lemma set_Rep: "A = range Rep"
39302
d7728f65b353 renamed lemmas: ext_iff -> fun_eq_iff, set_ext_iff -> set_eq_iff, set_ext -> set_eqI
nipkow
parents: 37655
diff changeset
    47
proof (rule set_eqI)
67120
491fd7f0b5df misc tuning and modernization;
wenzelm
parents: 65363
diff changeset
    48
  show "x \<in> A \<longleftrightarrow> x \<in> range Rep" for x
24333
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
    49
    by (auto dest: Abs_inverse [of x, symmetric])
65363
5eb619751b14 misc tuning and modernization;
wenzelm
parents: 61941
diff changeset
    50
qed
24333
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
    51
65363
5eb619751b14 misc tuning and modernization;
wenzelm
parents: 61941
diff changeset
    52
lemma set_Rep_Abs: "A = range (Rep \<circ> Abs)"
39302
d7728f65b353 renamed lemmas: ext_iff -> fun_eq_iff, set_ext_iff -> set_eq_iff, set_ext -> set_eqI
nipkow
parents: 37655
diff changeset
    53
proof (rule set_eqI)
67120
491fd7f0b5df misc tuning and modernization;
wenzelm
parents: 65363
diff changeset
    54
  show "x \<in> A \<longleftrightarrow> x \<in> range (Rep \<circ> Abs)" for x
24333
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
    55
    by (auto dest: Abs_inverse [of x, symmetric])
65363
5eb619751b14 misc tuning and modernization;
wenzelm
parents: 61941
diff changeset
    56
qed
24333
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
    57
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
    58
lemma Abs_inj_on: "inj_on Abs A"
65363
5eb619751b14 misc tuning and modernization;
wenzelm
parents: 61941
diff changeset
    59
  unfolding inj_on_def
24333
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
    60
  by (auto dest: Abs_inject [THEN iffD1])
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
    61
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
    62
lemma image: "Abs ` A = UNIV"
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
    63
  by (auto intro!: image_eqI)
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
    64
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
    65
lemmas td_thm = type_definition_axioms
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
    66
67120
491fd7f0b5df misc tuning and modernization;
wenzelm
parents: 65363
diff changeset
    67
lemma fns1: "Rep \<circ> fa = fr \<circ> Rep \<or> fa \<circ> Abs = Abs \<circ> fr \<Longrightarrow> Abs \<circ> fr \<circ> Rep = fa"
24333
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
    68
  by (auto dest: Rep_comp_inverse elim: comp_Abs_inverse simp: o_assoc)
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
    69
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
    70
lemmas fns1a = disjI1 [THEN fns1]
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
    71
lemmas fns1b = disjI2 [THEN fns1]
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
    72
67120
491fd7f0b5df misc tuning and modernization;
wenzelm
parents: 65363
diff changeset
    73
lemma fns4: "Rep \<circ> fa \<circ> Abs = fr \<Longrightarrow> Rep \<circ> fa = fr \<circ> Rep \<and> fa \<circ> Abs = Abs \<circ> fr"
45538
1fffa81b9b83 eliminated slightly odd Rep' with dynamically-scoped [simplified];
wenzelm
parents: 44939
diff changeset
    74
  by auto
24333
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
    75
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
    76
end
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
    77
67399
eab6ce8368fa ran isabelle update_op on all sources
nipkow
parents: 67120
diff changeset
    78
interpretation nat_int: type_definition int nat "Collect ((\<le>) 0)"
24333
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
    79
  by (rule td_nat_int)
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
    80
27138
63fdfcf6c7a3 proper deletion of nat cases/induct rules from type_definition;
wenzelm
parents: 27135
diff changeset
    81
declare
63fdfcf6c7a3 proper deletion of nat cases/induct rules from type_definition;
wenzelm
parents: 27135
diff changeset
    82
  nat_int.Rep_cases [cases del]
63fdfcf6c7a3 proper deletion of nat cases/induct rules from type_definition;
wenzelm
parents: 27135
diff changeset
    83
  nat_int.Abs_cases [cases del]
63fdfcf6c7a3 proper deletion of nat cases/induct rules from type_definition;
wenzelm
parents: 27135
diff changeset
    84
  nat_int.Rep_induct [induct del]
63fdfcf6c7a3 proper deletion of nat cases/induct rules from type_definition;
wenzelm
parents: 27135
diff changeset
    85
  nat_int.Abs_induct [induct del]
24333
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
    86
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
    87
24350
4d74f37c6367 headers for document generation
huffman
parents: 24333
diff changeset
    88
subsection "Extended form of type definition predicate"
24333
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
    89
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
    90
lemma td_conds:
67120
491fd7f0b5df misc tuning and modernization;
wenzelm
parents: 65363
diff changeset
    91
  "norm \<circ> norm = norm \<Longrightarrow>
491fd7f0b5df misc tuning and modernization;
wenzelm
parents: 65363
diff changeset
    92
    fr \<circ> norm = norm \<circ> fr \<longleftrightarrow> norm \<circ> fr \<circ> norm = fr \<circ> norm \<and> norm \<circ> fr \<circ> norm = norm \<circ> fr"
24333
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
    93
  apply safe
49739
13aa6d8268ec consolidated names of theorems on composition;
haftmann
parents: 45604
diff changeset
    94
    apply (simp_all add: comp_assoc)
24333
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
    95
   apply (simp_all add: o_assoc)
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
    96
  done
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
    97
67120
491fd7f0b5df misc tuning and modernization;
wenzelm
parents: 65363
diff changeset
    98
lemma fn_comm_power: "fa \<circ> tr = tr \<circ> fr \<Longrightarrow> fa ^^ n \<circ> tr = tr \<circ> fr ^^ n"
65363
5eb619751b14 misc tuning and modernization;
wenzelm
parents: 61941
diff changeset
    99
  apply (rule ext)
24333
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   100
  apply (induct n)
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   101
   apply (auto dest: fun_cong)
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   102
  done
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   103
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   104
lemmas fn_comm_power' =
45604
29cf40fe8daf eliminated obsolete "standard";
wenzelm
parents: 45538
diff changeset
   105
  ext [THEN fn_comm_power, THEN fun_cong, unfolded o_def]
24333
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   106
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   107
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   108
locale td_ext = type_definition +
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   109
  fixes norm
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   110
  assumes eq_norm: "\<And>x. Rep (Abs x) = norm x"
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   111
begin
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   112
67120
491fd7f0b5df misc tuning and modernization;
wenzelm
parents: 65363
diff changeset
   113
lemma Abs_norm [simp]: "Abs (norm x) = Abs x"
24333
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   114
  using eq_norm [of x] by (auto elim: Rep_inverse')
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   115
67120
491fd7f0b5df misc tuning and modernization;
wenzelm
parents: 65363
diff changeset
   116
lemma td_th: "g \<circ> Abs = f \<Longrightarrow> f (Rep x) = g x"
24333
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   117
  by (drule comp_Abs_inverse [symmetric]) simp
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   118
65363
5eb619751b14 misc tuning and modernization;
wenzelm
parents: 61941
diff changeset
   119
lemma eq_norm': "Rep \<circ> Abs = norm"
45538
1fffa81b9b83 eliminated slightly odd Rep' with dynamically-scoped [simplified];
wenzelm
parents: 44939
diff changeset
   120
  by (auto simp: eq_norm)
24333
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   121
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   122
lemma norm_Rep [simp]: "norm (Rep x) = Rep x"
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   123
  by (auto simp: eq_norm' intro: td_th)
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   124
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   125
lemmas td = td_thm
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   126
67613
ce654b0e6d69 more symbols;
wenzelm
parents: 67408
diff changeset
   127
lemma set_iff_norm: "w \<in> A \<longleftrightarrow> w = norm w"
24333
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   128
  by (auto simp: set_Rep_Abs eq_norm' eq_norm [symmetric])
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   129
67120
491fd7f0b5df misc tuning and modernization;
wenzelm
parents: 65363
diff changeset
   130
lemma inverse_norm: "Abs n = w \<longleftrightarrow> Rep w = norm n"
24333
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   131
  apply (rule iffI)
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   132
   apply (clarsimp simp add: eq_norm)
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   133
  apply (simp add: eq_norm' [symmetric])
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   134
  done
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   135
67120
491fd7f0b5df misc tuning and modernization;
wenzelm
parents: 65363
diff changeset
   136
lemma norm_eq_iff: "norm x = norm y \<longleftrightarrow> Abs x = Abs y"
24333
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   137
  by (simp add: eq_norm' [symmetric])
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   138
65363
5eb619751b14 misc tuning and modernization;
wenzelm
parents: 61941
diff changeset
   139
lemma norm_comps:
5eb619751b14 misc tuning and modernization;
wenzelm
parents: 61941
diff changeset
   140
  "Abs \<circ> norm = Abs"
5eb619751b14 misc tuning and modernization;
wenzelm
parents: 61941
diff changeset
   141
  "norm \<circ> Rep = Rep"
5eb619751b14 misc tuning and modernization;
wenzelm
parents: 61941
diff changeset
   142
  "norm \<circ> norm = norm"
24333
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   143
  by (auto simp: eq_norm' [symmetric] o_def)
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   144
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   145
lemmas norm_norm [simp] = norm_comps
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   146
67120
491fd7f0b5df misc tuning and modernization;
wenzelm
parents: 65363
diff changeset
   147
lemma fns5: "Rep \<circ> fa \<circ> Abs = fr \<Longrightarrow> fr \<circ> norm = fr \<and> norm \<circ> fr = fr"
45538
1fffa81b9b83 eliminated slightly odd Rep' with dynamically-scoped [simplified];
wenzelm
parents: 44939
diff changeset
   148
  by (fold eq_norm') auto
24333
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   149
67408
4a4c14b24800 prefer formal comments;
wenzelm
parents: 67399
diff changeset
   150
text \<open>
4a4c14b24800 prefer formal comments;
wenzelm
parents: 67399
diff changeset
   151
  following give conditions for converses to \<open>td_fns1\<close>
4a4c14b24800 prefer formal comments;
wenzelm
parents: 67399
diff changeset
   152
  \<^item> the condition \<open>norm \<circ> fr \<circ> norm = fr \<circ> norm\<close> says that
4a4c14b24800 prefer formal comments;
wenzelm
parents: 67399
diff changeset
   153
    \<open>fr\<close> takes normalised arguments to normalised results
4a4c14b24800 prefer formal comments;
wenzelm
parents: 67399
diff changeset
   154
  \<^item> \<open>norm \<circ> fr \<circ> norm = norm \<circ> fr\<close> says that \<open>fr\<close>
4a4c14b24800 prefer formal comments;
wenzelm
parents: 67399
diff changeset
   155
    takes norm-equivalent arguments to norm-equivalent results
4a4c14b24800 prefer formal comments;
wenzelm
parents: 67399
diff changeset
   156
  \<^item> \<open>fr \<circ> norm = fr\<close> says that \<open>fr\<close>
4a4c14b24800 prefer formal comments;
wenzelm
parents: 67399
diff changeset
   157
    takes norm-equivalent arguments to the same result
4a4c14b24800 prefer formal comments;
wenzelm
parents: 67399
diff changeset
   158
  \<^item> \<open>norm \<circ> fr = fr\<close> says that \<open>fr\<close> takes any argument to a normalised result
4a4c14b24800 prefer formal comments;
wenzelm
parents: 67399
diff changeset
   159
\<close>
67120
491fd7f0b5df misc tuning and modernization;
wenzelm
parents: 65363
diff changeset
   160
lemma fns2: "Abs \<circ> fr \<circ> Rep = fa \<Longrightarrow> norm \<circ> fr \<circ> norm = fr \<circ> norm \<longleftrightarrow> Rep \<circ> fa = fr \<circ> Rep"
24333
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   161
  apply (fold eq_norm')
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   162
  apply safe
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   163
   prefer 2
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   164
   apply (simp add: o_assoc)
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   165
  apply (rule ext)
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   166
  apply (drule_tac x="Rep x" in fun_cong)
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   167
  apply auto
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   168
  done
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   169
67120
491fd7f0b5df misc tuning and modernization;
wenzelm
parents: 65363
diff changeset
   170
lemma fns3: "Abs \<circ> fr \<circ> Rep = fa \<Longrightarrow> norm \<circ> fr \<circ> norm = norm \<circ> fr \<longleftrightarrow> fa \<circ> Abs = Abs \<circ> fr"
24333
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   171
  apply (fold eq_norm')
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   172
  apply safe
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   173
   prefer 2
49739
13aa6d8268ec consolidated names of theorems on composition;
haftmann
parents: 45604
diff changeset
   174
   apply (simp add: comp_assoc)
24333
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   175
  apply (rule ext)
65363
5eb619751b14 misc tuning and modernization;
wenzelm
parents: 61941
diff changeset
   176
  apply (drule_tac f="a \<circ> b" for a b in fun_cong)
24333
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   177
  apply simp
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   178
  done
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   179
67120
491fd7f0b5df misc tuning and modernization;
wenzelm
parents: 65363
diff changeset
   180
lemma fns: "fr \<circ> norm = norm \<circ> fr \<Longrightarrow> fa \<circ> Abs = Abs \<circ> fr \<longleftrightarrow> Rep \<circ> fa = fr \<circ> Rep"
24333
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   181
  apply safe
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   182
   apply (frule fns1b)
65363
5eb619751b14 misc tuning and modernization;
wenzelm
parents: 61941
diff changeset
   183
   prefer 2
5eb619751b14 misc tuning and modernization;
wenzelm
parents: 61941
diff changeset
   184
   apply (frule fns1a)
24333
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   185
   apply (rule fns3 [THEN iffD1])
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   186
     prefer 3
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   187
     apply (rule fns2 [THEN iffD1])
49739
13aa6d8268ec consolidated names of theorems on composition;
haftmann
parents: 45604
diff changeset
   188
       apply (simp_all add: comp_assoc)
24333
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   189
   apply (simp_all add: o_assoc)
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   190
  done
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   191
67120
491fd7f0b5df misc tuning and modernization;
wenzelm
parents: 65363
diff changeset
   192
lemma range_norm: "range (Rep \<circ> Abs) = A"
24333
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   193
  by (simp add: set_Rep_Abs)
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   194
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   195
end
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   196
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   197
lemmas td_ext_def' =
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   198
  td_ext_def [unfolded type_definition_def td_ext_axioms_def]
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   199
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   200
end
e77ea0ea7f2c * HOL-Word:
kleing
parents:
diff changeset
   201