Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(algebra/pi_instances): improve definitions of
pi.*
(#3116)
The new `test/pi_simp.lean` fails with current `master`. Note that this is a workaround, not a proper fix for `tactic.pi_instance`. See also [Zulip chat](https://leanprover.zulipchat.com/#narrow/stream/113488-general/topic/.60id.60.20in.20pi_instances) Also use `@[to_additive]` to generate additive definitions, add ordered multiplicative monoids, and add `semimodule (Π i, f i) (Π, g i)`.
- Loading branch information
Showing
4 changed files
with
134 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/- | ||
Copyright (c) 2020 Yury G. Kudryashov. All rights reserved. | ||
Released under Apache 2.0 license as described in the file LICENSE. | ||
Author: Yury G. Kudryashov | ||
-/ | ||
import algebra.pi_instances | ||
|
||
/-! | ||
Test if `simp` can use a lemma about `pi.has_one` to simplify `1` coming from `pi.group` | ||
-/ | ||
|
||
variables {I : Type*} {f : Π i : I, Type*} | ||
|
||
namespace test | ||
|
||
def eval_default [inhabited I] (F : Π i, f i) : f (default I) := F (default I) | ||
|
||
@[simp] lemma eval_default_one [inhabited I] [Π i, has_one (f i)] : | ||
eval_default (1 : Π i, f i) = 1 := rfl | ||
|
||
example [inhabited I] [Π i, group (f i)] (F : Π i, f i) : eval_default (F⁻¹ * F) = 1 := by simp | ||
|
||
end test |