reserve IIG for Circuit-like non void non empty ManySortedSign;
reserve IIG for monotonic Circuit-like non void non empty ManySortedSign;

theorem Th5:
  for IIG for SCS being finite-yielding non-empty MSAlgebra over
IIG, v, w being Vertex of IIG, e1 being Element of (the Sorts of FreeEnv SCS).v
  , q1 being DTree-yielding FinSequence st v in InnerVertices IIG & e1 = [
  action_at v,the carrier of IIG]-tree q1 holds for k being Element of NAT st k
  in dom q1 & q1.k in (the Sorts of FreeEnv SCS).w holds w = (the_arity_of
  action_at v)/.k
proof
  let IIG;
  let SCS be finite-yielding non-empty MSAlgebra over IIG, v, w be Vertex of
  IIG, e1 be Element of (the Sorts of FreeEnv SCS).v, q1 be DTree-yielding
  FinSequence;
  assume that
A1: v in InnerVertices IIG and
A2: e1 = [action_at v,the carrier of IIG]-tree q1;
  thus for k being Element of NAT st k in dom q1 & q1.k in (the Sorts of
  FreeEnv SCS).w holds w = (the_arity_of action_at v)/.k
  proof
    reconsider av = action_at v as OperSymbol of IIG;
    let k be Element of NAT;
    assume that
A3: k in dom q1 and
A4: q1.k in (the Sorts of FreeEnv SCS).w;
A5: FreeEnv SCS = MSAlgebra (# FreeSort the Sorts of SCS, FreeOper the
      Sorts of SCS #) by MSAFREE:def 14;
    e1 in (the Sorts of FreeEnv SCS).v;
    then
A6: e1 in (the Sorts of FreeEnv SCS) .(the_result_sort_of av) by A1,
MSAFREE2:def 7;
    then len q1 = len (the_arity_of av) by A2,MSAFREE2:10;
    then
A7: k in dom the_arity_of av by A3,FINSEQ_3:29;
    then q1.k in (the Sorts of FreeEnv SCS) .((the_arity_of av).k) by A2,A6,
MSAFREE2:11;
    then
A8: q1.k in (FreeSort the Sorts of SCS).((the_arity_of av)/.k) by A7,A5,
PARTFUN1:def 6;
    now
      assume (the_arity_of av)/.k <> w;
      then ((FreeSort the Sorts of SCS).((the_arity_of av)/.k)) misses ((
      FreeSort the Sorts of SCS).w) by MSAFREE:12;
      then ((FreeSort the Sorts of SCS).((the_arity_of av)/.k)) /\ ((FreeSort
      the Sorts of SCS).w) = {} by XBOOLE_0:def 7;
      hence contradiction by A4,A5,A8,XBOOLE_0:def 4;
    end;
    hence thesis;
  end;
end;
