# HG changeset patch # User Shinji KONO # Date 1609529360 -32400 # Node ID ba7d4cc92e608dac5b04326549e4ec319a089947 # Parent d78fc1951c2656fe4ba3642457a8fed19c0e9344 ... gcd (i + j) j ≡ gcd i j diff -r d78fc1951c26 -r ba7d4cc92e60 agda/gcd.agda --- a/agda/gcd.agda Sat Jan 02 03:43:24 2021 +0900 +++ b/agda/gcd.agda Sat Jan 02 04:29:20 2021 +0900 @@ -86,51 +86,6 @@ comp : ℕ is-comp : n * comp ≡ m -gcd27 : (n m i : ℕ) → 1 < m → gcd n i ≡ m → Comp m n ∨ Comp m i -gcd27 n m i 1 ¬a ¬b c = case1 (record { non-1 = 1 a a₁) @@ -175,55 +130,30 @@ gcd1 (i + j1) (i0 + suc j) j1 j0 ≡⟨ gcd201 i i0 j j0 j1 ⟩ gcd1 i (i0 + suc j) zero j0 ∎ where open ≡-Reasoning gcd200 : (i i0 j j0 : ℕ) → gcd1 (i + j) (i0 + j) j j0 ≡ gcd1 i i j0 j0 - -- gcd200 i i0 zero j0 = subst₂ (λ m k → gcd1 m k zero j0 ≡ gcd1 i i0 zero j0 ) (+-comm zero i) (+-comm zero i0) refl gcd200 i i0 zero j0 = {!!} gcd200 (suc (suc i)) i0 (suc j) (suc j0) = gcd201 (suc (suc i)) i0 j (suc j0) (suc j) gcd200 zero zero (suc zero) j0 = {!!} gcd200 zero zero (suc (suc j)) j0 = {!!} gcd200 zero (suc i0) (suc j) j0 = {!!} gcd200 (suc zero) i0 (suc j) j0 = {!!} - gcd200 (suc (suc i)) i0 (suc j) zero = ? + gcd200 (suc (suc i)) i0 (suc j) zero = {!!} + +gcd4 : ( n k : ℕ ) → gcd n k ≡ k → k ≤ n +gcd4 n k gn = gcd40 n n k k gn where + gcd40 : (i i0 j j0 : ℕ) → gcd1 i i0 j j0 ≡ j0 → j0 ≤ i0 + gcd40 zero i0 zero j0 gn = {!!} + gcd40 zero i0 (suc j) j0 gn = {!!} + gcd40 (suc i) i0 zero j0 gn = {!!} + gcd40 (suc i) i0 (suc j) j0 gn = gcd40 i i0 j j0 (subst (λ k → k ≡ j0) (gcd22 i i0 j j0) gn) + +gcd3 : ( n k : ℕ ) → n ≤ k + k → gcd n k ≡ k → n ≡ k +gcd3 n k n<2k gn = {!!} + +gcd23 : ( n m k : ℕ) → gcd n k ≡ k → gcd m k ≡ k → k ≤ gcd n m +gcd23 = {!!} gcd24 : { n m k : ℕ} → n > 1 → m > 1 → k > 1 → gcd n k ≡ k → gcd m k ≡ k → ¬ ( gcd n m ≡ 1 ) -gcd24 {n} {m} {k} 1 ¬a ¬b c = 1 ¬a ¬b c = ⊥-elim ( nat-≡< gm 1 (subst (λ k → k ≤ 1 ) gm (gcd27 (suc j) (suc (suc j)))) 1 (suc (suc o0)) → gm = gnm → (suc (suc i0)) ≡ 1 - -- (suc (suc i0)) < (suc (suc o0)) → ? gcd1 (suc j) (suc (suc j)) (suc o0) (suc (suc o0)) ≡ (suc (suc o0)) - -- gcd1 (suc j) (suc (suc j)) (suc i0) (suc (suc i0)) ≡ 1 - gcd25 (suc (suc i0)) (suc (suc o0)) (suc j) j0 1 ¬a ¬b c = gcd26 {!!} {!!} {!!} {!!} {!!} {!!} {!!} - gcd21 zero i0 (suc j) j0 (suc zero) o0 1