Auxillary definitions related to Lean.RArray
that are typically only used in meta-code, in
particular the ToExpr
instance.
Equations
- Lean.RArray.ofFn f h = Lean.RArray.ofFn.go f 0 n h ⋯
Instances For
Equations
- Lean.RArray.ofArray xs h = Lean.RArray.ofFn (fun (x : Fin xs.size) => xs[x]) h
Instances For
theorem
Lean.RArray.get_ofFn
{α : Type}
{n : Nat}
(f : Fin n → α)
(h : 0 < n)
(i : Fin n)
:
(Lean.RArray.ofFn f h).get ↑i = f i
The correctness theorem for ofFn
@[simp]
theorem
Lean.RArray.size_ofFn
{α : Type}
{n : Nat}
(f : Fin n → α)
(h : 0 < n)
:
(Lean.RArray.ofFn f h).size = n
Equations
- Lean.RArray.toExpr ty f (Lean.RArray.leaf x_1) = Lean.mkApp2 (Lean.mkConst `Lean.RArray.leaf) ty (f x_1)
- Lean.RArray.toExpr ty f (Lean.RArray.branch p l r) = Lean.mkApp4 (Lean.mkConst `Lean.RArray.branch) ty (Lean.mkRawNatLit p) (Lean.RArray.toExpr ty f l) (Lean.RArray.toExpr ty f r)
Instances For
Equations
- Lean.instToExprRArray = { toExpr := fun (a : Lean.RArray α) => Lean.RArray.toExpr (Lean.toTypeExpr α) Lean.toExpr a, toTypeExpr := Lean.mkApp (Lean.mkConst `Lean.RArray) (Lean.toTypeExpr α) }