@prefix skolem: <https://eyereasoner.github.io/.well-known/genid/8b98b360-9a70-4845-b52c-c675af60ad01#>.
@prefix r: <http://www.w3.org/2000/10/swap/reason#>.
@prefix : <http://example.org/#>.
@prefix n3: <http://www.w3.org/2004/06/rei#>.
@prefix var: <http://www.w3.org/2000/10/swap/var#>.
@prefix list: <http://www.w3.org/2000/10/swap/list#>.
@prefix graph: <http://www.w3.org/2000/10/swap/graph#>.

skolem:proof a r:Proof, r:Conjunction;
    r:component skolem:lemma1;
    r:component skolem:lemma2;
    r:gives {
        :i a :A.
        :i a :B.
    }.

skolem:lemma1 a r:Inference;
    r:gives {
        :i a :A.
    };
    r:evidence (
        skolem:lemma3
    );
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_0"]; r:boundTo [ n3:uri "http://example.org/#i"]];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_1"]; r:boundTo [ n3:uri "http://example.org/#A"]];
    r:rule skolem:lemma4.

skolem:lemma2 a r:Inference;
    r:gives {
        :i a :B.
    };
    r:evidence (
        skolem:lemma5
    );
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_0"]; r:boundTo [ n3:uri "http://example.org/#i"]];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_1"]; r:boundTo [ n3:uri "http://example.org/#B"]];
    r:rule skolem:lemma4.

skolem:lemma3 a r:Extraction;
    r:gives {
        :i a :A.
    };
    r:because [ a r:Parsing; r:source <https://eyereasoner.github.io/eye/reasoning/sequents/input/abcd.n3>].

skolem:lemma4 a r:Extraction;
    r:gives {
        @forAll var:x_0, var:x_1. {
            var:x_0 a var:x_1.
        } => {
            var:x_0 a var:x_1.
        }.
    };
    r:because [ a r:Parsing; r:source <https://eyereasoner.github.io/eye/reasoning/sequents/input/abcd.n3>].

skolem:lemma5 a r:Inference;
    r:gives {
        :i a :B.
    };
    r:evidence (
        [ a r:Fact; r:gives {{
            :i a :D.
        } => ($ $)}]
        skolem:lemma3
    );
    r:rule skolem:lemma6.

skolem:lemma6 a r:Inference;
    r:gives {
        {
            {
                :i a :D.
            } => ($ $).
            :i a :A.
        } => {
            :i a :B.
        }.
    };
    r:evidence (
        skolem:lemma7
        [ a r:Fact; r:gives {({
            :i a :B.
        }) list:removeDuplicates ({
            :i a :B.
        })}]
    );
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_0"]; r:boundTo {
        {
            :i a :D.
        } => ($ $).
        :i a :A.
    }];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_1"]; r:boundTo ({
        :i a :B.
    })];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_2"]; r:boundTo {
        :i a :B.
    }];
    r:rule skolem:lemma8.

skolem:lemma7 a r:Inference;
    r:gives {
        {
            {
                :i a :D.
            } => ($ $).
            :i a :A.
        } => ({
            :i a :B.
        }).
    };
    r:evidence (
        skolem:lemma9
        [ a r:Fact; r:gives {({
            :i a :B.
        } {
            :i a :D.
        }) list:select ({
            :i a :D.
        } ({
            :i a :B.
        }))}]
        [ a r:Fact; r:gives {({
            {
                :i a :D.
            } => ($ $).
        } {
            :i a :A.
        }) graph:union {
            {
                :i a :D.
            } => ($ $).
            :i a :A.
        }}]
    );
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_0"]; r:boundTo {
        :i a :A.
    }];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_1"]; r:boundTo ({
        :i a :B.
    } {
        :i a :D.
    })];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_2"]; r:boundTo {
        :i a :D.
    }];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_3"]; r:boundTo ({
        :i a :B.
    })];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_4"]; r:boundTo {
        {
            :i a :D.
        } => ($ $).
        :i a :A.
    }];
    r:rule skolem:lemma10.

skolem:lemma8 a r:Extraction;
    r:gives {
        @forAll var:x_0, var:x_1, var:x_2. {
            var:x_0 => var:x_1.
            var:x_1 list:removeDuplicates (var:x_2).
        } => {
            var:x_0 => var:x_2.
        }.
    };
    r:because [ a r:Parsing; r:source <https://eyereasoner.github.io/eye/reasoning/sequents/sequents.n3>].

skolem:lemma9 a r:Inference;
    r:gives {
        {
            :i a :A.
        } => ({
            :i a :B.
        } {
            :i a :D.
        }).
    };
    r:evidence (
        [ a r:Fact; r:gives {{
            :i a :A.
        } => ($ {
            :i a :B.
        } {
            :i a :C.
        } {
            :i a :D.
        } $)}]
        [ a r:Fact; r:gives {($ {
            :i a :B.
        } {
            :i a :C.
        } {
            :i a :D.
        } $) list:select ({
            :i a :C.
        } ({
            :i a :B.
        } {
            :i a :D.
        }))}]
        [ a r:Fact; r:gives {{
            :i a :C.
        } => ($ $)}]
    );
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_0"]; r:boundTo {
        :i a :A.
    }];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_1"]; r:boundTo ($ {
        :i a :B.
    } {
        :i a :C.
    } {
        :i a :D.
    } $)];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_2"]; r:boundTo {
        :i a :C.
    }];
    r:binding [ r:variable [ n3:uri "http://www.w3.org/2000/10/swap/var#x_3"]; r:boundTo ({
        :i a :B.
    } {
        :i a :D.
    })];
    r:rule skolem:lemma11.

skolem:lemma10 a r:Extraction;
    r:gives {
        @forAll var:x_0, var:x_1, var:x_2, var:x_3, var:x_4. {
            var:x_0 => var:x_1.
            var:x_1 list:select (var:x_2 var:x_3).
            ({
                var:x_2 => ($ $).
            } var:x_0) graph:union var:x_4.
        } => {
            var:x_4 => var:x_3.
        }.
    };
    r:because [ a r:Parsing; r:source <https://eyereasoner.github.io/eye/reasoning/sequents/sequents.n3>].

skolem:lemma11 a r:Extraction;
    r:gives {
        @forAll var:x_0, var:x_1, var:x_2, var:x_3. {
            var:x_0 => var:x_1.
            var:x_1 list:select (var:x_2 var:x_3).
            var:x_2 => ($ $).
        } => {
            var:x_0 => var:x_3.
        }.
    };
    r:because [ a r:Parsing; r:source <https://eyereasoner.github.io/eye/reasoning/sequents/sequents.n3>].

