Documentation

Foundation.Logic.Predicate.Term

Terms of first-order logic #

This file defines the terms of first-order logic.

The bounded variables are denoted by #x for x : Fin n, and free variables are denoted by &x for x : ξ. t : Semiterm L ξ n is a (semi-)term of language L with bounded variables of Fin n and free variables of ξ.

inductive LO.FirstOrder.Semiterm (L : Language) (ξ : Type u_1) (n : ) :
Type (max u_1 u_2)
Instances For
    @[reducible, inline]
    abbrev LO.FirstOrder.Term (L : Language) (ξ : Type u_1) :
    Type (max u_1 u_2)
    Equations
    Instances For
      @[reducible, inline]
      Equations
      Instances For
        @[reducible, inline]
        Equations
        Instances For
          def LO.FirstOrder.Semiterm.toStr {L : Language} {ξ : Type u_1} {n : } [(k : ) → ToString (L.Func k)] [ToString ξ] :
          Semiterm L ξ nString
          Equations
          Instances For
            instance LO.FirstOrder.Semiterm.instRepr {L : Language} {ξ : Type u_1} {n : } [(k : ) → ToString (L.Func k)] [ToString ξ] :
            Repr (Semiterm L ξ n)
            Equations
            instance LO.FirstOrder.Semiterm.instToString {L : Language} {ξ : Type u_1} {n : } [(k : ) → ToString (L.Func k)] [ToString ξ] :
            Equations
            def LO.FirstOrder.Semiterm.hasDecEq {L : Language} {ξ : Type u_1} {n : } [(k : ) → DecidableEq (L.Func k)] [DecidableEq ξ] (t u : Semiterm L ξ n) :
            Decidable (t = u)
            Equations
            Instances For
              def LO.FirstOrder.Semiterm.complexity {L : Language} {ξ : Type u_1} {n : } :
              Semiterm L ξ n
              Equations
              Instances For
                @[simp]
                theorem LO.FirstOrder.Semiterm.complexity_bvar {L : Language} {ξ : Type u_1} {n : } (x : Fin n) :
                (bvar x).complexity = 0
                @[simp]
                theorem LO.FirstOrder.Semiterm.complexity_fvar {L : Language} {ξ : Type u_1} {n : } (x : ξ) :
                (fvar x).complexity = 0
                theorem LO.FirstOrder.Semiterm.complexity_func {L : Language} {ξ : Type u_1} {n k : } (f : L.Func k) (v : Fin kSemiterm L ξ n) :
                (func f v).complexity = (Finset.univ.sup fun (i : Fin k) => (v i).complexity) + 1
                @[simp]
                theorem LO.FirstOrder.Semiterm.complexity_func_lt {L : Language} {ξ : Type u_1} {n k : } (f : L.Func k) (v : Fin kSemiterm L ξ n) (i : Fin k) :
                (v i).complexity < (func f v).complexity
                @[reducible, inline]
                abbrev LO.FirstOrder.Semiterm.func! {L : Language} {ξ : Type u_1} {n : } (k : ) (f : L.Func k) (v : Fin kSemiterm L ξ n) :
                Semiterm L ξ n
                Equations
                Instances For
                  def LO.FirstOrder.Semiterm.bv {L : Language} {ξ : Type u_1} {n : } :
                  Semiterm L ξ nFinset (Fin n)
                  Equations
                  Instances For
                    @[simp]
                    theorem LO.FirstOrder.Semiterm.bv_bvar {L : Language} {ξ : Type u_1} {n : } {x : Fin n} :
                    (bvar x).bv = {x}
                    @[simp]
                    theorem LO.FirstOrder.Semiterm.bv_fvar {L : Language} {ξ : Type u_1} {n : } {x : ξ} :
                    (fvar x).bv =
                    theorem LO.FirstOrder.Semiterm.bv_func {L : Language} {ξ : Type u_1} {n k : } (f : L.Func k) (v : Fin kSemiterm L ξ n) :
                    (func f v).bv = Finset.univ.biUnion fun (i : Fin k) => (v i).bv
                    @[simp]
                    theorem LO.FirstOrder.Semiterm.bv_constant {L : Language} {ξ : Type u_1} {n : } (f : L.Func 0) (v : Fin 0Semiterm L ξ n) :
                    (func f v).bv =
                    def LO.FirstOrder.Semiterm.Positive {L : Language} {ξ : Type u_1} {n : } (t : Semiterm L ξ (n + 1)) :
                    Equations
                    • t.Positive = xt.bv, 0 < x
                    Instances For
                      @[simp]
                      theorem LO.FirstOrder.Semiterm.Positive.bvar {L : Language} {ξ : Type u_1} {n : } {x : Fin (n + 1)} :
                      (bvar x).Positive 0 < x
                      @[simp]
                      theorem LO.FirstOrder.Semiterm.Positive.fvar {L : Language} {ξ : Type u_1} {n : } {x : ξ} :
                      (fvar x).Positive
                      @[simp]
                      theorem LO.FirstOrder.Semiterm.Positive.func {L : Language} {ξ : Type u_1} {n k : } (f : L.Func k) (v : Fin kSemiterm L ξ (n + 1)) :
                      (func f v).Positive ∀ (i : Fin k), (v i).Positive
                      theorem LO.FirstOrder.Semiterm.bv_eq_empty_of_positive {L : Language} {ξ : Type u_1} {t : Semiterm L ξ 1} (ht : t.Positive) :
                      t.bv =
                      def LO.FirstOrder.Semiterm.freeVariables {L : Language} {ξ : Type u_1} {n : } [DecidableEq ξ] :
                      Semiterm L ξ nFinset ξ
                      Equations
                      Instances For
                        @[simp]
                        theorem LO.FirstOrder.Semiterm.freeVariables_bvar {L : Language} {ξ : Type u_1} {n : } [DecidableEq ξ] {x : Fin n} :
                        (bvar x).freeVariables =
                        @[simp]
                        theorem LO.FirstOrder.Semiterm.freeVariables_fvar {L : Language} {ξ : Type u_1} {n : } [DecidableEq ξ] {x : ξ} :
                        (fvar x).freeVariables = {x}
                        theorem LO.FirstOrder.Semiterm.freeVariables_func {L : Language} {ξ : Type u_1} {n : } [DecidableEq ξ] {k : } (f : L.Func k) (v : Fin kSemiterm L ξ n) :
                        (func f v).freeVariables = Finset.univ.biUnion fun (i : Fin k) => (v i).freeVariables
                        @[simp]
                        theorem LO.FirstOrder.Semiterm.freeVariables_constant {L : Language} {ξ : Type u_1} {n : } [DecidableEq ξ] (f : L.Func 0) (v : Fin 0Semiterm L ξ n) :
                        (func f v).freeVariables =
                        @[simp]
                        theorem LO.FirstOrder.Semiterm.freeVariables_empty {L : Language} {n : } {ο : Type u_6} [IsEmpty ο] {t : Semiterm L ο n} :
                        t.freeVariables =
                        @[reducible, inline]
                        abbrev LO.FirstOrder.Semiterm.FVar? {L : Language} {ξ : Type u_1} {n : } [DecidableEq ξ] (t : Semiterm L ξ n) (x : ξ) :
                        Equations
                        • t.FVar? x = (x t.freeVariables)
                        Instances For
                          @[simp]
                          theorem LO.FirstOrder.Semiterm.fvar?_bvar {L : Language} {ξ : Type u_1} {n : } [DecidableEq ξ] (x : Fin n) (z : ξ) :
                          ¬(bvar x).FVar? z
                          @[simp]
                          theorem LO.FirstOrder.Semiterm.fvar?_fvar {L : Language} {ξ : Type u_1} {n : } [DecidableEq ξ] (x z : ξ) :
                          (fvar x).FVar? z x = z
                          @[simp]
                          theorem LO.FirstOrder.Semiterm.fvar?_func {L : Language} {ξ : Type u_1} {n : } [DecidableEq ξ] (x : ξ) {k : } (f : L.Func k) (v : Fin kSemiterm L ξ n) :
                          (func f v).FVar? x ∃ (i : Fin k), (v i).FVar? x
                          @[simp]
                          theorem LO.FirstOrder.Semiterm.lMap_bvar {L₁ : Language} {L₂ : Language} {ξ : Type u_1} {n : } (Φ : L₁.Hom L₂) (x : Fin n) :
                          lMap Φ (bvar x) = bvar x
                          @[simp]
                          theorem LO.FirstOrder.Semiterm.lMap_fvar {L₁ : Language} {L₂ : Language} {ξ : Type u_1} {n : } (Φ : L₁.Hom L₂) (x : ξ) :
                          lMap Φ (fvar x) = fvar x
                          theorem LO.FirstOrder.Semiterm.lMap_func {L₁ : Language} {L₂ : Language} {ξ : Type u_1} {n : } (Φ : L₁.Hom L₂) {k : } (f : L₁.Func k) (v : Fin kSemiterm L₁ ξ n) :
                          lMap Φ (func f v) = func (Φ.func f) fun (i : Fin k) => lMap Φ (v i)
                          @[simp]
                          theorem LO.FirstOrder.Semiterm.lMap_positive {L₁ : Language} {L₂ : Language} {ξ : Type u_1} {n : } (Φ : L₁.Hom L₂) (t : Semiterm L₁ ξ (n + 1)) :
                          (lMap Φ t).Positive t.Positive
                          @[simp]
                          theorem LO.FirstOrder.Semiterm.freeVariables_lMap {L₁ : Language} {L₂ : Language} {ξ : Type u_1} {n : } [DecidableEq ξ] (Φ : L₁.Hom L₂) (t : Semiterm L₁ ξ n) :
                          (lMap Φ t).freeVariables = t.freeVariables
                          instance LO.FirstOrder.Semiterm.instInhabited_1 {L : Language} {ξ : Type u_1} {n : } [L.ConstantInhabited] :
                          Equations
                          theorem LO.FirstOrder.Semiterm.default_def {L : Language} {ξ : Type u_1} {n : } [L.ConstantInhabited] :