@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#>.
@prefix var: <http://josd.github.io/var#>.
@prefix skolem: <http://josd.github.io/.well-known/genid/3917894951695475063#>.
@prefix n3: <http://www.w3.org/2004/06/rei#>.

skolem:proof a r:Proof, r:Conjunction;
  r:component skolem:lemma1;
  r:gives {
    ((4 2) (6 2) (7 6) (4 6) (5 5) (5 3) (4 2)) polygon:area 7 .
  }.

skolem: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 (
    skolem:lemma2
  );
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_0"]; r:boundTo 7];
  r:rule skolem:lemma3.

skolem: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)))}]
    skolem: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:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_0"]; r:boundTo ((4 2) (6 2) (7 6) (4 6) (5 5) (5 3) (4 2))];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_1"]; r:boundTo 4];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_2"]; r:boundTo 2];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_3"]; r:boundTo ((6 2) (7 6) (4 6) (5 5) (5 3) (4 2))];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_4"]; r:boundTo 6];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_5"]; r:boundTo 2];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_6"]; r:boundTo ((7 6) (4 6) (5 5) (5 3) (4 2))];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_7"]; r:boundTo 9];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_8"]; r:boundTo 8];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_9"]; r:boundTo 12];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_10"]; r:boundTo -4];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_11"]; r:boundTo -2];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_12"]; r:boundTo 7];
  r:rule skolem:lemma5.

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

skolem: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)))}]
    skolem: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:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_0"]; r:boundTo ((6 2) (7 6) (4 6) (5 5) (5 3) (4 2))];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_1"]; r:boundTo 6];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_2"]; r:boundTo 2];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_3"]; r:boundTo ((7 6) (4 6) (5 5) (5 3) (4 2))];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_4"]; r:boundTo 7];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_5"]; r:boundTo 6];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_6"]; r:boundTo ((4 6) (5 5) (5 3) (4 2))];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_7"]; r:boundTo -2];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_8"]; r:boundTo 36];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_9"]; r:boundTo 14];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_10"]; r:boundTo 22];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_11"]; r:boundTo 11];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_12"]; r:boundTo 9];
  r:rule skolem:lemma5.

skolem:lemma5 a r:Extraction;
  r:gives {
    @forAll var:x_0, var:x_1, var:x_2, var:x_3, var:x_4, var:x_5, var:x_6, var:x_7, var:x_8, var:x_9, var:x_10, var:x_11, var:x_12. {var:x_0 polygon:area var:x_12} <= {var:x_0 e:firstRest ((var:x_1 var:x_2) var:x_3).
     var:x_3 e:firstRest ((var:x_4 var:x_5) var:x_6).
     var:x_3 polygon:area var:x_7.
     (var:x_1 var:x_5) math:product var:x_8.
     (var:x_2 var:x_4) math:product var:x_9.
     (var:x_8 var:x_9) math:difference var:x_10.
     (var:x_10 2) math:quotient var:x_11.
     (var:x_11 var:x_7) math:sum var:x_12}.
  };
  r:because [ a r:Parsing; r:source <http://josd.github.io/eye/reasoning/polygon/polygon.n3>].

skolem: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)))}]
    skolem: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:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_0"]; r:boundTo ((7 6) (4 6) (5 5) (5 3) (4 2))];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_1"]; r:boundTo 7];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_2"]; r:boundTo 6];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_3"]; r:boundTo ((4 6) (5 5) (5 3) (4 2))];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_4"]; r:boundTo 4];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_5"]; r:boundTo 6];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_6"]; r:boundTo ((5 5) (5 3) (4 2))];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_7"]; r:boundTo -11];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_8"]; r:boundTo 42];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_9"]; r:boundTo 24];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_10"]; r:boundTo 18];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_11"]; r:boundTo 9];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_12"]; r:boundTo -2];
  r:rule skolem:lemma5.

skolem: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)))}]
    skolem: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:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_0"]; r:boundTo ((4 6) (5 5) (5 3) (4 2))];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_1"]; r:boundTo 4];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_2"]; r:boundTo 6];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_3"]; r:boundTo ((5 5) (5 3) (4 2))];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_4"]; r:boundTo 5];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_5"]; r:boundTo 5];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_6"]; r:boundTo ((5 3) (4 2))];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_7"]; r:boundTo -6];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_8"]; r:boundTo 20];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_9"]; r:boundTo 30];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_10"]; r:boundTo -10];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_11"]; r:boundTo -5];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_12"]; r:boundTo -11];
  r:rule skolem:lemma5.

skolem: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)))}]
    skolem: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:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_0"]; r:boundTo ((5 5) (5 3) (4 2))];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_1"]; r:boundTo 5];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_2"]; r:boundTo 5];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_3"]; r:boundTo ((5 3) (4 2))];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_4"]; r:boundTo 5];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_5"]; r:boundTo 3];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_6"]; r:boundTo ((4 2))];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_7"]; r:boundTo -1];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_8"]; r:boundTo 15];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_9"]; r:boundTo 25];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_10"]; r:boundTo -10];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_11"]; r:boundTo -5];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_12"]; r:boundTo -6];
  r:rule skolem:lemma5.

skolem: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) ())}]
    skolem: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:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_0"]; r:boundTo ((5 3) (4 2))];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_1"]; r:boundTo 5];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_2"]; r:boundTo 3];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_3"]; r:boundTo ((4 2))];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_4"]; r:boundTo 4];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_5"]; r:boundTo 2];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_6"]; r:boundTo ()];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_7"]; r:boundTo 0];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_8"]; r:boundTo 10];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_9"]; r:boundTo 12];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_10"]; r:boundTo -2];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_11"]; r:boundTo -1];
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_12"]; r:boundTo -1];
  r:rule skolem:lemma5.

skolem:lemma10 a r:Inference;
  r:gives {
    ((4 2)) polygon:area 0 .
  };
  r:evidence (
    [ a r:Fact; r:gives true]
  );
  r:binding [ r:variable [ n3:uri "http://josd.github.io/var#x_0"]; r:boundTo (4 2)];
  r:rule skolem:lemma11.

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

