summaryrefslogtreecommitdiff
path: root/backends/lean/Base
diff options
context:
space:
mode:
authorZyad Hassan2024-02-23 16:37:58 -0800
committerSon Ho2024-03-08 09:45:57 +0100
commit5427563a8000f281ac614a2501fb9983beb44f21 (patch)
tree55835ec19c84d06fb291cf3df456a90f88f8dc7e /backends/lean/Base
parent44248ccfe3bfb8c45e5bb434d8dfb3dfa6e6b69c (diff)
Fix tuple indexing for Lean backend
Diffstat (limited to '')
-rw-r--r--backends/lean/Base/IList/IList.lean2
1 files changed, 1 insertions, 1 deletions
diff --git a/backends/lean/Base/IList/IList.lean b/backends/lean/Base/IList/IList.lean
index 51457c20..ca5ee266 100644
--- a/backends/lean/Base/IList/IList.lean
+++ b/backends/lean/Base/IList/IList.lean
@@ -33,7 +33,7 @@ def indexOpt (ls : List α) (i : Int) : Option α :=
@[simp] theorem indexOpt_zero_cons : indexOpt ((x :: tl) : List α) 0 = some x := by simp [indexOpt]
@[simp] theorem indexOpt_nzero_cons (hne : i ≠ 0) : indexOpt ((x :: tl) : List α) i = indexOpt tl (i - 1) := by simp [*, indexOpt]
--- Remark: if i < 0, then the result is the defaul element
+-- Remark: if i < 0, then the result is the default element
def index [Inhabited α] (ls : List α) (i : Int) : α :=
match ls with
| [] => Inhabited.default