fin2

An alternate definition of fin n defined as an inductive type instead of a subtype of nat. This is useful for its induction principle and different definitional equalities.

fin2.to_nat

convert a fin2 into a nat

fin2.opt_of_nat

convert a nat into a fin2 if it is in range

fin2.add

i + k : fin2 (n + k) when i : fin2 n and k : ℕ

fin2.left

left k is the embedding fin2 n fin2 (k + n)

fin2.insert_perm

insert_perm a is a permutation of fin2 n with the following properties:

fin2.remap_left

remap_left f k : fin2 (m + k) fin2 (n + k) applies the function f : fin2 m fin2 n to inputs less than m, and leaves the right part on the right (that is, remap_left f k (m + i) = n + i).

fin2.is_lt

This is a simple type class inference prover for proof obligations of the form m < n where m n : ℕ.

fin2.of_nat'

Use type class inference to infer the boundedness proof, so that we can directly convert a nat into a fin2 n. This supports notation like &1 : fin 3.

vector3

Alternate definition of vector based on fin2.

vector3.nil

The empty vector

vector3.cons

The vector cons operation

vector3.nth

Get the ith element of a vector

vector3.of_fn

Construct a vector from a function on fin2.

vector3.head

Get the head of a nonempty vector.

vector3.tail

Get the tail of a nonempty vector.

vector3.append

Append two vectors

vector3.insert

Insert a into v at index i.

vector_ex

"Curried" exists, i.e. ∃ x1 ... xn, f [x1, ..., xn]

vector_all

"Curried" forall, i.e. ∀ x1 ... xn, f [x1, ..., xn]

vector_allp

vector_allp p v is equivalent to ∀ i, p (v i), but unfolds directly to a conjunction, i.e. vector_allp p [0, 1, 2] = p 0 p 1 p 2.

list_all

list_all p l is equivalent to ∀ a ∈ l, p a, but unfolds directly to a conjunction, i.e. list_all p [0, 1, 2] = p 0 p 1 p 2.

is_poly

A predicate asserting that a function is a multivariate integer polynomial. (We are being a bit lazy here by allowing many representations for multiplication, rather than only allowing monomials and addition, but the definition is equivalent and this is easier to use.)

poly

The type of multivariate integer polynomials

poly.isp

The underlying function of a poly is a polynomial

poly.ext

Extensionality for poly α

poly.subst

Construct a poly given an extensionally equivalent poly.

poly.proj

The ith projection function, x_i.

poly.const

The constant function with value n : ℤ.

poly.zero

The zero polynomial

poly.one

The zero polynomial

poly.sub

Subtraction of polynomials

poly.neg

Negation of a polynomial

poly.add

Addition of polynomials

poly.mul

Multiplication of polynomials

poly.sumsq

The sum of squares of a list of polynomials. This is relevant for Diophantine equations, because it means that a list of equations can be encoded as a single equation: x = 0 y = 0 z = 0 is equivalent to x^2 + y^2 + z^2 = 0.

poly.remap

Map the index set of variables, replacing x_i with x_(f i).

sum.join

combine two functions into a function on the disjoint union

option.cons

Functions from option can be combined similarly to vector.cons

dioph

A set S ⊆ ℕ^α is diophantine if there exists a polynomial on α ⊕ β such that v ∈ S iff there exists t : ℕ^β with p (v, t) = 0.

dioph.dioph_pfun

A partial function is Diophantine if its graph is Diophantine.

dioph.dioph_fn

A function is Diophantine if its graph is Diophantine.