Plan, apply and roll back changes to a production ontology, with a blast radius report and a proof an auditor can re-check.
Rust ai-nativedescription-logicsformal-verificationinfrastructure-as-codeisabelle-languageknowledge-graphleanlean4mcpmcp-serverontologyowlowl2reasoningrustshaclsparqltheorem-proving
bridge: discharge the conforming-interpretation bridge, and make the refutation theorem non-vacuous over the W3C class
FABIOTESS9192873701e6
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 4a0e39c9..10645918 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -5,6 +5,57 @@ All notable changes to Open Ontologies are documented here.## [Unreleased]### Changed+- **The bridge to the specification was prose. It is a theorem.** `lean/OOCert/Conforming.lean`+ formalises an OWL 2 RDF-Based interpretation in core Lean as `OOCert.Interpretation`: the parts+ of RBS Table 5.1, with `IR` as the carrier type so that the table's `IP ⊆ IR`, `IC ⊆ IR`,+ `ICEXT(x) ⊆ IR` and `IEXT(x) ⊆ IR × IR` hold by typing, plus `IS`, `IL`, the blank-node+ assignment of RDF 1.1 Semantics section 5.1, and `ICEXT` and `IC` as definitions per section 9.+ Truth is section 5's clause with its `I(p) is in IP` conjunct, stated as the specification+ states it. `OOCert.Conforming` collects thirty fields, twenty-nine of them a quoted cell and the+ thirtieth Table 5.1's `IR ≠ ∅`: Table 5.8 in both directions, Tables 5.9, 5.12 and 5.13 forward only, Table 5.6's+ three restriction rows with the outer `if-then` and the consequent equality, the typing rows of+ Tables 5.2 and 5.3, Tables 5.4 and 5.5 forward, and five axiomatic triples.+ `OOCert.Conforming.toW3C` proves that every such interpretation carries `W3C` at full strength,+ `OOCert.Conforming.toW3CModel` carries that to `W3CModel` including proving that every `Chain G`+ list is a semantic sequence in the specification's sense, and+ `OOCert.certificate_conforming_sound` is the sentence `certificate_w3c_sound`'s docstring says+ of itself that it is not: a checked certificate's conclusions hold in every conforming+ interpretation of the asserted graph. Its statement mentions no structure of this repository's+ invention.+ **The five `IP` memberships the old bridge assumed are discharged, not moved.** Each is a field+ asserting one axiomatic triple whose own predicate is the wanted term, so the truth clause hands+ the fact back as the triple's first conjunct: `rdf:type rdf:type rdf:Property .`,+ `rdfs:Datatype rdfs:subClassOf rdfs:Class .`,+ `rdfs:isDefinedBy rdfs:subPropertyOf rdfs:seeAlso .`,+ `rdf:type rdfs:domain rdfs:Resource .` and `rdf:type rdfs:range rdfs:Class .`. Taking them at all+ is licensed by RBS Definition 4.2, RBS section 4.2 and RDF 1.1 section 9, quoted in the file.+ **One of the five was previously sourced to the wrong triple.** `W3C.lean`'s table gave+ `I(rdfs:range) ∈ IP` the source `rdfs:range rdfs:domain rdf:Property .` "whose truth puts its own+ predicate in `IP`"; that triple's predicate is `rdfs:domain`, so its truth gives+ `I(rdfs:domain) ∈ IP` and reaching `rdfs:range` from it needs a further step the entry omits. The+ fact is true and the route was wrong; the correction is recorded at both files rather than+ applied silently.+ `lean/OOCert/ConformingWitness.lean` exhibits a two-element interpretation satisfying every one+ of those conditions, every RDF axiom of RDF 1.1 section 8 and every RDFS axiomatic triple of+ section 9 (fifty-four, checked by `decide`), and three identity rows of RBS Table 5.2 that+ `W3CWitness.lean`'s `live` records itself as violating. Table 5.8 is alive there in both+ directions and CONSTRAINING: `IEXT(I(rdfs:subClassOf))` holds three of four possible pairs, the+ missing one excluded by the forward direction and one of the present ones forced by the backward+ direction, both checked. The eleven OWL-vocabulary extensions are empty there and+ `two_dead_fields` says so as a theorem; `two_violates_these_known_rows` records the Table 5.2 row+ it breaks. The file also carries one non-entailment and one entailment (`rdfs9` at an instance),+ so `ConformingEntails` is neither empty nor everything.+ **What is still not a theorem**, stated at the top of the file rather than at the bottom: that+ `Conforming`'s field list is a SUBSET of the Recommendation's conditions. A subset is the safe+ direction, which is why it is allowed, and a reader checks it cell by cell. One modelling+ decision does NOT run in the safe direction and is named at its field: `IL` is total, following+ RBS section 4.2's wording rather than RDF 1.1 section 5's, so interpretations in which a literal+ fails to denote are outside the claim; closing that needs a term-occurrence lemma about+ `checkStep` that nobody has written. One reading is load-bearing and flagged: RBS Table 5.4 at+ `n = 0`, which `Rules.lean`'s `takeChain` and `Semantics.lean`'s `Model.int` already depend on.+ `Conditions`, `Interp`, `Model`, `Entails` and `certificate_sound` are untouched, and+ `Conforming.lean` pins all twenty-three fields of `Conditions` and all five of `Model` with+ `#guard_msgs` on their constructors, so a change to any of them breaks the build.- **A binding is data, and a certificate that admits two readings is refused.** Running theLean checker in `lean/OOCert/Horn.lean` and the independent Isabelle/HOL one in `isabelle/`over 1,718 certificates found 47 rows where the two disagreed, always in the same direction@@ -232,7 +283,7 @@ All notable changes to Open Ontologies are documented here.would make the result unprovable and the mistake invisible.- **A live, non-degenerate model of those conditions, with its liveness compiled- into the build.** `lean/OOCert/W3CWitness.lean` builds a twenty-six-element+ into the build.** `lean/OOCert/W3CWitness.lean` builds a thirty-five-elementinterpretation meeting the quoted cells of Tables 5.2, 5.3, 5.6, 5.8, 5.9,5.12 and 5.13, with every condition settled by the kernel's `decide`. Asoundness theorem over a degenerate model class would prove less than the@@ -244,13 +295,10 @@ All notable changes to Open Ontologies are documented here.non-empty and a proper subset of `IEXT(p2)`. `live_exercises_every_arm`: allfourteen derivations fire at concrete instances of this model, which isstronger than any field having something in its extension.- `live_fires_the_other_sixteen` and- `live_leaves_exactly_these_five_vacuous`: a satisfied antecedent for each of- the other sixteen fields of `W3C`, and the five that are not exercised, named,- none of which carries any of the fourteen arms. Sixteen plus five is the- twenty-one fields, so neither number can drift from the tables. `dom_bwd`- and `rng_bwd` are discharged over real pairs rather than vacuously, which the- second kernel's own witness does not manage.+ `live_fires_every_field`: a satisfied antecedent for every one of the+ twenty-one fields of `W3C`, so no condition holds for want of anything to+ check. `dom_bwd` and `rng_bwd` are discharged over real pairs rather than+ vacuously.**The first version of this model was vacuous exactly where its conditionsbite, and the rebuild is recorded rather than quietly substituted.** It had@@ -262,6 +310,63 @@ All notable changes to Open Ontologies are documented here.because `IEXT(p1)` was empty, and that emptiness was written into the livenessgate as though it were a feature.+ **It took two rebuilds and the second corrected a claim about the+ specification, not just about the model.** The first rebuild, at twenty-six+ elements, left five fields still holding for want of anything to check:+ `same_fwd`, `sym_fwd`, `trp_fwd`, `inv_fwd` and `hv_eq`. The note beside them+ said four of the five were a budget problem and that the fifth, `owl:sameAs`,+ "cannot be exercised by any model at all because the specification makes that+ relation the diagonal". The premise is right and the conclusion does not+ follow. RBS Table 5.9 row 1 is an `iff` whose right-hand side is `a₁ = a₂` over+ unscoped variables, which the specification's conventions section reads as+ ranging over IR, and RBS section 4.2 defines IR as "the universe of I, i.e., a+ nonempty set", so a conforming interpretation's `owl:sameAs` extension is the+ whole NON-EMPTY diagonal. The+ model had it EMPTY, which no conforming interpretation does, and reported that+ as a fact about the specification rather than a hole in the model. All five are+ now exercised, `live_fires_every_field` pins that, and the residual limit is+ one theorem about every interpretation rather than a list about this one:+ `sameAs_has_no_off_diagonal_instance` says the condition can never be exercised+ at `a ≠ b`. A second consequence of the same two cells meeting is recorded as+ `sameAs_diagonal_needs_an_off_diagonal_subproperty`: a model that gives+ `owl:sameAs` the diagonal cannot also have `IEXT(rdfs:subPropertyOf)` be the+ diagonal, so a countermodel needs two distinct properties one below the other.+ Both quotes were re-read in the raw HTML of the Recommendation on 15 September+ 2026.++- **The second kernel's non-vacuity witness had the same defect and now has the+ same treatment.** `isabelle/OO_NonVacuity.thy`'s `M3` was presented as "THE REAL+ WITNESS" for all twenty-six conditions of `owl_rl_interp`. FIFTEEN of them held+ in it only because the extension their antecedent reads is EMPTY: every+ `owl:*` IRI it does not use denotes one junk element, so `c_sameAs_fwd`,+ `c_eqc_fwd`, `c_eqp_fwd`, `c_inv_fwd`, `c_sym_fwd`, `c_trp_fwd`, `c_svf`,+ `c_avf`, `c_hv`, `c_restr_IC`, `c_svf_typ`, `c_avf_typ`, `c_onp_typ`,+ `c_dom_fwd` and `c_rng_fwd` were each discharged by a bare `by simp` off that+ emptiness. `M3_leaves_these_extensions_empty` now states that limit as a+ theorem instead of leaving it to be discovered, and `M3` itself is unchanged.++ `M4` is the witness that exercises them: thirty-four elements, `owl_rl_interp`+ and `wf_interp`, kernel proofs only, no `sorry`, no `oops`, and no `eval`, which+ in Isabelle is the counterpart of the banned `native_decide`.+ `M4_every_condition_has_a_live_antecedent` exhibits a satisfied antecedent for+ each of the twenty-six, and `M4_exercises_every_derivation` applies each of the+ fourteen derived monotonicity and subsumption lemmas of `OO_Builtin_Sound.thy`+ at named elements of `M4`, which is the direct counterpart of the Lean's+ `live_exercises_every_arm` and the same gate. `M4_is_live`,+ `M4_is_bridge_coherent` and `M4_avf2_really_is_antitone` pin the rest.+ `sameAs_is_exercised_only_on_the_diagonal` is the same residual limit the Lean+ states, proved over an arbitrary interpretation rather than about this one. The+ oracle audit in `OO_Audit.thy` now covers all of it: thirty-nine theorems, empty+ oracle set, and a second block that fails the build if an `eval`-proved lemma+ ever stops reporting one, so the gate is proved able to fail.++ Two specification citations were corrected against the raw HTML while doing it,+ and both had been repeated in the Lean. IR is defined in RBS section 4.2,+ Vocabulary Interpretations, not 4.4. And Table 5.2 gives `owl:Restriction`,+ `owl:SymmetricProperty` and `owl:TransitiveProperty` a row each whose second+ column is `∈ IC`; both witnesses keep all three out of `IC` and say so, where a+ draft had claimed the last two have no row in that table at all.+- **Two more English claims turned into theorems, one of which was wrong.**`Witness.lean` asserted in prose that `saturated` also satisfies the newspecification conditions. It does, and `saturated_meets_the_w3c_conditions`@@ -325,9 +430,22 @@ All notable changes to Open Ontologies are documented here.(`and_the_old_verdict_does_not_notice`), now carry the field that fails as a`decide`-checked theorem: `svf_witness_misses_the_restriction_typing`,`feed_closure_misses_the_class_typing` and- `graze_closure_misses_the_class_typing`. Nine statements in the repository are- a `¬ Entails` or a `¬ Unsat`; five are now over `W3CModel` and four are not,- and `Semantics.lean` carries the complete table. The two `¬ EntailsR` results+ `graze_closure_misses_the_class_typing`.++ **Those three theorems were true and they were about the wrong thing, and they+ are gone.** Each said the HERBRAND witness is not a `W3CModel`, which is a+ reason to build a different structure rather than a reason the result is out of+ reach. Three finite structures were built and all three results transfer:+ `the_old_svf_derivation_is_not_w3c_entailed` on an eighteen-element model of+ `svfPremises` whose `ICEXT(C)` is empty; `feed_is_not_w3c_refuted` and+ `the_old_verdict_does_not_notice_over_w3c` on one thirteen-element carrier with+ a single row switched, the row being `ICEXT(Herbivore)`, which is empty over+ `feed` and `{leo}` over `graze`. `feed`'s result is stated as `¬ W3CUnsat`,+ which is STRONGER than `¬ Unsat` rather than weaker, because `Unsat` is a+ universal negative over the model class; `w3cUnsat_of_unsat` records the easy+ direction, that a refutation rules out the conforming interpretations too.+ ALL NINE `¬ Entails` and `¬ Unsat` statements in the repository are now over+ `W3CModel`, and `Semantics.lean` carries the complete table. The two `¬ EntailsR` resultsare about a rule-relative relation with no `W3CModel` counterpart, nothing isclaimed about them, and that is said rather than left to inference. The obstruction about `Der` and strictlynegative occurrences survives, and says only that there is no general *closurediff --git a/README.md b/README.mdindex 8d4aaedd..d9c43b04 100644--- a/README.md+++ b/README.md@@ -108,27 +108,37 @@ is named property by property in [docs/trusted-computing-base.md](docs/trusted-cproperty-tested, and partly bounded-model-checked. It is not verified. This work verified thejoint, not the machine.-**The bridge to the specification is prose, not a theorem.** Fourteen rule arms used to be-assumed rather than derived, and they are now derived, each with an empty axiom footprint, over a-structure carrying the W3C conditions at full strength. What is still assumed is the reading that-turns a conforming interpretation into one of ours, and five facts from the axiomatic-triple-tables that reading needs. Formalising the specification side properly means building its whole-interpretation structure in core Lean, and that has not been done.+**The bridge to the specification is a theorem, and what stands in its place now is smaller and a+different kind of thing.** An OWL 2 RDF-Based interpretation is a Lean structure in its own right:+the parts of RBS Table 5.1 the rules reach, and RDF 1.1 Semantics section 5's truth clause with its+`I(p) ∈ IP` conjunct. `OOCert.Conforming.toW3C` proves that every such interpretation carries the+W3C conditions at full strength, and the five axiomatic-triple facts the old prose assumed are+discharged inside that proof, from five triples of the RDF and RDFS axiomatic tables carried as+quoted fields. `OOCert.certificate_conforming_sound` is then the sentence: a checked certificate's+conclusions are true, in the specification's own sense of true, in every interpretation meeting+those conditions that satisfies the asserted graph. One of the five facts was previously sourced to+a triple whose predicate is the wrong one, which is why it is now taken from+`rdf:type rdfs:range rdfs:Class .` instead.++What is left is a containment, not a reading: the condition list is a SUBSET of the+Recommendation's, which is the safe direction and is why it is allowed, and that it is a subset is+checked cell by cell by a reader rather than by Lean. Two smaller things are named at the file.+`IL` is total, following RBS section 4.2's wording, which excludes RDF 1.1 interpretations in which+a literal fails to denote; that one does not run in the safe direction, and closing it needs a+term-occurrence lemma about `checkStep` that nobody has written. And one reading is load-bearing:+RBS Table 5.4 at `n = 0`, which the engine's `cls-int1` already depends on for empty lists.**Two kernels agreeing is weaker than it sounds.** They are theorems over model classes nobody hasordered in either direction, so "both said entailed" means less than a reader would naturally takeit to mean. Lean's class is still larger than the specification's, so entailment transfers outward-and non-entailment transfers only where it has been shown to: four of the negative results now-carry over, and three do not, each of those three carrying the field that fails as a checked-theorem.+for free and non-entailment does not: each one needs its own witness in the smaller class, and+every negative result about the built-in rules now has one.**A non-vacuity witness can be vacuous where it matters**, and ours was. It satisfied nine oftwenty-one conditions only because the relevant extensions were empty, and six of the fourteen armsrested entirely on those, which is the failure mode that most resembles success. It is rebuilt, andthe gate is now stronger than non-emptiness: every one of the fourteen derivations must fire at a-concrete instance. Five conditions remain vacuous, they carry no arm, and one of them cannot be-exercised by any model at all because the specification makes that relation the diagonal. The-Isabelle witness has not had the same treatment.+concrete instance, and every one of the twenty-one conditions must have a satisfied antecedent.**Negative answers are mostly unchecked opinion.** A refutation cannot be replayed in core Lean, soan "unsatisfiable" from any prover is testimony, not a certificate. One clash rule has a semantic@@ -163,13 +173,16 @@ the specification's raw HTML, in [lean/OOCert/W3C.lean](lean/OOCert/W3C.lean), athose cells, rather than over the weaker conditions this Lean used to posit. Same certificates,same checker, and not one of those derivations depends on any axiom at all.-One step short of that is still an argument rather than a theorem, and it is labelled as one in the-file: reading a conforming interpretation as a Lean `Interp` is a bridge written in prose, because-nothing in core Lean quantifies over the specification's metatheory. That bridge also assumes five-`IP` memberships taken from the RDF and RDFS axiomatic-triple tables rather than from any cell the-file quotes, and they are listed there as the assumption they are. So-`certificate_w3c_sound` is not yet the sentence "true in every conforming interpretation", and no-document here says it is.+That step short of the specification has since been closed.+[lean/OOCert/Conforming.lean](lean/OOCert/Conforming.lean) builds the specification's own+interpretation in core Lean, so there is something to quantify over, and the reading that used to be+prose is `OOCert.Conforming.toW3C`. The five `IP` memberships the old bridge assumed are fields of+that structure, quoted out of the RDF and RDFS axiomatic-triple tables, and discharged in one step+each by section 5's truth clause. `OOCert.certificate_conforming_sound` is the sentence+`certificate_w3c_sound` said it was not yet, and+[lean/OOCert/ConformingWitness.lean](lean/OOCert/ConformingWitness.lean) exhibits an interpretation+satisfying every one of those conditions and every RDF and RDFS axiomatic triple, then names, as+checked theorems, which conditions it leaves untested and which Table 5.2 row it breaks.The same review found the limit of that result. Entailment transfers outward and non-entailment doesnot, so a `¬ Entails` here is about this layer's model class unless something restates it over thediff --git a/docs/decisions/0002-an-inference-carries-a-certificate.md b/docs/decisions/0002-an-inference-carries-a-certificate.mdindex 96fb9b70..bd4a84c8 100644--- a/docs/decisions/0002-an-inference-carries-a-certificate.md+++ b/docs/decisions/0002-an-inference-carries-a-certificate.md@@ -44,12 +44,19 @@ on the engine's author having thought of the bug.rest is the *if* direction of the corresponding W3C condition or a consequence of it. Weakerconditions admit more interpretations, so soundness here implies soundness over theconditions `lean/OOCert/W3C.lean` states, and since 15 September 2026 that implication is a- theorem (`OOCert.W3CEntails.of_entails`) rather than an argument in a docstring. It is NOT yet- the sentence "sound under the OWL 2 RDF-Based Semantics": the reading of a conforming- interpretation as a Lean `Interp` is prose, it assumes five `IP` memberships from the axiomatic- triple tables, and `W3CModel` omits every table row no rule consumes. `Model` reads a list- off the asserted graph through `Chain`, which is weaker than the specification's semantic- sequence relation and so keeps the model class larger.+ theorem (`OOCert.W3CEntails.of_entails`) rather than an argument in a docstring. Since the same+ day it reaches one layer further out: `lean/OOCert/Conforming.lean` formalises an OWL 2+ RDF-Based interpretation in its own right, from RBS Table 5.1 and RDF 1.1 Semantics section 5's+ truth clause, proves the reading that used to be prose as `OOCert.Conforming.toW3C`, and+ discharges all five of the `IP` memberships the old bridge assumed from five quoted axiomatic+ triples carried as fields. `OOCert.certificate_conforming_sound` is the resulting sentence.+ What is still not a theorem is that the field list is a SUBSET of the Recommendation's+ conditions, which a reader checks cell by cell; that a subset is the safe direction is the+ reason it is allowed. One modelling decision does not run in the safe direction and is named+ there: `IL` is total, per RBS section 4.2, so RDF 1.1 interpretations in which a literal fails+ to denote are outside the claim. `Model` reads a list off the asserted graph through `Chain`,+ which is weaker than the specification's semantic sequence relation and so keeps the model class+ larger; `OOCert.Conforming.seq_of_chain` proves that comparison rather than asserting it.5. **The theorem is shown non-vacuous in the same directory.** A soundness result about anunsatisfiable semantics proves nothing, so `lean/OOCert/Witness.lean` exhibits a model of anarbitrary graph, exhibits a triple that is not entailed, and proves that the derivationdiff --git a/docs/lean-certificates.md b/docs/lean-certificates.mdindex af3617ab..59198946 100644--- a/docs/lean-certificates.md+++ b/docs/lean-certificates.md@@ -86,9 +86,10 @@ conditions at full strength, one field per table cell quoted verbatim from the rspecification, and `OOCert.W3CEntails.of_entails` proves that everything `Entails` gives is true inevery `W3CModel`, which is an interpretation meeting those fields.`OOCert.certificate_w3c_sound` is `certificate_sound` restated over that class, with the same-certificates and the same checker. **It is not yet the sentence "true in every conforming+certificates and the same checker. **It is not the sentence "true in every conforminginterpretation", the file says so in its own docstring, and no document here may say otherwise.**-Two things separate them and both are set out in the next paragraph.+That sentence is `OOCert.certificate_conforming_sound`, a layer further out, and the section after+next is about it.Fourteen arms of the soundness proof used to be *posited*: the theorem that `scm-dom1` is sound reada field off `Conditions` which said that `scm-dom1` holds. All fourteen are now derived, and each@@ -97,23 +98,87 @@ Table 5.8's connective, which carries `rowspan="4"` in the source and so states`rdfs:subClassOf`, `rdfs:subPropertyOf`, `rdfs:domain` and `rdfs:range`. RDFS alone gives those rowsonly the `if-then` direction, and the twelve `scm-*` arms among the fourteen do not follow from it.-One step is an argument rather than a theorem, and it is labelled as one in the file. Reading a-conforming interpretation as a Lean `Interp` needs a bridge, `iext p x y := IP p and (x, y) in-IEXT p`, under which `Interp.sat` unfolds to RDF 1.1 Semantics section 5's truth clause including-its `I(p) is in IP` conjunct. Core Lean has nothing to quantify over on the specification side, so-that step is prose.--That bridge assumes more than the cells the file quotes, and the file now lists what. Under it,-`I.sc a b` unfolds to `IP(I(rdfs:subClassOf))` *and* the pair being in the extension, and `I.cext`-carries an `IP(I(rdf:type))` conjunct in the same way, so five `IP` memberships have to come from-outside every table `W3C.lean` cites: `I(rdf:type)`, `I(rdfs:subClassOf)`, `I(rdfs:subPropertyOf)`,-`I(rdfs:domain)` and `I(rdfs:range)`. All five come from the RDF and RDFS *axiomatic triple* tables-of RDF 1.1 Semantics sections 8 and 9, re-read in the raw HTML on 15 September 2026. The second-kernel makes three of the same assumptions explicitly, as `c_type_IP`, `c_sco_IP` and `c_spo_IP` in-`isabelle/OO_Semantics.thy`, and needs no counterpart to the other two. An earlier version of this-documentation and of `W3C.lean` claimed the Lean needed none of them and was therefore ahead of the-Isabelle on this point; the opposite is true, and dropping the `IP` conjunct from `Interp.sat` moves-the obligation into the bridge rather than removing it.+That step used to be an argument rather than a theorem. It is now a theorem, in+`lean/OOCert/Conforming.lean`, and this section records both the result and what it does not cover.++An OWL 2 RDF-Based interpretation is a Lean structure there, `OOCert.Interpretation`: the parts of+RBS Table 5.1, with `IR` as the carrier type so that Table 5.1's `IP ⊆ IR`, `IC ⊆ IR`,+`ICEXT(x) ⊆ IR` and `IEXT(x) ⊆ IR × IR` hold by typing, plus `IS`, `IL` and the blank-node+assignment of RDF 1.1 Semantics section 5.1. `ICEXT` and `IC` are definitions, per section 9's+"ICEXT(y) is defined to be …" and "IC is defined to be ICEXT(I(rdfs:Class))". Truth is section 5's+clause with its `I(p) is in IP` conjunct, and the bridge to `Interp` is chosen so that+`Interp.sat` and `Interpretation.Sat` are the same proposition: `OOCert.Interpretation.sat_eq` is+`Iff.rfl`.++`OOCert.Conforming.toW3C` then proves the reading that used to be prose, and+`OOCert.Conforming.toW3CModel` carries it to `W3CModel`, which includes proving that every+`Chain G` list is a semantic sequence in the specification's sense whenever `G` is satisfied+(`OOCert.Conforming.seq_of_chain`). `OOCert.certificate_conforming_sound` is the end of it: a+checked certificate's conclusions are true, in section 5's sense, in every such interpretation of+the asserted graph.++The five `IP` memberships that bridge used to assume, namely `I(rdf:type)`, `I(rdfs:subClassOf)`,+`I(rdfs:subPropertyOf)`, `I(rdfs:domain)` and `I(rdfs:range)`, are now discharged. Each is a field+of `OOCert.Conforming` asserting one axiomatic triple whose OWN PREDICATE is the term in question,+so section 5's truth clause hands the membership back as that triple's first conjunct, with no table+consulted:++| fact | axiomatic triple | table |+|---|---|---|+| `I(rdf:type) ∈ IP` | `rdf:type rdf:type rdf:Property .` | RDF 1.1 §8, RDF axioms |+| `I(rdfs:subClassOf) ∈ IP` | `rdfs:Datatype rdfs:subClassOf rdfs:Class .` | RDF 1.1 §9, RDFS axiomatic triples |+| `I(rdfs:subPropertyOf) ∈ IP` | `rdfs:isDefinedBy rdfs:subPropertyOf rdfs:seeAlso .` | same |+| `I(rdfs:domain) ∈ IP` | `rdf:type rdfs:domain rdfs:Resource .` | same |+| `I(rdfs:range) ∈ IP` | `rdf:type rdfs:range rdfs:Class .` | same |++Taking axiomatic triples at all is licensed by a three-link chain, quoted in the file: RBS+Definition 4.2 makes an OWL 2 RDF-Based interpretation a D-interpretation; RBS section 4.2 says a+D-interpretation "has to meet … those for RDF interpretations and RDFS interpretations"; RDF 1.1+section 9 says an RDFS interpretation satisfies "all the triples in the subsequent table of RDFS+axiomatic triples". Only five are taken rather than the whole tables, because importing more would+shrink the model class for nothing.++**The last row of that table is a correction.** `W3C.lean` sourced `I(rdfs:range) ∈ IP` to+`rdfs:range rdfs:domain rdf:Property .` with the note "whose truth puts its own predicate in `IP`".+The predicate of that triple is `rdfs:domain`, so its truth gives `I(rdfs:domain) ∈ IP` and not+`I(rdfs:range) ∈ IP`; the fact is still available from it, through Table 5.8's `rdfs:domain` row,+but that step was not in the entry. The triple above needs no such step.++The second kernel makes three of the same assumptions explicitly, as `c_type_IP`, `c_sco_IP` and+`c_spo_IP` in `isabelle/OO_Semantics.thy`, and needs no counterpart to the other two. An earlier+version of this documentation and of `W3C.lean` claimed the Lean needed none of them and was+therefore ahead of the Isabelle on this point; the opposite was true, and dropping the `IP` conjunct+from `Interp.sat` moved the obligation into the bridge rather than removing it. The Lean is now+ahead on this point for a different reason: it discharges all five where the Isabelle assumes three.++**What is left, and it is a containment rather than a reading.** `OOCert.Conforming` carries a+SUBSET of the Recommendation's conditions, which is the safe direction. A subset admits more+interpretations, so every conforming interpretation is one of these and a sentence true throughout+is true of every one of them. That it is a subset is checked cell by cell by a reader, not by Lean,+and the Recommendation has fifteen condition tables where this carries rows from six.++Three further items are named at their fields rather than folded into the word "conforming".+Blank nodes are rigid, which makes the entailment relation strictly smaller and the theorem+strictly stronger, the same decision and the same argument as `OO_Semantics.thy`'s DECISION M4.+`IEXT` is total on the carrier and every condition relativises to `IP` exactly where the+specification's quantifier does, as in DECISION M6. And `IL` is total, following RBS section 4.2's+wording rather than RDF 1.1 section 5's "partial mapping"; **this one does not run in the safe+direction**, because it excludes RDF 1.1 interpretations in which a literal fails to denote.+Closing it needs a term-occurrence lemma about `checkStep`, saying that every term of a checked+conclusion occurs in the asserted graph, so that in any model of the graph every such term denotes.+Nobody has written it.++One reading of a cell is load-bearing and is flagged at the field: RBS Table 5.4 at `n = 0`, where+`ICEXT(c1) ∩ … ∩ ICEXT(cn)` is read as `IR`. `Rules.lean`'s `takeChain` accepts an empty chain, so+`cls-int1` fires on `c owl:intersectionOf rdf:nil` and concludes `x rdf:type c` for every `x`, and+`Model.int` quantifies over the whole domain, so the engine and the existing Lean already depend on+that reading.++`lean/OOCert/ConformingWitness.lean` exhibits an interpretation satisfying every stated condition,+plus every RDF and RDFS axiomatic triple in both tables and three identity rows of RBS Table 5.2+that `W3CWitness.lean`'s model records itself as violating. It also states, as checked theorems,+which conditions it leaves untested (all eleven OWL-vocabulary extensions are empty there) and which+Table 5.2 row it breaks (`owl:Nothing | = ∅`).`W3CModel` is also deliberately weaker than conformance, because `W3C` omits every table row no ruleconsumes, so its class is larger than the bridge image. Both gaps run in the safe direction for@@ -160,20 +225,20 @@ restatement is hard. `IP` is a free parameter of `W3C`, not a field of `Interp`,`IP := fun _ => False` makes all three vacuous. `sc_bwd` is guarded by `IC` instead, and over aHerbrand interpretation `IC` is the set of things the graph types as `rdfs:Class`, so a witnessgraph with no such typing makes that field vacuous too. Nine statements here are a `¬ Entails` or a-`¬ Unsat`. Five are now over `W3CModel`, four of them with their existing witness interpretations-unchanged:+`¬ Unsat`. ALL NINE are now over `W3CModel`: four with their existing witness interpretations+unchanged, four on a finite structure built for them, and one by unfolding.| result | over `W3CModel` | how ||---|---|---|| `not_everything_is_entailed` | yes | `not_everything_is_w3c_entailed`, the empty graph's Herbrand interpretation |-| `the_natural_avf2_direction_is_not_entailed` | yes | `the_natural_avf2_direction_is_not_w3c_entailed`, a twenty-six-element structure built for it |+| `the_natural_avf2_direction_is_not_entailed` | yes | `the_natural_avf2_direction_is_not_w3c_entailed`, a thirty-five-element structure built for it || `an_unlisted_individual_is_not_entailed` | yes | `an_unlisted_individual_is_not_w3c_entailed`, `ooWitness` unchanged || `membership_in_one_member_does_not_give_the_intersection` | yes | `membership_in_one_member_is_not_w3c_enough`, `intWitness` unchanged || `mix_not_absolutely_entailed` | yes | `mix_not_absolutely_w3c_entailed` in `Mixed.lean`, `mixH` unchanged |-| `the_old_svf_derivation_is_not_entailed` | no | `svf_witness_misses_the_restriction_typing` |-| `feed_is_not_refuted` | no | `feed_closure_misses_the_class_typing`, and `¬ Unsat` runs the wrong way |-| `and_the_old_verdict_does_not_notice` | no | `sc_fwd` fails on `grazeClosure` for the same reason |-| `not_unsat_of_joint_model` | no | a lemma with a hypothesis, same direction problem |+| `the_old_svf_derivation_is_not_entailed` | yes | `the_old_svf_derivation_is_not_w3c_entailed`, an eighteen-element structure built for it |+| `feed_is_not_refuted` | yes | `feed_is_not_w3c_refuted`, a thirteen-element structure that also satisfies `RefuteConditions`; the verdict is `¬ W3CUnsat`, which is STRONGER than `¬ Unsat` |+| `and_the_old_verdict_does_not_notice` | yes | `the_old_verdict_does_not_notice_over_w3c`, the same carrier with one row changed |+| `not_unsat_of_joint_model` | yes | `not_w3cUnsat_of_joint_w3c_model`, by unfolding |`Mixed.lean`'s `mix_relative_is_not_everything` and `HornWitness.lean`'s`demo_not_everything_entailed` are `¬ EntailsR`, about the models of a graph that also satisfy a@@ -184,11 +249,13 @@ two beyond `Conditions`.basis for a run reporting `entailed_under_supplied_rules` rather than `entailed`, and it is now thestrong version of that sentence rather than the one about this layer's own conditions.-The two obstructions are checked by `decide` rather than argued. `svfWitness` carries-`R owl:onProperty p` and types `R` as nothing, so RBS Table 5.3's `owl:onProperty` row fails on its-first conjunct; `feedClosure` carries `Lion rdfs:subClassOf Carnivore` and types nothing as an-`rdfs:Class`, so Table 5.8 row 1 forward fails on the `IC` conjunct it concludes. Neither field-mentions `IP`, so the empty-`IP` reading does not help.+The last four rows used to read "no", with the field that fails pinned as a `decide`-checked+theorem: `svfWitness` carries `R owl:onProperty p` and types `R` as nothing, so RBS Table 5.3's+`owl:onProperty` row fails on its first conjunct; `feedClosure` and `grazeClosure` carry+`Lion rdfs:subClassOf Carnivore` and type nothing as an `rdfs:Class`, so Table 5.8 row 1 forward+fails on the `IC` conjunct it concludes. Those theorems were true and they were about the HERBRAND+WITNESSES rather than about the results. A witness that is not a `W3CModel` is a reason to build one,+and `svfI` and `refI` are the structures that were built.**An earlier version of this section said the opposite, and the reason it gave was inverted.** Itread: "a Herbrand witness carrying no `rdf:type` triple has `IC` empty, so Table 5.8's backward@@ -210,11 +277,12 @@ The live witness, in `lean/OOCert/W3CWitness.lean`:| theorem | says ||---|---|-| `live_is_a_w3c_model` | a twenty-six-element interpretation meets the quoted cells of Tables 5.2, 5.3, 5.6, 5.8, 5.9, 5.12 and 5.13, so `W3C` is satisfiable |+| `live_is_a_w3c_model` | a thirty-five-element interpretation meets the quoted cells of Tables 5.2, 5.3, 5.6, 5.8, 5.9, 5.12 and 5.13, so `W3C` is satisfiable || `live_is_live` | and it is not degenerate: `IC` is not the carrier, one class extension is everything, another is a proper subset witnessed on both sides, the filler extension is non-empty and proper, and `IEXT(p1)` is non-empty and a proper subset of `IEXT(p2)` || `live_exercises_every_arm` | all fourteen derivations fire at concrete instances of it, which is stronger than any field being non-empty |-| `live_fires_the_other_sixteen` | a satisfied antecedent for each of the other sixteen fields of `W3C`, guards and quantified clause together for the four backward ones |-| `live_leaves_exactly_these_five_vacuous` | and the five fields it does not exercise, named, none of which carries any of the fourteen arms; sixteen plus five is twenty-one, so neither number can drift |+| `live_fires_every_field` | a satisfied antecedent for each of the twenty-one fields of `W3C`, guards and quantified clause together for the four backward ones, so no field holds for want of anything to check |+| `sameAs_has_no_off_diagonal_instance` | the one residual limit, and it is about every interpretation rather than this one: RBS Table 5.9 row 1 is an `iff` whose right side is an equation, so `same_fwd` can be exercised and can never be exercised at `a ≠ b` |+| `sameAs_diagonal_needs_an_off_diagonal_subproperty` | and what that cell costs a model builder: with `owl:sameAs` carrying the diagonal, `IEXT(rdfs:subPropertyOf)` cannot be the diagonal too, so a countermodel needs two distinct properties one below the other || `the_natural_avf2_direction_is_not_w3c_entailed` | the reversed `scm-avf2` conclusion fails in that interpretation || `not_everything_is_w3c_entailed` | `W3CEntails` is not the trivial relation either |@@ -224,7 +292,13 @@ nothing was in the extension their antecedent reads, six of the fourteen arms rethose nine, and the refutation's own premise `p1 rdfs:subPropertyOf p2` held because `sp_bwd` hadnothing to check. Worse, the two emptinesses were conjuncts of `live_is_live`, the theorem whose jobis to catch exactly that. The rebuilt model gives `p1` a pair, `Y` a member, and each of the six-dead arms a configuration to fire on.+dead arms a configuration to fire on. It left five fields still vacuous, and a second rebuild closed+those too: `owl:sameAs`, `owl:inverseOf`, `owl:hasValue`, `owl:SymmetricProperty` and+`owl:TransitiveProperty` had been falling through the denotation table to the junk element, and they+now denote elements with rows of their own. The note that came with the five said `owl:sameAs`+"cannot be exercised by any model at all", which is false: RBS section 4.2 makes IR nonempty and+Table 5.9 row 1 makes the extension the whole diagonal on it, so a model that leaves it empty is+failing to model that cell rather than obeying it.`the_natural_avf2_direction_is_not_w3c_entailed` is still not a proof that the triple fails to beOWL 2 RDF-Based entailed, and nobody should write that sentence. `W3CModel`'s class is larger thandiff --git a/docs/reasoning-systems-inventory.md b/docs/reasoning-systems-inventory.mdindex 5b0278a1..4299433d 100644--- a/docs/reasoning-systems-inventory.md+++ b/docs/reasoning-systems-inventory.md@@ -124,6 +124,15 @@ vacuous exactly where their conditions are strongest. Each of those is a case ofclaiming more than it had earned, which by this project's standards is the same category as asoundness bug.+Three of those four are now closed and the fourth is narrower than it was. The eight arms are+derived on both sides. Both non-vacuity witnesses are rebuilt and both carry a gate that fails if+they are hollowed out later: `live_exercises_every_arm` and `live_fires_every_field` on the Lean+side, `M4_exercises_every_derivation` and `M4_every_condition_has_a_live_antecedent` on the+Isabelle. Every non-entailment in the Lean is now stated over the class carrying the quoted table+cells as well, four of them on finite structures built for the purpose. What is NOT closed is the+ordering of the two kernels' model classes, which nobody has established in either direction, so+"both said entailed" still means less than it looks.+What remains declined is the wider use. Reconstructing Vampire or E refutations throughIsabelle's kernel would give this project kernel-checked refutations, which it lacks, at the costof a second proof assistant in the trust surface for every user rather than for a cross-check.diff --git a/isabelle/OO_Audit.thy b/isabelle/OO_Audit.thyindex 0412a7ee..533ab9ce 100644--- a/isabelle/OO_Audit.thy+++ b/isabelle/OO_Audit.thy@@ -40,7 +40,20 @@ ML \<open>@{thm M3_refutes_sameAs},@{thm entailment_is_not_trivial},@{thm entailment_is_not_trivial_empty},- @{thm the_IP_clause_has_content}]+ @{thm the_IP_clause_has_content},+ @{thm M4_is_a_model},+ @{thm M4_wf},+ @{thm M4_models_fixture_graph},+ @{thm M4_sat_the_certified_conclusion},+ @{thm M4_refutes_fresh_class},+ @{thm entailment_is_not_trivial_M4},+ @{thm M4_exercises_every_derivation},+ @{thm M4_avf2_really_is_antitone},+ @{thm M4_is_bridge_coherent},+ @{thm sameAs_is_exercised_only_on_the_diagonal},+ @{thm M3_leaves_these_extensions_empty},+ @{thm M4_is_live},+ @{thm M4_every_condition_has_a_live_antecedent}]@ @{thms M3_is_not_degenerate}val oracles = Thm_Deps.all_oracles thsval names = map (fn ((n, _), _) => n) oraclesdiff --git a/isabelle/OO_NonVacuity.thy b/isabelle/OO_NonVacuity.thyindex c88c3289..0b5f5412 100644--- a/isabelle/OO_NonVacuity.thy+++ b/isabelle/OO_NonVacuity.thy@@ -14,11 +14,34 @@partiality of IL (M3) and says nothing about the IRI-only case, which is theinteresting one.- THE REAL WITNESS is M3. It is a model of the ACTUAL FIXTURE GRAPH- tests/fixtures/horn/asserted.tsv; it has IC non-empty, so the Table 5.8 backward- conditions are LIVE rather than vacuous; it satisfies the conclusion the fixture- certificate derives, as soundness requires; and it refutes an IRI-only triple over- that same non-empty graph. *)+ THE WITNESS FOR TABLE 5.8 AND FOR THE FIXTURE GRAPH is M3. It is a model of the+ ACTUAL FIXTURE GRAPH tests/fixtures/horn/asserted.tsv; it has IC non-empty, so the+ Table 5.8 backward conditions are LIVE rather than vacuous; it satisfies the+ conclusion the fixture certificate derives, as soundness requires; and it refutes an+ IRI-only triple over that same non-empty graph.++ It does NOT separate the IP clause of the truth condition M5, although the comment at+ M3_refutes_sameAs reads as though it does. zz is outside IP AND has an empty+ extension, so that triple is false for two reasons at once and would stay false if the+ IP clause were dropped. The same is true of M4. Isolating that clause needs a+ predicate outside IP with a NON-EMPTY extension, which costs bridge coherence, and no+ witness in this file has one.++ M3 IS NOT THE WITNESS FOR THE REST OF THE TABLE, and an earlier version of this+ header called it THE REAL WITNESS with no such qualification. FIFTEEN of the+ twenty-six conditions hold in M3 only because the extension their antecedent reads is+ EMPTY: c_dom_fwd, c_rng_fwd, c_sameAs_fwd, c_eqc_fwd, c_eqp_fwd, c_inv_fwd,+ c_sym_fwd, c_trp_fwd, c_svf, c_avf, c_hv, c_restr_IC, c_svf_typ, c_avf_typ and+ c_onp_typ. Each of those is discharged below by a bare "by simp" off the single fact+ that rdfs:domain, rdfs:range and every owl: term denote the junk element zz, whose+ extension is {}. Nothing about M3 is wrong; what is wrong is calling it the witness+ for conditions it never touches.++ THE WITNESS FOR THE OTHER FIFTEEN is M4, in section N4. Every one of the twenty-six+ conditions has a satisfied antecedent there (M4_every_condition_has_a_live_antecedent)+ and all fourteen derived monotonicity and subsumption lemmas of OO_Builtin_Sound fire+ at concrete elements of it (M4_exercises_every_derivation), so an edit that hollows+ the model out breaks the build instead of passing quietly. *)theory OO_NonVacuityimports OO_Builtin_Sound@@ -88,7 +111,9 @@ section \<open>N3: a non-degenerate model of the fixture graph\<close>someValuesFrom, allValuesFrom, hasValue, onProperty, domain, range, Restriction,SymmetricProperty and TransitiveProperty all vacuous at once -- and it is soundprecisely because nothing in the condition set FORCES a pair into any of those- extensions. Checked: only c_sco_bwd, c_spo_bwd, c_dom_bwd and c_rng_bwd have a+ extensions. It is also the LIMIT of what M3 establishes: fifteen of the twenty-six+ conditions are satisfied here by having nothing to check, and M4 in section N4 is+ the model that checks them. Checked: only c_sco_bwd, c_spo_bwd, c_dom_bwd and c_rng_bwd have aconsequent that asserts membership, and their consequents name subClassOf,subPropertyOf, domain and range. domain and range are handled by showing theirantecedents false. *)@@ -288,14 +313,38 @@ theorem M3_is_a_model: "owl_rl_interp M3"satisfiability for the bridge theorem T4 as well as for entails. *)theorem M3_wf: "wf_interp M3" by (simp add: wf_interp_def)-(* THE POINT OF M3: the Table 5.8 backward conditions are LIVE in it, not vacuous. A- witness with IC empty satisfies c_sco_bwd, c_dom_bwd and c_rng_bwd by having nothing- to quantify over, and therefore provides NO evidence that those conditions -- which- twelve of the 27 arms depend on -- are jointly satisfiable alongside the rest. *)+(* THE POINT OF M3, and its exact limit. The Table 5.8 backward conditions are LIVE in+ it, not vacuous. A witness with IC empty satisfies c_sco_bwd, c_dom_bwd and c_rng_bwd+ by having nothing to quantify over, and therefore provides NO evidence that those+ conditions -- which twelve of the 27 arms depend on -- are jointly satisfiable+ alongside the rest. What M3 does NOT establish is stated as a theorem rather than+ left to inspection: M3_leaves_these_extensions_empty below names the thirteen extensions+ that are empty here, and M4 in section N4 is where each of them has something in it. *)theorem M3_is_not_degenerate:"IC M3 \<noteq> {}" and "ICEXT M3 cA \<noteq> {}" and "IEXT M3 (IS M3 rdfs_subClassOf) \<noteq> {}"by (simp_all add: S3_def)+(* AND THE EXACT LIMIT OF M3, as a theorem rather than as a remark. These are the+ thirteen extensions the fifteen unexercised conditions read, and every one of them is+ empty here, which is the only reason those fifteen conditions hold. Stated so that+ the claim in the file header cannot drift from the model. Section N4 is where each of+ these has something in it. *)+theorem M3_leaves_these_extensions_empty:+ "IEXT M3 (IS M3 rdfs_domain) = {}+ \<and> IEXT M3 (IS M3 rdfs_range) = {}+ \<and> IEXT M3 (IS M3 owl_sameAs) = {}+ \<and> IEXT M3 (IS M3 owl_equivalentClass) = {}+ \<and> IEXT M3 (IS M3 owl_equivalentProperty) = {}+ \<and> IEXT M3 (IS M3 owl_inverseOf) = {}+ \<and> IEXT M3 (IS M3 owl_someValuesFrom) = {}+ \<and> IEXT M3 (IS M3 owl_allValuesFrom) = {}+ \<and> IEXT M3 (IS M3 owl_hasValue) = {}+ \<and> IEXT M3 (IS M3 owl_onProperty) = {}+ \<and> ICEXT M3 (IS M3 owl_Restriction) = {}+ \<and> ICEXT M3 (IS M3 owl_SymmetricProperty) = {}+ \<and> ICEXT M3 (IS M3 owl_TransitiveProperty) = {}"+ by simp+subsection \<open>What M3 makes true, and what it makes false\<close>lemma M3_sat_asserted_1: "sat M3 (Iri ex_a, Iri rdf_type, Iri ex_A)"@@ -345,4 +394,1406 @@ theorem the_IP_clause_has_content:unfolding entails_defusing M3_is_a_model M3_models_fixture_graph M3_refutes_sameAs by blast+section \<open>N4: a model in which no condition holds for want of anything to check\<close>++(* WHAT M3 LEAVES UNEXERCISED, and why a second witness is needed.++ M3 is a genuine model of the fixture graph and it makes the Table 5.8 BACKWARD+ conditions live, which is what the section above claims for it. It is not the real+ witness for the rest of the table, and the header above overstates it. FIFTEEN of+ the twenty-six conditions hold in M3 because the extension their antecedent reads is+ EMPTY: c_dom_fwd, c_rng_fwd, c_sameAs_fwd, c_eqc_fwd, c_eqp_fwd, c_inv_fwd,+ c_sym_fwd, c_trp_fwd, c_svf, c_avf, c_hv, c_restr_IC, c_svf_typ, c_avf_typ and+ c_onp_typ. Every one of them is discharged there by a bare "by simp" off the single+ fact that rdfs:domain, rdfs:range and every owl: term denote the junk element zz,+ whose extension is {}. A condition satisfied that way is evidence that the condition+ set is consistent with having nothing to check, and nothing more.++ The same defect reaches further than the conditions. Twelve of the twenty-seven arms+ of the built-in table rest on those fifteen conditions, so over M3 they are supported+ by a model that never fires them.++ M4 below is what exercises them. Every one of the twenty-six conditions has a+ SATISFIED ANTECEDENT in it, stated as the block of lemmas M4_ante_*, and all fourteen+ derived monotonicity and subsumption lemmas of OO_Builtin_Sound fire at concrete+ elements of it, stated as M4_arm_* and collected in M4_exercises_every_derivation.+ M3 is kept, unchanged, because it is still the smallest thing that makes the point of+ section N3.++ THE CONSTRUCTION. Three individuals Alice, Bob and Carl; seven classes; six ordinary+ properties; the schema and constructor vocabulary as thirty-four elements in all.+ The shape is forced far more than it is chosen.++ Alice has one PrP1-successor, Carl, and two PrP2-successors, Bob and Carl. So+ IEXT(PrP1) is NON-EMPTY and a PROPER subset of IEXT(PrP2), and the subPropertyOf+ fact between them holds for a reason rather than for want of anything to check.+ ICEXT(ClY) is {Carl}: Carl is in it and Bob is not.++ ClC1 is the universal restriction on PrP1 with filler ClY, ClC2 the universal+ restriction on PrP2 with filler ClY, ClA2 the universal restriction on PrP2 with+ filler ClC1. Table 5.6 then FORCES ICEXT(ClC1) and ICEXT(ClA2) to be the whole+ carrier and ICEXT(ClC2) to be the carrier without Alice, because Alice's second+ PrP2-successor Bob is outside ICEXT(ClY). ClS1, ClS2 and ClS3 are the existential+ restrictions on PrP2 with filler ClY, on PrP2 with filler ClC1 and on PrP1 with+ filler ClY; Table 5.6 forces each of their class extensions to be {Alice}.++ ClS1 carries an owl:hasValue pair to Bob as well as its owl:someValuesFrom pair.+ That is legitimate and it is not an accident of drafting: RBS Table 5.6's rows are+ IF-THEN conditions on an element, not definitions of one element per class+ expression, so one element may satisfy several of them, and here both rows force the+ SAME class extension {Alice}. Doing it this way saves an element, and the size of+ the carrier is what the proofs below cost.++ PrQ has the same extension as PrP1 and is a different element, which is what+ owl:equivalentProperty needs. ClC1 and ClA2 have the same class extension and are+ different elements, which is what owl:equivalentClass needs; ClS1 and ClS2 are a+ second such pair. PrR is the converse of PrP1, for owl:inverseOf. PrSym is+ symmetric and not transitive, PrTrans is transitive and not symmetric, and each is+ typed accordingly, so neither of those two conditions is met by a relation that+ happens to satisfy both.++ IEXT(owl:sameAs) is the DIAGONAL Id on IR, and IR is the whole carrier. See+ sameAs_is_exercised_only_on_the_diagonal below for why that is the only choice a+ conforming interpretation has and why it is nevertheless not vacuous.++ The four relations rdfs:subClassOf, rdfs:subPropertyOf, rdfs:domain and rdfs:range+ are then a FIXPOINT and not a free choice, because Table 5.8 is an iff in all four+ rows and because those four elements are themselves in IP and in the scope of the+ conditions they carry. The tables Sco4, Spo4, Dm4 and Rg4 below are that fixpoint.+ Nothing in them can be adjusted without some condition below failing.++ WHAT M4 IS NOT. It is not a conforming OWL 2 RDF-Based interpretation, and no+ theorem here says it is. owl:Thing, rdf:Property and rdfs:Resource denote VJunk with+ an empty class extension, where RBS Table 5.2 requires ICEXT(owl:Thing) = IR,+ ICEXT(rdf:Property) = IP and ICEXT(rdfs:Resource) = IR; the axiomatic triple tables of+ RDF 1.1 Semantics sections 8 and 9 are absent; and owl:Restriction is kept out of IC,+ where Table 5.2's row reads "owl:Restriction | in IC | subset of IC" and so asserts+ the membership in its second column as well as the inclusion in its third. That row+ was re-read in the raw HTML of the Recommendation on 15 September 2026, and the+ membership half of it is what M4 does not have.++ The same is true of owl:SymmetricProperty and owl:TransitiveProperty, whose Table 5.2+ rows read "in IC | subset of IP" and which M4 also keeps out of IC. A draft of this+ paragraph said those two IRIs "do not appear in Table 5.2 at all", which is false: the+ table has a row for each, checked in the raw HTML on 15 September 2026, and the entry+ in the second column is the same membership owl:Restriction has. The correction is+ recorded rather than silently applied, because a claim about a table that nobody+ re-reads is exactly the defect this file exists to remove. What M4 does satisfy is+ the third column and Table 5.13, which is what c_sym_fwd and c_trp_fwd encode and all+ that any arm consumes.++ owl_rl_interp demands none of the rows M4 lacks, by DECISION M8 and the closing note+ of OO_Semantics, so M4 is a model of the class the soundness theorems quantify over.+ Closing the gap to a conforming interpretation means formalising Table 5.2 and the+ axiomatic triple tables first. That is a different piece of work and it is not+ claimed here. *)++datatype E4 =+ Alice | Bob | Carl+ | ClY | ClC1 | ClC2 | ClA2 | ClS1 | ClS2 | ClS3+ | PrP1 | PrP2 | PrQ | PrR | PrSym | PrTrans+ | VType | VSco | VSpo | VDom | VRng+ | VAvf | VSvf | VOnp | VEqc | VEqp | VSame | VInv | VHas+ | VClass | VRestr | VSymC | VTransC+ | VJunk++definition Ty4 :: "(E4 \<times> E4) set" where+ "Ty4 = {(x,y). y = ClC1 \<or> y = ClA2+ \<or> (y = ClC2 \<and> x \<noteq> Alice)+ \<or> (y = ClY \<and> x = Carl)+ \<or> (y \<in> {ClS1, ClS2, ClS3} \<and> x = Alice)+ \<or> (y = VSymC \<and> x = PrSym)+ \<or> (y = VTransC \<and> x = PrTrans)+ \<or> (y = VClass \<and> x \<in> {ClY, ClC1, ClC2, ClA2, ClS1, ClS2, ClS3})+ \<or> (y = VRestr \<and> x \<in> {ClC1, ClC2, ClA2, ClS1, ClS2, ClS3})}"++definition Sco4 :: "(E4 \<times> E4) set" where+ "Sco4 = {(ClA2, ClA2), (ClA2, ClC1), (ClC1, ClA2), (ClC1, ClC1), (ClC2, ClA2), (ClC2,+ ClC1), (ClC2, ClC2), (ClS1, ClA2), (ClS1, ClC1), (ClS1, ClS1), (ClS1, ClS2), (ClS1,+ ClS3), (ClS2, ClA2), (ClS2, ClC1), (ClS2, ClS1), (ClS2, ClS2), (ClS2, ClS3), (ClS3,+ ClA2), (ClS3, ClC1), (ClS3, ClS1), (ClS3, ClS2), (ClS3, ClS3), (ClY, ClA2), (ClY, ClC1),+ (ClY, ClC2), (ClY, ClY)}"++definition Spo4 :: "(E4 \<times> E4) set" where+ "Spo4 = {(VAvf, VAvf), (VDom, VDom), (VEqc, VEqc), (VEqc, VSco), (VEqp, VEqp), (VEqp,+ VSpo), (VHas, VHas), (VInv, VInv), (VOnp, VOnp), (PrP1, PrP1), (PrP1, PrP2), (PrP1,+ PrQ), (PrP1, PrTrans), (PrP2, PrP2), (PrP2, PrTrans), (PrQ, PrP1), (PrQ, PrP2), (PrQ,+ PrQ), (PrQ, PrTrans), (PrR, PrR), (VRng, VRng), (VSame, VSame), (VSco, VSco), (VSpo,+ VSpo), (VSvf, VSvf), (PrSym, PrSym), (PrTrans, PrTrans), (VType, VType)}"++definition Dm4 :: "(E4 \<times> E4) set" where+ "Dm4 = {(VAvf, ClA2), (VAvf, ClC1), (VAvf, ClC2), (VDom, ClA2), (VDom, ClC1), (VDom, ClC2),+ (VEqc, ClA2), (VEqc, ClC1), (VEqc, ClC2), (VEqp, ClA2), (VEqp, ClC1), (VEqp, ClC2),+ (VHas, ClA2), (VHas, ClC1), (VHas, ClC2), (VInv, ClA2), (VInv, ClC1), (VInv, ClC2),+ (VOnp, ClA2), (VOnp, ClC1), (VOnp, ClC2), (PrP1, ClA2), (PrP1, ClC1), (PrP1, ClS1),+ (PrP1, ClS2), (PrP1, ClS3), (PrP2, ClA2), (PrP2, ClC1), (PrP2, ClS1), (PrP2, ClS2),+ (PrP2, ClS3), (PrQ, ClA2), (PrQ, ClC1), (PrQ, ClS1), (PrQ, ClS2), (PrQ, ClS3), (PrR,+ ClA2), (PrR, ClC1), (PrR, ClC2), (PrR, ClY), (VRng, ClA2), (VRng, ClC1), (VRng, ClC2),+ (VSame, ClA2), (VSame, ClC1), (VSco, ClA2), (VSco, ClC1), (VSco, ClC2), (VSpo, ClA2),+ (VSpo, ClC1), (VSpo, ClC2), (VSvf, ClA2), (VSvf, ClC1), (VSvf, ClC2), (PrSym, ClA2),+ (PrSym, ClC1), (PrSym, ClC2), (PrTrans, ClA2), (PrTrans, ClC1), (VType, ClA2), (VType,+ ClC1)}"++definition Rg4 :: "(E4 \<times> E4) set" where+ "Rg4 = {(VAvf, ClA2), (VAvf, ClC1), (VAvf, ClC2), (VDom, ClA2), (VDom, ClC1), (VDom, ClC2),+ (VEqc, ClA2), (VEqc, ClC1), (VEqc, ClC2), (VEqp, ClA2), (VEqp, ClC1), (VEqp, ClC2),+ (VHas, ClA2), (VHas, ClC1), (VHas, ClC2), (VInv, ClA2), (VInv, ClC1), (VInv, ClC2),+ (VOnp, ClA2), (VOnp, ClC1), (VOnp, ClC2), (PrP1, ClA2), (PrP1, ClC1), (PrP1, ClC2),+ (PrP1, ClY), (PrP2, ClA2), (PrP2, ClC1), (PrP2, ClC2), (PrQ, ClA2), (PrQ, ClC1), (PrQ,+ ClC2), (PrQ, ClY), (PrR, ClA2), (PrR, ClC1), (PrR, ClS1), (PrR, ClS2), (PrR, ClS3),+ (VRng, ClA2), (VRng, ClC1), (VRng, ClC2), (VSame, ClA2), (VSame, ClC1), (VSco, ClA2),+ (VSco, ClC1), (VSco, ClC2), (VSpo, ClA2), (VSpo, ClC1), (VSpo, ClC2), (VSvf, ClA2),+ (VSvf, ClC1), (VSvf, ClC2), (PrSym, ClA2), (PrSym, ClC1), (PrSym, ClC2), (PrTrans,+ ClA2), (PrTrans, ClC1), (PrTrans, ClC2), (VType, ClA2), (VType, ClC1), (VType, ClC2)}"++definition Avf4 :: "(E4 \<times> E4) set" where+ "Avf4 = {(ClA2, ClC1), (ClC1, ClY), (ClC2, ClY)}"++definition Svf4 :: "(E4 \<times> E4) set" where+ "Svf4 = {(ClS1, ClY), (ClS2, ClC1), (ClS3, ClY)}"++definition Onp4 :: "(E4 \<times> E4) set" where+ "Onp4 = {(ClA2, PrP2), (ClC1, PrP1), (ClC2, PrP2), (ClS1, PrP2), (ClS2, PrP2), (ClS3,+ PrP1)}"++definition Eqc4 :: "(E4 \<times> E4) set" where+ "Eqc4 = {(ClA2, ClC1), (ClC1, ClA2), (ClS1, ClS2), (ClS2, ClS1)}"++definition Eqp4 :: "(E4 \<times> E4) set" where+ "Eqp4 = {(PrP1, PrQ), (PrQ, PrP1)}"++definition Inv4 :: "(E4 \<times> E4) set" where+ "Inv4 = {(PrP1, PrR)}"++definition Hv4 :: "(E4 \<times> E4) set" where+ "Hv4 = {(ClS1, Bob)}"++definition P1_4 :: "(E4 \<times> E4) set" where+ "P1_4 = {(Alice, Carl)}"++definition P2_4 :: "(E4 \<times> E4) set" where+ "P2_4 = {(Alice, Bob), (Alice, Carl)}"++definition Q4 :: "(E4 \<times> E4) set" where+ "Q4 = {(Alice, Carl)}"++definition R4 :: "(E4 \<times> E4) set" where+ "R4 = {(Carl, Alice)}"++definition Sy4 :: "(E4 \<times> E4) set" where+ "Sy4 = {(Bob, Carl), (Carl, Bob)}"++definition Tr4 :: "(E4 \<times> E4) set" where+ "Tr4 = {(Alice, Bob), (Alice, Carl), (Bob, Carl)}"++primrec ext4 :: "E4 \<Rightarrow> (E4 \<times> E4) set" where+ "ext4 Alice = {}"+| "ext4 Bob = {}"+| "ext4 Carl = {}"+| "ext4 ClY = {}"+| "ext4 ClC1 = {}"+| "ext4 ClC2 = {}"+| "ext4 ClA2 = {}"+| "ext4 ClS1 = {}"+| "ext4 ClS2 = {}"+| "ext4 ClS3 = {}"+| "ext4 PrP1 = P1_4"+| "ext4 PrP2 = P2_4"+| "ext4 PrQ = Q4"+| "ext4 PrR = R4"+| "ext4 PrSym = Sy4"+| "ext4 PrTrans = Tr4"+| "ext4 VType = Ty4"+| "ext4 VSco = Sco4"+| "ext4 VSpo = Spo4"+| "ext4 VDom = Dm4"+| "ext4 VRng = Rg4"+| "ext4 VAvf = Avf4"+| "ext4 VSvf = Svf4"+| "ext4 VOnp = Onp4"+| "ext4 VEqc = Eqc4"+| "ext4 VEqp = Eqp4"+| "ext4 VSame = Id"+| "ext4 VInv = Inv4"+| "ext4 VHas = Hv4"+| "ext4 VClass = {}"+| "ext4 VRestr = {}"+| "ext4 VSymC = {}"+| "ext4 VTransC = {}"+| "ext4 VJunk = {}"++definition IP4 :: "E4 set" where+ "IP4 = {VAvf, VDom, VEqc, VEqp, VHas, VInv, VOnp, PrP1, PrP2, PrQ, PrR, VRng, VSame, VSco,+ VSpo, VSvf, PrSym, PrTrans, VType}"++definition M4 :: "E4 interp" where+ "M4 = \<lparr> IR = UNIV, IP = IP4, IEXT = ext4,+ IS = (\<lambda>u. if u = ex_a then Carl+ else if u = ex_A then ClY+ else if u = ex_B then ClC2+ else if u = rdf_type then VType+ else if u = rdfs_subClassOf then VSco+ else if u = rdfs_subPropertyOf then VSpo+ else if u = rdfs_domain then VDom+ else if u = rdfs_range then VRng+ else if u = rdfs_Class then VClass+ else if u = owl_Restriction then VRestr+ else if u = owl_onProperty then VOnp+ else if u = owl_someValuesFrom then VSvf+ else if u = owl_allValuesFrom then VAvf+ else if u = owl_hasValue then VHas+ else if u = owl_equivalentClass then VEqc+ else if u = owl_equivalentProperty then VEqp+ else if u = owl_sameAs then VSame+ else if u = owl_inverseOf then VInv+ else if u = owl_SymmetricProperty then VSymC+ else if u = owl_TransitiveProperty then VTransC+ else VJunk),+ IB = (\<lambda>b. VJunk),+ IL = (\<lambda>l. None) \<rparr>"++lemma M4_IR [simp]: "IR M4 = UNIV" by (simp add: M4_def)+lemma M4_IP [simp]: "IP M4 = IP4" by (simp add: M4_def)+lemma M4_IEXT [simp]: "IEXT M4 x = ext4 x" by (simp add: M4_def)+lemma M4_IB [simp]: "IB M4 b = VJunk" by (simp add: M4_def)+lemma M4_IL [simp]: "IL M4 l = None" by (simp add: M4_def)++lemma M4_IS [simp]:+ "IS M4 ex_a = Carl" "IS M4 ex_A = ClY" "IS M4 ex_B = ClC2"+ "IS M4 rdf_type = VType" "IS M4 rdfs_subClassOf = VSco" "IS M4 rdfs_subPropertyOf = VSpo"+ "IS M4 rdfs_domain = VDom" "IS M4 rdfs_range = VRng" "IS M4 rdfs_Class = VClass"+ "IS M4 owl_Restriction = VRestr" "IS M4 owl_onProperty = VOnp" "IS M4 owl_someValuesFrom = VSvf"+ "IS M4 owl_allValuesFrom = VAvf" "IS M4 owl_hasValue = VHas" "IS M4 owl_equivalentClass = VEqc"+ "IS M4 owl_equivalentProperty = VEqp" "IS M4 owl_sameAs = VSame" "IS M4 owl_inverseOf = VInv"+ "IS M4 owl_SymmetricProperty = VSymC" "IS M4 owl_TransitiveProperty = VTransC" "IS M4 ex_C = VJunk"+ by (simp_all add: M4_def ex_a_def ex_A_def ex_B_def ex_C_def rdf_type_def rdfs_subClassOf_def rdfs_subPropertyOf_def rdfs_domain_def rdfs_range_def rdfs_Class_def owl_Restriction_def owl_onProperty_def owl_someValuesFrom_def owl_allValuesFrom_def owl_hasValue_def owl_equivalentClass_def owl_equivalentProperty_def owl_sameAs_def owl_inverseOf_def owl_SymmetricProperty_def owl_TransitiveProperty_def)++lemma M4_ICEXT_raw: "ICEXT M4 y = {x. (x,y) \<in> Ty4}"+ by (simp add: ICEXT_def)++lemma M4_ICEXT [simp]:+ "ICEXT M4 Alice = {}"+ "ICEXT M4 Bob = {}"+ "ICEXT M4 Carl = {}"+ "ICEXT M4 ClY = {Carl}"+ "ICEXT M4 ClC1 = UNIV"+ "ICEXT M4 ClC2 = - {Alice}"+ "ICEXT M4 ClA2 = UNIV"+ "ICEXT M4 ClS1 = {Alice}"+ "ICEXT M4 ClS2 = {Alice}"+ "ICEXT M4 ClS3 = {Alice}"+ "ICEXT M4 PrP1 = {}"+ "ICEXT M4 PrP2 = {}"+ "ICEXT M4 PrQ = {}"+ "ICEXT M4 PrR = {}"+ "ICEXT M4 PrSym = {}"+ "ICEXT M4 PrTrans = {}"+ "ICEXT M4 VType = {}"+ "ICEXT M4 VSco = {}"+ "ICEXT M4 VSpo = {}"+ "ICEXT M4 VDom = {}"+ "ICEXT M4 VRng = {}"+ "ICEXT M4 VAvf = {}"+ "ICEXT M4 VSvf = {}"+ "ICEXT M4 VOnp = {}"+ "ICEXT M4 VEqc = {}"+ "ICEXT M4 VEqp = {}"+ "ICEXT M4 VSame = {}"+ "ICEXT M4 VInv = {}"+ "ICEXT M4 VHas = {}"+ "ICEXT M4 VClass = {ClA2, ClC1, ClC2, ClS1, ClS2, ClS3, ClY}"+ "ICEXT M4 VRestr = {ClA2, ClC1, ClC2, ClS1, ClS2, ClS3}"+ "ICEXT M4 VSymC = {PrSym}"+ "ICEXT M4 VTransC = {PrTrans}"+ "ICEXT M4 VJunk = {}"+ by (auto simp: M4_ICEXT_raw Ty4_def)++lemma M4_IC [simp]: "IC M4 = {ClA2, ClC1, ClC2, ClS1, ClS2, ClS3, ClY}"+ by (simp add: IC_def)++(* every enumerated table in one bundle, for the case analyses below *)+lemmas M4_tables = Ty4_def Sco4_def Spo4_def Dm4_def Rg4_def Avf4_def Svf4_def Onp4_def Eqc4_def Eqp4_def Inv4_def Hv4_def P1_4_def P2_4_def Q4_def R4_def Sy4_def Tr4_def IP4_def++subsection \<open>Each of the 26 conditions over M4, discharged separately\<close>++lemma M4_type_IP: "c_type_IP M4" by (simp add: c_type_IP_def IP4_def)+lemma M4_sco_IP: "c_sco_IP M4" by (simp add: c_sco_IP_def IP4_def)+lemma M4_spo_IP: "c_spo_IP M4" by (simp add: c_spo_IP_def IP4_def)++lemma M4_sco_fwd: "c_sco_fwd M4"+ unfolding c_sco_fwd_def by (auto simp: Sco4_def)++lemma M4_sco_trans: "c_sco_trans M4"+ unfolding c_sco_trans_def by (auto simp: Sco4_def)++lemma M4_spo_fwd: "c_spo_fwd M4"+ unfolding c_spo_fwd_def by (auto simp: M4_tables)++lemma M4_spo_trans: "c_spo_trans M4"+ unfolding c_spo_trans_def by (auto simp: Spo4_def)++lemma M4_dom_fwd: "c_dom_fwd M4"+ unfolding c_dom_fwd_def by (auto simp: M4_tables)++lemma M4_rng_fwd: "c_rng_fwd M4"+ unfolding c_rng_fwd_def by (auto simp: M4_tables)++(* RBS Table 5.9 row 1 is an iff whose right-hand side is a1 = a2, so the extension of+ owl:sameAs in a conforming interpretation is exactly the diagonal on IR. Id is that+ diagonal, since IR M4 is the whole carrier. *)+lemma M4_sameAs_fwd: "c_sameAs_fwd M4" unfolding c_sameAs_fwd_def by simp++lemma M4_eqc_fwd: "c_eqc_fwd M4"+ unfolding c_eqc_fwd_def by (auto simp: Eqc4_def)++lemma M4_eqp_fwd: "c_eqp_fwd M4"+ unfolding c_eqp_fwd_def by (auto simp: Eqp4_def P1_4_def Q4_def IP4_def)++lemma M4_inv_fwd: "c_inv_fwd M4"+ unfolding c_inv_fwd_def by (auto simp: Inv4_def P1_4_def R4_def IP4_def)++lemma M4_sym_fwd: "c_sym_fwd M4"+ unfolding c_sym_fwd_def by (auto simp: Sy4_def)++lemma M4_trp_fwd: "c_trp_fwd M4"+ unfolding c_trp_fwd_def by (auto simp: Tr4_def)++(* The three rows of RBS Table 5.6. Each class extension on the left is FORCED by the+ row, and the proof is the check that the value written into Ty4 is the forced one. *)+lemma M4_svf: "c_svf M4"+ unfolding c_svf_def by (auto simp: Svf4_def Onp4_def P1_4_def P2_4_def)++lemma M4_avf: "c_avf M4"+ unfolding c_avf_def by (auto simp: Avf4_def Onp4_def P1_4_def P2_4_def)++lemma M4_hv: "c_hv M4"+ unfolding c_hv_def by (auto simp: Hv4_def Onp4_def P2_4_def)++lemma M4_restr_IC: "c_restr_IC M4" unfolding c_restr_IC_def by simp++lemma M4_svf_typ: "c_svf_typ M4"+ unfolding c_svf_typ_def by (auto simp: Svf4_def)++lemma M4_avf_typ: "c_avf_typ M4"+ unfolding c_avf_typ_def by (auto simp: Avf4_def)++lemma M4_onp_typ: "c_onp_typ M4"+ unfolding c_onp_typ_def by (auto simp: Onp4_def IP4_def)++(* The four BACKWARD halves of RBS Table 5.8. These are the expensive ones, because+ each quantifies over IC or IP twice and demands a set inclusion, and with nineteen+ properties in IP a blind case analysis is 361 inclusion tests over tables of up to a+ hundred and twenty pairs. The proofs below do it in nineteen cases instead: from the+ inclusion hypothesis they take ONE pair (or, where one does not separate enough, two)+ out of the source's own table, push it through the hypothesis, and let the resulting+ membership decide which targets are possible. The witnesses are not guesses; they+ were computed so that the set of targets they admit is EXACTLY the row of the table+ being proved, which is why each case closes with a single auto. *)+lemma M4_sco_bwd: "c_sco_bwd M4"+ unfolding c_sco_bwd_def+proof (intro allI impI)+ fix c1 c2 :: E4+ assume a1: "c1 \<in> IC M4" and a2: "c2 \<in> IC M4"+ and sub: "ICEXT M4 c1 \<subseteq> ICEXT M4 c2"+ from a1 consider "c1 = ClA2"+ | "c1 = ClC1"+ | "c1 = ClC2"+ | "c1 = ClS1"+ | "c1 = ClS2"+ | "c1 = ClS3"+ | "c1 = ClY"+ by (auto simp: IC_def)+ then show "(c1, c2) \<in> IEXT M4 (IS M4 rdfs_subClassOf)"+ proof cases+ case 1+ from 1 sub have s: "ICEXT M4 ClA2 \<subseteq> ICEXT M4 c2" by simp+ from s have w1: "Alice \<in> ICEXT M4 c2" by auto+ from s have w2: "VAvf \<in> ICEXT M4 c2" by auto+ show ?thesis using 1 a2 w1 w2 by (auto simp: Sco4_def)+ next+ case 2+ from 2 sub have s: "ICEXT M4 ClC1 \<subseteq> ICEXT M4 c2" by simp+ from s have w1: "Alice \<in> ICEXT M4 c2" by auto+ from s have w2: "VAvf \<in> ICEXT M4 c2" by auto+ show ?thesis using 2 a2 w1 w2 by (auto simp: Sco4_def)+ next+ case 3+ from 3 sub have s: "ICEXT M4 ClC2 \<subseteq> ICEXT M4 c2" by simp+ from s have w1: "VAvf \<in> ICEXT M4 c2" by auto+ show ?thesis using 3 a2 w1 by (auto simp: Sco4_def)+ next+ case 4+ from 4 sub have s: "ICEXT M4 ClS1 \<subseteq> ICEXT M4 c2" by simp+ from s have w1: "Alice \<in> ICEXT M4 c2" by auto+ show ?thesis using 4 a2 w1 by (auto simp: Sco4_def)+ next+ case 5+ from 5 sub have s: "ICEXT M4 ClS2 \<subseteq> ICEXT M4 c2" by simp+ from s have w1: "Alice \<in> ICEXT M4 c2" by auto+ show ?thesis using 5 a2 w1 by (auto simp: Sco4_def)+ next+ case 6+ from 6 sub have s: "ICEXT M4 ClS3 \<subseteq> ICEXT M4 c2" by simp+ from s have w1: "Alice \<in> ICEXT M4 c2" by auto+ show ?thesis using 6 a2 w1 by (auto simp: Sco4_def)+ next+ case 7+ from 7 sub have s: "ICEXT M4 ClY \<subseteq> ICEXT M4 c2" by simp+ from s have w1: "Carl \<in> ICEXT M4 c2" by auto+ show ?thesis using 7 a2 w1 by (auto simp: Sco4_def)+ qed+qed++lemma M4_spo_bwd: "c_spo_bwd M4"+ unfolding c_spo_bwd_def+proof (intro allI impI)+ fix p1 p2 :: E4+ assume a1: "p1 \<in> IP M4" and a2: "p2 \<in> IP M4"+ and sub: "IEXT M4 p1 \<subseteq> IEXT M4 p2"+ from a1 consider "p1 = VAvf"+ | "p1 = VDom"+ | "p1 = VEqc"+ | "p1 = VEqp"+ | "p1 = VHas"+ | "p1 = VInv"+ | "p1 = VOnp"+ | "p1 = PrP1"+ | "p1 = PrP2"+ | "p1 = PrQ"+ | "p1 = PrR"+ | "p1 = VRng"+ | "p1 = VSame"+ | "p1 = VSco"+ | "p1 = VSpo"+ | "p1 = VSvf"+ | "p1 = PrSym"+ | "p1 = PrTrans"+ | "p1 = VType"+ by (auto simp: IP4_def)+ then show "(p1, p2) \<in> IEXT M4 (IS M4 rdfs_subPropertyOf)"+ proof cases+ case 1+ from 1 sub have s: "ext4 VAvf \<subseteq> ext4 p2" by simp+ have m1: "(ClC1, ClY) \<in> ext4 VAvf" by (simp add: Avf4_def)+ from s m1 have w1: "(ClC1, ClY) \<in> ext4 p2" by blast+ show ?thesis using 1 a2 w1 by (auto simp: M4_tables)+ next+ case 2+ from 2 sub have s: "ext4 VDom \<subseteq> ext4 p2" by simp+ have m1: "(PrP1, ClS1) \<in> ext4 VDom" by (simp add: Dm4_def)+ from s m1 have w1: "(PrP1, ClS1) \<in> ext4 p2" by blast+ show ?thesis using 2 a2 w1 by (auto simp: M4_tables)+ next+ case 3+ from 3 sub have s: "ext4 VEqc \<subseteq> ext4 p2" by simp+ have m1: "(ClS1, ClS2) \<in> ext4 VEqc" by (simp add: Eqc4_def)+ from s m1 have w1: "(ClS1, ClS2) \<in> ext4 p2" by blast+ show ?thesis using 3 a2 w1 by (auto simp: M4_tables)+ next+ case 4+ from 4 sub have s: "ext4 VEqp \<subseteq> ext4 p2" by simp+ have m1: "(PrP1, PrQ) \<in> ext4 VEqp" by (simp add: Eqp4_def)+ from s m1 have w1: "(PrP1, PrQ) \<in> ext4 p2" by blast+ show ?thesis using 4 a2 w1 by (auto simp: M4_tables)+ next+ case 5+ from 5 sub have s: "ext4 VHas \<subseteq> ext4 p2" by simp+ have m1: "(ClS1, Bob) \<in> ext4 VHas" by (simp add: Hv4_def)+ from s m1 have w1: "(ClS1, Bob) \<in> ext4 p2" by blast+ show ?thesis using 5 a2 w1 by (auto simp: M4_tables)+ next+ case 6+ from 6 sub have s: "ext4 VInv \<subseteq> ext4 p2" by simp+ have m1: "(PrP1, PrR) \<in> ext4 VInv" by (simp add: Inv4_def)+ from s m1 have w1: "(PrP1, PrR) \<in> ext4 p2" by blast+ show ?thesis using 6 a2 w1 by (auto simp: M4_tables)+ next+ case 7+ from 7 sub have s: "ext4 VOnp \<subseteq> ext4 p2" by simp+ have m1: "(ClA2, PrP2) \<in> ext4 VOnp" by (simp add: Onp4_def)+ from s m1 have w1: "(ClA2, PrP2) \<in> ext4 p2" by blast+ show ?thesis using 7 a2 w1 by (auto simp: M4_tables)+ next+ case 8+ from 8 sub have s: "ext4 PrP1 \<subseteq> ext4 p2" by simp+ have m1: "(Alice, Carl) \<in> ext4 PrP1" by (simp add: P1_4_def)+ from s m1 have w1: "(Alice, Carl) \<in> ext4 p2" by blast+ show ?thesis using 8 a2 w1 by (auto simp: M4_tables)+ next+ case 9+ from 9 sub have s: "ext4 PrP2 \<subseteq> ext4 p2" by simp+ have m1: "(Alice, Bob) \<in> ext4 PrP2" by (simp add: P2_4_def)+ from s m1 have w1: "(Alice, Bob) \<in> ext4 p2" by blast+ show ?thesis using 9 a2 w1 by (auto simp: M4_tables)+ next+ case 10+ from 10 sub have s: "ext4 PrQ \<subseteq> ext4 p2" by simp+ have m1: "(Alice, Carl) \<in> ext4 PrQ" by (simp add: Q4_def)+ from s m1 have w1: "(Alice, Carl) \<in> ext4 p2" by blast+ show ?thesis using 10 a2 w1 by (auto simp: M4_tables)+ next+ case 11+ from 11 sub have s: "ext4 PrR \<subseteq> ext4 p2" by simp+ have m1: "(Carl, Alice) \<in> ext4 PrR" by (simp add: R4_def)+ from s m1 have w1: "(Carl, Alice) \<in> ext4 p2" by blast+ show ?thesis using 11 a2 w1 by (auto simp: M4_tables)+ next+ case 12+ from 12 sub have s: "ext4 VRng \<subseteq> ext4 p2" by simp+ have m1: "(PrP1, ClY) \<in> ext4 VRng" by (simp add: Rg4_def)+ from s m1 have w1: "(PrP1, ClY) \<in> ext4 p2" by blast+ show ?thesis using 12 a2 w1 by (auto simp: M4_tables)+ next+ case 13+ from 13 sub have s: "ext4 VSame \<subseteq> ext4 p2" by simp+ have m1: "(Alice, Alice) \<in> ext4 VSame" by (simp)+ from s m1 have w1: "(Alice, Alice) \<in> ext4 p2" by blast+ show ?thesis using 13 a2 w1 by (auto simp: M4_tables)+ next+ case 14+ from 14 sub have s: "ext4 VSco \<subseteq> ext4 p2" by simp+ have m1: "(ClS1, ClS3) \<in> ext4 VSco" by (simp add: Sco4_def)+ from s m1 have w1: "(ClS1, ClS3) \<in> ext4 p2" by blast+ show ?thesis using 14 a2 w1 by (auto simp: M4_tables)+ next+ case 15+ from 15 sub have s: "ext4 VSpo \<subseteq> ext4 p2" by simp+ have m1: "(VEqc, VSco) \<in> ext4 VSpo" by (simp add: Spo4_def)+ from s m1 have w1: "(VEqc, VSco) \<in> ext4 p2" by blast+ show ?thesis using 15 a2 w1 by (auto simp: M4_tables)+ next+ case 16+ from 16 sub have s: "ext4 VSvf \<subseteq> ext4 p2" by simp+ have m1: "(ClS1, ClY) \<in> ext4 VSvf" by (simp add: Svf4_def)+ from s m1 have w1: "(ClS1, ClY) \<in> ext4 p2" by blast+ show ?thesis using 16 a2 w1 by (auto simp: M4_tables)+ next+ case 17+ from 17 sub have s: "ext4 PrSym \<subseteq> ext4 p2" by simp+ have m1: "(Carl, Bob) \<in> ext4 PrSym" by (simp add: Sy4_def)+ from s m1 have w1: "(Carl, Bob) \<in> ext4 p2" by blast+ show ?thesis using 17 a2 w1 by (auto simp: M4_tables)+ next+ case 18+ from 18 sub have s: "ext4 PrTrans \<subseteq> ext4 p2" by simp+ have m1: "(Alice, Bob) \<in> ext4 PrTrans" by (simp add: Tr4_def)+ from s m1 have w1: "(Alice, Bob) \<in> ext4 p2" by blast+ have m2: "(Bob, Carl) \<in> ext4 PrTrans" by (simp add: Tr4_def)+ from s m2 have w2: "(Bob, Carl) \<in> ext4 p2" by blast+ show ?thesis using 18 a2 w1 w2 by (auto simp: M4_tables)+ next+ case 19+ from 19 sub have s: "ext4 VType \<subseteq> ext4 p2" by simp+ have m1: "(Alice, ClA2) \<in> ext4 VType" by (simp add: Ty4_def)+ from s m1 have w1: "(Alice, ClA2) \<in> ext4 p2" by blast+ show ?thesis using 19 a2 w1 by (auto simp: M4_tables)+ qed+qed++lemma M4_dom_bwd: "c_dom_bwd M4"+ unfolding c_dom_bwd_def+proof (intro allI impI)+ fix p c :: E4+ assume a1: "p \<in> IP M4" and a2: "c \<in> IC M4"+ and h: "\<forall>x y. (x,y) \<in> IEXT M4 p \<longrightarrow> x \<in> ICEXT M4 c"+ from a1 consider "p = VAvf"+ | "p = VDom"+ | "p = VEqc"+ | "p = VEqp"+ | "p = VHas"+ | "p = VInv"+ | "p = VOnp"+ | "p = PrP1"+ | "p = PrP2"+ | "p = PrQ"+ | "p = PrR"+ | "p = VRng"+ | "p = VSame"+ | "p = VSco"+ | "p = VSpo"+ | "p = VSvf"+ | "p = PrSym"+ | "p = PrTrans"+ | "p = VType"+ by (auto simp: IP4_def)+ then show "(p, c) \<in> IEXT M4 (IS M4 rdfs_domain)"+ proof cases+ case 1+ from 1 h have h1: "\<forall>x y. (x,y) \<in> ext4 VAvf \<longrightarrow> x \<in> ICEXT M4 c"+ by simp+ have m1: "(ClA2, ClC1) \<in> ext4 VAvf" by (simp add: Avf4_def)+ from h1 m1 have w1: "ClA2 \<in> ICEXT M4 c" by blast+ show ?thesis using 1 a2 w1 by (auto simp: Dm4_def)+ next+ case 2+ from 2 h have h1: "\<forall>x y. (x,y) \<in> ext4 VDom \<longrightarrow> x \<in> ICEXT M4 c"+ by simp+ have m1: "(VAvf, ClA2) \<in> ext4 VDom" by (simp add: Dm4_def)+ from h1 m1 have w1: "VAvf \<in> ICEXT M4 c" by blast+ show ?thesis using 2 a2 w1 by (auto simp: Dm4_def)+ next+ case 3+ from 3 h have h1: "\<forall>x y. (x,y) \<in> ext4 VEqc \<longrightarrow> x \<in> ICEXT M4 c"+ by simp+ have m1: "(ClA2, ClC1) \<in> ext4 VEqc" by (simp add: Eqc4_def)+ from h1 m1 have w1: "ClA2 \<in> ICEXT M4 c" by blast+ show ?thesis using 3 a2 w1 by (auto simp: Dm4_def)+ next+ case 4+ from 4 h have h1: "\<forall>x y. (x,y) \<in> ext4 VEqp \<longrightarrow> x \<in> ICEXT M4 c"+ by simp+ have m1: "(PrP1, PrQ) \<in> ext4 VEqp" by (simp add: Eqp4_def)+ from h1 m1 have w1: "PrP1 \<in> ICEXT M4 c" by blast+ show ?thesis using 4 a2 w1 by (auto simp: Dm4_def)+ next+ case 5+ from 5 h have h1: "\<forall>x y. (x,y) \<in> ext4 VHas \<longrightarrow> x \<in> ICEXT M4 c"+ by simp+ have m1: "(ClS1, Bob) \<in> ext4 VHas" by (simp add: Hv4_def)+ from h1 m1 have w1: "ClS1 \<in> ICEXT M4 c" by blast+ show ?thesis using 5 a2 w1 by (auto simp: Dm4_def)+ next+ case 6+ from 6 h have h1: "\<forall>x y. (x,y) \<in> ext4 VInv \<longrightarrow> x \<in> ICEXT M4 c"+ by simp+ have m1: "(PrP1, PrR) \<in> ext4 VInv" by (simp add: Inv4_def)+ from h1 m1 have w1: "PrP1 \<in> ICEXT M4 c" by blast+ show ?thesis using 6 a2 w1 by (auto simp: Dm4_def)+ next+ case 7+ from 7 h have h1: "\<forall>x y. (x,y) \<in> ext4 VOnp \<longrightarrow> x \<in> ICEXT M4 c"+ by simp+ have m1: "(ClA2, PrP2) \<in> ext4 VOnp" by (simp add: Onp4_def)+ from h1 m1 have w1: "ClA2 \<in> ICEXT M4 c" by blast+ show ?thesis using 7 a2 w1 by (auto simp: Dm4_def)+ next+ case 8+ from 8 h have h1: "\<forall>x y. (x,y) \<in> ext4 PrP1 \<longrightarrow> x \<in> ICEXT M4 c"+ by simp+ have m1: "(Alice, Carl) \<in> ext4 PrP1" by (simp add: P1_4_def)+ from h1 m1 have w1: "Alice \<in> ICEXT M4 c" by blast+ show ?thesis using 8 a2 w1 by (auto simp: Dm4_def)+ next+ case 9+ from 9 h have h1: "\<forall>x y. (x,y) \<in> ext4 PrP2 \<longrightarrow> x \<in> ICEXT M4 c"+ by simp+ have m1: "(Alice, Bob) \<in> ext4 PrP2" by (simp add: P2_4_def)+ from h1 m1 have w1: "Alice \<in> ICEXT M4 c" by blast+ show ?thesis using 9 a2 w1 by (auto simp: Dm4_def)+ next+ case 10+ from 10 h have h1: "\<forall>x y. (x,y) \<in> ext4 PrQ \<longrightarrow> x \<in> ICEXT M4 c"+ by simp+ have m1: "(Alice, Carl) \<in> ext4 PrQ" by (simp add: Q4_def)+ from h1 m1 have w1: "Alice \<in> ICEXT M4 c" by blast+ show ?thesis using 10 a2 w1 by (auto simp: Dm4_def)+ next+ case 11+ from 11 h have h1: "\<forall>x y. (x,y) \<in> ext4 PrR \<longrightarrow> x \<in> ICEXT M4 c"+ by simp+ have m1: "(Carl, Alice) \<in> ext4 PrR" by (simp add: R4_def)+ from h1 m1 have w1: "Carl \<in> ICEXT M4 c" by blast+ show ?thesis using 11 a2 w1 by (auto simp: Dm4_def)+ next+ case 12+ from 12 h have h1: "\<forall>x y. (x,y) \<in> ext4 VRng \<longrightarrow> x \<in> ICEXT M4 c"+ by simp+ have m1: "(VAvf, ClA2) \<in> ext4 VRng" by (simp add: Rg4_def)+ from h1 m1 have w1: "VAvf \<in> ICEXT M4 c" by blast+ show ?thesis using 12 a2 w1 by (auto simp: Dm4_def)+ next+ case 13+ from 13 h have h1: "\<forall>x y. (x,y) \<in> ext4 VSame \<longrightarrow> x \<in> ICEXT M4 c"+ by simp+ have m1: "(Alice, Alice) \<in> ext4 VSame" by (simp)+ from h1 m1 have w1: "Alice \<in> ICEXT M4 c" by blast+ have m2: "(VAvf, VAvf) \<in> ext4 VSame" by (simp)+ from h1 m2 have w2: "VAvf \<in> ICEXT M4 c" by blast+ show ?thesis using 13 a2 w1 w2 by (auto simp: Dm4_def)+ next+ case 14+ from 14 h have h1: "\<forall>x y. (x,y) \<in> ext4 VSco \<longrightarrow> x \<in> ICEXT M4 c"+ by simp+ have m1: "(ClA2, ClA2) \<in> ext4 VSco" by (simp add: Sco4_def)+ from h1 m1 have w1: "ClA2 \<in> ICEXT M4 c" by blast+ show ?thesis using 14 a2 w1 by (auto simp: Dm4_def)+ next+ case 15+ from 15 h have h1: "\<forall>x y. (x,y) \<in> ext4 VSpo \<longrightarrow> x \<in> ICEXT M4 c"+ by simp+ have m1: "(VAvf, VAvf) \<in> ext4 VSpo" by (simp add: Spo4_def)+ from h1 m1 have w1: "VAvf \<in> ICEXT M4 c" by blast+ show ?thesis using 15 a2 w1 by (auto simp: Dm4_def)+ next+ case 16+ from 16 h have h1: "\<forall>x y. (x,y) \<in> ext4 VSvf \<longrightarrow> x \<in> ICEXT M4 c"+ by simp+ have m1: "(ClS1, ClY) \<in> ext4 VSvf" by (simp add: Svf4_def)+ from h1 m1 have w1: "ClS1 \<in> ICEXT M4 c" by blast+ show ?thesis using 16 a2 w1 by (auto simp: Dm4_def)+ next+ case 17+ from 17 h have h1: "\<forall>x y. (x,y) \<in> ext4 PrSym \<longrightarrow> x \<in> ICEXT M4 c"+ by simp+ have m1: "(Bob, Carl) \<in> ext4 PrSym" by (simp add: Sy4_def)+ from h1 m1 have w1: "Bob \<in> ICEXT M4 c" by blast+ show ?thesis using 17 a2 w1 by (auto simp: Dm4_def)+ next+ case 18+ from 18 h have h1: "\<forall>x y. (x,y) \<in> ext4 PrTrans \<longrightarrow> x \<in> ICEXT M4 c"+ by simp+ have m1: "(Alice, Bob) \<in> ext4 PrTrans" by (simp add: Tr4_def)+ from h1 m1 have w1: "Alice \<in> ICEXT M4 c" by blast+ have m2: "(Bob, Carl) \<in> ext4 PrTrans" by (simp add: Tr4_def)+ from h1 m2 have w2: "Bob \<in> ICEXT M4 c" by blast+ show ?thesis using 18 a2 w1 w2 by (auto simp: Dm4_def)+ next+ case 19+ from 19 h have h1: "\<forall>x y. (x,y) \<in> ext4 VType \<longrightarrow> x \<in> ICEXT M4 c"+ by simp+ have m1: "(Alice, ClA2) \<in> ext4 VType" by (simp add: Ty4_def)+ from h1 m1 have w1: "Alice \<in> ICEXT M4 c" by blast+ have m2: "(VAvf, ClA2) \<in> ext4 VType" by (simp add: Ty4_def)+ from h1 m2 have w2: "VAvf \<in> ICEXT M4 c" by blast+ show ?thesis using 19 a2 w1 w2 by (auto simp: Dm4_def)+ qed+qed++lemma M4_rng_bwd: "c_rng_bwd M4"+ unfolding c_rng_bwd_def+proof (intro allI impI)+ fix p c :: E4+ assume a1: "p \<in> IP M4" and a2: "c \<in> IC M4"+ and h: "\<forall>x y. (x,y) \<in> IEXT M4 p \<longrightarrow> y \<in> ICEXT M4 c"+ from a1 consider "p = VAvf"+ | "p = VDom"+ | "p = VEqc"+ | "p = VEqp"+ | "p = VHas"+ | "p = VInv"+ | "p = VOnp"+ | "p = PrP1"+ | "p = PrP2"+ | "p = PrQ"+ | "p = PrR"+ | "p = VRng"+ | "p = VSame"+ | "p = VSco"+ | "p = VSpo"+ | "p = VSvf"+ | "p = PrSym"+ | "p = PrTrans"+ | "p = VType"+ by (auto simp: IP4_def)+ then show "(p, c) \<in> IEXT M4 (IS M4 rdfs_range)"+ proof cases+ case 1+ from 1 h have h1: "\<forall>x y. (x,y) \<in> ext4 VAvf \<longrightarrow> y \<in> ICEXT M4 c"+ by simp+ have m1: "(ClA2, ClC1) \<in> ext4 VAvf" by (simp add: Avf4_def)+ from h1 m1 have w1: "ClC1 \<in> ICEXT M4 c" by blast+ show ?thesis using 1 a2 w1 by (auto simp: Rg4_def)+ next+ case 2+ from 2 h have h1: "\<forall>x y. (x,y) \<in> ext4 VDom \<longrightarrow> y \<in> ICEXT M4 c"+ by simp+ have m1: "(VAvf, ClA2) \<in> ext4 VDom" by (simp add: Dm4_def)+ from h1 m1 have w1: "ClA2 \<in> ICEXT M4 c" by blast+ show ?thesis using 2 a2 w1 by (auto simp: Rg4_def)+ next+ case 3+ from 3 h have h1: "\<forall>x y. (x,y) \<in> ext4 VEqc \<longrightarrow> y \<in> ICEXT M4 c"+ by simp+ have m1: "(ClC1, ClA2) \<in> ext4 VEqc" by (simp add: Eqc4_def)+ from h1 m1 have w1: "ClA2 \<in> ICEXT M4 c" by blast+ show ?thesis using 3 a2 w1 by (auto simp: Rg4_def)+ next+ case 4+ from 4 h have h1: "\<forall>x y. (x,y) \<in> ext4 VEqp \<longrightarrow> y \<in> ICEXT M4 c"+ by simp+ have m1: "(PrQ, PrP1) \<in> ext4 VEqp" by (simp add: Eqp4_def)+ from h1 m1 have w1: "PrP1 \<in> ICEXT M4 c" by blast+ show ?thesis using 4 a2 w1 by (auto simp: Rg4_def)+ next+ case 5+ from 5 h have h1: "\<forall>x y. (x,y) \<in> ext4 VHas \<longrightarrow> y \<in> ICEXT M4 c"+ by simp+ have m1: "(ClS1, Bob) \<in> ext4 VHas" by (simp add: Hv4_def)+ from h1 m1 have w1: "Bob \<in> ICEXT M4 c" by blast+ show ?thesis using 5 a2 w1 by (auto simp: Rg4_def)+ next+ case 6+ from 6 h have h1: "\<forall>x y. (x,y) \<in> ext4 VInv \<longrightarrow> y \<in> ICEXT M4 c"+ by simp+ have m1: "(PrP1, PrR) \<in> ext4 VInv" by (simp add: Inv4_def)+ from h1 m1 have w1: "PrR \<in> ICEXT M4 c" by blast+ show ?thesis using 6 a2 w1 by (auto simp: Rg4_def)+ next+ case 7+ from 7 h have h1: "\<forall>x y. (x,y) \<in> ext4 VOnp \<longrightarrow> y \<in> ICEXT M4 c"+ by simp+ have m1: "(ClC1, PrP1) \<in> ext4 VOnp" by (simp add: Onp4_def)+ from h1 m1 have w1: "PrP1 \<in> ICEXT M4 c" by blast+ show ?thesis using 7 a2 w1 by (auto simp: Rg4_def)+ next+ case 8+ from 8 h have h1: "\<forall>x y. (x,y) \<in> ext4 PrP1 \<longrightarrow> y \<in> ICEXT M4 c"+ by simp+ have m1: "(Alice, Carl) \<in> ext4 PrP1" by (simp add: P1_4_def)+ from h1 m1 have w1: "Carl \<in> ICEXT M4 c" by blast+ show ?thesis using 8 a2 w1 by (auto simp: Rg4_def)+ next+ case 9+ from 9 h have h1: "\<forall>x y. (x,y) \<in> ext4 PrP2 \<longrightarrow> y \<in> ICEXT M4 c"+ by simp+ have m1: "(Alice, Bob) \<in> ext4 PrP2" by (simp add: P2_4_def)+ from h1 m1 have w1: "Bob \<in> ICEXT M4 c" by blast+ show ?thesis using 9 a2 w1 by (auto simp: Rg4_def)+ next+ case 10+ from 10 h have h1: "\<forall>x y. (x,y) \<in> ext4 PrQ \<longrightarrow> y \<in> ICEXT M4 c"+ by simp+ have m1: "(Alice, Carl) \<in> ext4 PrQ" by (simp add: Q4_def)+ from h1 m1 have w1: "Carl \<in> ICEXT M4 c" by blast+ show ?thesis using 10 a2 w1 by (auto simp: Rg4_def)+ next+ case 11+ from 11 h have h1: "\<forall>x y. (x,y) \<in> ext4 PrR \<longrightarrow> y \<in> ICEXT M4 c"+ by simp+ have m1: "(Carl, Alice) \<in> ext4 PrR" by (simp add: R4_def)+ from h1 m1 have w1: "Alice \<in> ICEXT M4 c" by blast+ show ?thesis using 11 a2 w1 by (auto simp: Rg4_def)+ next+ case 12+ from 12 h have h1: "\<forall>x y. (x,y) \<in> ext4 VRng \<longrightarrow> y \<in> ICEXT M4 c"+ by simp+ have m1: "(VAvf, ClA2) \<in> ext4 VRng" by (simp add: Rg4_def)+ from h1 m1 have w1: "ClA2 \<in> ICEXT M4 c" by blast+ show ?thesis using 12 a2 w1 by (auto simp: Rg4_def)+ next+ case 13+ from 13 h have h1: "\<forall>x y. (x,y) \<in> ext4 VSame \<longrightarrow> y \<in> ICEXT M4 c"+ by simp+ have m1: "(Alice, Alice) \<in> ext4 VSame" by (simp)+ from h1 m1 have w1: "Alice \<in> ICEXT M4 c" by blast+ have m2: "(VAvf, VAvf) \<in> ext4 VSame" by (simp)+ from h1 m2 have w2: "VAvf \<in> ICEXT M4 c" by blast+ show ?thesis using 13 a2 w1 w2 by (auto simp: Rg4_def)+ next+ case 14+ from 14 h have h1: "\<forall>x y. (x,y) \<in> ext4 VSco \<longrightarrow> y \<in> ICEXT M4 c"+ by simp+ have m1: "(ClA2, ClA2) \<in> ext4 VSco" by (simp add: Sco4_def)+ from h1 m1 have w1: "ClA2 \<in> ICEXT M4 c" by blast+ show ?thesis using 14 a2 w1 by (auto simp: Rg4_def)+ next+ case 15+ from 15 h have h1: "\<forall>x y. (x,y) \<in> ext4 VSpo \<longrightarrow> y \<in> ICEXT M4 c"+ by simp+ have m1: "(VAvf, VAvf) \<in> ext4 VSpo" by (simp add: Spo4_def)+ from h1 m1 have w1: "VAvf \<in> ICEXT M4 c" by blast+ show ?thesis using 15 a2 w1 by (auto simp: Rg4_def)+ next+ case 16+ from 16 h have h1: "\<forall>x y. (x,y) \<in> ext4 VSvf \<longrightarrow> y \<in> ICEXT M4 c"+ by simp+ have m1: "(ClS2, ClC1) \<in> ext4 VSvf" by (simp add: Svf4_def)+ from h1 m1 have w1: "ClC1 \<in> ICEXT M4 c" by blast+ show ?thesis using 16 a2 w1 by (auto simp: Rg4_def)+ next+ case 17+ from 17 h have h1: "\<forall>x y. (x,y) \<in> ext4 PrSym \<longrightarrow> y \<in> ICEXT M4 c"+ by simp+ have m1: "(Carl, Bob) \<in> ext4 PrSym" by (simp add: Sy4_def)+ from h1 m1 have w1: "Bob \<in> ICEXT M4 c" by blast+ show ?thesis using 17 a2 w1 by (auto simp: Rg4_def)+ next+ case 18+ from 18 h have h1: "\<forall>x y. (x,y) \<in> ext4 PrTrans \<longrightarrow> y \<in> ICEXT M4 c"+ by simp+ have m1: "(Alice, Bob) \<in> ext4 PrTrans" by (simp add: Tr4_def)+ from h1 m1 have w1: "Bob \<in> ICEXT M4 c" by blast+ show ?thesis using 18 a2 w1 by (auto simp: Rg4_def)+ next+ case 19+ from 19 h have h1: "\<forall>x y. (x,y) \<in> ext4 VType \<longrightarrow> y \<in> ICEXT M4 c"+ by simp+ have m1: "(Alice, ClA2) \<in> ext4 VType" by (simp add: Ty4_def)+ from h1 m1 have w1: "ClA2 \<in> ICEXT M4 c" by blast+ show ?thesis using 19 a2 w1 by (auto simp: Rg4_def)+ qed+qed+++theorem M4_is_a_model: "owl_rl_interp M4"+ unfolding owl_rl_interp_def+ by (simp add: M4_type_IP M4_sco_IP M4_spo_IP M4_sco_fwd M4_sco_bwd+ M4_spo_fwd M4_spo_bwd M4_sco_trans M4_spo_trans+ M4_dom_fwd M4_dom_bwd M4_rng_fwd M4_rng_bwd+ M4_sameAs_fwd M4_eqc_fwd M4_eqp_fwd M4_inv_fwd M4_sym_fwd M4_trp_fwd+ M4_svf M4_avf M4_hv M4_restr_IC M4_svf_typ M4_avf_typ M4_onp_typ)++(* The Table 5.1 domain conditions, so M4 also witnesses satisfiability for the bridge+ theorem T4, exactly as M3 does. *)+theorem M4_wf: "wf_interp M4" by (simp add: wf_interp_def)++subsection \<open>Every condition has a SATISFIED ANTECEDENT\<close>++(* The point of this block. owl_rl_interp M4 alone is worth about as much as+ owl_rl_interp W: a condition of the form "for all x in S, P x" is true when S is+ empty, and fifteen of the twenty-six are true in M3 for exactly that reason. Each+ lemma below exhibits something IN the extension the corresponding condition reads, so+ that the condition is doing work. The three IP conditions have no antecedent to+ satisfy, so what is exhibited for them is that the element they put in IP has a pair+ in its extension, which is the property that makes the membership consequential.++ Where a condition's antecedent is itself an inclusion that could hold for want of+ anything to check -- c_sco_bwd, c_spo_bwd, c_dom_bwd and c_rng_bwd -- the lemma+ exhibits the whole antecedent AND a member of the set being included, so that the+ inclusion is not the empty one. *)++lemma M4_ante_type_IP:+ "IS M4 rdf_type \<in> IP M4 \<and> (Carl, ClY) \<in> IEXT M4 (IS M4 rdf_type)"+ by (simp add: IP4_def Ty4_def)++lemma M4_ante_sco_IP:+ "IS M4 rdfs_subClassOf \<in> IP M4+ \<and> (ClY, ClC2) \<in> IEXT M4 (IS M4 rdfs_subClassOf)"+ by (simp add: IP4_def Sco4_def)++lemma M4_ante_spo_IP:+ "IS M4 rdfs_subPropertyOf \<in> IP M4+ \<and> (PrP1, PrP2) \<in> IEXT M4 (IS M4 rdfs_subPropertyOf)"+ by (simp add: IP4_def Spo4_def)++lemma M4_ante_sco_fwd:+ "(ClY, ClC2) \<in> IEXT M4 (IS M4 rdfs_subClassOf) \<and> Carl \<in> ICEXT M4 ClY"+ by (simp add: Sco4_def)++lemma M4_ante_sco_bwd:+ "ClY \<in> IC M4 \<and> ClC2 \<in> IC M4 \<and> ICEXT M4 ClY \<subseteq> ICEXT M4 ClC2+ \<and> Carl \<in> ICEXT M4 ClY"+ by simp++lemma M4_ante_spo_fwd:+ "(PrP1, PrP2) \<in> IEXT M4 (IS M4 rdfs_subPropertyOf)+ \<and> (Alice, Carl) \<in> IEXT M4 PrP1"+ by (simp add: Spo4_def P1_4_def)++lemma M4_ante_spo_bwd:+ "PrP1 \<in> IP M4 \<and> PrP2 \<in> IP M4 \<and> IEXT M4 PrP1 \<subseteq> IEXT M4 PrP2+ \<and> (Alice, Carl) \<in> IEXT M4 PrP1"+ by (simp add: IP4_def P1_4_def P2_4_def)++lemma M4_ante_sco_trans:+ "(ClY, ClC2) \<in> IEXT M4 (IS M4 rdfs_subClassOf)+ \<and> (ClC2, ClC1) \<in> IEXT M4 (IS M4 rdfs_subClassOf)+ \<and> ClY \<noteq> ClC2 \<and> ClC2 \<noteq> ClC1"+ by (simp add: Sco4_def)++lemma M4_ante_spo_trans:+ "(PrP1, PrQ) \<in> IEXT M4 (IS M4 rdfs_subPropertyOf)+ \<and> (PrQ, PrP2) \<in> IEXT M4 (IS M4 rdfs_subPropertyOf)+ \<and> PrP1 \<noteq> PrQ \<and> PrQ \<noteq> PrP2"+ by (simp add: Spo4_def)++lemma M4_ante_dom_fwd:+ "(PrP1, ClS1) \<in> IEXT M4 (IS M4 rdfs_domain)+ \<and> (Alice, Carl) \<in> IEXT M4 PrP1"+ by (simp add: Dm4_def P1_4_def)++lemma M4_ante_dom_bwd:+ "PrP1 \<in> IP M4 \<and> ClS1 \<in> IC M4+ \<and> (\<forall>x y. (x,y) \<in> IEXT M4 PrP1 \<longrightarrow> x \<in> ICEXT M4 ClS1)+ \<and> (Alice, Carl) \<in> IEXT M4 PrP1"+ by (simp add: IP4_def P1_4_def)++lemma M4_ante_rng_fwd:+ "(PrP1, ClY) \<in> IEXT M4 (IS M4 rdfs_range) \<and> (Alice, Carl) \<in> IEXT M4 PrP1"+ by (simp add: Rg4_def P1_4_def)++lemma M4_ante_rng_bwd:+ "PrP1 \<in> IP M4 \<and> ClY \<in> IC M4+ \<and> (\<forall>x y. (x,y) \<in> IEXT M4 PrP1 \<longrightarrow> y \<in> ICEXT M4 ClY)+ \<and> (Alice, Carl) \<in> IEXT M4 PrP1"+ by (simp add: IP4_def P1_4_def)++lemma M4_ante_sameAs_fwd: "(Alice, Alice) \<in> IEXT M4 (IS M4 owl_sameAs)"+ by simp++lemma M4_ante_eqc_fwd:+ "(ClS1, ClS2) \<in> IEXT M4 (IS M4 owl_equivalentClass) \<and> ClS1 \<noteq> ClS2+ \<and> Alice \<in> ICEXT M4 ClS1"+ by (simp add: Eqc4_def)++lemma M4_ante_eqp_fwd:+ "(PrP1, PrQ) \<in> IEXT M4 (IS M4 owl_equivalentProperty) \<and> PrP1 \<noteq> PrQ+ \<and> (Alice, Carl) \<in> IEXT M4 PrP1"+ by (simp add: Eqp4_def P1_4_def)++lemma M4_ante_inv_fwd:+ "(PrP1, PrR) \<in> IEXT M4 (IS M4 owl_inverseOf) \<and> PrP1 \<noteq> PrR+ \<and> (Alice, Carl) \<in> IEXT M4 PrP1 \<and> (Carl, Alice) \<in> IEXT M4 PrR"+ by (simp add: Inv4_def P1_4_def R4_def)++lemma M4_ante_sym_fwd:+ "PrSym \<in> ICEXT M4 (IS M4 owl_SymmetricProperty)+ \<and> (Bob, Carl) \<in> IEXT M4 PrSym \<and> (Carl, Bob) \<in> IEXT M4 PrSym"+ by (simp add: Sy4_def)++lemma M4_ante_trp_fwd:+ "PrTrans \<in> ICEXT M4 (IS M4 owl_TransitiveProperty)+ \<and> (Alice, Bob) \<in> IEXT M4 PrTrans \<and> (Bob, Carl) \<in> IEXT M4 PrTrans+ \<and> (Alice, Carl) \<in> IEXT M4 PrTrans"+ by (simp add: Tr4_def)++lemma M4_ante_svf:+ "(ClS1, ClY) \<in> IEXT M4 (IS M4 owl_someValuesFrom)+ \<and> (ClS1, PrP2) \<in> IEXT M4 (IS M4 owl_onProperty)+ \<and> Alice \<in> ICEXT M4 ClS1"+ by (simp add: Svf4_def Onp4_def)++lemma M4_ante_avf:+ "(ClC1, ClY) \<in> IEXT M4 (IS M4 owl_allValuesFrom)+ \<and> (ClC1, PrP1) \<in> IEXT M4 (IS M4 owl_onProperty)+ \<and> Alice \<in> ICEXT M4 ClC1"+ by (simp add: Avf4_def Onp4_def)++lemma M4_ante_hv:+ "(ClS1, Bob) \<in> IEXT M4 (IS M4 owl_hasValue)+ \<and> (ClS1, PrP2) \<in> IEXT M4 (IS M4 owl_onProperty)+ \<and> Alice \<in> ICEXT M4 ClS1"+ by (simp add: Hv4_def Onp4_def)++lemma M4_ante_restr_IC:+ "ClC1 \<in> ICEXT M4 (IS M4 owl_Restriction) \<and> ClC1 \<in> IC M4"+ by simp++lemma M4_ante_svf_typ: "(ClS1, ClY) \<in> IEXT M4 (IS M4 owl_someValuesFrom)"+ by (simp add: Svf4_def)++lemma M4_ante_avf_typ: "(ClC1, ClY) \<in> IEXT M4 (IS M4 owl_allValuesFrom)"+ by (simp add: Avf4_def)++lemma M4_ante_onp_typ: "(ClC1, PrP1) \<in> IEXT M4 (IS M4 owl_onProperty)"+ by (simp add: Onp4_def)++(* The twenty-six, in ONE conjunction, so that a later edit which hollows one of them+ out fails here rather than passing quietly. Twenty-six is the number of conjuncts of+ owl_rl_interp, so neither list can drift from the other without this going red.++ WHY A CONJUNCTION AND NOT "and". The first draft of this theorem used the multiple+ statement form, name: "A" and "B" and "C". Isabelle proves every one of those, but+ it binds only the FIRST to the theorem's name, so @{thm name} in the ML gate of+ OO_Audit sees one conjunct and the other twenty-five are outside the oracle audit.+ Measured, not assumed: a probe reported length 1 for a thirteen-statement theorem.+ The same defect is present in M3_is_not_degenerate above, which is left as it is+ because M3 and everything that depends on it is kept unchanged; the audit therefore+ covers its first statement only. Every collector written for M4 is a conjunction. *)+theorem M4_every_condition_has_a_live_antecedent:+ "(IS M4 rdf_type \<in> IP M4 \<and> (Carl, ClY) \<in> IEXT M4 (IS M4 rdf_type))+ \<and> (IS M4 rdfs_subClassOf \<in> IP M4+ \<and> (ClY, ClC2) \<in> IEXT M4 (IS M4 rdfs_subClassOf))+ \<and> (IS M4 rdfs_subPropertyOf \<in> IP M4+ \<and> (PrP1, PrP2) \<in> IEXT M4 (IS M4 rdfs_subPropertyOf))+ \<and> ((ClY, ClC2) \<in> IEXT M4 (IS M4 rdfs_subClassOf) \<and> Carl \<in> ICEXT M4 ClY)+ \<and> (ClY \<in> IC M4 \<and> ClC2 \<in> IC M4 \<and> ICEXT M4 ClY \<subseteq> ICEXT M4 ClC2+ \<and> Carl \<in> ICEXT M4 ClY)+ \<and> ((PrP1, PrP2) \<in> IEXT M4 (IS M4 rdfs_subPropertyOf)+ \<and> (Alice, Carl) \<in> IEXT M4 PrP1)+ \<and> (PrP1 \<in> IP M4 \<and> PrP2 \<in> IP M4 \<and> IEXT M4 PrP1 \<subseteq> IEXT M4 PrP2+ \<and> (Alice, Carl) \<in> IEXT M4 PrP1)+ \<and> ((ClY, ClC2) \<in> IEXT M4 (IS M4 rdfs_subClassOf)+ \<and> (ClC2, ClC1) \<in> IEXT M4 (IS M4 rdfs_subClassOf)+ \<and> ClY \<noteq> ClC2 \<and> ClC2 \<noteq> ClC1)+ \<and> ((PrP1, PrQ) \<in> IEXT M4 (IS M4 rdfs_subPropertyOf)+ \<and> (PrQ, PrP2) \<in> IEXT M4 (IS M4 rdfs_subPropertyOf)+ \<and> PrP1 \<noteq> PrQ \<and> PrQ \<noteq> PrP2)+ \<and> ((PrP1, ClS1) \<in> IEXT M4 (IS M4 rdfs_domain)+ \<and> (Alice, Carl) \<in> IEXT M4 PrP1)+ \<and> (PrP1 \<in> IP M4 \<and> ClS1 \<in> IC M4+ \<and> (\<forall>x y. (x,y) \<in> IEXT M4 PrP1 \<longrightarrow> x \<in> ICEXT M4 ClS1)+ \<and> (Alice, Carl) \<in> IEXT M4 PrP1)+ \<and> ((PrP1, ClY) \<in> IEXT M4 (IS M4 rdfs_range)+ \<and> (Alice, Carl) \<in> IEXT M4 PrP1)+ \<and> (PrP1 \<in> IP M4 \<and> ClY \<in> IC M4+ \<and> (\<forall>x y. (x,y) \<in> IEXT M4 PrP1 \<longrightarrow> y \<in> ICEXT M4 ClY)+ \<and> (Alice, Carl) \<in> IEXT M4 PrP1)+ \<and> ((Alice, Alice) \<in> IEXT M4 (IS M4 owl_sameAs))+ \<and> ((ClS1, ClS2) \<in> IEXT M4 (IS M4 owl_equivalentClass) \<and> ClS1 \<noteq> ClS2+ \<and> Alice \<in> ICEXT M4 ClS1)+ \<and> ((PrP1, PrQ) \<in> IEXT M4 (IS M4 owl_equivalentProperty) \<and> PrP1 \<noteq> PrQ+ \<and> (Alice, Carl) \<in> IEXT M4 PrP1)+ \<and> ((PrP1, PrR) \<in> IEXT M4 (IS M4 owl_inverseOf) \<and> PrP1 \<noteq> PrR+ \<and> (Alice, Carl) \<in> IEXT M4 PrP1 \<and> (Carl, Alice) \<in> IEXT M4 PrR)+ \<and> (PrSym \<in> ICEXT M4 (IS M4 owl_SymmetricProperty)+ \<and> (Bob, Carl) \<in> IEXT M4 PrSym \<and> (Carl, Bob) \<in> IEXT M4 PrSym)+ \<and> (PrTrans \<in> ICEXT M4 (IS M4 owl_TransitiveProperty)+ \<and> (Alice, Bob) \<in> IEXT M4 PrTrans \<and> (Bob, Carl) \<in> IEXT M4 PrTrans+ \<and> (Alice, Carl) \<in> IEXT M4 PrTrans)+ \<and> ((ClS1, ClY) \<in> IEXT M4 (IS M4 owl_someValuesFrom)+ \<and> (ClS1, PrP2) \<in> IEXT M4 (IS M4 owl_onProperty)+ \<and> Alice \<in> ICEXT M4 ClS1)+ \<and> ((ClC1, ClY) \<in> IEXT M4 (IS M4 owl_allValuesFrom)+ \<and> (ClC1, PrP1) \<in> IEXT M4 (IS M4 owl_onProperty)+ \<and> Alice \<in> ICEXT M4 ClC1)+ \<and> ((ClS1, Bob) \<in> IEXT M4 (IS M4 owl_hasValue)+ \<and> (ClS1, PrP2) \<in> IEXT M4 (IS M4 owl_onProperty)+ \<and> Alice \<in> ICEXT M4 ClS1)+ \<and> (ClC1 \<in> ICEXT M4 (IS M4 owl_Restriction) \<and> ClC1 \<in> IC M4)+ \<and> ((ClS1, ClY) \<in> IEXT M4 (IS M4 owl_someValuesFrom))+ \<and> ((ClC1, ClY) \<in> IEXT M4 (IS M4 owl_allValuesFrom))+ \<and> ((ClC1, PrP1) \<in> IEXT M4 (IS M4 owl_onProperty))"+ using M4_ante_type_IP M4_ante_sco_IP M4_ante_spo_IP M4_ante_sco_fwd+ M4_ante_sco_bwd M4_ante_spo_fwd M4_ante_spo_bwd M4_ante_sco_trans+ M4_ante_spo_trans M4_ante_dom_fwd M4_ante_dom_bwd M4_ante_rng_fwd+ M4_ante_rng_bwd M4_ante_sameAs_fwd M4_ante_eqc_fwd M4_ante_eqp_fwd+ M4_ante_inv_fwd M4_ante_sym_fwd M4_ante_trp_fwd M4_ante_svf M4_ante_avf+ M4_ante_hv M4_ante_restr_IC M4_ante_svf_typ M4_ante_avf_typ M4_ante_onp_typ+ by blast++subsection \<open>THE GATE: all fourteen derivations fire at concrete elements of M4\<close>++(* Non-vacuity of a CONDITION is weaker than non-vacuity of a DERIVATION. A condition+ can have something in the extension its antecedent reads while the derivation that+ consumes it never has all of its premises met at once. Each theorem below applies one+ of the fourteen derived lemmas of OO_Builtin_Sound to M4 at named elements, with every+ premise discharged from M4's own tables, and lands on a membership those tables+ contain. The fourteen are exactly the lemmas the twelve schema arms of the built-in+ table consume: rdfs11, rdfs5, scm-eqc1 (two conclusions), scm-eqp1 (two conclusions),+ scm-svf1, scm-svf2, scm-avf1, scm-avf2, scm-dom1, scm-dom2, scm-rng1, scm-rng2. *)++theorem M4_arm_sco_trans: "(ClY, ClC1) \<in> IEXT M4 (IS M4 rdfs_subClassOf)"+proof (rule D_sco_trans[OF M4_is_a_model])+ show "(ClY, ClC2) \<in> IEXT M4 (IS M4 rdfs_subClassOf)" by (simp add: Sco4_def)+ show "(ClC2, ClC1) \<in> IEXT M4 (IS M4 rdfs_subClassOf)" by (simp add: Sco4_def)+qed++theorem M4_arm_spo_trans: "(PrP1, PrP2) \<in> IEXT M4 (IS M4 rdfs_subPropertyOf)"+proof (rule D_spo_trans[OF M4_is_a_model])+ show "(PrP1, PrQ) \<in> IEXT M4 (IS M4 rdfs_subPropertyOf)" by (simp add: Spo4_def)+ show "(PrQ, PrP2) \<in> IEXT M4 (IS M4 rdfs_subPropertyOf)" by (simp add: Spo4_def)+qed++(* ClC1 and ClA2 are distinct elements with the SAME class extension, which is what+ scm-eqc1 needs and what M3 has nothing of. ClS1 and ClS2 are a second such pair. *)+theorem M4_arm_eqc_sub1: "(ClC1, ClA2) \<in> IEXT M4 (IS M4 rdfs_subClassOf)"+proof (rule D_eqc_sub1[OF M4_is_a_model])+ show "(ClC1, ClA2) \<in> IEXT M4 (IS M4 owl_equivalentClass)" by (simp add: Eqc4_def)+qed++theorem M4_arm_eqc_sub2: "(ClA2, ClC1) \<in> IEXT M4 (IS M4 rdfs_subClassOf)"+proof (rule D_eqc_sub2[OF M4_is_a_model])+ show "(ClC1, ClA2) \<in> IEXT M4 (IS M4 owl_equivalentClass)" by (simp add: Eqc4_def)+qed++theorem M4_arm_eqp_sub1: "(PrP1, PrQ) \<in> IEXT M4 (IS M4 rdfs_subPropertyOf)"+proof (rule D_eqp_sub1[OF M4_is_a_model])+ show "(PrP1, PrQ) \<in> IEXT M4 (IS M4 owl_equivalentProperty)" by (simp add: Eqp4_def)+qed++theorem M4_arm_eqp_sub2: "(PrQ, PrP1) \<in> IEXT M4 (IS M4 rdfs_subPropertyOf)"+proof (rule D_eqp_sub2[OF M4_is_a_model])+ show "(PrP1, PrQ) \<in> IEXT M4 (IS M4 owl_equivalentProperty)" by (simp add: Eqp4_def)+qed++(* scm-svf1: two existential restrictions on the same property PrP2, ordered because+ their fillers ClY and ClC1 are ordered. *)+theorem M4_arm_svf_mono1: "(ClS1, ClS2) \<in> IEXT M4 (IS M4 rdfs_subClassOf)"+proof (rule D_svf_mono1[OF M4_is_a_model])+ show "(ClS1, ClY) \<in> IEXT M4 (IS M4 owl_someValuesFrom)" by (simp add: Svf4_def)+ show "(ClS1, PrP2) \<in> IEXT M4 (IS M4 owl_onProperty)" by (simp add: Onp4_def)+ show "(ClS2, ClC1) \<in> IEXT M4 (IS M4 owl_someValuesFrom)" by (simp add: Svf4_def)+ show "(ClS2, PrP2) \<in> IEXT M4 (IS M4 owl_onProperty)" by (simp add: Onp4_def)+ show "(ClY, ClC1) \<in> IEXT M4 (IS M4 rdfs_subClassOf)" by (simp add: Sco4_def)+qed++(* scm-svf2: two existential restrictions with the same filler ClY, ordered because+ PrP1 is below PrP2 and that inclusion is PROPER, not an equality of empty sets. *)+theorem M4_arm_svf_mono2: "(ClS3, ClS1) \<in> IEXT M4 (IS M4 rdfs_subClassOf)"+proof (rule D_svf_mono2[OF M4_is_a_model])+ show "(ClS3, ClY) \<in> IEXT M4 (IS M4 owl_someValuesFrom)" by (simp add: Svf4_def)+ show "(ClS3, PrP1) \<in> IEXT M4 (IS M4 owl_onProperty)" by (simp add: Onp4_def)+ show "(ClS1, ClY) \<in> IEXT M4 (IS M4 owl_someValuesFrom)" by (simp add: Svf4_def)+ show "(ClS1, PrP2) \<in> IEXT M4 (IS M4 owl_onProperty)" by (simp add: Onp4_def)+ show "(PrP1, PrP2) \<in> IEXT M4 (IS M4 rdfs_subPropertyOf)" by (simp add: Spo4_def)+qed++(* scm-avf1: a universal restriction is MONOTONE in its filler, so this runs the same+ way round as scm-svf1. *)+theorem M4_arm_avf_mono1: "(ClC2, ClA2) \<in> IEXT M4 (IS M4 rdfs_subClassOf)"+proof (rule D_avf_mono1[OF M4_is_a_model])+ show "(ClC2, ClY) \<in> IEXT M4 (IS M4 owl_allValuesFrom)" by (simp add: Avf4_def)+ show "(ClC2, PrP2) \<in> IEXT M4 (IS M4 owl_onProperty)" by (simp add: Onp4_def)+ show "(ClA2, ClC1) \<in> IEXT M4 (IS M4 owl_allValuesFrom)" by (simp add: Avf4_def)+ show "(ClA2, PrP2) \<in> IEXT M4 (IS M4 owl_onProperty)" by (simp add: Onp4_def)+ show "(ClY, ClC1) \<in> IEXT M4 (IS M4 rdfs_subClassOf)" by (simp add: Sco4_def)+qed++(* scm-avf2: and ANTITONE in its property, so the conclusion is REVERSED. The pair+ (ClC1, ClC2) that the naive reading would draw is not merely absent from Sco4, it is+ barred from it; M4_avf2_really_is_antitone below pins that. *)+theorem M4_arm_avf_mono2: "(ClC2, ClC1) \<in> IEXT M4 (IS M4 rdfs_subClassOf)"+proof (rule D_avf_mono2[OF M4_is_a_model])+ show "(ClC1, ClY) \<in> IEXT M4 (IS M4 owl_allValuesFrom)" by (simp add: Avf4_def)+ show "(ClC1, PrP1) \<in> IEXT M4 (IS M4 owl_onProperty)" by (simp add: Onp4_def)+ show "(ClC2, ClY) \<in> IEXT M4 (IS M4 owl_allValuesFrom)" by (simp add: Avf4_def)+ show "(ClC2, PrP2) \<in> IEXT M4 (IS M4 owl_onProperty)" by (simp add: Onp4_def)+ show "(PrP1, PrP2) \<in> IEXT M4 (IS M4 rdfs_subPropertyOf)" by (simp add: Spo4_def)+qed++(* scm-dom1: widening PrP1's domain from ClS1 to ClS2. *)+theorem M4_arm_dom_mono1: "(PrP1, ClS2) \<in> IEXT M4 (IS M4 rdfs_domain)"+proof (rule D_dom_mono1[OF M4_is_a_model])+ show "(PrP1, ClS1) \<in> IEXT M4 (IS M4 rdfs_domain)" by (simp add: Dm4_def)+ show "(ClS1, ClS2) \<in> IEXT M4 (IS M4 rdfs_subClassOf)" by (simp add: Sco4_def)+qed++(* scm-dom2: inheriting PrP2's domain ClS3 down to the subproperty PrP1. *)+theorem M4_arm_dom_mono2: "(PrP1, ClS3) \<in> IEXT M4 (IS M4 rdfs_domain)"+proof (rule D_dom_mono2[OF M4_is_a_model])+ show "(PrP2, ClS3) \<in> IEXT M4 (IS M4 rdfs_domain)" by (simp add: Dm4_def)+ show "(PrP1, PrP2) \<in> IEXT M4 (IS M4 rdfs_subPropertyOf)" by (simp add: Spo4_def)+qed++(* scm-rng1: widening PrP1's range from ClY to ClC1. *)+theorem M4_arm_rng_mono1: "(PrP1, ClC1) \<in> IEXT M4 (IS M4 rdfs_range)"+proof (rule D_rng_mono1[OF M4_is_a_model])+ show "(PrP1, ClY) \<in> IEXT M4 (IS M4 rdfs_range)" by (simp add: Rg4_def)+ show "(ClY, ClC1) \<in> IEXT M4 (IS M4 rdfs_subClassOf)" by (simp add: Sco4_def)+qed++(* scm-rng2: inheriting PrP2's range ClC2 down to the subproperty PrP1. The domain and+ range tables DIFFER at this row and at the ClY row, which is M4 separating the two+ halves of Table 5.8 rather than satisfying them both by accident. *)+theorem M4_arm_rng_mono2: "(PrP1, ClC2) \<in> IEXT M4 (IS M4 rdfs_range)"+proof (rule D_rng_mono2[OF M4_is_a_model])+ show "(PrP2, ClC2) \<in> IEXT M4 (IS M4 rdfs_range)" by (simp add: Rg4_def)+ show "(PrP1, PrP2) \<in> IEXT M4 (IS M4 rdfs_subPropertyOf)" by (simp add: Spo4_def)+qed++(* All fourteen, in one statement. A later edit that stops exercising one of them fails+ here instead of passing quietly, which is the whole point of the block. *)+theorem M4_exercises_every_derivation:+ "(ClY, ClC1) \<in> IEXT M4 (IS M4 rdfs_subClassOf)+ \<and> (PrP1, PrP2) \<in> IEXT M4 (IS M4 rdfs_subPropertyOf)+ \<and> (ClC1, ClA2) \<in> IEXT M4 (IS M4 rdfs_subClassOf)+ \<and> (ClA2, ClC1) \<in> IEXT M4 (IS M4 rdfs_subClassOf)+ \<and> (PrP1, PrQ) \<in> IEXT M4 (IS M4 rdfs_subPropertyOf)+ \<and> (PrQ, PrP1) \<in> IEXT M4 (IS M4 rdfs_subPropertyOf)+ \<and> (ClS1, ClS2) \<in> IEXT M4 (IS M4 rdfs_subClassOf)+ \<and> (ClS3, ClS1) \<in> IEXT M4 (IS M4 rdfs_subClassOf)+ \<and> (ClC2, ClA2) \<in> IEXT M4 (IS M4 rdfs_subClassOf)+ \<and> (ClC2, ClC1) \<in> IEXT M4 (IS M4 rdfs_subClassOf)+ \<and> (PrP1, ClS2) \<in> IEXT M4 (IS M4 rdfs_domain)+ \<and> (PrP1, ClS3) \<in> IEXT M4 (IS M4 rdfs_domain)+ \<and> (PrP1, ClC1) \<in> IEXT M4 (IS M4 rdfs_range)+ \<and> (PrP1, ClC2) \<in> IEXT M4 (IS M4 rdfs_range)"+ using M4_arm_sco_trans M4_arm_spo_trans M4_arm_eqc_sub1 M4_arm_eqc_sub2+ M4_arm_eqp_sub1 M4_arm_eqp_sub2 M4_arm_svf_mono1 M4_arm_svf_mono2+ M4_arm_avf_mono1 M4_arm_avf_mono2 M4_arm_dom_mono1 M4_arm_dom_mono2+ M4_arm_rng_mono1 M4_arm_rng_mono2+ by blast++subsection \<open>Non-degeneracy, pinned\<close>++(* Everything above would still go through with the tables hollowed out, which is how+ the gap this section closes stayed invisible in M3 for as long as it did. These are+ the facts that stop an emptied-out M4 from being reported as a result. Each is stated+ at a NAMED ELEMENT rather than as a non-emptiness, so that the witness is in the+ theorem and not in a tactic, and each of the three shapes the brief asks for is here:+ IC is non-empty and is not the whole carrier; ICEXT(ClY) is a non-empty PROPER subset+ of ICEXT(ClC2), witnessed on both sides by Carl and Bob; and IEXT(PrP1) is non-empty+ and a PROPER subset of IEXT(PrP2), witnessed on both sides by (Alice, Carl) and+ (Alice, Bob), which is what makes the subPropertyOf fact between them hold for a+ reason rather than for want of anything to check. *)+theorem M4_is_live:+ "(ClC1 \<in> IC M4)+ \<and> (Alice \<notin> IC M4)+ \<and> (Carl \<in> ICEXT M4 ClY)+ \<and> (ICEXT M4 ClY \<subseteq> ICEXT M4 ClC2)+ \<and> (Bob \<in> ICEXT M4 ClC2)+ \<and> (Bob \<notin> ICEXT M4 ClY)+ \<and> ((Alice, Carl) \<in> IEXT M4 PrP1)+ \<and> (IEXT M4 PrP1 \<subseteq> IEXT M4 PrP2)+ \<and> ((Alice, Bob) \<in> IEXT M4 PrP2)+ \<and> ((Alice, Bob) \<notin> IEXT M4 PrP1)+ \<and> ((PrP1, PrP2) \<in> IEXT M4 (IS M4 rdfs_subPropertyOf))+ \<and> (ICEXT M4 (IS M4 owl_Restriction) \<subseteq> IC M4)+ \<and> (ClY \<in> IC M4)+ \<and> (ClY \<notin> ICEXT M4 (IS M4 owl_Restriction))+ \<and> ((Alice, Alice) \<in> IEXT M4 (IS M4 owl_sameAs))"+ by (simp add: P1_4_def P2_4_def Spo4_def)++(* scm-avf2 is ANTITONE, and this is what that costs: the pair the arm does NOT conclude+ is not merely absent from Sco4, it is barred from it, because c_sco_fwd would demand+ an inclusion between the two class extensions that fails at Alice. *)+theorem M4_avf2_really_is_antitone:+ "(ClC1, ClC2) \<notin> IEXT M4 (IS M4 rdfs_subClassOf)"+ by (simp add: Sco4_def)++(* Bridge coherence, and what it is and is not for. Every element of M4 whose extension+ is NON-EMPTY is in IP. That is a NECESSARY condition for a structure to be the image+ of a conforming interpretation under a bridge that reads IEXT only at members of IP,+ and it is not sufficient for anything; owl_rl_interp does not impose it, because no+ arm consumes it, so it is a property this model happens to have rather than a+ requirement it meets.++ It is also why M4 does not sharpen the IP-clause refutation that M3 carries. The+ elements M4 leaves outside IP are exactly the ones whose extension is empty, so a+ triple whose predicate denotes one of them is false for two reasons at once. That is+ equally true of M3_refutes_sameAs, whose comment above claims a little more for itself+ than it establishes: zz is outside IP AND has an empty extension, so dropping the IP+ clause from M5 would leave that triple false rather than make it true. Neither+ witness here isolates the IP clause, and this file does not have one that does. *)+theorem M4_is_bridge_coherent: "ext4 p \<noteq> {} \<Longrightarrow> p \<in> IP M4"+ by (cases p) (auto simp: IP4_def)++subsection \<open>What M4 makes true, and what it makes false\<close>++(* The fixture IRIs land on ex_a = Carl, ex_A = ClY and ex_B = ClC2, so the asserted+ subClassOf triple of the fixture graph holds because {Carl} is a PROPER non-empty+ subset of the carrier without Alice, and not because both sides are empty. *)+lemma M4_sat_asserted_1: "sat M4 (Iri ex_a, Iri rdf_type, Iri ex_A)"+ by (simp add: IP4_def Ty4_def)+lemma M4_sat_asserted_2: "sat M4 (Iri ex_A, Iri rdfs_subClassOf, Iri ex_B)"+ by (simp add: IP4_def Sco4_def)++theorem M4_models_fixture_graph: "models M4 (set fixture_graph)"+ by (simp add: models_def fixture_graph_def IP4_def Ty4_def Sco4_def)++theorem M4_sat_the_certified_conclusion: "sat M4 (Iri ex_a, Iri rdf_type, Iri ex_B)"+ by (simp add: IP4_def Ty4_def)++theorem M4_refutes_fresh_class: "\<not> sat M4 (Iri ex_a, Iri rdf_type, Iri ex_C)"+ by (simp add: Ty4_def)++theorem entailment_is_not_trivial_M4:+ "\<not> entails TYPE(E4) (set fixture_graph) (Iri ex_a, Iri rdf_type, Iri ex_C)"+ unfolding entails_def+ using M4_is_a_model M4_models_fixture_graph M4_refutes_fresh_class by blast++subsection \<open>owl:sameAs, corrected\<close>++(* A CORRECTION, recorded rather than applied silently. It is not true that owl:sameAs+ cannot be exercised by any model. RBS Table 5.9 row 1 reads+ "( a1 , a2 ) in IEXT(I(owl:sameAs)) iff a1 = a2" with the variables unscoped and so+ ranging over IR, and RBS section 4.2 defines IR as "the universe of I, i.e., a+ nonempty set that contains at least the denotations of literals and IRIs in V"; both+ re-read in the raw HTML of the Recommendation on 15 September 2026. The section+ number is 4.2, Vocabulary Interpretations, and not 4.4, which is Parts of the+ Universe and defines IC and IP; the draft this note replaces cited 4.4. So in every+ conforming interpretation that extension is the FULL DIAGONAL on a non-empty set,+ hence non-empty, and c_sameAs_fwd has a satisfied antecedent there. M4 carries that+ diagonal and M4_ante_sameAs_fwd exhibits an instance.++ What IS true is the sharper statement below, and it is the reason the condition can+ never be made to look interesting: no interpretation meeting the cell has an+ OFF-DIAGONAL pair, so the condition is exercised at a = a and at nothing else. The+ obstruction is proved here rather than asserted. *)+theorem sameAs_is_exercised_only_on_the_diagonal:+ assumes "owl_rl_interp I" and "a \<noteq> b"+ shows "(a, b) \<notin> IEXT I (IS I owl_sameAs)"+ using assms by (auto simp: owl_rl_interp_def c_sameAs_fwd_def)+enddiff --git a/isabelle/README.md b/isabelle/README.mdindex cc87fed8..d4ec7ed7 100644--- a/isabelle/README.md+++ b/isabelle/README.md@@ -203,7 +203,7 @@ Three things the differential did settle, all of them corners neither side had a| `OO_Check.thy` | the executable checker and the built-in rule table. No semantics. || `OO_Sound.thy` | `horn_certificate_sound` — the conditional verdict. || `OO_Builtin_Sound.thy` | the 27 arms, and `entails_of_builtin` — the absolute verdict. |-| `OO_NonVacuity.thy` | witness models; entailment is not the trivial relation. |+| `OO_NonVacuity.thy` | witness models; entailment is not the trivial relation. `M4` is the witness in which every one of the 26 conditions has a satisfied antecedent and all fourteen derivations of `OO_Builtin_Sound.thy` fire. || `OO_Parse.thy` | TSV field lists to datatypes. Executable. || `OO_Pipeline.thy` | what the tool's own output means, end to end. || `OO_Fixtures.thy` | the checker run on the real fixture bytes, as build gates. Uses `eval`; no soundness theorem depends on it. |diff --git a/lean/OOCert.lean b/lean/OOCert.leanindex 5332af02..c982d22c 100644--- a/lean/OOCert.lean+++ b/lean/OOCert.lean@@ -3,6 +3,8 @@ import OOCert.Semanticsimport OOCert.Rulesimport OOCert.Soundnessimport OOCert.W3C+import OOCert.Conforming+import OOCert.ConformingWitnessimport OOCert.Witnessimport OOCert.W3CWitnessimport OOCert.Horndiff --git a/lean/OOCert/Conforming.lean b/lean/OOCert/Conforming.leannew file mode 100644index 00000000..873ec335--- /dev/null+++ b/lean/OOCert/Conforming.lean@@ -0,0 +1,1048 @@+import OOCert.W3C++/-!+# An RDF-Based Semantics interpretation, and the bridge as a theorem++`W3C.lean` derives fourteen rule arms over `W3C I IP`, which is a structure+*this repository* wrote. The sentence a reader wants is about the+specification's own interpretations, and until now the step between the two was+a paragraph: it said how to read a conforming interpretation as an `Interp`, and+it assumed five `IP` memberships off the RDF and RDFS axiomatic-triple tables+without quoting a cell of either.++This file removes both. An OWL 2 RDF-Based interpretation is formalised here as+a Lean structure in its own right, `Interpretation`, with the parts of RBS Table+5.1 and RDF 1.1 Semantics section 5's truth clause, `I(p) ∈ IP` conjunct+included. `Conforming I` collects semantic conditions, each one a quoted cell.+`Conforming.toW3C` then *proves* that every such interpretation yields an+`Interp` and a `W3C` instance, and the five facts that used to be assumed are+discharged inside that proof from five axiomatic triples that are fields of+`Conforming`.++The sentence at the end, `certificate_conforming_sound`, mentions no structure+of this repository's invention. It reads: if `checkCert` accepts, then every+step's conclusion is true, in the sense of RDF 1.1 Semantics section 5, in every+interpretation satisfying the quoted conditions that also satisfies the asserted+graph.++## What is still not a theorem, stated before anything else++`Conforming` carries a SUBSET of the specification's conditions. It has to: the+Recommendation has fifteen condition tables, thirty-one rows in Table 5.2 and+fifty-five in Table 5.3, a datatype map, facets, and the parts `LV`, `IX`,+`IDC`, `IODP`, `IOXP` and `IOAP` of Table 5.1, and none of the twenty-nine rules+consumes any of them. Rows were counted off the raw HTML on 15 September 2026.++A subset is the SAFE direction and that is why it is allowed. Every condition+below is one the Recommendation imposes, so every conforming interpretation+satisfies all of them, the class of structures this file quantifies over+CONTAINS the conforming interpretations, and a sentence true throughout the+larger class is true of every member of the smaller one. What remains prose is+therefore a CONTAINMENT, checkable cell by cell against the Recommendation, and+no longer a translation plus five unproved facts. It is a smaller thing to check+and a different kind of thing to check, and the difference is the whole point of+this file.++That containment has ONE exception, and it is stated here rather than left to be+found: `IL` is total. RDF 1.1 section 5 makes it partial, so an interpretation+in which a literal fails to denote is NOT one of these, and the sentence at the+end says nothing about it. The next section but one argues the point and names+the obligation that would close it.++Three further consequences a reader should not have to infer:++1. **Nothing here licenses a NEGATIVE result about conforming interpretations.**+ A structure satisfying these conditions need not be a conforming+ interpretation, so `¬ ConformingEntails G t` does not give+ "`G` does not OWL 2 RDF-Based entail `t`". `not_everything_is_conforming_entailed`+ in `ConformingWitness.lean` is a statement about this class and says so.+2. **Three modelling decisions are recorded at their fields**, not folded into+ the word "conforming": rigid blank nodes, a total `IL`, and `IEXT` total on+ the carrier. Each is argued below with its direction of safety, and the+ second of the three does not run in the safe direction.+3. **One reading of a table cell is load-bearing and is flagged**: Table 5.4 at+ `n = 0`. See `int_fwd`.++## Sources, fetched from the raw HTML on 15 September 2026++* RBS = OWL 2 Web Ontology Language RDF-Based Semantics (Second Edition), W3C+ Recommendation 11 December 2012, <https://www.w3.org/TR/owl2-rdf-based-semantics/>.+* RDF11 = RDF 1.1 Semantics, W3C Recommendation 25 February 2014,+ <https://www.w3.org/TR/rdf11-mt/>.++Both were read out of the raw HTML, with markup intact, rather than out of a+rendering. That matters at least twice: a markdown conversion of RBS loses+Table 5.8's `rowspan="4"` and renders its `iff` as `if`, and it loses the+`rowspan` that makes Table 5.9's `iff` govern the `owl:equivalentClass` and+`owl:equivalentProperty` rows as well as the `owl:sameAs` row.++## The chain that licenses the axiomatic triples, quoted++The five `IP` facts used to be assumed because nothing in this repository+quoted a cell of an axiomatic-triple table. The licence is three sentences long+and each link is verbatim.++RBS Definition 4.2: "An OWL 2 RDF-Based interpretation, `I = ( IR , IP , IEXT ,+IS , IL , LV )`, of V with respect to D is a D-interpretation of V with respect+to D that meets all the extra semantic conditions given in Section 5."++RBS Section 4.2: "As detailed in the RDF Semantics [RDF Semantics], a+D-interpretation has to meet all the semantic conditions for ground graphs and+blank nodes, those for RDF interpretations and RDFS interpretations, and the+'general semantic conditions for datatypes'."++RDF11 Section 9: "An RDFS interpretation (recognizing D) is an RDF+interpretation (recognizing D) I which satisfies the semantic conditions in the+following table, and all the triples in the subsequent table of RDFS axiomatic+triples."++So an OWL 2 RDF-Based interpretation satisfies every RDF axiom of RDF11 section+8 and every RDFS axiomatic triple of RDF11 section 9. Five of them are fields of+`Conforming` below, and by section 5's truth clause each one puts its own+predicate's denotation into `IP`. Only five are taken, because importing the+whole tables would be a strengthening nothing needs; RBS's own section 6, which+collects axiomatic triples, is marked "(Informative)", and OWL 2 Profiles+section 4.3 declines to include them, so the minimum is what is taken.++**One of the five is taken by a different route from the one the previous prose+claimed, because that claim was wrong.** `W3C.lean`'s table gave+`I(rdfs:range) ∈ IP` the source "RDFS axiomatic triple+`rdfs:range rdfs:domain rdf:Property .`, same", where "same" pointed at the row+above it reading "whose truth puts its own predicate in `IP`". The predicate of+that triple is `rdfs:domain`, so its truth puts `I(rdfs:domain)` into `IP` and+not `I(rdfs:range)`. Reaching `rdfs:range` from it needs a further step through+Table 5.8's `rdfs:domain` row. The field below uses+`rdf:type rdfs:range rdfs:Class .` instead, whose predicate IS `rdfs:range`, so+one application of the truth clause suffices and no table is consulted at all.+The same simplification is taken for `rdfs:subClassOf` and `rdfs:subPropertyOf`,+where the old prose also went through Table 5.8.++## Three modelling decisions, each with its direction of safety++**Blank nodes are rigid.** `IB` is a component of the interpretation and+`ConformingEntails` quantifies over it along with everything else, where RDF11+section 5.1 quantifies over an assignment `A` existentially inside satisfaction.+Write `⊨₂` for the relation defined here and `⊨₁` for the specification's. Then+`⊨₂` implies `⊨₁`: given `I` and a witness `A` with `[I+A]` satisfying `G`, the+pair `(I, A)` is one of the structures `⊨₂` quantifies over, so it satisfies+`t`, and `A` itself witnesses the consequent of `⊨₁`. The converse fails, so+`⊨₂` is the STRICTLY SMALLER relation and a soundness theorem proved for it is+the STRONGER one. This is the same decision, and the same argument, as+`isabelle/OO_Semantics.thy`'s DECISION M4.++**`IL` is total.** RBS Section 4.2: "IL is a mapping from typed literals+`"s"^^u` in V to their denotations in IR, where `IL("s"^^u) = L2V(d)(s)`,+provided that d is a datatype of D, `IS(u) = d`, and s is in the lexical space+`LS(d)`; otherwise `IL("s"^^u)` is not in LV." An ill-typed literal denotes+something in `IR` outside `LV`; it does not fail to denote. RDF11 section 5+instead lists "A partial mapping IL from literals into IR", and its own note+records the change: "In the 2004 RDF 1.0 semantics, IL was a total, rather than+partial, mapping." RBS is the document that defines the interpretations this+project's claim is about, and its normative reference [RDF Semantics] is the+2004 Recommendation, so total is what is written here.++**This one does NOT run in the safe direction and the cost is stated rather than+argued away.** Requiring `IL` total EXCLUDES any RDF 1.1 interpretation in which+some literal fails to denote, so `certificate_conforming_sound` says nothing+about those. The gap is closable and is not closed here: every term of a+checked step's conclusion occurs in the asserted graph, so in any interpretation+satisfying the graph every such term denotes, and the partial case reduces to+the total one. That argument needs a term-occurrence lemma about `checkStep`,+twenty-nine cases, which is not in this repository. Until it is, the residue is+one sentence long and it is written down here. Taking `IL` partial instead is+not an option: the domain would then have to be `Option IR`, and `Model.int`+quantifies over the whole domain, so an empty `owl:intersectionOf` list would+demand that the extra element be in a class extension, which it cannot be.++**`IEXT` is total on the carrier.** RDF11 section 5 item 3 gives "A mapping IEXT+from IP into the powerset of IR x IR", so the specification's `IEXT` is defined+only on `IP`. Here it is a relation on the whole carrier and every condition+relativises to `IP` exactly where the specification's quantifier does, and+nowhere else. No condition below constrains `IEXT(x)` for an `x` that the same+condition does not first place in `IP`, so sending every non-property to the+empty extension turns any specification interpretation into one of these. Same+decision as `OO_Semantics.thy`'s DECISION M6.++## What the carrier being `IR` settles for free++Table 5.1 gives the parts of the universe, and for `IP` and `IC` its second+column reads `S ⊆ IR`, with the third column giving `ICEXT(x) ⊆ IR` for classes+and `IEXT(x) ⊆ IR × IR` for properties. All four are conditions here by typing:+`IP` and `IC` are predicates on the carrier and `IEXT` is a relation on it, so+nothing can leave `IR`. The first row, `IR | S ≠ ∅`, is the one that needs+saying, and it is the field `IR_nonempty`.++`ICEXT` and `IC` are DEFINITIONS and not conditions, which is what RDF11 section+9 makes them: "ICEXT(y) is defined to be `{ x : < x,y > is in IEXT(I(rdf:type)) }`"+and "IC is defined to be ICEXT(I(rdfs:Class))". A definition cannot shrink the+model class; a condition can.++`LV`, `IX`, `IDC`, `IODP`, `IOXP` and `IOAP` are not modelled. Every condition+mentioning them would be an extra condition, so leaving them out enlarges the+class and is safe.+-/+namespace OOCert++namespace V++/-- `rdf:Property`. Subject of nothing here; object of the RDF axiom+`rdf:type rdf:type rdf:Property .`. -/+def Property : Term := "<http://www.w3.org/1999/02/22-rdf-syntax-ns#Property>"++/-- `rdfs:Resource`. Object of the RDFS axiomatic triple+`rdf:type rdfs:domain rdfs:Resource .`. -/+def Resource : Term := "<http://www.w3.org/2000/01/rdf-schema#Resource>"++/-- `rdfs:Datatype`. Subject of the RDFS axiomatic triple+`rdfs:Datatype rdfs:subClassOf rdfs:Class .`. -/+def Datatype : Term := "<http://www.w3.org/2000/01/rdf-schema#Datatype>"++/-- `rdfs:isDefinedBy`. Subject of the RDFS axiomatic triple+`rdfs:isDefinedBy rdfs:subPropertyOf rdfs:seeAlso .`. -/+def isDefinedBy : Term := "<http://www.w3.org/2000/01/rdf-schema#isDefinedBy>"++/-- `rdfs:seeAlso`. Object of the same triple. -/+def seeAlso : Term := "<http://www.w3.org/2000/01/rdf-schema#seeAlso>"++end V++/-! ## Which of the three mappings a term uses -/++/-- The three sorts of RDF term that RDF11 section 5 gives separate treatment:+IRIs go through `IS`, literals through `IL`, and blank nodes through section+5.1's assignment, here the rigid `IB`. -/+inductive TermKind+ | iri | bnode | lit+ deriving DecidableEq, Repr++/-- The sort of a term, read off its N-Triples spelling, which is how `Term` is+written (see `Triple.lean`). `<…>` is an IRI, `_:…` is a blank node, anything+else is a literal.++The match is on `String.toList` rather than on `String.startsWith` because the+latter does not reduce in the kernel, so `termKind V.type = .iri` would not be+`rfl` and every vocabulary lemma below would need a tactic. -/+def termKind (t : Term) : TermKind :=+ match t.toList with+ | '<' :: _ => .iri+ | '_' :: ':' :: _ => .bnode+ | _ => .lit++/-! ## The interpretation -/++/-- An OWL 2 RDF-Based interpretation's components.++RBS Definition 4.2 writes the tuple `I = ( IR , IP , IEXT , IS , IL , LV )`, and+RDF11 section 5 gives the same list for a simple interpretation: "1. A non-empty+set IR of resources, called the domain or universe of I. 2. A set IP, called the+set of properties of I. 3. A mapping IEXT from IP into the powerset of IR x IR+… 4. A mapping IS from IRIs into (IR union IP) 5. A partial mapping IL from+literals into IR".++`IR` is the carrier TYPE, which is what makes Table 5.1's `IP ⊆ IR`, `IC ⊆ IR`,+`ICEXT(x) ⊆ IR` and `IEXT(x) ⊆ IR × IR` hold by typing. `LV` is absent because+nothing here consumes it. `IB` is the assignment of RDF11 section 5.1, carried+as a component; see the module docstring for the direction of safety.++RDF11 gives `IS` the codomain `IR ∪ IP`, which is wider than `IR`; RBS Table+5.1 gives `IP` the row `S ⊆ IR`, so under the OWL 2 RDF-Based Semantics the two+codomains coincide and `IR` is the faithful one. -/+structure Interpretation where+ /-- `IR`, the universe. Its non-emptiness is the field `Conforming.IR_nonempty`,+ because a structure field cannot state a condition on its own type. -/+ IR : Type+ /-- `IP`, the properties of `I`. -/+ IP : IR → Prop+ /-- `IEXT`. `IEXT p x y` reads "`( x , y ) ∈ IEXT(p)`". Total on the carrier;+ see the module docstring. -/+ IEXT : IR → IR → IR → Prop+ /-- `IS`, the denotation of IRIs. -/+ IS : Term → IR+ /-- The blank node assignment of RDF11 section 5.1, rigid here. -/+ IB : Term → IR+ /-- `IL`, the denotation of literals. Total; see the module docstring. -/+ IL : Term → IR++namespace Interpretation++variable (I : Interpretation)++/-- `I(E)` for a term `E`, which RBS's convention section writes as one mapping:+"for a given interpretation I of a vocabulary V the notation `I(x)` will be used+instead of `IL(x)` and `IS(x)` for the typed literals and IRIs x in V". -/+def den (t : Term) : I.IR :=+ match termKind t with+ | .iri => I.IS t+ | .bnode => I.IB t+ | .lit => I.IL t++/-- `ICEXT`. RDF11 section 9, verbatim: "ICEXT(y) is defined to be+`{ x : < x,y > is in IEXT(I(rdf:type)) }`". A DEFINITION, per that wording, and+per RBS section 4.5 which repeats it. -/+def ICEXT (y x : I.IR) : Prop := I.IEXT (I.IS V.type) x y++/-- `IC`. RDF11 section 9, verbatim: "IC is defined to be ICEXT(I(rdfs:Class))".+RBS Table 5.2's `rdfs:Class` row agrees, reading `rdfs:Class | ∈ IC | = IC`+where the third column is headed `ICEXT(I(E))`. -/+def IC (c : I.IR) : Prop := I.ICEXT (I.IS V.Class) c++/-- Truth of a ground triple. RDF11 section 5, "Semantic conditions for ground+graphs", verbatim:++> if E is a ground triple s p o.+> then I(E) = true if I(p) is in IP and the pair <I(s),I(o)> is in IEXT(I(p))+> otherwise I(E) = false.++The `I(p) ∈ IP` conjunct is the clause's own first conjunct and not an addition.+Section 5 item 3 gives the reason it has to be there: "A mapping IEXT from IP+into the powerset of IR x IR", so `IEXT` is not defined off `IP` at all, and+without the conjunct a triple could be true whose predicate denotes a+non-property.++There is deliberately no case distinction on the predicate. RDF11 section 5+gives ONE truth condition for all triples and the vocabulary's meaning enters+only through conditions on `IEXT`; a formalisation that gives `rdfs:subClassOf`+its own truth clause is not an RDF semantics. -/+def Sat (t : Triple) : Prop :=+ I.IP (I.den t.p) ∧ I.IEXT (I.den t.p) (I.den t.s) (I.den t.o)++/-- `s` is a sequence of `as`. RBS's convention section, "Sequence+expressions", verbatim:++> An expression of the form "s sequence of a1 , … , an ∈ S" means that "s"+> represents an RDF list of n ≥ 0 individuals a1 , … , an, all of them being+> members of the set S. Precisely, s = I(rdf:nil) for n = 0; and for n > 0 there+> exist z1 ∈ IR , … , zn ∈ IR, such that s = z1 , a1 ∈ S ,+> ( z1 , a1 ) ∈ IEXT(I(rdf:first)) , ( z1 , z2 ) ∈ IEXT(I(rdf:rest)) , … ,+> an ∈ S, ( zn , an ) ∈ IEXT(I(rdf:first)) ,+> ( zn , I(rdf:nil) ) ∈ IEXT(I(rdf:rest)) .++The membership `∈ S` is dropped because every use below takes `S = IR`, which+the carrier gives for free. The quantifier is over `IEXT(I(rdf:first))` and+`IEXT(I(rdf:rest))` and never over a graph, which is the point this relation+exists to get right: `Semantics.lean`'s `Chain` reads the list off the ASSERTED+GRAPH and is therefore a strictly finer relation in any model of that graph.+`Conforming.seq_of_chain` is that comparison, proved.++The specification adds, and it is why this is a relation and not a function:+"there are no semantic constraints that enforce "well-formed" sequence+structures. So, for example, it is possible for a sequence head s to refer to+more than one sequence." -/+inductive Seq : I.IR → List I.IR → Prop+ | nil : Seq (I.IS V.nil) []+ | cons {z a z' as} :+ I.IEXT (I.IS V.first) z a → I.IEXT (I.IS V.rest) z z' →+ Seq z' as → Seq z (a :: as)++/-- The `Interp` of `Semantics.lean` that this interpretation is.++`D := IR`, `ι := I(·)`, and `iext p x y := IP p ∧ ( x , y ) ∈ IEXT(p)`. The `IP`+conjunct is RDF11 section 5's truth clause's own first conjunct, which is what+makes `Interp.sat` and `Interpretation.Sat` the SAME PROPOSITION rather than two+that have to be argued equal: `sat_eq` below is `Iff.rfl`. -/+def toInterp : Interp where+ D := I.IR+ ι := I.den+ iext := fun p x y => I.IP p ∧ I.IEXT p x y++/-- The bridge preserves truth, in both directions, by definition. This is the+statement the old prose bridge had to be read for, and it is now `rfl`. -/+theorem sat_eq (t : Triple) : I.toInterp.sat t ↔ I.Sat t := Iff.rfl++end Interpretation++/-! ## The semantic conditions, one field per quoted cell++Every field carries the cell it comes from. A field with no quote above it is a+field nobody checked. Each is the WEAKEST the specification licenses: where the+Recommendation gives an `iff` and only one direction is consumed, only that+direction is written, because the converse would exclude conforming+interpretations and no proof would fail. -/++/-- The semantic conditions of an OWL 2 RDF-Based interpretation that the+twenty-nine rules of this checker reach, together with the five axiomatic+triples the bridge needs. A SUBSET of the Recommendation's conditions; see the+module docstring for why the subset runs in the safe direction. -/+structure Conforming (I : Interpretation) : Prop where+ /-- RBS Table 5.1, row `IR`: `IR | S ≠ ∅`. The only row of that table that is+ not already carried by the carrier being a type. -/+ IR_nonempty : Nonempty I.IR++ /- ### The axiomatic triples, five of them++ RDF11 section 8's RDF axioms and section 9's RDFS axiomatic triples are+ satisfied by every OWL 2 RDF-Based interpretation, through the chain quoted in+ the module docstring. Five are taken, each chosen so that its OWN PREDICATE is+ the term whose `IP` membership is wanted: the truth clause then discharges the+ fact in one step, with no table consulted. -/++ /-- RDF11 section 8, "RDF axioms", first line: `rdf:type rdf:type rdf:Property .`++ Its predicate is `rdf:type`, so its truth gives `I(rdf:type) ∈ IP`, which is+ what every condition mentioning `ICEXT` needs under the bridge. -/+ ax_type : I.Sat ⟨V.type, V.type, V.Property⟩+ /-- RDF11 section 9, "RDFS axiomatic triples":+ `rdfs:Datatype rdfs:subClassOf rdfs:Class .`++ Its predicate is `rdfs:subClassOf`, so its truth gives+ `I(rdfs:subClassOf) ∈ IP`, which `sc_bwd` needs under the bridge in order to+ produce a `rdfs:subClassOf` triple at all. -/+ ax_subClassOf : I.Sat ⟨V.Datatype, V.subClassOf, V.Class⟩+ /-- RDF11 section 9, "RDFS axiomatic triples":+ `rdfs:isDefinedBy rdfs:subPropertyOf rdfs:seeAlso .`+ Predicate `rdfs:subPropertyOf`; needed by `sp_bwd`. -/+ ax_subPropertyOf : I.Sat ⟨V.isDefinedBy, V.subPropertyOf, V.seeAlso⟩+ /-- RDF11 section 9, "RDFS axiomatic triples":+ `rdf:type rdfs:domain rdfs:Resource .`+ Predicate `rdfs:domain`; needed by `dom_bwd`. -/+ ax_domain : I.Sat ⟨V.type, V.domain, V.Resource⟩+ /-- RDF11 section 9, "RDFS axiomatic triples":+ `rdf:type rdfs:range rdfs:Class .`+ Predicate `rdfs:range`; needed by `rng_bwd`. This is the one the previous+ prose sourced to a triple whose predicate is `rdfs:domain`. -/+ ax_range : I.Sat ⟨V.type, V.range, V.Class⟩++ /- ### RBS Table 5.8, the RDFS vocabulary++ The `iff` cell of this table carries `rowspan="4"` in the source and governs+ all four rows. That is the single load-bearing markup fact in this file: a+ rendering that flattens it to `if` makes twelve of the fourteen arms+ underivable, and the mistake is invisible because every proof still compiles+ over the weaker `Conditions`. The section prose agrees: "The semantic+ conditions provided here are "iff" conditions, while the original semantic+ conditions, as specified in Section 4.1 of the RDF Semantics, are weaker+ "if-then" conditions." -/++ /-- Table 5.8, row 1, forward.++ > `( c1 , c2 ) ∈ IEXT(I(rdfs:subClassOf))` **iff**+ > `c1 , c2 ∈ IC , ICEXT(c1) ⊆ ICEXT(c2)` -/+ sc_fwd : ∀ a b, I.IEXT (I.IS V.subClassOf) a b →+ I.IC a ∧ I.IC b ∧ ∀ x, I.ICEXT a x → I.ICEXT b x+ /-- Table 5.8, row 1, backward. Same cell.++ The `IC` conjuncts are KEPT. Dropping them shortens every derivation below and+ fails no proof, and it would force a `rdfs:subClassOf` triple between any two+ things with nested extensions, including things that are not classes. -/+ sc_bwd : ∀ a b, I.IC a → I.IC b → (∀ x, I.ICEXT a x → I.ICEXT b x) →+ I.IEXT (I.IS V.subClassOf) a b+ /-- Table 5.8, row 2, forward.++ > `( p1 , p2 ) ∈ IEXT(I(rdfs:subPropertyOf))` **iff**+ > `p1 , p2 ∈ IP , IEXT(p1) ⊆ IEXT(p2)` -/+ sp_fwd : ∀ a b, I.IEXT (I.IS V.subPropertyOf) a b →+ I.IP a ∧ I.IP b ∧ ∀ x y, I.IEXT a x y → I.IEXT b x y+ /-- Table 5.8, row 2, backward. Same cell; `IP` conjuncts kept. -/+ sp_bwd : ∀ a b, I.IP a → I.IP b → (∀ x y, I.IEXT a x y → I.IEXT b x y) →+ I.IEXT (I.IS V.subPropertyOf) a b+ /-- Table 5.8, row 3, forward.++ > `( p , c ) ∈ IEXT(I(rdfs:domain))` **iff**+ > `p ∈ IP , c ∈ IC , ∀ x , y : ( x , y ) ∈ IEXT(p) implies x ∈ ICEXT(c)`++ RDF11 section 9 gives `rdfs:domain` only the if-then direction, "If < x,y > is+ in IEXT(I(rdfs:domain)) and < u,v > is in IEXT(x) then u is in ICEXT(y)", and+ `scm-dom1` does NOT follow from it. This row sitting inside Table 5.8's+ `rowspan="4"` is the whole reason the twelve arms are derivable. -/+ dom_fwd : ∀ p c, I.IEXT (I.IS V.domain) p c →+ I.IP p ∧ I.IC c ∧ ∀ x y, I.IEXT p x y → I.ICEXT c x+ /-- Table 5.8, row 3, backward. Same cell; conjuncts kept. -/+ dom_bwd : ∀ p c, I.IP p → I.IC c → (∀ x y, I.IEXT p x y → I.ICEXT c x) →+ I.IEXT (I.IS V.domain) p c+ /-- Table 5.8, row 4, forward.++ > `( p , c ) ∈ IEXT(I(rdfs:range))` **iff**+ > `p ∈ IP , c ∈ IC , ∀ x , y : ( x , y ) ∈ IEXT(p) implies y ∈ ICEXT(c)`++ One letter apart from row 3, `y` for `x`. -/+ rng_fwd : ∀ p c, I.IEXT (I.IS V.range) p c →+ I.IP p ∧ I.IC c ∧ ∀ x y, I.IEXT p x y → I.ICEXT c y+ /-- Table 5.8, row 4, backward. Same cell; conjuncts kept. -/+ rng_bwd : ∀ p c, I.IP p → I.IC c → (∀ x y, I.IEXT p x y → I.ICEXT c y) →+ I.IEXT (I.IS V.range) p c++ /- ### RBS Table 5.9, equivalence++ The `iff` cell here carries `rowspan="6"`. Only the forward direction of three+ of those six rows is written: the converses are consumed by nothing, and the+ converse of the `owl:sameAs` row in particular would force `owl:sameAs` to+ hold reflexively across the entire universe. -/++ /-- Table 5.9, row 1, forward only.++ > `( a1 , a2 ) ∈ IEXT(I(owl:sameAs))` **iff** `a1 = a2`++ Cited to Table 5.9 and not to Table 5.10, which is the N-ary disjointness+ table; an earlier document in this repository got that wrong. -/+ same_fwd : ∀ a b, I.IEXT (I.IS V.sameAs) a b → a = b+ /-- Table 5.9, row 3, forward only.++ > `( c1 , c2 ) ∈ IEXT(I(owl:equivalentClass))` **iff**+ > `c1 , c2 ∈ IC , ICEXT(c1) = ICEXT(c2)`++ Note what the cell does NOT contain: a `rdfs:subClassOf` triple. `scm-eqc1`+ concludes one, which is why that rule is a derivation from this row plus+ Table 5.8 backward, and not a reading of any single cell. -/+ eqc_fwd : ∀ a b, I.IEXT (I.IS V.equivalentClass) a b →+ I.IC a ∧ I.IC b ∧ ∀ x, (I.ICEXT a x ↔ I.ICEXT b x)+ /-- Table 5.9, row 5, forward only.++ > `( p1 , p2 ) ∈ IEXT(I(owl:equivalentProperty))` **iff**+ > `p1 , p2 ∈ IP , IEXT(p1) = IEXT(p2)` -/+ eqp_fwd : ∀ a b, I.IEXT (I.IS V.equivalentProperty) a b →+ I.IP a ∧ I.IP b ∧ ∀ x y, (I.IEXT a x y ↔ I.IEXT b x y)++ /-- RBS Table 5.12, forward only.++ > `( p1 , p2 ) ∈ IEXT(I(owl:inverseOf))` **iff**+ > `p1 , p2 ∈ IP , IEXT(p1) = { ( x , y ) | ( y , x ) ∈ IEXT(p2) }`++ Both inclusions of the set equality are kept, because `prp-inv1` and+ `prp-inv2` use opposite ones, and both `IP` conjuncts are kept, because each+ of those two rules has a head predicate that no body triple forces into `IP`. -/+ inv_fwd : ∀ p q, I.IEXT (I.IS V.inverseOf) p q →+ I.IP p ∧ I.IP q ∧ ∀ x y, (I.IEXT p x y ↔ I.IEXT q y x)++ /-- RBS Table 5.13, the `owl:SymmetricProperty` row, forward, universally+ quantified part only.++ > `p ∈ ICEXT(I(owl:SymmetricProperty))` **iff**+ > `p ∈ IP , ∀ x , y : ( x , y ) ∈ IEXT(p) implies ( y , x ) ∈ IEXT(p)`++ The `p ∈ IP` conjunct is dropped because `prp-symp`'s head predicate is the+ same `?p` that its body triple already carries into `IP` through the truth+ clause. Keeping it would be faithful and redundant; dropping it is weaker. -/+ sym_fwd : ∀ p, I.ICEXT (I.IS V.symmetricProperty) p →+ ∀ x y, I.IEXT p x y → I.IEXT p y x+ /-- RBS Table 5.13, the `owl:TransitiveProperty` row, same treatment.++ > `p ∈ ICEXT(I(owl:TransitiveProperty))` **iff** `p ∈ IP , ∀ x , y , z :+ > ( x , y ) ∈ IEXT(p) and ( y , z ) ∈ IEXT(p) implies ( x , z ) ∈ IEXT(p)` -/+ trp_fwd : ∀ p, I.ICEXT (I.IS V.transitiveProperty) p →+ ∀ x y z, I.IEXT p x y → I.IEXT p y z → I.IEXT p x z++ /- ### RBS Table 5.6, property restrictions++ The OUTER connective of this table is an IF-THEN and the CONSEQUENT is a SET+ EQUALITY. Both are load-bearing and they pull opposite ways, which is what+ makes this the easiest row in the Recommendation to get wrong. The table's+ header row reads "if | then", and Tables 5.8 and 5.9 two sections later ARE+ `iff`s, so a reader carrying that habit here shrinks the model class while+ every proof still passes. The equality is written once, as the specification+ has it, and no second field may be added in this area to close a proof. -/++ /-- Table 5.6, row 1.++ > **if** `( z , c ) ∈ IEXT(I(owl:someValuesFrom)) ,+ > ( z , p ) ∈ IEXT(I(owl:onProperty))` **then**+ > `ICEXT(z) = { x | ∃ y : ( x , y ) ∈ IEXT(p) and y ∈ ICEXT(c) }`++ Both inclusions are consumed: `⊇` by `cls-svf1`, `⊆` by `scm-svf1` and+ `scm-svf2`. -/+ svf_eq : ∀ z c p, I.IEXT (I.IS V.someValuesFrom) z c →+ I.IEXT (I.IS V.onProperty) z p →+ ∀ x, (I.ICEXT z x ↔ ∃ y, I.IEXT p x y ∧ I.ICEXT c y)+ /-- Table 5.6, row 3.++ > **if** `( z , c ) ∈ IEXT(I(owl:allValuesFrom)) ,+ > ( z , p ) ∈ IEXT(I(owl:onProperty))` **then**+ > `ICEXT(z) = { x | ∀ y : ( x , y ) ∈ IEXT(p) implies y ∈ ICEXT(c) }`++ Both inclusions consumed: `⊆` by `cls-avf`, `⊇` by `scm-avf1` and+ `scm-avf2`. -/+ avf_eq : ∀ z c p, I.IEXT (I.IS V.allValuesFrom) z c →+ I.IEXT (I.IS V.onProperty) z p →+ ∀ x, (I.ICEXT z x ↔ ∀ y, I.IEXT p x y → I.ICEXT c y)+ /-- Table 5.6, row 5.++ > **if** `( z , a ) ∈ IEXT(I(owl:hasValue)) ,+ > ( z , p ) ∈ IEXT(I(owl:onProperty))` **then**+ > `ICEXT(z) = { x | ( x , a ) ∈ IEXT(p) }` -/+ hv_eq : ∀ z a p, I.IEXT (I.IS V.hasValue) z a →+ I.IEXT (I.IS V.onProperty) z p →+ ∀ x, (I.ICEXT z x ↔ I.IEXT p x a)++ /-- RBS Table 5.2, the `owl:Restriction` row, third column:+ `ICEXT(I(owl:Restriction)) ⊆ IC`.++ SUBSET and never equality. The table writes `⊆` here where it writes `=` for+ `rdfs:Class`, `rdf:Property`, `rdfs:Resource` and `owl:Thing`, and writing the+ equality would force every class to be a restriction. The second column of the+ same row, `owl:Restriction ∈ IC`, is not taken: no rule consumes it. -/+ restr_IC : ∀ x, I.ICEXT (I.IS V.Restriction) x → I.IC x+ /-- RBS Table 5.3, the `owl:someValuesFrom` row, third column:+ `IEXT(I(owl:someValuesFrom)) ⊆ ICEXT(I(owl:Restriction)) × IC`. -/+ svf_typ : ∀ z c, I.IEXT (I.IS V.someValuesFrom) z c →+ I.ICEXT (I.IS V.Restriction) z ∧ I.IC c+ /-- RBS Table 5.3, the `owl:allValuesFrom` row, third column:+ `IEXT(I(owl:allValuesFrom)) ⊆ ICEXT(I(owl:Restriction)) × IC`. -/+ avf_typ : ∀ z c, I.IEXT (I.IS V.allValuesFrom) z c →+ I.ICEXT (I.IS V.Restriction) z ∧ I.IC c+ /-- RBS Table 5.3, the `owl:onProperty` row, third column:+ `IEXT(I(owl:onProperty)) ⊆ ICEXT(I(owl:Restriction)) × IP`.++ The `IP` half is what carries the restriction rules across the bridge: under+ the bridge `Interp.iext p x y` demands `IP p`, and for the property of a+ restriction nothing else supplies it. -/+ onp_typ : ∀ z p, I.IEXT (I.IS V.onProperty) z p →+ I.ICEXT (I.IS V.Restriction) z ∧ I.IP p++ /- ### RBS Tables 5.4 and 5.5, the list constructors++ Forward direction only, and the `IC` conjuncts of each cell are dropped: no+ arm consumes them, so leaving them out enlarges the class. -/++ /-- RBS Table 5.4, the `owl:intersectionOf` row, forward.++ > **if** `s` sequence of `c1 , … , cn ∈ IR` **then**+ > `( z , s ) ∈ IEXT(I(owl:intersectionOf))` **iff**+ > `z , c1 , … , cn ∈ IC , ICEXT(z) = ICEXT(c1) ∩ … ∩ ICEXT(cn)`++ **A READING IS LOAD-BEARING HERE AND IT IS THE ONLY ONE IN THIS FILE.** The+ `∀ c ∈ cs` form below reads `ICEXT(c1) ∩ … ∩ ICEXT(cn)` at `n = 0` as `IR`,+ the empty intersection taken inside the universe. Three things license it and+ none of them is decisive on its own, so it is flagged rather than assumed:+ the convention section defines the sequence expression for "n ≥ 0"; the two+ neighbouring rows of this very table write "n ≥ 1" explicitly where they mean+ it, so the absence of that phrase here is a choice; and Table 5.1 gives+ `ICEXT(x) ⊆ IR`, which is the universe the intersection is taken in.++ The reading is not idle. `Rules.lean`'s `takeChain` accepts an empty chain, so+ `cls-int1` fires on `c owl:intersectionOf rdf:nil` and concludes+ `x rdf:type c` for EVERY `x`. `Semantics.lean`'s `Model.int` quantifies over+ the whole domain and therefore already commits this repository to the same+ reading. Under the other reading, that step would be unsound and this field+ would be too strong. -/+ int_fwd : ∀ z s cs, I.IEXT (I.IS V.intersectionOf) z s → I.Seq s cs →+ ∀ x, (I.ICEXT z x ↔ ∀ c ∈ cs, I.ICEXT c x)+ /-- RBS Table 5.4, the `owl:unionOf` row, forward.++ > **if** `s` sequence of `c1 , … , cn ∈ IR` **then**+ > `( z , s ) ∈ IEXT(I(owl:unionOf))` **iff**+ > `z , c1 , … , cn ∈ IC , ICEXT(z) = ICEXT(c1) ∪ … ∪ ICEXT(cn)`++ At `n = 0` the `∃ c ∈ cs` form reads the empty union as `∅`, which needs no+ convention. -/+ uni_fwd : ∀ z s cs, I.IEXT (I.IS V.unionOf) z s → I.Seq s cs →+ ∀ x, (I.ICEXT z x ↔ ∃ c ∈ cs, I.ICEXT c x)+ /-- RBS Table 5.5, forward.++ > **if** `s` sequence of `a1 , … , an ∈ IR` **then**+ > `( z , s ) ∈ IEXT(I(owl:oneOf))` **iff** `z ∈ IC , ICEXT(z) = { a1 , … , an }`++ `Model.oneOf` is the `⊇` half of this equality and nothing else; the `⊆` half+ is available here and consumed by no rule. -/+ oneOf_fwd : ∀ z s as, I.IEXT (I.IS V.oneOf) z s → I.Seq s as →+ ∀ x, (I.ICEXT z x ↔ ∃ a ∈ as, x = a)++/-! ## The bridge, proved++Each lemma below is the step the old paragraph asked a reader to take. The five+`IP` facts it assumed are the first five, and each is one projection out of one+axiomatic triple. -/++namespace Conforming++variable {I : Interpretation}++/-- `I(rdf:type) ∈ IP`, discharged. The predicate of `rdf:type rdf:type+rdf:Property .` is `rdf:type`, so RDF11 section 5's truth clause hands this back+as the triple's own first conjunct. -/+theorem IP_type (C : Conforming I) : I.IP (I.IS V.type) := C.ax_type.1++/-- `I(rdfs:subClassOf) ∈ IP`, discharged from+`rdfs:Datatype rdfs:subClassOf rdfs:Class .`. -/+theorem IP_subClassOf (C : Conforming I) : I.IP (I.IS V.subClassOf) :=+ C.ax_subClassOf.1++/-- `I(rdfs:subPropertyOf) ∈ IP`, discharged from+`rdfs:isDefinedBy rdfs:subPropertyOf rdfs:seeAlso .`. -/+theorem IP_subPropertyOf (C : Conforming I) : I.IP (I.IS V.subPropertyOf) :=+ C.ax_subPropertyOf.1++/-- `I(rdfs:domain) ∈ IP`, discharged from+`rdf:type rdfs:domain rdfs:Resource .`. -/+theorem IP_domain (C : Conforming I) : I.IP (I.IS V.domain) := C.ax_domain.1++/-- `I(rdfs:range) ∈ IP`, discharged from `rdf:type rdfs:range rdfs:Class .`. -/+theorem IP_range (C : Conforming I) : I.IP (I.IS V.range) := C.ax_range.1++/-- `Interp.cext` IS `ICEXT`. The left-to-right direction is free; the other way+needs `I(rdf:type) ∈ IP`, and that is the whole of what the first assumed fact+was for. -/+theorem cext_iff (C : Conforming I) {c x : I.IR} :+ I.toInterp.cext c x ↔ I.ICEXT c x :=+ ⟨fun h => h.2, fun h => ⟨C.IP_type, h⟩⟩++/-- `Interp.IC` IS `IC`. -/+theorem IC_iff (C : Conforming I) {c : I.IR} : I.toInterp.IC c ↔ I.IC c :=+ C.cext_iff++/-- `Interp.sc` IS membership in `IEXT(I(rdfs:subClassOf))`. -/+theorem sc_iff (C : Conforming I) {a b : I.IR} :+ I.toInterp.sc a b ↔ I.IEXT (I.IS V.subClassOf) a b :=+ ⟨fun h => h.2, fun h => ⟨C.IP_subClassOf, h⟩⟩++/-- `Interp.sp` IS membership in `IEXT(I(rdfs:subPropertyOf))`. -/+theorem sp_iff (C : Conforming I) {a b : I.IR} :+ I.toInterp.sp a b ↔ I.IEXT (I.IS V.subPropertyOf) a b :=+ ⟨fun h => h.2, fun h => ⟨C.IP_subPropertyOf, h⟩⟩++/-- Every graph chain is a semantic sequence, in any interpretation that+satisfies the graph.++This is the comparison `Semantics.lean` and `W3C.lean` argue in English at their+list fields and never state. `Chain G` quantifies over the ASSERTED GRAPH and+the specification's sequence expression quantifies over+`IEXT(I(rdf:first))` and `IEXT(I(rdf:rest))`; the two meet exactly here, because+a satisfied graph puts each of its own `rdf:first` and `rdf:rest` triples into+those extensions. The converse is false and is not needed: a sequence built from+pairs the graph never asserts is not a graph chain, which is why the conditions+stated over `Chain` are the weaker ones. -/+theorem seq_of_chain {G : List Triple} (hG : ∀ t ∈ G, I.Sat t) :+ ∀ {l : Term} {ms : List Term}, Chain G l ms → I.Seq (I.den l) (ms.map I.den) := by+ intro l ms h+ induction h with+ | nil => exact Interpretation.Seq.nil+ | @cons l m l' ms hf hr _ ih =>+ have h1 : I.IEXT (I.den V.first) (I.den l) (I.den m) := (hG _ hf).2+ have h2 : I.IEXT (I.den V.rest) (I.den l) (I.den l') := (hG _ hr).2+ exact Interpretation.Seq.cons h1 h2 ih++end Conforming++/-! ### Two list lemmas++Core Lean only, so they are proved here rather than imported. -/++theorem forall_mem_map_iff {α β : Type} (f : α → β) (P : β → Prop) (l : List α) :+ (∀ b ∈ l.map f, P b) ↔ ∀ a ∈ l, P (f a) := by+ constructor+ · intro h a ha; exact h (f a) (List.mem_map_of_mem ha)+ · intro h b hb+ match List.mem_map.mp hb with+ | ⟨a, ha, he⟩ => exact he ▸ h a ha++theorem exists_mem_map_iff {α β : Type} (f : α → β) (P : β → Prop) (l : List α) :+ (∃ b ∈ l.map f, P b) ↔ ∃ a ∈ l, P (f a) := by+ constructor+ · intro ⟨b, hb, hp⟩+ match List.mem_map.mp hb with+ | ⟨a, ha, he⟩ => exact ⟨a, ha, he ▸ hp⟩+ · intro ⟨a, ha, hp⟩+ exact ⟨f a, List.mem_map_of_mem ha, hp⟩++namespace Conforming++variable {I : Interpretation}++/-- **Every conforming interpretation carries the specification conditions of+`W3C.lean` at full strength.**++This is the theorem the module docstring of `W3C.lean` said did not exist. Each+field is the corresponding quoted cell, read through the bridge; the only work+in the proof is supplying the `IP` memberships that `Interp.iext` demands and+the specification's cells do not mention, and every one of those comes from an+axiomatic triple above rather than from an assumption. -/+theorem toW3C (C : Conforming I) : W3C I.toInterp I.IP where+ sc_fwd := fun a b h =>+ match C.sc_fwd a b h.2 with+ | ⟨ha, hb, hsub⟩ =>+ ⟨C.IC_iff.mpr ha, C.IC_iff.mpr hb,+ fun x hx => C.cext_iff.mpr (hsub x (C.cext_iff.mp hx))⟩+ sc_bwd := fun a b ha hb hsub =>+ ⟨C.IP_subClassOf, C.sc_bwd a b (C.IC_iff.mp ha) (C.IC_iff.mp hb)+ (fun x hx => C.cext_iff.mp (hsub x (C.cext_iff.mpr hx)))⟩+ sp_fwd := fun a b h =>+ match C.sp_fwd a b h.2 with+ | ⟨ha, hb, hsub⟩ =>+ ⟨ha, hb, fun x y hxy => ⟨hb, hsub x y hxy.2⟩⟩+ sp_bwd := fun a b ha hb hsub =>+ ⟨C.IP_subPropertyOf, C.sp_bwd a b ha hb+ (fun x y hxy => (hsub x y ⟨ha, hxy⟩).2)⟩+ dom_fwd := fun p c h =>+ match C.dom_fwd p c h.2 with+ | ⟨hp, hc, hall⟩ =>+ ⟨hp, C.IC_iff.mpr hc, fun x y hxy => C.cext_iff.mpr (hall x y hxy.2)⟩+ dom_bwd := fun p c hp hc hall =>+ ⟨C.IP_domain, C.dom_bwd p c hp (C.IC_iff.mp hc)+ (fun x y hxy => C.cext_iff.mp (hall x y ⟨hp, hxy⟩))⟩+ rng_fwd := fun p c h =>+ match C.rng_fwd p c h.2 with+ | ⟨hp, hc, hall⟩ =>+ ⟨hp, C.IC_iff.mpr hc, fun x y hxy => C.cext_iff.mpr (hall x y hxy.2)⟩+ rng_bwd := fun p c hp hc hall =>+ ⟨C.IP_range, C.rng_bwd p c hp (C.IC_iff.mp hc)+ (fun x y hxy => C.cext_iff.mp (hall x y ⟨hp, hxy⟩))⟩+ eqc_fwd := fun a b h =>+ match C.eqc_fwd a b h.2 with+ | ⟨ha, hb, heq⟩ =>+ ⟨C.IC_iff.mpr ha, C.IC_iff.mpr hb,+ fun x => ⟨fun hx => C.cext_iff.mpr ((heq x).mp (C.cext_iff.mp hx)),+ fun hx => C.cext_iff.mpr ((heq x).mpr (C.cext_iff.mp hx))⟩⟩+ eqp_fwd := fun a b h =>+ match C.eqp_fwd a b h.2 with+ | ⟨ha, hb, heq⟩ =>+ ⟨ha, hb, fun x y => ⟨fun hxy => ⟨hb, (heq x y).mp hxy.2⟩,+ fun hxy => ⟨ha, (heq x y).mpr hxy.2⟩⟩⟩+ same_fwd := fun a b h => C.same_fwd a b h.2+ inv_fwd := fun p q h =>+ match C.inv_fwd p q h.2 with+ | ⟨hp, hq, heq⟩ =>+ ⟨hp, hq, fun x y => ⟨fun hxy => ⟨hq, (heq x y).mp hxy.2⟩,+ fun hyx => ⟨hp, (heq x y).mpr hyx.2⟩⟩⟩+ sym_fwd := fun p h x y hxy =>+ ⟨hxy.1, C.sym_fwd p (C.cext_iff.mp h) x y hxy.2⟩+ trp_fwd := fun p h x y z hxy hyz =>+ ⟨hxy.1, C.trp_fwd p (C.cext_iff.mp h) x y z hxy.2 hyz.2⟩+ svf_eq := fun z c p h1 h2 x =>+ ⟨fun hx =>+ match (C.svf_eq z c p h1.2 h2.2 x).mp (C.cext_iff.mp hx) with+ | ⟨y, hxy, hy⟩ => ⟨y, ⟨(C.onp_typ z p h2.2).2, hxy⟩, C.cext_iff.mpr hy⟩,+ fun hx =>+ match hx with+ | ⟨y, hxy, hy⟩ =>+ C.cext_iff.mpr ((C.svf_eq z c p h1.2 h2.2 x).mpr+ ⟨y, hxy.2, C.cext_iff.mp hy⟩)⟩+ avf_eq := fun z c p h1 h2 x =>+ ⟨fun hx y hxy =>+ C.cext_iff.mpr ((C.avf_eq z c p h1.2 h2.2 x).mp (C.cext_iff.mp hx) y hxy.2),+ fun hall =>+ C.cext_iff.mpr ((C.avf_eq z c p h1.2 h2.2 x).mpr+ (fun y hxy => C.cext_iff.mp (hall y ⟨(C.onp_typ z p h2.2).2, hxy⟩)))⟩+ hv_eq := fun z a p h1 h2 x =>+ ⟨fun hx => ⟨(C.onp_typ z p h2.2).2, (C.hv_eq z a p h1.2 h2.2 x).mp (C.cext_iff.mp hx)⟩,+ fun hxa => C.cext_iff.mpr ((C.hv_eq z a p h1.2 h2.2 x).mpr hxa.2)⟩+ restr_IC := fun x h => C.IC_iff.mpr (C.restr_IC x (C.cext_iff.mp h))+ svf_typ := fun z c h =>+ match C.svf_typ z c h.2 with+ | ⟨h1, h2⟩ => ⟨C.cext_iff.mpr h1, C.IC_iff.mpr h2⟩+ avf_typ := fun z c h =>+ match C.avf_typ z c h.2 with+ | ⟨h1, h2⟩ => ⟨C.cext_iff.mpr h1, C.IC_iff.mpr h2⟩+ onp_typ := fun z p h =>+ match C.onp_typ z p h.2 with+ | ⟨h1, h2⟩ => ⟨C.cext_iff.mpr h1, h2⟩++/-- **Every conforming interpretation that satisfies the graph is a+`W3CModel` of it.**++The three list fields are where `Chain` meets the specification's sequence+expression, through `seq_of_chain`. -/+theorem toW3CModel (C : Conforming I) {G : List Triple} (hG : ∀ t ∈ G, I.Sat t) :+ W3CModel I.toInterp I.IP G where+ conds := C.toW3C+ facts := hG+ int_eq := fun c l ms hin hch x => by+ have hax : I.IEXT (I.den V.intersectionOf) (I.den c) (I.den l) := (hG _ hin).2+ have h := C.int_fwd (I.den c) (I.den l) (ms.map I.den) hax (seq_of_chain hG hch) x+ have hm := forall_mem_map_iff I.den (fun k => I.ICEXT k x) ms+ exact ⟨fun hx m hmem => C.cext_iff.mpr (hm.mp (h.mp (C.cext_iff.mp hx)) m hmem),+ fun hall => C.cext_iff.mpr (h.mpr (hm.mpr+ (fun m hmem => C.cext_iff.mp (hall m hmem))))⟩+ uni_eq := fun c l ms hin hch x => by+ have hax : I.IEXT (I.den V.unionOf) (I.den c) (I.den l) := (hG _ hin).2+ have h := C.uni_fwd (I.den c) (I.den l) (ms.map I.den) hax (seq_of_chain hG hch) x+ have hm := exists_mem_map_iff I.den (fun k => I.ICEXT k x) ms+ exact ⟨fun hx => match hm.mp (h.mp (C.cext_iff.mp hx)) with+ | ⟨m, hmem, hk⟩ => ⟨m, hmem, C.cext_iff.mpr hk⟩,+ fun hex => match hex with+ | ⟨m, hmem, hk⟩ =>+ C.cext_iff.mpr (h.mpr (hm.mpr ⟨m, hmem, C.cext_iff.mp hk⟩))⟩+ oneOf_eq := fun c l ms hin hch x => by+ have hax : I.IEXT (I.den V.oneOf) (I.den c) (I.den l) := (hG _ hin).2+ have h := C.oneOf_fwd (I.den c) (I.den l) (ms.map I.den) hax (seq_of_chain hG hch) x+ have hm := exists_mem_map_iff I.den (fun a => x = a) ms+ exact ⟨fun hx => hm.mp (h.mp (C.cext_iff.mp hx)),+ fun hex => C.cext_iff.mpr (h.mpr (hm.mpr hex))⟩++/-- Every conforming interpretation that satisfies the graph is a `Model` of+it, which is what `certificate_sound` quantifies over. -/+theorem toModel (C : Conforming I) {G : List Triple} (hG : ∀ t ∈ G, I.Sat t) :+ Model I.toInterp G :=+ (C.toW3CModel hG).toModel++end Conforming++/-! ## The sentence the project wants -/++/-- `G` entails `t` over the conforming interpretations: every interpretation+meeting the quoted conditions and satisfying every triple of `G` satisfies `t`,+where "satisfies" is RDF 1.1 Semantics section 5's truth clause and nothing+else.++Compare `Entails`, which quantifies over `Semantics.lean`'s much larger+`Conditions` class, and `W3CEntails`, which quantifies over `W3CModel`. This is+the smallest class of the three, so this is the LARGEST relation of the three,+and a non-entailment stated over it is correspondingly the weakest. -/+def ConformingEntails (G : List Triple) (t : Triple) : Prop :=+ ∀ I : Interpretation, Conforming I → (∀ u ∈ G, I.Sat u) → I.Sat t++/-- Everything `Entails` gives holds in every conforming interpretation. -/+theorem ConformingEntails.of_entails {G : List Triple} {t : Triple}+ (h : Entails G t) : ConformingEntails G t :=+ fun _ C hG => h _ (C.toModel hG)++/-- **A checked certificate's conclusions are true in every conforming+interpretation of the asserted graph.**++`certificate_w3c_sound`'s docstring says of itself that it "is not yet the+sentence "true in every conforming interpretation", and the difference is the+bridge in the module docstring above, which is an argument and not a theorem".+This is that sentence, and the bridge is now `Conforming.toW3C` and+`Conforming.toW3CModel`.++What the statement mentions: `checkCert`, which is the checker; `Interpretation`,+which is RBS Definition 4.2's tuple; `Conforming`, which is a list of quoted+cells; and `Interpretation.Sat`, which is RDF 1.1 Semantics section 5's truth+clause. It mentions no structure invented by this repository.++What it still does not mention, and what therefore remains to be checked by+hand, is that `Conforming` is a SUBSET of the Recommendation's conditions rather+than a paraphrase of them. That is a containment, one field at a time, and the+module docstring says which conditions are left out and why leaving them out+enlarges the class. It is not a reading of one structure as another, and it does+not assume anything about axiomatic triples: the five facts that used to be+assumed are fields of `Conforming`, quoted, and discharged in the proof.++The one remaining modelling decision that does NOT run in the safe direction is+`IL` being total, which excludes RDF 1.1 interpretations in which some literal+fails to denote. The obligation that would close it is named at the+`Interpretation` structure. -/+theorem certificate_conforming_sound (G : List Triple) (steps : List Step)+ (h : checkCert G steps = true) :+ ∀ st ∈ steps, ConformingEntails G st.conclusion :=+ fun st hst => ConformingEntails.of_entails (certificate_sound G steps h st hst)++/-! ## Tripwires++Two kinds, and both are in the build rather than in a document, because a claim+that lives in a document is a claim that goes stale.++The first is the axiom guard that `Soundness.lean` and `W3C.lean` carry. A+`sorry` or a `native_decide` anywhere in the bridge changes the footprint below+and fails the build here. The three axioms that ARE listed are Lean's own, and+they arrive through `String.data`, which `termKind` reads to tell an IRI from a+literal; `#print axioms String.data` reports the same three. What the guard+rules out is `sorryAx` and `Lean.ofReduceBool`, which is what `native_decide`+would add.++The second is new. Everything this file proves rests on `Conditions`, `Interp`,+`Model`, `Entails` and `certificate_sound` being what they were when it was+written, and a layer added on top is exactly the situation in which one of them+gets quietly adjusted to make a proof go through. "Unchanged" is not something to+check by eye. `#check` on a structure's CONSTRUCTOR prints every field's+statement in order, so the blocks below pin all twenty-three fields of+`Conditions` and all six of `Model`, not merely their names. A field weakened,+strengthened, added, removed or reordered anywhere in the repository breaks this+file. That is verbose on purpose: the verbosity is the check.+-/+++/-- info: 'OOCert.Conforming.toW3C' depends on axioms: [propext, Classical.choice, Quot.sound] -/+#guard_msgs in+#print axioms Conforming.toW3C++/-- info: 'OOCert.Conforming.toW3CModel' depends on axioms: [propext, Classical.choice, Quot.sound] -/+#guard_msgs in+#print axioms Conforming.toW3CModel++/-- info: 'OOCert.certificate_conforming_sound' depends on axioms: [propext, Classical.choice, Quot.sound] -/+#guard_msgs in+#print axioms certificate_conforming_sound++/-- info: Interp.mk : (D : Type) → (Term → D) → (D → D → D → Prop) → Interp -/+#guard_msgs in+#check @Interp.mk++/--+info: @Conditions.mk : ∀ {I : Interp},+ (∀ (a b : I.D), I.sc a b → ∀ (x : I.D), I.cext a x → I.cext b x) →+ (∀ (a b c : I.D), I.sc a b → I.sc b c → I.sc a c) →+ (∀ (a b : I.D), I.sp a b → ∀ (x y : I.D), I.iext a x y → I.iext b x y) →+ (∀ (a b c : I.D), I.sp a b → I.sp b c → I.sp a c) →+ (∀ (p c : I.D), I.iext (I.ι V.domain) p c → ∀ (x y : I.D), I.iext p x y → I.cext c x) →+ (∀ (p c : I.D), I.iext (I.ι V.range) p c → ∀ (x y : I.D), I.iext p x y → I.cext c y) →+ (∀ (p : I.D),+ I.cext (I.ι V.transitiveProperty) p → ∀ (x y z : I.D), I.iext p x y → I.iext p y z → I.iext p x z) →+ (∀ (p : I.D), I.cext (I.ι V.symmetricProperty) p → ∀ (x y : I.D), I.iext p x y → I.iext p y x) →+ (∀ (p q : I.D), I.iext (I.ι V.inverseOf) p q → ∀ (x y : I.D), I.iext p x y ↔ I.iext q y x) →+ (∀ (a b : I.D), I.iext (I.ι V.sameAs) a b → a = b) →+ (∀ (a b : I.D), I.iext (I.ι V.equivalentClass) a b → I.sc a b ∧ I.sc b a) →+ (∀ (a b : I.D), I.iext (I.ι V.equivalentProperty) a b → I.sp a b ∧ I.sp b a) →+ (∀ (r p c : I.D),+ I.iext (I.ι V.onProperty) r p →+ I.iext (I.ι V.someValuesFrom) r c →+ ∀ (x y : I.D), I.iext p x y → I.cext c y → I.cext r x) →+ (∀ (r p c : I.D),+ I.iext (I.ι V.onProperty) r p →+ I.iext (I.ι V.allValuesFrom) r c →+ ∀ (x y : I.D), I.cext r x → I.iext p x y → I.cext c y) →+ (∀ (r p v : I.D),+ I.iext (I.ι V.onProperty) r p →+ I.iext (I.ι V.hasValue) r v → ∀ (x : I.D), I.cext r x ↔ I.iext p x v) →+ (∀ (c1 c2 p y1 y2 : I.D),+ I.iext (I.ι V.someValuesFrom) c1 y1 →+ I.iext (I.ι V.onProperty) c1 p →+ I.iext (I.ι V.someValuesFrom) c2 y2 →+ I.iext (I.ι V.onProperty) c2 p → I.sc y1 y2 → I.sc c1 c2) →+ (∀ (c1 c2 p1 p2 y : I.D),+ I.iext (I.ι V.someValuesFrom) c1 y →+ I.iext (I.ι V.onProperty) c1 p1 →+ I.iext (I.ι V.someValuesFrom) c2 y →+ I.iext (I.ι V.onProperty) c2 p2 → I.sp p1 p2 → I.sc c1 c2) →+ (∀ (c1 c2 p y1 y2 : I.D),+ I.iext (I.ι V.allValuesFrom) c1 y1 →+ I.iext (I.ι V.onProperty) c1 p →+ I.iext (I.ι V.allValuesFrom) c2 y2 →+ I.iext (I.ι V.onProperty) c2 p → I.sc y1 y2 → I.sc c1 c2) →+ (∀ (c1 c2 p1 p2 y : I.D),+ I.iext (I.ι V.allValuesFrom) c1 y →+ I.iext (I.ι V.onProperty) c1 p1 →+ I.iext (I.ι V.allValuesFrom) c2 y →+ I.iext (I.ι V.onProperty) c2 p2 → I.sp p1 p2 → I.sc c2 c1) →+ (∀ (p c1 c2 : I.D),+ I.iext (I.ι V.domain) p c1 → I.sc c1 c2 → I.iext (I.ι V.domain) p c2) →+ (∀ (p1 p2 c : I.D),+ I.iext (I.ι V.domain) p2 c → I.sp p1 p2 → I.iext (I.ι V.domain) p1 c) →+ (∀ (p c1 c2 : I.D),+ I.iext (I.ι V.range) p c1 → I.sc c1 c2 → I.iext (I.ι V.range) p c2) →+ (∀ (p1 p2 c : I.D),+ I.iext (I.ι V.range) p2 c → I.sp p1 p2 → I.iext (I.ι V.range) p1 c) →+ Conditions I+-/+#guard_msgs in+#check @Conditions.mk++/--+info: @Model.mk : ∀ {I : Interp} {G : List Triple},+ Conditions I →+ (∀ (t : Triple), t ∈ G → I.sat t) →+ (∀ (c l : Term) (ms : List Term),+ { s := c, p := V.intersectionOf, o := l } ∈ G →+ Chain G l ms → ∀ (x : I.D), (∀ (m : Term), m ∈ ms → I.cext (I.ι m) x) → I.cext (I.ι c) x) →+ (∀ (c l : Term) (ms : List Term),+ { s := c, p := V.intersectionOf, o := l } ∈ G →+ Chain G l ms → ∀ (x : I.D), I.cext (I.ι c) x → ∀ (m : Term), m ∈ ms → I.cext (I.ι m) x) →+ (∀ (c l : Term) (ms : List Term),+ { s := c, p := V.unionOf, o := l } ∈ G →+ Chain G l ms → ∀ (x : I.D) (m : Term), m ∈ ms → I.cext (I.ι m) x → I.cext (I.ι c) x) →+ (∀ (c l : Term) (ms : List Term),+ { s := c, p := V.oneOf, o := l } ∈ G → Chain G l ms → ∀ (m : Term), m ∈ ms → I.cext (I.ι c) (I.ι m)) →+ Model I G+-/+#guard_msgs in+#check @Model.mk++/-- info: Entails : List Triple → Triple → Prop -/+#guard_msgs in+#check @Entails++/--+info: certificate_sound : ∀ (G : List Triple) (steps : List Step),+ checkCert G steps = true → ∀ (st : Step), st ∈ steps → Entails G st.conclusion+-/+#guard_msgs in+#check @certificate_sound++end OOCertdiff --git a/lean/OOCert/ConformingWitness.lean b/lean/OOCert/ConformingWitness.leannew file mode 100644index 00000000..fbe0382c--- /dev/null+++ b/lean/OOCert/ConformingWitness.lean@@ -0,0 +1,567 @@+import OOCert.Conforming++/-!+# A conforming interpretation, and something it does not entail++`Conforming.lean` proves a bridge over a structure. A structure nothing+satisfies proves nothing, and a structure satisfied only by something degenerate+proves very little, so this file exhibits one and then says exactly how much of+it is alive.++## The model++Two elements. `hub` carries the RDFS vocabulary; `rim` absorbs everything else.++* `IEXT(hub)` is every pair EXCEPT `( hub , rim )`. `IEXT(rim)` is empty.+* `I(u) = hub` for `rdf:type`, `rdf:Property`, `rdfs:Class`, `rdfs:Resource`,+ `rdfs:subClassOf`, `rdfs:subPropertyOf`, `rdfs:domain`, `rdfs:range` and+ `owl:Thing`; `I(u) = rim` for every other term, every blank node and every+ literal.+* `IP` is the whole carrier.++Everything else follows. `ICEXT(hub)` is the whole carrier and `ICEXT(rim)` is+`{ rim }`, so `IC` is the whole carrier and `ICEXT(I(rdfs:Class)) = IC`,+`ICEXT(I(rdf:Property)) = IP`, `ICEXT(I(rdfs:Resource)) = IR` and+`ICEXT(I(owl:Thing)) = IR` all hold. The first of those four rows of RBS Table+5.2 cannot fail in any `Interpretation`, because `IC` is DEFINED as+`ICEXT(I(rdfs:Class))`; the other three are checked, and they are three rows that+`W3CWitness.lean`'s `live` records itself as violating.++## What is alive here and what is not++**Table 5.8 is alive in both directions and it is alive because it is+CONSTRAINING.** `IEXT(I(rdfs:subClassOf))` holds three of the four possible+pairs. The missing one, `( hub , rim )`, is missing because `ICEXT(hub)` is not+contained in `ICEXT(rim)`, and the forward direction forbids it; the present+one, `( rim , hub )`, is present because `ICEXT(rim) ⊆ ICEXT(hub)` and the+backward direction forces it. `two_table58_separates` and+`two_table58_forces` are those two facts, checked. A model in which every+relation is total satisfies Table 5.8 for no reason at all and distinguishes+nothing; this one does not.++The same three-of-four shape holds for `rdfs:subPropertyOf`, `rdfs:domain` and+`rdfs:range`, and the reason differs in each case, which is what+`two_table58_row_reasons` records.++**The OWL vocabulary is dead here and the report says so rather than implying+otherwise.** Every OWL term denotes `rim`, whose extension is empty, so Table+5.6's three rows, Table 5.9's three, Table 5.12, and the `owl:someValuesFrom`,+`owl:allValuesFrom` and `owl:onProperty` typing rows of Table 5.3 hold for want+of anything to test. `two_dead_fields` is that list, as a theorem, so it cannot+drift from the file. Table 5.13's two rows and Table 5.2's `owl:Restriction` row+DO fire, at `rim`.++Bringing the OWL vocabulary to life inside a model that also satisfies the+axiomatic triples is the obvious next witness and it is not this one. It is not+a small change: the axiomatic triples force `I(rdf:type)`, `I(rdfs:domain)` and+`I(rdfs:range)` into a mutual fixpoint with `IEXT`, and `W3CWitness.lean`'s+`live` needs twenty-six elements to keep that fixpoint apart from the OWL+configuration while carrying no axiomatic triple at all.++## The axiomatic triples, all of them++This model satisfies EVERY RDF axiom of RDF11 section 8 and EVERY RDFS axiomatic+triple of RDF11 section 9, not just the five that `Conforming` carries, and+`two_satisfies_every_listed_axiomatic_triple` checks the whole table by+`decide`. The reason is structural rather than lucky: every axiomatic triple's+predicate is one of `rdf:type`, `rdfs:domain`, `rdfs:range`, `rdfs:subClassOf`+and `rdfs:subPropertyOf`, all of which denote `hub`, and the only pair `IEXT(hub)`+omits is `( hub , rim )`, which would need an axiomatic triple whose subject is+one of the nine `hub` terms and whose object is not. There is none.++## What this does NOT establish++It does not establish that a fully conforming OWL 2 RDF-Based interpretation+exists in Lean, because `Conforming` is a subset of the Recommendation's+conditions. The rows this model is known to violate are listed at+`two_violates_these_known_rows`. The satisfiability of the FULL Recommendation is+a different and much larger question and nothing here touches it.++It also does not turn any non-entailment below into a claim about OWL 2+RDF-Based entailment, for the same reason: a `Conforming` structure need not be+a conforming interpretation.+-/+namespace OOCert++/-! ## The carrier -/++/-- Two elements. `hub` is where the RDFS vocabulary lands and `rim` is+everything else. -/+inductive Two+ | hub | rim+ deriving DecidableEq, Repr++namespace Two++/-- Both of them. -/+def all : List Two := [.hub, .rim]++theorem mem_all (w : Two) : w ∈ all := by cases w <;> decide++/-- Universal quantification over the carrier is decidable, so every condition+below is settled by `decide` rather than by a tactic script that might be+proving something adjacent to what it says. Same device as+`W3CWitness.lean`'s `LiveD.decForall`, over two elements instead of+twenty-six. -/+instance decForall (p : Two → Prop) [DecidablePred p] : Decidable (∀ w, p w) :=+ decidable_of_iff (∀ w ∈ all, p w) ⟨fun h w => h w (mem_all w), fun h w _ => h w⟩++/-- And so is existential quantification. -/+instance decExists (p : Two → Prop) [DecidablePred p] : Decidable (∃ w, p w) :=+ decidable_of_iff (∃ w ∈ all, p w)+ ⟨fun ⟨w, _, h⟩ => ⟨w, h⟩, fun ⟨w, h⟩ => ⟨w, mem_all w, h⟩⟩++end Two++/-- `IEXT(hub)`, as a relation on the carrier: every pair but `( hub , rim )`.++That one omission is the whole content of the model. Put it back and Table 5.8's+forward direction fails at `rdfs:subClassOf`, because `ICEXT(hub)` is the whole+carrier and `ICEXT(rim)` is not. Take another pair out and the backward+direction fails. -/+def twoR : Two → Two → Bool+ | .hub, .rim => false+ | _, _ => true++/-- `IEXT`. Only `hub` has a non-empty extension. -/+def twoIEXT : Two → Two → Two → Bool+ | .hub, x, y => twoR x y+ | .rim, _, _ => false++/-- `IP`, the whole carrier. RDF11 section 9 is explicit that this is allowed:+"RDFS does not partition the universe into disjoint categories of classes,+properties and individuals … it also permits classes which contain themselves+and properties which apply to themselves." -/+def twoIP : Two → Bool := fun _ => true++/-- `owl:Thing`. Local to this file: no condition in `Conforming` mentions it,+and it is here only so that `two_satisfies_table_52_identity_rows` can check RBS+Table 5.2's `owl:Thing | ∈ IC | = IR` row. -/+def owlThing : Term := "<http://www.w3.org/2002/07/owl#Thing>"++/-- The nine terms that denote `hub`. Eight of them are forced: they are the+subjects and objects of the five axiomatic triples `Conforming` carries, read+through `IEXT(hub)`. `owl:Thing` is the ninth and is free. -/+def twoHubTerms : List Term :=+ [V.type, V.Property, V.Class, V.Resource,+ V.subClassOf, V.subPropertyOf, V.domain, V.range, owlThing]++/-- `IS`. -/+def twoIS (t : Term) : Two := if twoHubTerms.contains t then .hub else .rim++/-- The interpretation. `@[reducible]` so that instance search can see+`two.IR` as `Two`; without it every `Decidable` instance below fails to fire. -/+@[reducible] def two : Interpretation where+ IR := Two+ IP := fun p => twoIP p = true+ IEXT := fun p x y => twoIEXT p x y = true+ IS := twoIS+ IB := fun _ => .rim+ IL := fun _ => .rim++/-! ## The conditions, checked++Every lemma in this section is stated over the `Bool` tables and never over a+term, so `decide` never has to compare a fifty-character IRI. The denotations+are resolved once, where each lemma is used as a field of `two_conforming`, by+definitional unfolding. `W3CWitness.lean` does the opposite: its conditions carry+`liveι V.domain` inside four nested quantifiers over a much larger carrier, which+is why that file raises `maxRecDepth` and `maxHeartbeats` and takes minutes to+elaborate. This one takes under a minute over two elements, and the difference is+where the strings are. -/++/-- `IEXT(rim)` is empty, which is what makes every OWL row below vacuous. -/+theorem two_rim_empty : ∀ z s : Two, ¬ (twoIEXT .rim z s = true) := by decide++theorem two_sc_fwd' : ∀ a b : Two, twoIEXT .hub a b = true →+ twoIEXT .hub a .hub = true ∧ twoIEXT .hub b .hub = true ∧+ ∀ x : Two, twoIEXT .hub x a = true → twoIEXT .hub x b = true := by decide++theorem two_sc_bwd' : ∀ a b : Two, twoIEXT .hub a .hub = true →+ twoIEXT .hub b .hub = true →+ (∀ x : Two, twoIEXT .hub x a = true → twoIEXT .hub x b = true) →+ twoIEXT .hub a b = true := by decide++theorem two_sp_fwd' : ∀ a b : Two, twoIEXT .hub a b = true →+ twoIP a = true ∧ twoIP b = true ∧+ ∀ x y : Two, twoIEXT a x y = true → twoIEXT b x y = true := by decide++theorem two_sp_bwd' : ∀ a b : Two, twoIP a = true → twoIP b = true →+ (∀ x y : Two, twoIEXT a x y = true → twoIEXT b x y = true) →+ twoIEXT .hub a b = true := by decide++theorem two_dom_fwd' : ∀ p c : Two, twoIEXT .hub p c = true →+ twoIP p = true ∧ twoIEXT .hub c .hub = true ∧+ ∀ x y : Two, twoIEXT p x y = true → twoIEXT .hub x c = true := by decide++theorem two_dom_bwd' : ∀ p c : Two, twoIP p = true → twoIEXT .hub c .hub = true →+ (∀ x y : Two, twoIEXT p x y = true → twoIEXT .hub x c = true) →+ twoIEXT .hub p c = true := by decide++theorem two_rng_fwd' : ∀ p c : Two, twoIEXT .hub p c = true →+ twoIP p = true ∧ twoIEXT .hub c .hub = true ∧+ ∀ x y : Two, twoIEXT p x y = true → twoIEXT .hub y c = true := by decide++theorem two_rng_bwd' : ∀ p c : Two, twoIP p = true → twoIEXT .hub c .hub = true →+ (∀ x y : Two, twoIEXT p x y = true → twoIEXT .hub y c = true) →+ twoIEXT .hub p c = true := by decide++/-- RBS Table 5.13's two rows and Table 5.2's `owl:Restriction` row fire at+`rim`, whose class extension contains it. They are not vacuous. -/+theorem two_sym_fwd' : ∀ p : Two, twoIEXT .hub p .rim = true →+ ∀ x y : Two, twoIEXT p x y = true → twoIEXT p y x = true := by decide++theorem two_trp_fwd' : ∀ p : Two, twoIEXT .hub p .rim = true →+ ∀ x y z : Two, twoIEXT p x y = true → twoIEXT p y z = true →+ twoIEXT p x z = true := by decide++theorem two_restr_IC' : ∀ x : Two, twoIEXT .hub x .rim = true →+ twoIEXT .hub x .hub = true := by decide++/-- **The conforming interpretation.** -/+theorem two_conforming : Conforming two where+ IR_nonempty := ⟨.hub⟩+ ax_type := ⟨rfl, rfl⟩+ ax_subClassOf := ⟨rfl, rfl⟩+ ax_subPropertyOf := ⟨rfl, rfl⟩+ ax_domain := ⟨rfl, rfl⟩+ ax_range := ⟨rfl, rfl⟩+ sc_fwd := two_sc_fwd'+ sc_bwd := two_sc_bwd'+ sp_fwd := two_sp_fwd'+ sp_bwd := two_sp_bwd'+ dom_fwd := two_dom_fwd'+ dom_bwd := two_dom_bwd'+ rng_fwd := two_rng_fwd'+ rng_bwd := two_rng_bwd'+ same_fwd := fun a b h => absurd h (two_rim_empty a b)+ eqc_fwd := fun a b h => absurd h (two_rim_empty a b)+ eqp_fwd := fun a b h => absurd h (two_rim_empty a b)+ inv_fwd := fun p q h => absurd h (two_rim_empty p q)+ sym_fwd := two_sym_fwd'+ trp_fwd := two_trp_fwd'+ svf_eq := fun z c _ h => absurd h (two_rim_empty z c)+ avf_eq := fun z c _ h => absurd h (two_rim_empty z c)+ hv_eq := fun z a _ h => absurd h (two_rim_empty z a)+ restr_IC := two_restr_IC'+ svf_typ := fun z c h => absurd h (two_rim_empty z c)+ avf_typ := fun z c h => absurd h (two_rim_empty z c)+ onp_typ := fun z p h => absurd h (two_rim_empty z p)+ int_fwd := fun z s _ h => absurd h (two_rim_empty z s)+ uni_fwd := fun z s _ h => absurd h (two_rim_empty z s)+ oneOf_fwd := fun z s _ h => absurd h (two_rim_empty z s)++/-! ## How much of it is alive++Decidability instances first, so that every liveness fact below is settled by+`decide` on the model's own tables and not by a tactic script. -/++instance decTwoIP {p : two.IR} : Decidable (two.IP p) :=+ inferInstanceAs (Decidable (twoIP p = true))++instance decTwoIEXT {p x y : two.IR} : Decidable (two.IEXT p x y) :=+ inferInstanceAs (Decidable (twoIEXT p x y = true))++instance decTwoICEXT {c x : two.IR} : Decidable (two.ICEXT c x) :=+ inferInstanceAs (Decidable (twoIEXT (twoIS V.type) x c = true))++instance decTwoIC {c : two.IR} : Decidable (two.IC c) :=+ inferInstanceAs (Decidable (twoIEXT (twoIS V.type) c (twoIS V.Class) = true))++instance decTwoSat {t : Triple} : Decidable (two.Sat t) :=+ inferInstanceAs (Decidable+ (twoIP (two.den t.p) = true ∧ twoIEXT (two.den t.p) (two.den t.s) (two.den t.o) = true))++/-- **Table 5.8's forward direction SEPARATES a pair.** `( hub , rim )` is not+in `IEXT(I(rdfs:subClassOf))`, and the reason is the one the table gives:+`ICEXT(hub)` is not contained in `ICEXT(rim)`, because `rim` is a class whose+extension holds only itself while `hub`'s holds everything.++This is the fact a saturated model cannot have. It is what makes the forward+direction of Table 5.8 do work here rather than hold by accident. -/+theorem two_table58_separates :+ ¬ two.IEXT (two.IS V.subClassOf) .hub .rim ∧+ two.ICEXT .hub .hub ∧ ¬ two.ICEXT .rim .hub := by decide++/-- **Table 5.8's backward direction FORCES a pair.** `( rim , hub )` IS in+`IEXT(I(rdfs:subClassOf))`, and nothing put it there by hand: `rim` and `hub`+are both classes and `ICEXT(rim) ⊆ ICEXT(hub)`, so the backward direction of the+`iff` demands the triple. -/+theorem two_table58_forces :+ two.IC .rim ∧ two.IC .hub ∧ (∀ x : Two, two.ICEXT .rim x → two.ICEXT .hub x) ∧+ two.IEXT (two.IS V.subClassOf) .rim .hub := by decide++/-- Each of Table 5.8's four rows holds exactly three of the four pairs, and the+pair each one omits is omitted for its own reason: extension containment for+`rdfs:subClassOf`, property-extension containment for `rdfs:subPropertyOf`, and+the subject and object clauses for `rdfs:domain` and `rdfs:range`. The four rows+therefore agree here, and they agree because each is separately satisfied rather+than because the model cannot tell them apart. -/+theorem two_table58_row_reasons :+ (¬ two.IEXT (two.IS V.subClassOf) .hub .rim) ∧+ (¬ two.IEXT (two.IS V.subPropertyOf) .hub .rim) ∧+ (¬ two.IEXT (two.IS V.domain) .hub .rim) ∧+ (¬ two.IEXT (two.IS V.range) .hub .rim) ∧+ two.IEXT (two.IS V.subClassOf) .rim .rim ∧+ two.IEXT (two.IS V.subPropertyOf) .rim .rim ∧+ two.IEXT (two.IS V.domain) .rim .rim ∧+ two.IEXT (two.IS V.range) .rim .rim := by decide++/-- **The fields that hold for want of anything to test, as a list.** Every OWL+term denotes `rim` and `IEXT(rim)` is empty, so these antecedents have no+instances. Kept as a theorem so that a later edit which brings one of them to+life has to update this list rather than quietly leaving it stale. -/+theorem two_dead_fields :+ (∀ a b, ¬ two.IEXT (two.IS V.sameAs) a b) ∧+ (∀ a b, ¬ two.IEXT (two.IS V.equivalentClass) a b) ∧+ (∀ a b, ¬ two.IEXT (two.IS V.equivalentProperty) a b) ∧+ (∀ p q, ¬ two.IEXT (two.IS V.inverseOf) p q) ∧+ (∀ z c, ¬ two.IEXT (two.IS V.someValuesFrom) z c) ∧+ (∀ z c, ¬ two.IEXT (two.IS V.allValuesFrom) z c) ∧+ (∀ z a, ¬ two.IEXT (two.IS V.hasValue) z a) ∧+ (∀ z p, ¬ two.IEXT (two.IS V.onProperty) z p) ∧+ (∀ z s, ¬ two.IEXT (two.IS V.intersectionOf) z s) ∧+ (∀ z s, ¬ two.IEXT (two.IS V.unionOf) z s) ∧+ (∀ z s, ¬ two.IEXT (two.IS V.oneOf) z s) :=+ ⟨two_rim_empty, two_rim_empty, two_rim_empty, two_rim_empty, two_rim_empty,+ two_rim_empty, two_rim_empty, two_rim_empty, two_rim_empty, two_rim_empty,+ two_rim_empty⟩++/-- **The fields that do fire.** Table 5.13's two rows have `rim` in the class+extension they read, and Table 5.2's `owl:Restriction` row has `rim` in+`ICEXT(I(owl:Restriction))`, so all three are applied at a real instance rather+than held vacuously. -/+theorem two_live_fields :+ two.ICEXT (two.IS V.symmetricProperty) .rim ∧+ two.ICEXT (two.IS V.transitiveProperty) .rim ∧+ two.ICEXT (two.IS V.Restriction) .rim ∧ two.IC .rim := by decide++/-! ## The identity rows of RBS Table 5.2, which the existing witness misses -/++/-- Three rows of RBS Table 5.2, and one semantic condition of RDF11 section 8.++> `rdf:Property | ∈ IC | = IP`+> `rdfs:Resource | ∈ IC | = IR`+> `owl:Thing | ∈ IC | = IR`++The first of those is also RDF11 section 8's first RDF semantic condition, "x is+in IP if and only if `< x, I(rdf:Property) >` is in IEXT(I(rdf:type))", which+section 9 restates as "IP = ICEXT(I(rdf:Property))".++None of the three is a field of `Conforming`, because no rule consumes any of+them, and `W3CWitness.lean`'s `live` records itself as violating all three. They+are checked here because a witness that satisfies more of the Recommendation+than it was asked to is worth more than one that satisfies exactly what it was+asked to.++Table 5.2's fourth identity row, `rdfs:Class | ∈ IC | = IC`, is not checked+because it cannot fail: `Interpretation.IC` is DEFINED as+`ICEXT(I(rdfs:Class))`, following RDF11 section 9, so the row holds in every+`Interpretation` by construction. -/+theorem two_satisfies_table_52_identity_rows :+ (∀ p : Two, two.ICEXT (two.IS V.Property) p ↔ two.IP p) ∧+ (∀ x : Two, two.ICEXT (two.IS V.Resource) x) ∧+ (∀ x : Two, two.ICEXT (two.IS owlThing) x) := by decide++/-! ## Every axiomatic triple, not only the five++RDF11 section 8's RDF axioms and section 9's RDFS axiomatic triples, transcribed+from the raw HTML on 15 September 2026. The `rdf:_1` and `rdf:_2` rows stand for+the infinite container-membership families; both tables end in "…". -/++/-- The RDF axioms of RDF11 section 8 and the RDFS axiomatic triples of section+9, in the order the Recommendation lists them. -/+def axiomaticTriples : List Triple :=+ let rdf := fun (s : String) => "<http://www.w3.org/1999/02/22-rdf-syntax-ns#" ++ s ++ ">"+ let rdfs := fun (s : String) => "<http://www.w3.org/2000/01/rdf-schema#" ++ s ++ ">"+ -- RDF axioms, section 8.+ [ ⟨rdf "type", rdf "type", rdf "Property"⟩,+ ⟨rdf "subject", rdf "type", rdf "Property"⟩,+ ⟨rdf "predicate", rdf "type", rdf "Property"⟩,+ ⟨rdf "object", rdf "type", rdf "Property"⟩,+ ⟨rdf "first", rdf "type", rdf "Property"⟩,+ ⟨rdf "rest", rdf "type", rdf "Property"⟩,+ ⟨rdf "value", rdf "type", rdf "Property"⟩,+ ⟨rdf "nil", rdf "type", rdf "List"⟩,+ ⟨rdf "_1", rdf "type", rdf "Property"⟩,+ ⟨rdf "_2", rdf "type", rdf "Property"⟩,+ -- RDFS axiomatic triples, section 9: the rdfs:domain block.+ ⟨rdf "type", rdfs "domain", rdfs "Resource"⟩,+ ⟨rdfs "domain", rdfs "domain", rdf "Property"⟩,+ ⟨rdfs "range", rdfs "domain", rdf "Property"⟩,+ ⟨rdfs "subPropertyOf", rdfs "domain", rdf "Property"⟩,+ ⟨rdfs "subClassOf", rdfs "domain", rdfs "Class"⟩,+ ⟨rdf "subject", rdfs "domain", rdf "Statement"⟩,+ ⟨rdf "predicate", rdfs "domain", rdf "Statement"⟩,+ ⟨rdf "object", rdfs "domain", rdf "Statement"⟩,+ ⟨rdfs "member", rdfs "domain", rdfs "Resource"⟩,+ ⟨rdf "first", rdfs "domain", rdf "List"⟩,+ ⟨rdf "rest", rdfs "domain", rdf "List"⟩,+ ⟨rdfs "seeAlso", rdfs "domain", rdfs "Resource"⟩,+ ⟨rdfs "isDefinedBy", rdfs "domain", rdfs "Resource"⟩,+ ⟨rdfs "comment", rdfs "domain", rdfs "Resource"⟩,+ ⟨rdfs "label", rdfs "domain", rdfs "Resource"⟩,+ ⟨rdf "value", rdfs "domain", rdfs "Resource"⟩,+ -- the rdfs:range block.+ ⟨rdf "type", rdfs "range", rdfs "Class"⟩,+ ⟨rdfs "domain", rdfs "range", rdfs "Class"⟩,+ ⟨rdfs "range", rdfs "range", rdfs "Class"⟩,+ ⟨rdfs "subPropertyOf", rdfs "range", rdf "Property"⟩,+ ⟨rdfs "subClassOf", rdfs "range", rdfs "Class"⟩,+ ⟨rdf "subject", rdfs "range", rdfs "Resource"⟩,+ ⟨rdf "predicate", rdfs "range", rdfs "Resource"⟩,+ ⟨rdf "object", rdfs "range", rdfs "Resource"⟩,+ ⟨rdfs "member", rdfs "range", rdfs "Resource"⟩,+ ⟨rdf "first", rdfs "range", rdfs "Resource"⟩,+ ⟨rdf "rest", rdfs "range", rdf "List"⟩,+ ⟨rdfs "seeAlso", rdfs "range", rdfs "Resource"⟩,+ ⟨rdfs "isDefinedBy", rdfs "range", rdfs "Resource"⟩,+ ⟨rdfs "comment", rdfs "range", rdfs "Literal"⟩,+ ⟨rdfs "label", rdfs "range", rdfs "Literal"⟩,+ ⟨rdf "value", rdfs "range", rdfs "Resource"⟩,+ -- the rdfs:subClassOf and rdfs:subPropertyOf blocks.+ ⟨rdf "Alt", rdfs "subClassOf", rdfs "Container"⟩,+ ⟨rdf "Bag", rdfs "subClassOf", rdfs "Container"⟩,+ ⟨rdf "Seq", rdfs "subClassOf", rdfs "Container"⟩,+ ⟨rdfs "ContainerMembershipProperty", rdfs "subClassOf", rdf "Property"⟩,+ ⟨rdfs "isDefinedBy", rdfs "subPropertyOf", rdfs "seeAlso"⟩,+ ⟨rdfs "Datatype", rdfs "subClassOf", rdfs "Class"⟩,+ -- the container-membership block.+ ⟨rdf "_1", rdf "type", rdfs "ContainerMembershipProperty"⟩,+ ⟨rdf "_1", rdfs "domain", rdfs "Resource"⟩,+ ⟨rdf "_1", rdfs "range", rdfs "Resource"⟩,+ ⟨rdf "_2", rdf "type", rdfs "ContainerMembershipProperty"⟩,+ ⟨rdf "_2", rdfs "domain", rdfs "Resource"⟩,+ ⟨rdf "_2", rdfs "range", rdfs "Resource"⟩ ]++/-- **Every listed axiomatic triple is true here**, not only the five that+`Conforming` carries. Fifty-four triples, checked one by one. -/+theorem two_satisfies_every_listed_axiomatic_triple :+ ∀ t ∈ axiomaticTriples, two.Sat t := by decide++/-- There are fifty-four of them, so that shortening the list to make a `decide`+cheaper breaks this rather than passing quietly. -/+theorem axiomaticTriples_count : axiomaticTriples.length = 54 := by decide++/-! ## Something it does not entail -/++/-- An ordinary IRI, denoting `rim`. -/+def exA : Term := "<http://example.org/a>"+/-- A second one. -/+def exB : Term := "<http://example.org/b>"+/-- A third, used as a predicate. Its denotation is `rim`, whose extension is+empty, so no triple with this predicate is true here. -/+def exP : Term := "<http://example.org/p>"+/-- A fourth, used as a class. -/+def exC : Term := "<http://example.org/C>"+/-- A fifth, used as a superclass. -/+def exD : Term := "<http://example.org/D>"++/-! ## And something it does entail++A non-entailment on its own leaves open that `ConformingEntails` is empty, which+would make `certificate_conforming_sound` true and useless. This is the other+side: one OWL 2 RL rule, `rdfs9`, at a concrete instance, true in every+conforming interpretation of its premises.++It is stated through `ConformingEntails.of_entails`, which is the same route+`certificate_conforming_sound` takes, so what it exercises is the bridge and not+a shortcut past it. `checkCert` itself is not run here for the reason+`Mixed.lean` gives at its own `decide` boundary: `checkCert` carries its derived+set in a `Std.HashSet`, and deciding a `checkCert` application would put+`Lean.ofReduceBool` on the trust surface. -/++/-- **`rdfs9` is sound in every conforming interpretation**, at one instance:+from `ex:a rdf:type ex:C` and `ex:C rdfs:subClassOf ex:D`, every conforming+interpretation of those two triples satisfies `ex:a rdf:type ex:D`.++The proof goes through `Entails` and `ConformingEntails.of_entails`, so the+bridge carries it; nothing about the two-element model is used. -/+theorem rdfs9_holds_in_every_conforming_interpretation :+ ConformingEntails [⟨exA, V.type, exC⟩, ⟨exC, V.subClassOf, exD⟩]+ ⟨exA, V.type, exD⟩ :=+ ConformingEntails.of_entails (fun I M =>+ M.conds.sc_sub (I.ι exC) (I.ι exD)+ (M.facts ⟨exC, V.subClassOf, exD⟩ (List.Mem.tail _ (List.Mem.head _)))+ (I.ι exA)+ (M.facts ⟨exA, V.type, exC⟩ (List.Mem.head _)))++/-- **The empty graph does not conforming-entail everything.** The predicate of+the conclusion denotes `rim` and `IEXT(rim)` is empty, so the triple is false in+this interpretation and the empty graph is satisfied by it.++`Witness.lean`'s `not_everything_is_entailed` is the same shape over the much+larger `Conditions` class, and `W3CWitness.lean`'s+`not_everything_is_w3c_entailed` over `W3CModel`. This one is over the smallest+class of the three, which makes it the strongest of the three. -/+theorem not_everything_is_conforming_entailed :+ ¬ ConformingEntails [] ⟨exA, exP, exB⟩ := by+ intro h+ exact absurd (h two two_conforming (fun _ hm => nomatch hm)).2 (by decide)++/-- **A non-entailment from a graph the interpretation actually satisfies**,+which the previous one does not deliver: `ex:a rdf:type ex:C` holds here, and+`rdf:type rdf:type ex:C` does not, because `( hub , rim )` is the one pair+`IEXT(hub)` omits.++The rule `rdfs9` would draw the second from the first together with+`ex:C rdfs:subClassOf ex:C`, which is also true here; what fails is the step from+a typing of `ex:a` to a typing of `rdf:type`, and nothing licenses it. -/+theorem a_typed_individual_does_not_type_rdf_type :+ two.Sat ⟨exA, V.type, exC⟩ ∧ ¬ two.Sat ⟨V.type, V.type, exC⟩ ∧+ ¬ ConformingEntails [⟨exA, V.type, exC⟩] ⟨V.type, V.type, exC⟩ := by+ refine ⟨by decide, by decide, ?_⟩+ intro h+ have hsat := h two two_conforming (fun u hu => by+ cases hu with+ | head => exact (by decide : two.Sat ⟨exA, V.type, exC⟩)+ | tail _ hm => exact nomatch hm)+ exact absurd hsat (by decide)++/-! ## What this model is known NOT to satisfy++Stated as a theorem for the same reason the vacuity list is: a limitation that+lives only in prose is a limitation that goes stale. -/++/-- RBS Table 5.2 gives `owl:Nothing` the row `owl:Nothing | ∈ IC | = ∅`, and+this model violates it: `owl:Nothing` denotes `rim`, whose class extension+contains `rim`. It is not a field of `Conforming`, because no rule consumes it,+which is exactly why this model can exist while a fully conforming+interpretation would need more elements.++This is the shape of every remaining gap between `Conforming` and the+Recommendation: a row nothing consumes, left out because leaving it out enlarges+the class, and therefore a row this witness is free to break. -/+theorem two_violates_these_known_rows :+ two.ICEXT (two.IS "<http://www.w3.org/2002/07/owl#Nothing>") .rim := by decide++/-! ## The axiom tripwire++`decide` in core Lean is checked by the kernel and adds no axiom. `native_decide`+would add `Lean.ofReduceBool`, and a `sorry` would add `sorryAx`, so pinning the+footprint here is what keeps every `decide` in this file honest. The three+listed are Lean's own and reach here through `String.data`, which `termKind`+reads to tell an IRI from a literal.+-/++/-- info: 'OOCert.two_conforming' depends on axioms: [propext, Classical.choice, Quot.sound] -/+#guard_msgs in+#print axioms two_conforming++/-- info: 'OOCert.two_satisfies_every_listed_axiomatic_triple' depends on axioms: [propext, Classical.choice, Quot.sound] -/+#guard_msgs in+#print axioms two_satisfies_every_listed_axiomatic_triple++/-- info: 'OOCert.not_everything_is_conforming_entailed' depends on axioms: [propext, Classical.choice, Quot.sound] -/+#guard_msgs in+#print axioms not_everything_is_conforming_entailed++/-- info: 'OOCert.a_typed_individual_does_not_type_rdf_type' depends on axioms: [propext, Classical.choice, Quot.sound] -/+#guard_msgs in+#print axioms a_typed_individual_does_not_type_rdf_type++/-- info: 'OOCert.rdfs9_holds_in_every_conforming_interpretation' depends on axioms: [propext, Classical.choice, Quot.sound] -/+#guard_msgs in+#print axioms rdfs9_holds_in_every_conforming_interpretation++end OOCertdiff --git a/lean/OOCert/Refute.lean b/lean/OOCert/Refute.leanindex 5c2e804f..1a90cb94 100644--- a/lean/OOCert/Refute.lean+++ b/lean/OOCert/Refute.lean@@ -408,8 +408,8 @@ theorem joint_model_of_closure {G : List Triple} {D : Triple → Prop}/-- A graph with a joint model is not refutable, so `refutation_sound` is not atheorem about an empty model class.-**Relative to `Conditions` and `RefuteConditions`, and it does not transfer to-the OWL 2 RDF-Based Semantics.** This note is here rather than only in+**Relative to `Conditions` and `RefuteConditions`, and it is not itself the+statement over the OWL 2 RDF-Based Semantics conditions.** This note is here rather than only in`Semantics.lean` because a caveat that lives in one file is a caveat that goesstale; until 15 September 2026 this one did, and this file was byte-identical tothe version that predates `lean/OOCert/W3C.lean`.@@ -421,9 +421,15 @@ useless way for this one: `refutation_sound`'s `Unsat G` does transfer, becauseevery `W3CModel` of `G` is a `Model` of `G`, so an accepted refutation rules outconforming interpretations too. A `¬ Unsat` needs a `W3CModel` that alsosatisfies `RefuteConditions`, and neither this lemma nor-`RefuteWitness.lean`'s `feed_is_not_refuted` supplies one. The obstruction for-`feed` in particular is checked at-`RefuteWitness.lean`'s `feed_closure_misses_the_class_typing`. -/+`RefuteWitness.lean`'s `feed_is_not_refuted` supplies one.++`RefuteWitness.lean` now does supply one, and this lemma is the shape it takes+over there: `W3CUnsat` is `Unsat` over the smaller class, `w3cUnsat_of_unsat`+is the transfer that does run, `not_w3cUnsat_of_joint_w3c_model` is this lemma's+counterpart, and `feed_is_not_w3c_refuted` is the result. The obstruction that+used to be recorded here, that `feedClosure` types nothing as an `rdfs:Class` and+so `W3C.sc_fwd` fails on it, was a fact about the HERBRAND witness and not about+the statement; a thirteen-element model built for it settles the statement. -/theorem not_unsat_of_joint_model {G : List Triple}(h : ∃ I : Interp, Model I G ∧ RefuteConditions I) : ¬ Unsat G := byobtain ⟨I, hM, hR⟩ := hdiff --git a/lean/OOCert/RefuteWitness.lean b/lean/OOCert/RefuteWitness.leanindex ed5e57b7..65a7fbb4 100644--- a/lean/OOCert/RefuteWitness.lean+++ b/lean/OOCert/RefuteWitness.lean@@ -1,5 +1,6 @@import OOCert.Refuteimport OOCert.W3C+import OOCert.Witness/-!# Witnesses for the refutation layer@@ -29,6 +30,9 @@ every class, violates it. The witness has to be rebuilt, not reused.| six `rejects_*` theorems | six ways to forge a refutation, each caught || `an_ordinary_certificate_is_worthless_over_the_refuted_graph` | the explosion, stated for the graph above || `and_the_old_verdict_does_not_notice` | and `Entails` does not notice, which is the trap |+| `w3cUnsat_of_unsat` | a refutation rules out the interpretations meeting the W3C tables too, which is the easy direction |+| `feed_is_not_w3c_refuted` | and the hard one: a thirteen-element model of `feed` that meets those tables AND respects disjointness |+| `the_old_verdict_does_not_notice_over_w3c` | the trap again, over that same class, on the same carrier with one row changed |## The one hypothesis the general theorem carries, named rather than hidden@@ -490,46 +494,34 @@ private theorem feed_closure_has_no_clash :¬(t.p = RV.disjointWith ∧ u.p = V.type ∧ u.o = t.s ∧v.p = V.type ∧ v.o = t.o ∧ v.s = u.s) := by decide-/-! `feed_is_not_refuted` below is about `Semantics.lean`'s `Conditions`, not-about the OWL 2 RDF-Based Semantics, and this is where that is recorded. Until-15 September 2026 it was recorded only in `Semantics.lean`'s docstring, with a-reason that turned out to be wrong; this file was byte-identical to the one that-predates `W3C.lean` while that docstring said the caveat sat "at the point of the-assumption".--Two things stop the transfer and they are different in kind.--FIRST, the direction. `Unsat G` is a universal negative over a model class, so a-SMALLER class makes it EASIER to hold and `¬ Unsat` harder. Positive refutations-transfer outward for free, because `W3CModel I IP G → Model I G`; `¬ Unsat` does-not, and would need a `W3CModel` that also satisfies `RefuteConditions`.--SECOND, this particular interpretation is not one. `feed` carries-`Lion rdfs:subClassOf Carnivore` and types nothing as an `rdfs:Class`, so-`W3C.sc_fwd`, Table 5.8 row 1 forward, fails: its conclusion demands-`Lion ∈ IC`. `sc_fwd` mentions no `IP`, so the `IP := fun _ => False` reading-that carries four other non-entailments in this repository over to the conforming-class does not help here. -/--/-- The obstruction, checked rather than asserted. The closure has the-`rdfs:subClassOf` triple that fires `W3C.sc_fwd` and no typing to satisfy the-`IC` conjunct that field concludes, so no choice of `IP` makes-`herbrandL feedClosure` a `W3CModel`.--`V.Class` is taken from `W3C.lean` rather than respelled here, which is why this-file imports it: the IRI is the whole content of the theorem and a second copy of-it would be a second thing to keep in step. -/-theorem feed_closure_misses_the_class_typing :- ((⟨rLion, V.subClassOf, rCarnivore⟩ : Triple) ∈ feedClosure) ∧- (⟨rLion, V.type, V.Class⟩ : Triple) ∉ feedClosure := by decide-+/-! `feed_is_not_refuted` below is about `Semantics.lean`'s `Conditions` and not+about the conditions `W3C.lean` quotes out of the OWL 2 RDF-Based Semantics+tables, because the interpretation it uses is a Herbrand one. `feedClosure`+carries `Lion rdfs:subClassOf Carnivore` and types nothing as an `rdfs:Class`, so+`W3C.sc_fwd`, Table 5.8 row 1 forward, fails on the `Lion ∈ IC` conjunct it+concludes, for every choice of `IP`.++The direction of transfer runs the unhelpful way here as well. `Unsat G` is a+universal negative over a model class, so a SMALLER class makes it EASIER to hold+and `¬ Unsat` HARDER. Positive refutations transfer outward for free, because+`W3CModel I IP G → Model I G`, and `w3cUnsat_of_unsat` at the end of this file+records that; `¬ Unsat` needs a `W3CModel` that also satisfies `RefuteConditions`.++Such a model is built at the end of this file and `feed_is_not_w3c_refuted` is+the theorem it carries, which is strictly stronger than the statement below. The+statement below is kept because it is proved by a different route, through the+closure machinery rather than through a hand-built finite structure, so the two+fail in different ways if either is broken. Until 15 September 2026 the caveat+was recorded only in `Semantics.lean`'s docstring, with a reason that turned out+to be wrong, and this file was byte-identical to the one that predates+`W3C.lean`. -//-- **A graph with a disjointness axiom that is NOT refutable.** Without this therefutation layer would be consistent with a checker that accepts everything.-Relative to `Conditions` and to `RefuteConditions`, not to the specification's-model class; the paragraph above says what stops the transfer and-`feed_closure_misses_the_class_typing` pins it. -/+Relative to `Conditions` and to `RefuteConditions`. The same sentence over the+specification's model class is `feed_is_not_w3c_refuted` at the end of this+file, which is strictly stronger and implies this one. -/theorem feed_is_not_refuted : ¬ Unsat feed := byrefine not_unsat_of_joint_model (no_violation_means_a_joint_model feed feed_has_no_sameAs ?_)intro c1 c2 x h1 h2 h3@@ -581,23 +573,410 @@ refuted graph checks green and means nothing, and nothing in`certificate_sound` reports that. This is why `oo-refute guard` exists. -/theorem the_junk_triple_is_not_in_the_closure : rJunk ∉ grazeClosure := by decide-/-- The same obstruction as `feed_closure_misses_the_class_typing`, on the other-graph this file builds a model of. -/-theorem graze_closure_misses_the_class_typing :- ((⟨rLion, V.subClassOf, rCarnivore⟩ : Triple) ∈ grazeClosure) ∧- (⟨rLion, V.type, V.Class⟩ : Triple) ∉ grazeClosure := by decide--/-- About `Semantics.lean`'s `Conditions`, like every other negative result built-from a Herbrand interpretation here, and it is one of the four that does not-transfer to `W3CModel`. `grazeClosure` carries `Lion rdfs:subClassOf Carnivore`-and types nothing as an `rdfs:Class`, so `W3C.sc_fwd` fails on the `IC` conjunct-it concludes; `graze_closure_misses_the_class_typing` just above pins that, and the-field mentions no `IP`, so the empty-`IP` reading that carries four other-non-entailments over does not apply. -/+/-- About `Semantics.lean`'s `Conditions`, because the interpretation is a+Herbrand one and `grazeClosure` types nothing as an `rdfs:Class`, so `W3C.sc_fwd`+fails on the `IC` conjunct it concludes. The same sentence over the+specification's model class is `the_old_verdict_does_not_notice_over_w3c` at the+end of this file, on a finite structure built for it. -/theorem and_the_old_verdict_does_not_notice : ¬ Entails graze rJunk := fun h =>the_junk_triple_is_not_in_the_closure(h (herbrandL grazeClosure) (graze_closure_is_plain.model graze_inside_its_closure))+/-! ## The two remaining negative results, over the specification's model class++`feed_is_not_refuted` and `and_the_old_verdict_does_not_notice` are the last two+results in this repository that were about `Semantics.lean`'s `Conditions` and+not about the conditions `W3C.lean` quotes out of the tables. Until now the+reason was recorded as a checked obstruction: `feedClosure` and `grazeClosure`+both carry `Lion rdfs:subClassOf Carnivore` and type nothing as an `rdfs:Class`,+so `W3C.sc_fwd` fails on the `IC` conjunct it concludes, for every choice of+`IP`.++That obstruction was true and it was about the HERBRAND interpretations those two+theorems use. It was never an obstruction to the results themselves, and the+structure below settles both. It is the same kind of object as+`W3CWitness.lean`'s `live` and `svfI`: a hand-built finite model with the four+`rdfs:*` tables at the fixpoint Table 5.8's two directions force.++One carrier serves both graphs, because `feed` and `graze` differ by one triple+and the models differ by one row. `ICEXT(Herbivore)` is EMPTY over `feed` and+`{leo}` over `graze`, and everything else is shared, so the Boolean parameter+`leoH` below is exactly the difference between a graph with a model that respects+disjointness and a graph without one.++**The direction of transfer is the point, and it runs opposite ways for the two+theorems.** `W3CEntails` quantifies over a SMALLER class than `Entails`, so a+non-entailment over it is a STRONGER claim and needs its own witness, which is+`grazeI` below. `Unsat` is itself a universal negative over a model class, so+`W3CUnsat` is a WEAKER claim than `Unsat` and `¬ W3CUnsat` is the stronger one;+`w3cUnsat_of_unsat` records the easy half, and `feed_is_not_w3c_refuted` is the+half that needed the model. Both of the old statements follow from the new ones,+and `feed_is_not_refuted_via_the_w3c_model` derives one of them to show that nothing was+lost. -/++/-- The thirteen elements. One individual, three classes, seven vocabulary+denotations that have to be told apart, and a junk element absorbing every other+IRI with both extensions empty. -/+inductive RefD where+ /-- `leo`. -/+ | leo+ /-- `Herbivore`. Its class extension is EMPTY over `feed` and `{leo}` over+ `graze`, and that one row is the entire difference between the two models. -/+ | herb+ /-- `Carnivore`, with `ICEXT(Carnivore) = {leo}` in both, FORCED by+ `Lion rdfs:subClassOf Carnivore` through Table 5.8 row 1 forward. -/+ | carn+ /-- `Lion`, with `ICEXT(Lion) = {leo}`, asserted by both graphs. -/+ | lion+ /-- `rdf:type`. -/+ | ty+ /-- `rdfs:subClassOf`. -/+ | sco+ /-- `rdfs:subPropertyOf`. -/+ | spo+ /-- `rdfs:domain`, whose extension is empty in both models. -/+ | dm+ /-- `rdfs:range`, likewise. -/+ | rg+ /-- `owl:disjointWith`. `W3C` states no row for it, because no rule of the+ derivation checker consumes one; `RefuteConditions` is where its reading+ lives. -/+ | dw+ /-- `owl:sameAs`, carrying the diagonal, as RBS Table 5.9 row 1 requires. -/+ | sa+ /-- `rdfs:Class`. -/+ | cls+ /-- Every other IRI, the junk triple's three IRIs included, which is what makes+ that triple false here. -/+ | other+deriving DecidableEq, Repr++namespace RefD++/-- The carrier as a list, so quantification over it is decidable without+Mathlib. -/+def all : List RefD :=+ [leo, herb, carn, lion, ty, sco, spo, dm, rg, dw, sa, cls, other]++theorem mem_all (w : RefD) : w ∈ all := by cases w <;> decide++instance decForall (p : RefD → Prop) [DecidablePred p] : Decidable (∀ w, p w) :=+ decidable_of_iff (∀ w ∈ all, p w) ⟨fun h w => h w (mem_all w), fun h w _ => h w⟩++instance decExists (p : RefD → Prop) [DecidablePred p] : Decidable (∃ w, p w) :=+ decidable_of_iff (∃ w ∈ all, p w)+ ⟨fun ⟨w, _, h⟩ => ⟨w, h⟩, fun ⟨w, h⟩ => ⟨w, mem_all w, h⟩⟩++end RefD++/-- The denotations. Everything absent denotes `other`, `rJunk`'s three IRIs+included. -/+def refTable : List (Term × RefD) :=+ [ (V.type, .ty), (V.subClassOf, .sco), (V.subPropertyOf, .spo),+ (V.domain, .dm), (V.range, .rg), (V.sameAs, .sa), (V.Class, .cls),+ (RV.disjointWith, .dw),+ (rHerbivore, .herb), (rCarnivore, .carn), (rLion, .lion), (rLeo, .leo) ]++/-- Terms denote their table entry, or `other`. -/+def refι (t : Term) : RefD := (List.lookup t refTable).getD .other++/-- `IP`: the five elements that carry pairs, so the structure is+bridge-coherent. `rdfs:domain` and `rdfs:range` are deliberately NOT in it, and+the reason is worth reading once because it is not a preference. Their extensions+are empty here. Put a property with an empty extension into `IP` and Table 5.8+row 3 BACKWARD fires on it for every class, because the empty set of subjects is+contained in every class extension, so `IEXT(rdfs:domain)` acquires the pairs+`(rdfs:domain, c)` for each `c` in `IC`. Its subject set is then+`{rdfs:domain}`, and the largest class extension in this model is `{leo}`, so row+3 FORWARD immediately fails on those same pairs. There is no fixpoint with them+in; leaving them out of `IP` is what makes one exist. -/+def refIsIP : RefD → Bool+ | .ty | .sco | .spo | .dw | .sa => true+ | _ => false++/-- The extensions, parameterised by whether `leo` is a `Herbivore`. `false` is+the model of `feed` and `true` the model of `graze`.++THREE rows are chosen: `ICEXT(Lion)`, `ICEXT(Herbivore)` and+`IEXT(owl:disjointWith)`. `ICEXT(Carnivore)` is forced by the asserted subclass+triple, the `owl:sameAs` diagonal by Table 5.9, and the four `rdfs:*` tables are+the fixpoint of Table 5.8's two directions. `rdfs:domain` and `rdfs:range` come+out EMPTY, because every property here has a subject or an object that is a class+rather than `leo`, and `{leo}` is the largest class extension in the model. -/+def refIext (leoH : Bool) : RefD → RefD → RefD → Bool+ -- ICEXT(rdfs:Class) = IC = {Herbivore, Carnivore, Lion}.+ | .ty, w, .cls => w == .herb || w == .carn || w == .lion+ -- ICEXT(Lion) = ICEXT(Carnivore) = {leo}. The Carnivore row is forced: Table 5.8+ -- row 1 forward on the asserted `Lion rdfs:subClassOf Carnivore` demands it.+ | .ty, w, .lion | .ty, w, .carn => w == .leo+ -- The one row that differs. Over `feed` it is empty, which is what lets+ -- RefuteConditions hold; over `graze` it is {leo}, which is what makes `graze`+ -- refutable and is why no model of `graze` respects disjointness.+ | .ty, w, .herb => leoH && w == .leo+ -- ICEXT of everything else is empty.+ | .ty, _, _ => false+ -- IEXT(rdfs:subClassOf): the pairs of IC whose extensions nest. Over `feed`+ -- Herbivore is below everything because its extension is empty; over `graze` all+ -- three extensions are equal and the table is all nine pairs.+ | .sco, .herb, v => v == .herb || v == .carn || v == .lion+ | .sco, .carn, v | .sco, .lion, v => (leoH && v == .herb) || v == .carn || v == .lion+ | .sco, _, _ => false+ -- IEXT(rdfs:subPropertyOf): the pairs of IP whose extensions nest. The one+ -- off-diagonal entry is FORCED and looks odd until it is checked:+ -- IEXT(owl:disjointWith) is the single pair (Herbivore, Carnivore), that pair is+ -- also in IEXT(rdfs:subClassOf), and Table 5.8 row 2 is an iff, so+ -- `owl:disjointWith rdfs:subPropertyOf rdfs:subClassOf` holds here. RDF has no+ -- sortal separation and this is what that costs.+ | .spo, .ty, v => v == .ty+ | .spo, .sco, v => v == .sco+ | .spo, .spo, v => v == .spo+ | .spo, .dw, v => v == .sco || v == .dw+ | .spo, .sa, v => v == .sa+ | .spo, _, _ => false+ -- The asserted disjointness axiom.+ | .dw, .herb, v => v == .carn+ | .dw, _, _ => false+ -- RBS Table 5.9 row 1.+ | .sa, u, v => u == v+ -- Everything else, `rdfs:domain`, `rdfs:range` and `other` included, is empty.+ | _, _, _ => false++/-- The interpretation, at either row. -/+def refI (leoH : Bool) : Interp where+ D := RefD+ ι := refι+ iext := fun p x y => refIext leoH p x y = true++/-- `IP` as a predicate. -/+def refIP (x : RefD) : Prop := refIsIP x = true++instance : DecidablePred refIP := fun x => decidable_of_iff (refIsIP x = true) Iff.rfl++/-! Each condition is checked for BOTH models at once, by quantifying over the+Boolean row. Two models for the price of one `decide`, and neither can drift from+the other. -/++theorem ref_sc_fwd : ∀ (h : Bool) (a b : RefD), refIext h .sco a b = true →+ refIext h .ty a .cls = true ∧ refIext h .ty b .cls = true ∧+ ∀ x, refIext h .ty x a = true → refIext h .ty x b = true := by decide++theorem ref_sc_bwd : ∀ (h : Bool) (a b : RefD), refIext h .ty a .cls = true →+ refIext h .ty b .cls = true →+ (∀ x, refIext h .ty x a = true → refIext h .ty x b = true) →+ refIext h .sco a b = true := by decide++theorem ref_sp_fwd : ∀ (h : Bool) (a b : RefD), refIext h .spo a b = true →+ refIP a ∧ refIP b ∧ ∀ x y, refIext h a x y = true → refIext h b x y = true := by decide++theorem ref_sp_bwd : ∀ (h : Bool) (a b : RefD), refIP a → refIP b →+ (∀ x y, refIext h a x y = true → refIext h b x y = true) →+ refIext h .spo a b = true := by decide++theorem ref_dom_fwd : ∀ (h : Bool) (p c : RefD), refIext h (refι V.domain) p c = true →+ refIP p ∧ refIext h .ty c .cls = true ∧+ ∀ x y, refIext h p x y = true → refIext h .ty x c = true := by decide++theorem ref_dom_bwd : ∀ (h : Bool) (p c : RefD), refIP p → refIext h .ty c .cls = true →+ (∀ x y, refIext h p x y = true → refIext h .ty x c = true) →+ refIext h (refι V.domain) p c = true := by decide++theorem ref_rng_fwd : ∀ (h : Bool) (p c : RefD), refIext h (refι V.range) p c = true →+ refIP p ∧ refIext h .ty c .cls = true ∧+ ∀ x y, refIext h p x y = true → refIext h .ty y c = true := by decide++theorem ref_rng_bwd : ∀ (h : Bool) (p c : RefD), refIP p → refIext h .ty c .cls = true →+ (∀ x y, refIext h p x y = true → refIext h .ty y c = true) →+ refIext h (refι V.range) p c = true := by decide++theorem ref_eqc_fwd : ∀ (h : Bool) (a b : RefD),+ refIext h (refι V.equivalentClass) a b = true →+ refIext h .ty a .cls = true ∧ refIext h .ty b .cls = true ∧+ ∀ x, (refIext h .ty x a = true ↔ refIext h .ty x b = true) := by decide++theorem ref_eqp_fwd : ∀ (h : Bool) (a b : RefD),+ refIext h (refι V.equivalentProperty) a b = true →+ refIP a ∧ refIP b ∧ ∀ x y, (refIext h a x y = true ↔ refIext h b x y = true) := by decide++theorem ref_same_fwd : ∀ (h : Bool) (a b : RefD), refIext h (refι V.sameAs) a b = true →+ a = b := by decide++theorem ref_inv_fwd : ∀ (h : Bool) (p r : RefD), refIext h (refι V.inverseOf) p r = true →+ refIP p ∧ refIP r ∧ ∀ x y, (refIext h p x y = true ↔ refIext h r y x = true) := by decide++theorem ref_sym_fwd : ∀ (h : Bool) (p : RefD),+ refIext h .ty p (refι V.symmetricProperty) = true →+ ∀ x y, refIext h p x y = true → refIext h p y x = true := by decide++theorem ref_trp_fwd : ∀ (h : Bool) (p : RefD),+ refIext h .ty p (refι V.transitiveProperty) = true →+ ∀ x y z, refIext h p x y = true → refIext h p y z = true →+ refIext h p x z = true := by decide++theorem ref_svf_eq : ∀ (h : Bool) (z c p : RefD),+ refIext h (refι V.someValuesFrom) z c = true → refIext h (refι V.onProperty) z p = true →+ ∀ x, (refIext h .ty x z = true ↔ ∃ y, refIext h p x y = true ∧+ refIext h .ty y c = true) := by decide++theorem ref_avf_eq : ∀ (h : Bool) (z c p : RefD),+ refIext h (refι V.allValuesFrom) z c = true → refIext h (refι V.onProperty) z p = true →+ ∀ x, (refIext h .ty x z = true ↔ ∀ y, refIext h p x y = true →+ refIext h .ty y c = true) := by decide++theorem ref_hv_eq : ∀ (h : Bool) (z a p : RefD), refIext h (refι V.hasValue) z a = true →+ refIext h (refι V.onProperty) z p = true →+ ∀ x, (refIext h .ty x z = true ↔ refIext h p x a = true) := by decide++theorem ref_restr_IC : ∀ (h : Bool) (x : RefD),+ refIext h .ty x (refι V.Restriction) = true → refIext h .ty x .cls = true := by decide++theorem ref_svf_typ : ∀ (h : Bool) (z c : RefD),+ refIext h (refι V.someValuesFrom) z c = true →+ refIext h .ty z (refι V.Restriction) = true ∧ refIext h .ty c .cls = true := by decide++theorem ref_avf_typ : ∀ (h : Bool) (z c : RefD),+ refIext h (refι V.allValuesFrom) z c = true →+ refIext h .ty z (refι V.Restriction) = true ∧ refIext h .ty c .cls = true := by decide++theorem ref_onp_typ : ∀ (h : Bool) (z p : RefD), refIext h (refι V.onProperty) z p = true →+ refIext h .ty z (refι V.Restriction) = true ∧ refIP p := by decide++/-- The conditions, at either row. -/+theorem ref_meets_the_w3c_conditions (h : Bool) : W3C (refI h) refIP where+ sc_fwd := ref_sc_fwd h+ sc_bwd := ref_sc_bwd h+ sp_fwd := ref_sp_fwd h+ sp_bwd := ref_sp_bwd h+ dom_fwd := ref_dom_fwd h+ dom_bwd := ref_dom_bwd h+ rng_fwd := ref_rng_fwd h+ rng_bwd := ref_rng_bwd h+ eqc_fwd := ref_eqc_fwd h+ eqp_fwd := ref_eqp_fwd h+ same_fwd := ref_same_fwd h+ inv_fwd := ref_inv_fwd h+ sym_fwd := ref_sym_fwd h+ trp_fwd := ref_trp_fwd h+ svf_eq := ref_svf_eq h+ avf_eq := ref_avf_eq h+ hv_eq := ref_hv_eq h+ restr_IC := ref_restr_IC h+ svf_typ := ref_svf_typ h+ avf_typ := ref_avf_typ h+ onp_typ := ref_onp_typ h++theorem ref_feed_facts :+ ∀ t ∈ feed, refIext false (refι t.p) (refι t.s) (refι t.o) = true := by decide++theorem ref_graze_facts :+ ∀ t ∈ graze, refIext true (refι t.p) (refι t.s) (refι t.o) = true := by decide++/-- **A `W3CModel` of `feed`.** -/+theorem feedI_is_a_w3c_model : W3CModel (refI false) refIP feed where+ conds := ref_meets_the_w3c_conditions false+ facts := ref_feed_facts+ int_eq := fun c l _ hc => absurd hc (not_mem_pred feed V.intersectionOf (by decide) c l)+ uni_eq := fun c l _ hc => absurd hc (not_mem_pred feed V.unionOf (by decide) c l)+ oneOf_eq := fun c l _ hc => absurd hc (not_mem_pred feed V.oneOf (by decide) c l)++/-- **A `W3CModel` of `graze`.** `graze` is refuted, and that does not stop it+having models: `Model` and `W3CModel` both ignore disjointness, which is the+whole content of `and_the_old_verdict_does_not_notice`. -/+theorem grazeI_is_a_w3c_model : W3CModel (refI true) refIP graze where+ conds := ref_meets_the_w3c_conditions true+ facts := ref_graze_facts+ int_eq := fun c l _ hc => absurd hc (not_mem_pred graze V.intersectionOf (by decide) c l)+ uni_eq := fun c l _ hc => absurd hc (not_mem_pred graze V.unionOf (by decide) c l)+ oneOf_eq := fun c l _ hc => absurd hc (not_mem_pred graze V.oneOf (by decide) c l)++theorem ref_feed_dw :+ ∀ a b : RefD, refIext false (refι RV.disjointWith) a b = true →+ ∀ x, refIext false .ty x a = true → refIext false .ty x b = true → False := by decide++/-- And the `feed` model respects disjointness, which is what+`RefuteConditions` asks and what `graze`'s model cannot do. -/+theorem feedI_respects_disjointness : RefuteConditions (refI false) where+ dw := ref_feed_dw++theorem ref_models_are_live_raw :+ (refIext false .ty .leo .lion = true ∧ refIext false .ty .leo .carn = true ∧+ ¬ refIext false .ty .leo .herb = true) ∧+ (refIext true .ty .leo .herb = true) ∧+ (refIext false .sco .lion .carn = true ∧ ¬ refIext false .sco .carn .herb = true) ∧+ (refIext false (refι RV.disjointWith) .herb .carn = true) ∧+ (refIext false .spo .dw .sco = true) ∧+ (∀ h : Bool, ∀ p x y : RefD, refIext h p x y = true → refIP p) := by decide++/-- **Neither model is degenerate.** `leo` is a `Lion` and a `Carnivore` in both+and a `Herbivore` in exactly one; the subclass table is not everything, so+`sc_bwd` is not satisfied by collapse; the disjointness axiom is really there;+the one forced off-diagonal `rdfs:subPropertyOf` entry is really there; and both+models are bridge-coherent, so both are in the image of the bridge in `W3C.lean`+where the Herbrand interpretations they replace are not. -/+theorem ref_models_are_live :+ ((refI false).cext .lion .leo ∧ (refI false).cext .carn .leo ∧+ ¬ (refI false).cext .herb .leo) ∧+ (refI true).cext .herb .leo ∧+ ((refI false).sc .lion .carn ∧ ¬ (refI false).sc .carn .herb) ∧+ (refI false).iext ((refI false).ι RV.disjointWith) .herb .carn ∧+ (refI false).sp .dw .sco ∧+ (∀ h : Bool, ∀ p x y : RefD, (refI h).iext p x y → refIP p) :=+ ref_models_are_live_raw++/-- `Unsat` over the specification's model class. A SMALLER class of+interpretations makes this EASIER to satisfy than `Unsat`, which is the direction+that matters: `w3cUnsat_of_unsat` is free and `¬ W3CUnsat` is the thing that+needs a model. -/+def W3CUnsat (G : List Triple) : Prop :=+ ∀ (I : Interp) (IP : I.D → Prop), ¬ (W3CModel I IP G ∧ RefuteConditions I)++/-- **A refutation rules out the conforming interpretations too.** The easy half,+and the one `refutation_sound`'s verdict needs: every `W3CModel` of `G` is a+`Model` of `G`, so a graph with no disjointness-respecting `Model` has no+disjointness-respecting `W3CModel` either. -/+theorem w3cUnsat_of_unsat {G : List Triple} (h : Unsat G) : W3CUnsat G :=+ fun I _ hw => h I ⟨hw.1.toModel, hw.2⟩++/-- The `W3CUnsat` counterpart of `not_unsat_of_joint_model`, and it is trivial+where that one is not: `W3CUnsat` is stated directly over `W3CModel`, so a joint+model refutes it by unfolding. Recorded so that the transfer table in+`W3CWitness.lean` has no row without a theorem behind it. -/+theorem not_w3cUnsat_of_joint_w3c_model {G : List Triple}+ (h : ∃ (I : Interp) (IP : I.D → Prop), W3CModel I IP G ∧ RefuteConditions I) :+ ¬ W3CUnsat G := by+ obtain ⟨I, IP, hM, hR⟩ := h+ exact fun hu => hu I IP ⟨hM, hR⟩++/-- **`feed` is not refutable over the specification's model class**, which is+strictly stronger than `feed_is_not_refuted` and is what that theorem's note said+was missing. The model is `refI false` and it satisfies `RefuteConditions`+because `ICEXT(Herbivore)` is empty there, which is exactly what removing+`leo rdf:type Herbivore` from `graze` buys. -/+theorem feed_is_not_w3c_refuted : ¬ W3CUnsat feed :=+ fun h => h (refI false) refIP ⟨feedI_is_a_w3c_model, feedI_respects_disjointness⟩++/-- And the old statement follows, so nothing was lost in the strengthening.+`feed_is_not_refuted` above proves the same thing by a different route, through+the closure machinery rather than through a hand-built model, and the two are+kept side by side because they fail in different ways if either is broken. -/+theorem feed_is_not_refuted_via_the_w3c_model : ¬ Unsat feed :=+ fun h => feed_is_not_w3c_refuted (w3cUnsat_of_unsat h)++theorem grazeI_refutes_the_junk_triple :+ ¬ refIext true (refι rJunk.p) (refι rJunk.s) (refι rJunk.o) = true := by decide++/-- **And the old verdict does not notice over the specification's model class+either.** `graze` is refuted, and `W3CEntails graze` is still a non-trivial+relation: `refI true` is a `W3CModel` of `graze` in which the junk triple is+false, because its three IRIs all denote the junk element, whose extension is+empty.++So a derivation certificate over a refuted graph checks green and means nothing,+and that is now a statement about the class `W3C.lean` quotes out of the tables+rather than only about `Semantics.lean`'s weaker `Conditions`. This is why+`oo-refute guard` exists. -/+theorem the_old_verdict_does_not_notice_over_w3c : ¬ W3CEntails graze rJunk := fun h =>+ absurd (h (refI true) refIP grazeI_is_a_w3c_model) grazeI_refutes_the_junk_triple+/-! ## Axioms, pinned -//-- info: 'OOCert.closure_is_a_model' does not depend on any axioms -/@@ -620,14 +999,6 @@ theorem and_the_old_verdict_does_not_notice : ¬ Entails graze rJunk := fun h =>#guard_msgs in#print axioms graze_is_refuted-/-- info: 'OOCert.feed_closure_misses_the_class_typing' depends on axioms: [propext] -/-#guard_msgs in-#print axioms feed_closure_misses_the_class_typing--/-- info: 'OOCert.graze_closure_misses_the_class_typing' depends on axioms: [propext] -/-#guard_msgs in-#print axioms graze_closure_misses_the_class_typing-/-- info: 'OOCert.feed_is_not_refuted' depends on axioms: [propext] -/#guard_msgs in#print axioms feed_is_not_refuted@@ -636,4 +1007,32 @@ theorem and_the_old_verdict_does_not_notice : ¬ Entails graze rJunk := fun h =>#guard_msgs in#print axioms and_the_old_verdict_does_not_notice+/-- info: 'OOCert.feedI_is_a_w3c_model' depends on axioms: [propext] -/+#guard_msgs in+#print axioms feedI_is_a_w3c_model++/-- info: 'OOCert.grazeI_is_a_w3c_model' depends on axioms: [propext] -/+#guard_msgs in+#print axioms grazeI_is_a_w3c_model++/-- info: 'OOCert.ref_models_are_live' depends on axioms: [propext] -/+#guard_msgs in+#print axioms ref_models_are_live++/-- info: 'OOCert.w3cUnsat_of_unsat' does not depend on any axioms -/+#guard_msgs in+#print axioms w3cUnsat_of_unsat++/-- info: 'OOCert.not_w3cUnsat_of_joint_w3c_model' does not depend on any axioms -/+#guard_msgs in+#print axioms not_w3cUnsat_of_joint_w3c_model++/-- info: 'OOCert.feed_is_not_w3c_refuted' depends on axioms: [propext] -/+#guard_msgs in+#print axioms feed_is_not_w3c_refuted++/-- info: 'OOCert.the_old_verdict_does_not_notice_over_w3c' depends on axioms: [propext] -/+#guard_msgs in+#print axioms the_old_verdict_does_not_notice_over_w3c+end OOCertdiff --git a/lean/OOCert/Semantics.lean b/lean/OOCert/Semantics.leanindex b296657f..0e452e85 100644--- a/lean/OOCert/Semantics.lean+++ b/lean/OOCert/Semantics.lean@@ -127,20 +127,22 @@ restates it over `W3CModel`. The state of each is recorded at the theorem itselfas well as here, because a summary that lives in one file is a summary that goesstale, and this one did.-Nine statements in this repository are a `¬ Entails` or a `¬ Unsat`. Five are-restated over `W3CModel`, four are not, and the four say which field stops them.+Nine statements in this repository are a `¬ Entails` or a `¬ Unsat`. ALL NINE are+now restated over `W3CModel`. Four of them transferred with their existing+witness graph unchanged; four needed a finite structure built for them; one is a+lemma and follows by unfolding.| result | over `W3CModel` | where ||---|---|---|-| `not_everything_is_entailed` | yes | `not_everything_is_w3c_entailed` |-| `the_natural_avf2_direction_is_not_entailed` | yes | `the_natural_avf2_direction_is_not_w3c_entailed`, the one that needed a structure built for it |+| `not_everything_is_entailed` | yes | `not_everything_is_w3c_entailed`, same witness graph |+| `the_natural_avf2_direction_is_not_entailed` | yes | `the_natural_avf2_direction_is_not_w3c_entailed`, on `live` || `an_unlisted_individual_is_not_entailed` | yes | `an_unlisted_individual_is_not_w3c_entailed`, same witness graph || `membership_in_one_member_does_not_give_the_intersection` | yes | `membership_in_one_member_is_not_w3c_enough`, same witness graph || `mix_not_absolutely_entailed` | yes | `mix_not_absolutely_w3c_entailed`, in `Mixed.lean`, same witness graph |-| `the_old_svf_derivation_is_not_entailed` | no | `onp_typ` fails; checked at `svf_witness_misses_the_restriction_typing` |-| `feed_is_not_refuted` | no | `sc_fwd` fails; checked at `feed_closure_misses_the_class_typing`, and `¬ Unsat` runs the wrong way |-| `and_the_old_verdict_does_not_notice` | no | `sc_fwd` fails on `grazeClosure` for the same reason |-| `not_unsat_of_joint_model` | no | a lemma with a hypothesis rather than a witness, same direction problem |+| `the_old_svf_derivation_is_not_entailed` | yes | `the_old_svf_derivation_is_not_w3c_entailed`, on `svfI` |+| `feed_is_not_refuted` | yes | `feed_is_not_w3c_refuted`, on `refI false`, and it is `¬ W3CUnsat`, which is STRONGER than `¬ Unsat` rather than weaker |+| `and_the_old_verdict_does_not_notice` | yes | `the_old_verdict_does_not_notice_over_w3c`, on `refI true` |+| `not_unsat_of_joint_model` | yes | `not_w3cUnsat_of_joint_w3c_model`, by unfolding |Two further negatives, `Mixed.lean`'s `mix_relative_is_not_everything` and`HornWitness.lean`'s `demo_not_everything_entailed`, are `¬ EntailsR`: statementsdiff --git a/lean/OOCert/W3C.lean b/lean/OOCert/W3C.leanindex 405be7b5..b80c6198 100644--- a/lean/OOCert/W3C.lean+++ b/lean/OOCert/W3C.lean@@ -61,12 +61,15 @@ fourteen arms that used to be posited are steps inside its proof.`certificate_sound` keeps its exact statement and its exact axiom footprint.**`W3CModel` is not the same thing as a conforming interpretation, and no-document in this repository may say that it is.** Two gaps separate them, both-stated below and both stated again at `certificate_w3c_sound`: the reading of one-as the other is prose rather than a theorem, and `W3C` omits every table row no-rule consumes, so its class is strictly larger than the bridge image. Both run in+document in this repository may say that it is.** Two gaps used to separate them.+The first, that the reading of one as the other was prose rather than a theorem,+is closed: `Conforming.lean` formalises the specification's interpretation and+`OOCert.Conforming.toW3CModel` is that reading, proved. The second remains:+`W3C` omits every table row no rule consumes, so its class is strictly larger+than the image of the conforming interpretations under that map. Both gaps run inthe safe direction for THIS theorem and neither runs in the safe direction for a-non-entailment result.+non-entailment result, so a refutation over `W3CModel` is still a statement about+`W3CModel` and not about the specification.`IP` is a PARAMETER of this structure rather than a field of `Interp`, which iswhat makes the whole file additive. It stays completely free INSIDE the@@ -84,11 +87,29 @@ remove those obligations, it MOVES them out of the proofs and into the bridge,and the bridge needs FIVE of them where Isabelle needs three. They are listed inthe next section, because a cost that is paid somewhere else is still paid.-## The bridge to a conforming interpretation, which is prose and not a theorem--There is no Lean formalisation of an OWL 2 RDF-Based interpretation to quantify-over, and building one is a different project, so this step is an argument and-is marked as one.+## The bridge to a conforming interpretation, WHICH IS NOW A THEOREM++**Everything in this section describes the state of the layer before 15+September 2026 and is superseded by `Conforming.lean`.** It is kept because the+argument below is still the argument, and because the correction of one of its+five assumed facts should stay next to the claim it corrects. What changed is+that there is now a Lean formalisation of an OWL 2 RDF-Based interpretation to+quantify over, `OOCert.Interpretation`, so the reading described here is+`OOCert.Conforming.toW3C` and the five facts listed below are fields of+`OOCert.Conforming`, quoted out of the axiomatic-triple tables and discharged+rather than assumed. `OOCert.certificate_conforming_sound` is the sentence this+file's `certificate_w3c_sound` says of itself that it is not yet.++**One entry in the table below is wrong and the correction is recorded rather+than silently applied.** The `I(rdfs:range) ∈ IP` row sources the fact to+`rdfs:range rdfs:domain rdf:Property .` with the note "same", pointing at the row+above it, which reads "whose truth puts its own predicate in `IP`". The predicate+of that triple is `rdfs:domain`, so its truth gives `I(rdfs:domain) ∈ IP` and not+`I(rdfs:range) ∈ IP`; reaching `rdfs:range` from it needs a further step through+Table 5.8's `rdfs:domain` row, which the entry does not mention.+`Conforming.lean` takes the fact from `rdf:type rdfs:range rdfs:Class .`+instead, whose predicate IS `rdfs:range`, so one application of the truth clause+settles it and no table is consulted.Given a conforming interpretation in the sense of OWL 2 RDF-Based Semanticssection 5, take `D := IR`, `ι := I`, and@@ -657,9 +678,11 @@ structure W3CModel (I : Interp) (IP : I.D → Prop) (G : List Triple) : Prop whe/-- **Every `W3CModel` is a `Model`.**-Not "every conforming interpretation is a model here": that sentence needs the-prose bridge and the five axiomatic-triple facts in the module docstring, and-this theorem quantifies over `W3CModel`, which is a Lean structure.+Not "every conforming interpretation is a model here": this theorem quantifies+over `W3CModel`, which is a Lean structure. That sentence is+`OOCert.Conforming.toModel` in `Conforming.lean`, which composes with this one+and discharges the five axiomatic-triple facts the module docstring above+assumes.Twelve of the twenty-three `Conditions` fields below are derivations rather thanprojections: `sc_trans`, `sp_trans`, `eqc`, `eqp`, `svf_sc`, `svf_sp`,@@ -714,9 +737,9 @@ def W3CEntails (G : List Triple) (t : Triple) : Prop :=and not about a conforming interpretation. Everything `Entails` gives is true inevery `W3CModel` of the graph, and the fourteen conditions that used to beposited are steps inside the proof of it. Reading that outward, to the-specification's own interpretations, costs the prose bridge and the five-axiomatic-triple facts in the module docstring; `certificate_w3c_sound` says so-again where a reader will hit it.+specification's own interpretations, is `OOCert.ConformingEntails.of_entails` in+`Conforming.lean`, which used to be the prose bridge and the five+axiomatic-triple facts in the module docstring above.The transfer runs in this direction and only this one. `Conditions` admits moreinterpretations than `W3C` does, so a claim true in all of them is true in all@@ -724,15 +747,15 @@ of the smaller class. The converse fails: a `¬ Entails` result does NOT give`¬ W3CEntails`, because the model refuting the first need not be a `W3CModel`.What that does NOT mean is that every non-entailment here is stuck. It says only-that each one needs its own proof, and four of the seven in this repository got-one for free, because the interpretations they already used ARE `W3CModel`s once-`IP` is instantiated to the empty predicate. `IP` is a free parameter of `W3C`-and `sp_bwd`, `dom_bwd` and `rng_bwd` are the only fields that take an `IP`-membership as a hypothesis, so `IP := fun _ => False` makes all three vacuous; a-witness graph with no `rdfs:Class` typing makes `sc_bwd` vacuous too, because-`I.IC` is then empty. `W3CWitness.lean` and `Mixed.lean` carry the four, and the-three that do not transfer carry the field that fails, checked rather than-asserted. -/+that each one needs its own proof, and every one of them in this repository now+has one. Four came for free, because the interpretations they already used ARE+`W3CModel`s once `IP` is instantiated to the empty predicate. `IP` is a free+parameter of `W3C` and `sp_bwd`, `dom_bwd` and `rng_bwd` are the only fields that+take an `IP` membership as a hypothesis, so `IP := fun _ => False` makes all+three vacuous; a witness graph with no `rdfs:Class` typing makes `sc_bwd` vacuous+too, because `I.IC` is then empty. `W3CWitness.lean` and `Mixed.lean` carry those+four. The rest needed a hand-built finite structure each, and `W3CWitness.lean`'s+`svfI` and `RefuteWitness.lean`'s `refI` are those structures. -/theorem W3CEntails.of_entails {G : List Triple} {t : Triple} (h : Entails G t) :W3CEntails G t :=fun _ _ W => h _ W.toModel@@ -743,16 +766,23 @@ now quantifies over every interpretation meeting the quoted table cells, ratherthan over the weaker set of conditions the Lean posited, and that the fourteenarms which used to be posited are steps inside the proof.-**This is not yet the sentence "true in every conforming interpretation", and-the difference is the bridge in the module docstring above, which is an argument-and not a theorem.** `W3CModel` is a Lean structure; a conforming interpretation-is an object of the specification's metatheory, and nothing here quantifies over-those. The bridge says how to read one as the other, and it is checkable by-hand, but it is prose. `W3CModel` is also strictly weaker than conformance,-because `W3C` deliberately omits every table row no rule consumes, so its class-is larger than the bridge image. Both gaps run in the safe direction for THIS-theorem, since a larger class makes the conclusion stronger; neither runs in the-safe direction for a non-entailment result. -/+**This is not the sentence "true in every conforming interpretation", and that+sentence is now `OOCert.certificate_conforming_sound` in `Conforming.lean`.**+`W3CModel` is a Lean structure. Until 15 September 2026 nothing in this+repository quantified over the specification's own interpretations, so the step+between the two was the prose bridge in the module docstring above, plus five+assumed facts; `Conforming.lean` builds `OOCert.Interpretation`, proves the+bridge as `OOCert.Conforming.toW3C`, and carries the five facts as quoted+axiomatic triples. This theorem is left exactly as it was, because it is what+`W3CWitness.lean` and `Mixed.lean` consume and because a weaker statement that+still holds is not a defect.++`W3CModel` remains strictly weaker than conformance, because `W3C` deliberately+omits every table row no rule consumes, so its class is larger than the image of+the conforming interpretations under `toW3C`. That gap runs in the safe direction+for THIS theorem, since a larger class makes the conclusion stronger; it does not+run in the safe direction for a non-entailment result, and nothing about+`Conforming.lean` changes that. -/theorem certificate_w3c_sound (G : List Triple) (steps : List Step)(h : checkCert G steps = true) :∀ st ∈ steps, W3CEntails G st.conclusion :=diff --git a/lean/OOCert/W3CWitness.lean b/lean/OOCert/W3CWitness.leanindex ad133025..5582bc79 100644--- a/lean/OOCert/W3CWitness.lean+++ b/lean/OOCert/W3CWitness.lean@@ -20,10 +20,10 @@ and refutes nothing. `W3CModel.toModel` proved over an unsatisfiable or adegenerate `W3C` would be a theorem about nothing that LOOKED better than theassumption it replaced, which is a strictly worse defect than the one beingrepaired. The gate is therefore a NON-DEGENERATE model, and `live_is_live`,-`live_exercises_every_arm` and `live_leaves_exactly_these_five_vacuous` below-compile the liveness facts, their limits and the exact list of exceptions into-the build, so that the next person to shorten this graph to fix a `decide`-timeout breaks it rather than hollowing it out silently.+`live_exercises_every_arm` and `live_fires_every_field` below compile the+liveness facts and their limits into the build, so that the next person to+shorten this graph to fix a `decide` timeout breaks it rather than hollowing it+out silently.## The first version of this file was vacuous where it mattered most, and this is the repair@@ -58,36 +58,49 @@ reason. `A2`, `S1`, `S2`, `S3` and `q` are five further elements carrying the`live_exercises_every_arm` applies all fourteen derivations at concrete instancesof this model, which is a strictly stronger gate than any field being non-empty.-## What is still vacuous, and it is exactly the fields that carry no arm--Five of the twenty-one fields still hold because nothing is in the extension-their antecedent reads: `same_fwd`, `sym_fwd`, `trp_fwd`, `inv_fwd` and `hv_eq`.-`live_leaves_exactly_these_five_vacuous` is that list as a theorem, so that it-cannot drift from the tables. None of the five carries any of the fourteen arms:-`Soundness.lean` takes all five out of `Conditions` by projection.--`same_fwd` cannot be exercised non-trivially by ANY model, and that is the-specification's doing. RBS reads `(a₁, a₂) ∈ IEXT(I(owl:sameAs))` **iff**-`a₁ = a₂`, so the only pairs a conforming interpretation may put there are-diagonal and the only instance of the field is `a = a`. The other four are-ordinary omissions that could be closed and are not: each needs its own-vocabulary element plus a property or a restriction to hold it, and every-condition here is quantified over the carrier three or four times, so the-`decide` cost grows as the fourth power of the carrier. Twenty-six elements-already cost about thirty seconds. The honest report is that these four are not-exercised, not that they cannot be.+## Nothing is left vacuous, and getting there took two rebuilds++The 15 September 2026 rebuild closed the six dead arms and left five fields still+holding for want of anything to check: `same_fwd`, `sym_fwd`, `trp_fwd`,+`inv_fwd` and `hv_eq`, none of which carries any of the fourteen arms. The second+rebuild closes those five too. `owl:sameAs`, `owl:inverseOf`, `owl:hasValue`,+`owl:SymmetricProperty` and `owl:TransitiveProperty` had all been falling through+the denotation table to the junk element `other`, whose extension is empty; they+now denote elements of their own, and `r1`, `sy`, `tr` and `H1` are the property+and restriction rows those five conditions read. `live_fires_every_field`+exhibits a satisfied antecedent for each of the twenty-one.++The note that used to sit here said `same_fwd` "cannot be exercised+non-trivially by ANY model", and as a statement about the extension being empty+that is false. RBS Table 5.9 row 1 is an `iff` whose right-hand side is+`a₁ = a₂` over unscoped variables, which the specification's conventions section+reads as ranging over IR, and RBS section 4.2 defines IR as "the universe of I,+i.e., a nonempty set". So a conforming interpretation's `owl:sameAs` extension is+the whole NON-EMPTY diagonal, and a model that leaves it empty is not modelling+that cell, it is failing to. What is true is the narrower statement+`sameAs_has_no_off_diagonal_instance` proves: no interpretation meeting the cell+has an instance at `a ≠ b`. The condition is exercised here, thirty-five times,+and every instance is diagonal because the specification permits no other.## The model-Carrier: three individuals `alice`, `bob` and `carl`; seven classes, of which-six are restrictions; three properties; twelve vocabulary denotations that have-to be told apart; and one junk element `other` absorbing every remaining IRI.-Twenty-six elements.+Carrier: three individuals `alice`, `bob` and `carl`; eight classes, of which+seven are restrictions; six properties; seventeen vocabulary denotations that+have to be told apart; and one junk element `other` absorbing every remaining+IRI. Thirty-five elements.-ELEVEN rows are chosen and the conditions determine the other ten.+SEVENTEEN rows are chosen and the conditions determine the other eleven.* `IEXT(p1) = IEXT(q) := {(alice, carl)}`, `IEXT(p2) := {(alice, bob),(alice, carl)}`, `ICEXT(Y) := {carl}`.+* `IEXT(r1) := {(carl, alice)}`, the converse of `IEXT(p1)`, which is what+ `owl:inverseOf` relates `p1` to; `IEXT(sy) := {(bob, carl), (carl, bob)}`,+ symmetric and not transitive; `IEXT(tr) := {(alice, bob), (bob, carl),+ (alice, carl)}`, transitive and not symmetric. `ICEXT(owl:SymmetricProperty)`+ is `{sy}` and `ICEXT(owl:TransitiveProperty)` is `{tr}`, so the two conditions+ are separated rather than met by one relation that satisfies both.+* `owl:sameAs` gets the whole DIAGONAL, which is the only extension RBS+ Table 5.9 row 1 permits and is not empty.* `owl:allValuesFrom` puts `C1 = ∀p1.Y`, `C2 = ∀p2.Y` and `A2 = ∀p2.C1`;`owl:someValuesFrom` puts `S1 = ∃p2.Y`, `S2 = ∃p2.C1` and `S3 = ∃p1.Y`;`owl:equivalentClass` relates `S1` and `S2`, whose class extensions are equal;@@ -103,9 +116,11 @@ ELEVEN rows are chosen and the conditions determine the other ten.`(C2, C1)` into `IEXT(rdfs:subClassOf)`, which is what `scm-avf2` draws. Thewitness confirms both halves of the pair, where the Herbrand witness in`Witness.lean` asserts one and leaves the other out by hand.-* `svf_eq` forces `ICEXT(S1) = ICEXT(S2) = ICEXT(S3) = {alice}`.-* `IC := {C1, C2, A2, Y, S1, S2, S3}` through `ICEXT(rdfs:Class)`, and- `ICEXT(owl:Restriction)` is the six restrictions, a PROPER subset of `IC`+* `svf_eq` forces `ICEXT(S1) = ICEXT(S2) = ICEXT(S3) = {alice}`, and `hv_eq`+ forces `ICEXT(H1) = {alice}` as well: `H1` is the `p2`-values restriction on+ `bob` and `alice` is the only element with `bob` as a `p2`-successor.+* `IC := {C1, C2, A2, Y, S1, S2, S3, H1}` through `ICEXT(rdfs:Class)`, and+ `ICEXT(owl:Restriction)` is the seven restrictions, a PROPER subset of `IC`per Table 5.2, because `Y` is a class and not a restriction.`owl:Restriction` itself is kept out of `IC`, so `sc_bwd` raises no obligationabout it.@@ -116,9 +131,13 @@ ELEVEN rows are chosen and the conditions determine the other ten.`rdfs:domain` and `rdfs:range` are themselves members of `IP` and so aresubject to the very conditions they carry. The tables below are that fixpoint.`(p2, p1)` is NOT in `IEXT(rdfs:subPropertyOf)`, because `IEXT(p2)` is not- contained in `IEXT(p1)`, and the domain and range tables DIFFER, at the rows- for `p1`, `q`, `p2` and `rdf:type`, which is the model separating the two rows- of Table 5.8 rather than satisfying them both by accident.+ contained in `IEXT(p1)`, and the domain and range tables DIFFER, including at+ the rows for `p1`, `q`, `p2`, `r1`, `tr` and `rdf:type`, which is the model+ separating the two rows of Table 5.8 rather than satisfying them both by+ accident. `r1` is the+ sharpest of those: it reaches `Y` on the domain side and the four+ `{alice}`-extension restrictions on the range side, exactly the mirror image of+ what `p1` does.`live_rng_bwd_is_exercised` pins one such separation, `(p2, C2)`, as atheorem: it is in the range extension and not in the domain extension.@@ -129,7 +148,7 @@ subject of `IEXT(rdfs:subClassOf)` lies in `ICEXT(C1)` because `ICEXT(C1)` iseverything, and Table 5.8's `rdfs:domain` row is an `iff`. RDF has no sortalseparation, and this is what that costs.-## `IP`, and why these thirteen+## `IP`, and why these nineteen`IP` must contain every element with a non-empty extension, or the structure isnot the image of any conforming interpretation under the bridge in `W3C.lean`@@ -139,8 +158,9 @@ It is a property of THIS model and NOT a field of `W3CModel`, which is adistinction an earlier draft of this file lost, at some cost; see the section onthe three transferred non-entailments below.-The thirteen are `p1`, `p2`, `q` and the ten vocabulary denotations that carry-pairs, and every one of them is in `IP` in any conforming interpretation:+The nineteen are `p1`, `p2`, `q`, `r1`, `sy`, `tr` and the thirteen vocabulary+denotations that carry pairs, and every one of them is in `IP` in any conforming+interpretation:* `owl:allValuesFrom`, `owl:someValuesFrom`, `owl:onProperty`,`owl:equivalentClass` and `owl:equivalentProperty` by RBS Table 5.3 directly,@@ -161,8 +181,11 @@ pairs, and every one of them is in `IP` in any conforming interpretation:`rdfs:subClassOf rdfs:domain rdfs:Class .`, whose truth puts`I(rdfs:subClassOf)` into `IP` through the forward direction of Table 5.8's`rdfs:domain` row.+* `owl:sameAs`, `owl:inverseOf` and `owl:hasValue` by RBS Table 5.3, whose+ second column reads "∈ IP" for all three.* `p1`, `p2` and `q` because `onp_typ` demands it of the first two and- `eqp_fwd` of the third.+ `eqp_fwd` of the third; `r1` because `inv_fwd` demands it; and `sy` and `tr`+ because they carry pairs and bridge coherence therefore demands it.All five axiomatic triples were re-read in the raw HTML of<https://www.w3.org/TR/rdf11-mt/> on 15 September 2026; they are the same five@@ -190,9 +213,19 @@ must satisfy:* `owl:Thing | in IC | = IR`. Here `owl:Thing` denotes `other`, whose classextension is empty and is not the carrier.* `rdf:Property | in IC | = IP`. Here `rdf:Property` also denotes `other`, so- its class extension is empty rather than the thirteen-element `IP`.+ its class extension is empty rather than the nineteen-element `IP`.* `rdfs:Resource | in IC | = IR`, and the RDF and RDFS axiomatic triple tablesthemselves, which are simply absent.+* The SECOND column of three rows this model otherwise uses.+ `owl:Restriction | in IC | subset of IC`,+ `owl:SymmetricProperty | in IC | subset of IP` and+ `owl:TransitiveProperty | in IC | subset of IP` each assert a membership as+ well as an inclusion, and this model satisfies the inclusions and keeps all+ three elements OUT of `IC`. That is deliberate and it is a departure:+ `restr_IC` is the third column of the first of them, no field of `W3C` states+ any of the three memberships, and putting `owl:Restriction` into `IC` would+ raise `sc_bwd` obligations about it that nothing here needs. All three rows+ were read in the raw HTML of the Recommendation on 15 September 2026.Closing that gap means formalising Table 5.2's forty-odd rows, the axiomatictriple tables, and the parts of the universe from Table 5.1, and then rebuilding@@ -200,27 +233,33 @@ this model over them. That is a different project, and the honest report is thatthis witness gets closer to the specification than anything else here and doesnot arrive.-## What it leaves untouched, corrected+## What it leaves untouched, corrected twiceAn earlier version of this section said that this file "does NOT rehabilitatethe other non-entailment results", and listed seven, on the ground that all ofthem "are discharged by Herbrand or saturated interpretations, and none of thoseis a `W3CModel`". That is false, it was false of one of the seven at the momentit was written, and the reason given for it was inverted. Four of the seven are-`W3CModel`s with their witness graphs unchanged. `not_everything_is_w3c_entailed`-was the one already proved below while the list called it open; the section after-it proves two more; `Mixed.lean` proves the fourth. The three that do not-transfer carry the field that fails, checked by `decide` rather than asserted.+`W3CModel`s with their witness graphs unchanged.++The next version said the remaining three could not transfer and pinned, as+checked theorems, the field that fails in each. Those theorems were true and they+were about the HERBRAND WITNESSES, not about the results. A witness that is not a+`W3CModel` is a reason to build one, not a reason the statement is out of reach,+and all three are reached now, each on a finite structure built for it:+`the_old_svf_derivation_is_not_w3c_entailed` at the end of this file, and+`feed_is_not_w3c_refuted` and `the_old_verdict_does_not_notice_over_w3c` in+`RefuteWitness.lean`. Nothing in this repository now states a non-entailment+about `Conditions` alone.-/namespace OOCert/-! ## The carrier -/-/-- The twenty-six elements. `other` absorbs every IRI the model does not need to-tell apart, and its extension and class extension are both empty, which is what-makes every condition over a vocabulary term not named here hold vacuously. The-five terms that stay in `other` are listed, with what it costs, under "What is-still vacuous" in the module docstring. -/+/-- The thirty-five elements. `other` absorbs every IRI the model does not need+to tell apart, and its extension and class extension are both empty. Five terms+used to stay in `other` and made their conditions hold vacuously; they have rows+of their own now, and the module docstring says which and why. -/inductive LiveD where/-- An individual with a `p1`-successor and two `p2`-successors, and the onlyelement outside `ICEXT(C2)`. -/@@ -251,6 +290,10 @@ inductive LiveD where/-- `S3`, the existential restriction `∃p1.Y`. `S3` and `S1` order under`scm-svf2` because `p1` is below `p2`. -/| s3+ /-- `H1`, the value restriction `∃p2.{bob}`. `owl:hasValue` needs a+ restriction to hold it, and `hv_eq` then forces `ICEXT(H1) = {alice}`, because+ `alice` is the only element with `bob` as a `p2`-successor. -/+ | h1/-- `p1`, with the single pair `(alice, carl)`. -/| p1/-- `p2`, with `(alice, bob)` and `(alice, carl)`, so `IEXT(p1)` is a PROPER@@ -259,6 +302,17 @@ inductive LiveD where/-- A second property with `IEXT(q) = IEXT(p1)`, exactly so that`owl:equivalentProperty` has a pair to relate. -/| q+ /-- `r1`, with the single pair `(carl, alice)`, which is the CONVERSE of+ `IEXT(p1)`. It exists so that `owl:inverseOf` relates two DISTINCT properties+ rather than a symmetric one to itself. -/+ | r1+ /-- `sy`, with `(bob, carl)` and `(carl, bob)`. Symmetric and NOT transitive,+ which is what keeps `sym_fwd` and `trp_fwd` separated by this model rather+ than satisfied together by one relation that happens to be both. -/+ | sy+ /-- `tr`, with `(alice, bob)`, `(bob, carl)` and `(alice, carl)`. Transitive+ and NOT symmetric. -/+ | tr/-- `rdf:type`, whose extension IS `ICEXT`. -/| ty/-- `rdfs:subClassOf`. -/@@ -279,6 +333,19 @@ inductive LiveD where| eqc/-- `owl:equivalentProperty`. -/| eqp+ /-- `owl:sameAs`, whose extension is the DIAGONAL on the carrier. RBS Table+ 5.9 row 1 is an `iff` and its right-hand side is `a₁ = a₂`, so that is the+ only extension a conforming interpretation may give it, and it is the whole+ diagonal rather than nothing. -/+ | sa+ /-- `owl:inverseOf`. -/+ | invo+ /-- `owl:hasValue`. -/+ | hv+ /-- `owl:SymmetricProperty`, whose class extension is `{sy}`. -/+ | symp+ /-- `owl:TransitiveProperty`, whose class extension is `{tr}`. -/+ | trp/-- `rdfs:Class`, whose class extension IS `IC` (Table 5.2, "= IC"). -/| cls/-- `owl:Restriction`, whose class extension is a PROPER subset of `IC`@@ -294,8 +361,9 @@ namespace LiveD/-- The carrier as a list, so that quantification over it is decidable withoutMathlib's `Fintype`. -/def all : List LiveD :=- [alice, bob, carl, c1, c2, a2, filler, s1, s2, s3, p1, p2, q,- ty, sco, spo, dm, rg, avf, svf, onp, eqc, eqp, cls, restr, other]+ [alice, bob, carl, c1, c2, a2, filler, s1, s2, s3, h1, p1, p2, q, r1, sy, tr,+ ty, sco, spo, dm, rg, avf, svf, onp, eqc, eqp, sa, invo, hv, symp, trp,+ cls, restr, other]theorem mem_all (w : LiveD) : w ∈ all := by cases w <;> decide@@ -316,25 +384,28 @@ end LiveD/-! ## The interpretation -//-- The denotation table. Everything absent from it denotes `other`, so-`owl:hasValue`, `owl:sameAs`, `owl:inverseOf`, `owl:SymmetricProperty`,-`owl:TransitiveProperty`, `owl:intersectionOf`, `owl:unionOf`, `owl:oneOf`,-`owl:Thing` and `rdf:Property` all land there together and their conditions hold-vacuously. The first five of those are the fields this witness does not-exercise, and `live_leaves_exactly_these_five_vacuous` pins that list so it-cannot drift; the last five are where the model stops being a conforming-interpretation, and the module docstring says so. -/+`owl:intersectionOf`, `owl:unionOf`, `owl:oneOf`, `owl:Thing` and `rdf:Property`+land there together with an empty extension. Those five are where the model+stops being a conforming interpretation, and the module docstring says so.++Every term whose row `W3C` states now has a row here. The 15 September 2026+rebuild added the last five, `owl:sameAs`, `owl:inverseOf`, `owl:hasValue`,+`owl:SymmetricProperty` and `owl:TransitiveProperty`, which used to fall through+to `other` and made their five conditions hold for want of anything to check. -/def liveTable : List (Term × LiveD) :=[ (V.type, .ty), (V.subClassOf, .sco), (V.subPropertyOf, .spo),(V.domain, .dm), (V.range, .rg),(V.allValuesFrom, .avf), (V.someValuesFrom, .svf), (V.onProperty, .onp),(V.equivalentClass, .eqc), (V.equivalentProperty, .eqp),+ (V.sameAs, .sa), (V.inverseOf, .invo), (V.hasValue, .hv),+ (V.symmetricProperty, .symp), (V.transitiveProperty, .trp),(V.Class, .cls), (V.Restriction, .restr),(tC1, .c1), (tC2, .c2), (tY, .filler), (tp1, .p1), (tp2, .p2) ]/-- Terms denote their table entry, or `other`. -/def liveι (t : Term) : LiveD := (List.lookup t liveTable).getD .other-/-- `IP`. The thirteen elements that carry pairs.+/-- `IP`. The nineteen elements that carry pairs.Every one of them is in `IP` in any conforming interpretation, by RBS Table 5.3for `owl:allValuesFrom`, `owl:someValuesFrom` and `owl:onProperty`, by Table 5.9@@ -344,37 +415,54 @@ rest; the citations are in the module docstring. Nothing else is in `IP`, whichis what keeps `sp_bwd`, `dom_bwd` and `rng_bwd` from forcing schema triples aboutindividuals. -/def isIP : LiveD → Bool- | .p1 | .p2 | .q | .ty | .sco | .spo | .dm | .rg- | .avf | .svf | .onp | .eqc | .eqp => true+ | .p1 | .p2 | .q | .r1 | .sy | .tr | .ty | .sco | .spo | .dm | .rg+ | .avf | .svf | .onp | .eqc | .eqp | .sa | .invo | .hv => true+ | _ => false++/-- `IC`, as a match rather than a disjunction chain. Every table below is+written this way on purpose. A `||` chain costs one `whnf` frame per disjunct,+four nested quantifiers over a thirty-five element carrier stack those frames,+and the default `maxRecDepth` is reached before the proposition is decided; a+pattern match compiles to a `casesOn` tree and costs constant depth. The tables+are also easier to read this way, which is the smaller of the two reasons. -/+def isIC : LiveD → Bool+ | .c1 | .c2 | .a2 | .filler | .s1 | .s2 | .s3 | .h1 => true+ | _ => false++/-- `ICEXT(owl:Restriction)`: the seven restrictions. A PROPER subset of `IC`,+because `Y` is a class and not a restriction, and RBS Table 5.2 writes a subset+there and never an equality. -/+def isRestriction : LiveD → Bool+ | .c1 | .c2 | .a2 | .s1 | .s2 | .s3 | .h1 => true| _ => false/-- The property extensions, as a decidable relation.-ELEVEN rows are chosen: `IEXT(p1)`, `IEXT(q)`, `IEXT(p2)`, `ICEXT(Y)`, the five-constructor tables `owl:allValuesFrom`, `owl:someValuesFrom`, `owl:onProperty`,-`owl:equivalentClass` and `owl:equivalentProperty`, and the two class extensions-`ICEXT(rdfs:Class)` and `ICEXT(owl:Restriction)` that say which elements are-classes and which are restrictions. The other TEN are determined. The class-extensions of `C1`, `C2`, `A2`, `S1`, `S2` and `S3` are FORCED by Table 5.6, and-`sco`, `spo`, `dm` and `rg` are the FIXPOINT that Table 5.8's two directions-force from all of it. The fixpoint is-mutual, because `sco`, `spo`, `dm` and `rg` are themselves in `IP` or `IC` and so-appear on both sides of their own conditions. Nothing here can be adjusted-without the build going red. -/+SEVENTEEN rows are chosen: `IEXT(p1)`, `IEXT(q)`, `IEXT(p2)`, `IEXT(r1)`,+`IEXT(sy)`, `IEXT(tr)`, `ICEXT(Y)`, the eight constructor tables+`owl:allValuesFrom`, `owl:someValuesFrom`, `owl:onProperty`,+`owl:equivalentClass`, `owl:equivalentProperty`, `owl:inverseOf`, `owl:hasValue`+and `owl:sameAs`, and the four class extensions `ICEXT(rdfs:Class)`,+`ICEXT(owl:Restriction)`, `ICEXT(owl:SymmetricProperty)` and+`ICEXT(owl:TransitiveProperty)` that say which elements are classes, which are+restrictions, and which properties are symmetric or transitive. The other ELEVEN+are determined. The class extensions of `C1`, `C2`, `A2`, `S1`, `S2`, `S3` and+`H1` are FORCED by Table 5.6, and `sco`, `spo`, `dm` and `rg` are the FIXPOINT+that Table 5.8's two directions force from all of it. The fixpoint is mutual,+because `sco`, `spo`, `dm` and `rg` are themselves in `IP` or `IC` and so appear+on both sides of their own conditions. Nothing here can be adjusted without the+build going red. -/def liveIext : LiveD → LiveD → LiveD → Bool- -- ICEXT(rdfs:Class) = IC = {C1, C2, A2, Y, S1, S2, S3}. Table 5.2's "= IC" row.- | .ty, x, .cls =>- x == .c1 || x == .c2 || x == .a2 || x == .filler || x == .s1 || x == .s2 || x == .s3- -- ICEXT(owl:Restriction) = the six restrictions, a PROPER subset of IC: Y is a- -- class and not a restriction. Table 5.2 writes a subset there, never an equality.- | .ty, x, .restr =>- x == .c1 || x == .c2 || x == .a2 || x == .s1 || x == .s2 || x == .s3- -- ICEXT(C1) is everything. FORCED: C1 is ∀p1.Y, IEXT(p1) = {(alice, carl)} and+ -- ICEXT(rdfs:Class) = IC = {C1, C2, A2, Y, S1, S2, S3, H1}. Table 5.2's "= IC" row.+ | .ty, x, .cls => isIC x+ -- ICEXT(owl:Restriction), a PROPER subset of IC.+ | .ty, x, .restr => isRestriction x+ -- ICEXT(C1) is everything. FORCED: C1 is ALL p1.Y, IEXT(p1) = {(alice, carl)} and-- carl IS in ICEXT(Y), so alice qualifies and nothing else has a p1-successor.| .ty, _, .c1 => true- -- ICEXT(A2) is everything. FORCED: A2 is ∀p2.C1 and ICEXT(C1) is everything.+ -- ICEXT(A2) is everything. FORCED: A2 is ALL p2.C1 and ICEXT(C1) is everything.| .ty, _, .a2 => true- -- ICEXT(C2) is everything but alice. FORCED: C2 is ∀p2.Y and alice has the+ -- ICEXT(C2) is everything but alice. FORCED: C2 is ALL p2.Y and alice has the-- p2-successor bob, which is not in ICEXT(Y).| .ty, x, .c2 => x != .alice-- ICEXT(Y) = {carl}. NOT EMPTY, which is what makes alice's membership of@@ -383,71 +471,126 @@ def liveIext : LiveD → LiveD → LiveD → Bool-- ICEXT(S1) = ICEXT(S2) = ICEXT(S3) = {alice}. FORCED by Table 5.6's-- someValuesFrom row: alice reaches carl by p1 and by p2, carl is in ICEXT(Y),-- and ICEXT(C1) is everything.- | .ty, x, .s1 => x == .alice- | .ty, x, .s2 => x == .alice- | .ty, x, .s3 => x == .alice+ | .ty, x, .s1 | .ty, x, .s2 | .ty, x, .s3 => x == .alice+ -- ICEXT(H1) = {alice}, FORCED by Table 5.6's hasValue row: H1 is the p2-values+ -- restriction on bob, and alice is the only element with bob as a p2-successor.+ | .ty, x, .h1 => x == .alice+ -- ICEXT(owl:SymmetricProperty) = {sy} and ICEXT(owl:TransitiveProperty) = {tr}.+ -- Two DIFFERENT properties: sy is not transitive and tr is not symmetric, so this+ -- model separates the two conditions rather than meeting both with one relation+ -- that happens to satisfy each.+ | .ty, x, .symp => x == .sy+ | .ty, x, .trp => x == .tr-- ICEXT of everything else is empty.| .ty, _, _ => false-- IEXT(rdfs:subClassOf): exactly the pairs of IC whose extensions nest.-- (C1, C2) is ABSENT, and that absence is the theorem at the end of the file.- | .sco, u, v =>- ((u == .c1 || u == .a2) && (v == .c1 || v == .a2)) ||- (u == .c2 && (v == .c1 || v == .a2 || v == .c2)) ||- (u == .filler && (v == .c1 || v == .a2 || v == .c2 || v == .filler)) ||- ((u == .s1 || u == .s2 || u == .s3) &&- (v == .c1 || v == .a2 || v == .s1 || v == .s2 || v == .s3))+ | .sco, .c1, v | .sco, .a2, v => v == .c1 || v == .a2+ | .sco, .c2, v => v == .c1 || v == .c2 || v == .a2+ | .sco, .filler, v => v == .c1 || v == .c2 || v == .a2 || v == .filler+ | .sco, .s1, v | .sco, .s2, v | .sco, .s3, v | .sco, .h1, v =>+ v == .c1 || v == .a2 || v == .s1 || v == .s2 || v == .s3 || v == .h1+ | .sco, _, _ => false-- IEXT(rdfs:subPropertyOf): exactly the pairs of IP whose extensions nest. The- -- diagonal; p1 and q both ways because their extensions are equal, and both- -- inside p2; owl:equivalentClass inside rdfs:subClassOf and+ -- diagonal; p1 and q both ways because their extensions are equal, and both inside+ -- p2; p1, q and p2 inside tr, which is forced because IEXT(tr) contains both of+ -- alice's p2-pairs; owl:equivalentClass inside rdfs:subClassOf and-- owl:equivalentProperty inside rdfs:subPropertyOf, which are forced and not-- chosen. (p2, p1) is ABSENT, and that kind separation is what keeps scm-avf2-- antitone here.- | .spo, u, v =>- (isIP u && u == v) ||- ((u == .p1 || u == .q) && (v == .p1 || v == .q || v == .p2)) ||- (u == .eqc && v == .sco) ||- (u == .eqp && v == .spo)- -- IEXT(rdfs:domain): every p in IP and c in IC such that every subject of p- -- lies in ICEXT(c). p1, q and p2 have the single subject alice, so they reach- -- the three existential restrictions as well; rdf:type has every element as a- -- subject, because ICEXT(C1) is everything, so it reaches only C1 and A2; the- -- rest have subjects that are classes or properties and never alice.- | .dm, u, v =>- ((u == .p1 || u == .q || u == .p2) &&- (v == .c1 || v == .a2 || v == .s1 || v == .s2 || v == .s3)) ||- (u == .ty && (v == .c1 || v == .a2)) ||- ((u == .sco || u == .spo || u == .dm || u == .rg || u == .avf || u == .svf ||- u == .onp || u == .eqc || u == .eqp) && (v == .c1 || v == .a2 || v == .c2))+ | .spo, .p1, v | .spo, .q, v => v == .p1 || v == .p2 || v == .q || v == .tr+ | .spo, .p2, v => v == .p2 || v == .tr+ | .spo, .r1, v => v == .r1+ | .spo, .sy, v => v == .sy+ | .spo, .tr, v => v == .tr+ | .spo, .ty, v => v == .ty+ | .spo, .sco, v => v == .sco+ | .spo, .spo, v => v == .spo+ | .spo, .dm, v => v == .dm+ | .spo, .rg, v => v == .rg+ | .spo, .avf, v => v == .avf+ | .spo, .svf, v => v == .svf+ | .spo, .onp, v => v == .onp+ | .spo, .eqc, v => v == .sco || v == .eqc+ | .spo, .eqp, v => v == .spo || v == .eqp+ | .spo, .sa, v => v == .sa+ | .spo, .invo, v => v == .invo+ | .spo, .hv, v => v == .hv+ | .spo, _, _ => false+ -- IEXT(rdfs:domain): every p in IP and c in IC such that every subject of p lies+ -- in ICEXT(c). p1, q and p2 have the single subject alice, so they reach the three+ -- existential restrictions and H1 as well; r1's single subject is carl, which is+ -- in ICEXT(Y), so r1 reaches Y where nothing else does; rdf:type, owl:sameAs and+ -- tr have a subject outside ICEXT(C2), so they reach only C1 and A2; the rest have+ -- subjects that are classes or properties and never alice.+ | .dm, .p1, v | .dm, .p2, v | .dm, .q, v =>+ v == .c1 || v == .a2 || v == .s1 || v == .s2 || v == .s3 || v == .h1+ | .dm, .r1, v => v == .c1 || v == .c2 || v == .a2 || v == .filler+ | .dm, .sy, v | .dm, .sco, v | .dm, .spo, v | .dm, .dm, v | .dm, .rg, v | .dm, .avf, v |+ .dm, .svf, v | .dm, .onp, v | .dm, .eqc, v | .dm, .eqp, v | .dm, .invo, v | .dm, .hv, v =>+ v == .c1 || v == .c2 || v == .a2+ | .dm, .tr, v | .dm, .ty, v | .dm, .sa, v => v == .c1 || v == .a2+ | .dm, _, _ => false-- IEXT(rdfs:range): the same with objects for subjects, and it DIFFERS from the-- domain table. p1 and q reach Y, because their only object carl is in ICEXT(Y)- -- while their only subject alice is not; and neither reaches S1, S2 or S3,- -- where the domain table does.- | .rg, u, v =>- ((u == .p1 || u == .q) && (v == .c1 || v == .a2 || v == .c2 || v == .filler)) ||- ((u == .p2 || u == .ty || u == .sco || u == .spo || u == .dm || u == .rg ||- u == .avf || u == .svf || u == .onp || u == .eqc || u == .eqp) &&- (v == .c1 || v == .a2 || v == .c2))+ -- while their only subject alice is not; neither reaches S1, S2, S3 or H1, where+ -- the domain table does; and r1 is the mirror image of that, reaching those four on+ -- the range side and Y on the domain side.+ | .rg, .p1, v | .rg, .q, v => v == .c1 || v == .c2 || v == .a2 || v == .filler+ | .rg, .p2, v | .rg, .sy, v | .rg, .tr, v | .rg, .ty, v | .rg, .sco, v | .rg, .spo, v |+ .rg, .dm, v | .rg, .rg, v | .rg, .avf, v | .rg, .svf, v | .rg, .onp, v | .rg, .eqc, v |+ .rg, .eqp, v | .rg, .invo, v | .rg, .hv, v =>+ v == .c1 || v == .c2 || v == .a2+ | .rg, .r1, v => v == .c1 || v == .a2 || v == .s1 || v == .s2 || v == .s3 || v == .h1+ | .rg, .sa, v => v == .c1 || v == .a2+ | .rg, _, _ => false-- The graph's two universal restrictions, plus A2.- | .avf, u, v =>- (u == .c1 && v == .filler) || (u == .c2 && v == .filler) || (u == .a2 && v == .c1)+ | .avf, .c1, v | .avf, .c2, v => v == .filler+ | .avf, .a2, v => v == .c1+ | .avf, _, _ => false-- The three existential restrictions.- | .svf, u, v =>- (u == .s1 && v == .filler) || (u == .s2 && v == .c1) || (u == .s3 && v == .filler)+ | .svf, .s1, v | .svf, .s3, v => v == .filler+ | .svf, .s2, v => v == .c1+ | .svf, _, _ => false-- Each restriction is on exactly one property.- | .onp, u, v =>- ((u == .c1 || u == .s3) && v == .p1) ||- ((u == .c2 || u == .a2 || u == .s1 || u == .s2) && v == .p2)+ | .onp, .c1, v | .onp, .s3, v => v == .p1+ | .onp, .c2, v | .onp, .a2, v | .onp, .s1, v | .onp, .s2, v | .onp, .h1, v => v == .p2+ | .onp, _, _ => false-- Two distinct classes with the same extension, so Table 5.9's class row has a-- pair to work on and scm-eqc1 is exercised on something other than a diagonal.- | .eqc, u, v => (u == .s1 && v == .s2) || (u == .s2 && v == .s1)+ | .eqc, .s1, v => v == .s2+ | .eqc, .s2, v => v == .s1+ | .eqc, _, _ => false-- And two distinct properties with the same extension, for scm-eqp1.- | .eqp, u, v => (u == .p1 && v == .q) || (u == .q && v == .p1)- -- The asserted individual pairs. IEXT(p1) is NOT empty and is a PROPER subset- -- of IEXT(p2), which is what makes `p1 rdfs:subPropertyOf p2` hold here for a- -- reason rather than for want of anything to check.- | .p1, u, v => u == .alice && v == .carl- | .q, u, v => u == .alice && v == .carl- | .p2, u, v => u == .alice && (v == .bob || v == .carl)+ | .eqp, .p1, v => v == .q+ | .eqp, .q, v => v == .p1+ | .eqp, _, _ => false+ -- RBS Table 5.9 row 1 is an iff whose right-hand side is `a1 = a2`, and its+ -- variables are unscoped, which the specification's own conventions read as+ -- ranging over IR. So a conforming interpretation gives owl:sameAs the WHOLE+ -- diagonal on the carrier, and never the empty relation the first version of this+ -- model gave it.+ | .sa, u, v => u == v+ -- One inverse pair, on two DISTINCT properties: IEXT(r1) is the converse of+ -- IEXT(p1) and neither is symmetric, so inv_fwd is exercised on a pair that is not+ -- a property paired with itself.+ | .invo, .p1, v => v == .r1+ | .invo, _, _ => false+ -- One value restriction: H1 is the p2-values restriction on bob.+ | .hv, .h1, v => v == .bob+ | .hv, _, _ => false+ -- The asserted individual pairs. IEXT(p1) is NOT empty and is a PROPER subset of+ -- IEXT(p2), which is what makes `p1 rdfs:subPropertyOf p2` hold here for a reason+ -- rather than for want of anything to check.+ | .p1, .alice, v | .q, .alice, v => v == .carl+ | .p2, .alice, v => v == .bob || v == .carl+ -- The converse of p1; a symmetric relation that is not transitive; and a+ -- transitive one that is not symmetric.+ | .r1, .carl, v => v == .alice+ | .sy, .bob, v => v == .carl+ | .sy, .carl, v => v == .bob+ | .tr, .alice, v => v == .bob || v == .carl+ | .tr, .bob, v => v == .carl-- Everything else, `other` included, is empty.| _, _, _ => false@@ -471,6 +614,33 @@ instance : DecidablePred liveIP := fun x => decidable_of_iff (isIP x = true) Iff@[simp] theorem live_sp (u v : LiveD) : live.sp u v ↔ liveIext .spo u v = true := Iff.rfl@[simp] theorem live_IC (u : LiveD) : live.IC u ↔ liveIext .ty u .cls = true := Iff.rfl+/-! ## Two elaboration limits, and what they are and are not++These are the only two `set_option` lines in `lean/`, so they get a reason.++`sp_bwd`, `dom_bwd` and `rng_bwd` are quantified over the carrier FOUR times+each, twice outside the implication and twice inside its universally quantified+clause, so `decide` evaluates on the order of the fourth power of the carrier and+nests the `Decidable` instances four deep on top of that.++At twenty-six elements the old model sat inside both defaults, and that is+measured rather than assumed: `git archive` of `lean/` at 0edfe44 into an empty+directory, then `lake build` with no warm cache and no `set_option` anywhere,+completes 105 jobs in about seventy seconds with no error. At thirty-five+elements it does not, and the five conditions the second rebuild added are why+the carrier grew.++Neither option touches what is proved. `maxRecDepth` bounds how deeply the+elaborator may recurse and `maxHeartbeats` how long it may run; a proof term that+gets past them is checked by the same kernel on the same rules as one that does+not, and the axiom tripwires at the end of this file are what guard soundness.+What they do cost is build time. This is by a wide margin the longest single file+in `lean/` to elaborate, and it accounts for most of a cold `lake build`. If that+becomes intolerable the honest repair is a smaller carrier and a smaller claim,+stated as such, and not a quieter gate. -/+set_option maxRecDepth 20000+set_option maxHeartbeats 2000000+/-! ## The conditions, one decidable fact eachEach lemma is stated over `liveIext` and `liveι` directly, which is what makes@@ -777,42 +947,58 @@ theorem live_exercises_every_arm :live_arm_svf_sc, live_arm_svf_sp, live_arm_avf_sc, live_arm_avf_sp,live_arm_dom_sc, live_arm_dom_sp, live_arm_rng_sc, live_arm_rng_sp⟩-/-! ### And what is still vacuous, named rather than left to be discovered--Five of the twenty-one fields of `W3C` still hold in this model because nothing-is in the extension their antecedent reads. Both halves of that sentence are-theorems: `live_fires_the_other_sixteen` exhibits a satisfied antecedent for each-of the other sixteen, and `live_leaves_exactly_these_five_vacuous` names the five.-Sixteen plus five is twenty-one, so neither number can drift from the tables-without the build going red. The five are exactly the fields that carry NONE of-the fourteen arms: `Soundness.lean` consumes `same_fwd`,-`sym_fwd`, `trp_fwd`, `inv_fwd` and `hv_eq` through projections out of-`Conditions`, never through a derivation.--`same_fwd` is the one that cannot be exercised non-trivially at all, and that is-the specification's doing rather than this model's: RBS Table 5.9's first row-reads `( a₁ , a₂ ) ∈ IEXT(I(owl:sameAs))` **iff** `a₁ = a₂`, so the only pairs-any conforming interpretation can put in that extension are diagonal ones and the-only instance of the field is `a = a`.--The other four are ordinary omissions and could be closed, at a price this file-declines to pay: each needs its own vocabulary element plus a property or a-restriction to hold it, and every condition here is quantified over the carrier-three or four times, so the `decide` cost is quartic in the number of elements.-Twenty-six elements already cost about ten seconds. The honest report is that-these four are not exercised, not that they cannot be. -/--/-- **The other sixteen fields fire**, one satisfied antecedent each, so that-"exactly these five" below is earned rather than asserted. Sixteen plus five is-the twenty-one fields of `W3C`.--`sc_fwd`, `sp_fwd`, `dom_fwd`, `rng_fwd`, `eqc_fwd`, `eqp_fwd`, `svf_eq`,-`svf_typ`, `avf_eq`, `avf_typ`, `onp_typ` and `restr_IC` are given a pair in the-extension their antecedent reads; `sc_bwd`, `sp_bwd`, `dom_bwd` and `rng_bwd` are-given the whole antecedent, guards and universally quantified clause together,-because those are the four whose hypotheses can be met for want of anything to-check and were. -/-theorem live_fires_the_other_sixteen_raw :+/-! ### And nothing is left vacuous, which took a second rebuild to get to++Every one of the twenty-one fields of `W3C` has a SATISFIED ANTECEDENT in this+model. `live_fires_every_field` is that sentence as a theorem, one exhibited+antecedent per field, so the count cannot drift from the tables without the build+going red.++**The 15 September 2026 rebuild left five fields vacuous and said so; this is the+second rebuild, which closes them.** The five were `same_fwd`, `sym_fwd`,+`trp_fwd`, `inv_fwd` and `hv_eq`, and the note beside them said two things. The+first was that closing the other four would cost more carrier than the `decide`+budget allowed. That was a budget, not an obstruction, and it is paid here:+`sy`, `tr`, `r1`, `H1` and the five vocabulary elements that had been falling+through to `other` bring the carrier to thirty-five, the four conditions are+exercised, and the two `set_option` lines earlier in the file are what that+costs, with the reason written beside them.++The second thing it said was wrong, and it is the kind of wrong this file exists+to catch. It said `same_fwd` "cannot be exercised non-trivially by ANY model at+all because the specification makes that relation the diagonal". The premise is+right and the conclusion does not follow. RBS Table 5.9 row 1 is+`( a₁ , a₂ ) ∈ IEXT(I(owl:sameAs))` **iff** `a₁ = a₂`, the `iff` cell carrying+`rowspan="6"`, and the specification's own conventions section reads an unscoped+variable as ranging over IR: "If no explicit scope is given for a variable `x`+... then `x` is unconstrained, which means x ∈ IR". So a conforming+interpretation's `owl:sameAs` extension is the WHOLE diagonal on IR, and RBS+section 4.2 defines IR as "the universe of I, i.e., a nonempty set", so that+extension is never empty. The first version of this model gave `owl:sameAs` the+EMPTY extension, which no+conforming interpretation has, and then reported the emptiness as a fact about+the specification rather than a defect in the model. Both quotes were re-read in+the raw HTML of <https://www.w3.org/TR/owl2-rdf-based-semantics/> on 15 September+2026.++What is true is narrower and is proved below rather than asserted:+`same_fwd` has no instance at `a ≠ b` in any interpretation meeting that cell.+`sameAs_has_no_off_diagonal_instance` is that theorem, and it is a statement+about every interpretation rather than about this one, which is why it is stated+over an arbitrary `Interp`. The condition can be exercised, it is exercised here+at thirty-five instances, and every one of them is a diagonal pair. That is the+whole of the residual limitation, and it is one line rather than five. -/++/-- **All twenty-one fields fire**, one satisfied antecedent each. Nothing in+`W3C` holds here for want of anything to check.++`sc_fwd`, `sp_fwd`, `dom_fwd`, `rng_fwd`, `eqc_fwd`, `eqp_fwd`, `same_fwd`,+`inv_fwd`, `sym_fwd`, `trp_fwd`, `svf_eq`, `svf_typ`, `avf_eq`, `avf_typ`,+`hv_eq`, `onp_typ` and `restr_IC` are given a pair in the extension their+antecedent reads; `sc_bwd`, `sp_bwd`, `dom_bwd` and `rng_bwd` are given the whole+antecedent, guards and universally quantified clause together, because those are+the four whose hypotheses can be met for want of anything to check and were. -/+theorem live_fires_every_field_raw :liveIext .sco .c2 .c1 = true ∧(liveIext .ty .c2 .cls = true ∧ liveIext .ty .c1 .cls = true ∧∀ x, liveIext .ty x .c2 = true → liveIext .ty x .c1 = true) ∧@@ -827,14 +1013,20 @@ theorem live_fires_the_other_sixteen_raw :∀ x y, liveIext .p2 x y = true → liveIext .ty y .c2 = true) ∧liveIext (liveι V.equivalentClass) .s1 .s2 = true ∧liveIext (liveι V.equivalentProperty) .p1 .q = true ∧+ liveIext (liveι V.sameAs) .alice .alice = true ∧+ liveIext (liveι V.inverseOf) .p1 .r1 = true ∧+ liveIext .ty .sy (liveι V.symmetricProperty) = true ∧+ liveIext .ty .tr (liveι V.transitiveProperty) = true ∧(liveIext (liveι V.someValuesFrom) .s1 .filler = true ∧liveIext (liveι V.onProperty) .s1 .p2 = true) ∧(liveIext (liveι V.allValuesFrom) .c1 .filler = true ∧liveIext (liveι V.onProperty) .c1 .p1 = true) ∧+ (liveIext (liveι V.hasValue) .h1 .bob = true ∧+ liveIext (liveι V.onProperty) .h1 .p2 = true) ∧liveIext .ty .c1 (liveι V.Restriction) = true := by decide-/-- The same sixteen over `live`, by definitional unfolding. -/-theorem live_fires_the_other_sixteen :+/-- The same twenty-one over `live`, by definitional unfolding. -/+theorem live_fires_every_field :live.sc .c2 .c1 ∧(live.IC .c2 ∧ live.IC .c1 ∧ ∀ x, live.cext .c2 x → live.cext .c1 x) ∧live.sp .p1 .p2 ∧@@ -845,30 +1037,47 @@ theorem live_fires_the_other_sixteen :(liveIP .p2 ∧ live.IC .c2 ∧ ∀ x y, live.iext .p2 x y → live.cext .c2 y) ∧live.iext (live.ι V.equivalentClass) .s1 .s2 ∧live.iext (live.ι V.equivalentProperty) .p1 .q ∧+ live.iext (live.ι V.sameAs) .alice .alice ∧+ live.iext (live.ι V.inverseOf) .p1 .r1 ∧+ live.cext (live.ι V.symmetricProperty) .sy ∧+ live.cext (live.ι V.transitiveProperty) .tr ∧(live.iext (live.ι V.someValuesFrom) .s1 .filler ∧live.iext (live.ι V.onProperty) .s1 .p2) ∧(live.iext (live.ι V.allValuesFrom) .c1 .filler ∧live.iext (live.ι V.onProperty) .c1 .p1) ∧+ (live.iext (live.ι V.hasValue) .h1 .bob ∧+ live.iext (live.ι V.onProperty) .h1 .p2) ∧live.cext (live.ι V.Restriction) .c1 :=- live_fires_the_other_sixteen_raw--theorem live_leaves_exactly_these_five_vacuous_raw :- (∀ a b : LiveD, ¬ liveIext (liveι V.sameAs) a b = true) ∧- (∀ p : LiveD, ¬ liveIext .ty p (liveι V.symmetricProperty) = true) ∧- (∀ p : LiveD, ¬ liveIext .ty p (liveι V.transitiveProperty) = true) ∧- (∀ p r : LiveD, ¬ liveIext (liveι V.inverseOf) p r = true) ∧- (∀ z a : LiveD, ¬ liveIext (liveι V.hasValue) z a = true) := by decide--/-- **The five fields this witness does not exercise**, pinned. Each carries none-of the fourteen arms. Everything else in `W3C` has something in its extension-here, and `live_exercises_every_arm` shows every arm firing. -/-theorem live_leaves_exactly_these_five_vacuous :- (∀ a b : LiveD, ¬ live.iext (live.ι V.sameAs) a b) ∧- (∀ p : LiveD, ¬ live.cext (live.ι V.symmetricProperty) p) ∧- (∀ p : LiveD, ¬ live.cext (live.ι V.transitiveProperty) p) ∧- (∀ p r : LiveD, ¬ live.iext (live.ι V.inverseOf) p r) ∧- (∀ z a : LiveD, ¬ live.iext (live.ι V.hasValue) z a) :=- live_leaves_exactly_these_five_vacuous_raw+ live_fires_every_field_raw++/-- RBS Table 5.9's `owl:sameAs` cell, both directions, as a property of an+arbitrary interpretation. `W3C.same_fwd` is its left-to-right half and is all any+rule consumes; this is the whole cell, and it is stated here rather than added to+`W3C` because adding it would SHRINK the model class for no rule's benefit. -/+def SameAsIsTheDiagonal (I : Interp) : Prop :=+ ∀ a b : I.D, I.iext (I.ι V.sameAs) a b ↔ a = b++/-- **The residual limitation on `same_fwd`, as a theorem about every+interpretation rather than a remark about this one.**++In any interpretation meeting the cell, `same_fwd`'s antecedent is met exactly on+the diagonal, so the field can be exercised and can never be exercised at+`a ≠ b`. That is a fact about the specification: the cell is an `iff` and its+right-hand side is an equation, so there is nothing for a model builder to+choose. It is NOT the claim an earlier draft of this file made, that the field+cannot be exercised at all; it is exercised here thirty-five times. -/+theorem sameAs_has_no_off_diagonal_instance {I : Interp} (h : SameAsIsTheDiagonal I)+ {a b : I.D} (hne : a ≠ b) : ¬ I.iext (I.ι V.sameAs) a b :=+ fun hab => hne ((h a b).mp hab)++theorem live_sameAs_is_the_diagonal_raw :+ ∀ a b : LiveD, liveIext (liveι V.sameAs) a b = true ↔ a = b := by decide++/-- And this model meets the cell in BOTH directions, not just the forward half+`W3C` states. The diagonal is what a conforming interpretation has there, so+putting it in moves the model towards conformance rather than away from it. -/+theorem live_sameAs_is_the_diagonal : SameAsIsTheDiagonal live :=+ live_sameAs_is_the_diagonal_rawtheorem live_c1_is_a_class : liveIext .ty .c1 .cls = true := by decidetheorem live_c2_is_a_class : liveIext .ty .c2 .cls = true := by decide@@ -888,8 +1097,10 @@ theorem live_p2_objects_are_c2 :theorem live_p2_is_not_a_domain_of_c2 : ¬ liveIext (liveι V.domain) .p2 .c2 = true := by decide/-- `dom_bwd` is discharged over a NON-EMPTY relation: the clause it demands is-proved at `p2`'s two pairs and not by there being no pairs, which is the thing the-second kernel's own witness fails to do for this condition. -/+proved at `p2`'s two pairs and not by there being no pairs. The second kernel's+`M3` does not manage that, which is what its own `M4` was built for;+`isabelle/OO_NonVacuity.thy`'s `M4_ante_dom_bwd` is the counterpart of this+theorem. -/theorem live_dom_bwd_is_exercised : live.iext (live.ι V.domain) .p2 .c1 :=live_w3c.dom_bwd .p2 .c1 live_p2_is_in_IP live_c1_is_a_class live_p2_subjects_are_c1@@ -1104,21 +1315,26 @@ what makes `sc_bwd` vacuous. The claim also silently promoted`live_is_bridge_coherent`, which is an EXTRA property the `live` model happensto have, into a requirement of `W3CModel`, which it is not.-FOUR of the seven results listed there transfer on the nose, with the existing-witness graphs unchanged and nothing hand-built: two proved in this section, one-in `Mixed.lean`, and one that was already proved further up THIS file at the-moment the list called it open. The remaining three do not, and the reason is-stated at each of them rather than generalised into a slogan.--| result | transfers | why |-|---|---|---|-| `not_everything_is_entailed` | yes, and already did | `not_everything_is_w3c_entailed`, below |-| `an_unlisted_individual_is_not_entailed` | yes | `an_unlisted_individual_is_not_w3c_entailed` |-| `membership_in_one_member_does_not_give_the_intersection` | yes | `membership_in_one_member_is_not_w3c_enough` |-| `mix_not_absolutely_entailed` | yes | `mix_not_absolutely_w3c_entailed`, in `Mixed.lean` |-| `the_old_svf_derivation_is_not_entailed` | no | `svfWitness` has `R owl:onProperty p` with no `R rdf:type owl:Restriction`, so `onp_typ` fails on its first conjunct for EVERY choice of `IP` |-| `feed_is_not_refuted` | no | `feed` carries `Lion rdfs:subClassOf Carnivore` and no `rdfs:Class` typing, so `sc_fwd` fails; and `¬ Unsat` runs the wrong way for transfer anyway |-| `not_unsat_of_joint_model` | no | it is a lemma with a hypothesis rather than a witness, and the same direction problem |+FOUR of the results listed there transfer on the nose, with the existing witness+graphs unchanged and nothing hand-built: two proved in this section, one in+`Mixed.lean`, and one that was already proved further up THIS file at the moment+the list called it open. The rest needed a finite structure each, and have one.++| result | how it transfers |+|---|---|+| `not_everything_is_entailed` | on its own witness: `not_everything_is_w3c_entailed`, below |+| `an_unlisted_individual_is_not_entailed` | on its own witness: `an_unlisted_individual_is_not_w3c_entailed` |+| `membership_in_one_member_does_not_give_the_intersection` | on its own witness: `membership_in_one_member_is_not_w3c_enough` |+| `mix_not_absolutely_entailed` | on its own witness: `mix_not_absolutely_w3c_entailed`, in `Mixed.lean` |+| `the_old_svf_derivation_is_not_entailed` | on `svfI`, built for it: `the_old_svf_derivation_is_not_w3c_entailed`, at the end of this file |+| `feed_is_not_refuted` | on `refI false`, built for it: `feed_is_not_w3c_refuted`, in `RefuteWitness.lean` |+| `and_the_old_verdict_does_not_notice` | on `refI true`, built for it: `the_old_verdict_does_not_notice_over_w3c`, in `RefuteWitness.lean` |+| `not_unsat_of_joint_model` | by unfolding: `not_w3cUnsat_of_joint_w3c_model`, in `RefuteWitness.lean` |++The three at the bottom of that table used to read "no", with the field that+fails pinned as a checked theorem. Those theorems said the HERBRAND witness is+not a `W3CModel`, which is true and is a reason to build a different structure+rather than a reason the result is out of reach.The two `owl:oneOf` and `owl:intersectionOf` graphs go through because the listfield of `W3CModel` is an `iff` and their witnesses satisfy it in both@@ -1264,24 +1480,364 @@ theorem membership_in_one_member_is_not_w3c_enough :absurd (h (herbrand intWitness) (fun _ => False) int_witness_is_a_w3c_model)(by decide : (⟨tv, V.type, tK⟩ : Triple) ∉ intWitness)-/-! ### And two that do not transfer, with the obstruction checked rather than argued+/-! ### And the last of the seven transfers, on a countermodel built for it++`the_old_svf_derivation_is_not_entailed` was the one non-entailment in+`Witness.lean` that the empty-`IP` reading could not carry over. The obstruction+was real and was recorded as a checked theorem: `svfWitness` carries+`R owl:onProperty p` and types `R` as nothing at all, so RBS Table 5.3's+`owl:onProperty` row fails on its first conjunct, `z ∈ ICEXT(owl:Restriction)`,+for EVERY choice of `IP`, and `svf_typ` and `sc_fwd` fail beside it.++What the obstruction showed was that the HERBRAND witness is not a `W3CModel`.+It did not show that no `W3CModel` refutes the triple, and the note beside it+said so: "what is open is whether a conforming interpretation also refutes it,+and nothing here suggests it does not". It does. `svfI` below is a hand-built+finite structure of the same kind as `live`, and it settles the question in the+direction the note expected.++The construction is the shortest one there is. `C rdfs:subClassOf R` needs+`ICEXT(C) ⊆ ICEXT(R)`, and the EMPTY set is contained in everything, so+`ICEXT(C) := ∅` satisfies the premise and refutes the conclusion at the same+time. Everything else is then forced: `R` is `∃p.D`, `IEXT(p) = {(x, y)}` and+`ICEXT(D) = {y}`, so Table 5.6 forces `ICEXT(R) = {x}`; `R` is typed+`owl:Restriction` and `C`, `D`, `R` are typed `rdfs:Class`, which is what+`svf_typ`, `onp_typ` and `restr_IC` demand and what the Herbrand witness could+not supply; and the four `rdfs:*` tables are the fixpoint Table 5.8's two+directions force from that.++`q` is the one element here that no premise asks for, and the reason it is+present is `sameAs_diagonal_needs_an_off_diagonal_subproperty` below. -/++/-- **Two distinct properties, one below the other, are FORCED on any model that+gives `owl:sameAs` the extension the specification gives it.**++This is not a remark about model building, it is a consequence of two table cells+meeting. Suppose `IEXT(rdfs:subPropertyOf)` were contained in the diagonal.+Table 5.9 row 1 then makes it a subset of `IEXT(owl:sameAs)`, so Table 5.8 row 2+BACKWARD puts the pair `(I(rdfs:subPropertyOf), I(owl:sameAs))` into+`IEXT(rdfs:subPropertyOf)` itself, and the diagonal assumption collapses that+pair, making the two IRIs denote the same thing.++The practical effect is that a small countermodel cannot have both a+`rdfs:subPropertyOf` extension that is exactly the diagonal on `IP` and a+non-empty `owl:sameAs`, which is why `svfI` carries a second property `q` with+`IEXT(q) = IEXT(p)`. Both are in `IP` by RBS Table 5.3, whose `I(E)` column reads+"∈ IP" for `owl:sameAs` and for `owl:onProperty`, re-read in the raw HTML of+<https://www.w3.org/TR/owl2-rdf-based-semantics/> on 15 September 2026. -/+theorem sameAs_diagonal_needs_an_off_diagonal_subproperty {I : Interp} {IP : I.D → Prop}+ (W : W3C I IP) (hd : SameAsIsTheDiagonal I)+ (hsa : IP (I.ι V.sameAs)) (hspo : IP (I.ι V.subPropertyOf))+ (hne : I.ι V.subPropertyOf ≠ I.ι V.sameAs)+ (hdiag : ∀ a b, I.sp a b → a = b) : False :=+ hne (hdiag _ _ (W.sp_bwd _ _ hspo hsa (fun x y hxy => (hd x y).mpr (hdiag x y hxy))))++/-- The eighteen elements of the countermodel for `svfPremises`. Two individuals;+three classes, of which one is a restriction; two properties with equal+extensions; ten vocabulary denotations that have to be told apart; and one junk+element. -/+inductive SvfD where+ /-- The subject of the asserted `x p y`, and the element the refuted triple+ claims is a `C`. -/+ | ex_x+ /-- Its `p`-successor, and the only member of `ICEXT(D)`. -/+ | ex_y+ /-- `C`, whose class extension is EMPTY. That is the refutation: the premise+ `C rdfs:subClassOf R` holds because the empty set is contained in `ICEXT(R)`,+ and `x rdf:type C` fails because nothing is in `ICEXT(C)`. -/+ | cC+ /-- `D`, the filler, with `ICEXT(D) = {y}`. -/+ | cD+ /-- `R`, the restriction `∃p.D`, with `ICEXT(R) = {x}` FORCED by Table 5.6. -/+ | cR+ /-- `p`, with the single pair `(x, y)`. -/+ | prop+ /-- A second property with `IEXT(q) = IEXT(p)`, present only so that+ `IEXT(rdfs:subPropertyOf)` is not the diagonal, which+ `sameAs_diagonal_needs_an_off_diagonal_subproperty` shows is what a non-empty+ `owl:sameAs` costs. -/+ /-- `rdf:type`. -/+ | ty+ /-- `rdfs:subClassOf`. -/+ | sco+ /-- `rdfs:subPropertyOf`. -/+ | spo+ /-- `rdfs:domain`. -/+ | dm+ /-- `rdfs:range`. -/+ | rg+ /-- `owl:onProperty`. -/+ | onp+ /-- `owl:someValuesFrom`. -/+ | svf+ /-- `owl:sameAs`, carrying the diagonal, as Table 5.9 row 1 requires. -/+ | sa+ /-- `rdfs:Class`. -/+ | cls+ /-- `owl:Restriction`. -/+ | restr+ /-- Every other IRI, with both extensions empty. -/+ | other+deriving DecidableEq, Repr++namespace SvfD++/-- The carrier as a list, so quantification over it is decidable without+Mathlib. -/+def all : List SvfD :=+ [ex_x, ex_y, cC, cD, cR, prop, qq, ty, sco, spo, dm, rg, onp, svf, sa, cls, restr, other]++theorem mem_all (w : SvfD) : w ∈ all := by cases w <;> decide++instance decForall (p : SvfD → Prop) [DecidablePred p] : Decidable (∀ w, p w) :=+ decidable_of_iff (∀ w ∈ all, p w) ⟨fun h w => h w (mem_all w), fun h w _ => h w⟩++instance decExists (p : SvfD → Prop) [DecidablePred p] : Decidable (∃ w, p w) :=+ decidable_of_iff (∃ w ∈ all, p w)+ ⟨fun ⟨w, _, h⟩ => ⟨w, h⟩, fun ⟨w, h⟩ => ⟨w, mem_all w, h⟩⟩++end SvfD++/-- The denotations. `owl:allValuesFrom`, `owl:hasValue`, `owl:inverseOf`,+`owl:equivalentClass`, `owl:equivalentProperty`, `owl:SymmetricProperty`,+`owl:TransitiveProperty` and the three list constructors all fall to `other`,+whose extensions are empty; `svfPremises` mentions none of them and no rule+consumes their rows here. `live` is the model that exercises them. -/+def svfTable : List (Term × SvfD) :=+ [ (V.type, .ty), (V.subClassOf, .sco), (V.subPropertyOf, .spo),+ (V.domain, .dm), (V.range, .rg), (V.onProperty, .onp),+ (V.someValuesFrom, .svf), (V.sameAs, .sa),+ (V.Class, .cls), (V.Restriction, .restr),+ (tC, .cC), (tD, .cD), (tR, .cR), (tp, .prop), (tx, .ex_x), (ty, .ex_y) ]++/-- Terms denote their table entry, or `other`. -/+def svfι (t : Term) : SvfD := (List.lookup t svfTable).getD .other++/-- `IP`: the ten elements that carry pairs, so the structure is bridge-coherent+in the sense `live_is_bridge_coherent` states. -/+def svfIsIP : SvfD → Bool+ | .prop | .qq | .ty | .sco | .spo | .dm | .rg | .onp | .svf | .sa => true+ | _ => false++/-- The extensions. SIX rows are chosen, `IEXT(p)`, `IEXT(q)`, `ICEXT(D)`,+`owl:onProperty`, `owl:someValuesFrom` and the two class-typing rows; `ICEXT(C)`+is chosen EMPTY, which is the refutation; `ICEXT(R)` is forced by Table 5.6, the+`owl:sameAs` diagonal is forced by Table 5.9, and `sco`, `spo`, `dm` and `rg` are+the fixpoint Table 5.8's two directions force. -/+def svfIext : SvfD → SvfD → SvfD → Bool+ -- ICEXT(rdfs:Class) = IC = {C, D, R}. All three have to be classes: sc_fwd+ -- demands it of C and R, and svf_typ demands it of D.+ | .ty, w, .cls => w == .cC || w == .cD || w == .cR+ -- ICEXT(owl:Restriction) = {R}, a PROPER subset of IC. This is the typing the+ -- Herbrand witness lacks and the reason that witness is not a W3CModel.+ | .ty, w, .restr => w == .cR+ -- ICEXT(R) = {x}, FORCED by Table 5.6: R is ∃p.D, x reaches y by p, y is a D,+ -- and nothing else has a p-successor.+ | .ty, w, .cR => w == .ex_x+ -- ICEXT(D) = {y}, asserted by the graph.+ | .ty, w, .cD => w == .ex_y+ -- ICEXT of everything else, C INCLUDED, is empty.+ | .ty, _, _ => false+ -- IEXT(rdfs:subClassOf): the pairs of IC whose extensions nest. C is below+ -- everything because its extension is empty, which is what makes the premise+ -- true and the conclusion false at once.+ | .sco, .cC, v => v == .cC || v == .cD || v == .cR+ | .sco, .cD, v => v == .cD+ | .sco, .cR, v => v == .cR+ | .sco, _, _ => false+ -- IEXT(rdfs:subPropertyOf): the pairs of IP whose extensions nest. p and q both+ -- ways, because their extensions are equal, and the diagonal otherwise.+ | .spo, .prop, v | .spo, .qq, v => v == .prop || v == .qq+ | .spo, .ty, v => v == .ty+ | .spo, .sco, v => v == .sco+ | .spo, .spo, v => v == .spo+ | .spo, .dm, v => v == .dm+ | .spo, .rg, v => v == .rg+ | .spo, .onp, v => v == .onp+ | .spo, .svf, v => v == .svf+ | .spo, .sa, v => v == .sa+ | .spo, _, _ => false+ -- IEXT(rdfs:domain) and IEXT(rdfs:range), and they DIFFER: p's only subject is+ -- x, which is an R, and its only object is y, which is a D.+ | .dm, .prop, v | .dm, .qq, v => v == .cR+ | .dm, _, _ => false+ | .rg, .prop, v | .rg, .qq, v => v == .cD+ | .rg, _, _ => false+ -- The restriction, on one property, with one filler.+ | .onp, .cR, v => v == .prop+ | .onp, _, _ => false+ | .svf, .cR, v => v == .cD+ | .svf, _, _ => false+ -- RBS Table 5.9 row 1, which is an iff whose right-hand side is an equation.+ | .sa, u, v => u == v+ -- The asserted pair, and q's copy of it.+ | .prop, .ex_x, v | .qq, .ex_x, v => v == .ex_y+ -- Everything else is empty.+ | _, _, _ => false++/-- The interpretation. -/+def svfI : Interp where+ D := SvfD+ ι := svfι+ iext := fun p x y => svfIext p x y = true++/-- `IP` as a predicate. -/+def svfIP (x : SvfD) : Prop := svfIsIP x = true++instance : DecidablePred svfIP := fun x => decidable_of_iff (svfIsIP x = true) Iff.rfl++theorem svf_sc_fwd : ∀ a b : SvfD, svfIext .sco a b = true →+ svfIext .ty a .cls = true ∧ svfIext .ty b .cls = true ∧+ ∀ x, svfIext .ty x a = true → svfIext .ty x b = true := by decide++theorem svf_sc_bwd : ∀ a b : SvfD, svfIext .ty a .cls = true → svfIext .ty b .cls = true →+ (∀ x, svfIext .ty x a = true → svfIext .ty x b = true) → svfIext .sco a b = true := by decide++theorem svf_sp_fwd : ∀ a b : SvfD, svfIext .spo a b = true →+ svfIP a ∧ svfIP b ∧ ∀ x y, svfIext a x y = true → svfIext b x y = true := by decide++theorem svf_sp_bwd : ∀ a b : SvfD, svfIP a → svfIP b →+ (∀ x y, svfIext a x y = true → svfIext b x y = true) → svfIext .spo a b = true := by decide++theorem svf_dom_fwd : ∀ p c : SvfD, svfIext (svfι V.domain) p c = true →+ svfIP p ∧ svfIext .ty c .cls = true ∧+ ∀ x y, svfIext p x y = true → svfIext .ty x c = true := by decide++theorem svf_dom_bwd : ∀ p c : SvfD, svfIP p → svfIext .ty c .cls = true →+ (∀ x y, svfIext p x y = true → svfIext .ty x c = true) →+ svfIext (svfι V.domain) p c = true := by decide++theorem svf_rng_fwd : ∀ p c : SvfD, svfIext (svfι V.range) p c = true →+ svfIP p ∧ svfIext .ty c .cls = true ∧+ ∀ x y, svfIext p x y = true → svfIext .ty y c = true := by decide++theorem svf_rng_bwd : ∀ p c : SvfD, svfIP p → svfIext .ty c .cls = true →+ (∀ x y, svfIext p x y = true → svfIext .ty y c = true) →+ svfIext (svfι V.range) p c = true := by decide++theorem svf_eqc_fwd : ∀ a b : SvfD, svfIext (svfι V.equivalentClass) a b = true →+ svfIext .ty a .cls = true ∧ svfIext .ty b .cls = true ∧+ ∀ x, (svfIext .ty x a = true ↔ svfIext .ty x b = true) := by decide++theorem svf_eqp_fwd : ∀ a b : SvfD, svfIext (svfι V.equivalentProperty) a b = true →+ svfIP a ∧ svfIP b ∧ ∀ x y, (svfIext a x y = true ↔ svfIext b x y = true) := by decide++theorem svf_same_fwd : ∀ a b : SvfD, svfIext (svfι V.sameAs) a b = true → a = b := by decide++theorem svf_inv_fwd : ∀ p r : SvfD, svfIext (svfι V.inverseOf) p r = true →+ svfIP p ∧ svfIP r ∧ ∀ x y, (svfIext p x y = true ↔ svfIext r y x = true) := by decide-Both obstructions are independent of `IP`: the field that fails does not mention-it. They are recorded as theorems so that a later reader who tries the same-`IP := fun _ => False` trick is told why it stops, instead of rediscovering it. -/+theorem svf_sym_fwd : ∀ p : SvfD, svfIext .ty p (svfι V.symmetricProperty) = true →+ ∀ x y, svfIext p x y = true → svfIext p y x = true := by decide-/-- `svfWitness` carries `R owl:someValuesFrom D` and `R owl:onProperty p` and-types `R` as nothing at all, so RBS Table 5.3's `owl:onProperty` row fails on its-FIRST conjunct, `z ∈ ICEXT(owl:Restriction)`. No choice of `IP` repairs that,-which is why `the_old_svf_derivation_is_not_entailed` stays a statement about-the `Conditions` class. -/-theorem svf_witness_misses_the_restriction_typing :- ((⟨tR, V.onProperty, tp⟩ : Triple) ∈ svfWitness) ∧- (⟨tR, V.type, V.Restriction⟩ : Triple) ∉ svfWitness := by decide+theorem svf_trp_fwd : ∀ p : SvfD, svfIext .ty p (svfι V.transitiveProperty) = true →+ ∀ x y z, svfIext p x y = true → svfIext p y z = true → svfIext p x z = true := by decide-/-! `feed`'s obstruction is the matching one and it is checked in-`RefuteWitness.lean`, beside the theorem it blocks, because `feedClosure` lives-there. -/+theorem svf_svf_eq : ∀ z c p : SvfD, svfIext (svfι V.someValuesFrom) z c = true →+ svfIext (svfι V.onProperty) z p = true →+ ∀ x, (svfIext .ty x z = true ↔ ∃ y, svfIext p x y = true ∧ svfIext .ty y c = true) := by+ decide++theorem svf_avf_eq : ∀ z c p : SvfD, svfIext (svfι V.allValuesFrom) z c = true →+ svfIext (svfι V.onProperty) z p = true →+ ∀ x, (svfIext .ty x z = true ↔ ∀ y, svfIext p x y = true → svfIext .ty y c = true) := by+ decide++theorem svf_hv_eq : ∀ z a p : SvfD, svfIext (svfι V.hasValue) z a = true →+ svfIext (svfι V.onProperty) z p = true →+ ∀ x, (svfIext .ty x z = true ↔ svfIext p x a = true) := by decide++theorem svf_restr_IC : ∀ x : SvfD, svfIext .ty x (svfι V.Restriction) = true →+ svfIext .ty x .cls = true := by decide++theorem svf_svf_typ : ∀ z c : SvfD, svfIext (svfι V.someValuesFrom) z c = true →+ svfIext .ty z (svfι V.Restriction) = true ∧ svfIext .ty c .cls = true := by decide++theorem svf_avf_typ : ∀ z c : SvfD, svfIext (svfι V.allValuesFrom) z c = true →+ svfIext .ty z (svfι V.Restriction) = true ∧ svfIext .ty c .cls = true := by decide++theorem svf_onp_typ : ∀ z p : SvfD, svfIext (svfι V.onProperty) z p = true →+ svfIext .ty z (svfι V.Restriction) = true ∧ svfIP p := by decide++/-- Every asserted triple of `svfPremises` holds. -/+theorem svf_facts :+ ∀ t ∈ svfPremises, svfIext (svfι t.p) (svfι t.s) (svfι t.o) = true := by decide++theorem svf_meets_the_w3c_conditions : W3C svfI svfIP where+ sc_fwd := svf_sc_fwd+ sc_bwd := svf_sc_bwd+ sp_fwd := svf_sp_fwd+ sp_bwd := svf_sp_bwd+ dom_fwd := svf_dom_fwd+ dom_bwd := svf_dom_bwd+ rng_fwd := svf_rng_fwd+ rng_bwd := svf_rng_bwd+ eqc_fwd := svf_eqc_fwd+ eqp_fwd := svf_eqp_fwd+ same_fwd := svf_same_fwd+ inv_fwd := svf_inv_fwd+ sym_fwd := svf_sym_fwd+ trp_fwd := svf_trp_fwd+ svf_eq := svf_svf_eq+ avf_eq := svf_avf_eq+ hv_eq := svf_hv_eq+ restr_IC := svf_restr_IC+ svf_typ := svf_svf_typ+ avf_typ := svf_avf_typ+ onp_typ := svf_onp_typ++/-- **A `W3CModel` of `svfPremises`.** The three list fields are vacuous because+`svfPremises` carries no `owl:intersectionOf`, `owl:unionOf` or `owl:oneOf`+triple. -/+theorem svfI_is_a_w3c_model : W3CModel svfI svfIP svfPremises where+ conds := svf_meets_the_w3c_conditions+ facts := svf_facts+ int_eq := fun c l _ hc =>+ absurd hc (not_mem_pred svfPremises V.intersectionOf (by decide) c l)+ uni_eq := fun c l _ hc => absurd hc (not_mem_pred svfPremises V.unionOf (by decide) c l)+ oneOf_eq := fun c l _ hc => absurd hc (not_mem_pred svfPremises V.oneOf (by decide) c l)++theorem svfI_is_live_raw :+ (svfIext .ty .ex_x .cR = true ∧ svfIext .ty .ex_y .cD = true) ∧+ (∀ w, ¬ svfIext .ty w .cC = true) ∧+ (svfIext .prop .ex_x .ex_y = true) ∧+ (svfIext .ty .cR (svfι V.Restriction) = true ∧+ ¬ svfIext .ty .cD (svfι V.Restriction) = true) ∧+ (svfIext .spo .prop .qq = true ∧ ¬ svfIext .spo .prop .ty = true) ∧+ (∀ p x y : SvfD, svfIext p x y = true → svfIP p) := by decide++/-- **The countermodel is not degenerate**, and the last two conjuncts are the+ones that matter. `IEXT(rdfs:subPropertyOf)` is not the diagonal, which is what+lets the `owl:sameAs` row be the diagonal rather than empty; and every predicate+carrying a pair is in `IP`, so the structure is in the image of the bridge in+`W3C.lean`, which the Herbrand witness this replaces is not. -/+theorem svfI_is_live :+ (svfI.cext .cR .ex_x ∧ svfI.cext .cD .ex_y) ∧+ (∀ w, ¬ svfI.cext .cC w) ∧+ svfI.iext .prop .ex_x .ex_y ∧+ (svfI.cext (svfI.ι V.Restriction) .cR ∧ ¬ svfI.cext (svfI.ι V.Restriction) .cD) ∧+ (svfI.sp .prop .qq ∧ ¬ svfI.sp .prop .ty) ∧+ (∀ p x y : SvfD, svfI.iext p x y → svfIP p) :=+ svfI_is_live_raw++theorem svfI_refutes_the_conclusion : ¬ svfIext (svfι V.type) (svfι tx) (svfι tC) = true := by+ decide++/-- **The old `cls-svf1` derivation fails over the specification's model class+too.** `C ⊑ ∃p.D` with `x p y` and `y ∈ D` does not entail `x ∈ C`, and this is+now a statement about `W3CModel` rather than about `Semantics.lean`'s weaker+`Conditions`.++Read the module docstring before quoting it anywhere. `W3CModel`'s class is still+LARGER than the bridge image of the conforming interpretations, because `W3C`+omits every table row no rule consumes, so this is not a proof that the triple+fails to be OWL 2 RDF-Based entailed. It is the strongest statement this+development can make about the defect `tests/reason_rl_ext_soundness_test.rs`+pins, and it is strictly stronger than the Herbrand result it stands beside. -/+theorem the_old_svf_derivation_is_not_w3c_entailed :+ ¬ W3CEntails svfPremises ⟨tx, V.type, tC⟩ := fun h =>+ absurd (h svfI svfIP svfI_is_a_w3c_model) svfI_refutes_the_conclusion/-! ## Axioms, pinned@@ -1313,13 +1869,17 @@ footprint below. -/#guard_msgs in#print axioms live_exercises_every_arm-/-- info: 'OOCert.live_fires_the_other_sixteen' depends on axioms: [propext] -/+/-- info: 'OOCert.live_fires_every_field' depends on axioms: [propext] -/#guard_msgs in-#print axioms live_fires_the_other_sixteen+#print axioms live_fires_every_field-/-- info: 'OOCert.live_leaves_exactly_these_five_vacuous' depends on axioms: [propext] -/+/-- info: 'OOCert.live_sameAs_is_the_diagonal' depends on axioms: [propext] -/#guard_msgs in-#print axioms live_leaves_exactly_these_five_vacuous+#print axioms live_sameAs_is_the_diagonal++/-- info: 'OOCert.sameAs_has_no_off_diagonal_instance' does not depend on any axioms -/+#guard_msgs in+#print axioms sameAs_has_no_off_diagonal_instance/-- info: 'OOCert.scm_avf2_runs_one_way_under_the_specification' depends on axioms: [propext] -/#guard_msgs in@@ -1356,4 +1916,22 @@ Quot.sound]#guard_msgs in#print axioms membership_in_one_member_is_not_w3c_enough+/-- info: 'OOCert.svfI_is_a_w3c_model' depends on axioms: [propext] -/+#guard_msgs in+#print axioms svfI_is_a_w3c_model++/-- info: 'OOCert.svfI_is_live' depends on axioms: [propext] -/+#guard_msgs in+#print axioms svfI_is_live++/-- info: 'OOCert.the_old_svf_derivation_is_not_w3c_entailed' depends on axioms: [propext] -/+#guard_msgs in+#print axioms the_old_svf_derivation_is_not_w3c_entailed++/--+info: 'OOCert.sameAs_diagonal_needs_an_off_diagonal_subproperty' does not depend on any axioms+-/+#guard_msgs in+#print axioms sameAs_diagonal_needs_an_off_diagonal_subproperty+end OOCertdiff --git a/lean/OOCert/Witness.lean b/lean/OOCert/Witness.leanindex 0e343b64..42c5216c 100644--- a/lean/OOCert/Witness.lean+++ b/lean/OOCert/Witness.lean@@ -298,32 +298,35 @@ theorem svf_witness_is_a_model : Model (herbrand svfWitness) svfPremises where/-- **The old rule was unsound.** `C ⊑ ∃p.D` together with `x p y` and `y ∈ D` does not entail`x ∈ C`. The reasoner derived exactly this until 13 September 2026.-**This is the one non-entailment in this file that does NOT transfer to the-`W3CModel` class**, and the field that stops it is checked rather than-argued: `W3CWitness.lean`'s `svf_witness_misses_the_restriction_typing`.+**This is the one non-entailment in this file whose own witness is not a+`W3CModel`**, and the field that stops it is checked rather than argued.`onp_typ` is RBS Table 5.3's `owl:onProperty` row, whose first conjunct is`z ∈ ICEXT(owl:Restriction)`. `svfWitness` carries `R owl:onProperty p` and types`R` as nothing at all, so the antecedent holds and the consequent fails.`svf_typ` fails the same way on `R owl:someValuesFrom D`, and `sc_fwd`, Table 5.8row 1 forward, fails on `C rdfs:subClassOf R` because `IC` is empty here, no-triple having `rdfs:Class` as its object.--None of those three fields mentions `IP`, so the escape that works for the other-three witnesses in this repository, choosing `IP := fun _ => False` to make the-backward conditions vacuous, does not apply. A conforming replacement is a-hand-built finite structure of the kind `W3CWitness.lean` builds.--An earlier version of this paragraph gave a different and wrong reason: that-bridge coherence forces every predicate the witness uses into `IP` and `sp_bwd`-then demands reflexive `rdfs:subPropertyOf` triples. Bridge coherence is a-property `W3CWitness.lean`'s model has, not a field of `W3CModel`, and `IP` is-free.+triple having `rdfs:Class` as its object. None of those three fields mentions+`IP`, so the escape that works for the other three witnesses in this repository,+choosing `IP := fun _ => False` to make the backward conditions vacuous, does not+apply.++That is a fact about THIS witness and it was once written up as though it were a+fact about the statement. It is not: a witness that is not a `W3CModel` is a+reason to build one. `W3CWitness.lean`'s `svfI` is that structure and+`the_old_svf_derivation_is_not_w3c_entailed` is the resulting theorem, which is+strictly stronger than this one.++An earlier version of this paragraph gave a different and wrong reason for the+witness failing: that bridge coherence forces every predicate the witness uses+into `IP` and `sp_bwd` then demands reflexive `rdfs:subPropertyOf` triples.+Bridge coherence is a property `W3CWitness.lean`'s models have, not a field of+`W3CModel`, and `IP` is free.**The claim itself is not in doubt and must not be withdrawn on the strength of-this note.** `tests/reason_rl_ext_soundness_test.rs` pins a real defect; what is-open is whether a conforming interpretation also refutes it, and nothing here-suggests it does not. -/+this note.** `tests/reason_rl_ext_soundness_test.rs` pins a real defect, and the+question that used to be open here, whether a structure meeting the quoted table+cells also refutes it, is answered yes by `svfI`. -/theorem the_old_svf_derivation_is_not_entailed :¬ Entails svfPremises ⟨tx, V.type, tC⟩ := fun h =>absurd (h (herbrand svfWitness) svf_witness_is_a_model)@@ -470,11 +473,11 @@ theorem the_avf2_direction_the_table_gives_is_entailed :`C1 rdfs:subClassOf C2` here, which is what copying `scm-avf1` gives, would bemaking a claim this model refutes.-**This one has a conforming replacement built for it**, and it is the only one-in the repository that needed a new structure rather than a re-reading of the-one it already had: `W3CWitness.lean`'s+**This one has a conforming replacement built for it**, and it was the first of+the four that needed a new structure rather than a re-reading of the one it+already had: `W3CWitness.lean`'s`the_natural_avf2_direction_is_not_w3c_entailed` refutes the same triple from the-same premises with a twenty-six-element bridge-coherent structure that meets the+same premises with a thirty-five-element bridge-coherent structure that meets thequoted cells of Tables 5.2, 5.3, 5.6, 5.8, 5.9, 5.12 and 5.13.`herbrand avfWitness` is not such a structure. `avfWitness` contains no `rdf:type`