Unused.thy
author Christian Urban <urbanc@in.tum.de>
Fri, 15 Jan 2010 17:09:36 +0100
changeset 895 92c43c96027e
parent 870 2a19e0a37131
child 912 aa960d16570f
permissions -rw-r--r--
added a partial proof under which conditions rlam_rec Respects alpha...I guess something like this is true; this means the Hom lemmas need to have preconditions
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
226
2a28e7ef3048 cleaned FSet
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 101
diff changeset
     1
(*notation ( output) "prop" ("#_" [1000] 1000) *)
2a28e7ef3048 cleaned FSet
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 101
diff changeset
     2
notation ( output) "Trueprop" ("#_" [1000] 1000)
101
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
     3
806
43336511993f Readded 'regularize_to_injection' which I believe will be needed.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 685
diff changeset
     4
lemma regularize_to_injection:
43336511993f Readded 'regularize_to_injection' which I believe will be needed.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 685
diff changeset
     5
  shows "(QUOT_TRUE l \<Longrightarrow> y) \<Longrightarrow> (l = r) \<longrightarrow> y"
43336511993f Readded 'regularize_to_injection' which I believe will be needed.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 685
diff changeset
     6
  by(auto simp add: QUOT_TRUE_def)
43336511993f Readded 'regularize_to_injection' which I believe will be needed.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 685
diff changeset
     7
43336511993f Readded 'regularize_to_injection' which I believe will be needed.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 685
diff changeset
     8
43336511993f Readded 'regularize_to_injection' which I believe will be needed.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 685
diff changeset
     9
870
2a19e0a37131 Remove SOLVED from quotient_tac. Move atomize_eqv to 'Unused'.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 806
diff changeset
    10
(* Atomize infrastructure *)
2a19e0a37131 Remove SOLVED from quotient_tac. Move atomize_eqv to 'Unused'.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 806
diff changeset
    11
(* FIXME/TODO: is this really needed? *)
2a19e0a37131 Remove SOLVED from quotient_tac. Move atomize_eqv to 'Unused'.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 806
diff changeset
    12
(*
2a19e0a37131 Remove SOLVED from quotient_tac. Move atomize_eqv to 'Unused'.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 806
diff changeset
    13
lemma atomize_eqv:
2a19e0a37131 Remove SOLVED from quotient_tac. Move atomize_eqv to 'Unused'.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 806
diff changeset
    14
  shows "(Trueprop A \<equiv> Trueprop B) \<equiv> (A \<equiv> B)"
2a19e0a37131 Remove SOLVED from quotient_tac. Move atomize_eqv to 'Unused'.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 806
diff changeset
    15
proof
2a19e0a37131 Remove SOLVED from quotient_tac. Move atomize_eqv to 'Unused'.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 806
diff changeset
    16
  assume "A \<equiv> B"
2a19e0a37131 Remove SOLVED from quotient_tac. Move atomize_eqv to 'Unused'.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 806
diff changeset
    17
  then show "Trueprop A \<equiv> Trueprop B" by unfold
2a19e0a37131 Remove SOLVED from quotient_tac. Move atomize_eqv to 'Unused'.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 806
diff changeset
    18
next
2a19e0a37131 Remove SOLVED from quotient_tac. Move atomize_eqv to 'Unused'.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 806
diff changeset
    19
  assume *: "Trueprop A \<equiv> Trueprop B"
2a19e0a37131 Remove SOLVED from quotient_tac. Move atomize_eqv to 'Unused'.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 806
diff changeset
    20
  have "A = B"
2a19e0a37131 Remove SOLVED from quotient_tac. Move atomize_eqv to 'Unused'.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 806
diff changeset
    21
  proof (cases A)
2a19e0a37131 Remove SOLVED from quotient_tac. Move atomize_eqv to 'Unused'.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 806
diff changeset
    22
    case True
2a19e0a37131 Remove SOLVED from quotient_tac. Move atomize_eqv to 'Unused'.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 806
diff changeset
    23
    have "A" by fact
2a19e0a37131 Remove SOLVED from quotient_tac. Move atomize_eqv to 'Unused'.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 806
diff changeset
    24
    then show "A = B" using * by simp
2a19e0a37131 Remove SOLVED from quotient_tac. Move atomize_eqv to 'Unused'.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 806
diff changeset
    25
  next
2a19e0a37131 Remove SOLVED from quotient_tac. Move atomize_eqv to 'Unused'.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 806
diff changeset
    26
    case False
2a19e0a37131 Remove SOLVED from quotient_tac. Move atomize_eqv to 'Unused'.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 806
diff changeset
    27
    have "\<not>A" by fact
2a19e0a37131 Remove SOLVED from quotient_tac. Move atomize_eqv to 'Unused'.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 806
diff changeset
    28
    then show "A = B" using * by auto
2a19e0a37131 Remove SOLVED from quotient_tac. Move atomize_eqv to 'Unused'.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 806
diff changeset
    29
  qed
2a19e0a37131 Remove SOLVED from quotient_tac. Move atomize_eqv to 'Unused'.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 806
diff changeset
    30
  then show "A \<equiv> B" by (rule eq_reflection)
2a19e0a37131 Remove SOLVED from quotient_tac. Move atomize_eqv to 'Unused'.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 806
diff changeset
    31
qed
2a19e0a37131 Remove SOLVED from quotient_tac. Move atomize_eqv to 'Unused'.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 806
diff changeset
    32
*)
2a19e0a37131 Remove SOLVED from quotient_tac. Move atomize_eqv to 'Unused'.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 806
diff changeset
    33
806
43336511993f Readded 'regularize_to_injection' which I believe will be needed.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 685
diff changeset
    34
101
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    35
ML {*
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    36
  fun dest_cbinop t =
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    37
    let
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    38
      val (t2, rhs) = Thm.dest_comb t;
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    39
      val (bop, lhs) = Thm.dest_comb t2;
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    40
    in
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    41
      (bop, (lhs, rhs))
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    42
    end
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    43
*}
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    44
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    45
ML {*
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    46
  fun dest_ceq t =
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    47
    let
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    48
      val (bop, pair) = dest_cbinop t;
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    49
      val (bop_s, _) = Term.dest_Const (Thm.term_of bop);
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    50
    in
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    51
      if bop_s = "op =" then pair else (raise CTERM ("Not an equality", [t]))
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    52
    end
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    53
*}
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    54
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    55
ML {*
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    56
  fun split_binop_conv t =
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    57
    let
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    58
      val (lhs, rhs) = dest_ceq t;
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    59
      val (bop, _) = dest_cbinop lhs;
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    60
      val [clT, cr2] = bop |> Thm.ctyp_of_term |> Thm.dest_ctyp;
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    61
      val [cmT, crT] = Thm.dest_ctyp cr2;
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    62
    in
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    63
      Drule.instantiate' [SOME clT, SOME cmT, SOME crT] [NONE, NONE, NONE, NONE, SOME bop] @{thm arg_cong2}
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    64
    end
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    65
*}
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    66
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    67
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    68
ML {*
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    69
  fun split_arg_conv t =
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    70
    let
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    71
      val (lhs, rhs) = dest_ceq t;
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    72
      val (lop, larg) = Thm.dest_comb lhs;
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    73
      val [caT, crT] = lop |> Thm.ctyp_of_term |> Thm.dest_ctyp;
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    74
    in
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    75
      Drule.instantiate' [SOME caT, SOME crT] [NONE, NONE, SOME lop] @{thm arg_cong}
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    76
    end
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    77
*}
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    78
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    79
ML {*
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    80
  fun split_binop_tac n thm =
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    81
    let
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    82
      val concl = Thm.cprem_of thm n;
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    83
      val (_, cconcl) = Thm.dest_comb concl;
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    84
      val rewr = split_binop_conv cconcl;
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    85
    in
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    86
      rtac rewr n thm
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    87
    end
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    88
      handle CTERM _ => Seq.empty
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    89
*}
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    90
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    91
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    92
ML {*
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    93
  fun split_arg_tac n thm =
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    94
    let
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    95
      val concl = Thm.cprem_of thm n;
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    96
      val (_, cconcl) = Thm.dest_comb concl;
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    97
      val rewr = split_arg_conv cconcl;
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    98
    in
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
    99
      rtac rewr n thm
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   100
    end
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   101
      handle CTERM _ => Seq.empty
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   102
*}
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   103
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   104
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   105
lemma trueprop_cong:
303
991b0e53f9dc More code cleaning and commenting
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 301
diff changeset
   106
  shows "(a \<equiv> b) \<Longrightarrow> (Trueprop a \<equiv> Trueprop b)"
101
4f93c5a026d2 Reordering the code, part 3
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff changeset
   107
  by auto
226
2a28e7ef3048 cleaned FSet
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 101
diff changeset
   108
2a28e7ef3048 cleaned FSet
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 101
diff changeset
   109
lemma list_induct_hol4:
303
991b0e53f9dc More code cleaning and commenting
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 301
diff changeset
   110
  fixes P :: "'a list \<Rightarrow> bool"
991b0e53f9dc More code cleaning and commenting
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 301
diff changeset
   111
  assumes a: "((P []) \<and> (\<forall>t. (P t) \<longrightarrow> (\<forall>h. (P (h # t)))))"
991b0e53f9dc More code cleaning and commenting
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 301
diff changeset
   112
  shows "\<forall>l. (P l)"
226
2a28e7ef3048 cleaned FSet
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 101
diff changeset
   113
  using a
2a28e7ef3048 cleaned FSet
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 101
diff changeset
   114
  apply (rule_tac allI)
2a28e7ef3048 cleaned FSet
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 101
diff changeset
   115
  apply (induct_tac "l")
2a28e7ef3048 cleaned FSet
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 101
diff changeset
   116
  apply (simp)
2a28e7ef3048 cleaned FSet
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 101
diff changeset
   117
  apply (metis)
2a28e7ef3048 cleaned FSet
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 101
diff changeset
   118
  done
2a28e7ef3048 cleaned FSet
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 101
diff changeset
   119
301
40bb0c4718a6 Cleaning and commenting
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 226
diff changeset
   120
ML {*
40bb0c4718a6 Cleaning and commenting
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 226
diff changeset
   121
val no_vars = Thm.rule_attribute (fn context => fn th =>
40bb0c4718a6 Cleaning and commenting
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 226
diff changeset
   122
  let
40bb0c4718a6 Cleaning and commenting
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 226
diff changeset
   123
    val ctxt = Variable.set_body false (Context.proof_of context);
40bb0c4718a6 Cleaning and commenting
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 226
diff changeset
   124
    val ((_, [th']), _) = Variable.import true [th] ctxt;
40bb0c4718a6 Cleaning and commenting
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 226
diff changeset
   125
  in th' end);
40bb0c4718a6 Cleaning and commenting
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 226
diff changeset
   126
*}
303
991b0e53f9dc More code cleaning and commenting
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 301
diff changeset
   127
991b0e53f9dc More code cleaning and commenting
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 301
diff changeset
   128
(*lemma equality_twice:
991b0e53f9dc More code cleaning and commenting
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 301
diff changeset
   129
  "a = c \<Longrightarrow> b = d \<Longrightarrow> (a = b \<longrightarrow> c = d)"
991b0e53f9dc More code cleaning and commenting
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 301
diff changeset
   130
by auto*)
685
b12f0321dfb0 moved the interpretation code into Unused.thy
Christian Urban <urbanc@in.tum.de>
parents: 303
diff changeset
   131
b12f0321dfb0 moved the interpretation code into Unused.thy
Christian Urban <urbanc@in.tum.de>
parents: 303
diff changeset
   132
b12f0321dfb0 moved the interpretation code into Unused.thy
Christian Urban <urbanc@in.tum.de>
parents: 303
diff changeset
   133
(*interpretation code *)
b12f0321dfb0 moved the interpretation code into Unused.thy
Christian Urban <urbanc@in.tum.de>
parents: 303
diff changeset
   134
(*val bindd = ((Binding.make ("", Position.none)), ([]: Attrib.src list))
b12f0321dfb0 moved the interpretation code into Unused.thy
Christian Urban <urbanc@in.tum.de>
parents: 303
diff changeset
   135
  val ((_, [eqn1pre]), lthy5) = Variable.import true [ABS_def] lthy4;
b12f0321dfb0 moved the interpretation code into Unused.thy
Christian Urban <urbanc@in.tum.de>
parents: 303
diff changeset
   136
  val eqn1i = Thm.prop_of (symmetric eqn1pre)
b12f0321dfb0 moved the interpretation code into Unused.thy
Christian Urban <urbanc@in.tum.de>
parents: 303
diff changeset
   137
  val ((_, [eqn2pre]), lthy6) = Variable.import true [REP_def] lthy5;
b12f0321dfb0 moved the interpretation code into Unused.thy
Christian Urban <urbanc@in.tum.de>
parents: 303
diff changeset
   138
  val eqn2i = Thm.prop_of (symmetric eqn2pre)
b12f0321dfb0 moved the interpretation code into Unused.thy
Christian Urban <urbanc@in.tum.de>
parents: 303
diff changeset
   139
b12f0321dfb0 moved the interpretation code into Unused.thy
Christian Urban <urbanc@in.tum.de>
parents: 303
diff changeset
   140
  val exp_morphism = ProofContext.export_morphism lthy6 (ProofContext.init (ProofContext.theory_of lthy6));
b12f0321dfb0 moved the interpretation code into Unused.thy
Christian Urban <urbanc@in.tum.de>
parents: 303
diff changeset
   141
  val exp_term = Morphism.term exp_morphism;
b12f0321dfb0 moved the interpretation code into Unused.thy
Christian Urban <urbanc@in.tum.de>
parents: 303
diff changeset
   142
  val exp = Morphism.thm exp_morphism;
b12f0321dfb0 moved the interpretation code into Unused.thy
Christian Urban <urbanc@in.tum.de>
parents: 303
diff changeset
   143
b12f0321dfb0 moved the interpretation code into Unused.thy
Christian Urban <urbanc@in.tum.de>
parents: 303
diff changeset
   144
  val mthd = Method.SIMPLE_METHOD ((rtac quot_thm 1) THEN
b12f0321dfb0 moved the interpretation code into Unused.thy
Christian Urban <urbanc@in.tum.de>
parents: 303
diff changeset
   145
    ALLGOALS (simp_tac (HOL_basic_ss addsimps [(symmetric (exp ABS_def)), (symmetric (exp REP_def))])))
b12f0321dfb0 moved the interpretation code into Unused.thy
Christian Urban <urbanc@in.tum.de>
parents: 303
diff changeset
   146
  val mthdt = Method.Basic (fn _ => mthd)
b12f0321dfb0 moved the interpretation code into Unused.thy
Christian Urban <urbanc@in.tum.de>
parents: 303
diff changeset
   147
  val bymt = Proof.global_terminal_proof (mthdt, NONE)
b12f0321dfb0 moved the interpretation code into Unused.thy
Christian Urban <urbanc@in.tum.de>
parents: 303
diff changeset
   148
  val exp_i = [(@{const_name QUOT_TYPE}, ((("QUOT_TYPE_I_" ^ (Binding.name_of qty_name)), true),
b12f0321dfb0 moved the interpretation code into Unused.thy
Christian Urban <urbanc@in.tum.de>
parents: 303
diff changeset
   149
    Expression.Named [("R", rel), ("Abs", abs), ("Rep", rep) ]))]*)
b12f0321dfb0 moved the interpretation code into Unused.thy
Christian Urban <urbanc@in.tum.de>
parents: 303
diff changeset
   150
b12f0321dfb0 moved the interpretation code into Unused.thy
Christian Urban <urbanc@in.tum.de>
parents: 303
diff changeset
   151
(*||> Local_Theory.theory (fn thy =>
b12f0321dfb0 moved the interpretation code into Unused.thy
Christian Urban <urbanc@in.tum.de>
parents: 303
diff changeset
   152
      let
b12f0321dfb0 moved the interpretation code into Unused.thy
Christian Urban <urbanc@in.tum.de>
parents: 303
diff changeset
   153
        val global_eqns = map exp_term [eqn2i, eqn1i];
b12f0321dfb0 moved the interpretation code into Unused.thy
Christian Urban <urbanc@in.tum.de>
parents: 303
diff changeset
   154
        (* Not sure if the following context should not be used *)
b12f0321dfb0 moved the interpretation code into Unused.thy
Christian Urban <urbanc@in.tum.de>
parents: 303
diff changeset
   155
        val (global_eqns2, lthy7) = Variable.import_terms true global_eqns lthy6;
b12f0321dfb0 moved the interpretation code into Unused.thy
Christian Urban <urbanc@in.tum.de>
parents: 303
diff changeset
   156
        val global_eqns3 = map (fn t => (bindd, t)) global_eqns2;
806
43336511993f Readded 'regularize_to_injection' which I believe will be needed.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents: 685
diff changeset
   157
      in ProofContext.theory_of (bymt (Expression.interpretation (exp_i, []) global_eqns3 thy)) end)*)