roseking's picture
Add lean source and binary files (part 60)
9dbc64e verified
Raw History Blame Contribute Delete
3.5 kB
11
def CylinderIn (U : Set Oracle) (s : List Bool) : Prop := ∀ G, Realizes s G → G ∈ U
13
theorem cylinderIn_denseOpen (U : Set Oracle) (ho : IsOpen U) (hd : Dense U) :
    DenseOpen (CylinderIn U) := by
proof · 12 lines
  constructor
  · intro s
    obtain ⟨H,hs,hHU⟩ := hd.inter_open_nonempty {G | Realizes s G} (realizes_isOpen s)
      ⟨fun i => s.getD i false,realizes_default s⟩
    obtain ⟨n,hn⟩ := cylinder_basis U ho H hHU
    refine ⟨initial H (max n s.length),?_,?_⟩
    · rw [←prefix_default s]
      simpa only [prefix_length] using initial_prefix (n := s.length) (m := max n s.length) (le_max_right _ _) hs
    · intro G hG
      exact hn G (((realizes_initial H G _).mp hG).mono (le_max_left _ _))
  · intro s t hst hs G hG
    exact hs G (realizes_mono hst hG)
28
theorem generic_subset_of_residual (S : Set Oracle) (hS : S ∈ residual Oracle) :
    ∃ D : ℕ → List Bool → Prop, (∀ n, DenseOpen (D n)) ∧
      ∀ G, GenericFor D G → G ∈ S := by
proof · 17 lines
  classical
  obtain ⟨T,hTo,hTd,hTc,hsub⟩ := mem_residual_iff.mp hS
  let : Countable T := hTc.to_subtype
  let : Encodable T := Encodable.ofCountable T
  let V : ℕ → Set Oracle := fun n => ((decode (α := T) n).map Subtype.val).getD univ
  have hV (n : ℕ) : IsOpen (V n) ∧ Dense (V n) := by
    cases he : decode (α := T) n with
    | none => simp [V,he]
    | some t => simpa [V,he] using And.intro (hTo t.val t.property) (hTd t.val t.property)
  refine ⟨fun n => CylinderIn (V n),fun n => cylinderIn_denseOpen _ (hV n).1 (hV n).2,?_⟩
  intro G hG
  apply hsub
  intro t ht
  let k : T := ⟨t,ht⟩
  obtain ⟨s,hs,hGs⟩ := hG (encode k)
  have hh := hs G hGs
  simpa [V,k] using hh
49
theorem borel_generic_truth (S : Set Oracle) (hS : MeasurableSet S) :
    ∃ U : Set Oracle, IsOpen U ∧ ∃ D : ℕ → List Bool → Prop,
      (∀ n, DenseOpen (D n)) ∧ ∀ G, GenericFor D G → (G ∈ S ↔ G ∈ U) := by
proof · 4 lines
  obtain ⟨U,hU,hSU⟩ := hS.residualEq_isOpen
  obtain ⟨D,hD,hDS⟩ := generic_subset_of_residual {G | G ∈ S ↔ G ∈ U}
    (Filter.eventuallyEqSet_iff.mp hSU)
  exact ⟨U,hU,D,hD,hDS⟩
57
def triple (G : Oracle) : Oracle × Oracle × Oracle :=
body · 3 lines
  (PairGenericSelection.column false G,
    PairGenericSelection.column false (PairGenericSelection.column true G),
    PairGenericSelection.column true (PairGenericSelection.column true G))
62
theorem triple_measurable : Measurable triple :=
proof · 3 lines
  (PairGenericSelection.column_measurable false).prodMk
    (((PairGenericSelection.column_measurable false).comp (PairGenericSelection.column_measurable true)).prodMk
      ((PairGenericSelection.column_measurable true).comp (PairGenericSelection.column_measurable true)))
67
theorem sourceEquation_generic_truth (p : OracleCode) (P : Oracle) :
    ∃ U : Set Oracle, IsOpen U ∧ ∃ D : ℕ → List Bool → Prop,
      (∀ n, DenseOpen (D n)) ∧ ∀ G, GenericFor D G →
        (GenericIdentity.SourceEquation p P (triple G) ↔ G ∈ U) :=
proof · 1 line
  borel_generic_truth _ ((GenericIdentity.sourceEquation_measurable p P).preimage triple_measurable)