User blog:Rpakr/A Formal Definition of Pair Sequence System using BM1 Rules

Introduction
In this blog post, I will define BM1 pair sequences formally without using things like ... which are ambiguous, and defines BM1 number.

Definitions
In this section I will define some functions, sets, etc. I will be using in the definition. When I use quotation marks, it means the string inside them should be treated as strings and not as numbers or expressions.

Nonnegative integer
N_0 is the set of all nonnegative integer.

N_0=N∪{0}

Concatenation of two strings
When A and B are strings, con(A,B) is defined to be the string that is the concatenation of A and B.

Pair function
Define Pair(a,b) to be the string “(a,b)” when a and b are nonnegative integers.

Pair(a,b)=P⇔(a∈N_0∧b∈N_0∧P=con(“(“,con(a,con(”,”,con(b,”)”)))))

Pair
Pair(A,B) is a pair when A∈N_0 and B∈N_0.

The set of all pairs is called Pair.

P∈Pair⇔∃A∃B(P=Pair(A,B))

First number
Define First(P) to be the first number of the pair when P is a pair. When P is not a pair, First(P) is undefined.

First(P)=A⇔(P∈Pair∧∃B∈N_0(P=Pair(A,B)))

Second number
Define Second(P) to be the second number of the pair when P is a pair. When P is not a pair, Second(P) is undefined.

Second(P)=B⇔∃A(P=Pair(A,B))

Adding a number to a pair
Define P+a to be the sequence that adds a to the first term of P.

P+a=Q⇔(P∈S∧a∈N_0∧Q=Pair(First(P)+a,Second(P)))

Sequence
Define sequence recursively.

A pair is a sequence.

If A is a pair and B is a sequence, con(A,B) is a sequence.

Let Seq be the set of all sequences.

S∈Seq⇔(S∈Pair∨(S=con(A,B)∧A∈Pair∧B∈Seq))

Expression function
Define Exp(S,n) to be the string “S[n]” when S is a sequence and n∈N.

Exp(S,n)=P⇔(S∈Seq∧n∈N∧P=con(S,con(”[“,con(n,”]”))))

Expression
Exp(S,n) is an expression when S is a sequence and n∈N.

The set of all expressions is called Exp.

E∈Exp⇔∃S∃n(E=Exp(S,n))

Sequence function
Define Seq(E) to be the sequence of expression E.

Seq(E)=S⇔∃n(E=Exp(S,n))

Bracket function
Define Bracket(E) to be the number inside the bracket of expression E.

Bracket(E)=n⇔∃S(E=Exp(S,n))

Length
Define length recursively.

If a sequence is a pair, its length is 1.

If a sequence can be written as con(A,B) when A is a pair and B is a sequence, its length is the the length of B plus one.

Len(S) means the length of sequence S.

Len(S)=1⇔S∈Pair

Len(S)=n+1⇔∃A∈Pair(∃B∈Seq(S=con(A,B)∧Len(B)=n))

nth pair
Pair(n,S) is the nth pair of S.

S∈Pair⇒(Pair(1,S)=S)

S∉Pair⇒(Pair(1,S)=P⇔∃S_2∈Seq(S=con(P,S_2)∧P∈Pair))

∃P∈Pair(S=con(P,S_2))⇒(Pair(n+1,S)=Pair(n,S_2))

m pairs from nth pair
Pair(n,m,S) is the sequence which is m pairs from the nth pair of S.

Pair(n,1,S)=Pair(n,S)

n+m1⇒(Del(S)=S_2⇔∃P∈Pair(con(S_2,P)=S))

Adding a number to a sequence
AddSeq(n,S) is sequence S with n added in the first number.

P(n,S,0)=S

P(n,S,k+1)=con(P(n,S,k),Pair(Len(P(n,S,k))-Len(S)+1,P(n,S,k))+n)

AddSeq_n(S)=P(n,S,n)

Adding a number to a sequence and repeat
AddSeqCon(S,d,r) is sequence S, repeated r times and for each repetition the first number increases by d.

AddSeqCon(S,d,1)=S

AddSeqCon(S,d,r)=con(AddSeqCon(S,d,r-1),AddSeq(r(d-1),S))

Base case
(E∈Exp∧Len(Seq(E))=1∧First(Pair(1,Seq(E)))=0∧Second(Pair(1,Seq(E)))=0)⇒Eval(E)=Bracket(E)+1

Successor case
(E∈Exp∧Len(Seq(E))>1∧First(Pair(Len(Seq(E)),Seq(E)))=0∧Second(Pair(Len(Seq(E)),Seq(E)))=0)⇒Eval(E)=Exp(Del(Seq(E)),Bracket(E)+1)

Limit case
Define LimExp. E∈LimExp⇔(E∈Exp∧Len(Seq(E))>1∧First(Pair(Len(Seq(E)),Seq(E)))>0)

Bad root
(E∈LimExp∧First(Pair(R,Seq(E)))0)∨(D=0∧Second(Pair(Len(Seq(E)),Seq(E)))=0))⇒Delta(E)=D

Good Part
Good(E)=Pair(1,BR(E)-1,Seq(E))

Bad Part
Bad(E)=Pair(BR(E),Len(E)-BR(E),Seq(E))

Value
Eval(E)=Exp(con(Good(E),AddSeqCon(Bad(E),Delta(E),Bracket(E))),Bracket(E))

Value of BM expression
Eval(E)∈N⇒Val(E)=Eval(E)

Eval(E)∉N⇒Val(E)=Val(Eval(E))

Definition of BM1 number
f(n)=Eval(Exp(“(0,0)(1,1)(2,1)(3,1)”,n))

BM1 number=f^10(10)