text_raw\<open>\<^footnote>\<open>A question from ``Bundeswettbewerb Mathematik''. Original
pen-and-paper proof due to Herbert Ehler; Isabelle tactic script by Tobias
Nipkow.\<close>\<close>
text\<open> \<^bold>\<open>Problem.\<close> Given some function \<open>f: \<nat> \<rightarrow> \<nat>\<close> such that \<open>f (f n) < f (Suc n)\<close> for all \<open>n\<close>. Demonstrate that \<open>f\<close> is the identity. \<close>
theorem assumes f_ax: "\n. f (f n) < f (Suc n)" shows"f n = n" proof (rule order_antisym) show ge: "n \ f n" for n proof (induct "f n" arbitrary: n rule: less_induct) case less show"n \ f n" proof (cases n) case (Suc m) from f_ax have"f (f m) < f n"by (simp only: Suc) with less have"f m \ f (f m)" . alsofrom f_ax have"\ < f n" by (simp only: Suc) finallyhave"f m < f n" . with less have"m \ f m" . alsonote\<open>\<dots> < f n\<close> finallyhave"m < f n" . thenhave"n \ f n" by (simp only: Suc) thenshow ?thesis . next case 0 thenshow ?thesis by simp qed qed
have mono: "m \ n \ f m \ f n" for m n :: nat proof (induct n) case 0 thenhave"m = 0"by simp thenshow ?caseby simp next case (Suc n) from Suc.prems show"f m \ f (Suc n)" proof (rule le_SucE) assume"m \ n" with Suc.hyps have"f m \ f n" . alsofrom ge f_ax have"\ < f (Suc n)" by (rule le_less_trans) finallyshow ?thesis by simp next assume"m = Suc n" thenshow ?thesis by simp qed qed
show"f n \ n" proof - have"\ n < f n" proof assume"n < f n" thenhave"Suc n \ f n" by simp thenhave"f (Suc n) \ f (f n)" by (rule mono) alsohave"\ < f (Suc n)" by (rule f_ax) finallyhave"\ < \" . then show False .. qed thenshow ?thesis by simp qed qed
end
¤ Dauer der Verarbeitung: 0.13 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.