Ordering a list of triplets according to lexical order
Given two triplets (a,b,c) and (a',b',c'), by definition (a,b,c) is less than (a',b',c') with respect to lexical order if a < a' or (a=a' and b < b') or (a=a' and b=b' and c < c' ). I want to order a list of triplets according to such order, for example if a list L consists of (1,2,3), (1,1,5), (1,3,5), (1,6,7), (8,7,3) . Is there a technique to do this by Sage.