Theory MSOinHOL_experiments

theory MSOinHOL_experiments
  imports
    MSOinHOL_deep
    MSOinHOL_shallow
    MSOinHOL_shallow_minimal
begin

abbreviation "(x::V)  1"
abbreviation "(y::V)  2"
abbreviation "(z::V)  3"
abbreviation "(X::V2)  1"
abbreviation "(Y::V2)  2"

consts P :: R

subsubsection ‹Propositional tautologies, lifted to MSO in all three embeddings›

lemma "d (Pd(x,x) d Pd(x,x))"
  unfolding DefD by simp

lemma "s (Ps(x,x) s Ps(x,x))"
  unfolding DefS by simp

lemma "m (Pm(x,x) m Pm(x,x))"
  unfolding DefM by simp

lemma "d (¬d¬d Pd(x,y)) d Pd(x,y)"
  unfolding DefD by auto

lemma "s (¬s¬s Ps(x,y)) s Ps(x,y)"
  unfolding DefS by auto

lemma "m (¬m¬m Pm(x,y)) m Pm(x,y)"
  unfolding DefM by auto

subsubsection ‹First-order tautologies›

text ‹The individual domain is inhabited whenever some assignment exists.›

lemma "d (dx. Pd(x,x)) d (dx. Pd(x,x))"
  unfolding DefD by auto

lemma "s (sx. Ps(x,x)) s (sx. Ps(x,x))"
  unfolding DefS by auto

lemma "m (mx. Pm(x,x)) m (mx. Pm(x,x))"
  unfolding DefM by auto

subsubsection ‹Membership tautology›

text ‹Every individual that is in X› is in X›.›

lemma "d (dx. (Xd(x) d Xd(x)))"
  unfolding DefD by auto

lemma "s (sx. (Xs(x) s Xs(x)))"
  unfolding DefS by auto

lemma "m (mx. (Xm(x) m Xm(x)))"
  unfolding DefM by auto

subsubsection ‹Monadic comprehension›

text ‹Headline second-order validity: the set of P›-self-related
  individuals exists.  Stated over the full second-order domain, where
  every monadic set is admissible.›

lemma comprehension_d:
  "d' (d2X. dx. ((Xd(x)) d Pd(x,x)))"
  unfolding DefD by (intro allI; simp) meson

lemma comprehension_s:
  "s' (s2X. sx. ((Xs(x)) s Ps(x,x)))"
  unfolding DefS by (intro allI; simp) meson

text ‹A universal monadic set exists over the full domain (the predicate
  that holds everywhere).›

lemma "d' (d2X. dx. (Xd(x)))"
  unfolding DefD by (simp, rule exI[where x="λd. True"]) simp

subsubsection ‹Invalid schemata›

text nitpick› reports finite countermodels (using the full-domain
  relation).›

text ‹Not every monadic set is inhabited: the empty set is a countermodel
  to ∀X. ∃x. x ∈ X›.›

lemma "d' (d2X. dx. (Xd(x)))"
  unfolding DefD apply simp nitpick oops

text ‹Symmetry of P› is not implied: nitpick› produces a 2-element
  countermodel.›

lemma "d' (dx. dy. (Pd(x,y) d Pd(y,x)))"
  unfolding DefD apply simp nitpick oops

text ‹No monadic set can contain and exclude every individual at once:
  ∃X. ∀x. x∈X ∧ ¬x∈X› is unsatisfiable, hence invalid.›

lemma "d' (d2X. dx. ((Xd(x)) d ¬d(Xd(x))))"
  unfolding DefD apply simp nitpick oops

end