reserve i,j,k,n,m for Nat,
        b,b1,b2 for bag of n;

theorem Th12:
  SgmX(RelIncl n, support b) =
    SgmX(RelIncl (n+1), support (b bag_extend 0))
proof
  set S1=SgmX(RelIncl n, support b);
  set B=b bag_extend 0;
  set S2 = SgmX(RelIncl (n+1), support B);
A1:RelIncl n linearly_orders support b by PRE_POLY:82;
A2:RelIncl (n+1) linearly_orders support B by PRE_POLY:82;
A3:rng S1 = support b & rng S2 = support B by A1,A2,PRE_POLY:def 2;
A4: support b = support B by Th11;
  then reconsider s2=S2 as FinSequence of n by A3,FINSEQ_1:def 4;
  reconsider R1=RelIncl (n+1) as Order of (n+1);
  for n1,m1 be Nat
    st n1 in dom s2 & m1 in dom s2 & n1 < m1 holds
    s2/.n1 <> s2/.m1 & [s2/.n1,s2/.m1] in RelIncl n
  proof
    let n1,m1 be Nat such that
A5: n1 in dom s2 & m1 in dom s2 & n1 < m1;
    [S2/.n1,S2/.m1] in RelIncl (n+1) by A5,A2,PRE_POLY:def 2;
    then
A6: S2/.n1 c= S2/.m1 by WELLORD2:def 1;
A7: S2/.n1 = S2.n1 = s2/.n1 by A5,PARTFUN1:def 6;
A8: S2/.m1 = S2.m1 = s2/.m1 by A5,PARTFUN1:def 6;
    s2.n1 in rng S2 & s2.m1 in rng S2 by A5,FUNCT_1:def 3;
    hence thesis by A5,A2,PRE_POLY:def 2,A6,A7,A8,A3,A4, WELLORD2:def 1;
  end;
  hence thesis by A3,A4,A1,PRE_POLY:def 2;
end;
