{"action":"created","comment":{"url":"https://api.github.com/repos/agda/agda-stdlib/pulls/comments/257846643","pull_request_review_id":204976457,"id":257846643,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI1Nzg0NjY0Mw==","diff_hunk":"@@ -340,6 +340,30 @@ toℕ-inject₁ : ∀ {n} (i : Fin n) → toℕ (inject₁ i) ≡ toℕ i\n toℕ-inject₁ zero    = refl\n toℕ-inject₁ (suc i) = cong suc (toℕ-inject₁ i)\n \n+toℕ-inject₁-≢ : ∀ {n}(i : Fin n) → n ≢ toℕ (inject₁ i)\n+toℕ-inject₁-≢ zero = λ ()\n+toℕ-inject₁-≢ (suc i) = λ p → toℕ-inject₁-≢ i (ℕₚ.suc-injective p)\n+\n+------------------------------------------------------------------------\n+-- inject₁ and lower₁\n+\n+inject₁-lower₁ : ∀ {n} (i : Fin (suc n)) (ne : n ≢ toℕ i)\n+               → inject₁ (lower₁ i ne) ≡ i\n+inject₁-lower₁ {zero} zero ne = ⊥-elim (ne refl)\n+inject₁-lower₁ {zero} (suc ()) _\n+inject₁-lower₁ {suc n} zero _ = refl\n+inject₁-lower₁ {suc n} (suc i) ne\n+  rewrite inject₁-lower₁ i  (λ x → ne (cong suc x)) = refl\n+\n+lower₁-inject₁′ : ∀ {n} (i : Fin n) (ne : n ≢ toℕ (inject₁ i))\n+                → lower₁ (inject₁ i) ne ≡ i\n+lower₁-inject₁′ {zero} () ne\n+lower₁-inject₁′ {suc n} zero ne = refl\n+lower₁-inject₁′ {suc n} (suc i) ne\n+  rewrite lower₁-inject₁′ i (λ x → ne (cong suc x)) = refl\n+","path":"src/Data/Fin/Properties.agda","position":25,"original_position":25,"commit_id":"6025526d00eb128d2d87c6601cd13a2c39d7ca2d","original_commit_id":"6025526d00eb128d2d87c6601cd13a2c39d7ca2d","user":{"login":"gallais","id":1094905,"node_id":"MDQ6VXNlcjEwOTQ5MDU=","avatar_url":"https://avatars1.githubusercontent.com/u/1094905?v=4","gravatar_id":"","url":"https://api.github.com/users/gallais","html_url":"https://github.com/gallais","followers_url":"https://api.github.com/users/gallais/followers","following_url":"https://api.github.com/users/gallais/following{/other_user}","gists_url":"https://api.github.com/users/gallais/gists{/gist_id}","starred_url":"https://api.github.com/users/gallais/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gallais/subscriptions","organizations_url":"https://api.github.com/users/gallais/orgs","repos_url":"https://api.github.com/users/gallais/repos","events_url":"https://api.github.com/users/gallais/events{/privacy}","received_events_url":"https://api.github.com/users/gallais/received_events","type":"User","site_admin":false},"body":"Here pattern-matching on `i` is enough to force `{n}` to have the right shape. So you can write:\r\n\r\n```agda\r\nlower₁-inject₁′ : ∀ {n} (i : Fin n) (ne : n ≢ toℕ (inject₁ i))\r\n                → lower₁ (inject₁ i) ne ≡ i\r\nlower₁-inject₁′ zero    ne = refl\r\nlower₁-inject₁′ (suc i) ne = cong suc (lower₁-inject₁′ i (ne ∘ cong suc))\r\n```","created_at":"2019-02-18T23:00:25Z","updated_at":"2019-02-18T23:00:25Z","html_url":"https://github.com/agda/agda-stdlib/pull/620#discussion_r257846643","pull_request_url":"https://api.github.com/repos/agda/agda-stdlib/pulls/620","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/agda/agda-stdlib/pulls/comments/257846643"},"html":{"href":"https://github.com/agda/agda-stdlib/pull/620#discussion_r257846643"},"pull_request":{"href":"https://api.github.com/repos/agda/agda-stdlib/pulls/620"}}},"pull_request":{"url":"https://api.github.com/repos/agda/agda-stdlib/pulls/620","id":253477837,"node_id":"MDExOlB1bGxSZXF1ZXN0MjUzNDc3ODM3","html_url":"https://github.com/agda/agda-stdlib/pull/620","diff_url":"https://github.com/agda/agda-stdlib/pull/620.diff","patch_url":"https://github.com/agda/agda-stdlib/pull/620.patch","issue_url":"https://api.github.com/repos/agda/agda-stdlib/issues/620","number":620,"state":"open","locked":false,"title":"[ new ] Added an inverse of inject₁ in Data.Fin ","user":{"login":"L-TChen","id":4060046,"node_id":"MDQ6VXNlcjQwNjAwNDY=","avatar_url":"https://avatars1.githubusercontent.com/u/4060046?v=4","gravatar_id":"","url":"https://api.github.com/users/L-TChen","html_url":"https://github.com/L-TChen","followers_url":"https://api.github.com/users/L-TChen/followers","following_url":"https://api.github.com/users/L-TChen/following{/other_user}","gists_url":"https://api.github.com/users/L-TChen/gists{/gist_id}","starred_url":"https://api.github.com/users/L-TChen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/L-TChen/subscriptions","organizations_url":"https://api.github.com/users/L-TChen/orgs","repos_url":"https://api.github.com/users/L-TChen/repos","events_url":"https://api.github.com/users/L-TChen/events{/privacy}","received_events_url":"https://api.github.com/users/L-TChen/received_events","type":"User","site_admin":false},"body":"Added the inverse of inject₁:\r\n\r\nlower₁ : (i : Fin (suc n)) → (n ≢ toℕ i) → Fin n\r\n\r\nand its related properties:\r\n\r\ntoℕ-inject₁-≢   : (i : Fin n)                 → n ≢ toℕ (inject₁ i)\r\ninject₁-lower₁  : (ne : n ≢ toℕ i)         → lower₁ (reduce₁ i ne) ≡ i\r\nlower₁-inject₁′ : (i : Fin n) (ne : n ≢ toℕ (inject₁ i)) → lower₁ (inject₁ i) ne ≡ i\r\nlower₁-inject₁  : (i : Fin n) → lower₁ (inject₁ i) (toℕ-inject₁-≢ i) ≡ i\r\n\r\nPlease feel free to comment or suggest. These are general properties one may need while manipulating Fin's index using inject₁. ","created_at":"2019-02-15T15:59:24Z","updated_at":"2019-02-18T23:00:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"66ccdf50803036e9c72fbfc9441495d72c22d091","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":75500023,"node_id":"MDU6TGFiZWw3NTUwMDAyMw==","url":"https://api.github.com/repos/agda/agda-stdlib/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"milestone":null,"commits_url":"https://api.github.com/repos/agda/agda-stdlib/pulls/620/commits","review_comments_url":"https://api.github.com/repos/agda/agda-stdlib/pulls/620/comments","review_comment_url":"https://api.github.com/repos/agda/agda-stdlib/pulls/comments{/number}","comments_url":"https://api.github.com/repos/agda/agda-stdlib/issues/620/comments","statuses_url":"https://api.github.com/repos/agda/agda-stdlib/statuses/6025526d00eb128d2d87c6601cd13a2c39d7ca2d","head":{"label":"L-TChen:lower-fin","ref":"lower-fin","sha":"6025526d00eb128d2d87c6601cd13a2c39d7ca2d","user":{"login":"L-TChen","id":4060046,"node_id":"MDQ6VXNlcjQwNjAwNDY=","avatar_url":"https://avatars1.githubusercontent.com/u/4060046?v=4","gravatar_id":"","url":"https://api.github.com/users/L-TChen","html_url":"https://github.com/L-TChen","followers_url":"https://api.github.com/users/L-TChen/followers","following_url":"https://api.github.com/users/L-TChen/following{/other_user}","gists_url":"https://api.github.com/users/L-TChen/gists{/gist_id}","starred_url":"https://api.github.com/users/L-TChen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/L-TChen/subscriptions","organizations_url":"https://api.github.com/users/L-TChen/orgs","repos_url":"https://api.github.com/users/L-TChen/repos","events_url":"https://api.github.com/users/L-TChen/events{/privacy}","received_events_url":"https://api.github.com/users/L-TChen/received_events","type":"User","site_admin":false},"repo":{"id":169926242,"node_id":"MDEwOlJlcG9zaXRvcnkxNjk5MjYyNDI=","name":"agda-stdlib","full_name":"L-TChen/agda-stdlib","private":false,"owner":{"login":"L-TChen","id":4060046,"node_id":"MDQ6VXNlcjQwNjAwNDY=","avatar_url":"https://avatars1.githubusercontent.com/u/4060046?v=4","gravatar_id":"","url":"https://api.github.com/users/L-TChen","html_url":"https://github.com/L-TChen","followers_url":"https://api.github.com/users/L-TChen/followers","following_url":"https://api.github.com/users/L-TChen/following{/other_user}","gists_url":"https://api.github.com/users/L-TChen/gists{/gist_id}","starred_url":"https://api.github.com/users/L-TChen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/L-TChen/subscriptions","organizations_url":"https://api.github.com/users/L-TChen/orgs","repos_url":"https://api.github.com/users/L-TChen/repos","events_url":"https://api.github.com/users/L-TChen/events{/privacy}","received_events_url":"https://api.github.com/users/L-TChen/received_events","type":"User","site_admin":false},"html_url":"https://github.com/L-TChen/agda-stdlib","description":"The Agda standard library","fork":true,"url":"https://api.github.com/repos/L-TChen/agda-stdlib","forks_url":"https://api.github.com/repos/L-TChen/agda-stdlib/forks","keys_url":"https://api.github.com/repos/L-TChen/agda-stdlib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/L-TChen/agda-stdlib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/L-TChen/agda-stdlib/teams","hooks_url":"https://api.github.com/repos/L-TChen/agda-stdlib/hooks","issue_events_url":"https://api.github.com/repos/L-TChen/agda-stdlib/issues/events{/number}","events_url":"https://api.github.com/repos/L-TChen/agda-stdlib/events","assignees_url":"https://api.github.com/repos/L-TChen/agda-stdlib/assignees{/user}","branches_url":"https://api.github.com/repos/L-TChen/agda-stdlib/branches{/branch}","tags_url":"https://api.github.com/repos/L-TChen/agda-stdlib/tags","blobs_url":"https://api.github.com/repos/L-TChen/agda-stdlib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/L-TChen/agda-stdlib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/L-TChen/agda-stdlib/git/refs{/sha}","trees_url":"https://api.github.com/repos/L-TChen/agda-stdlib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/L-TChen/agda-stdlib/statuses/{sha}","languages_url":"https://api.github.com/repos/L-TChen/agda-stdlib/languages","stargazers_url":"https://api.github.com/repos/L-TChen/agda-stdlib/stargazers","contributors_url":"https://api.github.com/repos/L-TChen/agda-stdlib/contributors","subscribers_url":"https://api.github.com/repos/L-TChen/agda-stdlib/subscribers","subscription_url":"https://api.github.com/repos/L-TChen/agda-stdlib/subscription","commits_url":"https://api.github.com/repos/L-TChen/agda-stdlib/commits{/sha}","git_commits_url":"https://api.github.com/repos/L-TChen/agda-stdlib/git/commits{/sha}","comments_url":"https://api.github.com/repos/L-TChen/agda-stdlib/comments{/number}","issue_comment_url":"https://api.github.com/repos/L-TChen/agda-stdlib/issues/comments{/number}","contents_url":"https://api.github.com/repos/L-TChen/agda-stdlib/contents/{+path}","compare_url":"https://api.github.com/repos/L-TChen/agda-stdlib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/L-TChen/agda-stdlib/merges","archive_url":"https://api.github.com/repos/L-TChen/agda-stdlib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/L-TChen/agda-stdlib/downloads","issues_url":"https://api.github.com/repos/L-TChen/agda-stdlib/issues{/number}","pulls_url":"https://api.github.com/repos/L-TChen/agda-stdlib/pulls{/number}","milestones_url":"https://api.github.com/repos/L-TChen/agda-stdlib/milestones{/number}","notifications_url":"https://api.github.com/repos/L-TChen/agda-stdlib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/L-TChen/agda-stdlib/labels{/name}","releases_url":"https://api.github.com/repos/L-TChen/agda-stdlib/releases{/id}","deployments_url":"https://api.github.com/repos/L-TChen/agda-stdlib/deployments","created_at":"2019-02-09T23:49:36Z","updated_at":"2019-02-15T15:38:36Z","pushed_at":"2019-02-15T17:06:28Z","git_url":"git://github.com/L-TChen/agda-stdlib.git","ssh_url":"git@github.com:L-TChen/agda-stdlib.git","clone_url":"https://github.com/L-TChen/agda-stdlib.git","svn_url":"https://github.com/L-TChen/agda-stdlib","homepage":"http://wiki.portal.chalmers.se/agda/pmwiki.php","size":8678,"stargazers_count":0,"watchers_count":0,"language":"Agda","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"agda:master","ref":"master","sha":"3c313ca9a2ad869e555222c1381f0f8ff66abc3c","user":{"login":"agda","id":410000,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMDAwMA==","avatar_url":"https://avatars2.githubusercontent.com/u/410000?v=4","gravatar_id":"","url":"https://api.github.com/users/agda","html_url":"https://github.com/agda","followers_url":"https://api.github.com/users/agda/followers","following_url":"https://api.github.com/users/agda/following{/other_user}","gists_url":"https://api.github.com/users/agda/gists{/gist_id}","starred_url":"https://api.github.com/users/agda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agda/subscriptions","organizations_url":"https://api.github.com/users/agda/orgs","repos_url":"https://api.github.com/users/agda/repos","events_url":"https://api.github.com/users/agda/events{/privacy}","received_events_url":"https://api.github.com/users/agda/received_events","type":"Organization","site_admin":false},"repo":{"id":15994976,"node_id":"MDEwOlJlcG9zaXRvcnkxNTk5NDk3Ng==","name":"agda-stdlib","full_name":"agda/agda-stdlib","private":false,"owner":{"login":"agda","id":410000,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMDAwMA==","avatar_url":"https://avatars2.githubusercontent.com/u/410000?v=4","gravatar_id":"","url":"https://api.github.com/users/agda","html_url":"https://github.com/agda","followers_url":"https://api.github.com/users/agda/followers","following_url":"https://api.github.com/users/agda/following{/other_user}","gists_url":"https://api.github.com/users/agda/gists{/gist_id}","starred_url":"https://api.github.com/users/agda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agda/subscriptions","organizations_url":"https://api.github.com/users/agda/orgs","repos_url":"https://api.github.com/users/agda/repos","events_url":"https://api.github.com/users/agda/events{/privacy}","received_events_url":"https://api.github.com/users/agda/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/agda/agda-stdlib","description":"The Agda standard library","fork":false,"url":"https://api.github.com/repos/agda/agda-stdlib","forks_url":"https://api.github.com/repos/agda/agda-stdlib/forks","keys_url":"https://api.github.com/repos/agda/agda-stdlib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/agda/agda-stdlib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/agda/agda-stdlib/teams","hooks_url":"https://api.github.com/repos/agda/agda-stdlib/hooks","issue_events_url":"https://api.github.com/repos/agda/agda-stdlib/issues/events{/number}","events_url":"https://api.github.com/repos/agda/agda-stdlib/events","assignees_url":"https://api.github.com/repos/agda/agda-stdlib/assignees{/user}","branches_url":"https://api.github.com/repos/agda/agda-stdlib/branches{/branch}","tags_url":"https://api.github.com/repos/agda/agda-stdlib/tags","blobs_url":"https://api.github.com/repos/agda/agda-stdlib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/agda/agda-stdlib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/agda/agda-stdlib/git/refs{/sha}","trees_url":"https://api.github.com/repos/agda/agda-stdlib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/agda/agda-stdlib/statuses/{sha}","languages_url":"https://api.github.com/repos/agda/agda-stdlib/languages","stargazers_url":"https://api.github.com/repos/agda/agda-stdlib/stargazers","contributors_url":"https://api.github.com/repos/agda/agda-stdlib/contributors","subscribers_url":"https://api.github.com/repos/agda/agda-stdlib/subscribers","subscription_url":"https://api.github.com/repos/agda/agda-stdlib/subscription","commits_url":"https://api.github.com/repos/agda/agda-stdlib/commits{/sha}","git_commits_url":"https://api.github.com/repos/agda/agda-stdlib/git/commits{/sha}","comments_url":"https://api.github.com/repos/agda/agda-stdlib/comments{/number}","issue_comment_url":"https://api.github.com/repos/agda/agda-stdlib/issues/comments{/number}","contents_url":"https://api.github.com/repos/agda/agda-stdlib/contents/{+path}","compare_url":"https://api.github.com/repos/agda/agda-stdlib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/agda/agda-stdlib/merges","archive_url":"https://api.github.com/repos/agda/agda-stdlib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/agda/agda-stdlib/downloads","issues_url":"https://api.github.com/repos/agda/agda-stdlib/issues{/number}","pulls_url":"https://api.github.com/repos/agda/agda-stdlib/pulls{/number}","milestones_url":"https://api.github.com/repos/agda/agda-stdlib/milestones{/number}","notifications_url":"https://api.github.com/repos/agda/agda-stdlib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/agda/agda-stdlib/labels{/name}","releases_url":"https://api.github.com/repos/agda/agda-stdlib/releases{/id}","deployments_url":"https://api.github.com/repos/agda/agda-stdlib/deployments","created_at":"2014-01-17T09:09:18Z","updated_at":"2019-02-18T03:08:34Z","pushed_at":"2019-02-18T22:52:49Z","git_url":"git://github.com/agda/agda-stdlib.git","ssh_url":"git@github.com:agda/agda-stdlib.git","clone_url":"https://github.com/agda/agda-stdlib.git","svn_url":"https://github.com/agda/agda-stdlib","homepage":"http://wiki.portal.chalmers.se/agda/pmwiki.php","size":71938,"stargazers_count":215,"watchers_count":215,"language":"Agda","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":86,"mirror_url":null,"archived":false,"open_issues_count":105,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":86,"open_issues":105,"watchers":215,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/agda/agda-stdlib/pulls/620"},"html":{"href":"https://github.com/agda/agda-stdlib/pull/620"},"issue":{"href":"https://api.github.com/repos/agda/agda-stdlib/issues/620"},"comments":{"href":"https://api.github.com/repos/agda/agda-stdlib/issues/620/comments"},"review_comments":{"href":"https://api.github.com/repos/agda/agda-stdlib/pulls/620/comments"},"review_comment":{"href":"https://api.github.com/repos/agda/agda-stdlib/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/agda/agda-stdlib/pulls/620/commits"},"statuses":{"href":"https://api.github.com/repos/agda/agda-stdlib/statuses/6025526d00eb128d2d87c6601cd13a2c39d7ca2d"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"gallais"}}