Definition tcompare (t1 t2 : tuple) := 
  let (i1, i2, i3) := t1 in
  let (j1, j2, j3) := t2 in
  match tvcompare i1 j1 with
  | Eq =>
    match tvcompare i2 j2 with
    | Eq => tvcompare i3 j3
    |  r => r
    end
  |  r => r
  end.

Lemma tcompare_eq t1 t2 : match tcompare t1 t2 with Eq => t1 = t2 | _ => True end.