# HG changeset patch # User nipkow # Date 1367792704 -7200 # Node ID 730b9802d6fe4b31989cb9fade2537f492388baf # Parent 3f2eacb8235a85b1c1d50f0762010f29f1a104df simplified proofs diff -r 3f2eacb8235a -r 730b9802d6fe src/HOL/IMP/Abs_Int2_ivl.thy --- a/src/HOL/IMP/Abs_Int2_ivl.thy Fri May 03 10:27:24 2013 +0200 +++ b/src/HOL/IMP/Abs_Int2_ivl.thy Mon May 06 00:25:04 2013 +0200 @@ -88,6 +88,9 @@ definition less_ivl where "i1 < i2 = (i1 \ i2 \ \ i2 \ (i1::ivl))" +lemma le_ivl_iff_subset: "iv1 \ iv2 \ \_ivl iv1 \ \_ivl iv2" +by transfer (rule le_iff_subset) + definition sup_rep :: "eint2 \ eint2 \ eint2" where "sup_rep p1 p2 = (if is_empty_rep p1 then p2 else if is_empty_rep p2 then p1 else let (l1,h1) = p1; (l2,h2) = p2 in (min l1 l2, max h1 h2))" @@ -154,20 +157,21 @@ lift_definition inf_ivl :: "ivl \ ivl \ ivl" is inf_rep by(auto simp: \_inf_rep eq_ivl_def) +lemma \_inf: "\_ivl (iv1 \ iv2) = \_ivl iv1 \ \_ivl iv2" +by transfer (rule \_inf_rep) + definition "\ = empty_ivl" instance proof - case goal1 thus ?case - unfolding inf_rep_def by transfer (auto simp: le_iff_subset \_inf_rep) + case goal1 thus ?case by (simp add: \_inf le_ivl_iff_subset) +next + case goal2 thus ?case by (simp add: \_inf le_ivl_iff_subset) next - case goal2 thus ?case - unfolding inf_rep_def by transfer (auto simp: le_iff_subset \_inf_rep) + case goal3 thus ?case by (simp add: \_inf le_ivl_iff_subset) next - case goal3 thus ?case - unfolding inf_rep_def by transfer (auto simp: le_iff_subset \_inf_rep) -next - case goal4 show ?case unfolding bot_ivl_def by transfer (auto simp: le_iff_subset) + case goal4 show ?case + unfolding bot_ivl_def by transfer (auto simp: le_iff_subset) qed end @@ -238,6 +242,9 @@ instance .. end +lemma \_uminus: "i : \_ivl iv \ -i \ \_ivl(- iv)" +by transfer (rule \_uminus_rep) + lemma uminus_nice: "-[l\h] = [-h\-l]" by transfer (simp add: uminus_rep_def) @@ -303,27 +310,11 @@ where \ = \_ivl and num' = num_ivl and plus' = "op +" defines aval_ivl is aval' proof - case goal1 show ?case - by transfer (auto simp add:inf_rep_def \_rep_cases split: prod.split extended.split) + case goal1 show ?case by(simp add: \_inf) next case goal2 show ?case unfolding bot_ivl_def by transfer simp qed -lemma \_plus_rep: "i1 : \_rep p1 \ i2 : \_rep p2 \ i1+i2 \ \_rep(plus_rep p1 p2)" -by(auto simp: plus_rep_def plus_rep_plus split: prod.splits) - -lemma non_empty_inf: "\n1 \ \_rep a1; n2 \ \_rep a2; n1 + n2 \ \_rep a \ \ - \ is_empty_rep (inf_rep a1 (plus_rep a (uminus_rep a2)))" -by (auto simp add: \_inf_rep set_eq_iff is_empty_rep_iff simp del: all_not_in_conv) - (metis \_plus_rep \_uminus_rep add_diff_cancel diff_minus) - -lemma filter_plus: "\eq_ivl (inf_rep a1 (plus_rep a (uminus_rep a2))) b1 \ - eq_ivl (inf_rep a2 (plus_rep a (uminus_rep a1))) b2; - n1 \ \_rep a1; n2 \ \_rep a2; n1 + n2 \ \_rep a\ - \ n1 \ \_rep b1 \ n2 \ \_rep b2" -by (auto simp: eq_ivl_iff \_inf_rep non_empty_inf add_ac) - (metis \_plus_rep \_uminus_rep add_diff_cancel diff_def add_commute)+ - interpretation Val_abs1 where \ = \_ivl and num' = num_ivl and plus' = "op +" and test_num' = in_ivl @@ -331,8 +322,11 @@ proof case goal1 thus ?case by transfer (auto simp: \_rep_def) next - case goal2 thus ?case unfolding filter_plus_ivl_def minus_ivl_def prod_rel_eq[symmetric] - by transfer (simp add: filter_plus) + case goal2 thus ?case + unfolding filter_plus_ivl_def minus_ivl_def prod_rel_eq[symmetric] + apply(clarsimp simp add: \_inf) + using gamma_plus'[of "i1+i2" _ "-i1"] gamma_plus'[of "i1+i2" _ "-i2"] + by(simp add: \_uminus) next case goal3 thus ?case unfolding prod_rel_eq[symmetric]