1 |
1. T : Type
2. L : T List
3. P : T T 
4. n : (||L||-1)
sum(if (i< j) P(swap(L;n;n+1)[i],swap(L;n;n+1)[j]) 1
sum(else 0 fi | i < ||L||; j < ||L||)
=
sum(if (i< j) P(L[i],L[j]) 1 else 0 fi | i < ||L||; j < ||L||)+if P(L[n]
sum(if (i< j) P(L[i],L[j]) 1 else 0 fi | i < ||L||; j < ||L||)+if P,L[(n
sum(if (i< j) P(L[i],L[j]) 1 else 0 fi | i < ||L||; j < ||L||)+if P+1)])
sum(if (i< j) P(L[i],L[j]) 1 else 0 fi | i < ||L||; j < ||L||)+if -1
sum(if (i< j) P(L[i],L[j]) 1 else 0 fi | i < ||L||; j < ||L||)+else 0 fi
+if P(L[(n+1)],L[n]) 1 else 0 fi
 | 28 steps |