        {"id":589,"date":"2021-07-22T06:00:20","date_gmt":"2021-07-22T04:00:20","guid":{"rendered":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/?p=589"},"modified":"2021-07-22T08:41:04","modified_gmt":"2021-07-22T06:41:04","slug":"si-f-x-%e2%89%a4-f-y-%e2%86%92-x-%e2%89%a4-y-entonces-f-es-inyectiva","status":"publish","type":"post","link":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/si-f-x-%e2%89%a4-f-y-%e2%86%92-x-%e2%89%a4-y-entonces-f-es-inyectiva\/","title":{"rendered":"Si `f x \u2264 f y \u2192 x \u2264 y`, entonces f es inyectiva"},"content":{"rendered":"<p>Sea f una funci\u00f3n de \u211d en \u211d tal que<\/p>\n<pre lang=\"text\">\n   \u2200 x y, f(x) \u2264 f(y) \u2192 x \u2264 y\n<\/pre>\n<p>Demostrar que f es inyectiva.<\/p>\n<p>Para ello, completar la siguiente teor\u00eda de Lean:<\/p>\n<pre lang=\"lean\">\nimport data.real.basic\nopen function\n\nvariable (f : \u211d \u2192 \u211d)\n\nexample\n  (h : \u2200 {x y}, f x \u2264 f y \u2192 x \u2264 y)\n  : injective f :=\nsorry\n<\/pre>\n<p>[expand title=\u00bbSoluciones con Lean\u00bb]<\/p>\n<pre lang=\"lean\">\r\nimport data.real.basic\r\nopen function\r\n\r\nvariable (f : \u211d \u2192 \u211d)\r\n\r\n-- 1\u00aa demostraci\u00f3n\r\nexample\r\n  (h : \u2200 {x y}, f x \u2264 f y \u2192 x \u2264 y)\r\n  : injective f :=\r\nbegin\r\n  intros x y hxy,\r\n  apply le_antisymm,\r\n  { apply h,\r\n    exact le_of_eq hxy, },\r\n  { apply h,\r\n    exact ge_of_eq hxy, },\r\nend\r\n\r\n-- 2\u00aa demostraci\u00f3n\r\nexample\r\n  (h : \u2200 {x y}, f x \u2264 f y \u2192 x \u2264 y)\r\n  : injective f :=\r\nbegin\r\n  intros x y hxy,\r\n  apply le_antisymm,\r\n  { exact h (le_of_eq hxy), },\r\n  { exact h (ge_of_eq hxy), },\r\nend\r\n\r\n-- 3\u00aa demostraci\u00f3n\r\nexample\r\n  (h : \u2200 {x y}, f x \u2264 f y \u2192 x \u2264 y)\r\n  : injective f :=\r\n\u03bb x y hxy, le_antisymm (h hxy.le) (h hxy.ge)\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\/Si_f(x)_leq_f(y)_to_x_leq_y,_entonces_f_es_inyectiva.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 \"Si_f(x)_leq_f(y)_to_x_leq_y,_entonces_f_es_inyectiva\"\r\nimports Main HOL.Real\r\nbegin\r\n\r\n(* 1\u00aa demostraci\u00f3n *)\r\nlemma\r\n  fixes f :: \"real \u21d2 real\"\r\n  assumes \"\u2200 x y. f x \u2264 f y \u27f6 x \u2264 y\"\r\n  shows   \"inj f\"\r\nproof (rule injI)\r\n  fix x y\r\n  assume \"f x = f y\"\r\n  show \"x = y\"\r\n  proof (rule antisym)\r\n    show \"x \u2264 y\" \r\n      by (simp only: assms \u2039f x = f y\u203a)\r\n  next\r\n    show \"y \u2264 x\"\r\n      by (simp only: assms \u2039f x = f y\u203a)\r\n  qed\r\nqed\r\n\r\n(* 2\u00aa demostraci\u00f3n *)\r\nlemma\r\n  fixes f :: \"real \u21d2 real\"\r\n  assumes \"\u2200 x y. f x \u2264 f y \u27f6 x \u2264 y\"\r\n  shows   \"inj f\"\r\nproof (rule injI)\r\n  fix x y\r\n  assume \"f x = f y\"\r\n  then show \"x = y\"\r\n    using assms\r\n    by (simp add: eq_iff)\r\nqed\r\n\r\n(* 3\u00aa demostraci\u00f3n *)\r\nlemma\r\n  fixes f :: \"real \u21d2 real\"\r\n  assumes \"\u2200 x y. f x \u2264 f y \u27f6 x \u2264 y\"\r\n  shows   \"inj f\"\r\n  by (smt (verit, ccfv_threshold) assms inj_on_def)\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>Sea f una funci\u00f3n de \u211d en \u211d tal que \u2200 x y, f(x) \u2264 f(y) \u2192 x \u2264 y Demostrar que f es inyectiva. Para ello, completar la siguiente teor\u00eda de Lean: import data.real.basic open function variable (f : \u211d \u2192 \u211d) example (h : \u2200 {x y}, f x \u2264 f y \u2192 x \u2264 y) : injective f := sorry [expand title=\u00bbSoluciones con Lean\u00bb] import data.real.basic open function variable (f : \u211d \u2192 \u211d) &#8212; 1\u00aa demostraci\u00f3n example (h : \u2200 {x y}, f x \u2264 f y \u2192 x \u2264 y) : injective f := begin intros x y hxy, apply le_antisymm, { apply h, exact le_of_eq hxy, }, { apply h, exact ge_of_eq hxy, }, end &#8212; 2\u00aa demostraci\u00f3n example&#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":[17],"tags":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/589"}],"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=589"}],"version-history":[{"count":2,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/589\/revisions"}],"predecessor-version":[{"id":593,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/589\/revisions\/593"}],"wp:attachment":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/media?parent=589"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/categories?post=589"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/tags?post=589"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}