# ACT4E Sandbox

$\mathsf{until}_{\lt t}\ f$

$\mathsf{until}_{\< t}\ f$

$a \lt b$

$a_{< t}\ f$

This is an example using a definition environment:

###### Definition

Let $H$ be a subgroup of a group $G$. A left coset of $H$ in $G$ is a subset of $G$ that is of the form $x H$, where $x \in G$ and $x H = \{ x h : h \in H \}$.

Similarly a right coset of $H$ in $G$ is a subset of $G$ that is of the form $H x$, where $H x = \{ h x : h \in H\}$.

Here is a link: Bibliography?

$F: C \rightarrow D$

## Time

###### Definition (Time axis)

A time axis is a totally ordered set. We indicated it as $\mathbb{T},\mathbb{U},\mathbb{V}$, etc.

###### Example

The real numbers $\mathbb{R}$, the naturals $\mathbb{N}$, etc.

###### Example

Any subset of the real numbers, naturals, etc.

###### Example

Super-dense time.

TODO: Put reference, definition here.

## Signals

###### Definition (Signals).

Given a time axis $\mathbb{T}$ and a set $A$, a signal is a map $f:\mathbb{T}\to A$. We write $A^{\mathbb{T}}$ to mean the signal space (set of all signals from $\mathbb{T}$ to $A$).

###### Definition (Truncation of a signal).

Given a signal $f:\mathbb{T}\to A$ and a threshold $t\in\mathbb{T}$, the truncations $\mathsf{until}_{\leq t}\ f$ and $\mathsf{since}_{\geq t}\ f$ are the restrictions on $\{a\in\mathbb{T}:a\leq t\}$ and $\{a\in\mathbb{T}:t\leq a\}$. Equivalently we define $\mathsf{until}_{< t}\ f$ and $\mathsf{since}_{< t}\ f$.

TODO: understand why < does not work

## Systems

###### Definition (System).

A system is a relation between two signal spaces.

###### Definition (The category of systems).

There exists a subcategory of $\mathbf{Rel}$ called $\mathbf{Systems}$ where:

• The objects are signal spaces $A^{\mathbbT}$.

• A morphism $f:A^{\mathbb{T}}\to B^{\mathbb{U}}$ is a relation between $A^{\mathbb{T}}$ and $B^{\mathbb{U}}$.

TODO: Define deterministic, total etc. in the obvious way.

###### Definition (Causal system).

A causal system $S:A^{\mathbb{T}}\to B^{\mathbb{U}}$ is one for which there exists an isomorphism $\alpha:\mathbb{T}\to\mathbb{U}$ such that, for any tree signals $a,b\in A^{\mathbb{T}}$ and $c\in A^{\mathbb{U}}$ for which $aSc$ and $bSc$, it holds that:

$\left(\mathsf{until}_{\leq t}a\right)=\left(\mathsf{until}_{\leq t}b\right)\quad\Rightarrow\quad a(\sigma(t))=b(\sigma(t)).$

We call it stricty causal if

$\left(\mathsf{until}_{

We call it anti-causal if

$\left(\mathsf{since}_{\geq t}a\right)=\left(\mathsf{until}_{\geq t}b\right)\quad\Rightarrow\quad a(\sigma(t))=b(\sigma(t)).$

We call it strictly anti-causal if

$\left(\mathsf{since}_{{<} t t}a\right)=\left(\mathsf{until}_{>t}b\right)\quad\Rightarrow\quad a(\sigma(t))=b(\sigma(t)).$
###### Exercise

Prove that causal and strictly causal systems form a subcategory of $\mathbf{Systems}$.

###### Exercise

Characterize the systems that are both causal and anti-causal.

###### Lemma

Given a system $S:A^{\mathbb{T}}\to B^{\mathbb{U}}$ there is an opposite system $S^{\text{op}}:A^{\mathbb{T}^{\text{op}}}\to B^{\mathbb{U}^{\text{op}}}$ defined in the obvious way.*

###### Exercise

Can you define (strictly) anti-causal from (strictly) causal using the notion of opposite system?

###### Definition

Given a signal $f:\mathbb{T}\to\mathbb{U}$ and an order isomorphism $\sigma:\mathbb{T}\to\mathbb{T}$ we denote as $\sigma\mathbf{;}f$ the “translation of $f$ by $\sigma$”.

###### Definition

A time invariant system $S:A^{\mathbb{T}}\to B^{\mathbb{U}}$ is one for which given an order isomorphism $\sigma:\mathbb{T}\to\mathbb{T}$ there exists an order isomorphism $\tau:\mathbb{U}\to\mathbb{U}$ such that

$aSb\Rightarrow(\sigma\mathbf{;}a)S(\tau\mathbf{;}b).$
###### Exercise

Consider the signal spaces $A^{\mathbb{T}}$ as categories where the objects are the signals and a morphism $\sigma:f\to g$ is an order isomorphism such that $\sigma;f=g$. Can you see the system $S:A^{\mathbb{T}}\to B^{\mathbb{U}}$ as a profunctor?

###### Definition

Given a system $S:A^{\mathbb{T}}\to B^{\mathbb{U}}$ and the order isomorphisms $\sigma:\mathbb{T}\to\mathbb{T}$ and $\tau:\mathbb{U}\to\mathbb{U}$ we construct the system $\sigma;S;\tau$ as the system such that $a(\sigma;S;\tau)b\Leftrightarrow(\sigma\mathbf{;}a)S(\tau\mathbf{;}b).$

###### Exercise

Fix two objects of $\mathbf{Systems}$ $A^{\mathbb{T}},B^{\mathbb{U}}$, and let’s try to make $\mathsf{Hom}_{\mathbf{Systems}}(A^{\mathbb{T}};B^{\mathbb{U}})$ into a category. Objects are systems $S_{1},S_{2}:A^{\mathbb{T}}\to B^{\mathbb{U}}$. A morphism $\alpha:S_{1}\to S_{2}$ is a pair of isomorphisms $\langle\sigma,\tau\rangle$ such that $\sigma;S_{1};\tau=S_{2}$. Does this satisfy the requirements for a category? Define identities and composition; show unitality and associativity.

###### Exercise

Assuming that the previous exercise gave a positive response, do the arrows-between-arrows we defined count as natural transformations in $\mathbf{Systems}$?

###### Exercise

Consider the signal spaces $A^{\mathbb{T}}$ as categories where the objects are the signals and a morphism $\sigma:f\to g$ is a bijection $\chi:$$A\to A$ such that $f;\chi=g$. Can you see a deterministic system $S:A^{\mathbb{T}}\to B^{\mathbb{U}}$ as a functor from $A^{\mathbb{T}}$ to $B^{\mathbb{U}}$?

## Discrete-time systems

###### Exercise

What are the order isomorphisms of the integers $\mathbb{Z}?$

###### Definition

Let $\mathbf{DiscreteTimeSystems}$ be a subcategory of $\mathbf{Systems}$ obtained by taking the restriction of the objects to those in the form $A^{\mathbb{Z}}$ where $\mathbb{Z}$ are the integers.

###### Exercise

Define $\mathbf{StateSpaceDiscreteTS}$ as a subcategory of $\mathbf{Rel}$ where the objects are signal spaces and the morphisms are between $U^{\mathbb{Z}}$ and $Y^{\mathbb{Z}}$are defined by a triple

$S=\langle X,f:X\times U\to X,g:X\times U\to Y\rangle$

and $uSy$ iff there exists an $x\in X^{\mathbb{Z}}$ such that

\begin{aligned} x_{k+1} & =f(x_{k},u_{k})\\ y_{k} & =g(x_{k},u_{k}).\end{aligned}
• Check that $\mathbf{StateSpaceDiscreteTS}$ is a category. Define composition, identity, etc.

• Is $\mathbf{StateSpaceDiscreteTS}$ a subcategory of $\mathbf{Systems}$?

• Is $\mathbf{StateSpaceDiscreteTS}$ a subcategory of $\mathbf{DiscreteTimeSystems}$?

• Can you find a functor from $\mathbf{DiscreteTimeSystems}$ to $\mathbf{StateSpaceDiscreteTS}$?

###### Exercise

If $C$ is a subcategory of $D$ and $D$ is a monoidal category, can we infer that $C$ is a sub-monoidal category?

###### Exercise

Is $\mathbf{StateSpaceDiscreteTS}$ a monoidal category?

###### Exercise

Consider the set of causal, deterministic, and time-invariant morphism in $\mathbf{DiscreteTimeSystems}$. Show that any of those can be written in state space form.

###### Exercise

Consider the set of strictly causal and deterministic morphism in $\mathbf{DiscreteTimeSystems}$. Show that any of those can be written in state space form as

\begin{aligned} x_{k+1} & =f(x_{k},u_{k})\\ y_{k} & =g(x_{k}), \end{aligned}

limiting $g$ to not depend on the last $u$.

## Linear time-invariant discrete system

###### Definition

Define the following types of finite-dimensional linear time-invariant discrete systems. In these equations the signals belong to \left(\mathbb{R}^{n}\right)^{\mathbb{{Z}}}for some finite $\left(\mathbb{R}^{n}\right)^{\mathbb{{n$. The symbols $A,B,C,D,E$ refer to matrices of suitable dimensions.

1. Strictly causal:

\begin{aligned} x_{k+1} & =Ax_{k}+Bu_{k}\\ y_{k} & =Cx_{k}\end{aligned}
2. Causal systems:

\begin{aligned} x_{k+1} & =Ax_{k}+Bu_{k}\\ y_{k} & =Cx_{k}+Du_{k}\end{aligned}
3. Descriptor systems:

\begin{aligned} Ex_{k+1} & =Ax_{k}+Bu_{k}\\ y_{k} & =Cx_{k}+Du_{k}\end{aligned}
###### Exercise

Show that these three types of systems are categories and from top to bottom they are ordered by subcategory inclusion.

###### Exercise

Are these monoidal categories?

###### Exercise

Are these traced monoidal categories?

## Linear time-invariant continuous system

###### Definition

Define the following types of finite-dimensional linear time-invariant discrete systems. In these equations the signals belong to \left(\mathbb{R}^{n}\right)^{\mathbb{{Z}}}for some finite $\left(\mathbb{R}^{n}\right)^{\mathbb{{n$. The symbols $A,B,C,D,E$ refer to matrices of suitable dimensions.

1. Strictly causal:

\begin{aligned} \dot{x} & =Ax_{t}+Bu_{t}\\ y_{t} & =Cx_{t}\end{aligned}
2. Causal systems:

\begin{aligned} \dot{x} & =Ax_{t}+Bu_{t}\\ y_{t} & =Cx_{t}+Du_{t}\end{aligned}
3. Descriptor systems:

\begin{aligned} E\dot{x} & =Ax_{t}+Bu_{t}\\ y_{t} & =Cx_{t}+Du_{t}\end{aligned}
###### Exercise

Show that these three types of systems are categories and from top to bottom they are ordered by subcategory inclusion.

###### Exercise

Are these monoidal categories?

###### Exercise

Are these traced monoidal categories?

## Linearity properties

TODO: we defined “linear” as “those defined by linear equations”. Now define the black-box linear behaviors (preserves sums, scaling, etc.).

## Relationship between linear discrete/continuous time

###### Definition

Define the operation of discretization as, given a period $\Delta,$ as .…

###### Exercise
1. Are discretizations functors from continuous to discrete linear systems?

2. Are discretizations embeddings from continuous to discrete linear systems?

###### Exercise
1. Can you find a bijection from discrete linear systems to continuous linear systems?

2. Can you find a functor from discrete linear systems to continuous linear systems?

3. Can you find an embedding from discrete linear systems to continuous linear systems?

## Z-transform

TODO: Define z-transforms and their properties.

TODO: Formalize the relationship between linear discrete systems and z-transforms.

TODO: Show what classes of Z-transforms are a traced monoidal category.

## Laplace transform

TODO: Define laplace-transforms and their properties.

TODO: Formalize the relationship between linear continuous systems and laplace -transforms.

TODO: Show how we can pass from Laplace to Z-transform by change of parameters.

## Stability

TODO: define property of stability.

TODO: define BIBO stability.

TODO: when is it preserved by composition?

## Observability and controllability

TODO: define properties of:

1. observability

2. controllabity

3. detectability

4. stabilizability

TODO: how do they behave under the various compositions?

## Uncertain systems

(Set-based uncertainty)

## Stochastic systems

(probability-based uncertainty)