OAI/Probability/FKMaps/Inventory.lean
38 declarations, 0 contain sorry, 0 declared as axioms
- abbrev
OAI.FKCRT.Inventory.Orderline 11Source documentation
noneis the flexible order; a typed order issome type.abbrev Order := Option Bool
- inductive
OAI.FKCRT.Inventory.Letterline 12 - def
OAI.FKCRT.Inventory.eligibleline 19Source documentation
Internal stacks are freshest-first. The source's surviving-burger list is
Evaluation.burgers.reverse, so source chronology is unchanged.def eligible (a : Order) (b : Bool) : Prop := a=none ∨ a=some b
Mentions: OAI.FKCRT.Inventory.Order
- instance
OAI.FKCRT.Inventory.(instance at line 21)line 21 - def
OAI.FKCRT.Inventory.popline 24 - lemma
OAI.FKCRT.Inventory.pop_appendline 28 - lemma
OAI.FKCRT.Inventory.pop_eq_none_iffline 41 - lemma
OAI.FKCRT.Inventory.pop_lengthline 48 - structure
OAI.FKCRT.Inventory.Evaluationline 65 - def
OAI.FKCRT.Inventory.stepline 70 - def
OAI.FKCRT.Inventory.runline 76 - def
OAI.FKCRT.Inventory.reduceline 80 - def
OAI.FKCRT.Inventory.evalOrdersline 82 - lemma
OAI.FKCRT.Inventory.run_appendline 85 - lemma
OAI.FKCRT.Inventory.run_orders_prefixline 91 - lemma
OAI.FKCRT.Inventory.evalOrders_nilline 105 - lemma
OAI.FKCRT.Inventory.evalOrders_appendline 107 - theorem
OAI.FKCRT.Inventory.run_older_supplyline 119Source documentation
Exact older-supply reduction. Unfilled orders retain chronological order; all surviving new burgers are fresher than all surviving old burgers.
theorem run_older_supply (w : List Letter) (s : List Bool) : run w ⟨[],s⟩ = ⟨(evalOrders (reduce w).orders s).orders, (reduce w).burgers++(evalOrders (reduce w).orders s).burgers⟩ := by …Mentions: OAI.FKCRT.Inventory.Letter, OAI.FKCRT.Inventory.run, OAI.FKCRT.Inventory.evalOrders, OAI.FKCRT.Inventory.reduce
- lemma
OAI.FKCRT.Inventory.run_burgersline 144 - def
OAI.FKCRT.Inventory.normalWordline 150 - theorem
OAI.FKCRT.Inventory.run_normalWordline 154Source documentation
A finite word may be replaced by its source reduction in any supply.
theorem run_normalWord (w : List Letter) (e : Evaluation) : run (normalWord (reduce w)) e=run w e := by …Mentions: OAI.FKCRT.Inventory.Letter, OAI.FKCRT.Inventory.Evaluation, OAI.FKCRT.Inventory.run, OAI.FKCRT.Inventory.normalWord, OAI.FKCRT.Inventory.reduce
- theorem
OAI.FKCRT.Inventory.freshest_survivor_prependline 167Source documentation
Once a suffix has a surviving burger, its freshest survivor is unchanged by prepending arbitrary further letters.
theorem freshest_survivor_prepend (w w' : List Letter) {b : Bool} {bs : List Bool} (h : (reduce w).burgers=b::bs) : (reduce (w'++w)).burgers.head?=some b := by …Mentions: OAI.FKCRT.Inventory.Letter, OAI.FKCRT.Inventory.reduce
- def
OAI.FKCRT.Inventory.Letter.incrementline 176 - def
OAI.FKCRT.Inventory.imbalanceline 180 - lemma
OAI.FKCRT.Inventory.step_imbalanceline 182 - lemma
OAI.FKCRT.Inventory.run_imbalanceline 195 - lemma
OAI.FKCRT.Inventory.reduce_imbalanceline 203 - lemma
OAI.FKCRT.Inventory.survivor_of_sum_posline 208 - lemma
OAI.FKCRT.Inventory.orders_length_le_stepline 215 - lemma
OAI.FKCRT.Inventory.orders_length_le_runline 221 - def
OAI.FKCRT.Inventory.EmptyReducingline 227 - theorem
OAI.FKCRT.Inventory.emptyReducing_dyckline 230Source documentation
Exact necessary Dyck-path event, without invoking a map encoding.
theorem emptyReducing_dyck (w : List Letter) (h : EmptyReducing w) : (w.map Letter.increment).sum=0 ∧ ∀ j,0≤((w.take j).map Letter.increment).sum := by …Mentions: OAI.FKCRT.Inventory.Letter, OAI.FKCRT.Inventory.EmptyReducing, OAI.FKCRT.Inventory.Letter.increment
- lemma
OAI.FKCRT.Inventory.evalOrders_consline 246 - lemma
OAI.FKCRT.Inventory.evalOrders_emptyline 258 - lemma
OAI.FKCRT.Inventory.evalOrders_singletonline 263 - lemma
OAI.FKCRT.Inventory.evalOrders_no_matchline 273 - lemma
OAI.FKCRT.Inventory.prepend_order_burgersline 280 - theorem
OAI.FKCRT.Inventory.first_survivor_shapeline 289Source documentation
The first backwards survivor has exactly one burger and only fixed orders of the opposite type, precisely as in source word:stopped-sum.
theorem first_survivor_shape (a : Letter) (w : List Letter) (h₀ : (reduce w).burgers=[]) (h₁ : (reduce (a::w)).burgers≠[]) : ∃ b, a=.burger b ∧ reduce (a::w)=⟨(reduce w).orders,[b]⟩ ∧ ∀ o∈(reduce w).orders,o=some (!b) := by …Mentions: OAI.FKCRT.Inventory.Letter, OAI.FKCRT.Inventory.reduce