        {"id":1745,"date":"2023-11-01T06:00:26","date_gmt":"2023-11-01T04:00:26","guid":{"rendered":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/?p=1745"},"modified":"2023-10-26T11:26:42","modified_gmt":"2023-10-26T09:26:42","slug":"01-nov-23","status":"publish","type":"post","link":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/01-nov-23\/","title":{"rendered":"Si a es una cota superior de f y c \u2265 0, entonces ca es una cota superior de cf"},"content":{"rendered":"<p>Demostrar con Lean4 que si &#92;(a&#92;) es una cota superior de &#92;(f&#92;) y &#92;(c \u2265 0&#92;), entonces &#92;(ca&#92;) es una cota superior de &#92;(cf&#92;).<\/p>\n<p>Para ello, completar la siguiente teor\u00eda de Lean4:<\/p>\n<pre lang=\"lean\">\nimport Mathlib.Data.Real.Basic\n\n-- (CotaSuperior f a) se verifica si a es una cota superior de f.\ndef CotaSuperior (f : \u211d \u2192 \u211d) (a : \u211d) : Prop :=\n  \u2200 x, f x \u2264 a\n\nvariable {f : \u211d \u2192 \u211d}\nvariable {c : \u211d}\n\nexample\n  (hfa : CotaSuperior f a)\n  (h : c \u2265 0)\n  : CotaSuperior (fun x \u21a6 c * f x) (c * a) :=\nby sorry\n<\/pre>\n<p><!--more--><\/p>\n<p><b>Demostraci\u00f3n en lenguaje natural<\/b><\/p>\n<p><br \/>\nSe usar\u00e1 el lema<br \/>\n&#92;[ &#92;{b \u2264 c, 0 \u2264 a&#92;} \u22a2 ab \u2264 ac &#92;tag{L1} &#92;]<\/p>\n<p>Tenemos que demostrar que<br \/>\n&#92;[ (\u2200 y \u2208 \u211d) cf(y) \u2264 ca &#92;]<br \/>\nSea &#92;(y \u2208 R&#92;). Puesto que &#92;(a&#92;) es una cota de &#92;(f&#92;), se tiene que<br \/>\n&#92;[ f(y) \u2264 a &#92;]<br \/>\nque, junto con &#92;(c \u2265 0&#92;), por el lema L1 nos da<br \/>\n&#92;[ cf(y) \u2264 ca &#92;]<\/p>\n<p><b>Demostraciones con Lean4<\/b><\/p>\n<pre lang=\"lean\">\nimport Mathlib.Data.Real.Basic\n\n-- (CotaSuperior f a) se verifica si a es una cota superior de f.\ndef CotaSuperior (f : \u211d \u2192 \u211d) (a : \u211d) : Prop :=\n  \u2200 x, f x \u2264 a\n\nvariable {f : \u211d \u2192 \u211d}\nvariable {c : \u211d}\n\n-- 1\u00aa demostraci\u00f3n\nexample\n  (hfa : CotaSuperior f a)\n  (h : c \u2265 0)\n  : CotaSuperior (fun x \u21a6 c * f x) (c * a) :=\nby\n  intro y\n  -- y : \u211d\n  -- \u22a2 (fun x => c * f x) y \u2264 c * a\n  have ha : f y \u2264 a := hfa y\n  calc (fun x => c * f x) y\n       = c * f y := by rfl\n     _ \u2264 c * a   := mul_le_mul_of_nonneg_left ha h\n\n-- 2\u00aa demostraci\u00f3n\nexample\n  (hfa : CotaSuperior f a)\n  (h : c \u2265 0)\n  : CotaSuperior (fun x \u21a6 c * f x) (c * a) :=\nby\n  intro y\n  calc (fun x => c * f x) y\n       = c * f y := by rfl\n     _ \u2264 c * a   := mul_le_mul_of_nonneg_left (hfa y) h\n\n-- 3\u00aa demostraci\u00f3n\nexample\n  (hfa : CotaSuperior f a)\n  (h : c \u2265 0)\n  : CotaSuperior (fun x \u21a6 c * f x) (c * a) :=\nby\n  intro y\n  show (fun x => c * f x) y \u2264 c * a\n  exact mul_le_mul_of_nonneg_left (hfa y) h\n\n-- 4\u00aa demostraci\u00f3n\nlemma CotaSuperior_mul\n  (hfa : CotaSuperior f a)\n  (h : c \u2265 0)\n  : CotaSuperior (fun x \u21a6 c * f x) (c * a) :=\nfun y \u21a6 mul_le_mul_of_nonneg_left (hfa y) h\n\n-- Lemas usados\n-- ============\n\n-- variable (c : \u211d)\n-- #check (mul_le_mul_of_nonneg_left : b \u2264 c \u2192 0 \u2264 a \u2192 a * b \u2264 a * c)\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\/Cota_superior_de_producto_por_escalar.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. 29.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Demostrar con Lean4 que si &#92;(a&#92;) es una cota superior de &#92;(f&#92;) y &#92;(c \u2265 0&#92;), entonces &#92;(ca&#92;) es una cota superior de &#92;(cf&#92;). Para ello, completar la siguiente teor\u00eda de Lean4: import Mathlib.Data.Real.Basic &#8212; (CotaSuperior f a) se verifica si a es una cota superior de f. def CotaSuperior (f : \u211d \u2192 \u211d) (a : \u211d) : Prop := \u2200 x, f x \u2264 a variable {f : \u211d \u2192 \u211d} variable {c : \u211d} example (hfa : CotaSuperior f a) (h : c \u2265 0) : CotaSuperior (fun x \u21a6 c * f x) (c * a) := by sorry<\/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\/1745"}],"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=1745"}],"version-history":[{"count":1,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/1745\/revisions"}],"predecessor-version":[{"id":1746,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/1745\/revisions\/1746"}],"wp:attachment":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/media?parent=1745"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/categories?post=1745"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/tags?post=1745"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}