This makes changes to the `GetElem` class so that it does not lead to unnecessary overhead in container like `RBMap`. The changes are to: 1. Make `getElem?` and `getElem!` part of the `GetElem` class so they can be overridden in instances. 2. Introduce a `LawfulGetElem` class that contains correctness theorems for `getElem?` and `getElem!` using the original definitions. 3. Reorganize definitions (e.g, by moving `GetElem` out of `Init.Prelude`) so that the `GetElem` changes are feasible. 4. Provide `LawfulGetElem` instances to complement all existing `GetElem` instances in Lean core. To reduce the size of the PR, this doesn't do the work of providing new `GetElem` instances for `RBMap`, `HashMap` etc. That will be done in a separate PR (#3688) that depends on this. --------- Co-authored-by: Mac Malone <tydeu@hatpress.net>
66 lines
4.2 KiB
Text
66 lines
4.2 KiB
Text
Vec.zip : {α : Type u_1} → {n : Nat} → {β : Type u_2} → Vec α ◾ → Vec β ◾ → Vec (α × β) ◾
|
||
mkConstTuple : {α : Type u_1} → α → Nat → ◾
|
||
Fin.add : {n : Nat} → Fin ◾ → Fin ◾ → Fin ◾
|
||
Vec.cons : {α : Type u} → {n : Nat} → α → Vec α ◾ → Vec α ◾
|
||
Eq.rec : {α : Sort u_1} → {a : α} → {motive : α → ◾ → Sort u} → motive ◾ ◾ → {a : α} → ◾ → motive ◾ ◾
|
||
GetElem.getElem : {coll : Type u} →
|
||
{idx : Type v} →
|
||
{elem : Type w} → {valid : coll → idx → Prop} → [self : GetElem coll idx elem ◾] → coll → idx → ◾ → elem
|
||
Term.constFold : {ctx : List Ty} → {ty : Ty} → Term ◾ ◾ → Term ◾ ◾
|
||
Term.denote : {ctx : List Ty} → {ty : Ty} → Term ◾ ◾ → HList ◾ ◾ → ◾
|
||
HList.get : {α : Type u_1} → {β : α → Type u_2} → {is : List α} → {i : α} → HList β ◾ → Member ◾ ◾ → β ◾
|
||
Member.head : {α : Type u_1} → {a : α} → {as : List α} → Member ◾ ◾
|
||
Ty.denote : Ty → Type
|
||
MonadControl.liftWith : {m : Type u → Type v} →
|
||
{n : Type u → Type w} → [self : MonadControl m n] → {α : Type u} → (({β : Type u} → n β → m ◾) → m α) → n α
|
||
MonadControl.restoreM : {m : Type u → Type v} → {n : Type u → Type w} → [self : MonadControl m n] → {α : Type u} → m ◾ → n α
|
||
Decidable.casesOn : {p : Prop} → {motive : Decidable ◾ → Sort u} → Decidable ◾ → (◾ → motive ◾) → (◾ → motive ◾) → motive ◾
|
||
Lean.getConstInfo : {m : Type → Type} →
|
||
[inst : Monad m] → [inst : Lean.MonadEnv m] → [inst : Lean.MonadError m] → Lean.Name → m Lean.ConstantInfo
|
||
Lean.Meta.instMonadMetaM : Monad fun α =>
|
||
Lean.Meta.Context →
|
||
ST.Ref PUnit Lean.Meta.State →
|
||
Lean.Core.Context → ST.Ref PUnit Lean.Core.State → PUnit → EStateM.Result Lean.Exception PUnit α
|
||
Lean.Meta.inferType : Lean.Expr →
|
||
Lean.Meta.Context →
|
||
ST.Ref PUnit Lean.Meta.State →
|
||
Lean.Core.Context → ST.Ref PUnit Lean.Core.State → PUnit → EStateM.Result Lean.Exception PUnit Lean.Expr
|
||
Lean.Elab.Term.elabTerm : Lean.Syntax →
|
||
Option Lean.Expr →
|
||
Bool →
|
||
Bool →
|
||
Lean.Elab.Term.Context →
|
||
ST.Ref PUnit Lean.Elab.Term.State →
|
||
Lean.Meta.Context →
|
||
ST.Ref PUnit Lean.Meta.State →
|
||
Lean.Core.Context → ST.Ref PUnit Lean.Core.State → PUnit → EStateM.Result Lean.Exception PUnit Lean.Expr
|
||
Nat.add : Nat → Nat → Nat
|
||
Magma.mul : Magma → ◾ → ◾ → ◾
|
||
weird1 : Bool → ◾
|
||
lamAny₁ : Bool → Monad ◾
|
||
lamAny₂ : Bool → Monad ◾
|
||
Term.constFold : List Ty → Ty → Term lcErased lcErased → Term lcErased lcErased
|
||
Term.denote : List Ty → Ty → Term lcErased lcErased → HList Ty lcErased lcErased → lcErased
|
||
HList.get : lcErased →
|
||
lcErased → List lcErased → lcErased → HList lcErased lcErased lcErased → Member lcErased lcErased lcErased → lcErased
|
||
Member.head : lcErased → lcErased → List lcErased → Member lcErased lcErased lcErased
|
||
Ty.denote : lcErased
|
||
MonadControl.liftWith : lcErased →
|
||
lcErased → MonadControl lcErased lcErased → lcErased → ((lcErased → lcErased → lcErased) → lcErased) → lcErased
|
||
MonadControl.restoreM : lcErased → lcErased → MonadControl lcErased lcErased → lcErased → lcErased → lcErased
|
||
Decidable.casesOn : lcErased → lcErased → Bool → (lcErased → lcErased) → (lcErased → lcErased) → lcErased
|
||
Lean.getConstInfo : lcErased → Monad lcErased → Lean.MonadEnv lcErased → Lean.MonadError lcErased → Lean.Name → lcErased
|
||
Lean.Meta.instMonadMetaM : Monad lcErased
|
||
Lean.Meta.inferType : Lean.Expr →
|
||
Lean.Meta.Context → lcErased → Lean.Core.Context → lcErased → PUnit → EStateM.Result Lean.Exception PUnit Lean.Expr
|
||
Lean.Elab.Term.elabTerm : Lean.Syntax →
|
||
Option Lean.Expr →
|
||
Bool →
|
||
Bool →
|
||
Lean.Elab.Term.Context →
|
||
lcErased →
|
||
Lean.Meta.Context →
|
||
lcErased → Lean.Core.Context → lcErased → PUnit → EStateM.Result Lean.Exception PUnit Lean.Expr
|
||
Nat.add : Nat → Nat → Nat
|
||
Fin.add : Nat → Nat → Nat → Nat
|
||
Lean.HashSetBucket.update : lcErased → Array (List lcErased) → USize → List lcErased → lcErased → Array (List lcErased)
|