# Identity function

Not to be confused with Null function or Empty function. Graph of the identity function on the real numbers

In mathematics, an identity function, also called an identity relation or identity map or identity transformation, is a function that always returns the same value that was used as its argument. In equations, the function is given by f(x) = x.

## Definition

Formally, if M is a set, the identity function f on M is defined to be that function with domain and codomain M which satisfies

f(x) = x   for all elements x in M.

In other words, the function value f(x) in M (that is, the codomain) is always the same input element x of M (now considered as the domain). The identity function on M is clearly an injective function as well as a surjective function, so it is also bijective.

The identity function f on M is often denoted by idM.

In set theory, where a function is defined as a particular kind of binary relation, the identity function is given by the identity relation, or diagonal of M.

## Algebraic property

If f : MN is any function, then we have f ∘ idM = f = idNf (where "∘" denotes function composition). In particular, idM is the identity element of the monoid of all functions from M to M.

Since the identity element of a monoid is unique, one can alternately define the identity function on M to be this identity element. Such a definition generalizes to the concept of an identity morphism in category theory, where the endomorphisms of M need not be functions.
{"ft_lang_label":"__label__en","ft_lang_prob":0.8090535,"math_prob":0.9920722,"size":2739,"snap":"2022-27-2022-33","text_gpt3_token_len":668,"char_repetition_ratio":0.17842779,"word_repetition_ratio":0.008888889,"special_character_ratio":0.2570281,"punctuation_ratio":0.14393939,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9958075,"pos_list":[0,1,2],"im_url_duplicate_count":[null,2,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2022-07-05T03:00:42Z\",\"WARC-Record-ID\":\"<urn:uuid:f137e4aa-becd-454d-afb8-b89ab1653932>\",\"Content-Length\":\"15761\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:10bc2fb9-fa93-405e-a220-705f90d47006>\",\"WARC-Concurrent-To\":\"<urn:uuid:5d4ef44f-e2e4-4f28-a1d2-e7a2cd0b752e>\",\"WARC-IP-Address\":\"209.94.90.1\",\"WARC-Target-URI\":\"https://gateway.ipfs.io/ipfs/QmXoypizjW3WknFiJnKLwHCnL72vedxjQkDDP1mXWo6uco/wiki/Identity_operator.html\",\"WARC-Payload-Digest\":\"sha1:EKN5CYLX5CWXWLTPRL2H4YBEUULWP2LE\",\"WARC-Block-Digest\":\"sha1:BNMWURI7COXY5VI6XSIWP23KG5TMEOIB\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2022/CC-MAIN-2022-27/CC-MAIN-2022-27_segments_1656104512702.80_warc_CC-MAIN-20220705022909-20220705052909-00434.warc.gz\"}"}