src/LCF/ex/Ex1.thy
author haftmann
Mon, 05 Jul 2010 15:12:20 +0200
changeset 37715 44b27ea94a16
parent 35762 af3ff2ba4c54
child 47025 b2b8ae61d6ad
permissions -rw-r--r--
tuned proof
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
17248
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 4905
diff changeset
     1
header {*  Section 10.4 *}
4905
be73ddff6c5a proper thy files;
wenzelm
parents:
diff changeset
     2
17248
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 4905
diff changeset
     3
theory Ex1
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 4905
diff changeset
     4
imports LCF
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 4905
diff changeset
     5
begin
4905
be73ddff6c5a proper thy files;
wenzelm
parents:
diff changeset
     6
be73ddff6c5a proper thy files;
wenzelm
parents:
diff changeset
     7
consts
17248
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 4905
diff changeset
     8
  P     :: "'a => tr"
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 4905
diff changeset
     9
  G     :: "'a => 'a"
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 4905
diff changeset
    10
  H     :: "'a => 'a"
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 4905
diff changeset
    11
  K     :: "('a => 'a) => ('a => 'a)"
4905
be73ddff6c5a proper thy files;
wenzelm
parents:
diff changeset
    12
17248
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 4905
diff changeset
    13
axioms
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 4905
diff changeset
    14
  P_strict:     "P(UU) = UU"
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 4905
diff changeset
    15
  K:            "K = (%h x. P(x) => x | h(h(G(x))))"
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 4905
diff changeset
    16
  H:            "H = FIX(K)"
81bf91654e73 converted to Isar theory format;
wenzelm
parents: 4905
diff changeset
    17
19755
90f80de04c46 removed obsolete ML files;
wenzelm
parents: 17248
diff changeset
    18
90f80de04c46 removed obsolete ML files;
wenzelm
parents: 17248
diff changeset
    19
declare P_strict [simp] K [simp]
90f80de04c46 removed obsolete ML files;
wenzelm
parents: 17248
diff changeset
    20
90f80de04c46 removed obsolete ML files;
wenzelm
parents: 17248
diff changeset
    21
lemma H_unfold: "H = K(H)"
90f80de04c46 removed obsolete ML files;
wenzelm
parents: 17248
diff changeset
    22
  apply (simplesubst H)
90f80de04c46 removed obsolete ML files;
wenzelm
parents: 17248
diff changeset
    23
  apply (rule FIX_eq [symmetric])
90f80de04c46 removed obsolete ML files;
wenzelm
parents: 17248
diff changeset
    24
  done
90f80de04c46 removed obsolete ML files;
wenzelm
parents: 17248
diff changeset
    25
90f80de04c46 removed obsolete ML files;
wenzelm
parents: 17248
diff changeset
    26
lemma H_strict [simp]: "H(UU)=UU"
90f80de04c46 removed obsolete ML files;
wenzelm
parents: 17248
diff changeset
    27
  apply (simplesubst H_unfold)
90f80de04c46 removed obsolete ML files;
wenzelm
parents: 17248
diff changeset
    28
  apply simp
90f80de04c46 removed obsolete ML files;
wenzelm
parents: 17248
diff changeset
    29
  done
90f80de04c46 removed obsolete ML files;
wenzelm
parents: 17248
diff changeset
    30
90f80de04c46 removed obsolete ML files;
wenzelm
parents: 17248
diff changeset
    31
lemma H_idemp_lemma: "ALL x. H(FIX(K,x)) = FIX(K,x)"
27208
5fe899199f85 proper context for tactics derived from res_inst_tac;
wenzelm
parents: 19755
diff changeset
    32
  apply (tactic {* induct_tac @{context} "K" 1 *})
19755
90f80de04c46 removed obsolete ML files;
wenzelm
parents: 17248
diff changeset
    33
  apply (simp (no_asm))
90f80de04c46 removed obsolete ML files;
wenzelm
parents: 17248
diff changeset
    34
  apply (simp (no_asm) split: COND_cases_iff)
90f80de04c46 removed obsolete ML files;
wenzelm
parents: 17248
diff changeset
    35
  apply (intro strip)
90f80de04c46 removed obsolete ML files;
wenzelm
parents: 17248
diff changeset
    36
  apply (subst H_unfold)
90f80de04c46 removed obsolete ML files;
wenzelm
parents: 17248
diff changeset
    37
  apply (simp (no_asm_simp))
90f80de04c46 removed obsolete ML files;
wenzelm
parents: 17248
diff changeset
    38
  done
90f80de04c46 removed obsolete ML files;
wenzelm
parents: 17248
diff changeset
    39
90f80de04c46 removed obsolete ML files;
wenzelm
parents: 17248
diff changeset
    40
lemma H_idemp: "ALL x. H(H(x)) = H(x)"
90f80de04c46 removed obsolete ML files;
wenzelm
parents: 17248
diff changeset
    41
  apply (rule H_idemp_lemma [folded H])
90f80de04c46 removed obsolete ML files;
wenzelm
parents: 17248
diff changeset
    42
  done
4905
be73ddff6c5a proper thy files;
wenzelm
parents:
diff changeset
    43
be73ddff6c5a proper thy files;
wenzelm
parents:
diff changeset
    44
end