User:Inthar/Style guide: Difference between revisions

Inthar (talk | contribs)
Inthar (talk | contribs)
Line 15: Line 15:
== Words ==
== Words ==
* Zero-indexing is used for indices.
* Zero-indexing is used for indices.
* A ''(linear) word'' is a function <math>w : [n]_0 \to \mathcal{A}</math> where <math>\mathcal{A}</math> is a set of letters and <math>n \in \mathbb{Z}_{\ge 0}.</math> ''n'' is called the ''length'' of ''w''. The letter of ''w'' at index ''i'' is denoted ''w''[''i''].  
* A ''(linear) word'' is a function <math>w : [n]_0 \to \mathcal{A}</math> where <math>\mathcal{A}</math> is a set of letters and <math>n \in \mathbb{Z}_{\ge 0}.</math> ''n'' is called the ''length'' of ''w''. The letter of ''w'' at index ''i'' is denoted ''w''[''i'']. If 0 &le; ''i'' < ''j'' &le; |''w''| &minus; 1, the slice notation ''w''[''i'':''j''] denotes the (''j'' &minus; ''i'')-letter word ''w''[''i'']''w''[''i''+1]...''w''[''j''&minus;1].
* A ''based circular word'' is a function <math> s: \mathbb{Z}/n \to \mathcal{A},</math> where by abuse of notation, ''s''[''i''] is used for ''s''[''i'' mod ''n'']. A ''period'' of a circular word ''s'' is the minimal <math>p, 1 \le p \le |s|,</math> such that for all ''i'', <math>s[i+p]=s[i].</math> If the period of ''s'' is equal to the length of ''s'', then ''s'' is called primitive.
* A ''based circular word'' is a function <math> s: \mathbb{Z}/n \to \mathcal{A},</math> where by abuse of notation, ''s''[''i''] is used for ''s''[''i'' mod ''n'']. A ''period'' of a circular word ''s'' is the minimal <math>p, 1 \le p \le |s|,</math> such that for all ''i'', <math>s[i+p]=s[i].</math> If the period of ''s'' is equal to the length of ''s'', then ''s'' is called primitive.
* A ''(free) circular word'' is a class of based circular words equivalent under rotation: <math>\{x\mapsto s[x], x\mapsto s[x+1], ..., x\mapsto s[x+|s|-1] \}</math> for ''s'' a based circular word.
* A ''(free) circular word'' is a class of based circular words equivalent under rotation: <math>\{x\mapsto s[x], x\mapsto s[x+1], ..., x\mapsto s[x+|s|-1] \}</math> for ''s'' a based circular word.
* The length of a linear, based circular, or free circular word ''s'' is denoted {{len|''s''}} or len(''s'').
* The length of a linear, based circular, or free circular word ''s'' is denoted {{len|''s''}} or len(''s'').
* Circular words may be treated as (based) infinite words. For circular words, the slice notation ''s''[''m'':''n''] denotes the (''n'' &minus; ''m'')-letter word ''s''[''m'']''s''[''m''+1]...''s''[''n''&minus;1], where all indices are taken mod {{len|''s''}}.
* Circular words may be treated as (based) infinite words. For circular words, the slice notation ''s''[''i'':''j''] denotes the (''j'' &minus; ''i'')-letter word ''s''[''i'']''s''[''i''+1]...''s''[''j''&minus;1], where all indices are taken mod {{len|''s''}}.
* Substitution: If ''w'' is a linear or based circular word in '''X''' and possibly other letters, and ''u'' is a based circular word in '''b''' and '''c''', then <math>\mathsf{subst}(w, \mathbf{X}, u)</math> denotes the word ''w'' but with the ''i''th occurrence of '''X''' replaced with ''u''[''i''] (for ''i'' &ge; 0).
* Substitution: If ''w'' is a linear or based circular word in '''X''' and possibly other letters, and ''u'' is a based circular word in '''b''' and '''c''', then <math>\mathsf{subst}(w, \mathbf{X}, u)</math> denotes the word ''w'' but with the ''i''th occurrence of '''X''' replaced with ''u''[''i''] (for ''i'' &ge; 0).