Cookies disclaimer

I agree Our site saves small pieces of text information (cookies) on your device in order to deliver better content and for statistical purposes. You can disable the usage of cookies by changing the settings of your browser. By browsing our website without changing the browser settings you grant us permission to store that information on your device.

[2018-Nov] Triple Rev

Is there a function rev of type "nat list => nat list" that applied thrice on a list of nats returns the original list again.

i.e. find a function rev and prove the following lemma:

rev (rev (rev xs)) = xs

Making sure you do not use the identity function, if your input is longer than 1.

length xs >= 2 ==> rev xs ~= xs


Download Files

Definitions File

theory Defs
  imports Main

Template File

theory Submission
  imports Defs

lemma showmewhatyougot: "\<exists>f::(nat list \<Rightarrow> nat list). (\<forall> xs. (length xs \<ge> 2 \<longrightarrow> f xs \<noteq> xs))
           \<and> (\<forall> xs. (f (f (f xs))) = xs)"


Check File

theory Check
  imports Submission

lemma  "\<exists>f::(nat list \<Rightarrow> nat list). (\<forall> xs. (length xs \<ge> 2 \<longrightarrow> f xs \<noteq> xs))
           \<and> (\<forall> xs. (f (f (f xs))) = xs)"
by (rule Submission.showmewhatyougot)


Terms and Conditions