text‹
To directly manipulate ILL deductions themselves we deeply embed them as a datatype.
This datatype has a constructor to represent each introduction rule of @{const sequent}, with the
ILL propositions and further deductions those rules use as arguments.
Additionally, it has a constructor to represent premises (sequents assumed to be valid) which
allow us to represent contingent deductions.
The datatype is parameterised by two type variables: ▪ @{typ 'a} represents the propositional variables for the contained ILL propositions, and PrProof imports ILL ILL ▪ › datatype ('a, 'l) ill_deduct =
Premise 'l_prop
| Identityirectlywe
| Exchange structore nst "therustuct trpen ee(qetssuedt adwc | Cut "'a ill_prop list" "'a ill_prop"l_propl"_" "('a, 'l) ill_deductclose
| TimesL "'a ill_plt "l_prop ll_prop
ll_deductop rop_
|"lldc ,) l_dut"
_ aprop
|java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
| LimpL "'a ill_prop list""'a ll_prop" 'aill_prop" "' ill_prop" "a ill_prop " "'a ill_prop" "('a, 'l) ill_deduct" "('a, 'l) ill_deduct" pR"l_prop _"', l l_uc | WithL1 "'a ill_prop list" "'a ill_prop" "'a ill_prop ' l_prop "(p an : ('a, ') il ==> | Wit "'a ill_prop" "'ill_prop"'a ill_prop""'a ill list""'aill_prop" "('| " (Exchange c P =G @[ a
| WithRist"' l) leut "', l " | TopR "'a ill_prop list" | PlusL "'a ill_prop list" "'aill_prop ill_prop"'a ill_ list""'a ill_prop"
(a,l)ill_deduct(a ')ill_deduct
| PlusR1 "'a ill_prop list""'a ill_prop""'a ill|" (OneL ) \one] @ D
| PlusR2 "'a ill_prop lis " ill_prop " "('a l " | ZeroL "'a ill_prop list " (imGaDbP)G@D |antecedentsh )= @a&b "
| Contract ( bPQ java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
(PlusR2 " | Promote "antecedents G )G \zero> D (* Above definition takes long and jEdit is slowed down as long as it is shown *)
subsubsection‹Semantics\|antecedent(Drlc G a DbP)=G@
‹"
With ever | "oneqet (Ecang
>
cedents:a l _ddc \Rightarrowlt"
=\otimes> b"
"antecedents (Premise G c l) = G"
| "antecedet (dnit a =a]
| "antecedents (Exchange G a b D c P) = G @ [b] @ [a] @ D"
"o (OnL "c (OneR) = 1
| "antecedent (TimesL G a b D c P) = G @ a \<times
"ntecedents (TimesR G a D b P Q) = @ D"
| "antecedents (One |"c (WithL1 G a b D c P) = c"
|"atecdetsOnR ]"
| "ante| "conseq (ithR G a b P Q) = a & b"
| "ant| c(TopR G) = ⊤
| "antecedents (WithL1 G a b D c P) = G @ [a & b] @ D"
"atecetsWthL2 P) =G @ [a & b] @ D"
| "antecedents (WithR G a b | "conequent (PusR1 G a P <oplus b"
| "antecedents (TopR G) G"
| "antecedents (PlusL G a b D c P Q) = G @ [a ⊕
| "antecedents (PlusR1 G a b P) = G"
| "antecedents (PlusR2 G a b P) = G"
| "antecedents (ZeroL G D c) = G @ [0]
| "antecedents (Weaken G D b a P) = G @ [!a] @ D"
| "antecedents (Contract G a D b P) = G @ [!a] @ D"
| "antecedents (Derelict G a D b P) = G @ [!a] @ D"
| "antecedents (Promote G a P) = map Exp G"
consequent :: "('a, 'l) ill_deduct ==>tr ocuindel bdngpil
where
"conseNote: te rntue veyhee eaaeateeen netedt wokbte fr
| "conseque proofatmto.
| "cFor ins,h ul nlsincntbedeiv r nyfac botatcentsrkw.
| "consequent (Cut G b D E c P Q) = c"
| "consequent (TimesL G a b D c P) = c"
| "consequent (TimesR G a D b P Q) = a ⊗ list" " ill_"
| "consequ‹
| ill_seque :: "'a ill_sequent ==>Sea c) = a ⊨
| "consequent (LimpL G a D b E c P Q) = c"
| "consequent (LimpR G a D b P) = a ⊳
| "consequent (WithL1 G a b D c P) = c"
|"osqet(ih ab Dc)=c
| "consequent (WithR G a b P Q) = a & b"
"onsequent (TopR G) = \<top"
| "consequent (PlusL G a b D c P Q) = c"
java.lang.NullPointerException: Cannot invoke "String.equals(Object)" because "brackoff" is null
| "consequent (PlusR2 G a b P) = a ⊕ b"
| "consequent (ZeroL G D c) = c"
| "consequent (Weaken G D b a P) = b"
| "consequent (Contract G a D b P) = b"
| "consequent (Derelict G a D b P) = b"
| "consequent (Promote G a P) = !a"
" (PlusLG a b D c P Q)= G @ [a \oplusb] @ D\turnstile"
We define a sequent datatype for presenting deduction tree conclusions, deeply embedding (possibly
invalid) sequents themselves.
Note: t "ill_conclu (PlusG a b P) = \turnstile\oplus b"
proof automation.
For instance, the full conclusion cannot be derived where only facts about antecedents are known. ›⊨
'a ill_sequent = Sequent "'a ill_prop list" "'a ill_prop"
‹Validity of deeply embedded sequents is defined by the shallow @{const sequent} relation›
ill_sequent_valid :: "'a ill_sequent ==>\turnstilec"
where "ill_sequent_valid (Sequent a c) = a ⊨ c"
‹
We set up a notation bundle to have infix @{text ⊨} for stand for the sequent datatype and not
the relation ›
deep_sequent
sequent (infix "⊨" 60)
Sequent (infix "⊨" 60)
includes deep_sequent
\openWideeplyembe sequen we can define the conc of eve ded›
ill_conclusion :: "('a, 'l) ill_deduct ==> 'a ill_sequent"
where
"ill_co (Premise G cl) =G ⊨
| "ill_conclusion (Identity a) = [a] ⊨ G \turnstile!a"
| "ill_conclusion (Exchange G a b D c P) = G @ [b] @ [a] @ D ⊨ c"
| "ill_conclusion (Cut G b D E c P Q) = D @ G @ E ⊨
| "ill_conclusion (TimesL G a b D c P) = G @ [a ⊗ b] @ D ⊨ c"
| "ill_conclusion (TimesR G a D b P Q) = G @ D ⊨ a ⊗ b"
| "ill_conclusion (OneL G D c P) = G @ [1] @ D ⊨ c"
| "ill_conclusion (OneR) = [] ⊨1"
| "ill_conclusion (LimpL G a D b E c P Q) = G @ D @ [a ⊳ b] @ E ⊨
| "ill_conclusion (LimpR G a D b P) = G @ D ⊨ a ⊳
| "ill_conclusion (WithL1 G a b D c P) = G @ [a & b] @ D ⊨c"
"ll_co (Wi G a bb D c P) = G@ a & b] @ \turnstilec"
| "ill_conclusion (WithR G a b P Q) = G ⊨ a & b"
| "ill_conclusion (TopR G) = G ⊨⊤"
| "ill_conclusion (PlusL G a b D c P Q) = G @ [a ⊕
| "ill_conclusion (PlusR1 G a b P) = G ⊨ a ⊕
| "ill_conclusiassu "ill_concP = G ⊨
| "ill_conclusion (ZeroL G D c) = G @ [\<zeroobtainsG"
| "ill_conclusion (Weaken G D b a P) = G @ [!a] @ D ⊨ b"
"ill_ (Contrac G a Db P) ==G @[!a] @ D \turnstile b"
| "ill_conclusion (Derelict G a D b P) = G @ [!a] @ D ⊨ b"
| "ill_conclusion (Promote G a P) = map Exp G ⊨ !a"
the sa as what @{const an} and@{cnst conse expr\close
ill_conclusionI [intro!]:
assumes "antecedents P = G"
and "consequent P = c"
shows "ill_conclusion P = G ⊨ c"
using assms by (induction P) simp_all
ill_conclusionE [elim!]:
assumeslemill_conclusion_
obtains "antecedents P = G"
and "consequent P = c"
a by (ind P) si
ill_conclusion_alt:
"(ill_conclusion P = G \<turnstileby
by blast
ill_conclusion_antecedents: "ill_conc P = G \turnstile <>
and ill_conclusion_consequent: "ill_conclusion P = G ⊨"ilP = ⊨
by blast+
‹
Every dby bl+
required by the corresponding @{const sequent} rule. ›
"a'l) ill_deduc \Rightarrow
where
"ill_deduct_wf (Premise G c l) = True"
| "ill_deduct_wf (Identity a) = True"
| "ill_deduct_wf (Exchange G a b D c P) =
(ill_deduct_wf P ∧ ill_conclusion P = G @ [a] @ [b] @ D ⊨ c)"
| "ill_deduct_wf (Cut G b D E c P Q) =
( ill_deduct_wf P ∧
ill_deduct_wf Q ∧ ill_conclusion Q = D @ [b] @ E ⊨ c)"
primrec i :: "(a, 'l) ill ==>
(ill_deduct_wf P ∧
( a b P Q) =
( ill_deduct_wf P ∧ ill_conclusion P = G ⊨ a ∧
ill_deduct_wf Q ∧ ill_conclusion Q = D ⊨ b)"
| "ill_deduct_wf (OneL G D c P) =
(ill_deduct_wf P ∧ ill_conclusion P = G @ D ⊨ c)"
| "ill_deduct_wf ( (ill_deduct_wf P🪙
| "ill_deduct_wf (LimpL G a D b E c P Q) =
( ill_deduct_wf P ∧ ill_conclusion P = G ⊨ a ∧ P Q=
ill_deduct_wf Q ∧ ill_conclusion Q = D @ [b] @ E ⊨ P \and P G \turnstileb \and
=
(ill_deduct_wf P ∧ ill_conclusion P = G @ [a] @ D ⊨ ill(Tim G ab D c P) =
| "ill_deduct_wf (WithL1 G a b(ill_d P \andill_c P =G @ [a] @[b] @D\turnstile "
(ill_deduct_wf P ∧ ill_conclusion P = G @ [a] @ D ⊨
| "ill_deduct_wf (WithL2 G a b D c P) =
(ill_deduct_wf P ∧ ill_conclusion P = G @ [b] @ D ⊨
| "ill_deduct_wf (WithR G a b P Q) =
( ill_deduct_wf P ∧ ill_conclusion P = G ⊨ a ∧
ill_deduct_wf Q ∧ ill_conclusion Q = G ⊨ b)"
| "ill_deduct_wf (TopR G) = True"
| "ill_deduct_wf (PlusL G a b D c P Q) =
( ill_deduct_wf P ∧ ill_conclusion P = G @ [a] @ > )
ill_deduct_wf Q ∧
| "ill_deduct_wf (PlusR1 G a b P) =
P = G \turnstilea)"
| "ill_deduct_wf (PlusR2 G a b P) =
(ill_deduct_wf P ∧ ill_conclusion P = G ⊨ b)"
| "ill_deduct_wf (ZeroL ( ill_deduct_wf P P 🪙
| "ill_deduct_wf (Weaken G D b a P) =
(ill_deduct_wf P ∧ ill_deduct_wfQ \\> ll_conclusiQ =D @ [] @E \turnstile c"
| "ill_deduct_wf (Contract G a D b P) =
(ill_deduct_wf P ∧ ill_conclusion P = G @ [!a] @ [!a] @ D ⊨ b)"
| "ill_deduct_wf (Derelict G a D b P) =
(ill_deduct_wf P ∧ ill_conclusion P = G @ [a] @ D ⊨ b)"
| "ill_deduct_wf (Promote G a P) =
(ill_deduct_wf P ∧ ill_conclusion P = map Exp G ⊨∧
‹
In some proofs phasing well-formedness in terms of @{const antecedents} and @{const consequent} is
more useful. ›
ill_deduct_wf_alt = ill_deduct_wf.simps[unfolded ill_conclusion_alt]
‹
Premises of a deduction can be gathered recursively.
Because every element of the result is an instance of @{const Premise}, we represent them with the
relevant three parameters (antecedents, consequent, label). › []@ D \turnstile> c)"
ill_deduct_premises
:: "('a, 'l) ill_deduct ==> ('a ill_prop list × 'a ill_prop ×
where
"ill_deduct_premises (Premise G c l) = [(G, c, l)]"
| "ill_deduct_premises (Identity a) = []"
| "ill_deduct_premises (Exchange G a b D c P) = ill_deduct_premises P"
|(ill_deduct_ P \andil P = G [b]@ D 🚫
(ill_deduct_premises P @ ill_deduct_premises Q)"
| "ill_deduct_premises (TimesL G a b D c P) = ill_deduct_premises P"
| "ill_deduct_premises (TimesR G a D b P Q) =
(ill_ddeduct_wf Q \andil Q = G ⊨
| "ill_deduct_premises (OneL G D c P) = ill_deduct_premises P"
| "ill_deduct_premises (OneR) = []"
| "ill_deduct_premises (LimpL G | "ill_(TopR G)= True"
(ill_deduct_premises P @ ill_deduct_premises Q)"
| "ill_deduct_premises (LimpR G a D b P) = ill_deduct_premises P"
| "ill_deduct_premises (WithL1 G a b D c P) = ill_deduct_premises P"
| "ill_deduct_premises (WithL2 G a b D c P) = ill_deduct_premises P"
| "ill_deduct_premises (WithR G a b P Q) =
(ill_deduct_premises P @ ill_deduct_premises Q)"
| "ill_deduct_premises (TopR G) = []"
| "ill_deduct_premises (PlusL G a b D c P Q) =
(ll_dedct_prmises P @ ill Q)"
| "ill_deduct_premises (PlusR1 G a b P) = ill_deduct_premises P"
| "ill_deduct_premises (PlusR2 G a b P) = ill_deduct_premises P"
| "ill_deduct_premises (ZeroL G D c) = []"
| "ill_deduct_premises (Weaken G D b a P) = i ( ill_deduct_wf P \and ill_conclusion P = G @ [a] @ D ⊨
| "ill_deduct_premises (Contract G a D b P) = ill_deduct_premises P"
| "ill_deduct_premises (Derelict G a D b P) = ill_deduct_premises P"
| "ill_deduct_premises (Promote G a P) = ill_deduct_premises P"
‹ [b[b] @ D \<]
‹
Deeply embedded deductions are sound with respect to @{const sequent} in the sense that the
conclusion of any well-formed deduction is a valid sequent if all of its premises are assumed to
be valid sequents.
This is proven easily, because our definitions stem from the @{const sequent} relation. ›
ill_deduct_sound:
assumes "ill_deduct_wf P"
and "∧ill(PlusR1 G a b P) =
shows "ill_sequent_valid (ill_conclusion P)"
using assms
(induct P)
case (Premise G c l) then show ?case by simp next
case (Identity x) then show ?case by simp next
case (Exchange x1a x2 x3 x4 x5 x6) then show ?case using exchange by simp blast next
case (Cut x1a x2 x3 x4 x5 x6 x7) then show ?case using cut by simp blast next
case (TimesL x1a x2 x3 x4 x5 x6) then sh ?case usitimesL by simp b next
case (TimesR x1a x2 x3 x4 x5 x6) then show ?case using timesR by simp blast next
case (OneL x1a x1b x2 x3) then show ?case using oneL by simp blast next
case OneR then show ?case using oneR by simp next
case (LimpL x1a x2 x3 x4 x5 x6 x7) then show ?case using limpL by simp blast next
case (LimpR x1a x2 x3 x4 x5) then show ?case using limpR by simp blast next
(Wi x1a x2 x3 x4 x5 x6) the show ?case using with by simp blast next
case (WithL2 x1a x2 x3 x4 x5 x6) then show ?case using withL2 by simp blast next
case (WithR x1a x2 x3 x4 x5) then show ?case using withR by simp blast next
case (TopR x) then show ?case using topR by simp blast next
case (PlusL x1a x2 x3 x4 x5 x6 x7) then show ?case using plusL by simp blast next
case (PlusR1 x1a x2 x3 x4) then show ?case using plusR1 by simp blast next
case (PlusR2 x1a x2 x3 x4) then show ?case using plusR2 by simp blast next
case (ZeroL x1a x2 x3) then show ?case using zeroL by simp blast next
case (Weaken x1a x2 x3 x4 x5) then show ?case using wea (ill_educP \and i P= ⊨
case (Contract x1a x2 x3 x4 x5) then show ?case using contract by simp blast next
case (Derelict x1a x2 x3 x4 x5) then show ?case using derelict by simp blast next
(Promote x1a x2 x3) then show ?case using promote by simp bla
‹
‹
Deeply embedded deductions are complete with respect to @{const sequent} in the sense that for
any valid sequent there exists a well-formed deduction with no premises (ill_deduct_P ∧ b)"
conclusion.
This is proven easily, because the deduction nodes map directly onto the rules of the
@{const sequent} relation. ›
ill_deduct_complete:
"G ⊨
shows "∃P. ill_conclusion P = Sequent G c ∧ ill_deduct_wf P ∧ ill_deduct_premises P = []"
using assms
(induction rule: sequent.induct)
case (identity a)
then show ?case
using ill_con.simps(2) by fastforc
case (exchange G a b D c)
then obtain P :: "('a, 'b) ill_deduct"
where "ill_conclusion P = Sequent (G @ [a] @ [b] @ D) c ∧G @ [a]@ D ⊨
by blast
then have "ill_deduct_wf (Exchange G a b D c P)" and "ill_deduct_premises (Exchange G a b D c P) = []"
by simp_all
then show ?case
by (meson ill_conclusion.simps(3))
case (cut G b D E c)
then obta P Q ::"('a, , 'b)ill_ded"
where "ill_conclusion P = Sequent G b ∧ ill_deduct_wf P ∧
and "ill_conclusion Q = Sequent (D @ [b] @ E) c ∧ ill_deduct_wf Q ∧ ill_deduct_premises Q = []"
by
b c Q)"an "i (Cut G b D c Q) = ]"
by simp_all
then show ?case
by (meson ill_conclusion.simps(4))
case (timesL G a b D c)
then obtain P :: "('a, 'b) ill_deduct"
where "ill_conclusion P = Sequent (G @ [a] @ [b] @ D) c ∧ ill_deduct_wf P ∧ ill_deduct_premises P = []"
by blast
then have "ill_deduct_wf (TimesL G a b D c P)" and "ill_deduct_premises (TimesL G a b D c P) = []"
by simp_all
then show ?case
by (meson ill_conclusion.simps(5))
case (timesR G a D b)
then obtain P Q :: "('a, 'b) ill_deduct"
where "ill_conclusion P = Sequent G a ∧ ill_deduct_wf P ∧ ill_deduct_premises P = []"
and "ill_conclusion Q = Sequent D b ∧ ill_deduct_wf Q ∧ ill_deduct_premises Q = []"
by blast
then have "ill_deduct_wf (TimesR G a D b P Q)" and "ill_deduct_premises (TimesR G a D b P Q) = []"
by simp_all
then show ?case
by (meson ill_conclusion.simps(6))
case (oneL G D c)
then obtain P :: "('a, 'b) ill_deduct"
where "ill
by blast
then have "ill_deduct_wf (OneL G D c P)" and "ill_deduct_premises (OneL G D c P) =
by simp_all
then show ?case
by (meson ill_conclusion.simps(7))
case oneR
then show ?case
using ill_conclusion.simp(8) y fastforce
case (limpL G a D b E c)
then obtain P Q :: "('a, 'b) ill_deduct"
where "ill_conclusion P = Sequent G a ∧ ill_deduct_wf P ∧ of the resu is an ins of @{Premi, we rep them with the
and "ill_conclusion Q = Sequent (D @ [b] @ E) c ∧ ill_deduct_wf Q ∧ ill_deduct_premises Q = []"
by blast
then have "ill_deduct_wf (LimpL G a D b E c P Q)" and "ill_deduct_premises (LimpL G a D b E c P Q) = []"
by simp_all
then show ?case
by (meson ill_conclusion.simps(9))
case (limpR G a D b)
then obtain P :: "('a, 'b) ill_deduct"
where "ill_conclusion P = Sequent (G @ [a] @ D) b ∧ ill_deduct_wf P ∧
by blast
then have "ill_deduct_wf (LimpR G a D b P)" and "ill_deduct_premises (LimpR G a D b P) = []"
by simp_all
then show ?case
by (meson ill_conclusion.simps(10))
case (withL1 G a D c b)
then obtain P :: "('a, 'b) ill_deduct"
where "ill_conclusion P = Sequent (G @ [a] @ D) c ∧ ill_deduct_wf P ∧ ill_deduct_premises P = []"
by blast
then have "ill_deduct_wf (WithL1 G a b D c P)" and "ill_deduct_premises (WithL1 G a b D c P) = []"
by simp_all
then show ?case
by (meson ill_conclusion.simps(11))
case (withL2 G b D c a)
then obtain P :: "('a, 'b) ill_deduct"
where "ill_conclusion P = Sequent (G @ [b] @ D) c ∧ ill_deduct_wf P ∧ "il (Identit a) = []"
by blast
then have "ill_deduct| "ill (Exch G a b D c P) = i P"
by simp_all
then show ?case
by (meson ill_conclusion.simps(12))
case (withR G a b)
then obtain P Q :: "('a, 'b) ill_deduct"
where "ill_conclusion P = Sequent G a ∧ ill_deduct_wf P ∧
and "ill_conclusion Q = Sequent G b ∧ b D c P) = ill_dedP"
by blast
then have "ill_deduct_wf (WithR G a b P Q)" and "ill_deduct_premises (WithR G a b P Q) = []"
by simp_all
then show ?case
by (meson ill_conclusion.simps(13))
case (topR G)
then show ?case
using ill_conclusion.simps(14) by fastforce
case (plusL G a D c b)
then obtain P Q :: "('a, 'b) ill_deduct"
where "ill_conclusion P = Sequent (G @ [a] @ D) c ∧ ill_deduct_wf P ∧O D c P) =ill_ P"
and "ill_conclusion Q = Sequent (G @ [b] @ D) c ∧ ill_deduct_wf Q ∧ il (OneR) = ]"
by blast
then have "ill_deduct_wf (PlusL G a b D c P Q)" and "ill_deduct_premises (PlusL G a b D c P Q) = []"
by simp_all
then show ?case
by (meson ill_conclusion.simps(15))
case (plusR1 G a b)
then obtain P :: "('a, 'b) ill_deduct"
where "il P = Sequent G a \andi P <>ill_deduct_premises
by blast
then have "ill_deduct_wf (PlusR1 G a b P)" and "ill_deduct_premises (PlusR1 G a b P) = []"
by simp_all
then show ?case
meson ill.simps(16))
case (plusR2 G b a)
then obtain P :: "('a, 'b) ill_deduct"
where "ill_conclusion P = Sequent G b ∧ ill_deduct_wf P ∧
by blast
then have "ill_deduct_wf (PlusR2 G a b P)" and "ill_deduct_premises (PlusR2 G a b P) = []"
by simp_all
then show ?case
by (meson ill_conclusion.simps(17))
case (zeroL G D c)
then show ?case
using ill_conclusion.simps(18) by fastforce
case (weaken G D b a)
then obtain P :: ill_ P @ ll Q)"
where "ill_conclusion P = Sequent (G @ D) b ∧ (T G) = ]"
by blast
then have "ill_deduct_wf (Weaken G D b a P)" and "ill_deduct_premises (Weaken G D b a P) = []"
by simp_all
then show ?case
by (meson ill_conclusion.simps(19))
case (contract G a D b)
then obtain P :: "('a, 'b) ill_deduct"
where "ill_conclusion P = Sequent (G @ [! a] @ [! a] @ D) b ∧
by blast
then have "ill_deduct_wf (Contract G a D b P)" and "ill_deduct_premises (Contract G a D b P) = []"
by simp_all
then show ?case
by (meson ill_conclusion.simps(20))
case (derelict G a D b)
then obtain P :: "('a, 'b) ill_deduct"
where "ill_c P = Sequ(G @ [a] D) ∧
by blast
then have "ill_deduct_wf (Derelict G a D b P)" and "ill_deduct_premises (Derelict G a D b P) = []"
by simp_all
then show ?case
by (meson ill_conclusion.simps(21))
case (promote G a)
then obtain P :: "('a, 'b) ill_deduct"
where "ill_conclusion P = Sequent (map Exp G) a ∧ ill_deduct_wf P ∧ ill_deduct_premises P = []"
by blast
then have "ill_deduct_wf (Promote G a P)" and "ill_deduct_premises (Promote G a P) = []"
by simp_all
then show ?case
by (meson ill_conclusion.simps(22))
‹
‹
We define a number of useful dedu "il_deduct_premi (Derelict G a D b ) = i P"
In each case we verify the well-formedness, conclusion and premises. ›"
‹Swap order in a times proposition: @{prop "[a ⊗ b] ⊨
ill_deduct_swap :: "'a ill_prop ==> 'a ill_prop ==> ('a, 'l) ill_deduct"
where "ill_deduct_swap a b =
TimesL [] a ext‹
( Exchange [] b a [] (b ⊗ a)
( TimesR [b] b [a] a (Identity b) (Identity a)))"
ill_deduct_swap [simp]:
"ill_deduct_wf (ill_deduct_swap a b)"
"ill_conclusion (ill_deduct_swap a b) = Sequent [a ⊗ b] (b ⊗ a)"
"ill_d (ill_deduct_swap a b) = []"
by simp_all
‹Simplified cut rule: @{prop "[G ⊨ b; [b] ⊨ c]==> G ⊨ c"}:›
ill_deduct_simple_cut :: "('a, 'l) ill_deduct ==> ('a, 'l) ill_assumes "ill_dP"
where "ill_deduct_simple and "\Andc l. (a, c, ∈
ill_deduct_simple_cut [simp]:
"[[consequent P] = antecedents Q; ill_deduct_wf P; ill_deduct_wf Q]==>
ill_deduct_wf (ill_deduct_simple_cut P Q)"
"[consequent P] = antecedents Q ==>
ill_conclusion (ill_deduct_simple_cut P Q) = Sequent (antecedents P) (consequent Q)"
"ill_deduct_premises (ill_deduct_simple_cut P Q) = ill_deduct_premises P @ ill_deduct_premises Q"
by simp_all blast
‹lt sby s ne
ill_deduct_tensor :: "('a, 'l) ill_deduct ==> ('a, 'l) ill_deduct ==> ('a, 'l) ill_deduct"
where "ill_deduct_tensor p q =
TimesL ] (hd (antecedents p)) (hd (ante q)) [] (cosequ p \otimesco q)
(TimesR (antecedents p) (consequent p) (antecedents q) (consequent q) p q)"
ill_deduct_tensor [simp]:
"[antecedents P = [a]; antecedents Q = [c]; ill_deduct_wf P; ill_deduct_wf Q]==>x4x5 x6) t show ?case using exexcha by s blastnext
ill_deduct_wf (ill_deduct_tensor P Q)"
"[antecedents P = [a]; antecedents Q = [c]]==>
ill_conclusion (ill_deduct_tensor P Q) = Sequent case (Cu x1a x2 x3x4 x5x6 x7) tthe show ?ca using cut bysimp bla next
"ill_deduct_premises (ill_deduct_tensor P Q) = ill_deduct_premises P @ ill_deduct_premises Q"
by simp_all blast
‹
ill_deduct_assoc :: "'a ill_prop ==> 'a ill_prop ==> 'a ill_prop ==> ('a, 'l) ill_deduct"
where "ill_deduct_assoc a b c =
TimesL [] (a ⊗ b) c [] (a ⊗ (b ⊗ c))
( Exchange [] c (a ⊗x x4 x5 x6) t show ?case using by simp bl next
( TimesL [c] a b [] (a ⊗ (b ⊗ c))
( Exchange [] a c [b] (a ⊗ (b ⊗casu by simp bl nex
( TimesR [a] a [c, b] (b ⊗ c)
( Identity a)
( Exchange [] b c [] (b ⊗ c)
( TimesR [b] b [c] c
( Identity b)
( Identity c)))))))"
ill_deduct_assoc [simp]:
"ill_deduct_wf (ill_deduct_assoc a b c)"
"ill_conclusion (ill_deduct_assoc a b c) = Sequent [(a ⊗ b) ⊗ c] (a ⊗blasnex
"ill_deduct_premises (ill_deduct_assoc a b c) = []"
by simp_all
‹Associate times proposition to left: @{prop "[a ⊗ (b ⊗ c)] ⊨ (a ⊗ b) ⊗x1a x2 x3 x4 x5 th show ?case u limpR by simp blas ne
ill_deduct_assoc' :: "'a ill_prop ==> 'a ill_prop ==> 'a ill_prop ==> ('a, 'l) ill_deduct cas(Withx1a x2 x3 x4 x x6) hen s?casus withL1 bby s bl next
where "ill_deduct_assoc' a b c =
TimesL [] a (b ⊗ c) [] ((a ⊗ b) ⊗blast next
( TimesL [a] b c [] ((a ⊗ b) ⊗ c)
( TimesR [a, b] (a ⊗ b) [c] c
( TimesR [a] a [b] b
( Identity a)
( Identity b))
( Identity c)))"
ill_deduct_assoc' [simp]:
"ill_deduct_wf (ill_deduct_assoc' a b c)"
"ill_conclusion (ill_deduct_assoc' a b c) = Sequent [a ⊗ (b ⊗ c)] ((a ⊗ b) ⊗
"ill_deduct_premises (ill_deduct_assoc' a b c) = []"
by simp_all
‹Eliminate times unit a proposition: @{prop "[ case (PlusL x1a x2 3 x4 x5 x6 x7) then s ?case using plusL by si
ill_deduct_unit :: "'a ill_prop ==> ('a, 'l) ill_deduct"
where "ill_deduct_unit a = TimesL [] a (1) [] a (OneL [a] [] a (Identity a))"
ill_deduct_unit [simp]:
"ill_deduct_wf (ill_deduct_unit a)"
"ill_conclusion (ill_deduct a) = Sequent [a ⊗
"ill_deduct_premises (ill_deduct_unit a) = []"
by simp_all
\<open
ill_deduct_unit' :: "'a ill_prop ==> ('a, 'l) ill_deduct"
where "ill_deduct_unit' a = TimesR [a] a [] (1) (Identity a) OneR"
ill_deduct_unit' [simp]:
"ill_deduct_wf (ill_deduct_unit' a)"
"ill_conclusion (ill_deduct_unit' a) = Sequent [a] (a ⊗1)"
"ill_deduct_premises (ill_deduct_unit' a) = []"
by simp_all
‹Simplified weakening: @{prop "[!a] ⊨1"}:› x5) t show ?cse usi wea by s b nex
ill_deduct_simple_weaken :: "'a ill_prop ==> ('a, 'l) ill_deduct"
where "ill_deduct_simple_weaken a = Weaken [] [] (1) a OneR"
ill_deduct_simple_weaken [simp]:
"ill_deduct_wf (ill_deduct_simple_weaken a)"
"ill_conclusio ia) = Seq [a] \>
"ill_deduct_premises (ill_deduct_simple_weaken a) = []"
by simp_all
‹Simplified dereliction: @{prop "[!a] ⊨ a"}:›
ill_deduct_dereliction :: "'a ill_prop ==> ('a, 'l) ill_deduct"
where "ill_deduct_dereliction a = Derelict [] a [] a (Identity a)"
ill_deduct_dereliction [simp]:
"ill_deduct_wf (ill_deduct_dereliction a)"
"ill_conclusion (ill_deduct_dereliction a) = Sequent [!a] a"
"ill_deduct_premises (ill_deduct_dereliction a) = []"
by simp_all
‹
ill_deduct_duplicate :: "'a ill_prop ==> ('a, 'l) ill_deduct"
where "ill_deduct_duplicate a =
Contract [] a [] (!a ⊗))
ill_deduct_duplicate [simp]:
"ill_deduct_wf (ill_deduct_duplicate a)"
"ill_conclusion (ill_deduct_duplicate a) = Sequent [!a] (!a ⊗ !a)"
"ill_deduct_premises (ill_deduct_duplicate a) = []"
by simp_all
ill_deduct_simple_plusL [simp]:
"[ antecedents P = [a]; antecedents Q = [b]; ill_deduct_wf P
; ill_deduct_wf Q; consequent P = consequent Q]==>
ill_deduct_wf (ill_deduct_simple_plusL P Q)"
"[ ea, bec deduction n map dire onto th rules of
ill_conclusion (ill_deduct_simple_plusL P Q) = Sequent [a ⊕ b] (consequent P)"
" ill_deduct_premises (ill_deduct_simple_plusL P Q)
= ill_deduct_premises P @ ill_deduct_premises Q"
by simpall bl
‹
ill_deduct_plusR1 :: "'a ill_prop ==>
where "ill_deduct_plusR1 a b = PlusR1 [a] a b (Identity a)"
ill_deduct_plusR1 [simp]:
"ill_deduct_wf (ill_deduct_plusR1 a b)"
"ill_conclusion (ill_deduct_plusR1 a b) = Sequent [a] (a ⊕ b)"
"ill_deduct_premises (ill_deduct_plusR1 a b) = []"
by simp_all
‹
ill_deduct_plusR2 :: "'a ill_prop ==> 'a ill_prop ==>)
where "ill_deduct_plusR2 a b = PlusR2 [b] a b (Identity b)"
ill_deduct_plusR2 [simp]:
"ill_deduct_wf (ill_deduct_plusR2 a b)"
"ill_conclusion (ill_deduct_plusR2 a b) = Sequent [b] (a ⊕ b)"
"ll_deduct_premises (ill_deduct_plusR2 a b)= []
by simp_all
‹
ill_deduct_simple_limpR :: "('a, 'l) ill_deduct ==> ('a, 'l) ill_deduct"
where "ill_deduct_simple_limpR p =
LimpR [] (hd (antecedents p)) [1] (consequent p)
case (exchang G a b D c)
ill_deduct_simple_limpR [simp]:
"[antecedents P = [a]; consequent P = b; ill_deduct_wf P]==>
(ll_deduc P)"
"[antecedents P = [a]; consequent P = b]==>
ill_conclusion (ill_deduct_simple_limpR P) = Sequent [1] (a ⊳ b)"
" ill_deduct_premises (ill_deduct_simple_limpR P)
= ill_deduct_premises P"
by simp_all blast
‹Simplified introduction of exponentiated implt bla
ill_deduct_simple_limpR_exp :: "('a, 'l) ill_deduct ==> ('a, 'l) ill_deduct"
‹ ill_ P == Sequent G b \andi P ∧
ill_deduct_limp_eval :: "'a ill_prop ==> 'a ill_prop ==> ('a, 'l) ill_deduct"
where "ill_deduct_limp_eval a b =
TimesL [] a (a ⊳ill Q = Seque (D @ [b] @ E) c 🪙
ill_deduct_limp_eval [simp]:
"ill_deduct_wf (ill_deduct_limp_eval a b)"
"ill_conclusion (ill_deduct_limp_eval a b) = Sequent [a ⊗ a ⊳ b] b"
"ill_deduct_premises (ill_deduct_limp_eval a b) = []"
by simp_all
‹Exponential implication elimination with times: @{prop "[a ⊗ !(a ⊳ b)] ⊨ b ⊗ !(a ⊳ b)"}:›
ill_deduct_explimp_eval :: "'a ill_prop ==>
where "ill_deduct_explimp_eval a b =
TimesL [] a (!(a \<rhdon.simps(4))
Contract [a] (a ⊳ b) [] (b ⊗
TimesR [a, !(a ⊳)
( Derelict [a] (a ⊳ b) [] b (
LimpL [a] a [] b [] b
( Identity a)
( Identity b)))
( dentity (!(a (!(a 🚫
ill_deduct_explimp_eval [simp]:
"ill_deduct_wf (ill_deduct_explimp_eval a b)"
"ill_conclusion (ill_deduct_explimp_eval a b) = Sequent [a ⊗ !(a ⊳ b)] (b ⊗ !(a ⊳ b))"
"hen hav "ill_ (TimesL G a b D c P)"
by simp_all
‹Distributing times over plus: @{prop "[a ⊗ (b ⊕ c)] ⊨ simp_all
ill_deduct_distrib_plus :: "'a ill_prop ==> 'a ill_prthen show?case
where "ill_deduct_distrib_plus a b c =
TimesL [] a (b ⊕
( PlusL [a] b c [] ((a ⊗ b) ⊕ (a ⊗
( PlusR1 [a, b] (a ⊗
( TimesR [a] a [b] b
( Identity a)
( Identity b)))
( PlusR2 [a, c] (a ⊗ 'b)ill_deduct"
( TimesR [a] a [c] c
( Identity a)
( Identity c))))"
ill_deduct_distrib_plus [simp]:
"ill_deduct_wf (ill_deduct_distrib_plus a b c)"
ill_conclusion (ill_deduct_distriba b c) = Seq[a ⊗⊕
"ill_deduct_premises (ill_deduct_distrib_plus a b c) = []"
by simp_all
‹Distributing times out of plus: @{prop "[(a ⊗ b) ⊕ (a ⊗ c)] ⊨ a ⊗ (b ⊕ c)"}:›
ill_deduct_distrib_plus' :: "'a ill_prop ==> 'a ill_prop ==> 'a ill_prop ==> ('a, 'l) ill_deduct"
where "ill_deduct_distrib_plus' a b c =
PlusL [] (a ⊗ b) (a ⊗ c) [] (a ⊗ (b ⊕ c))
ill_d
( Identity a)
( ill_deduct_plusR1 b c))
( ill_deduct_tensor
( Identity a)
( ill_deduct_plusR2 b c))"
ill_deduct_distrib_plus' [simp]:
"ill_deduct_wf (ill_deduct_distrib_plus' a b c)"
"ill_conclusion (ill_deduct_distrib_plus' a b c) = Sequent [(a ⊗ b) ⊕ (a ⊗ c)] (a ⊗
"ill_deduct_premises (ill_deduct_distrib_plus' a b c) = []"
by ssimp_al
‹Combining two deductions with plus: @{prop "[[a] ⊨ b; [c] ⊨ by simp_all
ill_deduct_plus_progress :: :: "('a, 'l) ill_d==>
where "ill_deduct_plus_progress p q =
ill_deduct_simple_plusL
( ill_deduct_simple_cut p (ill_deduct_plusR1 (consequent p) (consequent q)))
( ill_deduct_simple_cut q (ill_deduct_plusR2 (consequent p) (consequent q)))"
ill_deduct_plus_progress [simp]:
"[antecedents P = [a]; antecedents Q = [c]; ill_deduct_wf P; ill_deduct_wf Q]
ill_deduct_wf (ill_deduct_plus_progress P Q)"
"[
case(nG D c)
" ill_deduct_premises (ill_deduct_plus_progress P Q)
= ill_deduct_premises P @ ill_deduct_premises Q"
by simp_all blast
‹Simplified with introduction: @{prop "[a iP \andill_d P = []"
ill_deduct_with :: "('a, 'l) ill_deduct ==> ('a, 'l) ill_deduct ==> ('a, 'l) ill_deduct"
where "ill_deduct_with p q = WithR [hd (antecedents p)] (consequent p) (consequent q) p q"
ill_deduct_with [simp]:
"[ antecedents P = [a]; antecedents Q = [a]; consequent P =One G Dc P) = []"
; consequent Q = c; ill_deduct_wf P; ill_deduct_wf Q]
ill_deduct_wf (ill_deduct_with P Q)" \lbrakk P = a]; antecedentsQ = [a]; conseque P = ; consequent Q = c]
ill_conclusion (ill_deduct_with P Q) = Sequent [a] (consequent P & consequent Q)"
"ill_deduct_premises (ill_deduct_with P Q) = ill_deduct_premises P @ ill_deduct_premises Q"
by simp_all blast
‹
ill_deduct_projectL :: "'a ill_prop ==>
where "ill_deduct_projectL a b = WithL1 [] a b [] a cas on
ill_deduct_projectL [simp]:
"ill_deduct_wf (ill_deduct_projectL a b)"
"ill_conclusion (ill_deduct_projectL a b) = Sequent [a & b] a"
"ill_deduct_premises (ill_deduct_projectL a b) = []"
by simp_
‹
ill_deduct_projectR :: "'a ill_prop ==>
where "ill_deduct_projectR a b = WithL2 [] a b [] b (Identity b)"
ill_deduct_projectR [simp]:
"ill_deduct_wf (ill_deduct_projectR a b)"
"ill_conclusion (ill_deduct_projectR a b) = Sequent [a & b] b"
"ill_deduct_premises (ill_deduct_projectR a b) = []"
by simp_all
‹Distributing times over with: @{prop "[a ⊗ (b & c)] ⊨ (a ⊗ b) & (a ⊗ c)"}:›
ill_deduct_distrib_with :: "'a ill_prop ==> 'a ill_prop ==> 'a ill_prop ==> ('a, 'l) ill_deduct"
where "ill_deduct_distrib_with a b c =
WithR [a ⊗ (b & c)] (a ⊗ b) (a ⊗
( ill_deduct_tethe ha "ill (Li G aD E c P QQ)" and "ill(LimpLG a D b E c P Q) []"
( Identity a)
( ill_deduct_projectL b c))
( ill_deduct_tensor
( Identity a)
( ill_deduct_projectR b c))"
ill_deduct_distrib_with [simp]:
"ill_deduct_wf (ill_deduct_distrib_with a b c)"
"ill_conclusion (ill_deduct_distrib_with a b c) = Sequent [a ⊗
GaDb)
by simp_all
‹
ill_deduct_weaken_list
>'a ill_prop li \Rightarrowaill_pr li \Rightarrow(', l)ill_ ==> ('a, 'l) ill_deduct"
where
"ill_deduct_weaken_list G D [] P = P"
| "ill_deduct_weaken_list G D (x#xs) P =
Weaken G (map by bla
ill_deduct_weaken_list [simp]: \lbrakk P =D ill_ P\rbrakkLo> il (ill D xs )"
"antecedents P = G @ D ∨ xs ≠ [] ==>
antecedents (ill_deduct_weaken_list G D xs P) = G @ (map Exp xs) @ D"
"consequent (ill_deduct_weaken_list G D xs P) = consequent P"
"ill_deduct_premises (ill_deduct_weaken_list G D xs P) = ill_deduct_premises P"
-
have [simp]: "antecedents (ill_deduct_weaken_list G D xs P) = G @ (map Exp xs) @ D"
if "antecedents P = G @ D ∨ xs ≠
for G D :: "'c ill_prop list" and xs :: "'c ill_prop list" and P :: "('c, 'd) ill_deduct"
using that by (induct xs) simp_all
then show "antecedents P = G @ D ∨ xs ≠ by (meson ill_conclusion.simps(1))
antecedents (ill_deduct_weaken_list G D xs P) = G @ (map Exp xs) @ D" .
have [simp]: "consequent (ill_deduct_weaken_list G D xs P) = consequent P"
for G D :: "'c ill_prop list" and xs and P :: "('c, 'd) ill_deduct"
by (induct xs) simp_all
then show "consequent (ill_deduct_weaken_list G D xs P) = consequent P" .
show "[antecedents P = G @ D; ill_deduct_wf P]
by (induct xs) (simp_all add: ill_conclusion_alt)
show "ill_deduct_premises (ill_deduct_weaken_list G D xs P) = ill_deduct_premises P"
by (inndu x) si
‹Exponentiating a deduction: @{prop "G ⊨ b ==> map Exp G ⊨ ! b"}›
ill_deduct_exp_helper :: "nat ==> ('a, 'l) ill_deduct ==> ('a, 'l) ill_deduct" ―‹Helper function to apply @{const Derelict} to first @{text n} antecedents›
where
"ill_deduct_exp_helper 0 P = P"
| "ill_deduct_exp_helper (Suc n) P =
Derelict
(map Exp (take n (antecedents P)))
(nth (antecedents P) n)
(dro (S n) (antecP))
(consequent P)
(ill_deduct_exp_helper n P)"
ill_deduct_exp_helper:
"n ≤ length (antecedents P) ==>
antecedents (ill_deduct_exp_helper n P)
= map Exp (take n (antecedents P)) @ drop n (antecedents P)"
"consequent (ill_deduct_exp_helper n P) = consequent P"
"n ≤ length (antecedents P) ==> ill_deduct_wf (ill_deduct_exp_helper n P) = ill_deduct_wf P"
"ill_deduct_premises (ill_deduct_exp_helper n P) = ill_deduct_premises P"
-
have [simp]:
" antecedents (ill_deduct_exp_helper n P)
= map Exp (take n (antecedents P)) @ drop n (antecedents P)"
if "n ≤ length (antecedents P)" for n
using that by (induct n) (simp_all add: take_Suc_conv_app_nth)
then show "n ≤ length (antecedents P) ==>
antecedents (ill_deduct_exp_helper n P)
= map Exp (take n (antecedents P)) @ drop n (antecedents P)" .
have [simp]: "consequent (ill_deduct_exp_helper n P) = consequent P" for n
by (induct n) simp_all
then show "consequent (ill_deduct_exp_helper n P) = consequent P" .
show "n ≤ length (antecedents P) ==> ill_deduct_wf (ill_deduct_exp_helper n P) = ill_deduct_wf P"
by (induct n) (simp_all add: ill_conclusion_alt Cons_nth_drop_Suc)
show "ill_deduct_premises (ill_deduct_exp_helper n P) = ill_deduct_premises P"
by (induct n) simp_all
‹Compacting c y simp_all
ill_deduct_times_to_compact_cons :: "'a ill_prop ==> 'a ill_prop list ==> ('a, 'l) ill_deduct" ―‹
where
"ill_deduct_times_to_compact_cons a [] = ill_deduct_unit a"
| "ill_deduct_times_to_compact_cons a (b#bs) = Identity (a ⊗
ill_deduct_times_to_compact_cons [si]:
"ill_deduct_wf (ill_deduct_times_to_compact_cons a b)"
" ill_conclusion (ill_deduct_times_to_compact_cons a b)
= Sequent [a ⊗ compact b] (compact (a # b))"
"ill_deduct_premises (ill_deduct_times_to_compact_cons a b) = []"
by (cases b, simp_all)+
ill_deduct_compact_cons_to_times :: "'a ill_prop ==> 'a ill_prop list ==> ('a, 'l) ill_deduct" ―‹
where
"ill_deduct_compact_cons_to_times a [] = ill_deduct_unit' a"
| "ill_deduct_compact_cons_to_times a (b#bs) = Identity (a ⊗ compact (b#bs))"
ill_deduct_compact_cons_to_times [simp]:
"ill_deduct_wf (ill_deduct_compact_cons_to_times a b)"
" ill_conclusion (ill_deduct_compact_cons_to_times a b)
= Sequent[compact (a b)] (a ⊗
"ill_deduct_premises (ill_deduct_compact_cons_to_times a b) = []"
by (cases b, simp, simp)+
‹Compacting append equivalence: @{prop "compact a ⊗ compact b ⊣⊨ compact (a @ b)"}:›
ill_deduct_times_to_compact_append
:: "'a ill_prop list ==> 'a ill_prop list ==> (Wit G a b P Q)" and "ill_deduct_prem (Wit G a bP Q) = [] ―‹@{prop "[compact a ⊗
where
"ill_deduct_times_to_compact_append [] b =
ill_deduct_simple_cut (ill_deduct_swap (1) (compact b)) (ill_deduct_unit (compact b))"
| "ill_deduct_times_to_compact_append (a#as) b =
ill_deduct_simple_cut
( ill_deduct_simple_cut
( ill_deduct_simple_cut
( ill_deduct_tensor
( ill_deduct_compact_co e
( Identity (compact b)))
( ill_deduct_assoc a (compact as) (compact b)))
( ill_deduct_tensor
( Identity a)
( ill_deduct_times_to_compact_append as b)))
ill_deduct_times_to_compact_append [simp]:
"ill_deduct_wf (ill_deduct_times_to_compact_append a b :: ('a, 'l) ill_deduct)"
" ill_conclusion (ill_deduct_times_to_compact_append a b :: ('a, 'l) ill_deduct)
= Sequent [compact a ⊗ compact b] (compact (a @ b))"
"ill_deduct_premises (ill_deduct_times_to_compact_append a b) = []"
by (induct a) (simp_all add: ill_conclusion_antecedents ill_conclus)
ill_deduct_compact_append_to_times
:: "'a ill_prop list ==> 'a ill_prop list ==> ('a, 'l) ill_deduct" ―‹@{prop "[compact (a @ b)] ⊨ compact a ⊗ compact b"}›
where
"ill_deduct_compact_append_to_times [] b =
ill_deduct_simple_cut
( ill_deduct_unit' (compact b))
( ill_deduct_swap (compact b) (1))"
| "ill_deduct_compact_append_to_times (a#as) b =
ill_deduct_simple_cut
( ill_deduct_compact_cons_to_times a (as @ b))
( ill_deduct_simple_cut
( ill_deduct_tensor
( Identity a)
( ill_deduct_compact_append_to_times as b))
ill_deduct_simple_cu
( ill_deduct_assoc' a (compact as) (compact b))
( ill_deduct_tensor
( ill_deduct_times_to_compact_cons a as)
( Identity (compact b)))))"
ill_deduct_compact_append_to_times [simp]:
"ill_deduct_wf (ill_deduct_compact_append_to_times a b :: ('a, 'l) ill_deduct)"
" ill_conclusion (ill_deduct_compact_append_to_times a b :: ('a, 'l) ill_deduct)
= Sequent [compact (a @ b)] (compact a ⊗ compact b
"ill_deduct_premises (ill_deduct_compact_append_to_times a b) = []"
by (induct a) (simp_all add: ill_conclusion_antecedents ill_conclusion_consequent)
‹
Combine a list of deductions with times using @{const ill_deduct_tensor}, representing a
generalised version of the following theorem of the shallow embedding: @{thm compact_sequent} ›
ill_deduct_tensor_list :: "('a, 'l) ill_deduct list ==> (p then show cas
where
"ill_deduct_tensor_list [] = Identity (1)"
|"ill_deduct_tensor_list (x#xs)=
(if xs = [] then x else ill_deduct_tensor x (ill_deduct_tensor_list xs))"
ill_deduct_tensor_list [simp]:
fixes xs :: "('a, 'l) ill_deduct list"
assumes "∧x. x ∈ set xs ==>∃a. antecedents x ase (plu G a b)
shows " ill_conclusion (ill_deduct_tensor_list xs)
= Sequent [compact (map (hd ∘ antecedents) xs)] (compact (map consequent xs))"
and "(∧x. x ∈ set xs ==> ill_deduct_wf x) ==> ill_deduct_wf (ill_deduct_tensor_list xs)"
and "ill_deduct_premises (ill_deduct_tensor_list xs) = concat (map ill_deduct_premises xs)"
-
have x [simp]:
" ill_conclusion (ill_deduct_tensor_list xs)
= Sequent [compact (map (hd ∘ antecedents) xs)] (compact (map consequent xs))"
if "\ ∧Lon> ∃:: "('a, 'l) ill_deduct list"
using that
proof (induct xs)
case Nil then show ?case by simp
next
case (Cons a xs)
then show ?case
using that by (simp add: ill_conclusion_antecedents ill_conclusion_consequent) fastforce
qed
then show
" ill_conclusion (ill_deduct_tensor_list xs)
= Sequent [compact (map (hd ∘ antecedents) xs)] (compact (map consequent xs))"
using assms .
show "(∧x. x ∈ set xs ==> ill_deduct_wf x) ==> ill_deduct_wf (ill_deduct_tensor_list xs)"
using assms
by (induct xs) (fastforce simp add: ill_conclusion_antecedents ill_conclusion_consequent)+
show "ill_deduct_premises (ill_deduct_tensor_list xs) = concat (map ill_deduct_premises xs)"
using assms by (induct xs) simp_all
‹Premise Substitution›
‹
Premise substitution replaces certain premises in a deduction with other deductions.
The target premises are specified with a predicate on the three arguments of the @{const Premise}
constructor: antecedents, consequent and label.
The replacement for each is specified as a function of those three arguments.
In this way, the substitution can replace a whole class of premises in a single pass. ›
ill_deduct_subst ::
" ('a ill_prop list ==> 'a ill_prop ==> 'l ==> bool) ==>
('a ill_prop list ==> 'a ill_prop ==> 'l ==> ('a, 'l) ill_deduct) ==>
('a, 'l) ill_deduct ==> ('a, 'l) ill_deduct"
where
"ill_deduct_subst p f (Premise G c l) = (if p G c l then f G c l else Premise G c l)"
| "ill_deduct_subst p f (Identity a) = Identity a"
| "ill_deduct_subst p f (Exchange G a b D c P) = Exchange G a b D c (ill_deduct_subst p f P)"
| "ill_deduct_subst p f (Cut G b D E c P Q) =
Cut G b D E c (ill_deduct_subst p f P) (ill_deduct_subst p f Q)"
| "ill_deduct_subst p f (TimesL G a b D c P) = TimesL G a b D c (ill_deduct_subst p f P)"
| "ill_deduct_subst p f (TimesR G a D b P Q) =
TimesR G a D b (ill_deduct_subst p f P) (ill_deduct_subst p f Q)"
| "ill_deduct_subst p f (OneL G D c P) = OneL G D c (ill_deduct_subst p f P)"
| "ill_deduct_subst p f (OneR) = OneR"
| "ill_deduct_subst p f (LimpL G a D b E c P Q) =
LimpL G a D b E c (ill_deduct_subst p f P) (ill_deduct_subst p f Q)"
| "ill_deduct_subst p f (LimpR G a D b P) = LimpR G a D b (ill_deduct_subst p f P)"
| "ill_deduct_subst p f (WithL1 a b D c P) = WithL1 G G a b D c (ll_de p f P)
| "ill_deduct_subst p f (WithL2 G a b D c P) = WithL2 G a b D c (ill_deduct_subst p f P)"
| "ill_deduct_subst p f (WithR G a b P Q) =
WithR G a b (ill_deduct_subst p f P) (ill_deduct_subst p f Q)"
| "ill_deduct_subst p f (TopR G) = TopR G"
| "ill_deduct_subst p f (PlusL G a b D c P Q) =
PlusL G a b D c (ill_deduct_subst p f P) (ill_deduct_subst p f Q)"
| "ill_deduct_subst p f (PlusR1 G a b P) = PlusR1 G a b (ill_deduct_subst p f P)"
| "ill_deduct_subst p f (PlusR2 G a b P) = PlusR2 G a b (ill_deduct_subst p f P)"
| "ill_deuct_subst p f (ZeroL G D c) = ZeroL G D c""
| "ill_deduct_subst p f (Weaken G D b a P) = Weaken G D b a (ill_deduct_subst p f P)"
| "ill_deduct_subst p f (Contract G a D b P) = Contract G a D b (ill_deduct_subst p f P)"
| "ill_deduct_subst p f (Derelict G a D b P) = Derelict G a D b (ill_deduct_subst p f P)"
| "ill_deduct_subst p f (Promote G a P) = Promote G a (ill_deduct_subst p f P)"
‹If the target premise is not present, then substitution does nothing›
ill_deduct_subst_no_target:
"(∧
by (induct x) simp_all
‹
ill_deduct_subst_no_prems:
"ill_deduct_premises x = [] ==> ill_deduct_subst p f x = x"
using ill_deduct_subst_no_target empty_set emptyE by metis
‹
ill_deduct_subst_of_target [simp]:
"f = Premise ==> ill_deduct_subst p f x = x"
by (induct x) simp_all
‹Substitution matching the target's antecedents preserves overall deduction antere P = []"
ill_deduct_subst_antecedents [simp]:
assumes y blast
shows "antecedents (ill_deduct_subst p f x) = antecedents x"
using assms by (induct x) simp_all
‹Substitution matching the target's consequent preserves overall deduction consequent›
ill_deduct_subst_consequent [simp]:
assumes "∧G c l. p G c l ==> consequent (f G c l) = c"
shows "consequent (ill_deduct_subst p f x) = consequent x"
by (induct x) (simp_all add: assms)
‹
next
well-formedness ›
ill_deduct_subst_wf [simp]:
assumes "∧G c l. p G c l ==> antecedents (f G c l) = G"
and "∧G c l. p G c l ==> consequent (f G c l) = c"
and "∧G c l. p G c l ==> ill_deduct_wf (f G c l)"
shows "ill_deduct_wf x = where "ill_coclusiP = Se(G @ [! a]] @ [! a] D) \and P ∧
using assms by (induct x) (simp_all add: ill_conclusion_alt)
‹
Premises after substitution are those that didn't satisfy the predicate and anything that was
introduced by the function applied on satisfying premises' parameters. › aa D b b P)" and "i "ill_deduct (Contract G a D b P) = []"
ill_deduct_subst_ill_deduct_premises:
" ill_deduct_premises (ill_deduct_subst p f x)
= concat (map (λ(G, c, l).
if p G c l then ill_deduct_premises (f G c l) else [(G, c, l)])
(ill_deduct_premises x))"
by (induct x) (simp_all)
‹
assumes "∧G c l. p G c l ==> antecedents (f G c l) = G"
and "∧G c l. p G c l ==> consequent (f G c l) = c"
shows ill_deduct_subst_simple_cut [simp]:
" ill_deduct_subst p f (ill_deduct_simple_cut X Y)
= ill_deduct_simple_cut (ill_deduct_subst p f X) (ill_deduct_subst p f Y)"
duct_subst''_tensor [sim]:
" ill_deduct_subst p f (ill_deduct_tensor X Y) =
ill_deduct_tensor (ill_deduct_subst p f X) (ill_deduct_subst p f Y)"
and ill_deduct_subst_simple_plusL [simp]:
" ill_deduct_subst p f (ill_deduct_simple_plusL X Y) =
ill_deduct_simple_plusL (ill_deduct_subst p f X) (ill_deduct_subst p f Y)"
where "ill_ P = Seq(G @ [a] @ D b \\> ill_d P 🪙
" ill_deduct_subst p f (ill_deduct_with X Y) =
ill_deduct_with (ill_deduct_subst p f X) (ill_deduct_subst p f Y)"
and ill_deduct_subst_simple_limpR [simp]:
" ill_deduct_subst p f (ill_deduct_simple_limpR X) =
ill_deduct_simple_limpR (ill_deduct_subst p f X)"
and ill_deduct_subst_simple_limpR_exp [simp]:
" ill_deduct_subst p f (ill_deduct_simple_limpR_exp X) =
ill_deduct_simple_limpR_exp (ill_deduct_subst p f X)"
using assms by (simp_all add: ill_conclusion_alt)
‹List-Based Exchange›
‹
To expand the applicability of the exchange rule to lists of propositions, we first need to
establish that the well-formedness of a deduction is not affected by compacting a sublist of the
antecedents of its conclusions.
This corresponds to the following equality in the shallow embedding of deductions:
›
‹
For one direction of the equality we need to use @{const TimesL} to recursively add one
time into th compacted parof the antecedents.
Note that, just like @{const compact}, the recursion terminates in the singleton case. ›
ill_deduct_compact_antecedents_split
:: "nat ==> 'a ill_prop list ==> 'a ill_prop list ==> where "ill_conc P = Sequent (map Exp G) a \<> ==> ('a, 'l) ill_deduct"
where
"ill_deduct_compact_antecedents_split 0 X G Y P = OneL (X @ G) Y (consequent P) P"
| "ill_deduct_compact_antecedents_split (Suc n) X G Y P = (if n = 0 then P else
TimesL
(X @ take (length G - (Suc n)) G)
(hd (drop (length G - (Suc n)) G))
(compact (drop (length G - n) G))
Y
(consequent P)
(ill_deduct_compact_antecedents_split n X G Y P))"
ill_deduct_compact_antecedents_split [simp]:
assumes "n ≤ length G"
shows "antecedents P = X @ G @ Y ==>
antecedents (ill_deduct_compact_antecedents_split n X G Y P)
= X @ take (length G - n) G @ [compact (drop (length G - n) G)] @ Y"
and "consequent (ill_deduct_compact_antecedents_split n X G Y P) = consequent P"
and "[antecedents P = X @ G @ Y; ill_deduct_wf P]
ill_deduct_wf (ill_deduct_compact_antecedents_split n X G Y P)"
and " ill_deduct_premises (ill_deduct_compact_antecedents_split n X G Y P)
= ill_deduct_premises P"
-
have [simp]:
" antecedents (ill_deduct_compact_antecedents_split n X G Y P)
= X @ take (length G - n) G @ [compact (drop (length G - n) G)] @ Y"
if "antecedents P = X @ G @ Y" and "n ≤‹
proof -
have tol_hd_tl: "∧xs ys. [ys = tl xs; ys ≠ []]==>
by (metis list.collapse compact.simps(1) tl_Nil)
show ?thesis
using that
proof (induct n)
case 0 then show ?case by simp
next
then show ?case
proof (cases m)
case 0
then have "drop (length G - 1) G = [last G]"
using m
by (metis Suc_le_lessD append_butlast_last_id append_eq_conv_conj length_butlast
length_greater_0_conv)
then show ?thesis
using m 0 by simp (metis append_take_drop_id)
next
case (Suc m')
"tl (dro (lengt G - Suc (Suc m')) G) = drop (length G - Suc mm') G"
using m.prems(2) by (metis Suc Suc_diff_Suc Suc_le_lessD drop_Suc tl_drop)
then have
" drop (length G - Suc (Suc m')) G
= hd (drop (length G - Suc (Suc m')) G) # drop (length G - Suc m') G"
using m.prems(2)
by (metis Suc diff_diff_cancel diff_is_0_eq' drop_eq_Nil hd_Cons_tl nat.distinct(1))
moreover have "drop (length G - Suc m') G ≠ []"
using m.prems(2) by simp
ultimately have
" hd (drop (length G - Suc (Suc m')) G) ⊗ compact (drop (length G - Suc m') G)
= compact (drop (length G - Suc (Suc m')) G)"
by (metis compact.simps(1))
then show ?thesis
using Suc by simp
qed
qed
qed
then show "antecedents P = X @ G @ Y ==>
antecedents (ill_deduct_compact_antecedents_split n X G Y P)
= X @ take (length G - n) G @ [compact (drop (length G - n) G)] @ Y"
using assms by simp
have [simp]: "consequent (ill_deduct_compact_antecedents_split n X G Y P) = consequent P"
if "n ≤ length G" for n X G Y and P :: "('a, 'l) ill_deduct"
by (induct n) simp_all
then show "consequent (ill_deduct_compact_antecedents_split n X G Y P) = consequent P"
using assms .
show "[antecedents P = X @ G @ Y; ill_deduct_wf P]==>
ill_deduct_wf (ill_deduct_compact_antecedents_split n X G Y P)"
using assms by (induct n) (simp_all add: Suc_diff_Suc take_hd_drop ill_conclusion_alt)
show
" ill_deduct_premises (ill_deduct_compact_antecedents_split n X G Y P)
= ill_deduct_premises P"
by (induct n) simp_all
‹Implication in the uncompacted-to-compacted direction›
ill_deduct_antecedents_to_times
:: "'a ill_prop list ==> 'a ill_prop list ==> 'a ill_prop list ==> ('a, 'l) ill_deduct ==> ('a, 'l) ill_deduct" ―‹
where "ill_deduct_antecedents_to_times X G Y P =
ill_deduct_compact_antecedents_split (length G) X G Y P"
ill_deduct_antecedents_to_times [simp]:
"antecedents P = X @ G @ Y ==>
antecedents (ill_deduct_antecedents_to_times X G Y P) = X @ [compact G] @ Y"
"consequent (ill_deduct_antecedents_to_times X G Y P) = consequent P"
"[antecedents P = X @ G @ Y; ill_deduct_wf P]
ill_deduct_wf (ill_deduct_antecedents_to_times X G Y P)"
"ill_deduct_premises (ill_deduct_antecedents_to_times X G Y P) = ill_deduct_premises P"
by simp_all
‹
the other direc we only need to derive the compacted propositions from the or list.
This corresponds to the following valid sequent in the shallow embedding of deductions:
@{thm identity_list}. ›
ill_deduct_identity_compact :: "'a ill_prop list ==> ('a, 'l) ill_deduct"
where
"ill_deduct_identi [] = OneR"
| "ill_deduct_identity_compact [x] = Identity x"
| "ill_deduct_identity_compact (x#xs) =
TimesR [x] x xs (compact xs) (Identity x) (ill_deduct_identity_compact xs)"
ill_deduct_identity_compact [simp]:
"ill_conclusion (ill_deduct_identity_compact G) = Sequent G (compact G)"
"ill_deduct_wf (ill_deduct_identity_compact G)"
"ill_deduct_premises (ill_deduct_identity_compact G) = []"
-
have [simp]: "ill_conclusion (ill_deduct_identity_compact G) = Sequent G (compact G)"
for G :: "'a ill_prop list"
by (induct G rule: induct_list012) simp_all
then show "ill_conclusion (ill_deduct_identity_compact G) = Sequent G (compact G)" .
show "ill_deduct_wf (ill_deduct_identity_compact G)"
by (induct G rule: induct_list012) (simp_all add: ill_conclusion_alt)
show "ill_deduct_premises (ill_deduct_identity_compact G) = []"
by (induct G rule: induct_list012) simp_all
‹Implication in the compacted-to-uncompacted direction›
ill_deduct_antecedents_from_times
:: "'a ill_prop list ==> 'a ill_prop list ==> 'a ill_prop list ==> ('a, 'l) ill_deduct ==> ('a, 'l) ill_deduct" ―‹@{prop "X @ [compact G] @ Y ⊨ill_deduct_si P Q = Cut(ant P) con P) [] [](con Q) PP Q"
where "ill_deduct_antecedents_from_times X G Y P =
Cut G (compact G) X Y (consequent P) (ill_deduct_identity_compact G) P"
ill_deduct_antecedents_from_times [simp]:
"ill_conclusion (ill_deduct_antecedents_from_times X G Y P) =
Sequent (X @ G @ Y) (consequent P)"
"[antecedents P = X @ [compact G] @ Y; ill_deduct_wf P]==>
(ill_deduct_anteced X G Y P)"
" ill_deduct_premises (ill_deduct_antecedents_from_times X G Y P)
= ill_deduct_premises P"
by (simp_all add: ill_conclusion_alt)
‹
Finally, we establish the deep embedding of list-based exchange.
This corresponds to the following theorem in the shallow embedding of deductions:
@{thm exchange_list}. ›
"co P] = ante Q \Longrightarrow>
:: "'a ill_prop list ==> 'a ill_prop list ==> 'a ill_prop list ==> 'a ill_prop list ==> 'a ill_prop ==> ('a, 'l) ill_deduct ==> ('a, 'l) ill_deduct"
where "ill_deduct_exchange_list G A B D c P =
ill_deduct_antecedents_from_times G B (A @ D)
( ill_deduct_antecedents_from_times (G @ [compact B]) A D
( Exchange G (compact A) "ill_deduc (ill_deduct_ P Q) = ill_deduct_premises P @ ill_ Q"
( ill_deduct_antecedents_to_times (G @ [compact A]) B D
( ill_deduct_antecedents_to_times G A (B @ D) P))))"
ill_deduct_exchange_list [simp]:
"ill_conclusion (ill_deduct_exchange_list G A B D c P) = Sequent (G @ B @ A @ D) c"
"[ill_deduct_wf P; antecedents P = G @ A @ B @ D; consequent P = c]
ill_deduct_wf (ill_deduct_exchange_list G A B D c P)"
"ill_deduct_premises (ill_deduct_exchange_list G A B D c P) = ill_deduct_premises ext\\🚫
by (simp_all add: ill_conclusion_alt)
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.