Polynomial elim Var correct
Cslib.SKI.Polynomial.elimVar_correct
Plain-language statement
Correctness for the elimVar algorithm, which provides the inductive step of the bracket abstraction algorithm. We induct backwards on the list, corresponding to applying the transformation from the inside out. Since we haven't defined reduction for polynomials, we substitute arbitrary terms for the inner variables.
Exact Lean statement
theorem Polynomial.elimVar_correct {n : Nat} (Γ : SKI.Polynomial (n + 1)) {ys : List SKI}
(hys : ys.length = n) (z : SKI) :
(Γ.elimVar.eval ys hys ⬝ z) ↠ Γ.eval (ys ++ [z])
(by rw [List.length_append, hys, List.length_singleton])Formal artifact
Lean source
theorem Polynomial.elimVar_correct {n : Nat} (Γ : SKI.Polynomial (n + 1)) {ys : List SKI} (hys : ys.length = n) (z : SKI) : (Γ.elimVar.eval ys hys ⬝ z) ↠ Γ.eval (ys ++ [z]) (by rw [List.length_append, hys, List.length_singleton]) := by match n, Γ with | _, .term x => rw [SKI.Polynomial.elimVar, SKI.Polynomial.eval] exact MRed.K _ _ | _, .app Γ Δ => rw [SKI.Polynomial.elimVar, SKI.Polynomial.eval] trans Γ.elimVar.eval ys hys ⬝ z ⬝ (Δ.elimVar.eval ys hys ⬝ z) · exact MRed.S _ _ _ · apply parallel_mRed · exact elimVar_correct Γ hys z · exact elimVar_correct Δ hys z | n, .var i => rw [SKI.Polynomial.elimVar] split_ifs with hi · have h : (ys ++ [z])[i]'(by simp [hys]) = ys[↑i] := by grind simp_rw [SKI.Polynomial.eval, h, Fin.getElem_fin, Fin.val_ofNat, Nat.mod_eq_of_lt hi] exact MRed.K _ _ · replace hi := Nat.eq_of_lt_succ_of_not_lt i.isLt hi have app_len : (ys ++ [z]).length = n + 1 := by simpa have : (ys ++ [z])[n]'(by rw [app_len]; exact Nat.lt_add_one n) = z := by rw [List.getElem_append_right] <;> simp [hys] simp_rw [SKI.Polynomial.eval, Fin.getElem_fin, hi, this] exact MRed.I _- Project
- Lean Computer Science Library
- License
- Apache-2.0
- Commit
- f36649cff2c9
- Source
- Cslib/Languages/CombinatoryLogic/Basic.lean:91-118
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
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.
Source project: Lean Computer Science Library
Person-level attribution pending.
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.
Source project: Lean Computer Science Library
Person-level attribution pending.
Buchi Family saturation
Cslib.Automata.NA.Buchi.buchiFamily_saturation
Plain-language statement
na.buchiFamily saturates the ω-language accepted by na.
Source project: Lean Computer Science Library
Person-level attribution pending.