{"action":"created","issue":{"url":"https://api.github.com/repos/leanprover/lean/issues/500","labels_url":"https://api.github.com/repos/leanprover/lean/issues/500/labels{/name}","comments_url":"https://api.github.com/repos/leanprover/lean/issues/500/comments","events_url":"https://api.github.com/repos/leanprover/lean/issues/500/events","html_url":"https://github.com/leanprover/lean/issues/500","id":64140932,"number":500,"title":"more tactics from Coq","user":{"login":"fpvandoorn","id":7376012,"avatar_url":"https://avatars.githubusercontent.com/u/7376012?v=3","gravatar_id":"","url":"https://api.github.com/users/fpvandoorn","html_url":"https://github.com/fpvandoorn","followers_url":"https://api.github.com/users/fpvandoorn/followers","following_url":"https://api.github.com/users/fpvandoorn/following{/other_user}","gists_url":"https://api.github.com/users/fpvandoorn/gists{/gist_id}","starred_url":"https://api.github.com/users/fpvandoorn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fpvandoorn/subscriptions","organizations_url":"https://api.github.com/users/fpvandoorn/orgs","repos_url":"https://api.github.com/users/fpvandoorn/repos","events_url":"https://api.github.com/users/fpvandoorn/events{/privacy}","received_events_url":"https://api.github.com/users/fpvandoorn/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/leanprover/lean/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":{"login":"leodemoura","id":2778936,"avatar_url":"https://avatars.githubusercontent.com/u/2778936?v=3","gravatar_id":"","url":"https://api.github.com/users/leodemoura","html_url":"https://github.com/leodemoura","followers_url":"https://api.github.com/users/leodemoura/followers","following_url":"https://api.github.com/users/leodemoura/following{/other_user}","gists_url":"https://api.github.com/users/leodemoura/gists{/gist_id}","starred_url":"https://api.github.com/users/leodemoura/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leodemoura/subscriptions","organizations_url":"https://api.github.com/users/leodemoura/orgs","repos_url":"https://api.github.com/users/leodemoura/repos","events_url":"https://api.github.com/users/leodemoura/events{/privacy}","received_events_url":"https://api.github.com/users/leodemoura/received_events","type":"User","site_admin":false},"milestone":null,"comments":19,"created_at":"2015-03-25T01:10:38Z","updated_at":"2015-05-02T20:03:26Z","closed_at":null,"body":"Today I looked over my Coq files from last year, and Coq has some tactics which are quite convenient, and probably not too hard to implement given what we already have. Here are the ones I consider most important (or which I expect to be easy to implement and which are still convenient).\r\nMore explanation can be found [here](https://coq.inria.fr/refman/Reference-Manual010.html).\r\n\r\n- [ ] `reflexivity`, `symmetry` and `transitivity t`: apply the corresponding theorem. This should at least work for equality, but maybe we can extend it to any relation where we've defined calc_refl/calc_symm/calc_trans. `transitivity t` changes to goal `s = r` to `s = t` and `t = r`.\r\n- [x] `f_equal`: If the goal is `f x y = f' x' y'`, produce new goals `f = f'`; `x = x'` and `y = y'`. Maybe only for nondependent functions, but of arbitrary arity. Perhaps already solve all goals provable by reflexivity.\r\n- [x] `contradiction`: does `intros` and then searches context for element of `false` or `empty` to solve goal\r\n- [x] `exfalso`: replace current goal by `false` (`empty` in HoTT)\r\n\r\n- [x] `constructor`: if the goal is an inductive definition, try to apply each constructor in order, until you find one which succeeds. This has the following useful variants:\r\n  - [x] `contructor n`: use the `n`th constructor\r\n  - [x] `split`: apply the unique constructor (for example if the goal is `A ∧ B`) \r\n  - [x] `exists t`: apply unique constructor with argument `t` (for example if the goal is `∃x, P x`, create new goal `P t` (we define `exists` inductively, right?))\r\n  - [x] `left`/`right`: apply first/second constructor if there are two constructors (for example if the goal is `A ∨ B`)\r\n\r\n- [x] `injection t`: if the type of `t` is `f x y = f x' y'` and `f` is the constructor of an (non-Prop) inductive type, replace conclusion `A` by `x = x' -> y = y' -> A`. Maybe it would also be nice (Coq doesn't do this): already introduce those new hypotheses to the context (with optional ability to name them) and if `t` is an hypothesis not occurring anywhere else, remove it.\r\n- [x] `discriminate t`: if the type of `t` is `f x y = g a b c`, where `f` and `g` are different constructors of the same inductive type, solve the goal. Maybe with variant `discriminate` which searches the context for any such equality.\r\n\r\n- [x] `subst`: for any hypothesis `H` of the form `x = t` or `t = x`, where `x` is a variable; replace `x` by `t` anywhere in the conclusion and hypotheses, and remove both `H` and `x` from the context. (Coq also has the variant `subst x` where this only happens for the single variable `x`, but I've never used that variant)"},"comment":{"url":"https://api.github.com/repos/leanprover/lean/issues/comments/98394841","html_url":"https://github.com/leanprover/lean/issues/500#issuecomment-98394841","issue_url":"https://api.github.com/repos/leanprover/lean/issues/500","id":98394841,"user":{"login":"leodemoura","id":2778936,"avatar_url":"https://avatars.githubusercontent.com/u/2778936?v=3","gravatar_id":"","url":"https://api.github.com/users/leodemoura","html_url":"https://github.com/leodemoura","followers_url":"https://api.github.com/users/leodemoura/followers","following_url":"https://api.github.com/users/leodemoura/following{/other_user}","gists_url":"https://api.github.com/users/leodemoura/gists{/gist_id}","starred_url":"https://api.github.com/users/leodemoura/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leodemoura/subscriptions","organizations_url":"https://api.github.com/users/leodemoura/orgs","repos_url":"https://api.github.com/users/leodemoura/repos","events_url":"https://api.github.com/users/leodemoura/events{/privacy}","received_events_url":"https://api.github.com/users/leodemoura/received_events","type":"User","site_admin":false},"created_at":"2015-05-02T20:03:26Z","updated_at":"2015-05-02T20:03:26Z","body":"`f_equal` is called `congruence` in lean"}}