Documentation

LeanPool.DomainTheory.Neighborhood.Theorem75

Theorem 7.5 (Scott 1981, PRG-19, Β§7) β€” (π’Ÿβ‚€ β†’ π’Ÿβ‚) is effectively given #

Following Dana Scott, Lectures on a Mathematical Theory of Computation, PRG-19, Lecture VII.

Theorem 7.5. If π’Ÿβ‚€ and π’Ÿβ‚ are effectively given, then so is (π’Ÿβ‚€ β†’ π’Ÿβ‚). The combinators eval and curry are computable, provided all the domains involved are effectively given. The computable elements f ∈ |π’Ÿβ‚€ β†’ π’Ÿβ‚| are exactly the computable maps f : π’Ÿβ‚€ β†’ π’Ÿβ‚.

This file builds the theorem in green, audited, choice-free milestones (see HANDOFF.md).

Milestone 1 β€” Proposition 3.9(i), the consistency condition (forward, #

choice-free)

The keystone is Scott's 3.9(i): a function-space neighbourhood β‹‚[Xα΅’,Yα΅’] is non-empty iff for every subset I of indices with {Xα΅’ ∣ i∈I} consistent in π’Ÿβ‚€, the outputs {Yα΅’ ∣ i∈I} are consistent in π’Ÿβ‚. We model a subset by a sublist sub βŠ‘ L (this is what the eventual primitive-recursive decider enumerates, one entry/bit at a time), and the intersection of a finite list of neighbourhoods by interList. The forward direction β€” non-empty ⟹ the subset condition β€” is choice-free: given a witness map f ∈ stepFun L and a common lower neighbourhood Z of the selected inputs, f relates Z to the intersection of the selected outputs (a finite inter_right fold over the explicit selection, so no undecidable X βŠ† Xα΅’ case-split is needed), whence that intersection is a neighbourhood by f.rel_cod.

(The reverse direction is genuinely decidable only relative to the presentations β€” it needs π’Ÿβ‚€-inclusion to be decidable to single out {i ∣ X βŠ† Xα΅’} β€” and is developed with the decider.)

interList β€” the intersection of a finite list of neighbourhoods (with a #

base).

def Domain.Neighborhood.interList {Ξ² : Type u_2} (base : Set Ξ²) :
List (Set Ξ²) β†’ Set Ξ²

The intersection of the sets in M, taken inside the base set base (so the empty list gives base, matching the convention 1.1a where the empty intersection is Ξ”).

Equations
Instances For
    @[simp]
    theorem Domain.Neighborhood.interList_nil {Ξ² : Type u_2} (base : Set Ξ²) :
    interList base [] = base
    theorem Domain.Neighborhood.interList_cons {Ξ² : Type u_2} (base Y : Set Ξ²) (M : List (Set Ξ²)) :
    interList base (Y :: M) = Y ∩ interList base M
    theorem Domain.Neighborhood.mem_interList {Ξ² : Type u_2} {base : Set Ξ²} {M : List (Set Ξ²)} {z : Ξ²} :
    z ∈ interList base M ↔ z ∈ base ∧ βˆ€ Y ∈ M, z ∈ Y
    theorem Domain.Neighborhood.interList_subset_base {Ξ² : Type u_2} {base : Set Ξ²} {M : List (Set Ξ²)} :
    interList base M βŠ† base

    Milestone 1 β€” the forward direction of 3.9(i), choice-free. #

    theorem Domain.Neighborhood.rel_interList_of_selection {Ξ± : Type u_1} {Ξ² : Type u_2} {Vβ‚€ : NeighborhoodSystem Ξ±} {V₁ : NeighborhoodSystem Ξ²} {f : ApproximableMap Vβ‚€ V₁} {Z : Set Ξ±} (hZ : Vβ‚€.mem Z) {sub : List (Set Ξ± Γ— Set Ξ²)} (hmem : βˆ€ p ∈ sub, f.rel p.1 p.2) (hZle : βˆ€ p ∈ sub, Z βŠ† p.1) :
    f.rel Z (interList V₁.master (List.map Prod.snd sub))

    A witness map f ∈ stepFun L relates a common lower neighbourhood Z of the selected inputs to the intersection of the selected outputs. The selection sub is processed entry-by-entry with inter_right, so the proof is choice-free (no inclusion case-split).

    theorem Domain.Neighborhood.interList_mem_of_stepFun_nonempty {Ξ± : Type u_1} {Ξ² : Type u_2} {Vβ‚€ : NeighborhoodSystem Ξ±} {V₁ : NeighborhoodSystem Ξ²} {L : List (Set Ξ± Γ— Set Ξ²)} (h : (stepFun L).Nonempty) {sub : List (Set Ξ± Γ— Set Ξ²)} (hsub : sub.Sublist L) {Z : Set Ξ±} (hZ : Vβ‚€.mem Z) (hZle : βˆ€ p ∈ sub, Z βŠ† p.1) :
    V₁.mem (interList V₁.master (List.map Prod.snd sub))

    Proposition 3.9(i) (Scott 1981, PRG-19), forward direction β€” choice-free. If the function-space neighbourhood stepFun L is non-empty, then for every selection sub βŠ‘ L whose inputs admit a common lower neighbourhood Z ∈ π’Ÿβ‚€, the intersection of the selected outputs is a neighbourhood of π’Ÿβ‚.

    Milestone 2 β€” the consistency characterization over coded entry-lists. #

    A function-space neighbourhood is presented by a list el : List β„• of entry codes: each e ∈ el codes a step pair [X_{e.1}, Y_{e.2}] via Nat.pair. funListOf turns el into the list of step pairs, and stepFun (funListOf el) is the neighbourhood β‹‚[X_{eα΅’.1}, Y_{eα΅’.2}].

    The characterization stepFun_funListOf_nonempty_iff is Scott's 3.9(i): the neighbourhood is non-empty iff for every sub-selection sub βŠ‘ el whose inputs have a common lower neighbourhood Z ∈ π’Ÿβ‚€, the intersection of the selected outputs is a neighbourhood of π’Ÿβ‚. The reverse direction builds the least map leastMap; its consistency hypothesis is discharged input-by-input by filtering el with the (choice-free) decidable π’Ÿβ‚€-inclusion test supplied by the presentation Pβ‚€, so it stays βŠ† {propext, Quot.sound}.

    def Domain.Neighborhood.funPair {Ξ± : Type u_1} {Ξ² : Type u_2} {Vβ‚€ : NeighborhoodSystem Ξ±} {V₁ : NeighborhoodSystem Ξ²} (Pβ‚€ : ComputablePresentation Vβ‚€) (P₁ : ComputablePresentation V₁) (e : β„•) :
    Set Ξ± Γ— Set Ξ²

    The step pair coded by an entry e: (X_{e.unpair.1}, Y_{e.unpair.2}).

    Equations
    Instances For
      @[simp]
      theorem Domain.Neighborhood.funPair_fst {Ξ± : Type u_1} {Ξ² : Type u_2} {Vβ‚€ : NeighborhoodSystem Ξ±} {V₁ : NeighborhoodSystem Ξ²} (Pβ‚€ : ComputablePresentation Vβ‚€) (P₁ : ComputablePresentation V₁) (e : β„•) :
      (funPair Pβ‚€ P₁ e).1 = Pβ‚€.X (Nat.unpair e).1
      @[simp]
      theorem Domain.Neighborhood.funPair_snd {Ξ± : Type u_1} {Ξ² : Type u_2} {Vβ‚€ : NeighborhoodSystem Ξ±} {V₁ : NeighborhoodSystem Ξ²} (Pβ‚€ : ComputablePresentation Vβ‚€) (P₁ : ComputablePresentation V₁) (e : β„•) :
      (funPair Pβ‚€ P₁ e).2 = P₁.X (Nat.unpair e).2
      def Domain.Neighborhood.funListOf {Ξ± : Type u_1} {Ξ² : Type u_2} {Vβ‚€ : NeighborhoodSystem Ξ±} {V₁ : NeighborhoodSystem Ξ²} (Pβ‚€ : ComputablePresentation Vβ‚€) (P₁ : ComputablePresentation V₁) (el : List β„•) :
      List (Set Ξ± Γ— Set Ξ²)

      The list of step pairs coded by an entry-list el.

      Equations
      Instances For
        theorem Domain.Neighborhood.funListOf_valid {Ξ± : Type u_1} {Ξ² : Type u_2} {Vβ‚€ : NeighborhoodSystem Ξ±} {V₁ : NeighborhoodSystem Ξ²} (Pβ‚€ : ComputablePresentation Vβ‚€) (P₁ : ComputablePresentation V₁) (el : List β„•) (p : Set Ξ± Γ— Set Ξ²) :
        p ∈ funListOf Pβ‚€ P₁ el β†’ Vβ‚€.mem p.1 ∧ V₁.mem p.2
        theorem Domain.Neighborhood.stepFun_funListOf_nonempty_iff {Ξ± : Type u_1} {Ξ² : Type u_2} {Vβ‚€ : NeighborhoodSystem Ξ±} {V₁ : NeighborhoodSystem Ξ²} (Pβ‚€ : ComputablePresentation Vβ‚€) (P₁ : ComputablePresentation V₁) (el : List β„•) :
        (stepFun (funListOf Pβ‚€ P₁ el)).Nonempty ↔ βˆ€ (sub : List β„•), sub.Sublist el β†’ (βˆƒ (Z : Set Ξ±), Vβ‚€.mem Z ∧ βˆ€ e ∈ sub, Z βŠ† Pβ‚€.X (Nat.unpair e).1) β†’ V₁.mem (interList V₁.master (List.map (fun (e : β„•) => P₁.X (Nat.unpair e).2) sub))

        Proposition 3.9(i) (Scott 1981, PRG-19), over coded entry-lists β€” choice-free. The function-space neighbourhood β‹‚[X_{eα΅’}, Y_{eα΅’}] coded by el is non-empty iff for every sub-selection sub βŠ‘ el whose inputs {X_{e} ∣ e ∈ sub} admit a common lower neighbourhood Z ∈ π’Ÿβ‚€, the intersection of the selected outputs {Y_{e} ∣ e ∈ sub} is a neighbourhood of π’Ÿβ‚.

        • (⟹) is interList_mem_of_stepFun_nonempty (Milestone 1), pushed through funPair.
        • (<=) builds leastMap; its consistency hypothesis hcons is discharged for each input X' by filtering el with the decidable π’Ÿβ‚€-inclusion X' βŠ† X_e (supplied choice-free by Pβ‚€), so that interYs Δ₁ (funListOf el) X' is exactly the intersection of the selected outputs.

        Milestone 3a β€” deciding consistency of a finite index set via the #

        inter-chain.

        To decide whether a finite list of neighbourhood indices js is consistent in π’Ÿ (i.e. whether β‹‚{X_j ∣ j ∈ js} is a neighbourhood) we fold the presentation's primitive-recursive inter along js, starting from masterIdx, to obtain an index idxchain js. The crisp characterization is:

        js is consistent iff X_{idxchain js} βŠ† X_j for every j ∈ js.

        The point is that X_{idxchain js} is always a neighbourhood (mem_X), so if it sits inside every X_j it witnesses consistency; conversely, when consistent, inter's spec (and the fact that a subset of a consistent set is consistent) makes the chain compute the genuine intersection. This replaces any consistency-flag bookkeeping by a single inter-fold plus a bounded inclusion check β€” all choice-free.

        def Domain.Neighborhood.interFrom {Ξ± : Type u_1} {V : NeighborhoodSystem Ξ±} (P : ComputablePresentation V) (A : Set Ξ±) :
        List β„• β†’ Set Ξ±

        The running intersection of A with the neighbourhoods X_j (j ∈ js), left-accumulated to match List.foldl.

        Equations
        Instances For
          theorem Domain.Neighborhood.mem_interFrom {Ξ± : Type u_1} {V : NeighborhoodSystem Ξ±} (P : ComputablePresentation V) {A : Set Ξ±} {js : List β„•} {z : Ξ±} :
          z ∈ interFrom P A js ↔ z ∈ A ∧ βˆ€ j ∈ js, z ∈ P.X j
          theorem Domain.Neighborhood.interFrom_subset {Ξ± : Type u_1} {V : NeighborhoodSystem Ξ±} (P : ComputablePresentation V) {A : Set Ξ±} {js : List β„•} :
          interFrom P A js βŠ† A
          theorem Domain.Neighborhood.interFrom_mem_of_witness {Ξ± : Type u_1} {V : NeighborhoodSystem Ξ±} (P : ComputablePresentation V) {A : Set Ξ±} {js : List β„•} {Z : Set Ξ±} (hZ : V.mem Z) (hZsub : Z βŠ† interFrom P A js) (hA : V.mem A) :
          V.mem (interFrom P A js)

          A finite running intersection with a neighbourhood inside it is itself a neighbourhood.

          theorem Domain.Neighborhood.interFrom_eq_of_foldl {Ξ± : Type u_1} {V : NeighborhoodSystem Ξ±} (P : ComputablePresentation V) (js : List β„•) (A : Set Ξ±) (a : β„•) :
          P.X a = A β†’ V.mem A β†’ V.mem (interFrom P A js) β†’ P.X (List.foldl (fun (acc j : β„•) => P.inter acc j) a js) = interFrom P A js

          The fold of inter along js (starting from a, with X a = A) computes the running intersection interFrom A js β€” provided that intersection is consistent (so each prefix is too, by inter_spec).

          The inter-chain index of js: inter-fold from masterIdx.

          Equations
          Instances For
            theorem Domain.Neighborhood.idxchain_spec {Ξ± : Type u_1} {V : NeighborhoodSystem Ξ±} (P : ComputablePresentation V) {js : List β„•} (h : V.mem (interFrom P V.master js)) :
            P.X (idxchain P js) = interFrom P V.master js

            When js is consistent, the inter-chain index genuinely indexes β‹‚{X_j ∣ j ∈ js}.

            theorem Domain.Neighborhood.consChain_iff {Ξ± : Type u_1} {V : NeighborhoodSystem Ξ±} (P : ComputablePresentation V) (js : List β„•) :
            (βˆ€ j ∈ js, P.X (idxchain P js) βŠ† P.X j) ↔ V.mem (interFrom P V.master js)

            Consistency via the inter-chain (choice-free). A finite index set js is consistent β€” i.e. β‹‚{X_j ∣ j ∈ js} is a neighbourhood β€” exactly when the always-a-neighbourhood X_{idxchain js} sits inside every X_j (j ∈ js).

            Milestone 3b β€” bitmask sublist selection. #

            The eventual decider enumerates the subsets of an entry-list one bit at a time: bitSelect L b keeps the entries of L whose position is set in the binary expansion of b (low bit = head). Every sublist arises as some bitSelect L b with b < 2 ^ L.length (exists_bitSelect_lt), so a universal statement over sublists is a bounded universal statement over bitmasks (forall_sublist_iff_forall_bitmask) β€” and bounded-βˆ€ of a recursively decidable predicate is recursively decidable (RecDecidable.bForall). All choice-free.

            The sublist of L selected by the bitmask b (low bit = head).

            Equations
            Instances For
              theorem Domain.Neighborhood.bitSelect_cons (e : β„•) (L : List β„•) (b : β„•) :
              bitSelect (e :: L) b = if b % 2 = 1 then e :: bitSelect L (b / 2) else bitSelect L (b / 2)
              theorem Domain.Neighborhood.exists_bitSelect_lt {L sub : List β„•} (hsub : sub.Sublist L) :
              βˆƒ b < 2 ^ L.length, bitSelect L b = sub
              theorem Domain.Neighborhood.forall_sublist_iff_forall_bitmask (c : β„•) (p : List β„• β†’ Prop) :
              (βˆ€ (sub : List β„•), sub.Sublist (Recursive.decodeList c) β†’ p sub) ↔ βˆ€ b < 2 ^ c, p (bitSelect (Recursive.decodeList c) b)

              A universal statement over all sublists of decodeList c is a bounded universal over bitmasks b < 2 ^ c (using (decodeList c).length ≀ c).

              Milestone 3c β€” the single-pass consistency fold (section ConsFold, #

              generic over P).

              To decide whether a bitmask-selected sublist of an index list is consistent, we fold once over the list threading a state s = pair b (pair idx flag): b the remaining bitmask, idx an index of the running intersection β‹‚{X_j ∣ j selected so far}, and flag ∈ {0,1} recording whether every prefix has been consistent. At a selected entry we set idx := P.inter idx (projFn x) and flag := flag ∧ [P.cons_computable says X_idx ∩ X_{projFn x} is consistent]. The headline consUpd_foldl_spec shows the final flag is 1 iff the selected intersection is a neighbourhood (using inter_spec to keep X_idx exact along the consistent prefix, and the fact that the full intersection being a neighbourhood forces every prefix to be one). All choice-free.

              def Domain.Neighborhood.consUpd {Ξ± : Type u_1} {V : NeighborhoodSystem Ξ±} (P : ComputablePresentation V) (projFn fc : β„• β†’ β„•) (s x : β„•) :

              One fold step (see the section doc). projFn extracts the relevant component index from an entry; fc is P.cons_computable's {0,1} consistency tester.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                theorem Domain.Neighborhood.consUpd_eval {Ξ± : Type u_1} {V : NeighborhoodSystem Ξ±} (P : ComputablePresentation V) (projFn fc : β„• β†’ β„•) (b idx flag x : β„•) :
                consUpd P projFn fc (Nat.pair b (Nat.pair idx flag)) x = Recursive.selectFn (b % 2) (Nat.pair (b / 2) (Nat.pair (P.inter idx (projFn x)) (Recursive.selectFn flag (Recursive.isOne (fc (Nat.pair idx (projFn x)))) 0))) (Nat.pair (b / 2) (Nat.pair idx flag))
                theorem Domain.Neighborhood.consUpd_foldl_flag_zero {Ξ± : Type u_1} {V : NeighborhoodSystem Ξ±} (P : ComputablePresentation V) (projFn fc : β„• β†’ β„•) (el : List β„•) (b a : β„•) :
                (Nat.unpair (Nat.unpair (List.foldl (fun (s x : β„•) => consUpd P projFn fc s x) (Nat.pair b (Nat.pair a 0)) el)).2).2 = 0

                Once the flag is 0, the fold keeps it 0 (inconsistency persists).

                theorem Domain.Neighborhood.consUpd_foldl_spec {Ξ± : Type u_1} {V : NeighborhoodSystem Ξ±} (P : ComputablePresentation V) (projFn fc : β„• β†’ β„•) (hfc : βˆ€ (s : β„•), fc s = 1 ↔ βˆƒ (k : β„•), P.X k βŠ† P.X (Nat.unpair s).1 ∩ P.X (Nat.unpair s).2) (el : List β„•) (b a : β„•) :
                (Nat.unpair (Nat.unpair (List.foldl (fun (s x : β„•) => consUpd P projFn fc s x) (Nat.pair b (Nat.pair a 1)) el)).2).2 = 1 ↔ V.mem (interFrom P (P.X a) (List.map projFn (bitSelect el b)))

                Single-pass consistency fold β€” correctness. Starting from index a (an index of X a) with flag 1, the final flag is 1 iff the running intersection of X a with the selected components is a neighbourhood. Choice-free.

                def Domain.Neighborhood.consStp {Ξ± : Type u_1} {V : NeighborhoodSystem Ξ±} (P : ComputablePresentation V) (projFn fc : β„• β†’ β„•) (w : β„•) :

                foldCode-shaped wrapper of consUpd (state lives in w.unpair.2.unpair.1, entry in w.unpair.1).

                Equations
                Instances For
                  def Domain.Neighborhood.consCharAt {Ξ± : Type u_1} {V : NeighborhoodSystem Ξ±} (P : ComputablePresentation V) (projFn fc : β„• β†’ β„•) (w : β„•) :

                  The {0,1} characteristic function of the bitmask-selected-sublist consistency test, packaged through foldCode so it is primitive recursive. Input w = pair b c (bitmask b, list code c).

                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For
                    theorem Domain.Neighborhood.consCharAt_spec {Ξ± : Type u_1} {V : NeighborhoodSystem Ξ±} (P : ComputablePresentation V) (projFn fc : β„• β†’ β„•) (hfc : βˆ€ (s : β„•), fc s = 1 ↔ βˆƒ (k : β„•), P.X k βŠ† P.X (Nat.unpair s).1 ∩ P.X (Nat.unpair s).2) (w : β„•) :
                    theorem Domain.Neighborhood.primrec_consStp {Ξ± : Type u_1} {V : NeighborhoodSystem Ξ±} (P : ComputablePresentation V) {projFn fc : β„• β†’ β„•} (hprojp : Nat.Primrec projFn) (hfcp : Nat.Primrec fc) :
                    Nat.Primrec (consStp P projFn fc)
                    theorem Domain.Neighborhood.primrec_consCharAt {Ξ± : Type u_1} {V : NeighborhoodSystem Ξ±} (P : ComputablePresentation V) {projFn fc : β„• β†’ β„•} (hprojp : Nat.Primrec projFn) (hfcp : Nat.Primrec fc) :
                    Nat.Primrec (consCharAt P projFn fc)
                    theorem Domain.Neighborhood.consFold_decidable {Ξ± : Type u_1} {V : NeighborhoodSystem Ξ±} (P : ComputablePresentation V) (projFn fc : β„• β†’ β„•) (hfc : βˆ€ (s : β„•), fc s = 1 ↔ βˆƒ (k : β„•), P.X k βŠ† P.X (Nat.unpair s).1 ∩ P.X (Nat.unpair s).2) (hprojp : Nat.Primrec projFn) (hfcp : Nat.Primrec fc) :

                    Consistency of the bitmask-selected sublist is recursively decidable. Choice-free.

                    Milestone 3d β€” assembling the function-space consistency decider #

                    funCons_decidable.

                    stepFun_funListOf_nonempty_iff (Milestone 2) characterises non-emptiness as a universal statement over sublists; forall_sublist_iff_forall_bitmask turns it into a bounded universal over bitmasks b < 2^c; antecedent_cons_iff / funConsequent_eq rewrite the per-bitmask antecedent and consequent into the interFrom form decided by consFold_decidable. The implication of two recursively decidable predicates is recursively decidable (.not/.or/.em, choice-free), and a bounded universal of a recursively decidable predicate is recursively decidable (RecDecidable.bForall).

                    interList over js.map X is the same set as the interFrom-chain over js.

                    theorem Domain.Neighborhood.antecedent_cons_iff {Ξ± : Type u_1} {Vβ‚€ : NeighborhoodSystem Ξ±} (Pβ‚€ : ComputablePresentation Vβ‚€) (sub : List β„•) :
                    (βˆƒ (Z : Set Ξ±), Vβ‚€.mem Z ∧ βˆ€ e ∈ sub, Z βŠ† Pβ‚€.X (Nat.unpair e).1) ↔ Vβ‚€.mem (interFrom Pβ‚€ Vβ‚€.master (List.map (fun (e : β„•) => (Nat.unpair e).1) sub))

                    The antecedent of Prop 3.9(i) β€” {X_{e.1} ∣ e ∈ sub} admits a common lower neighbourhood β€” is exactly consistency of {e.1 ∣ e ∈ sub} in π’Ÿβ‚€ (in interFrom form). Choice-free.

                    theorem Domain.Neighborhood.funConsequent_eq {Ξ² : Type u_2} {V₁ : NeighborhoodSystem Ξ²} (P₁ : ComputablePresentation V₁) (sub : List β„•) :
                    interList V₁.master (List.map (fun (e : β„•) => P₁.X (Nat.unpair e).2) sub) = interFrom P₁ V₁.master (List.map (fun (e : β„•) => (Nat.unpair e).2) sub)

                    The consequent of Prop 3.9(i), rewritten from interList to interFrom form.

                    theorem Domain.Neighborhood.funCons_iff {Ξ± : Type u_1} {Ξ² : Type u_2} {Vβ‚€ : NeighborhoodSystem Ξ±} {V₁ : NeighborhoodSystem Ξ²} (Pβ‚€ : ComputablePresentation Vβ‚€) (P₁ : ComputablePresentation V₁) (c : β„•) :
                    (stepFun (funListOf Pβ‚€ P₁ (Recursive.decodeList c))).Nonempty ↔ βˆ€ b < 2 ^ c, Vβ‚€.mem (interFrom Pβ‚€ Vβ‚€.master (List.map (fun (e : β„•) => (Nat.unpair e).1) (bitSelect (Recursive.decodeList c) b))) β†’ V₁.mem (interFrom P₁ V₁.master (List.map (fun (e : β„•) => (Nat.unpair e).2) (bitSelect (Recursive.decodeList c) b)))

                    Proposition 3.9(i) as a bounded bitmask quantifier. The function-space neighbourhood coded by decodeList c is non-empty iff for every bitmask b < 2^c, consistency of the selected inputs in π’Ÿβ‚€ forces consistency of the selected outputs in π’Ÿβ‚. Choice-free.

                    theorem Domain.Neighborhood.funCons_decidable {Ξ± : Type u_1} {Ξ² : Type u_2} {Vβ‚€ : NeighborhoodSystem Ξ±} {V₁ : NeighborhoodSystem Ξ²} (Pβ‚€ : ComputablePresentation Vβ‚€) (P₁ : ComputablePresentation V₁) (fc0 fc1 : β„• β†’ β„•) (hfc0 : βˆ€ (s : β„•), fc0 s = 1 ↔ βˆƒ (k : β„•), Pβ‚€.X k βŠ† Pβ‚€.X (Nat.unpair s).1 ∩ Pβ‚€.X (Nat.unpair s).2) (hfc1 : βˆ€ (s : β„•), fc1 s = 1 ↔ βˆƒ (k : β„•), P₁.X k βŠ† P₁.X (Nat.unpair s).1 ∩ P₁.X (Nat.unpair s).2) (hfc0p : Nat.Primrec fc0) (hfc1p : Nat.Primrec fc1) :

                    The function-space consistency relation is recursively decidable. Given the binary consistency deciders fc0/fc1 of the two presentations, (stepFun (funListOf (decodeList c))) is non-empty is recursively decidable in c. Choice-free.

                    Milestone 4 β€” appendCode (list append on entry codes). #

                    X n ∩ X m = stepFun (L_n ++ L_m), so the presentation's inter will splice two entry-lists. We fold one code onto another (prepending each entry), giving appendCode a b whose decoded list is (decodeList b).reverse ++ decodeList a; since stepFun is an intersection (order- and duplicate-invariant), this codes X a ∩ X b regardless of the reversal. All choice-free.

                    Prepend the entry x onto the list coded by acc.

                    Equations
                    Instances For

                      appendCode a b codes (decodeList b).reverse ++ decodeList a.

                      Equations
                      Instances For
                        theorem Domain.Neighborhood.funListOf_append {Ξ± : Type u_1} {Ξ² : Type u_2} {Vβ‚€ : NeighborhoodSystem Ξ±} {V₁ : NeighborhoodSystem Ξ²} (Pβ‚€ : ComputablePresentation Vβ‚€) (P₁ : ComputablePresentation V₁) (la lb : List β„•) :
                        funListOf Pβ‚€ P₁ (la ++ lb) = funListOf Pβ‚€ P₁ la ++ funListOf Pβ‚€ P₁ lb
                        theorem Domain.Neighborhood.stepFun_funListOf_appendCode {Ξ± : Type u_1} {Ξ² : Type u_2} {Vβ‚€ : NeighborhoodSystem Ξ±} {V₁ : NeighborhoodSystem Ξ²} (Pβ‚€ : ComputablePresentation Vβ‚€) (P₁ : ComputablePresentation V₁) (a b : β„•) :

                        stepFun (funListOf (decodeList (appendCode a b))) is exactly X a ∩ X b at the level of the underlying step-intersections.

                        Milestone 5 β€” the function-space inclusion characterization (choice-free). #

                        stepFun La βŠ† stepFun Lb iff βˆ€ (X',Y') ∈ Lb, β‹‚{Y ∣ X' βŠ† X, (X,Y)∈La} βŠ† Y' (Scott, via the least map leastMap/3.9(ii)). The forward direction is choice-free (test the least map). The backward direction needs f.rel X' (interYs Δ₁ La X') for arbitrary f ∈ stepFun La β€” the library rel_interYs proves this classically (by_cases X' βŠ† Xα΅’), so we re-prove it choice-free for the presented list funListOf el, replacing the case split by Pβ‚€.incl_computable's recursive decidability (.em).

                        theorem Domain.Neighborhood.funListOf_cons {Ξ± : Type u_1} {Ξ² : Type u_2} {Vβ‚€ : NeighborhoodSystem Ξ±} {V₁ : NeighborhoodSystem Ξ²} (Pβ‚€ : ComputablePresentation Vβ‚€) (P₁ : ComputablePresentation V₁) (e : β„•) (el : List β„•) :
                        funListOf Pβ‚€ P₁ (e :: el) = funPair Pβ‚€ P₁ e :: funListOf Pβ‚€ P₁ el
                        theorem Domain.Neighborhood.rel_interYs_funList {Ξ± : Type u_1} {Ξ² : Type u_2} {Vβ‚€ : NeighborhoodSystem Ξ±} {V₁ : NeighborhoodSystem Ξ²} (Pβ‚€ : ComputablePresentation Vβ‚€) (P₁ : ComputablePresentation V₁) {f : ApproximableMap Vβ‚€ V₁} {el : List β„•} (hf : f ∈ stepFun (funListOf Pβ‚€ P₁ el)) (n' : β„•) :
                        f.rel (Pβ‚€.X n') (interYs V₁.master (funListOf Pβ‚€ P₁ el) (Pβ‚€.X n'))

                        Choice-free rel_interYs for a presented list. Any f ∈ stepFun (funListOf el) relates each Xβ‚€_{n'} to the intersection of the relevant outputs interYs Δ₁ (funListOf el) (Xβ‚€_{n'}). The case split on Xβ‚€_{n'} βŠ† Xβ‚€_{e.1} is discharged by Pβ‚€.incl_computable.em (no Classical.choice).

                        theorem Domain.Neighborhood.interYs_funList_mem_of_nonempty {Ξ± : Type u_1} {Ξ² : Type u_2} {Vβ‚€ : NeighborhoodSystem Ξ±} {V₁ : NeighborhoodSystem Ξ²} (Pβ‚€ : ComputablePresentation Vβ‚€) (P₁ : ComputablePresentation V₁) {ea : List β„•} (h : (stepFun (funListOf Pβ‚€ P₁ ea)).Nonempty) {X : Set Ξ±} (hX : Vβ‚€.mem X) :
                        V₁.mem (interYs V₁.master (funListOf Pβ‚€ P₁ ea) X)

                        If stepFun (funListOf ea) is non-empty, then interYs Δ₁ (funListOf ea) X is a neighbourhood of π’Ÿβ‚ for every X ∈ π’Ÿβ‚€ (the consistency hypothesis needed by leastMap). Choice-free.

                        theorem Domain.Neighborhood.stepFun_funListOf_subset_iff {Ξ± : Type u_1} {Ξ² : Type u_2} {Vβ‚€ : NeighborhoodSystem Ξ±} {V₁ : NeighborhoodSystem Ξ²} (Pβ‚€ : ComputablePresentation Vβ‚€) (P₁ : ComputablePresentation V₁) {ea eb : List β„•} (hcons : βˆ€ {X : Set Ξ±}, Vβ‚€.mem X β†’ V₁.mem (interYs V₁.master (funListOf Pβ‚€ P₁ ea) X)) :
                        stepFun (funListOf Pβ‚€ P₁ ea) βŠ† stepFun (funListOf Pβ‚€ P₁ eb) ↔ βˆ€ e' ∈ eb, interYs V₁.master (funListOf Pβ‚€ P₁ ea) (Pβ‚€.X (Nat.unpair e').1) βŠ† P₁.X (Nat.unpair e').2

                        Function-space inclusion characterisation (choice-free). With ea consistent (so the least map exists), stepFun (funListOf ea) βŠ† stepFun (funListOf eb) iff for every entry e' ∈ eb, the intersection of the ea-outputs relevant to the input Xβ‚€_{e'.1} is contained in X₁_{e'.2}.

                        Milestone 5b β€” the function-space inclusion / equality / consistency #

                        deciders.

                        We now turn the choice-free characterization of Milestone 5a into recursive deciders for the function-space presentation. Two small generic facts first; then the interYs-index fold (a conditional inter-chain over π’Ÿβ‚, gated by the decidable π’Ÿβ‚€-inclusion test); then the deciders themselves. All choice-free.

                        selectFn driven by isOne is a Nat-equality if (choice-free; decEq on β„•).

                        decodeList inverts encodeList: every list is the decoding of its code.

                        The interYs-index fold: a conditional inter-chain over π’Ÿβ‚. #

                        For a presented list funListOf (decodeList a) and a π’Ÿβ‚€-index k, the set interYs Δ₁ (funListOf (decodeList a)) (Xβ‚€_k) is the intersection of the outputs X₁_{e.2} over the entries e of decodeList a whose input dominates Xβ‚€_k (Xβ‚€_k βŠ† Xβ‚€_{e.1}). We compute an index of it by folding P₁.inter over decodeList a, intersecting at an entry exactly when the (decidable) inclusion test fires. condSet k A el is the running set; interYsFoldl_spec is the index correctness (when the result is consistent), mirroring interFrom_eq_of_foldl.

                        def Domain.Neighborhood.condSet {Ξ± : Type u_1} {Ξ² : Type u_2} {Vβ‚€ : NeighborhoodSystem Ξ±} {V₁ : NeighborhoodSystem Ξ²} (Pβ‚€ : ComputablePresentation Vβ‚€) (P₁ : ComputablePresentation V₁) (k : β„•) (A : Set Ξ²) (el : List β„•) :
                        Set Ξ²

                        The running set of the conditional inter-chain: A intersected with the outputs X₁_{e.2} of the entries e ∈ el whose input dominates Xβ‚€_k.

                        Equations
                        Instances For
                          theorem Domain.Neighborhood.mem_condSet {Ξ± : Type u_1} {Ξ² : Type u_2} {Vβ‚€ : NeighborhoodSystem Ξ±} {V₁ : NeighborhoodSystem Ξ²} (Pβ‚€ : ComputablePresentation Vβ‚€) (P₁ : ComputablePresentation V₁) {k : β„•} {A : Set Ξ²} {el : List β„•} {z : Ξ²} :
                          z ∈ condSet Pβ‚€ P₁ k A el ↔ z ∈ A ∧ βˆ€ e ∈ el, Pβ‚€.X k βŠ† Pβ‚€.X (Nat.unpair e).1 β†’ z ∈ P₁.X (Nat.unpair e).2
                          theorem Domain.Neighborhood.condSet_nil {Ξ± : Type u_1} {Ξ² : Type u_2} {Vβ‚€ : NeighborhoodSystem Ξ±} {V₁ : NeighborhoodSystem Ξ²} (Pβ‚€ : ComputablePresentation Vβ‚€) (P₁ : ComputablePresentation V₁) (k : β„•) (A : Set Ξ²) :
                          condSet Pβ‚€ P₁ k A [] = A
                          theorem Domain.Neighborhood.condSet_subset {Ξ± : Type u_1} {Ξ² : Type u_2} {Vβ‚€ : NeighborhoodSystem Ξ±} {V₁ : NeighborhoodSystem Ξ²} (Pβ‚€ : ComputablePresentation Vβ‚€) (P₁ : ComputablePresentation V₁) (k : β„•) (A : Set Ξ²) (el : List β„•) :
                          condSet Pβ‚€ P₁ k A el βŠ† A
                          theorem Domain.Neighborhood.condSet_cons_pos {Ξ± : Type u_1} {Ξ² : Type u_2} {Vβ‚€ : NeighborhoodSystem Ξ±} {V₁ : NeighborhoodSystem Ξ²} (Pβ‚€ : ComputablePresentation Vβ‚€) (P₁ : ComputablePresentation V₁) {k : β„•} {A : Set Ξ²} {e : β„•} {el : List β„•} (h : Pβ‚€.X k βŠ† Pβ‚€.X (Nat.unpair e).1) :
                          condSet Pβ‚€ P₁ k A (e :: el) = condSet Pβ‚€ P₁ k (A ∩ P₁.X (Nat.unpair e).2) el

                          condSet cons-step when the input dominates the head entry's input: intersect A with the head's output.

                          theorem Domain.Neighborhood.condSet_cons_neg {Ξ± : Type u_1} {Ξ² : Type u_2} {Vβ‚€ : NeighborhoodSystem Ξ±} {V₁ : NeighborhoodSystem Ξ²} (Pβ‚€ : ComputablePresentation Vβ‚€) (P₁ : ComputablePresentation V₁) {k : β„•} {A : Set Ξ²} {e : β„•} {el : List β„•} (h : Β¬Pβ‚€.X k βŠ† Pβ‚€.X (Nat.unpair e).1) :
                          condSet Pβ‚€ P₁ k A (e :: el) = condSet Pβ‚€ P₁ k A el

                          condSet cons-step when the input does not dominate the head entry's input: drop the head.

                          theorem Domain.Neighborhood.condSet_eq_interYs {Ξ± : Type u_1} {Ξ² : Type u_2} {Vβ‚€ : NeighborhoodSystem Ξ±} {V₁ : NeighborhoodSystem Ξ²} (Pβ‚€ : ComputablePresentation Vβ‚€) (P₁ : ComputablePresentation V₁) (k : β„•) (el : List β„•) :
                          condSet Pβ‚€ P₁ k V₁.master el = interYs V₁.master (funListOf Pβ‚€ P₁ el) (Pβ‚€.X k)

                          condSet k Δ₁ el is exactly interYs Δ₁ (funListOf el) (Xβ‚€_k).

                          def Domain.Neighborhood.interYsStp {Ξ² : Type u_2} {V₁ : NeighborhoodSystem Ξ²} (P₁ : ComputablePresentation V₁) (incl0 : β„• β†’ β„•) (w : β„•) :

                          One step of the interYs-index fold. State pair entry (pair acc k): entry e = w.unpair.1, running π’Ÿβ‚-index acc = w.unpair.2.unpair.1, input index k = w.unpair.2.unpair.2 (the foldCode parameter). Intersects acc with e's output index when the inclusion test fires.

                          Equations
                          • One or more equations did not get rendered due to their size.
                          Instances For
                            def Domain.Neighborhood.interYsIdx {Ξ² : Type u_2} {V₁ : NeighborhoodSystem Ξ²} (P₁ : ComputablePresentation V₁) (incl0 : β„• β†’ β„•) (a k : β„•) :

                            The index of interYs Δ₁ (funListOf (decodeList a)) (Xβ‚€_k): a conditional inter-fold over decodeList a from masterIdx, with k carried as the foldCode parameter.

                            Equations
                            Instances For
                              theorem Domain.Neighborhood.condFoldl_spec {Ξ± : Type u_1} {Ξ² : Type u_2} {Vβ‚€ : NeighborhoodSystem Ξ±} {V₁ : NeighborhoodSystem Ξ²} (Pβ‚€ : ComputablePresentation Vβ‚€) (P₁ : ComputablePresentation V₁) (incl0 : β„• β†’ β„•) (hincl0 : βˆ€ (s : β„•), incl0 s = 1 ↔ Pβ‚€.X (Nat.unpair s).1 βŠ† Pβ‚€.X (Nat.unpair s).2) (k : β„•) (el : List β„•) (A : Set Ξ²) (a : β„•) :
                              P₁.X a = A β†’ V₁.mem A β†’ V₁.mem (condSet Pβ‚€ P₁ k A el) β†’ P₁.X (List.foldl (fun (acc x : β„•) => if incl0 (Nat.pair k (Nat.unpair x).1) = 1 then P₁.inter acc (Nat.unpair x).2 else acc) a el) = condSet Pβ‚€ P₁ k A el

                              Correctness of the conditional inter-fold (if-form). When the running set is consistent, the fold computes an index of it, by induction with inter_spec (mirrors interFrom_eq_of_foldl).

                              theorem Domain.Neighborhood.interYsIdx_spec {Ξ± : Type u_1} {Ξ² : Type u_2} {Vβ‚€ : NeighborhoodSystem Ξ±} {V₁ : NeighborhoodSystem Ξ²} (Pβ‚€ : ComputablePresentation Vβ‚€) (P₁ : ComputablePresentation V₁) (incl0 : β„• β†’ β„•) (hincl0 : βˆ€ (s : β„•), incl0 s = 1 ↔ Pβ‚€.X (Nat.unpair s).1 βŠ† Pβ‚€.X (Nat.unpair s).2) (a k : β„•) (hcons : V₁.mem (interYs V₁.master (funListOf Pβ‚€ P₁ (Recursive.decodeList a)) (Pβ‚€.X k))) :
                              P₁.X (interYsIdx P₁ incl0 a k) = interYs V₁.master (funListOf Pβ‚€ P₁ (Recursive.decodeList a)) (Pβ‚€.X k)

                              interYsIdx indexes interYs Δ₁ (funListOf (decodeList a)) (Xβ‚€_k) (when that is consistent, which it is whenever stepFun (funListOf (decodeList a)) is non-empty). Choice-free.

                              theorem Domain.Neighborhood.primrec_interYsStp {Ξ² : Type u_2} {V₁ : NeighborhoodSystem Ξ²} (P₁ : ComputablePresentation V₁) (incl0 : β„• β†’ β„•) (hincl0p : Nat.Primrec incl0) :
                              Nat.Primrec (interYsStp P₁ incl0)
                              theorem Domain.Neighborhood.primrec_interYsIdx {Ξ² : Type u_2} {V₁ : NeighborhoodSystem Ξ²} (P₁ : ComputablePresentation V₁) (incl0 : β„• β†’ β„•) (hincl0p : Nat.Primrec incl0) :
                              Nat.Primrec fun (t : β„•) => interYsIdx P₁ incl0 (Nat.unpair t).1 (Nat.unpair t).2

                              A concrete {0,1} characteristic function for function-space #

                              consistency.

                              funCons_decidable already shows consistency is recursively decidable, but to use it in data (the function-space enumeration branches on it) we need a concrete primitive-recursive char rather than one extracted from an existential (extraction needs choice). We build it explicitly from the component presentations' consistency chars fc0/fc1, and prove its spec via funCons_iff.

                              theorem Domain.Neighborhood.selectFn_one_iff_imp {A B : β„•} (hA : A ≀ 1) :
                              Recursive.selectFn A B 1 = 1 ↔ A = 1 β†’ B = 1

                              selectFn A B 1 = 1 decides the implication A = 1 β†’ B = 1 for A ∈ {0,1}.

                              def Domain.Neighborhood.funImpChar {Ξ± : Type u_1} {Ξ² : Type u_2} {Vβ‚€ : NeighborhoodSystem Ξ±} {V₁ : NeighborhoodSystem Ξ²} (Pβ‚€ : ComputablePresentation Vβ‚€) (P₁ : ComputablePresentation V₁) (fc0 fc1 : β„• β†’ β„•) (w : β„•) :

                              The per-bitmask implication char: consβ‚€(selected inputs) β†’ cons₁(selected outputs).

                              Equations
                              • One or more equations did not get rendered due to their size.
                              Instances For
                                def Domain.Neighborhood.funConsChar {Ξ± : Type u_1} {Ξ² : Type u_2} {Vβ‚€ : NeighborhoodSystem Ξ±} {V₁ : NeighborhoodSystem Ξ²} (Pβ‚€ : ComputablePresentation Vβ‚€) (P₁ : ComputablePresentation V₁) (fc0 fc1 : β„• β†’ β„•) (c : β„•) :

                                The concrete {0,1} characteristic function of function-space consistency.

                                Equations
                                Instances For
                                  theorem Domain.Neighborhood.funConsChar_spec {Ξ± : Type u_1} {Ξ² : Type u_2} {Vβ‚€ : NeighborhoodSystem Ξ±} {V₁ : NeighborhoodSystem Ξ²} (Pβ‚€ : ComputablePresentation Vβ‚€) (P₁ : ComputablePresentation V₁) (fc0 fc1 : β„• β†’ β„•) (hfc0 : βˆ€ (s : β„•), fc0 s = 1 ↔ βˆƒ (k : β„•), Pβ‚€.X k βŠ† Pβ‚€.X (Nat.unpair s).1 ∩ Pβ‚€.X (Nat.unpair s).2) (hfc1 : βˆ€ (s : β„•), fc1 s = 1 ↔ βˆƒ (k : β„•), P₁.X k βŠ† P₁.X (Nat.unpair s).1 ∩ P₁.X (Nat.unpair s).2) (c : β„•) :
                                  funConsChar Pβ‚€ P₁ fc0 fc1 c = 1 ↔ (stepFun (funListOf Pβ‚€ P₁ (Recursive.decodeList c))).Nonempty
                                  theorem Domain.Neighborhood.primrec_funImpChar {Ξ± : Type u_1} {Ξ² : Type u_2} {Vβ‚€ : NeighborhoodSystem Ξ±} {V₁ : NeighborhoodSystem Ξ²} (Pβ‚€ : ComputablePresentation Vβ‚€) (P₁ : ComputablePresentation V₁) (fc0 fc1 : β„• β†’ β„•) (hfc0p : Nat.Primrec fc0) (hfc1p : Nat.Primrec fc1) :
                                  Nat.Primrec (funImpChar Pβ‚€ P₁ fc0 fc1)
                                  theorem Domain.Neighborhood.primrec_funConsChar {Ξ± : Type u_1} {Ξ² : Type u_2} {Vβ‚€ : NeighborhoodSystem Ξ±} {V₁ : NeighborhoodSystem Ξ²} (Pβ‚€ : ComputablePresentation Vβ‚€) (P₁ : ComputablePresentation V₁) (fc0 fc1 : β„• β†’ β„•) (hfc0p : Nat.Primrec fc0) (hfc1p : Nat.Primrec fc1) :
                                  Nat.Primrec (funConsChar Pβ‚€ P₁ fc0 fc1)

                                  A generic list-AND and the stepFun-inclusion decider subChar. #

                                  theorem Domain.Neighborhood.andFoldl_eq_one_iff (g : β„• β†’ β„•) (el : List β„•) (a : β„•) :
                                  a ≀ 1 β†’ (List.foldl (fun (acc x : β„•) => Recursive.selectFn acc (Recursive.isOne (g x)) 0) a el = 1 ↔ a = 1 ∧ βˆ€ e ∈ el, g e = 1)

                                  A {0,1} left-fold AND of isOne ∘ g over a list, started from a ∈ {0,1}.

                                  theorem Domain.Neighborhood.andFoldl_one (g : β„• β†’ β„•) (el : List β„•) :
                                  List.foldl (fun (acc x : β„•) => Recursive.selectFn acc (Recursive.isOne (g x)) 0) 1 el = 1 ↔ βˆ€ e ∈ el, g e = 1
                                  def Domain.Neighborhood.subStp {Ξ² : Type u_2} {V₁ : NeighborhoodSystem Ξ²} (P₁ : ComputablePresentation V₁) (incl0 incl1 : β„• β†’ β„•) (w : β„•) :

                                  One step of the stepFun-inclusion fold over decodeList b: test interYs-index βŠ† output.

                                  Equations
                                  • One or more equations did not get rendered due to their size.
                                  Instances For
                                    def Domain.Neighborhood.subChar {Ξ² : Type u_2} {V₁ : NeighborhoodSystem Ξ²} (P₁ : ComputablePresentation V₁) (incl0 incl1 : β„• β†’ β„•) (a b : β„•) :

                                    The {0,1} characteristic function of stepFun (funListOf (decodeList a)) βŠ† stepFun (funListOf (decodeList b)) (correct when a is consistent). a is the foldCode parameter, b the code.

                                    Equations
                                    Instances For
                                      theorem Domain.Neighborhood.subChar_spec {Ξ± : Type u_1} {Ξ² : Type u_2} {Vβ‚€ : NeighborhoodSystem Ξ±} {V₁ : NeighborhoodSystem Ξ²} (Pβ‚€ : ComputablePresentation Vβ‚€) (P₁ : ComputablePresentation V₁) (incl0 incl1 : β„• β†’ β„•) (hincl0 : βˆ€ (s : β„•), incl0 s = 1 ↔ Pβ‚€.X (Nat.unpair s).1 βŠ† Pβ‚€.X (Nat.unpair s).2) (hincl1 : βˆ€ (s : β„•), incl1 s = 1 ↔ P₁.X (Nat.unpair s).1 βŠ† P₁.X (Nat.unpair s).2) {a : β„•} (hane : (stepFun (funListOf Pβ‚€ P₁ (Recursive.decodeList a))).Nonempty) (b : β„•) :
                                      subChar P₁ incl0 incl1 a b = 1 ↔ stepFun (funListOf Pβ‚€ P₁ (Recursive.decodeList a)) βŠ† stepFun (funListOf Pβ‚€ P₁ (Recursive.decodeList b))
                                      theorem Domain.Neighborhood.primrec_subStp {Ξ² : Type u_2} {V₁ : NeighborhoodSystem Ξ²} (P₁ : ComputablePresentation V₁) (incl0 incl1 : β„• β†’ β„•) (hincl0p : Nat.Primrec incl0) (hincl1p : Nat.Primrec incl1) :
                                      Nat.Primrec (subStp P₁ incl0 incl1)
                                      theorem Domain.Neighborhood.primrec_subChar {Ξ² : Type u_2} {V₁ : NeighborhoodSystem Ξ²} (P₁ : ComputablePresentation V₁) (incl0 incl1 : β„• β†’ β„•) (hincl0p : Nat.Primrec incl0) (hincl1p : Nat.Primrec incl1) :
                                      Nat.Primrec fun (t : β„•) => subChar P₁ incl0 incl1 (Nat.unpair t).1 (Nat.unpair t).2

                                      The trivial test: stepFun (funListOf el) = univ iff every output is Δ₁`. #

                                      def Domain.Neighborhood.botMap {Ξ± : Type u_1} {Ξ² : Type u_2} {Vβ‚€ : NeighborhoodSystem Ξ±} {V₁ : NeighborhoodSystem Ξ²} :
                                      ApproximableMap Vβ‚€ V₁

                                      The least map of the empty step-list β€” the function-space bottom: it relates every π’Ÿβ‚€ neighbourhood only to Δ₁.

                                      Equations
                                      Instances For
                                        theorem Domain.Neighborhood.botMap_rel {Ξ± : Type u_1} {Ξ² : Type u_2} {Vβ‚€ : NeighborhoodSystem Ξ±} {V₁ : NeighborhoodSystem Ξ²} {X : Set Ξ±} {Y : Set Ξ²} :
                                        botMap.rel X Y ↔ Vβ‚€.mem X ∧ V₁.mem Y ∧ V₁.master βŠ† Y
                                        theorem Domain.Neighborhood.stepFun_funListOf_eq_univ_iff {Ξ± : Type u_1} {Ξ² : Type u_2} {Vβ‚€ : NeighborhoodSystem Ξ±} {V₁ : NeighborhoodSystem Ξ²} (Pβ‚€ : ComputablePresentation Vβ‚€) (P₁ : ComputablePresentation V₁) (el : List β„•) :
                                        stepFun (funListOf Pβ‚€ P₁ el) = Set.univ ↔ βˆ€ e ∈ el, P₁.X (Nat.unpair e).2 = V₁.master

                                        stepFun (funListOf el) is everything iff every output neighbourhood is Δ₁. Forward: the bottom map botMap lies in univ, and botMap.rel X Y forces Y = Δ₁. Backward: [X, Δ₁] is satisfied by every map. Choice-free.

                                        def Domain.Neighborhood.trivStp {Ξ² : Type u_2} {V₁ : NeighborhoodSystem Ξ²} (P₁ : ComputablePresentation V₁) (eq1 : β„• β†’ β„•) (w : β„•) :

                                        One step of the trivial-test fold: is this entry's output index equal to masterIdx?

                                        Equations
                                        Instances For
                                          def Domain.Neighborhood.trivialChar {Ξ² : Type u_2} {V₁ : NeighborhoodSystem Ξ²} (P₁ : ComputablePresentation V₁) (eq1 : β„• β†’ β„•) (a : β„•) :

                                          The {0,1} characteristic function of stepFun (funListOf (decodeList a)) = univ.

                                          Equations
                                          Instances For
                                            theorem Domain.Neighborhood.trivialChar_spec {Ξ± : Type u_1} {Ξ² : Type u_2} {Vβ‚€ : NeighborhoodSystem Ξ±} {V₁ : NeighborhoodSystem Ξ²} (Pβ‚€ : ComputablePresentation Vβ‚€) (P₁ : ComputablePresentation V₁) (eq1 : β„• β†’ β„•) (heq1 : βˆ€ (s : β„•), eq1 s = 1 ↔ P₁.X (Nat.unpair s).1 = P₁.X (Nat.unpair s).2) (a : β„•) :
                                            trivialChar P₁ eq1 a = 1 ↔ stepFun (funListOf Pβ‚€ P₁ (Recursive.decodeList a)) = Set.univ
                                            theorem Domain.Neighborhood.primrec_trivStp {Ξ² : Type u_2} {V₁ : NeighborhoodSystem Ξ²} (P₁ : ComputablePresentation V₁) (eq1 : β„• β†’ β„•) (heq1p : Nat.Primrec eq1) :
                                            Nat.Primrec (trivStp P₁ eq1)
                                            theorem Domain.Neighborhood.primrec_trivialChar {Ξ² : Type u_2} {V₁ : NeighborhoodSystem Ξ²} (P₁ : ComputablePresentation V₁) (eq1 : β„• β†’ β„•) (heq1p : Nat.Primrec eq1) :
                                            Nat.Primrec (trivialChar P₁ eq1)

                                            The function-space enumeration Xenum and its consistency-pair decider. #

                                            def Domain.Neighborhood.Xenum {Ξ± : Type u_1} {Ξ² : Type u_2} {Vβ‚€ : NeighborhoodSystem Ξ±} {V₁ : NeighborhoodSystem Ξ²} (Pβ‚€ : ComputablePresentation Vβ‚€) (P₁ : ComputablePresentation V₁) (gN : β„• β†’ β„•) (c : β„•) :
                                            Set (ApproximableMap Vβ‚€ V₁)

                                            The function-space enumeration: a code c lists step-pairs; if they are consistent (gN c = 1, where gN is the consistency char) the neighbourhood is stepFun (funListOf (decodeList c)), otherwise we send the junk code to the master neighbourhood univ. Choice-free as data because the branch is a Nat-equality if.

                                            Equations
                                            Instances For
                                              theorem Domain.Neighborhood.Xenum_pos {Ξ± : Type u_1} {Ξ² : Type u_2} {Vβ‚€ : NeighborhoodSystem Ξ±} {V₁ : NeighborhoodSystem Ξ²} (Pβ‚€ : ComputablePresentation Vβ‚€) (P₁ : ComputablePresentation V₁) {gN : β„• β†’ β„•} {c : β„•} (h : gN c = 1) :
                                              Xenum Pβ‚€ P₁ gN c = stepFun (funListOf Pβ‚€ P₁ (Recursive.decodeList c))
                                              theorem Domain.Neighborhood.Xenum_neg {Ξ± : Type u_1} {Ξ² : Type u_2} {Vβ‚€ : NeighborhoodSystem Ξ±} {V₁ : NeighborhoodSystem Ξ²} (Pβ‚€ : ComputablePresentation Vβ‚€) (P₁ : ComputablePresentation V₁) {gN : β„• β†’ β„•} {c : β„•} (h : gN c β‰  1) :
                                              Xenum Pβ‚€ P₁ gN c = Set.univ
                                              theorem Domain.Neighborhood.Xenum_mem {Ξ± : Type u_1} {Ξ² : Type u_2} {Vβ‚€ : NeighborhoodSystem Ξ±} {V₁ : NeighborhoodSystem Ξ²} (Pβ‚€ : ComputablePresentation Vβ‚€) (P₁ : ComputablePresentation V₁) (gN : β„• β†’ β„•) (hgN : βˆ€ (c : β„•), gN c = 1 ↔ (stepFun (funListOf Pβ‚€ P₁ (Recursive.decodeList c))).Nonempty) (c : β„•) :
                                              (funSpace Vβ‚€ V₁).mem (Xenum Pβ‚€ P₁ gN c)
                                              theorem Domain.Neighborhood.Xenum_nonempty {Ξ± : Type u_1} {Ξ² : Type u_2} {Vβ‚€ : NeighborhoodSystem Ξ±} {V₁ : NeighborhoodSystem Ξ²} (Pβ‚€ : ComputablePresentation Vβ‚€) (P₁ : ComputablePresentation V₁) (gN : β„• β†’ β„•) (hgN : βˆ€ (c : β„•), gN c = 1 ↔ (stepFun (funListOf Pβ‚€ P₁ (Recursive.decodeList c))).Nonempty) (c : β„•) :
                                              (Xenum Pβ‚€ P₁ gN c).Nonempty

                                              The canonical code of the intersection Xenum n ∩ Xenum m: appendCode when both are consistent, otherwise the consistent side (the other being univ).

                                              Equations
                                              • One or more equations did not get rendered due to their size.
                                              Instances For
                                                theorem Domain.Neighborhood.Xenum_inter_eq {Ξ± : Type u_1} {Ξ² : Type u_2} {Vβ‚€ : NeighborhoodSystem Ξ±} {V₁ : NeighborhoodSystem Ξ²} (Pβ‚€ : ComputablePresentation Vβ‚€) (P₁ : ComputablePresentation V₁) (gN : β„• β†’ β„•) (hgN : βˆ€ (c : β„•), gN c = 1 ↔ (stepFun (funListOf Pβ‚€ P₁ (Recursive.decodeList c))).Nonempty) (n m : β„•) (hne : (Xenum Pβ‚€ P₁ gN n ∩ Xenum Pβ‚€ P₁ gN m).Nonempty) :
                                                Xenum Pβ‚€ P₁ gN (interIdx gN n m) = Xenum Pβ‚€ P₁ gN n ∩ Xenum Pβ‚€ P₁ gN m

                                                interIdx codes the intersection whenever it is non-empty (and the result is in the enumeration).

                                                The {0,1} characteristic function of Scott's consistency relation (ii) for the function space: βˆƒ k, Xenum k βŠ† Xenum n ∩ Xenum m.

                                                Equations
                                                • One or more equations did not get rendered due to their size.
                                                Instances For
                                                  theorem Domain.Neighborhood.consPairChar_spec {Ξ± : Type u_1} {Ξ² : Type u_2} {Vβ‚€ : NeighborhoodSystem Ξ±} {V₁ : NeighborhoodSystem Ξ²} (Pβ‚€ : ComputablePresentation Vβ‚€) (P₁ : ComputablePresentation V₁) (gN : β„• β†’ β„•) (hgN : βˆ€ (c : β„•), gN c = 1 ↔ (stepFun (funListOf Pβ‚€ P₁ (Recursive.decodeList c))).Nonempty) (n m : β„•) :
                                                  consPairChar gN n m = 1 ↔ βˆƒ (k : β„•), Xenum Pβ‚€ P₁ gN k βŠ† Xenum Pβ‚€ P₁ gN n ∩ Xenum Pβ‚€ P₁ gN m

                                                  The equality decider eqEnumChar and Scott's relation (i) interEqChar. #

                                                  selectFn c d 0 = 1 decides the conjunction c = 1 ∧ d = 1.

                                                  def Domain.Neighborhood.eqEnumChar {Ξ² : Type u_2} {V₁ : NeighborhoodSystem Ξ²} (P₁ : ComputablePresentation V₁) (gN incl0 incl1 eq1 : β„• β†’ β„•) (a b : β„•) :

                                                  The {0,1} characteristic function of Xenum a = Xenum b. Both consistent β†’ inclusion both ways (subChar); one consistent, one junk (univ) β†’ the consistent side is the trivial neighbourhood (trivialChar); both junk β†’ equal.

                                                  Equations
                                                  • One or more equations did not get rendered due to their size.
                                                  Instances For
                                                    theorem Domain.Neighborhood.eqEnumChar_spec {Ξ± : Type u_1} {Ξ² : Type u_2} {Vβ‚€ : NeighborhoodSystem Ξ±} {V₁ : NeighborhoodSystem Ξ²} (Pβ‚€ : ComputablePresentation Vβ‚€) (P₁ : ComputablePresentation V₁) (gN incl0 incl1 eq1 : β„• β†’ β„•) (hgN : βˆ€ (c : β„•), gN c = 1 ↔ (stepFun (funListOf Pβ‚€ P₁ (Recursive.decodeList c))).Nonempty) (hincl0 : βˆ€ (s : β„•), incl0 s = 1 ↔ Pβ‚€.X (Nat.unpair s).1 βŠ† Pβ‚€.X (Nat.unpair s).2) (hincl1 : βˆ€ (s : β„•), incl1 s = 1 ↔ P₁.X (Nat.unpair s).1 βŠ† P₁.X (Nat.unpair s).2) (heq1 : βˆ€ (s : β„•), eq1 s = 1 ↔ P₁.X (Nat.unpair s).1 = P₁.X (Nat.unpair s).2) (a b : β„•) :
                                                    eqEnumChar P₁ gN incl0 incl1 eq1 a b = 1 ↔ Xenum Pβ‚€ P₁ gN a = Xenum Pβ‚€ P₁ gN b
                                                    theorem Domain.Neighborhood.primrec_eqEnumChar {Ξ² : Type u_2} {V₁ : NeighborhoodSystem Ξ²} (P₁ : ComputablePresentation V₁) (gN incl0 incl1 eq1 : β„• β†’ β„•) (hgNp : Nat.Primrec gN) (hincl0p : Nat.Primrec incl0) (hincl1p : Nat.Primrec incl1) (heq1p : Nat.Primrec eq1) :
                                                    Nat.Primrec fun (t : β„•) => eqEnumChar P₁ gN incl0 incl1 eq1 (Nat.unpair t).1 (Nat.unpair t).2
                                                    def Domain.Neighborhood.interEqChar {Ξ² : Type u_2} {V₁ : NeighborhoodSystem Ξ²} (P₁ : ComputablePresentation V₁) (gN incl0 incl1 eq1 : β„• β†’ β„•) (n m k : β„•) :

                                                    The {0,1} characteristic function of Scott's relation (i) for the function space: Xenum n ∩ Xenum m = Xenum k.

                                                    Equations
                                                    • One or more equations did not get rendered due to their size.
                                                    Instances For
                                                      theorem Domain.Neighborhood.interEqChar_spec {Ξ± : Type u_1} {Ξ² : Type u_2} {Vβ‚€ : NeighborhoodSystem Ξ±} {V₁ : NeighborhoodSystem Ξ²} (Pβ‚€ : ComputablePresentation Vβ‚€) (P₁ : ComputablePresentation V₁) (gN incl0 incl1 eq1 : β„• β†’ β„•) (hgN : βˆ€ (c : β„•), gN c = 1 ↔ (stepFun (funListOf Pβ‚€ P₁ (Recursive.decodeList c))).Nonempty) (hincl0 : βˆ€ (s : β„•), incl0 s = 1 ↔ Pβ‚€.X (Nat.unpair s).1 βŠ† Pβ‚€.X (Nat.unpair s).2) (hincl1 : βˆ€ (s : β„•), incl1 s = 1 ↔ P₁.X (Nat.unpair s).1 βŠ† P₁.X (Nat.unpair s).2) (heq1 : βˆ€ (s : β„•), eq1 s = 1 ↔ P₁.X (Nat.unpair s).1 = P₁.X (Nat.unpair s).2) (n m k : β„•) :
                                                      interEqChar P₁ gN incl0 incl1 eq1 n m k = 1 ↔ Xenum Pβ‚€ P₁ gN n ∩ Xenum Pβ‚€ P₁ gN m = Xenum Pβ‚€ P₁ gN k
                                                      theorem Domain.Neighborhood.primrec_interEqChar {Ξ² : Type u_2} {V₁ : NeighborhoodSystem Ξ²} (P₁ : ComputablePresentation V₁) (gN incl0 incl1 eq1 : β„• β†’ β„•) (hgNp : Nat.Primrec gN) (hincl0p : Nat.Primrec incl0) (hincl1p : Nat.Primrec incl1) (heq1p : Nat.Primrec eq1) :
                                                      Nat.Primrec fun (t : β„•) => interEqChar P₁ gN incl0 incl1 eq1 (Nat.unpair t).1 (Nat.unpair (Nat.unpair t).2).1 (Nat.unpair (Nat.unpair t).2).2

                                                      Milestone 6 β€” assembling the function-space presentation. #

                                                      Theorem 7.5 (existence part): (π’Ÿβ‚€ β†’ π’Ÿβ‚) is effectively given. We package the deciders above into a ComputablePresentation (funSpace Vβ‚€ V₁), with X = Xenum, inter = interIdx and masterIdx = 0 (the empty step-list, whose neighbourhood is univ = Ξ”). The concrete characteristic functions are obtained choice-free from the component presentations' relations inside the Nonempty proof of funSpace_isEffectivelyGiven (extraction into a Prop goal needs no choice).

                                                      theorem Domain.Neighborhood.exists_funListOf {Ξ± : Type u_1} {Ξ² : Type u_2} {Vβ‚€ : NeighborhoodSystem Ξ±} {V₁ : NeighborhoodSystem Ξ²} (Pβ‚€ : ComputablePresentation Vβ‚€) (P₁ : ComputablePresentation V₁) {L : List (Set Ξ± Γ— Set Ξ²)} (hL : βˆ€ p ∈ L, Vβ‚€.mem p.1 ∧ V₁.mem p.2) :
                                                      βˆƒ (el : List β„•), funListOf Pβ‚€ P₁ el = L

                                                      Every valid finite step-list is funListOf of some entry-list (choice-free: Exists.elim of Pβ‚€.surj/P₁.surj, entry by entry).

                                                      def Domain.Neighborhood.funPresentation {Ξ± : Type u_1} {Ξ² : Type u_2} {Vβ‚€ : NeighborhoodSystem Ξ±} {V₁ : NeighborhoodSystem Ξ²} (Pβ‚€ : ComputablePresentation Vβ‚€) (P₁ : ComputablePresentation V₁) (gN incl0 incl1 eq1 : β„• β†’ β„•) (hgN : βˆ€ (c : β„•), gN c = 1 ↔ (stepFun (funListOf Pβ‚€ P₁ (Recursive.decodeList c))).Nonempty) (hgNp : Nat.Primrec gN) (hincl0 : βˆ€ (s : β„•), incl0 s = 1 ↔ Pβ‚€.X (Nat.unpair s).1 βŠ† Pβ‚€.X (Nat.unpair s).2) (hincl0p : Nat.Primrec incl0) (hincl1 : βˆ€ (s : β„•), incl1 s = 1 ↔ P₁.X (Nat.unpair s).1 βŠ† P₁.X (Nat.unpair s).2) (hincl1p : Nat.Primrec incl1) (heq1 : βˆ€ (s : β„•), eq1 s = 1 ↔ P₁.X (Nat.unpair s).1 = P₁.X (Nat.unpair s).2) (heq1p : Nat.Primrec eq1) :

                                                      The function-space presentation. Built from explicit characteristic functions for the component presentations' relations (gN = function-space consistency, incl0/incl1 = inclusion, eq1 = equality), so it is choice-free given those concrete functions.

                                                      Equations
                                                      • One or more equations did not get rendered due to their size.
                                                      Instances For
                                                        theorem Domain.Neighborhood.funSpace_isEffectivelyGiven {Ξ± : Type u_1} {Ξ² : Type u_2} {Vβ‚€ : NeighborhoodSystem Ξ±} {V₁ : NeighborhoodSystem Ξ²} (hβ‚€ : Vβ‚€.IsEffectivelyGiven) (h₁ : V₁.IsEffectivelyGiven) :
                                                        (funSpace Vβ‚€ V₁).IsEffectivelyGiven

                                                        Theorem 7.5 (existence part) (Scott 1981, PRG-19). If π’Ÿβ‚€ and π’Ÿβ‚ are effectively given, then so is the function space (π’Ÿβ‚€ β†’ π’Ÿβ‚). Choice-free.

                                                        Milestone 8 β€” computable elements of (π’Ÿβ‚€ β†’ π’Ÿβ‚) are exactly the #

                                                        computable maps.

                                                        Scott (Theorem 7.5): "The computable elements f ∈ |π’Ÿβ‚€ β†’ π’Ÿβ‚| are exactly the computable maps f : π’Ÿβ‚€ β†’ π’Ÿβ‚." Under the completeness isomorphism toApproxMap (Theorem 3.10), a filter Ο† of the function space corresponds to the approximable map fΜ‚ = toApproxMap Ο†, and Ο†.mem [X, Y] ↔ X fΜ‚ Y. The enumeration Xenum c of a consistent code is the finite intersection β‹‚[Xβ‚€_{eα΅’}, X₁_{eα΅’}], so Ο† βˆ‹ Xenum c ↔ βˆ€ eα΅’, Ο† βˆ‹ [Xβ‚€_{eα΅’}, X₁_{eα΅’}] (the generation lemma mem_stepFun_iff); junk codes map to univ, always in Ο†. Hence the element index set {c ∣ Xenum c ∈ Ο†} is r.e. iff the single-step relation {⟨n,m⟩ ∣ [Xβ‚€β‚™, Xβ‚β‚˜] ∈ Ο†} is β€” the map's neighbourhood relation. The map ⟹ element half is the choice-free bounded-βˆ€ over a coded list closure REPred.forall_mem_decodeList.

                                                        theorem Domain.Neighborhood.mem_Xenum_iff {Ξ± : Type u_1} {Ξ² : Type u_2} {Vβ‚€ : NeighborhoodSystem Ξ±} {V₁ : NeighborhoodSystem Ξ²} (Pβ‚€ : ComputablePresentation Vβ‚€) (P₁ : ComputablePresentation V₁) (gN : β„• β†’ β„•) (Ο† : (funSpace Vβ‚€ V₁).Element) (c : β„•) :
                                                        Ο†.mem (Xenum Pβ‚€ P₁ gN c) ↔ gN c = 1 β†’ βˆ€ e ∈ Recursive.decodeList c, Ο†.mem (step (Pβ‚€.X (Nat.unpair e).1) (P₁.X (Nat.unpair e).2))

                                                        Bridge. Ο† βˆ‹ Xenum c iff, when c is consistent, Ο† contains every constituent step.

                                                        theorem Domain.Neighborhood.Xenum_isComputableElement_iff {Ξ± : Type u_1} {Ξ² : Type u_2} {Vβ‚€ : NeighborhoodSystem Ξ±} {V₁ : NeighborhoodSystem Ξ²} (Pβ‚€ : ComputablePresentation Vβ‚€) (P₁ : ComputablePresentation V₁) (gN : β„• β†’ β„•) (hgNp : Nat.Primrec gN) (hgN : βˆ€ (c : β„•), gN c = 1 ↔ (stepFun (funListOf Pβ‚€ P₁ (Recursive.decodeList c))).Nonempty) (Ο† : (funSpace Vβ‚€ V₁).Element) :
                                                        (Recursive.REPred fun (c : β„•) => Ο†.mem (Xenum Pβ‚€ P₁ gN c)) ↔ IsComputableMap Pβ‚€ P₁ (toApproxMap Ο†)

                                                        Theorem 7.5 (Scott 1981, PRG-19) β€” computable elements = computable maps (choice-free). For the function-space enumeration Xenum built from a consistency char gN, an element Ο† has an r.e. index set iff the corresponding approximable map toApproxMap Ο† is computable.

                                                        theorem Domain.Neighborhood.isComputableElement_funPresentation_iff {Ξ± : Type u_1} {Ξ² : Type u_2} {Vβ‚€ : NeighborhoodSystem Ξ±} {V₁ : NeighborhoodSystem Ξ²} (Pβ‚€ : ComputablePresentation Vβ‚€) (P₁ : ComputablePresentation V₁) (gN incl0 incl1 eq1 : β„• β†’ β„•) (hgN : βˆ€ (c : β„•), gN c = 1 ↔ (stepFun (funListOf Pβ‚€ P₁ (Recursive.decodeList c))).Nonempty) (hgNp : Nat.Primrec gN) (hincl0 : βˆ€ (s : β„•), incl0 s = 1 ↔ Pβ‚€.X (Nat.unpair s).1 βŠ† Pβ‚€.X (Nat.unpair s).2) (hincl0p : Nat.Primrec incl0) (hincl1 : βˆ€ (s : β„•), incl1 s = 1 ↔ P₁.X (Nat.unpair s).1 βŠ† P₁.X (Nat.unpair s).2) (hincl1p : Nat.Primrec incl1) (heq1 : βˆ€ (s : β„•), eq1 s = 1 ↔ P₁.X (Nat.unpair s).1 = P₁.X (Nat.unpair s).2) (heq1p : Nat.Primrec eq1) (Ο† : (funSpace Vβ‚€ V₁).Element) :
                                                        IsComputableElement (funPresentation Pβ‚€ P₁ gN incl0 incl1 eq1 hgN hgNp hincl0 hincl0p hincl1 hincl1p heq1 heq1p) Ο† ↔ IsComputableMap Pβ‚€ P₁ (toApproxMap Ο†)

                                                        Theorem 7.5 (Scott 1981, PRG-19), packaged for funPresentation. An element of the function-space presentation is a computable element iff it is (the filter of) a computable map.

                                                        Milestone 7 β€” eval is computable. #

                                                        Scott (Theorem 7.5): "The combinators eval and curry are computable, provided all the domains involved are effectively given." The evaluation map eval : (π’Ÿβ‚€ β†’ π’Ÿβ‚) Γ— π’Ÿβ‚€ β†’ π’Ÿβ‚ sends (F, X) to Y iff every map f ∈ F relates X to Y (Theorem 3.11), i.e. F βŠ† [X, Y] (the step neighbourhood, viewed as the set of maps relating X to Y). On the product presentation prodPresentation funPresentation Pβ‚€, the neighbourhood at index k is Xenum_{k.1} Γ— Xβ‚€_{k.2}, so

                                                        (Xenum c, Xβ‚€β±Ό) eval Yβ‚β‚˜ ↔ Xenum c βŠ† [Xβ‚€β±Ό, Yβ‚β‚˜].

                                                        The single step [Xβ‚€β±Ό, Yβ‚β‚˜] is itself a one-entry function-space neighbourhood β€” Xenum of the (always consistent) code ⟨⟨j, m⟩, 0⟩ + 1 β€” so the relation is exactly the decidable function-space inclusion funPresentation.incl_computable, re-indexed by a primitive-recursive code map. This is Scott's observation that eval is a recursive set; r.e.-ness (hence computability) and choice-freeness follow.

                                                        theorem Domain.Neighborhood.Xenum_singleton {Ξ± : Type u_1} {Ξ² : Type u_2} {Vβ‚€ : NeighborhoodSystem Ξ±} {V₁ : NeighborhoodSystem Ξ²} (Pβ‚€ : ComputablePresentation Vβ‚€) (P₁ : ComputablePresentation V₁) (gN : β„• β†’ β„•) (hgN : βˆ€ (c : β„•), gN c = 1 ↔ (stepFun (funListOf Pβ‚€ P₁ (Recursive.decodeList c))).Nonempty) (j m : β„•) :
                                                        Xenum Pβ‚€ P₁ gN (Nat.pair (Nat.pair j m) 0 + 1) = step (Pβ‚€.X j) (P₁.X m)

                                                        The step neighbourhood [Xβ‚€β±Ό, Yβ‚β‚˜] as a one-entry Xenum. The code ⟨⟨j, m⟩, 0⟩ + 1 decodes to the singleton entry-list [⟨j, m⟩], which is always consistent (the step map itself is a witness), so Xenum of it is stepFun [(Xβ‚€β±Ό, Yβ‚β‚˜)] = [Xβ‚€β±Ό, Yβ‚β‚˜].

                                                        theorem Domain.Neighborhood.evalMap_rel_prodNbhd_iff {Ξ± : Type u_1} {Ξ² : Type u_2} {Vβ‚€ : NeighborhoodSystem Ξ±} {V₁ : NeighborhoodSystem Ξ²} {F : Set (ApproximableMap Vβ‚€ V₁)} (hF : (funSpace Vβ‚€ V₁).mem F) {X : Set Ξ±} (hX : Vβ‚€.mem X) {Y : Set Ξ²} (hY : V₁.mem Y) :
                                                        (evalMap Vβ‚€ V₁).rel (prodNbhd F X) Y ↔ F βŠ† step X Y

                                                        Evaluation against a product neighbourhood. (F, X) eval Y ↔ F βŠ† [X, Y], for any function-space neighbourhood F and basic neighbourhoods X, Y: every map in F relates X to Y exactly when F is contained in the step set [X, Y] = {f ∣ f X Y}.

                                                        theorem Domain.Neighborhood.evalMap_isComputable {Ξ± : Type u_1} {Ξ² : Type u_2} {Vβ‚€ : NeighborhoodSystem Ξ±} {V₁ : NeighborhoodSystem Ξ²} (Pβ‚€ : ComputablePresentation Vβ‚€) (P₁ : ComputablePresentation V₁) (gN incl0 incl1 eq1 : β„• β†’ β„•) (hgN : βˆ€ (c : β„•), gN c = 1 ↔ (stepFun (funListOf Pβ‚€ P₁ (Recursive.decodeList c))).Nonempty) (hgNp : Nat.Primrec gN) (hincl0 : βˆ€ (s : β„•), incl0 s = 1 ↔ Pβ‚€.X (Nat.unpair s).1 βŠ† Pβ‚€.X (Nat.unpair s).2) (hincl0p : Nat.Primrec incl0) (hincl1 : βˆ€ (s : β„•), incl1 s = 1 ↔ P₁.X (Nat.unpair s).1 βŠ† P₁.X (Nat.unpair s).2) (hincl1p : Nat.Primrec incl1) (heq1 : βˆ€ (s : β„•), eq1 s = 1 ↔ P₁.X (Nat.unpair s).1 = P₁.X (Nat.unpair s).2) (heq1p : Nat.Primrec eq1) :
                                                        IsComputableMap (prodPresentation (funPresentation Pβ‚€ P₁ gN incl0 incl1 eq1 hgN hgNp hincl0 hincl0p hincl1 hincl1p heq1 heq1p) Pβ‚€) P₁ (evalMap Vβ‚€ V₁)

                                                        Theorem 7.5 (Scott 1981, PRG-19) β€” eval is computable (choice-free). Relative to the function-space presentation funPresentation (and the product/codomain presentations), the evaluation map eval : (π’Ÿβ‚€ β†’ π’Ÿβ‚) Γ— π’Ÿβ‚€ β†’ π’Ÿβ‚ is computable: its neighbourhood relation is the recursively decidable function-space inclusion Xenum c βŠ† [Xβ‚€β±Ό, Yβ‚β‚˜], hence recursively enumerable.

                                                        Milestone 9 β€” curry is computable. #

                                                        Scott (Theorem 7.5): "The combinators eval and curry are computable." For a map g : π’Ÿβ‚€ Γ— π’Ÿβ‚ β†’ π’Ÿβ‚‚, curry g : π’Ÿβ‚€ β†’ (π’Ÿβ‚ β†’ π’Ÿβ‚‚) sends X to the (filter generated by the) section map gᴬ = gSection g X, with gᴬ Y Z ↔ X βˆͺ Y g Z (Theorem 3.12). On the codomain presentation funPresentation P₁ Pβ‚‚, (Xβ‚€β‚™) curry(g) (Xenum c) holds iff the section map lies in Xenum c, i.e. (for consistent c) βˆ€ ⟨j, k⟩ ∈ decodeList c, Xβ‚€β‚™ βˆͺ X₁ⱼ g Xβ‚‚β‚– β€” a bounded βˆ€ over the coded list, with the π’Ÿβ‚€-parameter n of the r.e. relation of g. This is r.e. by the parameterised closure REPred.forall_mem_decodeListβ‚‚; junk codes go to univ (always satisfied). Choice-free.

                                                        theorem Domain.Neighborhood.mem_Xenum_iff_map {Ξ± : Type u_1} {Ξ² : Type u_2} {Vβ‚€ : NeighborhoodSystem Ξ±} {V₁ : NeighborhoodSystem Ξ²} (Pβ‚€ : ComputablePresentation Vβ‚€) (P₁ : ComputablePresentation V₁) (gN : β„• β†’ β„•) (f : ApproximableMap Vβ‚€ V₁) (c : β„•) :
                                                        f ∈ Xenum Pβ‚€ P₁ gN c ↔ gN c = 1 β†’ βˆ€ e ∈ Recursive.decodeList c, f.rel (Pβ‚€.X (Nat.unpair e).1) (P₁.X (Nat.unpair e).2)

                                                        Membership in Xenum for a single map. A map f lies in Xenum c iff (when c is consistent) it relates every coded step ⟨Xβ‚€α΅’, Xβ‚β±ΌβŸ©; junk codes give univ. (The single-map analogue of mem_Xenum_iff.)

                                                        theorem Domain.Neighborhood.curry_rel_Xenum_iff {Ξ± : Type u_1} {Ξ² : Type u_2} {Ξ³ : Type u_3} {Vβ‚€ : NeighborhoodSystem Ξ±} {V₁ : NeighborhoodSystem Ξ²} (Pβ‚€ : ComputablePresentation Vβ‚€) (P₁ : ComputablePresentation V₁) {Vβ‚‚ : NeighborhoodSystem Ξ³} (Pβ‚‚ : ComputablePresentation Vβ‚‚) (gN : β„• β†’ β„•) (hgN : βˆ€ (c : β„•), gN c = 1 ↔ (stepFun (funListOf P₁ Pβ‚‚ (Recursive.decodeList c))).Nonempty) (g : ApproximableMap (prod Vβ‚€ V₁) Vβ‚‚) (n c : β„•) :
                                                        (curry g).rel (Pβ‚€.X n) (Xenum P₁ Pβ‚‚ gN c) ↔ gN c = 1 β†’ βˆ€ e ∈ Recursive.decodeList c, g.rel (prodNbhd (Pβ‚€.X n) (P₁.X (Nat.unpair e).1)) (Pβ‚‚.X (Nat.unpair e).2)

                                                        Bridge for curry. (Xβ‚€β‚™) curry(g) (Xenum c) iff, when c is consistent, g relates Xβ‚€β‚™ βˆͺ X₁_{e.1} to Xβ‚‚_{e.2} for every coded entry e.

                                                        theorem Domain.Neighborhood.curry_isComputable {Ξ± : Type u_1} {Ξ² : Type u_2} {Ξ³ : Type u_3} {Vβ‚€ : NeighborhoodSystem Ξ±} {V₁ : NeighborhoodSystem Ξ²} (Pβ‚€ : ComputablePresentation Vβ‚€) (P₁ : ComputablePresentation V₁) {Vβ‚‚ : NeighborhoodSystem Ξ³} (Pβ‚‚ : ComputablePresentation Vβ‚‚) (gN incl0 incl1 eq1 : β„• β†’ β„•) (hgN : βˆ€ (c : β„•), gN c = 1 ↔ (stepFun (funListOf P₁ Pβ‚‚ (Recursive.decodeList c))).Nonempty) (hgNp : Nat.Primrec gN) (hincl0 : βˆ€ (s : β„•), incl0 s = 1 ↔ P₁.X (Nat.unpair s).1 βŠ† P₁.X (Nat.unpair s).2) (hincl0p : Nat.Primrec incl0) (hincl1 : βˆ€ (s : β„•), incl1 s = 1 ↔ Pβ‚‚.X (Nat.unpair s).1 βŠ† Pβ‚‚.X (Nat.unpair s).2) (hincl1p : Nat.Primrec incl1) (heq1 : βˆ€ (s : β„•), eq1 s = 1 ↔ Pβ‚‚.X (Nat.unpair s).1 = Pβ‚‚.X (Nat.unpair s).2) (heq1p : Nat.Primrec eq1) {g : ApproximableMap (prod Vβ‚€ V₁) Vβ‚‚} (hg : IsComputableMap (prodPresentation Pβ‚€ P₁) Pβ‚‚ g) :
                                                        IsComputableMap Pβ‚€ (funPresentation P₁ Pβ‚‚ gN incl0 incl1 eq1 hgN hgNp hincl0 hincl0p hincl1 hincl1p heq1 heq1p) (curry g)

                                                        Theorem 7.5 (Scott 1981, PRG-19) β€” curry is computable (choice-free). If g : π’Ÿβ‚€ Γ— π’Ÿβ‚ β†’ π’Ÿβ‚‚ is computable then so is curry g : π’Ÿβ‚€ β†’ (π’Ÿβ‚ β†’ π’Ÿβ‚‚): its neighbourhood relation is the parameterised bounded βˆ€ (REPred.forall_mem_decodeListβ‚‚) over the r.e. relation of g, guarded by the decidable consistency flag.