reserve A for QC-alphabet;
reserve n,k,m for Nat;
reserve F,G,G9,H,H9 for Element of QC-WFF(A);

theorem Th4:
  rng list_of_immediate_constituents(F) = { G where G is Element
  of QC-WFF(A) : G is_immediate_constituent_of F }
proof
  thus rng list_of_immediate_constituents(F) c= { G where G is Element of
  QC-WFF(A) : G is_immediate_constituent_of F }
  proof
    let y be object;
    assume
A1: y in rng list_of_immediate_constituents(F);
    rng list_of_immediate_constituents(F) c= QC-WFF(A) by FINSEQ_1:def 4;
    then reconsider G = y as Element of QC-WFF(A) by A1;
    ex x being object st x in dom list_of_immediate_constituents(F) & y = (
    list_of_immediate_constituents(F)).x by A1,FUNCT_1:def 3;
    then G is_immediate_constituent_of F by Th3;
    hence thesis;
  end;
  thus { G where G is Element of QC-WFF(A) :
    G is_immediate_constituent_of F } c=
  rng list_of_immediate_constituents(F)
  proof
    let x be object;
    assume
    x in { G where G is Element of QC-WFF(A) :
    G is_immediate_constituent_of F };
    then consider G such that
A2: x = G and
A3: G is_immediate_constituent_of F;
    ex n st n in dom list_of_immediate_constituents(F) & G = (
    list_of_immediate_constituents(F)).n
    proof
A4:   F <> VERUM(A) by A3,QC_LANG2:41;
      per cases by A3,A4,QC_LANG1:9,QC_LANG2:47;
      suppose
        F is negative;
        then
A5:     list_of_immediate_constituents(F) = <* the_argument_of F *> & G =
        the_argument_of F by A3,Def1,QC_LANG2:48;
        consider n such that
A6:     n = 1;
        dom <* the_argument_of F *> = Seg 1 & <* the_argument_of F *>.n =
        the_argument_of F by A6,FINSEQ_1:def 8;
        hence thesis by A6,A5,FINSEQ_1:3;
      end;
      suppose
A7:     F is conjunctive;
A8:     <* the_left_argument_of F, the_right_argument_of F *>.2 =
        the_right_argument_of F;
        len <* the_left_argument_of F, the_right_argument_of F *> = 2 by
FINSEQ_1:44;
        then
A9:     dom <* the_left_argument_of F, the_right_argument_of F *> = Seg 2
        by FINSEQ_1:def 3;
A10:    list_of_immediate_constituents(F) = <* the_left_argument_of F,
        the_right_argument_of F *> by A7,Def1;
A11:    <* the_left_argument_of F, the_right_argument_of F *>.1 =
        the_left_argument_of F;
        now
          per cases by A3,A7,QC_LANG2:49;
          suppose
A12:        G = the_left_argument_of F;
            1 in {1,2} by TARSKI:def 2;
            hence thesis by A10,A11,A9,A12,FINSEQ_1:2;
          end;
          suppose
            G = the_right_argument_of F;
            hence thesis by A10,A8,A9,FINSEQ_1:3;

          end;
        end;
        hence thesis;
      end;
      suppose
A13:    F is universal;
        then
A14:    not F is conjunctive by QC_LANG1:20;
        ( not F is atomic)& not F is negative by A13,QC_LANG1:20;
        then
A15:    list_of_immediate_constituents(F) = <* the_scope_of F *> by A14,Def1,A4
;
        consider n such that
A16:    n = 1;
A17:    G = the_scope_of F by A3,A13,QC_LANG2:50;
        dom <* the_scope_of F *> = Seg 1 & <* the_scope_of F *>.n =
        the_scope_of F by A16,FINSEQ_1:def 8;
        hence thesis by A15,A16,A17,FINSEQ_1:3;
      end;
    end;
    hence thesis by A2,FUNCT_1:def 3;
  end;
end;
