Tuples, relations, and databases #
This file defines the basic relational model used throughout the library.
Main definitions #
Equations
- t.repr x✝ = Std.Format.bracket "[" (Std.Format.joinSep (List.map (fun (i : Fin n) => reprArg (t i)) (List.finRange n)) (Std.Format.text ", ")) "]"
Instances For
Equations
- Tuple.cast heq t = heq ▸ t
Instances For
@[implicit_reducible]
@[implicit_reducible]
Equations
- instReprTuple = { reprPrec := Tuple.repr }
@[implicit_reducible]
instance
instDecidableRelTupleLt
{T : Type}
{n : ℕ}
[LinearOrder T]
:
DecidableRel fun (t₁ t₂ : Tuple T n) => t₁ < t₂
@[implicit_reducible]
Equations
- One or more equations did not get rendered due to their size.
Equations
- Relation.cast heq r = heq ▸ r
Instances For
@[implicit_reducible]
Equations
- instAddRelation = { add := instAddRelation._aux_1 }
@[implicit_reducible]
Equations
- instSubRelation = { sub := instSubRelation._aux_1 }
Equations
- Database.find n s d = Database.find.f n s d
Instances For
def
sortedInsert
{α : Type u_1}
[LinearOrder α]
(x : α)
(l : { l : List α // List.Pairwise (fun (x1 x2 : α) => x1 ≤ x2) l })
:
Equations
- sortedInsert x l = ⟨List.orderedInsert (fun (x1 x2 : α) => x1 ≤ x2) x ↑l, ⋯⟩
Instances For
@[implicit_reducible]
Equations
- instToStringRelationOfLinearOrder = { toString := fun (r : Relation T n) => "\n".intercalate (List.map toString ↑(Multiset.foldr sortedInsert ⟨[], ⋯⟩ r)) ++ "\n" }