Theory Knowledge
section‹Study on knowledge equivalence --- results to relate the knowledge of an agent to that of another's›
theory Knowledge
imports NS_Public_Bad_GA
begin
theorem knowledge_equiv:
"⟦ X ∈ knows A evs; Notes A X ∉ set evs;
X ∉ {Key (priEK A), Key (priSK A), Key (shrK A)} ⟧
⟹ X ∈ knows B evs"
apply (erule rev_mp, erule rev_mp, erule rev_mp)
apply (induct_tac "A", induct_tac "B", induct_tac "evs")
apply (induct_tac [2] "a") apply auto
done
lemma knowledge_equiv_bis:
"⟦ X ∈ knows A evs; Notes A X ∉ set evs ⟧
⟹ X ∈ {Key (priEK A), Key (priSK A), Key (shrK A)} ∪ knows B evs"
apply (blast dest: knowledge_equiv)
done
lemma knowledge_equiv_ter:
"⟦ X ∈ knows A evs; X ∉ {Key (priEK A), Key (priSK A), Key (shrK A)} ⟧
⟹ X ∈ knows B evs ∨ Notes A X ∈ set evs"
apply (blast dest: knowledge_equiv)
done
lemma knowledge_equiv_quater:
" X ∈ knows A evs
⟹ X ∈ knows B evs ∨ Notes A X ∈ set evs ∨
X ∈ {Key (priEK A), Key (priSK A), Key (shrK A)}"
apply (blast dest: knowledge_equiv)
done
lemma setdiff_diff_insert: "A-B-C=D-E-F ⟹ insert m (A-B-C) = insert m (D-E-F)"
by simp
lemma "A-B-C=D-E-F ⟹ insert m A-B-C = insert m D-E-F"
oops
lemma knowledge_equiv_eq_setdiff:
"knows A evs -
{Key (priEK A), Key (priSK A), Key (shrK A)} -
{X. Notes A X ∈ set evs}
=
knows B evs -
{Key (priEK B), Key (priSK B), Key (shrK B)} -
{X. Notes B X ∈ set evs}"
apply (induct_tac "evs", induct_tac "A", induct_tac "B")
apply force
apply (induct_tac "a")
apply simp_all
oops
lemma knowledge_equiv_eq_old:
"knows A evs ∪
{Key (priEK B), Key (priSK B), Key (shrK B)} ∪
{X. Notes B X ∈ set evs}
=
knows B evs ∪
{Key (priEK A), Key (priSK A), Key (shrK A)} ∪
{X. Notes A X ∈ set evs}"
apply (induct_tac "evs", induct_tac "A", induct_tac "B")
apply force
apply (induct_tac "a")
txt‹Gets case solves because this event doesn't touch any agent knowledge›
apply simp_all
apply safe txt‹speeds up subsequent blasting›
apply blast+ txt‹very very slow›
done
theorem knowledge_eval: "knows A evs =
{Key (priEK A), Key (priSK A), Key (shrK A)} ∪
(Key ` range pubEK) ∪ (Key ` range pubSK) ∪
{X. ∃ S R. Says S R X ∈ set evs} ∪
{X. Notes A X ∈ set evs}"
apply (induct_tac "A", induct_tac "evs")
apply (induct_tac [2] "a")
apply auto
done
lemma knowledge_eval_setdiff:
"knows A evs -
{Key (priEK A), Key (priSK A), Key (shrK A)} -
{X. Notes A X ∈ set evs}
=
(Key ` range pubEK) ∪ (Key ` range pubSK) ∪
{X. ∃ S R. Says S R X ∈ set evs}"
apply (simp only: knowledge_eval) apply auto
oops
theorem knowledge_equiv_eq: "knows A evs ∪
{Key (priEK B), Key (priSK B), Key (shrK B)} ∪
{X. Notes B X ∈ set evs}
=
knows B evs ∪
{Key (priEK A), Key (priSK A), Key (shrK A)} ∪
{X. Notes A X ∈ set evs}"
apply (force simp only: knowledge_eval)
done
lemma "knows A evs ∪
{Key (priEK B), Key (priSK B), Key (shrK B)} ∪
{X. Notes B X ∈ set evs} -
( {Key (priEK B), Key (priSK B), Key (shrK B)} ∪
{X. Notes B X ∈ set evs} ) = knows A evs"
apply auto
oops
theorem parts_knowledge_equiv_eq: "
parts(knows A evs) ∪
{Key (priEK B), Key (priSK B), Key (shrK B)} ∪
parts({X. Notes B X ∈ set evs})
=
parts(knows B evs) ∪
{Key (priEK A), Key (priSK A), Key (shrK A)} ∪
parts({X. Notes A X ∈ set evs})"
apply (simp only: knowledge_eval parts_Un) apply force
done
lemmas parts_knowledge_equiv = parts_knowledge_equiv_eq [THEN equalityD1, THEN subsetD]
thm parts_knowledge_equiv
theorem noprishr_parts_knowledge_equiv: "
⟦ X ∉ {Key (priEK A), Key (priSK A), Key (shrK A)};
X ∈ parts(knows A evs) ⟧
⟹ X ∈ parts(knows B evs) ∪
parts({X. Notes A X ∈ set evs})"
apply (force dest: UnI1 [THEN UnI1, THEN parts_knowledge_equiv])
done
lemma knowledge_equiv_eq_NS: "
evs ∈ ns_public ⟹
knows A evs ∪ {Key (priEK B), Key (priSK B), Key (shrK B)} =
knows B evs ∪ {Key (priEK A), Key (priSK A), Key (shrK A)}"
apply (force simp only: knowledge_eval NS_no_Notes)
done
lemma parts_knowledge_equiv_eq_NS: "
evs ∈ ns_public ⟹
parts(knows A evs) ∪ {Key (priEK B), Key (priSK B), Key (shrK B)} =
parts(knows B evs) ∪ {Key (priEK A), Key (priSK A), Key (shrK A)}"
apply (simp only: knowledge_eval NS_no_Notes parts_Un) apply force
done
theorem noprishr_parts_knowledge_equiv_NS: "
⟦ X ∉ {Key (priEK A), Key (priSK A), Key (shrK A)};
X ∈ parts(knows A evs); evs ∈ ns_public ⟧
⟹ X ∈ parts(knows B evs)"
apply (drule noprishr_parts_knowledge_equiv, simp)
apply (simp add: NS_no_Notes)
done
theorem Agent_not_analz_N:
"⟦ Nonce N ∉ parts(knows A evs); evs ∈ ns_public ⟧
⟹ Nonce N ∉ analz(knows B evs)"
apply (force intro: noprishr_parts_knowledge_equiv_NS analz_into_parts)
done
end