Documentation

Flypitch.FOL.Theory

Flypitch.FOL.Theory packages closed formulas into theories and records the proof-theoretic and semantic notions attached to them. It also defines consistency, completeness, and the basic operations for working inside a theory rather than an arbitrary set of formulas.

bounded_term_at t n means that every free variable of t is strictly below n.

Equations
Instances For
    theorem Flypitch.fol.bounded_term_at_mono {L : Language} {l : } (t : preterm L l) {n m : } :
    bounded_term_at t nn mbounded_term_at t m

    Increasing the bound preserves boundedness of terms.

    theorem Flypitch.fol.bounded_formula_at_mono {L : Language} {l : } (f : preformula L l) {n m : } :

    Increasing the bound preserves boundedness of formulas.

    theorem Flypitch.fol.bounded_term_at_lift_irrel {L : Language} {l : } (t : preterm L l) (n m : ) :
    bounded_term_at t m → (t ↑' n # m) = t

    Lifting above a bound already respected by a term has no effect.

    Lifting above a bound already respected by a formula has no effect.

    theorem Flypitch.fol.bounded_term_at_subst_irrel {L : Language} {l : } (t : preterm L l) {n : } :
    bounded_term_at t n∀ (s : term L), t[s // n] = t

    Substituting at a variable bound already respected by a term has no effect.

    theorem Flypitch.fol.bounded_formula_at_subst_irrel {L : Language} {l : } (f : preformula L l) {n : } :
    bounded_formula_at f n∀ (s : term L), subst_formula f s n = f

    Substituting at a variable bound already respected by a formula has no effect.

    theorem Flypitch.fol.bounded_term_at_subst_closed {L : Language} {l : } (t : preterm L l) {n : } {s : term L} :

    Substituting a closed term into a term bounded by n + 1 lowers the bound to n.

    Substituting a closed term into a formula bounded by n + 1 lowers the bound to n.

    theorem Flypitch.fol.lift_subst_term_cancel {L : Language} {l : } (t : preterm L l) (n : ) :
    (t ↑' 1 # n + 1)[&0 // n] = t

    Lifting above a bound and then substituting the new variable back in cancels for terms.

    theorem Flypitch.fol.lift_subst_formula_cancel {L : Language} {l : } (f : preformula L l) (n : ) :
    subst_formula (lift_formula_at f 1 (n + 1)) (&0) n = f

    Lifting above a bound and then substituting the new variable back in cancels for formulas.

    Closed formulas, represented as formulas with no free variables.

    Equations
    Instances For
      @[implicit_reducible]
      Equations
      @[implicit_reducible]
      Equations

      Implication of closed formulas.

      Equations
      Instances For

        Negation of a sentence.

        Equations
        Instances For
          @[implicit_reducible]
          Equations

          Conjunction of sentences.

          Equations
          Instances For
            def Flypitch.fol.sentence.or {L : Language} (f₁ f₂ : sentence L) :

            Disjunction of sentences.

            Equations
            Instances For

              Biconditional of sentences.

              Equations
              Instances For

                Universal quantification of a sentence, viewed as opening one bound variable.

                Equations
                Instances For

                  Existential quantification of a sentence.

                  Equations
                  Instances For

                    Lifting a closed formula is definitionally irrelevant.

                    theorem Flypitch.fol.subst_sentence_irrel {L : Language} (f : sentence L) (s : term L) :
                    subst_formula (↑f) s 0 = f

                    Substituting into a closed formula is definitionally irrelevant.

                    structure Flypitch.fol.Theory (L : Language) :
                    Type (u + 1)

                    A theory is a set of closed formulas.

                    Instances For
                      @[implicit_reducible]
                      Equations
                      @[implicit_reducible]
                      Equations
                      @[implicit_reducible]
                      Equations
                      @[implicit_reducible]
                      Equations
                      @[implicit_reducible]
                      Equations

                      Inclusion of theories.

                      Equations
                      Instances For
                        theorem Flypitch.fol.Theory.ext {L : Language} {T T' : Theory L} (h : ∀ (x : sentence L), x T x T') :
                        T = T'
                        theorem Flypitch.fol.Theory.ext_iff {L : Language} {T T' : Theory L} :
                        T = T' ∀ (x : sentence L), x T x T'
                        @[reducible]
                        Equations
                        Instances For
                          theorem Flypitch.fol.Theory.image_subset {L : Language} {T T' : Theory L} (h : T.Subset T') :
                          T.fst T'.fst

                          Inclusion of theories induces inclusion of the underlying sets of formulas.

                          @[simp]
                          theorem Flypitch.fol.Theory.fst_insert {L : Language} (A : sentence L) (T : Theory L) :
                          (insert A T).fst = Set.insert (↑A) T.fst

                          Lifting does nothing on the underlying formulas of a theory of sentences.

                          @[reducible, inline]
                          abbrev Flypitch.fol.sprf {L : Language} (T : Theory L) (f : sentence L) :

                          Proofs from a theory, viewed through its underlying set of formulas.

                          Equations
                          Instances For
                            @[reducible, inline]
                            abbrev Flypitch.fol.sprovable {L : Language} (T : Theory L) (f : sentence L) :

                            Truncated provability from a theory.

                            Equations
                            Instances For
                              def Flypitch.fol.saxm {L : Language} {T : Theory L} {A : sentence L} (h : A T) :
                              T A

                              Any sentence already in the theory is provable from it.

                              Equations
                              Instances For
                                def Flypitch.fol.saxm1 {L : Language} {T : Theory L} {A : sentence L} :
                                insert A T A

                                The newest inserted sentence is provable immediately.

                                Equations
                                Instances For
                                  def Flypitch.fol.saxm2 {L : Language} {T : Theory L} {A B : sentence L} :
                                  insert A (insert B T) B

                                  The second newest inserted sentence is provable immediately.

                                  Equations
                                  Instances For
                                    def Flypitch.fol.simpI {L : Language} {T : Theory L} {A B : sentence L} (h : insert A T B) :
                                    T A B

                                    Implication introduction internal to theories.

                                    Equations
                                    Instances For
                                      theorem Flypitch.fol.simpI' {L : Language} {T : Theory L} {A B : sentence L} (h : insert A T ⊢' B) :
                                      T ⊢' A B

                                      Truncated implication introduction internal to theories.

                                      def Flypitch.fol.simpE {L : Language} {T : Theory L} (A : sentence L) {B : sentence L} (h₁ : T A B) (h₂ : T A) :
                                      T B

                                      Implication elimination internal to theories.

                                      Equations
                                      Instances For
                                        def Flypitch.fol.sfalsumE {L : Language} {T : Theory L} {A : sentence L} (h : insert (A) T ) :
                                        T A

                                        Ex falso internal to theories using an explicit negated assumption.

                                        Equations
                                        Instances For
                                          theorem Flypitch.fol.sfalsumE' {L : Language} {T : Theory L} {A : sentence L} (h : insert (A) T ⊢' ) :
                                          T ⊢' A
                                          noncomputable def Flypitch.fol.sweakening {L : Language} {T T' : Theory L} (hsub : T'.Subset T) {ψ : sentence L} (h : T' ψ) :
                                          T ψ

                                          Weakening of theory proofs along inclusion of theories.

                                          Equations
                                          Instances For
                                            noncomputable def Flypitch.fol.sweakening1 {L : Language} {T : Theory L} {ψ₁ ψ₂ : sentence L} (h : T ψ₂) :
                                            insert ψ₁ T ψ₂

                                            One-step weakening for theory proofs.

                                            Equations
                                            Instances For
                                              noncomputable def Flypitch.fol.sweakening2 {L : Language} {T : Theory L} {ψ₁ ψ₂ ψ₃ : sentence L} (h : insert ψ₁ T ψ₃) :
                                              insert ψ₁ (insert ψ₂ T) ψ₃

                                              Two-step weakening for theory proofs.

                                              Equations
                                              Instances For
                                                theorem Flypitch.fol.simpE' {L : Language} {T : Theory L} (A : sentence L) {B : sentence L} (h₁ : T ⊢' A B) (h₂ : T ⊢' A) :
                                                T ⊢' B

                                                Truncated implication elimination internal to theories.

                                                theorem Flypitch.fol.snot_and_self'' {L : Language} {T : Theory L} {A : sentence L} (h₁ : T ⊢' A) (h₂ : T ⊢' A) :

                                                A sentence and its negation yield falsum.

                                                theorem Flypitch.fol.sprf_by_cases {L : Language} {Γ : Theory L} (f₁ : sentence L) {f₂ : sentence L} (h₁ : insert f₁ Γ ⊢' f₂) (h₂ : insert (f₁) Γ ⊢' f₂) :
                                                Γ ⊢' f₂

                                                Proof by cases inside a theory.

                                                def Flypitch.fol.sprovable_of_provable {L : Language} {T : Theory L} {f : sentence L} (h : T.fst f) :
                                                T f

                                                Reinterpret a formula-level proof as a sentence-level proof.

                                                Equations
                                                Instances For
                                                  def Flypitch.fol.provable_of_sprovable {L : Language} {T : Theory L} {f : sentence L} (h : T f) :
                                                  T.fst f

                                                  Forget that a sentence-level proof came from a theory.

                                                  Equations
                                                  Instances For
                                                    theorem Flypitch.fol.sprovable_of_sprf {L : Language} {T : Theory L} {f : sentence L} (h : T f) :
                                                    T ⊢' f
                                                    theorem Flypitch.fol.sprovable.elim {L : Language} {P : Prop} {T : Theory L} {f : sentence L} (ih : ∀ (a : T f), P) (h : T ⊢' f) :
                                                    P

                                                    Eliminate the truncation in sprovable.

                                                    @[reducible, inline]

                                                    Satisfaction of a sentence in a structure.

                                                    Equations
                                                    Instances For
                                                      @[reducible, inline]

                                                      Every sentence in T is satisfied in M.

                                                      Equations
                                                      Instances For
                                                        theorem Flypitch.fol.all_realize_sentence_of_subset {L : Language} {M : Structure L} {T₁ T₂ : Theory L} (h : all_realize_sentence M T₂) (hsub : T₁.Subset T₂) :

                                                        Satisfaction is monotone along inclusion of theories.

                                                        Satisfaction of an inserted sentence splits into the new axiom and the old theory.

                                                        @[simp]

                                                        A singleton theory is satisfied exactly when its unique sentence is.

                                                        theorem Flypitch.fol.realize_sentence_of_mem {L : Language} {M : Structure L} {T : Theory L} {f : sentence L} (h : all_realize_sentence M T) (hf : f T) :

                                                        Extract satisfaction of a particular member of a theory.

                                                        Semantic consequence between theories and sentences.

                                                        Equations
                                                        Instances For
                                                          theorem Flypitch.fol.ssatisfied_of_mem {L : Language} {T : Theory L} {f : sentence L} (hf : f T) :

                                                          Any sentence already in a theory is a semantic consequence of it.

                                                          A theory is consistent when it does not prove falsum.

                                                          Equations
                                                          Instances For

                                                            If f is not provable, adjoining ¬f preserves consistency.

                                                            A complete theory is consistent and decides every sentence.

                                                            Equations
                                                            Instances For
                                                              theorem Flypitch.fol.mem_of_sprf {L : Language} {T : Theory L} (h : is_complete T) {f : sentence L} (hf : T f) :
                                                              f T

                                                              In a complete theory, every provable sentence is already an axiom.

                                                              theorem Flypitch.fol.mem_of_sprovable {L : Language} {T : Theory L} (h : is_complete T) {f : sentence L} (hf : T ⊢' f) :
                                                              f T

                                                              Truncated version of mem_of_sprf.

                                                              theorem Flypitch.fol.impI_of_is_complete {L : Language} {T : Theory L} (h : is_complete T) {f₁ f₂ : sentence L} (hf : T ⊢' f₁T ⊢' f₂) :
                                                              T ⊢' f₁ f₂

                                                              In a complete theory, implication can be introduced from a meta-level implication on provability.

                                                              theorem Flypitch.fol.notI_of_is_complete {L : Language} {T : Theory L} (h : is_complete T) {f : sentence L} (hf : ¬T ⊢' f) :

                                                              In a complete theory, non-provability of f yields provability of ¬f.

                                                              @[reducible, inline]

                                                              Synonym for is_consistent under the Theory namespace.

                                                              Equations
                                                              Instances For
                                                                @[reducible, inline]

                                                                Synonym for is_complete under the Theory namespace.

                                                                Equations
                                                                Instances For
                                                                  def Flypitch.fol.TheoryOver {L : Language} (T : Theory L) (hT : is_consistent T) :
                                                                  Type (u + 1)

                                                                  Consistent theory extensions ordered by inclusion.

                                                                  Equations
                                                                  Instances For

                                                                    The base theory regarded as an extension of itself.

                                                                    Equations
                                                                    Instances For
                                                                      @[reducible, inline]

                                                                      Alias used when completeness is the relevant viewpoint.

                                                                      Equations
                                                                      Instances For