Theory HOMLinHOL

section‹Mechanization of higher-order modal logic (HOML)›
subsection‹HOMLinHOL.thy (Figure 3 of \cite{J75})›
text‹Shallow embedding of higher-order modal logic (HOML) in the classical higher-order logic (HOL)
of Isabelle/HOL utilizing the logic-pluralistic LogiKEy methodology. Here logic S5 is introduced.›
theory HOMLinHOL imports Main
begin

―‹Global parameters setting for the model finder nitpick and the parser; unimport for the reader›
 nitpick_params[user_axioms,expect=genuine,show_all,format=2,max_genuine=3]
 declare[[syntax_ambiguity_warning=false]] 

―‹Type i is associated with possible worlds and type e with entities›
typedecl i ―‹Possible worlds› 
typedecl e ―‹Individuals/entities› 
type_synonym σ = "ibool" ―‹World-lifted propositions›
type_synonym τ = "eσ" ―‹Modal properties›

consts R::"iibool" ("_r_") ―‹Accessibility relation between worlds›

axiomatization where
 Rrefl: "x. xrx" and 
 Rsymm: "x y. xry  yrx" and 
 Rtrans: "x y z. xry  yrz  xrz" 

―‹Logical connectives (operating on truth-sets)›
abbreviation Mbot::σ ("") where "  λw. False"
abbreviation Mtop::σ ("") where "  λw. True"
abbreviation Mneg::"σσ" ("¬_" [52]53) where "¬φ  λw. ¬(φ w)"
abbreviation Mand::"σσσ" (infixl "" 50) where "φψ  λw. φ w  ψ w" 
abbreviation Mor::"σσσ" (infixl "" 49) where "φψ  λw. φ w  ψ w "
abbreviation Mimp::"σσσ" (infixr "" 48) where "φψ  λw. φ w  ψ w" 
abbreviation Mequiv::"σσσ" (infixl "" 47) where "φψ  λw. φ w  ψ w"
abbreviation Mbox::"σσ" ("_" [54]55) where "φ  λw.v. w r v  φ v"
abbreviation Mdia::"σσ" ("_" [54]55) where "φ  λw.v. w r v  φ v"
abbreviation Mprimeq::"'a'aσ" ("_=_") where "x=y  λw. x=y"
abbreviation Mprimneg::"'a'aσ" ("__") where "xy  λw. xy"
abbreviation Mnegpred::"ττ" ("~_") where "~Φ  λx.λw. ¬Φ x w"
abbreviation Mconpred::"τττ" (infixl "." 50) where "Φ.Ψ  λx.λw. Φ x w  Ψ x w"
abbreviation Mexclor::"σσσ" (infixl "e" 49) where "φeψ  (φ  ψ)  ¬(φ  ψ)" 

―‹Possibilist quantifiers (polymorphic)›
abbreviation Mallposs::"('aσ)σ" ("") where "Φ  λw.x. Φ x w"
abbreviation Mallpossb (binder "" [8]9) where "x. φ(x)  φ" 
abbreviation Mexiposs::"('aσ)σ" ("") where "Φ  λw.x. Φ x w" 
abbreviation Mexipossb (binder "" [8]9) where "x. φ(x)  φ" 

―‹Actualist quantifiers (for individuals/entities)›
consts existsAt::"eσ" ("_@_") 
abbreviation Mallact::"(eσ)σ" ("E") where "EΦ  λw.x. x@w  Φ x w"
abbreviation Mallactb (binder "E" [8]9) where "Ex. φ(x)  Eφ" 
abbreviation Mexiact::"(eσ)σ" ("E") where "EΦ  λw.x. x@w  Φ x w"
abbreviation Mexiactb (binder "E" [8]9) where "Ex. φ(x)  Eφ"

―‹Leibniz equality (polymorphic)›
abbreviation Mleibeq::"'a'aσ" ("__") where "xy  P. P x  P y"

―‹Meta-logical predicate for global validity›
abbreviation Mvalid::"σbool" ("_") where "ψ  w. ψ w"

end