@@ -7,7 +7,9 @@ set_option autoImplicit false
77open Syntax
88open Semantics
99
10- /-! ## 3.3 Models, Validity, and Satisfiability -/
10+ /-! ## 3.3 Models, Validity, and Satisfiability
11+ In this section we establish various notions of semantic entailment and prove several lemmas that
12+ show how assignments and substitutions interact. -/
1113
1214namespace Models
1315
@@ -50,6 +52,22 @@ theorem entails_iff_imp_valid [inst : DecidableEq X]
5052 (F G : Formula sig X) : @Entails _ _ univ _ F G ↔ @Valid _ _ univ _ (Formula.imp F G) :=
5153 Eq.to_iff rfl
5254
55+ /- N ⊨ F -/
56+ @[simp]
57+ def SetEntails [DecidableEq X]
58+ (N : Set (Formula sig X)) (F : Formula sig X) : Prop :=
59+ ∀ (I : Interpretation sig univ) (β : Assignment X univ),
60+ (∀ G ∈ N, EntailsInterpret I β G) → EntailsInterpret I β F
61+
62+ @[simp]
63+ def ClauseSetEntails [DecidableEq X]
64+ (N : Set <| Clause sig X) (C : Clause sig X) : Prop :=
65+ ∀ (I : Interpretation sig univ),
66+ (∀ D ∈ N, @ValidIn _ X _ _ D I) → @ValidIn _ X _ _ C I
67+
68+ lemma entails_setEntails [inst : DecidableEq X]
69+ (F G : Formula sig X) : @Entails _ _ univ _ F G ↔ @SetEntails _ X univ _ {F} G := by simp
70+
5371/- ### Satsfiability -/
5472
5573@[simp]
@@ -73,21 +91,6 @@ def Literal.satisfied_by [DecidableEq X]
7391 | Literal.pos a => Formula.atom a
7492 | Literal.neg a => Formula.neg (Formula.atom a)
7593
76- @[simp]
77- def SetEntails [DecidableEq X]
78- (N : Set (Formula sig X)) (F : Formula sig X) : Prop :=
79- ∀ (I : Interpretation sig univ) (β : Assignment X univ),
80- (∀ G ∈ N, EntailsInterpret I β G) → EntailsInterpret I β F
81-
82- @[simp]
83- def ClauseSetEntails [DecidableEq X]
84- (N : Set <| Clause sig X) (C : Clause sig X) : Prop :=
85- ∀ (I : Interpretation sig univ),
86- (∀ D ∈ N, @ValidIn _ X _ _ D I) → @ValidIn _ X _ _ C I
87-
88- lemma entails_setEntails [inst : DecidableEq X]
89- (F G : Formula sig X) : @Entails _ _ univ _ F G ↔ @SetEntails _ X univ _ {F} G := by simp
90-
9194@[simp]
9295def ClauseSatisfiable [DecidableEq X] (C : Clause sig X) : Prop :=
9396 ∃ (I : Interpretation sig univ) (β : Assignment X univ),
@@ -168,8 +171,10 @@ lemma validIn_of_entails_closed {sig : Signature} {X : Variables} [inst : Decida
168171 exact hγ
169172
170173/- ### Lemmas Related to Entailment
171- In the following section, we prove several lemmas that will be vital in our soundness proof. -/
174+ In the following section, we prove several lemmas from the lecture notes that will be vital for our
175+ soundness proof. -/
172176
177+ /- Composition β ∘ σ of an assignment β with a substitution σ -/
173178@[simp]
174179def Assignment.compose [DecidableEq X] (I : Interpretation sig univ) (β : Assignment X univ)
175180 (σ : Substitution sig X) : Assignment X univ :=
@@ -191,6 +196,7 @@ lemma Assignment.compose_term_eq_eval_compose [DecidableEq X] (I : Interpretatio
191196 · simp_all only [compose_term, Term.eval.eq_1, compose]
192197 · simp_all only [compose_term, List.map_subtype, List.unattach_attach, Term.eval.eq_2]
193198
199+ /- I(β)(tσ) = I(β ∘ σ)(t) -/
194200theorem substitution_lemma [DecidableEq X]
195201 (I : Interpretation sig univ) (β : Assignment X univ) (σ : Substitution _ _) (t : Term _ _) :
196202 Term.eval I β (t.substitute σ) = Term.eval I (Assignment.compose I β σ) t := by
@@ -207,6 +213,7 @@ theorem substitution_lemma [DecidableEq X]
207213 simp_all only [List.map_inj_left, Function.comp_apply, implies_true]
208214 rw [hargsarequal]
209215
216+ /- I(β)(Fσ) = A(β ∘ σ)(F) -/
210217theorem three_three_five [DecidableEq X]
211218 (I : Interpretation sig univ) (β : Assignment X univ) (σ : Substitution _ _) (C : Clause _ _) :
212219 Formula.eval I β (C.substitute σ) = Formula.eval I (Assignment.compose I β σ) C := by
@@ -242,7 +249,9 @@ theorem three_three_six [DecidableEq X]
242249 rw [EntailsInterpret, EntailsInterpret, ← eq_iff_iff]
243250 exact three_three_five I β σ C
244251
245- /- ### Lemma 3.3.7 -/
252+ /- A ⊨ ∀ x1, ..., xn F ↔ A ⊨ F
253+ Since we do not demand that F is a closed formula, this statement is slightly stronger than the
254+ one in the lecture notes. Regardless, this proof has the same structure as the one in the notes. -/
246255lemma three_three_seven [DecidableEq X] (n : ℕ) (F : Formula sig X) (I : Interpretation sig univ)
247256 (xs : List X) (huniq : xs.Nodup) (hn : xs.length = n) :
248257 ValidIn (F.bigForall _ _ xs) I ↔ ValidIn F I := by
@@ -281,6 +290,7 @@ lemma three_three_seven [DecidableEq X] (n : ℕ) (F : Formula sig X) (I : Inter
281290 intro a
282291 exact ih (n - 1 ) (List.Nodup.of_cons huniq) (Nat.eq_sub_of_add_eq hn) (β.modify x a)
283292
293+ /- Used in the following proof. -/
284294lemma valid_sub_of_valid {I : Interpretation sig univ} [DecidableEq X] (C : Clause sig X)
285295 (σ : Substitution sig X) :
286296 ValidIn (Clause.toFormula sig X C) I →
@@ -291,6 +301,7 @@ lemma valid_sub_of_valid {I : Interpretation sig univ} [DecidableEq X] (C : Clau
291301 rw [three_three_five]
292302 exact hvalid
293303
304+ /- A ⊨ ∀ x1, ..., xn F → A ⊨ ∀ y1, ..., yn F -/
294305lemma three_three_eight {sig : Signature} {X : Variables} [DecidableEq X] (C : Clause sig X)
295306 (I : Interpretation sig univ) (σ : Substitution sig X) (n m : ℕ)
296307 (xs ys : List X) (hxuniq : xs.Nodup) (hn : xs.length = n)
0 commit comments