reserve n for Nat,
  k for Integer;
reserve p for polyhedron,
  k for Integer,
  n for Nat;

theorem Th86:
  p is simply-connected implies p is eulerian
proof
  assume
A1: p is simply-connected;
  set apcs = alternating-proper-f-vector(p);
  per cases;
  suppose
    dim(p) = 0;
    hence thesis by Th85;
  end;
  suppose
A2: dim(p) > 0;
    deffunc B(Nat) = ((-1)|^($1+1))*(dim (($1-1)-circuit-space(p)));
    deffunc A(Nat) = ((-1)|^($1+1))*(dim (($1-2)-bounding-chain-space(p)));
    consider a being FinSequence such that
A3: len a = len apcs and
A4: for n being Nat st n in dom a holds a.n = A(n) from FINSEQ_1:sch 2;
A5: rng a c= INT
    proof
      let y be object;
      assume y in rng a;
      then consider x being object such that
A6:   x in dom a and
A7:   y = a.x by FUNCT_1:def 3;
      reconsider x as Element of NAT by A6;
      a.x = ((-1)|^(x+1))*(dim ((x-2)-bounding-chain-space(p))) by A4,A6;
      hence thesis by A7, INT_1:def 2;
    end;
    consider b being FinSequence such that
A8: len b = len apcs and
A9: for n being Nat st n in dom b holds b.n = B(n) from FINSEQ_1:sch 2;
    rng b c= INT
    proof
      let y be object;
      assume y in rng b;
      then consider x being object such that
A10:  x in dom b and
A11:  y = b.x by FUNCT_1:def 3;
      reconsider x as Element of NAT by A10;
      b.x = ((-1)|^(x+1))*(dim ((x-1)-circuit-space(p))) by A9,A10;
      hence thesis by A11,INT_1:def 2;
    end;
    then reconsider a,b as FinSequence of INT by A5,FINSEQ_1:def 4;
A12: len apcs > 0 by A2,Def27;
A13: a.1 = 1
    proof
      reconsider egy = 1 as Element of NAT;
      1 <= 0 + 1;
      then egy <= len apcs by A12,NAT_1:13;
      then egy in dom a by A3,FINSEQ_3:25;
      then
      a.egy = ((-1)|^(1+1))*(dim ((egy-2)-bounding-chain-space(p))) by A4
        .= 1*(dim ((egy-2)-bounding-chain-space(p))) by Th4,Th7
        .= 1 by Th60;
      hence thesis;
    end;
A14: for n being Nat st 1 <= n & n < len apcs holds b.n = -(a.(n+1))
    proof
      let n be Nat such that
A15:  1 <= n and
A16:  n < len apcs;
A17:  n in dom b by A8,A15,A16,FINSEQ_3:25;
      reconsider n as Element of NAT by ORDINAL1:def 12;
A18:  b.n = ((-1)|^(n+1))*(dim ((n-1)-circuit-space(p))) by A9,A17;
A19:  1 <= n + 1 by NAT_1:11;
      n + 1 <= len apcs by A16,INT_1:7;
      then n + 1 in dom a by A3,A19,FINSEQ_3:25;
      then a.(n+1) = A(n+1) by A4
        .= (((-1)|^(n+1))*((-1)|^1))*(dim ((n-1)-bounding-chain-space(p)))
      by NEWTON:8
        .= ((-1)|^(n+1))*(-1)*(dim ((n-1)-bounding-chain-space(p)))
        .= -((-1)|^(n+1))*(dim ((n-1)-bounding-chain-space(p)))
        .= -(b.n) by A1,A18,Th48;
      hence thesis;
    end;
A20: b.(len apcs) = (-1)|^(dim(p)+1)
    proof
      reconsider n = len apcs as Element of NAT;
A21:  n = dim(p) by Def27;
      0 + 1 = 1;
      then 1 <= len apcs by A12,NAT_1:13;
      then n in dom b by A8,FINSEQ_3:25;
      then b.n = B(n) by A9
        .= ((-1)|^(n+1))*1 by A1,A21,Th77
        .= (-1)|^(n+1);
      hence thesis by Def27;
    end;
    for n being Nat st 1 <= n & n <= len apcs holds apcs.n = a.n + b.n
    proof
      let n be Nat such that
A22:  1 <= n & n <= len apcs;
      reconsider n9 = n as Element of NAT by ORDINAL1:def 12;
      n9 in dom a by A3,A22,FINSEQ_3:25;
      then
A23:  a.n9 = ((-1)|^(n9+1))*(dim ((n9-2)-bounding-chain-space(p))) by A4;
      apcs.n = ((-1)|^(n+1))*(dim ((n-2)-bounding-chain-space(p))) +
      ((-1)|^(n+1))* (dim ((n-1)-circuit-space(p))) & n9 in dom b
      by A8,A22,Th49,FINSEQ_3:25;
      hence thesis by A9,A23;
    end;
    then Sum apcs = (a.1) + (b.(len apcs)) by A12,A3,A8,A14,Th13;
    hence thesis by A13,A20;
  end;
end;
