All rearrangement cones are proper::
- sage: all([ rearrangement_cone(p,n).is_proper()
- ....: for n in range(10)
- ....: for p in range(n) ])
+ sage: all( rearrangement_cone(p,n).is_proper()
+ ....: for n in range(10)
+ ....: for p in range(n) )
True
The Lyapunov rank of the rearrangement cone of order ``p`` in ``n``
dimensions is ``n`` for ``p == 1`` or ``p == n`` and one otherwise::
- sage: all([ rearrangement_cone(p,n).lyapunov_rank() == n
- ....: for n in range(2, 10)
- ....: for p in [1, n-1] ])
+ sage: all( rearrangement_cone(p,n).lyapunov_rank() == n
+ ....: for n in range(2, 10)
+ ....: for p in [1, n-1] )
True
- sage: all([ rearrangement_cone(p,n).lyapunov_rank() == 1
- ....: for n in range(3, 10)
- ....: for p in range(2, n-1) ])
+ sage: all( rearrangement_cone(p,n).lyapunov_rank() == 1
+ ....: for n in range(3, 10)
+ ....: for p in range(2, n-1) )
True
TESTS:
sage: p = ZZ.random_element(1,n)
sage: K = rearrangement_cone(p,n)
sage: P = SymmetricGroup(n).random_element().matrix()
- sage: all([ K.contains(P*r) for r in K.rays() ])
+ sage: all( K.contains(P*r) for r in K )
True
"""
Every element of a rearrangement cone should have the property::
- sage: for n in range(2,10):
- ....: for p in range(1, n-1):
- ....: K = rearrangement_cone(p,n)
- ....: v = K.random_element()
- ....: if not has_rearrangement_property(v,p):
- ....: print(v)
+ sage: set_random_seed()
+ sage: all( has_rearrangement_property(
+ ....: rearrangement_cone(p,n).random_element(),
+ ....: p
+ ....: )
+ ....: for n in range(2, 10)
+ ....: for p in range(1, n-1)
+ ....: )
+ True
"""
components = sorted(v)[0:p]