All proofs
Project-declaredLean 4.33.0-rc1 · mathlib@169c26b52a38

Polynomial to SKI correct

Cslib.SKI.Polynomial.toSKI_correct

Plain-language statement

Correctness for the toSKI (bracket abstraction) algorithm.

Exact Lean statement

theorem Polynomial.toSKI_correct {n : Nat} (Γ : SKI.Polynomial n) (xs : List SKI)
    (hxs : xs.length = n) : Γ.toSKI.applyList xs ↠ Γ.eval xs hxs

Formal artifact

Lean source

Canonical source
Full Lean sourceLean 4
theorem Polynomial.toSKI_correct {n : Nat} (Γ : SKI.Polynomial n) (xs : List SKI)    (hxs : xs.length = n) : Γ.toSKI.applyList xs ↠ Γ.eval xs hxs := by  match n with  | 0 =>    rw [List.length_eq_zero_iff] at hxs    simp_rw [hxs, applyList, List.foldl_nil]    rfl  | n+1 =>    -- show that xs = ys + [z]    have : xs  [] := List.ne_nil_of_length_eq_add_one hxs    let h : xs = []   (l' : List SKI),  (b : SKI), xs = l'.concat b :=      List.eq_nil_or_concat xs    simp_rw [this, false_or, List.concat_eq_append] at h    replace ys, z, h := h    -- apply inductive step, using elimVar_correct    have : ys.length = n := by      replace h := congr_arg List.length h      simp_rw [List.length_append, List.length_singleton, hxs] at h      exact Nat.succ_inj.mp h.symm    simp_rw [h, applyList_concat]    trans Γ.elimVar.eval ys this ⬝ z    · apply MRed.head      exact SKI.Polynomial.toSKI_correct Γ.elimVar ys this    · exact SKI.Polynomial.elimVar_correct Γ this z
Project
Lean Computer Science Library
License
Apache-2.0
Commit
f36649cff2c9
Source
Cslib/Languages/CombinatoryLogic/Basic.lean:127-150

Reuse this declaration

Bring the exact result into your workflow

The import identifies the source module. Your project still needs the pinned package dependency shown on this page.

What this badge means

This completion status comes from the project or community source. It has not yet been represented here as an independent rebuild and axiom audit.

Continue in this project

Related declarations

Project-declaredLean 4.33.0-rc1

Unique minimal

Cslib.Automata.DA.FinAcc.unique_minimal

Plain-language statement

The minimal DFA M accepting the language l is unique up to unique isomorphism.

computer sciencecomputabilityprogram semantics

Source project: Lean Computer Science Library

Person-level attribution pending.

View proof record
Project-declaredLean 4.33.0-rc1

Buchi Family cover

Cslib.Automata.NA.Buchi.buchiFamily_cover

Project documentation

na.buchiFamily is a cover if na has only finitely many states. This theorem uses the Ramsey theorem for infinite graphs and does not depend on any details of na.BuchiCongruence other than that it is of finite index.

computer sciencecomputabilityprogram semantics

Source project: Lean Computer Science Library

Person-level attribution pending.

View proof record