@@ -156,6 +156,10 @@ open import characteristic.ModeGraded using
156156 ( MGEcho to ModeGEcho
157157 ; applyGrade to applyGradeM
158158 )
159+ open import characteristic.RoleModeGrade using
160+ ( applyAll
161+ ; trace-non-trivial-cell
162+ )
159163
160164------------------------------------------------------------------------
161165-- Definitions of "non-trivial" for the formal theorem
@@ -299,6 +303,45 @@ ModeGrade-no-non-identity-cell :
299303 NonIdentity modegrade-cell-action → ⊥
300304ModeGrade-no-non-identity-cell (x , px) = px refl
301305
306+ ------------------------------------------------------------------------
307+ -- n=3 — RoleModeGrade (EI-2 obligation 4, formal enumeration form)
308+ --
309+ -- The 3D construction's pairwise/triple commutations are already
310+ -- discharged in characteristic.RoleModeGrade (all by `refl`). What
311+ -- was only stated there as a prose tracker entry — that the 3D
312+ -- construction has its non-trivial cell *because* it contains the
313+ -- non-loss-only axis Role — is here promoted to the SAME formal
314+ -- shape as the n=2 exhibits above. This is the mechanical extension
315+ -- of the concrete enumeration from n=2 to n=3 (obligation 4); it
316+ -- adds no new mathematical content over RoleModeGrade, only the
317+ -- formal `PreservesDistinct` certificate and an enumeration entry.
318+ --
319+ -- The unique live triple cell is (c⊑s, linear≤linear, keep≤keep);
320+ -- `applyAll` at that cell computes to `client-to-server` (proved in
321+ -- RoleModeGrade as `trace-non-trivial-cell`), so the n=3 cell action
322+ -- preserves distinctness via the same Choreo distinguishing pair.
323+ ------------------------------------------------------------------------
324+
325+ rmg-cell-action : RoleEcho Client true → RoleEcho Server true
326+ rmg-cell-action e = applyAll c⊑s linear≤linear keep≤keep e
327+
328+ rmg-cell-action-equals-c2s :
329+ ∀ (e : RoleEcho Client true) →
330+ rmg-cell-action e ≡ client-to-server e
331+ rmg-cell-action-equals-c2s = trace-non-trivial-cell
332+
333+ RoleModeGrade-has-non-trivial-cell :
334+ PreservesDistinct rmg-cell-action
335+ RoleModeGrade-has-non-trivial-cell =
336+ rg-input₁ , rg-input₂ , rg-inputs-distinct , rmg-images-distinct
337+ where
338+ rmg-images-distinct :
339+ rmg-cell-action rg-input₁ ≢ rmg-cell-action rg-input₂
340+ rmg-images-distinct p =
341+ rg-images-distinct
342+ (trans (sym (rmg-cell-action-equals-c2s rg-input₁))
343+ (trans p (rmg-cell-action-equals-c2s rg-input₂)))
344+
302345------------------------------------------------------------------------
303346-- The recipe-non-triviality theorem (concrete form)
304347--
@@ -327,6 +370,8 @@ data ConstructionWithStatus : Set where
327370 ConstructionWithStatus
328371 mg-trivial : (NonIdentity modegrade-cell-action → ⊥) →
329372 ConstructionWithStatus
373+ rmg-non-trivial : PreservesDistinct rmg-cell-action →
374+ ConstructionWithStatus
330375
331376-- The recipe-non-triviality theorem (concrete enumeration form):
332377-- each of the three 2D constructions has the non-triviality status
@@ -340,6 +385,23 @@ recipe-non-triviality-concrete =
340385 , rm-non-trivial RoleMode-has-non-trivial-cell
341386 , mg-trivial ModeGrade-no-non-identity-cell
342387
388+ -- The recipe-non-triviality theorem extended to n=3: the three n=2
389+ -- constructions plus the 3D RoleModeGrade construction, each with
390+ -- the non-triviality status predicted by the hypothesis (non-trivial
391+ -- iff the tuple contains a non-loss-only axis; RoleModeGrade is
392+ -- non-trivial because it contains Role). This discharges EI-2
393+ -- obligation 4 in the same formal enumeration shape as the n=2 case.
394+ recipe-non-triviality-concrete-n3 :
395+ ConstructionWithStatus
396+ × ConstructionWithStatus
397+ × ConstructionWithStatus
398+ × ConstructionWithStatus
399+ recipe-non-triviality-concrete-n3 =
400+ rg-non-trivial RoleGraded-has-non-trivial-cell
401+ , rm-non-trivial RoleMode-has-non-trivial-cell
402+ , mg-trivial ModeGrade-no-non-identity-cell
403+ , rmg-non-trivial RoleModeGrade-has-non-trivial-cell
404+
343405------------------------------------------------------------------------
344406-- §<<abstract>> — Generic abstract axis machinery (partial)
345407--
@@ -564,6 +626,84 @@ Mode-is-not-proper-non-loss-only
564626 (degradeMode linear≤affine (ProperlyStrict.x ps))
565627 (degradeMode linear≤affine (ProperlyStrict.y ps)))
566628
629+ ------------------------------------------------------------------------
630+ -- Generic forward direction (EI-2 obligation 5, FORWARD half)
631+ --
632+ -- The §<<abstract>> header above speculated that the generic forward
633+ -- direction needs decidable equality on D plus a designated "live"
634+ -- decoration. That over-estimates the requirement: once the
635+ -- criterion is stated in its sharpened (proper-step) form, the
636+ -- forward direction follows directly from `ProperlyStrict`. A
637+ -- properly-non-loss-only axis exhibits a step whose transport is a
638+ -- distinctness-preserving (hence non-identity-acting) map. No
639+ -- decidable equality and no live decoration are needed; this is a
640+ -- sharpening of the file's own meta-claim about the requirement.
641+ --
642+ -- This discharges the FORWARD half of obligation 5 generically. The
643+ -- REVERSE half (no-NLO ⇒ every cell trivial) is unaffected and
644+ -- remains walled off by needing extensionality under --safe (see the
645+ -- §<<abstract>> note and PATH A/B below). The EI-2 verdict is
646+ -- UNCHANGED: this neither reopens nor terminates EI-2 (cf. the
647+ -- TERMINATION NOTICE and docs/EI2_REPORT.adoc); it discharges a
648+ -- residual obligation in its defensible form, exactly as the
649+ -- proper-strict sharpening did for the loss-only obligation.
650+ ------------------------------------------------------------------------
651+
652+ -- Forward, bare form: a properly-non-loss-only axis has a step whose
653+ -- transport preserves distinctness (is non-trivial).
654+ ProperNonLossOnly⇒distinguishing-step :
655+ ∀ (a : Axis) → ProperNonLossOnly a →
656+ Σ (Axis.D a) (λ d1 →
657+ Σ (Axis.D a) (λ d2 →
658+ Σ (Axis._≤_ a d1 d2) (λ le →
659+ PreservesDistinct (Axis.t a le))))
660+ ProperNonLossOnly⇒distinguishing-step a (d1 , d2 , le , ps) =
661+ d1 , d2 , le ,
662+ ( ProperlyStrict.x ps
663+ , ProperlyStrict.y ps
664+ , ProperlyStrict.x≢y ps
665+ , ProperlyStrict.tx≢ty ps )
666+
667+ -- Forward, 2D-cell form: composing that distinguishing step with ANY
668+ -- second-axis step whose action on the codomain is the identity
669+ -- still yields a cell whose composed action preserves distinctness.
670+ -- The identity hypothesis is supplied POINTWISE (∀ z → gB z ≡ z) —
671+ -- which every concrete reflexive second-axis step satisfies by
672+ -- `refl` — so the proof never invokes function extensionality.
673+ generic-2cell-forward :
674+ ∀ (a : Axis) {d1 d2 : Axis.D a} (le : Axis._≤_ a d1 d2)
675+ (ps : ProperlyStrict a le)
676+ (gB : Axis.F a d2 → Axis.F a d2) →
677+ (∀ z → gB z ≡ z) →
678+ PreservesDistinct (λ w → gB (Axis.t a le w))
679+ generic-2cell-forward a le ps gB gB-id =
680+ ProperlyStrict.x ps
681+ , ProperlyStrict.y ps
682+ , ProperlyStrict.x≢y ps
683+ , λ eq → ProperlyStrict.tx≢ty ps
684+ (trans (sym (gB-id (Axis.t a le (ProperlyStrict.x ps))))
685+ (trans eq
686+ (gB-id (Axis.t a le (ProperlyStrict.y ps)))))
687+
688+ -- The concrete cells are instances of the generic forward direction:
689+ -- ChoreoAxis is properly-non-loss-only via c⊑s, and the second-axis
690+ -- contribution in the concrete n=2/n=3 cells is pointwise-identity
691+ -- (`applyGrade keep≤keep` / `applyMode linear≤linear`, both `refl`).
692+ -- This is the link between the concrete enumeration above and the
693+ -- generic statement (non-vacuity witness; no duplication of content).
694+ choreo-instantiates-generic-forward :
695+ PreservesDistinct (λ w → (λ z → z) (Axis.t ChoreoAxis c⊑s w))
696+ choreo-instantiates-generic-forward =
697+ generic-2cell-forward ChoreoAxis c⊑s
698+ (record
699+ { distinct = λ ()
700+ ; x = rg-input₁
701+ ; y = rg-input₂
702+ ; x≢y = rg-inputs-distinct
703+ ; tx≢ty = rg-images-distinct
704+ })
705+ (λ z → z) (λ z → refl)
706+
567707------------------------------------------------------------------------
568708-- Summary (prose; the formal content is above)
569709--
0 commit comments