(* le_of_forall_pos_le_add.thy -- If (\ \ > 0, y \ x + \), then y \ x -- José A. Alonso -- Seville, September 2, 2024 -- ------------------------------------------------------------------ *) (* --------------------------------------------------------------------- -- Let x, y \ \. Prove that -- (\\>0. y \ x + \) \ y \ x -- ------------------------------------------------------------------- *) theory le_of_forall_pos_le_add imports Main HOL.Real begin (* Proof 1 *) lemma fixes x y :: real shows "(\\>0. y \ x + \) \ y \ x" proof (rule impI) assume h1 : "(\\>0. y \ x + \)" show "y \ x" proof (rule ccontr) assume "\ (y \ x)" then have "x < y" by simp then have "(y - x) / 2 > 0" by simp then have "y \ x + (y - x) / 2" using h1 by blast then have "2 * y \ 2 * x + (y - x)" by argo then have "y \ x" by simp then show False using \\ (y \ x)\ by simp qed qed (* Proof 2 *) lemma fixes x y :: real shows "(\\>0. y \ x + \) \ y \ x" proof (rule impI) assume h1 : "(\\>0. y \ x + \)" show "y \ x" proof (rule ccontr) assume "\ (y \ x)" then have "x < y" by simp then obtain z where hz : "x < z \ z < y" using Rats_dense_in_real by blast then have "0 < z -x" by simp then have "y \ x + (z - x)" using h1 by blast then have "y \ z" by simp then show False using hz by simp qed qed (* Proof 3 *) lemma fixes x y :: real shows "(\\>0. y \ x + \) \ y \ x" proof (rule impI) assume h1 : "(\\>0. y \ x + \)" show "y \ x" proof (rule dense_le) fix z assume "z < y" then have "0 < y - z" by simp then have "y \ x + (y - z)" using h1 by simp then have "0 \ x - z" by simp then show "z \ x" by simp qed qed (* Proof 4 *) lemma fixes x y :: real shows "(\\>0. y \ x + \) \ y \ x" by (simp add: field_le_epsilon) end