 reserve V for Z_Module;
 reserve W for Subspace of V;
 reserve v, u for Vector of V;
 reserve i for Element of INT.Ring;

theorem ThISRank2:
  for V being torsion-free Z_Module,
  W1, W2 being finite-rank free Subspace of V,
  I being Basis of W1
  st (for v being Vector of V st v in I holds (W1 /\ W2) /\ Lin{v} <> (0).V)
  holds rank(W1 /\ W2) = rank(W1)
  proof
    let V be torsion-free Z_Module;
    defpred P[Nat] means
    for W1, W2 being finite-rank free Subspace of V,
    I being Basis of W1
    st (for v being Vector of V st v in I holds (W1 /\ W2) /\ Lin{v} <> (0).V)
    & rank(W1) = $1 holds
    rank(W1 /\ W2) = rank(W1);
    A1: P[0] by ThISRank1;
    A2: for n being Nat st P[n] holds P[n+1]
    proof
      let n be Nat such that
      B1: P[n];
      let W1, W2 be finite-rank free Subspace of V,
      I be Basis of W1 such that
      B2: (for v being Vector of V st v in I holds
      (W1 /\ W2) /\ Lin{v} <> (0).V) & rank(W1) = n + 1;
      card(I) > 0 by ZMODUL03:def 5,B2;
      then I <> {}(the carrier of W1);
      then consider u be object such that
      B3: u in I by XBOOLE_0:7;
      reconsider u as Vector of W1 by B3;
      reconsider uu = u as Vector of V by ZMODUL01:25;
      BX1: I is linearly-independent by VECTSP_7:def 3;
      reconsider II = I as linearly-independent Subset of V
      by ZMODUL03:15,VECTSP_7:def 3;
      I \ {u} is linearly-independent by BX1,XBOOLE_1:36,ZMODUL02:56;
      then reconsider Iu = I \ {u} as linearly-independent Subset of V
      by ZMODUL03:15;
      (Omega).W1 = Lin(I) by VECTSP_7:def 3
      .= Lin(II) by ZMODUL03:20;
      then BX2: (Omega).W1 = Lin(Iu) + Lin{uu} & Lin(Iu) /\ Lin{uu} = (0).V &
      Lin(Iu) is free & Lin{uu} is free & uu <> 0.V by B3,ThLin8;
      reconsider LIu = Lin(Iu) as finite-rank free Subspace of V;
      B5: Iu is Basis of Lin(Iu) by ThLin7;
      card(Iu) = card(I) - card{u} by B3,ZFMISC_1:31,CARD_2:44
      .= rank(W1) - card{u} by ZMODUL03:def 5
      .= n + 1 - 1 by B2,CARD_1:30
      .= n;
      then B6: rank(LIu) = n by B5,ZMODUL03:def 5;
      B7X:for v being Vector of V st v in Iu holds
      (Lin(Iu) /\ W2) /\ Lin{v} <> (0).V
      proof
        let v be Vector of V such that
        C1: v in Iu;
        v in I by C1,TARSKI:def 3,XBOOLE_1:36;
        then (W1 /\ W2) /\ Lin{v} <> (0).V by B2;
        then W1 /\ (W2 /\ Lin{v}) <> (0).V by ZMODUL01:104;
        then C2: W2 /\ Lin{v} <> (0).V by ZMODUL01:107;
        C3: v <> 0.V by C1,ZMODUL02:57;
        C4: v in Lin{v} by ZMODUL02:65,ZFMISC_1:31;
        v in LIu by C1,ZMODUL02:65;
        then LIu /\ Lin{v} <> (0).V by C3,ZMODUL02:66,C4,ZMODUL01:94;
        hence thesis by C2,LmISRank21;
      end;
      B8: (W1 /\ W2) /\ Lin{uu} <> (0).V by B2,B3;
      (LIu /\ W2) + Lin{uu} is Subspace of (W1 /\ W2) + Lin{uu}
      proof
        for x being Vector of V st x in (LIu /\ W2) + Lin{uu} holds
        x in (W1 /\ W2) + Lin{uu}
        proof
          let x be Vector of V such that
          D1: x in (LIu /\ W2) + Lin{uu};
          consider x1, x2 be Vector of V such that
          D2: x1 in (LIu /\ W2) & x2 in Lin{uu} & x = x1 + x2
          by D1,ZMODUL01:92;
          D3: x1 in LIu & x1 in W2 by D2,ZMODUL01:94; then
          x1 in (Omega).W1 by BX2,ZMODUL01:93;
          then x1 in W1;
          then x1 in (W1 /\ W2) by D3,ZMODUL01:94;
          hence thesis by D2,ZMODUL01:92;
        end;
        hence thesis by ZMODUL01:44;
      end;
      then B10X: rank((LIu /\ W2) + Lin{uu}) <= rank((W1 /\ W2) + Lin{uu})
      by ZMODUL05:2;
      (LIu /\ Lin{uu}) /\ W2 = (0).V by ZMODUL01:107,BX2;
      then (W2 /\ LIu) /\ Lin{uu} = (0).V by ZMODUL01:104;
      then rank((LIu /\ W2) + Lin{uu}) = rank(LIu /\ W2) + rank(Lin{uu})
      by ThRankDirectSum
      .= rank(LIu /\ W2) + 1 by BX2,LmRank0a
      .= rank(LIu) + 1 by B7X,B1,B5,B6;
      then B11: rank(LIu) + 1 <= rank(W1 /\ W2) by B10X,B8,BX2,LmRank2;
      B12: rank(W1) = rank((Omega).W1) by ZMODUL05:4
      .= rank(LIu) + rank(Lin{uu}) by BX2,ThRankDirectSum
      .= rank(LIu) + 1 by BX2,LmRank0a;
      W1 /\ W2 is Subspace of W1 by ZMODUL01:105;
      then rank(W1 /\ W2) <= rank(W1) by ZMODUL05:2;
      hence thesis by B12,B11,XXREAL_0:1;
    end;
    A3: for n being Nat holds P[n] from NAT_1:sch 2(A1,A2);
    let W1, W2 be finite-rank free Subspace of V,
    I be Basis of W1 such that
    A4: for v being Vector of V st v in I holds (W1 /\ W2) /\ Lin{v} <> (0).V;
    thus thesis by A4,A3;
  end;
