leanified/CoreReader/Reflexivity.lean
Back to claims · Declarations and proofs
Philosophy 0.1.4 · considered Core 0.1.4. This view uses the repository’s public target catalog, readers and Lean files. Presentation does not change their judgments.
Expand Lean and line explanations · 367 lines
L1import StdImports Std and its dependencies into this module.
L3namespace CoreReader.AgencyOpens namespace CoreReader.Agency; file boundaries do not change declaration identity.
L5inductive Phase | formation | application | revisionDefines formation, application and revision phase tags.
L6 deriving DecidableEq, ReprGenerates decidable equality and display instances for the preceding datatype.
L8structure PrincipleKey whereIdentifies a registered principle by owner and local identifier.
L9 owner : NatStores the owning subject identifier.
L10 localId : NatStores the principle identifier within its owner.
L11 deriving DecidableEq, ReprGenerates decidable equality and display instances for the preceding datatype.
L13inductive SubjectDistinguishes system, principle and phase-indexed principle-process objects.
L14 | system (owner : Nat)Represents the system itself, identified by its owner number.
L15 | principle (owner id : Nat)Represents a particular principle by owner and local principle identifier.
L16 | process (owner id : Nat) (phase : Phase)Represents that principle's formation, application or revision process as a separate subject.
L17 deriving DecidableEq, ReprGenerates decidable equality and display instances for the preceding datatype.
L19def Subject.owner : Subject → NatExtracts the owner's identifier from every subject constructor.
L20 | .system n => nExtracts the owner directly from a system subject.
L21 | .principle n _ => nExtracts a principle's owner while ignoring its local identifier.
L22 | .process n _ _ => nExtracts a process subject's owner independently of its principle identifier and phase.
L24inductive Activity | generation | assessmentDistinguishes generation work from assessment work.
L25 deriving DecidableEq, ReprGenerates decidable equality and display instances for the preceding datatype.
L27inductive QuestionKind | conformity | formationBasis | applicability | revisionGroundsSeparates conformity, formation basis, applicability and revision-ground questions.
L28 deriving DecidableEq, ReprGenerates decidable equality and display instances for the preceding datatype.
L30inductive SampleProgram | alwaysTrue | onlyAtZeroProvides a constant-true program and a program true only at zero.
L31 deriving DecidableEq, ReprGenerates decidable equality and display instances for the preceding datatype.
L33def SampleProgram.run : SampleProgram → Nat → BoolEvaluates those two programs on natural inputs.
L34 | .alwaysTrue, _ => trueThe alwaysTrue sample program accepts every natural-number input.
L35 | .onlyAtZero, n => n == 0The onlyAtZero program returns true precisely at input zero.
L37/- A generated candidate specifies both the inputs it tests and the scope it proposes to license. -/Documents the following definition or result: Stores tested inputs separately from the claimed scope, allowing overextended claims.
L38structure MethodDraft whereStores tested inputs separately from the claimed scope, allowing overextended claims.
L39 testedInputs : List NatRecords the inputs on which this method draft actually tests a program.
L40 claimedScope : List NatSeparately records the input scope the draft proposes to authorize.
L41 deriving DecidableEq, ReprGenerates decidable equality and display instances for the preceding datatype.
L43def MethodDraft.accepts (draft : MethodDraft) (program : SampleProgram) : Bool :=Accepts a program when it succeeds on all listed test inputs; untested inputs are unchecked.
L44 draft.testedInputs.all program.runAccepts a program when every tested input returns true; claimedScope is not checked here.
L46/- This finite application asks whether a proposed rule's observed inputs support its claimed input scope. -/Documents the following definition or result: Binds a target and question kind to requested scope and the target's current method content.
L47structure Inquiry whereBinds a target and question kind to requested scope and the target's current method content.
L48 target : SubjectIdentifies the exact subject whose method is being examined.
L49 kind : QuestionKindDistinguishes conformity, formation reasons, applicability and revision reasons as inquiry purposes.
L50 requestedScope : List NatRecords the input scope this particular inquiry asks the method to cover.
L51 currentMethod : MethodDraftAttaches the actual method draft under examination, including its tested and claimed inputs.
L52 deriving DecidableEq, ReprGenerates decidable equality and display instances for the preceding datatype.
L54inductive ReasonContentRepresents purposes, declared scopes, observations and concrete program/input counterexamples.
L55 | purpose (inputs : List Nat)A purpose reason names the inputs the method is intended to address.
L56 | declaredScope (inputs : List Nat)A scope reason states the method's declared input limits.
L57 | observation (input : Nat) (output : Bool)An observation reason records a specific input and Boolean output.
L58 | counterexample (program : SampleProgram) (input : Nat)A counterexample reason names an actual sample program and input to check.
L59 deriving DecidableEq, ReprGenerates decidable equality and display instances for the preceding datatype.
L61def ReasonContent.identifier : ReasonContent → NatAssigns a small code to each reason constructor; the code alone is not evidential content.
L62 | .purpose _ => 0Uses local reference 0 for purpose reasons; this is a category identifier, not a unique global identity.
L63 | .declaredScope _ => 1Uses local reference 1 for declared-scope reasons.
L64 | .observation _ _ => 2Uses local reference 2 for observation reasons.
L65 | .counterexample _ _ => 3Uses local reference 3 for counterexample reasons.
L67/- Reasons have independently supplied contents, a stable local reference and the actual target they concern. -/Documents the following definition or result: Attaches a reason's content and reference to the subject it concerns.
L68structure ReasonObject whereAttaches a reason's content and reference to the subject it concerns.
L69 reference : NatStores a local reference identifying this reason in the modeled inquiry.
L70 target : SubjectIdentifies the subject this reason actually concerns.
L71 content : ReasonContentStores the purpose, scope, observation or counterexample contents of the reason.
L72 deriving DecidableEq, ReprGenerates decidable equality and display instances for the preceding datatype.
L74inductive AssessmentResult | supportedWithinScope | insufficient | notApplicable | undeterminedAllows scoped support, insufficiency, nonapplicability and undetermined results.
L75 deriving DecidableEq, ReprGenerates decidable equality and display instances for the preceding datatype.
L77inductive WorkOutcomeSeparates an assessment result from a generated method draft.
L78 | assessment (result : AssessmentResult)Packages a verdict as an assessment outcome; a negative verdict is still an assessment.
L79 | generated (draft : MethodDraft)Packages a newly generated method draft, without asserting that the draft is correct.
L80 deriving DecidableEq, ReprGenerates decidable equality and display instances for the preceding datatype.
L82/- A method's question, source reasons and limits are determined before looking at its activity records.Documents the following definition or result: Registers a rule's identity, activity, declared method, applicability, inquiries, reasons, limits and explicit outcome semantics.
L83The meaning relation describes application of that method, not its universal adequacy. -/Documents the following definition or result: Registers a rule's identity, activity, declared method, applicability, inquiries, reasons, limits and explicit outcome semantics.
L84structure Principle whereRegisters a rule's identity, activity, declared method, applicability, inquiries, reasons, limits and explicit outcome semantics.
L85 key : PrincipleKeyGives the principle an owner/local identifier used to resolve its records.
L86 activity : ActivitySpecifies whether this principle governs generation or assessment activity.
L87 declaredMethod : MethodDraftStates the method draft belonging to this registered principle.
L88 applicable : Subject → PropStates the subjects on which this principle is applicable.
L89 inquiry : Subject → InquiryAssigns the actual question to examine for each subject.
L90 reasons : Subject → List ReasonObjectAssigns the reasons supplied for each subject's question.
L91 limits : Subject → List NatAssigns the retained input limits for each subject's application.
L92 meaning : Inquiry → List ReasonObject → List Nat → WorkOutcome → PropDefines when an outcome follows this principle's question, reasons and limits; no adequacy law is imposed by this field alone.
L94structure WorkRecord whereStores the actual rule identity, target, activity, inquiry, reasons, limits and outcome used by an application.
L95 usedPrinciple : PrincipleKeyRecords the exact registered principle key claimed to have been used.
L96 target : SubjectRecords the subject on which this work was performed.
L97 activity : ActivityRecords whether this work was generation or assessment.
L98 inquiry : InquiryStores the concrete inquiry actually recorded for this work.
L99 reasons : List ReasonObjectStores the concrete reasons used in this work record.
L100 limits : List NatStores the input limits retained in this work record.
L101 outcome : WorkOutcomeStores the recorded assessment verdict or generated method draft.
L102 deriving DecidableEq, ReprGenerates decidable equality and display instances for the preceding datatype.
L104def RegistryCoherent (rules : List Principle) : Prop :=Requires equal registered keys to identify the same principle, preventing ambiguous duplicate identities.
L105 ∀ p ∈ rules, ∀ q ∈ rules, p.key = q.key → p = qTwo registered principles sharing one key must be the same principle, preventing ambiguous lookup.
L107def TargetResolved (rules : List Principle) : Subject → PropRequires each assessed target to resolve to a registered owner or exact principle key.
L108 | .system owner => ∃ p ∈ rules, p.key.owner = ownerA system subject is resolved when the registry contains some principle with that owner.
L109 | .principle owner id | .process owner id _ => ∃ p ∈ rules, p.key = ⟨owner,id⟩Principle and process subjects require a registry entry with their exact owner and local identifier.
L111/- The inquiry names the registered target's declared method contract, not an unrelated candidate.Documents the following definition or result: Connects the inquiry's current method to the registered target principle's declared method.
L112For a system inquiry this finite model uses the registered generation contract as its assessed artifact. -/Documents the following definition or result: Connects the inquiry's current method to the registered target principle's declared method.
L113def TargetContentResolved (rules : List Principle) (question : Inquiry) : Prop :=Connects the inquiry's current method to the registered target principle's declared method.
L114 match question.target withChooses the lookup rule from the inquiry's actual target kind.
L115 | .system owner => ∃ p ∈ rules, p.key = ⟨owner,0⟩ ∧ question.currentMethod = p.declaredMethodA system inquiry examines the declared method of its owner's registered principle zero.
L116 | .principle owner id | .process owner id _ =>For a principle or its process, retain that target's actual owner and identifier for lookup.
L117 ∃ p ∈ rules, p.key = ⟨owner,id⟩ ∧ question.currentMethod = p.declaredMethodRequires both exact key lookup and equality between the inquiry's method and that registered principle's method.
L119def Performed (records : List WorkRecord) (s : Subject) (a : Activity) : Prop :=Requires an actual stored record with the requested target and activity; validity is checked separately.
L120 ∃ record ∈ records, record.target = s ∧ record.activity = aPerformed means a listed record has this exact subject and activity; by itself it checks no reason contents.
L122/- The old scope condition remains available without conflating scope with content completion. -/Documents the following definition or result: Retains the owner-and-applicability-conditioned record-coverage interface.
L123def ReflexiveScope (owner : Nat) (rules : List Principle) (records : List WorkRecord) : Prop :=Retains the owner-and-applicability-conditioned record-coverage interface.
L124 ∀ rule ∈ rules, ∀ s, s.owner = owner → rule.applicable s → Performed records s rule.activityEvery applicable registered rule must have a performed activity on subjects belonging to the specified owner.
L126/- A record uses a registered principle on the same resolvable target, question, reasons and limits,Documents the following definition or result: Checks rule registration, applicability, object identities, resolved method content, nonempty targeted reasons, exact limits and agreement with the rule's semantics.
L127and its result must actually follow that principle's method. A negative result can satisfy this relation. -/Documents the following definition or result: Checks rule registration, applicability, object identities, resolved method content, nonempty targeted reasons, exact limits and agreement with the rule's semantics.
L128structure ValidApplication (rules : List Principle) (rule : Principle) (s : Subject)Checks rule registration, applicability, object identities, resolved method content, nonempty targeted reasons, exact limits and agreement with the rule's semantics.
L129 (record : WorkRecord) : Prop whereThe following proof fields certify one particular work record as a valid use of rule on s.
L130 registered : rule ∈ rulesRequires the rule used by the record to belong to this registry.
L131 applicable : rule.applicable sRequires that same rule to be applicable to the assessed subject.
L132 usedIdentity : record.usedPrinciple = rule.keyChecks the record's used-principle key against this rule's exact key.
L133 targetIdentity : record.target = sChecks that the work record targets this exact subject s.
L134 targetResolved : TargetResolved rules sRequires the record's subject to resolve within the same rule registry.
L135 activityIdentity : record.activity = rule.activityChecks that the recorded activity is the activity governed by this rule.
L136 inquiryIdentity : record.inquiry = rule.inquiry sChecks that the recorded inquiry equals the inquiry this rule assigns to s.
L137 inquiryTarget : record.inquiry.target = sSeparately checks that the inquiry itself targets s, rather than an unrelated subject.
L138 targetContent : TargetContentResolved rules record.inquiryChecks that the inquiry's method belongs to its resolved registered target.
L139 reasonsIdentity : record.reasons = rule.reasons sChecks the recorded reasons equal those specified by this rule for s.
L140 reasonsNonempty : record.reasons ≠ []Requires at least one actual reason in this record.
L141 reasonTargets : ∀ reason ∈ record.reasons, reason.target = sRequires every recorded reason to concern the same subject s.
L142 limitsIdentity : record.limits = rule.limits sChecks that recorded limits equal the rule's limits for s.
L143 followsMeaning : rule.meaning record.inquiry record.reasons record.limits record.outcomeRequires the record's outcome to satisfy the rule's actual meaning relation on its inquiry, reasons and limits.
L145/- The registered normative interface requires contentful application, not just activity labels. -/Documents the following definition or result: Requires a coherent registry and a valid recorded application for every applicable same-owner subject and registered rule; this remains a model compliance condition.
L146/-- organon-map CoreReader.Agency.ReflexiveOpens provenance metadata binding CoreReader.Agency.Reflexive to the following source references; this metadata is not a proof premise.
L147organon.charter.reflexivity#p1 sha256 13293b45c2fa89068c68ae7ef3c5df38f0efadb3ef3873d78a5ba67d9691a757Records source reference organon.charter.reflexivity#p1 with content digest 13293b45c2fa89068c68ae7ef3c5df38f0efadb3ef3873d78a5ba67d9691a757; matching a digest establishes source identity, not semantic fidelity.
L148organon.charter.reflexivity.meaning#p1 sha256 8a2caede01a43d8b6c60b54c78ac089c51868e9956f316948077ccee2e45c9ccRecords source reference organon.charter.reflexivity.meaning#p1 with content digest 8a2caede01a43d8b6c60b54c78ac089c51868e9956f316948077ccee2e45c9cc; matching a digest establishes source identity, not semantic fidelity.
L149organon.charter.reflexivity.limits#p1 sha256 ac0baae0d86e69f84c1ca4dee837de2759e2d29c295ffc257d988962158d4bbcRecords source reference organon.charter.reflexivity.limits#p1 with content digest ac0baae0d86e69f84c1ca4dee837de2759e2d29c295ffc257d988962158d4bbc; matching a digest establishes source identity, not semantic fidelity.
L150-/Closes the preceding documentation/provenance comment; it adds no executable code.
L151def Reflexive (owner : Nat) (rules : List Principle) (records : List WorkRecord) : Prop :=Requires a coherent registry and a valid recorded application for every applicable same-owner subject and registered rule; this remains a model compliance condition.
L152 RegistryCoherent rules ∧Reflexive first requires unambiguous principle registration.
L153 ∀ rule ∈ rules, ∀ s, s.owner = owner → rule.applicable s →It then ranges over each registered rule and owned subject where that rule is applicable.
L154 ∃ record ∈ records, ValidApplication rules rule s recordFor each such application, some listed record must satisfy all ValidApplication content checks.
L156theorem Reflexive.toScope {owner : Nat} {rules : List Principle} {records : List WorkRecord}Forgets content-validity details while extracting target/activity record coverage from full reflexivity.
L157 (h : Reflexive owner rules records) : ReflexiveScope owner rules records := byAssumes full contentful Reflexive compliance and derives its weaker scope-only coverage.
L158 intro rule hr s hs haTakes a registered rule, an owned subject and its applicability premise for the scope obligation.
L159 obtain ⟨record, hm, hv⟩ := h.2 rule hr s hs haUses full Reflexive compliance to obtain the actual listed record and its ValidApplication proof.
L160 exact ⟨record, hm, hv.targetIdentity, hv.activityIdentity⟩Keeps that record's membership, target identity and activity identity to prove Performed.
L162/-- organon-map CoreReader.Agency.noSelfExemptionOpens provenance metadata binding CoreReader.Agency.noSelfExemption to the following source references; this metadata is not a proof premise.
L163organon.charter.reflexivity.limits#p1 sha256 ac0baae0d86e69f84c1ca4dee837de2759e2d29c295ffc257d988962158d4bbcRecords source reference organon.charter.reflexivity.limits#p1 with content digest ac0baae0d86e69f84c1ca4dee837de2759e2d29c295ffc257d988962158d4bbc; matching a digest establishes source identity, not semantic fidelity.
L164-/Closes the preceding documentation/provenance comment; it adds no executable code.
L165theorem noSelfExemption (owner : Nat) (rules : List Principle) (records : List WorkRecord)Instantiates full reflexivity at a registered applicable same-owner subject, then extracts its performance record.
L166 (h : Reflexive owner rules records) (rule : Principle) (hr : rule ∈ rules)Requires full Reflexive compliance and actual membership of the rule in the registry.
L167 (s : Subject) (hs : s.owner = owner) (ha : rule.applicable s) :Also requires the target's owner to match and the rule to be applicable to it.
L168 Performed records s rule.activity := h.toScope rule hr s hs haSpecializes the derived scope obligation to those premises, yielding this target's performed activity.
L170def localMethod : MethodDraft := ⟨[0],[0]⟩Tests input zero and declares scope zero.
L172def inquiryFor (s : Subject) : Inquiry :=Maps formation to basis, application to applicability, revision to grounds over zero and one, and other objects to conformity.
L173 match s withChooses the inquiry from the subject's process phase, retaining the same subject as target.
L174 | .process _ _ .formation => ⟨s, .formationBasis, [0], localMethod⟩For formation, asks about the basis for a method covering input zero.
L175 | .process _ _ .application => ⟨s, .applicability, [0], localMethod⟩For application, asks whether the local method applies on input zero.
L176 | .process _ _ .revision => ⟨s, .revisionGrounds, [0,1], localMethod⟩For revision, asks about extending the same local method's scope to inputs zero and one.
L177 | _ => ⟨s, .conformity, [0], localMethod⟩For a system or principle itself, asks conformity on the local scope {0}.
L179/- These original inquiry inputs do not depend on which work records happen to be present. -/Documents the following definition or result: Supplies question-specific purpose/scope/observation data, adding a failing untested-input program for revision review.
L180def sourceReasonContents : QuestionKind → List ReasonContentSupplies question-specific purpose/scope/observation data, adding a failing untested-input program for revision review.
L181 | .formationBasis => [.purpose [0], .declaredScope [0], .observation 0 true]Formation reasons state the purpose {0}, declared scope {0}, and the observed true result at zero.
L182 | .applicability | .conformity => [.declaredScope [0], .observation 0 true]Applicability and conformity use the declared local scope plus the same observation at zero.
L183 | .revisionGrounds => [.purpose [0,1], .declaredScope [0], .observation 0 true,Revision reasons request {0,1} while acknowledging a declared scope of {0} and only a zero observation.
L184 .counterexample .onlyAtZero 1]Adds the concrete onlyAtZero program at input one as a revision counterexample.
L186def reasonsFor (s : Subject) : List ReasonObject :=Attaches every chosen reason's content to this exact inquiry target.
L187 (sourceReasonContents (inquiryFor s).kind).map fun content => ⟨content.identifier,s,content⟩Wraps each source reason with its category reference and the same subject s, preserving its actual content.
L189/- The application-specific evaluator examines actual scope and sample/counterexample contents.Documents the following definition or result: Computes scoped results from actual reason contents and method scope; a program passing current tests but failing a requested input yields insufficiency for revision.
L190It is a finite inferential method, not a universal standard for empirical or value claims. -/Documents the following definition or result: Computes scoped results from actual reason contents and method scope; a program passing current tests but failing a requested input yields insufficiency for revision.
L191def assessInquiry (question : Inquiry) (reasons : List ReasonObject) (limits : List Nat) : AssessmentResult :=Computes scoped results from actual reason contents and method scope; a program passing current tests but failing a requested input yields insufficiency for revision.
L192 let contents := reasons.map ReasonObject.contentExtracts reason contents for checking their substantive purpose, scope, observations and counterexamples.
L193 if limits ≠ question.currentMethod.claimedScope then .undetermined elseReturns undetermined if supplied limits differ from the examined method's declared scope.
L194 match question.kind withAfter checking limits, evaluates the specific kind of question asked.
L195 | .formationBasis =>Selects the formation-basis assessment branch.
L196 if ReasonContent.purpose question.requestedScope ∈ contents ∧Requires a purpose reason covering the inquiry's requested inputs.
L197 ReasonContent.declaredScope limits ∈ contents ∧ question.requestedScope = limitsAlso requires an explicit limit declaration and equality of requested and declared scopes.
L198 then .supportedWithinScope else .undeterminedFormation is supportedWithinScope only when those content checks pass; otherwise it is undetermined.
L199 | .applicability | .conformity =>Uses the same local checks for applicability and conformity questions.
L200 if question.requestedScope.all (fun n => limits.contains n) thenFirst tests that every requested input belongs to the supplied limits.
L201 if ReasonContent.declaredScope limits ∈ contents ∧Within those limits, requires a reason explicitly declaring that same scope.
L202 ReasonContent.observation 0 true ∈ contents ∧ question.requestedScope = [0]Also requires the true observation at zero and a requested scope exactly equal to [0].
L203 then .supportedWithinScope else .undeterminedPassing these local checks yields supportedWithinScope; incomplete evidence yields undetermined.
L204 else .notApplicableA requested input outside the supplied limits yields notApplicable.
L205 | .revisionGrounds =>Selects the revision-grounds branch, which searches for an actual scope counterexample.
L206 if ReasonContent.purpose question.requestedScope ∈ contents ∧Requires a reason stating the revised requested scope as the intended purpose.
L207 ReasonContent.declaredScope limits ∈ contents ∧Requires the old limits to be explicitly present as a declared-scope reason.
L208 ReasonContent.observation 0 true ∈ contents ∧Requires the original successful observation at input zero.
L209 contents.any (fun reason => match reason withSearches the supplied reason contents for a counterexample satisfying the following concrete checks.
L210 | .counterexample program input => question.requestedScope.contains input &&A counterexample's input must be inside the newly requested scope.
L211 question.currentMethod.accepts program &&Its program must nevertheless pass the current method's tested inputs.
L212 !(program.run input)That same program must fail at the counterexample input.
L213 | _ => false)Other reason kinds cannot themselves satisfy this counterexample search.
L214 then .insufficient else .undeterminedA witnessed testing/scope gap yields insufficient; without those contents, the result is undetermined.
L216def finiteMethodResult (activity : Activity) (question : Inquiry)Generation keeps tested inputs and adopts requested scope; assessment executes the reason-sensitive inquiry evaluator.
L217 (reasons : List ReasonObject) (limits : List Nat) : WorkOutcome :=Supplies the same reasons and limits to the activity-specific result function.
L218 match activity withChooses between generating a draft and evaluating an inquiry.
L219 | .generation => .generated ⟨question.currentMethod.testedInputs,question.requestedScope⟩Generation keeps the method's tested inputs but proposes the inquiry's requested scope; correctness is not certified.
L220 | .assessment => .assessment (assessInquiry question reasons limits)Assessment computes assessInquiry from this question's actual reasons and limits.
L222def finiteMethodMeaning (activity : Activity) (question : Inquiry)Defines acceptable outcome by equality with the disclosed finite evaluation algorithm, not an assumed successful result.
L223 (reasons : List ReasonObject) (limits : List Nat) (outcome : WorkOutcome) : Prop :=Receives the specific recorded outcome whose compliance with this activity's method is checked.
L224 outcome = finiteMethodResult activity question reasons limitsAn outcome follows the method exactly when it equals the computed finiteMethodResult.
L226def ownSubjects (owner : Nat) : List Subject :=Enumerates the owner system, both registered principles and all three phases of each principle.
L227 [.system owner, .principle owner 0, .principle owner 1,Includes the system itself and its two principle identities as owned subjects.
L228 .process owner 0 .formation, .process owner 0 .application, .process owner 0 .revision,Includes formation, application and revision of principle zero as separate subjects.
L229 .process owner 1 .formation, .process owner 1 .application, .process owner 1 .revision]Also includes all three phases of principle one, giving nine owned subjects total.
L231/- Applying an existing rule is not a generation event in this application. -/Documents the following definition or result: Excludes application-phase processes from this particular generation rule while retaining the other objects.
L232def generationEligible : Subject → BoolExcludes application-phase processes from this particular generation rule while retaining the other objects.
L233 | .process _ _ .application => falseTreats applying an already existing principle as ineligible for generation in this application model.
L234 | _ => trueAll other represented subject kinds remain eligible for generation.
L236def generatingRule (owner : Nat) : Principle whereRegisters principle zero for generation with the local method, explicit inquiries/reasons and restricted applicability.
L237 key := ⟨owner,0⟩Registers the generation principle under local key zero for this owner.
L238 activity := .generationMakes this rule govern generation work.
L239 declaredMethod := localMethodAssigns the local test-and-scope draft [0]/[0] to the generation rule.
L240 applicable s := s ∈ ownSubjects owner ∧ generationEligible s = trueGeneration requires both membership in this owner's nine subjects and generation eligibility.
L241 inquiry := inquiryForUses inquiryFor to supply the subject's actual phase-sensitive question.
L242 reasons := reasonsForUses reasonsFor to supply the original target-linked reason contents.
L243 limits _ := [0]Retains [0] as the generation rule's limit for every subject.
L244 meaning := finiteMethodMeaning .generationRequires the generated outcome to match finiteMethodResult's generation branch.
L246def assessingRule (owner : Nat) : Principle whereRegisters principle one for assessment of every enumerated own subject with explicit finite evaluation semantics.
L247 key := ⟨owner,1⟩Registers the assessment principle under distinct local key one.
L248 activity := .assessmentMakes this rule govern assessment work.
L249 declaredMethod := localMethodThe assessment principle declares the same local [0]/[0] method contract.
L250 applicable s := s ∈ ownSubjects ownerAssessment applies to all nine subjects belonging to this owner.
L251 inquiry := inquiryForAssigns the same phase-sensitive inquiry function to the assessment rule.
L252 reasons := reasonsForAssigns the same original target-linked reasons to its assessments.
L253 limits _ := [0]Retains [0] as the assessment rule's declared limit.
L254 meaning := finiteMethodMeaning .assessmentRequires assessment outcomes to equal the evaluator's actual result.
L256def ownRules (owner : Nat) : List Principle := [generatingRule owner, assessingRule owner]Returns the two distinct registered generation and assessment principles.
L258/- Recorded verdicts are stated separately from the evaluator, so agreement has to be proved. -/Documents the following definition or result: Constructs expected generated drafts and scoped/insufficient assessment results, which are subsequently checked against evaluation.
L259def statedOutcome (activity : Activity) (s : Subject) : WorkOutcome :=Constructs expected generated drafts and scoped/insufficient assessment results, which are subsequently checked against evaluation.
L260 match activity withChooses the independently stated record outcome by activity.
L261 | .generation => .generated ⟨(inquiryFor s).currentMethod.testedInputs,(inquiryFor s).requestedScope⟩The recorded generated draft retains tested inputs and adopts the inquiry's requested scope.
L262 | .assessment => .assessment (match (inquiryFor s).kind withFor assessment records, chooses a stated verdict from the inquiry kind rather than calling assessInquiry here.
L263 | .revisionGrounds => .insufficientRevision inquiries are recorded as insufficient.
L264 | _ => .supportedWithinScope)The remaining represented inquiries are recorded as supportedWithinScope.
L266def recordFor (rule : Principle) (s : Subject) : WorkRecord :=Builds a record from the supplied rule and subject; registry membership and content validity require the later ValidApplication proof.
L267 ⟨rule.key,s,rule.activity,rule.inquiry s,rule.reasons s,rule.limits s,statedOutcome rule.activity s⟩Builds a record from this rule's identity, inquiry, reasons and limits, but uses the separately stated outcome.
L269theorem reasonsFor_nonempty (s : Subject) : reasonsFor s ≠ [] := byExhausts subject/phase constructors to prove each concrete inquiry has reasons.
L270 cases s withChecks reason-list nonemptiness for each kind of subject.
L271 | system owner => simp [reasonsFor, inquiryFor, sourceReasonContents]System inquiries use the conformity reasons, which contain scope and observation entries.
L272 | principle owner id => simp [reasonsFor, inquiryFor, sourceReasonContents]Principle inquiries likewise have the nonempty scope-and-observation list.
L273 | process owner id phase => cases phase <;> simp [reasonsFor, inquiryFor, sourceReasonContents]Each process phase reduces to its actual nonempty formation, application or revision reason list.
L275theorem reasonsFor_target (s : Subject) : ∀ reason ∈ reasonsFor s, reason.target = s := byUses the reason-list map construction to prove every reason targets the same subject.
L276 intro reason hTakes any reason known to occur in this subject's constructed reason list.
L277 obtain ⟨content, _, rfl⟩ := List.mem_map.mp hInverts the map construction to recover the source content and replace the reason with its target-tagged wrapper.
L278 rflThat wrapper's target is s by construction, so target equality is reflexive.
L280theorem inquiryFor_target (s : Subject) : (inquiryFor s).target = s := byChecks each constructor to prove the generated inquiry retains its subject identity.
L281 cases s withChecks the inquiry target for system, principle and process subjects separately.
L282 | system owner => rflThe system inquiry was constructed with that same system as target.
L283 | principle owner id => rflThe principle inquiry likewise retains that same principle target.
L284 | process owner id phase => cases phase <;> rflEvery process phase uses the original process subject as its inquiry target.
L286/- This proof includes the actual negative revision evaluation for both principle identities. -/Documents the following definition or result: Computes every subject/phase assessment and generation case, showing stored expected outcomes agree with the actual algorithm, including insufficiency.
L287theorem ownContentEvaluates (activity : Activity) (s : Subject) :Computes every subject/phase assessment and generation case, showing stored expected outcomes agree with the actual algorithm, including insufficiency.
L288 statedOutcome activity s = finiteMethodResult activity (inquiryFor s) (reasonsFor s) [0] := byRequires the independently stated outcome to equal actual evaluation of this subject's question, reasons and [0] limits.
L289 cases activity withSplits this equality check between generated drafts and assessment verdicts.
L290 | generation => rflBoth generation definitions construct the identical tested-input/requested-scope draft.
L291 | assessment =>For assessment, the stated verdict must now be checked against the actual evaluator.
L292 cases s withSeparates the finite assessment check by subject kind.
L293 | system owner => rflThe system's conformity contents compute to the stated supportedWithinScope verdict.
L294 | principle owner id => rflThe principle's conformity contents compute to that same supportedWithinScope verdict.
L295 | process owner id phase => cases phase <;> rflFormation/application compute support; revision computes insufficient from the program passing zero but failing one.
L297theorem ownRegistryCoherent (owner : Nat) : RegistryCoherent (ownRules owner) := bySeparates local identifiers zero and one to prove the two-rule registry has no ambiguous key.
L298 intro p hp q hq hkeyTakes two registered principles whose keys are assumed equal.
L299 simp only [ownRules, List.mem_cons, List.not_mem_nil, or_false] at hp hqRestricts both registry memberships to the actual generation or assessment rule.
L300 rcases hp with rfl | rfl <;> rcases hq with rfl | rflExamines the four resulting pairs of concrete rules.
L301 · rflWhen both are the generation rule, principle equality holds directly.
L302 · have bad := congrArg PrincipleKey.localId hkey; contradictionGeneration key 0 cannot equal assessment key 1; projecting localId produces a contradiction.
L303 · have bad := congrArg PrincipleKey.localId hkey; contradictionThe reverse mixed pair would require localId 1=0, also impossible.
L304 · rflWhen both are the assessment rule, principle equality holds directly.
L306theorem ownTargetResolved (owner : Nat) (s : Subject) (hs : s ∈ ownSubjects owner) :Checks all nine enumerated subjects resolve to an actual registered owner/principle.
L307 TargetResolved (ownRules owner) s := byThe subject selected from ownSubjects must resolve to this owner's actual registry.
L308 simp only [ownSubjects, List.mem_cons, List.not_mem_nil, or_false] at hsExpands membership hs into the nine concrete owned subjects.
L309 rcases hs with rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl <;>Handles each of those nine subjects with its original owner and principle identifier fixed.
L310 simp [TargetResolved, ownRules, generatingRule, assessingRule]Finds the generation or assessment registry entry matching each target key.
L312theorem ownTargetContent (owner : Nat) (s : Subject) (hs : s ∈ ownSubjects owner) :Checks each inquiry's method matches its registered target's declared local method.
L313 TargetContentResolved (ownRules owner) (inquiryFor s) := byRequires the selected subject's inquiry to examine its own registered declared method.
L314 simp only [ownSubjects, List.mem_cons, List.not_mem_nil, or_false] at hsAgain enumerates the nine concrete subjects from the actual membership premise.
L315 rcases hs with rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl | rfl <;>Checks target-method correspondence separately for each system, principle and phase subject.
L316 simp [TargetContentResolved, inquiryFor, ownRules, generatingRule, assessingRule]Both registered rules declare localMethod, exactly the method inquiryFor assigns to every enumerated target.
L318theorem ownRecordValid (owner : Nat) (rule : Principle) (hr : rule ∈ ownRules owner)Combines identity, reason-target, scope, registry and actual evaluation facts to validate each applicable generated record.
L319 (s : Subject) (ha : rule.applicable s) :Assumes the chosen registered rule is applicable to this subject s.
L320 ValidApplication (ownRules owner) rule s (recordFor rule s) := byProves the concrete recordFor rule s satisfies every ValidApplication field.
L321 have hs : s ∈ ownSubjects owner := byFirst derives that applicability places s in this owner's subject list.
L322 simp only [ownRules, List.mem_cons, List.not_mem_nil, or_false] at hrUses registry membership to restrict rule to one of the two owned rules.
L323 rcases hr with rfl | rflSeparates the generation and assessment applicability conditions.
L324 · exact ha.1Generation applicability includes owned-subject membership as its first conjunct.
L325 · exact haAssessment applicability is exactly that owned-subject membership.
L326 have hq : rule.inquiry = inquiryFor := byEstablishes that this actual rule uses inquiryFor as its inquiry function.
L327 simp only [ownRules, List.mem_cons, List.not_mem_nil, or_false] at hrReduces registered-rule membership to generation or assessment to inspect its inquiry field.
L328 rcases hr with rfl | rfl <;> rflBoth possible rules define their inquiry field as inquiryFor.
L329 have hg : rule.reasons = reasonsFor := byEstablishes that the chosen rule uses reasonsFor as its reason provider.
L330 simp only [ownRules, List.mem_cons, List.not_mem_nil, or_false] at hrAgain restricts the rule to the two actual registry entries before inspecting reasons.
L331 rcases hr with rfl | rfl <;> rflBoth entries supply exactly reasonsFor.
L332 have hl : rule.limits s = [0] := byEstablishes that this rule's limits for s are exactly [0].
L333 simp only [ownRules, List.mem_cons, List.not_mem_nil, or_false] at hrResolves registry membership before inspecting the selected rule's limits.
L334 rcases hr with rfl | rfl <;> rflBoth owned rules retain [0] as their limit.
L335 have hm : rule.meaning = finiteMethodMeaning rule.activity := byEstablishes that the chosen rule's meaning is the result function for its own activity.
L336 simp only [ownRules, List.mem_cons, List.not_mem_nil, or_false] at hrResolves registry membership to inspect generation versus assessment meaning.
L337 rcases hr with rfl | rfl <;> rflIn either case, the rule's meaning is finiteMethodMeaning specialized to that rule's activity.
L338 refine ⟨hr, ha, rfl, rfl, ownTargetResolved owner s hs, rfl, rfl, ?_, ?_, rfl, ?_, ?_, rfl, ?_⟩Builds ValidApplication using registry/applicability premises, record identities and resolved target; leaves inquiry, reasons and computed meaning checks to follow.
L339 · change (rule.inquiry s).target = sThe remaining inquiry-target goal is about this rule's actual inquiry on s.
L340 rw [hq]; exact inquiryFor_target sReplaces the rule's inquiry with inquiryFor, whose target-preservation theorem proves it targets s.
L341 · change TargetContentResolved (ownRules owner) (rule.inquiry s)The remaining method-identity goal checks the registered target of this rule's inquiry.
L342 rw [hq]; exact ownTargetContent owner s hsRewrites to inquiryFor and uses the concrete owned-target method-resolution theorem.
L343 · change rule.reasons s ≠ []Reduces record reason nonemptiness to nonemptiness of this rule's supplied reasons.
L344 rw [hg]; exact reasonsFor_nonempty sRewrites those reasons to reasonsFor and applies its nonempty-list theorem.
L345 · change ∀ reason ∈ rule.reasons s, reason.target = sReduces reason-target consistency to every supplied reason targeting s.
L346 rw [hg]; exact reasonsFor_target sRewrites to reasonsFor and uses its target-preserving construction theorem.
L347 · change rule.meaning (rule.inquiry s) (rule.reasons s) (rule.limits s) (statedOutcome rule.activity s)The final obligation compares the separately stated outcome against this rule's actual inquiry, reasons, limits and meaning.
L348 rw [hm, hq, hg, hl]Substitutes the four established identities for meaning, inquiry, reasons and [0] limits.
L349 exact ownContentEvaluates rule.activity sUses ownContentEvaluates to prove the recorded outcome equals the actual method result.
L351def completeOwnWork (owner : Nat) : List WorkRecord :=Constructs records for all nine subjects, including generation only where its eligibility condition holds.
L352 (ownSubjects owner).flatMap fun s =>Builds the full log by concatenating the records assigned to each owned subject.
L353 if generationEligible s then [recordFor (generatingRule owner) s, recordFor (assessingRule owner) s]Eligible subjects receive both a generation record and an assessment record.
L354 else [recordFor (assessingRule owner) s]Application-phase subjects receive assessment only, matching generation's explicit applicability restriction.
L356theorem assessingRecord_member (owner : Nat) (s : Subject) (hs : s ∈ ownSubjects owner) :Places each subject's assessment record in the flat-mapped complete work list.
L357 recordFor (assessingRule owner) s ∈ completeOwnWork owner := byClaims this owned subject's assessment record occurs in the constructed full log.
L358 apply List.mem_flatMap.mprUses flatMap membership: choose a subject whose assigned record list contains the desired record.
L359 refine ⟨s,hs,?_⟩Chooses the same s and its supplied owned-subject membership hs.
L360 cases generationEligible s <;> simpWhether generation is eligible or not, the assigned list contains s's assessment record.
L362theorem generatingRecord_member (owner : Nat) (s : Subject) (hs : s ∈ ownSubjects owner)Places a subject's generation record in the work list under explicit generation eligibility.
L363 (hg : generationEligible s = true) : recordFor (generatingRule owner) s ∈ completeOwnWork owner := byAdds generation eligibility to owned membership before claiming a generation record in the full log.
L364 exact List.mem_flatMap.mpr ⟨s,hs,by simp [hg]⟩Selects s's flatMap branch; hg makes that branch include the requested generation record.
L366theorem completeOwnWork_reflexive (owner : Nat) :Combines coherent registry, membership and content-valid applications to establish the concrete nonempty reflexivity model.
L367 Reflexive owner (ownRules owner) (completeOwnWork owner) := byStates full contentful reflexivity for the actual two-rule registry and constructed work log.
L368 refine ⟨ownRegistryCoherent owner, ?_⟩Provides the proved registry coherence and leaves contentful coverage for each applicable subject.
L369 intro rule hr s _ haTakes an actual registered rule and applicable subject; applicability itself will supply needed owned membership.
L370 refine ⟨recordFor rule s, ?_, ownRecordValid owner rule hr s ha⟩Chooses recordFor rule s and its already proved content validity, leaving only its presence in the full log.
L371 simp only [ownRules, List.mem_cons, List.not_mem_nil, or_false] at hrResolves rule membership to the generation or assessment entry.
L372 rcases hr with rfl | rflSplits record membership by those two actual rule cases.
L373 · exact generatingRecord_member owner s ha.1 ha.2For generation, ha supplies owned membership and eligibility, which place its record in the full log.
L374 · exact assessingRecord_member owner s haFor assessment, ha directly supplies the owned membership needed for its record.
L376theorem ownAssessmentPerformed (owner : Nat) (s : Subject) (hs : s ∈ ownSubjects owner) :Extracts the constructed assessment record for a listed own subject.
L377 Performed (completeOwnWork owner) s .assessment :=Claims a performed assessment on s in the same complete work log.
L378 ⟨recordFor (assessingRule owner) s, assessingRecord_member owner s hs, rfl, rfl⟩Uses s's assessment record, its proved log membership and exact target/activity identities as the Performed witness.
L380def applicationRule : Principle :=Restricts an assessment rule to one application-phase subject and assigns it a resolvable key.
L381 { assessingRule 0 with key := ⟨0,0⟩, applicable := fun s => s = .process 0 0 .application }Restricts the assessment rule to exactly principle-zero's application process, with key (0,0).
L383def applicationWork : List WorkRecord := [recordFor applicationRule (.process 0 0 .application)]Stores the one fully specified application assessment record.
L385theorem applicationWork_reflexive : Reflexive 0 [applicationRule] applicationWork := byChecks the singleton registry and record satisfy full content-valid reflexivity on their restricted applicability.
L386 constructorSeparates singleton-registry coherence from coverage of its sole applicable subject.
L387 · intro p hp q hq _Takes any two rules in that singleton registry; key equality is unnecessary because membership already identifies both.
L388 simp only [List.mem_singleton] at hp hqSingleton membership makes both rules equal to applicationRule.
L389 rw [hp,hq]Substituting these identities proves the two rules are equal.
L390 · intro rule hr s _ haTakes an applicable subject for a rule in the singleton application registry.
L391 simp only [List.mem_singleton] at hrUses singleton membership to identify the rule as applicationRule.
L392 subst ruleReplaces rule with that exact applicationRule throughout the coverage obligation.
L393 change s = .process 0 0 .application at haUnfolds applicability to show s is exactly owner-zero principle-zero's application process.
L394 subst sSubstitutes that exact process for s, fixing the work target.
L395 refine ⟨recordFor applicationRule (.process 0 0 .application), by simp [applicationWork], ?_⟩Selects the sole record in applicationWork and proves its membership; content validity remains to check.
L396 refine ⟨by simp, rfl, rfl, rfl, ?_, rfl, rfl, rfl, ?_, rfl, ?_, ?_, rfl, ?_⟩Fills immediate registry, applicability and record-identity fields; leaves target resolution, reasons and computed outcome checks.
L397 · exact ⟨applicationRule, by simp, rfl⟩The target key resolves to applicationRule itself in the singleton registry.
L398 · exact ⟨applicationRule, by simp, rfl, rfl⟩That same registered rule supplies the localMethod actually examined by the inquiry.
L399 · exact reasonsFor_nonempty _The application inquiry's reasons are nonempty by reasonsFor_nonempty.
L400 · exact reasonsFor_target _Every application reason targets this exact application-process subject.
L401 · change statedOutcome .assessment (.process 0 0 .application) = finiteMethodResult .assessment (inquiryFor (.process 0 0 .application)) (reasonsFor (.process 0 0 .application)) [0]The remaining meaning obligation is equality of the stated application assessment and its actual finite evaluation.
L402 exact ownContentEvaluates .assessment _Uses ownContentEvaluates to certify that equality for the application-phase assessment.
L404/-- organon-map CoreReader.Agency.applicabilityRetainedOpens provenance metadata binding CoreReader.Agency.applicabilityRetained to the following source references; this metadata is not a proof premise.
L405organon.charter.reflexivity.limits#p1 sha256 ac0baae0d86e69f84c1ca4dee837de2759e2d29c295ffc257d988962158d4bbcRecords source reference organon.charter.reflexivity.limits#p1 with content digest ac0baae0d86e69f84c1ca4dee837de2759e2d29c295ffc257d988962158d4bbc; matching a digest establishes source identity, not semantic fidelity.
L406-/Closes the preceding documentation/provenance comment; it adds no executable code.
L407theorem applicabilityRetained (owner : Nat) (rules : List Principle) (records : List WorkRecord) :Derives record scope from full reflexivity, proves its classical conditional/disjunctive equivalence, and gives a valid restricted example with no system assessment.
L408 (Reflexive owner rules records → ReflexiveScope owner rules records) ∧The first clause retains the implication from full contentful reflexivity to scope coverage.
L409 (ReflexiveScope owner rules records ↔The second clause restates conditional scope coverage as an either/or obligation.
L410 ∀ rule ∈ rules, ∀ s, s.owner = owner → (¬ rule.applicable s ∨ Performed records s rule.activity)) ∧For each owned subject and registered rule, either the rule is inapplicable or its activity was performed.
L411 (Reflexive 0 [applicationRule] applicationWork ∧The concrete singleton application log satisfies full reflexivity under its restricted rule.
L412 ¬ Performed applicationWork (.system 0) .assessment) := byYet that same log contains no assessment of the system itself, where this rule is not applicable.
L413 classicalUses classical case splitting on possibly undecidable applicability predicates.
L414 refine ⟨Reflexive.toScope, ?_, applicationWork_reflexive, ?_⟩Supplies the general scope projection and concrete restricted witness; leaves the equivalence and missing-system-record proof.
L415 · constructorProves both directions of the applicability-or-performance reformulation.
L416 · intro h rule hr s hsAssumes conditional scope coverage and fixes a registered rule with an owned subject.
L417 by_cases ha : rule.applicable sSplits on whether that exact rule is applicable to this subject.
L418 · exact Or.inr (h rule hr s hs ha)When applicable, coverage supplies the performed activity, satisfying the right disjunct.
L419 · exact Or.inl haWhen inapplicable, that negative applicability fact satisfies the left disjunct.
L420 · intro h rule hr s hs haFor the reverse direction, assumes the disjunction and actual applicability on the owned subject.
L421 exact (h rule hr s hs).resolve_left (not_not_intro ha)Rules out the inapplicable disjunct using ha, leaving the required performed activity.
L422 · rintro ⟨record, hm, ht, _⟩Assumes a system assessment exists and extracts its listed record plus target identity.
L423 simp only [applicationWork, List.mem_singleton] at hmThe singleton applicationWork list forces that record to be its application-process record.
L424 subst recordReplaces the alleged system-assessment record with that sole process record.
L425 cases htIts process target cannot equal the system target, contradicting the assumed record identity.
L427end CoreReader.AgencyCloses the current namespace.