@@ -65,7 +65,7 @@ open WF public using (Acc; acc)
6565 induct {suc j} (acc rs) (tri< (s≤s i≤j) _ _) _ = Pᵢ⇒Pᵢ₊₁ j P[1+j]
6666 where
6767 toℕj≡toℕinjJ = sym $ toℕ-inject₁ j
68- P[1+j] = induct (rs _ (s≤s (subst (ℕ._≤ toℕ j) toℕj≡toℕinjJ ≤-refl)))
68+ P[1+j] = induct (rs (s≤s (subst (ℕ._≤ toℕ j) toℕj≡toℕinjJ ≤-refl)))
6969 (<-cmp i $ inject₁ j) (subst (toℕ i ℕ.≤_) toℕj≡toℕinjJ i≤j)
7070
7171<-weakInduction : (P : Pred (Fin (suc n)) ℓ) →
@@ -80,8 +80,7 @@ open WF public using (Acc; acc)
8080
8181private
8282 acc-map : ∀ {x : Fin n} → Acc ℕ._<_ (n ∸ toℕ x) → Acc _>_ x
83- acc-map {n} (acc rs) = acc λ y y>x →
84- acc-map (rs (n ∸ toℕ y) (ℕ.∸-monoʳ-< y>x (toℕ≤n y)))
83+ acc-map (acc rs) = acc λ y>x → acc-map (rs (ℕ.∸-monoʳ-< y>x (toℕ≤n _)))
8584
8685>-wellFounded : WellFounded {A = Fin n} _>_
8786>-wellFounded {n} x = acc-map (ℕ.<-wellFounded (n ∸ toℕ x))
@@ -96,7 +95,7 @@ private
9695 induct {i} (acc rec) with n ℕ.≟ toℕ i
9796 ... | yes n≡i = subst P (toℕ-injective (trans (toℕ-fromℕ n) n≡i)) Pₙ
9897 ... | no n≢i = subst P (inject₁-lower₁ i n≢i) (Pᵢ₊₁⇒Pᵢ _ Pᵢ₊₁)
99- where Pᵢ₊₁ = induct (rec _ (ℕ.≤-reflexive (cong suc (sym (toℕ-lower₁ i n≢i)))))
98+ where Pᵢ₊₁ = induct (rec (ℕ.≤-reflexive (cong suc (sym (toℕ-lower₁ i n≢i)))))
10099
101100------------------------------------------------------------------------
102101-- Well-foundedness of other (strict) partial orders on Fin
@@ -112,20 +111,20 @@ module _ {_≈_ : Rel (Fin n) ℓ} where
112111
113112 spo-wellFounded : ∀ {r} {_⊏_ : Rel (Fin n) r} →
114113 IsStrictPartialOrder _≈_ _⊏_ → WellFounded _⊏_
115- spo-wellFounded {_} {_⊏_} isSPO i = go n i pigeon where
114+ spo-wellFounded {_} {_⊏_} isSPO i = go n pigeon where
116115
117116 module ⊏ = IsStrictPartialOrder isSPO
118117
119- go : ∀ m i →
120- (( xs : Vec (Fin n) m) → Linked (flip _⊏_) (i ∷ xs) → WellFounded _⊏_) →
118+ go : ∀ m {i} →
119+ ({ xs : Vec (Fin n) m} → Linked (flip _⊏_) (i ∷ xs) → WellFounded _⊏_) →
121120 Acc _⊏_ i
122- go zero i k = k [] [ -] i
123- go (suc m) i k = acc $ λ j j ⊏i → go m j ( λ xs i∷xs↑ → k (j ∷ xs) (j ⊏i ∷ i∷xs↑) )
121+ go zero k = k [-] _
122+ go (suc m) k = acc λ j⊏i → go m λ i∷xs↑ → k (j⊏i ∷ i∷xs↑)
124123
125- pigeon : ( xs : Vec (Fin n) n) → Linked (flip _⊏_) (i ∷ xs) → WellFounded _⊏_
126- pigeon xs i∷xs↑ =
124+ pigeon : { xs : Vec (Fin n) n} → Linked (flip _⊏_) (i ∷ xs) → WellFounded _⊏_
125+ pigeon {xs} i∷xs↑ =
127126 let (i₁ , i₂ , i₁<i₂ , xs[i₁]≡xs[i₂]) = pigeonhole (n<1+n n) (Vec.lookup (i ∷ xs)) in
128- let xs[i₁]⊏xs[i₂] = Linkedₚ.lookup⁺ (Ord.transitive _⊏_ ⊏.trans) {xs = i ∷ xs} i∷xs↑ i₁<i₂ in
127+ let xs[i₁]⊏xs[i₂] = Linkedₚ.lookup⁺ (Ord.transitive _⊏_ ⊏.trans) i∷xs↑ i₁<i₂ in
129128 let xs[i₁]⊏xs[i₁] = ⊏.<-respʳ-≈ (⊏.Eq.reflexive xs[i₁]≡xs[i₂]) xs[i₁]⊏xs[i₂] in
130129 contradiction xs[i₁]⊏xs[i₁] (⊏.irrefl ⊏.Eq.refl)
131130
0 commit comments