Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions Cubical/Data/Fin/LehmerCode.agda
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,6 @@ encode = equivFun lehmerEquiv
decode : LehmerCode n → Fin n ≃ Fin n
decode = invEq lehmerEquiv

-- Use the one in Cubical.Data.Nat.Properties instead
factorial : ℕ → ℕ
factorial = _!

lehmerFinEquiv : LehmerCode n ≃ Fin (n !)
lehmerFinEquiv {zero} = isContr→Equiv isContrLehmerZero isContrFin1
lehmerFinEquiv {suc n} = _ ≃⟨ invEquiv lehmerSucEquiv ⟩
Expand Down
2 changes: 1 addition & 1 deletion Cubical/Data/FinSet/Cardinality.agda
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ module _
module _
(X : FinSet ℓ ) where

cardAut : card (_ , isFinSetAut X) ≡ LehmerCode.factorial (card X)
cardAut : card (_ , isFinSetAut X) ≡ (card X !)
cardAut = refl

module _
Expand Down
2 changes: 1 addition & 1 deletion Cubical/Data/FinSet/Constructors.agda
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ module _
(X : FinSet ℓ) where

isFinSetAut : isFinSet (X .fst ≃ X .fst)
isFinSetAut = LehmerCode.factorial (card X) ,
isFinSetAut = card X ! ,
Prop.map (λ p → isFinOrd≃ (X .fst) (card X , p) .snd) (X .snd .snd)

isFinSetTypeAut : isFinSet (X .fst ≡ X .fst)
Expand Down
8 changes: 5 additions & 3 deletions Cubical/Data/Nat/Properties.agda
Original file line number Diff line number Diff line change
Expand Up @@ -266,12 +266,14 @@ n∸n (suc n) = n∸n n
∸-distribʳ zero (suc n) k = sym (zero∸ (k + n · k))
∸-distribʳ (suc m) (suc n) k = ∸-distribʳ m n k ∙ sym (∸-cancelˡ k (m · k) (n · k))


infix 6 _!
infix 7 _choose_

-- factorial:
_! :
_! factorial :
zero ! = 1
suc n ! = (suc n) · (n !)
suc n ! = suc n · (n !)
factorial = _!

--binomial coefficient:
_choose_ :
Expand Down
2 changes: 1 addition & 1 deletion Cubical/Data/SumFin/Properties.agda
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ isProp→Fin≤1 (suc (suc n)) p = ⊥.rec (fzero≠fone (p fzero (fsuc fzero)))

-- automorphisms of SumFin

SumFin≃≃ : (n : ℕ) → (Fin n ≃ Fin n) ≃ Fin (LehmerCode.factorial n)
SumFin≃≃ : (n : ℕ) → (Fin n ≃ Fin n) ≃ Fin (n !)
SumFin≃≃ _ =
equivComp (SumFin≃Fin _) (SumFin≃Fin _)
⋆ LehmerCode.lehmerEquiv
Expand Down