1- import InferenceInLean.Syntax
2- import InferenceInLean.Semantics
3- import InferenceInLean.Models
4- import InferenceInLean.Unification
1+ import InferenceInLean.A_Syntax
2+ import InferenceInLean.B_Semantics
3+ import InferenceInLean.C_Models
4+ import InferenceInLean.D_Unification
55
66set_option autoImplicit false
77--set_option diagnostics true
@@ -25,7 +25,7 @@ structure Inference where
2525 conclusion : Clause sig X
2626 condition: Prop
2727
28- def InferenceSystem := List (Inference sig X)
28+ abbrev InferenceSystem := List (Inference sig X)
2929
3030instance : Membership (Inference sig X) (InferenceSystem sig X) :=
3131 List.instMembership
@@ -67,57 +67,6 @@ the lecture notes. This means that we can show the soundness of an inference sys
6767showing that all of its inferences are sound. -/
6868theorem generalSoundness_of_soundness [inst : DecidableEq X]
6969 (Γ : InferenceSystem sig X) : @Soundness _ _ univ _ Γ → @GeneralSoundness _ _ univ _ Γ := by
70+ /- The proof that was here before only worked due to a wrong definition of ClauseSetEntails.
71+ However, the proof was still correct at least for variables being the Empty type. -/
7072 sorry
71- /-
72- intro hsound N F hproof A β hgstrue
73- rcases hproof with ⟨proof, ⟨hassumptions, hconclusion⟩⟩
74- have hproofsequencetrue : ∀ F ∈ proof.clauses, EntailsInterpret A β F := by
75- have hindicestrue : ∀ i (hindex : i < proof.clauses.length),
76- EntailsInterpret A β proof.clauses[ i ] := by
77- intro i hlen
78- induction' i using Nat.case_strong_induction_on with i ih
79- · have hvalid := proof.is_valid 0 hlen
80- aesop
81- · have hvalid := proof.is_valid (i + 1) hlen
82- rcases hvalid with hassump | hconseq
83- · simp_all only [Soundness, SetEntails, Assignment, EntailsInterpret]
84- · rcases hconseq with ⟨inference, ⟨hin, ⟨hlast, hcond, hprev⟩⟩⟩
85- rw [ hlast ]
86- have hinfsound := hsound inference hin
87- apply hinfsound
88- · exact hcond
89- · intro inf_form hprem
90- have hinftrue := hprev inf_form hprem
91- rcases hinftrue with ⟨j, ⟨hjindex, heq⟩⟩
92- have hjtrue := ih j (Nat.le_of_lt_succ hjindex) (Nat.lt_trans hjindex hlen)
93- rw [ heq ]
94- exact hjtrue
95- intro F hF
96- have hfindex : ∃ (i : ℕ) (hindex : i < proof.clauses.length), proof.clauses[ i ] = F :=
97- List.mem_iff_getElem.mp hF
98- aesop
99- have hlen : proof.clauses.length - 1 < proof.clauses.length := by
100- have hlennonzero : proof.clauses.length ≠ 0 := by
101- have hnonempty := proof.clauses_not_empty
102- simp_all only [List.empty_eq, ne_eq, List.length_eq_zero, not_false_eq_true]
103- exact Nat.sub_one_lt hlennonzero
104- have hfconclusion := proof.is_valid (proof.clauses.length - 1) hlen
105- have hfislast : proof.clauses[proof.clauses.length - 1] = F := by
106- rw [proof.last_clause_conclusion, hconclusion]
107- rw [ hfislast ] at hfconclusion
108- rcases hfconclusion with hl | hr
109- · simp_all only [Soundness, SetEntails, Assignment, EntailsInterpret]
110- · subst hassumptions hconclusion
111- obtain ⟨inference, h⟩ := hr
112- obtain ⟨hinf, right⟩ := h
113- obtain ⟨hconcs, hcond, hforms⟩ := right
114- have h := hsound inference hinf
115- rw [ hconcs ]
116- apply h
117- · exact hcond
118- · intro G hgprem
119- have hinf := hforms G hgprem
120- rcases hinf with ⟨j, hjnotconc, hginforms⟩
121- simp_all only [Soundness, SetEntails, Assignment, EntailsInterpret,
122- implies_true, List.getElem_mem]
123- -/
0 commit comments