Zulip Chat Archive
Stream: mathlib4
Topic: Fintype (alternatingGroup α)
Jeremy Tan (Apr 08 2023 at 14:44):
How do I synthesise the instance fta
given these imports?
import Mathlib.Algebra.Group.ConjFinite
import Mathlib.GroupTheory.Perm.Fin
import Mathlib.GroupTheory.Subgroup.Simple
import Mathlib.Tactic.IntervalCases
open Equiv Equiv.Perm Subgroup Fintype
variable (α : Type _) [Fintype α] [DecidableEq α]
def alternatingGroup : Subgroup (Perm α) :=
sign.ker deriving Fintype -- deriving Fintype doesn't work
instance fta : Fintype (alternatingGroup α) :=
fintypePerm (α := α) -- ???
Eric Wieser (Apr 08 2023 at 14:48):
deriving doesn't make sense there, since that's not a type in the first place
Eric Wieser (Apr 08 2023 at 14:49):
The second instance should be docs4#Subtype.fintype
Eric Wieser (Apr 08 2023 at 14:52):
The missing instance you probably need to add yourself is DecidablePred (∈ alternatingGroup α)
Eric Wieser (Apr 08 2023 at 14:52):
I would guess lean 3 just unfolded for you
Jeremy Tan (Apr 08 2023 at 14:56):
Eric Wieser said:
The missing instance you probably need to add yourself is
DecidablePred (∈ alternatingGroup α)
I'm not sure how that can be proved from the given variables
Jeremy Tan (Apr 08 2023 at 14:56):
It may in fact be false
Jeremy Tan (Apr 08 2023 at 15:03):
…wait, this seems to work
instance : DecidablePred fun x => x ∈ alternatingGroup α := MonoidHom.decidableMemKer sign
Eric Wieser (Apr 08 2023 at 15:21):
That's a pretty good indication that it's not false :)
Eric Wieser (Apr 08 2023 at 15:22):
fun x => x ∈ alternatingGroup α
can be written slightly more concisely as (\. ∈ alternatingGroup α)
Jeremy Tan (Apr 10 2023 at 12:43):
!4#3371 is as far as I could get on the relevant file
Jeremy Tan (Apr 10 2023 at 12:43):
@Eric Wieser would like to see if you can solve the 4 remaining errors
Jeremy Tan (Apr 10 2023 at 12:48):
The last error is particularly laughable; none of decide
, ring
, linarith
and aesop
can close what simplifies to (-1) ^ 5 != 1
!
Johan Commelin (Apr 10 2023 at 12:48):
What about norm_num
?
Johan Commelin (Apr 10 2023 at 12:48):
What is the type of these numbers?
Jeremy Tan (Apr 10 2023 at 13:09):
mathlib3 closes the proof of (-1) ^ (Multiset.sum {4} + ↑Multiset.card {4}) ≠ 1
using decide
@Johan Commelin
norm_num
also doesn't work, but leaves the goal as ¬(-1) ^ 5 = 1
where the -1
is of type ℤˣ
, the 5
is of type \N
and the RHS 1
is of type (fun x => ℤˣ) g
Johan Commelin (Apr 10 2023 at 13:19):
Does ext; simp
make some progress?
Johan Commelin (Apr 10 2023 at 13:19):
ext
should turn this into a goal about ℤ
as opposed to ℤˣ
.
Eric Wieser (Apr 10 2023 at 13:23):
Are we missing docs#units.decidable_eq? docs4#instUnitsDecidableEq ?
Eric Wieser (Apr 10 2023 at 13:24):
Hmm, docs4#Units.instDecidableEqUnits exists (though I hate that it's no longer easy to guess instance names)
Jeremy Tan (Apr 10 2023 at 13:25):
ext
doesn't work, it gives another error:
applyExtLemma only applies to equations, not
(-1) ^ 5 = 1 → False
Eric Wieser (Apr 10 2023 at 13:25):
Right, ext
doesn't work on ne
Eric Wieser (Apr 10 2023 at 13:25):
does rw [ne.def]
allow decide
to work?
Eric Wieser (Apr 10 2023 at 13:25):
Does decide
give any diagnostics when it fails?
Jeremy Tan (Apr 10 2023 at 13:26):
the original decide
gives the error message
expected type must not contain free or meta variables
(-1) ^ (Multiset.sum {4} + ↑Multiset.card {4}) ≠ 1
Yakov Pechersky (Apr 10 2023 at 13:35):
Jeremy Tan said:
ext
doesn't work, it gives another error:applyExtLemma only applies to equations, not (-1) ^ 5 = 1 → False
One can always use an explicit ext lemma like Subtype.ext_iff or Units.ext_iff
Eric Wieser (Apr 10 2023 at 13:35):
The decide
works if you put a dsimp only
before it. This looks like a bug in decide
.
Eric Wieser (Apr 10 2023 at 13:36):
ext
only works on =
not ≠
Matthew Ballard (Apr 10 2023 at 13:38):
simp only [Set.singleton_subset_iff, SetLike.mem_coe, ne_eq, mk_eq_one_iff]
also works
Yakov Pechersky (Apr 10 2023 at 13:38):
Right. I meant my message as an interpretation of Johan's message
Yakov Pechersky (Apr 10 2023 at 13:39):
simp [Something.ext_iff]
Jeremy Tan (Apr 10 2023 at 13:40):
Right, I pushed the dsimp only
fix
Eric Wieser (Apr 10 2023 at 13:43):
Matthew Ballard said:
simp only [Set.singleton_subset_iff, SetLike.mem_coe, ne_eq, mk_eq_one_iff]
also works
So does simp only
because that uses decide
under the hood, so here simp only
is essentially the same as dsimp only; decide
Jeremy Tan (Apr 10 2023 at 13:45):
I tested simp only
on Lean 4 Web, it doesn't work
Eric Wieser (Apr 10 2023 at 13:46):
It worked for me in your PR branch
Eric Wieser (Apr 10 2023 at 13:46):
Though there's an error higher up the same proof that might be causing trouble
Jeremy Tan (Apr 10 2023 at 14:18):
I actually don't know how to fill in the underscores here, which is the last remaining non-timeout error in the alternating group file
have h := SetLike.mem_coe.1 (@subset_normalClosure _ _ >_< _ (Set.mem_singleton _))
Jeremy Tan (Apr 10 2023 at 14:18):
It needs a Group
but I don't know which Group
is the right one
Eric Wieser (Apr 10 2023 at 14:28):
Looking at the type of h
in Lean 3 might help
Jeremy Tan (Apr 10 2023 at 14:39):
h
's type is h : ?m_3 ∈ normal_closure {?m_3}
, which I feel is totally unrelated to the existing term
Notification Bot (Apr 10 2023 at 14:39):
A message was moved here from #mathlib4 > lake exe cache get by Jeremy Tan.
Last updated: Dec 20 2023 at 11:08 UTC