Langlib

Langlib.Grammars.Indexed.NormalForm.Aho.Scheduler.Resources.IndexTickets

Logical tickets for persistent compressed indices #

Physical index owners are drawn from the reusable generic bank. A second, ghost-only ticket ledger gives every live physical owner a distinct element of Fin (6 * |input|). Keeping the association in a function, rather than in ScheduleIndex, lets the scheduler change physical owners without changing the finite machine alphabet or the block-layout API.

The important distinction is that the ticket ledger is inductive: allocation extends the association at one fresh physical owner and demands a genuinely fresh logical ticket. Thus the cardinality bound below cannot be manufactured merely by assuming a scalar inequality.

@[reducible, inline]
abbrev IndexedGrammar.Aho.IndexTicket {T : Type} (input : List T) :

The logical ticket carrier. Primary productive tickets occupy the first 2|input|-1 values, shadow tickets the next 2|input|-1, the next two values are emergency scratch and transient tickets, and the upper 2|input| values form an outside-window parking bank.

The parking bank is as large as the complete physical owner pool. Consequently a live core ticket and the global 6|input| index bound certify that some parking ticket is absent, even while parking tickets belonging to nested protected calls remain live.

Equations
Instances For
    def IndexedGrammar.Aho.IndexTicket.scratch {T : Type} {input : List T} (hinput : 0 < input.length) :

    The one-step emergency logical scratch ticket.

    Equations
    Instances For
      @[simp]
      theorem IndexedGrammar.Aho.IndexTicket.scratch_val {T : Type} {input : List T} (hinput : 0 < input.length) :
      (scratch hinput) = 4 * input.length - 2
      def IndexedGrammar.Aho.IndexTicket.transient {T : Type} {input : List T} (hinput : 0 < input.length) :

      The distinguished last logical transient ticket.

      Equations
      Instances For
        @[simp]
        theorem IndexedGrammar.Aho.IndexTicket.transient_val {T : Type} {input : List T} (hinput : 0 < input.length) :
        (transient hinput) = 4 * input.length - 1
        def IndexedGrammar.Aho.IndexTicket.parking {T : Type} {input : List T} (slot : Fin (2 * input.length)) :

        One logical parking ticket. Parking tickets lie above both productive semantic banks.

        Equations
        Instances For
          @[simp]
          theorem IndexedGrammar.Aho.IndexTicket.parking_val {T : Type} {input : List T} (slot : Fin (2 * input.length)) :
          (parking slot) = 4 * input.length + slot

          The complete finite parking bank.

          Equations
          Instances For
            theorem IndexedGrammar.Aho.IndexTicket.parking_ne_scratch {T : Type} {input : List T} (slot : Fin (2 * input.length)) (hinput : 0 < input.length) :
            parking slot scratch hinput
            theorem IndexedGrammar.Aho.IndexTicket.parking_ne_transient {T : Type} {input : List T} (slot : Fin (2 * input.length)) (hinput : 0 < input.length) :
            parking slot transient hinput
            def IndexedGrammar.Aho.IndexTicket.Nonparking {T : Type} {input : List T} (ticket : IndexTicket input) :

            A ticket is nonparking when it is distinct from every member of the upper parking bank.

            Equations
            Instances For
              theorem IndexedGrammar.Aho.IndexTicket.nonparking_of_core {T : Type} {input : List T} {ticket : IndexTicket input} (hcore : ticket < 4 * input.length) :
              ticket.Nonparking

              Every core ticket lies strictly below, and hence outside, the parking bank.

              theorem IndexedGrammar.Aho.IndexTicket.scratch_nonparking {T : Type} {input : List T} (hinput : 0 < input.length) :

              The reserved scratch ticket is nonparking.

              theorem IndexedGrammar.Aho.IndexTicket.transient_nonparking {T : Type} {input : List T} (hinput : 0 < input.length) :

              The distinguished transient ticket is nonparking.

              def IndexedGrammar.Aho.IndexTicket.semanticOwner {T : Type} {g : IndexedGrammar T} {input : List T} (ticket : IndexTicket input) :
              Fin (10 * input.length)

              Interpret a logical ticket in the semantic-owner carrier. All ticket values, including the complete parking bank, are retained by the embedding.

              Equations
              Instances For

                The semantic interpretation of logical tickets is injective.

                def IndexedGrammar.Aho.IndexTicket.ofProductiveOwner {T : Type} {input : List T} (owner : Fin (10 * input.length)) (hprimary : owner < 2 * input.length - 1) :

                Turn a semantic productive owner into its corresponding logical ticket.

                Equations
                Instances For
                  def IndexedGrammar.Aho.IndexTicket.ofSemanticOwner {T : Type} {input : List T} (owner : Fin (10 * input.length)) (hbank : owner < 4 * input.length - 2) :

                  Any semantic primary-or-shadow owner below the two temporary slots is a logical ticket.

                  Equations
                  Instances For
                    theorem IndexedGrammar.Aho.IndexTicket.ofProductiveOwner_nonparking {T : Type} {input : List T} (owner : Fin (10 * input.length)) (hprimary : owner < 2 * input.length - 1) :
                    (ofProductiveOwner owner hprimary).Nonparking

                    Every primary productive-owner ticket is nonparking.

                    theorem IndexedGrammar.Aho.IndexTicket.ofSemanticOwner_nonparking {T : Type} {input : List T} (owner : Fin (10 * input.length)) (hbank : owner < 4 * input.length - 2) :

                    Every primary-or-shadow semantic-owner ticket is nonparking.

                    @[simp]
                    theorem IndexedGrammar.Aho.IndexTicket.semanticOwner_ofProductiveOwner {T : Type} {g : IndexedGrammar T} {input : List T} (owner : Fin (10 * input.length)) (hprimary : owner < 2 * input.length - 1) :
                    (ofProductiveOwner owner hprimary).semanticOwner = owner
                    @[simp]
                    theorem IndexedGrammar.Aho.IndexTicket.semanticOwner_ofSemanticOwner {T : Type} {g : IndexedGrammar T} {input : List T} (owner : Fin (10 * input.length)) (hbank : owner < 4 * input.length - 2) :
                    (ofSemanticOwner owner hbank).semanticOwner = owner
                    @[simp]
                    theorem IndexedGrammar.Aho.IndexTicket.semanticOwner_transient_val {T : Type} {g : IndexedGrammar T} {input : List T} (hinput : 0 < input.length) :
                    (transient hinput).semanticOwner = 4 * input.length - 1
                    def IndexedGrammar.Aho.ProductiveOwnerWindow.pushChildEventTicketOne {T : Type} {g : IndexedGrammar T} {input : List T} {A B : g.nt} {f : g.flag} {stack : List g.flag} {w : List T} {r : IRule T g.nt g.flag} {hr : r g.rules} {hlhs : r.lhs = A} {hc : r.consume = none} {hrhs : r.rhs = [IRhsSymbol.nonterminal B (some f)]} {rest : g.NFParse B (f :: stack) w} (window : ProductiveOwnerWindow (NFParse.push hr hlhs hc hrhs rest)) (hone : 1 rest.eventDepths) :

                    The logical ticket of the child depth-one event exposed by a unary push.

                    Equations
                    Instances For
                      @[simp]
                      theorem IndexedGrammar.Aho.ProductiveOwnerWindow.semanticOwner_pushChildEventTicketOne {T : Type} {g : IndexedGrammar T} {input : List T} {A B : g.nt} {f : g.flag} {stack : List g.flag} {w : List T} {r : IRule T g.nt g.flag} {hr : r g.rules} {hlhs : r.lhs = A} {hc : r.consume = none} {hrhs : r.rhs = [IRhsSymbol.nonterminal B (some f)]} {rest : g.NFParse B (f :: stack) w} (window : ProductiveOwnerWindow (NFParse.push hr hlhs hc hrhs rest)) (hone : 1 rest.eventDepths) :
                      theorem IndexedGrammar.Aho.ProductiveOwnerWindow.pushChildEventTicketOne_nonparking {T : Type} {g : IndexedGrammar T} {input : List T} {A B : g.nt} {f : g.flag} {stack : List g.flag} {w : List T} {r : IRule T g.nt g.flag} {hr : r g.rules} {hlhs : r.lhs = A} {hc : r.consume = none} {hrhs : r.rhs = [IRhsSymbol.nonterminal B (some f)]} {rest : g.NFParse B (f :: stack) w} (window : ProductiveOwnerWindow (NFParse.push hr hlhs hc hrhs rest)) (hone : 1 rest.eventDepths) :

                      The child depth-one productive-event ticket lies below the parking bank.

                      def IndexedGrammar.Aho.ProductiveOwnerWindow.shadowEventTicket {T : Type} {g : IndexedGrammar T} {input : List T} {A : g.nt} {stack : List g.flag} {w : List T} {parse : g.NFParse A stack w} (window : ProductiveOwnerWindow parse) (d : ) (hd : d parse.eventDepths) :

                      The logical shadow ticket attached to one productive event.

                      Equations
                      Instances For
                        @[simp]
                        theorem IndexedGrammar.Aho.ProductiveOwnerWindow.semanticOwner_shadowEventTicket {T : Type} {g : IndexedGrammar T} {input : List T} {A : g.nt} {stack : List g.flag} {w : List T} {parse : g.NFParse A stack w} (window : ProductiveOwnerWindow parse) (d : ) (hd : d parse.eventDepths) :
                        theorem IndexedGrammar.Aho.ProductiveOwnerWindow.shadowEventTicket_nonparking {T : Type} {g : IndexedGrammar T} {input : List T} {A : g.nt} {stack : List g.flag} {w : List T} {parse : g.NFParse A stack w} (window : ProductiveOwnerWindow parse) (d : ) (hd : d parse.eventDepths) :

                        Every shadow-event ticket lies below the parking bank.

                        def IndexedGrammar.Aho.ProductiveOwnerWindow.parkingSlot {T : Type} {g : IndexedGrammar T} {input : List T} {A : g.nt} {stack : List g.flag} {w : List T} {parse : g.NFParse A stack w} (window : ProductiveOwnerWindow parse) :
                        Fin (2 * input.length)

                        The canonical parking slot of a productive window is its root-relative base.

                        Equations
                        Instances For
                          @[simp]
                          theorem IndexedGrammar.Aho.ProductiveOwnerWindow.parkingSlot_val {T : Type} {g : IndexedGrammar T} {input : List T} {A : g.nt} {stack : List g.flag} {w : List T} {parse : g.NFParse A stack w} (window : ProductiveOwnerWindow parse) :
                          window.parkingSlot = window.base
                          def IndexedGrammar.Aho.ProductiveOwnerWindow.parkingTicket {T : Type} {g : IndexedGrammar T} {input : List T} {A : g.nt} {stack : List g.flag} {w : List T} {parse : g.NFParse A stack w} (window : ProductiveOwnerWindow parse) :

                          The canonical logical parking ticket associated with a productive window.

                          Equations
                          Instances For
                            @[simp]
                            theorem IndexedGrammar.Aho.ProductiveOwnerWindow.parkingTicket_val {T : Type} {g : IndexedGrammar T} {input : List T} {A : g.nt} {stack : List g.flag} {w : List T} {parse : g.NFParse A stack w} (window : ProductiveOwnerWindow parse) :
                            window.parkingTicket = 4 * input.length + window.base
                            def IndexedGrammar.Aho.ScheduleCursor.indexTickets {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} (cursor : ScheduleCursor g input) (ticketOf : Fin (10 * input.length)IndexTicket input) :

                            Logical tickets currently present on the work tape, read through an owner-to-ticket association.

                            Equations
                            Instances For
                              @[simp]
                              theorem IndexedGrammar.Aho.ScheduleCursor.indexTickets_length {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} (cursor : ScheduleCursor g input) (ticketOf : Fin (10 * input.length)IndexTicket input) :
                              (cursor.indexTickets ticketOf).length = cursor.indexOwners.length

                              Ghost-only semantic projection #

                              def IndexedGrammar.Aho.ScheduleIndex.withTicketOwner {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} (idx : ScheduleIndex g input) (owner : Fin (10 * input.length)) :

                              Replace only the owner annotation of a compressed index. This local copy deliberately does not import the later physical-owner relabelling module, so ticket resources remain usable by Scheduler.Resources.RunResources without an import cycle.

                              Equations
                              Instances For
                                @[simp]
                                theorem IndexedGrammar.Aho.ScheduleIndex.withTicketOwner_owner {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} (idx : ScheduleIndex g input) (owner : Fin (10 * input.length)) :
                                (idx.withTicketOwner owner).owner = owner
                                @[simp]
                                theorem IndexedGrammar.Aho.ScheduleAtom.indexOwner?_relabelTicketOwner {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} (f : Fin (10 * input.length)Fin (10 * input.length)) (atom : ScheduleAtom g input) :
                                @[simp]
                                theorem IndexedGrammar.Aho.ScheduleAtom.closeOwner?_relabelTicketOwner {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} (f : Fin (10 * input.length)Fin (10 * input.length)) (atom : ScheduleAtom g input) :
                                def IndexedGrammar.Aho.ScheduleCursor.relabelTicketOwners {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} (cursor : ScheduleCursor g input) (f : Fin (10 * input.length)Fin (10 * input.length)) :

                                A virtual cursor whose owner annotations are the semantic images of logical tickets.

                                Equations
                                • One or more equations did not get rendered due to their size.
                                Instances For
                                  @[simp]
                                  theorem IndexedGrammar.Aho.ScheduleCursor.relabelTicketOwners_indexOwners {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} (cursor : ScheduleCursor g input) (f : Fin (10 * input.length)Fin (10 * input.length)) :
                                  @[simp]
                                  theorem IndexedGrammar.Aho.ScheduleCursor.relabelTicketOwners_frameOwners {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} (cursor : ScheduleCursor g input) (f : Fin (10 * input.length)Fin (10 * input.length)) :
                                  structure IndexedGrammar.Aho.IndexTicketLedger {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} (cursor : ScheduleCursor g input) :

                                  An injective logical-ticket assignment for all persistent physical owners in a cursor.

                                  Instances For
                                    def IndexedGrammar.Aho.IndexTicketLedger.swapTickets {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} {cursor : ScheduleCursor g input} (ledger : IndexTicketLedger cursor) (left right : IndexTicket input) (hleft : ∀ (hinput : 0 < input.length), left IndexTicket.scratch hinput) (hright : ∀ (hinput : 0 < input.length), right IndexTicket.scratch hinput) :

                                    Apply one logical-ticket transposition to every persistent index. This is a ghost-only operation: injectivity is preserved by the permutation, and the explicit side conditions say that the reserved scratch ticket is fixed.

                                    Equations
                                    Instances For
                                      @[simp]
                                      theorem IndexedGrammar.Aho.IndexTicketLedger.swapTickets_ticketOf {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} {cursor : ScheduleCursor g input} (ledger : IndexTicketLedger cursor) (left right : IndexTicket input) (hleft : ∀ (hinput : 0 < input.length), left IndexTicket.scratch hinput) (hright : ∀ (hinput : 0 < input.length), right IndexTicket.scratch hinput) (owner : Fin (10 * input.length)) :
                                      (ledger.swapTickets left right hleft hright).ticketOf owner = (Equiv.swap left right) (ledger.ticketOf owner)
                                      def IndexedGrammar.Aho.IndexTicketLedger.ParkingBelow {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} {A : g.nt} {stack : List g.flag} {w : List T} {parse : g.NFParse A stack w} {cursor : ScheduleCursor g input} (ledger : IndexTicketLedger cursor) (window : ProductiveOwnerWindow parse) :

                                      Every live parking ticket has a slot strictly below the active productive-window base.

                                      Equations
                                      Instances For
                                        def IndexedGrammar.Aho.IndexTicketLedger.ParkingAtOrBelow {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} {A : g.nt} {stack : List g.flag} {w : List T} {parse : g.NFParse A stack w} {cursor : ScheduleCursor g input} (ledger : IndexTicketLedger cursor) (window : ProductiveOwnerWindow parse) :

                                        Every live parking ticket has a slot at or below the active productive-window base.

                                        Equations
                                        Instances For
                                          theorem IndexedGrammar.Aho.IndexTicketLedger.ParkingBelow.toAtOrBelow {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} {A : g.nt} {stack : List g.flag} {w : List T} {parse : g.NFParse A stack w} {cursor : ScheduleCursor g input} {ledger : IndexTicketLedger cursor} {window : ProductiveOwnerWindow parse} (hbelow : ledger.ParkingBelow window) :
                                          ledger.ParkingAtOrBelow window

                                          A strict parking bound also supplies the corresponding non-strict bound.

                                          theorem IndexedGrammar.Aho.IndexTicketLedger.ParkingBelow.parkingTicket_fresh {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} {A : g.nt} {stack : List g.flag} {w : List T} {parse : g.NFParse A stack w} {cursor : ScheduleCursor g input} {ledger : IndexTicketLedger cursor} {window : ProductiveOwnerWindow parse} (hbelow : ledger.ParkingBelow window) :
                                          window.parkingTicketcursor.indexTickets ledger.ticketOf

                                          The canonical window-base parking ticket is fresh under a strict parking bound.

                                          theorem IndexedGrammar.Aho.IndexTicketLedger.ParkingBelow.mono {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} {A₁ A₂ : g.nt} {stack₁ stack₂ : List g.flag} {w₁ w₂ : List T} {parse₁ : g.NFParse A₁ stack₁ w₁} {parse₂ : g.NFParse A₂ stack₂ w₂} {cursor : ScheduleCursor g input} {ledger : IndexTicketLedger cursor} {oldWindow : ProductiveOwnerWindow parse₁} {newWindow : ProductiveOwnerWindow parse₂} (hbelow : ledger.ParkingBelow oldWindow) (hbase : oldWindow.base newWindow.base) :
                                          ledger.ParkingBelow newWindow

                                          Increasing the productive-window base preserves a strict parking bound.

                                          theorem IndexedGrammar.Aho.IndexTicketLedger.ParkingAtOrBelow.mono {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} {A₁ A₂ : g.nt} {stack₁ stack₂ : List g.flag} {w₁ w₂ : List T} {parse₁ : g.NFParse A₁ stack₁ w₁} {parse₂ : g.NFParse A₂ stack₂ w₂} {cursor : ScheduleCursor g input} {ledger : IndexTicketLedger cursor} {oldWindow : ProductiveOwnerWindow parse₁} {newWindow : ProductiveOwnerWindow parse₂} (hbound : ledger.ParkingAtOrBelow oldWindow) (hbase : oldWindow.base newWindow.base) :
                                          ledger.ParkingAtOrBelow newWindow

                                          Increasing the productive-window base preserves a non-strict parking bound.

                                          theorem IndexedGrammar.Aho.IndexTicketLedger.ParkingAtOrBelow.toBelow_of_base_lt {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} {A₁ A₂ : g.nt} {stack₁ stack₂ : List g.flag} {w₁ w₂ : List T} {parse₁ : g.NFParse A₁ stack₁ w₁} {parse₂ : g.NFParse A₂ stack₂ w₂} {cursor : ScheduleCursor g input} {ledger : IndexTicketLedger cursor} {oldWindow : ProductiveOwnerWindow parse₁} {newWindow : ProductiveOwnerWindow parse₂} (hbound : ledger.ParkingAtOrBelow oldWindow) (hbase : oldWindow.base < newWindow.base) :
                                          ledger.ParkingBelow newWindow

                                          A strict increase of the productive-window base turns AtOrBelow back into Below.

                                          def IndexedGrammar.Aho.IndexTicketLedger.ofEmpty {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} {cursor : ScheduleCursor g input} (hinput : 0 < input.length) (hempty : cursor.indexOwners = []) :

                                          The unique useful ticket state for an owner-free cursor. The association away from live owners is deliberately arbitrary; choosing the transient ticket makes the root construction uniform.

                                          Equations
                                          • One or more equations did not get rendered due to their size.
                                          Instances For
                                            theorem IndexedGrammar.Aho.IndexTicketLedger.parkingBelow_ofEmpty {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} {A : g.nt} {stack : List g.flag} {w : List T} {parse : g.NFParse A stack w} {cursor : ScheduleCursor g input} (hinput : 0 < input.length) (hempty : cursor.indexOwners = []) (window : ProductiveOwnerWindow parse) :
                                            (ofEmpty hinput hempty).ParkingBelow window

                                            The owner-free ledger satisfies every strict window-relative parking bound.

                                            theorem IndexedGrammar.Aho.IndexTicketLedger.ticketOf_injectiveOn {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} {cursor : ScheduleCursor g input} (ledger : IndexTicketLedger cursor) {left right : Fin (10 * input.length)} (hleft : left cursor.indexOwners) (hright : right cursor.indexOwners) (heq : ledger.ticketOf left = ledger.ticketOf right) :
                                            left = right

                                            Live physical owners inherit injectivity from the duplicate-free ticket image.

                                            def IndexedGrammar.Aho.IndexTicketLedger.semanticOwnerOf {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} {cursor : ScheduleCursor g input} (ledger : IndexTicketLedger cursor) (owner : Fin (10 * input.length)) :
                                            Fin (10 * input.length)

                                            Interpret one physical owner through the ledger's logical ticket.

                                            Equations
                                            Instances For
                                              def IndexedGrammar.Aho.IndexTicketLedger.semanticCursor {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} {cursor : ScheduleCursor g input} (ledger : IndexTicketLedger cursor) :

                                              The virtual cursor on which the existing productive-owner ledger can be reused unchanged. Both compressed indices and their matching frame closes are projected.

                                              Equations
                                              Instances For
                                                theorem IndexedGrammar.Aho.IndexTicketLedger.semanticOwner_mem_indexOwners_iff {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} {cursor : ScheduleCursor g input} (ledger : IndexTicketLedger cursor) (ticket : IndexTicket input) :

                                                Membership in the virtual semantic cursor is exactly membership of the corresponding logical ticket in the physical cursor.

                                                theorem IndexedGrammar.Aho.IndexTicketLedger.ticket_not_mem_of_semanticOwner_not_mem {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} {cursor : ScheduleCursor g input} (ledger : IndexTicketLedger cursor) {ticket : IndexTicket input} (hfresh : ticket.semanticOwnerledger.semanticCursor.indexOwners) :
                                                ticketcursor.indexTickets ledger.ticketOf

                                                Negative form used directly after an existing productive-owner freshness theorem.

                                                def IndexedGrammar.Aho.IndexTicketLedger.semanticOwners {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} {cursor : ScheduleCursor g input} (ledger : IndexTicketLedger cursor) (owners : List (Fin (10 * input.length))) :
                                                List (Fin (10 * input.length))

                                                Map an aligned physical-owner list into its productive-owner ticket view.

                                                Equations
                                                Instances For
                                                  @[reducible, inline]
                                                  abbrev IndexedGrammar.Aho.IndexTicketLedger.EventTicketLayout {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} {A : g.nt} {stack : List g.flag} {w : List T} (parse : g.NFParse A stack w) (window : ProductiveOwnerWindow parse) {cursor : ScheduleCursor g input} (ledger : IndexTicketLedger cursor) (blocks : List (List g.flag)) (owners : List (Fin (10 * input.length))) :

                                                  Reuse the existing event-owned block layout on the semantic ticket projection.

                                                  Equations
                                                  Instances For
                                                    @[reducible, inline]
                                                    abbrev IndexedGrammar.Aho.IndexTicketLedger.ShadowTicketLayout {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} {A : g.nt} {stack : List g.flag} {w : List T} (parse : g.NFParse A stack w) (window : ProductiveOwnerWindow parse) {cursor : ScheduleCursor g input} (ledger : IndexTicketLedger cursor) (blocks : List (List g.flag)) (owners : List (Fin (10 * input.length))) :

                                                    Reuse the existing shadow-start layout on the semantic ticket projection.

                                                    Equations
                                                    Instances For
                                                      @[reducible, inline]
                                                      abbrev IndexedGrammar.Aho.IndexTicketLedger.SemanticScheduleOwnerLedger {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} {A : g.nt} {stack : List g.flag} {w : List T} (parse : g.NFParse A stack w) (window : ProductiveOwnerWindow parse) {cursor : ScheduleCursor g input} (ledger : IndexTicketLedger cursor) :

                                                      Reuse the complete cursor-level productive-owner ledger on the semantic ticket cursor.

                                                      Equations
                                                      Instances For
                                                        @[reducible, inline]
                                                        abbrev IndexedGrammar.Aho.IndexTicketLedger.SemanticShadowOwnerLedger {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} {A : g.nt} {stack : List g.flag} {w : List T} (parse : g.NFParse A stack w) (window : ProductiveOwnerWindow parse) {cursor : ScheduleCursor g input} (ledger : IndexTicketLedger cursor) :

                                                        Reuse the complete cursor-level shadow ledger on the semantic ticket cursor.

                                                        Equations
                                                        Instances For
                                                          def IndexedGrammar.Aho.IndexTicketLedger.insertTicket {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} {cursor : ScheduleCursor g input} (ledger : IndexTicketLedger cursor) (owner : Fin (10 * input.length)) (ticket : IndexTicket input) :
                                                          Fin (10 * input.length)IndexTicket input

                                                          The owner-to-ticket association used after allocating one physical owner.

                                                          Equations
                                                          Instances For
                                                            @[simp]
                                                            theorem IndexedGrammar.Aho.IndexTicketLedger.insertTicket_self {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} {cursor : ScheduleCursor g input} (ledger : IndexTicketLedger cursor) (owner : Fin (10 * input.length)) (ticket : IndexTicket input) :
                                                            ledger.insertTicket owner ticket owner = ticket
                                                            theorem IndexedGrammar.Aho.IndexTicketLedger.insertTicket_eq_of_mem {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} {cursor : ScheduleCursor g input} (ledger : IndexTicketLedger cursor) (owner : Fin (10 * input.length)) (ticket : IndexTicket input) {candidate : Fin (10 * input.length)} (hcandidate : candidate cursor.indexOwners) (hfresh : ownercursor.indexOwners) :
                                                            ledger.insertTicket owner ticket candidate = ledger.ticketOf candidate
                                                            def IndexedGrammar.Aho.IndexTicketLedger.allocate {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} {old new : ScheduleCursor g input} (ledger : IndexTicketLedger old) (owner : Fin (10 * input.length)) (ticket : IndexTicket input) (hownerFresh : ownerold.indexOwners) (hticketFresh : ticketold.indexTickets ledger.ticketOf) (hticketNotScratch : ∀ (hinput : 0 < input.length), ticket IndexTicket.scratch hinput) (hindices : new.indexOwners.Perm (owner :: old.indexOwners)) :

                                                            Allocate a fresh physical owner and attach a fresh logical ticket to it.

                                                            Equations
                                                            • ledger.allocate owner ticket hownerFresh hticketFresh hticketNotScratch hindices = { ticketOf := ledger.insertTicket owner ticket, tickets_nodup := , scratch_fresh := }
                                                            Instances For
                                                              @[simp]
                                                              theorem IndexedGrammar.Aho.IndexTicketLedger.allocate_ticketOf_self {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} {old new : ScheduleCursor g input} (ledger : IndexTicketLedger old) (owner : Fin (10 * input.length)) (ticket : IndexTicket input) (hownerFresh : ownerold.indexOwners) (hticketFresh : ticketold.indexTickets ledger.ticketOf) (hticketNotScratch : ∀ (hinput : 0 < input.length), ticket IndexTicket.scratch hinput) (hindices : new.indexOwners.Perm (owner :: old.indexOwners)) :
                                                              (ledger.allocate owner ticket hownerFresh hticketFresh hticketNotScratch hindices).ticketOf owner = ticket
                                                              theorem IndexedGrammar.Aho.IndexTicketLedger.allocate_ticket_eq_of_mem_of_fresh {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} {old new : ScheduleCursor g input} (ledger : IndexTicketLedger old) (owner : Fin (10 * input.length)) (ticket fresh : IndexTicket input) (hownerFresh : ownerold.indexOwners) (hticketFresh : ticketold.indexTickets ledger.ticketOf) (hticketNotScratch : ∀ (hinput : 0 < input.length), ticket IndexTicket.scratch hinput) (hindices : new.indexOwners.Perm (owner :: old.indexOwners)) (hfresh : freshold.indexTickets ledger.ticketOf) (hmem : fresh new.indexTickets (ledger.allocate owner ticket hownerFresh hticketFresh hticketNotScratch hindices).ticketOf) :
                                                              ticket = fresh

                                                              If a ticket absent from the old cursor appears after one fresh-owner allocation, it must be the ticket assigned to the new owner.

                                                              theorem IndexedGrammar.Aho.IndexTicketLedger.allocate_preserves_fresh {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} {old new : ScheduleCursor g input} (ledger : IndexTicketLedger old) (owner : Fin (10 * input.length)) (ticket fresh : IndexTicket input) (hownerFresh : ownerold.indexOwners) (hticketFresh : ticketold.indexTickets ledger.ticketOf) (hticketNotScratch : ∀ (hinput : 0 < input.length), ticket IndexTicket.scratch hinput) (hindices : new.indexOwners.Perm (owner :: old.indexOwners)) (hfresh : freshold.indexTickets ledger.ticketOf) (hne : fresh ticket) :
                                                              freshnew.indexTickets (ledger.allocate owner ticket hownerFresh hticketFresh hticketNotScratch hindices).ticketOf

                                                              Allocating a different ticket preserves freshness of every ticket absent from the old cursor.

                                                              def IndexedGrammar.Aho.IndexTicketLedger.transport {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} {old new : ScheduleCursor g input} (ledger : IndexTicketLedger old) (hindices : new.indexOwners.Perm old.indexOwners) :

                                                              Transport tickets across a cursor change which preserves physical owners up to permutation.

                                                              Equations
                                                              • ledger.transport hindices = { ticketOf := ledger.ticketOf, tickets_nodup := , scratch_fresh := }
                                                              Instances For
                                                                def IndexedGrammar.Aho.IndexTicketLedger.release {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} {old new : ScheduleCursor g input} (ledger : IndexTicketLedger old) (owner : Fin (10 * input.length)) (hindices : old.indexOwners.Perm (owner :: new.indexOwners)) :

                                                                Releasing one physical owner preserves injectivity on the remaining owners.

                                                                Equations
                                                                • ledger.release owner hindices = { ticketOf := ledger.ticketOf, tickets_nodup := , scratch_fresh := }
                                                                Instances For
                                                                  @[simp]
                                                                  theorem IndexedGrammar.Aho.IndexTicketLedger.release_ticketOf {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} {old new : ScheduleCursor g input} (ledger : IndexTicketLedger old) (owner : Fin (10 * input.length)) (hindices : old.indexOwners.Perm (owner :: new.indexOwners)) :
                                                                  (ledger.release owner hindices).ticketOf = ledger.ticketOf
                                                                  @[simp]
                                                                  theorem IndexedGrammar.Aho.IndexTicketLedger.release_semanticOwnerOf {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} {old new : ScheduleCursor g input} (ledger : IndexTicketLedger old) (owner : Fin (10 * input.length)) (hindices : old.indexOwners.Perm (owner :: new.indexOwners)) (candidate : Fin (10 * input.length)) :
                                                                  (ledger.release owner hindices).semanticOwnerOf candidate = ledger.semanticOwnerOf candidate
                                                                  def IndexedGrammar.Aho.IndexTicketLedger.reticket {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} {cursor : ScheduleCursor g input} (ledger : IndexTicketLedger cursor) (owner : Fin (10 * input.length)) (target : IndexTicket input) (howner : owner cursor.indexOwners) (htargetFresh : targetcursor.indexTickets ledger.ticketOf) (htargetNotScratch : ∀ (hinput : 0 < input.length), target IndexTicket.scratch hinput) :

                                                                  Reticket one live physical owner by swapping its old logical ticket with a fresh target. Because live tickets are duplicate-free and the target is absent, only that owner changes on the projected cursor; applying the same map to frame closes keeps owner matching coherent.

                                                                  Equations
                                                                  • One or more equations did not get rendered due to their size.
                                                                  Instances For
                                                                    @[simp]
                                                                    theorem IndexedGrammar.Aho.IndexTicketLedger.reticket_ticketOf_owner {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} {cursor : ScheduleCursor g input} (ledger : IndexTicketLedger cursor) (owner : Fin (10 * input.length)) (target : IndexTicket input) (howner : owner cursor.indexOwners) (htargetFresh : targetcursor.indexTickets ledger.ticketOf) (htargetNotScratch : ∀ (hinput : 0 < input.length), target IndexTicket.scratch hinput) :
                                                                    (ledger.reticket owner target howner htargetFresh htargetNotScratch).ticketOf owner = target
                                                                    theorem IndexedGrammar.Aho.IndexTicketLedger.reticket_ticketOf_eq_of_mem_ne {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} {cursor : ScheduleCursor g input} (ledger : IndexTicketLedger cursor) (owner : Fin (10 * input.length)) (target : IndexTicket input) (howner : owner cursor.indexOwners) (htargetFresh : targetcursor.indexTickets ledger.ticketOf) (htargetNotScratch : ∀ (hinput : 0 < input.length), target IndexTicket.scratch hinput) {candidate : Fin (10 * input.length)} (hcandidate : candidate cursor.indexOwners) (hne : candidate owner) :
                                                                    (ledger.reticket owner target howner htargetFresh htargetNotScratch).ticketOf candidate = ledger.ticketOf candidate

                                                                    Reticketing one live owner leaves every other live owner association unchanged.

                                                                    theorem IndexedGrammar.Aho.IndexTicketLedger.reticket_old_fresh {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} {cursor : ScheduleCursor g input} (ledger : IndexTicketLedger cursor) (owner : Fin (10 * input.length)) (target : IndexTicket input) (howner : owner cursor.indexOwners) (htargetFresh : targetcursor.indexTickets ledger.ticketOf) (htargetNotScratch : ∀ (hinput : 0 < input.length), target IndexTicket.scratch hinput) :
                                                                    ledger.ticketOf ownercursor.indexTickets (ledger.reticket owner target howner htargetFresh htargetNotScratch).ticketOf

                                                                    After reticketing to a fresh target, the old ticket is absent from the live cursor.

                                                                    Preservation of window-relative parking bounds #

                                                                    theorem IndexedGrammar.Aho.IndexTicketLedger.ParkingBelow.swapTickets_nonparking {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} {A : g.nt} {stack : List g.flag} {w : List T} {parse : g.NFParse A stack w} {cursor : ScheduleCursor g input} {ledger : IndexTicketLedger cursor} {window : ProductiveOwnerWindow parse} (hbound : ledger.ParkingBelow window) (left right : IndexTicket input) (hleft : ∀ (hinput : 0 < input.length), left IndexTicket.scratch hinput) (hright : ∀ (hinput : 0 < input.length), right IndexTicket.scratch hinput) (hleftNonparking : left.Nonparking) (hrightNonparking : right.Nonparking) :
                                                                    (ledger.swapTickets left right hleft hright).ParkingBelow window

                                                                    Swapping two nonparking tickets preserves a strict parking bound.

                                                                    theorem IndexedGrammar.Aho.IndexTicketLedger.ParkingAtOrBelow.swapTickets_nonparking {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} {A : g.nt} {stack : List g.flag} {w : List T} {parse : g.NFParse A stack w} {cursor : ScheduleCursor g input} {ledger : IndexTicketLedger cursor} {window : ProductiveOwnerWindow parse} (hbound : ledger.ParkingAtOrBelow window) (left right : IndexTicket input) (hleft : ∀ (hinput : 0 < input.length), left IndexTicket.scratch hinput) (hright : ∀ (hinput : 0 < input.length), right IndexTicket.scratch hinput) (hleftNonparking : left.Nonparking) (hrightNonparking : right.Nonparking) :
                                                                    (ledger.swapTickets left right hleft hright).ParkingAtOrBelow window

                                                                    Swapping two nonparking tickets preserves a non-strict parking bound.

                                                                    theorem IndexedGrammar.Aho.IndexTicketLedger.ParkingBelow.transport {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} {A : g.nt} {stack : List g.flag} {w : List T} {parse : g.NFParse A stack w} {old new : ScheduleCursor g input} {ledger : IndexTicketLedger old} {window : ProductiveOwnerWindow parse} (hbound : ledger.ParkingBelow window) (hindices : new.indexOwners.Perm old.indexOwners) :
                                                                    (ledger.transport hindices).ParkingBelow window

                                                                    Transport across a physical-owner permutation preserves strict parking bounds.

                                                                    theorem IndexedGrammar.Aho.IndexTicketLedger.ParkingAtOrBelow.transport {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} {A : g.nt} {stack : List g.flag} {w : List T} {parse : g.NFParse A stack w} {old new : ScheduleCursor g input} {ledger : IndexTicketLedger old} {window : ProductiveOwnerWindow parse} (hbound : ledger.ParkingAtOrBelow window) (hindices : new.indexOwners.Perm old.indexOwners) :
                                                                    (ledger.transport hindices).ParkingAtOrBelow window

                                                                    Transport across a physical-owner permutation preserves non-strict parking bounds.

                                                                    theorem IndexedGrammar.Aho.IndexTicketLedger.ParkingBelow.transport_mono {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} {A₁ A₂ : g.nt} {stack₁ stack₂ : List g.flag} {w₁ w₂ : List T} {parse₁ : g.NFParse A₁ stack₁ w₁} {parse₂ : g.NFParse A₂ stack₂ w₂} {old new : ScheduleCursor g input} {ledger : IndexTicketLedger old} {oldWindow : ProductiveOwnerWindow parse₁} {newWindow : ProductiveOwnerWindow parse₂} (hbound : ledger.ParkingBelow oldWindow) (hindices : new.indexOwners.Perm old.indexOwners) (hbase : oldWindow.base newWindow.base) :
                                                                    (ledger.transport hindices).ParkingBelow newWindow

                                                                    Transport followed by a weak base increase preserves a strict parking bound.

                                                                    theorem IndexedGrammar.Aho.IndexTicketLedger.ParkingAtOrBelow.transport_mono {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} {A₁ A₂ : g.nt} {stack₁ stack₂ : List g.flag} {w₁ w₂ : List T} {parse₁ : g.NFParse A₁ stack₁ w₁} {parse₂ : g.NFParse A₂ stack₂ w₂} {old new : ScheduleCursor g input} {ledger : IndexTicketLedger old} {oldWindow : ProductiveOwnerWindow parse₁} {newWindow : ProductiveOwnerWindow parse₂} (hbound : ledger.ParkingAtOrBelow oldWindow) (hindices : new.indexOwners.Perm old.indexOwners) (hbase : oldWindow.base newWindow.base) :
                                                                    (ledger.transport hindices).ParkingAtOrBelow newWindow

                                                                    Transport followed by a weak base increase preserves a non-strict parking bound.

                                                                    theorem IndexedGrammar.Aho.IndexTicketLedger.ParkingAtOrBelow.transport_toBelow_of_base_lt {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} {A₁ A₂ : g.nt} {stack₁ stack₂ : List g.flag} {w₁ w₂ : List T} {parse₁ : g.NFParse A₁ stack₁ w₁} {parse₂ : g.NFParse A₂ stack₂ w₂} {old new : ScheduleCursor g input} {ledger : IndexTicketLedger old} {oldWindow : ProductiveOwnerWindow parse₁} {newWindow : ProductiveOwnerWindow parse₂} (hbound : ledger.ParkingAtOrBelow oldWindow) (hindices : new.indexOwners.Perm old.indexOwners) (hbase : oldWindow.base < newWindow.base) :
                                                                    (ledger.transport hindices).ParkingBelow newWindow

                                                                    A strict base increase after transport restores a strict bound from AtOrBelow.

                                                                    theorem IndexedGrammar.Aho.IndexTicketLedger.ParkingBelow.release {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} {A : g.nt} {stack : List g.flag} {w : List T} {parse : g.NFParse A stack w} {old new : ScheduleCursor g input} {ledger : IndexTicketLedger old} {window : ProductiveOwnerWindow parse} (hbound : ledger.ParkingBelow window) (owner : Fin (10 * input.length)) (hindices : old.indexOwners.Perm (owner :: new.indexOwners)) :
                                                                    (ledger.release owner hindices).ParkingBelow window

                                                                    Releasing one physical owner preserves strict parking bounds.

                                                                    theorem IndexedGrammar.Aho.IndexTicketLedger.ParkingAtOrBelow.release {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} {A : g.nt} {stack : List g.flag} {w : List T} {parse : g.NFParse A stack w} {old new : ScheduleCursor g input} {ledger : IndexTicketLedger old} {window : ProductiveOwnerWindow parse} (hbound : ledger.ParkingAtOrBelow window) (owner : Fin (10 * input.length)) (hindices : old.indexOwners.Perm (owner :: new.indexOwners)) :
                                                                    (ledger.release owner hindices).ParkingAtOrBelow window

                                                                    Releasing one physical owner preserves non-strict parking bounds.

                                                                    theorem IndexedGrammar.Aho.IndexTicketLedger.ParkingBelow.allocate_nonparking {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} {A : g.nt} {stack : List g.flag} {w : List T} {parse : g.NFParse A stack w} {old new : ScheduleCursor g input} {ledger : IndexTicketLedger old} {window : ProductiveOwnerWindow parse} (hbound : ledger.ParkingBelow window) (owner : Fin (10 * input.length)) (ticket : IndexTicket input) (hownerFresh : ownerold.indexOwners) (hticketFresh : ticketold.indexTickets ledger.ticketOf) (hticketNotScratch : ∀ (hinput : 0 < input.length), ticket IndexTicket.scratch hinput) (hindices : new.indexOwners.Perm (owner :: old.indexOwners)) (hnonparking : ticket.Nonparking) :
                                                                    (ledger.allocate owner ticket hownerFresh hticketFresh hticketNotScratch hindices).ParkingBelow window

                                                                    Allocating a nonparking ticket preserves a strict parking bound.

                                                                    theorem IndexedGrammar.Aho.IndexTicketLedger.ParkingAtOrBelow.allocate_nonparking {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} {A : g.nt} {stack : List g.flag} {w : List T} {parse : g.NFParse A stack w} {old new : ScheduleCursor g input} {ledger : IndexTicketLedger old} {window : ProductiveOwnerWindow parse} (hbound : ledger.ParkingAtOrBelow window) (owner : Fin (10 * input.length)) (ticket : IndexTicket input) (hownerFresh : ownerold.indexOwners) (hticketFresh : ticketold.indexTickets ledger.ticketOf) (hticketNotScratch : ∀ (hinput : 0 < input.length), ticket IndexTicket.scratch hinput) (hindices : new.indexOwners.Perm (owner :: old.indexOwners)) (hnonparking : ticket.Nonparking) :
                                                                    (ledger.allocate owner ticket hownerFresh hticketFresh hticketNotScratch hindices).ParkingAtOrBelow window

                                                                    Allocating a nonparking ticket preserves a non-strict parking bound.

                                                                    theorem IndexedGrammar.Aho.IndexTicketLedger.ParkingBelow.allocate_core {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} {A : g.nt} {stack : List g.flag} {w : List T} {parse : g.NFParse A stack w} {old new : ScheduleCursor g input} {ledger : IndexTicketLedger old} {window : ProductiveOwnerWindow parse} (hbound : ledger.ParkingBelow window) (owner : Fin (10 * input.length)) (ticket : IndexTicket input) (hownerFresh : ownerold.indexOwners) (hticketFresh : ticketold.indexTickets ledger.ticketOf) (hticketNotScratch : ∀ (hinput : 0 < input.length), ticket IndexTicket.scratch hinput) (hindices : new.indexOwners.Perm (owner :: old.indexOwners)) (hcore : ticket < 4 * input.length) :
                                                                    (ledger.allocate owner ticket hownerFresh hticketFresh hticketNotScratch hindices).ParkingBelow window

                                                                    Allocating a core ticket preserves a strict parking bound.

                                                                    theorem IndexedGrammar.Aho.IndexTicketLedger.ParkingAtOrBelow.allocate_core {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} {A : g.nt} {stack : List g.flag} {w : List T} {parse : g.NFParse A stack w} {old new : ScheduleCursor g input} {ledger : IndexTicketLedger old} {window : ProductiveOwnerWindow parse} (hbound : ledger.ParkingAtOrBelow window) (owner : Fin (10 * input.length)) (ticket : IndexTicket input) (hownerFresh : ownerold.indexOwners) (hticketFresh : ticketold.indexTickets ledger.ticketOf) (hticketNotScratch : ∀ (hinput : 0 < input.length), ticket IndexTicket.scratch hinput) (hindices : new.indexOwners.Perm (owner :: old.indexOwners)) (hcore : ticket < 4 * input.length) :
                                                                    (ledger.allocate owner ticket hownerFresh hticketFresh hticketNotScratch hindices).ParkingAtOrBelow window

                                                                    Allocating a core ticket preserves a non-strict parking bound.

                                                                    theorem IndexedGrammar.Aho.IndexTicketLedger.ParkingBelow.reticket_nonparking {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} {A : g.nt} {stack : List g.flag} {w : List T} {parse : g.NFParse A stack w} {cursor : ScheduleCursor g input} {ledger : IndexTicketLedger cursor} {window : ProductiveOwnerWindow parse} (hbound : ledger.ParkingBelow window) (owner : Fin (10 * input.length)) (target : IndexTicket input) (howner : owner cursor.indexOwners) (htargetFresh : targetcursor.indexTickets ledger.ticketOf) (htargetNotScratch : ∀ (hinput : 0 < input.length), target IndexTicket.scratch hinput) (hnonparking : target.Nonparking) :
                                                                    (ledger.reticket owner target howner htargetFresh htargetNotScratch).ParkingBelow window

                                                                    Reticketing one owner to a fresh nonparking target preserves a strict parking bound.

                                                                    theorem IndexedGrammar.Aho.IndexTicketLedger.ParkingAtOrBelow.reticket_nonparking {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} {A : g.nt} {stack : List g.flag} {w : List T} {parse : g.NFParse A stack w} {cursor : ScheduleCursor g input} {ledger : IndexTicketLedger cursor} {window : ProductiveOwnerWindow parse} (hbound : ledger.ParkingAtOrBelow window) (owner : Fin (10 * input.length)) (target : IndexTicket input) (howner : owner cursor.indexOwners) (htargetFresh : targetcursor.indexTickets ledger.ticketOf) (htargetNotScratch : ∀ (hinput : 0 < input.length), target IndexTicket.scratch hinput) (hnonparking : target.Nonparking) :
                                                                    (ledger.reticket owner target howner htargetFresh htargetNotScratch).ParkingAtOrBelow window

                                                                    Reticketing one owner to a fresh nonparking target preserves a non-strict bound.

                                                                    theorem IndexedGrammar.Aho.IndexTicketLedger.ParkingBelow.reticket_core {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} {A : g.nt} {stack : List g.flag} {w : List T} {parse : g.NFParse A stack w} {cursor : ScheduleCursor g input} {ledger : IndexTicketLedger cursor} {window : ProductiveOwnerWindow parse} (hbound : ledger.ParkingBelow window) (owner : Fin (10 * input.length)) (target : IndexTicket input) (howner : owner cursor.indexOwners) (htargetFresh : targetcursor.indexTickets ledger.ticketOf) (htargetNotScratch : ∀ (hinput : 0 < input.length), target IndexTicket.scratch hinput) (hcore : target < 4 * input.length) :
                                                                    (ledger.reticket owner target howner htargetFresh htargetNotScratch).ParkingBelow window

                                                                    Reticketing one owner to a fresh core target preserves a strict parking bound.

                                                                    theorem IndexedGrammar.Aho.IndexTicketLedger.ParkingAtOrBelow.reticket_core {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} {A : g.nt} {stack : List g.flag} {w : List T} {parse : g.NFParse A stack w} {cursor : ScheduleCursor g input} {ledger : IndexTicketLedger cursor} {window : ProductiveOwnerWindow parse} (hbound : ledger.ParkingAtOrBelow window) (owner : Fin (10 * input.length)) (target : IndexTicket input) (howner : owner cursor.indexOwners) (htargetFresh : targetcursor.indexTickets ledger.ticketOf) (htargetNotScratch : ∀ (hinput : 0 < input.length), target IndexTicket.scratch hinput) (hcore : target < 4 * input.length) :
                                                                    (ledger.reticket owner target howner htargetFresh htargetNotScratch).ParkingAtOrBelow window

                                                                    Reticketing one owner to a fresh core target preserves a non-strict parking bound.

                                                                    theorem IndexedGrammar.Aho.IndexTicketLedger.ParkingBelow.reticket_parkingTicket {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} {A : g.nt} {stack : List g.flag} {w : List T} {parse : g.NFParse A stack w} {cursor : ScheduleCursor g input} {ledger : IndexTicketLedger cursor} {window : ProductiveOwnerWindow parse} (hbound : ledger.ParkingBelow window) (owner : Fin (10 * input.length)) (howner : owner cursor.indexOwners) (htargetFresh : window.parkingTicketcursor.indexTickets ledger.ticketOf) (htargetNotScratch : ∀ (hinput : 0 < input.length), window.parkingTicket IndexTicket.scratch hinput) :
                                                                    (ledger.reticket owner window.parkingTicket howner htargetFresh htargetNotScratch).ParkingAtOrBelow window

                                                                    Parking one owner at the canonical window-base ticket weakens Below only to AtOrBelow.

                                                                    theorem IndexedGrammar.Aho.IndexTicketLedger.index_count_le {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} {cursor : ScheduleCursor g input} (ledger : IndexTicketLedger cursor) :
                                                                    cursor.indexOwners.length 6 * input.length

                                                                    Logical ticket injectivity bounds physical persistent indices by the complete 6|input| logical carrier.

                                                                    theorem IndexedGrammar.Aho.IndexTicketLedger.index_count_lt {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} {cursor : ScheduleCursor g input} (ledger : IndexTicketLedger cursor) (hinput : 0 < input.length) :
                                                                    cursor.indexOwners.length < 6 * input.length

                                                                    The permanently reserved scratch ticket leaves strict room in the complete logical carrier. This is deliberately not a bound for the smaller physical owner pool.

                                                                    theorem IndexedGrammar.Aho.IndexTicketLedger.pool_free_ne_nil {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} {cursor : ScheduleCursor g input} (ledger : IndexTicketLedger cursor) (pool : IndexOwnerPool cursor) (hcapacity : cursor.indexOwners.length < 6 * input.length) :
                                                                    pool.free []

                                                                    An explicit strict physical-capacity bound implies that the physical owner pool is nonempty. Logical-ticket cardinality alone does not imply this after adding parking tickets.

                                                                    Semantic-owner images of live tickets are also duplicate-free.