reconsider n = n as non zero Nat by A1;
set f = { [k,((n - k) mod n)] where k is Element of NAT : k < n } ;
A1: for x being set st x in { [k,((n - k) mod n)] where k is Element of NAT : k < n } holds
ex y, z being set st x = [y,z]
proof
let x be set ; :: thesis: ( x in { [k,((n - k) mod n)] where k is Element of NAT : k < n } implies ex y, z being set st x = [y,z] )
assume x in { [k,((n - k) mod n)] where k is Element of NAT : k < n } ; :: thesis: ex y, z being set st x = [y,z]
then ex k being Element of NAT st
( x = [k,((n - k) mod n)] & k < n ) ;
hence ex y, z being set st x = [y,z] ; :: thesis: verum
end;
for x, y1, y2 being set st [x,y1] in { [k,((n - k) mod n)] where k is Element of NAT : k < n } & [x,y2] in { [k,((n - k) mod n)] where k is Element of NAT : k < n } holds
y1 = y2
proof
let x, y1, y2 be set ; :: thesis: ( [x,y1] in { [k,((n - k) mod n)] where k is Element of NAT : k < n } & [x,y2] in { [k,((n - k) mod n)] where k is Element of NAT : k < n } implies y1 = y2 )
assume that
A2: [x,y1] in { [k,((n - k) mod n)] where k is Element of NAT : k < n } and
A3: [x,y2] in { [k,((n - k) mod n)] where k is Element of NAT : k < n } ; :: thesis: y1 = y2
consider k being Element of NAT such that
A4: [x,y1] = [k,((n - k) mod n)] and
k < n by A2;
A5: y1 = (n - k) mod n by A4, XTUPLE_0:1;
consider k9 being Element of NAT such that
A6: [x,y2] = [k9,((n - k9) mod n)] and
k9 < n by A3;
A7: y2 = (n - k9) mod n by A6, XTUPLE_0:1;
k = x by A4, XTUPLE_0:1
.= k9 by A6, XTUPLE_0:1 ;
hence y1 = y2 by A5, A7; :: thesis: verum
end;
then reconsider f = { [k,((n - k) mod n)] where k is Element of NAT : k < n } as Function by A1, FUNCT_1:def 1, RELAT_1:def 1;
A8: for x being set st x in Segm n holds
x in dom f
proof
let x be set ; :: thesis: ( x in Segm n implies x in dom f )
assume A9: x in Segm n ; :: thesis: x in dom f
then reconsider x = x as Element of NAT ;
x < n by A9, NAT_1:44;
then [x,((n - x) mod n)] in f ;
hence x in dom f by XTUPLE_0:def 12; :: thesis: verum
end;
for x being set st x in dom f holds
x in Segm n
proof
let x be set ; :: thesis: ( x in dom f implies x in Segm n )
assume x in dom f ; :: thesis: x in Segm n
then consider y being set such that
A10: [x,y] in f by XTUPLE_0:def 12;
consider k being Element of NAT such that
A11: [x,y] = [k,((n - k) mod n)] and
A12: k < n by A10;
x = k by A11, XTUPLE_0:1;
hence x in Segm n by A12, NAT_1:44; :: thesis: verum
end;
then A13: dom f = Segm n by A8, TARSKI:1;
for y being set st y in rng f holds
y in Segm n
proof
let y be set ; :: thesis: ( y in rng f implies y in Segm n )
assume y in rng f ; :: thesis: y in Segm n
then consider x being set such that
A14: [x,y] in f by XTUPLE_0:def 13;
consider k being Element of NAT such that
A15: [x,y] = [k,((n - k) mod n)] and
A16: k < n by A14;
k - k < n - k by A16, XREAL_1:9;
then reconsider z = n - k as Element of NAT by INT_1:3;
A17: z mod n < n by NAT_D:1;
y = (n - k) mod n by A15, XTUPLE_0:1;
hence y in Segm n by A17, NAT_1:44; :: thesis: verum
end;
then rng f c= Segm n by TARSKI:def 3;
then reconsider f = f as UnOp of (Segm n) by A13, FUNCT_2:def 1, RELSET_1:4;
for k being Element of Segm n holds f . k = (n - k) mod n
proof
let k be Element of Segm n; :: thesis: f . k = (n - k) mod n
reconsider k = k as Element of NAT ;
k < n by NAT_1:44;
then [k,((n - k) mod n)] in f ;
hence f . k = (n - k) mod n by A13, FUNCT_1:def 2; :: thesis: verum
end;
hence ex b1 being UnOp of (Segm n) st
for k being Element of Segm n holds b1 . k = (n - k) mod n ; :: thesis: verum