src/HOL/Real/Hyperreal/Lim.ML
changeset 10659 58b6cfd8ecf3
parent 10648 a8c647cfa31f
child 10662 cf6be1804912
equal deleted inserted replaced
10658:b9d43a2add79 10659:58b6cfd8ecf3
  1734 qed "lemma_BOLZANO2";
  1734 qed "lemma_BOLZANO2";
  1735 
  1735 
  1736 (*----------------------------------------------------------------------------*)
  1736 (*----------------------------------------------------------------------------*)
  1737 (* Intermediate Value Theorem (prove contrapositive by bisection)             *)
  1737 (* Intermediate Value Theorem (prove contrapositive by bisection)             *)
  1738 (*----------------------------------------------------------------------------*)
  1738 (*----------------------------------------------------------------------------*)
  1739 (* proved elsewhere surely? *)
  1739 
  1740 Goal "!!P. (~P ==> ~Q) ==> Q ==> P";
       
  1741 by (auto_tac (claset() addIs [ccontr],simpset()));
       
  1742 qed "contrapos2";
       
  1743 
       
  1744 (*
       
  1745 see junk.ML
       
  1746 Goal "[| f(a) <= y & y <= f(b); \
  1740 Goal "[| f(a) <= y & y <= f(b); \
  1747 \        a <= b; \
  1741 \        a <= b; \
  1748 \        (ALL x. a <= x & x <= b --> isCont f x) \
  1742 \        (ALL x. a <= x & x <= b --> isCont f x) \
  1749 \     |] ==> EX x. a <= x & x <= b & f(x) = y";
  1743 \     |] ==> EX x. a <= x & x <= b & f(x) = y";
  1750 by (rtac contrapos2 1);
  1744 by (rtac contrapos_pp 1);
  1751 by (assume_tac 2);
  1745 by (assume_tac 1);
  1752 by (cut_inst_tac [("P","%(u,v). a <= u & u <= v & v <= b --> \
  1746 by (cut_inst_tac [("P","%(u,v). a <= u & u <= v & v <= b --> \
  1753 \   ~(f(u) <= y & y <= f(v))")] lemma_BOLZANO2 1);
  1747 \   ~(f(u) <= y & y <= f(v))")] lemma_BOLZANO2 1);
  1754 by (Step_tac 1);
  1748 by (Step_tac 1);
  1755 by (ALLGOALS(Asm_full_simp_tac));
  1749 by (ALLGOALS(Asm_full_simp_tac));
  1756 by (Blast_tac 2);
  1750 by (Blast_tac 2);
  1759 by (subgoal_tac "a <= x & x <= b" 1);
  1753 by (subgoal_tac "a <= x & x <= b" 1);
  1760 by (Asm_full_simp_tac 2);
  1754 by (Asm_full_simp_tac 2);
  1761 by (rotate_tac 3 2);
  1755 by (rotate_tac 3 2);
  1762 by (dres_inst_tac [("x","1r")] spec 2);
  1756 by (dres_inst_tac [("x","1r")] spec 2);
  1763 by (Step_tac 2);
  1757 by (Step_tac 2);
  1764 by (asm_full_simp_tac (simpset() addsimps []) 2);
  1758 by (Asm_full_simp_tac 2);
  1765 by (asm_full_simp_tac (simpset() addsimps []) 2);
  1759 by (Asm_full_simp_tac 2);
  1766 by (REPEAT(blast_tac (claset() addIs [real_le_trans]) 2));
  1760 by (REPEAT(blast_tac (claset() addIs [real_le_trans]) 2));
  1767 by (REPEAT(dres_inst_tac [("x","x")] spec 1));
  1761 by (REPEAT(dres_inst_tac [("x","x")] spec 1));
  1768 by (Asm_full_simp_tac 1);
  1762 by (Asm_full_simp_tac 1);
  1769 (**)
  1763 (**)
  1770 by (rotate_tac 4 1);
  1764 by (rotate_tac 4 1);
  1777 by (dres_inst_tac [("x","s")] spec 1);
  1771 by (dres_inst_tac [("x","s")] spec 1);
  1778 by (Step_tac 1);
  1772 by (Step_tac 1);
  1779 by (cut_inst_tac [("R1.0","f x"),("R2.0","y")] real_linear 1);
  1773 by (cut_inst_tac [("R1.0","f x"),("R2.0","y")] real_linear 1);
  1780 by (Auto_tac);
  1774 by (Auto_tac);
  1781 by (dres_inst_tac [("x","ba - x")] spec 1);
  1775 by (dres_inst_tac [("x","ba - x")] spec 1);
  1782 by (auto_tac (claset(),simpset() addsimps [abs_iff,real_diff_le_eq,
  1776 by (auto_tac (claset(),
  1783        (real_diff_def RS meta_eq_to_obj_eq) RS sym,real_less_le_iff,
  1777      simpset() 
  1784        real_le_diff_eq,CLAIM "(~(x::real) <= y) = (y < x)",
  1778 	       addsimps [abs_iff, real_diff_le_eq,
       
  1779        (real_diff_def RS meta_eq_to_obj_eq) RS sym,
       
  1780        real_less_le_iff, real_le_diff_eq, 
       
  1781        CLAIM "(~(x::real) <= y) = (y < x)",
  1785        CLAIM "(-x < -y) = ((y::real) < x)",
  1782        CLAIM "(-x < -y) = ((y::real) < x)",
  1786        CLAIM "(-(y - x)) = (x - (y::real))"]));
  1783        CLAIM "(-(y - x)) = (x - (y::real))",
  1787 by (dres_inst_tac [("z","x"),("w","ba")] real_le_anti_sym 1);
  1784        CLAIM "(x-y=#0) = (x = (y::real))"]));
  1788 by (assume_tac 1 THEN Asm_full_simp_tac 1);
       
  1789 by (dres_inst_tac [("x","aa - x")] spec 1);
  1785 by (dres_inst_tac [("x","aa - x")] spec 1);
  1790 by (case_tac "x <= aa" 1);
  1786 by (case_tac "x <= aa" 1);
  1791 by (auto_tac (claset(),simpset() addsimps [real_minus_zero_le_iff2,
  1787 by (auto_tac (claset(),simpset() addsimps [real_minus_zero_le_iff2,
  1792     real_le_diff_eq,real_diff_le_eq,(real_le_def RS meta_eq_to_obj_eq) 
  1788     real_le_diff_eq,real_diff_le_eq,(real_le_def RS meta_eq_to_obj_eq) 
  1793     RS sym]));
  1789     RS sym]));
  1905 qed "isCont_has_Ub";
  1901 qed "isCont_has_Ub";
  1906 
  1902 
  1907 (*----------------------------------------------------------------------------*)
  1903 (*----------------------------------------------------------------------------*)
  1908 (* Now show that it attains its upper bound                                   *)
  1904 (* Now show that it attains its upper bound                                   *)
  1909 (*----------------------------------------------------------------------------*)
  1905 (*----------------------------------------------------------------------------*)
  1910 
       
  1911 
       
  1912 
       
  1913 
       
  1914  *)