这个 Modulo a Set 的公式是什么?
Is this formulation of Modulo a Set?
Cubical Agda 库defined a Modulo
type like this:
data Modulo (k : ℕ) : Type₀ where
embed : (n : ℕ) → Modulo k
pre-step : NonZero k → (n : ℕ) → embed n ≡ embed (k + n)
这是一套吗?
挥手,我可以看到任何路径都是refl
s和pre-step
s的组合,形式为embed n ≡ embed (m * k + n)
;和
由于 _+_
是关联的,而 0 +_ ≡ id
,因此 refl
和 pre-step
的结构如何组合并不重要;但如何将其正式化?
根据@András Kovács 的评论,结果 Modulo n
确实是一个 h 集,而 there is a proof in the standard library,我只是错过了它:)
证明基本上是这样的:
Modulo 0
同构于 ℕ
因为 NonZero 0
是空的(所以我们只有 embed
值)。
Modulo (suc k)
与 Fin (suc k)
同构,基本上是通过应用足够的 pre-step
s 直到我们得到 embed n
和 n < k
。 This is a long-winded technical proof taking up its own module.
当然 ℕ
和 Fin (suc k)
都是离散的,因此 h 集本身。
Cubical Agda 库defined a Modulo
type like this:
data Modulo (k : ℕ) : Type₀ where
embed : (n : ℕ) → Modulo k
pre-step : NonZero k → (n : ℕ) → embed n ≡ embed (k + n)
这是一套吗?
挥手,我可以看到任何路径都是refl
s和pre-step
s的组合,形式为embed n ≡ embed (m * k + n)
;和
由于 _+_
是关联的,而 0 +_ ≡ id
,因此 refl
和 pre-step
的结构如何组合并不重要;但如何将其正式化?
根据@András Kovács 的评论,结果 Modulo n
确实是一个 h 集,而 there is a proof in the standard library,我只是错过了它:)
证明基本上是这样的:
Modulo 0
同构于ℕ
因为NonZero 0
是空的(所以我们只有embed
值)。Modulo (suc k)
与Fin (suc k)
同构,基本上是通过应用足够的pre-step
s 直到我们得到embed n
和n < k
。 This is a long-winded technical proof taking up its own module.
当然 ℕ
和 Fin (suc k)
都是离散的,因此 h 集本身。