{"action":"created","issue":{"url":"https://api.github.com/repos/leanprover/lean/issues/687","labels_url":"https://api.github.com/repos/leanprover/lean/issues/687/labels{/name}","comments_url":"https://api.github.com/repos/leanprover/lean/issues/687/comments","events_url":"https://api.github.com/repos/leanprover/lean/issues/687/events","html_url":"https://github.com/leanprover/lean/issues/687","id":90250864,"number":687,"title":"instance inference","user":{"login":"htzh","id":5956967,"avatar_url":"https://avatars.githubusercontent.com/u/5956967?v=3","gravatar_id":"","url":"https://api.github.com/users/htzh","html_url":"https://github.com/htzh","followers_url":"https://api.github.com/users/htzh/followers","following_url":"https://api.github.com/users/htzh/following{/other_user}","gists_url":"https://api.github.com/users/htzh/gists{/gist_id}","starred_url":"https://api.github.com/users/htzh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/htzh/subscriptions","organizations_url":"https://api.github.com/users/htzh/orgs","repos_url":"https://api.github.com/users/htzh/repos","events_url":"https://api.github.com/users/htzh/events{/privacy}","received_events_url":"https://api.github.com/users/htzh/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-06-23T00:28:21Z","updated_at":"2015-06-29T11:21:01Z","closed_at":"2015-06-29T03:27:36Z","body":"The following inductive or match definitions only work with the nat annotation on the cases:\r\n```\r\nsection rot\r\nopen nat fin eq.ops algebra\r\n\r\ndefinition rotr₁ {n : nat} : fin n → fin n := match n with \r\n| (0:nat)      := take i, elim0 i\r\n| (nat.succ k) := madd (-maxi)\r\nend\r\n\r\ndefinition rotr₂ : ∀ {n : nat}, fin n → fin n\r\n| (0:nat)        := take i, elim0 i\r\n| (nat.succ n) := madd (-maxi)\r\n\r\nend rot\r\n```\r\nEven enclosing the definition in its own section still requires annotation of succ:\r\n```\r\nsection\r\nopen nat\r\ndefinition rotr : ∀ {n : nat}, fin n → fin n\r\n| 0      := take i, elim0 i\r\n| (nat.succ n) := madd (-maxi)\r\nend\r\n```\r\nOtherwise group over ```madd``` is not inferred.\r\nNone-inductive definition does not have the same problem:\r\n```\r\ndefinition rotr {n : nat} : fin (succ n) → fin (succ n) := madd (-maxi)\r\n```\r\nworks.\r\n"},"comment":{"url":"https://api.github.com/repos/leanprover/lean/issues/comments/116618125","html_url":"https://github.com/leanprover/lean/issues/687#issuecomment-116618125","issue_url":"https://api.github.com/repos/leanprover/lean/issues/687","id":116618125,"user":{"login":"avigad","id":2783534,"avatar_url":"https://avatars.githubusercontent.com/u/2783534?v=3","gravatar_id":"","url":"https://api.github.com/users/avigad","html_url":"https://github.com/avigad","followers_url":"https://api.github.com/users/avigad/followers","following_url":"https://api.github.com/users/avigad/following{/other_user}","gists_url":"https://api.github.com/users/avigad/gists{/gist_id}","starred_url":"https://api.github.com/users/avigad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avigad/subscriptions","organizations_url":"https://api.github.com/users/avigad/orgs","repos_url":"https://api.github.com/users/avigad/repos","events_url":"https://api.github.com/users/avigad/events{/privacy}","received_events_url":"https://api.github.com/users/avigad/received_events","type":"User","site_admin":false},"created_at":"2015-06-29T11:21:00Z","updated_at":"2015-06-29T11:21:00Z","body":"\r\nI moved the coercion `int.of_nat` inside the `int` namespace. Absolutely nothing at all in the library broke when I did that, so I just added it to the pull request that is pending.\r\n\r\nI started to migrate the theorems in `fin (succ n)`, and then realized that there is a problem: `fin (succ n)` depends on the parameter `n`. The `migrate` command can't handle that yet, can it?"}}