Documentation

LeanPool.BeyondBethe.Complexitylib.Models.RandomAccessMachine.Simulation.RegisterStore.Machine.Lookup.ResetLayout

Reusable lookup tape layout and scratch encodings #

The fourteen-tape lookup assignment, fixed reset targets, width bounds, and found/missing bit encodings used by the reusable lookup controller.

Fourteen pairwise-distinct tapes for a reusable sparse operand lookup. Slots 0..9 are the bounded scanner; the final four slots preserve the entry count, supply the query, receive the value, and provide zero copy scratch.

  • idx : Fin 14 → Fin n

    Physical work tape assigned to each logical lookup role.

  • injective : Function.Injective self.idx

    Distinct logical lookup roles occupy distinct physical tapes.

Instances For

    Bounded scanner view of the reusable lookup assignment.

    Equations
    • tapes.scan = { entry := { idx := fun (i : Fin 9) => tapes.idx ⟨↑i, ⋯⟩, injective := ⋯ }, count := tapes.idx 9, count_ne := ⋯ }
    Instances For

      Preserved canonical copy of the store cardinality.

      Equations
      Instances For

        Canonical address supplied to this lookup.

        Equations
        Instances For

          Canonical destination receiving the looked-up register value.

          Equations
          Instances For

            Preserved zero tape used by width-linear binary copying.

            Equations
            Instances For
              theorem Complexity.RAM.RegisterStore.Machine.EntryLookupRestoreTapes.ne {n : ℕ} (tapes : EntryLookupRestoreTapes n) {i j : Fin 14} (hne : i ≠ j) :
              tapes.idx i ≠ tapes.idx j

              Inequality of logical slots gives inequality of physical tapes.

              theorem Complexity.RAM.RegisterStore.Machine.EntryLookupRestoreTapes.scan_ne_external {n : ℕ} (tapes : EntryLookupRestoreTapes n) (slot : Fin 10) (external : Fin 4) :
              tapes.idx ⟨↑slot, ⋯⟩ ≠ tapes.idx ⟨↑external + 10, ⋯⟩

              Every scanner tape is distinct from an external reusable-lookup role.

              Logical parent slots reset after one lookup.

              Equations
              Instances For

                Physical reset target selected by a finite logical slot.

                Equations
                Instances For

                  Scanner-owned tapes reset after copying out a lookup result. The encoded source is deliberately excluded because it is read-only and merely rewound.

                  Equations
                  Instances For

                    Width envelope for every binary scratch value at a successful hit on one entry.

                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For

                      Width envelope contributed by possible hit entries in a complete store.

                      Equations
                      Instances For

                        Width envelope for every hit or miss reset target in a complete store.

                        Equations
                        Instances For
                          def Complexity.RAM.RegisterStore.Machine.entryLookupFoundBits {n : ℕ} (tapes : EntryLookupRestoreTapes n) (entry : Entry) (remaining address : ℕ) (i : Fin n) :

                          Exact reset contents at a successful lookup endpoint.

                          Equations
                          • One or more equations did not get rendered due to their size.
                          Instances For

                            Exact reset contents at an unsuccessful lookup endpoint.

                            Equations
                            Instances For
                              @[simp]
                              theorem Complexity.RAM.RegisterStore.Machine.entryLookupFoundBits_zero {n : ℕ} (tapes : EntryLookupRestoreTapes n) (entry : Entry) (remaining address : ℕ) :
                              entryLookupFoundBits tapes entry remaining address tapes.scan.entry.address = entry.1.bits
                              @[simp]
                              theorem Complexity.RAM.RegisterStore.Machine.entryLookupFoundBits_one {n : ℕ} (tapes : EntryLookupRestoreTapes n) (entry : Entry) (remaining address : ℕ) :
                              entryLookupFoundBits tapes entry remaining address tapes.scan.entry.value = entry.2.bits
                              @[simp]
                              theorem Complexity.RAM.RegisterStore.Machine.entryLookupFoundBits_two {n : ℕ} (tapes : EntryLookupRestoreTapes n) (entry : Entry) (remaining address : ℕ) :
                              entryLookupFoundBits tapes entry remaining address tapes.scan.entry.addressCounter = List.replicate (bitlen entry.1) true
                              @[simp]
                              theorem Complexity.RAM.RegisterStore.Machine.entryLookupFoundBits_three {n : ℕ} (tapes : EntryLookupRestoreTapes n) (entry : Entry) (remaining address : ℕ) :
                              entryLookupFoundBits tapes entry remaining address tapes.scan.entry.addressWidth = []
                              @[simp]
                              theorem Complexity.RAM.RegisterStore.Machine.entryLookupFoundBits_four {n : ℕ} (tapes : EntryLookupRestoreTapes n) (entry : Entry) (remaining address : ℕ) :
                              entryLookupFoundBits tapes entry remaining address tapes.scan.entry.valueCounter = List.replicate (bitlen entry.2) true
                              @[simp]
                              theorem Complexity.RAM.RegisterStore.Machine.entryLookupFoundBits_five {n : ℕ} (tapes : EntryLookupRestoreTapes n) (entry : Entry) (remaining address : ℕ) :
                              entryLookupFoundBits tapes entry remaining address tapes.scan.entry.valueWidth = []
                              @[simp]
                              theorem Complexity.RAM.RegisterStore.Machine.entryLookupFoundBits_six {n : ℕ} (tapes : EntryLookupRestoreTapes n) (entry : Entry) (remaining address : ℕ) :
                              entryLookupFoundBits tapes entry remaining address tapes.scan.entry.result = [decide (entry.1.bits = address.bits)]
                              @[simp]
                              theorem Complexity.RAM.RegisterStore.Machine.entryLookupFoundBits_seven {n : ℕ} (tapes : EntryLookupRestoreTapes n) (entry : Entry) (remaining address : ℕ) :
                              entryLookupFoundBits tapes entry remaining address tapes.scan.entry.query = address.bits
                              @[simp]
                              theorem Complexity.RAM.RegisterStore.Machine.entryLookupFoundBits_eight {n : ℕ} (tapes : EntryLookupRestoreTapes n) (entry : Entry) (remaining address : ℕ) :
                              entryLookupFoundBits tapes entry remaining address (tapes.idx 9) = remaining.bits
                              @[simp]
                              theorem Complexity.RAM.RegisterStore.Machine.entryLookupMissBits_other {n : ℕ} (tapes : EntryLookupRestoreTapes n) (address : ℕ) (slot : Fin 9) (hslot : slot ≠ 7) :
                              entryLookupMissBits tapes address (tapes.resetIdx slot) = []