        {"id":2500,"date":"2024-05-22T06:00:20","date_gmt":"2024-05-22T04:00:20","guid":{"rendered":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/?p=2500"},"modified":"2024-05-20T17:28:10","modified_gmt":"2024-05-20T15:28:10","slug":"22-may-24","status":"publish","type":"post","link":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/22-may-24\/","title":{"rendered":"Si una funci\u00f3n es creciente e involutiva, entonces es la identidad"},"content":{"rendered":"\n<p>Sea una funci\u00f3n &#92;(f&#92;) de &#92;(\u211d&#92;) en &#92;(\u211d&#92;).<\/p>\n<ul>\n<li>Se dice que &#92;(f&#92;) es creciente si para todo &#92;(x&#92;) e &#92;(y&#92;) tales que &#92;(x \u2264 y&#92;) se tiene que &#92;(f(x) \u2264 f(y)&#92;).<\/li>\n<li>Se dice que &#92;(f&#92;) es involutiva si para todo &#92;(x&#92;) se tiene que &#92;(f(f(x)) = x&#92;).<\/li>\n<\/ul>\n<p>En Lean4 que &#92;(f&#92;) sea creciente se representa por <code>Monotone f<\/code> y que sea involutiva por <code>Involutive f<\/code><\/p>\n<p>Demostrar con Lean4 que si &#92;(f&#92;) es creciente e involutiva, entonces &#92;(f&#92;) es la identidad.<\/p>\n<p>Para ello, completar la siguiente teor\u00eda de Lean4:<\/p>\n<pre lang=\"lean\">\nimport Mathlib.Data.Real.Basic\nopen Function\n\nvariable (f : \u211d \u2192 \u211d)\n\nexample\n  (hc : Monotone f)\n  (hi : Involutive f)\n  : f = id :=\nby sorry\n<\/pre>\n<p><!--more--><\/p>\n<h2>1. Demostraci\u00f3n en lenguaje natural<\/h2>\n<p>Tenemos que demostrar que para todo &#92;(x \u2208 \u211d&#92;), &#92;(f(x) = x&#92;). Sea &#92;(x \u2208 \u211d&#92;). Entonces, por ser &#92;(f&#92;) involutiva, se tiene que<br \/>\n&#92;[ f(f(x)) = x &#92;tag{1} &#92;]<br \/>\nAdem\u00e1s, por las propiedades del orden, se tiene que &#92;(f(x) \u2264 x&#92;) \u00f3 &#92;(x \u2264 f(x)&#92;). Demostraremos que &#92;(f(x) = x&#92;) en los dos casos.<\/p>\n<p>Caso 1: Supongamos que<br \/>\n&#92;[ f(x) \u2264 x &#92;tag{2} &#92;]<br \/>\nEntonces, por ser &#92;(f&#92;) creciente, se tiene que<br \/>\n&#92;[ f(f(x)) \u2264 f(x) &#92;tag{3} &#92;]<br \/>\nSustituyendo (1) en (3), se tiene<br \/>\n&#92;[ x \u2264 f(x) &#92;]<br \/>\nque junto con (1) da<br \/>\n&#92;[ f(x) = x &#92;]<\/p>\n<p>Caso 2: Supongamos que<br \/>\n&#92;[ x \u2264 f(x) &#92;tag{4} &#92;]<br \/>\nEntonces, por ser &#92;(f&#92;) creciente, se tiene que<br \/>\n&#92;[ f(x) \u2264 f(f(x)) &#92;tag{5} &#92;]<br \/>\nSustituyendo (1) en (5), se tiene<br \/>\n&#92;[ f(x) \u2264 x &#92;]<br \/>\nque junto con (4) da<br \/>\n&#92;[ f(x) = x &#92;]<\/p>\n<h2>2. Demostraciones con Lean4<\/h2>\n<pre lang=\"lean\">\nimport Mathlib.Data.Real.Basic\nopen Function\n\nvariable (f : \u211d \u2192 \u211d)\n\n-- 1\u00aa demostraci\u00f3n\nexample\n  (hc : Monotone f)\n  (hi : Involutive f)\n  : f = id :=\nby\n  funext x\n  -- x : \u211d\n  -- \u22a2 f x = id x\n  have h : f (f x) = x := hi x\n  cases' (le_total (f x) x) with h1 h2\n  . -- h1 : f x \u2264 x\n    have h1a : f (f x) \u2264 f x := hc h1\n    have h1b : x \u2264 f x := by rwa [h] at h1a\n    show f x = x\n    exact antisymm h1 h1b\n  . -- h2 : x \u2264 f x\n    have h2a : f x \u2264 f (f x) := hc h2\n    have h2b : f x \u2264 x := by rwa [h] at h2a\n    show f x = x\n    exact antisymm h2b h2\n\n-- 2\u00aa demostraci\u00f3n\nexample\n  (hc : Monotone f)\n  (hi : Involutive f)\n  : f = id :=\nby\n  unfold Monotone Involutive at *\n  -- hc : \u2200 \u2983a b : \u211d\u2984, a \u2264 b \u2192 f a \u2264 f b\n  -- hi : \u2200 (x : \u211d), f (f x) = x\n  funext x\n  -- x : \u211d\n  -- \u22a2 f x = id x\n  unfold id\n  -- \u22a2 f x = x\n  cases' (le_total (f x) x) with h1 h2\n  . -- h1 : f x \u2264 x\n    apply antisymm h1\n    -- \u22a2 x \u2264 f x\n    have h3 : f (f x) \u2264 f x := by\n      apply hc\n      -- \u22a2 f x \u2264 x\n      exact h1\n    rwa [hi] at h3\n  . -- h2 : x \u2264 f x\n    apply antisymm _ h2\n    -- \u22a2 f x \u2264 x\n    have h4 : f x \u2264 f (f x) := by\n      apply hc\n      -- \u22a2 x \u2264 f x\n      exact h2\n    rwa [hi] at h4\n\n-- 3\u00aa demostraci\u00f3n\nexample\n  (hc : Monotone f)\n  (hi : Involutive f)\n  : f = id :=\nby\n  funext x\n  -- x : \u211d\n  -- \u22a2 f x = id x\n  cases' (le_total (f x) x) with h1 h2\n  . -- h1 : f x \u2264 x\n    apply antisymm h1\n    -- \u22a2 x \u2264 f x\n    have h3 : f (f x) \u2264 f x := hc h1\n    rwa [hi] at h3\n  . -- h2 : x \u2264 f x\n    apply antisymm _ h2\n    -- \u22a2 f x \u2264 x\n    have h4 : f x \u2264 f (f x) := hc h2\n    rwa [hi] at h4\n\n-- 4\u00aa demostraci\u00f3n\nexample\n  (hc : Monotone f)\n  (hi : Involutive f)\n  : f = id :=\nby\n  funext x\n  -- x : \u211d\n  -- \u22a2 f x = id x\n  cases' (le_total (f x) x) with h1 h2\n  . -- h1 : f x \u2264 x\n    apply antisymm h1\n    -- \u22a2 x \u2264 f x\n    calc x\n         = f (f x) := (hi x).symm\n       _ \u2264 f x     := hc h1\n  . -- h2 : x \u2264 f x\n    apply antisymm _ h2\n    -- \u22a2 f x \u2264 x\n    calc f x\n         \u2264 f (f x) := hc h2\n       _ = x       := hi x\n\n-- Lemas usados\n-- ============\n\n-- variable (a b : \u211d)\n-- #check (le_total a b : a \u2264 b \u2228 b \u2264 a)\n-- #check (antisymm : a \u2264 b \u2192 b \u2264 a \u2192 a = b)\n<\/pre>\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\/Una_funcion_creciente_e_involutiva_es_la_identidad.lean\">Lean 4 Web<\/a>.<\/p>\n<h2>3. Demostraciones con Isabelle\/HOL<\/h2>\n<pre lang=\"isar\">\ntheory Una_funcion_creciente_e_involutiva_es_la_identidad\nimports Main HOL.Real\nbegin\n\ndefinition involutiva :: \"(real \u21d2 real) \u21d2 bool\"\n  where \"involutiva f \u27f7 (\u2200x. f (f x) = x)\"\n\n(* 1\u00aa demostraci\u00f3n *)\n\nlemma\n  fixes f :: \"real \u21d2 real\"\n  assumes \"mono f\"\n          \"involutiva f\"\n  shows   \"f = id\"\nproof (unfold fun_eq_iff; intro allI)\n  fix x\n  have \"x \u2264 f x \u2228 f x \u2264 x\"\n    by (rule linear)\n  then have \"f x = x\"\n  proof (rule disjE)\n    assume \"x \u2264 f x\"\n    then have \"f x \u2264 f (f x)\"\n      using assms(1) by (simp only: monoD)\n    also have \"\u2026 = x\"\n      using assms(2) by (simp only: involutiva_def)\n    finally have \"f x \u2264 x\"\n      by this\n    show \"f x = x\"\n      using \u2039f x \u2264 x\u203a \u2039x \u2264 f x\u203a by (simp only: antisym)\n  next\n    assume \"f x \u2264 x\"\n    have \"x = f (f x)\"\n      using assms(2) by (simp only: involutiva_def)\n    also have \"... \u2264 f x\"\n      using \u2039f x \u2264 x\u203a assms(1) by (simp only: monoD)\n    finally have \"x \u2264 f x\"\n      by this\n    show \"f x = x\"\n      using \u2039f x \u2264 x\u203a \u2039x \u2264 f x\u203a by (simp only: monoD)\n  qed\n  then show \"f x = id x\"\n    by (simp only: id_apply)\nqed\n\n(* 2\u00aa demostraci\u00f3n *)\n\nlemma\n  fixes f :: \"real \u21d2 real\"\n  assumes \"mono f\"\n          \"involutiva f\"\n  shows   \"f = id\"\nproof\n  fix x\n  have \"x \u2264 f x \u2228 f x \u2264 x\"\n    by (rule linear)\n  then have \"f x = x\"\n  proof\n    assume \"x \u2264 f x\"\n    then have \"f x \u2264 f (f x)\"\n      using assms(1) by (simp only: monoD)\n    also have \"\u2026 = x\"\n      using assms(2) by (simp only: involutiva_def)\n    finally have \"f x \u2264 x\"\n      by this\n    show \"f x = x\"\n      using \u2039f x \u2264 x\u203a \u2039x \u2264 f x\u203a by auto\n  next\n    assume \"f x \u2264 x\"\n    have \"x = f (f x)\"\n      using assms(2) by (simp only: involutiva_def)\n    also have \"... \u2264 f x\"\n      by (simp add: \u2039f x \u2264 x\u203a assms(1) monoD)\n    finally have \"x \u2264 f x\"\n      by this\n    show \"f x = x\"\n      using \u2039f x \u2264 x\u203a \u2039x \u2264 f x\u203a by auto\n  qed\n  then show \"f x = id x\"\n    by simp\nqed\n\n(* 3\u00aa demostraci\u00f3n *)\n\nlemma\n  fixes f :: \"real \u21d2 real\"\n  assumes \"mono f\"\n          \"involutiva f\"\n  shows   \"f = id\"\nproof\n  fix x\n  have \"x \u2264 f x \u2228 f x \u2264 x\"\n    by (rule linear)\n  then have \"f x = x\"\n  proof\n    assume \"x \u2264 f x\"\n    then have \"f x \u2264 x\"\n      by (metis assms involutiva_def mono_def)\n    then show \"f x = x\"\n      using \u2039x \u2264 f x\u203a by auto\n  next\n    assume \"f x \u2264 x\"\n    then have \"x \u2264 f x\"\n      by (metis assms involutiva_def mono_def)\n    then show \"f x = x\"\n      using \u2039f x \u2264 x\u203a by auto\n  qed\n  then show \"f x = id x\"\n    by simp\nqed\n\nend\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Sea una funci\u00f3n &#92;(f&#92;) de &#92;(\u211d&#92;) en &#92;(\u211d&#92;). Se dice que &#92;(f&#92;) es creciente si para todo &#92;(x&#92;) e &#92;(y&#92;) tales que &#92;(x \u2264 y&#92;) se tiene que &#92;(f(x) \u2264 f(y)&#92;). Se dice que &#92;(f&#92;) es involutiva si para todo &#92;(x&#92;) se tiene que &#92;(f(f(x)) = x&#92;). En Lean4 que &#92;(f&#92;) sea creciente se representa por Monotone f y que sea involutiva por Involutive f Demostrar con Lean4 que si &#92;(f&#92;) es creciente e involutiva, entonces &#92;(f&#92;) es la identidad. Para ello, completar la siguiente teor\u00eda de Lean4: import Mathlib.Data.Real.Basic open Function variable (f : \u211d \u2192 \u211d) example (hc : Monotone f) (hi : Involutive f) : f = id := 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":"default","_kad_post_title":"default","_kad_post_layout":"default","_kad_post_sidebar_id":"","_kad_post_content_style":"default","_kad_post_vertical_padding":"default","_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\/2500"}],"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=2500"}],"version-history":[{"count":1,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/2500\/revisions"}],"predecessor-version":[{"id":2501,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/posts\/2500\/revisions\/2501"}],"wp:attachment":[{"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/media?parent=2500"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/categories?post=2500"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.glc.us.es\/~jalonso\/calculemus\/wp-json\/wp\/v2\/tags?post=2500"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}