Skip to content

Commit 36d4396

Browse files
hyperpolymathclaude
andcommitted
agda(EchoEpistemic): fix Agda 2.8.0 inference for knowledge-monotone-{comp,id}
Two surgical changes to keep `--safe --without-K` green under Agda 2.8.0: 1. `Knows r P y` was defined as `∀ e → P (proj₁ (RoleEcho r y ∋ e))` using a where-bound type-ascription operator `_∋_`. Under 2.8.0 the unifier can no longer see the role/value parameters through that indirection, which leaves r and y as unsolved metas in any downstream lemma quantifying over `e`. Spelt out as `(e : RoleEcho r y) → P (proj₁ e)` — equivalent meaning, no ascription helper. 2. `knowledge-monotone-comp` and `knowledge-monotone-id` previously used `∀ e → ...` in their signatures, which left e's type as a meta. Made the type explicit (`(e : RoleEcho r y) → ...`) and, because `obs : Role → Global → Bool` is not injective, supplied the implicit `r y P Q R` arguments at every `knowledge-monotone` call site inside the equality. The proof body remains `refl` — both sides reduce definitionally to `qr (proj₁ e) (pq (proj₁ e) (k e))`. EchoEpistemic.agda now typechecks under `--safe --without-K`. No postulates introduced. No semantics changed — the lemmas express the same modal-layer composition rung the previous version described. This fix does not touch Ordinal.Brouwer (separately failing under the in-flight Phase 1.3 recursive-predicate redesign). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 59cf61f commit 36d4396

1 file changed

Lines changed: 17 additions & 10 deletions

File tree

proofs/agda/EchoEpistemic.agda

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ indist-trans :
2626
indist-trans = trans
2727

2828
-- Knowledge at visible value y: P holds for every witness compatible with y.
29+
-- Spelt out as `(e : RoleEcho r y) → ...` rather than `∀ e → ... ∋ e` so
30+
-- Agda 2.8.0's unifier can see the role and value parameters through
31+
-- downstream lemmas (knowledge-monotone-comp etc.) without a
32+
-- type-ascription indirection.
2933
Knows : Role (Global Set) Bool Set
30-
Knows r P y = e P (proj₁ (RoleEcho r y ∋ e))
31-
where
32-
infix 4 _∋_
33-
_∋_ : {ℓ} (A : Set ℓ) A A
34-
_ ∋ x = x
34+
Knows r P y = (e : RoleEcho r y) P (proj₁ e)
3535

3636
knows-from-preimage :
3737
{r : Role} {y : Bool} {P : Global Set}
@@ -56,14 +56,20 @@ knowledge-monotone pq k e = pq (proj₁ e) (k e)
5656
-- equation lives inside `--safe --without-K` without function
5757
-- extensionality. Both sides reduce to `qr (proj₁ e) (pq (proj₁ e)
5858
-- (k e))` definitionally.
59+
-- Implicit args to `knowledge-monotone` are annotated explicitly at every
60+
-- call site. Under Agda 2.8.0 the unifier won't infer the implicit role
61+
-- `r` from `obs _r x = obs r x` (obs isn't injective), so the
62+
-- decoration's role+value+predicate parameters must be supplied directly.
5963
knowledge-monotone-comp :
6064
{r : Role} {y : Bool} {P Q R : Global Set}
6165
(pq : g P g Q g)
6266
(qr : g Q g R g)
6367
(k : Knows r P y)
64-
e
65-
knowledge-monotone qr (knowledge-monotone pq k) e
66-
≡ knowledge-monotone (λ g p qr g (pq g p)) k e
68+
(e : RoleEcho r y)
69+
knowledge-monotone {r = r} {y = y} {P = Q} {Q = R} qr
70+
(knowledge-monotone {r = r} {y = y} {P = P} {Q = Q} pq k) e
71+
≡ knowledge-monotone {r = r} {y = y} {P = P} {Q = R}
72+
(λ g p qr g (pq g p)) k e
6773
knowledge-monotone-comp pq qr k e = refl
6874

6975
-- Identity-step corollary: monotonicity along the identity predicate
@@ -72,8 +78,9 @@ knowledge-monotone-comp pq qr k e = refl
7278
knowledge-monotone-id :
7379
{r : Role} {y : Bool} {P : Global Set}
7480
(k : Knows r P y)
75-
e
76-
knowledge-monotone (λ _ p p) k e ≡ k e
81+
(e : RoleEcho r y)
82+
knowledge-monotone {r = r} {y = y} {P = P} {Q = P} (λ _ p p) k e
83+
≡ k e
7784
knowledge-monotone-id k e = refl
7885

7986
ServerIsTrue : Global Set

0 commit comments

Comments
 (0)