(*Coinductive definition of equality*) consts
lleq :: "i==>i"
(*Previously used <*> in the domain and variant pairs as elements. But standardpairsworkjustaswell.Tousevariantpairs,mustchangeprefix
a q/Q to the Sigma, Pair and converse rules.*) coinductive
domains "lleq(A)"⊆"llist(A) * llist(A)" intros
LNil: "⟨LNil, LNil⟩∈ lleq(A)"
LCons: "[a ∈ A; <l,l'> ∈ lleq(A)] ==> <LCons(a,l), LCons(a,l')> ∈ lleq(A)"
type_intros llist.intros
(*Lazy list functions; flip is not definitional!*) definition
lconst :: "i ==> i"where "lconst(a) ≡ lfp(univ(a), λl. LCons(a,l))"
axiomatization flip :: "i ==> i" where
flip_LNil: "flip(LNil) = LNil"and
flip_LCons: "[x ∈ bool; l ∈ llist(bool)] ==> flip(LCons(x,l)) = LCons(not(x), flip(l))"
(*These commands cause classical reasoning to regard the subset relation
as primitive, not reducing it to membership*)
lemma llist_quniv_lemma: "Ord(i) ==> l ∈ llist(quniv(A)) ==> l ∩ Vset(i) ⊆ univ(eclose(A))" proof (induct i arbitrary: l rule: trans_induct) case (step i l) show ?caseusing‹l ∈ llist(quniv(A))› proof (cases l rule: llist.cases) case LNil thus ?thesis by (simp add: QInl_def QInr_def llist.con_defs) next case (LCons a l) thus ?thesis using step.hyps proof (simp add: QInl_def QInr_def llist.con_defs) show"<1; <a; l>> ∩ Vset(i) ⊆ univ(eclose(A))"using LCons ‹Ord(i)› by (fast intro: step Ord_trans Int_lower1 [THEN subset_trans]) qed qed qed
(*Lemma for proving finality. Unfold the lazy list; use induction hypothesis*) lemma lleq_Int_Vset_subset: "Ord(i) ==> <l,l'> ∈ lleq(A) ==> l ∩ Vset(i) ⊆ l'" proof (induct i arbitrary: l l' rule: trans_induct) case (step i l l') show ?caseusing‹⟨l, l'⟩∈ lleq(A)› proof (cases rule: lleq.cases) case LNil thus ?thesis by (auto simp add: QInr_def llist.con_defs) next case (LCons a l l') thus ?thesis using step.hyps by (auto simp add: QInr_def llist.con_defs intro: Ord_trans) qed qed
(*lleq(A) is a symmetric relation because qconverse(lleq(A)) is a fixedpoint*) lemma lleq_symmetric: "<l,l'> ∈ lleq(A) ==> <l',l> ∈ lleq(A)" apply (erule lleq.coinduct [OF converseI]) apply (rule lleq.dom_subset [THEN converse_type], safe) apply (erule lleq.cases, blast+) done
(*Reasoning borrowed from lleq.ML; a similar proof works for all
"productive" functions -- cf Coquand's "Infinite Objects in Type Theory".*) lemma flip_llist_quniv_lemma: "Ord(i) ==> l ∈ llist(bool) ==> flip(l) ∩ Vset(i) ⊆ univ(eclose(bool))" proof (induct i arbitrary: l rule: trans_induct) case (step i l) show ?caseusing‹l ∈ llist(bool)› proof (cases l rule: llist.cases) case LNil thus ?thesis by (simp, simp add: QInl_def QInr_def llist.con_defs) next case (LCons a l) thus ?thesis using step.hyps proof (simp, simp add: QInl_def QInr_def llist.con_defs) show"<1; <not(a); flip(l)>> ∩ Vset(i) ⊆ univ(eclose(bool))"using LCons step.hyps by (auto intro: Ord_trans) qed qed qed
lemma flip_in_quniv: "l ∈ llist(bool) ==> flip(l) ∈ quniv(bool)" by (rule flip_llist_quniv_lemma [THEN Int_Vset_subset, THEN qunivI], assumption+)
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 und die Messung sind noch experimentell.