diff --git a/thys/Saturation_Framework/Consequence_Relations_and_Inference_Systems.thy b/thys/Saturation_Framework/Consequence_Relations_and_Inference_Systems.thy --- a/thys/Saturation_Framework/Consequence_Relations_and_Inference_Systems.thy +++ b/thys/Saturation_Framework/Consequence_Relations_and_Inference_Systems.thy @@ -1,100 +1,100 @@ (* Title: Consequence Relations and Inference Systems of the Saturation Framework * Author: Sophie Tourret , 2018-2020 *) section \Consequence Relations and Inference Systems\ text \This section introduces the most basic notions upon which the framework is built: consequence relations and inference systems. It also defines the notion of a family of consequence relations. This corresponds to section 2.1 of the report.\ theory Consequence_Relations_and_Inference_Systems imports Main begin subsection \Consequence Relations\ locale consequence_relation = fixes Bot :: "'f set" and entails :: "'f set \ 'f set \ bool" (infix "\" 50) assumes bot_not_empty: "Bot \ {}" and bot_implies_all: "B \ Bot \ {B} \ N1" and subset_entailed: "N2 \ N1 \ N1 \ N2" and all_formulas_entailed: "(\C \ N2. N1 \ {C}) \ N1 \ N2" and entails_trans [trans]: "N1 \ N2 \ N2 \ N3 \ N1 \ N3" begin lemma entail_set_all_formulas: "N1 \ N2 \ (\C \ N2. N1 \ {C})" by (meson all_formulas_entailed empty_subsetI insert_subset subset_entailed entails_trans) lemma entail_union: "N \ N1 \ N \ N2 \ N \ N1 \ N2" using entail_set_all_formulas[of N N1] entail_set_all_formulas[of N N2] entail_set_all_formulas[of N "N1 \ N2"] by blast -lemma entail_unions: "(\i \ I. N \ Ni i) \ N \ UNION I Ni" +lemma entail_unions: "(\i \ I. N \ Ni i) \ N \ \ (Ni ` I)" using entail_set_all_formulas[of N "\ (Ni ` I)"] entail_set_all_formulas[of N] Complete_Lattices.UN_ball_bex_simps(2)[of Ni I "\C. N \ {C}", symmetric] by meson lemma entail_all_bot: "(\B \ Bot. N \ {B}) \ (\B' \ Bot. N \ {B'})" using bot_implies_all entails_trans by blast end subsection \Families of Consequence Relations\ locale consequence_relation_family = fixes Bot :: "'f set" and Q :: "'q itself" and entails_q :: "'q \ ('f set \ 'f set \ bool)" assumes Bot_not_empty: "Bot \ {}" and q_cons_rel: "consequence_relation Bot (entails_q q)" begin definition entails_Q :: "'f set \ 'f set \ bool" (infix "\Q" 50) where "(N1 \Q N2) = (\q. entails_q q N1 N2)" (* lem:intersection-of-conseq-rel *) lemma intersect_cons_rel_family: "consequence_relation Bot entails_Q" unfolding consequence_relation_def proof (intro conjI) show \Bot \ {}\ using Bot_not_empty . next show "\B N. B \ Bot \ {B} \Q N" unfolding entails_Q_def by (metis consequence_relation_def q_cons_rel) next show "\N2 N1. N2 \ N1 \ N1 \Q N2" unfolding entails_Q_def by (metis consequence_relation_def q_cons_rel) next show "\N2 N1. (\C\N2. N1 \Q {C}) \ N1 \Q N2" unfolding entails_Q_def by (metis consequence_relation_def q_cons_rel) next show "\N1 N2 N3. N1 \Q N2 \ N2 \Q N3 \ N1 \Q N3" unfolding entails_Q_def by (metis consequence_relation_def q_cons_rel) qed end subsection \Inference Systems\ datatype 'f inference = Infer (prems_of: "'f list") (concl_of: "'f") locale inference_system = fixes Inf :: \'f inference set\ begin definition Inf_from :: "'f set \ 'f inference set" where "Inf_from N = {\ \ Inf. set (prems_of \) \ N}" definition Inf_from2 :: "'f set \ 'f set \ 'f inference set" where "Inf_from2 N M = Inf_from (N \ M) - Inf_from (N - M)" end end diff --git a/thys/Saturation_Framework/Labeled_Lifting_to_Non_Ground_Calculi.thy b/thys/Saturation_Framework/Labeled_Lifting_to_Non_Ground_Calculi.thy --- a/thys/Saturation_Framework/Labeled_Lifting_to_Non_Ground_Calculi.thy +++ b/thys/Saturation_Framework/Labeled_Lifting_to_Non_Ground_Calculi.thy @@ -1,434 +1,434 @@ (* Title: Labeled Lifting to Non-Ground Calculi of the Saturation Framework * Author: Sophie Tourret , 2019-2020 *) section \Labeled Liftings\ text \This section formalizes the extension of the lifting results to labeled calculi. This corresponds to section 3.4 of the report.\ theory Labeled_Lifting_to_Non_Ground_Calculi imports Lifting_to_Non_Ground_Calculi begin subsection \Labeled Lifting with a Family of Well-founded Orderings\ locale labeled_lifting_w_wf_ord_family = lifting_with_wf_ordering_family Bot_F Inf_F Bot_G entails_G Inf_G Red_Inf_G Red_F_G \_F \_Inf Prec_F for Bot_F :: "'f set" and Inf_F :: "'f inference set" and Bot_G :: "'g set" and entails_G :: "'g set \ 'g set \ bool" (infix "\G" 50) and Inf_G :: "'g inference set" and Red_Inf_G :: "'g set \ 'g inference set" and Red_F_G :: "'g set \ 'g set" and \_F :: "'f \ 'g set" and \_Inf :: "'f inference \ 'g inference set option" and Prec_F :: "'g \ 'f \ 'f \ bool" (infix "\" 50) + fixes l :: \'l itself\ and Inf_FL :: \('f \ 'l) inference set\ assumes Inf_F_to_Inf_FL: \\\<^sub>F \ Inf_F \ length (Ll :: 'l list) = length (prems_of \\<^sub>F) \ \L0. Infer (zip (prems_of \\<^sub>F) Ll) (concl_of \\<^sub>F, L0) \ Inf_FL\ and Inf_FL_to_Inf_F: \\\<^sub>F\<^sub>L \ Inf_FL \ Infer (map fst (prems_of \\<^sub>F\<^sub>L)) (fst (concl_of \\<^sub>F\<^sub>L)) \ Inf_F\ begin definition to_F :: \('f \ 'l) inference \ 'f inference\ where \to_F \\<^sub>F\<^sub>L = Infer (map fst (prems_of \\<^sub>F\<^sub>L)) (fst (concl_of \\<^sub>F\<^sub>L))\ definition Bot_FL :: \('f \ 'l) set\ where \Bot_FL = Bot_F \ UNIV\ definition \_F_L :: \('f \ 'l) \ 'g set\ where \\_F_L CL = \_F (fst CL)\ definition \_Inf_L :: \('f \ 'l) inference \ 'g inference set option\ where \\_Inf_L \\<^sub>F\<^sub>L = \_Inf (to_F \\<^sub>F\<^sub>L)\ (* lem:labeled-grounding-function *) sublocale labeled_standard_lifting: standard_lifting where Bot_F = Bot_FL and Inf_F = Inf_FL and \_F = \_F_L and \_Inf = \_Inf_L proof show "Bot_FL \ {}" unfolding Bot_FL_def using Bot_F_not_empty by simp next show "B\Bot_FL \ \_F_L B \ {}" for B unfolding \_F_L_def Bot_FL_def using Bot_map_not_empty by auto next show "B\Bot_FL \ \_F_L B \ Bot_G" for B unfolding \_F_L_def Bot_FL_def using Bot_map by force next fix CL show "\_F_L CL \ Bot_G \ {} \ CL \ Bot_FL" unfolding \_F_L_def Bot_FL_def using Bot_cond by (metis SigmaE UNIV_I UNIV_Times_UNIV mem_Sigma_iff prod.sel(1)) next fix \ assume i_in: \\ \ Inf_FL\ and ground_not_none: \\_Inf_L \ \ None\ then show "the (\_Inf_L \) \ Red_Inf_G (\_F_L (concl_of \))" unfolding \_Inf_L_def \_F_L_def to_F_def using inf_map Inf_FL_to_Inf_F by fastforce qed abbreviation Labeled_Empty_Order :: \ ('f \ 'l) \ ('f \ 'l) \ bool\ where "Labeled_Empty_Order C1 C2 \ False" sublocale labeled_lifting_w_empty_ord_family : lifting_with_wf_ordering_family Bot_FL Inf_FL Bot_G entails_G Inf_G Red_Inf_G Red_F_G \_F_L \_Inf_L "\g. Labeled_Empty_Order" proof show "po_on Labeled_Empty_Order UNIV" unfolding po_on_def by (simp add: transp_onI wfp_on_imp_irreflp_on) show "wfp_on Labeled_Empty_Order UNIV" unfolding wfp_on_def by simp qed notation "labeled_standard_lifting.entails_\" (infix "\\L" 50) (* lem:labeled-consequence *) lemma labeled_entailment_lifting: "NL1 \\L NL2 \ fst ` NL1 \\ fst ` NL2" unfolding labeled_standard_lifting.entails_\_def \_F_L_def entails_\_def by auto lemma (in-) subset_fst: "A \ fst ` AB \ \x \ A. \y. (x,y) \ AB" by fastforce lemma red_inf_impl: "\ \ labeled_lifting_w_empty_ord_family.Red_Inf_\ NL \ to_F \ \ Red_Inf_\ (fst ` NL)" unfolding labeled_lifting_w_empty_ord_family.Red_Inf_\_def Red_Inf_\_def \_Inf_L_def \_F_L_def to_F_def using Inf_FL_to_Inf_F by auto (* lem:labeled-saturation *) lemma labeled_saturation_lifting: "labeled_lifting_w_empty_ord_family.lifted_calculus_with_red_crit.saturated NL \ empty_order_lifting.lifted_calculus_with_red_crit.saturated (fst ` NL)" unfolding labeled_lifting_w_empty_ord_family.lifted_calculus_with_red_crit.saturated_def empty_order_lifting.lifted_calculus_with_red_crit.saturated_def labeled_standard_lifting.Non_ground.Inf_from_def Non_ground.Inf_from_def proof clarify fix \ assume subs_Red_Inf: "{\ \ Inf_FL. set (prems_of \) \ NL} \ labeled_lifting_w_empty_ord_family.Red_Inf_\ NL" and i_in: "\ \ Inf_F" and i_prems: "set (prems_of \) \ fst ` NL" define Lli where "Lli i \ (SOME x. ((prems_of \)!i,x) \ NL)" for i have [simp]:"((prems_of \)!i,Lli i) \ NL" if "i < length (prems_of \)" for i using that subset_fst[OF i_prems] unfolding Lli_def by (meson nth_mem someI_ex) define Ll where "Ll \ map Lli [0..)]" have Ll_length: "length Ll = length (prems_of \)" unfolding Ll_def by auto have subs_NL: "set (zip (prems_of \) Ll) \ NL" unfolding Ll_def by (auto simp:in_set_zip) obtain L0 where L0: "Infer (zip (prems_of \) Ll) (concl_of \, L0) \ Inf_FL" using Inf_F_to_Inf_FL[OF i_in Ll_length] .. define \_FL where "\_FL = Infer (zip (prems_of \) Ll) (concl_of \, L0)" then have "set (prems_of \_FL) \ NL" using subs_NL by simp then have "\_FL \ {\ \ Inf_FL. set (prems_of \) \ NL}" unfolding \_FL_def using L0 by blast then have "\_FL \ labeled_lifting_w_empty_ord_family.Red_Inf_\ NL" using subs_Red_Inf by fast moreover have "\ = to_F \_FL" unfolding to_F_def \_FL_def using Ll_length by (cases \) auto ultimately show "\ \ Red_Inf_\ (fst ` NL)" by (auto intro:red_inf_impl) qed (* lem:labeled-static-ref-compl *) lemma stat_ref_comp_to_labeled_sta_ref_comp: "static_refutational_complete_calculus Bot_F Inf_F (\\) Red_Inf_\ Red_F_\ \ static_refutational_complete_calculus Bot_FL Inf_FL (\\L) labeled_lifting_w_empty_ord_family.Red_Inf_\ labeled_lifting_w_empty_ord_family.Red_F_\" unfolding static_refutational_complete_calculus_def proof (rule conjI impI; clarify) interpret calculus_with_red_crit Bot_FL Inf_FL labeled_standard_lifting.entails_\ labeled_lifting_w_empty_ord_family.Red_Inf_\ labeled_lifting_w_empty_ord_family.Red_F_\ by (simp add: labeled_lifting_w_empty_ord_family.lifted_calculus_with_red_crit.calculus_with_red_crit_axioms) show "calculus_with_red_crit Bot_FL Inf_FL (\\L) labeled_lifting_w_empty_ord_family.Red_Inf_\ labeled_lifting_w_empty_ord_family.Red_F_\" by standard next assume calc: "calculus_with_red_crit Bot_F Inf_F (\\) Red_Inf_\ Red_F_\" and static: "static_refutational_complete_calculus_axioms Bot_F Inf_F (\\) Red_Inf_\" show "static_refutational_complete_calculus_axioms Bot_FL Inf_FL (\\L) labeled_lifting_w_empty_ord_family.Red_Inf_\" unfolding static_refutational_complete_calculus_axioms_def proof (intro conjI impI allI) fix Bl :: \'f \ 'l\ and Nl :: \('f \ 'l) set\ assume Bl_in: \Bl \ Bot_FL\ and Nl_sat: \labeled_lifting_w_empty_ord_family.lifted_calculus_with_red_crit.saturated Nl\ and Nl_entails_Bl: \Nl \\L {Bl}\ have static_axioms: "B \ Bot_F \ empty_order_lifting.lifted_calculus_with_red_crit.saturated N \ N \\ {B} \ (\B'\Bot_F. B' \ N)" for B N using static[unfolded static_refutational_complete_calculus_axioms_def] by fast define B where "B = fst Bl" have B_in: "B \ Bot_F" using Bl_in Bot_FL_def B_def SigmaE by force define N where "N = fst ` Nl" have N_sat: "empty_order_lifting.lifted_calculus_with_red_crit.saturated N" using N_def Nl_sat labeled_saturation_lifting by blast have N_entails_B: "N \\ {B}" using Nl_entails_Bl unfolding labeled_entailment_lifting N_def B_def by force have "\B' \ Bot_F. B' \ N" using B_in N_sat N_entails_B static_axioms[of B N] by blast then obtain B' where in_Bot: "B' \ Bot_F" and in_N: "B' \ N" by force then have "B' \ fst ` Bot_FL" unfolding Bot_FL_def by fastforce obtain Bl' where in_Nl: "Bl' \ Nl" and fst_Bl': "fst Bl' = B'" using in_N unfolding N_def by blast have "Bl' \ Bot_FL" unfolding Bot_FL_def using fst_Bl' in_Bot vimage_fst by fastforce then show \\Bl'\Bot_FL. Bl' \ Nl\ using in_Nl by blast qed qed end subsection \Labeled Lifting with a Family of Redundancy Criteria\ locale labeled_lifting_with_red_crit_family = no_labels: standard_lifting_with_red_crit_family Inf_F Bot_G Inf_G Q entails_q Red_Inf_q Red_F_q Bot_F \_F_q \_Inf_q "\g. Empty_Order" for Bot_F :: "'f set" and Inf_F :: "'f inference set" and Bot_G :: "'g set" and Q :: "'q itself" and entails_q :: "'q \ 'g set \ 'g set \ bool" and Inf_G :: "'g inference set" and Red_Inf_q :: "'q \ 'g set \ 'g inference set" and Red_F_q :: "'q \ 'g set \ 'g set" and \_F_q :: "'q \ 'f \ 'g set" and \_Inf_q :: "'q \ 'f inference \ 'g inference set option" + fixes l :: "'l itself" and Inf_FL :: \('f \ 'l) inference set\ assumes Inf_F_to_Inf_FL: \\\<^sub>F \ Inf_F \ length (Ll :: 'l list) = length (prems_of \\<^sub>F) \ \L0. Infer (zip (prems_of \\<^sub>F) Ll) (concl_of \\<^sub>F, L0) \ Inf_FL\ and Inf_FL_to_Inf_F: \\\<^sub>F\<^sub>L \ Inf_FL \ Infer (map fst (prems_of \\<^sub>F\<^sub>L)) (fst (concl_of \\<^sub>F\<^sub>L)) \ Inf_F\ begin definition to_F :: \('f \ 'l) inference \ 'f inference\ where \to_F \\<^sub>F\<^sub>L = Infer (map fst (prems_of \\<^sub>F\<^sub>L)) (fst (concl_of \\<^sub>F\<^sub>L))\ definition Bot_FL :: \('f \ 'l) set\ where \Bot_FL = Bot_F \ UNIV\ definition \_F_L_q :: \'q \ ('f \ 'l) \ 'g set\ where \\_F_L_q q CL = \_F_q q (fst CL)\ definition \_Inf_L_q :: \'q \ ('f \ 'l) inference \ 'g inference set option\ where \\_Inf_L_q q \\<^sub>F\<^sub>L = \_Inf_q q (to_F \\<^sub>F\<^sub>L)\ definition \_set_L_q :: "'q \ ('f \ 'l) set \ 'g set" where - "\_set_L_q q N \ UNION N (\_F_L_q q)" + "\_set_L_q q N \ \ (\_F_L_q q ` N)" definition Red_Inf_\_L_q :: "'q \ ('f \ 'l) set \ ('f \ 'l) inference set" where "Red_Inf_\_L_q q N = {\ \ Inf_FL. ((\_Inf_L_q q \) \ None \ the (\_Inf_L_q q \) \ Red_Inf_q q (\_set_L_q q N)) \ ((\_Inf_L_q q \ = None) \ \_F_L_q q (concl_of \) \ (\_set_L_q q N \ Red_F_q q (\_set_L_q q N)))}" definition Red_Inf_\_L_Q :: "('f \ 'l) set \ ('f \ 'l) inference set" where "Red_Inf_\_L_Q N = \ {X N |X. X \ (Red_Inf_\_L_q ` UNIV)}" definition Labeled_Empty_Order :: \ ('f \ 'l) \ ('f \ 'l) \ bool\ where "Labeled_Empty_Order C1 C2 \ False" definition Red_F_\_empty_L_q :: "'q \ ('f \ 'l) set \ ('f \ 'l) set" where "Red_F_\_empty_L_q q N = {C. \D \ \_F_L_q q C. D \ Red_F_q q (\_set_L_q q N) \ (\E \ N. Labeled_Empty_Order E C \ D \ \_F_L_q q E)}" definition Red_F_\_empty_L :: "('f \ 'l) set \ ('f \ 'l) set" where "Red_F_\_empty_L N = \ {X N |X. X \ (Red_F_\_empty_L_q ` UNIV)}" definition entails_\_L_q :: "'q \ ('f \ 'l) set \ ('f \ 'l) set \ bool" where "entails_\_L_q q N1 N2 \ entails_q q (\_set_L_q q N1) (\_set_L_q q N2)" definition entails_\_L_Q :: "('f \ 'l) set \ ('f \ 'l) set \ bool" (infix "\\L" 50) where "entails_\_L_Q N1 N2 \ \q. entails_\_L_q q N1 N2" lemma lifting_q: "labeled_lifting_w_wf_ord_family Bot_F Inf_F Bot_G (entails_q q) Inf_G (Red_Inf_q q) (Red_F_q q) (\_F_q q) (\_Inf_q q) (\g. Empty_Order) Inf_FL" proof - fix q show "labeled_lifting_w_wf_ord_family Bot_F Inf_F Bot_G (entails_q q) Inf_G (Red_Inf_q q) (Red_F_q q) (\_F_q q) (\_Inf_q q) (\g. Empty_Order) Inf_FL" using no_labels.standard_lifting_family Inf_F_to_Inf_FL Inf_FL_to_Inf_F by (simp add: labeled_lifting_w_wf_ord_family_axioms_def labeled_lifting_w_wf_ord_family_def) qed lemma lifted_q: "standard_lifting Bot_FL Inf_FL Bot_G Inf_G (entails_q q) (Red_Inf_q q) (Red_F_q q) (\_F_L_q q) (\_Inf_L_q q)" proof - fix q interpret q_lifting: labeled_lifting_w_wf_ord_family Bot_F Inf_F Bot_G "entails_q q" Inf_G "Red_Inf_q q" "Red_F_q q" "\_F_q q" "\_Inf_q q" "\g. Empty_Order" l Inf_FL using lifting_q . have "\_F_L_q q = q_lifting.\_F_L" unfolding \_F_L_q_def q_lifting.\_F_L_def by simp moreover have "\_Inf_L_q q = q_lifting.\_Inf_L" unfolding \_Inf_L_q_def q_lifting.\_Inf_L_def to_F_def q_lifting.to_F_def by simp moreover have "Bot_FL = q_lifting.Bot_FL" unfolding Bot_FL_def q_lifting.Bot_FL_def by simp ultimately show "standard_lifting Bot_FL Inf_FL Bot_G Inf_G (entails_q q) (Red_Inf_q q) (Red_F_q q) (\_F_L_q q) (\_Inf_L_q q)" using q_lifting.labeled_standard_lifting.standard_lifting_axioms by simp qed lemma ord_fam_lifted_q: "lifting_with_wf_ordering_family Bot_FL Inf_FL Bot_G (entails_q q) Inf_G (Red_Inf_q q) (Red_F_q q) (\_F_L_q q) (\_Inf_L_q q) (\g. Labeled_Empty_Order)" proof - fix q interpret standard_q_lifting: standard_lifting Bot_FL Inf_FL Bot_G Inf_G "entails_q q" "Red_Inf_q q" "Red_F_q q" "\_F_L_q q" "\_Inf_L_q q" using lifted_q . have "minimal_element Labeled_Empty_Order UNIV" unfolding Labeled_Empty_Order_def by (simp add: minimal_element.intro po_on_def transp_onI wfp_on_imp_irreflp_on) then show "lifting_with_wf_ordering_family Bot_FL Inf_FL Bot_G (entails_q q) Inf_G (Red_Inf_q q) (Red_F_q q) (\_F_L_q q) (\_Inf_L_q q) (\g. Labeled_Empty_Order)" using standard_q_lifting.standard_lifting_axioms by (simp add: lifting_with_wf_ordering_family_axioms.intro lifting_with_wf_ordering_family_def) qed lemma all_lifted_red_crit: "calculus_with_red_crit Bot_FL Inf_FL (entails_\_L_q q) (Red_Inf_\_L_q q) (Red_F_\_empty_L_q q)" proof - fix q interpret ord_q_lifting: lifting_with_wf_ordering_family Bot_FL Inf_FL Bot_G "entails_q q" Inf_G "Red_Inf_q q" "Red_F_q q" "\_F_L_q q" "\_Inf_L_q q" "\g. Labeled_Empty_Order" using ord_fam_lifted_q . have "entails_\_L_q q = ord_q_lifting.entails_\" unfolding entails_\_L_q_def \_set_L_q_def ord_q_lifting.entails_\_def by simp moreover have "Red_Inf_\_L_q q = ord_q_lifting.Red_Inf_\" unfolding Red_Inf_\_L_q_def ord_q_lifting.Red_Inf_\_def \_set_L_q_def by simp moreover have "Red_F_\_empty_L_q q = ord_q_lifting.Red_F_\" unfolding Red_F_\_empty_L_q_def ord_q_lifting.Red_F_\_def \_set_L_q_def by simp ultimately show "calculus_with_red_crit Bot_FL Inf_FL (entails_\_L_q q) (Red_Inf_\_L_q q) (Red_F_\_empty_L_q q)" using ord_q_lifting.lifted_calculus_with_red_crit.calculus_with_red_crit_axioms by argo qed lemma all_lifted_cons_rel: "consequence_relation Bot_FL (entails_\_L_q q)" proof - fix q interpret q_red_crit: calculus_with_red_crit Bot_FL Inf_FL "entails_\_L_q q" "Red_Inf_\_L_q q" "Red_F_\_empty_L_q q" using all_lifted_red_crit . show "consequence_relation Bot_FL (entails_\_L_q q)" using q_red_crit.consequence_relation_axioms . qed sublocale labeled_cons_rel_family: consequence_relation_family Bot_FL Q entails_\_L_q using all_lifted_cons_rel no_labels.lifted_calc_w_red_crit_family.Bot_not_empty unfolding Bot_FL_def by (simp add: consequence_relation_family.intro) sublocale with_labels: calculus_with_red_crit_family Bot_FL Inf_FL Q entails_\_L_q Red_Inf_\_L_q Red_F_\_empty_L_q using calculus_with_red_crit_family.intro[OF labeled_cons_rel_family.consequence_relation_family_axioms] all_lifted_cons_rel by (simp add: all_lifted_red_crit calculus_with_red_crit_family_axioms_def) notation "no_labels.entails_\_Q" (infix "\\" 50) (* lem:labeled-consequence-intersection *) lemma labeled_entailment_lifting: "NL1 \\L NL2 \ fst ` NL1 \\ fst ` NL2" unfolding no_labels.entails_\_Q_def no_labels.entails_\_q_def no_labels.\_set_q_def entails_\_L_Q_def entails_\_L_q_def \_set_L_q_def \_F_L_q_def by force lemma subset_fst: "A \ fst ` AB \ \x \ A. \y. (x,y) \ AB" by fastforce lemma red_inf_impl: "\ \ with_labels.Red_Inf_Q NL \ to_F \ \ no_labels.empty_ord_lifted_calc_w_red_crit_family.Red_Inf_Q (fst ` NL)" unfolding no_labels.empty_ord_lifted_calc_w_red_crit_family.Red_Inf_Q_def with_labels.Red_Inf_Q_def proof clarify fix X Xa q assume i_in_inter: "\ \ \ {X NL |X. X \ Red_Inf_\_L_q ` UNIV}" have i_in_q: "\ \ Red_Inf_\_L_q q NL" using i_in_inter image_eqI by blast then have i_in: "\ \ Inf_FL" unfolding Red_Inf_\_L_q_def by blast have to_F_in: "to_F \ \ Inf_F" unfolding to_F_def using Inf_FL_to_Inf_F[OF i_in] . have rephrase1: "(\CL\NL. \_F_q q (fst CL)) = (\ (\_F_q q ` fst ` NL))" by blast have rephrase2: "fst (concl_of \) = concl_of (to_F \)" unfolding concl_of_def to_F_def by simp have subs_red: "((\_Inf_L_q q \) \ None \ the (\_Inf_L_q q \) \ Red_Inf_q q (\_set_L_q q NL)) \ ((\_Inf_L_q q \ = None) \ \_F_L_q q (concl_of \) \ (\_set_L_q q NL \ Red_F_q q (\_set_L_q q NL)))" using i_in_q unfolding Red_Inf_\_L_q_def by blast then have to_F_subs_red: "((\_Inf_q q (to_F \)) \ None \ the (\_Inf_q q (to_F \)) \ Red_Inf_q q (no_labels.\_set_q q (fst ` NL))) \ ((\_Inf_q q (to_F \) = None) \ \_F_q q (concl_of (to_F \)) \ (no_labels.\_set_q q (fst ` NL) \ Red_F_q q (no_labels.\_set_q q (fst ` NL))))" unfolding \_Inf_L_q_def \_set_L_q_def no_labels.\_set_q_def \_F_L_q_def using rephrase1 rephrase2 by metis then show "to_F \ \ no_labels.Red_Inf_\_q q (fst ` NL)" using to_F_in unfolding no_labels.Red_Inf_\_q_def by simp qed (* lem:labeled-saturation-intersection *) lemma labeled_family_saturation_lifting: "with_labels.inter_red_crit_calculus.saturated NL \ no_labels.lifted_calc_w_red_crit_family.inter_red_crit_calculus.saturated (fst ` NL)" unfolding with_labels.inter_red_crit_calculus.saturated_def no_labels.lifted_calc_w_red_crit_family.inter_red_crit_calculus.saturated_def with_labels.Inf_from_def no_labels.Non_ground.Inf_from_def proof clarify fix \F assume labeled_sat: "{\ \ Inf_FL. set (prems_of \) \ NL} \ with_labels.Red_Inf_Q NL" and iF_in: "\F \ Inf_F" and iF_prems: "set (prems_of \F) \ fst ` NL" define Lli where "Lli i \ (SOME x. ((prems_of \F)!i,x) \ NL)" for i have [simp]:"((prems_of \F)!i,Lli i) \ NL" if "i < length (prems_of \F)" for i using that subset_fst[OF iF_prems] nth_mem someI_ex unfolding Lli_def by metis define Ll where "Ll \ map Lli [0..F)]" have Ll_length: "length Ll = length (prems_of \F)" unfolding Ll_def by auto have subs_NL: "set (zip (prems_of \F) Ll) \ NL" unfolding Ll_def by (auto simp:in_set_zip) obtain L0 where L0: "Infer (zip (prems_of \F) Ll) (concl_of \F, L0) \ Inf_FL" using Inf_F_to_Inf_FL[OF iF_in Ll_length] .. define \FL where "\FL = Infer (zip (prems_of \F) Ll) (concl_of \F, L0)" then have "set (prems_of \FL) \ NL" using subs_NL by simp then have "\FL \ {\ \ Inf_FL. set (prems_of \) \ NL}" unfolding \FL_def using L0 by blast then have "\FL \ with_labels.Red_Inf_Q NL" using labeled_sat by fast moreover have "\F = to_F \FL" unfolding to_F_def \FL_def using Ll_length by (cases \F) auto ultimately show "\F \ no_labels.empty_ord_lifted_calc_w_red_crit_family.Red_Inf_Q (fst ` NL)" by (auto intro:red_inf_impl) qed (* thm:labeled-static-ref-compl-intersection *) theorem labeled_static_ref: "static_refutational_complete_calculus Bot_F Inf_F (\\) no_labels.empty_ord_lifted_calc_w_red_crit_family.Red_Inf_Q no_labels.empty_ord_lifted_calc_w_red_crit_family.Red_F_Q \ static_refutational_complete_calculus Bot_FL Inf_FL (\\L) with_labels.Red_Inf_Q with_labels.Red_F_Q" unfolding static_refutational_complete_calculus_def proof (rule conjI impI; clarify) show "calculus_with_red_crit Bot_FL Inf_FL (\\L) with_labels.Red_Inf_Q with_labels.Red_F_Q" using with_labels.inter_red_crit_calculus.calculus_with_red_crit_axioms unfolding labeled_cons_rel_family.entails_Q_def entails_\_L_Q_def . next assume calc: "calculus_with_red_crit Bot_F Inf_F (\\) no_labels.empty_ord_lifted_calc_w_red_crit_family.Red_Inf_Q no_labels.empty_ord_lifted_calc_w_red_crit_family.Red_F_Q" and static: "static_refutational_complete_calculus_axioms Bot_F Inf_F (\\) no_labels.empty_ord_lifted_calc_w_red_crit_family.Red_Inf_Q" show "static_refutational_complete_calculus_axioms Bot_FL Inf_FL (\\L) with_labels.Red_Inf_Q" unfolding static_refutational_complete_calculus_axioms_def proof (intro conjI impI allI) fix Bl :: \'f \ 'l\ and Nl :: \('f \ 'l) set\ assume Bl_in: \Bl \ Bot_FL\ and Nl_sat: \with_labels.inter_red_crit_calculus.saturated Nl\ and Nl_entails_Bl: \Nl \\L {Bl}\ have static_axioms: "B \ Bot_F \ no_labels.lifted_calc_w_red_crit_family.inter_red_crit_calculus.saturated N \ N \\ {B} \ (\B'\Bot_F. B' \ N)" for B N using static[unfolded static_refutational_complete_calculus_axioms_def] by fast define B where "B = fst Bl" have B_in: "B \ Bot_F" using Bl_in Bot_FL_def B_def SigmaE by force define N where "N = fst ` Nl" have N_sat: "no_labels.lifted_calc_w_red_crit_family.inter_red_crit_calculus.saturated N" using N_def Nl_sat labeled_family_saturation_lifting by blast have N_entails_B: "N \\ {B}" using Nl_entails_Bl unfolding labeled_entailment_lifting N_def B_def by force have "\B' \ Bot_F. B' \ N" using B_in N_sat N_entails_B static_axioms[of B N] by blast then obtain B' where in_Bot: "B' \ Bot_F" and in_N: "B' \ N" by force then have "B' \ fst ` Bot_FL" unfolding Bot_FL_def by fastforce obtain Bl' where in_Nl: "Bl' \ Nl" and fst_Bl': "fst Bl' = B'" using in_N unfolding N_def by blast have "Bl' \ Bot_FL" unfolding Bot_FL_def using fst_Bl' in_Bot vimage_fst by fastforce then show \\Bl'\Bot_FL. Bl' \ Nl\ using in_Nl by blast qed qed end end diff --git a/thys/Saturation_Framework/Lifting_to_Non_Ground_Calculi.thy b/thys/Saturation_Framework/Lifting_to_Non_Ground_Calculi.thy --- a/thys/Saturation_Framework/Lifting_to_Non_Ground_Calculi.thy +++ b/thys/Saturation_Framework/Lifting_to_Non_Ground_Calculi.thy @@ -1,865 +1,865 @@ (* Title: Lifting to Non-Ground Calculi of the Saturation Framework * Author: Sophie Tourret , 2018-2020 *) section \Lifting to Non-ground Calculi\ text \The section 3.1 to 3.3 of the report are covered by the current section. Various forms of lifting are proven correct. These allow to obtain the dynamic refutational completeness of a non-ground calculus from the static refutational completeness of its ground counterpart.\ theory Lifting_to_Non_Ground_Calculi imports Calculi Well_Quasi_Orders.Minimal_Elements begin subsection \Standard Lifting\ locale standard_lifting = Non_ground: inference_system Inf_F + Ground: calculus_with_red_crit Bot_G Inf_G entails_G Red_Inf_G Red_F_G for Bot_F :: \'f set\ and Inf_F :: \'f inference set\ and Bot_G :: \'g set\ and Inf_G :: \'g inference set\ and entails_G :: \'g set \ 'g set \ bool\ (infix "\G" 50) and Red_Inf_G :: \'g set \ 'g inference set\ and Red_F_G :: \'g set \ 'g set\ + fixes \_F :: \'f \ 'g set\ and \_Inf :: \'f inference \ 'g inference set option\ assumes Bot_F_not_empty: "Bot_F \ {}" and Bot_map_not_empty: \B \ Bot_F \ \_F B \ {}\ and Bot_map: \B \ Bot_F \ \_F B \ Bot_G\ and Bot_cond: \\_F C \ Bot_G \ {} \ C \ Bot_F\ and inf_map: \\ \ Inf_F \ \_Inf \ \ None \ the (\_Inf \) \ Red_Inf_G (\_F (concl_of \))\ begin abbreviation \_set :: \'f set \ 'g set\ where - \\_set N \ UNION N \_F\ + \\_set N \ \ (\_F ` N)\ lemma \_subset: \N1 \ N2 \ \_set N1 \ \_set N2\ by auto definition entails_\ :: \'f set \ 'f set \ bool\ (infix "\\" 50) where \N1 \\ N2 \ \_set N1 \G \_set N2\ lemma subs_Bot_G_entails: assumes not_empty: \sB \ {}\ and in_bot: \sB \ Bot_G\ shows \sB \G N\ proof - have \\B. B \ sB\ using not_empty by auto then obtain B where B_in: \B \ sB\ by auto then have r_trans: \{B} \G N\ using Ground.bot_implies_all in_bot by auto have l_trans: \sB \G {B}\ using B_in Ground.subset_entailed by auto then show ?thesis using r_trans Ground.entails_trans[of sB "{B}"] by auto qed (* lem:derived-consequence-relation *) sublocale lifted_consequence_relation: consequence_relation where Bot=Bot_F and entails=entails_\ proof show "Bot_F \ {}" using Bot_F_not_empty . next show \B\Bot_F \ {B} \\ N\ for B N proof - assume \B \ Bot_F\ then show \{B} \\ N\ using Bot_map Ground.bot_implies_all[of _ "\_set N"] subs_Bot_G_entails Bot_map_not_empty unfolding entails_\_def by auto qed next fix N1 N2 :: \'f set\ assume \N2 \ N1\ then show \N1 \\ N2\ using entails_\_def \_subset Ground.subset_entailed by auto next fix N1 N2 assume N1_entails_C: \\C \ N2. N1 \\ {C}\ show \N1 \\ N2\ using Ground.all_formulas_entailed N1_entails_C entails_\_def by (smt UN_E UN_I Ground.entail_set_all_formulas singletonI) next fix N1 N2 N3 assume \N1 \\ N2\ and \N2 \\ N3\ then show \N1 \\ N3\ using entails_\_def Ground.entails_trans by blast qed end subsection \Strong Standard Lifting\ (* rmk:strong-standard-lifting *) locale strong_standard_lifting = Non_ground: inference_system Inf_F + Ground: calculus_with_red_crit Bot_G Inf_G entails_G Red_Inf_G Red_F_G for Bot_F :: \'f set\ and Inf_F :: \'f inference set\ and Bot_G :: \'g set\ and Inf_G :: \'g inference set\ and entails_G :: \'g set \ 'g set \ bool\ (infix "\G" 50) and Red_Inf_G :: \'g set \ 'g inference set\ and Red_F_G :: \'g set \ 'g set\ + fixes \_F :: \'f \ 'g set\ and \_Inf :: \'f inference \ 'g inference set option\ assumes Bot_F_not_empty: "Bot_F \ {}" and Bot_map_not_empty: \B \ Bot_F \ \_F B \ {}\ and Bot_map: \B \ Bot_F \ \_F B \ Bot_G\ and Bot_cond: \\_F C \ Bot_G \ {} \ C \ Bot_F\ and strong_inf_map: \\ \ Inf_F \ \_Inf \ \ None \ concl_of ` (the (\_Inf \)) \ (\_F (concl_of \))\ and inf_map_in_Inf: \\ \ Inf_F \ \_Inf \ \ None \ the (\_Inf \) \ Inf_G\ begin sublocale standard_lifting proof show "Bot_F \ {}" using Bot_F_not_empty . next fix B assume b_in: "B \ Bot_F" show "\_F B \ {}" using Bot_map_not_empty[OF b_in] . next fix B assume b_in: "B \ Bot_F" show "\_F B \ Bot_G" using Bot_map[OF b_in] . next show "\C. \_F C \ Bot_G \ {} \ C \ Bot_F" using Bot_cond . next fix \ assume i_in: "\ \ Inf_F" and some_g: "\_Inf \ \ None" show "the (\_Inf \) \ Red_Inf_G (\_F (concl_of \))" proof fix \G assume ig_in1: "\G \ the (\_Inf \)" then have ig_in2: "\G \ Inf_G" using inf_map_in_Inf[OF i_in some_g] by blast show "\G \ Red_Inf_G (\_F (concl_of \))" using strong_inf_map[OF i_in some_g] Ground.Red_Inf_of_Inf_to_N[OF ig_in2] ig_in1 by blast qed qed end subsection \Lifting with a Family of Well-founded Orderings\ locale lifting_with_wf_ordering_family = standard_lifting Bot_F Inf_F Bot_G Inf_G entails_G Red_Inf_G Red_F_G \_F \_Inf for Bot_F :: \'f set\ and Inf_F :: \'f inference set\ and Bot_G :: \'g set\ and entails_G :: \'g set \ 'g set \ bool\ (infix "\G" 50) and Inf_G :: \'g inference set\ and Red_Inf_G :: \'g set \ 'g inference set\ and Red_F_G :: \'g set \ 'g set\ and \_F :: "'f \ 'g set" and \_Inf :: "'f inference \ 'g inference set option" + fixes Prec_F_g :: \'g \ 'f \ 'f \ bool\ assumes all_wf: "minimal_element (Prec_F_g g) UNIV" begin definition Red_Inf_\ :: "'f set \ 'f inference set" where \Red_Inf_\ N = {\ \ Inf_F. (\_Inf \ \ None \ the (\_Inf \) \ Red_Inf_G (\_set N)) \ (\_Inf \ = None \ \_F (concl_of \) \ (\_set N \ Red_F_G (\_set N)))}\ definition Red_F_\ :: "'f set \ 'f set" where \Red_F_\ N = {C. \D \ \_F C. D \ Red_F_G (\_set N) \ (\E \ N. Prec_F_g D E C \ D \ \_F E)}\ lemma Prec_trans: assumes \Prec_F_g D A B\ and \Prec_F_g D B C\ shows \Prec_F_g D A C\ using minimal_element.po assms unfolding po_on_def transp_on_def by (smt UNIV_I all_wf) lemma prop_nested_in_set: "D \ P C \ C \ {C. \D \ P C. A D \ B C D} \ A D \ B C D" by blast (* lem:wolog-C'-nonredundant *) lemma Red_F_\_equiv_def: \Red_F_\ N = {C. \Di \ \_F C. Di \ Red_F_G (\_set N) \ (\E \ (N - Red_F_\ N). Prec_F_g Di E C \ Di \ \_F E)}\ proof (rule;clarsimp) fix C D assume C_in: \C \ Red_F_\ N\ and D_in: \D \ \_F C\ and not_sec_case: \\E \ N - Red_F_\ N. Prec_F_g D E C \ D \ \_F E\ have C_in_unfolded: "C \ {C. \Di \ \_F C. Di \ Red_F_G (\_set N) \ (\E\N. Prec_F_g Di E C \ Di \ \_F E)}" using C_in unfolding Red_F_\_def . have neg_not_sec_case: \\ (\E\N - Red_F_\ N. Prec_F_g D E C \ D \ \_F E)\ using not_sec_case by clarsimp have unfol_C_D: \D \ Red_F_G (\_set N) \ (\E\N. Prec_F_g D E C \ D \ \_F E)\ using prop_nested_in_set[of D \_F C "\x. x \ Red_F_G (\ (\_F ` N))" "\x y. \E \ N. Prec_F_g y E x \ y \ \_F E", OF D_in C_in_unfolded] by blast show \D \ Red_F_G (\_set N)\ proof (rule ccontr) assume contrad: \D \ Red_F_G (\_set N)\ have non_empty: \\E\N. Prec_F_g D E C \ D \ \_F E\ using contrad unfol_C_D by auto define B where \B = {E \ N. Prec_F_g D E C \ D \ \_F E}\ then have B_non_empty: \B \ {}\ using non_empty by auto interpret minimal_element "Prec_F_g D" UNIV using all_wf[of D] . obtain F :: 'f where F: \F = min_elt B\ by auto then have D_in_F: \D \ \_F F\ unfolding B_def using non_empty by (smt Sup_UNIV Sup_upper UNIV_I contra_subsetD empty_iff empty_subsetI mem_Collect_eq min_elt_mem unfol_C_D) have F_prec: \Prec_F_g D F C\ using F min_elt_mem[of B, OF _ B_non_empty] unfolding B_def by auto have F_not_in: \F \ Red_F_\ N\ proof assume F_in: \F \ Red_F_\ N\ have unfol_F_D: \D \ Red_F_G (\_set N) \ (\G\N. Prec_F_g D G F \ D \ \_F G)\ using F_in D_in_F unfolding Red_F_\_def by auto then have \\G\N. Prec_F_g D G F \ D \ \_F G\ using contrad D_in unfolding Red_F_\_def by auto then obtain G where G_in: \G \ N\ and G_prec: \Prec_F_g D G F\ and G_map: \D \ \_F G\ by auto have \Prec_F_g D G C\ using G_prec F_prec Prec_trans by blast then have \G \ B\ unfolding B_def using G_in G_map by auto then show \False\ using F G_prec min_elt_minimal[of B G, OF _ B_non_empty] by auto qed have \F \ N\ using F by (metis B_def B_non_empty mem_Collect_eq min_elt_mem top_greatest) then have \F \ N - Red_F_\ N\ using F_not_in by auto then show \False\ using D_in_F neg_not_sec_case F_prec by blast qed next fix C assume only_if: \\D\\_F C. D \ Red_F_G (\_set N) \ (\E\N - Red_F_\ N. Prec_F_g D E C \ D \ \_F E)\ show \C \ Red_F_\ N\ unfolding Red_F_\_def using only_if by auto qed (* lem:lifting-main-technical *) lemma not_red_map_in_map_not_red: \\_set N - Red_F_G (\_set N) \ \_set (N - Red_F_\ N)\ proof fix D assume D_hyp: \D \ \_set N - Red_F_G (\_set N)\ interpret minimal_element "Prec_F_g D" UNIV using all_wf[of D] . have D_in: \D \ \_set N\ using D_hyp by blast have D_not_in: \D \ Red_F_G (\_set N)\ using D_hyp by blast have exist_C: \\C. C \ N \ D \ \_F C\ using D_in by auto define B where \B = {C \ N. D \ \_F C}\ obtain C where C: \C = min_elt B\ by auto have C_in_N: \C \ N\ using exist_C by (metis B_def C empty_iff mem_Collect_eq min_elt_mem top_greatest) have D_in_C: \D \ \_F C\ using exist_C by (metis B_def C empty_iff mem_Collect_eq min_elt_mem top_greatest) have C_not_in: \C \ Red_F_\ N\ proof assume C_in: \C \ Red_F_\ N\ have \D \ Red_F_G (\_set N) \ (\E\N. Prec_F_g D E C \ D \ \_F E)\ using C_in D_in_C unfolding Red_F_\_def by auto then show \False\ proof assume \D \ Red_F_G (\_set N)\ then show \False\ using D_not_in by simp next assume \\E\N. Prec_F_g D E C \ D \ \_F E\ then show \False\ using C by (metis (no_types, lifting) B_def UNIV_I empty_iff mem_Collect_eq min_elt_minimal top_greatest) qed qed show \D \ \_set (N - Red_F_\ N)\ using D_in_C C_not_in C_in_N by blast qed (* lem:nonredundant-entails-redundant *) lemma Red_F_Bot_F: \B \ Bot_F \ N \\ {B} \ N - Red_F_\ N \\ {B}\ proof - fix B N assume B_in: \B \ Bot_F\ and N_entails: \N \\ {B}\ then have to_bot: \\_set N - Red_F_G (\_set N) \G \_F B\ using Ground.Red_F_Bot Bot_map unfolding entails_\_def by (smt cSup_singleton Ground.entail_set_all_formulas image_insert image_is_empty subsetCE) have from_f: \\_set (N - Red_F_\ N) \G \_set N - Red_F_G (\_set N)\ using Ground.subset_entailed[OF not_red_map_in_map_not_red] by blast then have \\_set (N - Red_F_\ N) \G \_F B\ using to_bot Ground.entails_trans by blast then show \N - Red_F_\ N \\ {B}\ using Bot_map unfolding entails_\_def by simp qed (* lem:redundancy-monotonic-addition 1/2 *) lemma Red_F_of_subset_F: \N \ N' \ Red_F_\ N \ Red_F_\ N'\ using Ground.Red_F_of_subset unfolding Red_F_\_def by (smt Collect_mono \_subset subset_iff) (* lem:redundancy-monotonic-addition 2/2 *) lemma Red_Inf_of_subset_F: \N \ N' \ Red_Inf_\ N \ Red_Inf_\ N'\ using Collect_mono \_subset subset_iff Ground.Red_Inf_of_subset unfolding Red_Inf_\_def by (smt Ground.Red_F_of_subset Un_iff) (* lem:redundancy-monotonic-deletion-forms *) lemma Red_F_of_Red_F_subset_F: \N' \ Red_F_\ N \ Red_F_\ N \ Red_F_\ (N - N')\ proof fix N N' C assume N'_in_Red_F_N: \N' \ Red_F_\ N\ and C_in_red_F_N: \C \ Red_F_\ N\ have lem8: \\D \ \_F C. D \ Red_F_G (\_set N) \ (\E \ (N - Red_F_\ N). Prec_F_g D E C \ D \ \_F E)\ using Red_F_\_equiv_def C_in_red_F_N by blast show \C \ Red_F_\ (N - N')\ unfolding Red_F_\_def proof (rule,rule) fix D assume \D \ \_F C\ then have \D \ Red_F_G (\_set N) \ (\E \ (N - Red_F_\ N). Prec_F_g D E C \ D \ \_F E)\ using lem8 by auto then show \D \ Red_F_G (\_set (N - N')) \ (\E\N - N'. Prec_F_g D E C \ D \ \_F E)\ proof assume \D \ Red_F_G (\_set N)\ then have \D \ Red_F_G (\_set N - Red_F_G (\_set N))\ using Ground.Red_F_of_Red_F_subset[of "Red_F_G (\_set N)" "\_set N"] by auto then have \D \ Red_F_G (\_set (N - Red_F_\ N))\ using Ground.Red_F_of_subset[OF not_red_map_in_map_not_red[of N]] by auto then have \D \ Red_F_G (\_set (N - N'))\ using N'_in_Red_F_N \_subset[of "N - Red_F_\ N" "N - N'"] by (smt DiffE DiffI Ground.Red_F_of_subset subsetCE subsetI) then show ?thesis by blast next assume \\E\N - Red_F_\ N. Prec_F_g D E C \ D \ \_F E\ then obtain E where E_in: \E\N - Red_F_\ N\ and E_prec_C: \Prec_F_g D E C\ and D_in: \D \ \_F E\ by auto have \E \ N - N'\ using E_in N'_in_Red_F_N by blast then show ?thesis using E_prec_C D_in by blast qed qed qed (* lem:redundancy-monotonic-deletion-infs *) lemma Red_Inf_of_Red_F_subset_F: \N' \ Red_F_\ N \ Red_Inf_\ N \ Red_Inf_\ (N - N') \ proof fix N N' \ assume N'_in_Red_F_N: \N' \ Red_F_\ N\ and i_in_Red_Inf_N: \\ \ Red_Inf_\ N\ have i_in: \\ \ Inf_F\ using i_in_Red_Inf_N unfolding Red_Inf_\_def by blast { assume not_none: "\_Inf \ \ None" have \\\' \ the (\_Inf \). \' \ Red_Inf_G (\_set N)\ using not_none i_in_Red_Inf_N unfolding Red_Inf_\_def by auto then have \\\' \ the (\_Inf \). \' \ Red_Inf_G (\_set N - Red_F_G (\_set N))\ using not_none Ground.Red_Inf_of_Red_F_subset by blast then have ip_in_Red_Inf_G: \\\' \ the (\_Inf \). \' \ Red_Inf_G (\_set (N - Red_F_\ N))\ using not_none Ground.Red_Inf_of_subset[OF not_red_map_in_map_not_red[of N]] by auto then have not_none_in: \\\' \ the (\_Inf \). \' \ Red_Inf_G (\_set (N - N'))\ using not_none N'_in_Red_F_N by (meson Diff_mono Ground.Red_Inf_of_subset \_subset subset_iff subset_refl) then have "the (\_Inf \) \ Red_Inf_G (\_set (N - N'))" by blast } moreover { assume none: "\_Inf \ = None" have ground_concl_subs: "\_F (concl_of \) \ (\_set N \ Red_F_G (\_set N))" using none i_in_Red_Inf_N unfolding Red_Inf_\_def by blast then have d_in_imp12: "D \ \_F (concl_of \) \ D \ \_set N - Red_F_G (\_set N) \ D \ Red_F_G (\_set N)" by blast have d_in_imp1: "D \ \_set N - Red_F_G (\_set N) \ D \ \_set (N - N')" using not_red_map_in_map_not_red N'_in_Red_F_N by blast have d_in_imp_d_in: "D \ Red_F_G (\_set N) \ D \ Red_F_G (\_set N - Red_F_G (\_set N))" using Ground.Red_F_of_Red_F_subset[of "Red_F_G (\_set N)" "\_set N"] by blast have g_subs1: "\_set N - Red_F_G (\_set N) \ \_set (N - Red_F_\ N)" using not_red_map_in_map_not_red unfolding Red_F_\_def by auto have g_subs2: "\_set (N - Red_F_\ N) \ \_set (N - N')" using N'_in_Red_F_N by blast have d_in_imp2: "D \ Red_F_G (\_set N) \ D \ Red_F_G (\_set (N - N'))" using Ground.Red_F_of_subset Ground.Red_F_of_subset[OF g_subs1] Ground.Red_F_of_subset[OF g_subs2] d_in_imp_d_in by blast have "\_F (concl_of \) \ (\_set (N - N') \ Red_F_G (\_set (N - N')))" using d_in_imp12 d_in_imp1 d_in_imp2 by (smt Ground.Red_F_of_Red_F_subset Ground.Red_F_of_subset UnCI UnE Un_Diff_cancel2 ground_concl_subs g_subs1 g_subs2 subset_iff) } ultimately show \\ \ Red_Inf_\ (N - N')\ using i_in unfolding Red_Inf_\_def by auto qed (* lem:concl-contained-implies-red-inf *) lemma Red_Inf_of_Inf_to_N_F: assumes i_in: \\ \ Inf_F\ and concl_i_in: \concl_of \ \ N\ shows \\ \ Red_Inf_\ N \ proof - have \\ \ Inf_F \ \_Inf \ \ None \ the (\_Inf \) \ Red_Inf_G (\_F (concl_of \))\ using inf_map by simp moreover have \Red_Inf_G (\_F (concl_of \)) \ Red_Inf_G (\_set N)\ using concl_i_in Ground.Red_Inf_of_subset by blast moreover have "\ \ Inf_F \ \_Inf \ = None \ concl_of \ \ N \ \_F (concl_of \) \ \_set N" by blast ultimately show ?thesis using i_in concl_i_in unfolding Red_Inf_\_def by auto qed (* thm:FRedsqsubset-is-red-crit and also thm:lifted-red-crit if ordering empty *) sublocale lifted_calculus_with_red_crit: calculus_with_red_crit where Bot = Bot_F and Inf = Inf_F and entails = entails_\ and Red_Inf = Red_Inf_\ and Red_F = Red_F_\ proof fix B N N' \ show \Red_Inf_\ N \ Inf_F\ unfolding Red_Inf_\_def by blast show \B \ Bot_F \ N \\ {B} \ N - Red_F_\ N \\ {B}\ using Red_F_Bot_F by simp show \N \ N' \ Red_F_\ N \ Red_F_\ N'\ using Red_F_of_subset_F by simp show \N \ N' \ Red_Inf_\ N \ Red_Inf_\ N'\ using Red_Inf_of_subset_F by simp show \N' \ Red_F_\ N \ Red_F_\ N \ Red_F_\ (N - N')\ using Red_F_of_Red_F_subset_F by simp show \N' \ Red_F_\ N \ Red_Inf_\ N \ Red_Inf_\ (N - N')\ using Red_Inf_of_Red_F_subset_F by simp show \\ \ Inf_F \ concl_of \ \ N \ \ \ Red_Inf_\ N\ using Red_Inf_of_Inf_to_N_F by simp qed lemma lifted_calc_is_calc: "calculus_with_red_crit Bot_F Inf_F entails_\ Red_Inf_\ Red_F_\" using lifted_calculus_with_red_crit.calculus_with_red_crit_axioms . lemma grounded_inf_in_ground_inf: "\ \ Inf_F \ \_Inf \ \ None \ the (\_Inf \) \ Inf_G" using inf_map Ground.Red_Inf_to_Inf by blast (* lem:sat-wrt-finf *) lemma sat_imp_ground_sat: "lifted_calculus_with_red_crit.saturated N \ Ground.Inf_from (\_set N) \ ({\. \\'\ Non_ground.Inf_from N. \_Inf \' \ None \ \ \ the (\_Inf \')} \ Red_Inf_G (\_set N)) \ Ground.saturated (\_set N)" proof - fix N assume sat_n: "lifted_calculus_with_red_crit.saturated N" and inf_grounded_in: "Ground.Inf_from (\_set N) \ ({\. \\'\ Non_ground.Inf_from N. \_Inf \' \ None \ \ \ the (\_Inf \')} \ Red_Inf_G (\_set N))" show "Ground.saturated (\_set N)" unfolding Ground.saturated_def proof fix \ assume i_in: "\ \ Ground.Inf_from (\_set N)" { assume "\ \ {\. \\'\ Non_ground.Inf_from N. \_Inf \' \ None \ \ \ the (\_Inf \')}" then obtain \' where "\'\ Non_ground.Inf_from N" "\_Inf \' \ None" "\ \ the (\_Inf \')" by blast then have "\ \ Red_Inf_G (\_set N)" using Red_Inf_\_def sat_n unfolding lifted_calculus_with_red_crit.saturated_def by auto } then show "\ \ Red_Inf_G (\_set N)" using inf_grounded_in i_in by blast qed qed (* thm:finf-complete *) theorem stat_ref_comp_to_non_ground: assumes stat_ref_G: "static_refutational_complete_calculus Bot_G Inf_G entails_G Red_Inf_G Red_F_G" and sat_n_imp: "\N. (lifted_calculus_with_red_crit.saturated N \ Ground.Inf_from (\_set N) \ ({\. \\'\ Non_ground.Inf_from N. \_Inf \' \ None \ \ \ the (\_Inf \')} \ Red_Inf_G (\_set N)))" shows "static_refutational_complete_calculus Bot_F Inf_F entails_\ Red_Inf_\ Red_F_\" proof fix B N assume b_in: "B \ Bot_F" and sat_n: "lifted_calculus_with_red_crit.saturated N" and n_entails_bot: "N \\ {B}" have ground_n_entails: "\_set N \G \_F B" using n_entails_bot unfolding entails_\_def by simp then obtain BG where bg_in1: "BG \ \_F B" using Bot_map_not_empty[OF b_in] by blast then have bg_in: "BG \ Bot_G" using Bot_map[OF b_in] by blast have ground_n_entails_bot: "\_set N \G {BG}" using ground_n_entails bg_in1 Ground.entail_set_all_formulas by blast have "Ground.Inf_from (\_set N) \ ({\. \\'\ Non_ground.Inf_from N. \_Inf \' \ None \ \ \ the (\_Inf \')} \ Red_Inf_G (\_set N))" using sat_n_imp[OF sat_n] . have "Ground.saturated (\_set N)" using sat_imp_ground_sat[OF sat_n sat_n_imp[OF sat_n]] . then have "\BG'\Bot_G. BG' \ (\_set N)" using stat_ref_G Ground.calculus_with_red_crit_axioms bg_in ground_n_entails_bot unfolding static_refutational_complete_calculus_def static_refutational_complete_calculus_axioms_def by blast then show "\B'\ Bot_F. B' \ N" using bg_in Bot_cond Bot_map_not_empty Bot_cond by blast qed end abbreviation Empty_Order where "Empty_Order C1 C2 \ False" lemma any_to_empty_order_lifting: "lifting_with_wf_ordering_family Bot_F Inf_F Bot_G entails_G Inf_G Red_Inf_G Red_F_G \_F \_Inf Prec_F_g \ lifting_with_wf_ordering_family Bot_F Inf_F Bot_G entails_G Inf_G Red_Inf_G Red_F_G \_F \_Inf (\g. Empty_Order)" proof - fix Bot_F Inf_F Bot_G entails_G Inf_G Red_Inf_G Red_F_G \_F \_Inf Prec_F_g assume lift: "lifting_with_wf_ordering_family Bot_F Inf_F Bot_G entails_G Inf_G Red_Inf_G Red_F_G \_F \_Inf Prec_F_g" then interpret lift_g: lifting_with_wf_ordering_family Bot_F Inf_F Bot_G entails_G Inf_G Red_Inf_G Red_F_G \_F \_Inf Prec_F_g by auto have empty_wf: "minimal_element ((\g. Empty_Order) g) UNIV" by (simp add: lift_g.all_wf minimal_element.intro po_on_def transp_on_def wfp_on_def wfp_on_imp_irreflp_on) then show "lifting_with_wf_ordering_family Bot_F Inf_F Bot_G entails_G Inf_G Red_Inf_G Red_F_G \_F \_Inf (\g. Empty_Order)" by (simp add: empty_wf lift_g.standard_lifting_axioms lifting_with_wf_ordering_family_axioms.intro lifting_with_wf_ordering_family_def) qed locale lifting_equivalence_with_empty_order = any_order_lifting: lifting_with_wf_ordering_family Bot_F Inf_F Bot_G entails_G Inf_G Red_Inf_G Red_F_G \_F \_Inf Prec_F_g + empty_order_lifting: lifting_with_wf_ordering_family Bot_F Inf_F Bot_G entails_G Inf_G Red_Inf_G Red_F_G \_F \_Inf "\g. Empty_Order" for \_F :: \'f \ 'g set\ and \_Inf :: \'f inference \ 'g inference set option\ and Bot_F :: \'f set\ and Inf_F :: \'f inference set\ and Bot_G :: \'g set\ and Inf_G :: \'g inference set\ and entails_G :: \'g set \ 'g set \ bool\ (infix "\G" 50) and Red_Inf_G :: \'g set \ 'g inference set\ and Red_F_G :: \'g set \ 'g set\ and Prec_F_g :: \'g \ 'f \ 'f \ bool\ sublocale lifting_with_wf_ordering_family \ lifting_equivalence_with_empty_order proof show "po_on Empty_Order UNIV" unfolding po_on_def by (simp add: transp_onI wfp_on_imp_irreflp_on) show "wfp_on Empty_Order UNIV" unfolding wfp_on_def by simp qed context lifting_equivalence_with_empty_order begin (* lem:saturation-indep-of-sqsubset *) lemma saturated_empty_order_equiv_saturated: "any_order_lifting.lifted_calculus_with_red_crit.saturated N = empty_order_lifting.lifted_calculus_with_red_crit.saturated N" by standard (* lem:static-ref-compl-indep-of-sqsubset *) lemma static_empty_order_equiv_static: "static_refutational_complete_calculus Bot_F Inf_F any_order_lifting.entails_\ empty_order_lifting.Red_Inf_\ empty_order_lifting.Red_F_\ = static_refutational_complete_calculus Bot_F Inf_F any_order_lifting.entails_\ any_order_lifting.Red_Inf_\ any_order_lifting.Red_F_\" unfolding static_refutational_complete_calculus_def by (rule iffI) (standard,(standard)[],simp)+ (* thm:FRedsqsubset-is-dyn-ref-compl *) theorem static_to_dynamic: "static_refutational_complete_calculus Bot_F Inf_F any_order_lifting.entails_\ empty_order_lifting.Red_Inf_\ empty_order_lifting.Red_F_\ = dynamic_refutational_complete_calculus Bot_F Inf_F any_order_lifting.entails_\ any_order_lifting.Red_Inf_\ any_order_lifting.Red_F_\ " (is "?static=?dynamic") proof assume ?static then have static_general: "static_refutational_complete_calculus Bot_F Inf_F any_order_lifting.entails_\ any_order_lifting.Red_Inf_\ any_order_lifting.Red_F_\" (is "?static_gen") using static_empty_order_equiv_static by simp interpret static_refutational_complete_calculus Bot_F Inf_F any_order_lifting.entails_\ any_order_lifting.Red_Inf_\ any_order_lifting.Red_F_\ using static_general . show "?dynamic" by standard next assume dynamic_gen: ?dynamic interpret dynamic_refutational_complete_calculus Bot_F Inf_F any_order_lifting.entails_\ any_order_lifting.Red_Inf_\ any_order_lifting.Red_F_\ using dynamic_gen . have "static_refutational_complete_calculus Bot_F Inf_F any_order_lifting.entails_\ any_order_lifting.Red_Inf_\ any_order_lifting.Red_F_\" by standard then show "?static" using static_empty_order_equiv_static by simp qed end subsection \Lifting with a Family of Redundancy Criteria\ locale standard_lifting_with_red_crit_family = Non_ground: inference_system Inf_F + Ground_family: calculus_with_red_crit_family Bot_G Inf_G Q entails_q Red_Inf_q Red_F_q for Inf_F :: "'f inference set" and Bot_G :: "'g set" and Inf_G :: \'g inference set\ and Q :: "'q itself" and entails_q :: "'q \ ('g set \ 'g set \ bool)" and Red_Inf_q :: "'q \ ('g set \ 'g inference set)" and Red_F_q :: "'q \ ('g set \ 'g set)" + fixes Bot_F :: "'f set" and \_F_q :: "'q \ 'f \ 'g set" and \_Inf_q :: "'q \ 'f inference \ 'g inference set option" and Prec_F_g :: "'g \ 'f \ 'f \ bool" assumes standard_lifting_family: "lifting_with_wf_ordering_family Bot_F Inf_F Bot_G (entails_q q) Inf_G (Red_Inf_q q) (Red_F_q q) (\_F_q q) (\_Inf_q q) Prec_F_g" begin definition \_set_q :: "'q \ 'f set \ 'g set" where - "\_set_q q N \ UNION N (\_F_q q)" + "\_set_q q N \ \ (\_F_q q ` N)" definition Red_Inf_\_q :: "'q \ 'f set \ 'f inference set" where "Red_Inf_\_q q N = {\ \ Inf_F. (\_Inf_q q \ \ None \ the (\_Inf_q q \) \ Red_Inf_q q (\_set_q q N)) \ (\_Inf_q q \ = None \ \_F_q q (concl_of \) \ (\_set_q q N \ Red_F_q q (\_set_q q N)))}" definition Red_Inf_\_Q :: "'f set \ 'f inference set" where "Red_Inf_\_Q N = \ {X N |X. X \ (Red_Inf_\_q ` UNIV)}" definition Red_F_\_empty_q :: "'q \ 'f set \ 'f set" where "Red_F_\_empty_q q N = {C. \D \ \_F_q q C. D \ Red_F_q q (\_set_q q N) \ (\E \ N. Empty_Order E C \ D \ \_F_q q E)}" definition Red_F_\_empty :: "'f set \ 'f set" where "Red_F_\_empty N = \ {X N |X. X \ (Red_F_\_empty_q ` UNIV)}" definition Red_F_\_q_g :: "'q \ 'f set \ 'f set" where "Red_F_\_q_g q N = {C. \D \ \_F_q q C. D \ Red_F_q q (\_set_q q N) \ (\E \ N. Prec_F_g D E C \ D \ \_F_q q E)}" definition Red_F_\_g :: "'f set \ 'f set" where "Red_F_\_g N = \ {X N |X. X \ (Red_F_\_q_g ` UNIV)}" definition entails_\_q :: "'q \ 'f set \ 'f set \ bool" where "entails_\_q q N1 N2 \ entails_q q (\_set_q q N1) (\_set_q q N2)" definition entails_\_Q :: "'f set \ 'f set \ bool" (infix "\\" 50) where "entails_\_Q N1 N2 \ \q. entails_\_q q N1 N2" lemma red_crit_lifting_family: "calculus_with_red_crit Bot_F Inf_F (entails_\_q q) (Red_Inf_\_q q) (Red_F_\_q_g q)" proof - fix q interpret wf_lift: lifting_with_wf_ordering_family Bot_F Inf_F Bot_G "entails_q q" Inf_G "Red_Inf_q q" "Red_F_q q" "\_F_q q" "\_Inf_q q" Prec_F_g using standard_lifting_family . have "entails_\_q q = wf_lift.entails_\" unfolding entails_\_q_def wf_lift.entails_\_def \_set_q_def by blast moreover have "Red_Inf_\_q q = wf_lift.Red_Inf_\" unfolding Red_Inf_\_q_def \_set_q_def wf_lift.Red_Inf_\_def by blast moreover have "Red_F_\_q_g q = wf_lift.Red_F_\" unfolding Red_F_\_q_g_def \_set_q_def wf_lift.Red_F_\_def by blast ultimately show "calculus_with_red_crit Bot_F Inf_F (entails_\_q q) (Red_Inf_\_q q) (Red_F_\_q_g q)" using wf_lift.lifted_calculus_with_red_crit.calculus_with_red_crit_axioms by simp qed lemma red_crit_lifting_family_empty_ord: "calculus_with_red_crit Bot_F Inf_F (entails_\_q q) (Red_Inf_\_q q) (Red_F_\_empty_q q)" proof - fix q interpret wf_lift: lifting_with_wf_ordering_family Bot_F Inf_F Bot_G "entails_q q" Inf_G "Red_Inf_q q" "Red_F_q q" "\_F_q q" "\_Inf_q q" Prec_F_g using standard_lifting_family . have "entails_\_q q = wf_lift.entails_\" unfolding entails_\_q_def wf_lift.entails_\_def \_set_q_def by blast moreover have "Red_Inf_\_q q = wf_lift.Red_Inf_\" unfolding Red_Inf_\_q_def \_set_q_def wf_lift.Red_Inf_\_def by blast moreover have "Red_F_\_empty_q q = wf_lift.empty_order_lifting.Red_F_\" unfolding Red_F_\_empty_q_def \_set_q_def wf_lift.empty_order_lifting.Red_F_\_def by blast ultimately show "calculus_with_red_crit Bot_F Inf_F (entails_\_q q) (Red_Inf_\_q q) (Red_F_\_empty_q q)" using wf_lift.empty_order_lifting.lifted_calculus_with_red_crit.calculus_with_red_crit_axioms by simp qed lemma cons_rel_fam_Q_lem: \consequence_relation_family Bot_F entails_\_q\ proof show "Bot_F \ {}" using standard_lifting_family by (meson ex_in_conv lifting_with_wf_ordering_family.axioms(1) standard_lifting.Bot_F_not_empty) next fix qi show "Bot_F \ {}" using standard_lifting_family by (meson ex_in_conv lifting_with_wf_ordering_family.axioms(1) standard_lifting.Bot_F_not_empty) next fix qi B N1 assume B_in: "B \ Bot_F" interpret lift: lifting_with_wf_ordering_family Bot_F Inf_F Bot_G "entails_q qi" Inf_G "Red_Inf_q qi" "Red_F_q qi" "\_F_q qi" "\_Inf_q qi" Prec_F_g by (rule standard_lifting_family) have "(entails_\_q qi) = lift.entails_\" unfolding entails_\_q_def lift.entails_\_def \_set_q_def by simp then show "entails_\_q qi {B} N1" using B_in lift.lifted_consequence_relation.bot_implies_all by auto next fix qi and N2 N1::"'f set" assume N_incl: "N2 \ N1" interpret lift: lifting_with_wf_ordering_family Bot_F Inf_F Bot_G "entails_q qi" Inf_G "Red_Inf_q qi" "Red_F_q qi" "\_F_q qi" "\_Inf_q qi" Prec_F_g by (rule standard_lifting_family) have "(entails_\_q qi) = lift.entails_\" unfolding entails_\_q_def lift.entails_\_def \_set_q_def by simp then show "entails_\_q qi N1 N2" using N_incl by (simp add: lift.lifted_consequence_relation.subset_entailed) next fix qi N1 N2 assume all_C: "\C\ N2. entails_\_q qi N1 {C}" interpret lift: lifting_with_wf_ordering_family Bot_F Inf_F Bot_G "entails_q qi" Inf_G "Red_Inf_q qi" "Red_F_q qi" "\_F_q qi" "\_Inf_q qi" Prec_F_g by (rule standard_lifting_family) have "(entails_\_q qi) = lift.entails_\" unfolding entails_\_q_def lift.entails_\_def \_set_q_def by simp then show "entails_\_q qi N1 N2" using all_C lift.lifted_consequence_relation.all_formulas_entailed by presburger next fix qi N1 N2 N3 assume entails12: "entails_\_q qi N1 N2" and entails23: "entails_\_q qi N2 N3" interpret lift: lifting_with_wf_ordering_family Bot_F Inf_F Bot_G "entails_q qi" Inf_G "Red_Inf_q qi" "Red_F_q qi" "\_F_q qi" "\_Inf_q qi" Prec_F_g by (rule standard_lifting_family) have "(entails_\_q qi) = lift.entails_\" unfolding entails_\_q_def lift.entails_\_def \_set_q_def by simp then show "entails_\_q qi N1 N3" using entails12 entails23 lift.lifted_consequence_relation.entails_trans by presburger qed interpretation cons_rel_Q: consequence_relation Bot_F entails_\_Q proof - interpret cons_rel_fam: consequence_relation_family Bot_F Q entails_\_q by (rule cons_rel_fam_Q_lem) have "consequence_relation_family.entails_Q entails_\_q = entails_\_Q" unfolding entails_\_Q_def cons_rel_fam.entails_Q_def by (simp add: entails_\_q_def) then show "consequence_relation Bot_F entails_\_Q" using consequence_relation_family.intersect_cons_rel_family[OF cons_rel_fam_Q_lem] by simp qed sublocale lifted_calc_w_red_crit_family: calculus_with_red_crit_family Bot_F Inf_F Q entails_\_q Red_Inf_\_q Red_F_\_q_g using cons_rel_fam_Q_lem red_crit_lifting_family by (simp add: calculus_with_red_crit_family.intro calculus_with_red_crit_family_axioms_def) lemma lifted_calc_family_is_calc: "calculus_with_red_crit Bot_F Inf_F entails_\_Q Red_Inf_\_Q Red_F_\_g" proof - have "lifted_calc_w_red_crit_family.entails_Q = entails_\_Q" unfolding entails_\_Q_def lifted_calc_w_red_crit_family.entails_Q_def by simp moreover have "lifted_calc_w_red_crit_family.Red_Inf_Q = Red_Inf_\_Q" unfolding Red_Inf_\_Q_def lifted_calc_w_red_crit_family.Red_Inf_Q_def by simp moreover have "lifted_calc_w_red_crit_family.Red_F_Q = Red_F_\_g" unfolding Red_F_\_g_def lifted_calc_w_red_crit_family.Red_F_Q_def by simp ultimately show "calculus_with_red_crit Bot_F Inf_F entails_\_Q Red_Inf_\_Q Red_F_\_g" using lifted_calc_w_red_crit_family.inter_red_crit by simp qed sublocale empty_ord_lifted_calc_w_red_crit_family: calculus_with_red_crit_family Bot_F Inf_F Q entails_\_q Red_Inf_\_q Red_F_\_empty_q using cons_rel_fam_Q_lem red_crit_lifting_family_empty_ord by (simp add: calculus_with_red_crit_family.intro calculus_with_red_crit_family_axioms_def) lemma inter_calc: "calculus_with_red_crit Bot_F Inf_F entails_\_Q Red_Inf_\_Q Red_F_\_empty" proof - have "lifted_calc_w_red_crit_family.entails_Q = entails_\_Q" unfolding entails_\_Q_def lifted_calc_w_red_crit_family.entails_Q_def by simp moreover have "empty_ord_lifted_calc_w_red_crit_family.Red_Inf_Q = Red_Inf_\_Q" unfolding Red_Inf_\_Q_def lifted_calc_w_red_crit_family.Red_Inf_Q_def by simp moreover have "empty_ord_lifted_calc_w_red_crit_family.Red_F_Q = Red_F_\_empty" unfolding Red_F_\_empty_def empty_ord_lifted_calc_w_red_crit_family.Red_F_Q_def by simp ultimately show "calculus_with_red_crit Bot_F Inf_F entails_\_Q Red_Inf_\_Q Red_F_\_empty" using empty_ord_lifted_calc_w_red_crit_family.inter_red_crit by simp qed (* thm:intersect-finf-complete *) theorem stat_ref_comp_to_non_ground_fam_inter: assumes stat_ref_G: "\q. static_refutational_complete_calculus Bot_G Inf_G (entails_q q) (Red_Inf_q q) (Red_F_q q)" and sat_n_imp: "\N. (empty_ord_lifted_calc_w_red_crit_family.inter_red_crit_calculus.saturated N \ \q. Ground_family.Inf_from (\_set_q q N) \ ({\. \\'\ Non_ground.Inf_from N. \_Inf_q q \' \ None \ \ \ the (\_Inf_q q \')} \ Red_Inf_q q (\_set_q q N)))" shows "static_refutational_complete_calculus Bot_F Inf_F entails_\_Q Red_Inf_\_Q Red_F_\_empty" using inter_calc unfolding static_refutational_complete_calculus_def static_refutational_complete_calculus_axioms_def proof (standard, clarify) fix B N assume b_in: "B \ Bot_F" and sat_n: "calculus_with_red_crit.saturated Inf_F Red_Inf_\_Q N" and entails_bot: "N \\ {B}" interpret calculus_with_red_crit Bot_F Inf_F entails_\_Q Red_Inf_\_Q Red_F_\_empty using inter_calc by blast have "empty_ord_lifted_calc_w_red_crit_family.Red_Inf_Q = Red_Inf_\_Q" unfolding Red_Inf_\_Q_def lifted_calc_w_red_crit_family.Red_Inf_Q_def by simp then have empty_ord_sat_n: "empty_ord_lifted_calc_w_red_crit_family.inter_red_crit_calculus.saturated N" using sat_n unfolding saturated_def empty_ord_lifted_calc_w_red_crit_family.inter_red_crit_calculus.saturated_def by simp then obtain q where inf_subs: "Ground_family.Inf_from (\_set_q q N) \ ({\. \\'\ Non_ground.Inf_from N. \_Inf_q q \' \ None \ \ \ the (\_Inf_q q \')} \ Red_Inf_q q (\_set_q q N))" using sat_n_imp[of N] by blast interpret q_calc: calculus_with_red_crit Bot_F Inf_F "entails_\_q q" "Red_Inf_\_q q" "Red_F_\_q_g q" using lifted_calc_w_red_crit_family.all_red_crit[of q] . have n_q_sat: "q_calc.saturated N" using lifted_calc_w_red_crit_family.sat_int_to_sat_q empty_ord_sat_n by simp interpret lifted_q_calc: lifting_with_wf_ordering_family Bot_F Inf_F Bot_G "entails_q q" Inf_G "Red_Inf_q q" "Red_F_q q" "\_F_q q" "\_Inf_q q" by (simp add: standard_lifting_family) have "lifted_q_calc.empty_order_lifting.lifted_calculus_with_red_crit.saturated N" using n_q_sat unfolding Red_Inf_\_q_def \_set_q_def lifted_q_calc.empty_order_lifting.Red_Inf_\_def lifted_q_calc.lifted_calculus_with_red_crit.saturated_def q_calc.saturated_def by auto then have ground_sat_n: "lifted_q_calc.Ground.saturated (\_set_q q N)" using lifted_q_calc.sat_imp_ground_sat[of N] inf_subs unfolding \_set_q_def by blast have "entails_\_q q N {B}" using entails_bot unfolding entails_\_Q_def by simp then have ground_n_entails_bot: "entails_q q (\_set_q q N) (\_set_q q {B})" unfolding entails_\_q_def . interpret static_refutational_complete_calculus Bot_G Inf_G "entails_q q" "Red_Inf_q q" "Red_F_q q" using stat_ref_G[of q] . obtain BG where bg_in: "BG \ \_F_q q B" using lifted_q_calc.Bot_map_not_empty[OF b_in] by blast then have "BG \ Bot_G" using lifted_q_calc.Bot_map[OF b_in] by blast then have "\BG'\Bot_G. BG' \ \_set_q q N" using ground_sat_n ground_n_entails_bot static_refutational_complete[of BG, OF _ ground_sat_n] bg_in lifted_q_calc.Ground.entail_set_all_formulas[of "\_set_q q N" "\_set_q q {B}"] unfolding \_set_q_def by simp then show "\B'\ Bot_F. B' \ N" using lifted_q_calc.Bot_cond unfolding \_set_q_def by blast qed (* lem:intersect-saturation-indep-of-sqsubset *) lemma sat_eq_sat_empty_order: "lifted_calc_w_red_crit_family.inter_red_crit_calculus.saturated N = empty_ord_lifted_calc_w_red_crit_family.inter_red_crit_calculus.saturated N " by simp (* lem:intersect-static-ref-compl-indep-of-sqsubset *) lemma static_empty_ord_inter_equiv_static_inter: "static_refutational_complete_calculus Bot_F Inf_F lifted_calc_w_red_crit_family.entails_Q lifted_calc_w_red_crit_family.Red_Inf_Q lifted_calc_w_red_crit_family.Red_F_Q = static_refutational_complete_calculus Bot_F Inf_F lifted_calc_w_red_crit_family.entails_Q empty_ord_lifted_calc_w_red_crit_family.Red_Inf_Q empty_ord_lifted_calc_w_red_crit_family.Red_F_Q" unfolding static_refutational_complete_calculus_def by (simp add: empty_ord_lifted_calc_w_red_crit_family.inter_red_crit_calculus.calculus_with_red_crit_axioms lifted_calc_w_red_crit_family.inter_red_crit_calculus.calculus_with_red_crit_axioms) (* thm:intersect-static-ref-compl-is-dyn-ref-compl-with-order *) theorem stat_eq_dyn_ref_comp_fam_inter: "static_refutational_complete_calculus Bot_F Inf_F lifted_calc_w_red_crit_family.entails_Q empty_ord_lifted_calc_w_red_crit_family.Red_Inf_Q empty_ord_lifted_calc_w_red_crit_family.Red_F_Q = dynamic_refutational_complete_calculus Bot_F Inf_F lifted_calc_w_red_crit_family.entails_Q lifted_calc_w_red_crit_family.Red_Inf_Q lifted_calc_w_red_crit_family.Red_F_Q" (is "?static=?dynamic") proof assume ?static then have static_general: "static_refutational_complete_calculus Bot_F Inf_F lifted_calc_w_red_crit_family.entails_Q lifted_calc_w_red_crit_family.Red_Inf_Q lifted_calc_w_red_crit_family.Red_F_Q" (is "?static_gen") using static_empty_ord_inter_equiv_static_inter by simp interpret static_refutational_complete_calculus Bot_F Inf_F lifted_calc_w_red_crit_family.entails_Q lifted_calc_w_red_crit_family.Red_Inf_Q lifted_calc_w_red_crit_family.Red_F_Q using static_general . show "?dynamic" by standard next assume dynamic_gen: ?dynamic interpret dynamic_refutational_complete_calculus Bot_F Inf_F lifted_calc_w_red_crit_family.entails_Q lifted_calc_w_red_crit_family.Red_Inf_Q lifted_calc_w_red_crit_family.Red_F_Q using dynamic_gen . have "static_refutational_complete_calculus Bot_F Inf_F lifted_calc_w_red_crit_family.entails_Q lifted_calc_w_red_crit_family.Red_Inf_Q lifted_calc_w_red_crit_family.Red_F_Q" by standard then show "?static" using static_empty_ord_inter_equiv_static_inter by simp qed end end