Zulip Chat Archive
Stream: general
Topic: how to prove fintype of enumeration
Thorsten Altenkirch (Jan 28 2023 at 17:27):
Is there a tactic to prove:
Thorsten Altenkirch (Jan 28 2023 at 17:27):
inductive Sigma1 : Type
| a b c : Sigma1
def isFin1 : fintype Sigma1 := sorry
Johan Commelin (Jan 28 2023 at 17:41):
I assume you want it to be computable?
Kevin Buzzard (Jan 28 2023 at 17:42):
Just to be clear, you really want this to be some recursive type?
#check Sigma1.a -- Sigma1.a : Sigma1 → Sigma1 → Sigma1
I suspect Sigma1 is empty.
Kevin Buzzard (Jan 28 2023 at 17:43):
def foo : Sigma1 → false
| ⟨b, c⟩ := foo b
Kevin Buzzard (Jan 28 2023 at 17:44):
In case this is what you meant:
import tactic
@[derive fintype]
inductive Sigma1 : Type
| a : Sigma1
| b : Sigma1
| c : Sigma1
def isFin1 : fintype Sigma1 := infer_instance
Thorsten Altenkirch (Jan 28 2023 at 17:47):
I thought I changed this on zulip, sorry.
Thorsten Altenkirch (Jan 28 2023 at 17:49):
Ok, thank you!
Thorsten Altenkirch (Jan 28 2023 at 17:52):
Btw, I am defining :
- an alphabet Sigma is a finite type
- a word over Sigma is a list over Sigma
- a language is a set of words, i.e. word Sigma -> Prop
what is the best way to do this?
section basics
variable Sigma : Type
-- the empty work ε
@[reducible]
def word : Type := list Sigma
def epsilon : word Sigma := []
@[reducible]
def lang : Type := word Sigma → Prop
end basics
But I never mention that Sigma has to be finite?
Thorsten Altenkirch (Jan 28 2023 at 17:53):
I guess I could define Alphabet as a record of a type with fintype?
Last updated: Dec 20 2023 at 11:08 UTC