简体   繁体   中英

Why J axiom takes 2 x when giving signature of x, y?

First, I've already looked up into several related materials, including the HoTT book & this question .

But I'm still confused, and I'm wishing for a explanation free from Agda, but directly from its mathematical formula. After removing the dot notation, J axiom then says like this, whose type signature is completely the same in the answer of the question I've mentioned above:

J : forall {A : Set} {C : (x y : A) → (x ≡ y) → Set} →
                 (c : ∀ x → C x x refl) →
                 (x y : A) → (p : x ≡ y) → C x y p

, noticing that the last line asks us to provide x, y and p. Then why

J c x x refl = c x

, (the only difference is that I've removed the dot notation)? Or to say, why the second x is written in x rather than y?

I have actually thought over this question and got my explanation, but I cannot make sure if I am correct. J's type signature is in the propositional world, but its definition is in the judgmental world. We are constructing the propositional equality class step by step but all judgmental equal variables can be instantly rewritten into each other, and when we are using J we should already have x judgmentally equal to y(since we are about to provide a path for that). But if my reasoning makes flawless sense, looking back into that question, why we are writing

cong : ∀ { a b} { A : Set a }  { B : Set b }
   (f : A → B ) {m  n}  → m ≡ n → f m ≡ f n
cong f {x} {y} p = J {C = \x y p → f x ≡ f y}
                     (\_ → refl)
                     x y p

again where the last line is providing x, y, p but not x, x, p?

当你在J的定义中p refl处的p进行模式匹配时,它的类型从x ≡ y精简到x ≡ x (因为构造函数refl的类型是∀ {x} -> x ≡ x ,即它设置两个索引到x ),这意味着我们可以通过x ~ y来改进左侧和右侧,这就是为什么模式中的y变为x (或者, 在Agda中为.x使其明确表示为是一个不可访问的模式 ),以及为什么cx : C xx refl在右侧传递结果类型C xyp

J is the induction axiom. Since it is an axiom, no proof is required. The axiom says that if you can provide a witness of type C xx refl , then C xyp can be constructed for any x and y , given that p is the proof of x ≡ y .

The proof in Agda isn't really the "full" proof - there is no visible step that constructs proofs for C xyp for any x , y and p . The visible part only establishes the fact that C xx refl can be constructed. The invisible part is the induction axiom built into Agda type-checker, which concludes that that's all that is needed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM