src/HOL/arith_data.ML
changeset 23881 851c74f1bb69
parent 23530 438c5d2db482
child 24076 ae946f751c44
equal deleted inserted replaced
23880:64b9806e160b 23881:851c74f1bb69
   105 (* nat less *)
   105 (* nat less *)
   106 
   106 
   107 structure LessCancelSums = CancelSumsFun
   107 structure LessCancelSums = CancelSumsFun
   108 (struct
   108 (struct
   109   open Sum;
   109   open Sum;
   110   val mk_bal = HOLogic.mk_binrel @{const_name Orderings.less};
   110   val mk_bal = HOLogic.mk_binrel @{const_name HOL.less};
   111   val dest_bal = HOLogic.dest_bin @{const_name Orderings.less} HOLogic.natT;
   111   val dest_bal = HOLogic.dest_bin @{const_name HOL.less} HOLogic.natT;
   112   val uncancel_tac = gen_uncancel_tac @{thm "nat_add_left_cancel_less"};
   112   val uncancel_tac = gen_uncancel_tac @{thm "nat_add_left_cancel_less"};
   113 end);
   113 end);
   114 
   114 
   115 (* nat le *)
   115 (* nat le *)
   116 
   116 
   117 structure LeCancelSums = CancelSumsFun
   117 structure LeCancelSums = CancelSumsFun
   118 (struct
   118 (struct
   119   open Sum;
   119   open Sum;
   120   val mk_bal = HOLogic.mk_binrel @{const_name Orderings.less_eq};
   120   val mk_bal = HOLogic.mk_binrel @{const_name HOL.less_eq};
   121   val dest_bal = HOLogic.dest_bin @{const_name Orderings.less_eq} HOLogic.natT;
   121   val dest_bal = HOLogic.dest_bin @{const_name HOL.less_eq} HOLogic.natT;
   122   val uncancel_tac = gen_uncancel_tac @{thm "nat_add_left_cancel_le"};
   122   val uncancel_tac = gen_uncancel_tac @{thm "nat_add_left_cancel_le"};
   123 end);
   123 end);
   124 
   124 
   125 (* nat diff *)
   125 (* nat diff *)
   126 
   126 
   368         add_atom all m pi
   368         add_atom all m pi
   369   val (p, i) = poly (lhs, Rat.one, ([], Rat.zero))
   369   val (p, i) = poly (lhs, Rat.one, ([], Rat.zero))
   370   val (q, j) = poly (rhs, Rat.one, ([], Rat.zero))
   370   val (q, j) = poly (rhs, Rat.one, ([], Rat.zero))
   371 in
   371 in
   372   case rel of
   372   case rel of
   373     @{const_name Orderings.less}    => SOME (p, i, "<", q, j)
   373     @{const_name HOL.less}    => SOME (p, i, "<", q, j)
   374   | @{const_name Orderings.less_eq} => SOME (p, i, "<=", q, j)
   374   | @{const_name HOL.less_eq} => SOME (p, i, "<=", q, j)
   375   | "op ="              => SOME (p, i, "=", q, j)
   375   | "op ="              => SOME (p, i, "=", q, j)
   376   | _                   => NONE
   376   | _                   => NONE
   377 end handle Zero => NONE;
   377 end handle Zero => NONE;
   378 
   378 
   379 fun of_lin_arith_sort sg (U : typ) : bool =
   379 fun of_lin_arith_sort sg (U : typ) : bool =
   521       (Const (@{const_name Orderings.max}, _), [t1, t2]) =>
   521       (Const (@{const_name Orderings.max}, _), [t1, t2]) =>
   522       let
   522       let
   523         val rev_terms     = rev terms
   523         val rev_terms     = rev terms
   524         val terms1        = map (subst_term [(split_term, t1)]) rev_terms
   524         val terms1        = map (subst_term [(split_term, t1)]) rev_terms
   525         val terms2        = map (subst_term [(split_term, t2)]) rev_terms
   525         val terms2        = map (subst_term [(split_term, t2)]) rev_terms
   526         val t1_leq_t2     = Const (@{const_name Orderings.less_eq},
   526         val t1_leq_t2     = Const (@{const_name HOL.less_eq},
   527                                     split_type --> split_type --> HOLogic.boolT) $ t1 $ t2
   527                                     split_type --> split_type --> HOLogic.boolT) $ t1 $ t2
   528         val not_t1_leq_t2 = HOLogic.Not $ t1_leq_t2
   528         val not_t1_leq_t2 = HOLogic.Not $ t1_leq_t2
   529         val not_false     = HOLogic.mk_Trueprop (HOLogic.Not $ HOLogic.false_const)
   529         val not_false     = HOLogic.mk_Trueprop (HOLogic.Not $ HOLogic.false_const)
   530         val subgoal1      = (HOLogic.mk_Trueprop t1_leq_t2) :: terms2 @ [not_false]
   530         val subgoal1      = (HOLogic.mk_Trueprop t1_leq_t2) :: terms2 @ [not_false]
   531         val subgoal2      = (HOLogic.mk_Trueprop not_t1_leq_t2) :: terms1 @ [not_false]
   531         val subgoal2      = (HOLogic.mk_Trueprop not_t1_leq_t2) :: terms1 @ [not_false]
   536     | (Const (@{const_name Orderings.min}, _), [t1, t2]) =>
   536     | (Const (@{const_name Orderings.min}, _), [t1, t2]) =>
   537       let
   537       let
   538         val rev_terms     = rev terms
   538         val rev_terms     = rev terms
   539         val terms1        = map (subst_term [(split_term, t1)]) rev_terms
   539         val terms1        = map (subst_term [(split_term, t1)]) rev_terms
   540         val terms2        = map (subst_term [(split_term, t2)]) rev_terms
   540         val terms2        = map (subst_term [(split_term, t2)]) rev_terms
   541         val t1_leq_t2     = Const (@{const_name Orderings.less_eq},
   541         val t1_leq_t2     = Const (@{const_name HOL.less_eq},
   542                                     split_type --> split_type --> HOLogic.boolT) $ t1 $ t2
   542                                     split_type --> split_type --> HOLogic.boolT) $ t1 $ t2
   543         val not_t1_leq_t2 = HOLogic.Not $ t1_leq_t2
   543         val not_t1_leq_t2 = HOLogic.Not $ t1_leq_t2
   544         val not_false     = HOLogic.mk_Trueprop (HOLogic.Not $ HOLogic.false_const)
   544         val not_false     = HOLogic.mk_Trueprop (HOLogic.Not $ HOLogic.false_const)
   545         val subgoal1      = (HOLogic.mk_Trueprop t1_leq_t2) :: terms1 @ [not_false]
   545         val subgoal1      = (HOLogic.mk_Trueprop t1_leq_t2) :: terms1 @ [not_false]
   546         val subgoal2      = (HOLogic.mk_Trueprop not_t1_leq_t2) :: terms2 @ [not_false]
   546         val subgoal2      = (HOLogic.mk_Trueprop not_t1_leq_t2) :: terms2 @ [not_false]
   553         val rev_terms   = rev terms
   553         val rev_terms   = rev terms
   554         val terms1      = map (subst_term [(split_term, t1)]) rev_terms
   554         val terms1      = map (subst_term [(split_term, t1)]) rev_terms
   555         val terms2      = map (subst_term [(split_term, Const (@{const_name HOL.uminus},
   555         val terms2      = map (subst_term [(split_term, Const (@{const_name HOL.uminus},
   556                             split_type --> split_type) $ t1)]) rev_terms
   556                             split_type --> split_type) $ t1)]) rev_terms
   557         val zero        = Const (@{const_name HOL.zero}, split_type)
   557         val zero        = Const (@{const_name HOL.zero}, split_type)
   558         val zero_leq_t1 = Const (@{const_name Orderings.less_eq},
   558         val zero_leq_t1 = Const (@{const_name HOL.less_eq},
   559                             split_type --> split_type --> HOLogic.boolT) $ zero $ t1
   559                             split_type --> split_type --> HOLogic.boolT) $ zero $ t1
   560         val t1_lt_zero  = Const (@{const_name Orderings.less},
   560         val t1_lt_zero  = Const (@{const_name HOL.less},
   561                             split_type --> split_type --> HOLogic.boolT) $ t1 $ zero
   561                             split_type --> split_type --> HOLogic.boolT) $ t1 $ zero
   562         val not_false   = HOLogic.mk_Trueprop (HOLogic.Not $ HOLogic.false_const)
   562         val not_false   = HOLogic.mk_Trueprop (HOLogic.Not $ HOLogic.false_const)
   563         val subgoal1    = (HOLogic.mk_Trueprop zero_leq_t1) :: terms1 @ [not_false]
   563         val subgoal1    = (HOLogic.mk_Trueprop zero_leq_t1) :: terms1 @ [not_false]
   564         val subgoal2    = (HOLogic.mk_Trueprop t1_lt_zero) :: terms2 @ [not_false]
   564         val subgoal2    = (HOLogic.mk_Trueprop t1_lt_zero) :: terms2 @ [not_false]
   565       in
   565       in
   576         val terms1          = map (subst_term [(split_term, zero)]) rev_terms
   576         val terms1          = map (subst_term [(split_term, zero)]) rev_terms
   577         val terms2          = map (subst_term [(incr_boundvars 1 split_term, d)])
   577         val terms2          = map (subst_term [(incr_boundvars 1 split_term, d)])
   578                                 (map (incr_boundvars 1) rev_terms)
   578                                 (map (incr_boundvars 1) rev_terms)
   579         val t1'             = incr_boundvars 1 t1
   579         val t1'             = incr_boundvars 1 t1
   580         val t2'             = incr_boundvars 1 t2
   580         val t2'             = incr_boundvars 1 t2
   581         val t1_lt_t2        = Const (@{const_name Orderings.less},
   581         val t1_lt_t2        = Const (@{const_name HOL.less},
   582                                 split_type --> split_type --> HOLogic.boolT) $ t1 $ t2
   582                                 split_type --> split_type --> HOLogic.boolT) $ t1 $ t2
   583         val t1_eq_t2_plus_d = Const ("op =", split_type --> split_type --> HOLogic.boolT) $ t1' $
   583         val t1_eq_t2_plus_d = Const ("op =", split_type --> split_type --> HOLogic.boolT) $ t1' $
   584                                 (Const (@{const_name HOL.plus},
   584                                 (Const (@{const_name HOL.plus},
   585                                   split_type --> split_type --> split_type) $ t2' $ d)
   585                                   split_type --> split_type --> split_type) $ t2' $ d)
   586         val not_false       = HOLogic.mk_Trueprop (HOLogic.Not $ HOLogic.false_const)
   586         val not_false       = HOLogic.mk_Trueprop (HOLogic.Not $ HOLogic.false_const)
   600                             (map (incr_boundvars 1) rev_terms)
   600                             (map (incr_boundvars 1) rev_terms)
   601         val terms2      = map (subst_term [(split_term, zero_nat)]) rev_terms
   601         val terms2      = map (subst_term [(split_term, zero_nat)]) rev_terms
   602         val t1'         = incr_boundvars 1 t1
   602         val t1'         = incr_boundvars 1 t1
   603         val t1_eq_int_n = Const ("op =", HOLogic.intT --> HOLogic.intT --> HOLogic.boolT) $ t1' $
   603         val t1_eq_int_n = Const ("op =", HOLogic.intT --> HOLogic.intT --> HOLogic.boolT) $ t1' $
   604                             (Const ("Nat.of_nat", HOLogic.natT --> HOLogic.intT) $ n)
   604                             (Const ("Nat.of_nat", HOLogic.natT --> HOLogic.intT) $ n)
   605         val t1_lt_zero  = Const (@{const_name Orderings.less},
   605         val t1_lt_zero  = Const (@{const_name HOL.less},
   606                             HOLogic.intT --> HOLogic.intT --> HOLogic.boolT) $ t1 $ zero_int
   606                             HOLogic.intT --> HOLogic.intT --> HOLogic.boolT) $ t1 $ zero_int
   607         val not_false   = HOLogic.mk_Trueprop (HOLogic.Not $ HOLogic.false_const)
   607         val not_false   = HOLogic.mk_Trueprop (HOLogic.Not $ HOLogic.false_const)
   608         val subgoal1    = (HOLogic.mk_Trueprop t1_eq_int_n) :: terms1 @ [not_false]
   608         val subgoal1    = (HOLogic.mk_Trueprop t1_eq_int_n) :: terms1 @ [not_false]
   609         val subgoal2    = (HOLogic.mk_Trueprop t1_lt_zero) :: terms2 @ [not_false]
   609         val subgoal2    = (HOLogic.mk_Trueprop t1_lt_zero) :: terms2 @ [not_false]
   610       in
   610       in
   626         val t2'                     = incr_boundvars 2 t2
   626         val t2'                     = incr_boundvars 2 t2
   627         val t2_eq_zero              = Const ("op =",
   627         val t2_eq_zero              = Const ("op =",
   628                                         split_type --> split_type --> HOLogic.boolT) $ t2 $ zero
   628                                         split_type --> split_type --> HOLogic.boolT) $ t2 $ zero
   629         val t2_neq_zero             = HOLogic.mk_not (Const ("op =",
   629         val t2_neq_zero             = HOLogic.mk_not (Const ("op =",
   630                                         split_type --> split_type --> HOLogic.boolT) $ t2' $ zero)
   630                                         split_type --> split_type --> HOLogic.boolT) $ t2' $ zero)
   631         val j_lt_t2                 = Const (@{const_name Orderings.less},
   631         val j_lt_t2                 = Const (@{const_name HOL.less},
   632                                         split_type --> split_type--> HOLogic.boolT) $ j $ t2'
   632                                         split_type --> split_type--> HOLogic.boolT) $ j $ t2'
   633         val t1_eq_t2_times_i_plus_j = Const ("op =", split_type --> split_type --> HOLogic.boolT) $ t1' $
   633         val t1_eq_t2_times_i_plus_j = Const ("op =", split_type --> split_type --> HOLogic.boolT) $ t1' $
   634                                        (Const (@{const_name HOL.plus}, split_type --> split_type --> split_type) $
   634                                        (Const (@{const_name HOL.plus}, split_type --> split_type --> split_type) $
   635                                          (Const (@{const_name HOL.times},
   635                                          (Const (@{const_name HOL.times},
   636                                            split_type --> split_type --> split_type) $ t2' $ i) $ j)
   636                                            split_type --> split_type --> split_type) $ t2' $ i) $ j)
   658         val t2'                     = incr_boundvars 2 t2
   658         val t2'                     = incr_boundvars 2 t2
   659         val t2_eq_zero              = Const ("op =",
   659         val t2_eq_zero              = Const ("op =",
   660                                         split_type --> split_type --> HOLogic.boolT) $ t2 $ zero
   660                                         split_type --> split_type --> HOLogic.boolT) $ t2 $ zero
   661         val t2_neq_zero             = HOLogic.mk_not (Const ("op =",
   661         val t2_neq_zero             = HOLogic.mk_not (Const ("op =",
   662                                         split_type --> split_type --> HOLogic.boolT) $ t2' $ zero)
   662                                         split_type --> split_type --> HOLogic.boolT) $ t2' $ zero)
   663         val j_lt_t2                 = Const (@{const_name Orderings.less},
   663         val j_lt_t2                 = Const (@{const_name HOL.less},
   664                                         split_type --> split_type--> HOLogic.boolT) $ j $ t2'
   664                                         split_type --> split_type--> HOLogic.boolT) $ j $ t2'
   665         val t1_eq_t2_times_i_plus_j = Const ("op =", split_type --> split_type --> HOLogic.boolT) $ t1' $
   665         val t1_eq_t2_times_i_plus_j = Const ("op =", split_type --> split_type --> HOLogic.boolT) $ t1' $
   666                                        (Const (@{const_name HOL.plus}, split_type --> split_type --> split_type) $
   666                                        (Const (@{const_name HOL.plus}, split_type --> split_type --> split_type) $
   667                                          (Const (@{const_name HOL.times},
   667                                          (Const (@{const_name HOL.times},
   668                                            split_type --> split_type --> split_type) $ t2' $ i) $ j)
   668                                            split_type --> split_type --> split_type) $ t2' $ i) $ j)
   695         val iszero_t2               = Const ("IntDef.iszero", split_type --> HOLogic.boolT) $ t2
   695         val iszero_t2               = Const ("IntDef.iszero", split_type --> HOLogic.boolT) $ t2
   696         val neg_minus_k             = Const ("IntDef.neg", split_type --> HOLogic.boolT) $
   696         val neg_minus_k             = Const ("IntDef.neg", split_type --> HOLogic.boolT) $
   697                                         (number_of $
   697                                         (number_of $
   698                                           (Const (@{const_name HOL.uminus},
   698                                           (Const (@{const_name HOL.uminus},
   699                                             HOLogic.intT --> HOLogic.intT) $ k'))
   699                                             HOLogic.intT --> HOLogic.intT) $ k'))
   700         val zero_leq_j              = Const (@{const_name Orderings.less_eq},
   700         val zero_leq_j              = Const (@{const_name HOL.less_eq},
   701                                         split_type --> split_type --> HOLogic.boolT) $ zero $ j
   701                                         split_type --> split_type --> HOLogic.boolT) $ zero $ j
   702         val j_lt_t2                 = Const (@{const_name Orderings.less},
   702         val j_lt_t2                 = Const (@{const_name HOL.less},
   703                                         split_type --> split_type--> HOLogic.boolT) $ j $ t2'
   703                                         split_type --> split_type--> HOLogic.boolT) $ j $ t2'
   704         val t1_eq_t2_times_i_plus_j = Const ("op =", split_type --> split_type --> HOLogic.boolT) $ t1' $
   704         val t1_eq_t2_times_i_plus_j = Const ("op =", split_type --> split_type --> HOLogic.boolT) $ t1' $
   705                                        (Const (@{const_name HOL.plus}, split_type --> split_type --> split_type) $
   705                                        (Const (@{const_name HOL.plus}, split_type --> split_type --> split_type) $
   706                                          (Const (@{const_name HOL.times},
   706                                          (Const (@{const_name HOL.times},
   707                                            split_type --> split_type --> split_type) $ t2' $ i) $ j)
   707                                            split_type --> split_type --> split_type) $ t2' $ i) $ j)
   708         val neg_t2                  = Const ("IntDef.neg", split_type --> HOLogic.boolT) $ t2'
   708         val neg_t2                  = Const ("IntDef.neg", split_type --> HOLogic.boolT) $ t2'
   709         val t2_lt_j                 = Const (@{const_name Orderings.less},
   709         val t2_lt_j                 = Const (@{const_name HOL.less},
   710                                         split_type --> split_type--> HOLogic.boolT) $ t2' $ j
   710                                         split_type --> split_type--> HOLogic.boolT) $ t2' $ j
   711         val j_leq_zero              = Const (@{const_name Orderings.less_eq},
   711         val j_leq_zero              = Const (@{const_name HOL.less_eq},
   712                                         split_type --> split_type --> HOLogic.boolT) $ j $ zero
   712                                         split_type --> split_type --> HOLogic.boolT) $ j $ zero
   713         val not_false               = HOLogic.mk_Trueprop (HOLogic.Not $ HOLogic.false_const)
   713         val not_false               = HOLogic.mk_Trueprop (HOLogic.Not $ HOLogic.false_const)
   714         val subgoal1                = (HOLogic.mk_Trueprop iszero_t2) :: terms1 @ [not_false]
   714         val subgoal1                = (HOLogic.mk_Trueprop iszero_t2) :: terms1 @ [not_false]
   715         val subgoal2                = (map HOLogic.mk_Trueprop [neg_minus_k, zero_leq_j])
   715         val subgoal2                = (map HOLogic.mk_Trueprop [neg_minus_k, zero_leq_j])
   716                                         @ hd terms2_3
   716                                         @ hd terms2_3
   747         val iszero_t2               = Const ("IntDef.iszero", split_type --> HOLogic.boolT) $ t2
   747         val iszero_t2               = Const ("IntDef.iszero", split_type --> HOLogic.boolT) $ t2
   748         val neg_minus_k             = Const ("IntDef.neg", split_type --> HOLogic.boolT) $
   748         val neg_minus_k             = Const ("IntDef.neg", split_type --> HOLogic.boolT) $
   749                                         (number_of $
   749                                         (number_of $
   750                                           (Const (@{const_name HOL.uminus},
   750                                           (Const (@{const_name HOL.uminus},
   751                                             HOLogic.intT --> HOLogic.intT) $ k'))
   751                                             HOLogic.intT --> HOLogic.intT) $ k'))
   752         val zero_leq_j              = Const (@{const_name Orderings.less_eq},
   752         val zero_leq_j              = Const (@{const_name HOL.less_eq},
   753                                         split_type --> split_type --> HOLogic.boolT) $ zero $ j
   753                                         split_type --> split_type --> HOLogic.boolT) $ zero $ j
   754         val j_lt_t2                 = Const (@{const_name Orderings.less},
   754         val j_lt_t2                 = Const (@{const_name HOL.less},
   755                                         split_type --> split_type--> HOLogic.boolT) $ j $ t2'
   755                                         split_type --> split_type--> HOLogic.boolT) $ j $ t2'
   756         val t1_eq_t2_times_i_plus_j = Const ("op =",
   756         val t1_eq_t2_times_i_plus_j = Const ("op =",
   757                                         split_type --> split_type --> HOLogic.boolT) $ t1' $
   757                                         split_type --> split_type --> HOLogic.boolT) $ t1' $
   758                                        (Const (@{const_name HOL.plus}, split_type --> split_type --> split_type) $
   758                                        (Const (@{const_name HOL.plus}, split_type --> split_type --> split_type) $
   759                                          (Const (@{const_name HOL.times},
   759                                          (Const (@{const_name HOL.times},
   760                                            split_type --> split_type --> split_type) $ t2' $ i) $ j)
   760                                            split_type --> split_type --> split_type) $ t2' $ i) $ j)
   761         val neg_t2                  = Const ("IntDef.neg", split_type --> HOLogic.boolT) $ t2'
   761         val neg_t2                  = Const ("IntDef.neg", split_type --> HOLogic.boolT) $ t2'
   762         val t2_lt_j                 = Const (@{const_name Orderings.less},
   762         val t2_lt_j                 = Const (@{const_name HOL.less},
   763                                         split_type --> split_type--> HOLogic.boolT) $ t2' $ j
   763                                         split_type --> split_type--> HOLogic.boolT) $ t2' $ j
   764         val j_leq_zero              = Const (@{const_name Orderings.less_eq},
   764         val j_leq_zero              = Const (@{const_name HOL.less_eq},
   765                                         split_type --> split_type --> HOLogic.boolT) $ j $ zero
   765                                         split_type --> split_type --> HOLogic.boolT) $ j $ zero
   766         val not_false               = HOLogic.mk_Trueprop (HOLogic.Not $ HOLogic.false_const)
   766         val not_false               = HOLogic.mk_Trueprop (HOLogic.Not $ HOLogic.false_const)
   767         val subgoal1                = (HOLogic.mk_Trueprop iszero_t2) :: terms1 @ [not_false]
   767         val subgoal1                = (HOLogic.mk_Trueprop iszero_t2) :: terms1 @ [not_false]
   768         val subgoal2                = (HOLogic.mk_Trueprop neg_minus_k)
   768         val subgoal2                = (HOLogic.mk_Trueprop neg_minus_k)
   769                                         :: terms2_3
   769                                         :: terms2_3
  1009 fun antisym_eq prems thm =
  1009 fun antisym_eq prems thm =
  1010   let
  1010   let
  1011     val r = #prop(rep_thm thm);
  1011     val r = #prop(rep_thm thm);
  1012   in
  1012   in
  1013     case r of
  1013     case r of
  1014       Tr $ ((c as Const(@{const_name Orderings.less_eq},T)) $ s $ t) =>
  1014       Tr $ ((c as Const(@{const_name HOL.less_eq},T)) $ s $ t) =>
  1015         let val r' = Tr $ (c $ t $ s)
  1015         let val r' = Tr $ (c $ t $ s)
  1016         in
  1016         in
  1017           case Library.find_first (prp r') prems of
  1017           case Library.find_first (prp r') prems of
  1018             NONE =>
  1018             NONE =>
  1019               let val r' = Tr $ (HOLogic.Not $ (Const(@{const_name Orderings.less},T) $ s $ t))
  1019               let val r' = Tr $ (HOLogic.Not $ (Const(@{const_name HOL.less},T) $ s $ t))
  1020               in case Library.find_first (prp r') prems of
  1020               in case Library.find_first (prp r') prems of
  1021                    NONE => []
  1021                    NONE => []
  1022                  | SOME thm' => [(thm' RS not_lessD) RS (thm RS antisym)]
  1022                  | SOME thm' => [(thm' RS not_lessD) RS (thm RS antisym)]
  1023               end
  1023               end
  1024           | SOME thm' => [thm' RS (thm RS antisym)]
  1024           | SOME thm' => [thm' RS (thm RS antisym)]
  1025         end
  1025         end
  1026     | Tr $ (Const("Not",_) $ (Const(@{const_name Orderings.less},T) $ s $ t)) =>
  1026     | Tr $ (Const("Not",_) $ (Const(@{const_name HOL.less},T) $ s $ t)) =>
  1027         let val r' = Tr $ (Const(@{const_name Orderings.less_eq},T) $ s $ t)
  1027         let val r' = Tr $ (Const(@{const_name HOL.less_eq},T) $ s $ t)
  1028         in
  1028         in
  1029           case Library.find_first (prp r') prems of
  1029           case Library.find_first (prp r') prems of
  1030             NONE =>
  1030             NONE =>
  1031               let val r' = Tr $ (HOLogic.Not $ (Const(@{const_name Orderings.less},T) $ t $ s))
  1031               let val r' = Tr $ (HOLogic.Not $ (Const(@{const_name HOL.less},T) $ t $ s))
  1032               in case Library.find_first (prp r') prems of
  1032               in case Library.find_first (prp r') prems of
  1033                    NONE => []
  1033                    NONE => []
  1034                  | SOME thm' =>
  1034                  | SOME thm' =>
  1035                      [(thm' RS not_lessD) RS ((thm RS not_lessD) RS antisym)]
  1035                      [(thm' RS not_lessD) RS ((thm RS not_lessD) RS antisym)]
  1036               end
  1036               end