Package hol-base: HOL basic theories

Information

namehol-base
version1.2
descriptionHOL basic theories
authorHOL OpenTheory Packager <opentheory-packager@hol-theorem-prover.org>
licenseMIT
checksum862b85a9be71d7cb896f56db338dad74b37dfaf2
requiresbase
showData.Bool
Data.List
Data.Option
Data.Pair
Data.Sum
Data.Unit
Function
HOL4
Number.Natural
Relation
Set

Files

Defined Type Operators

Defined Constants

Theorems

combin.ASSOC ()

combin.ASSOC ()

combin.ASSOC (@)

pred_set.countable pred_set.EMPTY

pred_set.countable pred_set.UNIV

pred_set.FINITE pred_set.EMPTY

relation.antisymmetric subrelation

relation.IDEM relation.RC

relation.IDEM relation.RTC

relation.IDEM relation.SC

relation.IDEM relation.STRORD

relation.IDEM transitiveClosure

relation.INVOL (¬)

relation.INVOL relation.inv

relation.WeakOrder subrelation

transitive (<)

wellFounded empty

wellFounded (<)

¬divides.prime 0

¬pred_set.FINITE pred_set.UNIV

¬pred_set.FINITE pred_set.UNIV

divides.prime (arithmetic.BIT2 0)

relation.symmetric (relation.EQC R)

reflexive (relation.EQC R)

transitive (relation.EQC R)

bool.ARB = bool.ARB

marker.IfCases

0 = 0

numeral_bit.iDIV2 = arithmetic.DIV2

numeral_bit.iSUC = suc

numeral.internal_mult = (*)

numeral_bit.iMOD_2EXP = bit.MOD_2EXP

pred_set.MIN_SET = while.LEAST

numeral_bit.iBITWISE = bit.BITWISE

combin.MONOID ()

combin.MONOID ()

combin.MONOID (@) []

pred_set.EMPTY = λx.

pred_set.UNIV = λx.

¬divides.prime 1

¬(pred_set.EMPTY = pred_set.UNIV)

¬(pred_set.UNIV = pred_set.EMPTY)

divides.prime 3

pred_set.countable (pred_set.IMAGE f pred_set.UNIV)

ind_type.BOTTOM = ind_type.mk_rec ind_type.ZBOT

rich_list.AND_EL = all id

rich_list.OR_EL = any id

empty = λx y.

const = λx y. x

combin.FAIL = λx y. x

universe = λx y.

pred_set.UNIV = pred_set.POW pred_set.UNIV

pred_set.PROD_SET = pred_set.PROD_IMAGE id

pred_set.SUM_SET = pred_set.SUM_IMAGE id

prim_rec.measure = relation.inv_image (<)

rich_list.SPLITP = rich_list.SPLITP_AUX []

0 < suc 0

n numpair.tri n

ind_type.ISO (λx. x) (λx. x)

pred_set.EMPTY x

pred_set.SING pred_set.EMPTY

pred_set.CARD pred_set.EMPTY = 0

pred_set.SUM_SET pred_set.EMPTY = 0

list.SET_TO_LIST pred_set.EMPTY = []

pred_set.BIGINTER pred_set.EMPTY = pred_set.UNIV

pred_set.BIGUNION pred_set.EMPTY = pred_set.EMPTY

pred_set.COMPL pred_set.EMPTY = pred_set.UNIV

bit.BIT 0 = odd

pred_set.count 0 = pred_set.EMPTY

relation.inv (=) = (=)

numpair.invtri n n

numpair.nfst n n

numpair.nsnd n n

relation.RTC R x x

x. bool.IN x pred_set.UNIV

t. t

v. v = ()

n. divides.prime (divides.PRIMES n)

n. list.ALL_DISTINCT (rich_list.COUNT_LIST n)

n. pred_set.FINITE (pred_set.count n)

x. x = x

a. divides.divides a 0

a. divides.divides a a

n. 0 n

m. m m

l. list.ALL_DISTINCT (list.nub l)

l. pred_set.FINITE (list.LIST_TO_SET l)

x. list.isPREFIX x x

l. rich_list.IS_SUFFIX l l

i. i = bool.the_value

s. pred_set.SUBSET pred_set.EMPTY s

s. pred_set.SUBSET s pred_set.UNIV

s. pred_set.SUBSET s s

f. transitive (prim_rec.measure f)

m. wellFounded (prim_rec.measure m)

R. relation.equivalence (relation.EQC R)

R. relation.symmetric (relation.SC R)

R. reflexive (relation.RC R)

R. reflexive (relation.RTC R)

R. transitive (relation.RTC R)

R. transitive (transitiveClosure R)

rep. bool.TYPE_DEFINITION ind_type.ZRECSPACE rep

() = select x.

while.LEAST (λm. ) = 0

option.some (λx. ) = none

¬(t ¬t)

¬list.LLEX R l []

id = Combinator.s const const

bit.LOG2 = logroot.LOG (arithmetic.BIT2 0)

numposrep.num_to_bin_list = numposrep.n2l (arithmetic.BIT2 0)

numposrep.l2n2 = numposrep.l2n (arithmetic.BIT2 0)

numposrep.num_from_bin_list = numposrep.l2n (arithmetic.BIT2 0)

pred_set.UNIV = pred_set.CROSS pred_set.UNIV pred_set.UNIV

bool.IN = λx f. f x

bool.literal_case = λf x. f x

bool.LET = λf x. f x

numeral.iDUB i = numeral.iDUB i

pred_set.PROD_SET pred_set.EMPTY = 1

1 = suc 0

wellFounded R relation.antisymmetric R

wellFounded R irreflexive R

combin.FAIL x y = x

arithmetic.DIV2 (bit1 x) = x

numpair.invtri (numpair.tri n) = n

list.DROP 0 l = l

list.TAKE 0 l = []

option.OPTION_CHOICE m1 none = m1

pred_set.IMAGE id s = s

numposrep.num_from_bin_list numposrep.num_to_bin_list = id

numposrep.num_from_dec_list numposrep.num_to_dec_list = id

numposrep.num_from_hex_list numposrep.num_to_hex_list = id

numposrep.num_from_oct_list numposrep.num_to_oct_list = id

pred_set.REL_RESTRICT R pred_set.EMPTY = empty

relation.O R (=) = R

relation.O (=) R = R

sum.++ id id = id

¬¬p p

p q p

p q q

numpair.tri (numpair.invtri n) n

x. ¬bool.IN x pred_set.EMPTY

x. list.ALL_DISTINCT (x :: [])

x. pred_set.FINITE (pred_set.INSERT x pred_set.EMPTY)

x. pred_set.SING (pred_set.INSERT x pred_set.EMPTY)

x. id x = x

x. marker.stmarker x = x

x. marker.unint x = x

x. marker.Abbrev x x

x. marker.Cong x x

b. basicSize.bool_size b = 0

x. basicSize.one_size x = 0

b. ¬bit.BIT b 0

n. ¬(n < 0)

n. ¬(n < n)

%%genvar%%1601. 0 < divides.PRIMES %%genvar%%1601

n. 0 < factorial n

n. 0 < suc n

n. n < divides.PRIMES n

n. n < suc n

m. m suc m

n. ind_type.FNIL n = bool.ARB

n. arithmetic.nat_elim__magic n = n

x. numeral.iZ x = x

%%genvar%%517. divides.divides 1 %%genvar%%517

x. arithmetic.MODEQ n x x

a. gcd.is_gcd 0 a a

a. gcd.is_gcd a 0 a

a. gcd.is_gcd a a a

s. ¬pred_set.PSUBSET pred_set.UNIV s

s. ¬pred_set.PSUBSET s pred_set.EMPTY

s. ¬pred_set.PSUBSET s s

s. pred_set.SUBSET (pred_set.REST s) s

s. pred_set.BIJ (λa. a) s s

s. pred_set.INJ (λa. a) s s

s. pred_set.SURJ (λa. a) s s

f g. f = g

¬(numpair.ncons x y = 0)

wellFounded (λx y. y = suc x)

(>) = λm n. n < m

Combinator.w = λf x. f x x

relation.Order R relation.WeakOrder (relation.RC R)

arithmetic.BIT2 0 = suc 1

relation.RC R = union R (=)

injective num.SUC_REP ¬surjective num.SUC_REP

transitive R transitive (list.LLEX R)

pred_set.SURJ f s (pred_set.IMAGE f s)

relation.trichotomous (relation.RC R) relation.trichotomous R

relation.trichotomous (relation.STRORD R) relation.trichotomous R

wellFounded (transitiveClosure R) wellFounded R

relation.inv (relation.diag A) = relation.diag A

pred_set.CARD (list.LIST_TO_SET ls) length ls

arithmetic.FUNPOW f 0 x = x

¬A A

numpair.nfst (numpair.npair x y) = x

numpair.nsnd (numpair.npair x y) = y

¬(p q) p

x. ¬(none = some x)

x. ¬(some x = none)

x. destLeft (left x) = x

x. option.THE (some x) = x

x. one.one_CASE () x = x

x. x = x

x. pred_set.DELETE pred_set.EMPTY x = pred_set.EMPTY

x. pred_set.INSERT x pred_set.UNIV = pred_set.UNIV

x. pred_set.DISJOINT (pred_set.INSERT x pred_set.EMPTY) pred_set.EMPTY

x. destRight (right x) = x

b. b (b )

t. ¬¬t t

y. ¬(num.ZERO_REP = num.SUC_REP y)

n. ¬(0 = suc n)

n. ¬(suc n = 0)

n. ¬(suc n = n)

n. ¬(suc n 0)

n. even (arithmetic.BIT2 0 * n)

n. even n odd n

n. 1 < divides.PRIMES n

n. length (rich_list.COUNT_LIST n) = n

n. pred_set.CARD (pred_set.count n) = n

c. arithmetic.- c c = 0

n. arithmetic.ABS_DIFF n n = 0

y. gcd.gcd 0 y = y

a. gcd.gcd a 0 = a

a. gcd.gcd a a = a

m. m * 0 = 0

m. m + 0 = m

n. max n n = n

n. min n n = n

l. reverse (reverse l) = l

l. l @ [] = l

f. pred_set.IMAGE f pred_set.EMPTY = pred_set.EMPTY

s. ¬(pred_set.POW s = pred_set.EMPTY)

s. pred_set.FINITE s pred_set.countable s

s. pred_set.SING s pred_set.FINITE s

s. pred_set.COMPL (pred_set.COMPL s) = s

s. pred_set.DIFF pred_set.EMPTY s = pred_set.EMPTY

s. pred_set.DIFF s pred_set.EMPTY = s

s. pred_set.DIFF s pred_set.UNIV = pred_set.EMPTY

s. pred_set.DIFF s s = pred_set.EMPTY

s. pred_set.INTER s s = s

s. pred_set.UNION s s = s

x. isLeft x isRight x

l. list.ZIP (unzip l) = l

R. wellFounded R prim_rec.wellfounded R

R. relation.StrongOrder R relation.Order R

R. relation.WeakOrder R relation.Order R

R. relation.inv (relation.inv R) = R

f. pair.CURRY (pair.UNCURRY f) = f

f. pair.UNCURRY (pair.CURRY f) = f

() = λf g x. f (g x)

flip = λf x y. f y x

(x. P x) P ()

pred_set.GSPEC (λx. (x, )) = pred_set.EMPTY

pred_set.GSPEC (λx. (x, )) = pred_set.UNIV

e. fn. fn () = e

e. f. f bool.the_value = e

e. ∃!fn. fn () = e

n. i. n < divides.PRIMES i

s. pred_set.IMAGE (λa. a) s = s

R x. relation.EQC R x x

pred_set.UNIV = pred_set.INSERT (pred_set.INSERT pred_set.EMPTY)

numposrep.num_to_dec_list =
  numposrep.n2l (arithmetic.BIT2 (arithmetic.BIT2 1))

numposrep.num_to_oct_list = numposrep.n2l (arithmetic.BIT2 3)

numposrep.num_from_dec_list =
  numposrep.l2n (arithmetic.BIT2 (arithmetic.BIT2 1))

numposrep.num_from_oct_list = numposrep.l2n (arithmetic.BIT2 3)

reflexive = λR. x. R x x

relation.symmetric R subrelation (relation.inv R) R

relation.STRORD R = intersect R (relation.RCOMPL (=))

divides.divides 0 m m = 0

gcd.lcm a b = gcd.lcm b a

intersect R1 R2 = intersect R2 R1

union R1 R2 = union R2 R1

arithmetic.ABS_DIFF x z x + z

isSome (map f x) isSome x

pred_set.countable (pred_set.INSERT x s) pred_set.countable s

¬(p q) ¬q

¬(p q) ¬p

¬(p q) ¬q

isSome (option.OPTION_BIND x g) isSome x

reverse (reverse f) = f

x. ¬(pred_set.EMPTY = pred_set.INSERT x pred_set.EMPTY)

x. ¬(pred_set.INSERT x pred_set.EMPTY = pred_set.EMPTY)

x. pred_set.CHOICE (pred_set.INSERT x pred_set.EMPTY) = x

x. pred_set.REST (pred_set.INSERT x pred_set.EMPTY) = pred_set.EMPTY

A. A ¬A

b. ¬b (b )

t. ¬t t

t. (t ) ¬t

A. ¬A A

n. ¬(even n odd n)

n. odd (suc (arithmetic.BIT2 0 * n))

b. bit.BIT b (arithmetic.BIT2 0 b)

n. 0 < arithmetic.BIT2 0 n

n. even n ¬odd n

n. odd n ¬even n

x. numeral.iDUB x = x + x

x. numeral.iSQR x = x * x

n. numeral.iiSUC n = suc (suc n)

n. rich_list.COUNT_LIST n = list.GENLIST id n

n. rich_list.COUNT_LIST n = rich_list.COUNT_LIST_AUX n []

p. divides.prime p 0 < p

n. divides.PRIMES n < divides.PRIMES (suc n)

n. list.LIST_TO_SET (rich_list.COUNT_LIST n) = pred_set.count n

n. pred_set.SUM_SET (pred_set.INSERT n pred_set.EMPTY) = n

m. m * 1 = m

q. q div 1 = q

q. q div suc 0 = q

k. k mod 1 = 0

k. k mod suc 0 = 0

m. 1 * m = m

l. null l l = []

L. length L = list.LEN L 0

L. reverse L = list.REV L []

l. list.ALL_DISTINCT (reverse l) list.ALL_DISTINCT l

l. length (reverse l) = length l

ls. list.LIST_TO_SET (reverse ls) = list.LIST_TO_SET ls

l. list.LIST_TO_SET (list.nub l) = list.LIST_TO_SET l

l. list.DROP (length l) l = []

l. list.TAKE (length l) l = l

l. rich_list.BUTLASTN (length l) l = []

l. rich_list.LASTN (length l) l = l

l. list.FOLDR (::) [] l = l

L. list.SUM L = list.SUM_ACC L 0

l. list.SUM (reverse l) = list.SUM l

x. isNone x x = none

x. option.option_CASE x none some = x

x. option.option_CASE x x some = x

s. ¬bool.IN (pred_set.CHOICE s) (pred_set.REST s)

P. pred_set.COMPL P = pred_set.DIFF pred_set.UNIV P

s. pred_set.FINITE s list.ALL_DISTINCT (list.SET_TO_LIST s)

s. pred_set.FINITE s pred_set.FINITE (pred_set.REST s)

s. pred_set.FINITE s pred_set.FINITE (pred_set.POW s)

P. pred_set.BIGINTER (pred_set.INSERT P pred_set.EMPTY) = P

x. pred_set.BIGUNION (pred_set.INSERT x pred_set.EMPTY) = x

x. ¬isLeft x isRight x

x. ¬isRight x isLeft x

l. rich_list.UNZIP_FST l = fst (unzip l)

l. length (rich_list.UNZIP_FST l) = length l

l. length (rich_list.UNZIP_SND l) = length l

l. rich_list.UNZIP_SND l = snd (unzip l)

f. combin.FCOMM f f combin.ASSOC f

R. relation.rcdiamond R relation.diamond (relation.RC R)

R. relation.CR R relation.diamond (relation.RTC R)

R. relation.Order R relation.StrongOrder (relation.STRORD R)

R. relation.SN R wellFounded (relation.inv R)

R. reflexive R subrelation (=) R

R. relation.diamond R relation.diamond (relation.RC R)

R. relation.diamond R relation.diamond (transitiveClosure R)

R. relation.symmetric R relation.symmetric (transitiveClosure R)

R. reflexive R reflexive (transitiveClosure R)

R. transitive R transitive (relation.RC R)

R. wellFounded R wellFounded (transitiveClosure R)

R. relation.antisymmetric (relation.inv R) relation.antisymmetric R

R. relation.antisymmetric (relation.RC R) relation.antisymmetric R

R. relation.symmetric (relation.inv R) relation.symmetric R

R. relation.symmetric (relation.RC R) relation.symmetric R

R. irreflexive (relation.inv R) irreflexive R

R. reflexive (relation.inv R) reflexive R

R. transitive (relation.inv R) transitive R

R. relation.EQC (relation.EQC R) = relation.EQC R

R. relation.RC (relation.RC R) = relation.RC R

R. relation.RTC (relation.RTC R) = relation.RTC R

R. relation.SC (relation.SC R) = relation.SC R

R. transitiveClosure (transitiveClosure R) = transitiveClosure R

ind_type.ZBOT = ind_type.INJP (ind_type.INJN 0) (select z. )

Combinator.s = λf g x. f x (g x)

list.LIST_BIND l (λx. x :: []) = l

pred_set.GSPEC (λx. (x, P x)) = P

x y. empty x y

x y. const x y = x

x y. universe x y

x l. ¬null (list.SNOC x l)

x s. bool.IN x (pred_set.INSERT x s)

x s. pred_set.SUBSET (pred_set.DELETE s x) s

x. (select y. x = y) = x

lab argument. marker.:- lab argument argument

u x. one.one_CASE u x = x

m n. m m + n

n m. arithmetic.- n m n

a c. list.isPREFIX a (a @ c)

P l. list.isPREFIX (rich_list.PREFIX P l) l

s t. pred_set.SUBSET (pred_set.DIFF s t) s

P. P () x. P x

P. P bool.the_value i. P i

numposrep.num_to_hex_list = numposrep.n2l (arithmetic.BIT2 7)

numposrep.num_from_hex_list = numposrep.l2n (arithmetic.BIT2 7)

(<) = transitiveClosure (λx y. y = suc x)

() = relation.RTC (λx y. y = suc x)

irreflexive = λR. x. ¬R x x

n < numpair.tri (numpair.invtri n + 1)

pred_set.countable pred_set.UNIV
  pred_set.countable pred_set.UNIV pred_set.countable pred_set.UNIV

pred_set.countable pred_set.UNIV
  pred_set.countable pred_set.UNIV pred_set.countable pred_set.UNIV

pred_set.FINITE pred_set.UNIV
  pred_set.FINITE pred_set.UNIV pred_set.FINITE pred_set.UNIV

transitive R subrelation (relation.O R R) R

option.OPTION_GUARD b = if b then some () else none

() (pair.UNCURRY f) () (() f)

relation.total (relation.RC R)
  relation.total (relation.RC (list.LLEX R))

bool.IN x P pred_set.SUBSET x (pred_set.BIGUNION P)

0 < n arithmetic.MODEQ n n 0

0 = length l l = []

reverse l = [] l = []

arithmetic.MODEQ 0 m1 m2 m1 = m2

logroot.ROOT (arithmetic.BIT2 0) n = fst (logroot.SQRTd n)

list.SET_TO_LIST (pred_set.INSERT x pred_set.EMPTY) = x :: []

head (list.GENLIST f (suc n)) = f 0

arithmetic.FUNPOW f 1 x = f x

list.LIST_BIND (x :: []) f = f x

a. ind_type.INJA a = λn b. b = a

x. pred_set.CARD (pred_set.INSERT x pred_set.EMPTY) = 1

x. pred_set.DELETE (pred_set.INSERT x pred_set.EMPTY) x = pred_set.EMPTY

t. t t

n. ¬(arithmetic.BIT2 0 n = 0)

n. arithmetic.DIV2 n = n div arithmetic.BIT2 0

n. numpair.invtri n = snd (numpair.invtri0 n 0)

m. prim_rec.PRE m = arithmetic.- m 1

m. suc m = m + 1

n. suc n = 1 + n

m. ind_type.INJN m = λn a. n = m

%%genvar%%1167. divides.prime %%genvar%%1167 1 < %%genvar%%1167

n. 1 arithmetic.BIT2 0 n

n. n 0 n = 0

x. numeral_bit.FDUB numeral.iDUB x = numeral.iDUB (numeral.iDUB x)

x.
    numeral_bit.FDUB numeral_bit.iDIV2 x =
    numeral_bit.iDIV2 (numeral_bit.iDIV2 x)

m. 0 = m 0 < m

a. arithmetic.- (suc a) a = 1

n. bit.LOG2 (arithmetic.BIT2 0 n) = n

m. arithmetic.- (suc m) 1 = m

n. numpair.npair (numpair.nfst n) (numpair.nsnd n) = n

l. null l length l = 0

l. reverse l = list.FOLDR list.SNOC [] l

l. rich_list.SEG (length l) 0 l = l

l. rich_list.AND_EL l list.FOLDL () l

l. rich_list.AND_EL l list.FOLDR () l

l. rich_list.OR_EL l list.FOLDL () l

l. rich_list.OR_EL l list.FOLDR () l

l. list.SUM l = list.FOLDL (+) 0 l

l. list.SUM l = list.FOLDR (+) 0 l

x. ¬isSome x x = none

s. pred_set.REST s = pred_set.DELETE s (pred_set.CHOICE s)

P. rich_list.SPLITL P = rich_list.SPLITP ((¬) P)

s. s = pred_set.EMPTY pred_set.DISJOINT s s

s. pred_set.DISJOINT s s s = pred_set.EMPTY

s. pred_set.SUBSET pred_set.UNIV s s = pred_set.UNIV

s. pred_set.SUBSET s pred_set.EMPTY s = pred_set.EMPTY

s.
    pred_set.DISJOINT pred_set.EMPTY s pred_set.DISJOINT s pred_set.EMPTY

l. concat l = list.FOLDL (@) [] l

l. concat l = list.FOLDR (@) [] l

x. (fst x, snd x) = x

R. relation.EQC R = relation.RC (transitiveClosure (relation.SC R))

R. relation.equivalence R relation.inv R = R

R. relation.symmetric R relation.inv R = R

R. relation.symmetric R relation.SC R = R

R. reflexive R relation.RC R = R

R. transitive R transitiveClosure R = R

R. relation.inv (relation.RC R) = relation.RC (relation.inv R)

R.
    relation.inv (transitiveClosure R) = transitiveClosure (relation.inv R)

wellFounded (λL1 L2. h. L2 = h :: L1)

bit1 = λn. n + (n + suc 0)

(x. bool.IN x s) s = pred_set.UNIV

pred_set.GSPEC (λx. (x, bool.IN x y)) = y

x y. ¬(left x = right y)

x y. ¬(right y = left x)

x y. fst (x, y) = x

x y. snd (x, y) = y

x l. ¬([] = list.SNOC x l)

x l. ¬(list.SNOC x l = [])

h t. head (h :: t) = h

x l. last (list.SNOC x l) = x

h t. tail (h :: t) = t

x l. list.FRONT (list.SNOC x l) = l

x s. ¬(pred_set.EMPTY = pred_set.INSERT x s)

x s. ¬(pred_set.INSERT x s = pred_set.EMPTY)

x x'. bool.IN x x' x' x

x f. combin.:> x f = f x

n x. length (rich_list.REPLICATE n x) = n

m n. 0 < suc n m

m n. m < m + suc n

a b. gcd.is_gcd a b (gcd.gcd a b)

p m. arithmetic.- p m < suc p

h l. bit.BITS h l 0 = 0

l h. bit.SLICE h l 0 = 0

n. p. n < p divides.prime p

n. bit.LOWEST_SET_BIT n = while.LEAST (λi. bit.BIT i n)

a1 a0. ¬([] = a0 :: a1)

a1 a0. ¬(a0 :: a1 = [])

x x'. bool.literal_case x x' = x x'

x x'. bool.LET x x' = x x'

P x. bool.IN x P P x

s r. poset.carrier (s, r) = s

s r. poset.relation (s, r) = r

s. ¬f. pred_set.SURJ f s (pred_set.POW s)

f n. length (list.GENLIST f n) = n

P x. P x P (while.LEAST P)

R. reflexive R x. R x x

R. wellFounded R x. relation.WFP R x

f b. pred_set.ITSET f pred_set.EMPTY b = b

max = λm n. if m < n then n else m

min = λm n. if m < n then m else n

pred_set.UNIV =
  pred_set.UNION (pred_set.IMAGE left pred_set.UNIV)
    (pred_set.IMAGE right pred_set.UNIV)

0 < m suc (prim_rec.PRE m) = m

indexedLists.MAPi f l = indexedLists.MAPi_ACC f 0 [] l

0 < n x x n

0 < y x mod y x

arithmetic.MODEQ n x y arithmetic.MODEQ n y x

list.LIST_TO_SET (list.SNOC x ls) =
  pred_set.INSERT x (list.LIST_TO_SET ls)

¬( ) ¬( )

f (λx. g x) = λx. f (g x)

flip (λx. f x) y = λx. f x y

(λx. f x) g = λx. f (g x)

pair.pair_CASE (x, y) f = f x y

pred_set.count n1 = pred_set.count n2 n1 = n2

left x = left y x = y

right x = right y x = y

pair.CURRY f = pair.CURRY g f = g

pair.UNCURRY f = pair.UNCURRY g f = g

rich_list.REPLICATE x y = [] x = 0

list.LIST_APPLY (f :: []) l = map f l

option.OPTION_APPLY (some f) (some x) = some (f x)

n. h t. n = numpair.npair h t

n. numeral_bit.iLOG2 n = bit.LOG2 (n + 1)

n. numpair.nsnd n = arithmetic.- n (numpair.tri (numpair.invtri n))

n. pred_set.num_to_pair n = (numpair.nfst n, numpair.nsnd n)

n. list.GENLIST f n = list.GENLIST_AUX f n []

n. pred_set.count (suc n) = pred_set.INSERT n (pred_set.count n)

b. 0 < b divides.divides b (factorial b)

n. ¬(n = 0) 0 < n

n. ¬(0 < n) n = 0

n. arithmetic.BIT2 0 * n = n + n

n. suc m = n m < n

l. null l list.FOLDL (λx l'. ) l

l. null l list.FOLDR (λx l'. ) l

l. 0 < length l ¬null l

l. length l = 0 l = []

s. pred_set.FINITE s list.LIST_TO_SET (list.SET_TO_LIST s) = s

s. ¬pred_set.FINITE s ¬pred_set.countable (pred_set.POW s)

s. ¬pred_set.FINITE s ¬pred_set.FINITE (pred_set.REST s)

f. relation.IDEM f f f = f

f. relation.INVOL f f f = id

l. length (concat l) = list.SUM (map length l)

xs.
    list.ALL_DISTINCT (concat (reverse xs)) list.ALL_DISTINCT (concat xs)

l. list.SUM (concat l) = list.SUM (map list.SUM l)

x. q r. x = (q, r)

a. pair.SWAP a = (snd a, fst a)

x. isLeft x left (destLeft x) = x

x. isRight x right (destRight x) = x

l. concat (concat l) = concat (map concat l)

R. relation.LinearOrder R relation.Order R relation.trichotomous R

R. relation.PreOrder R reflexive R transitive R

R.
    relation.StrongLinearOrder R
    relation.StrongOrder R relation.trichotomous R

R.
    relation.WeakLinearOrder R
    relation.WeakOrder R relation.trichotomous R

R. relation.StrongOrder R relation.STRORD (relation.RC R) = R

R. relation.WeakOrder R relation.RC (relation.STRORD R) = R

R. relation.WCR R relation.SN R relation.CR R

R. irreflexive R transitive R relation.antisymmetric R

Z. relation.Order Z relation.antisymmetric Z transitive Z

Z. relation.StrongOrder Z irreflexive Z transitive Z

numpair.nlen = numpair.nlistrec 0 (λn t r. r + 1)

(b. P b) P P

bool.IN x (relation.RDOM R) y. R x y

bool.IN y (relation.RRANGE R) x. R x y

x s. pred_set.FINITE (pred_set.DELETE s x) pred_set.FINITE s

x s. pred_set.FINITE (pred_set.INSERT x s) pred_set.FINITE s

b1 b2. marker.AC b1 b2 b1 b2

m n. ¬(suc n m = 0)

m n. ¬(suc (m + n) m)

x y. x arithmetic.ABS_DIFF x y + y

m n. pred_set.count n m m < n

m n. m > n n < m

n m. n m m n

n m. arithmetic.ABS_DIFF n m = arithmetic.ABS_DIFF m n

a b. gcd.gcd a b = gcd.gcd b a

m n. m * n = n * m

m n. m + n = n + m

m n. max m n = max n m

m n. min m n = min n m

m n. m < n m n

m n. m < n n m

m n. m n n m

m n. min m n max m n

a c. arithmetic.- (a + c) c = a

%%genvar%%1580.
    divides.prime %%genvar%%1580 i. %%genvar%%1580 = divides.PRIMES i

p. divides.prime p i. divides.PRIMES i = p

l x. rich_list.ELL 0 (list.SNOC x l) = x

ls n. list.ALL_DISTINCT ls list.ALL_DISTINCT (list.DROP n ls)

l1 l2. list.isPREFIX l2 l1 rich_list.IS_SUBLIST l1 l2

l1 l2. rich_list.IS_SUFFIX l1 l2 rich_list.IS_SUBLIST l1 l2

l f. length (map f l) = length l

opt. isSome opt x. opt = some x

f a. combin.UPDATE a (f a) f = f

f ls. list.ALL_DISTINCT (map f ls) list.ALL_DISTINCT ls

f s. pred_set.countable s pred_set.countable (pred_set.IMAGE f s)

P l. list.ALL_DISTINCT l list.ALL_DISTINCT (filter P l)

P l. length (filter P l) length l

P ls. length (list.dropWhile P ls) length ls

s t. pred_set.DISJOINT s t pred_set.DISJOINT t s

s t. pred_set.INTER s t = pred_set.INTER t s

s t. pred_set.UNION s t = pred_set.UNION t s

s t. pred_set.UNION s (pred_set.DIFF s t) = s

s. pred_set.countable s f. pred_set.INJ f s pred_set.UNIV

s. pred_set.FINITE s f. pred_set.FINITE (pred_set.IMAGE f s)

s. pred_set.FINITE s t. pred_set.FINITE (pred_set.DIFF s t)

s. pred_set.FINITE s t. pred_set.FINITE (pred_set.INTER s t)

P. ¬pred_set.FINITE P x. bool.IN x P

f. ¬n. f (suc n) < f n

f x. Combinator.w f x = f x x

R f. relation.symmetric R relation.symmetric (relation.inv_image R f)

R f. relation.total R relation.total (relation.inv_image R f)

R f. reflexive R reflexive (relation.inv_image R f)

R f. transitive R transitive (relation.inv_image R f)

R. irreflexive R x. ¬R x x

f. pair.UNCURRY f = λv. f (fst v) (snd v)

R f. wellFounded R wellFounded (relation.inv_image R f)

f l. length (indexedLists.MAPi f l) = length l

f. ind_type.INJF f = λn. f (ind_type.NUMFST n) (ind_type.NUMSND n)

p t. poset.complete p poset.complete (poset.pointwise_lift t p)

() = λm n. m < n m = n

() = λm n. m > n m = n

pred_set.GSPEC f = pred_set.IMAGE (fst f) (snd f)

map f x = option.option_CASE x none (some f)

pred_set.equiv_on R s ¬bool.IN pred_set.EMPTY (pred_set.partition R s)

pred_set.equiv_on R s pred_set.BIGUNION (pred_set.partition R s) = s

0 < n arithmetic.MODEQ n (x mod n) x

P (bool.literal_case f v) = bool.literal_case (P f) v

P (bool.LET f v) = bool.LET (P f) v

bool.literal_case f v x = bool.literal_case (flip f x) v

bool.LET f v x = bool.LET (flip f x) v

pred_set.countable (pred_set.UNION s t)
  pred_set.countable s pred_set.countable t

reflexive (pair.LEX R1 R2) reflexive R1 reflexive R2

map f (concat l) = concat (map (map f) l)

pred_set.COMPL (pred_set.UNION s t) =
  pred_set.INTER (pred_set.COMPL s) (pred_set.COMPL t)

f pair.UNCURRY g = pair.UNCURRY (() f g)

(¬A ) (A )

1 < b x < b x

() (pair.UNCURRY (λx. P x)) x. () (P x)

() (pair.UNCURRY (λx. P x)) x. () (P x)

Combinator.s f (λx. g x) = λx. f x (g x)

Combinator.s (λx. f x) g = λx. f x (g x)

option.OPTION_APPLY (map f x) y = option.OPTION_MAP2 f x y

option.OPTION_GUARD = some () option.OPTION_GUARD = none

relation.symmetric R1 relation.symmetric R2
  relation.symmetric (pair.LEX R1 R2)

relation.total R1 relation.total R2 relation.total (pair.LEX R1 R2)

transitive R1 transitive R2 transitive (intersect R1 R2)

transitive R1 transitive R2 transitive (pair.LEX R1 R2)

arithmetic.NRC R 1 x y R x y

x P. bool.IN x (λx. P x) P x

h l n. bit.BITS h l n n

x. even x x mod arithmetic.BIT2 0 = 0

n. bit1 n = n + (n + suc 0)

n. 0 < n 0 div n = 0

n. 0 < n 0 mod n = 0

%%genvar%%531. divides.divides %%genvar%%531 1 %%genvar%%531 = 1

n. ¬(n = 0) bit.BIT (bit.LOG2 n) n

l. length l = list.FOLDL (λl' x. suc l') 0 l

l. length l = list.FOLDR (λx l'. suc l') 0 l

ls.
    list.ALL_DISTINCT ls pred_set.CARD (list.LIST_TO_SET ls) = length ls

ls. pred_set.SUM_IMAGE f (list.LIST_TO_SET ls) list.SUM (map f ls)

ls.
    pred_set.CARD (list.LIST_TO_SET ls) = length ls list.ALL_DISTINCT ls

l. list.FOLDL (λxs x. list.SNOC x xs) [] l = l

P. list.FIND P = map snd list.INDEX_FIND 0 P

s. pred_set.FINITE s length (list.SET_TO_LIST s) = pred_set.CARD s

s. ¬(s = pred_set.EMPTY) bool.IN (pred_set.CHOICE s) s

s. ¬(s = pred_set.EMPTY) pred_set.PSUBSET (pred_set.REST s) s

f g. f g = λx. f (g x)

P. while.LEAST P = while.WHILE ((¬) P) suc 0

l. concat (reverse l) = reverse (concat (map reverse l))

l. reverse (concat l) = concat (reverse (map reverse l))

ls.
    list.LIST_TO_SET (concat ls) =
    pred_set.BIGUNION (list.LIST_TO_SET (map list.LIST_TO_SET ls))

ls. concat ls = [] all ((=) []) ls

option.OPTION_APPLY f (some x) = option.OPTION_APPLY (some (λf. f x)) f

map (pair.UNCURRY (λx. pair.UNCURRY (λy z. x))) funs = map fst funs

pred_set.GSPEC (λx. (x, x = y)) = pred_set.INSERT y pred_set.EMPTY

pred_set.GSPEC (λx. (x, y = x)) = pred_set.INSERT y pred_set.EMPTY

bool.IN y (pred_set.GSPEC (λx. (x, P x))) P y

x y. pred_set.INSERT y pred_set.EMPTY x x = y

x l. length (list.SNOC x l) = suc (length l)

x y. list.isPREFIX (list.FRONT (x :: y)) (x :: y)

x xs. length (list.FRONT (x :: xs)) = length xs

x f n. fun. prim_rec.SIMP_REC_REL fun x f n

x s. pred_set.COMPL s x ¬bool.IN x s

A B. A B ¬A B

n x. rich_list.REPLICATE n x = list.GENLIST (const x) n

m n. ¬(m < n n < m)

m n. ¬(m < n n m)

m n. m < n suc m n

n m. n m n < suc m

n b. bit.BITV n b = bit.BITS b b n

m n. bit.BIT_REVERSE m n = numeral_bit.BIT_REV m n 0

n x. bit.DIV_2EXP n x = arithmetic.FUNPOW arithmetic.DIV2 n x

x x1. gcd.gcd x x1 = gcd.gcd_tupled (x, x1)

x x1. numposrep.n2l x x1 = numposrep.n2l_tupled (x, x1)

x x1. numpair.invtri0 x x1 = numpair.invtri0_tupled (x, x1)

m n. m = n ¬(m < n)

m n. m < n ¬(m = n)

m n. m < n m < suc n

m n. m < n suc m n

n m. n m n < suc m

m n. ¬(m < n) n m

m n. ¬(m n) n < m

m n. ¬(m > n) m n

m n. bool.IN m (pred_set.count n) m < n

m n. pred_set.pair_to_num (m, n) = numpair.npair m n

m n. suc m < n m < n

m n. suc m n m < n

n l. list.DROP n l = arithmetic.FUNPOW rich_list.TL_T n l

n f. null (list.GENLIST f n) n = 0

n. pred_set.count n = pred_set.GSPEC (λm. (m, m < n))

m. m = 0 n. m = suc n

l x. list.EL (length l) (list.SNOC x l) = x

l x. rich_list.ELL (length l) (x :: l) = x

L n. list.LEN L n = length L + n

l1 l2. l1 @ l2 = list.FOLDR (::) l2 l1

L1 L2. list.REV L1 L2 = reverse L1 @ L2

l1 l2. list.DROP (length l1) (l1 @ l2) = l2

l1 l2. list.TAKE (length l1) (l1 @ l2) = l1

l2 l1. rich_list.BUTLASTN (length l2) (l1 @ l2) = l1

l2 l1. rich_list.LASTN (length l2) (l1 @ l2) = l2

l. ¬null l e. bool.IN e (list.LIST_TO_SET l)

m1 m2. list.LIST_IGNORE_BIND m1 m2 = list.LIST_BIND m1 (const m2)

l f. list.LIST_BIND l f = concat (map f l)

L n. list.SUM_ACC L n = list.SUM L + n

opt. opt = none x. opt = some x

m1 m2.
    option.OPTION_IGNORE_BIND m1 m2 = option.OPTION_BIND m1 (const m2)

x x1. indexedLists.fupdLast x x1 = indexedLists.fupdLast_tupled (x, x1)

P l. all P (reverse l) all P l

P l. any P (reverse l) any P l

set e. bool.IN e (pred_set.POW set) pred_set.SUBSET e set

s. pred_set.SING s x. s = pred_set.INSERT x pred_set.EMPTY

set. pred_set.POW set = pred_set.GSPEC (λs. (s, pred_set.SUBSET s set))

s. ¬pred_set.FINITE s f. pred_set.INJ f pred_set.UNIV s

s. pred_set.PSUBSET s pred_set.UNIV x. ¬bool.IN x s

s. (x. bool.IN x s) ¬(s = pred_set.EMPTY)

f e. pred_set.SUM_IMAGE f (pred_set.INSERT e pred_set.EMPTY) = f e

f. relation.INVOL f x. f (f x) = x

P m. m < while.LEAST P ¬P m

P. (λp. P p) = pair.UNCURRY (λp1 p2. P (p1, p2))

intersect = λR1 R2 x y. R1 x y R2 x y

union = λR1 R2 x y. R1 x y R2 x y

null [] h t. ¬null (h :: t)

numeral.texp_help n 0 = arithmetic.BIT2 0 (n + 1)

0 x = if x = 0 then 1 else 0

list.TAKE n l = list.splitAtPki (const (=) n) const l

subrelation empty R (subrelation R empty R = empty)

pred_set.SUBSET s1 s2
  subrelation (pred_set.REL_RESTRICT R s1) (pred_set.REL_RESTRICT R s2)

y x numpair.invtri (numpair.tri x + y) = x

flip (pair.UNCURRY f) x = pair.UNCURRY (flip (flip f) x)

pred_set.MAX_SET pred_set.EMPTY = 0
  pred_set.MAX_SET (pred_set.INSERT e pred_set.EMPTY) = e

bool.IN x (list.LIST_TO_SET l) indexedLists.findi x l < length l

(x. isLeft (left x)) y. ¬isLeft (right y)

(x. isRight (right x)) y. ¬isRight (left y)

(x. R x x) x. option.OPTREL R x x

list.DROP n (rich_list.REPLICATE m a) =
  rich_list.REPLICATE (arithmetic.- m n) a

list.LIST_BIND (map f l) g = list.LIST_BIND l (g f)

map f (map g x) = map (f g) x

option.OPTION_MCOMP f (option.OPTION_MCOMP g h) =
  option.OPTION_MCOMP (option.OPTION_MCOMP f g) h

relation.O R1 (relation.O R2 R3) = relation.O (relation.O R1 R2) R3

intersect R1 (intersect R2 R3) = intersect (intersect R1 R2) R3

union R1 (union R2 R3) = union (union R1 R2) R3

gcd.lcm 0 x = 0 gcd.lcm x 0 = 0

option.OPTION_MCOMP g some = g option.OPTION_MCOMP some f = f

(a b. R a b) ¬wellFounded (list.LLEX R)

(subrelation universe R R = universe) subrelation R universe

while.OWHILE G f s = some s' ¬G s'

x. list.INDEX_OF x = map fst list.INDEX_FIND 0 ((=) x)

c i r. ¬(ind_type.CONSTR c i r = ind_type.BOTTOM)

c i r. ¬(ind_type.ZCONSTR c i r = ind_type.ZBOT)

n. odd n n mod arithmetic.BIT2 0 = 1

n. arithmetic.BIT2 n = n + (n + suc (suc 0))

m. m < suc m m < suc (suc m)

%%genvar%%14367.
    pred_set.count (%%genvar%%14367 + 1) =
    pred_set.INSERT %%genvar%%14367 (pred_set.count %%genvar%%14367)

l. reverse l = list.FOLDL (λl' x. x :: l') [] l

l. ¬null l rich_list.ELL 0 l = last l

s r. poset.poset (s, r) x. s x

s.
    pred_set.FINITE s
    pred_set.CARD (pred_set.IMAGE f s) pred_set.CARD s

f. injective f b. n. b < f n

L. unzip L = (map fst L, map snd L)

R x. relation.RDOM R x y. R x y

R y. relation.RRANGE R y x. R x y

p c. poset.complete p x. poset.glb p c x

p c. poset.complete p x. poset.lub p c x

¬pred_set.FINITE pred_set.UNIV
  s. pred_set.FINITE s pred_set.PSUBSET s pred_set.UNIV

(v1. P v1) p_1 p_2. P (p_1, p_2)

(l. P l) n f. P (list.GENLIST f n)

(v1. P v1) p_1 p_2. P (p_1, p_2)

prim_rec.PRE 0 = 0 m. prim_rec.PRE (suc m) = m

option.OPTION_JOIN none = none x. option.OPTION_JOIN (some x) = x

map (λx. x) l = l map id l = l

(x. isNone (some x) ) (isNone none )

(x. isSome (some x) ) (isSome none )

(p_1 p_2. P (p_1, p_2)) v1. P v1

x y. relation.RTC R x y relation.EQC R x y

x y. bool.IN x (pred_set.INSERT y pred_set.EMPTY) x = y

x y. some x = some y x = y

a1 a2. ind_type.INJA a1 = ind_type.INJA a2 a1 = a2

x l. x :: l = (x :: []) @ l

x l. list.SNOC x l = reverse (x :: reverse l)

x l. list.SNOC x l = l @ x :: []

x l. bool.IN x (list.LIST_TO_SET l) any ((=) x) l

x l. reverse (list.SNOC x l) = x :: reverse l

e l. bool.IN (last (e :: l)) (list.LIST_TO_SET (e :: l))

x s. bool.IN x s pred_set.INSERT x s = s

x s. bool.IN x s pred_set.INSERT x s = s

x s. bool.IN x (pred_set.COMPL s) ¬bool.IN x s

s x.
    pred_set.PSUBSET x (pred_set.INSERT s pred_set.EMPTY)
    x = pred_set.EMPTY

x s. pred_set.INSERT x (pred_set.INSERT x s) = pred_set.INSERT x s

x s. pred_set.DELETE (pred_set.DELETE s x) x = pred_set.DELETE s x

A B. (A B A) B A

m n. ¬(m < n n < suc m)

n m. ¬(suc (n + n) = m + m)

n m. m < n 0 < arithmetic.- n m

b n. bit.BITV n b = bit.SBIT (bit.BIT b n) 0

m n. 0 < n m mod n < n

a b. 0 < b a mod b a

m n. m < n ¬(n < suc m)

m n. m < n divides.PRIMES m < divides.PRIMES n

n m. n < m numpair.tri n < numpair.tri m

m n. m < n suc m < suc n

r n. r < n r div n = 0

n k. k < n k mod n = k

m n. ¬(m n) suc n m

m n. ¬(m n) suc m n

m n. prim_rec.PRE (arithmetic.- m n) = arithmetic.- (prim_rec.PRE m) n

m n. suc (m + n) = m + suc n

m n. suc (m + n) = suc n + m

n h. bit.SLICE h 0 n = bit.BITS h 0 n

i n. bit.LOG2 n < i ¬bit.BIT i n

x z. arithmetic.ABS_DIFF x (suc z) suc (arithmetic.ABS_DIFF x z)

n m. ¬(suc n m) m n

m n. bool.IN m (list.LIST_TO_SET (rich_list.COUNT_LIST n)) m < n

m n. numpair.tri m = numpair.tri n m = n

m n. suc m = suc n m = n

n1 n2. ind_type.INJN n1 = ind_type.INJN n2 n1 = n2

n m. numpair.tri n < numpair.tri m n < m

m n. suc m < suc n m < n

m n. numpair.tri m numpair.tri n m n

n m. suc n suc m n m

m n. arithmetic.- m n = 0 m n

n m. arithmetic.ABS_DIFF n m = 0 n = m

m n. m + n = m n = 0

a b. gcd.gcd a (a + b) = gcd.gcd a b

n m. arithmetic.- (suc n) (suc m) = arithmetic.- n m

n m. arithmetic.ABS_DIFF (suc n) (suc m) = arithmetic.ABS_DIFF n m

a b. gcd.gcd (a + b) a = gcd.gcd a b

%%genvar%%1420 n.
    divides.PRIMES %%genvar%%1420 = divides.PRIMES n %%genvar%%1420 = n

m n. suc m = suc n m = n

m n. suc m < suc n m < n

m n. m + n = m n = 0

n xs. rich_list.BUTLASTN n xs = reverse (list.DROP n (reverse xs))

n xs. rich_list.LASTN n xs = reverse (list.TAKE n (reverse xs))

n l. length (list.DROP n l) = arithmetic.- (length l) n

n l. list.TAKE n l @ list.DROP n l = l

x l. list.SUM (list.SNOC x l) = list.SUM l + x

n. even n m. n = arithmetic.BIT2 0 * m

n. 0 < n k. k div n k

m. ¬(m = 0) n. m = suc n

l1 l2.
    rich_list.IS_SUFFIX l1 l2 list.isPREFIX (reverse l2) (reverse l1)

x y. x = y length x = length y

x y. list.isPREFIX x y length x length y

l1 l2. l1 = reverse l2 l2 = reverse l1

%%genvar%%10697 l2.
    reverse %%genvar%%10697 = l2 %%genvar%%10697 = reverse l2

l1 l2. reverse l1 = reverse l2 l1 = l2

l1 l2.
    list.isPREFIX (reverse l2) (reverse l1) rich_list.IS_SUFFIX l1 l2

l1 l2.
    rich_list.IS_SUBLIST (reverse l1) (reverse l2)
    rich_list.IS_SUBLIST l1 l2

l2 l1.
    rich_list.IS_SUFFIX (reverse l1) (reverse l2) list.isPREFIX l2 l1

l P. filter P (reverse l) = reverse (filter P l)

x l. concat (list.SNOC x l) = concat l @ x

x y. ind_type.dest_rec x = ind_type.dest_rec y x = y

f l. map f (reverse l) = reverse (map f l)

f l. list.LIST_TO_SET (map f l) = pred_set.IMAGE f (list.LIST_TO_SET l)

f x. map f x = none x = none

s x.
    pred_set.DELETE s x =
    pred_set.DIFF s (pred_set.INSERT x pred_set.EMPTY)

s x.
    pred_set.INSERT x s =
    pred_set.UNION (pred_set.INSERT x pred_set.EMPTY) s

s x.
    pred_set.COMPL (pred_set.INSERT x s) =
    pred_set.DELETE (pred_set.COMPL s) x

P l. filter P l = l all P l

P ls. list.dropWhile P ls = [] all P ls

f l. filter f (filter f l) = filter f l

s f. pred_set.IMAGE f s = pred_set.EMPTY s = pred_set.EMPTY

s t. pred_set.DISJOINT s t pred_set.INTER s t = pred_set.EMPTY

s t. pred_set.SUBSET s t pred_set.INTER s t = s

s t. pred_set.SUBSET s t pred_set.UNION s t = t

s1 s2.
    pred_set.SUBSET s1 s2
    pred_set.SUBSET (pred_set.POW s1) (pred_set.POW s2)

s t. pred_set.DIFF s t = pred_set.EMPTY pred_set.SUBSET s t

s t. pred_set.DIFF (pred_set.DIFF s t) t = pred_set.DIFF s t

s t. pred_set.countable s pred_set.SUBSET t s pred_set.countable t

%%genvar%%1612 t.
    pred_set.FINITE %%genvar%%1612 pred_set.SUBSET t %%genvar%%1612
    pred_set.FINITE t

P B.
    pred_set.BIGINTER (pred_set.INSERT P B) =
    pred_set.INTER P (pred_set.BIGINTER B)

s P.
    pred_set.BIGUNION (pred_set.INSERT s P) =
    pred_set.UNION s (pred_set.BIGUNION P)

s. pred_set.FINITE s t. pred_set.PSUBSET t s pred_set.FINITE t

s. pred_set.FINITE s t. pred_set.SUBSET t s pred_set.FINITE t

f. relation.IDEM f x. f (f x) = f x

f n.
    list.LIST_TO_SET (list.GENLIST f n) =
    pred_set.IMAGE f (pred_set.count n)

f. numpair.nmap f = numpair.nlistrec 0 (λn t r. numpair.ncons (f n) r)

f. (n. f n < f (suc n)) injective f

p f. pair.pair_CASE p f = f (fst p) (snd p)

fs xs. list.LIST_APPLY fs xs = list.LIST_BIND fs (flip map xs)

R1 R2. irreflexive R2 subrelation R1 R2 irreflexive R1

f v. pair.UNCURRY f v = f (fst v) (snd v)

f. (x. ¬snd (f x)) pred_set.GSPEC f = pred_set.EMPTY

f1 f2. ind_type.INJF f1 = ind_type.INJF f2 f1 = f2

p. poset.poset p poset.complete p x. poset.bottom p x

p. poset.poset p poset.complete p x. poset.top p x

numpair.tri n = n * (n + 1) div arithmetic.BIT2 0

pred_set.FINITE s
  pred_set.SUM_IMAGE f s = list.SUM (map f (list.SET_TO_LIST s))

wellFounded R transitiveClosure R x y ¬(x = y)

list.DROP n l = list.splitAtPki (const (=) n) (const id) l

(opt. P opt) P none x. P (some x)

(opt. P opt) P none x. P (some x)

last (h :: t) = if t = [] then h else last t

option.option_CASE x e f = if isSome x then f (option.THE x) else e

1 < n 1 mod n = 1

arithmetic.BIT2 0 * numpair.tri n = n * (n + 1)

map f (list.LIST_BIND l g) = list.LIST_BIND l (map f g)

option.OPTION_IGNORE_BIND none m = none
  option.OPTION_IGNORE_BIND (some v) m = m

P (bool.LET (λx. N x) M) bool.LET (λx. P (N x)) M

reverse l = e :: [] l = e :: []

pair.PROD_ALL P Q (x, y) P x Q y

list.LIST_APPLY (f :: []) (x :: []) = f x :: []

x n ys. length (list.LUPDATE x n ys) = length ys

c l. all (λx. c) l l = [] c

n.
    numpair.nfst n =
    arithmetic.- (numpair.tri (numpair.invtri n) + numpair.invtri n) n

%%genvar%%520.
    P %%genvar%%520 P (while.LEAST P) while.LEAST P %%genvar%%520

n. 0 < n bit.BITS (bit.LOG2 n) 0 n = n

n. n mod arithmetic.BIT2 0 = if even n then 0 else 1

a. 1 < a logroot.LOG a a = 1

a. 1 < a logroot.LOG a 1 = 0

m. arithmetic.- 0 m = 0 arithmetic.- m 0 = m

n. arithmetic.ABS_DIFF n 0 = n arithmetic.ABS_DIFF 0 n = n

n. max n 0 = n max 0 n = n

n. min n 0 = 0 min 0 n = 0

x. list.isPREFIX [] x (list.isPREFIX x [] x = [])

l. ¬null l head l :: tail l = l

ls. ¬(ls = []) last (reverse ls) = head ls

f g x. (f g) x = f (g x)

f. id f = f f id = f

s. pred_set.SING s pred_set.CARD s = 1 pred_set.FINITE s

s. pred_set.FINITE s f b. pred_set.BIJ f (pred_set.count b) s

s. pred_set.FINITE s (pred_set.CARD s = 0 s = pred_set.EMPTY)

P.
    pred_set.CROSS P pred_set.EMPTY = pred_set.EMPTY
    pred_set.CROSS pred_set.EMPTY P = pred_set.EMPTY

R x y. R x y relation.EQC R x y

R x y. R x y relation.RC R x y

R x y. R x y relation.RTC R x y

R x y. R x y transitiveClosure R x y

R x y. relation.inv R x y R y x

R.
    relation.equivalence R
    reflexive R relation.symmetric R transitive R

R.
    (relation.rcdiamond R relation.CR R)
    (relation.diamond R relation.CR R)

f x y. flip f x y = f y x

R x. relation.nf R x y. ¬R x y

Z.
    relation.WeakOrder Z
    reflexive Z relation.antisymmetric Z transitive Z

pred_set.BIGINTER B x s. bool.IN s B bool.IN x s

reverse (list.GENLIST f n) =
  list.GENLIST (λm. f (arithmetic.- (prim_rec.PRE n) m)) n

list.LIST_APPLY fs (x :: []) = list.LIST_APPLY ((λf. f x) :: []) fs

x l. list.SNOC x l = list.FOLDR (::) (x :: []) l

e l. rich_list.LIST_ELEM_COUNT e l > 0 bool.IN e (list.LIST_TO_SET l)

x s. ¬bool.IN x s pred_set.DELETE s x = s

x s. ¬bool.IN x s pred_set.DELETE s x = s

x y. x y x < y + 1

x n. bit.DIV_2EXP x n = n div arithmetic.BIT2 0 x

x n. bit.MOD_2EXP x n = n mod arithmetic.BIT2 0 x

x n. bit.TIMES_2EXP x n = n * arithmetic.BIT2 0 x

h t. numpair.ncons h t = numpair.npair h t + 1

m n. numpair.npair m n = numpair.tri (m + n) + n

m n. max m n = if m < n then n else m

m n. min m n = if m < n then m else n

%%genvar%%2631 n.
    bit.BIT %%genvar%%2631 n arithmetic.BIT2 0 %%genvar%%2631 n

b n. 0 < b all ((>) b) (numposrep.n2l b n)

m n. m < n list.EL m (rich_list.COUNT_LIST n) = m

m n. n < m n arithmetic.- m 1

m n. even (m * n) even m even n

m n. even (m + n) even m even n

m n. odd (m * n) odd m odd n

m n. m * suc n = m + m * n

m n. ¬(n = 0) m < m + n

n a. fst (numpair.invtri0 n a) < suc (snd (numpair.invtri0 n a))

x n. bit.SBIT (bit.BIT x n) x = bit.SLICE x x n

n m. bit.BIT n (arithmetic.BIT2 0 m) m = n

n. odd n m. n = suc (arithmetic.BIT2 0 * m)

n. 0 < n x. bool.IN x (list.LIST_TO_SET (rich_list.REPLICATE n x))

l x.
    bool.IN x (list.LIST_TO_SET (reverse l))
    bool.IN x (list.LIST_TO_SET l)

l x. rich_list.BUTLASTN (length l) (x :: l) = x :: []

l m. m = length l list.DROP m l = []

l m. m = length l list.TAKE m l = l

l n. length l n list.DROP n l = []

l n. length l n list.TAKE n l = l

ls n. list.DROP n ls = [] n length ls

l1 l2. length (l1 @ l2) = length l1 + length l2

l1 l2. reverse (l1 @ l2) = reverse l2 @ reverse l1

l1 l2.
    list.LIST_TO_SET (l1 @ l2) =
    pred_set.UNION (list.LIST_TO_SET l1) (list.LIST_TO_SET l2)

l1 l2.
    pred_set.UNION (list.LIST_TO_SET l1) (list.LIST_TO_SET l2) =
    list.LIST_TO_SET (l1 @ l2)

l1 l2. indexedLists.LIST_RELi R l1 l2 length l1 = length l2

x y. list.LIST_REL R x y length x = length y

l1 l2. list.SUM (l1 @ l2) = list.SUM l1 + list.SUM l2

f l. map f (concat l) = concat (map (map f) l)

f M.
    pred_set.IMAGE f (pred_set.BIGUNION M) =
    pred_set.BIGUNION (pred_set.IMAGE (pred_set.IMAGE f) M)

P l. all P l list.FOLDL () (map P l)

P l. all P l list.FOLDR () (map P l)

P l. any P l list.FOLDL () (map P l)

P l. any P l list.FOLDR () (map P l)

P l. rich_list.PREFIX P l = fst (rich_list.SPLITP ((¬) P) l)

P l. ¬all P l any ((¬) P) l

P l. ¬any P l all ((¬) P) l

s t.
    pred_set.INTER s t =
    pred_set.COMPL (pred_set.UNION (pred_set.COMPL s) (pred_set.COMPL t))

s t.
    pred_set.FINITE (pred_set.UNION s t)
    pred_set.FINITE s pred_set.FINITE t

s t.
    pred_set.countable s pred_set.countable t
    pred_set.countable (pred_set.UNION s t)

%%genvar%%13562 t.
    pred_set.countable %%genvar%%13562 pred_set.countable t
    pred_set.countable (pred_set.INTER %%genvar%%13562 t)

s1 s2.
    pred_set.FINITE s1 pred_set.FINITE s2
    pred_set.FINITE (pred_set.INTER s1 s2)

P Q.
    pred_set.BIGINTER
      (pred_set.INSERT P (pred_set.INSERT Q pred_set.EMPTY)) =
    pred_set.INTER P Q

P Q.
    pred_set.FINITE (pred_set.DIFF P Q) pred_set.FINITE Q
    pred_set.FINITE P

p q.
    pred_set.UNION (pred_set.INTER p q)
      (pred_set.INTER (pred_set.COMPL p) q) = q

s t.
    pred_set.countable s pred_set.countable t
    pred_set.countable (pred_set.CROSS s t)

P Q.
    pred_set.FINITE P pred_set.FINITE Q
    pred_set.FINITE (pred_set.CROSS P Q)

P l. filter P (concat l) = concat (map (filter P) l)

s.
    pred_set.FINITE s
    t. pred_set.CARD (pred_set.INTER s t) pred_set.CARD s

f g. map (f g) = map f map g

l1 l2. concat (l1 @ l2) = concat l1 @ concat l2

P. (l. length l = 0 P l) P []

R R'.
    relation.inv (relation.O R R') =
    relation.O (relation.inv R') (relation.inv R)

R Q. wellFounded R wellFounded Q wellFounded (pair.LEX R Q)

R Q. wellFounded R wellFounded Q wellFounded (pair.RPROD R Q)

R f. relation.inv_image R f = λx y. R (f x) (f y)

s1 s2.
    pred_set.BIGINTER (pred_set.UNION s1 s2) =
    pred_set.INTER (pred_set.BIGINTER s1) (pred_set.BIGINTER s2)

s1 s2.
    pred_set.BIGUNION (pred_set.UNION s1 s2) =
    pred_set.UNION (pred_set.BIGUNION s1) (pred_set.BIGUNION s2)

subrelation = λR1 R2. x y. R1 x y R2 x y

m n suc b m suc b n

length (list.TAKE n xs) = if n length xs then n else length xs

list.GENLIST f (suc n) = f 0 :: list.GENLIST (f suc) n

0 < x y 0 < x y = 0

max m n = 0 m = 0 n = 0

min m n = 0 m = 0 n = 0

option.OPTION_CHOICE m1 m2 = none m1 = none m2 = none

pred_set.CROSS s t = pred_set.EMPTY
  s = pred_set.EMPTY t = pred_set.EMPTY

list.LIST_BIND (l1 @ l2) f = list.LIST_BIND l1 f @ list.LIST_BIND l2 f

list.LIST_BIND (list.LIST_BIND l g) f =
  list.LIST_BIND l (flip list.LIST_BIND f g)

list.LIST_REL R (map f l1) l2 list.LIST_REL (R f) l1 l2

gcd.lcm 1 x = x gcd.lcm x 1 = x

pred_set.INTER x (pred_set.COMPL x) = pred_set.EMPTY
  pred_set.INTER (pred_set.COMPL x) x = pred_set.EMPTY

rich_list.REPLICATE n a @ rich_list.REPLICATE m a =
  rich_list.REPLICATE (n + m) a

pred_set.GSPEC (pair.UNCURRY (λx y. ((x, y), P x y))) = pair.UNCURRY P

t1 t2. fn. fn = t1 fn = t2

e l. rich_list.LIST_ELEM_COUNT e l = length (filter (λx. x = e) l)

e s1 s2.
    pred_set.SUBSET s1 s2 pred_set.SUBSET s1 (pred_set.INSERT e s2)

c l. any (λx. c) l ¬(l = []) c

%%genvar%%1030 b c.
    divides.divides %%genvar%%1030 b
    divides.divides %%genvar%%1030 (b * c)

a b c. gcd.is_gcd a b c gcd.is_gcd b a c

a b. divides.divides a b q. b = q * a

m n. m n p. n = m + p

n m. n < m p. n < m + p

m n. n < m p. p + n = m

m n. m n k. m = arithmetic.- n k

m n. m n p. n = m + p

m n. n m p. p + n = m

n m. n < m p. n = p + m

n. n = 0 h t. n = numpair.ncons h t

s h t. rich_list.IS_SUFFIX s (h :: t) rich_list.IS_SUFFIX s t

l m P. any P (list.DROP m l) any P l

l m P. any P (list.TAKE m l) any P l

a b c. list.isPREFIX (a @ b) c list.isPREFIX a c

l1 l2. list.isPREFIX l2 l1 l. l1 = l2 @ l

l1 l2. rich_list.IS_SUFFIX l1 l2 l. l1 = l @ l2

ll. ll = [] a l. ll = a :: l

ll. ll = [] x l. ll = list.SNOC x l

l. ¬(l = []) length (list.FRONT l) = prim_rec.PRE (length l)

l. ¬(l = []) rich_list.BUTLASTN 1 l = list.FRONT l

f g. f = g x. f x = g x

P t. (x. x = t P x) () P

P l. all P l ¬any (λx. ¬P x) l

P l. any P l ¬all (λx. ¬P x) l

P1 P2 l. all P1 l all P1 (filter P2 l)

s.
    pred_set.SING s
    ¬(s = pred_set.EMPTY) pred_set.REST s = pred_set.EMPTY

P.
    list.dropWhile P =
    list.splitAtPki (flip (const ((¬) P))) (const id)

s.
    pred_set.FINITE s
    pred_set.CARD (pred_set.POW s) = arithmetic.BIT2 0 pred_set.CARD s

s.
    ¬(s = pred_set.EMPTY)
    pred_set.INSERT (pred_set.CHOICE s) (pred_set.REST s) = s

P. (n. P n) P 0 n. P (suc n)

P. (n. P n) P 0 n. P (suc n)

p f g. fst (pair.## f g p) = f (fst p)

p f g. snd (pair.## f g p) = g (snd p)

ss. (x. ss = left x) y. ss = right y

g f m. option.OPTION_MCOMP g f m = option.OPTION_BIND (f m) g

P. P none (x. P (some x)) opt. P opt

R x y. relation.EQC R x y relation.EQC R y x

R u v. relation.RC R u v relation.RTC R u v

R x y. transitiveClosure R x y relation.RTC R x y

R x y. arithmetic.NRC R 0 x y x = y

R s t. bool.IN t (pred_set.partition R s) pred_set.SUBSET t s

f e l. length (rich_list.SCANL f e l) = suc (length l)

f e. combin.RIGHT_ID f e x. f x e = x

f e. combin.LEFT_ID f e x. f e x = x

f e l. length (rich_list.SCANR f e l) = suc (length l)

f x y. pair.UNCURRY f (x, y) = f x y

f g x. Combinator.s f g x = f x (g x)

R x y. relation.RCOMPL R x y ¬R x y

f x y. pair.CURRY f x y = f (x, y)

bool.IN x (pred_set.BIGINTER B) s. bool.IN s B bool.IN x s

list.LIST_TO_SET (filter P l) =
  pred_set.INTER (pred_set.GSPEC (λx. (x, P x))) (list.LIST_TO_SET l)

(even 0 ) n. even (suc n) ¬even n

(odd 0 ) n. odd (suc n) ¬odd n

while.OWHILE G f s = none n. G (arithmetic.FUNPOW f n s)

(p. P (fst p) (snd p)) x y. P x y

(p. P (fst p) (snd p)) x y. P x y

list.LIST_BIND l (λl. l) = concat l list.LIST_BIND l id = concat l

x y.
    pred_set.INSERT x pred_set.EMPTY = pred_set.INSERT y pred_set.EMPTY
    x = y

x s. bool.IN x s pred_set.INSERT x (pred_set.DELETE s x) = s

t1 t2. (t1 t2) (t1 t2) (t2 t1)

t1 t2. (t1 t2) (t2 t1) (t1 t2)

b n. bit.SBIT b n = if b then arithmetic.BIT2 0 n else 0

m n. m = n m n n m

b n. bit.BIT b n bit.BITS b b n = 1

m n. m n m < n m = n

m n. m n m > n m = n

x n. bit.DIVMOD_2EXP x n = (bit.DIV_2EXP x n, bit.MOD_2EXP x n)

m n. divides.divides m n m n n = 0

n q. 0 < n q * n div n = q

m n. n m arithmetic.- m n + n = m

m n. m = n m < n n < m

n a. ¬bit.BIT n a bit.BITS n n a = 0

b n. ¬bit.BIT b n bit.SLICE b b n = 0

n m. even (m n) 0 < n even m

m n. odd (m + n) ¬(odd m odd n)

n m. odd (m n) n = 0 odd m

n i. bit.BIT n (i div arithmetic.BIT2 0) bit.BIT (suc n) i

i n. n < arithmetic.BIT2 0 i ¬bit.BIT i n

%%genvar%%924 n. 0 < n even %%genvar%%924 even (%%genvar%%924 n)

%%genvar%%928 n. 0 < n odd %%genvar%%928 odd (%%genvar%%928 n)

n k. k mod arithmetic.BIT2 0 n < arithmetic.BIT2 0 n

a b. arithmetic.BIT2 0 arithmetic.- a b arithmetic.BIT2 0 a

m n. min m n = max m n m = n

a b. divides.divides a b divides.divides b a a = b

a b. 0 < b divides.divides a b a b

n m. n m m n n = m

n l. n < length l bool.IN (list.EL n l) (list.LIST_TO_SET l)

n l. n < length l bool.IN (rich_list.ELL n l) (list.LIST_TO_SET l)

n l. n length l length (list.TAKE n l) = n

n l. n length l length (rich_list.LASTN n l) = n

n f. 0 < n head (list.GENLIST f n) = f 0

x s. pred_set.FINITE s bool.IN x s x pred_set.SUM_SET s

n. 0 < n k. k * n mod n = 0

l1 l2. l1 @ l2 = list.FOLDL (λxs x. list.SNOC x xs) l1 l2

x y. list.isPREFIX x y list.isPREFIX y x x = y

l1 l2. list.LIST_REL R l1 (reverse l2) list.LIST_REL R (reverse l1) l2

s1 s2. s1 = s2 pred_set.SUBSET s1 s2 pred_set.SUBSET s2 s1

s t. pred_set.SUBSET s t pred_set.SUBSET t s s = t

s.
    pred_set.countable s
    s = pred_set.EMPTY f. pred_set.SURJ f pred_set.UNIV s

s. ¬pred_set.FINITE s t. pred_set.SUBSET s t ¬pred_set.FINITE t

f g. basicSize.pair_size f g = pair.UNCURRY (λx y. f x + g y)

f n. tail (list.GENLIST f (suc n)) = list.GENLIST (f suc) n

s. pred_set.FINITE s y. bool.IN y s y pred_set.MAX_SET s

x y. option.OPTION_JOIN x = some y x = some (some y)

f. fn. x y. fn (x, y) = f x y

y z. y = z subrelation y z subrelation z y

R1 R2. subrelation R1 R2 subrelation R2 R1 R1 = R2

p f.
    poset.continuous p f
    poset.up_continuous p f poset.down_continuous p f

¬pred_set.FINITE pred_set.UNIV s. pred_set.FINITE s x. ¬bool.IN x s

bool.literal_case f v
  () (Combinator.s (() (marker.Abbrev flip (=) v)) f)

bool.LET f v () (Combinator.s (() (marker.Abbrev flip (=) v)) f)

pred_set.SING (pred_set.INSERT x s)
  s = pred_set.EMPTY s = pred_set.INSERT x pred_set.EMPTY

(p ¬q) (p q) (¬q ¬p)

Combinator.s f (pair.UNCURRY g) =
  pair.UNCURRY (Combinator.s (Combinator.s (() f ,)) g)

(null [] ) h t. null (h :: t)

rich_list.TL_T [] = [] h t. rich_list.TL_T (h :: t) = t

list.LIST_TO_SET [] = pred_set.EMPTY
  list.LIST_TO_SET (h :: t) = pred_set.INSERT h (list.LIST_TO_SET t)

x < b x 1 < b x = 0

list.GENLIST f 0 = [] list.GENLIST f n = list.GENLIST_AUX f n []

option.OPTION_MAP2 f o1 o2 = none o1 = none o2 = none

¬(A B) ¬A ¬B

pred_set.INJ f s (pred_set.IMAGE f s)
  (pred_set.countable (pred_set.IMAGE f s) pred_set.countable s)

(l. l @ [] = l) l. [] @ l = l

(s. pred_set.INTER pred_set.EMPTY s = pred_set.EMPTY)
  s. pred_set.INTER s pred_set.EMPTY = pred_set.EMPTY

(s. pred_set.INTER pred_set.UNIV s = s)
  s. pred_set.INTER s pred_set.UNIV = s

(s. pred_set.UNION pred_set.EMPTY s = s)
  s. pred_set.UNION s pred_set.EMPTY = s

(s. pred_set.UNION pred_set.UNIV s = pred_set.UNIV)
  s. pred_set.UNION s pred_set.UNIV = pred_set.UNIV

while.LEAST (λn. n = x) = x while.LEAST (λn. x = n) = x

¬(¬A B) A ¬B

while.OWHILE G f s = some s' while.WHILE G f s = s'

option.OPTION_APPLY
    (option.OPTION_APPLY (option.OPTION_APPLY (some ()) f) g) x =
  option.OPTION_APPLY f (option.OPTION_APPLY g x)

x y. relation.RTC R x y n. arithmetic.NRC R n x y

x s. bool.IN x s f. bool.IN (f x) (pred_set.IMAGE f s)

n x y. arithmetic.NRC R n x y relation.RTC R x y

n x l. rich_list.ELL (suc n) (list.SNOC x l) = rich_list.ELL n l

h l n. h < l bit.BITS h l n = 0

h l n. h < l bit.SLICE h l n = 0

h l n. bit.BITS h l n < arithmetic.BIT2 0 suc h

h l n. bit.SLICE h l n < arithmetic.BIT2 0 suc h

l1 l2.
    numpair.napp l1 l2 = numpair.nlistrec l2 (λn t r. numpair.ncons n r) l1

m n. n < m p. suc p + n = m

n. arithmetic.num_CASE n f g = if n = 0 then f else g (prim_rec.PRE n)

b. 1 < b n. m. n b m

xs n x. list.LUPDATE x n xs = [] xs = []

ls. list.SUM (map f ls) = list.FOLDL (λa e. a + f e) 0 ls

ls. ¬(ls = []) last ls = list.EL (prim_rec.PRE (length ls)) ls

l. ¬(l = []) list.EL (prim_rec.PRE (length l)) l = last l

l. ¬(l = []) rich_list.ELL (prim_rec.PRE (length l)) l = head l

ls. ¬(ls = []) list.TAKE (prim_rec.PRE (length ls)) ls = list.FRONT ls

f n x. map f (rich_list.REPLICATE n x) = rich_list.REPLICATE n (f x)

f ls. list.GENLIST (λn. f (list.EL n ls)) (length ls) = map f ls

f s y. pred_set.LINV f s y = option.THE (pred_set.LINV_OPT f s y)

f s y. pred_set.RINV f s y = option.THE (pred_set.LINV_OPT f s y)

f s t. pred_set.SURJ f s t pred_set.IMAGE f s = t

f s t. pred_set.countable t pred_set.INJ f s t pred_set.countable s

f s t. pred_set.BIJ f s t pred_set.FINITE s pred_set.FINITE t

%%genvar%%1873 s t.
    pred_set.INJ %%genvar%%1873 s t pred_set.FINITE t pred_set.FINITE s

f s. pred_set.IMAGE f s = pred_set.GSPEC (λx. (f x, bool.IN x s))

P l. filter P l = [] all (λx. ¬P x) l

P f. bool.RES_SELECT P f = select x. bool.IN x P f x

P f. bool.RES_EXISTS P f x. bool.IN x P f x

P f. bool.RES_FORALL P f x. bool.IN x P f x

P. option.some P = if (x. P x) then some (select x. P x) else none

s.
    pred_set.FINITE s
    (wellFounded (pred_set.REL_RESTRICT R s)
     irreflexive (transitiveClosure (pred_set.REL_RESTRICT R s)))

s.
    pred_set.INTER (pred_set.COMPL s) s = pred_set.EMPTY
    pred_set.UNION (pred_set.COMPL s) s = pred_set.UNIV

f x y. prim_rec.measure f x y f x < f y

P.
    while.OLEAST P =
    if (n. P n) then some (while.LEAST (λn. P n)) else none

s.
    ¬(s = pred_set.EMPTY) pred_set.FINITE s
    pred_set.MIN_SET s pred_set.MAX_SET s

f. combin.COMM f x y. f x y = f y x

R. prim_rec.wellfounded R ¬f. n. R (f (suc n)) (f n)

R. relation.symmetric R x y. R x y R y x

R. relation.total R x y. R x y R y x

R.
    relation.inv (relation.EQC R) = relation.EQC R
    relation.EQC (relation.inv R) = relation.EQC R

R.
    relation.inv (relation.SC R) = relation.SC R
    relation.SC (relation.inv R) = relation.SC R

R.
    relation.RC (transitiveClosure R) = relation.RTC R
    transitiveClosure (relation.RC R) = relation.RTC R

f e x. list.FOLDL f e (x :: []) = f e x

f e x. list.FOLDR f e (x :: []) = f x e

f x x1. pred_set.ITSET f x x1 = pred_set.ITSET_tupled f (x, x1)

P l1 l2. list.LIST_REL P l1 l2 length l1 = length l2

P. (x y. P x y) () (pair.UNCURRY (λx y. P x y))

P. (x y. P x y) () (pair.UNCURRY (λx y. P x y))

f xs ys. list.LIST_LIFT2 f xs ys = list.LIST_APPLY (map f xs) ys

f v. pred_set.GSPEC f v x. (v, ) = f x

(l. P l) P [] h t. P (h :: t)

(s. P s) (x. P (left x)) y. P (right y)

(l. P l) P [] h t. P (h :: t)

rich_list.COUNT_LIST 0 = []
  n. rich_list.COUNT_LIST (suc n) = list.SNOC n (rich_list.COUNT_LIST n)

(x. P x P' x) option.OPTION_ALL P opt option.OPTION_ALL P' opt

(x. P x Q x) all P l all Q l

(x. P x Q x) any P l any Q l

(x. bool.IN x s bool.IN (left x) t) pred_set.INJ left s t

(x. bool.IN x s bool.IN (right x) t) pred_set.INJ right s t

(x. bool.IN x (list.LIST_TO_SET ls) R x x) list.LIST_REL R ls ls

a b. combin.UPDATE a b = λf c. if a = c then b else f c

h t. last (h :: t) = if t = [] then h else last t

x l. bool.IN x (list.LIST_TO_SET l) list.FOLDL () (map ((=) x) l)

x l. bool.IN x (list.LIST_TO_SET l) list.FOLDR () (map ((=) x) l)

x P.
    pred_set.FINITE P
    pred_set.CARD (pred_set.CROSS (pred_set.INSERT x pred_set.EMPTY) P) =
    pred_set.CARD P

Q P. (x. P x Q) (x. P x) Q

p b. divides.prime p divides.divides p b gcd.is_gcd p b 1

r n. r < n (n + r) div n = 1

m n. m < suc n m = n m < n

h n. bit.BITS h 0 n = n mod arithmetic.BIT2 0 suc h

a b. ¬(a = b) ¬bit.BIT a (arithmetic.BIT2 0 b)

m n. m < suc n m = n m < n

b n. 1 < b numposrep.l2n b (numposrep.n2l b n) = n

n m. suc (suc m) n < suc (suc m) suc n

m n. min m n < max m n ¬(m = n)

m n. 0 < m m n divides.divides m (factorial n)

%%genvar%%927 b.
    0 < b b < %%genvar%%927 ¬divides.divides %%genvar%%927 b

m n. m = n m < n m < suc n

n l. n length l rich_list.BUTLASTN n (rich_list.LASTN n l) = []

m. prim_rec.PRE m = if m = 0 then 0 else select n. m = suc n

n. ¬(n = 1) p. divides.prime p divides.divides p n

l x.
    bool.IN x (list.LIST_TO_SET l) list.EL (indexedLists.findi x l) l = x

l x. rich_list.SEG 1 (length l) (list.SNOC x l) = x :: []

l n. n < length l last (list.DROP n l) = last l

l f.
    indexedLists.MAPi f l =
    list.GENLIST (Combinator.s f (flip list.EL l)) (length l)

l b. 0 < b numposrep.l2n b l < b length l

f l. map f l = list.FOLDL (λl' x. list.SNOC (f x) l') [] l

f l. map f l = list.FOLDR (λx l'. f x :: l') [] l

P l. all P l list.FOLDL (λl' x. l' P x) l

P l. all P l list.FOLDR (λx l'. P x l') l

P l. any P l list.FOLDL (λl' x. l' P x) l

P l. any P l list.FOLDR (λx l'. P x l') l

P ls. any ((¬) P) ls ¬P (head (list.dropWhile P ls))

s t. pred_set.PSUBSET s t pred_set.SUBSET s t ¬(s = t)

s1 s2.
    pred_set.PSUBSET s1 s2 pred_set.SUBSET s1 s2 ¬pred_set.SUBSET s2 s1

s.
    pred_set.FINITE s
    x. bool.IN x s bool.IN x (list.LIST_TO_SET (list.SET_TO_LIST s))

%%genvar%%7794.
    pred_set.FINITE %%genvar%%7794
    x.
      bool.IN x (list.LIST_TO_SET (list.SET_TO_LIST %%genvar%%7794))
      bool.IN x %%genvar%%7794

s.
    pred_set.FINITE s
    t. pred_set.PSUBSET t s pred_set.CARD t < pred_set.CARD s

s.
    pred_set.FINITE s
    t. pred_set.SUBSET t s pred_set.CARD t pred_set.CARD s

f s. pred_set.SUM_IMAGE f s = pred_set.ITSET (λe acc. f e + acc) s 0

s t.
    pred_set.FINITE t pred_set.SUBSET s t
    pred_set.SUM_SET s pred_set.SUM_SET t

R s.
    pred_set.FINITE s relation.StrongOrder (pred_set.REL_RESTRICT R s)
    wellFounded (pred_set.REL_RESTRICT R s)

(n. P n) P 0 n. P n P (suc n)

ind_type.FCONS a f n = if n = 0 then a else f (arithmetic.- n 1)

while.OWHILE G f s = if G s then while.OWHILE G f (f s) else some s

numpair.nlen 0 = 0
  numpair.nlen (numpair.ncons h t) = numpair.nlen t + 1

list.EL 0 = head list.EL (suc n) (l :: ls) = list.EL n ls

pred_set.INJ f s t pred_set.FINITE s
  pred_set.CARD (pred_set.IMAGE f s) = pred_set.CARD s

indexedLists.MAPi_ACC f n a l =
  reverse a @ indexedLists.MAPi (f (+) n) l

length reverse = length length (reverse f) = length f

bool.IN x (relation.RDOM (relation.RRESTRICT R s))
  bool.IN x (relation.RDOM R) bool.IN x s

¬(A B) (A ) ¬B

numpair.ncons x y = numpair.ncons h t x = h y = t

numpair.npair x1 y1 = numpair.npair x2 y2 x1 = x2 y1 = y2

(x, y) = (a, b) x = a y = b

(relation.antisymmetric R1 relation.antisymmetric (intersect R1 R2))
  (relation.antisymmetric R2 relation.antisymmetric (intersect R1 R2))

gcd.gcd 1 x = 1 gcd.gcd x 1 = 1

(option.OPTION_GUARD b = some () b)
  (option.OPTION_GUARD b = none ¬b)

(x y) (z w) x z y w

(x y) (z w) x z y w

(y x) (z w) (x z) y w

subrelation R1 R2 subrelation S1 S2
  subrelation (relation.O R1 S1) (relation.O R2 S2)

list.LIST_APPLY (list.LIST_APPLY (list.LIST_APPLY (() :: []) fs) gs)
    xs = list.LIST_APPLY fs (list.LIST_APPLY gs xs)

x y s.
    pred_set.INSERT x (pred_set.INSERT y s) =
    pred_set.INSERT y (pred_set.INSERT x s)

x y s.
    pred_set.DELETE (pred_set.DELETE s x) y =
    pred_set.DELETE (pred_set.DELETE s y) x

h l1 l2. last (l1 @ h :: l2) = last (h :: l2)

x s t.
    pred_set.SUBSET s (pred_set.INSERT x t)
    pred_set.SUBSET (pred_set.DELETE s x) t

x s t.
    pred_set.UNION (pred_set.INSERT x s) t =
    pred_set.INSERT x (pred_set.UNION s t)

x f m.
    prim_rec.PRIM_REC x f m = prim_rec.PRIM_REC_FUN x f m (prim_rec.PRE m)

x f.
    prim_rec.PRIM_REC_FUN x f =
    prim_rec.SIMP_REC (λp. x) (λfun n. f (fun (prim_rec.PRE n)) n)

x sos. pred_set.BIGUNION sos x s. bool.IN x s bool.IN s sos

x x1 x2. numpair.nlistrec x x1 x2 = numpair.nlistrec_tupled (x, x1, x2)

t1 t2 t3. t1 t2 t3 (t1 t2) t3

t1 t2 t3. t1 t2 t3 (t1 t2) t3

A B C. A B C A B C

n1 n2 x. n1 < n2 list.EL n1 (rich_list.REPLICATE n2 x) = x

m n p. m < n m + p < n + p

m n p. m n m * p n * p

x y z.
    arithmetic.ABS_DIFF x z
    arithmetic.ABS_DIFF x y + arithmetic.ABS_DIFF y z

m n p. m < arithmetic.- n p m + p < n

m n p. m arithmetic.- n p m + p n

m n p. arithmetic.- m n p m n + p

m n p. arithmetic.- m n > p m > n + p

a b c. arithmetic.- a (b + c) = arithmetic.- (arithmetic.- a b) c

m n p. m * (n * p) = m * n * p

m n p. m + (n + p) = m + n + p

z x y. x (y * z) = (x y) z

m n p. max m (max n p) = max (max m n) p

m n p. min m (min n p) = min (min m n) p

m n p. arithmetic.- (arithmetic.- m n) p = arithmetic.- m (n + p)

a b c. (a b) c = a (b * c)

n m i. i < arithmetic.- n m i + m < n

x z y. arithmetic.ABS_DIFF x (y + z) y + arithmetic.ABS_DIFF x z

m n p. m + n = m + p n = p

m n p. m + p = n + p m = n

m n p. m + p < n + p m < n

m n p. p + m < p + n m < n

m n p. m + n m + p n p

m n p. m + p n + p m n

m n p. n + m p + m n p

n m p. arithmetic.ABS_DIFF (n + p) (m + p) = arithmetic.ABS_DIFF n m

%%genvar%%500 b c.
    divides.divides %%genvar%%500 b divides.divides b c
    divides.divides %%genvar%%500 c

m n p. m < n n < p m < p

m n p. m < n n p m < p

m n p. m n n < p m < p

m n p. m n n p m p

m n p. m + p < n + p m < n

n m l. list.DROP n (list.DROP m l) = list.DROP (n + m) l

n. n length l1 list.TAKE n (l1 @ l2) = list.TAKE n l1

n.
    arithmetic.BIT2 0 * (n div arithmetic.BIT2 0) =
    arithmetic.- n (n mod arithmetic.BIT2 0)

n. 1 n = 1 n 1 = n

l1 x l2. l1 @ list.SNOC x l2 = list.SNOC x (l1 @ l2)

l1 x l2. list.SNOC x l1 @ l2 = l1 @ x :: l2

l m x.
    bool.IN x (list.LIST_TO_SET (list.DROP m l))
    bool.IN x (list.LIST_TO_SET l)

l m x.
    bool.IN x (list.LIST_TO_SET (list.TAKE m l))
    bool.IN x (list.LIST_TO_SET l)

l1 l2 l3. l1 @ l2 @ l3 = (l1 @ l2) @ l3

a b c. list.isPREFIX (a @ b) (a @ c) list.isPREFIX b c

x y z. list.isPREFIX y x list.isPREFIX z y list.isPREFIX z x

l. list.list_CASE l b f = if null l then b else f (head l) (tail l)

l. ¬(l = []) rich_list.LASTN 1 l = last l :: []

l. ¬(l = []) list.FRONT l @ last l :: [] = l

l. 0 < length l length (tail l) = arithmetic.- (length l) 1

f n x. arithmetic.FUNPOW f (suc n) x = f (arithmetic.FUNPOW f n x)

f a b. f a = b combin.UPDATE a b f = f

f b a. f a = b combin.UPDATE a b f = f

f s t. pred_set.BIJ f s t pred_set.BIJ (pred_set.LINV f s) t s

f g h. f (g h) = f g h

f g n. map f (list.GENLIST g n) = list.GENLIST (f g) n

f g. ∃!h. h left = f h right = g

s e s2.
    pred_set.SUBSET (pred_set.DELETE s e) s2
    pred_set.SUBSET s (pred_set.INSERT e s2)

P ls x.
    bool.IN x (list.LIST_TO_SET (list.dropWhile P ls))
    bool.IN x (list.LIST_TO_SET ls)

P l. all P l e. bool.IN e (list.LIST_TO_SET l) P e

P l. any P l e. bool.IN e (list.LIST_TO_SET l) P e

s1 s2 x.
    pred_set.SUBSET s1 s2
    pred_set.SUBSET (pred_set.DELETE s1 x) (pred_set.DELETE s2 x)

s t x.
    pred_set.DISJOINT (pred_set.DELETE s x) t
    pred_set.DISJOINT (pred_set.DELETE t x) s

s t x.
    pred_set.DIFF s (pred_set.INSERT x t) =
    pred_set.DIFF (pred_set.DELETE s x) t

s t x.
    pred_set.INTER (pred_set.DELETE s x) t =
    pred_set.DELETE (pred_set.INTER s t) x

f1 f2 l. filter f1 (filter f2 l) = filter f2 (filter f1 l)

x y z.
    pred_set.DIFF x (pred_set.UNION y z) =
    pred_set.DIFF (pred_set.DIFF x y) z

s t u.
    pred_set.INTER s (pred_set.INTER t u) =
    pred_set.INTER (pred_set.INTER s t) u

s t u.
    pred_set.UNION s (pred_set.UNION t u) =
    pred_set.UNION (pred_set.UNION s t) u

x y z.
    pred_set.DIFF (pred_set.DIFF x y) z =
    pred_set.DIFF (pred_set.DIFF x z) y

s t u.
    pred_set.DISJOINT s t pred_set.SUBSET u t pred_set.DISJOINT s u

s t u.
    pred_set.PSUBSET s t pred_set.PSUBSET t u pred_set.PSUBSET s u

s t u. pred_set.PSUBSET s t pred_set.SUBSET t u pred_set.PSUBSET s u

s t u. pred_set.SUBSET s t pred_set.PSUBSET t u pred_set.PSUBSET s u

s t u. pred_set.SUBSET s t pred_set.SUBSET t u pred_set.SUBSET s u

s t. s = t x. bool.IN x s bool.IN x t

s t. pred_set.SUBSET s t x. bool.IN x s bool.IN x t

s t.
    pred_set.SUBSET s t
    f. pred_set.SUBSET (pred_set.IMAGE f s) (pred_set.IMAGE f t)

P f l. all P (map f l) all (P f) l

s r x. poset.poset (s, r) s x r x x

f g l. map f (map g l) = map (f g) l

f g s. pred_set.IMAGE (f g) s = pred_set.IMAGE f (pred_set.IMAGE g s)

P n. all P (rich_list.COUNT_LIST n) m. m < n P m

R x y. wellFounded R R x y ¬(x = y)

R x. relation.WFP R x y. R y x relation.WFP R y

R x. (y. R y x relation.WFP R y) relation.WFP R x

R s t.
    pred_set.pairwise R t pred_set.SUBSET s t pred_set.pairwise R s

R l1 l2.
    list.LIST_REL R l1 l2 list.LIST_REL R (reverse l1) (reverse l2)

x x1 x2. list.MAP2 x x1 x2 = list.MAP2_tupled (x, x1, x2)

f v. bool.IN v (pred_set.GSPEC f) x. (v, ) = f x

injective f b. a. x. f x b x a

numpair.tri 0 = 0 n. numpair.tri (suc n) = suc n + numpair.tri n

(x. P x Q x) (x. P x) x. Q x

(x. P x Q x) (x. P x) x. Q x

t1 t2. (if then t1 else t2) = t1 (if then t1 else t2) = t2

x y.
    pred_set.CROSS (pred_set.INSERT x pred_set.EMPTY)
      (pred_set.INSERT y pred_set.EMPTY) =
    pred_set.INSERT (x, y) pred_set.EMPTY

x l.
    list.ALL_DISTINCT (list.SNOC x l)
    ¬bool.IN x (list.LIST_TO_SET l) list.ALL_DISTINCT l

x l. tail (list.SNOC x l) = if null l then [] else list.SNOC x (tail l)

e s.
    pred_set.POW (pred_set.INSERT e s) =
    pred_set.UNION (pred_set.IMAGE (pred_set.INSERT e) (pred_set.POW s))
      (pred_set.POW s)

t1 t2. (t1 t2) t1 t2 ¬t1 ¬t2

x y.
    (ind_type.NUMLEFT (ind_type.NUMSUM x y) x)
    ind_type.NUMRIGHT (ind_type.NUMSUM x y) = y

p b. divides.prime p divides.divides p b gcd.gcd p b = 1

b n. bit.BIT b n bit.SLICE b b n = arithmetic.BIT2 0 b

n m. arithmetic.- n m = if m < n then numeral.iSUB n m else 0

x y. 0 < x x y bit.LOG2 x bit.LOG2 y

n x. 0 < n (n + x) mod n = x mod n

%%genvar%%1168 x.
    0 < %%genvar%%1168
    (x + %%genvar%%1168) mod %%genvar%%1168 = x mod %%genvar%%1168

m n. 0 < n (m = prim_rec.PRE n suc m = n)

x y. 0 < y (x mod y = x x < y)

a b. a < b arithmetic.BIT2 0 a < arithmetic.BIT2 0 b

a b. a b arithmetic.BIT2 0 a arithmetic.BIT2 0 b

n m.
    pred_set.count (n + m) =
    pred_set.UNION (pred_set.count n)
      (pred_set.IMAGE ((+) n) (pred_set.count m))

m n. m < suc n ¬(m = n) m < n

m n. 0 < m * n 0 < m 0 < n

m n. 0 < m + n 0 < m 0 < n

m n. arithmetic.- m n = m m = 0 n = 0

n m. gcd.gcd n m = 0 n = 0 m = 0

m n. m * n = 0 m = 0 n = 0

m n. m + n = 0 m = 0 n = 0

n m. n m = 0 n = 0 0 < m

x y.
    ind_type.NUMFST (ind_type.NUMPAIR x y) = x
    ind_type.NUMSND (ind_type.NUMPAIR x y) = y

m n. 0 < m 0 < n 0 < m * n

m n. 0 < n n m arithmetic.- m n < m

a b. b a 0 < b 0 < a div b

b n. bit.BIT b (arithmetic.- (arithmetic.BIT2 0 n) 1) b < n

m n. divides.prime m divides.prime n divides.divides m n m = n

m n. ¬(m < n) ¬(m = n) n < m

n l. n < length l list.EL n (reverse l) = rich_list.ELL n l

n l. n < length l rich_list.ELL n (reverse l) = list.EL n l

n ls. n < length ls list.LUPDATE (list.EL n ls) n ls = ls

n l. n length l list.TAKE n l = rich_list.SEG n 0 l

b ls. 0 < b numposrep.l2n b (list.SNOC 0 ls) = numposrep.l2n b ls

n op a b. bit.BITWISE n op a b < arithmetic.BIT2 0 n

m. 0 < m n. prim_rec.PRE m < prim_rec.PRE n m < n

n. 0 < n m. prim_rec.PRE m prim_rec.PRE n m n

n. 0 < n k. k mod n mod n = k mod n

n. all P (list.GENLIST f n) i. i < n P (f i)

n. any P (list.GENLIST f n) i. i < n P (f i)

l x.
    rich_list.ELL (length l) (list.SNOC x l) = if null l then x else head l

l x. ¬(l = x :: l) ¬(x :: l = l)

l2 l1. ¬null l2 list.EL (length l1) (l1 @ l2) = head l2

l1 l2. ¬null l1 rich_list.ELL (length l2) (l1 @ l2) = last l1

x y. list.isPREFIX x y length x = length y x = y

l f. ¬null l map f (tail l) = tail (map f l)

l f. ¬(l = []) last (map f l) = f (last l)

ls. list.SUM ls = 0 x. bool.IN x (list.LIST_TO_SET ls) x = 0

P ls. any ((¬) P) ls length (filter P ls) < length ls

P g. f. x. f x = if P x then x else f (g x)

s t.
    pred_set.UNION s t = pred_set.EMPTY
    s = pred_set.EMPTY t = pred_set.EMPTY

s t.
    ¬pred_set.FINITE s pred_set.FINITE t
    ¬(pred_set.DIFF s t = pred_set.EMPTY)

f s. pred_set.PROD_IMAGE f s = pred_set.ITSET (λe acc. f e * acc) s 1

P f l. all P (map f l) all (λx. P (f x)) l

P f l. any P (map f l) any (λx. P (f x)) l

R x y. relation.RTC R x y n. arithmetic.NRC R n x y

R M x. relation.the_fun R M x = select f. relation.approx R M x f

P.
    pred_set.FINITE (pred_set.BIGUNION P)
    pred_set.FINITE P s. bool.IN s P pred_set.FINITE s

s.
    pred_set.countable s (x. bool.IN x s pred_set.countable x)
    pred_set.countable (pred_set.BIGUNION s)

P.
    pred_set.FINITE P (s. bool.IN s P pred_set.FINITE s)
    pred_set.FINITE (pred_set.BIGUNION P)

P. (s. P s) (x. P (left x)) y. P (right y)

P. (x. P (left x)) (y. P (right y)) s. P s

P. (∃!f. P f) ∃!p. P (λa. (fst p a, snd p a))

0 < n (arithmetic.MODEQ n m1 m2 m1 mod n = m2 mod n)

0 < n arithmetic.MODEQ n e0 e1 e0 mod n = e1 mod n

n m arithmetic.findq (a, m, n) * n a * m

1 < n 0 < n 1 mod n = 1

length [] = 0 h t. length (h :: t) = suc (length t)

pred_set.FINITE s pred_set.FINITE t
  pred_set.CARD (pred_set.UNION s t) pred_set.CARD s + pred_set.CARD t

bool.IN x (relation.RDOM (relation.RDOM_DELETE R k))
  bool.IN x (relation.RDOM R) ¬(x = k)

bool.IN x (relation.RDOM (union R1 R2))
  bool.IN x (relation.RDOM R1) bool.IN x (relation.RDOM R2)

option.some (λx. x = y) = some y option.some (λx. y = x) = some y

list.LIST_REL P (rich_list.REPLICATE n x) (rich_list.REPLICATE n y)
  n > 0 P x y

x y s. pred_set.INSERT y s x x = y bool.IN x s

x sos.
    bool.IN x (pred_set.BIGUNION sos) s. bool.IN x s bool.IN s sos

n a b. bit.MOD_2EXP_EQ n a b bit.MOD_2EXP n a = bit.MOD_2EXP n b

h l n. bit.BITS h l n < arithmetic.BIT2 0 arithmetic.- (suc h) l

h l n. bit.BITS h l (bit.SLICE h l n) = bit.BITS h l n

a m n. arithmetic.findq (a, m, n) = 0 a = 0

m n. n < m p. m = n + (p + 1)

n.
    list.EL n l =
    if n = 0 then head l else list.EL (prim_rec.PRE n) (tail l)

n. ¬(n mod arithmetic.BIT2 0 = 0) n mod arithmetic.BIT2 0 = 1

n. ¬(n mod arithmetic.BIT2 0 = 1) n mod arithmetic.BIT2 0 = 0

l1 x l2. list.EL (length l1) ((l1 @ x :: []) @ l2) = x

ls f. map f (list.ZIP (ls, ls)) = map (λx. f (x, x)) ls

f x l. map f (list.SNOC x l) = list.SNOC (f x) (map f l)

f x s.
    pred_set.IMAGE f (pred_set.INSERT x s) =
    pred_set.INSERT (f x) (pred_set.IMAGE f s)

f ls.
    pred_set.IMAGE (λn. f (list.EL n ls)) (pred_set.count (length ls)) =
    pred_set.IMAGE f (list.LIST_TO_SET ls)

f g l. map f (indexedLists.MAPi g l) = indexedLists.MAPi (() f g) l

f g p. pair.## f g p = (f (fst p), g (snd p))

A x y. relation.diag A x y x = y bool.IN x A

P x l. all P (list.SNOC x l) all P l P x

P x l. any P (list.SNOC x l) P x any P l

f n x. all f (rich_list.REPLICATE n x) n = 0 f x

P l. all (λx. ¬P x) l rich_list.SPLITP P l = (l, [])

s t x. pred_set.INTER s t x bool.IN x s bool.IN x t

s t x. pred_set.UNION s t x bool.IN x s bool.IN x t

s t. pred_set.DISJOINT s t ¬x. bool.IN x s bool.IN x t

P Q p. pair.PROD_ALL P Q p P (fst p) Q (snd p)

X P.
    pred_set.SUBSET X (pred_set.BIGINTER P)
    Y. bool.IN Y P pred_set.SUBSET X Y

X P.
    pred_set.SUBSET (pred_set.BIGUNION P) X
    Y. bool.IN Y P pred_set.SUBSET Y X

s.
    pred_set.FINITE s
    pred_set.CARD (pred_set.DIFF s t) =
    arithmetic.- (pred_set.CARD s) (pred_set.CARD (pred_set.INTER s t))

f x ls. bool.IN x (list.LIST_TO_SET ls) f x list.SUM (map f ls)

f. relation.INVOL f a b. f a = b a = f b

f. relation.INVOL f a b. f a = f b a = b

f n x. x < n list.EL x (list.GENLIST f n) = f x

P. P 0 (n. P n P (suc n)) n. P n

pl.
    length (fst (unzip pl)) = length pl
    length (snd (unzip pl)) = length pl

R x y. relation.RC R x y x = y R x y

R x y. relation.SC R x y R x y R y x

R. relation.equivalence R x y. R x y R x = R y

P.
    pred_set.BIGINTER P =
    pred_set.GSPEC (λx. (x, (s. bool.IN s P bool.IN x s)))

P.
    pred_set.BIGUNION P =
    pred_set.GSPEC (λx. (x, (s. bool.IN s P bool.IN x s)))

0 < n (k mod n = 0 d. k = d * n)

rich_list.COUNT_LIST 0 = []
  n. rich_list.COUNT_LIST (suc n) = 0 :: map suc (rich_list.COUNT_LIST n)

factorial 0 = 1 n. factorial (suc n) = suc n * factorial n

bool.IN x (list.LIST_TO_SET (list.GENLIST f n)) m. m < n x = f m

(t. ¬¬t t) (¬ ) (¬ )

y l. bool.IN y (list.LIST_TO_SET l) list.FOLDL (λl' x. l' y = x) l

y l. bool.IN y (list.LIST_TO_SET l) list.FOLDR (λx l'. y = x l') l

h t. list.FRONT (h :: t) = if t = [] then [] else h :: list.FRONT t

e f. fn. fn none = e x. fn (some x) = f x

c i r.
    ind_type.CONSTR c i r =
    ind_type.mk_rec (ind_type.ZCONSTR c i (λn. ind_type.dest_rec (r n)))

x1 y1 x2 y2. ind_type.NUMPAIR x1 y1 = ind_type.NUMPAIR x2 y2 x1 = x2

n m.
    arithmetic.ABS_DIFF n m =
    if n < m then arithmetic.- m n else arithmetic.- n m

a b. gcd.gcd a b = if a = 0 then b else gcd.gcd (b mod a) a

m n. ¬(m = n) suc m n suc n m

m n. bit.BIT 0 (m + n) ¬(bit.BIT 0 m bit.BIT 0 n)

m n. m * n = n m = 1 n = 0

n m. divides.divides (n * m) m m = 0 n = 1

x n.
    x < length (numposrep.num_to_bin_list n)
    list.EL x (numposrep.num_to_bin_list n) = bit.BITV n x

m n.
    arithmetic.FUNPOW f (m + n) x =
    arithmetic.FUNPOW f m (arithmetic.FUNPOW f n x)

h a. a < arithmetic.BIT2 0 suc h bit.BITS h 0 a = a

n d. 0 < n 1 < d n div d < n

m n. m < n ¬(n = suc m) suc m < n

m n. m < n ¬(suc m = n) suc m < n

b n. 1 < b n div b = 0 n < b

n l.
    n < length l
    rich_list.BUTLASTN n (list.FRONT l) =
    list.FRONT (rich_list.BUTLASTN n l)

n l.
    n < length l
    rich_list.BUTLASTN (suc n) l = rich_list.BUTLASTN n (list.FRONT l)

n l.
    n length l
    length (rich_list.BUTLASTN n l) = arithmetic.- (length l) n

m l.
    m length l
    list.DROP m (reverse l) = reverse (rich_list.BUTLASTN m l)

n l.
    n length l list.TAKE n (reverse l) = reverse (rich_list.LASTN n l)

n l.
    n length l
    rich_list.BUTLASTN n (reverse l) = reverse (list.DROP n l)

n l.
    n length l rich_list.LASTN n (reverse l) = reverse (list.TAKE n l)

n l. n length l rich_list.BUTLASTN n l @ rich_list.LASTN n l = l

n.
    pred_set.count n =
    if n = 0 then pred_set.EMPTY
    else
      bool.LET (λp. pred_set.INSERT p (pred_set.count p)) (prim_rec.PRE n)

l1 l2. rich_list.IS_SUBLIST l1 l2 l l'. l1 = l @ l2 @ l'

l1 l2.
    list.ALL_DISTINCT l1 length l1 = length l2
    list.ALL_DISTINCT (list.ZIP (l1, l2))

f R x. relation.RESTRICT f R x = λy. if R y x then f y else bool.ARB

P C Q. while.HOARE_SPEC P C Q s. P s Q (C s)

a b f. poset.function a b f x. a x b (f x)

s.
    ¬pred_set.FINITE s
    t. pred_set.FINITE t pred_set.SUBSET t s pred_set.PSUBSET t s

%%genvar%%11172.
    (n. %%genvar%%11172 n < %%genvar%%11172 (suc n))
    b. n. b < %%genvar%%11172 n

f e.
    combin.MONOID f e
    combin.ASSOC f combin.RIGHT_ID f e combin.LEFT_ID f e

R x y. transitiveClosure R x y n. arithmetic.NRC R (suc n) x y

R1 R2. subrelation R1 R2 x y. R1 x y R2 x y

R f x y. relation.inv_image R f x y R (f x) (f y)

pred_set.FINITE s
  list.SET_TO_LIST s =
  if s = pred_set.EMPTY then []
  else pred_set.CHOICE s :: list.SET_TO_LIST (pred_set.REST s)

indexedLists.fupdLast f l =
  if l = [] then [] else list.FRONT l @ f (last l) :: []

list.SUM [] = 0 h t. list.SUM (h :: t) = h + list.SUM t

concat [] = [] h t. concat (h :: t) = h @ concat t

reverse [] = [] x l. reverse (x :: l) = list.SNOC x (reverse l)

numpair.napp 0 nlist = nlist
  numpair.napp (numpair.ncons h t) nlist =
  numpair.ncons h (numpair.napp t nlist)

(a. ind_type.mk_rec (ind_type.dest_rec a) = a)
  r. ind_type.ZRECSPACE r ind_type.dest_rec (ind_type.mk_rec r) = r

(s t. pred_set.SUBSET s (pred_set.UNION s t))
  s t. pred_set.SUBSET s (pred_set.UNION t s)

(s t. pred_set.SUBSET (pred_set.INTER s t) s)
  s t. pred_set.SUBSET (pred_set.INTER t s) s

(numpair.tri n = 0 n = 0) (0 = numpair.tri n n = 0)

(list.LIST_TO_SET l = pred_set.EMPTY l = [])
  (pred_set.EMPTY = list.LIST_TO_SET l l = [])

(list.LIST_REL R [] x x = []) (list.LIST_REL R [] y y = [])

¬null l2 n = length l1 list.EL n (l1 @ l2) = head l2

(n.
     bit.LOWEST_SET_BIT (arithmetic.BIT2 n) =
     suc (bit.LOWEST_SET_BIT (suc n)))
  n. bit.LOWEST_SET_BIT (bit1 n) = 0

numpair.tri y n n < numpair.tri (y + 1) numpair.invtri n = y

x y s. bool.IN x (pred_set.INSERT y s) x = y bool.IN x s

x s t.
    pred_set.SUBSET (pred_set.INSERT x s) t
    bool.IN x t pred_set.SUBSET s t

x s. pred_set.INSERT x s = pred_set.GSPEC (λy. (y, y = x bool.IN y s))

A B C. (B C) A B A C A

A B C. B C A (B A) (C A)

m n p. m n suc p * m suc p * n

n a s. n < s ¬bit.BIT n (a * arithmetic.BIT2 0 s)

h l n.
    bit.BITS h l n =
    bit.MOD_2EXP (arithmetic.- (suc h) l) (bit.DIV_2EXP l n)

h l n.
    bit.SLICE h l n =
    arithmetic.- (bit.MOD_2EXP (suc h) n) (bit.MOD_2EXP l n)

m n p. p * arithmetic.- m n = arithmetic.- (p * m) (p * n)

m n p. p * (m + n) = p * m + p * n

p q n. n (p + q) = n p * n q

m n p. arithmetic.- m n * p = arithmetic.- (m * p) (n * p)

m n p. (m + n) * p = m * p + n * p

z x y. (x * y) z = x z * y z

h l n. n < arithmetic.BIT2 0 l bit.BITS h l n = 0

m n k. gcd.gcd (k * m) (k * n) = k * gcd.gcd m n

%%genvar%%763 b c.
    divides.divides %%genvar%%763 b divides.divides %%genvar%%763 c
    divides.divides %%genvar%%763 (arithmetic.- b c)

%%genvar%%562 b c.
    divides.divides %%genvar%%562 b divides.divides %%genvar%%562 c
    divides.divides %%genvar%%562 (b + c)

p m n. n * suc p = m * suc p n = m

m i n. suc n * m = suc n * i m = i

m i n. suc n * m < suc n * i m < i

a b c.
    divides.divides a b divides.divides a (b + c) divides.divides a c

n x l. x < n list.EL x (list.TAKE n l) = list.EL x l

n r. r < n q. (q * n + r) div n = q

n r. r < n q. (q * n + r) mod n = r

n m.
    rich_list.COUNT_LIST (n + m) =
    rich_list.COUNT_LIST n @ map (λn'. n' + n) (rich_list.COUNT_LIST m)

n f m. n < m list.EL n (map f (rich_list.COUNT_LIST m)) = f n

m f n. bit.BIT_MODIFY m f n = numeral_bit.BIT_MODF m f n 0 1 0

n. i. n < divides.PRIMES i j. j < i divides.PRIMES j n

n. 0 < n n div n = 1 n mod n = 0

xs h i. P h all P xs all P (list.LUPDATE h i xs)

l1 l2 e. list.FRONT (l1 @ e :: l2) = l1 @ list.FRONT (e :: l2)

a b c. list.isPREFIX a (b @ c) list.isPREFIX a b list.isPREFIX b a

l1 l2.
    pred_set.DIFF (list.LIST_TO_SET l2) (list.LIST_TO_SET l1) =
    list.LIST_TO_SET (filter (λx. ¬bool.IN x (list.LIST_TO_SET l1)) l2)

l P. all P l n. n < length l P (list.EL n l)

f l1 l2. map f (l1 @ l2) = map f l1 @ map f l2

f s t.
    pred_set.IMAGE f (pred_set.UNION s t) =
    pred_set.UNION (pred_set.IMAGE f s) (pred_set.IMAGE f t)

f s t.
    pred_set.SUBSET (pred_set.IMAGE f (pred_set.INTER s t))
      (pred_set.INTER (pred_set.IMAGE f s) (pred_set.IMAGE f t))

f s t.
    pred_set.INJ f s t pred_set.FINITE t
    pred_set.CARD s pred_set.CARD t

f.
    (s. pred_set.INJ f pred_set.EMPTY s)
    s. pred_set.INJ f s pred_set.EMPTY s = pred_set.EMPTY

f g z. sum.++ f g z = sum.sum_CASE z (left f) (right g)

s x y. pred_set.DELETE s y x bool.IN x s ¬(x = y)

P l1 l2. all P l1 list.dropWhile P (l1 @ l2) = list.dropWhile P l2

P l1 l2. all P (l1 @ l2) all P l1 all P l2

P l1 l2. any P (l1 @ l2) any P l1 any P l2

P L M. filter P (L @ M) = filter P L @ filter P M

P ls. null (filter P ls) x. bool.IN x (list.LIST_TO_SET ls) ¬P x

s t x. pred_set.DIFF s t x bool.IN x s ¬bool.IN x t

s t x. bool.IN x (pred_set.INTER s t) bool.IN x s bool.IN x t

s t x. bool.IN x (pred_set.UNION s t) bool.IN x s bool.IN x t

A B x.
    pred_set.DELETE (pred_set.UNION A B) x =
    pred_set.UNION (pred_set.DELETE A x) (pred_set.DELETE B x)

r s t.
    pred_set.SUBSET r s
    pred_set.DIFF r (pred_set.INTER s t) = pred_set.DIFF r t

s1 s2 s3.
    pred_set.SUBSET s1 (pred_set.DIFF s2 s3)
    pred_set.SUBSET s1 s2 pred_set.DISJOINT s1 s3

s t u.
    pred_set.SUBSET s (pred_set.INTER t u)
    pred_set.SUBSET s t pred_set.SUBSET s u

s t u.
    pred_set.DISJOINT (pred_set.UNION s t) u
    pred_set.DISJOINT s u pred_set.DISJOINT t u

s t u.
    pred_set.SUBSET (pred_set.UNION s t) u
    pred_set.SUBSET s u pred_set.SUBSET t u

s t u.
    pred_set.INTER s (pred_set.UNION t u) =
    pred_set.UNION (pred_set.INTER s t) (pred_set.INTER s u)

s t u.
    pred_set.UNION s (pred_set.INTER t u) =
    pred_set.INTER (pred_set.UNION s t) (pred_set.UNION s u)

s t.
    pred_set.INTER s t =
    pred_set.GSPEC (λx. (x, bool.IN x s bool.IN x t))

s t.
    pred_set.UNION s t =
    pred_set.GSPEC (λx. (x, bool.IN x s bool.IN x t))

s t. ¬(s = t) x. bool.IN x t ¬bool.IN x s

f1 f2 l. filter f1 (map f2 l) = map f2 (filter (f1 f2) l)

f s e. pred_set.FINITE s bool.IN e s f e pred_set.SUM_IMAGE f s

f e. combin.MONOID f e l. list.FOLDR f e l = list.FOLDL f e l

%%genvar%%1678 x y.
    relation.RTC %%genvar%%1678 x y
    x = y transitiveClosure %%genvar%%1678 x y

R a b. relation.STRORD R a b R a b ¬(a = b)

R.
    relation.WeakLinearOrder R relation.WeakOrder R x y. R x y R y x

f e l. list.FOLDL f e l = list.FOLDR (λx y. f y x) e (reverse l)

f e l. list.FOLDL f e (reverse l) = list.FOLDR (λx y. f y x) e l

f e l. list.FOLDR f e l = list.FOLDL (λx y. f y x) e (reverse l)

f e l. list.FOLDR f e (reverse l) = list.FOLDL (λx y. f y x) e l

arithmetic.NRC R n x y ls. list.LRC R ls x y length ls = n

arithmetic.NRC R (suc n) x y z. arithmetic.NRC R n x z R z y

(x. bit.MOD_2EXP x 0 = 0)
  %%genvar%%559 n.
    bit.MOD_2EXP %%genvar%%559 n = numeral_bit.iMOD_2EXP %%genvar%%559 n

(m2. option.OPTION_CHOICE none m2 = m2)
  x m2. option.OPTION_CHOICE (some x) m2 = some x

(P. option.OPTION_ALL P none )
  P x. option.OPTION_ALL P (some x) P x

(f. option.OPTION_BIND none f = none)
  x f. option.OPTION_BIND (some x) f = f x

x l. bool.IN x (list.LIST_TO_SET l) l1 l2. l = l1 @ x :: l2

b x.
    ind_type.NUMSUM b x =
    if b then suc (arithmetic.BIT2 0 * x) else arithmetic.BIT2 0 * x

m n l x. rich_list.SEG m (suc n) (x :: l) = rich_list.SEG m n l

n a.
    bit.MOD_2EXP_MAX n a
    bit.MOD_2EXP n a = arithmetic.- (arithmetic.BIT2 0 n) 1

m n.
    suc (arithmetic.- m n) =
    if m n then suc 0 else arithmetic.- (suc m) n

n m. numeral.exactlog n = bit1 m n = arithmetic.BIT2 0 (m + 1)

x n. x < arithmetic.BIT2 0 n x = 0 bit.LOG2 x < n

x y. 1 < x y 1 < x 0 < y

n m. n m = 1 n = 1 m = 0

n a. ¬(bit.BITS n n a = 0) bit.BITS n n a = 1

%%genvar%%1965 b.
    %%genvar%%1965 n < b n %%genvar%%1965 < b 0 < n

a b. a n b n a b n = 0

n a. ¬(bit.BITS n n a = 1) bit.BITS n n a = 0

p q. 1 < p 0 < q 1 < p * q

m n. 1 < m 0 < n suc n m * n

n a.
    numpair.tri (snd (numpair.invtri0 n a)) + fst (numpair.invtri0 n a) =
    n + numpair.tri a

n p.
    divides.PRIMES n < p p < divides.PRIMES (suc n) divides.prime p

n l. n < length l list.EL n l = head (rich_list.SEG 1 n l)

n l.
    n length l
    list.DROP n l = rich_list.LASTN (arithmetic.- (length l) n) l

n l.
    n length l
    list.TAKE n l = rich_list.BUTLASTN (arithmetic.- (length l) n) l

n l.
    n length l
    rich_list.BUTLASTN n l = list.TAKE (arithmetic.- (length l) n) l

n l.
    n length l
    rich_list.LASTN n l = list.DROP (arithmetic.- (length l) n) l

l i.
    i < length l
    length (indexedLists.delN i l) = arithmetic.- (length l) 1

l n.
    n < length l list.ALL_DISTINCT l
    indexedLists.findi (list.EL n l) l = n

l1 l2. length l1 = length l2 unzip (list.ZIP (l1, l2)) = (l1, l2)

f a b c. combin.UPDATE a c (combin.UPDATE a b f) = combin.UPDATE a c f

f b x y. f (if b then x else y) = if b then f x else f y

f g x y. pair.## f g (x, y) = (f x, g y)

f R y z. R y z relation.RESTRICT f R z y = f y

s x.
    bool.IN x s
    (pred_set.DELETE s x = pred_set.EMPTY
     s = pred_set.INSERT x pred_set.EMPTY)

P l.
    filter P l =
    list.FOLDL (λl' x. if P x then list.SNOC x l' else l') [] l

P l. filter P l = list.FOLDR (λx l'. if P x then x :: l' else l') [] l

P l.
    rich_list.PREFIX P l =
    list.FOLDR (λx l'. if P x then x :: l' else []) [] l

P l.
    rich_list.SUFFIX P l =
    list.FOLDL (λl' x. if P x then list.SNOC x l' else []) [] l

P1 P2 l. all P1 (filter P2 l) all (λx. P2 x P1 x) l

P Q l. filter P (filter Q l) = filter (λx. P x Q x) l

P Q. (x. P x) (x. P x Q x) Q ((select) P)

I' J.
    pred_set.FINITE I' pred_set.FINITE J pred_set.SUBSET I' J
    pred_set.MAX_SET I' pred_set.MAX_SET J

P. (n. (m. m < n P m) P n) n. P n

p q. p = q fst p = fst q snd p = snd q

%%genvar%%12113 s.
    pred_set.equiv_on %%genvar%%12113 s pred_set.FINITE s
    pred_set.CARD s =
    pred_set.SUM_IMAGE pred_set.CARD (pred_set.partition %%genvar%%12113 s)

R1 R2.
    pair.RPROD R1 R2 =
    pair.UNCURRY (λs t. pair.UNCURRY (λu v. R1 s u R2 t v))

R. wellFounded R M. ∃!f. x. f x = M (relation.RESTRICT f R x) x

x y.
    ind_type.mk_rec x = ind_type.mk_rec y
    ind_type.ZRECSPACE x ind_type.ZRECSPACE y x = y

p. poset.complete p c. (x. poset.lub p c x) x. poset.glb p c x

transitive = λR. x y z. R x y R y z R x z

ind_type.ZRECSPACE ind_type.ZBOT
  c i r.
    (n. ind_type.ZRECSPACE (r n))
    ind_type.ZRECSPACE (ind_type.ZCONSTR c i r)

pred_set.countable (pred_set.CROSS s t)
  s = pred_set.EMPTY t = pred_set.EMPTY
  pred_set.countable s pred_set.countable t

arithmetic.MODEQ n x0 x1 arithmetic.MODEQ n y0 y1
  arithmetic.MODEQ n (x0 * y0) (x1 * y1)

arithmetic.MODEQ n x0 x1 arithmetic.MODEQ n y0 y1
  arithmetic.MODEQ n (x0 + y0) (x1 + y1)

numpair.nmap f 0 = 0
  numpair.nmap f (numpair.ncons h t) =
  numpair.ncons (f h) (numpair.nmap f t)

list.LIST_BIND [] f = []
  list.LIST_BIND (h :: t) f = f h @ list.LIST_BIND t f

(n. bit.LOG2 (bit1 n) = numeral_bit.iLOG2 (numeral.iDUB n))
  n. bit.LOG2 (arithmetic.BIT2 n) = numeral_bit.iLOG2 (bit1 n)

list.LIST_REL (λa b. R a b) l1 (map f l2)
  list.LIST_REL (λa b. R a (f b)) l1 l2

list.LIST_REL R l1 l2 list.LIST_REL R l3 l4
  list.LIST_REL R (l1 @ l3) (l2 @ l4)

list.GENLIST ((+) a) n1 @ list.GENLIST ((+) (n1 + a)) n2 =
  list.GENLIST ((+) a) (n1 + n2)

bool.IN (x, y) (pred_set.GSPEC (pair.UNCURRY (λx y. ((x, y), P x y))))
  P x y

c n s.
    list.PAD_LEFT c n s =
    list.GENLIST (const c) (arithmetic.- n (length s)) @ s

c n s.
    list.PAD_RIGHT c n s =
    s @ list.GENLIST (const c) (arithmetic.- n (length s))

x f n. ∃!y. g. prim_rec.SIMP_REC_REL g x f (suc n) y = g n

x s t.
    pred_set.DISJOINT t (pred_set.INSERT x s)
    pred_set.DISJOINT t s ¬bool.IN x t

x s t.
    pred_set.SUBSET s (pred_set.DELETE t x)
    ¬bool.IN x s pred_set.SUBSET s t

x s t.
    pred_set.DISJOINT (pred_set.INSERT x s) t
    pred_set.DISJOINT s t ¬bool.IN x t

x s.
    ¬bool.IN x s
    t. pred_set.SUBSET s (pred_set.INSERT x t) pred_set.SUBSET s t

b m n. bit.SBIT b n * arithmetic.BIT2 0 m = bit.SBIT b (n + m)

c i r.
    ind_type.ZCONSTR c i r =
    ind_type.INJP (ind_type.INJN (suc c))
      (ind_type.INJP (ind_type.INJA i) (ind_type.INJF r))

n h l. bit.SLICE h l n = bit.BITS h l n * arithmetic.BIT2 0 l

n i a. bit.BIT i (a div arithmetic.BIT2 0 n) bit.BIT (i + n) a

x y z.
    arithmetic.MODEQ n x y arithmetic.MODEQ n y z
    arithmetic.MODEQ n x z

n a s. bit.BIT (n + s) (a * arithmetic.BIT2 0 s) bit.BIT n a

n k l. n + k length l length (rich_list.SEG n k l) = n

n l1 l2. n < length l1 list.EL n (l1 @ l2) = list.EL n l1

n l. n < length l x. list.EL n (list.SNOC x l) = list.EL n l

n l. n < length l x. rich_list.ELL n (x :: l) = rich_list.ELL n l

n l2.
    n < length l2 l1. rich_list.ELL n (l1 @ l2) = rich_list.ELL n l2

n l. n length l x. list.TAKE n (list.SNOC x l) = list.TAKE n l

n l. n length l x. rich_list.LASTN n (x :: l) = rich_list.LASTN n l

n l1. n length l1 l2. list.TAKE n (l1 @ l2) = list.TAKE n l1

n l2.
    n length l2 l1. rich_list.LASTN n (l1 @ l2) = rich_list.LASTN n l2

m l. m length l P. any P (list.DROP m l) any P l

m l. m length l P. any P (list.TAKE m l) any P l

m l. m length l P. any P (rich_list.BUTLASTN m l) any P l

m l. m length l P. any P (rich_list.LASTN m l) any P l

n. 0 < n x l. list.EL n (x :: l) = list.EL (prim_rec.PRE n) l

n.
    0 < n
    x l.
      rich_list.ELL n (list.SNOC x l) = rich_list.ELL (prim_rec.PRE n) l

n.
    ¬(n = 0)
    rich_list.COUNT_LIST n =
    0 :: map suc (rich_list.COUNT_LIST (arithmetic.- n 1))

l e y.
    bool.IN y (list.LIST_TO_SET (list.FRONT (e :: l)))
    bool.IN y (list.LIST_TO_SET (e :: l))

ls f. all (λx. y. x = f y) ls l. ls = map f l

f x s.
    ¬bool.IN x s
    pred_set.IMAGE f (pred_set.DELETE s x) = pred_set.IMAGE f s

f ls a. list.FOLDR (λx y. f x :: y) a ls = map f ls @ a

f s t. pred_set.BIJ f s t pred_set.INJ f s t pred_set.SURJ f s t

%%genvar%%2627 s t.
    pred_set.FINITE t pred_set.CARD t < pred_set.CARD s
    ¬pred_set.INJ %%genvar%%2627 s t

s x y. bool.IN x (pred_set.DELETE s y) bool.IN x s ¬(x = y)

s x. bool.IN x s t. s = pred_set.INSERT x t ¬bool.IN x t

P L x.
    bool.IN x (list.LIST_TO_SET (filter P L))
    P x bool.IN x (list.LIST_TO_SET L)

P l. all P l m. m length l all P (list.DROP m l)

P l. all P l m. m length l all P (list.TAKE m l)

P l. all P l m. m length l all P (rich_list.BUTLASTN m l)

P l. all P l m. m length l all P (rich_list.LASTN m l)

P l. ¬(filter P l = []) e. bool.IN e (list.LIST_TO_SET l) P e

P g x. while.WHILE P g x = if P x then while.WHILE P g (g x) else x

s t x. bool.IN x (pred_set.DIFF s t) bool.IN x s ¬bool.IN x t

s t.
    pred_set.PSUBSET s t
    x. ¬bool.IN x s pred_set.SUBSET (pred_set.INSERT x s) t

s t.
    pred_set.DIFF s t =
    pred_set.GSPEC (λx. (x, bool.IN x s ¬bool.IN x t))

P Q x. pred_set.CROSS P Q x bool.IN (fst x) P bool.IN (snd x) Q

s.
    pred_set.FINITE s
    f a. pred_set.ITSET f s a = list.FOLDL (flip f) a (list.SET_TO_LIST s)

s. s = pred_set.EMPTY x t. s = pred_set.INSERT x t ¬bool.IN x t

s.
    pred_set.FINITE s ¬(s = pred_set.EMPTY)
    pred_set.CARD (pred_set.REST s) = arithmetic.- (pred_set.CARD s) 1

f s t.
    pred_set.FINITE s pred_set.SUBSET t s
    pred_set.SUM_IMAGE f t pred_set.SUM_IMAGE f s

R x y. relation.RTC R x y relation.RC R x y transitiveClosure R x y

R. relation.antisymmetric R x y. R x y R y x x = y

R. relation.trichotomous R a b. R a b R b a a = b

R. relation.WeakOrder R y z. y = z R y z R z y

n < suc m n = 0 n0. n = suc n0 n0 < m

transitiveClosure R x z R x z y. R x y transitiveClosure R y z

transitiveClosure R x z R x z y. transitiveClosure R x y R y z

(n. bit.DIV_2EXP n 0 = 0)
  n x. bit.DIV_2EXP n x = numeral_bit.SFUNPOW numeral_bit.iDIV2 n x

(n. bit.TIMES_2EXP n 0 = 0)
  n x. bit.TIMES_2EXP n x = numeral_bit.SFUNPOW numeral.iDUB n x

(x. option.OPTION_APPLY none x = none)
  f x. option.OPTION_APPLY (some f) x = map f x

(f. basicSize.option_size f none = 0)
  f x. basicSize.option_size f (some x) = suc (f x)

pred_set.SUBSET
    (pred_set.BIGUNION (pred_set.IMAGE f (list.LIST_TO_SET ls))) s
  x. bool.IN x (list.LIST_TO_SET ls) pred_set.SUBSET (f x) s

(m. m < n f1 m = f2 m) list.GENLIST f1 n = list.GENLIST f2 n

(f x. map f (some x) = some (f x)) f. map f none = none

bool.IN (a, b) (pred_set.GSPEC (λx. ((x, x), P x))) P a a = b

bool.IN (a, b) (pred_set.GSPEC (λy. ((y, x), P y))) P a b = x

bool.IN (a, b) (pred_set.GSPEC (λy. ((x, y), P y))) P b a = x

h1 h2. ¬(h1 = h2) l1 l2. ¬(h1 :: l1 = h2 :: l2)

x1 l1 x2 l2. list.SNOC x1 l1 = list.SNOC x2 l2 length l1 = length l2

x ls.
    list.LIST_TO_SET ls = pred_set.INSERT x pred_set.EMPTY
    ¬(ls = []) all ((=) x) ls

e f. ∃!fn1. fn1 0 = e n. fn1 (suc n) = f (fn1 n) n

e f. fn. fn 0 = e n. fn (suc n) = f n (fn n)

y s f. pred_set.IMAGE f s y x. y = f x bool.IN x s

h l x n. h < l + x ¬bit.BIT x (bit.BITS h l n)

a b c d. gcd.is_gcd a b c gcd.is_gcd a b d c = d

x y.
    ind_type.NUMPAIR x y =
    arithmetic.BIT2 0 x * (arithmetic.BIT2 0 * y + 1)

n a. numeral.texp_help n a = (a + 1) * arithmetic.BIT2 0 (n + 1)

x y. x * y = 1 x = 1 y = 1

n l.
    n < length l
    list.EL n l =
    rich_list.ELL (prim_rec.PRE (arithmetic.- (length l) n)) l

n l.
    n < length l
    rich_list.ELL n l =
    list.EL (prim_rec.PRE (arithmetic.- (length l) n)) l

n l.
    n length l
    list.DROP n l = rich_list.SEG (arithmetic.- (length l) n) n l

n l.
    n length l
    rich_list.BUTLASTN n l = rich_list.SEG (arithmetic.- (length l) n) 0 l

n l.
    n length l
    rich_list.LASTN n l = rich_list.SEG n (arithmetic.- (length l) n) l

n l. n length l 0 < n last (rich_list.LASTN n l) = last l

b ls.
    0 < b
    numposrep.l2n b (reverse (list.dropWhile ((=) 0) (reverse ls))) =
    numposrep.l2n b ls

l1 l2. ¬(l1 = l2) h1 h2. ¬(h1 :: l1 = h2 :: l2)

l.
    list.ALL_DISTINCT l
    x. bool.IN x (list.LIST_TO_SET l) filter ((=) x) l = x :: []

f a b c. combin.UPDATE a b f c = if a = c then b else f c

f a b c. combin.UPDATE a b f = combin.UPDATE a c f b = c

f s t.
    pred_set.INJ f s t s = pred_set.EMPTY f'. pred_set.SURJ f' t s

P Q. (x. P x Q x) l. all P l all Q l

P Q.
    pred_set.FINITE P pred_set.FINITE Q
    pred_set.CARD (pred_set.CROSS P Q) = pred_set.CARD P * pred_set.CARD Q

A B.
    pred_set.FINITE A pred_set.FINITE B
    pred_set.MAX_SET (pred_set.UNION A B) =
    max (pred_set.MAX_SET A) (pred_set.MAX_SET B)

P. (n. P n) n. P n m. m < n ¬P m

P. P 0 (h t. P t P (numpair.ncons h t)) n. P n

P. P [] (l. P l a. P (a :: l)) l. P l

P. P [] (l. P l x. P (list.SNOC x l)) l. P l

R x y z. R x y relation.RTC R y z transitiveClosure R x z

R x z. transitiveClosure R x z z1. R x z1 relation.RTC R z1 z

R P. wellFounded R (x y. P x y R x y) wellFounded P

f e x l. list.FOLDR f e (list.SNOC x l) = list.FOLDR f (f x e) l

R l1 l2 n.
    list.LIST_REL R l1 l2
    list.LIST_REL R (list.DROP n l1) (list.DROP n l2)

P xs ys n.
    list.LIST_REL P xs ys
    list.LIST_REL P (list.TAKE n xs) (list.TAKE n ys)

R s x y. relation.RRESTRICT R s x y R x y bool.IN x s

R1 R2 x y. intersect R1 R2 x y R1 x y R2 x y

R1 R2 x y. union R1 R2 x y R1 x y R2 x y

f e x l. list.FOLDL f e (list.SNOC x l) = f (list.FOLDL f e l) x

f1 f2.
    ind_type.INJP f1 f2 =
    λn a.
      if ind_type.NUMLEFT n then f1 (ind_type.NUMRIGHT n) a
      else f2 (ind_type.NUMRIGHT n) a

(<) = λm n. P. (n. P (suc n) P n) P m ¬P n

pred_set.SUBSET s t
  pred_set.UNION s (pred_set.DIFF t s) = t
  pred_set.UNION (pred_set.DIFF t s) s = t

reverse [] = [] h t. reverse (h :: t) = reverse t @ h :: []

ind_type.ISO f f' ind_type.ISO g g'
  ind_type.ISO (λh a'. g (h (f' a'))) (λh a. g' (h (f a)))

0 < m 0 < n m gcd.lcm m n m gcd.lcm n m

(t1 t2. (if then t1 else t2) = t1)
  t1 t2. (if then t1 else t2) = t2

(indexedLists.fupdLast f x = [] x = [])
  ([] = indexedLists.fupdLast f x x = [])

(map f x = none x = none) (none = map f x x = none)

(pred_set.INTER A B = A pred_set.SUBSET A B)
  (pred_set.INTER A B = B pred_set.SUBSET B A)

(a c. ¬(d = (a @ b :: []) @ c)) ¬bool.IN b (list.LIST_TO_SET d)

y x l.
    bool.IN y (list.LIST_TO_SET (list.SNOC x l))
    y = x bool.IN y (list.LIST_TO_SET l)

x y z.
    list.isPREFIX z (list.SNOC x y) list.isPREFIX z y z = list.SNOC x y

x L.
    bool.IN x (list.LIST_TO_SET (concat L))
    l. bool.IN l (list.LIST_TO_SET L) bool.IN x (list.LIST_TO_SET l)

m.
    num.IS_NUM_REP m
    P. P num.ZERO_REP (n. P n P (num.SUC_REP n)) P m

r x y. 0 < r x y logroot.ROOT r x logroot.ROOT r y

a b r. 0 < r (a < b a r < b r)

a b r. 0 < r (a b a r b r)

x y z. 0 < z (x y div z x * z y)

x y z. 0 < z (y div z < x y < x * z)

m n p. n p (m + n = p m = arithmetic.- p n)

m n p. m arithmetic.- n p m + p n m 0

m n p. m > arithmetic.- n p m + p > n m > 0

m n p. arithmetic.- m n < p m < n + p 0 < p

m n p. arithmetic.- m n p m n + p 0 p

m n p. m * n = m * p m = 0 n = p

m n p. n * m = p * m m = 0 n = p

%%genvar%%2041 b2 x.
    %%genvar%%2041 x = b2 x x = 0 %%genvar%%2041 = b2

m n p. arithmetic.- n m < arithmetic.- p m n < p m < p

z y x. arithmetic.- x y < arithmetic.- x z z < y z < x

m n p. m * n < m * p 0 < m n < p

m n p. m * n < p * n 0 < n m < p

m n p. arithmetic.- n m arithmetic.- p m n m n p

z y x. arithmetic.- x y arithmetic.- x z z y x y

m n p. m * n m * p m = 0 n p

m n p. m * n p * n n = 0 m p

n x y. 0 < n x y x div n y div n

n m b. 0 < b m n b m b n

a b c. a b gcd.is_gcd a (arithmetic.- b a) c gcd.is_gcd a b c

a b c. b a gcd.is_gcd (arithmetic.- a b) b c gcd.is_gcd a b c

n m l. list.TAKE (n + m) l = list.TAKE n l @ list.TAKE m (list.DROP n l)

i n op a b. n i ¬bit.BIT i (bit.BITWISE n op a b)

m p. m p n. arithmetic.- p m n p m + n

c b. c b a. arithmetic.- (a + b) c = a + arithmetic.- b c

a b. a b p. arithmetic.BIT2 0 b = p * arithmetic.BIT2 0 a

a b. b a c. arithmetic.- a b < c a < b + c

b c.
    c b a. arithmetic.- a (arithmetic.- b c) = arithmetic.- (a + c) b

n m. (i. i n ¬bit.BIT i m) bit.BITS n 0 m = 0

n l f. n < length l rich_list.ELL n (map f l) = f (rich_list.ELL n l)

n l. n < length l f. list.EL n (map f l) = f (list.EL n l)

n P. (m. m < n ¬P m) P n while.LEAST P = n

n. 0 < n q r. (q * n + r) mod n = r mod n

n.
    ¬(n = 0)
    bit.LOWEST_SET_BIT n =
    if odd n then 0 else 1 + bit.LOWEST_SET_BIT (arithmetic.DIV2 n)

l x. bool.IN x (list.LIST_TO_SET l) n. n < length l x = list.EL n l

l l1 l2.
    list.isPREFIX l1 l list.isPREFIX l2 l
    list.isPREFIX l1 l2 list.isPREFIX l2 l1

l1 l2.
    list.nub (l1 @ l2) =
    list.nub (filter (λx. ¬bool.IN x (list.LIST_TO_SET l2)) l1) @
    list.nub l2

P l. ¬(filter P l = l) e. bool.IN e (list.LIST_TO_SET l) ¬P e

s t.
    ¬pred_set.FINITE s pred_set.FINITE t x. bool.IN x s ¬bool.IN x t

P Q x.
    pred_set.CROSS (pred_set.INSERT x P) Q =
    pred_set.UNION (pred_set.CROSS (pred_set.INSERT x pred_set.EMPTY) Q)
      (pred_set.CROSS P Q)

P Q x.
    pred_set.CROSS P (pred_set.INSERT x Q) =
    pred_set.UNION (pred_set.CROSS P (pred_set.INSERT x pred_set.EMPTY))
      (pred_set.CROSS P Q)

P Q x.
    bool.IN x (pred_set.CROSS P Q) bool.IN (fst x) P bool.IN (snd x) Q

P Q.
    pred_set.CROSS P Q =
    pred_set.GSPEC (λp. (p, bool.IN (fst p) P bool.IN (snd p) Q))

P m n. P m P n P (min m n) P (max m n)

p. (n. p n) p (while.LEAST p) n. n < while.LEAST p ¬p n

p. (n. p n) p (while.LEAST p) n. n < while.LEAST p ¬p n

f l e.
    combin.ASSOC f combin.COMM f list.FOLDL f e l = list.FOLDR f e l

P. (n. P (suc n) n) n. 0 < n P n (arithmetic.- n 1)

f.
    indexedLists.FOLDRi f a (l1 @ l2) =
    indexedLists.FOLDRi f (indexedLists.FOLDRi (f (+) (length l1)) a l2)
      l1

P (prim_rec.PRE n) m. (n = 0 P 0) (n = suc m P m)

n = length l1
  list.ZIP (l1, rich_list.COUNT_LIST n) =
  list.GENLIST (λn. (list.EL n l1, n)) (length l1)

(x. pred_set.pair_to_num (pred_set.num_to_pair x) = x)
  x y. pred_set.num_to_pair (pred_set.pair_to_num (x, y)) = (x, y)

(n. 0 + n = n) m n. suc m + n = suc (m + n)

(f. numeral_bit.FDUB f 0 = 0)
  f n. numeral_bit.FDUB f (suc n) = f (f (suc n))

map f l = x :: [] x0. l = x0 :: [] x = f x0

list.LIST_REL P (list.GENLIST f l) (list.GENLIST g l)
  i. i < l P (f i) (g i)

map snd (filter (pair.UNCURRY (λx y. ¬(y = z))) ls) =
  filter (λy. ¬(z = y)) (map snd ls)

x n l f. map f (list.LUPDATE x n l) = list.LUPDATE (f x) n (map f l)

x f' n.
    g.
      prim_rec.SIMP_REC_REL g x f' (suc n) prim_rec.SIMP_REC x f' n = g n

y s f. bool.IN y (pred_set.IMAGE f s) x. y = f x bool.IN x s

x n.
    bit.DIVMOD_2EXP x n =
    (n div arithmetic.BIT2 0 x, n mod arithmetic.BIT2 0 x)

m n. 0 < m 0 < n (prim_rec.PRE m = prim_rec.PRE n m = n)

%%genvar%%12404 n.
    0 < n n %%genvar%%12404
    arithmetic.- %%genvar%%12404 n mod n = %%genvar%%12404 mod n

m n.
    n div arithmetic.BIT2 0 < arithmetic.BIT2 0 m
    n < arithmetic.BIT2 0 suc m

n l. n < length l list.DROP n l = list.EL n l :: list.DROP (suc n) l

n l.
    n < length l
    list.EL n (reverse l) =
    list.EL (prim_rec.PRE (arithmetic.- (length l) n)) l

n l.
    n < length l
    rich_list.ELL n (reverse l) =
    rich_list.ELL (prim_rec.PRE (arithmetic.- (length l) n)) l

n l.
    n < length l
    list.SNOC (list.EL n l) (list.TAKE n l) = list.TAKE (suc n) l

ls n.
    n length ls
    reverse (list.DROP n ls) =
    reverse (rich_list.LASTN (arithmetic.- (length ls) n) ls)

l1 l2.
    list.ALL_DISTINCT (list.ZIP (l1, l2)) length l1 = length l2
    list.ALL_DISTINCT (list.ZIP (l2, l1))

P Q l. all (λx. P x Q x) l all P l all Q l

P Q l. any (λx. P x Q x) l any P l any Q l

s.
    pred_set.FINITE s
    x.
      pred_set.CARD (pred_set.INSERT x s) =
      if bool.IN x s then pred_set.CARD s else suc (pred_set.CARD s)

s.
    pred_set.FINITE s
    (pred_set.SUM_IMAGE f s = 0 x. bool.IN x s f x = 0)

s.
    pred_set.FINITE s
    arithmetic.ABS_DIFF (pred_set.SUM_IMAGE f s) (pred_set.SUM_IMAGE g s)
    pred_set.SUM_IMAGE (λx. arithmetic.ABS_DIFF (f x) (g x)) s

f. combin.ASSOC f x y z. f x (f y z) = f (f x y) z

f. combin.ASSOC f x y z. f (f x y) z = f x (f y z)

R x y z. relation.EQC R x y relation.EQC R y z relation.EQC R x z

R x y. relation.RTC R x y u. relation.RTC R x u relation.RTC R u y

R x y. relation.RTC R x y z. relation.RTC R y z relation.RTC R x z

R P M.
    wellFounded R relation.INDUCTIVE_INVARIANT R P M
    x. P x (relation.WFREC R M x)

R. transitive R x y z. R x y R y z R x z

f e l1 l2.
    list.FOLDL f e (l1 @ l2) = list.FOLDL f (list.FOLDL f e l1) l2

f e l1 l2.
    list.FOLDR f e (l1 @ l2) = list.FOLDR f (list.FOLDR f e l2) l1

f g a l.
    list.FOLDR f a (indexedLists.MAPi g l) =
    indexedLists.FOLDRi (() f g) a l

R x u v. relation.RDOM_DELETE R x u v R u v ¬(u = x)

f a l.
    numpair.nfoldl f a l =
    numpair.nlistrec (λa. a) (λn t r a. r (f n a)) l a

x x1 x2 x3. list.FOLDL2 x x1 x2 x3 = list.FOLDL2_tupled (x, x1, x2, x3)

Q (option.some P) (x. P x Q (some x)) (x. ¬P x) Q none

arithmetic.DIV2 0 = 0 (n. arithmetic.DIV2 (bit1 n) = n)
  n. arithmetic.DIV2 (arithmetic.BIT2 n) = suc n

pred_set.MAX_SET pred_set.EMPTY = 0
  e s.
    pred_set.FINITE s
    pred_set.MAX_SET (pred_set.INSERT e s) = max e (pred_set.MAX_SET s)

divides.PRIMES 0 = arithmetic.BIT2 0
  n.
    divides.PRIMES (suc n) =
    while.LEAST (λp. divides.prime p divides.PRIMES n < p)

numpair.nfoldl f a 0 = a
  numpair.nfoldl f a (numpair.ncons h t) = numpair.nfoldl f (f h a) t

(x y. R x y Q x y) relation.RC R x y relation.RC Q x y

(x y. R x y Q x y) relation.RTC R x y relation.RTC Q x y

(x y. R x y Q x y) relation.SC R x y relation.SC Q x y

(x y. R x y Q x y) transitiveClosure R x y transitiveClosure Q x y

(x y. R x y R' x y) relation.EQC R x y relation.EQC R' x y

(x y. R1 x y R2 x y) list.LLEX R1 x y list.LLEX R2 x y

(x y. P x y Q x y) option.OPTREL P x y option.OPTREL Q x y

(x y. R1 x y R2 x y) list.LIST_REL R1 l1 l2 list.LIST_REL R2 l1 l2

(x. P x Q (some x)) ((x. ¬P x) Q none) Q (option.some P)

e l1 l2.
    bool.IN e (list.LIST_TO_SET (l1 @ l2))
    bool.IN e (list.LIST_TO_SET l1) bool.IN e (list.LIST_TO_SET l2)

e a b. 1 < e (a < b e a < e b)

e a b. 1 < e (a b e a e b)

m n p.
    arithmetic.- m (arithmetic.- n p) =
    if n p then m else arithmetic.- (m + p) n

m n p.
    m + arithmetic.- n p = if n p then m else arithmetic.- (m + n) p

m n p.
    arithmetic.- m n + p = if m n then p else arithmetic.- (m + p) n

m n k. gcd.gcd m k = 1 gcd.gcd m (k * n) = gcd.gcd m n

p a b.
    divides.prime p divides.divides p (a * b)
    divides.divides p a divides.divides p b

a b c. gcd.gcd a b = 1 divides.divides b (a * c) divides.divides b c

m n l. m + n = length l list.TAKE n l @ rich_list.LASTN m l = l

m n l. m + n = length l rich_list.BUTLASTN m l @ list.DROP n l = l

r n. 0 < r rt. rt r n n < suc rt r

m l x.
    m length l rich_list.SEG m 0 (list.SNOC x l) = rich_list.SEG m 0 l

n l1 l2.
    n length l2
    rich_list.BUTLASTN n (l1 @ l2) = l1 @ rich_list.BUTLASTN n l2

n l1 l2.
    list.DROP n (l1 @ l2) =
    list.DROP n l1 @ list.DROP (arithmetic.- n (length l1)) l2

n l1 l2.
    list.TAKE n (l1 @ l2) =
    list.TAKE n l1 @ list.TAKE (arithmetic.- n (length l1)) l2

n l.
    n length l
    x. list.DROP n (list.SNOC x l) = list.SNOC x (list.DROP n l)

n l.
    n length l
    x. rich_list.BUTLASTN n (x :: l) = x :: rich_list.BUTLASTN n l

m l.
    m length l
    x.
      bool.IN x (list.LIST_TO_SET (list.DROP m l))
      bool.IN x (list.LIST_TO_SET l)

m l.
    m length l
    x.
      bool.IN x (list.LIST_TO_SET (list.TAKE m l))
      bool.IN x (list.LIST_TO_SET l)

m l.
    m length l
    x.
      bool.IN x (list.LIST_TO_SET (rich_list.BUTLASTN m l))
      bool.IN x (list.LIST_TO_SET l)

m l.
    m length l
    x.
      bool.IN x (list.LIST_TO_SET (rich_list.LASTN m l))
      bool.IN x (list.LIST_TO_SET l)

n l1. n length l1 l2. list.DROP n (l1 @ l2) = list.DROP n l1 @ l2

n l.
    n length l
    f. rich_list.BUTLASTN n (map f l) = map f (rich_list.BUTLASTN n l)

n l.
    n length l
    f. rich_list.LASTN n (map f l) = map f (rich_list.LASTN n l)

n.
    logroot.SQRTd n =
    (logroot.ROOT (arithmetic.BIT2 0) n,
     arithmetic.- n
       (logroot.ROOT (arithmetic.BIT2 0) n *
        logroot.ROOT (arithmetic.BIT2 0) n))

n.
    length l1 < n
    list.TAKE n (l1 @ l2) = l1 @ list.TAKE (arithmetic.- n (length l1)) l2

%%genvar%%1877.
    1 < %%genvar%%1877
    n m. %%genvar%%1877 n = %%genvar%%1877 m n = m

%%genvar%%1858.
    1 < %%genvar%%1858
    n m. %%genvar%%1858 m < %%genvar%%1858 n m < n

b. 1 < b n m. b m b n m n

f g. h. (x. h (left x) = f x) y. h (right y) = g y

f g z.
    sum.++ f g z =
    if isLeft z then left (f (destLeft z)) else right (g (destRight z))

s t.
    pred_set.PSUBSET s t
    pred_set.SUBSET s t x. bool.IN x t ¬bool.IN x s

S.
    pred_set.FINITE S
    t f.
      pred_set.BIJ f S t pred_set.FINITE t
      pred_set.CARD S = pred_set.CARD t

f.
    combin.COMM f combin.ASSOC f
    e l. list.FOLDL f e (reverse l) = list.FOLDL f e l

f.
    combin.COMM f combin.ASSOC f
    e l. list.FOLDR f e (reverse l) = list.FOLDR f e l

R s.
    pred_set.FINITE s
    pred_set.FINITE (pred_set.partition R s)
    t. bool.IN t (pred_set.partition R s) pred_set.FINITE t

R M.
    wellFounded R
    x.
      relation.WFREC R M x =
      M (relation.RESTRICT (relation.WFREC R M) R x) x

f ls s.
    list.FOLDL (λs x. pred_set.UNION s (f x)) s ls =
    pred_set.UNION s
      (pred_set.BIGUNION (pred_set.IMAGE f (list.LIST_TO_SET ls)))

R1 R2 x z. relation.O R1 R2 x z y. R2 x y R1 y z

f n l.
    n < length l list.EL n (indexedLists.MAPi f l) = f n (list.EL n l)

(x. rich_list.REPLICATE 0 x = [])
  n x. rich_list.REPLICATE (suc n) x = x :: rich_list.REPLICATE n x

(n. 0 * n = 0) m n. suc m * n = m * n + n

(l. rich_list.COUNT_LIST_AUX 0 l = l)
  n l.
    rich_list.COUNT_LIST_AUX (suc n) l =
    rich_list.COUNT_LIST_AUX n (n :: l)

arithmetic.NRC R (m + n) x z
  y. arithmetic.NRC R m x y arithmetic.NRC R n y z

(acc. numeral.texp_help 0 acc = arithmetic.BIT2 acc)
  n acc. numeral.texp_help (suc n) acc = numeral.texp_help n (bit1 acc)

(l. list.EL 0 l = head l) l n. list.EL (suc n) l = list.EL n (tail l)

(l. rich_list.ELL 0 l = last l)
  n l. rich_list.ELL (suc n) l = rich_list.ELL n (list.FRONT l)

(s. pred_set.chooser s 0 = pred_set.CHOICE s)
  s n. pred_set.chooser s (suc n) = pred_set.chooser (pred_set.REST s) n

h1 h2. h1 = h2 l1 l2. l1 = l2 h1 :: l1 = h2 :: l2

m n.
    relation.RTC (λx y. y = f x) (f m) n
    transitiveClosure (λx y. y = f x) m n

x y a b. (x, y) = (a, b) x = a y = b

y x P. P y x = f y bool.IN x (pred_set.GSPEC (λx. (f x, P x)))

a0 a1 a0' a1'. a0 :: a1 = a0' :: a1' a0 = a0' a1 = a1'

x y a b. list.SNOC x y = list.SNOC a b x = a y = b

b1 x1 b2 x2.
    ind_type.NUMSUM b1 x1 = ind_type.NUMSUM b2 x2 (b1 b2) x1 = x2

x1 y1 x2 y2.
    ind_type.NUMPAIR x1 y1 = ind_type.NUMPAIR x2 y2 x1 = x2 y1 = y2

a b x y. a < x b < y a * b < x * y

m n i j. m i n j m * n i * j

m n p q. m p n q m + n p + q

n1 n2 m1 m2.
    arithmetic.ABS_DIFF (n1 + n2) (m1 + m2)
    arithmetic.ABS_DIFF n1 m1 + arithmetic.ABS_DIFF n2 m2

k n. 0 < n r q. k = q * n + r r < n

a b. 1 < a 0 < b (logroot.LOG a b = 0 b < a)

m n.
    transitiveClosure (λx y. y = suc x) m (suc n)
    relation.RTC (λx y. y = suc x) m n

n. m. n = suc (suc 0) * m n = suc (suc 0) * m + 1

b. 0 < b l. numposrep.l2n b l = 0 all ((=) 0 flip (mod) b) l

xs x y ys. list.LUPDATE x (length xs) (xs @ y :: ys) = xs @ x :: ys

l1 h l2 l3. (l1 @ h :: l2) @ l3 = l1 @ h :: l2 @ l3

l n.
    n < length (list.FRONT l) ¬null l
    list.EL n (list.FRONT l) = list.EL n l

l1 l2.
    length l1 = length l2
    reverse (list.ZIP (l1, l2)) = list.ZIP (reverse l1, reverse l2)

f s u t.
    pred_set.SUBSET s u pred_set.SUBSET (pred_set.IMAGE f u) t
    pred_set.SUBSET (pred_set.IMAGE f s) t

f g. ind_type.ISO f g (x. f (g x) = x) y. g (f y) = y

f.
    (x. pred_set.FINITE (pred_set.GSPEC (λy. (y, x = f y))))
    s. pred_set.FINITE (pred_set.IMAGE f s) pred_set.FINITE s

P l.
    rich_list.SPLITR P l =
    bool.LET (pair.UNCURRY (λa b. (reverse b, reverse a)))
      (rich_list.SPLITP ((¬) P) (reverse l))

P Q. (x. P x Q x) ls. length (filter P ls) length (filter Q ls)

P Q.
    pred_set.FINITE (pred_set.CROSS P Q)
    P = pred_set.EMPTY Q = pred_set.EMPTY
    pred_set.FINITE P pred_set.FINITE Q

s r x. poset.bottom (s, r) x s x y. s y r x y

s r x. poset.top (s, r) x s x y. s y r y x

t.
    pred_set.FINITE t
    s.
      pred_set.FINITE s
      pred_set.CARD (pred_set.DIFF s t) =
      arithmetic.- (pred_set.CARD s) (pred_set.CARD (pred_set.INTER s t))

t.
    pred_set.FINITE t
    s.
      pred_set.FINITE s pred_set.CARD t < pred_set.CARD s
      0 < pred_set.CARD (pred_set.DIFF s t)

f a b.
    list.GENLIST f (a + b) =
    list.GENLIST f b @ list.GENLIST (λt. f (t + b)) a

s.
    pred_set.FINITE s
    e.
      pred_set.SUM_SET (pred_set.DELETE s e) =
      if bool.IN e s then arithmetic.- (pred_set.SUM_SET s) e
      else pred_set.SUM_SET s

%%genvar%%11417.
    ¬(%%genvar%%11417 = pred_set.EMPTY)
    bool.IN (pred_set.MIN_SET %%genvar%%11417) %%genvar%%11417
    x. bool.IN x %%genvar%%11417 pred_set.MIN_SET %%genvar%%11417 x

s. (n. bool.IN n s) n. bool.IN n s m. bool.IN m s n m

x l.
    unzip (list.SNOC x l) =
    (list.SNOC (fst x) (fst (unzip l)), list.SNOC (snd x) (snd (unzip l)))

P s.
    pred_set.pairwise P s e1 e2. bool.IN e1 s bool.IN e2 s P e1 e2

f e g l. list.FOLDL f e (map g l) = list.FOLDL (λx y. f x (g y)) e l

f e g l. list.FOLDR f e (map g l) = list.FOLDR (λx y. f (g x) y) e l

f1 f1' f2 f2'.
    ind_type.INJP f1 f2 = ind_type.INJP f1' f2' f1 = f1' f2 = f2'

Fn. f. c i r. f (ind_type.CONSTR c i r) = Fn c i r (λn. f (r n))

0 < x (x * y = z y = z div x z mod x = 0)

(∃!x. P x) (x. P x) x x'. P x P x' x = x'

(list.ALL_DISTINCT [] )
  h t.
    list.ALL_DISTINCT (h :: t)
    ¬bool.IN h (list.LIST_TO_SET t) list.ALL_DISTINCT t

numeral.iiSUC 0 = arithmetic.BIT2 0
  numeral.iiSUC (bit1 n) = bit1 (suc n)
  numeral.iiSUC (arithmetic.BIT2 n) = arithmetic.BIT2 (suc n)

numpair.nlistrec n f 0 = n
  numpair.nlistrec n f (numpair.ncons h t) = f h t (numpair.nlistrec n f t)

pair.LEX R1 R2 (a, b) (c, d) R1 a c a = c R2 b d

0 < n n * q m arithmetic.- m (n * q) mod n = m mod n

list.LIST_REL R (l1 @ x1 :: []) (l2 @ x2 :: [])
  list.LIST_REL R l1 l2 R x1 x2

x s.
    bool.IN x s (y. bool.IN y s x = y)
    s = pred_set.INSERT x pred_set.EMPTY

h l n.
    bit.BITS h l n =
    n mod arithmetic.BIT2 0 suc h div arithmetic.BIT2 0 l

n a b. (bit.BIT n a bit.BIT n b) bit.SLICE n n a = bit.SLICE n n b

y x n.
    bit.SBIT (bit.BIT x n) (x + y) =
    bit.SLICE x x n * arithmetic.BIT2 0 y

n m l.
    n + m length l rich_list.SEG n m l = list.TAKE n (list.DROP m l)

n. 0 < n x r. (x * n + r) div n = x + r div n

n. 0 < n j k. (j + k mod n) mod n = (j + k) mod n

n. 0 < n j k. (k mod n + j) mod n = (k + j) mod n

n.
    numeral.iDUB (bit1 n) = arithmetic.BIT2 (numeral.iDUB n)
    numeral.iDUB (arithmetic.BIT2 n) = arithmetic.BIT2 (bit1 n)
    numeral.iDUB 0 = 0

l1 n.
    length l1 n
    l2. list.EL n (l1 @ l2) = list.EL (arithmetic.- n (length l1)) l2

l2 n.
    length l2 n
    l1.
      rich_list.ELL n (l1 @ l2) =
      rich_list.ELL (arithmetic.- n (length l2)) l1

l1 n.
    length l1 n
    l2. list.DROP n (l1 @ l2) = list.DROP (arithmetic.- n (length l1)) l2

l2 n.
    length l2 n
    l1.
      rich_list.BUTLASTN n (l1 @ l2) =
      rich_list.BUTLASTN (arithmetic.- n (length l2)) l1

l1 l2 f.
    indexedLists.MAPi f (l1 @ l2) =
    indexedLists.MAPi f l1 @ indexedLists.MAPi (f (+) (length l1)) l2

ls f e.
    list.FOLDL f e (list.ZIP (ls, ls)) = list.FOLDL (λx y. f x (y, y)) e ls

f.
    (s. pred_set.BIJ f pred_set.EMPTY s s = pred_set.EMPTY)
    s. pred_set.BIJ f s pred_set.EMPTY s = pred_set.EMPTY

f.
    (s. pred_set.SURJ f pred_set.EMPTY s s = pred_set.EMPTY)
    s. pred_set.SURJ f s pred_set.EMPTY s = pred_set.EMPTY

s x y.
    pred_set.INSERT x s = pred_set.INSERT y pred_set.EMPTY
    x = y pred_set.SUBSET s (pred_set.INSERT y pred_set.EMPTY)

P x l.
    filter P (list.SNOC x l) =
    if P x then list.SNOC x (filter P l) else filter P l

P ls k.
    length (list.dropWhile P (reverse ls)) k k < length ls
    P (list.EL k ls)

P l1 l2.
    any ((¬) P) l1
    list.dropWhile P (l1 @ l2) = list.dropWhile P l1 @ l2

X Y P.
    bool.IN Y P pred_set.DISJOINT Y X
    pred_set.DISJOINT X (pred_set.BIGINTER P)
    pred_set.DISJOINT (pred_set.BIGINTER P) X

s.
    pred_set.FINITE s
    g.
      pred_set.BIJ g s s
      f. pred_set.SUM_IMAGE (f g) s = pred_set.SUM_IMAGE f s

P M N.
    P (bool.LET (pair.UNCURRY (λx y. N x y)) M) =
    bool.LET (pair.UNCURRY (λx y. P (N x y))) M

M N b.
    bool.LET (pair.UNCURRY (λx y. N x y)) M b =
    bool.LET (pair.UNCURRY (λx y. N x y b)) M

R.
    relation.EQC (relation.RC R) = relation.EQC R
    relation.EQC (relation.SC R) = relation.EQC R
    relation.EQC (transitiveClosure R) = relation.EQC R

P.
    (s.
       (pred_set.FINITE s ¬(s = pred_set.EMPTY) P (pred_set.REST s))
       P s) t. P t

wellFounded = λR. B. (w. B w) min. B min b. R b min ¬B b

(f. list.GENLIST f 0 = [])
  f n. list.GENLIST f (suc n) = list.SNOC (f n) (list.GENLIST f n)

(m. m 0 = 1) m n. m suc n = m * m n

(m. bit.BIT_REVERSE m 0 = numeral_bit.BIT_REV m 0 0)
  n m. bit.BIT_REVERSE m n = numeral_bit.BIT_REV m n 0

x y l.
    bool.IN (x, y) (list.LIST_TO_SET l)
    z. x = fst z bool.IN z (list.LIST_TO_SET l)

h h2 l n. h h2 bit.BITS h2 l (bit.SLICE h l n) = bit.BITS h l n

h l x n. bit.BITS h l x div arithmetic.BIT2 0 n = bit.BITS h (l + n) x

x n f a. x < n (bit.BIT x (bit.BIT_MODIFY n f a) f x (bit.BIT x a))

n m. ¬(n = 0) p q. p * n = q * m + gcd.gcd m n

b x. 1 < b 0 < x logroot.LOG b (b * x) = suc (logroot.LOG b x)

n p.
    arithmetic.BIT2 0 p n n < arithmetic.BIT2 0 suc p
    bit.LOG2 n = p

n l.
    n < length l
    rich_list.ELL n l =
    head (rich_list.SEG 1 (prim_rec.PRE (arithmetic.- (length l) n)) l)

l x y i.
    bool.IN x (list.LIST_TO_SET (list.LUPDATE y i l))
    x = y bool.IN x (list.LIST_TO_SET l)

ls n.
    n < length ls list.DROP n ls = list.EL n ls :: list.DROP (n + 1) ls

ls n.
    n < length ls
    list.TAKE (n + 1) ls = list.SNOC (list.EL n ls) (list.TAKE n ls)

l n. length l = suc n h l'. length l' = n l = h :: l'

l f x.
    bool.IN x (list.LIST_TO_SET (map f l))
    y. x = f y bool.IN y (list.LIST_TO_SET l)

l f. (map f l = [] l = []) ([] = map f l l = [])

f x y. map f x = some y z. x = some z y = f z

f s t.
    pred_set.BIJ f s t x. bool.IN x t f (pred_set.LINV f s x) = x

f s t.
    pred_set.INJ f s t x. bool.IN x s pred_set.LINV f s (f x) = x

f s t.
    pred_set.SURJ f s t x. bool.IN x t f (pred_set.RINV f s x) = x

x y.
    pred_set.DIFF (pred_set.UNION x y) x = pred_set.DIFF y x
    pred_set.DIFF (pred_set.UNION x y) y = pred_set.DIFF x y

s.
    pred_set.FINITE s
    P. P pred_set.EMPTY (s. P s e. P (pred_set.INSERT e s)) P s

s.
    pred_set.FINITE s
    x.
      pred_set.CARD (pred_set.DELETE s x) =
      if bool.IN x s then arithmetic.- (pred_set.CARD s) 1
      else pred_set.CARD s

s.
    pred_set.FINITE s
    t.
      pred_set.FINITE t pred_set.CARD s = pred_set.CARD t
      pred_set.SUBSET s t s = t

f. (n. f n < f (suc n)) m n. m < n f m < f n

l1 l2. map fst l1 = map fst l2 map snd l1 = map snd l2 l1 = l2

R1 R2.
    pair.LEX R1 R2 =
    pair.UNCURRY (λs t. pair.UNCURRY (λu v. R1 s u s = u R2 t v))

p f x x'. poset.poset p poset.gfp p f x poset.gfp p f x' x = x'

p f x x'. poset.poset p poset.lfp p f x poset.lfp p f x' x = x'

pred_set.SUM_SET pred_set.EMPTY = 0
  x s.
    pred_set.FINITE s
    pred_set.SUM_SET (pred_set.INSERT x s) =
    x + pred_set.SUM_SET (pred_set.DELETE s x)

pred_set.SURJ f s t
  g. pred_set.INJ g t s y. bool.IN y t f (g y) = y

(p q r) (p q) (p ¬r) (¬q r ¬p)

(p q r) (p ¬q) (p ¬r) (q r ¬p)

max 0 x = x max x 0 = x max x y = if x < y then y else x

min 0 x = 0 min x 0 = 0 min x y = if x < y then x else y

(l. list.DROP 0 l = l)
  n x l. list.DROP (suc n) (x :: l) = list.DROP n l

(l. rich_list.BUTLASTN 0 l = l)
  n x l.
    rich_list.BUTLASTN (suc n) (list.SNOC x l) = rich_list.BUTLASTN n l

(f v. const v f = const v) f v. f const v = const (f v)

list.EL (bit1 n) l = list.EL (prim_rec.PRE (bit1 n)) (tail l)
  list.EL (arithmetic.BIT2 n) l = list.EL (bit1 n) (tail l)

x y P. bool.IN x (pred_set.INSERT y P) x = y ¬(x = y) bool.IN x P

x y s.
    pred_set.DELETE (pred_set.INSERT x s) y =
    if x = y then pred_set.DELETE s y
    else pred_set.INSERT x (pred_set.DELETE s y)

x y. transitiveClosure R x y ¬(x = y) z. R x z ¬(x = z)

f1 f2 a b c. ¬(b = c) ¬(combin.UPDATE a b f = combin.UPDATE a c f)

x f.
    prim_rec.SIMP_REC x f 0 = x
    m. prim_rec.SIMP_REC x f (suc m) = f (prim_rec.SIMP_REC x f m)

x s t.
    pred_set.INTER (pred_set.INSERT x s) t =
    if bool.IN x t then pred_set.INSERT x (pred_set.INTER s t)
    else pred_set.INTER s t

x s t.
    pred_set.UNION (pred_set.INSERT x s) t =
    if bool.IN x t then pred_set.UNION s t
    else pred_set.INSERT x (pred_set.UNION s t)

f0 f1. fn. fn [] = f0 a0 a1. fn (a0 :: a1) = f1 a0 a1 (fn a1)

e f. fn. fn [] = e x l. fn (list.SNOC x l) = f x l (fn l)

x f. ∃!fn1. fn1 [] = x h t. fn1 (h :: t) = f (fn1 t) h t

b m n.
    n < m
    bit.SBIT b (arithmetic.- m n) = bit.SBIT b m div arithmetic.BIT2 0 n

x y z. 0 < z (x < y div z (x + 1) * z y)

x y z. 0 < z (y div z x y < (x + 1) * z)

x n a.
    x < n
    (bit.BIT x (bit.BIT_REVERSE n a)
     bit.BIT (arithmetic.- (arithmetic.- n 1) x) a)

n a s.
    s n
    (bit.BIT n (a * arithmetic.BIT2 0 s) bit.BIT (arithmetic.- n s) a)

n h l.
    l h n mod arithmetic.BIT2 0 l n mod arithmetic.BIT2 0 suc h

a n p. a p n n < a suc p logroot.LOG a n = p

r n p. p r n n < suc p r logroot.ROOT r n = p

m n l. m + n < length l list.EL m (list.DROP n l) = list.EL (m + n) l

n m l.
    n + m length l list.DROP n (list.DROP m l) = list.DROP (n + m) l

m n l.
    n + m length l
    rich_list.BUTLASTN n (rich_list.BUTLASTN m l) =
    rich_list.BUTLASTN (n + m) l

m l.
    m length l n. n m list.TAKE n (list.TAKE m l) = list.TAKE n l

l n m.
    m length l n m
    rich_list.LASTN n (rich_list.LASTN m l) = rich_list.LASTN n l

l i j.
    i < j j < length l list.EL i (indexedLists.delN j l) = list.EL i l

l1 l2.
    length (list.nub (l1 @ l2)) =
    length (list.nub l1) +
    length (list.nub (filter (λx. ¬bool.IN x (list.LIST_TO_SET l1)) l2))

l1 l2 f.
    list.LIST_REL f l1 l2
    length l1 = length l2 all (pair.UNCURRY f) (list.ZIP (l1, l2))

l1 l2.
    length l1 = length l2
    f. list.MAP2 f l1 l2 = map (pair.UNCURRY f) (list.ZIP (l1, l2))

s t x.
    pred_set.DIFF (pred_set.INSERT x s) t =
    if bool.IN x t then pred_set.DIFF s t
    else pred_set.INSERT x (pred_set.DIFF s t)

s. pred_set.FINITE s f b. e. bool.IN e s n. n < b e = f n

R. wellFounded R P. (x. (y. R y x P y) P x) x. P x

R. wellFounded R P. (x. (y. R y x P y) P x) x. P x

R. (P. (x. (y. R y x P y) P x) x. P x) wellFounded R

f g. combin.FCOMM f g x y z. g x (f y z) = f (g x y) z

R l1 l2.
    list.LIST_REL R l1 l2
    length l1 = length l2 all (pair.UNCURRY R) (list.ZIP (l1, l2))

f x y.
    option.OPTION_MAP2 f x y =
    if isSome x isSome y then some (f (option.THE x) (option.THE y))
    else none

P = Q (x. bool.IN x Q (f x g x))
  (bool.RES_EXISTS P f bool.RES_EXISTS Q g)

P = Q (x. bool.IN x Q (f x g x))
  (bool.RES_FORALL P f bool.RES_FORALL Q g)

(a. bit.MOD_2EXP_MAX 0 a )
  n a.
    bit.MOD_2EXP_MAX (suc n) a
    odd a bit.MOD_2EXP_MAX n (arithmetic.DIV2 a)

pred_set.IMAGE f s = pred_set.INSERT z pred_set.EMPTY
  ¬(s = pred_set.EMPTY) x. bool.IN x s f x = z

(v f. arithmetic.num_CASE 0 v f = v)
  n v f. arithmetic.num_CASE (suc n) v f = f n

(a f. ind_type.FCONS a f 0 = a)
  a f n. ind_type.FCONS a f (suc n) = f n

(v f. option.option_CASE none v f = v)
  x v f. option.option_CASE (some x) v f = f x

s1 = s2 (x. bool.IN x s2 f1 x = f2 x)
  pred_set.SUM_IMAGE f1 s1 = pred_set.SUM_IMAGE f2 s2

x x' y y'. (x x') (x' (y y')) (x y x' y')

h l a b.
    bit.BITS h l (a * arithmetic.BIT2 0 suc h + b) = bit.BITS h l b

p q n m. n * suc q p = m * suc q p n = m

n k q. (r. k = q * n + r r < n) k div n = q

n k r. (q. k = q * n + r r < n) k mod n = r

m k l. m + k length l P. any P (rich_list.SEG m k l) any P l

n k.
    k =
    (k div arithmetic.BIT2 0 n) * arithmetic.BIT2 0 n +
    k mod arithmetic.BIT2 0 n

m n. m < n P. (n. P (suc n) P n) P m ¬P n

m n. gcd.lcm m n = if m = 0 n = 0 then 0 else m * n div gcd.gcd m n

r n. 0 < r logroot.ROOT r n r n n < suc (logroot.ROOT r n) r

x y.
    pred_set.pair_to_num (x, y) =
    (x + y + 1) * (x + y) div arithmetic.BIT2 0 + y

b n.
    1 < b
    length (numposrep.n2l b n) = if n = 0 then 1 else suc (logroot.LOG b n)

x n.
    (n div arithmetic.BIT2 0 x) * arithmetic.BIT2 0 x =
    arithmetic.- n (n mod arithmetic.BIT2 0 x)

n a.
    ¬(a = 0) a mod arithmetic.BIT2 0 n = 0 arithmetic.BIT2 0 n a

n f g. list.GENLIST f n = list.GENLIST g n x. x < n f x = g x

l1 l2 P.
    length l1 = length l2
    (all (λx. P (fst x)) (list.ZIP (l1, l2)) all P l1)

l1 l2 P.
    length l1 = length l2
    (all (λx. P (snd x)) (list.ZIP (l1, l2)) all P l2)

l1 l2.
    length l1 = length l2 (list.ZIP (l1, l2) = [] l1 = [] l2 = [])

f.
    (x y. f x = f y x = y)
    s. pred_set.FINITE (pred_set.IMAGE f s) pred_set.FINITE s

P l. all P l m k. m + k length l all P (rich_list.SEG m k l)

s.
    pred_set.FINITE s (x. bool.IN x s f x g x)
    pred_set.SUM_IMAGE f s pred_set.SUM_IMAGE g s

f g ls.
    list.SUM (map (λx. f x + g x) ls) =
    list.SUM (map f ls) + list.SUM (map g ls)

R x y. relation.RTC R x y x = y y1. R x y1 relation.RTC R y1 y

R x y. relation.RTC R x y x = y u. relation.RTC R x u R u y

R x z.
    transitiveClosure R x z R x z y. R x y transitiveClosure R y z

R x z.
    transitiveClosure R x z R x z y. transitiveClosure R x y R y z

R s x y.
    pred_set.REL_RESTRICT R s x y bool.IN x s bool.IN y s R x y

0 < n ((x + k) mod n = x mod n + k k < arithmetic.- n (x mod n))

bool.IN e (list.LIST_TO_SET l)
  pfx sfx. l = (pfx @ e :: []) @ sfx ¬bool.IN e (list.LIST_TO_SET pfx)

bool.IN e (list.LIST_TO_SET l)
  pfx sfx. l = (pfx @ e :: []) @ sfx ¬bool.IN e (list.LIST_TO_SET sfx)

(p q r) (p ¬q ¬r) (q ¬p) (r ¬p)

pred_set.PROD_SET pred_set.EMPTY = 1
  x s.
    pred_set.FINITE s
    pred_set.PROD_SET (pred_set.INSERT x s) =
    x * pred_set.PROD_SET (pred_set.DELETE s x)

suc 0 = 1 (n. suc (bit1 n) = arithmetic.BIT2 n)
  n. suc (arithmetic.BIT2 n) = bit1 (suc n)

(acc. list.SUM_ACC [] acc = acc)
  h t acc. list.SUM_ACC (h :: t) acc = list.SUM_ACC t (h + acc)

(l. [] @ l = l) l1 l2 h. (h :: l1) @ l2 = h :: l1 @ l2

(acc. list.REV [] acc = acc)
  h t acc. list.REV (h :: t) acc = list.REV t (h :: acc)

0 < n n * q m
  arithmetic.- m (n * q) div n = arithmetic.- (m div n) q

(x y. R1 x y R2 y x)
  x y. list.LIST_REL R1 x y list.LIST_REL R2 y x

list.LRC R ls x y bool.IN e (list.LIST_TO_SET ls)
  z t. R e z list.LRC R t z y

0 < n k < arithmetic.- n (x mod n) (x + k) mod n = x mod n + k

x f.
    prim_rec.PRIM_REC x f 0 = x
    m. prim_rec.PRIM_REC x f (suc m) = f (prim_rec.PRIM_REC x f m) m

n m1 m2. arithmetic.MODEQ n m1 m2 a b. a * n + m1 = b * n + m2

h l n.
    bit.BITS h l n =
    n div arithmetic.BIT2 0 l mod
    arithmetic.BIT2 0 arithmetic.- (suc h) l

m n p. m = arithmetic.- n p m + p = n m 0 n p

m n p. arithmetic.- m n = p m = n + p m n p 0

h l n.
    n < arithmetic.BIT2 0 suc h
    bit.BITS h l n = n div arithmetic.BIT2 0 l

p n m. p n p m (arithmetic.- n p = arithmetic.- m p n = m)

p n m. n p m p (arithmetic.- p n = arithmetic.- p m n = m)

h a b.
    bit.BITS h 0 (bit.BITS h 0 a * bit.BITS h 0 b) = bit.BITS h 0 (a * b)

h a b.
    bit.BITS h 0 (bit.BITS h 0 a + bit.BITS h 0 b) = bit.BITS h 0 (a + b)

n m l.
    m n
    list.TAKE m l @ list.TAKE (arithmetic.- n m) (list.DROP m l) =
    list.TAKE n l

m n. 0 < m 0 < n x. x div m div n = x div m * n

m n. 0 < n 0 < m x. x mod n * m mod n = x mod n

b n. ¬(n = 0) n < arithmetic.BIT2 0 b i. i < b bit.BIT i n

n. 0 < n j k. (j mod n) * (k mod n) mod n = j * k mod n

n. 0 < n j k. (j mod n + k mod n) mod n = (j + k) mod n

l1 n.
    length l1 n
    l2.
      list.TAKE n (l1 @ l2) =
      l1 @ list.TAKE (arithmetic.- n (length l1)) l2

l2 n.
    length l2 n
    l1.
      rich_list.LASTN n (l1 @ l2) =
      rich_list.LASTN (arithmetic.- n (length l2)) l1 @ l2

f g s t u.
    pred_set.BIJ f s t pred_set.BIJ g t u pred_set.BIJ (g f) s u

f g s t u.
    pred_set.INJ f s t pred_set.INJ g t u pred_set.INJ (g f) s u

f g s t u.
    pred_set.SURJ f s t pred_set.SURJ g t u pred_set.SURJ (g f) s u

s x x'.
    (bool.IN x s bool.IN x' s) bool.IN x (pred_set.DELETE s x')
    bool.IN x' (pred_set.DELETE s x)

s r p x. poset.glb (s, r) (λj. s j p j) x poset.glb (s, r) p x

s r p x. poset.lub (s, r) (λj. s j p j) x poset.lub (s, r) p x

s.
    pred_set.FINITE s
    g.
      pred_set.INJ g s pred_set.UNIV
      f.
        pred_set.SUM_IMAGE f (pred_set.IMAGE g s) =
        pred_set.SUM_IMAGE (f g) s

I' J n.
    ¬(I' = pred_set.EMPTY) ¬(J = pred_set.EMPTY) pred_set.SUBSET I' J
    pred_set.MIN_SET J pred_set.MIN_SET I'

R a. relation.WFP R a P. (x. (y. R y x P y) P x) P a

R P. (x. (y. R y x P y) P x) x. relation.WFP R x P x

R M x f.
    relation.approx R M x f
    f = relation.RESTRICT (λy. M (relation.RESTRICT f R y) y) R x

R M.
    relation.WFREC R M =
    λx.
      M
        (relation.RESTRICT
           (relation.the_fun (transitiveClosure R)
              (λf y. M (relation.RESTRICT f R y) y) x) R x) x

R. wellFounded R B. (w. B w) min. B min b. R b min ¬B b

R.
    relation.SC (relation.RC R) = relation.RC (relation.SC R)
    relation.RC (relation.RC R) = relation.RC R
    transitiveClosure (relation.RC R) = relation.RC (transitiveClosure R)

P (arithmetic.- a b) d. (b = a + d P 0) (a = b + d P d)

x n l1 l2.
    n < length l1 list.LUPDATE x n (l1 @ l2) = list.LUPDATE x n l1 @ l2

A B. (¬(A B) ¬A ¬B) (¬(A B) ¬A ¬B)

n h l a. l + n h (bit.BIT n (bit.BITS h l a) bit.BIT (l + n) a)

b h l n. bit.BIT b (bit.SLICE h l n) l b b h bit.BIT b n

n m l.
    n + m length l
    x. rich_list.SEG n m (list.SNOC x l) = rich_list.SEG n m l

n m l1.
    n + m length l1
    l2. rich_list.SEG n m (l1 @ l2) = rich_list.SEG n m l1

a x. 1 < a a x logroot.LOG a x = 1 + logroot.LOG a (x div a)

a. divides.prime a ¬(a = 1) b. divides.divides b a b = a b = 1

n. 0 < n x. (x + 1) mod n = 0 x mod n + 1 = n

n. 0 < n k. k = (k div n) * n + k mod n k mod n < n

l1 l2 n x.
    n < length l1 list.LUPDATE x n (l1 @ l2) = list.LUPDATE x n l1 @ l2

f P l. (x. P (f x) P x) map f (filter P l) = filter P (map f l)

f1 f2 l.
    map f1 l = map f2 l e. bool.IN e (list.LIST_TO_SET l) f1 e = f2 e

P1 P2 l.
    filter P1 l = filter P2 l
    x. bool.IN x (list.LIST_TO_SET l) (P1 x P2 x)

P Q l.
    (x. bool.IN x (list.LIST_TO_SET l) P x Q x) all P l all Q l

s t.
    pred_set.FINITE s pred_set.FINITE t
    pred_set.CARD (pred_set.UNION s t) =
    arithmetic.- (pred_set.CARD s + pred_set.CARD t)
      (pred_set.CARD (pred_set.INTER s t))

s t f.
    pred_set.BIJ f s t
    e.
      bool.IN e s
      pred_set.BIJ f (pred_set.DELETE s e) (pred_set.DELETE t (f e))

s t f.
    pred_set.INJ f s t
    e.
      bool.IN e s
      pred_set.INJ f (pred_set.DELETE s e) (pred_set.DELETE t (f e))

s.
    pred_set.FINITE s
    t.
      pred_set.FINITE t
      pred_set.CARD (pred_set.UNION s t) +
      pred_set.CARD (pred_set.INTER s t) =
      pred_set.CARD s + pred_set.CARD t

s t.
    pred_set.FINITE s pred_set.FINITE t
    pred_set.SUM_SET (pred_set.UNION s t) =
    arithmetic.- (pred_set.SUM_SET s + pred_set.SUM_SET t)
      (pred_set.SUM_SET (pred_set.INTER s t))

xs n f h.
    list.LUPDATE (some (f h)) n (map (map f) xs) =
    map (map f) (list.LUPDATE (some h) n xs)

P.
    P ind_type.BOTTOM
    (c i r. (n. P (r n)) P (ind_type.CONSTR c i r)) x. P x

f.
    combin.COMM f
    e'.
      combin.MONOID f e' e l. list.FOLDL f e l = f e (list.FOLDL f e' l)

f.
    combin.COMM f
    e'.
      combin.MONOID f e' e l. list.FOLDR f e l = f e (list.FOLDR f e' l)

f e P l.
    list.FOLDL f e (filter P l) =
    list.FOLDL (λx y. if P y then f x y else x) e l

f e P l.
    list.FOLDR f e (filter P l) =
    list.FOLDR (λx y. if P x then f x y else y) e l

f l1 l2 n.
    n length l1 list.LIST_REL f l1 l2
    list.LIST_REL f (rich_list.BUTLASTN n l1) (rich_list.BUTLASTN n l2)

f l1 l2 n.
    n length l1 list.LIST_REL f l1 l2
    list.LIST_REL f (rich_list.LASTN n l1) (rich_list.LASTN n l2)

P.
    (x. (y. pred_set.PSUBSET y x P y) pred_set.FINITE x P x)
    s. pred_set.FINITE s P s

f ls s.
    list.FOLDL (λs. pair.UNCURRY (λx y. pred_set.UNION s (f x y))) s ls =
    pred_set.UNION s
      (pred_set.BIGUNION
         (pred_set.IMAGE (pair.UNCURRY f) (list.LIST_TO_SET ls)))

M R f.
    f = relation.WFREC R M wellFounded R
    x. f x = M (relation.RESTRICT f R x) x

0 < y (suc x mod y = suc (x mod y) ¬(suc x = suc (x div y) * y))

arithmetic.MODEQ n m1 m2 n = 0 m1 = m2 0 < n m1 mod n = m2 mod n

list.nub [] = []
  x l.
    list.nub (x :: l) =
    if bool.IN x (list.LIST_TO_SET l) then list.nub l else x :: list.nub l

list.LIST_REL R xs (h :: t)
  h' t'. xs = h' :: t' R h' h list.LIST_REL R t' t

list.LIST_REL R (h :: t) xs
  h' t'. xs = h' :: t' R h h' list.LIST_REL R t t'

(n. list.LEN [] n = n)
  h t n. list.LEN (h :: t) n = list.LEN t (n + 1)

(l. list.TAKE 0 l = [])
  n x l. list.TAKE (suc n) (x :: l) = x :: list.TAKE n l

(l. rich_list.LASTN 0 l = [])
  n x l.
    rich_list.LASTN (suc n) (list.SNOC x l) =
    list.SNOC x (rich_list.LASTN n l)

(f. map f [] = []) f h t. map f (h :: t) = f h :: map f t

(P. all P [] ) P h t. all P (h :: t) P h all P t

(P. any P [] ) P h t. any P (h :: t) P h any P t

(x. last (x :: []) = x) x y z. last (x :: y :: z) = last (y :: z)

(x. last (x :: []) = x)
  h1 h2 t. last (h1 :: h2 :: t) = last (h2 :: t)

list.EL (bit1 n) (l :: ls) = list.EL (prim_rec.PRE (bit1 n)) ls
  list.EL (arithmetic.BIT2 n) (l :: ls) = list.EL (bit1 n) ls

(x y. f x = f y x = y)
  (pred_set.IMAGE f s1 = pred_set.IMAGE f s2 s1 = s2)

0 < y ¬(suc x = suc (x div y) * y) suc x mod y = suc (x mod y)

(x. P x P' x) (y. Q y Q' y) pair.PROD_ALL P Q p
  pair.PROD_ALL P' Q' p

(x. P x P' x) (y. Q y Q' y) sum.SUM_ALL P Q s
  sum.SUM_ALL P' Q' s

e l h.
    bool.IN e (list.LIST_TO_SET l) ¬(e = last (h :: l))
    bool.IN e (list.LIST_TO_SET (list.FRONT (h :: l)))

m n a. 0 < n arithmetic.DIVMOD (a, m, n) = (a + m div n, m mod n)

h l a.
    l h
    bit.BITS h l (a * arithmetic.BIT2 0 l) =
    bit.BITS (arithmetic.- h l) 0 a

a x y. 1 < a 0 < x x y logroot.LOG a x logroot.LOG a y

a b c. 1 < a b < a c logroot.LOG a (b + a c) = c

n m l.
    n + m length l
    rich_list.LASTN n (rich_list.BUTLASTN m l) =
    rich_list.BUTLASTN m (rich_list.LASTN (n + m) l)

n l.
    rich_list.BUTLASTN n l =
    bool.LET
      (λm.
         if n m then list.TAKE (arithmetic.- m n) l
         else combin.FAIL rich_list.BUTLASTN longer than list n l)
      (length l)

n l.
    rich_list.LASTN n l =
    bool.LET
      (λm.
         if n m then list.DROP (arithmetic.- m n) l
         else combin.FAIL rich_list.LASTN longer than list n l) (length l)

n.
    0 < n
    n =
    arithmetic.BIT2 0 logroot.LOG (arithmetic.BIT2 0) n +
    n mod arithmetic.BIT2 0 logroot.LOG (arithmetic.BIT2 0) n

n.
    (even n m. n = arithmetic.BIT2 0 * m)
    (odd n m. n = suc (arithmetic.BIT2 0 * m))

l1 l2 n.
    list.EL n (l1 @ l2) =
    if n < length l1 then list.EL n l1
    else list.EL (arithmetic.- n (length l1)) l2

f l1 l2.
    pred_set.INJ f
      (pred_set.UNION (list.LIST_TO_SET l1) (list.LIST_TO_SET l2))
      pred_set.UNIV map f l1 = map f l2 l1 = l2

f s t s0 t0.
    pred_set.INJ f s t pred_set.SUBSET s0 s pred_set.SUBSET t t0
    pred_set.INJ f s0 t0

P Q.
    pred_set.GSPEC (λx. (x, P x Q x)) =
    pred_set.INTER (pred_set.GSPEC (λx. (x, P x)))
      (pred_set.GSPEC (λx. (x, Q x)))

P Q.
    pred_set.GSPEC (λx. (x, P x Q x)) =
    pred_set.UNION (pred_set.GSPEC (λx. (x, P x)))
      (pred_set.GSPEC (λx. (x, Q x)))

s M. (x. bool.IN x s) x. bool.IN x s y. bool.IN y s M x M y

s1 s2.
    pred_set.CROSS pred_set.EMPTY s2 = pred_set.EMPTY
    pred_set.CROSS (pred_set.INSERT a s1) s2 =
    pred_set.UNION (pred_set.IMAGE (λy. (a, y)) s2) (pred_set.CROSS s1 s2)

s.
    pred_set.FINITE s
    n.
      (x. bool.IN x s n f x)
      pred_set.CARD s * n pred_set.SUM_IMAGE f s

s.
    pred_set.FINITE s
    n.
      (x. bool.IN x s f x n)
      pred_set.SUM_IMAGE f s pred_set.CARD s * n

a0.
    ind_type.ZRECSPACE a0
    a0 = ind_type.ZBOT
    c i r. a0 = ind_type.ZCONSTR c i r n. ind_type.ZRECSPACE (r n)

pred_set.POW pred_set.EMPTY =
  pred_set.INSERT pred_set.EMPTY pred_set.EMPTY
  e s.
    pred_set.POW (pred_set.INSERT e s) =
    bool.LET
      (λps. pred_set.UNION (pred_set.IMAGE (pred_set.INSERT e) ps) ps)
      (pred_set.POW s)

(m. arithmetic.- 0 m = 0)
  m n.
    arithmetic.- (suc m) n = if m < n then 0 else suc (arithmetic.- m n)

x f l.
    bool.IN x (list.LIST_TO_SET (indexedLists.MAPi f l))
    n. n < length l x = f n (list.EL n l)

P P' Q Q'. (Q (P P')) (P' (Q Q')) (P Q P' Q')

n m l.
    n + m length l
    x.
      bool.IN x (list.LIST_TO_SET (rich_list.SEG n m l))
      bool.IN x (list.LIST_TO_SET l)

p q.
    arithmetic.BIT2 0 * p + 1 < arithmetic.BIT2 0 * q
    arithmetic.BIT2 0 * p < arithmetic.BIT2 0 * q

x l.
    all ((>) (arithmetic.BIT2 0)) l x < length l
    (bit.BIT x (numposrep.num_from_bin_list l) list.EL x l = 1)

wl op a b.
    bit.BITWISE (suc wl) op (bit.BITS wl 0 a) (bit.BITS wl 0 b) =
    bit.BITWISE (suc wl) op a b

l f n.
    length l = n
    list.ZIP (l, list.GENLIST f n) =
    list.GENLIST (λx. (list.EL x l, f x)) n

f.
    (x y. f x = f y x = y)
    s. ¬pred_set.FINITE s ¬pred_set.FINITE (pred_set.IMAGE f s)

t s r.
    poset.pointwise_lift t (s, r) =
    (poset.function t s, (λf g. x. t x r (f x) (g x)))

P x n. 0 < n P x (y. P (y + n) P y) P (x mod n)

P.
    P 0 (n. P n P (bit1 n)) (n. P n P (arithmetic.BIT2 n))
    n. P n

list.ALL_DISTINCT (list.GENLIST f n)
  m1 m2. m1 < n m2 < n f m1 = f m2 m1 = m2

pred_set.CARD pred_set.EMPTY = 0
  s.
    pred_set.FINITE s
    x.
      pred_set.CARD (pred_set.INSERT x s) =
      if bool.IN x s then pred_set.CARD s else suc (pred_set.CARD s)

(x. list.LIST_TO_SET [] x )
  h t x. list.LIST_TO_SET (h :: t) x x = h list.LIST_TO_SET t x

(x. list.SNOC x [] = x :: [])
  x x' l. list.SNOC x (x' :: l) = x' :: list.SNOC x l

(y x. left x = left y x = y) y x. right x = right y x = y

(a b. gcd.gcd a (a + b) = gcd.gcd a b)
  a b. gcd.gcd a (b + a) = gcd.gcd a b

(a b. gcd.gcd (a + b) a = gcd.gcd a b)
  a b. gcd.gcd (b + a) a = gcd.gcd a b

list.LRC R (h :: t) x y bool.IN e (list.LIST_TO_SET t)
  z p. R z e list.LRC R p x z

h1 l1 h2 l2 n.
    bit.BITS h2 l2 (bit.BITS h1 l1 n) =
    bit.BITS (min h1 (h2 + l1)) (l2 + l1) n

n a b. 0 < n (suc a mod n = suc b mod n a mod n = b mod n)

n p q. 0 < n 0 < q n * (p mod q) = n * p mod n * q

r x y.
    0 < r 0 < y logroot.ROOT r x div y = logroot.ROOT r (x div y r)

m n k. 0 < n 0 < k m div n mod k = m mod n * k div n

p q n. 0 < n q p n arithmetic.- p q = n p div n q

n l1 l2.
    list.isPREFIX l1 l2 n < length l1 n < length l2
    list.EL n l1 = list.EL n l2

n.
    even 0 even (arithmetic.BIT2 n) ¬even (bit1 n) ¬odd 0
    ¬odd (arithmetic.BIT2 n) odd (bit1 n)

l1 l2.
    list.ALL_DISTINCT (l1 @ l2)
    list.ALL_DISTINCT l1 list.ALL_DISTINCT l2
    e. bool.IN e (list.LIST_TO_SET l1) ¬bool.IN e (list.LIST_TO_SET l2)

f R P M x.
    f = relation.WFREC R M wellFounded R
    relation.INDUCTIVE_INVARIANT R P M P x (f x)

s f b.
    pred_set.FINITE s
    pred_set.ITSET f s b =
    if s = pred_set.EMPTY then b
    else pred_set.ITSET f (pred_set.REST s) (f (pred_set.CHOICE s) b)

f.
    combin.ASSOC f
    e.
      combin.LEFT_ID f e
      l.
        list.FOLDR f e (concat l) = list.FOLDR f e (map (list.FOLDR f e) l)

f.
    combin.ASSOC f
    e.
      combin.RIGHT_ID f e
      l.
        list.FOLDL f e (concat l) = list.FOLDL f e (map (list.FOLDL f e) l)

R P M D x.
    wellFounded R relation.INDUCTIVE_INVARIANT_ON R D P M D x
    P x (relation.WFREC R M x)

R. relation.diamond R x y z. R x y R x z u. R y u R z u

R.
    (x. relation.RTC R x x)
    x y z. R x y relation.RTC R y z relation.RTC R x z

R.
    (x. relation.RTC R x x)
    x y z. relation.RTC R x y R y z relation.RTC R x z

R.
    (x. pred_set.FINITE (pred_set.GSPEC (λy. (y, R x y))))
    wellFounded (relation.inv R)
    x. pred_set.FINITE (pred_set.GSPEC (λy. (y, relation.RTC R x y)))

p f.
    poset.poset p poset.complete p
    poset.function (poset.carrier p) (poset.carrier p) f
    poset.monotonic p f x. poset.gfp p f x

p f.
    poset.poset p poset.complete p
    poset.function (poset.carrier p) (poset.carrier p) f
    poset.monotonic p f x. poset.lfp p f x

pred_set.equiv_on R s
  t.
    bool.IN t (pred_set.partition R s)
    e1 e2. bool.IN e1 t bool.IN e2 t R e1 e2

indexedLists.LIST_RELi R l1 l2
  length l1 = length l2
  i. i < length l1 R i (list.EL i l1) (list.EL i l2)

(n. n 0 n = 0) m n. m suc n m = suc n m n

(f x. arithmetic.FUNPOW f 0 x = x)
  f n x. arithmetic.FUNPOW f (suc n) x = arithmetic.FUNPOW f n (f x)

n a.
    0 < numeral.onecount n a 0 < n
    n =
    arithmetic.-
      (arithmetic.BIT2 0 arithmetic.- (numeral.onecount n a) a) 1

ys x i k.
    list.EL i (list.LUPDATE x k ys) =
    if i = k k < length ys then x else list.EL i ys

l1 l2.
    length l1 = length l2
    length (list.ZIP (l1, l2)) = length l1
    length (list.ZIP (l1, l2)) = length l2

f s.
    (x y. f x = f y x = y) pred_set.FINITE s
    pred_set.CARD (pred_set.IMAGE f s) = pred_set.CARD s

R.
    (x. relation.WFP R x (y. R y x P y) P x)
    x. relation.WFP R x P x

bool.TYPE_DEFINITION =
  λP rep.
    (x' x''. rep x' = rep x'' x' = x'') x. P x x'. x = rep x'

concat [] = [] concat ([] :: t) = concat t
  concat ((h :: t1) :: t2) = h :: concat (t1 :: t2)

unzip [] = ([], [])
  unzip ((x, y) :: t) =
  bool.LET (pair.UNCURRY (λL1 L2. (x :: L1, y :: L2))) (unzip t)

0 mod arithmetic.BIT2 0 = 0 (n. bit1 n mod arithmetic.BIT2 0 = 1)
  n. arithmetic.BIT2 n mod arithmetic.BIT2 0 = 0

option.OPTION_MAP2 f o1 o2 = some v
  x1 x2. o1 = some x1 o2 = some x2 v = f x1 x2

(x. list.FRONT (x :: []) = [])
  x y z. list.FRONT (x :: y :: z) = x :: list.FRONT (y :: z)

(e. pred_set.MIN_SET (pred_set.INSERT e pred_set.EMPTY) = e)
  s e1 e2.
    pred_set.MIN_SET (pred_set.INSERT e1 (pred_set.INSERT e2 s)) =
    min e1 (pred_set.MIN_SET (pred_set.INSERT e2 s))

(v f. list.list_CASE [] v f = v)
  a0 a1 v f. list.list_CASE (a0 :: a1) v f = f a0 a1

(x y. R x y f x = f y) x y. relation.RC R x y f x = f y

(x y. R x y f x = f y) x y. relation.RTC R x y f x = f y

(x y. R x y f x = f y) x y. relation.SC R x y f x = f y

(x y. R x y f x = f y) x y. transitiveClosure R x y f x = f y

(x y. P x R x y P y) x y. P x relation.RC R x y P y

(x y. P x R x y P y) x y. P x relation.RTC R x y P y

(x y. P x R x y P y) x y. P x transitiveClosure R x y P y

(x f f1. sum.sum_CASE (left x) f f1 = f x)
  y f f1. sum.sum_CASE (right y) f f1 = f1 y

(P Q x. sum.SUM_ALL P Q (left x) P x)
  P Q y. sum.SUM_ALL P Q (right y) Q y

(f g x. basicSize.sum_size f g (left x) = f x)
  f g y. basicSize.sum_size f g (right y) = g y

v l1 x l2 l3.
    list.LUPDATE v (length l1) ((l1 @ x :: []) @ l2) = (l1 @ v :: []) @ l2

t. (( t) t) ((t ) t) (( t) ¬t) ((t ) ¬t)

m n x y z.
    arithmetic.NRC R m x y arithmetic.NRC R n y z
    arithmetic.NRC R (m + n) x z

m n x z.
    arithmetic.NRC R (m + n) x z
    y. arithmetic.NRC R m x y arithmetic.NRC R n y z

x y z. 0 < z (y div z = x x * z y y < suc x * z)

n a b.
    bit.BITWISE (suc n) (λx y. ¬x) a b =
    arithmetic.- (arithmetic.- (arithmetic.BIT2 0 suc n) 1)
      (bit.BITS n 0 a)

n a b. 1 < a 0 < b logroot.LOG a (a n * b) = n + logroot.LOG a b

n m a.
    n < m a < arithmetic.BIT2 0 m
    a div arithmetic.BIT2 0 n < arithmetic.BIT2 0 m

n m l.
    n + m length l
    rich_list.SEG n m l =
    rich_list.LASTN n
      (rich_list.BUTLASTN (arithmetic.- (length l) (n + m)) l)

m n l.
    m n n length l
    rich_list.BUTLASTN m (rich_list.LASTN n l) =
    rich_list.LASTN (arithmetic.- n m) (rich_list.BUTLASTN m l)

x n op a b.
    x < n
    (bit.BIT x (bit.BITWISE n op a b) op (bit.BIT x a) (bit.BIT x b))

l1 l2.
    l1 = l2
    length l1 = length l2 x. x < length l1 list.EL x l1 = list.EL x l2

l1 l2.
    length l1 = length l2
    (x. x < length l1 list.EL x l1 = list.EL x l2) l1 = l2

P f.
    bool.RES_EXISTS_UNIQUE P f
    bool.RES_EXISTS P (λx. f x)
    bool.RES_FORALL P (λx. bool.RES_FORALL P (λy. f x f y x = y))

s f b.
    pred_set.ITSET f s b =
    if pred_set.FINITE s then
      if s = pred_set.EMPTY then b
      else pred_set.ITSET f (pred_set.REST s) (f (pred_set.CHOICE s) b)
    else bool.ARB

f s.
    pred_set.FINITE s
    e.
      pred_set.SUM_IMAGE f (pred_set.DELETE s e) =
      if bool.IN e s then arithmetic.- (pred_set.SUM_IMAGE f s) (f e)
      else pred_set.SUM_IMAGE f s

R f.
    transitive R (n. R (f n) (f (suc n))) m n. m < n R (f m) (f n)

f.
    sum.IS_SUM_REP f
    v1 v2. f = (λb x y. x = v1 b) f = λb x y. y = v2 ¬b

¬pred_set.FINITE pred_set.UNIV
  f. (x y. f x = f y x = y) y. x. ¬(f x = y)

divides.divides m (gcd.lcm m n) divides.divides n (gcd.lcm m n)
  p.
    divides.divides m p divides.divides n p
    divides.divides (gcd.lcm m n) p

x y. 1 < x * y 0 < x 1 < y 0 < y 1 < x

m n. m + n = 1 m = 1 n = 0 m = 0 n = 1

m n.
    1 < m 0 < n
    logroot.LOG m n = if n < m then 0 else suc (logroot.LOG m (n div m))

ys k x y.
    list.LUPDATE x k (list.SNOC y ys) =
    if k = length ys then list.SNOC x ys
    else list.SNOC y (list.LUPDATE x k ys)

l1 l2 n x.
    length l1 n
    list.LUPDATE x n (l1 @ l2) =
    l1 @ list.LUPDATE x (arithmetic.- n (length l1)) l2

ls f n.
    n = length ls (i. i < n f i = list.EL i ls)
    list.GENLIST f n = ls

f s y.
    pred_set.LINV_OPT f s y =
    if bool.IN y (pred_set.IMAGE f s) then
      some (select x. bool.IN x s f x = y)
    else none

P.
    (rep. bool.TYPE_DEFINITION P rep)
    rep abs. (a. abs (rep a) = a) r. P r rep (abs r) = r

P n.
    (l. length l = suc n P l)
    l. length l = n let l l in a. P (a :: l)

ZRECSPACE'.
    ZRECSPACE' ind_type.ZBOT
    (c i r.
       (n. ZRECSPACE' (r n)) ZRECSPACE' (ind_type.ZCONSTR c i r))
    a0. ind_type.ZRECSPACE a0 ZRECSPACE' a0

pred_set.equiv_on R s
  t1 t2.
    bool.IN t1 (pred_set.partition R s)
    bool.IN t2 (pred_set.partition R s) ¬(t1 = t2)
    pred_set.DISJOINT t1 t2

numeral_bit.iLOG2 0 = 0
  (n. numeral_bit.iLOG2 (bit1 n) = 1 + numeral_bit.iLOG2 n)
  n. numeral_bit.iLOG2 (arithmetic.BIT2 n) = 1 + numeral_bit.iLOG2 n

(b. numposrep.l2n b [] = 0)
  b h t. numposrep.l2n b (h :: t) = h mod b + b * numposrep.l2n b t

(P. list.dropWhile P [] = [])
  P h t.
    list.dropWhile P (h :: t) = if P h then list.dropWhile P t else h :: t

(P. rich_list.PREFIX P [] = [])
  P x l.
    rich_list.PREFIX P (x :: l) =
    if P x then x :: rich_list.PREFIX P l else []

(f. list.list_size f [] = 0)
  f a0 a1. list.list_size f (a0 :: a1) = 1 + (f a0 + list.list_size f a1)

(P. list.EVERYi P [] )
  P h t. list.EVERYi P (h :: t) P 0 h list.EVERYi (P suc) t

(f. indexedLists.MAPi f [] = [])
  f h t.
    indexedLists.MAPi f (h :: t) = f 0 h :: indexedLists.MAPi (f suc) t

l1 @ l2 = e :: [] l1 = e :: [] l2 = [] l1 = [] l2 = e :: []

map f l = h :: t x0 t0. l = x0 :: t0 h = f x0 t = map f t0

pred_set.DISJOINT x (list.LIST_TO_SET (list.GENLIST ((+) n) (a + b)))
  pred_set.DISJOINT x (list.LIST_TO_SET (list.GENLIST ((+) n) a))
  pred_set.DISJOINT x (list.LIST_TO_SET (list.GENLIST ((+) (n + a)) b))

list.LIST_REL (λa b. P a b Q a b) l1 l2
  list.LIST_REL (λa b. P a b) l1 l2 list.LIST_REL (λa b. Q a b) l1 l2

(x y. R x y R (f x) (f y))
  x y. relation.RC R x y relation.RC R (f x) (f y)

(x y. R x y R (f x) (f y))
  x y. relation.RTC R x y relation.RTC R (f x) (f y)

(x y. R x y R (f x) (f y))
  x y. relation.SC R x y relation.SC R (f x) (f y)

(x y. R x y R (f x) (f y))
  x y. transitiveClosure R x y transitiveClosure R (f x) (f y)

(m m * n m = 0 0 < n) (m n * m m = 0 0 < n)

(m * n < m 0 < m n = 0) (m * n < n 0 < n m = 0)

length (fst ps) = length (snd ps)
  bool.IN p (list.LIST_TO_SET (list.ZIP ps))
  bool.IN (fst p) (list.LIST_TO_SET (fst ps))
  bool.IN (snd p) (list.LIST_TO_SET (snd ps))

h l x y n.
    h x y l bit.SLICE h l (bit.SLICE x y n) = bit.SLICE h l n

n m l.
    n + m length l
    rich_list.SEG n m (reverse l) =
    reverse (rich_list.SEG n (arithmetic.- (length l) (n + m)) l)

l1 l2.
    length l1 = length l2
    f.
      length (list.MAP2 f l1 l2) = length l1
      length (list.MAP2 f l1 l2) = length l2

l1 l2.
    length l1 = length l2
    f a.
      list.FOLDL2 f a l1 l2 =
      list.FOLDL (λa. pair.UNCURRY (f a)) a (list.ZIP (l1, l2))

f a b c d.
    ¬(a = b)
    combin.UPDATE a c (combin.UPDATE b d f) =
    combin.UPDATE b d (combin.UPDATE a c f)

f.
    pred_set.SUM_IMAGE f pred_set.EMPTY = 0
    e s.
      pred_set.FINITE s
      pred_set.SUM_IMAGE f (pred_set.INSERT e s) =
      f e + pred_set.SUM_IMAGE f (pred_set.DELETE s e)

Q P.
    (n. P n) (n. (m. m < n ¬P m) P n Q n) Q (while.LEAST P)

R.
    relation.rcdiamond R
    x y z. R x y R x z u. relation.RC R y u relation.RC R z u

R.
    relation.WCR R
    x y z. R x y R x z u. relation.RTC R y u relation.RTC R z u

(x. bit.BIT_REVERSE 0 x = 0)
  n x.
    bit.BIT_REVERSE (suc n) x =
    bit.BIT_REVERSE n x * arithmetic.BIT2 0 + bit.SBIT (bit.BIT n x) 0

(f l. list.GENLIST_AUX f 0 l = l)
  f n l. list.GENLIST_AUX f (suc n) l = list.GENLIST_AUX f n (f n :: l)

n a.
    numpair.invtri0 n a =
    if n < a + 1 then (n, a)
    else numpair.invtri0 (arithmetic.- n (a + 1)) (a + 1)

a n.
    1 < a 0 < n a logroot.LOG a n n n < a suc (logroot.LOG a n)

s r x y. poset.poset (s, r) s x s y r x y r y x x = y

s.
    pred_set.FINITE s
    f x b.
      pred_set.ITSET f (pred_set.INSERT x s) b =
      pred_set.ITSET f (pred_set.REST (pred_set.INSERT x s))
        (f (pred_set.CHOICE (pred_set.INSERT x s)) b)

g f.
    combin.FCOMM g f
    e.
      combin.LEFT_ID g e
      l.
        list.FOLDR f e (concat l) = list.FOLDR g e (map (list.FOLDR f e) l)

R P M.
    relation.INDUCTIVE_INVARIANT R P M
    f x. (y. R y x P y (f y)) P x (M f x)

f g.
    combin.FCOMM f g
    e.
      combin.RIGHT_ID g e
      l.
        list.FOLDL f e (concat l) = list.FOLDL g e (map (list.FOLDL f e) l)

P l1 l2 v1 v2 n.
    P v1 v2 list.LIST_REL P l1 l2
    list.LIST_REL P (list.LUPDATE v1 n l1) (list.LUPDATE v2 n l2)

list.splitAtPki P k l =
  option.option_CASE (while.OLEAST (λi. i < length l P i (list.EL i l)))
    (k l []) (λi. k (list.TAKE i l) (list.DROP i l))

pred_set.SING (pred_set.UNION s t)
  pred_set.SING s t = pred_set.EMPTY
  pred_set.SING t s = pred_set.EMPTY
  pred_set.SING s pred_set.SING t s = t

pred_set.INJ f s t
  x y.
    pred_set.LINV_OPT f s y = some x y = f x bool.IN x s bool.IN y t

unzip [] = ([], [])
  x l. unzip (x :: l) = (fst x :: fst (unzip l), snd x :: snd (unzip l))

map f l = l1 @ l2
  l10 l20. l = l10 @ l20 l1 = map f l10 l2 = map f l20

(x. bool.IN x (list.LIST_TO_SET []) )
  x h t.
    bool.IN x (list.LIST_TO_SET (h :: t))
    x = h bool.IN x (list.LIST_TO_SET t)

while.OLEAST (λn. n = x) = some x while.OLEAST (λn. x = n) = some x
  while.OLEAST (λn. ) = none while.OLEAST (λm. ) = some 0

(f g a. sum.++ f g (left a) = left (f a))
  f g b. sum.++ f g (right b) = right (g b)

a x r.
    1 < a 0 < x 0 < r
    logroot.LOG a (logroot.ROOT r x) = logroot.LOG a x div r

l i j.
    j i i + 1 < length l
    list.EL i (indexedLists.delN j l) = list.EL (i + 1) l

l n1 n2.
    list.ALL_DISTINCT l n1 < length l n2 < length l
    (list.EL n1 l = list.EL n2 l n1 = n2)

l.
    list.ALL_DISTINCT l
    n1 n2.
      n1 < length l n2 < length l
      (list.EL n1 l = list.EL n2 l n1 = n2)

f g M N. M = N (x. x = N f x = g x) bool.LET f M = bool.LET g N

f s f' s'.
    s = s' (x. bool.IN x s' f x = f' x)
    pred_set.IMAGE f s = pred_set.IMAGE f' s'

s r f.
    poset.monotonic (s, r) f x y. s x s y r x y r (f x) (f y)

f.
    pred_set.PROD_IMAGE f pred_set.EMPTY = 1
    e s.
      pred_set.FINITE s
      pred_set.PROD_IMAGE f (pred_set.INSERT e s) =
      f e * pred_set.PROD_IMAGE f (pred_set.DELETE s e)

R s.
    pred_set.partition R s =
    pred_set.GSPEC
      (λt.
         (t,
          (x.
             bool.IN x s
             t = pred_set.GSPEC (λy. (y, bool.IN y s R x y)))))

0 < m 0 < n
  p. 0 < p p < gcd.lcm m n ¬divides.divides m p ¬divides.divides n p

(m a. numposrep.BOOLIFY 0 m a = a)
  n m a.
    numposrep.BOOLIFY (suc n) m a =
    numposrep.BOOLIFY n (arithmetic.DIV2 m) (odd m :: a)

n a b p. 0 < n ((a + p) mod n = (b + p) mod n a mod n = b mod n)

b l.
    1 < b all ((>) b) l ¬(numposrep.l2n b l = 0)
    suc (logroot.LOG b (numposrep.l2n b l)) length l

l1 l2.
    length l1 = length l2
    x1 x2.
      list.ZIP (list.SNOC x1 l1, list.SNOC x2 l2) =
      list.SNOC (x1, x2) (list.ZIP (l1, l2))

f1 f2 l1 l2.
    map f1 l1 = map f2 l2
    length l1 = length l2 list.LIST_REL (λx y. f1 x = f2 y) l1 l2

P Q P0 Q0.
    pred_set.SUBSET (pred_set.CROSS P0 Q0) (pred_set.CROSS P Q)
    P0 = pred_set.EMPTY Q0 = pred_set.EMPTY
    pred_set.SUBSET P0 P pred_set.SUBSET Q0 Q

%%genvar%%11655 B.
    pred_set.FINITE %%genvar%%11655 pred_set.FINITE B
    ¬(%%genvar%%11655 = pred_set.EMPTY) ¬(B = pred_set.EMPTY)
    pred_set.MIN_SET (pred_set.UNION %%genvar%%11655 B) =
    min (pred_set.MIN_SET %%genvar%%11655) (pred_set.MIN_SET B)

P Q.
    ¬(P = pred_set.EMPTY)
    (x. (y. bool.IN y P x y) bool.IN x P Q x)
    Q (pred_set.MIN_SET P)

R l1 l2.
    list.LIST_REL R l1 l2
    length l1 = length l2
    n. n < length l1 R (list.EL n l1) (list.EL n l2)

(list.isPREFIX [] l ) (list.isPREFIX (h :: t) [] )
  (list.isPREFIX (h1 :: t1) (h2 :: t2) h1 = h2 list.isPREFIX t1 t2)

numeral.texp_help 0 acc = arithmetic.BIT2 acc
  numeral.texp_help (bit1 n) acc =
  numeral.texp_help (prim_rec.PRE (bit1 n)) (bit1 acc)
  numeral.texp_help (arithmetic.BIT2 n) acc =
  numeral.texp_help (bit1 n) (bit1 acc)

(x. indexedLists.findi x [] = 0)
  x h t.
    indexedLists.findi x (h :: t) =
    if x = h then 0 else 1 + indexedLists.findi x t

(l. list.isPREFIX [] l )
  h t l.
    list.isPREFIX (h :: t) l
    list.list_CASE l (λh' t'. h = h' list.isPREFIX t t')

(P. filter P [] = [])
  P h t. filter P (h :: t) = if P h then h :: filter P t else filter P t

(f e. list.FOLDR f e [] = e)
  f e x l. list.FOLDR f e (x :: l) = f x (list.FOLDR f e l)

(f e. list.FOLDL f e [] = e)
  f e x l. list.FOLDL f e (x :: l) = list.FOLDL f (f e x) l

(m < m * n 0 < m 1 < n) (m < n * m 0 < m 1 < n)

(m * n m m = 0 n 1) (m * n n n = 0 m 1)

(x y. R x y Q (f x) (f y)) transitive Q
  x y. transitiveClosure R x y Q (f x) (f y)

x ls n.
    bool.IN x (list.LIST_TO_SET (list.DROP n ls))
    n < length ls x = list.EL n ls
    bool.IN x (list.LIST_TO_SET (list.DROP (suc n) ls))

h1 l1 h2 l2 n.
    h2 + l1 h1
    bit.BITS h2 l2 (bit.BITS h1 l1 n) = bit.BITS (h2 + l1) (l2 + l1) n

h l n.
    l suc h
    bit.SBIT (bit.BIT (suc h) n) (arithmetic.- (suc h) l) +
    bit.BITS h l n = bit.BITS (suc h) l n

n q r.
    0 < n 0 < q r n
    arithmetic.- (q * n) r mod n = arithmetic.- n r mod n

b x n.
    1 < b x < length (numposrep.n2l b n)
    list.EL x (numposrep.n2l b n) = n div b x mod b

b x y.
    1 < b 0 < y x < b
    logroot.LOG b (b * y + x) = suc (logroot.LOG b y)

a b.
    divides.divides (gcd.gcd a b) a divides.divides (gcd.gcd a b) b
    d.
      divides.divides d a divides.divides d b
      divides.divides d (gcd.gcd a b)

l n1 n2.
    length l = n1 + n2
    l1 l2. length l1 = n1 length l2 = n2 l = l1 @ l2

l1 l2 f f'.
    l1 = l2 (x. bool.IN x (list.LIST_TO_SET l2) f x = f' x)
    map f l1 = map f' l2

l1 l2 P P'.
    l1 = l2 (x. bool.IN x (list.LIST_TO_SET l2) (P x P' x))
    (all P l1 all P' l2)

l1 l2 P P'.
    l1 = l2 (x. bool.IN x (list.LIST_TO_SET l2) (P x P' x))
    (any P l1 any P' l2)

M N f f'.
    M = N (x. bool.IN x (list.LIST_TO_SET N) f x = f' x)
    list.list_size f M = list.list_size f' N

l1 l2 n.
    length l1 = length l2 n < length l1
    list.EL n (list.ZIP (l1, l2)) = (list.EL n l1, list.EL n l2)

opt1 opt2 f1 f2.
    opt1 = opt2 (x. opt2 = some x f1 x = f2 x)
    map f1 opt1 = map f2 opt2

opt opt' P P'.
    opt = opt' (x. opt' = some x (P x P' x))
    (option.OPTION_ALL P opt option.OPTION_ALL P' opt')

o1 o2 f1 f2.
    o1 = o2 (x. o2 = some x f1 x = f2 x)
    option.OPTION_BIND o1 f1 = option.OPTION_BIND o2 f2

f x ls.
    list.ALL_DISTINCT ls
    (bool.IN x (list.LIST_TO_SET (list.ZIP (ls, map f ls)))
     bool.IN (fst x) (list.LIST_TO_SET ls) snd x = f (fst x))

f s t.
    pred_set.FINITE s pred_set.FINITE t
    pred_set.SUM_IMAGE f (pred_set.UNION s t) =
    arithmetic.- (pred_set.SUM_IMAGE f s + pred_set.SUM_IMAGE f t)
      (pred_set.SUM_IMAGE f (pred_set.INTER s t))

fun x f n.
    prim_rec.SIMP_REC_REL fun x f n
    fun 0 = x m. m < n fun (suc m) = f (fun m)

R.
    list.LIST_REL R [] []
    h1 h2 t1 t2.
      R h1 h2 list.LIST_REL R t1 t2
      list.LIST_REL R (h1 :: t1) (h2 :: t2)

f. a n. 1 < a 0 < n a f a n n n < a suc (f a n)

numeral.exactlog 0 = 0 (n. numeral.exactlog (bit1 n) = 0)
  n.
    numeral.exactlog (arithmetic.BIT2 n) =
    bool.LET (λx. if x = 0 then 0 else bit1 x) (numeral.onecount n 0)

(x. numeral.onecount 0 x = x)
  (n x. numeral.onecount (bit1 n) x = numeral.onecount n (suc x))
  n x. numeral.onecount (arithmetic.BIT2 n) x = 0

((n. ¬P n) Q none) (n. P n (m. m < n ¬P m) Q (some n))
  Q (while.OLEAST P)

c1 i1 r1 c2 i2 r2.
    ind_type.CONSTR c1 i1 r1 = ind_type.CONSTR c2 i2 r2
    c1 = c2 i1 = i2 r1 = r2

h m l n.
    suc m h l m
    bit.SLICE h (suc m) n + bit.SLICE m l n = bit.SLICE h l n

a b c.
    gcd.is_gcd a b c
    divides.divides c a divides.divides c b
    d. divides.divides d a divides.divides d b divides.divides d c

a b.
    divides.divides a b
    if a = 0 then b = 0
    else if a = 1 then
    else if b = 0 then
    else b mod a = 0

n b.
    numposrep.n2l b n =
    if n < b b < arithmetic.BIT2 0 then n mod b :: []
    else n mod b :: numposrep.n2l b (n div b)

n. 0 < n x. ¬((x + 1) mod n = 0) (x + 1) mod n = x mod n + 1

l1 m n l2.
    length l1 m n length l2
    rich_list.SEG n m (l1 @ l2) =
    rich_list.SEG n (arithmetic.- m (length l1)) l2

xs ys xs1 ys1.
    list.LIST_REL P (xs @ xs1) (ys @ ys1) length xs = length ys
    list.LIST_REL P xs ys list.LIST_REL P xs1 ys1

P. (n. P n) (x. y. y > x ¬P y) x. P x y. y > x ¬P y

P.
    P pred_set.EMPTY
    (s.
       pred_set.FINITE s P s
       e. ¬bool.IN e s P (pred_set.INSERT e s))
    s. pred_set.FINITE s P s

0 < n
  n bit1 x div n = n arithmetic.- (bit1 x) 1
  n arithmetic.BIT2 x div n = n bit1 x

list.ZIP ([], []) = []
  x1 l1 x2 l2.
    list.ZIP (x1 :: l1, x2 :: l2) = (x1, x2) :: list.ZIP (l1, l2)

arithmetic.BIT2 0 0 = 1
  arithmetic.BIT2 0 bit1 n =
  numeral.texp_help (prim_rec.PRE (bit1 n)) 0
  arithmetic.BIT2 0 arithmetic.BIT2 n = numeral.texp_help (bit1 n) 0

list.LIST_REL R l1 l2 list.LIST_REL R l3 l4
  list.LIST_REL R (l1 @ l3) (l2 @ l4) length l1 = length l2
  length l3 = length l4

x f.
    (n. prim_rec.PRIM_REC_FUN x f 0 n = x)
    m n.
      prim_rec.PRIM_REC_FUN x f (suc m) n =
      f (prim_rec.PRIM_REC_FUN x f m (prim_rec.PRE n)) n

t. ( t t) (t t) ( t ) (t ) (t t t)

t. ( t ) (t ) ( t t) (t t) (t t t)

h l n.
    bit.BITS (suc h) l n =
    if suc h < l then 0
    else
      bit.SBIT (bit.BIT (suc h) n) (arithmetic.- (suc h) l) +
      bit.BITS h l n

n a b.
    n length a length a = length b
    list.ZIP (list.TAKE n a, list.TAKE n b) = list.TAKE n (list.ZIP (a, b))

c.
    0 < c
    ((n. n < c P n)
     P (arithmetic.- c 1) n. n < arithmetic.- c 1 P n)

c.
    0 < c
    ((n. n < c P n)
     P (arithmetic.- c 1) n. n < arithmetic.- c 1 P n)

a b n.
    n length a length a = length b
    list.ZIP (list.DROP n a, list.DROP n b) = list.DROP n (list.ZIP (a, b))

G f s.
    while.OWHILE G f s =
    if (n. ¬G (arithmetic.FUNPOW f n s)) then
      some
        (arithmetic.FUNPOW f
           (while.LEAST (λn. ¬G (arithmetic.FUNPOW f n s))) s)
    else none

G f s.
    P s (x. P x G x P (f x))
    s'. while.OWHILE G f s = some s' P s'

P m n. 0 < n (P (m div n) q r. m = q * n + r r < n P q)

P p q. 0 < q (P (p div q) k r. p = k * q + r r < q P k)

P m n. 0 < n (P (m mod n) q r. m = q * n + r r < n P r)

P p q. 0 < q (P (p mod q) k r. p = k * q + r r < q P r)

P.
    (b n. (¬(n < b b < arithmetic.BIT2 0) P b (n div b)) P b n)
    v v1. P v v1

P.
    (pred_set.BIGUNION P = pred_set.EMPTY
     P = pred_set.EMPTY
     P = pred_set.INSERT pred_set.EMPTY pred_set.EMPTY)
    (pred_set.EMPTY = pred_set.BIGUNION P
     P = pred_set.EMPTY
     P = pred_set.INSERT pred_set.EMPTY pred_set.EMPTY)

P.
    (s b.
       (pred_set.FINITE s ¬(s = pred_set.EMPTY)
        P (pred_set.REST s) (f (pred_set.CHOICE s) b)) P s b)
    v v1. P v v1

l1 @ l2 = h :: t
  l1 = [] l2 = h :: t lt. l1 = h :: lt t = lt @ l2

(f x. numeral_bit.SFUNPOW f 0 x = x)
  f n x.
    numeral_bit.SFUNPOW f (suc n) x =
    if x = 0 then 0 else numeral_bit.SFUNPOW f n (f x)

zf b1f b2f.
    f.
      f 0 = zf (n. f (bit1 n) = b1f n (f n))
      n. f (arithmetic.BIT2 n) = b2f n (f n)

f R D P M x.
    f = relation.WFREC R M wellFounded R
    relation.INDUCTIVE_INVARIANT_ON R D P M D x P x (f x)

ZRECSPACE'.
    ZRECSPACE' ind_type.ZBOT
    (c i r.
       (n. ind_type.ZRECSPACE (r n) ZRECSPACE' (r n))
       ZRECSPACE' (ind_type.ZCONSTR c i r))
    a0. ind_type.ZRECSPACE a0 ZRECSPACE' a0

factorial 0 = 1
  (n. factorial (bit1 n) = bit1 n * factorial (prim_rec.PRE (bit1 n)))
  n.
    factorial (arithmetic.BIT2 n) = arithmetic.BIT2 n * factorial (bit1 n)

0 + m = m m + 0 = m suc m + n = suc (m + n) m + suc n = suc (m + n)

(i. indexedLists.delN i [] = [])
  i h t.
    indexedLists.delN i (h :: t) =
    if i = 0 then t else h :: indexedLists.delN (arithmetic.- i 1) t

(n. list.DROP n [] = [])
  n x xs.
    list.DROP n (x :: xs) =
    if n = 0 then x :: xs else list.DROP (arithmetic.- n 1) xs

(n. list.TAKE n [] = [])
  n x xs.
    list.TAKE n (x :: xs) =
    if n = 0 then [] else x :: list.TAKE (arithmetic.- n 1) xs

pred_set.INTER (pred_set.UNION A B) A = A
  pred_set.INTER (pred_set.UNION B A) A = A
  pred_set.INTER A (pred_set.UNION A B) = A
  pred_set.INTER A (pred_set.UNION B A) = A

(list.LIST_REL P (map f l1) l2 list.LIST_REL (λx y. P (f x) y) l1 l2)
  (list.LIST_REL Q l1 (map g l2) list.LIST_REL (λx y. Q x (g y)) l1 l2)

t. ( t t) (t ) ( t ) (t t ) (t ¬t)

n m p. (p < max m n p < m p < n) (max m n < p m < p n < p)

n m p. (p max m n p m p n) (max m n p m p n p)

n m p. (min m n < p m < p n < p) (p < min m n p < m p < n)

n m p. (min m n p m p n p) (p min m n p m p n)

s t u.
    (pred_set.DISJOINT (pred_set.UNION s t) u
     pred_set.DISJOINT s u pred_set.DISJOINT t u)
    (pred_set.DISJOINT u (pred_set.UNION s t)
     pred_set.DISJOINT s u pred_set.DISJOINT t u)

%%genvar%%10716 s x.
    pred_set.FINITE (pred_set.IMAGE %%genvar%%10716 s)
    ¬bool.IN (%%genvar%%10716 x) (pred_set.IMAGE %%genvar%%10716 s)
    pred_set.PROD_SET
      (pred_set.IMAGE %%genvar%%10716 (pred_set.INSERT x s)) =
    %%genvar%%10716 x *
    pred_set.PROD_SET (pred_set.IMAGE %%genvar%%10716 s)

g f.
    combin.FCOMM g f
    e.
      combin.LEFT_ID g e
      l1 l2.
        list.FOLDR f e (l1 @ l2) =
        g (list.FOLDR f e l1) (list.FOLDR f e l2)

f g.
    combin.FCOMM f g
    e.
      combin.RIGHT_ID g e
      l1 l2.
        list.FOLDL f e (l1 @ l2) =
        g (list.FOLDL f e l1) (list.FOLDL f e l2)

ind_type.ZRECSPACE =
  λa0.
    ZRECSPACE'.
      (a0.
         a0 = ind_type.ZBOT
         (c i r. a0 = ind_type.ZCONSTR c i r n. ZRECSPACE' (r n))
         ZRECSPACE' a0) ZRECSPACE' a0

arithmetic.findq (a, m, n) =
  if n = 0 then a
  else
    bool.LET
      (λd.
         if m < d then a
         else arithmetic.findq (arithmetic.BIT2 0 * a, m, d))
      (arithmetic.BIT2 0 * n)

(a x f. combin.UPDATE a x f a = x)
  a b x f. ¬(a = b) combin.UPDATE a x f b = f b

(option.OPTION_IGNORE_BIND m1 m2 = none m1 = none m2 = none)
  (option.OPTION_IGNORE_BIND m1 m2 = some y
   x. m1 = some x m2 = some y)

m n.
    logroot.LOG m n =
    if m < arithmetic.BIT2 0 n = 0 then
      combin.FAIL logroot.LOG base < 2 or n = 0 m n
    else if n < m then 0
    else suc (logroot.LOG m (n div m))

b.
    1 < b
    l.
      ¬(l = []) 0 < last l all ((>) b) l
      logroot.LOG b (numposrep.l2n b l) = prim_rec.PRE (length l)

f1 f2 a b c.
    combin.UPDATE a b f1 = combin.UPDATE a c f2
    b = c v. combin.UPDATE a v f1 = combin.UPDATE a v f2

P.
    pred_set.FINITE P
    f p.
      bool.IN p P (q. bool.IN q P f p = f q)
      pred_set.SUM_IMAGE f P = pred_set.CARD P * f p

R.
    (x y. R x y transitiveClosure R x y)
    x y z.
      transitiveClosure R x y transitiveClosure R y z
      transitiveClosure R x z

p f.
    poset.poset p poset.complete p
    poset.function (poset.carrier p) (poset.carrier p) f
    poset.monotonic p f (x. poset.lfp p f x) x. poset.gfp p f x

numpair.tri 0 = 0
  (n.
     numpair.tri (bit1 n) =
     bit1 n + numpair.tri (arithmetic.- (bit1 n) 1))
  n.
    numpair.tri (arithmetic.BIT2 n) =
    arithmetic.BIT2 n + numpair.tri (bit1 n)

pred_set.pairwise R (pred_set.UNION s1 s2)
  pred_set.pairwise R s1 pred_set.pairwise R s2
  x y. bool.IN x s1 bool.IN y s2 R x y R y x

(f a. indexedLists.FOLDRi f a [] = a)
  f a h t.
    indexedLists.FOLDRi f a (h :: t) =
    f 0 h (indexedLists.FOLDRi (f suc) a t)

(l1 l2 l3. l1 @ l2 = l1 @ l3 l2 = l3)
  l1 l2 l3. l2 @ l1 = l3 @ l1 l2 = l3

(x y. R x y Q (f x) (f y)) reflexive Q transitive Q
  x y. relation.RTC R x y Q (f x) (f y)

h l a b.
    (x. l x x h (bit.BIT x a bit.BIT x b))
    bit.BITS h l a = bit.BITS h l b

b l x.
    1 < b all ((>) b) l x < length l
    numposrep.l2n b l div b x mod b = list.EL x l

s r x y z. poset.poset (s, r) s x s y s z r x y r y z r x z

s r c.
    poset.chain (s, r) c x y. s x s y c x c y r x y r y x

M M' f.
    M = M' (x y. M' = (x, y) f x y = f' x y)
    pair.pair_CASE M f = pair.pair_CASE M' f'

P Q l1 l2.
    (x.
       bool.IN x (list.LIST_TO_SET (list.ZIP (l1, l2)))
       pair.UNCURRY P x pair.UNCURRY Q x) list.LIST_REL P l1 l2
    list.LIST_REL Q l1 l2

(f x. bit.BIT_MODIFY 0 f x = 0)
  n f x.
    bit.BIT_MODIFY (suc n) f x =
    bit.BIT_MODIFY n f x + bit.SBIT (f n (bit.BIT n x)) n

l1 l2 f1 f2.
    l1 = l2 (x n. bool.IN x (list.LIST_TO_SET l2) f1 n x = f2 n x)
    indexedLists.MAPi f1 l1 = indexedLists.MAPi f2 l2

l1 l1'.
    length l1 = length l1'
    l2 l2'.
      length l2 = length l2' (l1 @ l2 = l1' @ l2' l1 = l1' l2 = l2')

ls f.
    (x y.
       bool.IN x (list.LIST_TO_SET ls) bool.IN y (list.LIST_TO_SET ls)
       f x = f y x = y) list.ALL_DISTINCT ls
    list.ALL_DISTINCT (map f ls)

s.
    pred_set.FINITE s
    (¬(s = pred_set.EMPTY)
     bool.IN (pred_set.MAX_SET s) s
     y. bool.IN y s y pred_set.MAX_SET s)
    (s = pred_set.EMPTY pred_set.MAX_SET s = 0)

l1 = l2 (x n. x = list.EL n l2 n < length l2 f1 n x = f2 n x)
  indexedLists.MAPi f1 l1 = indexedLists.MAPi f2 l2

pred_set.BIJ f (pred_set.INSERT e s) t
  ¬bool.IN e s bool.IN (f e) t
  pred_set.BIJ f s (pred_set.DELETE t (f e))
  bool.IN e s pred_set.BIJ f s t

arithmetic.FUNPOW f 0 x = x
  arithmetic.FUNPOW f (bit1 n) x =
  arithmetic.FUNPOW f (prim_rec.PRE (bit1 n)) (f x)
  arithmetic.FUNPOW f (arithmetic.BIT2 n) x =
  arithmetic.FUNPOW f (bit1 n) (f x)

(%%genvar%%927. list.MAP2 %%genvar%%927 [] [] = [])
  %%genvar%%922 h1 t1 h2 t2.
    list.MAP2 %%genvar%%922 (h1 :: t1) (h2 :: t2) =
    %%genvar%%922 h1 h2 :: list.MAP2 %%genvar%%922 t1 t2

(f e. rich_list.SCANL f e [] = e :: [])
  f e x l. rich_list.SCANL f e (x :: l) = e :: rich_list.SCANL f (f e x) l

(x y. arithmetic.BIT2 0 x y x bit.LOG2 y)
  y x. 0 < x x arithmetic.BIT2 0 y bit.LOG2 x y

(%%genvar%%1168 x.
     0 < %%genvar%%1168
     (x + %%genvar%%1168) mod %%genvar%%1168 = x mod %%genvar%%1168)
  n x. 0 < n (n + x) mod n = x mod n

(l1 l2. [] = l1 @ l2 l1 = [] l2 = [])
  l1 l2. l1 @ l2 = [] l1 = [] l2 = []

(x y. R1 x y R2 x y) (x y. R3 x y R4 x y) pair.LEX R1 R3 x y
  pair.LEX R2 R4 x y

n a b.
    n length a length a length b
    list.ZIP (list.TAKE n a, list.TAKE n b) =
    list.TAKE n (list.ZIP (a, list.TAKE (length a) b))

b l.
    1 < b any (λy. ¬(0 = y)) l all ((>) b) l
    logroot.LOG b (numposrep.l2n b l) =
    prim_rec.PRE (length (list.dropWhile ((=) 0) (reverse l)))

n.
    0 < n
    m p. m mod n = 0 p mod n = 0 (m + p) div n = m div n + p div n

B C R.
    wellFounded R (s. B s R (C s) s)
    P. (s. (B s P (C s)) P s) x. P x

s r f x.
    poset.gfp (s, r) f x s x f x = x y. s y r y (f y) r y x

s r f x.
    poset.lfp (s, r) f x s x f x = x y. s y r (f y) y r x y

R x y.
    option.OPTREL R x y
    x = none y = none x0 y0. x = some x0 y = some y0 R x0 y0

h l a b.
    b < arithmetic.BIT2 0 l
    bit.BITS h l (a * arithmetic.BIT2 0 l + b) =
    bit.BITS h l (a * arithmetic.BIT2 0 l)

l1 l2 p.
    length l1 = length l2
    (bool.IN p (list.LIST_TO_SET (list.ZIP (l1, l2)))
     n. n < length l1 p = (list.EL n l1, list.EL n l2))

xs ys.
    map f1 xs @ map g1 ys = map f2 xs @ map g2 ys
    map f1 xs = map f2 xs map g1 ys = map g2 ys

P l l1 l2.
    filter P l = l1 @ l2
    l3 l4. l = l3 @ l4 filter P l3 = l1 filter P l4 = l2

P Q.
    pred_set.FINITE P (P = pred_set.EMPTY Q 0)
    (x. (y. bool.IN y P y x) bool.IN x P Q x)
    Q (pred_set.MAX_SET P)

f' f M' M.
    M = M' (x y. M' = (x, y) f x y = f' x y)
    pair.UNCURRY f M = pair.UNCURRY f' M'

l1 @ l2 = m1 @ m2
  (l. l1 = m1 @ l m2 = l @ l2) l. m1 = l1 @ l l2 = l @ m2

option.OPTION_MAP2 f (some x) (some y) = some (f x y)
  option.OPTION_MAP2 f (some x) none = none
  option.OPTION_MAP2 f none (some y) = none
  option.OPTION_MAP2 f none none = none

(s t.
     pred_set.DISJOINT (pred_set.BIGUNION s) t
     s'. bool.IN s' s pred_set.DISJOINT s' t)
  s t.
    pred_set.DISJOINT t (pred_set.BIGUNION s)
    s'. bool.IN s' s pred_set.DISJOINT t s'

n1 m1 n2 m2 l.
    n1 + m1 length l n2 + m2 n1
    rich_list.SEG n2 m2 (rich_list.SEG n1 m1 l) =
    rich_list.SEG n2 (m1 + m2) l

n a b.
    0 < n 1 < a 0 < b
    logroot.LOG a (a suc n * b) = suc (logroot.LOG a (a n * b))

l1 l2 P k.
    list.EVERYi (λi. (¬) P i) l1
    (0 < length l2 P (length l1) (head l2))
    list.splitAtPki P k (l1 @ l2) = k l1 l2

s.
    pred_set.FINITE s
    (x. bool.IN x s f x < g x) (x. bool.IN x s f x g x)
    pred_set.SUM_IMAGE f s < pred_set.SUM_IMAGE g s

P.
    (n a. (¬(n < a + 1) P (arithmetic.- n (a + 1)) (a + 1)) P n a)
    n a. P n a

(m f. bit.BIT_MODIFY m f 0 = numeral_bit.BIT_MODF m f 0 0 1 0)
  m f n. bit.BIT_MODIFY m f n = numeral_bit.BIT_MODF m f n 0 1 0

P Q x x' y y'.
    (P Q) (Q x = x') (¬Q y = y')
    (if P then x else y) = if Q then x' else y'

p n.
    0 < p
    numposrep.n2l (arithmetic.BIT2 0 p) n =
    bool.LET
      (pair.UNCURRY
         (λq r.
            if q = 0 then r :: []
            else r :: numposrep.n2l (arithmetic.BIT2 0 p) q))
      (bit.DIVMOD_2EXP p n)

n op a b.
    bit.BITWISE (suc n) op a b =
    arithmetic.BIT2 0 *
    bit.BITWISE n op (a div arithmetic.BIT2 0) (b div arithmetic.BIT2 0) +
    bit.SBIT (op (odd a) (odd b)) 0

f s t.
    pred_set.SURJ f s t
    (x. bool.IN x s bool.IN (f x) t)
    x. bool.IN x t y. bool.IN y s f y = x

(p q r) (p q r) (p ¬r ¬q) (q ¬r ¬p) (r ¬q ¬p)

(i P. list.INDEX_FIND i P [] = none)
  i P h t.
    list.INDEX_FIND i P (h :: t) =
    if P h then some (i, h) else list.INDEX_FIND (suc i) P t

(x y z. R x y R y z R x z)
  x y z. list.LIST_REL R x y list.LIST_REL R y z list.LIST_REL R x z

x f g1 g2 m1 m2.
    prim_rec.SIMP_REC_REL g1 x f m1 prim_rec.SIMP_REC_REL g2 x f m2
    n. n < m1 n < m2 g1 n = g2 n

x n op a b.
    x < n op (bit.BIT x a) (bit.BIT x b)
    bit.BITWISE n op a b div arithmetic.BIT2 0 x mod arithmetic.BIT2 0 =
    1

x n op a b.
    x < n ¬op (bit.BIT x a) (bit.BIT x b)
    bit.BITWISE n op a b div arithmetic.BIT2 0 x mod arithmetic.BIT2 0 =
    0

R.
    indexedLists.LIST_RELi R [] []
    h1 h2 l1 l2.
      R (length l1) h1 h2 indexedLists.LIST_RELi R l1 l2
      indexedLists.LIST_RELi R (l1 @ h1 :: []) (l2 @ h2 :: [])

transitiveClosure =
  λR a b.
    P. (x y. R x y P x y) (x y z. P x y P y z P x z) P a b

pred_set.INJ f s t
  (x. bool.IN x s bool.IN (f x) t)
  x y. bool.IN x s bool.IN y s (f x = f y x = y)

(x y. numeral_bit.BIT_REV 0 x y = y)
  n x y.
    numeral_bit.BIT_REV (suc n) x y =
    numeral_bit.BIT_REV n (x div arithmetic.BIT2 0)
      (arithmetic.BIT2 0 * y + bit.SBIT (odd x) 0)

l h n.
    bit.SIGN_EXTEND l h n =
    bool.LET
      (λm.
         if bit.BIT (arithmetic.- l 1) n then
           arithmetic.- (arithmetic.BIT2 0 h) (arithmetic.BIT2 0 l) + m
         else m) (n mod arithmetic.BIT2 0 l)

a b n.
    ¬(n = 0) arithmetic.BIT2 0 a n n < arithmetic.BIT2 0 b
    i. a i i < b bit.BIT i n

b l.
    1 < b all ((>) b) l
    numposrep.n2l b (numposrep.l2n b l) =
    if numposrep.l2n b l = 0 then 0 :: []
    else list.TAKE (suc (logroot.LOG b (numposrep.l2n b l))) l

a b c d.
    length a = length b length c = length d
    list.ZIP (a, b) @ list.ZIP (c, d) = list.ZIP (a @ c, b @ d)

R a b.
    relation.RTC R a b
    P. (x. P x x) (x y z. R x y P y z P x z) P a b

R P.
    (x. P x x) (x y z. R x y P y z P x z)
    x y. relation.RTC R x y P x y

R P.
    (x. P x x) (x y z. P x y R y z P x z)
    x y. relation.RTC R x y P x y

(indexedLists.LIST_RELi R [] x x = [])
  (indexedLists.LIST_RELi R (h :: t) l
   h' t'. l = h' :: t' R 0 h h' indexedLists.LIST_RELi (R suc) t t')

(p. numposrep.l2n (arithmetic.BIT2 0 p) [] = 0)
  p h t.
    numposrep.l2n (arithmetic.BIT2 0 p) (h :: t) =
    bit.MOD_2EXP p h +
    bit.TIMES_2EXP p (numposrep.l2n (arithmetic.BIT2 0 p) t)

h m' m l n.
    l m m' = m + 1 m < h
    bit.SLICE h m' n + bit.SLICE m l n = bit.SLICE h l n

f.
    (a b c. f a (f b c) = f b (f a c))
    e P l.
      list.FOLDR f e (filter P (reverse l)) = list.FOLDR f e (filter P l)

f.
    (a b c. f a (f b c) = f b (f a c))
    e g l. list.FOLDR f e (map g (reverse l)) = list.FOLDR f e (map g l)

R D P M.
    relation.INDUCTIVE_INVARIANT_ON R D P M
    f x. D x (y. D y R y x P y (f y)) P x (M f x)

P l n1 n2.
    list.ALL_DISTINCT (filter P l) n1 < length l n2 < length l
    P (list.EL n1 l) list.EL n1 l = list.EL n2 l n1 = n2

filter P [] = [] (h. P h filter P (h :: l) = h :: filter P l)
  h. ¬P h filter P (h :: l) = filter P l

b m b n b = 0 n = 0 b = 0 0 < m b = 1 1 < b m n

(f e. rich_list.SCANR f e [] = e :: [])
  f e x l.
    rich_list.SCANR f e (x :: l) =
    f x (head (rich_list.SCANR f e l)) :: rich_list.SCANR f e l

(m n. 0 < n m div n = fst (arithmetic.DIVMOD (0, m, n)))
  m n. 0 < n m mod n = snd (arithmetic.DIVMOD (0, m, n))

f x s t.
    pred_set.INJ f (pred_set.INSERT x s) t
    pred_set.INJ f s t bool.IN (f x) t
    y. bool.IN y s f x = f y x = y

R.
    (x. pred_set.FINITE (pred_set.GSPEC (λy. (y, R x y))))
    x.
      ¬pred_set.FINITE (pred_set.GSPEC (λy. (y, relation.RTC R x y)))
      f. f 0 = x n. R (f n) (f (suc n))

h m l n.
    suc m h l m
    bit.BITS h (suc m) n * arithmetic.BIT2 0 arithmetic.- (suc m) l +
    bit.BITS m l n = bit.BITS h l n

n m.
    ¬(n = 0) ¬(m = 0)
    p q. n = p * gcd.gcd n m m = q * gcd.gcd n m gcd.gcd p q = 1

a b.
    arithmetic.BIT2 0 b a a mod arithmetic.BIT2 0 b = 0
    arithmetic.- (a div arithmetic.BIT2 0 b) 1 =
    arithmetic.- a 1 div arithmetic.BIT2 0 b

R B C.
    wellFounded R (s. B s R (C s) s)
    while.HOARE_SPEC (λs. P s B s) C P
    while.HOARE_SPEC P (while.WHILE B C) (λs. P s ¬B s)

list.SET_TO_LIST =
  relation.WFREC
    (select R.
       wellFounded R
       s.
         pred_set.FINITE s ¬(s = pred_set.EMPTY) R (pred_set.REST s) s)
    (λSET_TO_LIST s.
       id
         (if pred_set.FINITE s then
            if s = pred_set.EMPTY then []
            else pred_set.CHOICE s :: SET_TO_LIST (pred_set.REST s)
          else bool.ARB))

(R x y. arithmetic.NRC R 0 x y x = y)
  R n x y.
    arithmetic.NRC R (suc n) x y z. R x z arithmetic.NRC R n z y

P R a.
    P a (x. P x y. P y R x y)
    f. f 0 = a n. P (f n) R (f n) (f (suc n))

f g.
    (n. g (suc n) = f n (suc n))
    (n. g (bit1 n) = f (arithmetic.- (bit1 n) 1) (bit1 n))
    n. g (arithmetic.BIT2 n) = f (bit1 n) (arithmetic.BIT2 n)

(n. n 0 = 1) (n m. n bit1 m = n * numeral.iSQR (n m))
  n m. n arithmetic.BIT2 m = numeral.iSQR n * numeral.iSQR (n m)

(l. rich_list.ELL 0 l = last l)
  (n l.
     rich_list.ELL (bit1 n) l =
     rich_list.ELL (arithmetic.- (bit1 n) 1) (list.FRONT l))
  n l.
    rich_list.ELL (arithmetic.BIT2 n) l =
    rich_list.ELL (bit1 n) (list.FRONT l)

(s. pred_set.chooser s 0 = pred_set.CHOICE s)
  (s n.
     pred_set.chooser s (bit1 n) =
     pred_set.chooser (pred_set.REST s) (arithmetic.- (bit1 n) 1))
  s n.
    pred_set.chooser s (arithmetic.BIT2 n) =
    pred_set.chooser (pred_set.REST s) (bit1 n)

arithmetic.findq =
  relation.WFREC
    (prim_rec.measure
       (pair.UNCURRY (λa. pair.UNCURRY (λm n. arithmetic.- m n))))
    (λf.
       pair.UNCURRY
         (λa.
            pair.UNCURRY
              (λm n.
                 if n = 0 then a
                 else
                   bool.LET
                     (λd.
                        if m < d then a
                        else f (arithmetic.BIT2 0 * a, m, d))
                     (arithmetic.BIT2 0 * n))))

ind_type.ISO f g
  (P. (x. P x) x. P (g x)) (P. (x. P x) x. P (g x))
  a b. a = g b f a = b

(P. rich_list.SPLITP P [] = ([], []))
  P x l.
    rich_list.SPLITP P (x :: l) =
    if P x then ([], x :: l)
    else (x :: fst (rich_list.SPLITP P l), snd (rich_list.SPLITP P l))

(x xs. list.FRONT (x :: xs) = [] xs = [])
  (x xs. [] = list.FRONT (x :: xs) xs = [])
  x xs. null (list.FRONT (x :: xs)) null xs

l1 = l2
  (n a. n < length l2 f1 n (list.EL n l2) a = f2 n (list.EL n l2) a)
  a1 = a2 indexedLists.FOLDRi f1 a1 l1 = indexedLists.FOLDRi f2 a2 l2

M M' v f.
    M = M' (M' = 0 v = v') (n. M' = suc n f n = f' n)
    arithmetic.num_CASE M v f = arithmetic.num_CASE M' v' f'

r n.
    0 < r
    logroot.ROOT r 0 = 0
    logroot.ROOT r n =
    bool.LET (λx. if n < suc x r then x else suc x)
      (arithmetic.BIT2 0 * logroot.ROOT r (n div arithmetic.BIT2 0 r))

l x y i.
    bool.IN x (list.LIST_TO_SET (list.LUPDATE y i l))
    i < length l x = y j. j < length l ¬(i = j) list.EL j l = x

M M' v f.
    M = M' (M' = none v = v') (x. M' = some x f x = f' x)
    option.option_CASE M v f = option.option_CASE M' v' f'

s.
    pred_set.FINITE s
    f.
      (n m.
         n < pred_set.CARD s m < pred_set.CARD s f n = f m n = m)
      s = pred_set.GSPEC (λn. (f n, n < pred_set.CARD s))

(x. rich_list.REPLICATE 0 x = [])
  (n x.
     rich_list.REPLICATE (bit1 n) x =
     x :: rich_list.REPLICATE (arithmetic.- (bit1 n) 1) x)
  n x.
    rich_list.REPLICATE (arithmetic.BIT2 n) x =
    x :: rich_list.REPLICATE (bit1 n) x

(l. list.isPREFIX [] l ) (h t. list.isPREFIX (h :: t) [] )
  x1 l1 x2 l2.
    list.isPREFIX (x2 :: l2) (x1 :: l1) x1 = x2 list.isPREFIX l2 l1

(l. rich_list.IS_SUFFIX l [] )
  (x l. rich_list.IS_SUFFIX [] (list.SNOC x l) )
  x1 l1 x2 l2.
    rich_list.IS_SUFFIX (list.SNOC x1 l1) (list.SNOC x2 l2)
    x1 = x2 rich_list.IS_SUFFIX l1 l2

(x n ys. length (list.LUPDATE x n ys) = length ys)
  e n l p.
    p < length l
    list.EL p (list.LUPDATE e n l) = if p = n then e else list.EL p l

(p m x. bool.IN x p bool.RES_ABSTRACT p m x = m x)
  p m1 m2.
    (x. bool.IN x p m1 x = m2 x)
    bool.RES_ABSTRACT p m1 = bool.RES_ABSTRACT p m2

n m.
    numeral.internal_mult 0 n = 0 numeral.internal_mult n 0 = 0
    numeral.internal_mult (bit1 n) m =
    numeral.iZ (numeral.iDUB (numeral.internal_mult n m) + m)
    numeral.internal_mult (arithmetic.BIT2 n) m =
    numeral.iDUB (numeral.iZ (numeral.internal_mult n m + m))

n m.
    0 * n = 0 n * 0 = 0
    bit1 n * m = numeral.iZ (numeral.iDUB (n * m) + m)
    arithmetic.BIT2 n * m = numeral.iDUB (numeral.iZ (n * m + m))

n.
    0 < n
    arithmetic.DIVMOD (a, m, n) =
    if m < n then (a, m)
    else
      bool.LET (λq. arithmetic.DIVMOD (a + q, arithmetic.- m (n * q), n))
        (arithmetic.findq (1, m, n))

ls1 ls2.
    length ls1 = length ls2 (x y. f (x, y) = g x + h y)
    list.SUM (map f (list.ZIP (ls1, ls2))) =
    list.SUM (map g ls1) + list.SUM (map h ls2)

f s t.
    pred_set.INJ f s t
    (x. bool.IN x s bool.IN (f x) t)
    x y. bool.IN x s bool.IN y s f x = f y x = y

R LIST_REL'.
    LIST_REL' [] []
    (h1 h2 t1 t2.
       R h1 h2 LIST_REL' t1 t2 LIST_REL' (h1 :: t1) (h2 :: t2))
    a0 a1. list.LIST_REL R a0 a1 LIST_REL' a0 a1

(option.OPTION_BIND p f = none
   p = none x. p = some x f x = none)
  (option.OPTION_BIND p f = some y x. p = some x f x = some y)

f e s b.
    (x y z. f x (f y z) = f y (f x z)) pred_set.FINITE s
    pred_set.ITSET f (pred_set.INSERT e s) b =
    f e (pred_set.ITSET f (pred_set.DELETE s e) b)

f s.
    (x y z. f x (f y z) = f y (f x z)) pred_set.FINITE s
    x b.
      pred_set.ITSET f (pred_set.INSERT x s) b =
      pred_set.ITSET f (pred_set.DELETE s x) (f x b)

prim_rec.PRE 0 = 0 prim_rec.PRE 1 = 0
  (n.
     prim_rec.PRE (bit1 (bit1 n)) =
     arithmetic.BIT2 (prim_rec.PRE (bit1 n)))
  (n.
     prim_rec.PRE (bit1 (arithmetic.BIT2 n)) = arithmetic.BIT2 (bit1 n))
  n. prim_rec.PRE (arithmetic.BIT2 n) = bit1 n

(op x y. bit.BITWISE 0 op x y = 0)
  n op x y.
    bit.BITWISE (suc n) op x y =
    bit.BITWISE n op x y + bit.SBIT (op (bit.BIT n x) (bit.BIT n y)) n

P Q.
    (Q (x. P x) x. Q P x) ((x. P x) Q x. P x Q)
    (Q (x. P x) x. Q P x)

P Q.
    ((x. P x) Q x. P x Q) ((x. P x) Q x. P x Q)
    (Q (x. P x) x. Q P x)

P l h lr.
    filter P l = h :: lr
    l1 l2.
      l = (l1 @ h :: []) @ l2 filter P l1 = [] filter P l2 = lr P h

R l1 l2.
    list.LLEX R l1 l2
    n.
      n length l1 n < length l2 list.TAKE n l1 = list.TAKE n l2
      (n < length l1 R (list.EL n l1) (list.EL n l2))

R P.
    (x. P x x) (x y z. R x y relation.RTC R y z P y z P x z)
    x y. relation.RTC R x y P x y

R P.
    (x. P x x) (x y z. P x y relation.RTC R x y R y z P x z)
    x y. relation.RTC R x y P x y

(acc P. rich_list.SPLITP_AUX acc P [] = (acc, []))
  acc P h t.
    rich_list.SPLITP_AUX acc P (h :: t) =
    if P h then (acc, h :: t) else rich_list.SPLITP_AUX (acc @ h :: []) P t

(f i a. indexedLists.MAPi_ACC f i a [] = reverse a)
  f i a h t.
    indexedLists.MAPi_ACC f i a (h :: t) =
    indexedLists.MAPi_ACC f (i + 1) (f i h :: a) t

(bit1 x * y = z y = z div bit1 x z mod bit1 x = 0)
  (arithmetic.BIT2 x * y = z
   y = z div arithmetic.BIT2 x z mod arithmetic.BIT2 x = 0)

p q m.
    (p marker.stmarker m marker.stmarker m p)
    ((marker.stmarker m p) q marker.stmarker m p q)
    (p marker.stmarker m q marker.stmarker m p q)

p q m.
    (p marker.stmarker m marker.stmarker m p)
    ((marker.stmarker m p) q marker.stmarker m p q)
    (p marker.stmarker m q marker.stmarker m p q)

p q m.
    (marker.stmarker m p p marker.stmarker m)
    (p q marker.stmarker m (p q) marker.stmarker m)
    ((p marker.stmarker m) q (p q) marker.stmarker m)

p q m.
    (marker.stmarker m p p marker.stmarker m)
    (p q marker.stmarker m (p q) marker.stmarker m)
    ((p marker.stmarker m) q (p q) marker.stmarker m)

R a b.
    transitiveClosure R a b
    P. (x y. R x y P x y) (x y z. P x y P y z P x z) P a b

R P.
    (x y. R x y P x y) (x y z. R x y P y z P x z)
    x x'. transitiveClosure R x x' P x x'

R P.
    (x y. R x y P x y) (x y z. P x y R y z P x z)
    x x'. transitiveClosure R x x' P x x'

R P.
    (x y. R x y P x y) (x y z. P x y P y z P x z)
    x x'. transitiveClosure R x x' P x x'

l1 = l2
  (n e a.
     n < length l2 bool.IN e (list.LIST_TO_SET l2)
     f1 n e a = f2 n e a) a1 = a2
  indexedLists.FOLDRi f1 a1 l1 = indexedLists.FOLDRi f2 a2 l2

arithmetic.DIVMOD (a, m, n) =
  if n = 0 then (0, 0)
  else if m < n then (a, m)
  else
    bool.LET (λq. arithmetic.DIVMOD (a + q, arithmetic.- m (n * q), n))
      (arithmetic.findq (1, m, n))

m n.
    (even m even n
     gcd.gcd m n =
     arithmetic.BIT2 0 *
     gcd.gcd (m div arithmetic.BIT2 0) (n div arithmetic.BIT2 0))
    (even m odd n gcd.gcd m n = gcd.gcd (m div arithmetic.BIT2 0) n)

l l' b b' f f'.
    l = l' b = b'
    (x a. bool.IN x (list.LIST_TO_SET l') f x a = f' x a)
    list.FOLDR f b l = list.FOLDR f' b' l'

l l' b b' f f'.
    l = l' b = b'
    (x a. bool.IN x (list.LIST_TO_SET l') f a x = f' a x)
    list.FOLDL f b l = list.FOLDL f' b' l'

P.
    (f. P f []) (f h. P f (h :: []))
    (f h v4 v5. P f (v4 :: v5) P f (h :: v4 :: v5)) v v1. P v v1

(list.LIST_REL R [] [] ) (list.LIST_REL R (a :: as) [] )
  (list.LIST_REL R [] (b :: bs) )
  (list.LIST_REL R (a :: as) (b :: bs) R a b list.LIST_REL R as bs)

(y. gcd.gcd 0 y = y) (x. gcd.gcd (suc x) 0 = suc x)
  y x.
    gcd.gcd (suc x) (suc y) =
    if y x then gcd.gcd (arithmetic.- x y) (suc y)
    else gcd.gcd (suc x) (arithmetic.- y x)

(¬list.LLEX R [] [] ¬list.LLEX R (h1 :: t1) [])
  list.LLEX R [] (h2 :: t2)
  (list.LLEX R (h1 :: t1) (h2 :: t2)
   R h1 h2 h1 = h2 list.LLEX R t1 t2)

a b c d x.
    (a @ x :: []) @ b = (c @ x :: []) @ d
    ¬bool.IN x (list.LIST_TO_SET b) ¬bool.IN x (list.LIST_TO_SET a)
    a = c b = d

P.
    (x1 y1 x2 y2. P x1 y1 = P x2 y2 x1 = x2 y1 = y2)
    X Y. x y. X (P x y) = x Y (P x y) = y

(f. indexedLists.fupdLast f [] = [])
  (h f. indexedLists.fupdLast f (h :: []) = f h :: [])
  v5 v4 h f.
    indexedLists.fupdLast f (h :: v4 :: v5) =
    h :: indexedLists.fupdLast f (v4 :: v5)

(a b. bit.MOD_2EXP_EQ 0 a b )
  (n a b.
     bit.MOD_2EXP_EQ (suc n) a b
     (odd a odd b)
     bit.MOD_2EXP_EQ n (arithmetic.DIV2 a) (arithmetic.DIV2 b))
  n a. bit.MOD_2EXP_EQ n a a

P G f.
    (s. ¬G s P s s) (s1 s2. G s1 P (f s1) s2 P s1 s2)
    s1 s2. while.OWHILE G f s1 = some s2 P s1 s2

n a b.
    bit.BIT (suc n) (a + b)
    if bit.BIT (suc n) (bit.BITS n 0 a + bit.BITS n 0 b) then
      bit.BIT (suc n) a bit.BIT (suc n) b
    else ¬(bit.BIT (suc n) a bit.BIT (suc n) b)

f a b c d.
    combin.UPDATE a c f = combin.UPDATE b d f
    a = b c = d
    ¬(a = b) combin.UPDATE a c f = f combin.UPDATE b d f = f

R a0 a1.
    list.LIST_REL R a0 a1
    a0 = [] a1 = []
    h1 h2 t1 t2.
      a0 = h1 :: t1 a1 = h2 :: t2 R h1 h2 list.LIST_REL R t1 t2

(zf bf1 bf2. numeral.iBIT_cases 0 zf bf1 bf2 = zf)
  (n zf bf1 bf2. numeral.iBIT_cases (bit1 n) zf bf1 bf2 = bf1 n)
  n zf bf1 bf2. numeral.iBIT_cases (arithmetic.BIT2 n) zf bf1 bf2 = bf2 n

l h n i.
    ¬(l = 0)
    (bit.BIT i (bit.SIGN_EXTEND l h n)
     if l h i < l then bit.BIT i (n mod arithmetic.BIT2 0 l)
     else i < h bit.BIT (arithmetic.- l 1) n)

M M' v f.
    M = M' (M' = [] v = v')
    (a0 a1. M' = a0 :: a1 f a0 a1 = f' a0 a1)
    list.list_CASE M v f = list.list_CASE M' v' f'

M M' f f1.
    M = M' (x. M' = left x f x = f' x)
    (y. M' = right y f1 y = f1' y)
    sum.sum_CASE M f f1 = sum.sum_CASE M' f' f1'

(p if q then r else s)
  (p q ¬s) (p ¬r ¬q) (p ¬r ¬s) (¬q r ¬p)
  (q s ¬p)

(R l2. list.LLEX R [] l2 ¬(l2 = []))
  R h1 t1 l2.
    list.LLEX R (h1 :: t1) l2
    list.list_CASE l2
      (λh2 t2.
         if R h1 h2 then else if h1 = h2 then list.LLEX R t1 t2 else )

n a b.
    bit.BITS (suc n) (suc n) (a + b) =
    (bit.BITS (suc n) (suc n) a + bit.BITS (suc n) (suc n) b +
     bit.BITS (suc n) (suc n) (bit.BITS n 0 a + bit.BITS n 0 b)) mod
    arithmetic.BIT2 0

s r f.
    poset.down_continuous (s, r) f
    c x.
      poset.chain (s, r) c poset.glb (s, r) c x
      poset.glb (s, r) (λy. z. (s z c z) y = f z) (f x)

s r f.
    poset.up_continuous (s, r) f
    c x.
      poset.chain (s, r) c poset.lub (s, r) c x
      poset.lub (s, r) (λy. z. (s z c z) y = f z) (f x)

f.
    (x y z. f x (f y z) = f (f x y) z) (x y. f x y = f y x)
    x y z. f x (f y z) = f y (f x z)

R.
    relation.inv (relation.inv R) = R
    relation.SC (relation.inv R) = relation.SC R
    relation.RC (relation.inv R) = relation.inv (relation.RC R)
    transitiveClosure (relation.inv R) =
    relation.inv (transitiveClosure R)
    relation.RTC (relation.inv R) = relation.inv (relation.RTC R)
    relation.EQC (relation.inv R) = relation.EQC R

(l. rich_list.COUNT_LIST_AUX 0 l = l)
  (n l.
     rich_list.COUNT_LIST_AUX (bit1 n) l =
     rich_list.COUNT_LIST_AUX (arithmetic.- (bit1 n) 1)
       (arithmetic.- (bit1 n) 1 :: l))
  n l.
    rich_list.COUNT_LIST_AUX (arithmetic.BIT2 n) l =
    rich_list.COUNT_LIST_AUX (bit1 n) (bit1 n :: l)

(R x y. list.LRC R [] x y x = y)
  R h t x y.
    list.LRC R (h :: t) x y x = h z. R x z list.LRC R t z y

R LIST_REL'.
    LIST_REL' [] []
    (h1 h2 t1 t2.
       R h1 h2 list.LIST_REL R t1 t2 LIST_REL' t1 t2
       LIST_REL' (h1 :: t1) (h2 :: t2))
    a0 a1. list.LIST_REL R a0 a1 LIST_REL' a0 a1

numeral_bit.iDIV2 0 = 0 numeral_bit.iDIV2 (numeral_bit.iSUC 0) = 0
  numeral_bit.iDIV2 (bit1 n) = n
  numeral_bit.iDIV2 (numeral_bit.iSUC (bit1 n)) = numeral_bit.iSUC n
  numeral_bit.iDIV2 (arithmetic.BIT2 n) = numeral_bit.iSUC n
  numeral_bit.iDIV2 (numeral_bit.iSUC (arithmetic.BIT2 n)) =
  numeral_bit.iSUC n numeral_bit.iSUC n = suc n

(P k. list.splitAtPki P k [] = k [] [])
  P k h t.
    list.splitAtPki P k (h :: t) =
    if P 0 h then k [] (h :: t)
    else list.splitAtPki (P suc) (λp s. k (h :: p) s) t

n.
    logroot.iSQRT0 n =
    bool.LET
      (λp.
         bool.LET
           (λd.
              if d = 0 then
                (arithmetic.BIT2 0 * fst p, arithmetic.BIT2 1 * snd p)
              else
                (suc (arithmetic.BIT2 0 * fst p),
                 arithmetic.- (arithmetic.BIT2 1 * d) 1))
           (arithmetic.- (snd p) (fst p))) (logroot.SQRTd n)

arithmetic.DIVMOD =
  relation.WFREC (prim_rec.measure (fst snd))
    (λf.
       pair.UNCURRY
         (λa.
            pair.UNCURRY
              (λm n.
                 if n = 0 then (0, 0)
                 else if m < n then (a, m)
                 else
                   bool.LET (λq. f (a + q, arithmetic.- m (n * q), n))
                     (arithmetic.findq (1, m, n)))))

(l. rich_list.IS_SUBLIST l [] )
  (x l. rich_list.IS_SUBLIST [] (x :: l) )
  x1 l1 x2 l2.
    rich_list.IS_SUBLIST (x1 :: l1) (x2 :: l2)
    x1 = x2 list.isPREFIX l2 l1 rich_list.IS_SUBLIST l1 (x2 :: l2)

(e n. list.LUPDATE e n [] = [])
  (e x l. list.LUPDATE e 0 (x :: l) = e :: l)
  e n x l. list.LUPDATE e (suc n) (x :: l) = x :: list.LUPDATE e n l

R LIST_RELi'.
    LIST_RELi' [] []
    (h1 h2 l1 l2.
       R (length l1) h1 h2 LIST_RELi' l1 l2
       LIST_RELi' (l1 @ h1 :: []) (l2 @ h2 :: []))
    l1 l2. indexedLists.LIST_RELi R l1 l2 LIST_RELi' l1 l2

(l1 @ e :: []) @ l2 = m1 @ m2
  (l. m1 = (l1 @ e :: []) @ l l2 = l @ m2)
  l. l1 = m1 @ l m2 = (l @ e :: []) @ l2

n.
    logroot.iSQRT2 n =
    bool.LET
      (λp.
         bool.LET
           (λd.
              bool.LET
                (λc.
                   bool.LET
                     (λe.
                        if e = 0 then (d, arithmetic.BIT2 0 * c)
                        else
                          (suc d, arithmetic.- (arithmetic.BIT2 0 * e) 1))
                     (arithmetic.- c d)) (suc (arithmetic.BIT2 0 * snd p)))
           (arithmetic.BIT2 0 * fst p)) (logroot.SQRTd n)

s r p x.
    poset.glb (s, r) p x
    s x (y. s y p y r x y)
    z. s z (y. s y p y r z y) r z x

s r p x.
    poset.lub (s, r) p x
    s x (y. s y p y r y x)
    z. s z (y. s y p y r y z) r x z

R P.
    (x y. R x y P x y)
    (x y z. R x y P y z transitiveClosure R y z P x z)
    x x'. transitiveClosure R x x' P x x'

R P.
    (x y. R x y P x y)
    (x y z. P x y transitiveClosure R x y R y z P x z)
    x x'. transitiveClosure R x x' P x x'

l1 l1' l2 l2' f f'.
    l1 = l1' l2 = l2'
    (x y.
       bool.IN x (list.LIST_TO_SET l1')
       bool.IN y (list.LIST_TO_SET l2') f x y = f' x y)
    list.MAP2 f l1 l2 = list.MAP2 f' l1' l2'

l1 l1' l2 l2' P P'.
    l1 = l1' l2 = l2'
    (x y.
       bool.IN x (list.LIST_TO_SET l1')
       bool.IN y (list.LIST_TO_SET l2') (P x y P' x y))
    (list.LIST_REL P l1 l2 list.LIST_REL P' l1' l2')

x1 x2 y1 y2 f1 f2.
    x1 = x2 y1 = y2
    (x y. x2 = some x y2 = some y f1 x y = f2 x y)
    option.OPTION_MAP2 f1 x1 y1 = option.OPTION_MAP2 f2 x2 y2

s s' P P' Q Q'.
    s = s' (a. s' = left a (P a P' a))
    (b. s' = right b (Q b Q' b))
    (sum.SUM_ALL P Q s sum.SUM_ALL P' Q' s')

R l1 l2 R' l1' l2'.
    l1 = l1' l2 = l2'
    (a b.
       bool.IN a (list.LIST_TO_SET l1')
       bool.IN b (list.LIST_TO_SET l2') (R a b R' a b))
    (list.LLEX R l1 l2 list.LLEX R' l1' l2')

n s.
    pred_set.FINITE s
    (e. bool.IN e s pred_set.FINITE e pred_set.CARD e = n)
    (s' t.
       bool.IN s' s bool.IN t s ¬(s' = t) pred_set.DISJOINT s' t)
    pred_set.CARD (pred_set.BIGUNION s) = pred_set.CARD s * n

n.
    logroot.iSQRT1 n =
    bool.LET
      (λp.
         bool.LET
           (λd.
              if d = 0 then
                (arithmetic.BIT2 0 * fst p,
                 suc (arithmetic.BIT2 1 * snd p))
              else
                (suc (arithmetic.BIT2 0 * fst p),
                 arithmetic.BIT2 1 * arithmetic.- d 1))
           (arithmetic.- (suc (snd p)) (fst p))) (logroot.SQRTd n)

(t2 t1 h2 h1 f.
     list.MAP2 f (h1 :: t1) (h2 :: t2) = f h1 h2 :: list.MAP2 f t1 t2)
  (y f. list.MAP2 f [] y = []) v5 v4 f. list.MAP2 f (v4 :: v5) [] = []

n.
    logroot.iSQRT3 n =
    bool.LET
      (λp.
         bool.LET
           (λd.
              bool.LET
                (λc.
                   bool.LET
                     (λe.
                        if e = 0 then (d, suc (arithmetic.BIT2 0 * c))
                        else (suc d, arithmetic.BIT2 0 * arithmetic.- e 1))
                     (arithmetic.- (suc c) d))
                (suc (arithmetic.BIT2 0 * snd p)))
           (arithmetic.BIT2 0 * fst p)) (logroot.SQRTd n)

l1 l2 l3.
    (n.
       n < length l1 R (list.EL n l1) (list.EL n l2)
       R (list.EL n l2) (list.EL n l3) R (list.EL n l1) (list.EL n l3))
    list.LIST_REL R l1 l2 list.LIST_REL R l2 l3 list.LIST_REL R l1 l3

length l1 = length l2
  map fst (list.ZIP (l1, l2)) = l1 map snd (list.ZIP (l1, l2)) = l2
  map (f fst) (list.ZIP (l1, l2)) = map f l1
  map (g snd) (list.ZIP (l1, l2)) = map g l2

(x. numeral_bit.SFUNPOW numeral.iDUB 0 x = x)
  (y. numeral_bit.SFUNPOW numeral.iDUB y 0 = 0)
  (n x.
     numeral_bit.SFUNPOW numeral.iDUB (bit1 n) x =
     numeral_bit.SFUNPOW (numeral_bit.FDUB numeral.iDUB) n
       (numeral.iDUB x))
  n x.
    numeral_bit.SFUNPOW numeral.iDUB (arithmetic.BIT2 n) x =
    numeral_bit.SFUNPOW (numeral_bit.FDUB numeral.iDUB) n
      (numeral.iDUB (numeral.iDUB x))

(x. numeral_bit.SFUNPOW numeral_bit.iDIV2 0 x = x)
  (y. numeral_bit.SFUNPOW numeral_bit.iDIV2 y 0 = 0)
  (n x.
     numeral_bit.SFUNPOW numeral_bit.iDIV2 (bit1 n) x =
     numeral_bit.SFUNPOW (numeral_bit.FDUB numeral_bit.iDIV2) n
       (numeral_bit.iDIV2 x))
  n x.
    numeral_bit.SFUNPOW numeral_bit.iDIV2 (arithmetic.BIT2 n) x =
    numeral_bit.SFUNPOW (numeral_bit.FDUB numeral_bit.iDIV2) n
      (numeral_bit.iDIV2 (numeral_bit.iDIV2 x))

R a0 a1.
    indexedLists.LIST_RELi R a0 a1
    a0 = [] a1 = []
    h1 h2 l1 l2.
      a0 = l1 @ h1 :: [] a1 = l2 @ h2 :: [] R (length l1) h1 h2
      indexedLists.LIST_RELi R l1 l2

numeral_bit.FDUB (numeral_bit.FDUB f) 0 = 0
  (x.
     numeral_bit.FDUB (numeral_bit.FDUB f) (numeral_bit.iSUC x) =
     numeral_bit.FDUB f (numeral_bit.FDUB f (numeral_bit.iSUC x)))
  (x.
     numeral_bit.FDUB (numeral_bit.FDUB f) (bit1 x) =
     numeral_bit.FDUB f (numeral_bit.FDUB f (bit1 x)))
  x.
    numeral_bit.FDUB (numeral_bit.FDUB f) (arithmetic.BIT2 x) =
    numeral_bit.FDUB f (numeral_bit.FDUB f (arithmetic.BIT2 x))

(k l. rich_list.SEG 0 k l = [])
  (m x l. rich_list.SEG (suc m) 0 (x :: l) = x :: rich_list.SEG m 0 l)
  m k x l.
    rich_list.SEG (suc m) (suc k) (x :: l) = rich_list.SEG (suc m) k l

m n.
    0 * m = 0 m * 0 = 0 1 * m = m m * 1 = m suc m * n = m * n + n
    m * suc n = m + m * n

l1 l2 f1 f2.
    length l1 = length l2
    list.ZIP (map f1 l1, l2) =
    map (λp. (f1 (fst p), snd p)) (list.ZIP (l1, l2))
    list.ZIP (l1, map f2 l2) =
    map (λp. (fst p, f2 (snd p))) (list.ZIP (l1, l2))

P.
    (y. P 0 y) (x y. P x y P y x) (x. P x x)
    (x y. 0 < x 0 < y P x y P x (x + y)) v v1. P v v1

R LIST_RELi'.
    LIST_RELi' [] []
    (h1 h2 l1 l2.
       R (length l1) h1 h2 indexedLists.LIST_RELi R l1 l2
       LIST_RELi' l1 l2 LIST_RELi' (l1 @ h1 :: []) (l2 @ h2 :: []))
    l1 l2. indexedLists.LIST_RELi R l1 l2 LIST_RELi' l1 l2

P.
    (f h1 t1 h2 t2. P f t1 t2 P f (h1 :: t1) (h2 :: t2))
    (f y. P f [] y) (f v4 v5. P f (v4 :: v5) []) v v1 v2. P v v1 v2

((if P then some x else none) = none ¬P)
  ((if P then none else some x) = none P)
  ((if P then some x else none) = some y P x = y)
  ((if P then none else some x) = some y ¬P x = y)

(l1 l2. l1 @ l2 = l1 l2 = []) (l1 l2. l1 @ l2 = l2 l1 = [])
  (l1 l2. l1 = l1 @ l2 l2 = []) l1 l2. l2 = l1 @ l2 l1 = []

R P.
    (x y. R x y P x y)
    (x y z.
       P x y P y z transitiveClosure R x y transitiveClosure R y z
       P x z) x x'. transitiveClosure R x x' P x x'

P.
    (y. P 0 y) (x. P (suc x) 0)
    (x y.
       (¬(y x) P (suc x) (arithmetic.- y x))
       (y x P (arithmetic.- x y) (suc y)) P (suc x) (suc y))
    v v1. P v v1

m l1 n l2.
    m < length l1 length l1 n + m n + m length l1 + length l2
    rich_list.SEG n m (l1 @ l2) =
    rich_list.SEG (arithmetic.- (length l1) m) m l1 @
    rich_list.SEG (arithmetic.- (n + m) (length l1)) 0 l2

p p' P P' Q Q'.
    p = p' (x y. p' = (x, y) (P x P' x))
    (x y. p' = (x, y) (Q y Q' y))
    (pair.PROD_ALL P Q p pair.PROD_ALL P' Q' p')

indexedLists.fupdLast_tupled =
  relation.WFREC
    (select R.
       wellFounded R h v5 v4 f. R (f, v4 :: v5) (f, h :: v4 :: v5))
    (λfupdLast_tupled a.
       pair.pair_CASE a
         (λf v1.
            list.list_CASE v1 (id [])
              (λh v3.
                 list.list_CASE v3 (id (f h :: []))
                   (λv6 v7. id (h :: fupdLast_tupled (f, v6 :: v7))))))

f s t.
    pred_set.BIJ f s t
    (x. bool.IN x s bool.IN (f x) t)
    g.
      (x. bool.IN x t bool.IN (g x) s)
      (x. bool.IN x s g (f x) = x) y. bool.IN y t f (g y) = y

f.
    pred_set.ITSET_tupled f =
    relation.WFREC
      (select R.
         wellFounded R
         b s.
           pred_set.FINITE s ¬(s = pred_set.EMPTY)
           R (pred_set.REST s, f (pred_set.CHOICE s) b) (s, b))
      (λITSET_tupled a.
         pair.pair_CASE a
           (λs b.
              id
                (if pred_set.FINITE s then
                   if s = pred_set.EMPTY then b
                   else
                     ITSET_tupled
                       (pred_set.REST s, f (pred_set.CHOICE s) b)
                 else bool.ARB)))

((if P then X else none) = none P isNone X)
  ((if P then none else X) = none isSome X P)
  ((if P then X else none) = some x P X = some x)
  ((if P then none else X) = some x ¬P X = some x)

x n.
    logroot.iSQRTd (x, n) =
    bool.LET
      (λp.
         bool.LET
           (λnext.
              bool.LET
                (λndiff.
                   if next < ndiff then (arithmetic.BIT2 0 * fst p, next)
                   else
                     (arithmetic.BIT2 0 * fst p + 1,
                      arithmetic.- next ndiff))
                (arithmetic.BIT2 1 * fst p + 1))
           (arithmetic.BIT2 1 * snd p + x)) (logroot.SQRTd n)

indexedLists.LIST_RELi =
  λR a0 a1.
    LIST_RELi'.
      (a0 a1.
         a0 = [] a1 = []
         (h1 h2 l1 l2.
            a0 = l1 @ h1 :: [] a1 = l2 @ h2 :: [] R (length l1) h1 h2
            LIST_RELi' l1 l2) LIST_RELi' a0 a1) LIST_RELi' a0 a1

(t.
     numposrep.l2n (arithmetic.BIT2 0) (0 :: t) =
     numposrep.l2n2 (0 :: t))
  (t.
     numposrep.l2n (arithmetic.BIT2 0) (1 :: t) =
     numposrep.l2n2 (1 :: t)) numposrep.l2n2 [] = 0
  (t. numposrep.l2n2 (0 :: t) = numeral.iDUB (numposrep.l2n2 t))
  t. numposrep.l2n2 (1 :: t) = bit1 (numposrep.l2n2 t)

(l1 l2 l1' l2'.
     length l1 = length l1'
     (l1 @ l2 = l1' @ l2' l1 = l1' l2 = l2'))
  l1 l2 l1' l2'.
    length l2 = length l2' (l1 @ l2 = l1' @ l2' l1 = l1' l2 = l2')

(f cs c bs b a.
     list.FOLDL2 f a (b :: bs) (c :: cs) = list.FOLDL2 f (f a b c) bs cs)
  (f cs a. list.FOLDL2 f a [] cs = a)
  v7 v6 f a. list.FOLDL2 f a (v6 :: v7) [] = a

(f l. list.GENLIST_AUX f 0 l = l)
  (f n l.
     list.GENLIST_AUX f (bit1 n) l =
     list.GENLIST_AUX f (arithmetic.- (bit1 n) 1)
       (f (arithmetic.- (bit1 n) 1) :: l))
  f n l.
    list.GENLIST_AUX f (arithmetic.BIT2 n) l =
    list.GENLIST_AUX f (bit1 n) (f (bit1 n) :: l)

n i a.
    bit.BIT i
      (arithmetic.- (arithmetic.BIT2 0 n)
         (a mod arithmetic.BIT2 0 n))
    a mod arithmetic.BIT2 0 n = 0 i = n
    ¬(a mod arithmetic.BIT2 0 n = 0) i < n
    ¬bit.BIT i (arithmetic.- (a mod arithmetic.BIT2 0 n) 1)

R P.
    (x y. R x y P x y) (x. P x x) (x y. P x y P y x)
    (x y z. P x y P y z P x z) x y. relation.EQC R x y P x y

list.MAP2_tupled =
  relation.WFREC
    (select R.
       wellFounded R
       h2 h1 t2 t1 f. R (f, t1, t2) (f, h1 :: t1, h2 :: t2))
    (λMAP2_tupled a.
       pair.pair_CASE a
         (λf v1.
            pair.pair_CASE v1
              (λv2 v3.
                 list.list_CASE v2 (id [])
                   (λh1 t1.
                      list.list_CASE v3 (id [])
                        (λh2 t2.
                           id (f h1 h2 :: MAP2_tupled (f, t1, t2)))))))

numposrep.n2l_tupled =
  relation.WFREC
    (select R.
       wellFounded R
       b n. ¬(n < b b < arithmetic.BIT2 0) R (b, n div b) (b, n))
    (λn2l_tupled a.
       pair.pair_CASE a
         (λb n.
            id
              (if n < b b < arithmetic.BIT2 0 then n mod b :: []
               else n mod b :: n2l_tupled (b, n div b))))

(n m arithmetic.MODEQ (bit1 n) (bit1 m) (bit1 m mod bit1 n))
  (n m
   arithmetic.MODEQ (bit1 n) (arithmetic.BIT2 m)
     (arithmetic.BIT2 m mod bit1 n))
  (n m
   arithmetic.MODEQ (arithmetic.BIT2 n) (arithmetic.BIT2 m)
     (arithmetic.BIT2 m mod arithmetic.BIT2 n))
  (n < m
   arithmetic.MODEQ (arithmetic.BIT2 n) (bit1 m)
     (bit1 m mod arithmetic.BIT2 n))

l1 l1' l2 l2' a a' f f'.
    l1 = l1' l2 = l2' a = a'
    (z b c.
       bool.IN b (list.LIST_TO_SET l1')
       bool.IN c (list.LIST_TO_SET l2') f z b c = f' z b c)
    list.FOLDL2 f a l1 l2 = list.FOLDL2 f' a' l1' l2'

f.
    (x. numeral_bit.SFUNPOW (numeral_bit.FDUB f) 0 x = x)
    (y. numeral_bit.SFUNPOW (numeral_bit.FDUB f) y 0 = 0)
    (n x.
       numeral_bit.SFUNPOW (numeral_bit.FDUB f) (bit1 n) x =
       numeral_bit.SFUNPOW (numeral_bit.FDUB (numeral_bit.FDUB f)) n
         (numeral_bit.FDUB f x))
    n x.
      numeral_bit.SFUNPOW (numeral_bit.FDUB f) (arithmetic.BIT2 n) x =
      numeral_bit.SFUNPOW (numeral_bit.FDUB (numeral_bit.FDUB f)) n
        (numeral_bit.FDUB f (numeral_bit.FDUB f x))

(l. list.DROP 0 l = l) (n. list.DROP (bit1 n) [] = [])
  (n. list.DROP (arithmetic.BIT2 n) [] = [])
  (n h t.
     list.DROP (bit1 n) (h :: t) = list.DROP (arithmetic.- (bit1 n) 1) t)
  n h t. list.DROP (arithmetic.BIT2 n) (h :: t) = list.DROP (bit1 n) t

(f x b e y. numeral_bit.BIT_MODF 0 f x b e y = y)
  n f x b e y.
    numeral_bit.BIT_MODF (suc n) f x b e y =
    numeral_bit.BIT_MODF n f (x div arithmetic.BIT2 0) (b + 1)
      (arithmetic.BIT2 0 * e) (if f b (odd x) then e + y else y)

numpair.invtri0_tupled =
  relation.WFREC
    (select R.
       wellFounded R
       a n. ¬(n < a + 1) R (arithmetic.- n (a + 1), a + 1) (n, a))
    (λinvtri0_tupled a'.
       pair.pair_CASE a'
         (λn a.
            id
              (if n < a + 1 then (n, a)
               else invtri0_tupled (arithmetic.- n (a + 1), a + 1))))

n m.
    (0 n ) (bit1 n 0 ) (arithmetic.BIT2 n 0 )
    (bit1 n bit1 m n m) (bit1 n arithmetic.BIT2 m n m)
    (arithmetic.BIT2 n bit1 m ¬(m n))
    (arithmetic.BIT2 n arithmetic.BIT2 m n m)

n m.
    (0 < bit1 n ) (0 < arithmetic.BIT2 n ) (n < 0 )
    (bit1 n < bit1 m n < m)
    (arithmetic.BIT2 n < arithmetic.BIT2 m n < m)
    (bit1 n < arithmetic.BIT2 m ¬(m < n))
    (arithmetic.BIT2 n < bit1 m n < m)

R s.
    pred_set.equiv_on R s
    (x. bool.IN x s R x x)
    (x y. bool.IN x s bool.IN y s (R x y R y x))
    x y z. bool.IN x s bool.IN y s bool.IN z s R x y R y z R x z

(l. length l = 0 l = [])
  (l n. length l = suc n h l'. length l' = n l = h :: l')
  l n1 n2.
    length l = n1 + n2
    l1 l2. length l1 = n1 length l2 = n2 l = l1 @ l2

(l. list.TAKE 0 l = []) (n. list.TAKE (bit1 n) [] = [])
  (n. list.TAKE (arithmetic.BIT2 n) [] = [])
  (n h t.
     list.TAKE (bit1 n) (h :: t) =
     h :: list.TAKE (arithmetic.- (bit1 n) 1) t)
  n h t.
    list.TAKE (arithmetic.BIT2 n) (h :: t) = h :: list.TAKE (bit1 n) t

(e. rich_list.LIST_ELEM_COUNT e [] = 0)
  (e l1 l2.
     rich_list.LIST_ELEM_COUNT e (l1 @ l2) =
     rich_list.LIST_ELEM_COUNT e l1 + rich_list.LIST_ELEM_COUNT e l2)
  (e h l.
     h = e
     rich_list.LIST_ELEM_COUNT e (h :: l) =
     suc (rich_list.LIST_ELEM_COUNT e l))
  e h l.
    ¬(h = e)
    rich_list.LIST_ELEM_COUNT e (h :: l) = rich_list.LIST_ELEM_COUNT e l

P.
    (f a b bs c cs. P f (f a b c) bs cs P f a (b :: bs) (c :: cs))
    (f a cs. P f a [] cs) (f a v6 v7. P f a (v6 :: v7) [])
    v v1 v2 v3. P v v1 v2 v3

n m i a.
    i + n < m a < arithmetic.BIT2 0 m
    (bit.BIT i
       (arithmetic.- (arithmetic.BIT2 0 m)
          ((a div arithmetic.BIT2 0 n +
            if a mod arithmetic.BIT2 0 n = 0 then 0 else 1) mod
           arithmetic.BIT2 0 m))
     bit.BIT (i + n)
       (arithmetic.- (arithmetic.BIT2 0 m)
          (a mod arithmetic.BIT2 0 m)))

n m.
    (0 = bit1 n ) (bit1 n = 0 ) (0 = arithmetic.BIT2 n )
    (arithmetic.BIT2 n = 0 ) (bit1 n = arithmetic.BIT2 m )
    (arithmetic.BIT2 n = bit1 m ) (bit1 n = bit1 m n = m)
    (arithmetic.BIT2 n = arithmetic.BIT2 m n = m)

numpair.nlistrec_tupled =
  relation.WFREC
    (select R.
       wellFounded R
       f n l.
         ¬(l = 0) R (n, f, numpair.nsnd (arithmetic.- l 1)) (n, f, l))
    (λnlistrec_tupled a.
       pair.pair_CASE a
         (λn v1.
            pair.pair_CASE v1
              (λf l.
                 id
                   (if l = 0 then n
                    else
                      f (numpair.nfst (arithmetic.- l 1))
                        (numpair.nsnd (arithmetic.- l 1))
                        (nlistrec_tupled
                           (n, f, numpair.nsnd (arithmetic.- l 1)))))))

s r.
    poset.poset (s, r)
    (x. s x) (x. s x r x x)
    (x y. s x s y r x y r y x x = y)
    x y z. s x s y s z r x y r y z r x z

(x f a. bit.BITWISE x f 0 0 = numeral_bit.iBITWISE x f 0 0)
  (x f a. bit.BITWISE x f a 0 = numeral_bit.iBITWISE x f a 0)
  (x f b. bit.BITWISE x f 0 b = numeral_bit.iBITWISE x f 0 b)
  x f a b. bit.BITWISE x f a b = numeral_bit.iBITWISE x f a b

(%%genvar%%491 n.
     %%genvar%%491 div bit1 n =
     fst (arithmetic.DIVMOD (0, %%genvar%%491, bit1 n)))
  (%%genvar%%489 n.
     %%genvar%%489 div arithmetic.BIT2 n =
     fst (arithmetic.DIVMOD (0, %%genvar%%489, arithmetic.BIT2 n)))
  (%%genvar%%487 n.
     %%genvar%%487 mod bit1 n =
     snd (arithmetic.DIVMOD (0, %%genvar%%487, bit1 n)))
  %%genvar%%485 n.
    %%genvar%%485 mod arithmetic.BIT2 n =
    snd (arithmetic.DIVMOD (0, %%genvar%%485, arithmetic.BIT2 n))

list.FOLDL2_tupled =
  relation.WFREC
    (select R.
       wellFounded R
       cs bs c b a f. R (f, f a b c, bs, cs) (f, a, b :: bs, c :: cs))
    (λFOLDL2_tupled a'.
       pair.pair_CASE a'
         (λf v1.
            pair.pair_CASE v1
              (λa v3.
                 pair.pair_CASE v3
                   (λv4 v5.
                      list.list_CASE v4 (id a)
                        (λb bs.
                           list.list_CASE v5 (id a)
                             (λc cs.
                                id
                                  (FOLDL2_tupled
                                     (f, f a b c, bs, cs))))))))

(e n. list.LUPDATE e n [] = [])
  (e x l. list.LUPDATE e 0 (x :: l) = e :: l)
  (e n x l.
     list.LUPDATE e (bit1 n) (x :: l) =
     x :: list.LUPDATE e (arithmetic.- (bit1 n) 1) l)
  e n x l.
    list.LUPDATE e (arithmetic.BIT2 n) (x :: l) =
    x :: list.LUPDATE e (bit1 n) l

R P.
    (x y. R x y P x y) (x. P x x)
    (x y. relation.EQC R x y P x y P y x)
    (x y z.
       P x y P y z relation.EQC R x y relation.EQC R y z P x z)
    x y. relation.EQC R x y P x y

gcd.gcd_tupled =
  relation.WFREC
    (select R.
       wellFounded R
       (x y. ¬(y x) R (suc x, arithmetic.- y x) (suc x, suc y))
       x y. y x R (arithmetic.- x y, suc y) (suc x, suc y))
    (λgcd_tupled a.
       pair.pair_CASE a
         (λv y.
            arithmetic.num_CASE v (id y)
              (λx.
                 arithmetic.num_CASE y (id (suc x))
                   (λy'.
                      id
                        (if y' x then
                           gcd_tupled (arithmetic.- x y', suc y')
                         else gcd_tupled (suc x, arithmetic.- y' x))))))

(opr a b. numeral_bit.iBITWISE 0 opr a b = 0)
  (x opr a b.
     numeral_bit.iBITWISE (bit1 x) opr a b =
     bool.LET (λw. if opr (odd a) (odd b) then bit1 w else numeral.iDUB w)
       (numeral_bit.iBITWISE (arithmetic.- (bit1 x) 1) opr
          (arithmetic.DIV2 a) (arithmetic.DIV2 b)))
  x opr a b.
    numeral_bit.iBITWISE (arithmetic.BIT2 x) opr a b =
    bool.LET (λw. if opr (odd a) (odd b) then bit1 w else numeral.iDUB w)
      (numeral_bit.iBITWISE (bit1 x) opr (arithmetic.DIV2 a)
         (arithmetic.DIV2 b))

(x y z. (if P then right x else left y) = right z P z = x)
  (x y z. (if P then right x else left y) = left z ¬P z = y)
  (x y z. (if P then left x else right y) = left z P z = x)
  x y z. (if P then left x else right y) = right z ¬P z = y

(n. numeral_bit.iMOD_2EXP 0 n = 0)
  (x n. numeral_bit.iMOD_2EXP x 0 = 0)
  (x n.
     numeral_bit.iMOD_2EXP (bit1 x) (bit1 n) =
     bit1 (numeral_bit.iMOD_2EXP (arithmetic.- (bit1 x) 1) n))
  (x n.
     numeral_bit.iMOD_2EXP (arithmetic.BIT2 x) (bit1 n) =
     bit1 (numeral_bit.iMOD_2EXP (bit1 x) n))
  (x n.
     numeral_bit.iMOD_2EXP (bit1 x) (arithmetic.BIT2 n) =
     numeral.iDUB
       (numeral_bit.iMOD_2EXP (arithmetic.- (bit1 x) 1) (suc n)))
  x n.
    numeral_bit.iMOD_2EXP (arithmetic.BIT2 x) (arithmetic.BIT2 n) =
    numeral.iDUB (numeral_bit.iMOD_2EXP (bit1 x) (suc n))

(P ys. list.LIST_REL P [] ys ys = [])
  (P yys x xs.
     list.LIST_REL P (x :: xs) yys
     y ys. yys = y :: ys P x y list.LIST_REL P xs ys)
  (P xs. list.LIST_REL P xs [] xs = [])
  P xxs y ys.
    list.LIST_REL P xxs (y :: ys)
    x xs. xxs = x :: xs P x y list.LIST_REL P xs ys

R1 R2 v1 v2 R1' R2' v1' v2'.
    v1 = v1' v2 = v2'
    (a b c d. v1' = (a, b) v2' = (c, d) (R1 a c R1' a c))
    (a b c d. v1' = (a, b) v2' = (c, d) a = c (R2 b d R2' b d))
    (pair.LEX R1 R2 v1 v2 pair.LEX R1' R2' v1' v2')

(l. length l = 0 l = [])
  (l n.
     length l = bit1 n
     h l'. length l' = arithmetic.- (bit1 n) 1 l = h :: l')
  (l n.
     length l = arithmetic.BIT2 n
     h l'. length l' = bit1 n l = h :: l')
  l n1 n2.
    length l = n1 + n2
    l1 l2. length l1 = n1 length l2 = n2 l = l1 @ l2

(x y. numeral_bit.BIT_REV 0 x y = y)
  (n y.
     numeral_bit.BIT_REV (bit1 n) 0 y =
     numeral_bit.BIT_REV (arithmetic.- (bit1 n) 1) 0 (numeral.iDUB y))
  (n y.
     numeral_bit.BIT_REV (arithmetic.BIT2 n) 0 y =
     numeral_bit.BIT_REV (bit1 n) 0 (numeral.iDUB y))
  (n x y.
     numeral_bit.BIT_REV (bit1 n) x y =
     numeral_bit.BIT_REV (arithmetic.- (bit1 n) 1) (arithmetic.DIV2 x)
       (if odd x then bit1 y else numeral.iDUB y))
  n x y.
    numeral_bit.BIT_REV (arithmetic.BIT2 n) x y =
    numeral_bit.BIT_REV (bit1 n) (arithmetic.DIV2 x)
      (if odd x then bit1 y else numeral.iDUB y)

(b x. numeral.iSUB b 0 x = 0)
  (b n x.
     numeral.iSUB b (bit1 n) x =
     if b then
       numeral.iBIT_cases x (bit1 n)
         (λm. numeral.iDUB (numeral.iSUB n m))
         (λm. bit1 (numeral.iSUB n m))
     else
       numeral.iBIT_cases x (numeral.iDUB n)
         (λm. bit1 (numeral.iSUB n m))
         (λm. numeral.iDUB (numeral.iSUB n m)))
  b n x.
    numeral.iSUB b (arithmetic.BIT2 n) x =
    if b then
      numeral.iBIT_cases x (arithmetic.BIT2 n)
        (λm. bit1 (numeral.iSUB n m))
        (λm. numeral.iDUB (numeral.iSUB n m))
    else
      numeral.iBIT_cases x (bit1 n) (λm. numeral.iDUB (numeral.iSUB n m))
        (λm. bit1 (numeral.iSUB n m))

logroot.SQRTd 0 = (0, 0) logroot.SQRTd 1 = (1, 0)
  logroot.SQRTd (arithmetic.BIT2 0) = (1, 1)
  logroot.SQRTd (bit1 (bit1 n)) = logroot.iSQRT3 n
  logroot.SQRTd (arithmetic.BIT2 (bit1 n)) = logroot.iSQRT0 (suc n)
  logroot.SQRTd (bit1 (arithmetic.BIT2 n)) = logroot.iSQRT1 (suc n)
  logroot.SQRTd (arithmetic.BIT2 (arithmetic.BIT2 n)) =
  logroot.iSQRT2 (suc n)
  logroot.SQRTd (suc (bit1 (bit1 n))) = logroot.iSQRT0 (suc n)
  logroot.SQRTd (suc (arithmetic.BIT2 (bit1 n))) = logroot.iSQRT1 (suc n)
  logroot.SQRTd (suc (bit1 (arithmetic.BIT2 n))) = logroot.iSQRT2 (suc n)
  logroot.SQRTd (suc (arithmetic.BIT2 (arithmetic.BIT2 n))) =
  logroot.iSQRT3 (suc n)

0 * n = 0 n * 0 = 0
  bit1 x * bit1 y = numeral.internal_mult (bit1 x) (bit1 y)
  bit1 x * arithmetic.BIT2 y =
  bool.LET
    (λn.
       if odd n then
         numeral.texp_help (arithmetic.DIV2 n) (prim_rec.PRE (bit1 x))
       else numeral.internal_mult (bit1 x) (arithmetic.BIT2 y))
    (numeral.exactlog (arithmetic.BIT2 y))
  arithmetic.BIT2 x * bit1 y =
  bool.LET
    (λm.
       if odd m then
         numeral.texp_help (arithmetic.DIV2 m) (prim_rec.PRE (bit1 y))
       else numeral.internal_mult (arithmetic.BIT2 x) (bit1 y))
    (numeral.exactlog (arithmetic.BIT2 x))
  arithmetic.BIT2 x * arithmetic.BIT2 y =
  bool.LET
    (λm.
       bool.LET
         (λn.
            if odd m then
              numeral.texp_help (arithmetic.DIV2 m)
                (prim_rec.PRE (arithmetic.BIT2 y))
            else if odd n then
              numeral.texp_help (arithmetic.DIV2 n)
                (prim_rec.PRE (arithmetic.BIT2 x))
            else
              numeral.internal_mult (arithmetic.BIT2 x)
                (arithmetic.BIT2 y))
         (numeral.exactlog (arithmetic.BIT2 y)))
    (numeral.exactlog (arithmetic.BIT2 x))

b n m.
    numeral.iSUB b 0 x = 0 numeral.iSUB n 0 = n
    numeral.iSUB (bit1 n) 0 = numeral.iDUB n
    numeral.iSUB (bit1 n) (bit1 m) = numeral.iDUB (numeral.iSUB n m)
    numeral.iSUB (bit1 n) (bit1 m) = bit1 (numeral.iSUB n m)
    numeral.iSUB (bit1 n) (arithmetic.BIT2 m) =
    bit1 (numeral.iSUB n m)
    numeral.iSUB (bit1 n) (arithmetic.BIT2 m) =
    numeral.iDUB (numeral.iSUB n m)
    numeral.iSUB (arithmetic.BIT2 n) 0 = bit1 n
    numeral.iSUB (arithmetic.BIT2 n) (bit1 m) =
    bit1 (numeral.iSUB n m)
    numeral.iSUB (arithmetic.BIT2 n) (bit1 m) =
    numeral.iDUB (numeral.iSUB n m)
    numeral.iSUB (arithmetic.BIT2 n) (arithmetic.BIT2 m) =
    numeral.iDUB (numeral.iSUB n m)
    numeral.iSUB (arithmetic.BIT2 n) (arithmetic.BIT2 m) =
    bit1 (numeral.iSUB n m)

(k l. rich_list.SEG 0 k l = [])
  (m x l.
     rich_list.SEG (bit1 m) 0 (x :: l) =
     x :: rich_list.SEG (arithmetic.- (bit1 m) 1) 0 l)
  (m x l.
     rich_list.SEG (arithmetic.BIT2 m) 0 (x :: l) =
     x :: rich_list.SEG (bit1 m) 0 l)
  (m k x l.
     rich_list.SEG (bit1 m) (bit1 k) (x :: l) =
     rich_list.SEG (bit1 m) (arithmetic.- (bit1 k) 1) l)
  (m k x l.
     rich_list.SEG (arithmetic.BIT2 m) (bit1 k) (x :: l) =
     rich_list.SEG (arithmetic.BIT2 m) (arithmetic.- (bit1 k) 1) l)
  (m k x l.
     rich_list.SEG (bit1 m) (arithmetic.BIT2 k) (x :: l) =
     rich_list.SEG (bit1 m) (bit1 k) l)
  m k x l.
    rich_list.SEG (arithmetic.BIT2 m) (arithmetic.BIT2 k) (x :: l) =
    rich_list.SEG (arithmetic.BIT2 m) (bit1 k) l

(f x b e y. numeral_bit.BIT_MODF 0 f x b e y = y)
  (n f b e y.
     numeral_bit.BIT_MODF (bit1 n) f 0 b e y =
     numeral_bit.BIT_MODF (arithmetic.- (bit1 n) 1) f 0 (b + 1)
       (numeral.iDUB e) (if f b then e + y else y))
  (n f b e y.
     numeral_bit.BIT_MODF (arithmetic.BIT2 n) f 0 b e y =
     numeral_bit.BIT_MODF (bit1 n) f 0 (b + 1) (numeral.iDUB e)
       (if f b then e + y else y))
  (n f x b e y.
     numeral_bit.BIT_MODF (bit1 n) f x b e y =
     numeral_bit.BIT_MODF (arithmetic.- (bit1 n) 1) f (arithmetic.DIV2 x)
       (b + 1) (numeral.iDUB e) (if f b (odd x) then e + y else y))
  n f x b e y.
    numeral_bit.BIT_MODF (arithmetic.BIT2 n) f x b e y =
    numeral_bit.BIT_MODF (bit1 n) f (arithmetic.DIV2 x) (b + 1)
      (numeral.iDUB e) (if f b (odd x) then e + y else y)

(x y. some x = some y x = y) (x. option.THE (some x) = x)
  (x. ¬(none = some x)) (x. ¬(some x = none))
  (x. isSome (some x) ) (isSome none )
  (x. isNone x x = none) (x. ¬isSome x x = none)
  (x. isSome x some (option.THE x) = x)
  (x. option.option_CASE x none some = x)
  (x. option.option_CASE x x some = x)
  (x. isNone x option.option_CASE x e f = e)
  (x. isSome x option.option_CASE x e f = f (option.THE x))
  (x. isSome x option.option_CASE x e some = x)
  (v f. option.option_CASE none v f = v)
  (x v f. option.option_CASE (some x) v f = f x)
  (f x. map f (some x) = some (f x)) (f. map f none = none)
  option.OPTION_JOIN none = none x. option.OPTION_JOIN (some x) = x

(y. gcd.gcd 0 y = y) (n. gcd.gcd (bit1 n) 0 = bit1 n)
  (n. gcd.gcd (arithmetic.BIT2 n) 0 = arithmetic.BIT2 n)
  (y n.
     gcd.gcd (bit1 n) (bit1 y) =
     if arithmetic.- (bit1 y) 1 arithmetic.- (bit1 n) 1 then
       gcd.gcd
         (arithmetic.- (arithmetic.- (bit1 n) 1) (arithmetic.- (bit1 y) 1))
         (bit1 y)
     else
       gcd.gcd (bit1 n)
         (arithmetic.- (arithmetic.- (bit1 y) 1)
            (arithmetic.- (bit1 n) 1)))
  (y n.
     gcd.gcd (arithmetic.BIT2 n) (bit1 y) =
     if arithmetic.- (bit1 y) 1 bit1 n then
       gcd.gcd (arithmetic.- (bit1 n) (arithmetic.- (bit1 y) 1)) (bit1 y)
     else
       gcd.gcd (arithmetic.BIT2 n)
         (arithmetic.- (arithmetic.- (bit1 y) 1) (bit1 n)))
  (y n.
     gcd.gcd (bit1 n) (arithmetic.BIT2 y) =
     if bit1 y arithmetic.- (bit1 n) 1 then
       gcd.gcd (arithmetic.- (arithmetic.- (bit1 n) 1) (bit1 y))
         (arithmetic.BIT2 y)
     else
       gcd.gcd (bit1 n)
         (arithmetic.- (bit1 y) (arithmetic.- (bit1 n) 1)))
  y n.
    gcd.gcd (arithmetic.BIT2 n) (arithmetic.BIT2 y) =
    if bit1 y bit1 n then
      gcd.gcd (arithmetic.- (bit1 n) (bit1 y)) (arithmetic.BIT2 y)
    else gcd.gcd (arithmetic.BIT2 n) (arithmetic.- (bit1 y) (bit1 n))

n m.
    numeral.iZ (0 + n) = n numeral.iZ (n + 0) = n
    numeral.iZ (bit1 n + bit1 m) = arithmetic.BIT2 (numeral.iZ (n + m))
    numeral.iZ (bit1 n + arithmetic.BIT2 m) = bit1 (suc (n + m))
    numeral.iZ (arithmetic.BIT2 n + bit1 m) = bit1 (suc (n + m))
    numeral.iZ (arithmetic.BIT2 n + arithmetic.BIT2 m) =
    arithmetic.BIT2 (suc (n + m)) suc (0 + n) = suc n
    suc (n + 0) = suc n suc (bit1 n + bit1 m) = bit1 (suc (n + m))
    suc (bit1 n + arithmetic.BIT2 m) = arithmetic.BIT2 (suc (n + m))
    suc (arithmetic.BIT2 n + bit1 m) = arithmetic.BIT2 (suc (n + m))
    suc (arithmetic.BIT2 n + arithmetic.BIT2 m) =
    bit1 (numeral.iiSUC (n + m))
    numeral.iiSUC (0 + n) = numeral.iiSUC n
    numeral.iiSUC (n + 0) = numeral.iiSUC n
    numeral.iiSUC (bit1 n + bit1 m) = arithmetic.BIT2 (suc (n + m))
    numeral.iiSUC (bit1 n + arithmetic.BIT2 m) =
    bit1 (numeral.iiSUC (n + m))
    numeral.iiSUC (arithmetic.BIT2 n + bit1 m) =
    bit1 (numeral.iiSUC (n + m))
    numeral.iiSUC (arithmetic.BIT2 n + arithmetic.BIT2 m) =
    arithmetic.BIT2 (numeral.iiSUC (n + m))

(n. 0 + n = n) (n. n + 0 = n) (n m. n + m = numeral.iZ (n + m))
  (n. 0 * n = 0) (n. n * 0 = 0) (n m. n * m = n * m)
  (m. arithmetic.- 0 m = 0) (n. arithmetic.- n 0 = n)
  (n m. arithmetic.- n m = arithmetic.- n m) (n. 0 bit1 n = 0)
  (n. 0 arithmetic.BIT2 n = 0) (m. m 0 = 1)
  (n m. n m = n m) suc 0 = 1 (n. suc n = suc n)
  prim_rec.PRE 0 = 0 (n. prim_rec.PRE n = prim_rec.PRE n)
  (n. n = 0 n = 0) (n. 0 = n n = 0) (n m. n = m n = m)
  (n. n < 0 ) (n. 0 < n 0 < n) (n m. n < m n < m)
  (n. 0 > n ) (n. n > 0 0 < n) (n m. n > m m < n)
  (n. 0 n ) (n. n 0 n 0) (n m. n m n m)
  (n. n 0 ) (n. 0 n n = 0) (n m. n m m n)
  (n. odd n odd n) (n. even n even n) ¬odd 0 even 0

External Type Operators

External Constants

Assumptions

null []

isNone none

even 0

¬isSome none

¬odd 0

const = λx y. x

¬

¬

length [] = 0

bit0 0 = 0

concat [] = []

reverse [] = []

a. isSome (some a)

a. isLeft (left a)

x. x = x

b. isRight (right b)

t. t t

v. v = ()

p. all p []

q. q

factorial 0 = 1

a. ¬isNone (some a)

a. ¬isRight (left a)

b. ¬isLeft (right b)

t. t ¬t

m. ¬(m < 0)

n. ¬(n < n)

n. n < suc n

p. ¬any p []

(¬) = λt. t

() = λP. P ((select) P)

x y. universe x y

a. x. x = a

a. ∃!b. b = a

t. (x. t) t

t. (x. t) t

t. (λx. t x) = t

f g. f = g

() = λP. P = λx.

Combinator.w = λf x. f x x

unzip [] = ([], [])

a. ¬(some a = none)

x. destLeft (left x) = x

x. destRight (right x) = x

t. ¬¬t t

t. ( t) t

t. (t ) t

t. t

t. t t

t. t

t. t t

t. t t t

t. t

t. t t

t. t

t. t t

t. t

t. t t

t. t

t. t t t

n. ¬(suc n = 0)

m. m * 0 = 0

n. 0 + n = n

l. [] @ l = l

f. map f [] = []

f. map f none = none

x. Combinator.s const x = id

p. filter p [] = []

() = λf g x. f (g x)

flip = λf x y. f y x

x y. ¬empty x y

t1 t2. (let x t2 in t1) = t1

t. ( t) ¬t

t. (t ) ¬t

t. t ¬t

n. bit1 n = suc (bit0 n)

m. m 0 = 1

l. null l l = []

f. injective f ¬surjective f

Combinator.s = λf g x. f x (g x)

h t. ¬null (h :: t)

x. (select y. y = x) = x

() = λp q. p q p

t. (t ) (t )

n. even (suc n) ¬even n

n. odd (suc n) ¬odd n

x. (fst x, snd x) = x

t1 t2. (if then t1 else t2) = t2

t1 t2. (if then t1 else t2) = t1

h t. ¬(h :: t = [])

h t. head (h :: t) = h

h t. tail (h :: t) = t

b t. (if b then t else t) = t

P x. P x P ((select) P)

r. reflexive r x. r x x

n. 0 < n ¬(n = 0)

n. bit0 (suc n) = suc (suc (bit0 n))

x. q r. x = (q, r)

x y. x = y y = x

x y. x = y y = x

t1 t2. t1 t2 t2 t1

A B. A B B A

m n. m > n n < m

m n. m n n m

m n. m * n = n * m

m n. m + n = n + m

p x. x fromPredicate p p x

r. irreflexive r x. ¬r x x

n. factorial (suc n) = suc n * factorial n

h t. length (h :: t) = suc (length t)

m n. m < suc n m n

m. m = 0 n. m = suc n

opt. opt = none x. opt = some x

f x. map f (some x) = some (f x)

p. (b. p b) p p

() = λp q. (λf. f p q) = λf. f

f. surjective f y. x. y = f x

P. ¬(x. P x) x. ¬P x

() = λP. q. (x. P x q) q

x y. some x = some y x = y

a b. left a = left b a = b

a b. right a = right b a = b

t1 t2. ¬(t1 t2) t1 ¬t2

m n. m + suc n = suc (m + n)

m n. suc m + n = suc (m + n)

m n. suc m = suc n m = n

m n. suc m < suc n m < n

h t. concat (h :: t) = h @ concat t

f g a. case f g (left a) = f a

f g b. case f g (right b) = g b

f g x. (f g) x = f (g x)

t1 t2. ¬(t1 t2) ¬t1 ¬t2

t1 t2. ¬(t1 t2) ¬t1 ¬t2

m n. max m n = if m n then n else m

m n. min m n = if m n then m else n

m n. m * suc n = m + m * n

m n. m suc n = m * m n

m n. ¬(n = 0) m mod n < n

r s. intersect r s = fromSet (toSet r toSet s)

r s. union r s = fromSet (toSet r toSet s)

f g. (x. f x = g x) f = g

p a. (x. a = x p x) p a

p a. (x. x = a p x) p a

P a. (y. y = a P y) P a

x. (a. x = left a) b. x = right b

P. P none (x. P (some x)) opt. P opt

() = λt1 t2. t. (t1 t) (t2 t) t

h t. last (h :: t) = if null t then h else last t

h t. reverse (h :: t) = reverse t @ h :: []

m n. m n m < n m = n

m n. m < n n < m m = n

s x y. fromSet s x y (x, y) s

r x y. (x, y) toSet r r x y

P Q. (x. P Q x) P x. Q x

P Q. (z. P Q z) P x'. Q x'

P Q. (u. P Q u) P x'. Q x'

P Q. (x. P Q x) P x. Q x

P Q. P (x'. Q x') u. P Q u

p q. p (x. q x) x. p q x

p q. p (x. q x) x. p q x

P Q. P (x'. Q x') z. P Q z

P Q. (x. P x Q) (x. P x) Q

p q. (x. p x q) (x. p x) q

P Q. (x. P x Q) (x. P x) Q

P Q. (x. P x) Q x. P x Q

p q. (x. p x) q x. p x q

p q. (x. p x) q x. p x q

P Q. (x. P x) Q x. P x Q

x y z. x = y y = z x = z

p q r. p q r p q r

t1 t2 t3. (t1 t2) t3 t1 t2 t3

t1 t2 t3. (t1 t2) t3 t1 t2 t3

m n p. m < n n < p m < p

l h t. (h :: t) @ l = h :: t @ l

P x. (y. P y y = x) (select) P = x

P. (x. y. P x y) f. x. P x (f x)

f h t. map f (h :: t) = f h :: map f t

f. injective f x1 x2. f x1 = f x2 x1 = x2

p h t. all p (h :: t) p h all p t

p h t. any p (h :: t) p h any p t

P. P 0 (n. P n P (suc n)) n. P n

e f. fn. fn none = e x. fn (some x) = f x

r s. subrelation r s x y. r x y s x y

b t1 t2. (if b then t1 else t2) (¬b t1) (b t2)

A B C. A (B C) A B A C

P Q R. P Q R (P Q) (P R)

p q r. (p q) r p r q r

P Q R. P Q R (P R) (Q R)

p q r. p q r (p r) (q r)

s t x. x s t x s x t

s t x. x s t x s x t

(∃!) = λP. () P x y. P x P y x = y

b f x y. f (if b then x else y) = if b then f x else f y

b f g x. (if b then f else g) x = if b then f x else g x

s x y. bigIntersect s x y r. r s r x y

P Q. (x'. P x' Q x') (x. P x) x'. Q x'

P Q. (x. P x Q x) (x. P x) x'. Q x'

r.
    transitiveClosure r =
    bigIntersect { s. s | subrelation r s transitive s }

m n. ¬(n = 0) (m div n) * n + m mod n = m

p. p [] (h t. p t p (h :: t)) l. p l

r. transitive r x y z. r x y r y z r x z

h1 h2 t1 t2. h1 :: t1 = h2 :: t2 h1 = h2 t1 = t2

a b a' b'. (a, b) = (a', b') a = a' b = b'

p h t. filter p (h :: t) = if p h then h :: filter p t else filter p t

f0 f1. fn. fn [] = f0 a0 a1. fn (a0 :: a1) = f1 a0 a1 (fn a1)

p. (∃!x. p x) (x. p x) x x'. p x p x' x = x'

r. wellFounded r p. (x. p x) x. p x y. r y x ¬p y

h x y t xs ys.
    unzip (h :: t) = (x :: xs, y :: ys) h = (x, y) unzip t = (xs, ys)