|
| 1 | +Require Export Undecidability.FOL.Syntax.Theories. |
| 2 | +Require Import Undecidability.FOL.Syntax.BinSig. |
| 3 | +Require Import FOL.ModelTheory.Core. |
| 4 | +Require Import FOL.ModelTheory.DCPre. |
| 5 | + |
| 6 | +(** * Reverse Analysis: DC-Delta *) |
| 7 | + |
| 8 | +Section DC. |
| 9 | + |
| 10 | + Existing Instance sig_empty. |
| 11 | + Existing Instance sig_binary. |
| 12 | + |
| 13 | + Fact Σ_countable: countable_sig. |
| 14 | + Proof. |
| 15 | + repeat split. |
| 16 | + - exists (fun _ => None). intros []. |
| 17 | + - exists (fun _ => Some tt). intros []. exists 42; eauto. |
| 18 | + - intros []. - intros [] []; firstorder. |
| 19 | + Qed. |
| 20 | + |
| 21 | + Variable A: Type. |
| 22 | + Variable a: A. |
| 23 | + Variable R: A -> A -> Prop. |
| 24 | + |
| 25 | + Instance interp__A : interp A := |
| 26 | + { |
| 27 | + i_func := fun F v => match F return A with end; |
| 28 | + i_atom := fun P v => R (hd v) (last v) |
| 29 | + }. |
| 30 | + |
| 31 | + Definition Model__A: model := |
| 32 | + {| |
| 33 | + domain := A; |
| 34 | + interp' := interp__A |
| 35 | + |}. |
| 36 | + |
| 37 | + Definition total_form := |
| 38 | + ∀ (∃ (atom _ _ _ _ tt (cons _ ($1) _ (cons _ ($0) _ (nil _))))). |
| 39 | + Definition forfor_form := |
| 40 | + (atom _ _ _ _ tt (cons _ ($1) _ (cons _ ($0) _ (nil _)))). |
| 41 | + |
| 42 | + Lemma total_sat: |
| 43 | + forall h, (forall x, exists y, R x y) -> Model__A ⊨[h] total_form. |
| 44 | + Proof. |
| 45 | + cbn; intros. |
| 46 | + destruct (H d) as [e P]. |
| 47 | + now exists e. |
| 48 | + Qed. |
| 49 | + |
| 50 | + Definition p {N} (α β: N): env N := |
| 51 | + fun n => match n with |
| 52 | + | 0 => β |
| 53 | + | _ => α end. |
| 54 | + |
| 55 | + Lemma forfor_sat {N} (h: N -> A) (α β: N): |
| 56 | + R (h α) (h β) <-> Model__A ⊨[(p α β) >> h] forfor_form. |
| 57 | + Proof. |
| 58 | + unfold ">>"; now cbn. |
| 59 | + Qed. |
| 60 | + |
| 61 | + Lemma exists_next: |
| 62 | + forall B (R': B -> B -> Prop), coutable_model B -> |
| 63 | + (forall x, exists y, R' x y) -> exists f: nat -> B, |
| 64 | + forall b, exists n, R' b (f n). |
| 65 | + Proof. |
| 66 | + intros B R' (f & h & sur) total. |
| 67 | + exists f. intro b. |
| 68 | + destruct (total b) as [c Rbc]. |
| 69 | + exists (h c). now rewrite sur. |
| 70 | + Qed. |
| 71 | + |
| 72 | + Section dec__R_full. |
| 73 | + |
| 74 | + Definition dec_R := forall x y, dec (R x y). |
| 75 | + |
| 76 | + Lemma LS_impl_DC: DLS -> dec_R -> DC_on' R. |
| 77 | + Proof using a. |
| 78 | + intros LS DecR total. |
| 79 | + destruct (LS sig_empty sig_binary Σ_countable Model__A a) as [N [(h & g & Hh) [f HN]]]. |
| 80 | + specialize (@total_sat ((fun _ => (h 42)) >> f) total ) as total'. |
| 81 | + apply HN in total'. |
| 82 | + assert (exists R', (forall x: N, (exists y: N, R' x y)) /\ (forall α β, R' α β <-> R (f α) (f β))). |
| 83 | + exists (fun x y => tt ₚ[ N] cons N x 1 (cons N y 0 (nil N))). |
| 84 | + split. intro x. now specialize(total' x). |
| 85 | + intros α β; rewrite forfor_sat. |
| 86 | + now unfold elementary_homomorphism in HN; rewrite <- HN. |
| 87 | + destruct H as [R' [P1 P2]]. |
| 88 | + assert (forall x y, dec (R' x y)) as dec__R'. |
| 89 | + { intros x y. destruct (DecR (f x) (f y)); firstorder. } |
| 90 | + assert (forall n : N, exists m : nat, h m = n) as Ht. |
| 91 | + { intro n. exists (g n). now rewrite Hh. } |
| 92 | + destruct (@DC_ω _ _ h Ht dec__R' P1 (h 42)) as [g' [case0 Choice]]. |
| 93 | + exists (g' >> f); unfold ">>". |
| 94 | + intro n'; now rewrite <- (P2 (g' n') (g' (S n'))). |
| 95 | + Qed. |
| 96 | + |
| 97 | + End dec__R_full. |
| 98 | + |
| 99 | +End DC. |
| 100 | + |
| 101 | +Section DCRes. |
| 102 | + |
| 103 | + Theorem LS_impl_DC_delta: DLS -> DC__Δ . |
| 104 | + Proof. |
| 105 | + intros H X R dec_R x tot_R. |
| 106 | + apply LS_impl_DC; eauto. |
| 107 | + Qed. |
| 108 | + |
| 109 | +End DCRes. |
| 110 | + |
| 111 | + |
| 112 | + |
| 113 | + |
| 114 | + |
| 115 | + |
| 116 | + |
| 117 | + |
| 118 | + |
| 119 | + |
| 120 | + |
| 121 | + |
| 122 | + |
| 123 | + |
| 124 | + |
| 125 | + |
| 126 | + |
| 127 | + |
0 commit comments