defpred S1[ Nat, Nat, set ] means ( ( $1 = $2 implies $3 = L ) & ( $1 + 1 = $2 implies $3 = 1_ K ) & ( $1 <> $2 & $1 + 1 <> $2 implies $3 = 0. K ) );
reconsider N = n as Element of NAT by ORDINAL1:def 12;
A1:
for i, j being Nat st [i,j] in [:(Seg N),(Seg N):] holds
ex x being Element of K st S1[i,j,x]
proof
let i,
j be
Nat;
( [i,j] in [:(Seg N),(Seg N):] implies ex x being Element of K st S1[i,j,x] )
assume
[i,j] in [:(Seg N),(Seg N):]
;
ex x being Element of K st S1[i,j,x]
per cases
( i = j or i + 1 = j or ( i <> j & i + 1 <> j ) )
;
suppose A2:
i = j
;
ex x being Element of K st S1[i,j,x]take
L
;
S1[i,j,L]thus
S1[
i,
j,
L]
by A2;
verum end; suppose A3:
i + 1
= j
;
ex x being Element of K st S1[i,j,x]take
1_ K
;
S1[i,j, 1_ K]thus
S1[
i,
j,
1_ K]
by A3;
verum end; end;
end;
consider M being Matrix of N,K such that
A5:
for i, j being Nat st [i,j] in Indices M holds
S1[i,j,M * (i,j)]
from MATRIX_0:sch 2(A1);
take
M
; ( len M = n & width M = n & ( for i, j being Nat st [i,j] in Indices M holds
( ( i = j implies M * (i,j) = L ) & ( i + 1 = j implies M * (i,j) = 1_ K ) & ( i <> j & i + 1 <> j implies M * (i,j) = 0. K ) ) ) )
thus
( len M = n & width M = n & ( for i, j being Nat st [i,j] in Indices M holds
( ( i = j implies M * (i,j) = L ) & ( i + 1 = j implies M * (i,j) = 1_ K ) & ( i <> j & i + 1 <> j implies M * (i,j) = 0. K ) ) ) )
by A5, MATRIX_0:24; verum