theory Test_Coinduction imports "Coinductive.Coinductive" begin typedecl state typedecl abs consts transition :: "state \ state \ bool" state_abs :: "state \ abs" abs_equiv :: "abs \ abs \ bool" coinductive abs_trace :: "state \ abs llist \ bool" where base:"\ \s2. \transition s1 s2\ \ abs_trace s1 (LNil)" | step:"\ transition s1 s2; abs_trace s2 l; state_abs s1 = as1\ \ abs_trace s1 (LCons as1 l)" definition P :: "state \ abs llist \ bool" where "P s l \ \l'. abs_trace s l' \ llist_all2 abs_equiv l l'" coinductive P_co :: "state \ abs llist \ bool" where base:"\ \s2. \transition s1 s2\ \ P_co s1 (LNil)" | step:"\ transition s1 s2; P_co s2 l; state_abs s1 = as1; abs_equiv as as1 \ \ P_co s1 (LCons as l)" lemma P_co_imp_P: assumes "P_co s al" shows "P s al" sorry thm P_co.coinduct lemma P_coinduct: assumes "X xa xb" and "(\x1 x2. X x1 x2 \ (\a. x1 = a \ x2 = LNil \ (\b. \ transition a b)) \ (\a b l aa' aa. x1 = a \ x2 = LCons aa l \ transition a b \ (X b l \ P b l) \ state_abs a = aa' \ abs_equiv aa aa'))" shows "P xa xb" sorry end