Theory Syntactic_Description
theory Syntactic_Description
imports Place_Framework Proper_Venn_Regions "HereditarilyFinite.Rank"
begin
locale satisfiable_normalized_MLSS_clause = ATOM Iβ©sβ©a +
normalized_MLSS_clause π +
proper_Venn_regions V π
for π :: "'a pset_fm set" and π :: "'a β hf" +
assumes π_sat_π: "βlt β π. I π lt"
begin
definition Ξ£ :: "hf set" where
"Ξ£ β‘ proper_Venn_regions.proper_Venn_region V π ` (Pβ§+ V) - {0}"
declare Ξ£_def [simp]
lemma mem_Ξ£_not_empty: "Ο β Ξ£ βΉ Ο β 0" by simp
fun associated_place :: "hf β ('a β bool)" (βΉΟβ_ββΊ) where
"ΟβΟβ x β· x β V β§ Ο β€ π x"
definition PI :: "('a β bool) set" where
"PI β‘ associated_place ` Ξ£"
declare PI_def [simp]
fun containing_region :: "'a β hf" (βΉΟβ_ββΊ) where
"Οβxβ = HF {π x}"
lemma containing_region_in_Ξ£:
assumes "x β W"
shows "Οβxβ β Ξ£"
proof -
from βΉx β WβΊ obtain y where y: "AT (Var y =β©s Single (Var x)) β π"
using memW_E by blast
then have "y β V" by fastforce
from y π_sat_π have "π y = HF {π x}" by auto
then have "π y = Οβxβ" by simp
moreover
from variable_as_composition_of_proper_Venn_regions βΉy β VβΊ have "π y = β¨HF (proper_Venn_region ` β V y)"
by presburger
ultimately
have "Οβxβ = β¨HF (proper_Venn_region ` β V y)" by argo
then have "βΞ± β Pβ§+ V. π y = proper_Venn_region Ξ±"
proof -
let ?l = "{Ξ± β β V y. proper_Venn_region Ξ± β 0}"
have "?l β {}"
proof (rule ccontr)
assume "Β¬ ?l β {}"
then have "β¨HF (proper_Venn_region ` β V y) = 0"
using HUnion_empty[where ?f = proper_Venn_region and ?S = "β V y"]
by blast
with βΉπ y = HF {π x}βΊ βΉπ y = β¨HF (proper_Venn_region ` β V y)βΊ show False
by (metis Int_lower1 equals0I finite_Int finite_V finite_imageI finite_insert hemptyE hmem_HF_iff insert_not_empty subset_empty)
qed
then obtain Ξ± where "Ξ± β ?l" by blast
moreover
have "Ξ² = Ξ±" if "Ξ² β ?l" for Ξ²
proof (rule ccontr)
assume "Ξ² β Ξ±"
from βΉΞ± β ?lβΊ βΉy β VβΊ
have "proper_Venn_region Ξ± β€ π y"
by (metis (mono_tags, lifting) β.elims mem_Collect_eq mem_P_plus_subset proper_Venn_region_subset_variable_iff)
with βΉΞ± β ?lβΊ have "proper_Venn_region Ξ± = π y"
using βΉπ y = HF {π x}βΊ
using singleton_nonempty_subset[where ?s = "π y" and ?c = "π x" and ?t = "proper_Venn_region Ξ±"]
by fastforce
from βΉΞ² β ?lβΊ βΉy β VβΊ
have "proper_Venn_region Ξ² β€ π y"
by (metis (mono_tags, lifting) β.elims mem_Collect_eq mem_P_plus_subset proper_Venn_region_subset_variable_iff)
with βΉΞ² β ?lβΊ have "proper_Venn_region Ξ² = π y"
using βΉπ y = HF {π x}βΊ
using singleton_nonempty_subset[where ?s = "π y" and ?c = "π x" and ?t = "proper_Venn_region Ξ²"]
by fastforce
from βΉΞ² β Ξ±βΊ βΉproper_Venn_region Ξ± = π yβΊ βΉproper_Venn_region Ξ² = π yβΊ βΉπ y = HF {π x}βΊ βΉx β WβΊ
show False using proper_Venn_region_strongly_injective[where ?Ξ± = Ξ± and ?Ξ² = Ξ²]
using calculation that by auto
qed
ultimately
have "?l = {Ξ±}" by blast
have Ly_minus_l: "β V y - ?l = {Ξ± β β V y. proper_Venn_region Ξ± = 0}" by auto
have "?l β β V y" by blast
then have "?l βͺ (β V y - ?l) = β V y" by blast
then have "β¨HF (proper_Venn_region ` β V y) = β¨HF (proper_Venn_region ` (?l βͺ (β V y - ?l)))" by argo
also have "... = β¨HF (proper_Venn_region ` (?l βͺ {Ξ± β β V y. proper_Venn_region Ξ± = 0}))"
using Ly_minus_l by argo
also have "... = β¨HF (proper_Venn_region ` ?l) β β¨HF (proper_Venn_region ` {Ξ± β β V y. proper_Venn_region Ξ± = 0})"
using HUnion_proper_Venn_region_union[where ?l = ?l and ?m = "{Ξ± β β V y. proper_Venn_region Ξ± = 0}"]
using finite_V βΉy β VβΊ
by auto
also have "... = β¨HF (proper_Venn_region ` ?l)"
using finite_V βΉy β VβΊ by auto
also have "... = β¨HF (proper_Venn_region ` {Ξ±})"
using βΉ?l = {Ξ±}βΊ by argo
also have "... = proper_Venn_region Ξ±" by fastforce
finally have "β¨HF (proper_Venn_region ` β V y) = proper_Venn_region Ξ±" .
with βΉπ y = β¨HF (proper_Venn_region ` (β V y))βΊ βΉΞ± β ?lβΊ show ?thesis by auto
qed
moreover
from βΉπ y = HF {π x}βΊ βΉπ y = ΟβxββΊ have "Οβxβ β 0"
by (metis finite.emptyI finite_insert hfset_0 hfset_HF insert_not_empty)
ultimately
show ?thesis
by (metis Diff_iff Ξ£_def βΉπ y = ΟβxββΊ empty_iff imageI insert_iff)
qed
fun atβ©p_f :: "'a β ('a β bool)" where
"atβ©p_f w = ΟβΟβwββ"
lemma range_atβ©p_f: "w β W βΉ atβ©p_f w β PI"
using atβ©p_f.simps containing_region_in_Ξ£ PI_def by blast
lemma Ο_Ο_Ξ±:
assumes "Ο β PI"
shows "βΞ± β Pβ§+ V. Ο = (Ξ»x. x β Ξ±) β§ Ο = Οβproper_Venn_region Ξ±β β§ proper_Venn_region Ξ± β 0"
proof -
from βΉΟ β PIβΊ obtain Ξ± where Ξ±:
"Ο = Οβproper_Venn_region Ξ±β" "proper_Venn_region Ξ± β 0" "Ξ± β Pβ§+ V"
by auto
have "Ο x β· x β Ξ±" for x
proof (cases "x β V")
case True
with Ξ± proper_Venn_region_subset_variable_iff
have "x β Ξ± β· proper_Venn_region Ξ± β€ π x" by simp
with βΉΟ = Οβproper_Venn_region Ξ±ββΊ True
show ?thesis by simp
next
case False
with βΉΟ = Οβ(proper_Venn_region Ξ±)ββΊ have "Β¬ Ο x" by auto
from False βΉΞ± β Pβ§+ VβΊ have "x β Ξ±" by auto
from βΉΒ¬ Ο xβΊ βΉx β Ξ±βΊ show ?thesis by blast
qed
with Ξ± show ?thesis by blast
qed
lemma Ο_Ο_Ξ±':
assumes "Ο β Ξ£"
shows "βΞ± β Pβ§+ V. ΟβΟβ = (Ξ»x. x β Ξ±) β§ Ο = proper_Venn_region Ξ±"
proof -
from βΉΟ β Ξ£βΊ obtain Ξ± where Ξ±: "Ξ± β Pβ§+ V" "Ο = proper_Venn_region Ξ±" "proper_Venn_region Ξ± β 0"
by auto
have "ΟβΟβ x β· x β Ξ±" for x
proof (cases "x β V")
case True
with Ξ± proper_Venn_region_subset_variable_iff
have "x β Ξ± β· proper_Venn_region Ξ± β€ π x" by simp
with βΉΟ = proper_Venn_region Ξ±βΊ True
show ?thesis by simp
next
case False
with βΉΟ = proper_Venn_region Ξ±βΊ have "Β¬ ΟβΟβ x" by auto
from False βΉΞ± β Pβ§+ VβΊ have "x β Ξ±" by auto
from βΉΒ¬ ΟβΟβ xβΊ βΉx β Ξ±βΊ show ?thesis by blast
qed
with Ξ± show ?thesis by blast
qed
lemma realise_same_implies_eq_under_all_Ο:
assumes "x β V"
and "y β V"
and "π x = π y"
and "Ο β PI"
shows "Ο x β· Ο y"
by (metis Ο_Ο_Ξ± assms associated_place.elims(2) associated_place.elims(3))
definition "rel_PI β‘ place_membership π PI"
declare rel_PI_def [simp]
definition "G_PI β‘ place_mem_graph π PI"
declare G_PI_def [simp]
lemma arcs_G_PI[simp]: "arcs G_PI = rel_PI" by simp
lemma arcs_ends_G_PI[simp]: "arcs_ends G_PI = rel_PI"
unfolding arcs_ends_def arc_to_ends_def by auto
lemma verts_G_PI[simp]: "verts G_PI = PI" by simp
lemma rel_PI_head_tail:
assumes "e β rel_PI"
shows "e = (tail G_PI e, head G_PI e)"
proof -
from assms arcs_ends_G_PI have "e β arcs_ends G_PI"
by blast
then show ?thesis
unfolding arcs_ends_def arc_to_ends_def
by simp
qed
lemma place_membership_irreflexive: "(Ο, Ο) β rel_PI"
proof (rule ccontr)
assume "Β¬ (Ο, Ο) β rel_PI"
then have "(Ο, Ο) β rel_PI" by blast
then obtain x y where xy: "AT (Var x =β©s Single (Var y)) β π" "Ο x" "Ο y" by auto
with π_sat_π have "π x = HF {π y}" by fastforce
then have "π x β π y = 0" by (simp add: hmem_not_refl)
from βΉ(Ο, Ο) β rel_PIβΊ have "Ο β PI" by auto
then obtain Ο where Ο: "Ο = ΟβΟβ" "Ο β Ξ£" by auto
then obtain Ξ± where Ξ±: "Ο = proper_Venn_region Ξ±" "Ξ± β Pβ§+ V" by auto
with Ο xy βΉπ x β π y = 0βΊ
show False
by (metis Ξ£_def DiffD2 associated_place.elims(2) insertCI le_inf_iff less_eq_hempty)
qed
interpretation pre_digraph G_PI .
lemma rel_PI_implies_rank_lt:
assumes Ο_lt: "(ΟβΟβ, ΟβΟ'β) β rel_PI"
and "Ο β Ξ£"
and "Ο' β Ξ£"
shows "rank Ο < rank Ο'"
proof -
from βΉΟ' β Ξ£βΊ have "Ο' β 0" by auto
from Ο_lt obtain x y where xy: "AT (Var x =β©s Single (Var y)) β π"
and "ΟβΟβ y" and "ΟβΟ'β x"
by auto
with π_sat_π have "π x = HF {π y}" by auto
with βΉΟβΟ'β xβΊ βΉΟ' β 0βΊ have "Ο' = π x"
by (metis associated_place.simps singleton_nonempty_subset)
then have "rank Ο' = rank (π x)" by blast
moreover
from βΉΟβΟβ yβΊ have "Ο β€ π y" by simp
then have "rank Ο β€ rank (π y)"
by (simp add: rank_mono)
moreover
from βΉπ x = HF {π y}βΊ have "rank (π y) < rank (π x)"
by (simp add: rank_lt)
ultimately
show ?thesis by order
qed
lemma awalk_in_G_PI_rank_lt:
assumes "awalk ΟβΟβ p ΟβΟ'β"
and "Ο β Ο'"
and "Ο β Ξ£"
and "Ο' β Ξ£"
shows "rank Ο < rank Ο'"
using assms unfolding awalk_def
proof (induction "ΟβΟβ" p "ΟβΟ'β" arbitrary: Ο Ο' rule: cas.induct)
case 1
then have "ΟβΟβ = ΟβΟ'β" using cas.simps(1) by blast
then have "Ο = Ο'"
by (smt (verit) "1.prems"(3) "1.prems"(4) Collect_mem_eq Ο_Ο_Ξ±')
with βΉΟ β Ο'βΊ have False by blast
then show ?case ..
next
case (2 e es)
then have e_es_in_arcs: "set (e # es) β arcs G_PI"
and cas_e_es: "cas ΟβΟβ (e # es) ΟβΟ'β"
by argo+
from e_es_in_arcs have "e β rel_PI"
by (metis arcs_G_PI in_mono list.set_intros(1))
then obtain Οβ©1 Οβ©2 where "e = (Οβ©1, Οβ©2)" "Οβ©1 β PI" "Οβ©2 β PI" by auto
then have e_Ο12: "Οβ©1 = tail G_PI e" "Οβ©2 = head G_PI e" by simp+
with cas_e_es have "Οβ©1 = ΟβΟβ" by (meson pre_digraph.cas.simps(2))
from βΉΟβ©2 β PIβΊ obtain Ο'' where "Ο'' β Ξ£" "Οβ©2 = ΟβΟ''β" by auto
with cas_e_es e_Ο12 have "cas ΟβΟ''β es ΟβΟ'β"
by (metis cas.simps(2))
from βΉΟβ©1 = ΟβΟββΊ βΉΟβ©2 = ΟβΟ''ββΊ βΉe = (Οβ©1, Οβ©2)βΊ have "e = (ΟβΟβ, ΟβΟ''β)"
by simp
with βΉe β rel_PIβΊ rel_PI_implies_rank_lt have "rank Ο < rank Ο''"
using βΉΟ β Ξ£βΊ βΉΟ'' β Ξ£βΊ by blast
show ?case
proof (cases "Ο'' = Ο'")
case True
with βΉrank Ο < rank Ο''βΊ show ?thesis by blast
next
case False
with "2.hyps" have "rank Ο'' < rank Ο'"
using "2.prems"(1) "2.prems"(4) βΉΟβ©2 = ΟβΟ''ββΊ βΉΟβ©2 β PIβΊ βΉΟ'' β Ξ£βΊ βΉcas ΟβΟ''β es ΟβΟ'ββΊ e_Ο12(2)
by (metis insert_subset list.simps(15) verts_G_PI)
with βΉrank Ο < rank Ο''βΊ show ?thesis by order
qed
qed
lemma all_places_same_implies_assignment_equal:
assumes "x β V"
and "y β V"
and Ο_eq: "βΟ β PI. Ο x β· Ο y"
shows "π x = π y"
proof -
let ?β_x' = "{Ξ± β β V x. proper_Venn_region Ξ± β 0}"
let ?β_y' = "{Ξ± β β V y. proper_Venn_region Ξ± β 0}"
have proper_Venn_region_β_x': "proper_Venn_region ` ?β_x' = {s β proper_Venn_region ` β V x. s β 0}"
by fast
have proper_Venn_region_β_y': "proper_Venn_region ` ?β_y' = {s β proper_Venn_region ` β V y. s β 0}"
by fast
from finite_V have "finite (β V x)" by blast
then have "finite (proper_Venn_region ` β V x)" by blast
from finite_V have "finite (β V y)" by blast
then have "finite (proper_Venn_region ` β V y)" by blast
have Ο_eq': "Οβproper_Venn_region Ξ±β x = Οβproper_Venn_region Ξ±β y"
if "Ξ± β ?β_x' β¨ Ξ± β ?β_y'" for Ξ±
proof -
from that have "x β Ξ± β¨ y β Ξ±" by fastforce
from that have "Ξ± β Pβ§+ V" by fastforce
with that have "Οβproper_Venn_region Ξ±β β PI" by fastforce
with Ο_eq show ?thesis by fast
qed
have "?β_x' = ?β_y'"
proof (standard; standard)
fix Ξ± assume "Ξ± β ?β_x'"
then have "x β Ξ±" by fastforce
with βΉΞ± β ?β_x'βΊ βΉx β VβΊ have "Οβproper_Venn_region Ξ±β x"
using proper_Venn_region_subset_variable_iff by auto
with Ο_eq' βΉΞ± β ?β_x'βΊ have "Οβproper_Venn_region Ξ±β y" by blast
with βΉΞ± β ?β_x'βΊ βΉy β VβΊ have "y β Ξ±"
using proper_Venn_region_subset_variable_iff by auto
with βΉΞ± β ?β_x'βΊ show "Ξ± β ?β_y'" by fastforce
next
fix Ξ± assume "Ξ± β ?β_y'"
then have "y β Ξ±" by fastforce
with βΉΞ± β ?β_y'βΊ βΉy β VβΊ have "Οβproper_Venn_region Ξ±β y"
using proper_Venn_region_subset_variable_iff by auto
with Ο_eq' βΉΞ± β ?β_y'βΊ have "Οβproper_Venn_region Ξ±β x" by blast
with βΉΞ± β ?β_y'βΊ βΉx β VβΊ have "x β Ξ±"
using proper_Venn_region_subset_variable_iff by auto
with βΉΞ± β ?β_y'βΊ show "Ξ± β ?β_x'" by fastforce
qed
from βΉx β VβΊ have "π x = β¨HF (proper_Venn_region ` β V x)"
using variable_as_composition_of_proper_Venn_regions by presburger
also have "... = β¨HF (proper_Venn_region ` ?β_x')"
using Hunion_nonempty[where ?S = "proper_Venn_region ` β V x"]
using βΉfinite (proper_Venn_region ` β V x)βΊ proper_Venn_region_β_x'
by argo
also have "... = β¨HF (proper_Venn_region ` ?β_y')"
using βΉ?β_x' = ?β_y'βΊ by argo
also have "... = β¨HF (proper_Venn_region ` β V y)"
using Hunion_nonempty[where ?S = "proper_Venn_region ` β V y"]
using βΉfinite (proper_Venn_region ` β V y)βΊ proper_Venn_region_β_y'
by argo
also have "... = π y"
using βΉy β VβΊ variable_as_composition_of_proper_Venn_regions
by presburger
finally show "π x = π y" .
qed
definition "atβ©p β‘ {(y, atβ©p_f y)|y. y β W}"
declare atβ©p_def [simp]
theorem syntactic_description_is_adequate:
"adequate_place_framework π PI atβ©p"
proof (unfold_locales, goal_cases)
case 1
then show ?case
proof
fix Ο assume "Ο β PI"
then obtain Ο where "Ο = ΟβΟβ" "Ο β Ξ£" by auto
then obtain Ξ± where "Ο = proper_Venn_region Ξ±" "Ξ± β Pβ§+ V" by auto
with βΉΟ β Ξ£βΊ have "Ο β 0" "proper_Venn_region Ξ± β 0" by auto
from βΉΞ± β Pβ§+ VβΊ have "Ξ± β V" by simp
from proper_Venn_region_subset_variable_iff
have Ξ±_Ο: "x β Ξ± β· Ο β€ π x" if "x β V" for x
using βΉΞ± β VβΊ βΉx β VβΊ βΉproper_Venn_region Ξ± β 0βΊ βΉΟ = proper_Venn_region Ξ±βΊ
by presburger
from βΉΟ = ΟβΟββΊ βΉΟ = proper_Venn_region Ξ±βΊ have "Ο = (Ξ»x. x β V β§ proper_Venn_region Ξ± β€ π x)"
by (meson associated_place.elims(2) associated_place.elims(3))
also have "... = (Ξ»x. x β Ξ±)"
using Ξ±_Ο βΉΞ± β VβΊ βΉΟ = proper_Venn_region Ξ±βΊ by (metis rev_contra_hsubsetD)
also have "... β places V"
unfolding places_def using βΉΞ± β VβΊ by blast
finally show "Ο β places V" .
qed
next
case 2
then show ?case using atβ©p_f.simps by auto
next
case 3
then show ?case using range_atβ©p_f by fastforce
next
case 4
then show ?case by (simp add: single_valued_def)
next
case (5 Ο)
from place_membership_irreflexive show ?case by auto
next
case (6 e)
obtain Ο Ο' where "e = (Ο, Ο')" by fastforce
with 6 have "Ο β PI" by simp
with βΉe = (Ο, Ο')βΊ show ?case by simp
next
case (7 e)
obtain Ο Ο' where "e = (Ο, Ο')" by fastforce
with 7 have "Ο' β PI" by simp
with βΉe = (Ο, Ο')βΊ show ?case by simp
next
case 8
from finite_V have "finite Ξ£" by auto
then show ?case by auto
next
case 9
from finite_V have "finite PI" by auto
then have "finite (PI Γ PI)" by auto
moreover
have "rel_PI β PI Γ PI" by auto
ultimately
have "finite rel_PI" by (simp add: finite_subset)
then show ?case by auto
next
case (10 e)
then have "e β rel_PI" by force
with place_membership_irreflexive have "fst e β snd e"
by (metis prod.collapse)
with rel_PI_head_tail show ?case by auto
next
case (11 eβ©1 eβ©2)
then show ?case
unfolding arc_to_ends_def by simp
next
case 12
show ?case
proof (rule ccontr)
assume "Β¬(βc. pre_digraph.cycle (place_mem_graph π PI) c)"
then obtain c where "cycle c"
by fastforce
then obtain e es Ο where e_es: "c = e # es" "awalk Ο (e # es) Ο"
by (metis awalk_def cas.elims(2) cycle_def)
then obtain Ο' where "e = (Ο, Ο')"
by (metis arcs_G_PI awalk_def cas.simps(2) insert_subset list.simps(15) rel_PI_head_tail)
then show False
proof (cases "es = []")
case True
with e_es have "e = (Ο, Ο)"
by (metis arcs_G_PI awalk_def cas.simps(1) cas.simps(2) list.set_intros(1) rel_PI_head_tail subset_code(1))
then have "(Ο, Ο) β rel_PI"
by (metis arcs_G_PI e_es(2) insert_subset list.simps(15) pre_digraph.awalk_def)
with place_membership_irreflexive show False by blast
next
case False
with e_es βΉcycle cβΊ βΉe = (Ο, Ο')βΊ have "Ο' β Ο"
by (metis arcs_G_PI awalk_def list.set_intros(1) place_membership_irreflexive subset_code(1))
from e_es βΉe = (Ο, Ο')βΊ have "Ο β PI" "Ο' β PI"
unfolding awalk_def by simp+
then obtain Ο Ο' where Ο_Ο': "Ο = ΟβΟβ" "Ο' = ΟβΟ'β" "Ο β Ξ£" "Ο' β Ξ£" by auto
from e_es βΉe = (Ο, Ο')βΊ have "awalk Ο' es Ο"
unfolding awalk_def
by (metis Pair_inject βΉΟ' β PIβΊ arcs_G_PI cas.simps(2) insert_subset list.simps(15) rel_PI_head_tail verts_G_PI)
with awalk_in_G_PI_rank_lt have "rank Ο' < rank Ο"
using βΉΟ' β ΟβΊ Ο_Ο' by blast
moreover
from rel_PI_implies_rank_lt have "rank Ο < rank Ο'"
using βΉe = (Ο, Ο')βΊ Ο_Ο'
by (metis e_es arcs_G_PI e_es(1) list.set_intros(1) pre_digraph.awalk_def subset_code(1))
ultimately
show False by simp
qed
qed
next
case (13 x)
with π_sat_π have "π x = 0" by fastforce
from 13 have "x β V" by force
have "Β¬ Ο x" if "Ο β PI" for Ο
proof -
from that obtain Ο where "Ο β Ξ£" "Ο = ΟβΟβ" by auto
then have "Ο x β· x β V β§ Ο β€ π x" "Ο β 0" by simp+
with βΉx β VβΊ have "Ο x β· Ο β€ π x" by argo
with βΉΟ β 0βΊ βΉπ x = 0βΊ show "Β¬ Ο x" by simp
qed
then show ?case unfolding PI_def by blast
next
case (14 x y)
with π_sat_π have "π x = π y" by fastforce
from βΉAT (Var x =β©s Var y) β πβΊ have "x β V" "y β V" by force+
have "Ο x = Ο y" if "Ο β PI" for Ο
proof -
from that obtain Ο where "Ο β Ξ£" "Ο = ΟβΟβ" by auto
then have "Ο x β· x β V β§ Ο β€ π x" "Ο y β· y β V β§ Ο β€ π y" by simp+
with βΉx β VβΊ βΉy β VβΊ have "Ο x β· Ο β€ π x" "Ο y β· Ο β€ π y" by argo+
with βΉπ x = π yβΊ show "Ο x = Ο y" by simp
qed
then show ?case unfolding PI_def by blast
next
case (15 x y z)
with π_sat_π have "π x = π y β π z" by fastforce
from 15 have "x β V" "y β V" "z β V" by force+
have "Ο x β· Ο y β¨ Ο z" if "Ο β PI" for Ο
proof -
from that Ο_Ο_Ξ± obtain Ξ± where Ξ±:
"Ξ± β Pβ§+ V" "Ο = Οβproper_Venn_region Ξ±β" "Ο = (Ξ»v. v β Ξ±)" "proper_Venn_region Ξ± β 0"
by blast
have "Ο y β¨ Ο z" if "Ο x"
proof -
from βΉΟ xβΊ Ξ± have "x β Ξ±" by metis
from βΉΟ xβΊ Ξ± have "proper_Venn_region Ξ± β€ π x" by simp
with βΉproper_Venn_region Ξ± β 0βΊ have "π x β 0" by fastforce
{assume "y β Ξ±" "z β Ξ±"
from βΉy β Ξ±βΊ βΉy β VβΊ have "π y β proper_Venn_region Ξ± = 0"
using finite_V by fastforce
moreover
from βΉz β Ξ±βΊ βΉz β VβΊ have "π z β proper_Venn_region Ξ± = 0"
using finite_V by fastforce
ultimately
have "π x β proper_Venn_region Ξ± = 0"
using βΉπ x = π y β π zβΊ by simp
from βΉx β Ξ±βΊ have "proper_Venn_region Ξ± β€ π x"
using Ξ± by (meson associated_place.elims(2))
with βΉπ x β 0βΊ βΉπ x β proper_Venn_region Ξ± = 0βΊ
have "proper_Venn_region Ξ± = 0" by blast
with βΉproper_Venn_region Ξ± β 0βΊ have False by blast}
then have "y β Ξ± β¨ z β Ξ±" by blast
then show "Ο y β¨ Ο z" by (simp add: βΉΟ = (Ξ»v. v β Ξ±)βΊ)
qed
have "Ο x" if "Ο y β¨ Ο z"
proof -
from βΉΟ y β¨ Ο zβΊ Ξ± have "proper_Venn_region Ξ± β€ π y β¨ proper_Venn_region Ξ± β€ π z"
by auto
with βΉπ x = π y β π zβΊ have "proper_Venn_region Ξ± β€ π x" by auto
with Ξ± βΉx β VβΊ show "Ο x" by simp
qed
from βΉΟ x βΉ Ο y β¨ Ο zβΊ βΉΟ y β¨ Ο z βΉ Ο xβΊ
show ?thesis by blast
qed
then show ?case unfolding PI_def by blast
next
case (16 x y z)
with π_sat_π have "π x = π y - π z" by fastforce
from βΉAT (Var x =β©s Var y -β©s Var z) β πβΊ have "x β V" "y β V" "z β V" by force+
have "Ο x β· Ο y β§ Β¬ Ο z" if "Ο β PI" for Ο
proof -
from that Ο_Ο_Ξ± obtain Ξ± where Ξ±:
"Ξ± β Pβ§+ V" "Ο = Οβproper_Venn_region Ξ±β" "Ο = (Ξ»v. v β Ξ±)" "proper_Venn_region Ξ± β 0"
by blast
with finite_V have "finite Ξ±" by blast
have "Ο x" if "Ο y" "Β¬ Ο z"
proof -
have "proper_Venn_region Ξ± β€ π y"
by (metis Ξ±(2) associated_place.elims(2) βΉΟ yβΊ)
moreover
from βΉΒ¬ Ο zβΊ βΉz β VβΊ have "z β V - Ξ±"
using Ξ± by (metis DiffI)
then have "π z β€ β¨HF (π ` (V - Ξ±))"
by (meson finite_Diff finite_V finite_imageI image_eqI mem_hsubset_HUnion)
then have "π z β proper_Venn_region Ξ± = 0"
by (simp add: hinter_hdiff_hempty)
ultimately
have "proper_Venn_region Ξ± β€ π y - π z" by blast
with βΉπ x = π y - π zβΊ have "proper_Venn_region Ξ± β€ π x" by argo
with Ξ± βΉx β VβΊ show ?thesis by auto
qed
have "Ο y β§ Β¬ Ο z" if "Ο x"
proof -
from βΉΟ xβΊ Ξ± have "proper_Venn_region Ξ± β€ π x"
by auto
with βΉπ x = π y - π zβΊ have "proper_Venn_region Ξ± β€ π y" "Β¬ proper_Venn_region Ξ± β€ π z"
apply simp_all
apply auto[1]
by (metis (no_types, lifting) Ξ±(4) hdiff_iff hdisjoint_iff inf.orderE proper_Venn_region.elims rev_hsubsetD)
with Ξ± βΉy β VβΊ βΉz β VβΊ show "Ο y β§ Β¬ Ο z" by simp
qed
from βΉΟ x βΉ Ο y β§ Β¬ Ο zβΊ βΉΟ y βΉ Β¬ Ο z βΉ Ο xβΊ
show ?thesis by blast
qed
then show ?case unfolding PI_def by blast
next
case (17 x y)
with π_sat_π have "π x β π y" by fastforce
from 17 have "x β V" "y β V" by fastforce+
with βΉπ x β π yβΊ all_places_same_implies_assignment_equal
show ?case by metis
next
case (18 x y)
then have "y β W" by fastforce
from 18 have "x β V" "y β V" by fastforce+
from 18 π_sat_π have "π x = HF{π y}" by fastforce
then have "Οβyβ β€ π x" by simp
with βΉx β VβΊ have "atβ©p_f y x" by (simp only: atβ©p_f.simps) simp
moreover
{fix Ο assume "Ο β PI" "Ο x"
then obtain Ο where "Ο = ΟβΟβ" "Ο β€ π x" "Ο β 0" by fastforce
with βΉπ x = HF{π y}βΊ have "Ο = HF{π y}" by fastforce
with βΉΟ = ΟβΟββΊ have "Ο = atβ©p_f y" by simp
}
then have "βΟ'βPI. Ο' β atβ©p_f y βΆ Β¬ Ο' x"
by blast
ultimately
show ?case using βΉy β WβΊ by simp
next
case (19 y z)
then obtain Ο where "Ο = atβ©p_f z" "Ο = atβ©p_f y" by simp
then have "atβ©p_f z = atβ©p_f y" by blast
from βΉy β WβΊ obtain x where x: "AT (Var x =β©s Single (Var y)) β π"
using memW_E by blast
with π_sat_π have "π x = HF{π y}" by fastforce
from 19 x have "x β V" "y β V" by fastforce+
from 19 have "z β V" using W_subset_V by blast
from βΉπ x = HF{π y}βΊ have "Οβyβ β€ π x" by simp
with βΉx β VβΊ have "atβ©p_f y x" by auto
with βΉatβ©p_f z = atβ©p_f yβΊ have "atβ©p_f z x" by argo
then have "Οβzβ β€ π x" by simp
with βΉπ x = HF{π y}βΊ have "Οβzβ = HF{π y}" by force
then have "π z = π y"
by (metis finite.emptyI finite_insert hfset_HF containing_region.elims singleton_insert_inj_eq)
{fix Ο assume "Ο β PI"
then obtain Ο where "Ο = ΟβΟβ" "Ο β 0" by auto
with βΉy β VβΊ have "Ο y β· Ο β€ π y" by fastforce
also have "... β· Ο β€ π z"
using βΉπ z = π yβΊ by auto
also have "... β· Ο z"
using βΉΟ = ΟβΟββΊ βΉz β VβΊ by simp
finally have "Ο y = Ο z" .
}
then show ?case by blast
next
case (20 y y')
then have "y β V" "y' β V" by (metis W_subset_V subsetD)+
with βΉβΟβPI. Ο y' = Ο yβΊ all_places_same_implies_assignment_equal
have "π y = π y'" by presburger
then have "atβ©p_f y = atβ©p_f y'" by simp
with βΉy β WβΊ βΉy' β WβΊ show ?case by simp
next
case (21 Οβ©1 Οβ©2)
have "Ο = ΟβHF {0}β" if "Ο β Range atβ©p - Range (place_membership π PI)" for Ο
proof -
from that obtain y where y: "y β W" "atβ©p_f y = Ο"
by (simp only: atβ©p_def) blast
with range_atβ©p_f have "Ο β PI" by blast
from βΉy β WβΊ obtain x where lt_in_π:
"AT (Var x =β©s Single (Var y)) β π"
using memW_E by presburger
with π_sat_π have "π x = HF {π y}" by fastforce
then have "Οβyβ β€ π x" by simp
with lt_in_π have "atβ©p_f y x" by force
with βΉatβ©p_f y = ΟβΊ have "Ο x" by blast
have "βΟ β PI. Β¬ Ο y"
proof (rule ccontr)
assume "Β¬ (βΟβPI. Β¬ Ο y)"
then obtain Ο' where "Ο' β PI" "Ο' y" by blast
with βΉAT (Var x =β©s Single (Var y)) β πβΊ βΉΟ xβΊ
have "(Ο', Ο) β place_membership π PI"
using βΉΟ β PIβΊ
by (simp only: place_membership.simps) blast
then have "Ο β Range (place_membership π PI)" by blast
with that show False by blast
qed
have "βΞ± β β V y. proper_Venn_region Ξ± = 0"
proof (rule ccontr)
assume "Β¬ (βΞ± β β V y. proper_Venn_region Ξ± = 0)"
then obtain Ξ± where Ξ±: "Ξ± β β V y" "proper_Venn_region Ξ± β 0" by blast
then have "proper_Venn_region Ξ± β€ π y"
using variable_as_composition_of_proper_Venn_regions β_finite finite_V
by (smt (verit, ccfv_threshold) W_subset_V finite_imageI image_eqI mem_hsubset_HUnion subset_iff y(1))
then have "Οβproper_Venn_region Ξ±β y"
using W_subset_V βΉy β WβΊ by auto
with βΉβΟ β PI. Β¬ Ο yβΊ show False
using Ξ± by auto
qed
then have "β¨HF (proper_Venn_region ` β V y) = 0"
by fastforce
with variable_as_composition_of_proper_Venn_regions[of y]
have "π y = 0"
using βΉy β WβΊ W_subset_V by auto
with βΉπ x = HF {π y}βΊ have "π x = HF {0}" by argo
from βΉΟ β PIβΊ obtain Ο where "Ο β Ξ£" "Ο = ΟβΟβ" by auto
with βΉΟ xβΊ have "Ο β 0" "Ο β€ π x" by simp+
with βΉπ x = HF {0}βΊ have "Ο = HF {0}" by fastforce
with βΉΟ = ΟβΟββΊ show "Ο = ΟβHF {0}β" by blast
qed
with 21 show ?case by blast
qed
end
end