-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUna_funcion_creciente_e_involutiva_es_la_identidad.thy
129 lines (119 loc) · 3.61 KB
/
Una_funcion_creciente_e_involutiva_es_la_identidad.thy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
(* Una_funcion_creciente_e_involutiva_es_la_identidad.thy
-- Si una función es creciente e involutiva, entonces es la identidad
-- José A. Alonso Jiménez <https://jaalonso.github.io>
-- Sevilla, 22-mayo-2024
-- ------------------------------------------------------------------ *)
(* ---------------------------------------------------------------------
-- Sea una función f de \<real> en \<real>.
-- + Se dice que f es creciente si para todo x e y tales que x \<le> y se
-- tiene que f(x) \<le> f(y).
-- + Se dice que f es involutiva si para todo x se tiene que f(f(x)) = x.
--
-- En Isabelle/HOL que f sea creciente se representa por `mono f`.
--
-- Demostrar que si f es creciente e involutiva, entonces f es la
-- identidad.
-- ------------------------------------------------------------------ *)
theory Una_funcion_creciente_e_involutiva_es_la_identidad
imports Main HOL.Real
begin
definition involutiva :: "(real \<Rightarrow> real) \<Rightarrow> bool"
where "involutiva f \<longleftrightarrow> (\<forall>x. f (f x) = x)"
(* 1\<ordfeminine> demostración *)
lemma
fixes f :: "real \<Rightarrow> real"
assumes "mono f"
"involutiva f"
shows "f = id"
proof (unfold fun_eq_iff; intro allI)
fix x
have "x \<le> f x \<or> f x \<le> x"
by (rule linear)
then have "f x = x"
proof (rule disjE)
assume "x \<le> f x"
then have "f x \<le> f (f x)"
using assms(1) by (simp only: monoD)
also have "\<dots> = x"
using assms(2) by (simp only: involutiva_def)
finally have "f x \<le> x"
by this
show "f x = x"
using \<open>f x \<le> x\<close> \<open>x \<le> f x\<close> by (simp only: antisym)
next
assume "f x \<le> x"
have "x = f (f x)"
using assms(2) by (simp only: involutiva_def)
also have "... \<le> f x"
using \<open>f x \<le> x\<close> assms(1) by (simp only: monoD)
finally have "x \<le> f x"
by this
show "f x = x"
using \<open>f x \<le> x\<close> \<open>x \<le> f x\<close> by (simp only: monoD)
qed
then show "f x = id x"
by (simp only: id_apply)
qed
(* 2\<ordfeminine> demostración *)
lemma
fixes f :: "real \<Rightarrow> real"
assumes "mono f"
"involutiva f"
shows "f = id"
proof
fix x
have "x \<le> f x \<or> f x \<le> x"
by (rule linear)
then have "f x = x"
proof
assume "x \<le> f x"
then have "f x \<le> f (f x)"
using assms(1) by (simp only: monoD)
also have "\<dots> = x"
using assms(2) by (simp only: involutiva_def)
finally have "f x \<le> x"
by this
show "f x = x"
using \<open>f x \<le> x\<close> \<open>x \<le> f x\<close> by auto
next
assume "f x \<le> x"
have "x = f (f x)"
using assms(2) by (simp only: involutiva_def)
also have "... \<le> f x"
by (simp add: \<open>f x \<le> x\<close> assms(1) monoD)
finally have "x \<le> f x"
by this
show "f x = x"
using \<open>f x \<le> x\<close> \<open>x \<le> f x\<close> by auto
qed
then show "f x = id x"
by simp
qed
(* 3\<ordfeminine> demostración *)
lemma
fixes f :: "real \<Rightarrow> real"
assumes "mono f"
"involutiva f"
shows "f = id"
proof
fix x
have "x \<le> f x \<or> f x \<le> x"
by (rule linear)
then have "f x = x"
proof
assume "x \<le> f x"
then have "f x \<le> x"
by (metis assms involutiva_def mono_def)
then show "f x = x"
using \<open>x \<le> f x\<close> by auto
next
assume "f x \<le> x"
then have "x \<le> f x"
by (metis assms involutiva_def mono_def)
then show "f x = x"
using \<open>f x \<le> x\<close> by auto
qed
then show "f x = id x"
by simp
qed
end