
theorem
  for s being Real, x being REAL-valued FinSequence
  st 1 <= len x holds
  (Q_ex(x)) . (1, s) = ((x . 1) _eq_ s) 'or' (s _eq_ 0)
  proof
    let s be Real, x be REAL-valued FinSequence;
    assume
    A1: 1 <= len x; then
    Q1: ((x | 1) exist_subset_sum_eq s
    implies (Q_ex(x)) . (1, s) = TRUE) &
    (not (x | 1) exist_subset_sum_eq s
    implies (Q_ex(x)) . (1, s) = FALSE) by defQ;
    A3: len (x | 1) = 1 by FINSEQ_1:59,A1;
    1 in Seg 1; then
A4: (x | 1) . 1 = x . 1 by FUNCT_1:49;
    A5: {1} = dom (x | 1) by A1,Lemacik1;
    A8: Seq (x | 1, {1}) = (x | 1) | {1} by A5,FINSEQ_3:116
    .= <* x . 1 *> by FINSEQ_1:40,A3,A5,A4;
    per cases;
    suppose A9: s <> 0; then
      A10: s _eq_ 0 = FALSE by FUNCOP_1:def 8;
      per cases;
      suppose A11: x . 1 = s; then
        A12: (x . 1) _eq_ s = TRUE by FUNCOP_1:def 8;
        Sum (Seq (x | 1, {1})) = s by A11,A8,RVSUM_1:73;
        hence (Q_ex(x)) . (1, s) = ((x . 1) _eq_ s) 'or' (s _eq_ 0)
        by Q1,A12,A5;
      end;
      suppose A13: x . 1 <> s;
        not x | 1 exist_subset_sum_eq s
        proof
          assume x | 1 exist_subset_sum_eq s; then
          consider I being set such that
          A15: I c= dom (x | 1) & Sum (Seq (x | 1, I)) = s;
          dom (x | 1) = {1} by A1,Lemacik1;
          then per cases by A15,ZFMISC_1:33;
          suppose I = {};
            hence contradiction by A9,A15,RVSUM_1:72;
          end;
          suppose I = {1};
            hence contradiction by A13,A15,A8,RVSUM_1:73;
          end;
        end;
        hence (Q_ex(x)) . (1, s) = ((x . 1) _eq_ s) 'or' (s _eq_ 0)
        by A13,A10,Q1,FUNCOP_1:def 8;
      end;
    end;
    suppose A20: s = 0; then
      A21: s _eq_ 0 = TRUE by FUNCOP_1:def 8;
      x | 1 exist_subset_sum_eq s
      proof
        take {};
        thus thesis by A20,RVSUM_1:72;
      end;
      hence (Q_ex(x)) . (1, s) = ((x . 1) _eq_ s) 'or' (s _eq_ 0)
      by A21,A1,defQ;
    end;
  end;
