reserve i,j,k,n,l for Element of NAT,
  K for Field,
  a,b,c for Element of K,
  p ,q for FinSequence of K,
  M1,M2,M3 for Matrix of n,K;
reserve D for non empty set,
  t for FinSequence of D,
  A for Matrix of n,D;

theorem
  n>0 implies 1.(K,n) is line_circulant
proof
  set M1=1.(K,n);
  set p=Line(M1,1);
  assume
A1: n>0;
A2: Indices (1.(K,n))=[:Seg n, Seg n:] by MATRIX_0:24;
A3: width (1.(K,n))=n by MATRIX_0:24;
  then
A4: len p = n by MATRIX_0:def 7;
  for i,j be Nat st [i,j] in Indices M1 holds M1*(i,j)=p.((j-i mod len p)+ 1)
  proof
    let i,j be Nat;
A5: j-i mod n >=0 by A1,NAT_D:62;
    then
A6: (j-i mod n)+1 in NAT by INT_1:3;
    assume
A7: [i,j] in Indices M1;
    then
A8: j in Seg n by A2,ZFMISC_1:87;
    then
A9: 1 <= j by FINSEQ_1:1;
A10: j <= n by A8,FINSEQ_1:1;
A11: i in Seg n by A2,A7,ZFMISC_1:87;
    then 1 <= i by FINSEQ_1:1;
    then
A12: j-i <= n-1 by A10,XREAL_1:13;
    n-1 < n by XREAL_1:44;
    then
A13: j-i< n by A12,XXREAL_0:2;
    i <= n by A11,FINSEQ_1:1;
    then
A14: 1-n<=j-i by A9,XREAL_1:13;
    -n<=-n+1 by XREAL_1:29;
    then
A15: -n<=j-i by A14,XXREAL_0:2;
    j-i mod n <=n-1
    proof
      per cases;
      suppose
        0 <=j-i;
        hence thesis by A12,A13,NAT_D:63;
      end;
      suppose
A16:    0 >j-i;
        then j-i<=-1 by INT_1:8;
        then n+(j-i)<=n+-1 by XREAL_1:6;
        hence thesis by A15,A16,NAT_D:63;
      end;
    end;
    then
A17: (j-i mod n)+1 <=n-1+1 by XREAL_1:6;
    (j-i mod n)+1>=0+1 by A5,XREAL_1:6;
    then
A18: (j-i mod n)+1 in Seg n by A17,A6;
    then
A19: (j-i mod len p)+1 in Seg n by A3,MATRIX_0:def 7;
    M1*(i,j)=p.((j-i mod len p)+1)
    proof
      per cases;
      suppose
A20:    i=j;
        0+1<=n by A1,NAT_1:13;
        then 1 in Seg n;
        then
A21:    [1,1] in Indices M1 by A2,ZFMISC_1:87;
        j-i mod len p =0 by A1,A4,A20,NAT_D:63;
        then p.((j-i mod len p)+1)=M1*(1,1) by A3,A19,MATRIX_0:def 7
          .=1_K by A21,MATRIX_1:def 3;
        hence thesis by A7,A20,MATRIX_1:def 3;
      end;
      suppose
A22:    i <> j;
        j-i mod n <>0
        proof
          per cases;
          suppose
            0 <=j-i;
            then j-i mod n=j-i by A13,NAT_D:63;
            hence thesis by A22;
          end;
          suppose
A23:        0 >j-i;
            1-n+n<=(j-i)+n by A14,XREAL_1:6;
            hence thesis by A15,A23,NAT_D:63;
          end;
        end;
        then
A24:    (j-i mod len p)+1<>1 by A3,MATRIX_0:def 7;
        set l=(j-i mod len p)+1;
        reconsider l as Nat by A3,A6,MATRIX_0:def 7;
        0+1<=n by A1,NAT_1:13;
        then
A25:    1 in Seg n;
        l in Seg n by A3,A18,MATRIX_0:def 7;
        then
A26:    [1,l] in Indices M1 by A2,A25,ZFMISC_1:87;
        p.l =M1*(1,l) by A3,A19,MATRIX_0:def 7
          .=0.K by A24,A26,MATRIX_1:def 3;
        hence thesis by A7,A22,MATRIX_1:def 3;
      end;
    end;
    hence thesis;
  end;
  then M1 is_line_circulant_about p by A3,A4;
  then consider p being FinSequence of K such that
A27: len p =width M1 & M1 is_line_circulant_about p;
  take p;
  thus thesis by A27;
end;
