Skip to content

Commit c16edad

Browse files
authored
Remove duplicated factorial function (agda#1183)
`_!` is defined in `Cubical.Data.Nat.Properties`, `factorial` is defined in `Cubical.Data.Fin.LehmerCode`, and they both have identical definitions.
1 parent f717d46 commit c16edad

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Cubical/Data/Fin/LehmerCode.agda

+3-3
Original file line numberDiff line numberDiff line change
@@ -191,11 +191,11 @@ encode = equivFun lehmerEquiv
191191
decode : LehmerCode n Fin n ≃ Fin n
192192
decode = invEq lehmerEquiv
193193

194+
-- Use the one in Cubical.Data.Nat.Properties instead
194195
factorial :
195-
factorial zero = 1
196-
factorial (suc n) = suc n · factorial n
196+
factorial = _!
197197

198-
lehmerFinEquiv : LehmerCode n ≃ Fin (factorial n)
198+
lehmerFinEquiv : LehmerCode n ≃ Fin (n !)
199199
lehmerFinEquiv {zero} = isContr→Equiv isContrLehmerZero isContrFin1
200200
lehmerFinEquiv {suc n} = _ ≃⟨ invEquiv lehmerSucEquiv ⟩
201201
_ ≃⟨ ≃-× (idEquiv _) lehmerFinEquiv ⟩

0 commit comments

Comments
 (0)