Advertisement
Guest User

Untitled

a guest
Jan 20th, 2020
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. pf-redreddepth : (t : Tree) -> {pf : T (is-just (redRed t))} -> (depth t ≡ depth (proj₁ (to-witness-T (redRed t) pf)))
  2. pf-redreddepth (Red Leaf (Red rl rr _) _) = refl
  3. pf-redreddepth (Red (Red ll lr _) r _) = refl
  4. pf-redreddepth (Red l@(Black _ _ _) (Red _ _ _) _) = refl
  5.  
  6. pf-depthbalance :
  7.        (l : Tree)
  8.     -> (r : Tree)
  9.     -> (k :)
  10.     -> (1 + depth l ≡ depth (balance l r k))
  11. pf-depthbalance l r k with redRed l
  12. pf-depthbalance l r k | pf@(just (ll₁ , i , ll₂ , j , ll₃)) = cong suc $ pf-redreddepth l
  13. pf-depthbalance l r k | nothing = {!!}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement