Skip to content

Commit

Permalink
Refactor Provability Predicate and Arithmetical Soundness (#1)
Browse files Browse the repository at this point in the history
* wip

* upd

* upd deps

* notation fix

* fx by review
  • Loading branch information
SnO2WMaN authored Sep 6, 2024
1 parent 773fd52 commit 6b203f9
Show file tree
Hide file tree
Showing 9 changed files with 219 additions and 261 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/build
/lake-packages/*
/.lake
/.lake

# VSCode
.vscode/settings.json
3 changes: 2 additions & 1 deletion Incompleteness.lean
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ import Incompleteness.Arith.First
import Incompleteness.Arith.Second
import Incompleteness.Arith.DC
import Incompleteness.DC.Basic
import Incompleteness.Modal.Basic

import Incompleteness.ProvabilityLogic.ProvabilityLogic
15 changes: 8 additions & 7 deletions Incompleteness/Arith/DC.lean
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@ instance : Diagonalization T where
fixpoint := fixpoint
diag θ := diagonal θ

abbrev _root_.LO.FirstOrder.Theory.standardDP : ProvabilityPredicate ℒₒᵣ ℒₒᵣ := ⟨U.provableₐ⟩

instance : U.standardDP.HBL1 T U := ⟨provableₐ_D1⟩
instance : U.standardDP.HBL2 T U := ⟨provableₐ_D2⟩
instance : U.standardDP.HBL3 T U := ⟨provableₐ_D3⟩
instance : U.standardDP.HBL T U := ⟨⟩
instance : U.standardDP.GoedelSound T U := ⟨fun h ↦ by simpa using provableₐ_sound h⟩
abbrev _root_.LO.FirstOrder.Theory.standardDP : ProvabilityPredicate T U where
prov := U.provableₐ
spec := provableₐ_D1

instance : (Theory.standardDP T U).HBL2 := ⟨provableₐ_D2⟩
instance : (Theory.standardDP T U).HBL3 := ⟨provableₐ_D3⟩
instance : (Theory.standardDP T U).HBL := ⟨⟩
instance : (Theory.standardDP T U).GoedelSound := ⟨fun h ↦ by simpa using provableₐ_sound h⟩

end LO.FirstOrder.Arith

Expand Down
253 changes: 120 additions & 133 deletions Incompleteness/DC/Basic.lean

Large diffs are not rendered by default.

118 changes: 0 additions & 118 deletions Incompleteness/Modal/Basic.lean

This file was deleted.

81 changes: 81 additions & 0 deletions Incompleteness/ProvabilityLogic/Basic.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
import Incompleteness.Arith.DC
import Incompleteness.DC.Basic
import Logic.Modal.Hilbert

namespace LO

open LO.FirstOrder LO.FirstOrder.DerivabilityCondition
open LO.Modal

variable {α : Type u} [DecidableEq α]
variable [Semiterm.Operator.GoedelNumber L (Sentence L)]
{T U : Theory L}


namespace ProvabilityLogic

/-- Mapping modal prop vars to first-order sentence -/
def Realization (α : Type u) (L) := α → FirstOrder.Sentence L

/-- Mapping modal formulae to first-order sentence -/
def Realization.interpret
{T U : FirstOrder.Theory L}
(f : Realization α L) (𝔅 : ProvabilityPredicate T U) : Formula α → FirstOrder.Sentence L
| .atom a => f a
| □p => 𝔅 (f.interpret 𝔅 p)
| ⊥ => ⊥
| p ⟶ q => (f.interpret 𝔅 p) ⟶ (f.interpret 𝔅 q)

variable [Semiterm.Operator.GoedelNumber L (Sentence L)]

class ArithmeticalSound (Λ : Hilbert α) (𝔅 : ProvabilityPredicate T U) where
sound : ∀ {p}, (Λ ⊢! p) → (∀ {f : Realization α L}, U ⊢!. (f.interpret 𝔅 p))

class ArithmeticalComplete (Λ : Hilbert α) (𝔅 : ProvabilityPredicate T U) where
complete : ∀ {p}, (∀ {f : Realization α L}, U ⊢!. (f.interpret 𝔅 p)) → (Λ ⊢! p)


section ArithmeticalSoundness

open System
open ProvabilityPredicate

variable {L : FirstOrder.Language} [Semiterm.Operator.GoedelNumber L (Sentence L)]
[DecidableEq (Sentence L)]
{T U : FirstOrder.Theory L} [T ≼ U] [Diagonalization T]
{𝔅 : ProvabilityPredicate T U}

lemma arithmetical_soundness_N (h : 𝐍 ⊢! p) : ∀ {f : Realization α L}, U ⊢!. (f.interpret 𝔅 p) := by
intro f;
induction h using Deduction.inducition_with_necOnly! with
| hMaxm hp => simp at hp;
| hNec ihp => exact D1_shift ihp;
| hMdp ihpq ihp =>
simp only [Realization.interpret] at ihpq;
exact ihpq ⨀ ihp;
| _ => dsimp [Realization.interpret]; trivial;

lemma arithmetical_soundness_GL [𝔅.HBL] (h : 𝐆𝐋 ⊢! p) : ∀ {f : Realization α L}, U ⊢!. (f.interpret 𝔅 p) := by
intro f;
induction h using Deduction.inducition_with_necOnly! with
| hMaxm hp =>
rcases hp with (⟨_, _, rfl⟩ | ⟨_, rfl⟩)
. exact D2_shift;
. exact FLT_shift;
| hNec ihp => exact D1_shift ihp;
| hMdp ihpq ihp =>
simp [Realization.interpret] at ihpq;
exact ihpq ⨀ ihp;
| _ => dsimp [Realization.interpret]; trivial;

end ArithmeticalSoundness


section

instance (T : Theory ℒₒᵣ) [𝐈𝚺₁ ≼ T] [T.Delta1Definable] : ArithmeticalSound (𝐆𝐋 : Hilbert α) (T.standardDP T) := ⟨arithmetical_soundness_GL⟩

end


end LO.ProvabilityLogic
1 change: 1 addition & 0 deletions Incompleteness/ProvabilityLogic/ProvabilityLogic.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import Incompleteness.ProvabilityLogic.Basic
2 changes: 1 addition & 1 deletion lake-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
"name": "logic",
"manifestFile": "lake-manifest.json",
"inputRev": "master",
"inherited": true,
"inherited": false,
"configFile": "lakefile.lean"},
{"url": "https://github.com/FormalizedFormalLogic/Arithmetization",
"type": "git",
Expand Down
2 changes: 2 additions & 0 deletions lakefile.lean
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ package «Incompleteness» where
]
-- add any additional package configuration options here

require «logic» from git "https://github.com/FormalizedFormalLogic/Foundation" @ "master"

require arithmetization from git "https://github.com/FormalizedFormalLogic/Arithmetization" @ "master"

require proofwidgets from git "https://github.com/leanprover-community/ProofWidgets4"@"v0.0.39"
Expand Down

0 comments on commit 6b203f9

Please sign in to comment.