Documentation

Std.Data.UnionFind.Lemmas

@[simp]
theorem Std.UnionFind.arr_push {m : Std.UnionFind} :
(Std.UnionFind.push m).arr = Array.push m.arr { parent := Array.size m.arr, rank := 0 }
@[simp]
theorem Std.UnionFind.parentD_push {a : Nat} {arr : Array Std.UFNode} :
Std.UnionFind.parentD (Array.push arr { parent := Array.size arr, rank := 0 }) a = Std.UnionFind.parentD arr a
@[simp]
theorem Std.UnionFind.rankD_push {a : Nat} {arr : Array Std.UFNode} :
Std.UnionFind.rankD (Array.push arr { parent := Array.size arr, rank := 0 }) a = Std.UnionFind.rankD arr a
theorem Std.UnionFind.parentD_linkAux {i : Nat} {self : Array Std.UFNode} {x : Fin (Array.size self)} {y : Fin (Array.size self)} :
Std.UnionFind.parentD (Std.UnionFind.linkAux self x y) i = if x = y then Std.UnionFind.parentD self i else if (Array.get self y).rank < (Array.get self x).rank then if y = i then x else Std.UnionFind.parentD self i else if x = i then y else Std.UnionFind.parentD self i
theorem Std.UnionFind.root_link.go {self : Std.UnionFind} {x : Fin (Std.UnionFind.size self)} {y : Fin (Std.UnionFind.size self)} (xroot : Std.UnionFind.parent self x = x) (yroot : Std.UnionFind.parent self y = y) {m : Std.UnionFind} (hm : ∀ (i : Nat), Std.UnionFind.parent m i = if y = i then x else Std.UnionFind.parent self i) (i : Nat) :
Std.UnionFind.rootD m i = if Std.UnionFind.rootD self i = x Std.UnionFind.rootD self i = y then x else Std.UnionFind.rootD self i
theorem Std.UnionFind.Equiv.trans {self : Std.UnionFind} {a : Nat} {b : Nat} {c : Nat} :