reserve X1,x,y,z for set,
  n,m for Nat,
  X for non empty set;
reserve A,B for Event of Borel_Sets,
  D for Subset of REAL;
reserve Q for QM_Str;
reserve A1 for Element of Obs Q;
reserve s for Element of Sts Q;
reserve E for Event of Borel_Sets;
reserve ASeq for SetSequence of Borel_Sets;
reserve Q for Quantum_Mechanics;
reserve s for Element of Sts Q;
reserve x1 for Element of X1;
reserve Inv for Function of X1,X1;
reserve p,q,r,p1,q1 for Element of Prop Q;
reserve B,C for Subset of Prop Q;

theorem :: Main Theorem
  for Q holds OrthoRelStr(#Class PropRel Q,OrdRel Q,InvRel Q#)
  is_a_Quantum_Logic
proof
  let Q;
A1: OrdRel Q is_transitive_in Class PropRel Q
  proof
    let x,y,z be object;
    assume that
A2: x in Class PropRel Q and
A3: y in Class PropRel Q and
A4: z in Class PropRel Q and
A5: [x,y] in OrdRel Q & [y,z] in OrdRel Q;
    consider p such that
A6: x = Class(PropRel Q,p) by A2,EQREL_1:36;
    consider r such that
A7: z = Class(PropRel Q,r) by A4,EQREL_1:36;
    consider q such that
A8: y = Class(PropRel Q,q) by A3,EQREL_1:36;
    p |- q & q |- r implies p |- r by Th4;
    hence thesis by A5,A6,A8,A7,Th10;
  end;
A9: OrdRel Q is_antisymmetric_in Class PropRel Q
  proof
    let x,y be object;
    assume that
A10: x in Class PropRel Q and
A11: y in Class PropRel Q and
A12: [x,y] in OrdRel Q & [y,x] in OrdRel Q;
    consider p such that
A13: x = Class(PropRel Q,p) by A10,EQREL_1:36;
    consider q such that
A14: y = Class(PropRel Q,q) by A11,EQREL_1:36;
A15: p <==> q implies [p,q] in PropRel Q by Def12;
    thus thesis by A12,A13,A14,A15,Th10,EQREL_1:35;
  end;
A16: for x,y being Element of Class PropRel Q st [x,y] in OrdRel Q holds
  [(InvRel Q).y,(InvRel Q).x] in OrdRel Q
  proof

    let x,y be Element of Class PropRel Q;
    consider p such that
A17: x = Class(PropRel Q,p) by EQREL_1:36;
    consider q such that
A18: y = Class(PropRel Q,q) by EQREL_1:36;
A19: p |- q implies 'not' q |- 'not' p by Th8;
    (InvRel Q).Class(PropRel Q,p) = Class(PropRel Q,'not' p) & (InvRel Q)
    .Class( PropRel Q,q) = Class(PropRel Q,'not' q) by Def14;
    hence thesis by A17,A18,A19,Th10;
  end;
A20: InvRel Q is_an_involution
  proof

    let x be Element of Class PropRel Q;
    consider p such that
A21: x = Class(PropRel Q,p) by EQREL_1:36;
    (InvRel Q).((InvRel Q).x) = (InvRel Q).Class(PropRel Q,'not' p) by A21
,Def14
      .= Class(PropRel Q,'not'('not' p)) by Def14;
    hence thesis by A21;
  end;
  OrdRel Q is_reflexive_in Class PropRel Q
  proof
    let x be object;
    assume x in Class PropRel Q;
    then ex p st x = Class(PropRel Q,p) by EQREL_1:36;
    hence thesis by Th10;
  end;
  then OrdRel Q partially_orders Class PropRel Q by A1,A9,ORDERS_1:def 8;
  hence thesis by A20,A16;
end;
