noncomputable def
AbstractMap.toList
{α : Type u}
{β : α → Type v}
{Cnd : (α : Type u) → (α → Type v) → Prop}
{M : (α : Type u) → (β : α → Type v) → Cnd α β → Type w}
[AM : AbstractMap Cnd M]
{H : Cnd α β}
[ha : LinearOrder α]
(m : M α β H)
:
List ((i : α) × β i)
Equations
- AbstractMap.toList m = Classical.epsilon fun (xs : List ((i : α) × β i)) => (List.map (fun (x : (i : α) × β i) => x.fst) xs).SortedLT ∧ List.foldl (fun (m : M α β H) (p : (i : α) × β i) => AbstractMap.insert m p.fst p.snd) AbstractMap.empty xs = m
Instances For
noncomputable def
AbstractMap.keys
{α : Type u}
{β : α → Type v}
{Cnd : (α : Type u) → (α → Type v) → Prop}
{M : (α : Type u) → (β : α → Type v) → Cnd α β → Type w}
[AM : AbstractMap Cnd M]
{H : Cnd α β}
[ha : LinearOrder α]
(m : M α β H)
:
List α
Equations
- AbstractMap.keys m = List.map (fun (x : (i : α) × β i) => x.fst) (AbstractMap.toList m)
Instances For
def
AbstractMap.ofList
{α : Type u}
{β : α → Type v}
{Cnd : (α : Type u) → (α → Type v) → Prop}
{M : (α : Type u) → (β : α → Type v) → Cnd α β → Type w}
[AM : AbstractMap Cnd M]
{H : Cnd α β}
(xs : List ((i : α) × β i))
:
M α β H
Equations
- AbstractMap.ofList xs = List.foldl (fun (m : M α β H) (p : (i : α) × β i) => AbstractMap.insert m p.fst p.snd) AbstractMap.empty xs
Instances For
noncomputable def
AbstractMap.get?
{α : Type u}
{β : α → Type v}
{Cnd : (α : Type u) → (α → Type v) → Prop}
{M : (α : Type u) → (β : α → Type v) → Cnd α β → Type w}
[AM : AbstractMap Cnd M]
{H : Cnd α β}
(m : M α β H)
(i : α)
:
Option (β i)
Equations
- AbstractMap.get? m i = choose? fun (x : β i) => ⟨i, x⟩ ∈ AbstractMap.toList m
Instances For
noncomputable def
AbstractMap.normList
{α : Type u}
{β : α → Type v}
[ha : LinearOrder α]
(xs : List ((i : α) × β i))
:
List ((i : α) × β i)
Equations
- AbstractMap.normList xs = List.map (fun (x : { x : α // x ∈ (List.map (fun (x : (i : α) × β i) => x.fst) xs).dedup.mergeSort fun (a b : α) => decide (a ≤ b) }) => match x with | ⟨i, h⟩ => (List.find? (fun (p : (i : α) × β i) => decide (p.fst = i)) xs.reverse).get!) ((List.map (fun (x : (i : α) × β i) => x.fst) xs).dedup.mergeSort fun (a b : α) => decide (a ≤ b)).attach