# Pi Types

A Pi type is a type of (dependent) functions. If p_1, … p_n are named or unnamed parameters and B is a type, then \Pi p_1 … p_n -> B is also a type. If B does not refer to variables defined in the parameters, you can write A_1 -> … A_n -> B instead, where A_i are types of the parameters. If A_i has type \Type p_i h_i and B has type \Type p h, then the type of the Pi type is \Type p_max h, where p_max is the maximum of p_1, … p_n, and p. Note that the homotopy level of the Pi type is simply the homotopy level of the codomain.

An expression of the form \Pi p_1 … p_n -> B is equivalent to \Pi p_1 -> \Pi p_2 … p_n -> B. Moreover, if p_1 equals to (x_1 … x_k : A), then it is also equivalent to \Pi (x_1 : A) -> \Pi (x_2 … x_k : A) -> \Pi p_2 … p_n -> B.

A lambda parameter is either a variable or a named parameter. If p_1, … p_n is a sequence of lambda parameters and e is an expression of type E, then \lam p_1 … p_n => e is an expression which has type \Pi p_1 … p_n -> E. If some parameters do not have types, then they will be inferred by the typechecker.

If f is an expression of type \Pi (x : A) -> B and a is an expression of type A, then f a is an expression of type B[a/x].

An expression of the form (\lam x => b) a reduces to b[a/x].

An expression of the form \lam x => f x is equivalent to f if x is not free in f (eta equivalence for Pi types).
{"extraction_info": {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "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.9591236114501953, "perplexity": 1461.357237192334}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": false}, "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-2020-10/segments/1581875145500.90/warc/CC-MAIN-20200221080411-20200221110411-00355.warc.gz"}