Correspondence between matrices and finite relations [00J1]
- January 17, 2024
- Jon Sterling
Definition The matrix associated to a finite relation [00IY]
- January 17, 2024
- Jon Sterling
Let R\colon {\mathopen {}\left [m\right ]\mathclose {}}\mathbin {\nrightarrow }{\mathopen {}\left [n\right ]\mathclose {}} be a relation; for any semiring S, we may form the {\mathopen {}\left (n\times n\right )\mathclose {}}-matrix over S associated to R as follows:
{\mathopen {}\left (\operatorname {\underline {mat}}_S{R}\right )\mathclose {}}_{i:{\mathopen {}\left [m\right ]\mathclose {}},j:{\mathopen {}\left [n\right ]\mathclose {}}} = \begin {cases} 1&\text {if } i\mathrel {R}j \\ 0&\text {otherwise} \end {cases}We have defined a function \operatorname {\underline {mat}}_S\colon \mathrm {Rel}{\mathopen {}\left ({\mathopen {}\left [m\right ]\mathclose {}},{\mathopen {}\left [n\right ]\mathclose {}}\right )\mathclose {}} \to \mathrm {Mat}_{S}{\mathopen {}\left (m,n\right )\mathclose {}}.
Definition The relation associated to a matrix [00IZ]
- January 17, 2024
- Jon Sterling
Let M be an {\mathopen {}\left (n\times n\right )\mathclose {}}-matrix over a semiring S. We define the relation associated to M below:
\begin {aligned} \operatorname {\underline {rel}}_S{M} &\colon {\mathopen {}\left [m\right ]\mathclose {}}\mathbin {\nrightarrow }{\mathopen {}\left [n\right ]\mathclose {}} \\ i\mathrel {{\mathopen {}\left (\operatorname {\underline {rel}}_S{M}\right )\mathclose {}}} j &\Longleftrightarrow M_{i,j} = 1 \end {aligned}We have defined a function \operatorname {\underline {rel}}_S\colon \mathrm {Mat}_{S}{\mathopen {}\left (m,n\right )\mathclose {}}\to \mathrm {Rel}{\mathopen {}\left ({\mathopen {}\left [m\right ]\mathclose {}},{\mathopen {}\left [n\right ]\mathclose {}}\right )\mathclose {}}.
Lemma A retraction from matrices to finite relations [00J0]
- January 17, 2024
- Jon Sterling
The associated matrix function \operatorname {\underline {mat}}_S\colon \mathrm {Rel}{\mathopen {}\left ({\mathopen {}\left [m\right ]\mathclose {}},{\mathopen {}\left [n\right ]\mathclose {}}\right )\mathclose {}} \to \mathrm {Mat}_{S}{\mathopen {}\left (m,n\right )\mathclose {}} is a section of the associated relation function \operatorname {\underline {rel}}_S\colon \mathrm {Mat}_{S}{\mathopen {}\left (m,n\right )\mathclose {}}\to \mathrm {Rel}{\mathopen {}\left ({\mathopen {}\left [m\right ]\mathclose {}},{\mathopen {}\left [n\right ]\mathclose {}}\right )\mathclose {}} for any semiring S.
Proof.
- January 17, 2024
- Jon Sterling
We must check that \operatorname {\underline {rel}}_S\circ \operatorname {\underline {mat}}_S = \mathsf {id}_{\mathrm {Rel}{\mathopen {}\left ({\mathopen {}\left [m\right ]\mathclose {}},{\mathopen {}\left [n\right ]\mathclose {}}\right )\mathclose {}}}. Fixing a relation R\colon {\mathopen {}\left [m\right ]\mathclose {}}\mathbin {\nrightarrow }{\mathopen {}\left [n\right ]\mathclose {}}, we compute:
\begin {aligned} i\mathrel {{\mathopen {}\left (\operatorname {\underline {rel}}_S{\mathopen {}\left (\operatorname {\underline {mat}}_SR\right )\mathclose {}}\right )\mathclose {}}} j &\Longleftrightarrow {\mathopen {}\left (\operatorname {\underline {mat}}_SR\right )\mathclose {}}_{i,j} = 1 \\ &\Longleftrightarrow i\mathrel {R}j \end {aligned}The other composite \operatorname {\underline {mat}}_S\circ \operatorname {\underline {rel}}_S\colon \mathrm {Mat}_{S}{\mathopen {}\left (m,n\right )\mathclose {}}\to \mathrm {Mat}_{S}{\mathopen {}\left (m,n\right )\mathclose {}} is not in general the identity function, but is (necessarily) an idempotent on the set of matrices over S. We will see that this idempotent, in some sense, measures the degree to which the base semiring S is not boolean.
Lemma Finite relations as matrices over the booleans [00IX]
- January 17, 2024
- Jon Sterling
The idempotent {\operatorname {\underline {mat}}_\mathbb {B}\circ \operatorname {\underline {rel}}_\mathbb {B}\colon \mathrm {Mat}_{\mathbb {B}}{\mathopen {}\left (m,n\right )\mathclose {}}\to \mathrm {Mat}_{\mathbb {B}}{\mathopen {}\left (m,n\right )\mathclose {}}} is in fact the identity function on matrices over the boolean semiring \mathbb {B}.
Proof.
- January 17, 2024
- Jon Sterling
We fix a matrix M:\mathrm {Mat}_{\mathbb {B}}{\mathopen {}\left (m,n\right )\mathclose {}} and compute:
\begin {aligned} {\mathopen {}\left (\operatorname {\underline {mat}}_\mathbb {B}{\mathopen {}\left (\operatorname {\underline {rel}}_\mathbb {B} M\right )\mathclose {}}\right )\mathclose {}}_{i,j} &= \begin {cases} 1 &\text {if } i \mathrel {{\mathopen {}\left (\operatorname {\underline {rel}}_\mathbb {B} M\right )\mathclose {}}} j\\ 0 &\text {otherwise} \end {cases} \\ &= \begin {cases} 1 &\text {if } M_{i,j} = 1\\ 0 &\text {otherwise} \end {cases} \end {aligned}Because \mathbb {B} is the boolean semiring, any scalar s: S is either 0 or 1. Therefore, we conclude:
{\mathopen {}\left (\operatorname {\underline {mat}}_\mathbb {B}{\mathopen {}\left (\operatorname {\underline {rel}}_\mathbb {B} M\right )\mathclose {}}\right )\mathclose {}}_{i,j} = M_{i,j}Thus we conclude that an {\mathopen {}\left (m\times n\right )\mathclose {}}-matrix over the booleans is the same thing as a relation from {\mathopen {}\left [m\right ]\mathclose {}} to {\mathopen {}\left [n\right ]\mathclose {}}.