SNAPKITTYWEST's picture
push from SNAPKITTYWEST/hyperkitty-constraint-dsl
224e773 verified
Raw History Blame Contribute Delete
1.49 kB
10
structure Witness : Type where
body · 1 line
  w : List Glyph
14
abbrev canonicalWitness : Witness := ⟨[Glyph.Pi, Glyph.Gamma, Glyph.Delta]⟩
17
abbrev evolveWitness (w : Witness) : Witness := 
body · 2 lines
  let [a, b, c] := w.w else ⟨[]⟩;
  ⟨[a.next b, b.next c, c.next a]⟩
22
theorem canonical_exhaustion : 
    (evolveWitness (evolveWitness canonicalWitness)).w = [Glyph.Omega, Glyph.Omega, Glyph.Omega] := by
proof · 2 lines
  simp [evolveWitness, canonicalWitness, Glyph.next, Q]
  decide
28
theorem invalid_fixed_point : 
    evolveWitness ⟨[Glyph.Lambda, Glyph.Lambda, Glyph.Lambda]⟩ = ⟨[Glyph.Lambda, Glyph.Lambda, Glyph.Lambda]⟩ := by
proof · 2 lines
  simp [evolveWitness, Glyph.next, Q]
  decide
34
def Witness.isExhausted (w : Witness) : Bool :=
body · 1 line
  w.w.all (· = Glyph.Omega)
38
def Witness.isInvalidFixedPoint (w : Witness) : Bool :=
body · 1 line
  w.w.all (· = Glyph.Lambda)
42
theorem witness_exhaustion_in_2_steps :
    ∀ w : Witness, w = canonicalWitness →
    (evolveWitness (evolveWitness w)).isExhausted := by
proof · 3 lines
  intro w hw
  rw [hw]
  simp [Witness.isExhausted, canonical_exhaustion]