reserve A for set, x,y,z for object,
  k for Element of NAT;
reserve n for Nat,
  x for object;
reserve V, C for set;

theorem Th76:
  for X being set, A being finite Subset of X, a being Element of
  X st not a in A for B being finite Subset of X st B = {a} \/ A for R being
Order of X st R linearly_orders B for k being Element of NAT st k in dom(SgmX(R
,B)) & SgmX(R,B)/.k = a for i being Element of NAT st 1 <= i & i <= k - 1 holds
  SgmX(R,B)/.i = SgmX(R,A)/.i
proof
  let X be set, A be finite Subset of X, a be Element of X;
  assume
A1: not a in A;
  let B be finite Subset of X;
  assume
A2: B = {a} \/ A;
  let R be Order of X;
  assume
A3: R linearly_orders B;
  then
A4: R linearly_orders A by A2,Lm6;
  field R = X by ORDERS_1:12;
  then
A5: R is_antisymmetric_in X by RELAT_2:def 12;
  set sgb = SgmX(R,B), sga = SgmX(R,A);
  consider lensga being Nat such that
A6: dom sga = Seg lensga by FINSEQ_1:def 2;
  consider lensgb being Nat such that
A7: dom sgb = Seg lensgb by FINSEQ_1:def 2;
  reconsider lensga,lensgb as Element of NAT by ORDINAL1:def 12;
  lensgb = len sgb by A7,FINSEQ_1:def 3
    .= card B by A3,Th10
    .= card A + 1 by A1,A2,CARD_2:41
    .= len sga + 1 by A2,A3,Lm6,Th10
    .= lensga + 1 by A6,FINSEQ_1:def 3;
  then
A8: lensga <= lensgb by NAT_1:11;
  defpred P[Nat] means sgb/.($1) = sga/.($1);
  let k be Element of NAT;
  assume that
A9: k in dom(SgmX(R,B)) and
A10: SgmX(R,B)/.k = a;
  k in Seg(len(sgb)) by A9,FINSEQ_1:def 3;
  then
A11: 1 <= k by FINSEQ_1:1;
  then 1 - 1 <= k - 1 by XREAL_1:9;
  then reconsider k9 = k - 1 as Element of NAT by INT_1:3;
A12: k - 1 + 1 = k + (0 qua Nat);
A13: for j being Element of NAT st 1 <= j & j < k9 holds (for j9 being
  Element of NAT st 1 <= j9 & j9 <= j holds P[j9]) implies P[j+1]
  proof
    let i9 be Element of NAT;
    assume that
A14: 1 <= i9 and
A15: i9 < k9;
A16: 1 <= i9 + 1 by A14,XREAL_1:29;
A17: i9 + 1 < k by A12,A15,XREAL_1:6;
    then
A18: i9 + 1 in dom sgb by A9,A16,FINSEQ_3:156;
    sgb/.(i9+1) = sgb.(i9+1) by A9,A17,A16,FINSEQ_3:156,PARTFUN1:def 6;
    then sgb/.(i9+1) in rng sgb by A18,FUNCT_1:def 3;
    then
A19: sgb/.(i9+1) in B by A3,Def2;
    sgb/.(i9+1) <> a by A3,A9,A10,A17,A18,Def2;
    then not sgb/.(i9+1) in {a} by TARSKI:def 1;
    then sgb/.(i9+1) in A by A2,A19,XBOOLE_0:def 3;
    then sgb/.(i9+1) in rng sga by A4,Def2;
    then consider l being object such that
A20: l in dom sga and
A21: sga.l = sgb/.(i9+1) by FUNCT_1:def 3;
    reconsider l as Element of NAT by A20;
A22: 1 <= l by A6,A20,FINSEQ_1:1;
    l <= lensga by A6,A20,FINSEQ_1:1;
    then l <= lensgb by A8,XXREAL_0:2;
    then
A23: l in dom sgb by A7,A22,FINSEQ_1:1;
    assume
A24: for j9 being Element of NAT st 1 <= j9 & j9 <= i9 holds P[j9];
    assume
A25: sgb/.(i9+1) <> sga/.(i9+1);
    then
A26: l <> i9 + 1 by A20,A21,PARTFUN1:def 6;
    per cases;
    suppose
      l < i9 + 1;
      then l <= i9 by NAT_1:13;
      then sgb/.l = sga/.l by A24,A22
        .= sgb/.(i9+1) by A20,A21,PARTFUN1:def 6;
      hence thesis by A3,A18,A26,A23,Th75;
    end;
    suppose
A27:  i9 + 1 <= l;
      then
A28:  i9 + 1 in dom sga by A16,A20,FINSEQ_3:156;
      sga/.(i9+1) = sga.(i9+1) by A16,A20,A27,FINSEQ_3:156,PARTFUN1:def 6;
      then sga/.(i9+1) in rng sga by A28,FUNCT_1:def 3;
      then sga/.(i9+1) in A by A4,Def2;
      then sga/.(i9+1) in B by A2,XBOOLE_0:def 3;
      then sga/.(i9+1) in rng sgb by A3,Def2;
      then consider l9 being object such that
A29:  l9 in dom sgb and
A30:  sgb.l9 = sga/.(i9+1) by FUNCT_1:def 3;
      reconsider l9 as Element of NAT by A29;
      i9 + 1 < l by A26,A27,XXREAL_0:1;
      then [sga/.(i9+1),sga/.l] in R by A4,A20,A28,Def2;
      then [sgb/.l9,sga/.l] in R by A29,A30,PARTFUN1:def 6;
      then
A31:  [sgb/.l9,sgb/.(i9+1)] in R by A20,A21,PARTFUN1:def 6;
      sgb/.l9 = sgb.l9 by A29,PARTFUN1:def 6;
      then sgb/.l9 in rng sgb by A29,FUNCT_1:def 3;
      then
A32:  sgb/.l9 in B by A3,Def2;
A33:  1 <= l9 by A7,A29,FINSEQ_1:1;
A34:  i9 + 1 < l9
      proof
        assume
A35:    l9 <= i9 + 1;
        now
          per cases by A35,XXREAL_0:1;
          case
            l9 = i9 + 1;
            hence thesis by A25,A29,A30,PARTFUN1:def 6;
          end;
          case
A36:        l9 < i9 + 1;
            then l9 <= i9 by NAT_1:13;
            then
A37:        sga/.l9 = sgb/.l9 by A24,A33
              .= sga/.(i9+1) by A29,A30,PARTFUN1:def 6;
            l9 in dom sga by A28,A33,A36,FINSEQ_3:156;
            hence thesis by A2,A3,A28,A36,A37,Lm6,Th75;
          end;
        end;
        hence thesis;
      end;
      then [sgb/.(i9+1),sgb/.l9] in R by A3,A18,A29,Def2;
      then sgb/.l9 = sgb/.(i9+1) by A5,A31,A32;
      hence thesis by A3,A18,A29,A34,Th75;
    end;
  end;
  let i be Element of NAT;
  assume that
A38: 1 <= i and
A39: i <= k - 1;
A40: 1 in dom sgb by A9,Lm5;
A41: P[1]
  proof
    sgb/.1 = sgb.1 by A9,Lm5,PARTFUN1:def 6;
    then sgb/.1 in rng sgb by A40,FUNCT_1:def 3;
    then
A42: sgb/.1 in B by A3,Def2;
    k <> 1 by A38,A39,XXREAL_0:2;
    then 1 < k by A11,XXREAL_0:1;
    then sgb/.1 <> a by A3,A9,A10,A40,Def2;
    then not sgb/.1 in {a} by TARSKI:def 1;
    then sgb/.1 in A by A2,A42,XBOOLE_0:def 3;
    then sgb/.1 in rng sga by A4,Def2;
    then consider l being object such that
A43: l in dom sga and
A44: sga.l = sgb/.1 by FUNCT_1:def 3;
A45: sga/.1 = sga.1 by A43,Lm5,PARTFUN1:def 6;
    assume
A46: sgb/.1 <> sga/.1;
    reconsider l as Element of NAT by A43;
A47: 1 in dom sga by A43,Lm5;
    1 <= l by A6,A43,FINSEQ_1:1;
    then 1 < l by A46,A44,A45,XXREAL_0:1;
    then [sga/.1,sga/.l] in R by A4,A43,A47,Def2;
    then
A48: [sga/.1,sgb/.1] in R by A43,A44,PARTFUN1:def 6;
    not sga/.1 in B
    proof
A49:  sgb/.1 = sgb.1 by A9,Lm5,PARTFUN1:def 6;
      assume sga/.1 in B;
      then sga/.1 in rng sgb by A3,Def2;
      then consider l9 being object such that
A50:  l9 in dom sgb and
A51:  sgb.l9 = sga/.1 by FUNCT_1:def 3;
      reconsider l9 as Element of NAT by A50;
      1 <= l9 by A7,A50,FINSEQ_1:1;
      then 1 < l9 by A46,A51,A49,XXREAL_0:1;
      then [sgb/.1,sgb/.l9] in R by A3,A40,A50,Def2;
      then [sgb/.1,sga/.1] in R by A50,A51,PARTFUN1:def 6;
      hence thesis by A5,A46,A42,A48;
    end;
    then
A52: not(sga/.1) in A by A2,XBOOLE_0:def 3;
    sga/.1 in rng sga by A47,A45,FUNCT_1:def 3;
    hence thesis by A4,A52,Def2;
  end;
  for j being Element of NAT st 1 <= j & j <= k9 holds P[j] from INT_1:sch 8
  (A41,A13);
  hence thesis by A38,A39;
end;
