        {"id":782,"date":"2021-09-23T05:00:18","date_gmt":"2021-09-23T03:00:18","guid":{"rendered":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/?p=782"},"modified":"2021-09-18T17:54:00","modified_gmt":"2021-09-18T15:54:00","slug":"prueba-de-1p%e2%81%bf-%e2%89%a5-1np","status":"publish","type":"post","link":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/prueba-de-1p%e2%81%bf-%e2%89%a5-1np\/","title":{"rendered":"Prueba de (1+p)\u207f \u2265 1+np"},"content":{"rendered":"<p>Sean p \u2208 \u211d y n \u2208 \u2115 tales que p > -1. Demostrar que<\/p>\n<pre lang=\"text\">\n   (1 + p)\u207f \u2265 1 + np\n<\/pre>\n<p>Para ello, completar la siguiente teor\u00eda de Lean:<\/p>\n<pre lang=\"lean\">\nimport data.real.basic\nopen nat\n\nvariable (p : \u211d)\nvariable (n : \u2115)\n\nexample\n  (h : p > -1)\n  : (1 + p)^n \u2265 1 + n*p :=\nbegin\nsorry\n<\/pre>\n<p>[expand title=\u00bbSoluciones con Lean\u00bb]<\/p>\n<pre lang=\"lean\">\r\nimport data.real.basic\r\nopen nat\r\n\r\nvariable (p : \u211d)\r\nvariable (n : \u2115)\r\n\r\nset_option pp.structure_projections false\r\n\r\nexample\r\n  (h : p > -1)\r\n  : (1 + p)^n \u2265 1 + n*p :=\r\nbegin\r\n  induction n with n HI,\r\n  { simp, },\r\n  { have h1 : 1 + p > 0 := iff.mp neg_lt_iff_pos_add' h,\r\n    have h2 : p*p \u2265 0 := mul_self_nonneg p,\r\n    replace h2 : \u2191n*(p*p) \u2265 0 := mul_nonneg (cast_nonneg n) h2,\r\n    calc (1 + p)^succ n\r\n         = (1 + p)^n * (1 + p)\r\n             : pow_succ' (1 + p) n\r\n     ... \u2265 (1 + n * p) * (1 + p)\r\n             : (mul_le_mul_right h1).mpr HI\r\n     ... = (1 + p + n*p) + n*(p*p)\r\n             : by ring !\r\n     ... \u2265 1 + p + n*p\r\n             : le_add_of_nonneg_right h2\r\n     ... = 1 + (n + 1) * p\r\n             : by ring !\r\n     ... = 1 + \u2191(succ n) * p\r\n             : by norm_num },\r\nend\r\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\/Prueba_de_(1+p)^n_mayor_o_igual_que_1+np.lean\" rel=\"noopener noreferrer\" target=\"_blank\">esta sesi\u00f3n con Lean<\/a>.<\/p>\n<p>En los comentarios se pueden escribir otras soluciones, escribiendo el c\u00f3digo entre una l\u00ednea con &#60;pre lang=&quot;lean&quot;&#62; y otra con &#60;\/pre&#62;<br \/>\n[\/expand]<\/p>\n<p>[expand title=\u00bbSoluciones con Isabelle\/HOL\u00bb]<\/p>\n<pre lang=\"isar\">\r\ntheory \"Prueba_de_(1+p)^n_mayor_o_igual_que_1+np\"\r\nimports Main HOL.Real\r\nbegin\r\n\r\nlemma\r\n  fixes p :: real\r\n  assumes \"p > -1\"\r\n  shows \"(1 + p)^n \u2265 1 + n*p\"\r\nproof (induct n)\r\n  show \"(1 + p) ^ 0 \u2265 1 + real 0 * p\"\r\n    by simp\r\nnext\r\n  fix n\r\n  assume HI : \"(1 + p)^n \u2265 1 +  n * p\"\r\n  have \"1 + Suc n * p = 1 + (n + 1) * p\"\r\n    by simp\r\n  also have \"\u2026 = 1 + n*p + p\"\r\n    by (simp add: distrib_right)\r\n  also have \"\u2026 \u2264 (1 + n*p + p) + n*(p*p)\"\r\n    by simp\r\n  also have \"\u2026 = (1 + n * p) * (1 + p)\"\r\n    by algebra\r\n  also have \"\u2026 \u2264 (1 + p)^n * (1 + p)\"\r\n    using HI assms by simp\r\n  also have \"\u2026 = (1 + p)^(Suc n)\"\r\n    by simp\r\n  finally show \"1 + Suc n * p \u2264 (1 + p)^(Suc n)\" .\r\nqed\r\n\r\nend\r\n<\/pre>\n<p>En los comentarios se pueden escribir otras soluciones, escribiendo el c\u00f3digo entre una l\u00ednea con &#60;pre lang=&quot;isar&quot;&#62; y otra con &#60;\/pre&#62;<br \/>\n[\/expand]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sean p \u2208 \u211d y n \u2208 \u2115 tales que p > -1. Demostrar que (1 + p)\u207f \u2265 1 + np Para ello, completar la siguiente teor\u00eda de Lean: import data.real.basic open nat variable (p : \u211d) variable (n : \u2115) example (h : p > -1) : (1 + p)^n \u2265 1 + n*p := begin sorry [expand title=\u00bbSoluciones con Lean\u00bb] import data.real.basic open nat variable (p : \u211d) variable (n : \u2115) set_option pp.structure_projections false example (h : p > -1) : (1 + p)^n \u2265 1 + n*p := begin induction n with n HI, { simp, }, { have h1 : 1 + p > 0 := iff.mp neg_lt_iff_pos_add&#8217; h, have h2 : p*p \u2265 0 := mul_self_nonneg p, replace&#8230;<\/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":[105],"tags":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/782"}],"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=782"}],"version-history":[{"count":3,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/782\/revisions"}],"predecessor-version":[{"id":785,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/782\/revisions\/785"}],"wp:attachment":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/media?parent=782"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/categories?post=782"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/tags?post=782"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}