- The Lyapunov rank of a proper polyhedral cone in `n` dimensions can
- be any number between `1` and `n` inclusive, excluding `n-1`
- [Gowda/Tao]_. By accident, the `n-1` restriction will hold for the
- trivial cone in a trivial space as well. However, in zero dimensions,
- the Lyapunov rank of the trivial cone will be zero::
-
- sage: K = random_cone(max_dim=10, strictly_convex=True, solid=True)
- sage: b = lyapunov_rank(K)
- sage: n = K.lattice_dim()
- sage: (n == 0 or 1 <= b) and b <= n
- True
- sage: b == n-1
- False
-
- In fact [Orlitzky/Gowda]_, no closed convex polyhedral cone can have
- Lyapunov rank `n-1` in `n` dimensions::
-
- sage: K = random_cone(max_dim=10)
- sage: b = lyapunov_rank(K)
- sage: n = K.lattice_dim()
- sage: b == n-1
- False
-
- The calculation of the Lyapunov rank of an improper cone can be
- reduced to that of a proper cone [Orlitzky/Gowda]_::
-
- sage: K = random_cone(max_dim=15, solid=False, strictly_convex=False)
- sage: actual = lyapunov_rank(K)
- sage: (phi1, _) = span_iso(K)
- sage: K_S = phi1(K)
- sage: (phi2, _) = span_iso(K_S.dual())
- sage: J_T = phi2(K_S.dual()).dual()
- sage: l = K.linear_subspace().dimension()
- sage: codim = K.lattice_dim() - K.dim()
- sage: expected = lyapunov_rank(J_T) + K.dim()*(l + codim) + codim**2
- sage: actual == expected
- True