Equations
- Chapter4.D1.search₀ f t = List.filter (fun (x : Nat) => decide (t = f x)) (List.range (t + 1))
Instances For
Equations
- Chapter4.D1.search₁ f t = Chapter4.D1.search₁.seek f t (0, t)
Instances For
Equations
- Chapter4.D1.search₂ f t = Chapter4.D1.search₂.seek f t 0 t
Instances For
Equations
- Chapter4.D1.bound.b f t = Chapter1.until' (Chapter4.D1.bound.done f t) (fun (x : Nat) => x * 2) 1
Instances For
Equations
- Chapter4.D1.bound.done f t b = decide (t ≤ f b)
Instances For
Equations
- Chapter4.D1.search₃ f t = if f (Chapter4.D1.search₃.x f t) = t then [Chapter4.D1.search₃.x f t] else []
Instances For
Equations
- Chapter4.D1.search₃.x f t = Chapter4.D1.smallest f t (Chapter4.D1.bound f t)
Instances For
Equations
- Chapter4.D2.search₀ f t = List.filter (fun (p : Nat × Nat) => decide (t = f p)) (Chapter4.D2.search₀.ps t)
Instances For
Equations
- Chapter4.D2.search₀.as t = List.range (t + 1)
Instances For
Equations
- Chapter4.D2.search₀.ps t = Chapter1.concatMap (fun (x : Nat) => List.map (fun (y : Nat) => (x, y)) (Chapter4.D2.search₀.as t)) (Chapter4.D2.search₀.as t)
Instances For
Equations
- Chapter4.D2.myhead₁ [] h_2 = absurd ⋯ h_2
- Chapter4.D2.myhead₁ (x :: tail) h_2 = x
Instances For
Equations
- Chapter4.D2.myhead₂ (x :: tail) x_1 = x
Instances For
Equations
Instances For
Equations
- Chapter4.BST1.Tree.null.toFormat = Std.Format.text "."
- (t₁.node x_1 t₂).toFormat = Std.Format.bracket "(" (Std.format x_1 ++ Std.Format.line ++ Std.Format.nest 2 t₁.toFormat ++ Std.Format.line ++ Std.Format.nest 2 t₂.toFormat) ")"
Instances For
Equations
- Chapter4.BST1.instReprTreeOfToString = { reprPrec := fun (e : Chapter4.BST1.Tree α) (x : Nat) => e.toFormat }
Equations
- Chapter4.BST1.search f x✝ Chapter4.BST1.Tree.null = none
- Chapter4.BST1.search f x✝ (l.node x_2 r) = if f x_2 < x✝ then Chapter4.BST1.search f x✝ r else if f x_2 = x✝ then some x_2 else Chapter4.BST1.search f x✝ l
Instances For
@[irreducible]
Equations
- One or more equations did not get rendered due to their size.
- Chapter4.BST1.mkTree [] = Chapter4.BST1.Tree.null
Instances For
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
- Chapter4.BST2.Tree.null.toFormat = Std.Format.text "."
Instances For
Equations
- Chapter4.BST2.instReprTreeOfToString = { reprPrec := fun (e : Chapter4.BST2.Tree a) (x : Nat) => e.toFormat }
Equations
- Chapter4.BST2.Tree.null.height = 0
- (Chapter4.BST2.Tree.node a_1 t₁ x_1 t₂).height = a_1
Instances For
Equations
- Chapter4.BST2.node l x r = Chapter4.BST2.Tree.node (Chapter4.BST2.node.h l r) l x r
Instances For
Equations
- Chapter4.BST2.bias Chapter4.BST2.Tree.null = 0
- Chapter4.BST2.bias (Chapter4.BST2.Tree.node a_1 t₁ x_1 t₂) = ↑t₁.height - ↑t₂.height
Instances For
Equations
- Chapter4.BST2.rotr Chapter4.BST2.Tree.null = Chapter4.BST2.Tree.null
- Chapter4.BST2.rotr (Chapter4.BST2.Tree.node a_1 (Chapter4.BST2.Tree.node a_2 ll y rl) x_1 r) = Chapter4.BST2.node ll y (Chapter4.BST2.node rl x_1 r)
- Chapter4.BST2.rotr (Chapter4.BST2.Tree.node a_1 Chapter4.BST2.Tree.null a_2 a_3) = Chapter4.BST2.Tree.null
Instances For
Equations
- Chapter4.BST2.rotl Chapter4.BST2.Tree.null = Chapter4.BST2.Tree.null
- Chapter4.BST2.rotl (Chapter4.BST2.Tree.node a_1 ll y (Chapter4.BST2.Tree.node a_2 lrl z rrl)) = Chapter4.BST2.node (Chapter4.BST2.node ll y lrl) z rrl
- Chapter4.BST2.rotl (Chapter4.BST2.Tree.node a_1 a_2 a_3 Chapter4.BST2.Tree.null) = Chapter4.BST2.Tree.null
Instances For
Equations
- Chapter4.BST2.balance.h1 t1 = t1.height
Instances For
Equations
- Chapter4.BST2.balance.h2 t2 = t2.height
Instances For
Equations
- Chapter4.BST2.balance.rotateR t1 x t2 = if 0 ≤ Chapter4.BST2.bias t1 then Chapter4.BST2.rotr (Chapter4.BST2.node t1 x t2) else Chapter4.BST2.rotr (Chapter4.BST2.node (Chapter4.BST2.rotl t1) x t2)
Instances For
Equations
- Chapter4.BST2.balance.rotateL t1 x t2 = if Chapter4.BST2.bias t2 ≤ 0 then Chapter4.BST2.rotl (Chapter4.BST2.node t1 x t2) else Chapter4.BST2.rotl (Chapter4.BST2.node t1 x (Chapter4.BST2.rotr t2))
Instances For
Equations
- One or more equations did not get rendered due to their size.
- Chapter4.BST2.insert x✝ Chapter4.BST2.Tree.null = Chapter4.BST2.node Chapter4.BST2.Tree.null x✝ Chapter4.BST2.Tree.null
Instances For
def
Chapter4.BST2.mkTree
{a : Type}
[LT a]
[DecidableRel fun (x1 x2 : a) => x1 < x2]
(xs : List a)
:
Tree a
Instances For
Equations
- One or more equations did not get rendered due to their size.
- Chapter4.BST2.balanceR Chapter4.BST2.Tree.null x t₂ = Chapter4.BST2.Tree.null
Instances For
Equations
- One or more equations did not get rendered due to their size.
- Chapter4.BST2.balanceL t₁ x Chapter4.BST2.Tree.null = Chapter4.BST2.Tree.null
Instances For
Equations
- One or more equations did not get rendered due to their size.
- Chapter4.BST2.insert₁ x✝ Chapter4.BST2.Tree.null = Chapter4.BST2.node Chapter4.BST2.Tree.null x✝ Chapter4.BST2.Tree.null
Instances For
Instances For
Equations
- One or more equations did not get rendered due to their size.
- Chapter4.BST2.insert₂ key x✝ Chapter4.BST2.Tree.null = Chapter4.BST2.node Chapter4.BST2.Tree.null x✝ Chapter4.BST2.Tree.null
Instances For
Equations
Instances For
Instances For
Equations
- One or more equations did not get rendered due to their size.
- Chapter4.BST2.search key k Chapter4.BST2.Tree.null = none
Instances For
@[reducible, inline]
Equations
Instances For
Equations
- Chapter4.DSet.member x Chapter4.BST2.Tree.null = false
- Chapter4.DSet.member x (Chapter4.BST2.Tree.node a_1 l y r) = if x < y then Chapter4.DSet.member x l else if x > y then Chapter4.DSet.member x r else true
Instances For
@[irreducible]
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Chapter4.DSet.combine Chapter4.BST2.Tree.null x✝ = x✝
- Chapter4.DSet.combine x✝ Chapter4.BST2.Tree.null = x✝
- Chapter4.DSet.combine x Chapter4.BST2.Tree.null = x
- Chapter4.DSet.combine x✝ (Chapter4.BST2.Tree.node a_1 b c d) = match Chapter4.DSet.deleteMin (Chapter4.BST2.Tree.node a_1 b c d) ⋯ with | (x, t) => Chapter4.BST2.balance x✝ x t
Instances For
def
Chapter4.DSet.delete
{a : Type}
[LT a]
[DecidableRel fun (x1 x2 : a) => x1 < x2]
[DecidableEq a]
:
Equations
- One or more equations did not get rendered due to their size.
- Chapter4.DSet.delete x✝ Chapter4.BST2.Tree.null = Chapter4.BST2.Tree.null
Instances For
Equations
- Chapter4.DSet.pieces x✝¹ x✝ = Chapter4.DSet.pieces.addPiece x✝¹ x✝ []
Instances For
def
Chapter4.DSet.pieces.addPiece
{α : Type}
[LT α]
[DecidableRel fun (x1 x2 : α) => x1 < x2]
(x : α)
:
Equations
- One or more equations did not get rendered due to their size.
- Chapter4.DSet.pieces.addPiece x Chapter4.BST2.Tree.null x✝ = x✝
Instances For
Equations
Instances For
Equations
- Chapter4.DSet.sew.step (t1, t2) (Chapter4.DSet.Piece.lp t x_2) = (Chapter4.BST2.gbalance t x_2 t1, t2)
- Chapter4.DSet.sew.step (t1, t2) (Chapter4.DSet.Piece.rp x_2 t) = (t1, Chapter4.BST2.gbalance t2 x_2 t)