PREFIX math: <http://www.w3.org/2000/10/swap/math#>
PREFIX e: <http://eulersharp.sourceforge.net/2003/03swap/log-rules#>
PREFIX polygon: <http://josd.github.io/eye/reasoning/polygon#>
PREFIX r: <http://www.w3.org/2000/10/swap/reason#>

[] a r:Proof, r:Conjunction;
  r:component <#lemma1>;
  r:gives {
    ((4 2) (6 2) (7 6) (4 6) (5 5) (5 3) (4 2)) polygon:area 7 .
  }.

<#lemma1> a r:Inference;
  r:gives {
    ((4 2) (6 2) (7 6) (4 6) (5 5) (5 3) (4 2)) polygon:area 7 .
  };
  r:evidence (
    <#lemma2>
  );
  r:rule <#lemma3>.

<#lemma2> a r:Inference;
  r:gives {
    ((4 2) (6 2) (7 6) (4 6) (5 5) (5 3) (4 2)) polygon:area 7 .
  };
  r:evidence (
    [ a r:Fact; r:gives {((4 2) (6 2) (7 6) (4 6) (5 5) (5 3) (4 2)) e:firstRest ((4 2) ((6 2) (7 6) (4 6) (5 5) (5 3) (4 2)))}]
    [ a r:Fact; r:gives {((6 2) (7 6) (4 6) (5 5) (5 3) (4 2)) e:firstRest ((6 2) ((7 6) (4 6) (5 5) (5 3) (4 2)))}]
    <#lemma4>
    [ a r:Fact; r:gives {(4 2) math:product 8}]
    [ a r:Fact; r:gives {(2 6) math:product 12}]
    [ a r:Fact; r:gives {(8 12) math:difference -4}]
    [ a r:Fact; r:gives {(-4 2) math:quotient -2}]
    [ a r:Fact; r:gives {(-2 9) math:sum 7}]
  );
  r:rule <#lemma5>.

<#lemma3> a r:Extraction;
  r:gives {
    {((4 2) (6 2) (7 6) (4 6) (5 5) (5 3) (4 2)) polygon:area ?x_0_1} => {((4 2) (6 2) (7 6) (4 6) (5 5) (5 3) (4 2)) polygon:area ?x_0_1}.
  };
  r:because [ a r:Parsing; r:source <http://josd.github.io/eye/reasoning/polygon/polygon_query.n3>].

<#lemma4> a r:Inference;
  r:gives {
    ((6 2) (7 6) (4 6) (5 5) (5 3) (4 2)) polygon:area 9 .
  };
  r:evidence (
    [ a r:Fact; r:gives {((6 2) (7 6) (4 6) (5 5) (5 3) (4 2)) e:firstRest ((6 2) ((7 6) (4 6) (5 5) (5 3) (4 2)))}]
    [ a r:Fact; r:gives {((7 6) (4 6) (5 5) (5 3) (4 2)) e:firstRest ((7 6) ((4 6) (5 5) (5 3) (4 2)))}]
    <#lemma6>
    [ a r:Fact; r:gives {(6 6) math:product 36}]
    [ a r:Fact; r:gives {(2 7) math:product 14}]
    [ a r:Fact; r:gives {(36 14) math:difference 22}]
    [ a r:Fact; r:gives {(22 2) math:quotient 11}]
    [ a r:Fact; r:gives {(11 -2) math:sum 9}]
  );
  r:rule <#lemma5>.

<#lemma5> a r:Extraction;
  r:gives {
    {?x_0_2 polygon:area ?x_12_2} <= {?x_0_2 e:firstRest ((?x_1_2 ?x_2_2) ?x_3_2).
     ?x_3_2 e:firstRest ((?x_4_2 ?x_5_2) ?x_6_2).
     ?x_3_2 polygon:area ?x_7_2.
     (?x_1_2 ?x_5_2) math:product ?x_8_2.
     (?x_2_2 ?x_4_2) math:product ?x_9_2.
     (?x_8_2 ?x_9_2) math:difference ?x_10_2.
     (?x_10_2 2) math:quotient ?x_11_2.
     (?x_11_2 ?x_7_2) math:sum ?x_12_2}.
  };
  r:because [ a r:Parsing; r:source <http://josd.github.io/eye/reasoning/polygon/polygon.n3>].

<#lemma6> a r:Inference;
  r:gives {
    ((7 6) (4 6) (5 5) (5 3) (4 2)) polygon:area -2 .
  };
  r:evidence (
    [ a r:Fact; r:gives {((7 6) (4 6) (5 5) (5 3) (4 2)) e:firstRest ((7 6) ((4 6) (5 5) (5 3) (4 2)))}]
    [ a r:Fact; r:gives {((4 6) (5 5) (5 3) (4 2)) e:firstRest ((4 6) ((5 5) (5 3) (4 2)))}]
    <#lemma7>
    [ a r:Fact; r:gives {(7 6) math:product 42}]
    [ a r:Fact; r:gives {(6 4) math:product 24}]
    [ a r:Fact; r:gives {(42 24) math:difference 18}]
    [ a r:Fact; r:gives {(18 2) math:quotient 9}]
    [ a r:Fact; r:gives {(9 -11) math:sum -2}]
  );
  r:rule <#lemma5>.

<#lemma7> a r:Inference;
  r:gives {
    ((4 6) (5 5) (5 3) (4 2)) polygon:area -11 .
  };
  r:evidence (
    [ a r:Fact; r:gives {((4 6) (5 5) (5 3) (4 2)) e:firstRest ((4 6) ((5 5) (5 3) (4 2)))}]
    [ a r:Fact; r:gives {((5 5) (5 3) (4 2)) e:firstRest ((5 5) ((5 3) (4 2)))}]
    <#lemma8>
    [ a r:Fact; r:gives {(4 5) math:product 20}]
    [ a r:Fact; r:gives {(6 5) math:product 30}]
    [ a r:Fact; r:gives {(20 30) math:difference -10}]
    [ a r:Fact; r:gives {(-10 2) math:quotient -5}]
    [ a r:Fact; r:gives {(-5 -6) math:sum -11}]
  );
  r:rule <#lemma5>.

<#lemma8> a r:Inference;
  r:gives {
    ((5 5) (5 3) (4 2)) polygon:area -6 .
  };
  r:evidence (
    [ a r:Fact; r:gives {((5 5) (5 3) (4 2)) e:firstRest ((5 5) ((5 3) (4 2)))}]
    [ a r:Fact; r:gives {((5 3) (4 2)) e:firstRest ((5 3) ((4 2)))}]
    <#lemma9>
    [ a r:Fact; r:gives {(5 3) math:product 15}]
    [ a r:Fact; r:gives {(5 5) math:product 25}]
    [ a r:Fact; r:gives {(15 25) math:difference -10}]
    [ a r:Fact; r:gives {(-10 2) math:quotient -5}]
    [ a r:Fact; r:gives {(-5 -1) math:sum -6}]
  );
  r:rule <#lemma5>.

<#lemma9> a r:Inference;
  r:gives {
    ((5 3) (4 2)) polygon:area -1 .
  };
  r:evidence (
    [ a r:Fact; r:gives {((5 3) (4 2)) e:firstRest ((5 3) ((4 2)))}]
    [ a r:Fact; r:gives {((4 2)) e:firstRest ((4 2) ())}]
    <#lemma10>
    [ a r:Fact; r:gives {(5 2) math:product 10}]
    [ a r:Fact; r:gives {(3 4) math:product 12}]
    [ a r:Fact; r:gives {(10 12) math:difference -2}]
    [ a r:Fact; r:gives {(-2 2) math:quotient -1}]
    [ a r:Fact; r:gives {(-1 0) math:sum -1}]
  );
  r:rule <#lemma5>.

<#lemma10> a r:Inference;
  r:gives {
    ((4 2)) polygon:area 0 .
  };
  r:evidence (
    [ a r:Fact; r:gives true]
  );
  r:rule <#lemma11>.

<#lemma11> a r:Extraction;
  r:gives {
    {(?x_0_3) polygon:area 0} <= true.
  };
  r:because [ a r:Parsing; r:source <http://josd.github.io/eye/reasoning/polygon/polygon.n3>].

