Documentation

Flypitch.FOL.Formula

Flypitch.FOL.Formula defines formulas over a first-order language together with the derived connectives, recursors, and the lifting/substitution lemmas used to manage de Bruijn variables.

inductive Flypitch.fol.preformula (L : Language) :
Type u

Formulas with l relation arguments still to be supplied.

Instances For
    @[reducible, inline]

    Closed formulas.

    Equations
    Instances For

      Derived negation.

      Equations
      Instances For
        @[implicit_reducible]
        Equations
        def Flypitch.fol.and {L : Language} (f₁ f₂ : formula L) :

        Derived conjunction.

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

          Derived disjunction.

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

            Derived biconditional.

            Equations
            Instances For

              Derived existential quantification.

              Equations
              Instances For
                def Flypitch.fol.apps_rel {L : Language} {l : } :
                preformula L ldvector (term L) lformula L

                Fully apply a relation formula to a tuple of term arguments.

                Equations
                Instances For
                  @[simp]
                  theorem Flypitch.fol.apps_rel_zero {L : Language} (f : formula L) (ts : dvector (term L) 0) :
                  apps_rel f ts = f

                  View a relation symbol as an arity'-valued formula constructor.

                  Equations
                  Instances For
                    def Flypitch.fol.formula.rec' {L : Language} {C : formula LSort v} (hfalsum : C ) (hequal : (t₁ t₂ : term L) → C (t₁ t₂)) (hrel : {l : } → (R : L.relations l) → (ts : dvector (term L) l) → C (apps_rel (preformula.rel R) ts)) (himp : {f₁ f₂ : formula L} → C f₁C f₂C (f₁ f₂)) (hall : {f : formula L} → C fC (∀' f)) {l : } (f : preformula L l) (ts : dvector (term L) l) :
                    C (apps_rel f ts)

                    Recursor for formulas presented as fully applied formulas.

                    Equations
                    Instances For
                      def Flypitch.fol.formula.rec {L : Language} {C : formula LSort v} (hfalsum : C ) (hequal : (t₁ t₂ : term L) → C (t₁ t₂)) (hrel : {l : } → (R : L.relations l) → (ts : dvector (term L) l) → C (apps_rel (preformula.rel R) ts)) (himp : {f₁ f₂ : formula L} → C f₁C f₂C (f₁ f₂)) (hall : {f : formula L} → C fC (∀' f)) (f : formula L) :
                      C f

                      Recursor on closed formulas.

                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For
                        theorem Flypitch.fol.formula.rec'_apps_rel {L : Language} {C : formula LSort v} (hfalsum : C ) (hequal : (t₁ t₂ : term L) → C (t₁ t₂)) (hrel : {l : } → (R : L.relations l) → (ts : dvector (term L) l) → C (apps_rel (preformula.rel R) ts)) (himp : {f₁ f₂ : formula L} → C f₁C f₂C (f₁ f₂)) (hall : {f : formula L} → C fC (∀' f)) {l : } (f : preformula L l) (ts : dvector (term L) l) :
                        rec' hfalsum hequal (fun {l : } => hrel) (fun {f₁ f₂ : formula L} => himp) (fun {f : formula L} => hall) (apps_rel f ts) dvector.nil = rec' hfalsum hequal (fun {l : } => hrel) (fun {f₁ f₂ : formula L} => himp) (fun {f : formula L} => hall) f ts

                        Compatibility of formula.rec' with apps_rel.

                        theorem Flypitch.fol.formula.rec_apps_rel {L : Language} {C : formula LSort v} (hfalsum : C ) (hequal : (t₁ t₂ : term L) → C (t₁ t₂)) (hrel : {l : } → (R : L.relations l) → (ts : dvector (term L) l) → C (apps_rel (preformula.rel R) ts)) (himp : {f₁ f₂ : formula L} → C f₁C f₂C (f₁ f₂)) (hall : {f : formula L} → C fC (∀' f)) {l : } (R : L.relations l) (ts : dvector (term L) l) :
                        rec hfalsum hequal (fun {l : } => hrel) (fun {f₁ f₂ : formula L} => himp) (fun {f : formula L} => hall) (apps_rel (preformula.rel R) ts) = hrel R ts

                        Compatibility of formula.rec with relation application.

                        Raise every free variable of index at least m in a formula by n.

                        Equations
                        Instances For

                          Lift every free variable in a formula by n.

                          Equations
                          Instances For

                            Lift every free variable in a formula by one.

                            Equations
                            Instances For
                              theorem Flypitch.fol.lift_formula_def {L : Language} {l : } (f : preformula L l) (n : ) :

                              lift_formula is lift_formula_at specialized to m = 0.

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

                              Lifting by zero leaves a formula unchanged.

                              theorem Flypitch.fol.lift_formula_at_apps_rel {L : Language} {l : } (f : preformula L l) (ts : dvector (term L) l) (n m : ) :
                              lift_formula_at (apps_rel f ts) n m = apps_rel (lift_formula_at f n m) (dvector.map (fun (x : preterm L 0) => x ↑' n # m) ts)

                              Lifting commutes with relation application.

                              def Flypitch.fol.subst_formula {L : Language} {l : } :
                              preformula L lterm Lpreformula L l

                              Substitute a term for variable n throughout a formula.

                              Equations
                              Instances For
                                @[simp]
                                theorem Flypitch.fol.subst_formula_equal {L : Language} (t₁ t₂ s : term L) (n : ) :
                                subst_formula (t₁ t₂) s n = t₁[s // n] t₂[s // n]
                                theorem Flypitch.fol.subst_formula_apps_rel {L : Language} {l : } (f : preformula L l) (ts : dvector (term L) l) (s : term L) (n : ) :
                                subst_formula (apps_rel f ts) s n = apps_rel (subst_formula f s n) (dvector.map (fun (x : preterm L 0) => x[s // n]) ts)

                                Substitution commutes with relation application.

                                theorem Flypitch.fol.lift_formula_at2_small {L : Language} {l : } (f : preformula L l) (n n' : ) {m m' : } :
                                m' mlift_formula_at (lift_formula_at f n m) n' m' = lift_formula_at (lift_formula_at f n' m') n (m + n')

                                Commute two lifts when the second cutoff is no larger than the first.

                                @[simp]

                                A single lift can be moved past another lift by adjusting the cutoff.

                                theorem Flypitch.fol.lift_at_subst_formula_large {L : Language} {l : } (f : preformula L l) (s : term L) {n₁ : } (n₂ : ) {m : } :
                                m n₁subst_formula (lift_formula_at f n₂ m) s (n₁ + n₂) = lift_formula_at (subst_formula f s n₁) n₂ m

                                Substituting above the lift cutoff commutes with lifting.

                                theorem Flypitch.fol.lift_subst_formula_large {L : Language} {l : } (f : preformula L l) (s : term L) (n₁ n₂ : ) :
                                subst_formula (lift_formula f n₂) s (n₁ + n₂) = lift_formula (subst_formula f s n₁) n₂

                                Global lifting commutes with substitution above the lifted block.

                                theorem Flypitch.fol.lift_subst_formula_large' {L : Language} {l : } (f : preformula L l) (s : term L) (n₁ n₂ : ) :
                                subst_formula (lift_formula f n₂) s (n₂ + n₁) = lift_formula (subst_formula f s n₁) n₂

                                Commuting version of lift_subst_formula_large with the indices swapped.

                                @[simp]
                                theorem Flypitch.fol.lift_formula1_subst_shift {L : Language} {l : } (f : preformula L l) (s : term L) (n : ) :
                                theorem Flypitch.fol.lift_at_subst_formula_medium {L : Language} {l : } (f : preformula L l) (s : term L) {n₁ n₂ m : } :
                                m n₂n₂ m + n₁subst_formula (lift_formula_at f (n₁ + 1) m) s n₂ = lift_formula_at f n₁ m

                                Substituting inside the lifted block lowers the lift amount by one.

                                theorem Flypitch.fol.lift_at_subst_formula_eq {L : Language} {l : } (f : preformula L l) (s : term L) (n : ) :

                                Lifting once and substituting at the cutoff cancels out.

                                @[simp]
                                theorem Flypitch.fol.lift_formula1_subst {L : Language} {l : } (f : preformula L l) (s : term L) :
                                theorem Flypitch.fol.lift_at_subst_formula_small {L : Language} {l : } (f : preformula L l) (s : term L) (n₁ n₂ m : ) :
                                subst_formula (lift_formula_at f n₁ (m + n₂ + 1)) (s ↑' n₁ # m) n₂ = lift_formula_at (subst_formula f s n₂) n₁ (m + n₂)

                                Substituting below the lift cutoff commutes with lifting the substituted term.

                                @[simp]
                                theorem Flypitch.fol.lift_at_subst_formula_small0 {L : Language} {l : } (f : preformula L l) (s : term L) (n₁ m : ) :
                                subst_formula (lift_formula_at f n₁ (m + 1)) (s ↑' n₁ # m) 0 = lift_formula_at (subst_formula f s 0) n₁ m

                                Special case of lift_at_subst_formula_small at variable 0.

                                theorem Flypitch.fol.subst_formula2 {L : Language} {l : } (f : preformula L l) (s₁ s₂ : term L) (n₁ n₂ : ) :
                                subst_formula (subst_formula f s₁ n₁) s₂ (n₁ + n₂) = subst_formula (subst_formula f s₂ (n₁ + n₂ + 1)) (s₁[s₂ // n₂]) n₁

                                Composition law for two substitutions into a formula.

                                @[simp]
                                theorem Flypitch.fol.subst_formula2_zero {L : Language} {l : } (f : preformula L l) (s₁ s₂ : term L) (n : ) :
                                subst_formula (subst_formula f s₁ 0) s₂ n = subst_formula (subst_formula f s₂ (n + 1)) (s₁[s₂ // n]) 0

                                Specialization of subst_formula2 with the first substitution at variable 0.

                                Predicate asserting that a formula contains no quantifiers.

                                Equations
                                Instances For