-
Notifications
You must be signed in to change notification settings - Fork 10
add(FirstOrder): Church's Undecidability Theorem #491
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
SnO2WMaN
wants to merge
4
commits into
master
Choose a base branch
from
church-theorem
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
import Foundation.FirstOrder.Incompleteness.First | ||
import Mathlib.Computability.Reduce | ||
|
||
/-! | ||
# Church's Undecidability of First-Order Logic Theorem | ||
-/ | ||
|
||
|
||
section | ||
|
||
variable {α β} [Primcodable α] [Primcodable β] | ||
|
||
lemma ComputablePred.range_subset {f : α → β} (hf : Computable f) {A} (hA : ComputablePred A) : ComputablePred { x | A (f x) } := by | ||
apply computable_iff.mpr; | ||
obtain ⟨inA, hinA₁, rfl⟩ := computable_iff.mp hA; | ||
use λ x => inA (f x); | ||
constructor; | ||
. apply Computable.comp <;> assumption; | ||
. rfl; | ||
|
||
end | ||
|
||
|
||
namespace LO.ISigma1 | ||
|
||
open Entailment FirstOrder FirstOrder.Arithmetic | ||
|
||
variable {T : Theory ℒₒᵣ} [𝐈𝚺₁ ⪯ T] [Entailment.Consistent T] | ||
|
||
lemma not_exists_theorem_representable_predicate : ¬∃ τ : Semisentence ℒₒᵣ 1, ∀ σ, (T ⊢!. σ → T ⊢!. τ/[⌜σ⌝]) ∧ (T ⊬. σ → T ⊢!. ∼τ/[⌜σ⌝]) := by | ||
rintro ⟨τ, hτ⟩; | ||
have ⟨h₁, h₂⟩ := hτ $ fixpoint “x. ¬!τ x”; | ||
by_cases h : T ⊢!. fixpoint (∼τ/[#0]); | ||
. apply Entailment.Consistent.not_bot (𝓢 := T.toAxiom); | ||
. infer_instance; | ||
. have H₁ : T ⊢!. τ/[⌜fixpoint (∼τ/[#0])⌝] := h₁ h; | ||
have H₂ : T ⊢!. fixpoint (∼τ/[#0]) ⭤ ∼τ/[⌜fixpoint (∼τ/[#0])⌝] := by simpa using diagonal “x. ¬!τ x”; | ||
cl_prover [h, H₁, H₂]; | ||
. apply h; | ||
have H₁ : T ⊢!. ∼τ/[⌜fixpoint (∼τ/[#0])⌝] := h₂ h; | ||
have H₂ : T ⊢!. fixpoint (∼τ/[#0]) ⭤ ∼τ/[⌜fixpoint (∼τ/[#0])⌝] := by simpa using diagonal “x. ¬!τ x”; | ||
cl_prover [H₁, H₂]; | ||
|
||
end LO.ISigma1 | ||
|
||
|
||
namespace LO.FirstOrder | ||
|
||
open LO.Entailment | ||
open ISigma1 FirstOrder FirstOrder.Arithmetic | ||
|
||
section | ||
|
||
variable {L : Language} {T : Theory L} {σ : Sentence L} | ||
|
||
@[simp] lemma Theory.eq_empty_toAxiom_empty : (∅ : Theory L).toAxiom = ∅ := by simp [Theory.toAxiom]; | ||
|
||
noncomputable def Theory.finite_conjunection (T_finite : T.Finite) : Sentence L := | ||
letI A := T.toAxiom; | ||
haveI A_finite : A.Finite := by apply Set.Finite.image; simpa; | ||
A_finite.toFinset.conj | ||
|
||
lemma iff_axiomProvable_empty_context_provable {A : Axiom L} : A ⊢! σ ↔ A *⊢[(∅ : Axiom L)]! σ := by | ||
constructor; | ||
. intro h; | ||
sorry; | ||
. intro h; | ||
sorry; | ||
|
||
lemma iff_provable₀_empty_context_provable : T ⊢!. σ ↔ (T.toAxiom) *⊢[(∅ : Theory L).toAxiom]! σ := by | ||
apply Iff.trans iff_axiomProvable_empty_context_provable; | ||
simp; | ||
|
||
variable [DecidableEq (Sentence L)] | ||
|
||
lemma firstorder_provable_of_finite_provable (T_finite : T.Finite) : T ⊢!. σ ↔ ∅ ⊢!. (Theory.finite_conjunection T_finite) ➝ σ := by | ||
apply Iff.trans ?_ FConj_DT.symm; | ||
apply Iff.trans iff_provable₀_empty_context_provable; | ||
simp; | ||
|
||
end | ||
|
||
namespace Arithmetic | ||
|
||
variable {T : ArithmeticTheory} [𝐈𝚺₁ ⪯ T] [Entailment.Consistent T] [T.SoundOnHierarchy 𝚺 1] | ||
variable {σ : Sentence _} | ||
|
||
open Classical in | ||
/-- Godel number of theorems of `T` is not computable. -/ | ||
theorem not_computable_theorems : ¬ComputablePred (fun n : ℕ ↦ ∃ σ : Sentence ℒₒᵣ, n = ⌜σ⌝ ∧ T ⊢!. σ) := by | ||
by_contra hC; | ||
let D : ℕ → Prop := fun n : ℕ ↦ ∃ σ : Semisentence ℒₒᵣ 1, n = ⌜σ⌝ ∧ T ⊬. σ/[⌜σ⌝]; | ||
have : ComputablePred D := by | ||
let f : ℕ → ℕ := λ n => if h : ∃ σ : Semisentence ℒₒᵣ 1, n = ⌜σ⌝ then ⌜(h.choose/[⌜h.choose⌝] : Sentence ℒₒᵣ)⌝ else 0; | ||
have : ComputablePred (λ x => ¬∃ σ, f x = ⌜σ⌝ ∧ T ⊢!. σ) := ComputablePred.range_subset (f := f) (by sorry) (ComputablePred.not hC); | ||
sorry; | ||
simpa [D] using re_complete (T := T) (ComputablePred.to_re this) (x := ⌜(codeOfREPred D)⌝); | ||
|
||
open Classical in | ||
/-- Godel number of theorems of first-order logic on `ℒₒᵣ` is not computable. -/ | ||
theorem firstorder_undecidability : ¬ComputablePred (fun n : ℕ ↦ ∃ σ : Sentence ℒₒᵣ, n = ⌜σ⌝ ∧ ∅ ⊢!. σ) := by | ||
by_contra h; | ||
apply @not_computable_theorems (T := 𝐏𝐀⁻) (by sorry) inferInstance inferInstance; | ||
sorry; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
end Arithmetic | ||
|
||
end LO.FirstOrder |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
明らかだとは思うがどうやればいいのかはわからない.