
theorem ThDE3:
  for L being RATional positive-definite Z_Lattice,
  I being Basis of EMLat(L),
  v being Vector of DivisibleMod(L) st v is Dual of L holds
  v in Lin DualBasis(I)
  proof
    let L be RATional positive-definite Z_Lattice,
    I be Basis of EMLat(L),
    v be Vector of DivisibleMod(L) such that
    A1: v is Dual of L;
    set f = (B2DB(I))";
    defpred P[object,object] means
    ($1 in DualBasis(I) implies $2 = (ScProductDM(L)).(f.$1, v)) &
    (not $1 in DualBasis(I) implies $2 = 0.INT.Ring);
    A2: for x being object st x in the carrier of DivisibleMod(L)
    ex y being object st y in the carrier of INT.Ring & P[x, y]
    proof
      let x be object such that
      x in the carrier of DivisibleMod(L);
      per cases;
      suppose B2: x in DualBasis(I);
        then x in rng B2DB(I) by defB2DB;
        then x in dom f by FUNCT_1:33;
        then f.x in rng f by FUNCT_1:3;
        then f.x in dom B2DB(I) by FUNCT_1:33;
        then f.x in I;
        then f.x in EMLat(L);
        then f.x in rng MorphsZQ(L) by ZMODLAT2:def 4;
        then B3: f.x in EMbedding(L) by ZMODUL08:def 3;
        EMbedding(L) is Submodule of DivisibleMod(L) by ZMODUL08:24;
        then B4: f.x is Vector of DivisibleMod(L) by B3,ZMODUL01:25;
        then B5: (ScProductDM(L)).(v, f.x) in INT.Ring by A1,B3,defDualElement;
        take (ScProductDM(L)).(f.x, v);
        thus thesis by B2,B4,B5,ZMODLAT2:6;
      end;
      suppose not x in DualBasis(I);
        hence thesis;
      end;
    end;
    consider l be Function of DivisibleMod(L),
    the carrier of INT.Ring such that
    A3: for x being object st x in the carrier of DivisibleMod(L) holds
    P[x, l.x] from FUNCT_2:sch 1(A2);
    reconsider l as Element of Funcs(the carrier of DivisibleMod(L),
    the carrier of INT.Ring) by FUNCT_2:8;
    for v being Vector of DivisibleMod(L) st not v in DualBasis(I) holds
    l.v = 0.INT.Ring by A3;
    then reconsider l as Linear_Combination of DivisibleMod(L)
    by VECTSP_6:def 1;
    Carrier l c= DualBasis(I)
    proof
      for x being Vector of DivisibleMod(L) st not x in DualBasis(I) holds
      not x in Carrier l
      proof
        let x be Vector of DivisibleMod(L) such that
        B1: not x in DualBasis(I);
        l.x = 0.INT.Ring by A3,B1;
        hence thesis by VECTSP_6:2;
      end;
      hence thesis;
    end;
    then A5: l is Linear_Combination of DualBasis(I) by VECTSP_6:def 4;
    consider b be FinSequence such that
    A6: rng b = I & b is one-to-one by FINSEQ_4:58;
    b is FinSequence of EMLat(L) by A6,FINSEQ_1:def 4;
    then reconsider b as OrdBasis of EMLat(L) by A6,ZMATRLIN:def 5;
    for n being Nat st n in dom b holds
    (ScProductDM(L)).(b/.n, v) = (ScProductDM(L)).(b/.n, Sum(l))
    proof
      let n be Nat such that
      B1: n in dom b;
      EMLat(L) is Submodule of DivisibleMod(L) by ZMODLAT2:20;
      then reconsider bn = b/.n as Vector of DivisibleMod(L) by ZMODUL01:25;
      (ScProductDM(L)).(bn, v) = SumSc(bn, l)
      proof
        b.n in rng b by B1,FUNCT_1:3;
        then B2: bn in I by A6,B1,PARTFUN1:def 6;
        then B5: bn in dom B2DB(I) by defB2DB;
        then B3: (B2DB(I)).bn in rng B2DB(I) by FUNCT_1:3;
        then B31: (B2DB(I)).bn in DualBasis(I);
        B4: for v being Vector of DivisibleMod(L) st v <> (B2DB(I)).bn holds
        (ScProductDM(L)).(bn, l.v * v) = 0.F_Real
        proof
          let v be Vector of DivisibleMod(L) such that
          C1: v <> (B2DB(I)).bn;
          per cases;
          suppose not v in DualBasis(I);
            then l.v = 0.INT.Ring by A3;
            then l.v * v = 0.DivisibleMod(L) by VECTSP_1:14;
            hence thesis by ZMODLAT2:14;
          end;
          suppose v in DualBasis(I); then
            C21: v in rng B2DB(I) by defB2DB;
            then C0: (B2DB(I)).(f.v) = v by FUNCT_1:35;
            v in dom f by C21,FUNCT_1:33;
            then f.v in rng f by FUNCT_1:3;
            then f.v in dom B2DB(I) by FUNCT_1:33;
            then f.v in I;
            then (ScProductDM(L)).(bn, v) = 0.F_Real by B2,C0,C1,defB2DB;
            then l.v * (ScProductDM(L)).(bn, v) = 0.F_Real;
            hence (ScProductDM(L)).(bn, l.v * v) = 0.F_Real by ZMODLAT2:13;
          end;
        end;
        reconsider bbn = (B2DB(I)).bn as Vector of DivisibleMod(L) by B31;
        per cases;
        suppose C1: not (B2DB(I)).bn in Carrier(l);
          consider F be FinSequence of DivisibleMod(L) such that
          C2: F is one-to-one & rng F = Carrier(l) &
          SumSc(bn, l) = Sum(ScFS(bn, l, F)) by defSumScDM;
          C3: len F = len(ScFS(bn, l, F)) by defScFSDM;
          for k being Nat st k in dom(ScFS(bn, l, F))
          holds (ScFS(bn, l, F)).k = -(ScFS(bn, l, F))/.k
          proof
            let k be Nat such that
            D1: k in dom(ScFS(bn, l, F));
            D2: (ScFS(bn, l, F)).k = (ScProductDM(L)).(bn, l.(F/.k) * F/.k)
            by D1,defScFSDM;
            per cases;
            suppose F/.k <> (B2DB(I)).bn;
              then (ScFS(bn, l, F)).k = 0.F_Real by B4,D2;
              hence (ScFS(bn, l, F)).k = -(ScFS(bn, l, F)).k
              .= -(ScFS(bn, l, F))/.k by D1,PARTFUN1:def 6;
            end;
            suppose F/.k = (B2DB(I)).bn;
              then (ScFS(bn, l, F)).k
              = (ScProductDM(L)).(bn, 0.INT.Ring * F/.k) by C1,D2
              .= (ScProductDM(L)).(bn, 0.DivisibleMod(L)) by VECTSP_1:14
              .= 0.F_Real by ZMODLAT2:14;
              hence (ScFS(bn, l, F)).k = -(ScFS(bn, l, F)).k
              .= -(ScFS(bn, l, F))/.k by D1,PARTFUN1:def 6;
            end;
          end;
          then C4: Sum(ScFS(bn, l, F)) = -Sum(ScFS(bn, l, F)) by C3,RLVECT_2:4;
          l.((B2DB(I)).bn) = (ScProductDM(L)).(f.((B2DB(I)).bn), v) by A3,B31;
          then (ScProductDM(L)).(f.(bbn), v) = 0.INT.Ring by C1;
          hence thesis by B5,C2,C4,FUNCT_1:34;
        end;
        suppose (B2DB(I)).bn in Carrier(l);
          then C2: Carrier(l) = (Carrier(l) \ {(B2DB(I)).bn}) \/ {(B2DB(I)).bn}
          by XBOOLE_1:45,ZFMISC_1:31;
          C3: (Carrier(l) \ {(B2DB(I)).bn}) /\ {(B2DB(I)).bn} = {}
          by XBOOLE_0:def 7,XBOOLE_1:79;
          l is Linear_Combination of Carrier(l) by VECTSP_6:7;
          then consider l1 be Linear_Combination of (Carrier(l) \ {bbn}),
          l2 be Linear_Combination of {bbn} such that
          C4: l = l1 + l2 by C2,C3,ZMODUL04:26;
          for x being Vector of DivisibleMod(L) st x in (Carrier(l) \ {bbn})
          holds x in Carrier(l1)
          proof
            let x be Vector of DivisibleMod(L) such that
            D1: x in (Carrier(l) \ {bbn});
            x in Carrier(l) by D1,XBOOLE_0:def 5;
            then D2: l.x <> 0.INT.Ring by VECTSP_6:2;
            D3: Carrier(l2) c= {bbn} by VECTSP_6:def 4;
            D4: l.x = l1.x + l2.x by C4,VECTSP_6:22;
            not x in Carrier(l2) by D1,D3,XBOOLE_0:def 5;
            then l1.x <> 0.INT.Ring by D2,D4;
            hence thesis;
          end;
          then (Carrier(l) \ {bbn}) c= Carrier(l1);
          then Carrier(l1) = (Carrier(l) \ {bbn}) by VECTSP_6:def 4;
          then C12: not bbn in Carrier(l1) by ZFMISC_1:56;
          consider F1 be FinSequence of DivisibleMod(L) such that
          C7: F1 is one-to-one & rng F1 = Carrier(l1) &
          SumSc(bn, l1) = Sum(ScFS(bn, l1, F1)) by defSumScDM;
          C8: len F1 = len(ScFS(bn, l1, F1)) by defScFSDM;
          for k being Nat st k in dom(ScFS(bn, l1, F1))
          holds (ScFS(bn, l1, F1)).k = -(ScFS(bn, l1, F1))/.k
          proof
            let k be Nat such that
            D1: k in dom(ScFS(bn, l1, F1));
            per cases;
            suppose E1: F1/.k <> (B2DB(I)).bn;
              then not F1/.k in {bbn} by TARSKI:def 1;
              then E2: not F1/.k in Carrier(l2) by TARSKI:def 3,VECTSP_6:def 4;
              l.(F1/.k) = l1.(F1/.k) + l2.(F1/.k) by C4,VECTSP_6:22
              .= l1.(F1/.k) + 0.INT.Ring by E2
              .= l1.(F1/.k);
              then (ScFS(bn, l1, F1)).k
              = (ScProductDM(L)).(bn, l.(F1/.k) * F1/.k) by D1,defScFSDM
              .= 0.F_Real by B4,E1;
              hence (ScFS(bn, l1, F1)).k = -(ScFS(bn, l1, F1)).k
              .= -(ScFS(bn, l1, F1))/.k by D1,PARTFUN1:def 6;
            end;
            suppose F1/.k = (B2DB(I)).bn;
              then l1.(F1/.k) = 0.INT.Ring by C12;
              then (ScFS(bn, l1, F1)).k
              = (ScProductDM(L)).(bn, 0.INT.Ring * F1/.k) by D1,defScFSDM
              .= (ScProductDM(L)).(bn, 0.DivisibleMod(L)) by VECTSP_1:14
              .= 0.F_Real by ZMODLAT2:14;
              hence (ScFS(bn, l1, F1)).k = -(ScFS(bn, l1, F1)).k
              .= -(ScFS(bn, l1, F1))/.k by D1,PARTFUN1:def 6;
            end;
          end;
          then C9: Sum(ScFS(bn, l1, F1)) = -Sum(ScFS(bn, l1, F1))
          by C8,RLVECT_2:4;
          C10: SumSc(bn, l2) = (ScProductDM(L)).(bn, l2.bbn * bbn)
          by LmSumScDM14
          .= l2.bbn * (ScProductDM(L)).(bn, bbn) by ZMODLAT2:13
          .= l2.bbn * 1 by B2,defB2DB
          .= l2.bbn;
          l.bbn = l1.bbn + l2.bbn by C4,VECTSP_6:22
          .= 0.INT.Ring + l2.bbn by C12
          .= l2.bbn;
          then C11: SumSc(bn, l2) = (ScProductDM(L)).(f.bbn, v) by A3,B3,C10
          .= (ScProductDM(L)).(bn, v) by B5,FUNCT_1:34;
          thus SumSc(bn, l) = SumSc(bn, l1) + SumSc(bn, l2) by C4,LmSumScDM1X
          .= (ScProductDM(L)).(bn, v) by C7,C9,C11;
        end;
      end;
      hence thesis by ThSumScDM1;
    end;
    hence thesis by A5,ZMODLAT2:63,ZMODUL02:64;
  end;
