# Timed set

## Idea

Some functions are more expensive to calculate than others. Additionally, calculation with large values is more expensive than with small values. A category of timed sets has additional structure which measures the cost of computation for each function.

When properly qualified and constructed, categories of timed sets can provide categorical descriptions of complexity classes.

## Definition

###### Definition

A size monoid is a commutative monoid with a partial order $\leq$ such that

$\underset{m \in M}{\forall} \;\; 0 \leq m$

and if $a \leq b$ and $c \leq d$ then $a + c \leq b + d$.

###### Definition

For a size monoid $M$, a timed map $f$ is a partial function $X \to Y$ and a partial cost function called the timing, $|-|_f : X \to M$ which are defined on the same elements of $X$.

Given a size monoid $M$, there is a category $\mathtt{TSet}(M)$ of sets and $M$-timed maps. The identity morphism has the zero function for timing. The composition of the cost of two morphisms $f : X \to Y$ and $g : Y \to Z$ is given by

$|x|_{g \circ f} = |x|_f + |f(x)|_g$

## Properties

As categories of sets and partial functions, categories of timed sets are restriction categories.

## Examples

The complexity classes PTIME? and LOGSPACE? can be described by categories of timed sets.

## References

Timed sets were introduced in:
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 16, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9560155272483826, "perplexity": 949.723159973667}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-05/segments/1642320301263.50/warc/CC-MAIN-20220119033421-20220119063421-00469.warc.gz"}