Documentation

Trestle.Model.PropFun

Propositional Formulas mod Equivalence #

This file defines the type of propositional formulas over a set ν of variables, quotiented by strong equivalence.

We show that they form a Boolean algebra with ordering given by semantic entailment. This allows us to use Mathlib's lattice notation & lemmas.

def Trestle.Model.PropFun (ν : Type u_1) :
Type u_1

A propositional function is a propositional formula up to semantic equivalence.

Equations
Instances For
    theorem Trestle.Model.PropFun.exact {ν : Type u_1} {φ₁ φ₂ : PropForm ν} :
    φ₁ = φ₂φ₁.equivalent φ₂

    Applied backwards, this reduces an equivalence between two syntactic formulas to an equality between the functions they denote.

    theorem Trestle.Model.PropFun.sound {ν : Type u_1} {φ₁ φ₂ : PropForm ν} :
    φ₁.equivalent φ₂φ₁ = φ₂
    def Trestle.Model.PropFun.neg {ν : Type u_1} :
    PropFun νPropFun ν
    Equations
    Instances For
      def Trestle.Model.PropFun.conj {ν : Type u_1} :
      PropFun νPropFun νPropFun ν
      Equations
      Instances For
        def Trestle.Model.PropFun.disj {ν : Type u_1} :
        PropFun νPropFun νPropFun ν
        Equations
        Instances For
          def Trestle.Model.PropFun.impl {ν : Type u_1} :
          PropFun νPropFun νPropFun ν
          Equations
          Instances For
            def Trestle.Model.PropFun.biImpl {ν : Type u_1} :
            PropFun νPropFun νPropFun ν
            Equations
            Instances For

              Evaluation

              def Trestle.Model.PropFun.eval {ν : Type u_1} (τ : PropAssignment ν) :
              PropFun νBool

              The unique extension of τ from variables to propositional functions.

              Equations
              Instances For
                @[simp]
                theorem Trestle.Model.PropFun.eval_mk {ν : Type u_1} (τ : PropAssignment ν) (φ : PropForm ν) :
                @[simp]
                theorem Trestle.Model.PropFun.eval_var {ν : Type u_1} (τ : PropAssignment ν) (x : ν) :
                eval τ (var x) = τ x
                @[simp]
                theorem Trestle.Model.PropFun.eval_tr {ν : Type u_1} (τ : PropAssignment ν) :
                @[simp]
                @[simp]
                theorem Trestle.Model.PropFun.eval_neg {ν : Type u_1} (τ : PropAssignment ν) (φ : PropFun ν) :
                eval τ φ.neg = !eval τ φ
                @[simp]
                theorem Trestle.Model.PropFun.eval_conj {ν : Type u_1} (τ : PropAssignment ν) (φ₁ φ₂ : PropFun ν) :
                eval τ (φ₁.conj φ₂) = (eval τ φ₁ && eval τ φ₂)
                @[simp]
                theorem Trestle.Model.PropFun.eval_disj {ν : Type u_1} (τ : PropAssignment ν) (φ₁ φ₂ : PropFun ν) :
                eval τ (φ₁.disj φ₂) = (eval τ φ₁ || eval τ φ₂)
                @[simp]
                theorem Trestle.Model.PropFun.eval_impl {ν : Type u_1} (τ : PropAssignment ν) (φ₁ φ₂ : PropFun ν) :
                eval τ (φ₁.impl φ₂) = eval τ φ₁ eval τ φ₂
                @[simp]
                theorem Trestle.Model.PropFun.eval_biImpl {ν : Type u_1} (τ : PropAssignment ν) (φ₁ φ₂ : PropFun ν) :
                (eval τ (φ₁.biImpl φ₂) = true) = (eval τ φ₁ = eval τ φ₂)

                Satisfying assignments

                This instance is scoped so that when PropFun is open, τ ⊨ φ implies φ : PropFun _ via the outParam.

                Equations
                Instances For
                  theorem Trestle.Model.PropFun.ext {ν : Type u_1} {φ₁ φ₂ : PropFun ν} :
                  (∀ (τ : PropAssignment ν), τ φ₁ τ φ₂)φ₁ = φ₂
                  theorem Trestle.Model.PropFun.ext_iff {ν : Type u_1} {φ₁ φ₂ : PropFun ν} :
                  φ₁ = φ₂ ∀ (τ : PropAssignment ν), τ φ₁ τ φ₂

                  Semantic entailment

                  def Trestle.Model.PropFun.entails {ν : Type u_1} (φ₁ φ₂ : PropFun ν) :
                  Equations
                  Instances For
                    @[simp]
                    theorem Trestle.Model.PropFun.entails_mk {ν : Type u_1} {φ₁ φ₂ : PropForm ν} :
                    entails φ₁ φ₂ φ₁.entails φ₂
                    theorem Trestle.Model.PropFun.entails_ext {ν : Type u_1} {φ₁ φ₂ : PropFun ν} :
                    φ₁.entails φ₂ ∀ (τ : PropAssignment ν), τ φ₁τ φ₂
                    theorem Trestle.Model.PropFun.entails_refl {ν : Type u_1} (φ : PropFun ν) :
                    φ.entails φ
                    theorem Trestle.Model.PropFun.entails.trans {ν✝ : Type u_1} {φ₁ φ₂ φ₃ : PropFun ν✝} :
                    φ₁.entails φ₂φ₂.entails φ₃φ₁.entails φ₃
                    theorem Trestle.Model.PropFun.entails.antisymm {ν✝ : Type u_1} {φ ψ : PropFun ν✝} :
                    φ.entails ψψ.entails φφ = ψ
                    theorem Trestle.Model.PropFun.entails_disj_left {ν : Type u_1} (φ₁ φ₂ : PropFun ν) :
                    φ₁.entails (φ₁.disj φ₂)
                    theorem Trestle.Model.PropFun.entails_disj_right {ν : Type u_1} (φ₁ φ₂ : PropFun ν) :
                    φ₂.entails (φ₁.disj φ₂)
                    theorem Trestle.Model.PropFun.disj_entails {ν✝ : Type u_1} {φ₁ φ₃ φ₂ : PropFun ν✝} :
                    φ₁.entails φ₃φ₂.entails φ₃(φ₁.disj φ₂).entails φ₃
                    theorem Trestle.Model.PropFun.conj_entails_left {ν : Type u_1} (φ₁ φ₂ : PropFun ν) :
                    (φ₁.conj φ₂).entails φ₁
                    theorem Trestle.Model.PropFun.conj_entails_right {ν : Type u_1} (φ₁ φ₂ : PropFun ν) :
                    (φ₁.conj φ₂).entails φ₂
                    theorem Trestle.Model.PropFun.entails_conj {ν✝ : Type u_1} {φ₁ φ₂ φ₃ : PropFun ν✝} :
                    φ₁.entails φ₂φ₁.entails φ₃φ₁.entails (φ₂.conj φ₃)
                    theorem Trestle.Model.PropFun.entails_disj_conj {ν : Type u_1} (φ₁ φ₂ φ₃ : PropFun ν) :
                    ((φ₁.disj φ₂).conj (φ₁.disj φ₃)).entails (φ₁.disj (φ₂.conj φ₃))
                    theorem Trestle.Model.PropFun.impl_eq {ν : Type u_1} (φ ψ : PropFun ν) :
                    φ.impl ψ = ψ.disj φ.neg
                    theorem Trestle.Model.PropFun.biImpl_eq {ν : Type u_1} (φ ψ : PropFun ν) :
                    φ.biImpl ψ = (φ.impl ψ).conj (ψ.impl φ)

                    From this point onwards we use lattice notation for PropFuns in order to get the mathlib laws for free.

                    Equations
                    • One or more equations did not get rendered due to their size.
                    @[simp]
                    theorem Trestle.Model.PropFun.eval_neg' {ν : Type u_1} (τ : PropAssignment ν) (φ : PropFun ν) :
                    eval τ φ = !eval τ φ
                    @[simp]
                    theorem Trestle.Model.PropFun.eval_conj' {ν : Type u_1} (τ : PropAssignment ν) (φ₁ φ₂ : PropFun ν) :
                    eval τ (φ₁φ₂) = (eval τ φ₁ && eval τ φ₂)
                    @[simp]
                    theorem Trestle.Model.PropFun.eval_disj' {ν : Type u_1} (τ : PropAssignment ν) (φ₁ φ₂ : PropFun ν) :
                    eval τ (φ₁φ₂) = (eval τ φ₁ || eval τ φ₂)
                    @[simp]
                    theorem Trestle.Model.PropFun.eval_impl' {ν : Type u_1} (τ : PropAssignment ν) (φ₁ φ₂ : PropFun ν) :
                    eval τ (φ₁ φ₂) = eval τ φ₁ eval τ φ₂
                    @[simp]
                    theorem Trestle.Model.PropFun.eval_biImpl' {ν : Type u_1} (τ : PropAssignment ν) (φ₁ φ₂ : PropFun ν) :
                    (eval τ ((fun (φ₁ φ₂ : PropFun ν) => (φ₁ φ₂) ⊓ (φ₂ φ₁)) φ₁ φ₂) = true) = (eval τ φ₁ = eval τ φ₂)
                    @[simp]
                    theorem Trestle.Model.PropFun.satisfies_mk {ν : Type u_1} {τ : PropAssignment ν} {φ : PropForm ν} :
                    τ φ τ φ
                    @[simp]
                    theorem Trestle.Model.PropFun.satisfies_var {ν : Type u_1} {τ : PropAssignment ν} {x : ν} :
                    τ var x τ x = true
                    @[simp]
                    theorem Trestle.Model.PropFun.satisfies_set {ν : Type u_1} {x : ν} {τ : PropAssignment ν} [DecidableEq ν] :
                    τ.set x var x
                    @[simp]
                    @[simp]
                    theorem Trestle.Model.PropFun.not_satisfies_fls {ν : Type u_1} {τ : PropAssignment ν} :
                    (fun (M : PropAssignment ν) (φ : PropFun ν) => ¬M φ) τ
                    @[simp]
                    theorem Trestle.Model.PropFun.satisfies_neg {ν : Type u_1} {φ : PropFun ν} {τ : PropAssignment ν} :
                    τ φ (fun (M : PropAssignment ν) (φ : PropFun ν) => ¬M φ) τ φ
                    @[simp]
                    theorem Trestle.Model.PropFun.satisfies_conj {ν : Type u_1} {φ₁ φ₂ : PropFun ν} {τ : PropAssignment ν} :
                    τ φ₁φ₂ τ φ₁ τ φ₂
                    @[simp]
                    theorem Trestle.Model.PropFun.satisfies_disj {ν : Type u_1} {φ₁ φ₂ : PropFun ν} {τ : PropAssignment ν} :
                    τ φ₁φ₂ τ φ₁ τ φ₂
                    @[simp]
                    theorem Trestle.Model.PropFun.satisfies_impl {ν : Type u_1} {φ₁ φ₂ : PropFun ν} {τ : PropAssignment ν} :
                    τ φ₁ φ₂ τ φ₁τ φ₂
                    theorem Trestle.Model.PropFun.satisfies_impl' {ν : Type u_1} {φ₁ φ₂ : PropFun ν} {τ : PropAssignment ν} :
                    τ φ₁ φ₂ (fun (M : PropAssignment ν) (φ : PropFun ν) => ¬M φ) τ φ₁ τ φ₂
                    @[simp]
                    theorem Trestle.Model.PropFun.satisfies_biImpl {ν : Type u_1} {φ₁ φ₂ : PropFun ν} {τ : PropAssignment ν} :
                    τ (fun (φ₁ φ₂ : PropFun ν) => (φ₁ φ₂) ⊓ (φ₂ φ₁)) φ₁ φ₂ (τ φ₁ τ φ₂)
                    theorem Trestle.Model.PropFun.eq_top_iff {ν : Type u_1} {φ : PropFun ν} :
                    φ = ∀ (τ : PropAssignment ν), τ φ
                    theorem Trestle.Model.PropFun.eq_bot_iff {ν : Type u_1} {φ : PropFun ν} :
                    φ = ∀ (τ : PropAssignment ν), (fun (M : PropAssignment ν) (φ : PropFun ν) => ¬M φ) τ φ
                    @[simp]
                    theorem Trestle.Model.PropFun.var_ne_bot {ν : Type u_1} (v : ν) :
                    @[simp]
                    theorem Trestle.Model.PropFun.var_ne_top {ν : Type u_1} (v : ν) :
                    @[simp]
                    theorem Trestle.Model.PropFun.bot_ne_var {ν : Type u_1} (v : ν) :
                    @[simp]
                    theorem Trestle.Model.PropFun.top_ne_var {ν : Type u_1} (v : ν) :
                    @[simp]
                    theorem Trestle.Model.PropFun.biImpl_top_left {ν : Type u_1} (φ : PropFun ν) :
                    (fun (φ₁ φ₂ : PropFun ν) => (φ₁ φ₂) ⊓ (φ₂ φ₁)) φ = φ
                    @[simp]
                    theorem Trestle.Model.PropFun.biImpl_top_right {ν : Type u_1} (φ : PropFun ν) :
                    (fun (φ₁ φ₂ : PropFun ν) => (φ₁ φ₂) ⊓ (φ₂ φ₁)) φ = φ
                    @[simp]
                    theorem Trestle.Model.PropFun.biImpl_bot_left {ν : Type u_1} (φ : PropFun ν) :
                    (fun (φ₁ φ₂ : PropFun ν) => (φ₁ φ₂) ⊓ (φ₂ φ₁)) φ = φ
                    @[simp]
                    theorem Trestle.Model.PropFun.biImpl_bot_right {ν : Type u_1} (φ : PropFun ν) :
                    (fun (φ₁ φ₂ : PropFun ν) => (φ₁ φ₂) ⊓ (φ₂ φ₁)) φ = φ
                    theorem Trestle.Model.PropFun.inf_le_iff_compl_sup {ν : Type u_1} {φ₁ φ₂ φ₃ : PropFun ν} :
                    φ₁φ₂ φ₃ φ₁ φ₂φ₃
                    theorem Trestle.Model.PropFun.le_iff_inf_compl_le_bot {ν : Type u_1} {φ₁ φ₂ : PropFun ν} :
                    φ₁ φ₂ φ₁φ₂
                    theorem Trestle.Model.PropFun.le_iff_inf_compl_eq_bot {ν : Type u_1} {φ₁ φ₂ : PropFun ν} :
                    φ₁ φ₂ φ₁φ₂ =
                    theorem Trestle.Model.PropFun.ne_top_left_of_disj_ne_top {ν : Type u_1} {φ₁ φ₂ : PropFun ν} :
                    φ₁φ₂ φ₁
                    theorem Trestle.Model.PropFun.ne_top_right_of_disj_ne_top {ν : Type u_1} {φ₁ φ₂ : PropFun ν} :
                    φ₁φ₂ φ₂
                    theorem Trestle.Model.PropFun.ne_top_of_disj_ne_top {ν : Type u_1} {φ₁ φ₂ : PropFun ν} :
                    φ₁φ₂ φ₁ φ₂
                    @[simp]
                    theorem Trestle.Model.PropFun.var_eq_var_iff {ν : Type u_1} [DecidableEq ν] (v v' : ν) :
                    var v = var v' v = v'
                    theorem Trestle.Model.PropFun.eq_compl_iff_neq {ν : Type u_1} {φ₁ φ₂ : PropFun ν} :
                    φ₁ = φ₂φ₁ φ₂
                    @[simp]
                    theorem Trestle.Model.PropFun.var_ne_var_compl {ν : Type u_1} [DecidableEq ν] (v1 v2 : ν) :
                    var v1 (var v2)
                    @[simp]
                    theorem Trestle.Model.PropFun.var_compl_ne_var {ν : Type u_1} [DecidableEq ν] (v1 v2 : ν) :
                    (var v1) var v2
                    theorem Trestle.Model.PropFun.compl_eq_iff_eq_compl {ν : Type u_1} {φ₁ φ₂ : PropFun ν} :
                    φ₁ = φ₂ φ₁ = φ₂
                    theorem Trestle.Model.PropFun.eq_compl_iff_compl_eq {ν : Type u_1} {φ₁ φ₂ : PropFun ν} :
                    φ₁ = φ₂ φ₁ = φ₂

                    Lemmas to push Quotient.mk inwards.

                    @[simp]
                    theorem Trestle.Model.PropFun.mk_var {ν : Type u_1} (x : ν) :
                    @[simp]
                    theorem Trestle.Model.PropFun.mk_neg {ν : Type u_1} (φ : PropForm ν) :
                    @[simp]
                    theorem Trestle.Model.PropFun.mk_conj {ν : Type u_1} (φ₁ φ₂ : PropForm ν) :
                    φ₁.conj φ₂ = φ₁φ₂
                    @[simp]
                    theorem Trestle.Model.PropFun.mk_disj {ν : Type u_1} (φ₁ φ₂ : PropForm ν) :
                    φ₁.disj φ₂ = φ₁φ₂
                    @[simp]
                    theorem Trestle.Model.PropFun.mk_impl {ν : Type u_1} (φ₁ φ₂ : PropForm ν) :
                    φ₁.impl φ₂ = φ₁ φ₂
                    @[simp]
                    theorem Trestle.Model.PropFun.mk_biImpl {ν : Type u_1} (φ₁ φ₂ : PropForm ν) :
                    φ₁.biImpl φ₂ = (fun (φ₁ φ₂ : PropFun ν) => (φ₁ φ₂) ⊓ (φ₂ φ₁)) φ₁ φ₂

                    All/any #

                    def Trestle.Model.PropFun.all {ν : Type u_1} (a : Multiset (PropFun ν)) :
                    Equations
                    Instances For
                      def Trestle.Model.PropFun.any {ν : Type u_1} (a : Multiset (PropFun ν)) :
                      Equations
                      Instances For
                        @[simp]
                        theorem Trestle.Model.PropFun.satisfies_all {ν : Type u_1} {a : Multiset (PropFun ν)} {τ : PropAssignment ν} :
                        τ all a ia, τ i
                        @[simp]
                        theorem Trestle.Model.PropFun.satisfies_any {ν : Type u_1} {a : Multiset (PropFun ν)} {τ : PropAssignment ν} :
                        τ any a ia, τ i
                        @[simp]
                        @[simp]

                        Satisfiable and Equisatisfiable #

                        def Trestle.Model.PropFun.Sat {ν : Type u_1} (φ : PropFun ν) :
                        Equations
                        Instances For
                          def Trestle.Model.PropFun.EquiSat {ν : Type u_1} (φ₁ φ₂ : PropFun ν) :
                          Equations
                          Instances For
                            def Trestle.Model.PropFun.EquiSat.symm {ν : Type u_1} {φ₁ φ₂ : PropFun ν} :
                            φ₁.EquiSat φ₂ φ₂.EquiSat φ₁
                            Equations
                            • =
                            Instances For
                              def Trestle.Model.PropFun.EquiSat.trans {ν : Type u_1} {φ₁ φ₂ φ₃ : PropFun ν} :
                              φ₁.EquiSat φ₂φ₂.EquiSat φ₃φ₁.EquiSat φ₃
                              Equations
                              • =
                              Instances For
                                @[simp]
                                @[simp]
                                theorem Trestle.Model.PropFun.eq_bot_of_equisat {ν : Type u_1} {F C : PropFun ν} :
                                F.EquiSat (FC)FC = F =
                                theorem Trestle.Model.PropFun.equisat_of_entails {ν : Type u_1} {F C : PropFun ν} :
                                F CF.EquiSat (FC)
                                Equations
                                • One or more equations did not get rendered due to their size.
                                Instances For
                                  Equations
                                  • One or more equations did not get rendered due to their size.
                                  Instances For
                                    Equations
                                    • One or more equations did not get rendered due to their size.
                                    Instances For
                                      Equations
                                      • One or more equations did not get rendered due to their size.
                                      Instances For
                                        Equations
                                        • One or more equations did not get rendered due to their size.
                                        Instances For
                                          Equations
                                          • One or more equations did not get rendered due to their size.
                                          Instances For
                                            Equations
                                            • One or more equations did not get rendered due to their size.
                                            Instances For
                                              Equations
                                              • One or more equations did not get rendered due to their size.
                                              Instances For
                                                Equations
                                                • One or more equations did not get rendered due to their size.
                                                Instances For