src/HOLCF/Domain_Aux.thy
author huffman
Mon, 08 Mar 2010 08:12:48 -0800
changeset 35652 05ca920cd94b
child 35653 f87132febfac
permissions -rw-r--r--
move take-proofs stuff into new theory Domain_Aux.thy
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
35652
05ca920cd94b move take-proofs stuff into new theory Domain_Aux.thy
huffman
parents:
diff changeset
     1
(*  Title:      HOLCF/Domain_Aux.thy
05ca920cd94b move take-proofs stuff into new theory Domain_Aux.thy
huffman
parents:
diff changeset
     2
    Author:     Brian Huffman
05ca920cd94b move take-proofs stuff into new theory Domain_Aux.thy
huffman
parents:
diff changeset
     3
*)
05ca920cd94b move take-proofs stuff into new theory Domain_Aux.thy
huffman
parents:
diff changeset
     4
05ca920cd94b move take-proofs stuff into new theory Domain_Aux.thy
huffman
parents:
diff changeset
     5
header {* Domain package support *}
05ca920cd94b move take-proofs stuff into new theory Domain_Aux.thy
huffman
parents:
diff changeset
     6
05ca920cd94b move take-proofs stuff into new theory Domain_Aux.thy
huffman
parents:
diff changeset
     7
theory Domain_Aux
05ca920cd94b move take-proofs stuff into new theory Domain_Aux.thy
huffman
parents:
diff changeset
     8
imports Ssum Sprod Fixrec
05ca920cd94b move take-proofs stuff into new theory Domain_Aux.thy
huffman
parents:
diff changeset
     9
uses
05ca920cd94b move take-proofs stuff into new theory Domain_Aux.thy
huffman
parents:
diff changeset
    10
  ("Tools/Domain/domain_take_proofs.ML")
05ca920cd94b move take-proofs stuff into new theory Domain_Aux.thy
huffman
parents:
diff changeset
    11
begin
05ca920cd94b move take-proofs stuff into new theory Domain_Aux.thy
huffman
parents:
diff changeset
    12
05ca920cd94b move take-proofs stuff into new theory Domain_Aux.thy
huffman
parents:
diff changeset
    13
subsection {* Proofs about take functions *}
05ca920cd94b move take-proofs stuff into new theory Domain_Aux.thy
huffman
parents:
diff changeset
    14
05ca920cd94b move take-proofs stuff into new theory Domain_Aux.thy
huffman
parents:
diff changeset
    15
text {*
05ca920cd94b move take-proofs stuff into new theory Domain_Aux.thy
huffman
parents:
diff changeset
    16
  This section contains lemmas that are used in a module that supports
05ca920cd94b move take-proofs stuff into new theory Domain_Aux.thy
huffman
parents:
diff changeset
    17
  the domain isomorphism package; the module contains proofs related
05ca920cd94b move take-proofs stuff into new theory Domain_Aux.thy
huffman
parents:
diff changeset
    18
  to take functions and the finiteness predicate.
05ca920cd94b move take-proofs stuff into new theory Domain_Aux.thy
huffman
parents:
diff changeset
    19
*}
05ca920cd94b move take-proofs stuff into new theory Domain_Aux.thy
huffman
parents:
diff changeset
    20
05ca920cd94b move take-proofs stuff into new theory Domain_Aux.thy
huffman
parents:
diff changeset
    21
lemma deflation_abs_rep:
05ca920cd94b move take-proofs stuff into new theory Domain_Aux.thy
huffman
parents:
diff changeset
    22
  fixes abs and rep and d
05ca920cd94b move take-proofs stuff into new theory Domain_Aux.thy
huffman
parents:
diff changeset
    23
  assumes abs_iso: "\<And>x. rep\<cdot>(abs\<cdot>x) = x"
05ca920cd94b move take-proofs stuff into new theory Domain_Aux.thy
huffman
parents:
diff changeset
    24
  assumes rep_iso: "\<And>y. abs\<cdot>(rep\<cdot>y) = y"
05ca920cd94b move take-proofs stuff into new theory Domain_Aux.thy
huffman
parents:
diff changeset
    25
  shows "deflation d \<Longrightarrow> deflation (abs oo d oo rep)"
05ca920cd94b move take-proofs stuff into new theory Domain_Aux.thy
huffman
parents:
diff changeset
    26
by (rule ep_pair.deflation_e_d_p) (simp add: ep_pair.intro assms)
05ca920cd94b move take-proofs stuff into new theory Domain_Aux.thy
huffman
parents:
diff changeset
    27
05ca920cd94b move take-proofs stuff into new theory Domain_Aux.thy
huffman
parents:
diff changeset
    28
lemma deflation_chain_min:
05ca920cd94b move take-proofs stuff into new theory Domain_Aux.thy
huffman
parents:
diff changeset
    29
  assumes chain: "chain d"
05ca920cd94b move take-proofs stuff into new theory Domain_Aux.thy
huffman
parents:
diff changeset
    30
  assumes defl: "\<And>n. deflation (d n)"
05ca920cd94b move take-proofs stuff into new theory Domain_Aux.thy
huffman
parents:
diff changeset
    31
  shows "d m\<cdot>(d n\<cdot>x) = d (min m n)\<cdot>x"
05ca920cd94b move take-proofs stuff into new theory Domain_Aux.thy
huffman
parents:
diff changeset
    32
proof (rule linorder_le_cases)
05ca920cd94b move take-proofs stuff into new theory Domain_Aux.thy
huffman
parents:
diff changeset
    33
  assume "m \<le> n"
05ca920cd94b move take-proofs stuff into new theory Domain_Aux.thy
huffman
parents:
diff changeset
    34
  with chain have "d m \<sqsubseteq> d n" by (rule chain_mono)
05ca920cd94b move take-proofs stuff into new theory Domain_Aux.thy
huffman
parents:
diff changeset
    35
  then have "d m\<cdot>(d n\<cdot>x) = d m\<cdot>x"
05ca920cd94b move take-proofs stuff into new theory Domain_Aux.thy
huffman
parents:
diff changeset
    36
    by (rule deflation_below_comp1 [OF defl defl])
05ca920cd94b move take-proofs stuff into new theory Domain_Aux.thy
huffman
parents:
diff changeset
    37
  moreover from `m \<le> n` have "min m n = m" by simp
05ca920cd94b move take-proofs stuff into new theory Domain_Aux.thy
huffman
parents:
diff changeset
    38
  ultimately show ?thesis by simp
05ca920cd94b move take-proofs stuff into new theory Domain_Aux.thy
huffman
parents:
diff changeset
    39
next
05ca920cd94b move take-proofs stuff into new theory Domain_Aux.thy
huffman
parents:
diff changeset
    40
  assume "n \<le> m"
05ca920cd94b move take-proofs stuff into new theory Domain_Aux.thy
huffman
parents:
diff changeset
    41
  with chain have "d n \<sqsubseteq> d m" by (rule chain_mono)
05ca920cd94b move take-proofs stuff into new theory Domain_Aux.thy
huffman
parents:
diff changeset
    42
  then have "d m\<cdot>(d n\<cdot>x) = d n\<cdot>x"
05ca920cd94b move take-proofs stuff into new theory Domain_Aux.thy
huffman
parents:
diff changeset
    43
    by (rule deflation_below_comp2 [OF defl defl])
05ca920cd94b move take-proofs stuff into new theory Domain_Aux.thy
huffman
parents:
diff changeset
    44
  moreover from `n \<le> m` have "min m n = n" by simp
05ca920cd94b move take-proofs stuff into new theory Domain_Aux.thy
huffman
parents:
diff changeset
    45
  ultimately show ?thesis by simp
05ca920cd94b move take-proofs stuff into new theory Domain_Aux.thy
huffman
parents:
diff changeset
    46
qed
05ca920cd94b move take-proofs stuff into new theory Domain_Aux.thy
huffman
parents:
diff changeset
    47
05ca920cd94b move take-proofs stuff into new theory Domain_Aux.thy
huffman
parents:
diff changeset
    48
use "Tools/Domain/domain_take_proofs.ML"
05ca920cd94b move take-proofs stuff into new theory Domain_Aux.thy
huffman
parents:
diff changeset
    49
05ca920cd94b move take-proofs stuff into new theory Domain_Aux.thy
huffman
parents:
diff changeset
    50
end