# HG changeset patch # User Shinji KONO # Date 1609573894 -32400 # Node ID 0b74851665ee00173ef8d5ac05c25dad1a8c5a34 # Parent 91265c9712004a198a264c61d55ac1b66d6cd4fb ( n k : ℕ ) → 1 < n → gcd n k ≤ n diff -r 91265c971200 -r 0b74851665ee agda/gcd.agda --- a/agda/gcd.agda Sat Jan 02 11:49:44 2021 +0900 +++ b/agda/gcd.agda Sat Jan 02 16:51:34 2021 +0900 @@ -35,9 +35,9 @@ gcd1 : ( i i0 j j0 : ℕ ) → ℕ gcd1 zero i0 zero j0 with <-cmp i0 j0 -... | tri< a ¬b ¬c = j0 +... | tri< a ¬b ¬c = i0 ... | tri≈ ¬a refl ¬c = i0 -... | tri> ¬a ¬b c = i0 +... | tri> ¬a ¬b c = j0 gcd1 zero i0 (suc zero) j0 = 1 gcd1 zero zero (suc (suc j)) j0 = j0 gcd1 zero (suc i0) (suc (suc j)) j0 = gcd1 i0 (suc i0) (suc j) (suc (suc j)) @@ -156,18 +156,25 @@ gcd1 1 1 (suc j) (suc j) ∎ where open ≡-Reasoning gcd200 (suc (suc i)) i0 (suc j) zero i=i0 () -gcd6 : ( i i0 j j0 n n0 : ℕ) → gcd1 i i0 j j0 ≡ gcd1 0 n 0 n0 → n ≡ n0 -gcd6 i i0 j j0 n n0 = {!!} - gcd5 : ( n k : ℕ ) → 1 < n → gcd n k ≤ n gcd5 n k 0 ¬a ¬b c = ≤-refl - gcd50 zero i0 (suc j) j0 0 ¬a ¬b c = ≤-trans refl-≤s c + gcd50 zero (suc i0) (suc zero) j0 0