        {"id":1835,"date":"2023-12-07T06:00:09","date_gmt":"2023-12-07T04:00:09","guid":{"rendered":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/?p=1835"},"modified":"2023-11-27T15:08:12","modified_gmt":"2023-11-27T13:08:12","slug":"07-dic-23","status":"publish","type":"post","link":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/07-dic-23\/","title":{"rendered":"Si f no es mon\u00f3tona, entonces \u2203x\u2203y[x \u2264 y \u2227 f(y) < f(x)]\u200b"},"content":{"rendered":"\n<p>Demostrar con Lean4 que si &#92;(f&#92;) no es mon\u00f3tona, entonces &#92;(\u2203x\u2203y[x \u2264 y \u2227 f(y) &lt; f(x)]\u200b&#92;).<\/p>\n<p>Para ello, completar la siguiente teor\u00eda de Lean4:<\/p>\n<pre lang=\"lean\">\nimport Mathlib.Tactic\nvariable (f : \u211d \u2192 \u211d)\n\nexample\n  (h : \u00acMonotone f)\n  : \u2203 x y, x \u2264 y \u2227 f y < f x :=\nby sorry\n<\/pre>\n<p><!--more--><\/p>\n<p><b>Demostraci\u00f3n en lenguaje natural<\/b><\/p>\n<p>Usaremos los siguientes lemas:<br \/>\n&#92;begin{align}<br \/>\n   &amp;\u00ac(\u2200x)P(x) \u2194 (\u2203 x)\u00acP(x)      &#92;tag{L1} &#92;&#92;<br \/>\n   &amp;\u00ac(p \u2192 q) \u2194 p \u2227 \u00acq           &#92;tag{L2} &#92;&#92;<br \/>\n   &amp;(\u2200a, b \u2208 \u211d)[\u00acb \u2264 a \u2192 a &lt; b] &#92;tag{L3}<br \/>\n&#92;end{align}<\/p>\n<p>Por la definici\u00f3n de funci\u00f3n mon\u00f3tona,<br \/>\n&#92;[ \u00ac(\u2200x)(\u2200y)[x \u2264 y \u2192 f(x) \u2264 f(y)] &#92;]<br \/>\nAplicando L1 se tiene<br \/>\n&#92;[ (\u2203x)\u00ac(\u2200y)[x \u2264 y \u2192 f(x) \u2264 f(y)] &#92;]<br \/>\nSea &#92;(a&#92;) tal que<br \/>\n&#92;[ \u00ac(\u2200y)[a \u2264 y \u2192 f(a) \u2264 f(y)] &#92;]<br \/>\nAplicando L1 se tiene<br \/>\n&#92;[ (\u2203y)\u00ac[a \u2264 y \u2192 f(a) \u2264 f(y)] &#92;]<br \/>\nSea &#92;(b&#92;) tal que<br \/>\n&#92;[ \u00ac[a \u2264 b \u2192 f(a) \u2264 f(b)] &#92;]<br \/>\nAplicando L2 se tiene que<br \/>\n&#92;[ a \u2264 b \u2227 \u00ac(f(a) \u2264 f(b)) &#92;]<br \/>\nAplicando L3 se tiene que<br \/>\n&#92;[ a \u2264 b \u2227 f(b) &lt; f(a) &#92;]<br \/>\nPor tanto,<br \/>\n&#92;[ (\u2203x,y)[x \u2264 y \u2227 f(y) &lt; f(x)] &#92;]<\/p>\n<p><b>Demostraciones con Lean4<\/b><\/p>\n<pre lang=\"lean\">\nimport Mathlib.Tactic\nvariable (f : \u211d \u2192 \u211d)\n\n-- 1\u00aa demostraci\u00f3n\n-- ===============\n\nexample\n  (h : \u00acMonotone f)\n  : \u2203 x y, x \u2264 y \u2227 f y < f x :=\nby\n  have h1 : \u00ac\u2200 x y, x \u2264 y \u2192 f x \u2264 f y := h\n  have h2 : \u2203 x, \u00ac(\u2200 y, x \u2264 y \u2192 f x \u2264 f y) := not_forall.mp h1\n  rcases h2 with \u27e8a, ha : \u00ac\u2200 y, a \u2264 y \u2192 f a \u2264 f y\u27e9\n  have h3 : \u2203 y, \u00ac(a \u2264 y \u2192 f a \u2264 f y) := not_forall.mp ha\n  rcases h3 with \u27e8b, hb : \u00ac(a \u2264 b \u2192 f a \u2264 f b)\u27e9\n  have h4 : a \u2264 b \u2227 \u00ac(f a \u2264 f b) := not_imp.mp hb\n  have h5 : a \u2264 b \u2227 f b < f a := \u27e8h4.1, lt_of_not_le h4.2\u27e9\n  use a, b\n  -- \u22a2 a \u2264 b \u2227 f b < f a\n  exact h5\n\n-- 2\u00aa demostraci\u00f3n\n-- ===============\n\nexample\n  (h : \u00acMonotone f)\n  : \u2203 x y, x \u2264 y \u2227 f y < f x :=\nby\n  simp only [Monotone] at h\n  -- h : \u00ac\u2200 \u2983a b : \u211d\u2984, a \u2264 b \u2192 f a \u2264 f b\n  push_neg at h\n  -- h : Exists fun \u2983a\u2984 => Exists fun \u2983b\u2984 => a \u2264 b \u2227 f b < f a\n  exact h\n\n-- Lemas usados\n-- ============\n\n-- variable {\u03b1 : Type _}\n-- variable (P : \u03b1 \u2192 Prop)\n-- variable (p q : Prop)\n-- variable (a b : \u211d)\n-- #check (not_forall : (\u00ac\u2200 x, P x) \u2194 \u2203 x, \u00acP x)\n-- #check (not_imp : \u00ac(p \u2192 q) \u2194 p \u2227 \u00acq)\n-- #check (lt_of_not_le : \u00acb \u2264 a \u2192 a < b)\n<\/pre>\n<p><b>Demostraciones interactivas<\/b><\/p>\n<p>Se puede interactuar con las demostraciones anteriores en <a href=\"https:\/\/live.lean-lang.org\/#url=https:\/\/raw.githubusercontent.com\/jaalonso\/Calculemus2\/main\/src\/CN_de_no_monotona.lean\" rel=\"noopener noreferrer\" target=\"_blank\">Lean 4 Web<\/a>.<\/p>\n<p><b>Referencias<\/b><\/p>\n<ul>\n<li> J. Avigad y P. Massot. <a href=\"https:\/\/bit.ly\/3U4UjBk\">Mathematics in Lean<\/a>, p. 34.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Demostrar con Lean4 que si f no es mon\u00f3tona, entonces \u2203x\u2203y[x \u2264 y \u2227 f(y) < f(x)]\u200b.\n<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/1835"}],"collection":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/comments?post=1835"}],"version-history":[{"count":4,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/1835\/revisions"}],"predecessor-version":[{"id":1839,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/1835\/revisions\/1839"}],"wp:attachment":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/media?parent=1835"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/categories?post=1835"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/tags?post=1835"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}