def discrete_complementarity_set(K):
r"""
- Compute the discrete complementarity set of this cone.
+ Compute a discrete complementarity set of this cone.
- The complementarity set of a cone is the set of all orthogonal pairs
- `(x,s)` such that `x` is in the cone, and `s` is in its dual. The
- discrete complementarity set is a subset of the complementarity set
- where `x` and `s` are required to be generators of their respective
- cones.
-
- For polyhedral cones, the discrete complementarity set is always
- finite.
+ A discrete complementarity set of `K` is the set of all orthogonal
+ pairs `(x,s)` such that `x \in G_{1}` and `s \in G_{2}` for some
+ generating sets `G_{1}` of `K` and `G_{2}` of its dual. Polyhedral
+ convex cones are input in terms of their generators, so "the" (this
+ particular) discrete complementarity set corresponds to ``G1
+ == K.rays()`` and ``G2 == K.dual().rays()``.
OUTPUT:
A list of pairs `(x,s)` such that,
* Both `x` and `s` are vectors (not rays).
- * `x` is a generator of this cone.
- * `s` is a generator of this cone's dual.
+ * `x` is one of ``K.rays()``.
+ * `s` is one of ``K.dual().rays()``.
* `x` and `s` are orthogonal.
REFERENCES:
beta += len(LL(K))
return beta
+
+
+
+def is_lyapunov_like(L,K):
+ r"""
+ Determine whether or not ``L`` is Lyapunov-like on ``K``.
+
+ We say that ``L`` is Lyapunov-like on ``K`` if `\left\langle
+ L\left\lparenx\right\rparen,s\right\rangle = 0` for all pairs
+ `\left\langle x,s \right\rangle` in the complementarity set of
+ ``K``. It is known [Orlitzky]_ that this property need only be
+ checked for generators of ``K`` and its dual.
+
+ INPUT:
+
+ - ``L`` -- A linear transformation or matrix.
+
+ - ``K`` -- A polyhedral closed convex cone.
+
+ OUTPUT:
+
+ ``True`` if it can be proven that ``L`` is Lyapunov-like on ``K``,
+ and ``False`` otherwise.
+
+ .. WARNING::
+
+ If this function returns ``True``, then ``L`` is Lyapunov-like
+ on ``K``. However, if ``False`` is returned, that could mean one
+ of two things. The first is that ``L`` is definitely not
+ Lyapunov-like on ``K``. The second is more of an "I don't know"
+ answer, returned (for example) if we cannot prove that an inner
+ product is zero.
+
+ REFERENCES:
+
+ .. [Orlitzky] M. Orlitzky. The Lyapunov rank of an
+ improper cone (preprint).
+
+ EXAMPLES:
+
+ todo.
+
+ TESTS:
+
+ todo.
+
+ """
+ return all([(L*x).inner_product(s) == 0
+ for (x,s) in discrete_complementarity_set(K)])