reserve a,b,d,n,k,i,j,x,s for Nat;

theorem Th11:
  for n,i,j st
    Fib(n),Fib(n+i) are_congruent_mod j &
    Fib(n+1),Fib(n+i+1) are_congruent_mod j
  for x,y be Nat st x,y are_congruent_mod i holds
    Fib(x),Fib(y) are_congruent_mod j
proof
  let n,i,j such that
A1: Fib(n),Fib(n+i) are_congruent_mod j &
    Fib(n+1),Fib(n+i+1) are_congruent_mod j;
  defpred P[Nat] means  Fib($1),Fib($1+i) are_congruent_mod j &
        Fib($1+1),Fib($1+i+1) are_congruent_mod j;
  defpred Q[Nat] means P[n+$1];
A2: Q[0] by A1;
A3: for k be Nat st Q[k] holds Q[k+1]
  proof
    let k be Nat such that
A4:   Q[k];
    Fib(n+k)+Fib(n+k+1),Fib(n+k+i)+Fib(n+k+i+1) are_congruent_mod j
    by A4,INT_1:16;
    then Fib(n+k+1+1),Fib(n+k+i)+Fib(n+k+i+1) are_congruent_mod j by PRE_FF:1;
    hence thesis by A4,PRE_FF:1;
  end;
A5: for k be Nat holds Q[k] from NAT_1:sch 2(A2,A3);
  defpred R[Nat] means $1<=n implies
    for i be Nat st i=n-$1 holds P[i];
A6: R[0] by A1;
A7: for k be Nat st R[k] holds R[k+1]
  proof
    let k be Nat such that
A8:   R[k] & k+1 <=n;
    let z be Nat such that
A9:   z=n-(k+1);
A10:  Fib(z) +Fib(z+1) = Fib(z+1+1) &
    Fib(z+i) +Fib(z+i+1) = Fib(z+1+i+1) by PRE_FF:1;
    P[z+1] by A8,NAT_1:13,A9;
    then Fib(z+1+1)-Fib(z+1),Fib(z+1+i+1)-Fib(z+1+i) are_congruent_mod j
      by INT_1:17;
    hence thesis by A10,A8,NAT_1:13,A9;
  end;
A11: for k be Nat holds R[k] from NAT_1:sch 2(A6,A7);
A12: for k be Nat holds Fib(k),Fib(k+i) are_congruent_mod j
  proof
    let k be Nat;
    per cases;
    suppose k <n;
      then reconsider z=n-k as Element of NAT by NAT_1:21;
A13:    R[z] by A11;
      z <= n-0 by XREAL_1:10;
      hence thesis by A13;
    end;
    suppose k>=n;
      then reconsider z=k-n as Element of NAT by NAT_1:21;
      Q[z] by A5;
      hence thesis;
    end;
  end;
A14:now let x,y be Nat such that
A15: x <y & x,y are_congruent_mod i;
    consider k be Integer such that
A16: y = k * i + x by NAT_6:9,A15,INT_1:14;
    y >= x+0 by A15;
    then k >=0 by A15,A16,XREAL_1:7;
    then reconsider k as Element of NAT by INT_1:3;
    defpred D[Nat] means Fib(x),Fib(x+i*$1) are_congruent_mod j;
A17:  D[0] by INT_1:11;
A18:  for k be Nat st D[k] holds D[k+1]
    proof
      let k be Nat such that
A19:    Fib(x),Fib(x+i*k) are_congruent_mod j;
      Fib(x+i*k),Fib(x+i*k+i) are_congruent_mod j by A12;
      hence thesis by A19,INT_1:15;
    end;
    for k be Nat holds D[k] from NAT_1:sch 2(A17,A18);
    then D[k];
    hence Fib(x),Fib(y) are_congruent_mod j by A16;
  end;
  let x,y be Nat such that
A20: x,y are_congruent_mod i;
A21: y,x are_congruent_mod i by A20,INT_1:14;
  per cases by XXREAL_0:1;
  suppose x<y;
    hence thesis by A20,A14;
  end;
  suppose x=y;
    hence thesis by INT_1:11;
  end;
  suppose y <x;
    then Fib(y),Fib(x) are_congruent_mod j by A14,A21;
    hence thesis by INT_1:14;
  end;
end;
