diff --git a/thys/Propositional_Proof_Systems/SC_Cut.thy b/thys/Propositional_Proof_Systems/SC_Cut.thy --- a/thys/Propositional_Proof_Systems/SC_Cut.thy +++ b/thys/Propositional_Proof_Systems/SC_Cut.thy @@ -1,166 +1,166 @@ theory SC_Cut imports SC begin subsubsection\Contraction\ text\First, we need contraction:\ lemma contract: "(F,F,\ \ \ \ F,\ \ \) \ (\ \ F,F,\ \ \ \ F,\)" proof(induction F arbitrary: \ \) case (Atom k) have "Atom k, Atom k, \ \ \ \ Atom k, \ \ \" by(induction "Atom k, Atom k, \" \ arbitrary: \ rule: SCp.induct) (auto dest!: multi_member_split intro!: SCp.intros(3-) simp add: lem2 lem1 SCp.intros) moreover have "\ \ Atom k, Atom k, \ \ \ \ Atom k, \" by(induction "\" "Atom k, Atom k, \" arbitrary: \ rule: SCp.induct) (auto dest!: multi_member_split intro!: SCp.intros(3-) simp add: lem2 lem1 SCp.intros) ultimately show ?case by blast next case Bot - have "\, \, \ \ \ \ \, \ \ \" by(induction "\, \, \" \ rule: SCp.induct; blast) + have "\, \, \ \ \ \ \, \ \ \" by(blast) moreover have "(\ \ \, \, \ \ \ \ \, \)" using Bot_delR by fastforce ultimately show ?case by blast next case (Not F) then show ?case by (meson NotL_inv NotR_inv SCp.NotL SCp.NotR) next case (And F1 F2) then show ?case by(auto intro!: SCp.intros(3-) dest!: AndR_inv AndL_inv) (metis add_mset_commute) next case (Or F1 F2) then show ?case by(auto intro!: SCp.intros(3-) dest!: OrR_inv OrL_inv) (metis add_mset_commute) next (* Okay, so the induction hypothesis is poison for the simplifier. For some reason, this didn't cause trouble for the other two cases, but here, it does. *) case (Imp F1 F2) show ?case by(auto dest!: ImpR_inv ImpL_inv intro!: SCp.intros(3-)) (insert Imp.IH; blast)+ qed corollary shows contractL: "F, F, \ \ \ \ F, \ \ \" and contractR: "\ \ F, F, \ \ \ \ F, \" using contract by blast+ subsubsection\Cut\ text\Which cut rule we show is up to us:\ lemma cut_cs_cf: assumes context_sharing_Cut: "\(A::'a formula) \ \. \ \ A,\ \ A,\ \ \ \ \ \ \" shows context_free_Cut: "\ \ (A::'a formula),\ \ A,\' \ \' \ \ + \' \ \ + \'" by(intro context_sharing_Cut[of "\ + \'" A "\ + \'"]) (metis add.commute union_mset_add_mset_left weakenL_set weakenR_set)+ lemma cut_cf_cs: assumes context_free_Cut: "\(A::'a formula) \ \' \ \'. \ \ A,\ \ A,\' \ \' \ \ + \' \ \ + \'" shows context_sharing_Cut: "\ \ (A::'a formula),\ \ A,\ \ \ \ \ \ \" proof - have contract\\: "\+\' \ \ \ \' \# \ \ \ \ \" for \ \' \ proof(induction "\'" arbitrary: \) case empty thus ?case using weakenL_set by force next case (add x \' \) from add.prems(2) have "x \# \" by (simp add: insert_subset_eq_iff) then obtain \'' where \[simp]: "\ = x,\''" by (meson multi_member_split) from add.prems(1) have "x,x,\'' + \' \ \" by simp with contractL have "x, \'' + \' \ \" . with add.IH[of \] show ?case using \ add.prems(2) subset_mset.trans by force qed have contract\\: "\ \ \+\' \ \' \# \ \ \ \ \" for \ \ \' proof(induction "\'" arbitrary: \) case empty thus ?case using weakenL_set by force next case (add x \' \) from add.prems(2) have "x \# \" by (simp add: insert_subset_eq_iff) then obtain \'' where \[simp]: "\ = x,\''" by (metis multi_member_split) from add.prems(1) have "\ \ x,x,\'' + \'" by simp with contractR have "\ \ x, \'' + \'" . with add.IH[of \] show ?case using \ add.prems(2) subset_mset.trans by force qed show "\ \ A,\ \ A,\ \ \ \ \ \ \" using context_free_Cut[of \ A \ \ \] contract\\ contract\\ by blast qed (* since these are the only lemmas that need contraction on sets, I've decided to transfer those in place *) text\According to Troelstra and Schwichtenberg~\cite{troelstra2000basic}, the sharing variant is the one we want to prove.\ lemma Cut_Atom_pre: "Atom k,\ \ \ \ \ \ Atom k,\ \ \ \ \" proof(induction "Atom k,\" "\" arbitrary: \ rule: SCp.induct) case BotL hence "\ \# \" by simp thus ?case using SCp.BotL by blast next case (Ax l \) show ?case proof cases assume "l = k" with \Atom l \# \\ obtain \' where "\ = Atom k, \'" by (meson multi_member_split) with \\ \ Atom k, \\ have "\ \ \" using contractR by blast thus ?thesis by auto next assume "l \ k" with \Atom l \# Atom k, \\ have "Atom l \# \" by simp with \Atom l \# \\ show ?thesis using SCp.Ax[of l] by blast qed next case NotL thus ?case by(auto simp: add_eq_conv_ex intro!: SCp.NotL dest!: NotL_inv) next case NotR then show ?case by(auto intro!: SCp.NotR dest!: NotR_inv) next case AndL thus ?case by(auto simp: add_eq_conv_ex intro!: SCp.AndL dest!: AndL_inv) next case AndR then show ?case by(auto intro!: SCp.AndR dest!: AndR_inv) next case OrL thus ?case by(auto simp: add_eq_conv_ex intro!: SCp.OrL dest!: OrL_inv) next case OrR thus ?case by(auto intro!: SCp.OrR dest!: OrR_inv) next case ImpL thus ?case by(auto simp: add_eq_conv_ex intro!: SCp.ImpL dest!: ImpL_inv) next case ImpR then show ?case by (auto dest!: ImpR_inv intro!: SCp.ImpR) qed text\We can show the admissibility of the cut rule by induction on the cut formula (or, if you will, as a procedure that splits the cut into smaller formulas that get cut). The only mildly complicated case is that of cutting in an @{term "Atom k"}. It is, contrary to the general case, only mildly complicated, since the cut formula can only appear principal in the axiom rules.\ theorem cut: "\ \ F,\ \ F,\ \ \ \ \ \ \" proof(induction F arbitrary: \ \) case Atom thus ?case using Cut_Atom_pre by metis next case Bot thus ?case using Bot_delR by fastforce next case Not with NotL_inv NotR_inv show ?case by blast next case And thus ?case by (meson AndL_inv AndR_inv weakenL) next case Or thus ?case by (metis OrL_inv OrR_inv weakenR) next case (Imp F G) (* an automatic proof: thus ?case by (meson ImpL_inv ImpR_inv weakenR) a readable one: *) from ImpR_inv \\ \ F \<^bold>\ G, \\ have R: "F, \ \ G, \" by blast from ImpL_inv \F \<^bold>\ G, \ \ \\ have L: "\ \ F, \" "G, \ \ \" by blast+ from L(1) have "\ \ F, G, \" using weakenR add_ac(3) by blast with R have "\ \ G, \" using Imp.IH(1) by simp with L(2) show "\ \ \" using Imp.IH(2) by clarsimp qed (* For this proof to work with FOL, I think we would need very special inversion rules. For example, for \R, we would need that there's a (finite!) multiset of substitutions S, such that instead of having \x.F,\, having {F[s/x] | s \ S} + \ is enough. I don't think that holds, but we may be able to cheat ourselves around it\ *) corollary cut_cf: "\ \ \ A, \; A, \' \ \'\ \ \ + \' \ \ + \'" using cut_cs_cf cut by metis lemma assumes cut: "\ \' \' (A::'a formula). \\' \ A, \'; A, \' \ \'\ \ \' \ \'" shows contraction_admissibility: "F,F,\ \ \ \ (F::'a formula),\ \ \" by(rule cut[of "F,\" F \, OF extended_Ax]) simp_all (* yes, unpublished Chapman p 2/5, second to last paragraph. that's right. we can prove contraction with cut. but what's that good for? *) end