-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBasic.lean
More file actions
59 lines (41 loc) · 1.8 KB
/
Basic.lean
File metadata and controls
59 lines (41 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import Lott.Data.Range
import Lott.Elab.Nat
import TabularTypes.Data.List
import TabularTypes.Elab.Permutation
import TabularTypes.«F⊗⊕ω».Syntax.Term
import TabularTypes.Syntax.Basic
import TabularTypes.Syntax.Type
namespace TabularTypes
termonly
instance : Coe TypeVarId «F⊗⊕ω».TypeVarId where coe a := a
termonly
instance : Coe TypeVarId «F⊗⊕ω».TypeVar where coe a := .free a
termonly
instance : Coe TermVarId «F⊗⊕ω».TermVarId where coe x := x
termonly
instance : Coe TermVarId «F⊗⊕ω».TermVar where coe x := .free x
syntax (name := elabRelatedJudgement) "elab_related " Lott.Judgement : Lott.Judgement
@[macro Lott.judgementEmbed]
private
def elabRelatedJudgementImpl : Lean.Macro := fun stx => do
let `([[elab_related $j:Lott.Judgement]]) := stx | Lean.Macro.throwUnsupported
``([[$j:Lott.Judgement]])
@[lott_tex_elab elabRelatedJudgement]
private
def elabRelatedJudgementTexElab : Lott.TexElab := fun profile ref stx => do
let `(Lott.Judgement| elab_related $j:Lott.Judgement) := stx | Lean.Elab.throwUnsupportedSyntax
let jTex ← Lott.texElabSymbolOrJudgement j.raw.getKind profile ref j
return s!"\\elabrelated\{{jTex}}"
judgement_syntax a " ≠ " a' : TypeVarNe (id a, a')
judgement TypeVarNe := Ne (α := TypeVarId)
judgement_syntax x " ≠ " x' : TermVarNe (id x, x')
judgement TermVarNe := Ne (α := TermVarId)
run_cmd Lott.addNatAlias `k
run_cmd Lott.addNatAlias `l
run_cmd Lott.addNatAlias `o
instance {α β : Type} {γ : (α → β) → Prop } : CoeFun { a : α → β // γ a } (fun _ => α → β) where
coe := Subtype.val
judgement_syntax p_ " permutes " "[" ":" n "]" : Permutes
judgement Permutes := fun p n => List.Perm p [:n].toList
end TabularTypes
judgement_syntax TabularTypes.p_ " inverts " TabularTypes.p_' " on " "[" ":" n "]" : Std.Range.get!InverseOn