Fixpoint linsert (t1 : tuple) (l : line) :=
match l with
|   nil => t1 :: l
| t2::l1 => match tcompare t1 t2 with
|  Gt => t2 :: linsert t1 l1
| res => t1 :: l
end
end.

Lemma linsert_c t l : {l[linsert t l]} = ({t[t]} * {l[l]})%f.
Fixpoint lsort (l : line) :=
match l with
|   nil => l
| t ::l1 => linsert t (lsort l1)
end.