{"id":7832,"date":"2022-10-31T07:55:57","date_gmt":"2022-10-31T06:55:57","guid":{"rendered":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/?p=7832"},"modified":"2022-10-31T07:55:57","modified_gmt":"2022-10-31T06:55:57","slug":"dao-la-semana-en-calculemus-28-de-octubre-de-2022","status":"publish","type":"post","link":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/dao-la-semana-en-calculemus-28-de-octubre-de-2022\/","title":{"rendered":"DAO: La semana en Calculemus (28 de octubre de 2022)"},"content":{"rendered":"<p>Esta semana he publicado en <a href=\"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/\">Calculemus<\/a> las demostraciones con Lean de las siguientes propiedades:<\/p>\n<ul>\n<li><a href=\"#ej1\">1. Si R es un ret\u00edculo tal que x \u2293 (y \u2294 z) = (x \u2293 y) \u2294 (x \u2293 z), entonces (a \u2294 b) \u2293 c = (a \u2293 c) \u2294 (b \u2293 c)<\/a><\/li>\n<li><a href=\"#ej2\">2. Si R es un ret\u00edculo tal que x \u2294 (y \u2293 z) = (x \u2294 y) \u2293 (x \u2294 z), entonces (a \u2293 b) \u2294 c = (a \u2294 c) \u2293 (b \u2294 c)<\/a><\/li>\n<li><a href=\"#ej3\">3. Si R es un anillo ordenado, entonces \u2200 a b \u2208 R, a \u2264 b \u2192 0 \u2264 b &#8211; a<\/a><\/li>\n<li><a href=\"#ej4\">4. Si R es un anillo ordenado y a, b \u2208 R, entonces 0 \u2264 b &#8211; a \u2192 a \u2264 b<\/a><\/li>\n<li><a href=\"#ej5\">5. Si R es un anillo ordenado y a, b, c \u2208 R tales que a \u2264 b y 0 \u2264 c, entonces ac \u2264 bc<\/a><\/li>\n<\/ul>\n<p>A continuaci\u00f3n se muestran las soluciones.<br \/>\n<!--more--><br \/>\n<a name=\"ej1\"><\/a><\/p>\n<h3>1. Si R es un ret\u00edculo tal que x \u2293 (y \u2294 z) = (x \u2293 y) \u2294 (x \u2293 z), entonces (a \u2294 b) \u2293 c = (a \u2293 c) \u2294 (b \u2293 c)<\/h3>\n<p>Demostrar que si R es un ret\u00edculo tal que<\/p>\n<pre lang=\"text\">\n   (\u2200 x y z \u2208 R, x \u2293 (y \u2294 z) = (x \u2293 y) \u2294 (x \u2293 z))),\n<\/pre>\n<p>entonces<\/p>\n<pre lang=\"text\">\n   (\u2200 a b c \u2208 R, (a \u2294 b) \u2293 c = (a \u2293 c) \u2294 (b \u2293 c))\n<\/pre>\n<p>Para ello, completar la siguiente teor\u00eda de Lean:<\/p>\n<pre lang=\"lean\">\nimport order.lattice\nvariables {R : Type*} [lattice R]\n\nexample\n  (h : \u2200 x y z : R, x \u2293 (y \u2294 z) = (x \u2293 y) \u2294 (x \u2293 z))\n  : \u2200 a b c : R, (a \u2294 b) \u2293 c = (a \u2293 c) \u2294 (b \u2293 c) :=\nsorry\n<\/pre>\n<p><!--more--><\/p>\n<p><b>Soluciones con Lean<\/b><\/p>\n<pre lang=\"lean\">\nimport order.lattice\nvariables {R : Type*} [lattice R]\n\nexample\n  (h : \u2200 x y z : R, x \u2293 (y \u2294 z) = (x \u2293 y) \u2294 (x \u2293 z))\n  : \u2200 a b c : R, (a \u2294 b) \u2293 c = (a \u2293 c) \u2294 (b \u2293 c) :=\nbegin\n  intros a b c,\n  calc (a \u2294 b) \u2293 c\n       = c \u2293 (a \u2294 b)       : by rw inf_comm\n   ... = (c \u2293 a) \u2294 (c \u2293 b) : by rw h\n   ... = (a \u2293 c) \u2294 (c \u2293 b) : by rw [@inf_comm _ _ c a]\n   ... = (a \u2293 c) \u2294 (b \u2293 c) : by rw [@inf_comm _ _ c b]\nend\n<\/pre>\n<p>Se puede interactuar con la prueba anterior en <a href=\"https:\/\/leanprover-community.github.io\/lean-web-editor\/#url=https:\/\/raw.githubusercontent.com\/jaalonso\/Calculemus\/main\/src\/Propiedad_distributiva_1.lean\" rel=\"noopener noreferrer\" target=\"_blank\">esta sesi\u00f3n con Lean<\/a>.<\/p>\n<p><b>Referencias<\/b><\/p>\n<ul>\n<li>J. Avigad, K. Buzzard, R.Y. Lewis y P. Massot. <a href=\"https:\/\/bit.ly\/3U4UjBk\">Mathematics in Lean<\/a>, p. 23.<\/li>\n<\/ul>\n<p><a name=\"ej2\"><\/a><\/p>\n<h3>2. Si R es un ret\u00edculo tal que x \u2294 (y \u2293 z) = (x \u2294 y) \u2293 (x \u2294 z), entonces (a \u2293 b) \u2294 c = (a \u2294 c) \u2293 (b \u2294 c)<\/h3>\n<p>Demostrar que Si R es un ret\u00edculo tal que<\/p>\n<pre lang=\"text\">\n   \u2200 x y z : \u03b1, x \u2294 (y \u2293 z) = (x \u2294 y) \u2293 (x \u2294 z)\n<\/pre>\n<p>entonces<\/p>\n<pre lang=\"text\">\n   \u2200 a b c : R, (a \u2293 b) \u2294 c = (a \u2294 c) \u2293 (b \u2294 c)\n<\/pre>\n<p>Para ello, completar la siguiente teor\u00eda de Lean:<\/p>\n<pre lang=\"lean\">\nimport order.lattice\nvariables {R : Type*} [lattice R]\n\nexample\n  (h : \u2200 x y z : R, x \u2294 (y \u2293 z) = (x \u2294 y) \u2293 (x \u2294 z))\n  : \u2200 a b c : R, (a \u2293 b) \u2294 c = (a \u2294 c) \u2293 (b \u2294 c) :=\nsorry\n<\/pre>\n<p><!--more--><\/p>\n<p><b>Soluciones con Lean<\/b><\/p>\n<pre lang=\"lean\">\nimport order.lattice\nvariables {R : Type*} [lattice R]\n\nexample\n  (h : \u2200 x y z : R, x \u2294 (y \u2293 z) = (x \u2294 y) \u2293 (x \u2294 z))\n  : \u2200 a b c : R, (a \u2293 b) \u2294 c = (a \u2294 c) \u2293 (b \u2294 c) :=\nbegin\n  intros a b c,\n  calc (a \u2293 b) \u2294 c\n       = c \u2294 (a \u2293 b)       : by rw sup_comm\n   ... = (c \u2294 a) \u2293 (c \u2294 b) : by rw h\n   ... = (a \u2294 c) \u2293 (c \u2294 b) : by rw [@sup_comm _ _ c a]\n   ... = (a \u2294 c) \u2293 (b \u2294 c) : by rw [@sup_comm _ _ c b]\nend\n<\/pre>\n<p>Se puede interactuar con la prueba anterior en <a href=\"https:\/\/leanprover-community.github.io\/lean-web-editor\/#url=https:\/\/raw.githubusercontent.com\/jaalonso\/Calculemus\/main\/src\/Propiedad_distributiva_2.lean\" rel=\"noopener noreferrer\" target=\"_blank\">esta sesi\u00f3n con Lean<\/a>.<\/p>\n<p><b>Referencias<\/b><\/p>\n<ul>\n<li>J. Avigad, K. Buzzard, R.Y. Lewis y P. Massot. <a href=\"https:\/\/bit.ly\/3U4UjBk\">Mathematics in Lean<\/a>, p. 23.<\/li>\n<\/ul>\n<p><a name=\"ej3\"><\/a><\/p>\n<h3>3. Si R es un anillo ordenado, entonces \u2200 a b \u2208 R, a \u2264 b \u2192 0 \u2264 b &#8211; a<\/h3>\n<p>Demostrar que si R es un anillo ordenado y a b \u2208 R, entonces<\/p>\n<pre lang=\"text\">\n   a \u2264 b \u2192 0 \u2264 b - a\n<\/pre>\n<p>Para ello, completar la siguiente teor\u00eda de Lean:<\/p>\n<pre lang=\"lean\">\nimport algebra.order.ring\nvariables {R : Type*} [ordered_ring R]\nvariables a b : R\n\nexample : a \u2264 b \u2192 0 \u2264 b - a :=\nsorry\n<\/pre>\n<p><!--more--><\/p>\n<p><b>Soluciones con Lean<\/b><\/p>\n<pre lang=\"lean\">\nimport algebra.order.ring\nvariables {R : Type*} [ordered_ring R]\nvariables a b : R\n\n-- 1\u00aa demostraci\u00f3n\n-- ===============\n\nexample : a \u2264 b \u2192 0 \u2264 b - a :=\nbegin\n  intro h,\n  calc\n    0   = a - a : (sub_self a).symm\n    ... \u2264 b - a : sub_le_sub_right h a\nend\n\n-- 2\u00aa demostraci\u00f3n\n-- ===============\n\nexample : a \u2264 b \u2192 0 \u2264 b - a :=\n-- by library_search\nsub_nonneg.mpr\n\n-- 3\u00aa demostraci\u00f3n\n-- ===============\n\nexample : a \u2264 b \u2192 0 \u2264 b - a :=\n-- by hint\nby simp\n<\/pre>\n<p>Se puede interactuar con la prueba anterior en <a href=\"https:\/\/leanprover-community.github.io\/lean-web-editor\/#url=https:\/\/raw.githubusercontent.com\/jaalonso\/Calculemus\/main\/src\/Si_es_menor_o_igual_entonces_la_diferencia_es_positiva.lean\" rel=\"noopener noreferrer\" target=\"_blank\">esta sesi\u00f3n con Lean<\/a>.<\/p>\n<p><b>Referencias<\/b><\/p>\n<ul>\n<li>J. Avigad, K. Buzzard, R.Y. Lewis y P. Massot. <a href=\"https:\/\/bit.ly\/3U4UjBk\">Mathematics in Lean<\/a>, p. 23.<\/li>\n<\/ul>\n<p><a name=\"ej4\"><\/a><\/p>\n<h3>4. Si R es un anillo ordenado y a, b \u2208 R, entonces 0 \u2264 b &#8211; a \u2192 a \u2264 b<\/h3>\n<p>Demostrar que si R es un anillo ordenado y a, b \u2208 R, entonces<\/p>\n<pre lang=\"text\">\n   0 \u2264 b - a \u2192 a \u2264 b\n<\/pre>\n<p>Para ello, completar la siguiente teor\u00eda de Lean:<\/p>\n<pre lang=\"lean\">\nimport algebra.order.ring\nvariables {R : Type*} [ordered_ring R]\nvariables a b : R\n\nexample : 0 \u2264 b - a \u2192 a \u2264 b :=\nsorry\n<\/pre>\n<p><!--more--><\/p>\n<p><b>Soluciones con Lean<\/b><\/p>\n<pre lang=\"lean\">\nimport algebra.order.ring\nvariables {R : Type*} [ordered_ring R]\nvariables a b : R\n\n-- 1\u00aa demostraci\u00f3n\n-- ===============\n\nexample : 0 \u2264 b - a \u2192 a \u2264 b :=\nbegin\n  intro h,\n  calc\n    a   = 0 + a       : (zero_add a).symm\n    ... \u2264 (b - a) + a : add_le_add_right h a\n    ... = b           : sub_add_cancel b a\nend\n\n-- 2\u00aa demostraci\u00f3n\n-- ===============\n\nexample : 0 \u2264 b - a \u2192 a \u2264 b :=\n-- by library_search\nsub_nonneg.mp\n\n-- 3\u00aa demostraci\u00f3n\n-- ===============\n\nexample : 0 \u2264 b - a \u2192 a \u2264 b :=\n-- by hint\nby simp\n<\/pre>\n<p>Se puede interactuar con la prueba anterior en <a href=\"https:\/\/leanprover-community.github.io\/lean-web-editor\/#url=https:\/\/raw.githubusercontent.com\/jaalonso\/Calculemus\/main\/src\/CN_de_diferencia_no_negativa.lean\" rel=\"noopener noreferrer\" target=\"_blank\">esta sesi\u00f3n con Lean<\/a>.<\/p>\n<p><b>Referencias<\/b><\/p>\n<ul>\n<li>J. Avigad, K. Buzzard, R.Y. Lewis y P. Massot. <a href=\"https:\/\/bit.ly\/3U4UjBk\">Mathematics in Lean<\/a>, p. 23.<\/li>\n<\/ul>\n<p><a name=\"ej5\"><\/a><\/p>\n<h3>5. Si R es un anillo ordenado y a, b, c \u2208 R tales que a \u2264 b y 0 \u2264 c, entonces ac \u2264 bc<\/h3>\n<p>Demostrar que si R es un anillo ordenado y a, b, c \u2208 R tales que<\/p>\n<pre lang=\"text\">\n   a \u2264 b\n   0 \u2264 c\n<\/pre>\n<p>entonces<\/p>\n<pre lang=\"text\">\n   a * c \u2264 b * c\n<\/pre>\n<p>Para ello, completar la siguiente teor\u00eda de Lean:<\/p>\n<pre lang=\"lean\">\nimport algebra.order.ring\nvariables {R : Type*} [ordered_ring R]\nvariables a b c: R\n\nexample\n  (h1 : a \u2264 b)\n  (h2 : 0 \u2264 c)\n  : a * c \u2264 b * c :=\nsorry\n<\/pre>\n<p><b>Soluciones con Lean<\/b><\/p>\n<pre lang=\"lean\">\nimport algebra.order.ring\nvariables {R : Type*} [ordered_ring R]\nvariables a b c: R\n\n-- 1\u00aa demostraci\u00f3n\n-- ===============\n\nexample\n  (h1 : a \u2264 b)\n  (h2 : 0 \u2264 c)\n  : a * c \u2264 b * c :=\nbegin\n  have h3 : 0 \u2264 b - a :=\n    sub_nonneg.mpr h1,\n  have h4 : 0 \u2264 (b - a) * c :=\n    mul_nonneg h3 h2,\n  have h5 : (b - a) * c = b * c - a * c :=\n    sub_mul b a c,\n  have h6 : 0 \u2264 b * c - a * c :=\n    eq.trans_ge h5 h4,\n  show a * c \u2264 b * c,\n    by exact sub_nonneg.mp h6,\nend\n\n-- 2\u00aa demostraci\u00f3n\n-- ===============\n\nopen_locale classical\n\nexample\n  (h1 : a \u2264 b)\n  (h2 : 0 \u2264 c)\n  : a * c \u2264 b * c :=\nbegin\n  by_cases h3 : b \u2264 a,\n  { have h3a : a = b :=\n      le_antisymm h1 h3,\n    show a * c \u2264 b * c,\n      by rw h3a },\n  { by_cases h4 : c = 0,\n    { calc a * c = a * 0 : by rw h4\n             ... = 0     : by rw mul_zero\n             ... \u2264 0     : le_refl 0\n             ... = b * 0 : by rw mul_zero\n             ... = b * c : by {congr ; rw h4}},\n    { apply le_of_lt,\n      apply mul_lt_mul_of_pos_right,\n      { show a < b,\n          by exact lt_of_le_not_le h1 h3 },\n      { show 0 < c,\n          by exact lt_of_le_of_ne h2 (ne.symm h4) }}},\nend\n\n-- 3\u00aa demostraci\u00f3n\nexample\n  (h1 : a \u2264 b)\n  (h2 : 0 \u2264 c)\n  : a * c \u2264 b * c :=\n-- by library_search\nmul_le_mul_of_nonneg_right h1 h2\n<\/pre>\n<p>Se puede interactuar con la prueba anterior en <a href=\"https:\/\/leanprover-community.github.io\/lean-web-editor\/#url=https:\/\/raw.githubusercontent.com\/jaalonso\/Calculemus\/main\/src\/Producto_desigualdad_por_no_negativo.lean\" rel=\"noopener noreferrer\" target=\"_blank\">esta sesi\u00f3n con Lean<\/a>.<\/p>\n<p><b>Referencias<\/b><\/p>\n<ul>\n<li>J. Avigad, K. Buzzard, R.Y. Lewis y P. Massot. <a href=\"https:\/\/bit.ly\/3U4UjBk\">Mathematics in Lean<\/a>, p. 23.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Esta semana he publicado en Calculemus las demostraciones con Lean de las siguientes propiedades: 1. Si R es un ret\u00edculo tal que x \u2293 (y \u2294 z) = (x \u2293 y) \u2294 (x \u2293 z), entonces (a \u2294 b) \u2293 c = (a \u2293 c) \u2294 (b \u2293 c) 2. Si R es un ret\u00edculo&#8230;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","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,"footnotes":"","_jetpack_memberships_contains_paid_content":false},"categories":[335],"tags":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_likes_enabled":false,"_links":{"self":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/wp-json\/wp\/v2\/posts\/7832"}],"collection":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/wp-json\/wp\/v2\/comments?post=7832"}],"version-history":[{"count":1,"href":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/wp-json\/wp\/v2\/posts\/7832\/revisions"}],"predecessor-version":[{"id":7833,"href":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/wp-json\/wp\/v2\/posts\/7832\/revisions\/7833"}],"wp:attachment":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/wp-json\/wp\/v2\/media?parent=7832"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/wp-json\/wp\/v2\/categories?post=7832"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/vestigium\/wp-json\/wp\/v2\/tags?post=7832"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}