url
stringclasses
147 values
commit
stringclasses
147 values
file_path
stringlengths
7
101
full_name
stringlengths
1
94
start
stringlengths
6
10
end
stringlengths
6
11
tactic
stringlengths
1
11.2k
state_before
stringlengths
3
2.09M
state_after
stringlengths
6
2.09M
input
stringlengths
73
2.09M
https://github.com/digama0/lean4lean.git
c534f13d8d25f5e1891b6d18cc76b601ee87aa66
Lean4Lean/Verify/LocalContext.lean
Lean4Lean.TrLCtx.fvars_eq
[56, 1]
[60, 42]
rfl
case nil env : VEnv Us : List Name lctx : LocalContext Δ : VLCtx ⊢ List.map (fun x => LocalDecl.fvarId x) (List.filterMap id (List.reverse (PersistentArray.toList' { fvarIdToDecl := PersistentHashMap.empty, decls := PersistentArray.empty }.decls))) = List.filterMap (fun x => x.fst) []
no goals
Please generate a tactic in lean4 to solve the state. STATE: case nil env : VEnv Us : List Name lctx : LocalContext Δ : VLCtx ⊢ List.map (fun x => LocalDecl.fvarId x) (List.filterMap id (List.reverse (PersistentArray.toList' { fvarIdToDecl := PersistentHashMap.empty, decls := PersistentArray.empty }.decls))) = List.filterMap (fun x => x.fst) [] TACTIC:
https://github.com/digama0/lean4lean.git
c534f13d8d25f5e1891b6d18cc76b601ee87aa66
Lean4Lean/Verify/LocalContext.lean
Lean4Lean.TrLCtx.fvars_eq
[56, 1]
[60, 42]
simp [h1, ← ih]
case cons env : VEnv Us : List Name lctx : LocalContext Δ : VLCtx fv✝ : FVarId map✝ : PersistentHashMap FVarId LocalDecl arr✝ : PersistentArray (Option LocalDecl) Δ✝ : VLCtx d✝ : LocalDecl d'✝ : VLocalDecl h1 : LocalDecl.fvarId d✝ = fv✝ a✝³ : PersistentHashMap.find? map✝ fv✝ = none a✝² : LocalDecl.index d✝ = arr✝.size a✝¹ : TrLCtx env Us { fvarIdToDecl := map✝, decls := arr✝ } Δ✝ a✝ : TrLocalDecl env Us Δ✝ d✝ d'✝ ih : List.map (fun x => LocalDecl.fvarId x) (List.filterMap id (List.reverse (PersistentArray.toList' { fvarIdToDecl := map✝, decls := arr✝ }.decls))) = List.filterMap (fun x => x.fst) Δ✝ ⊢ List.map (fun x => LocalDecl.fvarId x) (List.filterMap id (List.reverse (PersistentArray.toList' { fvarIdToDecl := PersistentHashMap.insert map✝ fv✝ d✝, decls := PersistentArray.push arr✝ (some d✝) }.decls))) = List.filterMap (fun x => x.fst) ((some fv✝, d'✝) :: Δ✝)
no goals
Please generate a tactic in lean4 to solve the state. STATE: case cons env : VEnv Us : List Name lctx : LocalContext Δ : VLCtx fv✝ : FVarId map✝ : PersistentHashMap FVarId LocalDecl arr✝ : PersistentArray (Option LocalDecl) Δ✝ : VLCtx d✝ : LocalDecl d'✝ : VLocalDecl h1 : LocalDecl.fvarId d✝ = fv✝ a✝³ : PersistentHashMap.find? map✝ fv✝ = none a✝² : LocalDecl.index d✝ = arr✝.size a✝¹ : TrLCtx env Us { fvarIdToDecl := map✝, decls := arr✝ } Δ✝ a✝ : TrLocalDecl env Us Δ✝ d✝ d'✝ ih : List.map (fun x => LocalDecl.fvarId x) (List.filterMap id (List.reverse (PersistentArray.toList' { fvarIdToDecl := map✝, decls := arr✝ }.decls))) = List.filterMap (fun x => x.fst) Δ✝ ⊢ List.map (fun x => LocalDecl.fvarId x) (List.filterMap id (List.reverse (PersistentArray.toList' { fvarIdToDecl := PersistentHashMap.insert map✝ fv✝ d✝, decls := PersistentArray.push arr✝ (some d✝) }.decls))) = List.filterMap (fun x => x.fst) ((some fv✝, d'✝) :: Δ✝) TACTIC:
https://github.com/digama0/lean4lean.git
c534f13d8d25f5e1891b6d18cc76b601ee87aa66
Lean4Lean/Verify/LocalContext.lean
Lean4Lean.TrLCtx.find?_isSome
[62, 1]
[72, 23]
rw [LocalContext.find?, H.map_wf.find?_eq, ← VLCtx.lookup_isSome, H.map_toList.lookup_eq H.map_wf.nodupKeys, List.map_fst_lookup]
env : VEnv Us : List Name lctx : LocalContext Δ : VLCtx fv : FVarId H : TrLCtx env Us lctx Δ ⊢ Option.isSome (LocalContext.find? lctx fv) = Option.isSome (VLCtx.find? Δ (Sum.inr fv))
env : VEnv Us : List Name lctx : LocalContext Δ : VLCtx fv : FVarId H : TrLCtx env Us lctx Δ ⊢ Option.isSome (List.find? (fun a => fv == LocalDecl.fvarId a) (LocalContext.toList lctx)) = Option.isSome (List.lookup (some fv) Δ)
Please generate a tactic in lean4 to solve the state. STATE: env : VEnv Us : List Name lctx : LocalContext Δ : VLCtx fv : FVarId H : TrLCtx env Us lctx Δ ⊢ Option.isSome (LocalContext.find? lctx fv) = Option.isSome (VLCtx.find? Δ (Sum.inr fv)) TACTIC:
https://github.com/digama0/lean4lean.git
c534f13d8d25f5e1891b6d18cc76b601ee87aa66
Lean4Lean/Verify/LocalContext.lean
Lean4Lean.TrLCtx.find?_isSome
[62, 1]
[72, 23]
have := H.forall₂
env : VEnv Us : List Name lctx : LocalContext Δ : VLCtx fv : FVarId H : TrLCtx env Us lctx Δ ⊢ Option.isSome (List.find? (fun a => fv == LocalDecl.fvarId a) (LocalContext.toList lctx)) = Option.isSome (List.lookup (some fv) Δ)
env : VEnv Us : List Name lctx : LocalContext Δ : VLCtx fv : FVarId H : TrLCtx env Us lctx Δ this : List.Forall₂ (fun d d' => d'.fst = some (LocalDecl.fvarId d)) (LocalContext.toList lctx) Δ ⊢ Option.isSome (List.find? (fun a => fv == LocalDecl.fvarId a) (LocalContext.toList lctx)) = Option.isSome (List.lookup (some fv) Δ)
Please generate a tactic in lean4 to solve the state. STATE: env : VEnv Us : List Name lctx : LocalContext Δ : VLCtx fv : FVarId H : TrLCtx env Us lctx Δ ⊢ Option.isSome (List.find? (fun a => fv == LocalDecl.fvarId a) (LocalContext.toList lctx)) = Option.isSome (List.lookup (some fv) Δ) TACTIC:
https://github.com/digama0/lean4lean.git
c534f13d8d25f5e1891b6d18cc76b601ee87aa66
Lean4Lean/Verify/LocalContext.lean
Lean4Lean.TrLCtx.find?_isSome
[62, 1]
[72, 23]
generalize lctx.toList = l at this ⊢
env : VEnv Us : List Name lctx : LocalContext Δ : VLCtx fv : FVarId H : TrLCtx env Us lctx Δ this : List.Forall₂ (fun d d' => d'.fst = some (LocalDecl.fvarId d)) (LocalContext.toList lctx) Δ ⊢ Option.isSome (List.find? (fun a => fv == LocalDecl.fvarId a) (LocalContext.toList lctx)) = Option.isSome (List.lookup (some fv) Δ)
env : VEnv Us : List Name lctx : LocalContext Δ : VLCtx fv : FVarId H : TrLCtx env Us lctx Δ l : List LocalDecl this : List.Forall₂ (fun d d' => d'.fst = some (LocalDecl.fvarId d)) l Δ ⊢ Option.isSome (List.find? (fun a => fv == LocalDecl.fvarId a) l) = Option.isSome (List.lookup (some fv) Δ)
Please generate a tactic in lean4 to solve the state. STATE: env : VEnv Us : List Name lctx : LocalContext Δ : VLCtx fv : FVarId H : TrLCtx env Us lctx Δ this : List.Forall₂ (fun d d' => d'.fst = some (LocalDecl.fvarId d)) (LocalContext.toList lctx) Δ ⊢ Option.isSome (List.find? (fun a => fv == LocalDecl.fvarId a) (LocalContext.toList lctx)) = Option.isSome (List.lookup (some fv) Δ) TACTIC:
https://github.com/digama0/lean4lean.git
c534f13d8d25f5e1891b6d18cc76b601ee87aa66
Lean4Lean/Verify/LocalContext.lean
Lean4Lean.TrLCtx.find?_isSome
[62, 1]
[72, 23]
clear H
env : VEnv Us : List Name lctx : LocalContext Δ : VLCtx fv : FVarId H : TrLCtx env Us lctx Δ l : List LocalDecl this : List.Forall₂ (fun d d' => d'.fst = some (LocalDecl.fvarId d)) l Δ ⊢ Option.isSome (List.find? (fun a => fv == LocalDecl.fvarId a) l) = Option.isSome (List.lookup (some fv) Δ)
env : VEnv Us : List Name lctx : LocalContext Δ : VLCtx fv : FVarId l : List LocalDecl this : List.Forall₂ (fun d d' => d'.fst = some (LocalDecl.fvarId d)) l Δ ⊢ Option.isSome (List.find? (fun a => fv == LocalDecl.fvarId a) l) = Option.isSome (List.lookup (some fv) Δ)
Please generate a tactic in lean4 to solve the state. STATE: env : VEnv Us : List Name lctx : LocalContext Δ : VLCtx fv : FVarId H : TrLCtx env Us lctx Δ l : List LocalDecl this : List.Forall₂ (fun d d' => d'.fst = some (LocalDecl.fvarId d)) l Δ ⊢ Option.isSome (List.find? (fun a => fv == LocalDecl.fvarId a) l) = Option.isSome (List.lookup (some fv) Δ) TACTIC:
https://github.com/digama0/lean4lean.git
c534f13d8d25f5e1891b6d18cc76b601ee87aa66
Lean4Lean/Verify/LocalContext.lean
Lean4Lean.TrLCtx.find?_isSome
[62, 1]
[72, 23]
induction this with | nil => rfl | @cons d d' _ _ eq _ ih => cases d'; cases eq simp [List.find?, List.lookup, show (some fv == some d.fvarId) = (fv == d.fvarId) from rfl] split <;> simp [*]
env : VEnv Us : List Name lctx : LocalContext Δ : VLCtx fv : FVarId l : List LocalDecl this : List.Forall₂ (fun d d' => d'.fst = some (LocalDecl.fvarId d)) l Δ ⊢ Option.isSome (List.find? (fun a => fv == LocalDecl.fvarId a) l) = Option.isSome (List.lookup (some fv) Δ)
no goals
Please generate a tactic in lean4 to solve the state. STATE: env : VEnv Us : List Name lctx : LocalContext Δ : VLCtx fv : FVarId l : List LocalDecl this : List.Forall₂ (fun d d' => d'.fst = some (LocalDecl.fvarId d)) l Δ ⊢ Option.isSome (List.find? (fun a => fv == LocalDecl.fvarId a) l) = Option.isSome (List.lookup (some fv) Δ) TACTIC:
https://github.com/digama0/lean4lean.git
c534f13d8d25f5e1891b6d18cc76b601ee87aa66
Lean4Lean/Verify/LocalContext.lean
Lean4Lean.TrLCtx.find?_isSome
[62, 1]
[72, 23]
rfl
case nil env : VEnv Us : List Name lctx : LocalContext Δ : VLCtx fv : FVarId l : List LocalDecl ⊢ Option.isSome (List.find? (fun a => fv == LocalDecl.fvarId a) []) = Option.isSome (List.lookup (some fv) [])
no goals
Please generate a tactic in lean4 to solve the state. STATE: case nil env : VEnv Us : List Name lctx : LocalContext Δ : VLCtx fv : FVarId l : List LocalDecl ⊢ Option.isSome (List.find? (fun a => fv == LocalDecl.fvarId a) []) = Option.isSome (List.lookup (some fv) []) TACTIC:
https://github.com/digama0/lean4lean.git
c534f13d8d25f5e1891b6d18cc76b601ee87aa66
Lean4Lean/Verify/LocalContext.lean
Lean4Lean.TrLCtx.find?_isSome
[62, 1]
[72, 23]
cases d'
case cons env : VEnv Us : List Name lctx : LocalContext Δ : VLCtx fv : FVarId l : List LocalDecl d : LocalDecl d' : Option FVarId × VLocalDecl l₁✝ : List LocalDecl l₂✝ : List (Option FVarId × VLocalDecl) eq : d'.fst = some (LocalDecl.fvarId d) a✝ : List.Forall₂ (fun d d' => d'.fst = some (LocalDecl.fvarId d)) l₁✝ l₂✝ ih : Option.isSome (List.find? (fun a => fv == LocalDecl.fvarId a) l₁✝) = Option.isSome (List.lookup (some fv) l₂✝) ⊢ Option.isSome (List.find? (fun a => fv == LocalDecl.fvarId a) (d :: l₁✝)) = Option.isSome (List.lookup (some fv) (d' :: l₂✝))
case cons.mk env : VEnv Us : List Name lctx : LocalContext Δ : VLCtx fv : FVarId l : List LocalDecl d : LocalDecl l₁✝ : List LocalDecl l₂✝ : List (Option FVarId × VLocalDecl) a✝ : List.Forall₂ (fun d d' => d'.fst = some (LocalDecl.fvarId d)) l₁✝ l₂✝ ih : Option.isSome (List.find? (fun a => fv == LocalDecl.fvarId a) l₁✝) = Option.isSome (List.lookup (some fv) l₂✝) fst✝ : Option FVarId snd✝ : VLocalDecl eq : (fst✝, snd✝).fst = some (LocalDecl.fvarId d) ⊢ Option.isSome (List.find? (fun a => fv == LocalDecl.fvarId a) (d :: l₁✝)) = Option.isSome (List.lookup (some fv) ((fst✝, snd✝) :: l₂✝))
Please generate a tactic in lean4 to solve the state. STATE: case cons env : VEnv Us : List Name lctx : LocalContext Δ : VLCtx fv : FVarId l : List LocalDecl d : LocalDecl d' : Option FVarId × VLocalDecl l₁✝ : List LocalDecl l₂✝ : List (Option FVarId × VLocalDecl) eq : d'.fst = some (LocalDecl.fvarId d) a✝ : List.Forall₂ (fun d d' => d'.fst = some (LocalDecl.fvarId d)) l₁✝ l₂✝ ih : Option.isSome (List.find? (fun a => fv == LocalDecl.fvarId a) l₁✝) = Option.isSome (List.lookup (some fv) l₂✝) ⊢ Option.isSome (List.find? (fun a => fv == LocalDecl.fvarId a) (d :: l₁✝)) = Option.isSome (List.lookup (some fv) (d' :: l₂✝)) TACTIC:
https://github.com/digama0/lean4lean.git
c534f13d8d25f5e1891b6d18cc76b601ee87aa66
Lean4Lean/Verify/LocalContext.lean
Lean4Lean.TrLCtx.find?_isSome
[62, 1]
[72, 23]
cases eq
case cons.mk env : VEnv Us : List Name lctx : LocalContext Δ : VLCtx fv : FVarId l : List LocalDecl d : LocalDecl l₁✝ : List LocalDecl l₂✝ : List (Option FVarId × VLocalDecl) a✝ : List.Forall₂ (fun d d' => d'.fst = some (LocalDecl.fvarId d)) l₁✝ l₂✝ ih : Option.isSome (List.find? (fun a => fv == LocalDecl.fvarId a) l₁✝) = Option.isSome (List.lookup (some fv) l₂✝) fst✝ : Option FVarId snd✝ : VLocalDecl eq : (fst✝, snd✝).fst = some (LocalDecl.fvarId d) ⊢ Option.isSome (List.find? (fun a => fv == LocalDecl.fvarId a) (d :: l₁✝)) = Option.isSome (List.lookup (some fv) ((fst✝, snd✝) :: l₂✝))
case cons.mk.refl env : VEnv Us : List Name lctx : LocalContext Δ : VLCtx fv : FVarId l : List LocalDecl d : LocalDecl l₁✝ : List LocalDecl l₂✝ : List (Option FVarId × VLocalDecl) a✝ : List.Forall₂ (fun d d' => d'.fst = some (LocalDecl.fvarId d)) l₁✝ l₂✝ ih : Option.isSome (List.find? (fun a => fv == LocalDecl.fvarId a) l₁✝) = Option.isSome (List.lookup (some fv) l₂✝) snd✝ : VLocalDecl ⊢ Option.isSome (List.find? (fun a => fv == LocalDecl.fvarId a) (d :: l₁✝)) = Option.isSome (List.lookup (some fv) ((some (LocalDecl.fvarId d), snd✝) :: l₂✝))
Please generate a tactic in lean4 to solve the state. STATE: case cons.mk env : VEnv Us : List Name lctx : LocalContext Δ : VLCtx fv : FVarId l : List LocalDecl d : LocalDecl l₁✝ : List LocalDecl l₂✝ : List (Option FVarId × VLocalDecl) a✝ : List.Forall₂ (fun d d' => d'.fst = some (LocalDecl.fvarId d)) l₁✝ l₂✝ ih : Option.isSome (List.find? (fun a => fv == LocalDecl.fvarId a) l₁✝) = Option.isSome (List.lookup (some fv) l₂✝) fst✝ : Option FVarId snd✝ : VLocalDecl eq : (fst✝, snd✝).fst = some (LocalDecl.fvarId d) ⊢ Option.isSome (List.find? (fun a => fv == LocalDecl.fvarId a) (d :: l₁✝)) = Option.isSome (List.lookup (some fv) ((fst✝, snd✝) :: l₂✝)) TACTIC:
https://github.com/digama0/lean4lean.git
c534f13d8d25f5e1891b6d18cc76b601ee87aa66
Lean4Lean/Verify/LocalContext.lean
Lean4Lean.TrLCtx.find?_isSome
[62, 1]
[72, 23]
simp [List.find?, List.lookup, show (some fv == some d.fvarId) = (fv == d.fvarId) from rfl]
case cons.mk.refl env : VEnv Us : List Name lctx : LocalContext Δ : VLCtx fv : FVarId l : List LocalDecl d : LocalDecl l₁✝ : List LocalDecl l₂✝ : List (Option FVarId × VLocalDecl) a✝ : List.Forall₂ (fun d d' => d'.fst = some (LocalDecl.fvarId d)) l₁✝ l₂✝ ih : Option.isSome (List.find? (fun a => fv == LocalDecl.fvarId a) l₁✝) = Option.isSome (List.lookup (some fv) l₂✝) snd✝ : VLocalDecl ⊢ Option.isSome (List.find? (fun a => fv == LocalDecl.fvarId a) (d :: l₁✝)) = Option.isSome (List.lookup (some fv) ((some (LocalDecl.fvarId d), snd✝) :: l₂✝))
case cons.mk.refl env : VEnv Us : List Name lctx : LocalContext Δ : VLCtx fv : FVarId l : List LocalDecl d : LocalDecl l₁✝ : List LocalDecl l₂✝ : List (Option FVarId × VLocalDecl) a✝ : List.Forall₂ (fun d d' => d'.fst = some (LocalDecl.fvarId d)) l₁✝ l₂✝ ih : Option.isSome (List.find? (fun a => fv == LocalDecl.fvarId a) l₁✝) = Option.isSome (List.lookup (some fv) l₂✝) snd✝ : VLocalDecl ⊢ Option.isSome (match fv == LocalDecl.fvarId d with | true => some d | false => List.find? (fun a => fv == LocalDecl.fvarId a) l₁✝) = Option.isSome (match fv == LocalDecl.fvarId d with | true => some snd✝ | false => List.lookup (some fv) l₂✝)
Please generate a tactic in lean4 to solve the state. STATE: case cons.mk.refl env : VEnv Us : List Name lctx : LocalContext Δ : VLCtx fv : FVarId l : List LocalDecl d : LocalDecl l₁✝ : List LocalDecl l₂✝ : List (Option FVarId × VLocalDecl) a✝ : List.Forall₂ (fun d d' => d'.fst = some (LocalDecl.fvarId d)) l₁✝ l₂✝ ih : Option.isSome (List.find? (fun a => fv == LocalDecl.fvarId a) l₁✝) = Option.isSome (List.lookup (some fv) l₂✝) snd✝ : VLocalDecl ⊢ Option.isSome (List.find? (fun a => fv == LocalDecl.fvarId a) (d :: l₁✝)) = Option.isSome (List.lookup (some fv) ((some (LocalDecl.fvarId d), snd✝) :: l₂✝)) TACTIC:
https://github.com/digama0/lean4lean.git
c534f13d8d25f5e1891b6d18cc76b601ee87aa66
Lean4Lean/Verify/LocalContext.lean
Lean4Lean.TrLCtx.find?_isSome
[62, 1]
[72, 23]
split <;> simp [*]
case cons.mk.refl env : VEnv Us : List Name lctx : LocalContext Δ : VLCtx fv : FVarId l : List LocalDecl d : LocalDecl l₁✝ : List LocalDecl l₂✝ : List (Option FVarId × VLocalDecl) a✝ : List.Forall₂ (fun d d' => d'.fst = some (LocalDecl.fvarId d)) l₁✝ l₂✝ ih : Option.isSome (List.find? (fun a => fv == LocalDecl.fvarId a) l₁✝) = Option.isSome (List.lookup (some fv) l₂✝) snd✝ : VLocalDecl ⊢ Option.isSome (match fv == LocalDecl.fvarId d with | true => some d | false => List.find? (fun a => fv == LocalDecl.fvarId a) l₁✝) = Option.isSome (match fv == LocalDecl.fvarId d with | true => some snd✝ | false => List.lookup (some fv) l₂✝)
no goals
Please generate a tactic in lean4 to solve the state. STATE: case cons.mk.refl env : VEnv Us : List Name lctx : LocalContext Δ : VLCtx fv : FVarId l : List LocalDecl d : LocalDecl l₁✝ : List LocalDecl l₂✝ : List (Option FVarId × VLocalDecl) a✝ : List.Forall₂ (fun d d' => d'.fst = some (LocalDecl.fvarId d)) l₁✝ l₂✝ ih : Option.isSome (List.find? (fun a => fv == LocalDecl.fvarId a) l₁✝) = Option.isSome (List.lookup (some fv) l₂✝) snd✝ : VLocalDecl ⊢ Option.isSome (match fv == LocalDecl.fvarId d with | true => some d | false => List.find? (fun a => fv == LocalDecl.fvarId a) l₁✝) = Option.isSome (match fv == LocalDecl.fvarId d with | true => some snd✝ | false => List.lookup (some fv) l₂✝) TACTIC:
https://github.com/digama0/lean4lean.git
c534f13d8d25f5e1891b6d18cc76b601ee87aa66
Lean4Lean/Verify/LocalContext.lean
Lean4Lean.TrLCtx.find?_eq_some
[74, 1]
[76, 97]
rw [← Option.isSome_iff_exists, H.find?_isSome, Option.isSome_iff_exists, VLCtx.find?_eq_some]
env : VEnv Us : List Name lctx : LocalContext Δ : VLCtx fv : FVarId H : TrLCtx env Us lctx Δ ⊢ (∃ d, LocalContext.find? lctx fv = some d) ↔ fv ∈ VLCtx.fvars Δ
no goals
Please generate a tactic in lean4 to solve the state. STATE: env : VEnv Us : List Name lctx : LocalContext Δ : VLCtx fv : FVarId H : TrLCtx env Us lctx Δ ⊢ (∃ d, LocalContext.find? lctx fv = some d) ↔ fv ∈ VLCtx.fvars Δ TACTIC:
https://github.com/digama0/lean4lean.git
c534f13d8d25f5e1891b6d18cc76b601ee87aa66
Lean4Lean/Verify/LocalContext.lean
Lean4Lean.TrLCtx.contains
[78, 1]
[80, 24]
rw [LocalContext.contains, PersistentHashMap.find?_isSome, Option.isSome_iff_exists]
env : VEnv Us : List Name lctx : LocalContext Δ : VLCtx fv : FVarId H : TrLCtx env Us lctx Δ ⊢ LocalContext.contains lctx fv = true ↔ fv ∈ VLCtx.fvars Δ
env : VEnv Us : List Name lctx : LocalContext Δ : VLCtx fv : FVarId H : TrLCtx env Us lctx Δ ⊢ (∃ a, PersistentHashMap.find? lctx.fvarIdToDecl fv = some a) ↔ fv ∈ VLCtx.fvars Δ
Please generate a tactic in lean4 to solve the state. STATE: env : VEnv Us : List Name lctx : LocalContext Δ : VLCtx fv : FVarId H : TrLCtx env Us lctx Δ ⊢ LocalContext.contains lctx fv = true ↔ fv ∈ VLCtx.fvars Δ TACTIC:
https://github.com/digama0/lean4lean.git
c534f13d8d25f5e1891b6d18cc76b601ee87aa66
Lean4Lean/Verify/LocalContext.lean
Lean4Lean.TrLCtx.contains
[78, 1]
[80, 24]
exact H.find?_eq_some
env : VEnv Us : List Name lctx : LocalContext Δ : VLCtx fv : FVarId H : TrLCtx env Us lctx Δ ⊢ (∃ a, PersistentHashMap.find? lctx.fvarIdToDecl fv = some a) ↔ fv ∈ VLCtx.fvars Δ
no goals
Please generate a tactic in lean4 to solve the state. STATE: env : VEnv Us : List Name lctx : LocalContext Δ : VLCtx fv : FVarId H : TrLCtx env Us lctx Δ ⊢ (∃ a, PersistentHashMap.find? lctx.fvarIdToDecl fv = some a) ↔ fv ∈ VLCtx.fvars Δ TACTIC:
https://github.com/digama0/lean4lean.git
c534f13d8d25f5e1891b6d18cc76b601ee87aa66
Lean4Lean/Verify/LocalContext.lean
Lean4Lean.TrLCtx.wf
[82, 1]
[84, 72]
simpa [← h4.find?_eq_some]
env : VEnv Us : List Name lctx : LocalContext Δ : VLCtx fv✝ : FVarId map✝ : PersistentHashMap FVarId LocalDecl arr✝ : PersistentArray (Option LocalDecl) Δ✝ : VLCtx d✝ : LocalDecl d'✝ : VLocalDecl a✝¹ : LocalDecl.fvarId d✝ = fv✝ h2 : PersistentHashMap.find? map✝ fv✝ = none a✝ : LocalDecl.index d✝ = arr✝.size h4 : TrLCtx env Us { fvarIdToDecl := map✝, decls := arr✝ } Δ✝ h5 : TrLocalDecl env Us Δ✝ d✝ d'✝ ⊢ ∀ (fv : FVarId), some fv✝ = some fv → ¬fv ∈ VLCtx.fvars Δ✝
no goals
Please generate a tactic in lean4 to solve the state. STATE: env : VEnv Us : List Name lctx : LocalContext Δ : VLCtx fv✝ : FVarId map✝ : PersistentHashMap FVarId LocalDecl arr✝ : PersistentArray (Option LocalDecl) Δ✝ : VLCtx d✝ : LocalDecl d'✝ : VLocalDecl a✝¹ : LocalDecl.fvarId d✝ = fv✝ h2 : PersistentHashMap.find? map✝ fv✝ = none a✝ : LocalDecl.index d✝ = arr✝.size h4 : TrLCtx env Us { fvarIdToDecl := map✝, decls := arr✝ } Δ✝ h5 : TrLocalDecl env Us Δ✝ d✝ d'✝ ⊢ ∀ (fv : FVarId), some fv✝ = some fv → ¬fv ∈ VLCtx.fvars Δ✝ TACTIC:
https://github.com/digama0/lean4lean.git
c534f13d8d25f5e1891b6d18cc76b601ee87aa66
Lean4Lean/Verify/Typing/ConditionallyTyped.lean
Lean4Lean.ConditionallyTyped.weakN_inv
[14, 1]
[20, 74]
refine H.imp_right fun H1 H2 => ?_
env : VEnv fv : FVarId d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some fv, d) :: Δ) H : ConditionallyTyped ngen env Us ((some fv, d) :: Δ) e ⊢ ConditionallyTyped ngen env Us Δ e
env : VEnv fv : FVarId d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some fv, d) :: Δ) H : ConditionallyTyped ngen env Us ((some fv, d) :: Δ) e H1 : InScope (fun x => x ∈ VLCtx.fvars ((some fv, d) :: Δ)) e → ∃ e', TrExpr env Us ((some fv, d) :: Δ) e e' H2 : InScope (fun x => x ∈ VLCtx.fvars Δ) e ⊢ ∃ e', TrExpr env Us Δ e e'
Please generate a tactic in lean4 to solve the state. STATE: env : VEnv fv : FVarId d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some fv, d) :: Δ) H : ConditionallyTyped ngen env Us ((some fv, d) :: Δ) e ⊢ ConditionallyTyped ngen env Us Δ e TACTIC:
https://github.com/digama0/lean4lean.git
c534f13d8d25f5e1891b6d18cc76b601ee87aa66
Lean4Lean/Verify/Typing/ConditionallyTyped.lean
Lean4Lean.ConditionallyTyped.weakN_inv
[14, 1]
[20, 74]
have ⟨e', H⟩ := H1 H2.fvars_cons
env : VEnv fv : FVarId d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some fv, d) :: Δ) H : ConditionallyTyped ngen env Us ((some fv, d) :: Δ) e H1 : InScope (fun x => x ∈ VLCtx.fvars ((some fv, d) :: Δ)) e → ∃ e', TrExpr env Us ((some fv, d) :: Δ) e e' H2 : InScope (fun x => x ∈ VLCtx.fvars Δ) e ⊢ ∃ e', TrExpr env Us Δ e e'
env : VEnv fv : FVarId d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some fv, d) :: Δ) H✝ : ConditionallyTyped ngen env Us ((some fv, d) :: Δ) e H1 : InScope (fun x => x ∈ VLCtx.fvars ((some fv, d) :: Δ)) e → ∃ e', TrExpr env Us ((some fv, d) :: Δ) e e' H2 : InScope (fun x => x ∈ VLCtx.fvars Δ) e e' : VExpr H : TrExpr env Us ((some fv, d) :: Δ) e e' ⊢ ∃ e', TrExpr env Us Δ e e'
Please generate a tactic in lean4 to solve the state. STATE: env : VEnv fv : FVarId d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some fv, d) :: Δ) H : ConditionallyTyped ngen env Us ((some fv, d) :: Δ) e H1 : InScope (fun x => x ∈ VLCtx.fvars ((some fv, d) :: Δ)) e → ∃ e', TrExpr env Us ((some fv, d) :: Δ) e e' H2 : InScope (fun x => x ∈ VLCtx.fvars Δ) e ⊢ ∃ e', TrExpr env Us Δ e e' TACTIC:
https://github.com/digama0/lean4lean.git
c534f13d8d25f5e1891b6d18cc76b601ee87aa66
Lean4Lean/Verify/Typing/ConditionallyTyped.lean
Lean4Lean.ConditionallyTyped.weakN_inv
[14, 1]
[20, 74]
exact TrExpr.weakN_inv henv (.skip_fvar _ _ .refl) (.refl henv hΔ) H H2
env : VEnv fv : FVarId d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some fv, d) :: Δ) H✝ : ConditionallyTyped ngen env Us ((some fv, d) :: Δ) e H1 : InScope (fun x => x ∈ VLCtx.fvars ((some fv, d) :: Δ)) e → ∃ e', TrExpr env Us ((some fv, d) :: Δ) e e' H2 : InScope (fun x => x ∈ VLCtx.fvars Δ) e e' : VExpr H : TrExpr env Us ((some fv, d) :: Δ) e e' ⊢ ∃ e', TrExpr env Us Δ e e'
no goals
Please generate a tactic in lean4 to solve the state. STATE: env : VEnv fv : FVarId d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some fv, d) :: Δ) H✝ : ConditionallyTyped ngen env Us ((some fv, d) :: Δ) e H1 : InScope (fun x => x ∈ VLCtx.fvars ((some fv, d) :: Δ)) e → ∃ e', TrExpr env Us ((some fv, d) :: Δ) e e' H2 : InScope (fun x => x ∈ VLCtx.fvars Δ) e e' : VExpr H : TrExpr env Us ((some fv, d) :: Δ) e e' ⊢ ∃ e', TrExpr env Us Δ e e' TACTIC:
https://github.com/digama0/lean4lean.git
c534f13d8d25f5e1891b6d18cc76b601ee87aa66
Lean4Lean/Verify/Typing/ConditionallyTyped.lean
Lean4Lean.ConditionallyTyped.fresh
[22, 1]
[30, 13]
refine have ⟨H1, H2⟩ := H; ⟨H1, fun H3 => ?_⟩
env : VEnv d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some { name := NameGenerator.curr ngen }, d) :: Δ) H : ConditionallyTyped ngen env Us Δ e ⊢ ConditionallyTyped ngen env Us ((some { name := NameGenerator.curr ngen }, d) :: Δ) e
env : VEnv d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some { name := NameGenerator.curr ngen }, d) :: Δ) H : ConditionallyTyped ngen env Us Δ e H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (fun x => x ∈ VLCtx.fvars Δ) e → ∃ e', TrExpr env Us Δ e e' H3 : InScope (fun x => x ∈ VLCtx.fvars ((some { name := NameGenerator.curr ngen }, d) :: Δ)) e ⊢ ∃ e', TrExpr env Us ((some { name := NameGenerator.curr ngen }, d) :: Δ) e e'
Please generate a tactic in lean4 to solve the state. STATE: env : VEnv d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some { name := NameGenerator.curr ngen }, d) :: Δ) H : ConditionallyTyped ngen env Us Δ e ⊢ ConditionallyTyped ngen env Us ((some { name := NameGenerator.curr ngen }, d) :: Δ) e TACTIC:
https://github.com/digama0/lean4lean.git
c534f13d8d25f5e1891b6d18cc76b601ee87aa66
Lean4Lean/Verify/Typing/ConditionallyTyped.lean
Lean4Lean.ConditionallyTyped.fresh
[22, 1]
[30, 13]
refine have ⟨_, h⟩ := H2 (H3.mp ?_ H1); ⟨_, h.weakN henv (.skip_fvar _ _ .refl) hΔ⟩
env : VEnv d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some { name := NameGenerator.curr ngen }, d) :: Δ) H : ConditionallyTyped ngen env Us Δ e H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (fun x => x ∈ VLCtx.fvars Δ) e → ∃ e', TrExpr env Us Δ e e' H3 : InScope (fun x => x ∈ VLCtx.fvars ((some { name := NameGenerator.curr ngen }, d) :: Δ)) e ⊢ ∃ e', TrExpr env Us ((some { name := NameGenerator.curr ngen }, d) :: Δ) e e'
env : VEnv d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some { name := NameGenerator.curr ngen }, d) :: Δ) H : ConditionallyTyped ngen env Us Δ e H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (fun x => x ∈ VLCtx.fvars Δ) e → ∃ e', TrExpr env Us Δ e e' H3 : InScope (fun x => x ∈ VLCtx.fvars ((some { name := NameGenerator.curr ngen }, d) :: Δ)) e ⊢ ∀ (fv : FVarId), fv ∈ VLCtx.fvars ((some { name := NameGenerator.curr ngen }, d) :: Δ) → NameGenerator.Reserves ngen fv → fv ∈ VLCtx.fvars Δ
Please generate a tactic in lean4 to solve the state. STATE: env : VEnv d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some { name := NameGenerator.curr ngen }, d) :: Δ) H : ConditionallyTyped ngen env Us Δ e H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (fun x => x ∈ VLCtx.fvars Δ) e → ∃ e', TrExpr env Us Δ e e' H3 : InScope (fun x => x ∈ VLCtx.fvars ((some { name := NameGenerator.curr ngen }, d) :: Δ)) e ⊢ ∃ e', TrExpr env Us ((some { name := NameGenerator.curr ngen }, d) :: Δ) e e' TACTIC:
https://github.com/digama0/lean4lean.git
c534f13d8d25f5e1891b6d18cc76b601ee87aa66
Lean4Lean/Verify/Typing/ConditionallyTyped.lean
Lean4Lean.ConditionallyTyped.fresh
[22, 1]
[30, 13]
intro _ h1 h2
env : VEnv d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some { name := NameGenerator.curr ngen }, d) :: Δ) H : ConditionallyTyped ngen env Us Δ e H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (fun x => x ∈ VLCtx.fvars Δ) e → ∃ e', TrExpr env Us Δ e e' H3 : InScope (fun x => x ∈ VLCtx.fvars ((some { name := NameGenerator.curr ngen }, d) :: Δ)) e ⊢ ∀ (fv : FVarId), fv ∈ VLCtx.fvars ((some { name := NameGenerator.curr ngen }, d) :: Δ) → NameGenerator.Reserves ngen fv → fv ∈ VLCtx.fvars Δ
env : VEnv d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some { name := NameGenerator.curr ngen }, d) :: Δ) H : ConditionallyTyped ngen env Us Δ e H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (fun x => x ∈ VLCtx.fvars Δ) e → ∃ e', TrExpr env Us Δ e e' H3 : InScope (fun x => x ∈ VLCtx.fvars ((some { name := NameGenerator.curr ngen }, d) :: Δ)) e fv✝ : FVarId h1 : fv✝ ∈ VLCtx.fvars ((some { name := NameGenerator.curr ngen }, d) :: Δ) h2 : NameGenerator.Reserves ngen fv✝ ⊢ fv✝ ∈ VLCtx.fvars Δ
Please generate a tactic in lean4 to solve the state. STATE: env : VEnv d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some { name := NameGenerator.curr ngen }, d) :: Δ) H : ConditionallyTyped ngen env Us Δ e H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (fun x => x ∈ VLCtx.fvars Δ) e → ∃ e', TrExpr env Us Δ e e' H3 : InScope (fun x => x ∈ VLCtx.fvars ((some { name := NameGenerator.curr ngen }, d) :: Δ)) e ⊢ ∀ (fv : FVarId), fv ∈ VLCtx.fvars ((some { name := NameGenerator.curr ngen }, d) :: Δ) → NameGenerator.Reserves ngen fv → fv ∈ VLCtx.fvars Δ TACTIC:
https://github.com/digama0/lean4lean.git
c534f13d8d25f5e1891b6d18cc76b601ee87aa66
Lean4Lean/Verify/Typing/ConditionallyTyped.lean
Lean4Lean.ConditionallyTyped.fresh
[22, 1]
[30, 13]
simp at h1
env : VEnv d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some { name := NameGenerator.curr ngen }, d) :: Δ) H : ConditionallyTyped ngen env Us Δ e H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (fun x => x ∈ VLCtx.fvars Δ) e → ∃ e', TrExpr env Us Δ e e' H3 : InScope (fun x => x ∈ VLCtx.fvars ((some { name := NameGenerator.curr ngen }, d) :: Δ)) e fv✝ : FVarId h1 : fv✝ ∈ VLCtx.fvars ((some { name := NameGenerator.curr ngen }, d) :: Δ) h2 : NameGenerator.Reserves ngen fv✝ ⊢ fv✝ ∈ VLCtx.fvars Δ
env : VEnv d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some { name := NameGenerator.curr ngen }, d) :: Δ) H : ConditionallyTyped ngen env Us Δ e H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (fun x => x ∈ VLCtx.fvars Δ) e → ∃ e', TrExpr env Us Δ e e' H3 : InScope (fun x => x ∈ VLCtx.fvars ((some { name := NameGenerator.curr ngen }, d) :: Δ)) e fv✝ : FVarId h2 : NameGenerator.Reserves ngen fv✝ h1 : fv✝ = { name := NameGenerator.curr ngen } ∨ fv✝ ∈ VLCtx.fvars Δ ⊢ fv✝ ∈ VLCtx.fvars Δ
Please generate a tactic in lean4 to solve the state. STATE: env : VEnv d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some { name := NameGenerator.curr ngen }, d) :: Δ) H : ConditionallyTyped ngen env Us Δ e H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (fun x => x ∈ VLCtx.fvars Δ) e → ∃ e', TrExpr env Us Δ e e' H3 : InScope (fun x => x ∈ VLCtx.fvars ((some { name := NameGenerator.curr ngen }, d) :: Δ)) e fv✝ : FVarId h1 : fv✝ ∈ VLCtx.fvars ((some { name := NameGenerator.curr ngen }, d) :: Δ) h2 : NameGenerator.Reserves ngen fv✝ ⊢ fv✝ ∈ VLCtx.fvars Δ TACTIC:
https://github.com/digama0/lean4lean.git
c534f13d8d25f5e1891b6d18cc76b601ee87aa66
Lean4Lean/Verify/Typing/ConditionallyTyped.lean
Lean4Lean.ConditionallyTyped.fresh
[22, 1]
[30, 13]
rcases h1 with rfl | h1
env : VEnv d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some { name := NameGenerator.curr ngen }, d) :: Δ) H : ConditionallyTyped ngen env Us Δ e H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (fun x => x ∈ VLCtx.fvars Δ) e → ∃ e', TrExpr env Us Δ e e' H3 : InScope (fun x => x ∈ VLCtx.fvars ((some { name := NameGenerator.curr ngen }, d) :: Δ)) e fv✝ : FVarId h2 : NameGenerator.Reserves ngen fv✝ h1 : fv✝ = { name := NameGenerator.curr ngen } ∨ fv✝ ∈ VLCtx.fvars Δ ⊢ fv✝ ∈ VLCtx.fvars Δ
case inl env : VEnv d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some { name := NameGenerator.curr ngen }, d) :: Δ) H : ConditionallyTyped ngen env Us Δ e H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (fun x => x ∈ VLCtx.fvars Δ) e → ∃ e', TrExpr env Us Δ e e' H3 : InScope (fun x => x ∈ VLCtx.fvars ((some { name := NameGenerator.curr ngen }, d) :: Δ)) e h2 : NameGenerator.Reserves ngen { name := NameGenerator.curr ngen } ⊢ { name := NameGenerator.curr ngen } ∈ VLCtx.fvars Δ case inr env : VEnv d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some { name := NameGenerator.curr ngen }, d) :: Δ) H : ConditionallyTyped ngen env Us Δ e H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (fun x => x ∈ VLCtx.fvars Δ) e → ∃ e', TrExpr env Us Δ e e' H3 : InScope (fun x => x ∈ VLCtx.fvars ((some { name := NameGenerator.curr ngen }, d) :: Δ)) e fv✝ : FVarId h2 : NameGenerator.Reserves ngen fv✝ h1 : fv✝ ∈ VLCtx.fvars Δ ⊢ fv✝ ∈ VLCtx.fvars Δ
Please generate a tactic in lean4 to solve the state. STATE: env : VEnv d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some { name := NameGenerator.curr ngen }, d) :: Δ) H : ConditionallyTyped ngen env Us Δ e H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (fun x => x ∈ VLCtx.fvars Δ) e → ∃ e', TrExpr env Us Δ e e' H3 : InScope (fun x => x ∈ VLCtx.fvars ((some { name := NameGenerator.curr ngen }, d) :: Δ)) e fv✝ : FVarId h2 : NameGenerator.Reserves ngen fv✝ h1 : fv✝ = { name := NameGenerator.curr ngen } ∨ fv✝ ∈ VLCtx.fvars Δ ⊢ fv✝ ∈ VLCtx.fvars Δ TACTIC:
https://github.com/digama0/lean4lean.git
c534f13d8d25f5e1891b6d18cc76b601ee87aa66
Lean4Lean/Verify/Typing/ConditionallyTyped.lean
Lean4Lean.ConditionallyTyped.fresh
[22, 1]
[30, 13]
cases Nat.lt_irrefl _ (h2 _ rfl)
case inl env : VEnv d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some { name := NameGenerator.curr ngen }, d) :: Δ) H : ConditionallyTyped ngen env Us Δ e H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (fun x => x ∈ VLCtx.fvars Δ) e → ∃ e', TrExpr env Us Δ e e' H3 : InScope (fun x => x ∈ VLCtx.fvars ((some { name := NameGenerator.curr ngen }, d) :: Δ)) e h2 : NameGenerator.Reserves ngen { name := NameGenerator.curr ngen } ⊢ { name := NameGenerator.curr ngen } ∈ VLCtx.fvars Δ
no goals
Please generate a tactic in lean4 to solve the state. STATE: case inl env : VEnv d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some { name := NameGenerator.curr ngen }, d) :: Δ) H : ConditionallyTyped ngen env Us Δ e H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (fun x => x ∈ VLCtx.fvars Δ) e → ∃ e', TrExpr env Us Δ e e' H3 : InScope (fun x => x ∈ VLCtx.fvars ((some { name := NameGenerator.curr ngen }, d) :: Δ)) e h2 : NameGenerator.Reserves ngen { name := NameGenerator.curr ngen } ⊢ { name := NameGenerator.curr ngen } ∈ VLCtx.fvars Δ TACTIC:
https://github.com/digama0/lean4lean.git
c534f13d8d25f5e1891b6d18cc76b601ee87aa66
Lean4Lean/Verify/Typing/ConditionallyTyped.lean
Lean4Lean.ConditionallyTyped.fresh
[22, 1]
[30, 13]
exact h1
case inr env : VEnv d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some { name := NameGenerator.curr ngen }, d) :: Δ) H : ConditionallyTyped ngen env Us Δ e H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (fun x => x ∈ VLCtx.fvars Δ) e → ∃ e', TrExpr env Us Δ e e' H3 : InScope (fun x => x ∈ VLCtx.fvars ((some { name := NameGenerator.curr ngen }, d) :: Δ)) e fv✝ : FVarId h2 : NameGenerator.Reserves ngen fv✝ h1 : fv✝ ∈ VLCtx.fvars Δ ⊢ fv✝ ∈ VLCtx.fvars Δ
no goals
Please generate a tactic in lean4 to solve the state. STATE: case inr env : VEnv d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some { name := NameGenerator.curr ngen }, d) :: Δ) H : ConditionallyTyped ngen env Us Δ e H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (fun x => x ∈ VLCtx.fvars Δ) e → ∃ e', TrExpr env Us Δ e e' H3 : InScope (fun x => x ∈ VLCtx.fvars ((some { name := NameGenerator.curr ngen }, d) :: Δ)) e fv✝ : FVarId h2 : NameGenerator.Reserves ngen fv✝ h1 : fv✝ ∈ VLCtx.fvars Δ ⊢ fv✝ ∈ VLCtx.fvars Δ TACTIC:
https://github.com/digama0/lean4lean.git
c534f13d8d25f5e1891b6d18cc76b601ee87aa66
Lean4Lean/Verify/Typing/ConditionallyTyped.lean
Lean4Lean.ConditionallyHasType.weakN_inv
[49, 1]
[67, 75]
have ⟨H1, H2, H3⟩ := H
env : VEnv fv : FVarId d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e A : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some fv, d) :: Δ) H : ConditionallyHasType ngen env Us ((some fv, d) :: Δ) e A ⊢ ConditionallyHasType ngen env Us Δ e A
env : VEnv fv : FVarId d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e A : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some fv, d) :: Δ) H : ConditionallyHasType ngen env Us ((some fv, d) :: Δ) e A H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (NameGenerator.Reserves ngen) A H3 : InScope (fun x => x ∈ VLCtx.fvars ((some fv, d) :: Δ)) e → TrHasType env Us ((some fv, d) :: Δ) e A ⊢ ConditionallyHasType ngen env Us Δ e A
Please generate a tactic in lean4 to solve the state. STATE: env : VEnv fv : FVarId d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e A : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some fv, d) :: Δ) H : ConditionallyHasType ngen env Us ((some fv, d) :: Δ) e A ⊢ ConditionallyHasType ngen env Us Δ e A TACTIC:
https://github.com/digama0/lean4lean.git
c534f13d8d25f5e1891b6d18cc76b601ee87aa66
Lean4Lean/Verify/Typing/ConditionallyTyped.lean
Lean4Lean.ConditionallyHasType.weakN_inv
[49, 1]
[67, 75]
refine ⟨H1, H2, fun H4 => ?_⟩
env : VEnv fv : FVarId d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e A : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some fv, d) :: Δ) H : ConditionallyHasType ngen env Us ((some fv, d) :: Δ) e A H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (NameGenerator.Reserves ngen) A H3 : InScope (fun x => x ∈ VLCtx.fvars ((some fv, d) :: Δ)) e → TrHasType env Us ((some fv, d) :: Δ) e A ⊢ ConditionallyHasType ngen env Us Δ e A
env : VEnv fv : FVarId d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e A : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some fv, d) :: Δ) H : ConditionallyHasType ngen env Us ((some fv, d) :: Δ) e A H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (NameGenerator.Reserves ngen) A H3 : InScope (fun x => x ∈ VLCtx.fvars ((some fv, d) :: Δ)) e → TrHasType env Us ((some fv, d) :: Δ) e A H4 : InScope (fun x => x ∈ VLCtx.fvars Δ) e ⊢ TrHasType env Us Δ e A
Please generate a tactic in lean4 to solve the state. STATE: env : VEnv fv : FVarId d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e A : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some fv, d) :: Δ) H : ConditionallyHasType ngen env Us ((some fv, d) :: Δ) e A H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (NameGenerator.Reserves ngen) A H3 : InScope (fun x => x ∈ VLCtx.fvars ((some fv, d) :: Δ)) e → TrHasType env Us ((some fv, d) :: Δ) e A ⊢ ConditionallyHasType ngen env Us Δ e A TACTIC:
https://github.com/digama0/lean4lean.git
c534f13d8d25f5e1891b6d18cc76b601ee87aa66
Lean4Lean/Verify/Typing/ConditionallyTyped.lean
Lean4Lean.ConditionallyHasType.weakN_inv
[49, 1]
[67, 75]
have ⟨h1, e', A', h2, h3, h4⟩ := H3 H4.fvars_cons
env : VEnv fv : FVarId d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e A : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some fv, d) :: Δ) H : ConditionallyHasType ngen env Us ((some fv, d) :: Δ) e A H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (NameGenerator.Reserves ngen) A H3 : InScope (fun x => x ∈ VLCtx.fvars ((some fv, d) :: Δ)) e → TrHasType env Us ((some fv, d) :: Δ) e A H4 : InScope (fun x => x ∈ VLCtx.fvars Δ) e ⊢ TrHasType env Us Δ e A
env : VEnv fv : FVarId d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e A : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some fv, d) :: Δ) H : ConditionallyHasType ngen env Us ((some fv, d) :: Δ) e A H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (NameGenerator.Reserves ngen) A H3 : InScope (fun x => x ∈ VLCtx.fvars ((some fv, d) :: Δ)) e → TrHasType env Us ((some fv, d) :: Δ) e A H4 : InScope (fun x => x ∈ VLCtx.fvars Δ) e h1 : ∀ (P : FVarId → Prop), IsFVarUpSet P ((some fv, d) :: Δ) → InScope P e → InScope P A e' A' : VExpr h2 : TrExpr env Us ((some fv, d) :: Δ) e e' h3 : TrExpr env Us ((some fv, d) :: Δ) A A' h4 : HasType env (List.length Us) (VLCtx.toCtx ((some fv, d) :: Δ)) e' A' ⊢ TrHasType env Us Δ e A
Please generate a tactic in lean4 to solve the state. STATE: env : VEnv fv : FVarId d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e A : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some fv, d) :: Δ) H : ConditionallyHasType ngen env Us ((some fv, d) :: Δ) e A H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (NameGenerator.Reserves ngen) A H3 : InScope (fun x => x ∈ VLCtx.fvars ((some fv, d) :: Δ)) e → TrHasType env Us ((some fv, d) :: Δ) e A H4 : InScope (fun x => x ∈ VLCtx.fvars Δ) e ⊢ TrHasType env Us Δ e A TACTIC:
https://github.com/digama0/lean4lean.git
c534f13d8d25f5e1891b6d18cc76b601ee87aa66
Lean4Lean/Verify/Typing/ConditionallyTyped.lean
Lean4Lean.ConditionallyHasType.weakN_inv
[49, 1]
[67, 75]
have W : VLCtx.LiftN Δ ((some fv, d) :: Δ) 0 (0 + d.depth) 0 := .skip_fvar _ _ .refl
env : VEnv fv : FVarId d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e A : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some fv, d) :: Δ) H : ConditionallyHasType ngen env Us ((some fv, d) :: Δ) e A H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (NameGenerator.Reserves ngen) A H3 : InScope (fun x => x ∈ VLCtx.fvars ((some fv, d) :: Δ)) e → TrHasType env Us ((some fv, d) :: Δ) e A H4 : InScope (fun x => x ∈ VLCtx.fvars Δ) e h1 : ∀ (P : FVarId → Prop), IsFVarUpSet P ((some fv, d) :: Δ) → InScope P e → InScope P A e' A' : VExpr h2 : TrExpr env Us ((some fv, d) :: Δ) e e' h3 : TrExpr env Us ((some fv, d) :: Δ) A A' h4 : HasType env (List.length Us) (VLCtx.toCtx ((some fv, d) :: Δ)) e' A' ⊢ TrHasType env Us Δ e A
env : VEnv fv : FVarId d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e A : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some fv, d) :: Δ) H : ConditionallyHasType ngen env Us ((some fv, d) :: Δ) e A H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (NameGenerator.Reserves ngen) A H3 : InScope (fun x => x ∈ VLCtx.fvars ((some fv, d) :: Δ)) e → TrHasType env Us ((some fv, d) :: Δ) e A H4 : InScope (fun x => x ∈ VLCtx.fvars Δ) e h1 : ∀ (P : FVarId → Prop), IsFVarUpSet P ((some fv, d) :: Δ) → InScope P e → InScope P A e' A' : VExpr h2 : TrExpr env Us ((some fv, d) :: Δ) e e' h3 : TrExpr env Us ((some fv, d) :: Δ) A A' h4 : HasType env (List.length Us) (VLCtx.toCtx ((some fv, d) :: Δ)) e' A' W : VLCtx.LiftN Δ ((some fv, d) :: Δ) 0 (0 + VLocalDecl.depth d) 0 ⊢ TrHasType env Us Δ e A
Please generate a tactic in lean4 to solve the state. STATE: env : VEnv fv : FVarId d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e A : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some fv, d) :: Δ) H : ConditionallyHasType ngen env Us ((some fv, d) :: Δ) e A H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (NameGenerator.Reserves ngen) A H3 : InScope (fun x => x ∈ VLCtx.fvars ((some fv, d) :: Δ)) e → TrHasType env Us ((some fv, d) :: Δ) e A H4 : InScope (fun x => x ∈ VLCtx.fvars Δ) e h1 : ∀ (P : FVarId → Prop), IsFVarUpSet P ((some fv, d) :: Δ) → InScope P e → InScope P A e' A' : VExpr h2 : TrExpr env Us ((some fv, d) :: Δ) e e' h3 : TrExpr env Us ((some fv, d) :: Δ) A A' h4 : HasType env (List.length Us) (VLCtx.toCtx ((some fv, d) :: Δ)) e' A' ⊢ TrHasType env Us Δ e A TACTIC:
https://github.com/digama0/lean4lean.git
c534f13d8d25f5e1891b6d18cc76b601ee87aa66
Lean4Lean/Verify/Typing/ConditionallyTyped.lean
Lean4Lean.ConditionallyHasType.weakN_inv
[49, 1]
[67, 75]
have ⟨e'', he⟩ := TrExpr.weakN_inv henv W (.refl henv hΔ) h2 H4
env : VEnv fv : FVarId d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e A : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some fv, d) :: Δ) H : ConditionallyHasType ngen env Us ((some fv, d) :: Δ) e A H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (NameGenerator.Reserves ngen) A H3 : InScope (fun x => x ∈ VLCtx.fvars ((some fv, d) :: Δ)) e → TrHasType env Us ((some fv, d) :: Δ) e A H4 : InScope (fun x => x ∈ VLCtx.fvars Δ) e h1 : ∀ (P : FVarId → Prop), IsFVarUpSet P ((some fv, d) :: Δ) → InScope P e → InScope P A e' A' : VExpr h2 : TrExpr env Us ((some fv, d) :: Δ) e e' h3 : TrExpr env Us ((some fv, d) :: Δ) A A' h4 : HasType env (List.length Us) (VLCtx.toCtx ((some fv, d) :: Δ)) e' A' W : VLCtx.LiftN Δ ((some fv, d) :: Δ) 0 (0 + VLocalDecl.depth d) 0 ⊢ TrHasType env Us Δ e A
env : VEnv fv : FVarId d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e A : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some fv, d) :: Δ) H : ConditionallyHasType ngen env Us ((some fv, d) :: Δ) e A H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (NameGenerator.Reserves ngen) A H3 : InScope (fun x => x ∈ VLCtx.fvars ((some fv, d) :: Δ)) e → TrHasType env Us ((some fv, d) :: Δ) e A H4 : InScope (fun x => x ∈ VLCtx.fvars Δ) e h1 : ∀ (P : FVarId → Prop), IsFVarUpSet P ((some fv, d) :: Δ) → InScope P e → InScope P A e' A' : VExpr h2 : TrExpr env Us ((some fv, d) :: Δ) e e' h3 : TrExpr env Us ((some fv, d) :: Δ) A A' h4 : HasType env (List.length Us) (VLCtx.toCtx ((some fv, d) :: Δ)) e' A' W : VLCtx.LiftN Δ ((some fv, d) :: Δ) 0 (0 + VLocalDecl.depth d) 0 e'' : VExpr he : TrExpr env Us Δ e e'' ⊢ TrHasType env Us Δ e A
Please generate a tactic in lean4 to solve the state. STATE: env : VEnv fv : FVarId d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e A : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some fv, d) :: Δ) H : ConditionallyHasType ngen env Us ((some fv, d) :: Δ) e A H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (NameGenerator.Reserves ngen) A H3 : InScope (fun x => x ∈ VLCtx.fvars ((some fv, d) :: Δ)) e → TrHasType env Us ((some fv, d) :: Δ) e A H4 : InScope (fun x => x ∈ VLCtx.fvars Δ) e h1 : ∀ (P : FVarId → Prop), IsFVarUpSet P ((some fv, d) :: Δ) → InScope P e → InScope P A e' A' : VExpr h2 : TrExpr env Us ((some fv, d) :: Δ) e e' h3 : TrExpr env Us ((some fv, d) :: Δ) A A' h4 : HasType env (List.length Us) (VLCtx.toCtx ((some fv, d) :: Δ)) e' A' W : VLCtx.LiftN Δ ((some fv, d) :: Δ) 0 (0 + VLocalDecl.depth d) 0 ⊢ TrHasType env Us Δ e A TACTIC:
https://github.com/digama0/lean4lean.git
c534f13d8d25f5e1891b6d18cc76b601ee87aa66
Lean4Lean/Verify/Typing/ConditionallyTyped.lean
Lean4Lean.ConditionallyHasType.weakN_inv
[49, 1]
[67, 75]
have ee := h2.uniq henv (.refl henv hΔ) <| he.weakN henv W hΔ
env : VEnv fv : FVarId d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e A : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some fv, d) :: Δ) H : ConditionallyHasType ngen env Us ((some fv, d) :: Δ) e A H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (NameGenerator.Reserves ngen) A H3 : InScope (fun x => x ∈ VLCtx.fvars ((some fv, d) :: Δ)) e → TrHasType env Us ((some fv, d) :: Δ) e A H4 : InScope (fun x => x ∈ VLCtx.fvars Δ) e h1 : ∀ (P : FVarId → Prop), IsFVarUpSet P ((some fv, d) :: Δ) → InScope P e → InScope P A e' A' : VExpr h2 : TrExpr env Us ((some fv, d) :: Δ) e e' h3 : TrExpr env Us ((some fv, d) :: Δ) A A' h4 : HasType env (List.length Us) (VLCtx.toCtx ((some fv, d) :: Δ)) e' A' W : VLCtx.LiftN Δ ((some fv, d) :: Δ) 0 (0 + VLocalDecl.depth d) 0 e'' : VExpr he : TrExpr env Us Δ e e'' ⊢ TrHasType env Us Δ e A
env : VEnv fv : FVarId d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e A : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some fv, d) :: Δ) H : ConditionallyHasType ngen env Us ((some fv, d) :: Δ) e A H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (NameGenerator.Reserves ngen) A H3 : InScope (fun x => x ∈ VLCtx.fvars ((some fv, d) :: Δ)) e → TrHasType env Us ((some fv, d) :: Δ) e A H4 : InScope (fun x => x ∈ VLCtx.fvars Δ) e h1 : ∀ (P : FVarId → Prop), IsFVarUpSet P ((some fv, d) :: Δ) → InScope P e → InScope P A e' A' : VExpr h2 : TrExpr env Us ((some fv, d) :: Δ) e e' h3 : TrExpr env Us ((some fv, d) :: Δ) A A' h4 : HasType env (List.length Us) (VLCtx.toCtx ((some fv, d) :: Δ)) e' A' W : VLCtx.LiftN Δ ((some fv, d) :: Δ) 0 (0 + VLocalDecl.depth d) 0 e'' : VExpr he : TrExpr env Us Δ e e'' ee : IsDefEqU env (List.length Us) (VLCtx.toCtx ((some fv, d) :: Δ)) e' (VExpr.liftN (0 + VLocalDecl.depth d) e'') ⊢ TrHasType env Us Δ e A
Please generate a tactic in lean4 to solve the state. STATE: env : VEnv fv : FVarId d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e A : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some fv, d) :: Δ) H : ConditionallyHasType ngen env Us ((some fv, d) :: Δ) e A H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (NameGenerator.Reserves ngen) A H3 : InScope (fun x => x ∈ VLCtx.fvars ((some fv, d) :: Δ)) e → TrHasType env Us ((some fv, d) :: Δ) e A H4 : InScope (fun x => x ∈ VLCtx.fvars Δ) e h1 : ∀ (P : FVarId → Prop), IsFVarUpSet P ((some fv, d) :: Δ) → InScope P e → InScope P A e' A' : VExpr h2 : TrExpr env Us ((some fv, d) :: Δ) e e' h3 : TrExpr env Us ((some fv, d) :: Δ) A A' h4 : HasType env (List.length Us) (VLCtx.toCtx ((some fv, d) :: Δ)) e' A' W : VLCtx.LiftN Δ ((some fv, d) :: Δ) 0 (0 + VLocalDecl.depth d) 0 e'' : VExpr he : TrExpr env Us Δ e e'' ⊢ TrHasType env Us Δ e A TACTIC:
https://github.com/digama0/lean4lean.git
c534f13d8d25f5e1891b6d18cc76b601ee87aa66
Lean4Lean/Verify/Typing/ConditionallyTyped.lean
Lean4Lean.ConditionallyHasType.weakN_inv
[49, 1]
[67, 75]
have ⟨_, hA⟩ := TrExpr.weakN_inv henv W (.refl henv hΔ) h3 <| h1 _ this H4
env : VEnv fv : FVarId d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e A : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some fv, d) :: Δ) H : ConditionallyHasType ngen env Us ((some fv, d) :: Δ) e A H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (NameGenerator.Reserves ngen) A H3 : InScope (fun x => x ∈ VLCtx.fvars ((some fv, d) :: Δ)) e → TrHasType env Us ((some fv, d) :: Δ) e A H4 : InScope (fun x => x ∈ VLCtx.fvars Δ) e h1 : ∀ (P : FVarId → Prop), IsFVarUpSet P ((some fv, d) :: Δ) → InScope P e → InScope P A e' A' : VExpr h2 : TrExpr env Us ((some fv, d) :: Δ) e e' h3 : TrExpr env Us ((some fv, d) :: Δ) A A' h4 : HasType env (List.length Us) (VLCtx.toCtx ((some fv, d) :: Δ)) e' A' W : VLCtx.LiftN Δ ((some fv, d) :: Δ) 0 (0 + VLocalDecl.depth d) 0 e'' : VExpr he : TrExpr env Us Δ e e'' ee : IsDefEqU env (List.length Us) (VLCtx.toCtx ((some fv, d) :: Δ)) e' (VExpr.liftN (0 + VLocalDecl.depth d) e'') this : IsFVarUpSet (fun x => x ∈ VLCtx.fvars Δ) ((some fv, d) :: Δ) ⊢ TrHasType env Us Δ e A
env : VEnv fv : FVarId d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e A : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some fv, d) :: Δ) H : ConditionallyHasType ngen env Us ((some fv, d) :: Δ) e A H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (NameGenerator.Reserves ngen) A H3 : InScope (fun x => x ∈ VLCtx.fvars ((some fv, d) :: Δ)) e → TrHasType env Us ((some fv, d) :: Δ) e A H4 : InScope (fun x => x ∈ VLCtx.fvars Δ) e h1 : ∀ (P : FVarId → Prop), IsFVarUpSet P ((some fv, d) :: Δ) → InScope P e → InScope P A e' A' : VExpr h2 : TrExpr env Us ((some fv, d) :: Δ) e e' h3 : TrExpr env Us ((some fv, d) :: Δ) A A' h4 : HasType env (List.length Us) (VLCtx.toCtx ((some fv, d) :: Δ)) e' A' W : VLCtx.LiftN Δ ((some fv, d) :: Δ) 0 (0 + VLocalDecl.depth d) 0 e'' : VExpr he : TrExpr env Us Δ e e'' ee : IsDefEqU env (List.length Us) (VLCtx.toCtx ((some fv, d) :: Δ)) e' (VExpr.liftN (0 + VLocalDecl.depth d) e'') this : IsFVarUpSet (fun x => x ∈ VLCtx.fvars Δ) ((some fv, d) :: Δ) w✝ : VExpr hA : TrExpr env Us Δ A w✝ ⊢ TrHasType env Us Δ e A
Please generate a tactic in lean4 to solve the state. STATE: env : VEnv fv : FVarId d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e A : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some fv, d) :: Δ) H : ConditionallyHasType ngen env Us ((some fv, d) :: Δ) e A H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (NameGenerator.Reserves ngen) A H3 : InScope (fun x => x ∈ VLCtx.fvars ((some fv, d) :: Δ)) e → TrHasType env Us ((some fv, d) :: Δ) e A H4 : InScope (fun x => x ∈ VLCtx.fvars Δ) e h1 : ∀ (P : FVarId → Prop), IsFVarUpSet P ((some fv, d) :: Δ) → InScope P e → InScope P A e' A' : VExpr h2 : TrExpr env Us ((some fv, d) :: Δ) e e' h3 : TrExpr env Us ((some fv, d) :: Δ) A A' h4 : HasType env (List.length Us) (VLCtx.toCtx ((some fv, d) :: Δ)) e' A' W : VLCtx.LiftN Δ ((some fv, d) :: Δ) 0 (0 + VLocalDecl.depth d) 0 e'' : VExpr he : TrExpr env Us Δ e e'' ee : IsDefEqU env (List.length Us) (VLCtx.toCtx ((some fv, d) :: Δ)) e' (VExpr.liftN (0 + VLocalDecl.depth d) e'') this : IsFVarUpSet (fun x => x ∈ VLCtx.fvars Δ) ((some fv, d) :: Δ) ⊢ TrHasType env Us Δ e A TACTIC:
https://github.com/digama0/lean4lean.git
c534f13d8d25f5e1891b6d18cc76b601ee87aa66
Lean4Lean/Verify/Typing/ConditionallyTyped.lean
Lean4Lean.ConditionallyHasType.weakN_inv
[49, 1]
[67, 75]
have AA := h3.uniq henv (.refl henv hΔ) <| hA.weakN henv W hΔ
env : VEnv fv : FVarId d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e A : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some fv, d) :: Δ) H : ConditionallyHasType ngen env Us ((some fv, d) :: Δ) e A H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (NameGenerator.Reserves ngen) A H3 : InScope (fun x => x ∈ VLCtx.fvars ((some fv, d) :: Δ)) e → TrHasType env Us ((some fv, d) :: Δ) e A H4 : InScope (fun x => x ∈ VLCtx.fvars Δ) e h1 : ∀ (P : FVarId → Prop), IsFVarUpSet P ((some fv, d) :: Δ) → InScope P e → InScope P A e' A' : VExpr h2 : TrExpr env Us ((some fv, d) :: Δ) e e' h3 : TrExpr env Us ((some fv, d) :: Δ) A A' h4 : HasType env (List.length Us) (VLCtx.toCtx ((some fv, d) :: Δ)) e' A' W : VLCtx.LiftN Δ ((some fv, d) :: Δ) 0 (0 + VLocalDecl.depth d) 0 e'' : VExpr he : TrExpr env Us Δ e e'' ee : IsDefEqU env (List.length Us) (VLCtx.toCtx ((some fv, d) :: Δ)) e' (VExpr.liftN (0 + VLocalDecl.depth d) e'') this : IsFVarUpSet (fun x => x ∈ VLCtx.fvars Δ) ((some fv, d) :: Δ) w✝ : VExpr hA : TrExpr env Us Δ A w✝ ⊢ TrHasType env Us Δ e A
env : VEnv fv : FVarId d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e A : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some fv, d) :: Δ) H : ConditionallyHasType ngen env Us ((some fv, d) :: Δ) e A H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (NameGenerator.Reserves ngen) A H3 : InScope (fun x => x ∈ VLCtx.fvars ((some fv, d) :: Δ)) e → TrHasType env Us ((some fv, d) :: Δ) e A H4 : InScope (fun x => x ∈ VLCtx.fvars Δ) e h1 : ∀ (P : FVarId → Prop), IsFVarUpSet P ((some fv, d) :: Δ) → InScope P e → InScope P A e' A' : VExpr h2 : TrExpr env Us ((some fv, d) :: Δ) e e' h3 : TrExpr env Us ((some fv, d) :: Δ) A A' h4 : HasType env (List.length Us) (VLCtx.toCtx ((some fv, d) :: Δ)) e' A' W : VLCtx.LiftN Δ ((some fv, d) :: Δ) 0 (0 + VLocalDecl.depth d) 0 e'' : VExpr he : TrExpr env Us Δ e e'' ee : IsDefEqU env (List.length Us) (VLCtx.toCtx ((some fv, d) :: Δ)) e' (VExpr.liftN (0 + VLocalDecl.depth d) e'') this : IsFVarUpSet (fun x => x ∈ VLCtx.fvars Δ) ((some fv, d) :: Δ) w✝ : VExpr hA : TrExpr env Us Δ A w✝ AA : IsDefEqU env (List.length Us) (VLCtx.toCtx ((some fv, d) :: Δ)) A' (VExpr.liftN (0 + VLocalDecl.depth d) w✝) ⊢ TrHasType env Us Δ e A
Please generate a tactic in lean4 to solve the state. STATE: env : VEnv fv : FVarId d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e A : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some fv, d) :: Δ) H : ConditionallyHasType ngen env Us ((some fv, d) :: Δ) e A H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (NameGenerator.Reserves ngen) A H3 : InScope (fun x => x ∈ VLCtx.fvars ((some fv, d) :: Δ)) e → TrHasType env Us ((some fv, d) :: Δ) e A H4 : InScope (fun x => x ∈ VLCtx.fvars Δ) e h1 : ∀ (P : FVarId → Prop), IsFVarUpSet P ((some fv, d) :: Δ) → InScope P e → InScope P A e' A' : VExpr h2 : TrExpr env Us ((some fv, d) :: Δ) e e' h3 : TrExpr env Us ((some fv, d) :: Δ) A A' h4 : HasType env (List.length Us) (VLCtx.toCtx ((some fv, d) :: Δ)) e' A' W : VLCtx.LiftN Δ ((some fv, d) :: Δ) 0 (0 + VLocalDecl.depth d) 0 e'' : VExpr he : TrExpr env Us Δ e e'' ee : IsDefEqU env (List.length Us) (VLCtx.toCtx ((some fv, d) :: Δ)) e' (VExpr.liftN (0 + VLocalDecl.depth d) e'') this : IsFVarUpSet (fun x => x ∈ VLCtx.fvars Δ) ((some fv, d) :: Δ) w✝ : VExpr hA : TrExpr env Us Δ A w✝ ⊢ TrHasType env Us Δ e A TACTIC:
https://github.com/digama0/lean4lean.git
c534f13d8d25f5e1891b6d18cc76b601ee87aa66
Lean4Lean/Verify/Typing/ConditionallyTyped.lean
Lean4Lean.ConditionallyHasType.weakN_inv
[49, 1]
[67, 75]
have h4 := h4.defeqU_r henv hΔ.toCtx AA |>.defeqU_l henv hΔ.toCtx ee
env : VEnv fv : FVarId d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e A : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some fv, d) :: Δ) H : ConditionallyHasType ngen env Us ((some fv, d) :: Δ) e A H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (NameGenerator.Reserves ngen) A H3 : InScope (fun x => x ∈ VLCtx.fvars ((some fv, d) :: Δ)) e → TrHasType env Us ((some fv, d) :: Δ) e A H4 : InScope (fun x => x ∈ VLCtx.fvars Δ) e h1 : ∀ (P : FVarId → Prop), IsFVarUpSet P ((some fv, d) :: Δ) → InScope P e → InScope P A e' A' : VExpr h2 : TrExpr env Us ((some fv, d) :: Δ) e e' h3 : TrExpr env Us ((some fv, d) :: Δ) A A' h4 : HasType env (List.length Us) (VLCtx.toCtx ((some fv, d) :: Δ)) e' A' W : VLCtx.LiftN Δ ((some fv, d) :: Δ) 0 (0 + VLocalDecl.depth d) 0 e'' : VExpr he : TrExpr env Us Δ e e'' ee : IsDefEqU env (List.length Us) (VLCtx.toCtx ((some fv, d) :: Δ)) e' (VExpr.liftN (0 + VLocalDecl.depth d) e'') this : IsFVarUpSet (fun x => x ∈ VLCtx.fvars Δ) ((some fv, d) :: Δ) w✝ : VExpr hA : TrExpr env Us Δ A w✝ AA : IsDefEqU env (List.length Us) (VLCtx.toCtx ((some fv, d) :: Δ)) A' (VExpr.liftN (0 + VLocalDecl.depth d) w✝) ⊢ TrHasType env Us Δ e A
env : VEnv fv : FVarId d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e A : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some fv, d) :: Δ) H : ConditionallyHasType ngen env Us ((some fv, d) :: Δ) e A H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (NameGenerator.Reserves ngen) A H3 : InScope (fun x => x ∈ VLCtx.fvars ((some fv, d) :: Δ)) e → TrHasType env Us ((some fv, d) :: Δ) e A H4 : InScope (fun x => x ∈ VLCtx.fvars Δ) e h1 : ∀ (P : FVarId → Prop), IsFVarUpSet P ((some fv, d) :: Δ) → InScope P e → InScope P A e' A' : VExpr h2 : TrExpr env Us ((some fv, d) :: Δ) e e' h3 : TrExpr env Us ((some fv, d) :: Δ) A A' h4✝ : HasType env (List.length Us) (VLCtx.toCtx ((some fv, d) :: Δ)) e' A' W : VLCtx.LiftN Δ ((some fv, d) :: Δ) 0 (0 + VLocalDecl.depth d) 0 e'' : VExpr he : TrExpr env Us Δ e e'' ee : IsDefEqU env (List.length Us) (VLCtx.toCtx ((some fv, d) :: Δ)) e' (VExpr.liftN (0 + VLocalDecl.depth d) e'') this : IsFVarUpSet (fun x => x ∈ VLCtx.fvars Δ) ((some fv, d) :: Δ) w✝ : VExpr hA : TrExpr env Us Δ A w✝ AA : IsDefEqU env (List.length Us) (VLCtx.toCtx ((some fv, d) :: Δ)) A' (VExpr.liftN (0 + VLocalDecl.depth d) w✝) h4 : HasType env (List.length Us) (VLCtx.toCtx ((some fv, d) :: Δ)) (VExpr.liftN (0 + VLocalDecl.depth d) e'') (VExpr.liftN (0 + VLocalDecl.depth d) w✝) ⊢ TrHasType env Us Δ e A
Please generate a tactic in lean4 to solve the state. STATE: env : VEnv fv : FVarId d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e A : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some fv, d) :: Δ) H : ConditionallyHasType ngen env Us ((some fv, d) :: Δ) e A H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (NameGenerator.Reserves ngen) A H3 : InScope (fun x => x ∈ VLCtx.fvars ((some fv, d) :: Δ)) e → TrHasType env Us ((some fv, d) :: Δ) e A H4 : InScope (fun x => x ∈ VLCtx.fvars Δ) e h1 : ∀ (P : FVarId → Prop), IsFVarUpSet P ((some fv, d) :: Δ) → InScope P e → InScope P A e' A' : VExpr h2 : TrExpr env Us ((some fv, d) :: Δ) e e' h3 : TrExpr env Us ((some fv, d) :: Δ) A A' h4 : HasType env (List.length Us) (VLCtx.toCtx ((some fv, d) :: Δ)) e' A' W : VLCtx.LiftN Δ ((some fv, d) :: Δ) 0 (0 + VLocalDecl.depth d) 0 e'' : VExpr he : TrExpr env Us Δ e e'' ee : IsDefEqU env (List.length Us) (VLCtx.toCtx ((some fv, d) :: Δ)) e' (VExpr.liftN (0 + VLocalDecl.depth d) e'') this : IsFVarUpSet (fun x => x ∈ VLCtx.fvars Δ) ((some fv, d) :: Δ) w✝ : VExpr hA : TrExpr env Us Δ A w✝ AA : IsDefEqU env (List.length Us) (VLCtx.toCtx ((some fv, d) :: Δ)) A' (VExpr.liftN (0 + VLocalDecl.depth d) w✝) ⊢ TrHasType env Us Δ e A TACTIC:
https://github.com/digama0/lean4lean.git
c534f13d8d25f5e1891b6d18cc76b601ee87aa66
Lean4Lean/Verify/Typing/ConditionallyTyped.lean
Lean4Lean.ConditionallyHasType.weakN_inv
[49, 1]
[67, 75]
have h4 := (HasType.weakN_iff henv hΔ.toCtx W.toCtx).1 h4
env : VEnv fv : FVarId d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e A : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some fv, d) :: Δ) H : ConditionallyHasType ngen env Us ((some fv, d) :: Δ) e A H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (NameGenerator.Reserves ngen) A H3 : InScope (fun x => x ∈ VLCtx.fvars ((some fv, d) :: Δ)) e → TrHasType env Us ((some fv, d) :: Δ) e A H4 : InScope (fun x => x ∈ VLCtx.fvars Δ) e h1 : ∀ (P : FVarId → Prop), IsFVarUpSet P ((some fv, d) :: Δ) → InScope P e → InScope P A e' A' : VExpr h2 : TrExpr env Us ((some fv, d) :: Δ) e e' h3 : TrExpr env Us ((some fv, d) :: Δ) A A' h4✝ : HasType env (List.length Us) (VLCtx.toCtx ((some fv, d) :: Δ)) e' A' W : VLCtx.LiftN Δ ((some fv, d) :: Δ) 0 (0 + VLocalDecl.depth d) 0 e'' : VExpr he : TrExpr env Us Δ e e'' ee : IsDefEqU env (List.length Us) (VLCtx.toCtx ((some fv, d) :: Δ)) e' (VExpr.liftN (0 + VLocalDecl.depth d) e'') this : IsFVarUpSet (fun x => x ∈ VLCtx.fvars Δ) ((some fv, d) :: Δ) w✝ : VExpr hA : TrExpr env Us Δ A w✝ AA : IsDefEqU env (List.length Us) (VLCtx.toCtx ((some fv, d) :: Δ)) A' (VExpr.liftN (0 + VLocalDecl.depth d) w✝) h4 : HasType env (List.length Us) (VLCtx.toCtx ((some fv, d) :: Δ)) (VExpr.liftN (0 + VLocalDecl.depth d) e'') (VExpr.liftN (0 + VLocalDecl.depth d) w✝) ⊢ TrHasType env Us Δ e A
env : VEnv fv : FVarId d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e A : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some fv, d) :: Δ) H : ConditionallyHasType ngen env Us ((some fv, d) :: Δ) e A H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (NameGenerator.Reserves ngen) A H3 : InScope (fun x => x ∈ VLCtx.fvars ((some fv, d) :: Δ)) e → TrHasType env Us ((some fv, d) :: Δ) e A H4 : InScope (fun x => x ∈ VLCtx.fvars Δ) e h1 : ∀ (P : FVarId → Prop), IsFVarUpSet P ((some fv, d) :: Δ) → InScope P e → InScope P A e' A' : VExpr h2 : TrExpr env Us ((some fv, d) :: Δ) e e' h3 : TrExpr env Us ((some fv, d) :: Δ) A A' h4✝¹ : HasType env (List.length Us) (VLCtx.toCtx ((some fv, d) :: Δ)) e' A' W : VLCtx.LiftN Δ ((some fv, d) :: Δ) 0 (0 + VLocalDecl.depth d) 0 e'' : VExpr he : TrExpr env Us Δ e e'' ee : IsDefEqU env (List.length Us) (VLCtx.toCtx ((some fv, d) :: Δ)) e' (VExpr.liftN (0 + VLocalDecl.depth d) e'') this : IsFVarUpSet (fun x => x ∈ VLCtx.fvars Δ) ((some fv, d) :: Δ) w✝ : VExpr hA : TrExpr env Us Δ A w✝ AA : IsDefEqU env (List.length Us) (VLCtx.toCtx ((some fv, d) :: Δ)) A' (VExpr.liftN (0 + VLocalDecl.depth d) w✝) h4✝ : HasType env (List.length Us) (VLCtx.toCtx ((some fv, d) :: Δ)) (VExpr.liftN (0 + VLocalDecl.depth d) e'') (VExpr.liftN (0 + VLocalDecl.depth d) w✝) h4 : HasType env (List.length Us) (VLCtx.toCtx Δ) e'' w✝ ⊢ TrHasType env Us Δ e A
Please generate a tactic in lean4 to solve the state. STATE: env : VEnv fv : FVarId d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e A : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some fv, d) :: Δ) H : ConditionallyHasType ngen env Us ((some fv, d) :: Δ) e A H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (NameGenerator.Reserves ngen) A H3 : InScope (fun x => x ∈ VLCtx.fvars ((some fv, d) :: Δ)) e → TrHasType env Us ((some fv, d) :: Δ) e A H4 : InScope (fun x => x ∈ VLCtx.fvars Δ) e h1 : ∀ (P : FVarId → Prop), IsFVarUpSet P ((some fv, d) :: Δ) → InScope P e → InScope P A e' A' : VExpr h2 : TrExpr env Us ((some fv, d) :: Δ) e e' h3 : TrExpr env Us ((some fv, d) :: Δ) A A' h4✝ : HasType env (List.length Us) (VLCtx.toCtx ((some fv, d) :: Δ)) e' A' W : VLCtx.LiftN Δ ((some fv, d) :: Δ) 0 (0 + VLocalDecl.depth d) 0 e'' : VExpr he : TrExpr env Us Δ e e'' ee : IsDefEqU env (List.length Us) (VLCtx.toCtx ((some fv, d) :: Δ)) e' (VExpr.liftN (0 + VLocalDecl.depth d) e'') this : IsFVarUpSet (fun x => x ∈ VLCtx.fvars Δ) ((some fv, d) :: Δ) w✝ : VExpr hA : TrExpr env Us Δ A w✝ AA : IsDefEqU env (List.length Us) (VLCtx.toCtx ((some fv, d) :: Δ)) A' (VExpr.liftN (0 + VLocalDecl.depth d) w✝) h4 : HasType env (List.length Us) (VLCtx.toCtx ((some fv, d) :: Δ)) (VExpr.liftN (0 + VLocalDecl.depth d) e'') (VExpr.liftN (0 + VLocalDecl.depth d) w✝) ⊢ TrHasType env Us Δ e A TACTIC:
https://github.com/digama0/lean4lean.git
c534f13d8d25f5e1891b6d18cc76b601ee87aa66
Lean4Lean/Verify/Typing/ConditionallyTyped.lean
Lean4Lean.ConditionallyHasType.weakN_inv
[49, 1]
[67, 75]
refine ⟨fun P hP he' => ?_, _, _, he, hA, h4⟩
env : VEnv fv : FVarId d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e A : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some fv, d) :: Δ) H : ConditionallyHasType ngen env Us ((some fv, d) :: Δ) e A H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (NameGenerator.Reserves ngen) A H3 : InScope (fun x => x ∈ VLCtx.fvars ((some fv, d) :: Δ)) e → TrHasType env Us ((some fv, d) :: Δ) e A H4 : InScope (fun x => x ∈ VLCtx.fvars Δ) e h1 : ∀ (P : FVarId → Prop), IsFVarUpSet P ((some fv, d) :: Δ) → InScope P e → InScope P A e' A' : VExpr h2 : TrExpr env Us ((some fv, d) :: Δ) e e' h3 : TrExpr env Us ((some fv, d) :: Δ) A A' h4✝¹ : HasType env (List.length Us) (VLCtx.toCtx ((some fv, d) :: Δ)) e' A' W : VLCtx.LiftN Δ ((some fv, d) :: Δ) 0 (0 + VLocalDecl.depth d) 0 e'' : VExpr he : TrExpr env Us Δ e e'' ee : IsDefEqU env (List.length Us) (VLCtx.toCtx ((some fv, d) :: Δ)) e' (VExpr.liftN (0 + VLocalDecl.depth d) e'') this : IsFVarUpSet (fun x => x ∈ VLCtx.fvars Δ) ((some fv, d) :: Δ) w✝ : VExpr hA : TrExpr env Us Δ A w✝ AA : IsDefEqU env (List.length Us) (VLCtx.toCtx ((some fv, d) :: Δ)) A' (VExpr.liftN (0 + VLocalDecl.depth d) w✝) h4✝ : HasType env (List.length Us) (VLCtx.toCtx ((some fv, d) :: Δ)) (VExpr.liftN (0 + VLocalDecl.depth d) e'') (VExpr.liftN (0 + VLocalDecl.depth d) w✝) h4 : HasType env (List.length Us) (VLCtx.toCtx Δ) e'' w✝ ⊢ TrHasType env Us Δ e A
env : VEnv fv : FVarId d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e A : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some fv, d) :: Δ) H : ConditionallyHasType ngen env Us ((some fv, d) :: Δ) e A H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (NameGenerator.Reserves ngen) A H3 : InScope (fun x => x ∈ VLCtx.fvars ((some fv, d) :: Δ)) e → TrHasType env Us ((some fv, d) :: Δ) e A H4 : InScope (fun x => x ∈ VLCtx.fvars Δ) e h1 : ∀ (P : FVarId → Prop), IsFVarUpSet P ((some fv, d) :: Δ) → InScope P e → InScope P A e' A' : VExpr h2 : TrExpr env Us ((some fv, d) :: Δ) e e' h3 : TrExpr env Us ((some fv, d) :: Δ) A A' h4✝¹ : HasType env (List.length Us) (VLCtx.toCtx ((some fv, d) :: Δ)) e' A' W : VLCtx.LiftN Δ ((some fv, d) :: Δ) 0 (0 + VLocalDecl.depth d) 0 e'' : VExpr he : TrExpr env Us Δ e e'' ee : IsDefEqU env (List.length Us) (VLCtx.toCtx ((some fv, d) :: Δ)) e' (VExpr.liftN (0 + VLocalDecl.depth d) e'') this : IsFVarUpSet (fun x => x ∈ VLCtx.fvars Δ) ((some fv, d) :: Δ) w✝ : VExpr hA : TrExpr env Us Δ A w✝ AA : IsDefEqU env (List.length Us) (VLCtx.toCtx ((some fv, d) :: Δ)) A' (VExpr.liftN (0 + VLocalDecl.depth d) w✝) h4✝ : HasType env (List.length Us) (VLCtx.toCtx ((some fv, d) :: Δ)) (VExpr.liftN (0 + VLocalDecl.depth d) e'') (VExpr.liftN (0 + VLocalDecl.depth d) w✝) h4 : HasType env (List.length Us) (VLCtx.toCtx Δ) e'' w✝ P : FVarId → Prop hP : IsFVarUpSet P Δ he' : InScope P e ⊢ InScope P A
Please generate a tactic in lean4 to solve the state. STATE: env : VEnv fv : FVarId d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e A : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some fv, d) :: Δ) H : ConditionallyHasType ngen env Us ((some fv, d) :: Δ) e A H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (NameGenerator.Reserves ngen) A H3 : InScope (fun x => x ∈ VLCtx.fvars ((some fv, d) :: Δ)) e → TrHasType env Us ((some fv, d) :: Δ) e A H4 : InScope (fun x => x ∈ VLCtx.fvars Δ) e h1 : ∀ (P : FVarId → Prop), IsFVarUpSet P ((some fv, d) :: Δ) → InScope P e → InScope P A e' A' : VExpr h2 : TrExpr env Us ((some fv, d) :: Δ) e e' h3 : TrExpr env Us ((some fv, d) :: Δ) A A' h4✝¹ : HasType env (List.length Us) (VLCtx.toCtx ((some fv, d) :: Δ)) e' A' W : VLCtx.LiftN Δ ((some fv, d) :: Δ) 0 (0 + VLocalDecl.depth d) 0 e'' : VExpr he : TrExpr env Us Δ e e'' ee : IsDefEqU env (List.length Us) (VLCtx.toCtx ((some fv, d) :: Δ)) e' (VExpr.liftN (0 + VLocalDecl.depth d) e'') this : IsFVarUpSet (fun x => x ∈ VLCtx.fvars Δ) ((some fv, d) :: Δ) w✝ : VExpr hA : TrExpr env Us Δ A w✝ AA : IsDefEqU env (List.length Us) (VLCtx.toCtx ((some fv, d) :: Δ)) A' (VExpr.liftN (0 + VLocalDecl.depth d) w✝) h4✝ : HasType env (List.length Us) (VLCtx.toCtx ((some fv, d) :: Δ)) (VExpr.liftN (0 + VLocalDecl.depth d) e'') (VExpr.liftN (0 + VLocalDecl.depth d) w✝) h4 : HasType env (List.length Us) (VLCtx.toCtx Δ) e'' w✝ ⊢ TrHasType env Us Δ e A TACTIC:
https://github.com/digama0/lean4lean.git
c534f13d8d25f5e1891b6d18cc76b601ee87aa66
Lean4Lean/Verify/Typing/ConditionallyTyped.lean
Lean4Lean.ConditionallyHasType.fresh
[69, 1]
[80, 15]
refine have ⟨H1, H2, H3⟩ := H; ⟨H1, H2, fun H4 => ?_⟩
env : VEnv d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e A : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some { name := NameGenerator.curr ngen }, d) :: Δ) H : ConditionallyHasType ngen env Us Δ e A ⊢ ConditionallyHasType ngen env Us ((some { name := NameGenerator.curr ngen }, d) :: Δ) e A
env : VEnv d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e A : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some { name := NameGenerator.curr ngen }, d) :: Δ) H : ConditionallyHasType ngen env Us Δ e A H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (NameGenerator.Reserves ngen) A H3 : InScope (fun x => x ∈ VLCtx.fvars Δ) e → TrHasType env Us Δ e A H4 : InScope (fun x => x ∈ VLCtx.fvars ((some { name := NameGenerator.curr ngen }, d) :: Δ)) e ⊢ TrHasType env Us ((some { name := NameGenerator.curr ngen }, d) :: Δ) e A
Please generate a tactic in lean4 to solve the state. STATE: env : VEnv d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e A : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some { name := NameGenerator.curr ngen }, d) :: Δ) H : ConditionallyHasType ngen env Us Δ e A ⊢ ConditionallyHasType ngen env Us ((some { name := NameGenerator.curr ngen }, d) :: Δ) e A TACTIC:
https://github.com/digama0/lean4lean.git
c534f13d8d25f5e1891b6d18cc76b601ee87aa66
Lean4Lean/Verify/Typing/ConditionallyTyped.lean
Lean4Lean.ConditionallyHasType.fresh
[69, 1]
[80, 15]
have ⟨h1, _, _, h2, h3, h4⟩ := H3 (H4.mp ?_ H1)
env : VEnv d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e A : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some { name := NameGenerator.curr ngen }, d) :: Δ) H : ConditionallyHasType ngen env Us Δ e A H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (NameGenerator.Reserves ngen) A H3 : InScope (fun x => x ∈ VLCtx.fvars Δ) e → TrHasType env Us Δ e A H4 : InScope (fun x => x ∈ VLCtx.fvars ((some { name := NameGenerator.curr ngen }, d) :: Δ)) e ⊢ TrHasType env Us ((some { name := NameGenerator.curr ngen }, d) :: Δ) e A
case refine_2 env : VEnv d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e A : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some { name := NameGenerator.curr ngen }, d) :: Δ) H : ConditionallyHasType ngen env Us Δ e A H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (NameGenerator.Reserves ngen) A H3 : InScope (fun x => x ∈ VLCtx.fvars Δ) e → TrHasType env Us Δ e A H4 : InScope (fun x => x ∈ VLCtx.fvars ((some { name := NameGenerator.curr ngen }, d) :: Δ)) e h1 : ∀ (P : FVarId → Prop), IsFVarUpSet P Δ → InScope P e → InScope P A w✝¹ w✝ : VExpr h2 : TrExpr env Us Δ e w✝¹ h3 : TrExpr env Us Δ A w✝ h4 : HasType env (List.length Us) (VLCtx.toCtx Δ) w✝¹ w✝ ⊢ TrHasType env Us ((some { name := NameGenerator.curr ngen }, d) :: Δ) e A case refine_1 env : VEnv d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e A : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some { name := NameGenerator.curr ngen }, d) :: Δ) H : ConditionallyHasType ngen env Us Δ e A H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (NameGenerator.Reserves ngen) A H3 : InScope (fun x => x ∈ VLCtx.fvars Δ) e → TrHasType env Us Δ e A H4 : InScope (fun x => x ∈ VLCtx.fvars ((some { name := NameGenerator.curr ngen }, d) :: Δ)) e ⊢ ∀ (fv : FVarId), fv ∈ VLCtx.fvars ((some { name := NameGenerator.curr ngen }, d) :: Δ) → NameGenerator.Reserves ngen fv → fv ∈ VLCtx.fvars Δ
Please generate a tactic in lean4 to solve the state. STATE: env : VEnv d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e A : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some { name := NameGenerator.curr ngen }, d) :: Δ) H : ConditionallyHasType ngen env Us Δ e A H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (NameGenerator.Reserves ngen) A H3 : InScope (fun x => x ∈ VLCtx.fvars Δ) e → TrHasType env Us Δ e A H4 : InScope (fun x => x ∈ VLCtx.fvars ((some { name := NameGenerator.curr ngen }, d) :: Δ)) e ⊢ TrHasType env Us ((some { name := NameGenerator.curr ngen }, d) :: Δ) e A TACTIC:
https://github.com/digama0/lean4lean.git
c534f13d8d25f5e1891b6d18cc76b601ee87aa66
Lean4Lean/Verify/Typing/ConditionallyTyped.lean
Lean4Lean.ConditionallyHasType.fresh
[69, 1]
[80, 15]
have W : VLCtx.LiftN Δ ((some ⟨ngen.curr⟩, d) :: Δ) 0 (0 + d.depth) 0 := .skip_fvar _ _ .refl
case refine_2 env : VEnv d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e A : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some { name := NameGenerator.curr ngen }, d) :: Δ) H : ConditionallyHasType ngen env Us Δ e A H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (NameGenerator.Reserves ngen) A H3 : InScope (fun x => x ∈ VLCtx.fvars Δ) e → TrHasType env Us Δ e A H4 : InScope (fun x => x ∈ VLCtx.fvars ((some { name := NameGenerator.curr ngen }, d) :: Δ)) e h1 : ∀ (P : FVarId → Prop), IsFVarUpSet P Δ → InScope P e → InScope P A w✝¹ w✝ : VExpr h2 : TrExpr env Us Δ e w✝¹ h3 : TrExpr env Us Δ A w✝ h4 : HasType env (List.length Us) (VLCtx.toCtx Δ) w✝¹ w✝ ⊢ TrHasType env Us ((some { name := NameGenerator.curr ngen }, d) :: Δ) e A
case refine_2 env : VEnv d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e A : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some { name := NameGenerator.curr ngen }, d) :: Δ) H : ConditionallyHasType ngen env Us Δ e A H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (NameGenerator.Reserves ngen) A H3 : InScope (fun x => x ∈ VLCtx.fvars Δ) e → TrHasType env Us Δ e A H4 : InScope (fun x => x ∈ VLCtx.fvars ((some { name := NameGenerator.curr ngen }, d) :: Δ)) e h1 : ∀ (P : FVarId → Prop), IsFVarUpSet P Δ → InScope P e → InScope P A w✝¹ w✝ : VExpr h2 : TrExpr env Us Δ e w✝¹ h3 : TrExpr env Us Δ A w✝ h4 : HasType env (List.length Us) (VLCtx.toCtx Δ) w✝¹ w✝ W : VLCtx.LiftN Δ ((some { name := NameGenerator.curr ngen }, d) :: Δ) 0 (0 + VLocalDecl.depth d) 0 ⊢ TrHasType env Us ((some { name := NameGenerator.curr ngen }, d) :: Δ) e A
Please generate a tactic in lean4 to solve the state. STATE: case refine_2 env : VEnv d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e A : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some { name := NameGenerator.curr ngen }, d) :: Δ) H : ConditionallyHasType ngen env Us Δ e A H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (NameGenerator.Reserves ngen) A H3 : InScope (fun x => x ∈ VLCtx.fvars Δ) e → TrHasType env Us Δ e A H4 : InScope (fun x => x ∈ VLCtx.fvars ((some { name := NameGenerator.curr ngen }, d) :: Δ)) e h1 : ∀ (P : FVarId → Prop), IsFVarUpSet P Δ → InScope P e → InScope P A w✝¹ w✝ : VExpr h2 : TrExpr env Us Δ e w✝¹ h3 : TrExpr env Us Δ A w✝ h4 : HasType env (List.length Us) (VLCtx.toCtx Δ) w✝¹ w✝ ⊢ TrHasType env Us ((some { name := NameGenerator.curr ngen }, d) :: Δ) e A TACTIC:
https://github.com/digama0/lean4lean.git
c534f13d8d25f5e1891b6d18cc76b601ee87aa66
Lean4Lean/Verify/Typing/ConditionallyTyped.lean
Lean4Lean.ConditionallyHasType.fresh
[69, 1]
[80, 15]
refine ⟨fun P hP => h1 _ hP.2, ?_⟩
case refine_2 env : VEnv d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e A : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some { name := NameGenerator.curr ngen }, d) :: Δ) H : ConditionallyHasType ngen env Us Δ e A H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (NameGenerator.Reserves ngen) A H3 : InScope (fun x => x ∈ VLCtx.fvars Δ) e → TrHasType env Us Δ e A H4 : InScope (fun x => x ∈ VLCtx.fvars ((some { name := NameGenerator.curr ngen }, d) :: Δ)) e h1 : ∀ (P : FVarId → Prop), IsFVarUpSet P Δ → InScope P e → InScope P A w✝¹ w✝ : VExpr h2 : TrExpr env Us Δ e w✝¹ h3 : TrExpr env Us Δ A w✝ h4 : HasType env (List.length Us) (VLCtx.toCtx Δ) w✝¹ w✝ W : VLCtx.LiftN Δ ((some { name := NameGenerator.curr ngen }, d) :: Δ) 0 (0 + VLocalDecl.depth d) 0 ⊢ TrHasType env Us ((some { name := NameGenerator.curr ngen }, d) :: Δ) e A
case refine_2 env : VEnv d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e A : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some { name := NameGenerator.curr ngen }, d) :: Δ) H : ConditionallyHasType ngen env Us Δ e A H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (NameGenerator.Reserves ngen) A H3 : InScope (fun x => x ∈ VLCtx.fvars Δ) e → TrHasType env Us Δ e A H4 : InScope (fun x => x ∈ VLCtx.fvars ((some { name := NameGenerator.curr ngen }, d) :: Δ)) e h1 : ∀ (P : FVarId → Prop), IsFVarUpSet P Δ → InScope P e → InScope P A w✝¹ w✝ : VExpr h2 : TrExpr env Us Δ e w✝¹ h3 : TrExpr env Us Δ A w✝ h4 : HasType env (List.length Us) (VLCtx.toCtx Δ) w✝¹ w✝ W : VLCtx.LiftN Δ ((some { name := NameGenerator.curr ngen }, d) :: Δ) 0 (0 + VLocalDecl.depth d) 0 ⊢ ∃ e' A', TrExpr env Us ((some { name := NameGenerator.curr ngen }, d) :: Δ) e e' ∧ TrExpr env Us ((some { name := NameGenerator.curr ngen }, d) :: Δ) A A' ∧ HasType env (List.length Us) (VLCtx.toCtx ((some { name := NameGenerator.curr ngen }, d) :: Δ)) e' A'
Please generate a tactic in lean4 to solve the state. STATE: case refine_2 env : VEnv d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e A : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some { name := NameGenerator.curr ngen }, d) :: Δ) H : ConditionallyHasType ngen env Us Δ e A H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (NameGenerator.Reserves ngen) A H3 : InScope (fun x => x ∈ VLCtx.fvars Δ) e → TrHasType env Us Δ e A H4 : InScope (fun x => x ∈ VLCtx.fvars ((some { name := NameGenerator.curr ngen }, d) :: Δ)) e h1 : ∀ (P : FVarId → Prop), IsFVarUpSet P Δ → InScope P e → InScope P A w✝¹ w✝ : VExpr h2 : TrExpr env Us Δ e w✝¹ h3 : TrExpr env Us Δ A w✝ h4 : HasType env (List.length Us) (VLCtx.toCtx Δ) w✝¹ w✝ W : VLCtx.LiftN Δ ((some { name := NameGenerator.curr ngen }, d) :: Δ) 0 (0 + VLocalDecl.depth d) 0 ⊢ TrHasType env Us ((some { name := NameGenerator.curr ngen }, d) :: Δ) e A TACTIC:
https://github.com/digama0/lean4lean.git
c534f13d8d25f5e1891b6d18cc76b601ee87aa66
Lean4Lean/Verify/Typing/ConditionallyTyped.lean
Lean4Lean.ConditionallyHasType.fresh
[69, 1]
[80, 15]
exact ⟨_, _, h2.weakN henv W hΔ, h3.weakN henv W hΔ, h4.weakN henv W.toCtx⟩
case refine_2 env : VEnv d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e A : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some { name := NameGenerator.curr ngen }, d) :: Δ) H : ConditionallyHasType ngen env Us Δ e A H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (NameGenerator.Reserves ngen) A H3 : InScope (fun x => x ∈ VLCtx.fvars Δ) e → TrHasType env Us Δ e A H4 : InScope (fun x => x ∈ VLCtx.fvars ((some { name := NameGenerator.curr ngen }, d) :: Δ)) e h1 : ∀ (P : FVarId → Prop), IsFVarUpSet P Δ → InScope P e → InScope P A w✝¹ w✝ : VExpr h2 : TrExpr env Us Δ e w✝¹ h3 : TrExpr env Us Δ A w✝ h4 : HasType env (List.length Us) (VLCtx.toCtx Δ) w✝¹ w✝ W : VLCtx.LiftN Δ ((some { name := NameGenerator.curr ngen }, d) :: Δ) 0 (0 + VLocalDecl.depth d) 0 ⊢ ∃ e' A', TrExpr env Us ((some { name := NameGenerator.curr ngen }, d) :: Δ) e e' ∧ TrExpr env Us ((some { name := NameGenerator.curr ngen }, d) :: Δ) A A' ∧ HasType env (List.length Us) (VLCtx.toCtx ((some { name := NameGenerator.curr ngen }, d) :: Δ)) e' A'
no goals
Please generate a tactic in lean4 to solve the state. STATE: case refine_2 env : VEnv d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e A : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some { name := NameGenerator.curr ngen }, d) :: Δ) H : ConditionallyHasType ngen env Us Δ e A H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (NameGenerator.Reserves ngen) A H3 : InScope (fun x => x ∈ VLCtx.fvars Δ) e → TrHasType env Us Δ e A H4 : InScope (fun x => x ∈ VLCtx.fvars ((some { name := NameGenerator.curr ngen }, d) :: Δ)) e h1 : ∀ (P : FVarId → Prop), IsFVarUpSet P Δ → InScope P e → InScope P A w✝¹ w✝ : VExpr h2 : TrExpr env Us Δ e w✝¹ h3 : TrExpr env Us Δ A w✝ h4 : HasType env (List.length Us) (VLCtx.toCtx Δ) w✝¹ w✝ W : VLCtx.LiftN Δ ((some { name := NameGenerator.curr ngen }, d) :: Δ) 0 (0 + VLocalDecl.depth d) 0 ⊢ ∃ e' A', TrExpr env Us ((some { name := NameGenerator.curr ngen }, d) :: Δ) e e' ∧ TrExpr env Us ((some { name := NameGenerator.curr ngen }, d) :: Δ) A A' ∧ HasType env (List.length Us) (VLCtx.toCtx ((some { name := NameGenerator.curr ngen }, d) :: Δ)) e' A' TACTIC:
https://github.com/digama0/lean4lean.git
c534f13d8d25f5e1891b6d18cc76b601ee87aa66
Lean4Lean/Verify/Typing/ConditionallyTyped.lean
Lean4Lean.ConditionallyHasType.fresh
[69, 1]
[80, 15]
intro _ h1 h2
case refine_1 env : VEnv d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e A : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some { name := NameGenerator.curr ngen }, d) :: Δ) H : ConditionallyHasType ngen env Us Δ e A H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (NameGenerator.Reserves ngen) A H3 : InScope (fun x => x ∈ VLCtx.fvars Δ) e → TrHasType env Us Δ e A H4 : InScope (fun x => x ∈ VLCtx.fvars ((some { name := NameGenerator.curr ngen }, d) :: Δ)) e ⊢ ∀ (fv : FVarId), fv ∈ VLCtx.fvars ((some { name := NameGenerator.curr ngen }, d) :: Δ) → NameGenerator.Reserves ngen fv → fv ∈ VLCtx.fvars Δ
case refine_1 env : VEnv d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e A : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some { name := NameGenerator.curr ngen }, d) :: Δ) H : ConditionallyHasType ngen env Us Δ e A H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (NameGenerator.Reserves ngen) A H3 : InScope (fun x => x ∈ VLCtx.fvars Δ) e → TrHasType env Us Δ e A H4 : InScope (fun x => x ∈ VLCtx.fvars ((some { name := NameGenerator.curr ngen }, d) :: Δ)) e fv✝ : FVarId h1 : fv✝ ∈ VLCtx.fvars ((some { name := NameGenerator.curr ngen }, d) :: Δ) h2 : NameGenerator.Reserves ngen fv✝ ⊢ fv✝ ∈ VLCtx.fvars Δ
Please generate a tactic in lean4 to solve the state. STATE: case refine_1 env : VEnv d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e A : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some { name := NameGenerator.curr ngen }, d) :: Δ) H : ConditionallyHasType ngen env Us Δ e A H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (NameGenerator.Reserves ngen) A H3 : InScope (fun x => x ∈ VLCtx.fvars Δ) e → TrHasType env Us Δ e A H4 : InScope (fun x => x ∈ VLCtx.fvars ((some { name := NameGenerator.curr ngen }, d) :: Δ)) e ⊢ ∀ (fv : FVarId), fv ∈ VLCtx.fvars ((some { name := NameGenerator.curr ngen }, d) :: Δ) → NameGenerator.Reserves ngen fv → fv ∈ VLCtx.fvars Δ TACTIC:
https://github.com/digama0/lean4lean.git
c534f13d8d25f5e1891b6d18cc76b601ee87aa66
Lean4Lean/Verify/Typing/ConditionallyTyped.lean
Lean4Lean.ConditionallyHasType.fresh
[69, 1]
[80, 15]
simp at h1
case refine_1 env : VEnv d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e A : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some { name := NameGenerator.curr ngen }, d) :: Δ) H : ConditionallyHasType ngen env Us Δ e A H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (NameGenerator.Reserves ngen) A H3 : InScope (fun x => x ∈ VLCtx.fvars Δ) e → TrHasType env Us Δ e A H4 : InScope (fun x => x ∈ VLCtx.fvars ((some { name := NameGenerator.curr ngen }, d) :: Δ)) e fv✝ : FVarId h1 : fv✝ ∈ VLCtx.fvars ((some { name := NameGenerator.curr ngen }, d) :: Δ) h2 : NameGenerator.Reserves ngen fv✝ ⊢ fv✝ ∈ VLCtx.fvars Δ
case refine_1 env : VEnv d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e A : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some { name := NameGenerator.curr ngen }, d) :: Δ) H : ConditionallyHasType ngen env Us Δ e A H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (NameGenerator.Reserves ngen) A H3 : InScope (fun x => x ∈ VLCtx.fvars Δ) e → TrHasType env Us Δ e A H4 : InScope (fun x => x ∈ VLCtx.fvars ((some { name := NameGenerator.curr ngen }, d) :: Δ)) e fv✝ : FVarId h2 : NameGenerator.Reserves ngen fv✝ h1 : fv✝ = { name := NameGenerator.curr ngen } ∨ fv✝ ∈ VLCtx.fvars Δ ⊢ fv✝ ∈ VLCtx.fvars Δ
Please generate a tactic in lean4 to solve the state. STATE: case refine_1 env : VEnv d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e A : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some { name := NameGenerator.curr ngen }, d) :: Δ) H : ConditionallyHasType ngen env Us Δ e A H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (NameGenerator.Reserves ngen) A H3 : InScope (fun x => x ∈ VLCtx.fvars Δ) e → TrHasType env Us Δ e A H4 : InScope (fun x => x ∈ VLCtx.fvars ((some { name := NameGenerator.curr ngen }, d) :: Δ)) e fv✝ : FVarId h1 : fv✝ ∈ VLCtx.fvars ((some { name := NameGenerator.curr ngen }, d) :: Δ) h2 : NameGenerator.Reserves ngen fv✝ ⊢ fv✝ ∈ VLCtx.fvars Δ TACTIC:
https://github.com/digama0/lean4lean.git
c534f13d8d25f5e1891b6d18cc76b601ee87aa66
Lean4Lean/Verify/Typing/ConditionallyTyped.lean
Lean4Lean.ConditionallyHasType.fresh
[69, 1]
[80, 15]
rcases h1 with rfl | h1
case refine_1 env : VEnv d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e A : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some { name := NameGenerator.curr ngen }, d) :: Δ) H : ConditionallyHasType ngen env Us Δ e A H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (NameGenerator.Reserves ngen) A H3 : InScope (fun x => x ∈ VLCtx.fvars Δ) e → TrHasType env Us Δ e A H4 : InScope (fun x => x ∈ VLCtx.fvars ((some { name := NameGenerator.curr ngen }, d) :: Δ)) e fv✝ : FVarId h2 : NameGenerator.Reserves ngen fv✝ h1 : fv✝ = { name := NameGenerator.curr ngen } ∨ fv✝ ∈ VLCtx.fvars Δ ⊢ fv✝ ∈ VLCtx.fvars Δ
case refine_1.inl env : VEnv d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e A : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some { name := NameGenerator.curr ngen }, d) :: Δ) H : ConditionallyHasType ngen env Us Δ e A H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (NameGenerator.Reserves ngen) A H3 : InScope (fun x => x ∈ VLCtx.fvars Δ) e → TrHasType env Us Δ e A H4 : InScope (fun x => x ∈ VLCtx.fvars ((some { name := NameGenerator.curr ngen }, d) :: Δ)) e h2 : NameGenerator.Reserves ngen { name := NameGenerator.curr ngen } ⊢ { name := NameGenerator.curr ngen } ∈ VLCtx.fvars Δ case refine_1.inr env : VEnv d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e A : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some { name := NameGenerator.curr ngen }, d) :: Δ) H : ConditionallyHasType ngen env Us Δ e A H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (NameGenerator.Reserves ngen) A H3 : InScope (fun x => x ∈ VLCtx.fvars Δ) e → TrHasType env Us Δ e A H4 : InScope (fun x => x ∈ VLCtx.fvars ((some { name := NameGenerator.curr ngen }, d) :: Δ)) e fv✝ : FVarId h2 : NameGenerator.Reserves ngen fv✝ h1 : fv✝ ∈ VLCtx.fvars Δ ⊢ fv✝ ∈ VLCtx.fvars Δ
Please generate a tactic in lean4 to solve the state. STATE: case refine_1 env : VEnv d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e A : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some { name := NameGenerator.curr ngen }, d) :: Δ) H : ConditionallyHasType ngen env Us Δ e A H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (NameGenerator.Reserves ngen) A H3 : InScope (fun x => x ∈ VLCtx.fvars Δ) e → TrHasType env Us Δ e A H4 : InScope (fun x => x ∈ VLCtx.fvars ((some { name := NameGenerator.curr ngen }, d) :: Δ)) e fv✝ : FVarId h2 : NameGenerator.Reserves ngen fv✝ h1 : fv✝ = { name := NameGenerator.curr ngen } ∨ fv✝ ∈ VLCtx.fvars Δ ⊢ fv✝ ∈ VLCtx.fvars Δ TACTIC:
https://github.com/digama0/lean4lean.git
c534f13d8d25f5e1891b6d18cc76b601ee87aa66
Lean4Lean/Verify/Typing/ConditionallyTyped.lean
Lean4Lean.ConditionallyHasType.fresh
[69, 1]
[80, 15]
cases Nat.lt_irrefl _ (h2 _ rfl)
case refine_1.inl env : VEnv d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e A : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some { name := NameGenerator.curr ngen }, d) :: Δ) H : ConditionallyHasType ngen env Us Δ e A H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (NameGenerator.Reserves ngen) A H3 : InScope (fun x => x ∈ VLCtx.fvars Δ) e → TrHasType env Us Δ e A H4 : InScope (fun x => x ∈ VLCtx.fvars ((some { name := NameGenerator.curr ngen }, d) :: Δ)) e h2 : NameGenerator.Reserves ngen { name := NameGenerator.curr ngen } ⊢ { name := NameGenerator.curr ngen } ∈ VLCtx.fvars Δ
no goals
Please generate a tactic in lean4 to solve the state. STATE: case refine_1.inl env : VEnv d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e A : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some { name := NameGenerator.curr ngen }, d) :: Δ) H : ConditionallyHasType ngen env Us Δ e A H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (NameGenerator.Reserves ngen) A H3 : InScope (fun x => x ∈ VLCtx.fvars Δ) e → TrHasType env Us Δ e A H4 : InScope (fun x => x ∈ VLCtx.fvars ((some { name := NameGenerator.curr ngen }, d) :: Δ)) e h2 : NameGenerator.Reserves ngen { name := NameGenerator.curr ngen } ⊢ { name := NameGenerator.curr ngen } ∈ VLCtx.fvars Δ TACTIC:
https://github.com/digama0/lean4lean.git
c534f13d8d25f5e1891b6d18cc76b601ee87aa66
Lean4Lean/Verify/Typing/ConditionallyTyped.lean
Lean4Lean.ConditionallyHasType.fresh
[69, 1]
[80, 15]
exact h1
case refine_1.inr env : VEnv d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e A : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some { name := NameGenerator.curr ngen }, d) :: Δ) H : ConditionallyHasType ngen env Us Δ e A H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (NameGenerator.Reserves ngen) A H3 : InScope (fun x => x ∈ VLCtx.fvars Δ) e → TrHasType env Us Δ e A H4 : InScope (fun x => x ∈ VLCtx.fvars ((some { name := NameGenerator.curr ngen }, d) :: Δ)) e fv✝ : FVarId h2 : NameGenerator.Reserves ngen fv✝ h1 : fv✝ ∈ VLCtx.fvars Δ ⊢ fv✝ ∈ VLCtx.fvars Δ
no goals
Please generate a tactic in lean4 to solve the state. STATE: case refine_1.inr env : VEnv d : VLocalDecl Δ : List (Option FVarId × VLocalDecl) ngen : NameGenerator Us : List Name e A : Expr henv : Ordered env hΔ : VLCtx.WF env (List.length Us) ((some { name := NameGenerator.curr ngen }, d) :: Δ) H : ConditionallyHasType ngen env Us Δ e A H1 : InScope (NameGenerator.Reserves ngen) e H2 : InScope (NameGenerator.Reserves ngen) A H3 : InScope (fun x => x ∈ VLCtx.fvars Δ) e → TrHasType env Us Δ e A H4 : InScope (fun x => x ∈ VLCtx.fvars ((some { name := NameGenerator.curr ngen }, d) :: Δ)) e fv✝ : FVarId h2 : NameGenerator.Reserves ngen fv✝ h1 : fv✝ ∈ VLCtx.fvars Δ ⊢ fv✝ ∈ VLCtx.fvars Δ TACTIC:
https://github.com/digama0/lean4lean.git
c534f13d8d25f5e1891b6d18cc76b601ee87aa66
Lean4Lean/Verify/Axioms.lean
Lean.PersistentArray.size_push
[29, 9]
[31, 66]
simp [push]
α : Type u_1 arr : PersistentArray α x : α ⊢ (push arr x).size = arr.size + 1
α : Type u_1 arr : PersistentArray α x : α ⊢ (if Array.size arr.tail + 1 < USize.toNat branching ∨ tooBig ≤ arr.size then { root := arr.root, tail := Array.push arr.tail x, size := arr.size + 1, shift := arr.shift, tailOff := arr.tailOff } else mkNewTail { root := arr.root, tail := Array.push arr.tail x, size := arr.size + 1, shift := arr.shift, tailOff := arr.tailOff }).size = arr.size + 1
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 arr : PersistentArray α x : α ⊢ (push arr x).size = arr.size + 1 TACTIC:
https://github.com/digama0/lean4lean.git
c534f13d8d25f5e1891b6d18cc76b601ee87aa66
Lean4Lean/Verify/Axioms.lean
Lean.PersistentArray.size_push
[29, 9]
[31, 66]
split <;> [rfl; (simp [mkNewTail]; split <;> rfl)]
α : Type u_1 arr : PersistentArray α x : α ⊢ (if Array.size arr.tail + 1 < USize.toNat branching ∨ tooBig ≤ arr.size then { root := arr.root, tail := Array.push arr.tail x, size := arr.size + 1, shift := arr.shift, tailOff := arr.tailOff } else mkNewTail { root := arr.root, tail := Array.push arr.tail x, size := arr.size + 1, shift := arr.shift, tailOff := arr.tailOff }).size = arr.size + 1
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 arr : PersistentArray α x : α ⊢ (if Array.size arr.tail + 1 < USize.toNat branching ∨ tooBig ≤ arr.size then { root := arr.root, tail := Array.push arr.tail x, size := arr.size + 1, shift := arr.shift, tailOff := arr.tailOff } else mkNewTail { root := arr.root, tail := Array.push arr.tail x, size := arr.size + 1, shift := arr.shift, tailOff := arr.tailOff }).size = arr.size + 1 TACTIC:
https://github.com/digama0/lean4lean.git
c534f13d8d25f5e1891b6d18cc76b601ee87aa66
Lean4Lean/Verify/Axioms.lean
Lean.PersistentArray.size_push
[29, 9]
[31, 66]
simp [mkNewTail]
case inr α : Type u_1 arr : PersistentArray α x : α h✝ : ¬(Array.size arr.tail + 1 < USize.toNat branching ∨ tooBig ≤ arr.size) ⊢ (mkNewTail { root := arr.root, tail := Array.push arr.tail x, size := arr.size + 1, shift := arr.shift, tailOff := arr.tailOff }).size = arr.size + 1
case inr α : Type u_1 arr : PersistentArray α x : α h✝ : ¬(Array.size arr.tail + 1 < USize.toNat branching ∨ tooBig ≤ arr.size) ⊢ (if arr.size + 1 ≤ USize.toNat (mul2Shift 1 (arr.shift + initShift)) then { root := insertNewLeaf arr.root (USize.ofNat arr.size) arr.shift (Array.push arr.tail x), tail := mkEmptyArray, size := arr.size + 1, shift := arr.shift, tailOff := arr.size + 1 } else { root := PersistentArrayNode.node (Array.push (Array.push mkEmptyArray arr.root) (mkNewPath arr.shift (Array.push arr.tail x))), tail := #[], size := arr.size + 1, shift := arr.shift + initShift, tailOff := arr.size + 1 }).size = arr.size + 1
Please generate a tactic in lean4 to solve the state. STATE: case inr α : Type u_1 arr : PersistentArray α x : α h✝ : ¬(Array.size arr.tail + 1 < USize.toNat branching ∨ tooBig ≤ arr.size) ⊢ (mkNewTail { root := arr.root, tail := Array.push arr.tail x, size := arr.size + 1, shift := arr.shift, tailOff := arr.tailOff }).size = arr.size + 1 TACTIC:
https://github.com/digama0/lean4lean.git
c534f13d8d25f5e1891b6d18cc76b601ee87aa66
Lean4Lean/Verify/Axioms.lean
Lean.PersistentArray.size_push
[29, 9]
[31, 66]
split <;> rfl
case inr α : Type u_1 arr : PersistentArray α x : α h✝ : ¬(Array.size arr.tail + 1 < USize.toNat branching ∨ tooBig ≤ arr.size) ⊢ (if arr.size + 1 ≤ USize.toNat (mul2Shift 1 (arr.shift + initShift)) then { root := insertNewLeaf arr.root (USize.ofNat arr.size) arr.shift (Array.push arr.tail x), tail := mkEmptyArray, size := arr.size + 1, shift := arr.shift, tailOff := arr.size + 1 } else { root := PersistentArrayNode.node (Array.push (Array.push mkEmptyArray arr.root) (mkNewPath arr.shift (Array.push arr.tail x))), tail := #[], size := arr.size + 1, shift := arr.shift + initShift, tailOff := arr.size + 1 }).size = arr.size + 1
no goals
Please generate a tactic in lean4 to solve the state. STATE: case inr α : Type u_1 arr : PersistentArray α x : α h✝ : ¬(Array.size arr.tail + 1 < USize.toNat branching ∨ tooBig ≤ arr.size) ⊢ (if arr.size + 1 ≤ USize.toNat (mul2Shift 1 (arr.shift + initShift)) then { root := insertNewLeaf arr.root (USize.ofNat arr.size) arr.shift (Array.push arr.tail x), tail := mkEmptyArray, size := arr.size + 1, shift := arr.shift, tailOff := arr.size + 1 } else { root := PersistentArrayNode.node (Array.push (Array.push mkEmptyArray arr.root) (mkNewPath arr.shift (Array.push arr.tail x))), tail := #[], size := arr.size + 1, shift := arr.shift + initShift, tailOff := arr.size + 1 }).size = arr.size + 1 TACTIC:
https://github.com/digama0/lean4lean.git
c534f13d8d25f5e1891b6d18cc76b601ee87aa66
Lean4Lean/Verify/Axioms.lean
Lean.PersistentArray.WF.toList'_length
[33, 9]
[34, 27]
induction h <;> simp [*]
α✝ : Type u_1 arr : PersistentArray α✝ h : WF arr ⊢ List.length (toList' arr) = arr.size
no goals
Please generate a tactic in lean4 to solve the state. STATE: α✝ : Type u_1 arr : PersistentArray α✝ h : WF arr ⊢ List.length (toList' arr) = arr.size TACTIC:
https://github.com/digama0/lean4lean.git
c534f13d8d25f5e1891b6d18cc76b601ee87aa66
Lean4Lean/Verify/Axioms.lean
Lean.PersistentHashMap.toList'_empty
[52, 9]
[57, 13]
have this n : @Node.toList' α β (.entries ⟨.replicate n .null⟩) = [] := by simp [Node.toList'] induction n <;> simp [*]
α : Type u_1 β : Type u_2 inst✝¹ : BEq α inst✝ : Hashable α ⊢ toList' empty = []
α : Type u_1 β : Type u_2 inst✝¹ : BEq α inst✝ : Hashable α this : ∀ (n : Nat), Node.toList' (Node.entries { data := List.replicate n Entry.null }) = [] ⊢ toList' empty = []
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 β : Type u_2 inst✝¹ : BEq α inst✝ : Hashable α ⊢ toList' empty = [] TACTIC:
https://github.com/digama0/lean4lean.git
c534f13d8d25f5e1891b6d18cc76b601ee87aa66
Lean4Lean/Verify/Axioms.lean
Lean.PersistentHashMap.toList'_empty
[52, 9]
[57, 13]
apply this
α : Type u_1 β : Type u_2 inst✝¹ : BEq α inst✝ : Hashable α this : ∀ (n : Nat), Node.toList' (Node.entries { data := List.replicate n Entry.null }) = [] ⊢ toList' empty = []
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 β : Type u_2 inst✝¹ : BEq α inst✝ : Hashable α this : ∀ (n : Nat), Node.toList' (Node.entries { data := List.replicate n Entry.null }) = [] ⊢ toList' empty = [] TACTIC:
https://github.com/digama0/lean4lean.git
c534f13d8d25f5e1891b6d18cc76b601ee87aa66
Lean4Lean/Verify/Axioms.lean
Lean.PersistentHashMap.toList'_empty
[52, 9]
[57, 13]
simp [Node.toList']
α : Type u_1 β : Type u_2 inst✝¹ : BEq α inst✝ : Hashable α n : Nat ⊢ Node.toList' (Node.entries { data := List.replicate n Entry.null }) = []
α : Type u_1 β : Type u_2 inst✝¹ : BEq α inst✝ : Hashable α n : Nat ⊢ Node.rec_2 (fun x => id) (fun ks xs x => List.zip ks.data xs.data) (fun x => id) [] (fun x x l1 l2 => l1 ++ l2) (fun a b => [(a, b)]) (fun x => id) [] (List.replicate n Entry.null) = []
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 β : Type u_2 inst✝¹ : BEq α inst✝ : Hashable α n : Nat ⊢ Node.toList' (Node.entries { data := List.replicate n Entry.null }) = [] TACTIC:
https://github.com/digama0/lean4lean.git
c534f13d8d25f5e1891b6d18cc76b601ee87aa66
Lean4Lean/Verify/Axioms.lean
Lean.PersistentHashMap.toList'_empty
[52, 9]
[57, 13]
induction n <;> simp [*]
α : Type u_1 β : Type u_2 inst✝¹ : BEq α inst✝ : Hashable α n : Nat ⊢ Node.rec_2 (fun x => id) (fun ks xs x => List.zip ks.data xs.data) (fun x => id) [] (fun x x l1 l2 => l1 ++ l2) (fun a b => [(a, b)]) (fun x => id) [] (List.replicate n Entry.null) = []
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 β : Type u_2 inst✝¹ : BEq α inst✝ : Hashable α n : Nat ⊢ Node.rec_2 (fun x => id) (fun ks xs x => List.zip ks.data xs.data) (fun x => id) [] (fun x x l1 l2 => l1 ++ l2) (fun a b => [(a, b)]) (fun x => id) [] (List.replicate n Entry.null) = [] TACTIC:
https://github.com/digama0/lean4lean.git
c534f13d8d25f5e1891b6d18cc76b601ee87aa66
Lean4Lean/Verify/Axioms.lean
Lean.PersistentHashMap.WF.nodupKeys
[81, 1]
[90, 49]
induction h with | empty => simp; exact .nil | insert h1 h2 ih => rw [h2.find?_eq] at h1 refine (h2.toList'_insert _ _ h1).nodupKeys_iff.2 (List.nodupKeys_cons.2 ⟨?_, ih⟩) rintro ⟨a, b⟩ h3 rfl cases h1.symm.trans (ih.lookup_eq_some.2 h3)
α : Type u_1 β : Type u_2 inst✝³ : BEq α inst✝² : Hashable α inst✝¹ : LawfulBEq α inst✝ : Std.HashMap.LawfulHashable α m : PersistentHashMap α β h : WF m ⊢ List.NodupKeys (toList' m)
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 β : Type u_2 inst✝³ : BEq α inst✝² : Hashable α inst✝¹ : LawfulBEq α inst✝ : Std.HashMap.LawfulHashable α m : PersistentHashMap α β h : WF m ⊢ List.NodupKeys (toList' m) TACTIC:
https://github.com/digama0/lean4lean.git
c534f13d8d25f5e1891b6d18cc76b601ee87aa66
Lean4Lean/Verify/Axioms.lean
Lean.PersistentHashMap.WF.nodupKeys
[81, 1]
[90, 49]
simp
case empty α : Type u_1 β : Type u_2 inst✝³ : BEq α inst✝² : Hashable α inst✝¹ : LawfulBEq α inst✝ : Std.HashMap.LawfulHashable α m : PersistentHashMap α β ⊢ List.NodupKeys (toList' PersistentHashMap.empty)
case empty α : Type u_1 β : Type u_2 inst✝³ : BEq α inst✝² : Hashable α inst✝¹ : LawfulBEq α inst✝ : Std.HashMap.LawfulHashable α m : PersistentHashMap α β ⊢ List.NodupKeys []
Please generate a tactic in lean4 to solve the state. STATE: case empty α : Type u_1 β : Type u_2 inst✝³ : BEq α inst✝² : Hashable α inst✝¹ : LawfulBEq α inst✝ : Std.HashMap.LawfulHashable α m : PersistentHashMap α β ⊢ List.NodupKeys (toList' PersistentHashMap.empty) TACTIC:
https://github.com/digama0/lean4lean.git
c534f13d8d25f5e1891b6d18cc76b601ee87aa66
Lean4Lean/Verify/Axioms.lean
Lean.PersistentHashMap.WF.nodupKeys
[81, 1]
[90, 49]
exact .nil
case empty α : Type u_1 β : Type u_2 inst✝³ : BEq α inst✝² : Hashable α inst✝¹ : LawfulBEq α inst✝ : Std.HashMap.LawfulHashable α m : PersistentHashMap α β ⊢ List.NodupKeys []
no goals
Please generate a tactic in lean4 to solve the state. STATE: case empty α : Type u_1 β : Type u_2 inst✝³ : BEq α inst✝² : Hashable α inst✝¹ : LawfulBEq α inst✝ : Std.HashMap.LawfulHashable α m : PersistentHashMap α β ⊢ List.NodupKeys [] TACTIC:
https://github.com/digama0/lean4lean.git
c534f13d8d25f5e1891b6d18cc76b601ee87aa66
Lean4Lean/Verify/Axioms.lean
Lean.PersistentHashMap.WF.nodupKeys
[81, 1]
[90, 49]
rw [h2.find?_eq] at h1
case insert α : Type u_1 β : Type u_2 inst✝³ : BEq α inst✝² : Hashable α inst✝¹ : LawfulBEq α inst✝ : Std.HashMap.LawfulHashable α m m✝ : PersistentHashMap α β a✝ : α b✝ : β h1 : find? m✝ a✝ = none h2 : WF m✝ ih : List.NodupKeys (toList' m✝) ⊢ List.NodupKeys (toList' (PersistentHashMap.insert m✝ a✝ b✝))
case insert α : Type u_1 β : Type u_2 inst✝³ : BEq α inst✝² : Hashable α inst✝¹ : LawfulBEq α inst✝ : Std.HashMap.LawfulHashable α m m✝ : PersistentHashMap α β a✝ : α b✝ : β h1 : List.lookup a✝ (toList' m✝) = none h2 : WF m✝ ih : List.NodupKeys (toList' m✝) ⊢ List.NodupKeys (toList' (PersistentHashMap.insert m✝ a✝ b✝))
Please generate a tactic in lean4 to solve the state. STATE: case insert α : Type u_1 β : Type u_2 inst✝³ : BEq α inst✝² : Hashable α inst✝¹ : LawfulBEq α inst✝ : Std.HashMap.LawfulHashable α m m✝ : PersistentHashMap α β a✝ : α b✝ : β h1 : find? m✝ a✝ = none h2 : WF m✝ ih : List.NodupKeys (toList' m✝) ⊢ List.NodupKeys (toList' (PersistentHashMap.insert m✝ a✝ b✝)) TACTIC:
https://github.com/digama0/lean4lean.git
c534f13d8d25f5e1891b6d18cc76b601ee87aa66
Lean4Lean/Verify/Axioms.lean
Lean.PersistentHashMap.WF.nodupKeys
[81, 1]
[90, 49]
refine (h2.toList'_insert _ _ h1).nodupKeys_iff.2 (List.nodupKeys_cons.2 ⟨?_, ih⟩)
case insert α : Type u_1 β : Type u_2 inst✝³ : BEq α inst✝² : Hashable α inst✝¹ : LawfulBEq α inst✝ : Std.HashMap.LawfulHashable α m m✝ : PersistentHashMap α β a✝ : α b✝ : β h1 : List.lookup a✝ (toList' m✝) = none h2 : WF m✝ ih : List.NodupKeys (toList' m✝) ⊢ List.NodupKeys (toList' (PersistentHashMap.insert m✝ a✝ b✝))
case insert α : Type u_1 β : Type u_2 inst✝³ : BEq α inst✝² : Hashable α inst✝¹ : LawfulBEq α inst✝ : Std.HashMap.LawfulHashable α m m✝ : PersistentHashMap α β a✝ : α b✝ : β h1 : List.lookup a✝ (toList' m✝) = none h2 : WF m✝ ih : List.NodupKeys (toList' m✝) ⊢ ∀ (a' : α × β), a' ∈ toList' m✝ → (a✝, b✝).fst ≠ a'.fst
Please generate a tactic in lean4 to solve the state. STATE: case insert α : Type u_1 β : Type u_2 inst✝³ : BEq α inst✝² : Hashable α inst✝¹ : LawfulBEq α inst✝ : Std.HashMap.LawfulHashable α m m✝ : PersistentHashMap α β a✝ : α b✝ : β h1 : List.lookup a✝ (toList' m✝) = none h2 : WF m✝ ih : List.NodupKeys (toList' m✝) ⊢ List.NodupKeys (toList' (PersistentHashMap.insert m✝ a✝ b✝)) TACTIC:
https://github.com/digama0/lean4lean.git
c534f13d8d25f5e1891b6d18cc76b601ee87aa66
Lean4Lean/Verify/Axioms.lean
Lean.PersistentHashMap.WF.nodupKeys
[81, 1]
[90, 49]
rintro ⟨a, b⟩ h3 rfl
case insert α : Type u_1 β : Type u_2 inst✝³ : BEq α inst✝² : Hashable α inst✝¹ : LawfulBEq α inst✝ : Std.HashMap.LawfulHashable α m m✝ : PersistentHashMap α β a✝ : α b✝ : β h1 : List.lookup a✝ (toList' m✝) = none h2 : WF m✝ ih : List.NodupKeys (toList' m✝) ⊢ ∀ (a' : α × β), a' ∈ toList' m✝ → (a✝, b✝).fst ≠ a'.fst
case insert.mk α : Type u_1 β : Type u_2 inst✝³ : BEq α inst✝² : Hashable α inst✝¹ : LawfulBEq α inst✝ : Std.HashMap.LawfulHashable α m m✝ : PersistentHashMap α β a✝ : α b✝ : β h1 : List.lookup a✝ (toList' m✝) = none h2 : WF m✝ ih : List.NodupKeys (toList' m✝) b : β h3 : ((a✝, b✝).fst, b) ∈ toList' m✝ ⊢ False
Please generate a tactic in lean4 to solve the state. STATE: case insert α : Type u_1 β : Type u_2 inst✝³ : BEq α inst✝² : Hashable α inst✝¹ : LawfulBEq α inst✝ : Std.HashMap.LawfulHashable α m m✝ : PersistentHashMap α β a✝ : α b✝ : β h1 : List.lookup a✝ (toList' m✝) = none h2 : WF m✝ ih : List.NodupKeys (toList' m✝) ⊢ ∀ (a' : α × β), a' ∈ toList' m✝ → (a✝, b✝).fst ≠ a'.fst TACTIC:
https://github.com/digama0/lean4lean.git
c534f13d8d25f5e1891b6d18cc76b601ee87aa66
Lean4Lean/Verify/Axioms.lean
Lean.PersistentHashMap.WF.nodupKeys
[81, 1]
[90, 49]
cases h1.symm.trans (ih.lookup_eq_some.2 h3)
case insert.mk α : Type u_1 β : Type u_2 inst✝³ : BEq α inst✝² : Hashable α inst✝¹ : LawfulBEq α inst✝ : Std.HashMap.LawfulHashable α m m✝ : PersistentHashMap α β a✝ : α b✝ : β h1 : List.lookup a✝ (toList' m✝) = none h2 : WF m✝ ih : List.NodupKeys (toList' m✝) b : β h3 : ((a✝, b✝).fst, b) ∈ toList' m✝ ⊢ False
no goals
Please generate a tactic in lean4 to solve the state. STATE: case insert.mk α : Type u_1 β : Type u_2 inst✝³ : BEq α inst✝² : Hashable α inst✝¹ : LawfulBEq α inst✝ : Std.HashMap.LawfulHashable α m m✝ : PersistentHashMap α β a✝ : α b✝ : β h1 : List.lookup a✝ (toList' m✝) = none h2 : WF m✝ ih : List.NodupKeys (toList' m✝) b : β h3 : ((a✝, b✝).fst, b) ∈ toList' m✝ ⊢ False TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Array.ext_iff
[26, 1]
[31, 24]
apply Iff.intro
α : Type u_1 as bs : Array α ⊢ as = bs ↔ as.data = bs.data
case mp α : Type u_1 as bs : Array α ⊢ as = bs → as.data = bs.data case mpr α : Type u_1 as bs : Array α ⊢ as.data = bs.data → as = bs
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 as bs : Array α ⊢ as = bs ↔ as.data = bs.data TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Array.ext_iff
[26, 1]
[31, 24]
. intro eq simp only [eq]
case mp α : Type u_1 as bs : Array α ⊢ as = bs → as.data = bs.data case mpr α : Type u_1 as bs : Array α ⊢ as.data = bs.data → as = bs
case mpr α : Type u_1 as bs : Array α ⊢ as.data = bs.data → as = bs
Please generate a tactic in lean4 to solve the state. STATE: case mp α : Type u_1 as bs : Array α ⊢ as = bs → as.data = bs.data case mpr α : Type u_1 as bs : Array α ⊢ as.data = bs.data → as = bs TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Array.ext_iff
[26, 1]
[31, 24]
. intro eq exact Array.ext' eq
case mpr α : Type u_1 as bs : Array α ⊢ as.data = bs.data → as = bs
no goals
Please generate a tactic in lean4 to solve the state. STATE: case mpr α : Type u_1 as bs : Array α ⊢ as.data = bs.data → as = bs TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
List.modifyLast_singleton
[33, 1]
[35, 59]
rw [← nil_append [a], modifyLast_append_one, nil_append]
α : Type u_1 f : α → α a : α ⊢ modifyLast f [a] = [f a]
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 f : α → α a : α ⊢ modifyLast f [a] = [f a] TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
String.toNatAux_accumulates
[47, 1]
[56, 9]
induction s generalizing accum with | nil => unfold toNatAux; simp | cons head tail ih => unfold toNatAux rw [ih] conv => right; rw [ih] simp [Nat.succ_eq_add_one] ring
s : List Char accum : ℕ ⊢ toNatAux s accum = toNatAux s 0 + accum * 10 ^ List.length s
no goals
Please generate a tactic in lean4 to solve the state. STATE: s : List Char accum : ℕ ⊢ toNatAux s accum = toNatAux s 0 + accum * 10 ^ List.length s TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
String.toNatAux_accumulates
[47, 1]
[56, 9]
unfold toNatAux
case nil accum : ℕ ⊢ toNatAux [] accum = toNatAux [] 0 + accum * 10 ^ List.length []
case nil accum : ℕ ⊢ accum = 0 + accum * 10 ^ List.length []
Please generate a tactic in lean4 to solve the state. STATE: case nil accum : ℕ ⊢ toNatAux [] accum = toNatAux [] 0 + accum * 10 ^ List.length [] TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
String.toNatAux_accumulates
[47, 1]
[56, 9]
simp
case nil accum : ℕ ⊢ accum = 0 + accum * 10 ^ List.length []
no goals
Please generate a tactic in lean4 to solve the state. STATE: case nil accum : ℕ ⊢ accum = 0 + accum * 10 ^ List.length [] TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
String.toNatAux_accumulates
[47, 1]
[56, 9]
unfold toNatAux
case cons head : Char tail : List Char ih : ∀ (accum : ℕ), toNatAux tail accum = toNatAux tail 0 + accum * 10 ^ List.length tail accum : ℕ ⊢ toNatAux (head :: tail) accum = toNatAux (head :: tail) 0 + accum * 10 ^ List.length (head :: tail)
case cons head : Char tail : List Char ih : ∀ (accum : ℕ), toNatAux tail accum = toNatAux tail 0 + accum * 10 ^ List.length tail accum : ℕ ⊢ toNatAux tail (accum * 10 + (Char.toNat head - Char.toNat (Char.ofNat 48))) = toNatAux tail (0 * 10 + (Char.toNat head - Char.toNat (Char.ofNat 48))) + accum * 10 ^ List.length (head :: tail)
Please generate a tactic in lean4 to solve the state. STATE: case cons head : Char tail : List Char ih : ∀ (accum : ℕ), toNatAux tail accum = toNatAux tail 0 + accum * 10 ^ List.length tail accum : ℕ ⊢ toNatAux (head :: tail) accum = toNatAux (head :: tail) 0 + accum * 10 ^ List.length (head :: tail) TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
String.toNatAux_accumulates
[47, 1]
[56, 9]
rw [ih]
case cons head : Char tail : List Char ih : ∀ (accum : ℕ), toNatAux tail accum = toNatAux tail 0 + accum * 10 ^ List.length tail accum : ℕ ⊢ toNatAux tail (accum * 10 + (Char.toNat head - Char.toNat (Char.ofNat 48))) = toNatAux tail (0 * 10 + (Char.toNat head - Char.toNat (Char.ofNat 48))) + accum * 10 ^ List.length (head :: tail)
case cons head : Char tail : List Char ih : ∀ (accum : ℕ), toNatAux tail accum = toNatAux tail 0 + accum * 10 ^ List.length tail accum : ℕ ⊢ toNatAux tail 0 + (accum * 10 + (Char.toNat head - Char.toNat (Char.ofNat 48))) * 10 ^ List.length tail = toNatAux tail (0 * 10 + (Char.toNat head - Char.toNat (Char.ofNat 48))) + accum * 10 ^ List.length (head :: tail)
Please generate a tactic in lean4 to solve the state. STATE: case cons head : Char tail : List Char ih : ∀ (accum : ℕ), toNatAux tail accum = toNatAux tail 0 + accum * 10 ^ List.length tail accum : ℕ ⊢ toNatAux tail (accum * 10 + (Char.toNat head - Char.toNat (Char.ofNat 48))) = toNatAux tail (0 * 10 + (Char.toNat head - Char.toNat (Char.ofNat 48))) + accum * 10 ^ List.length (head :: tail) TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
String.toNatAux_accumulates
[47, 1]
[56, 9]
conv => right; rw [ih]
case cons head : Char tail : List Char ih : ∀ (accum : ℕ), toNatAux tail accum = toNatAux tail 0 + accum * 10 ^ List.length tail accum : ℕ ⊢ toNatAux tail 0 + (accum * 10 + (Char.toNat head - Char.toNat (Char.ofNat 48))) * 10 ^ List.length tail = toNatAux tail (0 * 10 + (Char.toNat head - Char.toNat (Char.ofNat 48))) + accum * 10 ^ List.length (head :: tail)
case cons head : Char tail : List Char ih : ∀ (accum : ℕ), toNatAux tail accum = toNatAux tail 0 + accum * 10 ^ List.length tail accum : ℕ ⊢ toNatAux tail 0 + (accum * 10 + (Char.toNat head - Char.toNat (Char.ofNat 48))) * 10 ^ List.length tail = toNatAux tail 0 + (0 * 10 + (Char.toNat head - Char.toNat (Char.ofNat 48))) * 10 ^ List.length tail + accum * 10 ^ List.length (head :: tail)
Please generate a tactic in lean4 to solve the state. STATE: case cons head : Char tail : List Char ih : ∀ (accum : ℕ), toNatAux tail accum = toNatAux tail 0 + accum * 10 ^ List.length tail accum : ℕ ⊢ toNatAux tail 0 + (accum * 10 + (Char.toNat head - Char.toNat (Char.ofNat 48))) * 10 ^ List.length tail = toNatAux tail (0 * 10 + (Char.toNat head - Char.toNat (Char.ofNat 48))) + accum * 10 ^ List.length (head :: tail) TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
String.toNatAux_accumulates
[47, 1]
[56, 9]
simp [Nat.succ_eq_add_one]
case cons head : Char tail : List Char ih : ∀ (accum : ℕ), toNatAux tail accum = toNatAux tail 0 + accum * 10 ^ List.length tail accum : ℕ ⊢ toNatAux tail 0 + (accum * 10 + (Char.toNat head - Char.toNat (Char.ofNat 48))) * 10 ^ List.length tail = toNatAux tail 0 + (0 * 10 + (Char.toNat head - Char.toNat (Char.ofNat 48))) * 10 ^ List.length tail + accum * 10 ^ List.length (head :: tail)
case cons head : Char tail : List Char ih : ∀ (accum : ℕ), toNatAux tail accum = toNatAux tail 0 + accum * 10 ^ List.length tail accum : ℕ ⊢ toNatAux tail 0 + (accum * 10 + (Char.toNat head - Char.toNat (Char.ofNat 48))) * 10 ^ List.length tail = toNatAux tail 0 + (Char.toNat head - Char.toNat (Char.ofNat 48)) * 10 ^ List.length tail + accum * 10 ^ (List.length tail + 1)
Please generate a tactic in lean4 to solve the state. STATE: case cons head : Char tail : List Char ih : ∀ (accum : ℕ), toNatAux tail accum = toNatAux tail 0 + accum * 10 ^ List.length tail accum : ℕ ⊢ toNatAux tail 0 + (accum * 10 + (Char.toNat head - Char.toNat (Char.ofNat 48))) * 10 ^ List.length tail = toNatAux tail 0 + (0 * 10 + (Char.toNat head - Char.toNat (Char.ofNat 48))) * 10 ^ List.length tail + accum * 10 ^ List.length (head :: tail) TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
String.toNatAux_accumulates
[47, 1]
[56, 9]
ring
case cons head : Char tail : List Char ih : ∀ (accum : ℕ), toNatAux tail accum = toNatAux tail 0 + accum * 10 ^ List.length tail accum : ℕ ⊢ toNatAux tail 0 + (accum * 10 + (Char.toNat head - Char.toNat (Char.ofNat 48))) * 10 ^ List.length tail = toNatAux tail 0 + (Char.toNat head - Char.toNat (Char.ofNat 48)) * 10 ^ List.length tail + accum * 10 ^ (List.length tail + 1)
no goals
Please generate a tactic in lean4 to solve the state. STATE: case cons head : Char tail : List Char ih : ∀ (accum : ℕ), toNatAux tail accum = toNatAux tail 0 + accum * 10 ^ List.length tail accum : ℕ ⊢ toNatAux tail 0 + (accum * 10 + (Char.toNat head - Char.toNat (Char.ofNat 48))) * 10 ^ List.length tail = toNatAux tail 0 + (Char.toNat head - Char.toNat (Char.ofNat 48)) * 10 ^ List.length tail + accum * 10 ^ (List.length tail + 1) TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
String.toNatΔ_cons
[59, 1]
[63, 7]
unfold String.toNatΔ
head : Char tail : List Char ⊢ toNatΔ (head :: tail) = (Char.toNat head - Char.toNat (Char.ofNat 48)) * 10 ^ List.length tail + toNatΔ tail
head : Char tail : List Char ⊢ toNatAux (head :: tail) 0 = (Char.toNat head - Char.toNat (Char.ofNat 48)) * 10 ^ List.length tail + toNatAux tail 0
Please generate a tactic in lean4 to solve the state. STATE: head : Char tail : List Char ⊢ toNatΔ (head :: tail) = (Char.toNat head - Char.toNat (Char.ofNat 48)) * 10 ^ List.length tail + toNatΔ tail TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
String.toNatΔ_cons
[59, 1]
[63, 7]
rw [String.toNatAux, String.toNatAux_accumulates]
head : Char tail : List Char ⊢ toNatAux (head :: tail) 0 = (Char.toNat head - Char.toNat (Char.ofNat 48)) * 10 ^ List.length tail + toNatAux tail 0
head : Char tail : List Char ⊢ toNatAux tail 0 + (0 * 10 + (Char.toNat head - Char.toNat (Char.ofNat 48))) * 10 ^ List.length tail = (Char.toNat head - Char.toNat (Char.ofNat 48)) * 10 ^ List.length tail + toNatAux tail 0
Please generate a tactic in lean4 to solve the state. STATE: head : Char tail : List Char ⊢ toNatAux (head :: tail) 0 = (Char.toNat head - Char.toNat (Char.ofNat 48)) * 10 ^ List.length tail + toNatAux tail 0 TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
String.toNatΔ_cons
[59, 1]
[63, 7]
ring
head : Char tail : List Char ⊢ toNatAux tail 0 + (0 * 10 + (Char.toNat head - Char.toNat (Char.ofNat 48))) * 10 ^ List.length tail = (Char.toNat head - Char.toNat (Char.ofNat 48)) * 10 ^ List.length tail + toNatAux tail 0
no goals
Please generate a tactic in lean4 to solve the state. STATE: head : Char tail : List Char ⊢ toNatAux tail 0 + (0 * 10 + (Char.toNat head - Char.toNat (Char.ofNat 48))) * 10 ^ List.length tail = (Char.toNat head - Char.toNat (Char.ofNat 48)) * 10 ^ List.length tail + toNatAux tail 0 TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_ne_nil
[78, 1]
[92, 11]
unfold Nat.toDigitsCore
f n b : ℕ a : List Char P : f > n ⊢ toDigitsCore b f n a ≠ []
f n b : ℕ a : List Char P : f > n ⊢ (match f, n, a with | 0, x, ds => ds | succ fuel, n, ds => let d := digitChar (n % b); let n' := n / b; if n' = 0 then d :: ds else toDigitsCore b fuel n' (d :: ds)) ≠ []
Please generate a tactic in lean4 to solve the state. STATE: f n b : ℕ a : List Char P : f > n ⊢ toDigitsCore b f n a ≠ [] TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_ne_nil
[78, 1]
[92, 11]
split
f n b : ℕ a : List Char P : f > n ⊢ (match f, n, a with | 0, x, ds => ds | succ fuel, n, ds => let d := digitChar (n % b); let n' := n / b; if n' = 0 then d :: ds else toDigitsCore b fuel n' (d :: ds)) ≠ []
case h_1 n b : ℕ a : List Char x✝² x✝¹ : ℕ x✝ : List Char P : 0 > n ⊢ a ≠ [] case h_2 n b : ℕ a : List Char x✝² x✝¹ : ℕ x✝ : List Char fuel✝ : ℕ P : succ fuel✝ > n ⊢ (let d := digitChar (n % b); let n' := n / b; if n' = 0 then d :: a else toDigitsCore b fuel✝ n' (d :: a)) ≠ []
Please generate a tactic in lean4 to solve the state. STATE: f n b : ℕ a : List Char P : f > n ⊢ (match f, n, a with | 0, x, ds => ds | succ fuel, n, ds => let d := digitChar (n % b); let n' := n / b; if n' = 0 then d :: ds else toDigitsCore b fuel n' (d :: ds)) ≠ [] TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_ne_nil
[78, 1]
[92, 11]
. case _ => contradiction
case h_1 n b : ℕ a : List Char x✝² x✝¹ : ℕ x✝ : List Char P : 0 > n ⊢ a ≠ [] case h_2 n b : ℕ a : List Char x✝² x✝¹ : ℕ x✝ : List Char fuel✝ : ℕ P : succ fuel✝ > n ⊢ (let d := digitChar (n % b); let n' := n / b; if n' = 0 then d :: a else toDigitsCore b fuel✝ n' (d :: a)) ≠ []
case h_2 n b : ℕ a : List Char x✝² x✝¹ : ℕ x✝ : List Char fuel✝ : ℕ P : succ fuel✝ > n ⊢ (let d := digitChar (n % b); let n' := n / b; if n' = 0 then d :: a else toDigitsCore b fuel✝ n' (d :: a)) ≠ []
Please generate a tactic in lean4 to solve the state. STATE: case h_1 n b : ℕ a : List Char x✝² x✝¹ : ℕ x✝ : List Char P : 0 > n ⊢ a ≠ [] case h_2 n b : ℕ a : List Char x✝² x✝¹ : ℕ x✝ : List Char fuel✝ : ℕ P : succ fuel✝ > n ⊢ (let d := digitChar (n % b); let n' := n / b; if n' = 0 then d :: a else toDigitsCore b fuel✝ n' (d :: a)) ≠ [] TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_ne_nil
[78, 1]
[92, 11]
. case _ _ _ _ fuel => simp have h: ∀x, List.length (Nat.toDigitsCore b fuel (n / b) (x :: a)) ≠ 0 := by simp [Nat.to_digits_core_lens_eq] split case _ => simp case _ => intro P₂ apply h rw [P₂] simp
case h_2 n b : ℕ a : List Char x✝² x✝¹ : ℕ x✝ : List Char fuel✝ : ℕ P : succ fuel✝ > n ⊢ (let d := digitChar (n % b); let n' := n / b; if n' = 0 then d :: a else toDigitsCore b fuel✝ n' (d :: a)) ≠ []
no goals
Please generate a tactic in lean4 to solve the state. STATE: case h_2 n b : ℕ a : List Char x✝² x✝¹ : ℕ x✝ : List Char fuel✝ : ℕ P : succ fuel✝ > n ⊢ (let d := digitChar (n % b); let n' := n / b; if n' = 0 then d :: a else toDigitsCore b fuel✝ n' (d :: a)) ≠ [] TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_ne_nil
[78, 1]
[92, 11]
contradiction
n b : ℕ a : List Char x✝² x✝¹ : ℕ x✝ : List Char P : 0 > n ⊢ a ≠ []
no goals
Please generate a tactic in lean4 to solve the state. STATE: n b : ℕ a : List Char x✝² x✝¹ : ℕ x✝ : List Char P : 0 > n ⊢ a ≠ [] TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_ne_nil
[78, 1]
[92, 11]
simp
n b : ℕ a : List Char x✝² x✝¹ : ℕ x✝ : List Char fuel : ℕ P : succ fuel > n ⊢ (let d := digitChar (n % b); let n' := n / b; if n' = 0 then d :: a else toDigitsCore b fuel n' (d :: a)) ≠ []
n b : ℕ a : List Char x✝² x✝¹ : ℕ x✝ : List Char fuel : ℕ P : succ fuel > n ⊢ ¬(if n / b = 0 then digitChar (n % b) :: a else toDigitsCore b fuel (n / b) (digitChar (n % b) :: a)) = []
Please generate a tactic in lean4 to solve the state. STATE: n b : ℕ a : List Char x✝² x✝¹ : ℕ x✝ : List Char fuel : ℕ P : succ fuel > n ⊢ (let d := digitChar (n % b); let n' := n / b; if n' = 0 then d :: a else toDigitsCore b fuel n' (d :: a)) ≠ [] TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_ne_nil
[78, 1]
[92, 11]
have h: ∀x, List.length (Nat.toDigitsCore b fuel (n / b) (x :: a)) ≠ 0 := by simp [Nat.to_digits_core_lens_eq]
n b : ℕ a : List Char x✝² x✝¹ : ℕ x✝ : List Char fuel : ℕ P : succ fuel > n ⊢ ¬(if n / b = 0 then digitChar (n % b) :: a else toDigitsCore b fuel (n / b) (digitChar (n % b) :: a)) = []
n b : ℕ a : List Char x✝² x✝¹ : ℕ x✝ : List Char fuel : ℕ P : succ fuel > n h : ∀ (x : Char), List.length (toDigitsCore b fuel (n / b) (x :: a)) ≠ 0 ⊢ ¬(if n / b = 0 then digitChar (n % b) :: a else toDigitsCore b fuel (n / b) (digitChar (n % b) :: a)) = []
Please generate a tactic in lean4 to solve the state. STATE: n b : ℕ a : List Char x✝² x✝¹ : ℕ x✝ : List Char fuel : ℕ P : succ fuel > n ⊢ ¬(if n / b = 0 then digitChar (n % b) :: a else toDigitsCore b fuel (n / b) (digitChar (n % b) :: a)) = [] TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_ne_nil
[78, 1]
[92, 11]
split
n b : ℕ a : List Char x✝² x✝¹ : ℕ x✝ : List Char fuel : ℕ P : succ fuel > n h : ∀ (x : Char), List.length (toDigitsCore b fuel (n / b) (x :: a)) ≠ 0 ⊢ ¬(if n / b = 0 then digitChar (n % b) :: a else toDigitsCore b fuel (n / b) (digitChar (n % b) :: a)) = []
case inl n b : ℕ a : List Char x✝² x✝¹ : ℕ x✝ : List Char fuel : ℕ P : succ fuel > n h : ∀ (x : Char), List.length (toDigitsCore b fuel (n / b) (x :: a)) ≠ 0 h✝ : n / b = 0 ⊢ ¬False case inr n b : ℕ a : List Char x✝² x✝¹ : ℕ x✝ : List Char fuel : ℕ P : succ fuel > n h : ∀ (x : Char), List.length (toDigitsCore b fuel (n / b) (x :: a)) ≠ 0 h✝ : ¬n / b = 0 ⊢ ¬toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) = []
Please generate a tactic in lean4 to solve the state. STATE: n b : ℕ a : List Char x✝² x✝¹ : ℕ x✝ : List Char fuel : ℕ P : succ fuel > n h : ∀ (x : Char), List.length (toDigitsCore b fuel (n / b) (x :: a)) ≠ 0 ⊢ ¬(if n / b = 0 then digitChar (n % b) :: a else toDigitsCore b fuel (n / b) (digitChar (n % b) :: a)) = [] TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_ne_nil
[78, 1]
[92, 11]
case _ => simp
n b : ℕ a : List Char x✝² x✝¹ : ℕ x✝ : List Char fuel : ℕ P : succ fuel > n h : ∀ (x : Char), List.length (toDigitsCore b fuel (n / b) (x :: a)) ≠ 0 h✝ : n / b = 0 ⊢ ¬False
no goals
Please generate a tactic in lean4 to solve the state. STATE: n b : ℕ a : List Char x✝² x✝¹ : ℕ x✝ : List Char fuel : ℕ P : succ fuel > n h : ∀ (x : Char), List.length (toDigitsCore b fuel (n / b) (x :: a)) ≠ 0 h✝ : n / b = 0 ⊢ ¬False TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_ne_nil
[78, 1]
[92, 11]
case _ => intro P₂ apply h rw [P₂] simp
n b : ℕ a : List Char x✝² x✝¹ : ℕ x✝ : List Char fuel : ℕ P : succ fuel > n h : ∀ (x : Char), List.length (toDigitsCore b fuel (n / b) (x :: a)) ≠ 0 h✝ : ¬n / b = 0 ⊢ ¬toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) = []
no goals
Please generate a tactic in lean4 to solve the state. STATE: n b : ℕ a : List Char x✝² x✝¹ : ℕ x✝ : List Char fuel : ℕ P : succ fuel > n h : ∀ (x : Char), List.length (toDigitsCore b fuel (n / b) (x :: a)) ≠ 0 h✝ : ¬n / b = 0 ⊢ ¬toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) = [] TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_ne_nil
[78, 1]
[92, 11]
simp [Nat.to_digits_core_lens_eq]
n b : ℕ a : List Char x✝² x✝¹ : ℕ x✝ : List Char fuel : ℕ P : succ fuel > n ⊢ ∀ (x : Char), List.length (toDigitsCore b fuel (n / b) (x :: a)) ≠ 0
no goals
Please generate a tactic in lean4 to solve the state. STATE: n b : ℕ a : List Char x✝² x✝¹ : ℕ x✝ : List Char fuel : ℕ P : succ fuel > n ⊢ ∀ (x : Char), List.length (toDigitsCore b fuel (n / b) (x :: a)) ≠ 0 TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_ne_nil
[78, 1]
[92, 11]
simp
n b : ℕ a : List Char x✝² x✝¹ : ℕ x✝ : List Char fuel : ℕ P : succ fuel > n h : ∀ (x : Char), List.length (toDigitsCore b fuel (n / b) (x :: a)) ≠ 0 h✝ : n / b = 0 ⊢ ¬False
no goals
Please generate a tactic in lean4 to solve the state. STATE: n b : ℕ a : List Char x✝² x✝¹ : ℕ x✝ : List Char fuel : ℕ P : succ fuel > n h : ∀ (x : Char), List.length (toDigitsCore b fuel (n / b) (x :: a)) ≠ 0 h✝ : n / b = 0 ⊢ ¬False TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_ne_nil
[78, 1]
[92, 11]
intro P₂
n b : ℕ a : List Char x✝² x✝¹ : ℕ x✝ : List Char fuel : ℕ P : succ fuel > n h : ∀ (x : Char), List.length (toDigitsCore b fuel (n / b) (x :: a)) ≠ 0 h✝ : ¬n / b = 0 ⊢ ¬toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) = []
n b : ℕ a : List Char x✝² x✝¹ : ℕ x✝ : List Char fuel : ℕ P : succ fuel > n h : ∀ (x : Char), List.length (toDigitsCore b fuel (n / b) (x :: a)) ≠ 0 h✝ : ¬n / b = 0 P₂ : toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) = [] ⊢ False
Please generate a tactic in lean4 to solve the state. STATE: n b : ℕ a : List Char x✝² x✝¹ : ℕ x✝ : List Char fuel : ℕ P : succ fuel > n h : ∀ (x : Char), List.length (toDigitsCore b fuel (n / b) (x :: a)) ≠ 0 h✝ : ¬n / b = 0 ⊢ ¬toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) = [] TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_ne_nil
[78, 1]
[92, 11]
apply h
n b : ℕ a : List Char x✝² x✝¹ : ℕ x✝ : List Char fuel : ℕ P : succ fuel > n h : ∀ (x : Char), List.length (toDigitsCore b fuel (n / b) (x :: a)) ≠ 0 h✝ : ¬n / b = 0 P₂ : toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) = [] ⊢ False
case a n b : ℕ a : List Char x✝² x✝¹ : ℕ x✝ : List Char fuel : ℕ P : succ fuel > n h : ∀ (x : Char), List.length (toDigitsCore b fuel (n / b) (x :: a)) ≠ 0 h✝ : ¬n / b = 0 P₂ : toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) = [] ⊢ List.length (toDigitsCore b fuel (n / b) (?x :: a)) = 0 case x n b : ℕ a : List Char x✝² x✝¹ : ℕ x✝ : List Char fuel : ℕ P : succ fuel > n h : ∀ (x : Char), List.length (toDigitsCore b fuel (n / b) (x :: a)) ≠ 0 h✝ : ¬n / b = 0 P₂ : toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) = [] ⊢ Char
Please generate a tactic in lean4 to solve the state. STATE: n b : ℕ a : List Char x✝² x✝¹ : ℕ x✝ : List Char fuel : ℕ P : succ fuel > n h : ∀ (x : Char), List.length (toDigitsCore b fuel (n / b) (x :: a)) ≠ 0 h✝ : ¬n / b = 0 P₂ : toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) = [] ⊢ False TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_ne_nil
[78, 1]
[92, 11]
rw [P₂]
case a n b : ℕ a : List Char x✝² x✝¹ : ℕ x✝ : List Char fuel : ℕ P : succ fuel > n h : ∀ (x : Char), List.length (toDigitsCore b fuel (n / b) (x :: a)) ≠ 0 h✝ : ¬n / b = 0 P₂ : toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) = [] ⊢ List.length (toDigitsCore b fuel (n / b) (?x :: a)) = 0 case x n b : ℕ a : List Char x✝² x✝¹ : ℕ x✝ : List Char fuel : ℕ P : succ fuel > n h : ∀ (x : Char), List.length (toDigitsCore b fuel (n / b) (x :: a)) ≠ 0 h✝ : ¬n / b = 0 P₂ : toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) = [] ⊢ Char
case a n b : ℕ a : List Char x✝² x✝¹ : ℕ x✝ : List Char fuel : ℕ P : succ fuel > n h : ∀ (x : Char), List.length (toDigitsCore b fuel (n / b) (x :: a)) ≠ 0 h✝ : ¬n / b = 0 P₂ : toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) = [] ⊢ List.length [] = 0
Please generate a tactic in lean4 to solve the state. STATE: case a n b : ℕ a : List Char x✝² x✝¹ : ℕ x✝ : List Char fuel : ℕ P : succ fuel > n h : ∀ (x : Char), List.length (toDigitsCore b fuel (n / b) (x :: a)) ≠ 0 h✝ : ¬n / b = 0 P₂ : toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) = [] ⊢ List.length (toDigitsCore b fuel (n / b) (?x :: a)) = 0 case x n b : ℕ a : List Char x✝² x✝¹ : ℕ x✝ : List Char fuel : ℕ P : succ fuel > n h : ∀ (x : Char), List.length (toDigitsCore b fuel (n / b) (x :: a)) ≠ 0 h✝ : ¬n / b = 0 P₂ : toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) = [] ⊢ Char TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigitsCore_ne_nil
[78, 1]
[92, 11]
simp
case a n b : ℕ a : List Char x✝² x✝¹ : ℕ x✝ : List Char fuel : ℕ P : succ fuel > n h : ∀ (x : Char), List.length (toDigitsCore b fuel (n / b) (x :: a)) ≠ 0 h✝ : ¬n / b = 0 P₂ : toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) = [] ⊢ List.length [] = 0
no goals
Please generate a tactic in lean4 to solve the state. STATE: case a n b : ℕ a : List Char x✝² x✝¹ : ℕ x✝ : List Char fuel : ℕ P : succ fuel > n h : ∀ (x : Char), List.length (toDigitsCore b fuel (n / b) (x :: a)) ≠ 0 h✝ : ¬n / b = 0 P₂ : toDigitsCore b fuel (n / b) (digitChar (n % b) :: a) = [] ⊢ List.length [] = 0 TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigits_ne_nil
[94, 1]
[96, 33]
unfold Nat.toDigits
b n : ℕ ⊢ toDigits b n ≠ []
b n : ℕ ⊢ toDigitsCore b (n + 1) n [] ≠ []
Please generate a tactic in lean4 to solve the state. STATE: b n : ℕ ⊢ toDigits b n ≠ [] TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Nat.toDigits_ne_nil
[94, 1]
[96, 33]
simp [Nat.toDigitsCore_ne_nil]
b n : ℕ ⊢ toDigitsCore b (n + 1) n [] ≠ []
no goals
Please generate a tactic in lean4 to solve the state. STATE: b n : ℕ ⊢ toDigitsCore b (n + 1) n [] ≠ [] TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Int.reprΔ_ne_nil
[98, 1]
[102, 73]
unfold Int.reprΔ
i : ℤ ⊢ reprΔ i ≠ []
i : ℤ ⊢ (match i with | ofNat m => Nat.toDigits 10 m | -[m+1] => [Char.ofNat 45] ++ Nat.toDigits 10 (Nat.succ m)) ≠ []
Please generate a tactic in lean4 to solve the state. STATE: i : ℤ ⊢ reprΔ i ≠ [] TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Int.reprΔ_ne_nil
[98, 1]
[102, 73]
cases i with | ofNat m => simp only; apply Nat.toDigits_ne_nil | negSucc m => simp only [List.singleton_append, ne_eq, not_false_iff]
i : ℤ ⊢ (match i with | ofNat m => Nat.toDigits 10 m | -[m+1] => [Char.ofNat 45] ++ Nat.toDigits 10 (Nat.succ m)) ≠ []
no goals
Please generate a tactic in lean4 to solve the state. STATE: i : ℤ ⊢ (match i with | ofNat m => Nat.toDigits 10 m | -[m+1] => [Char.ofNat 45] ++ Nat.toDigits 10 (Nat.succ m)) ≠ [] TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Int.reprΔ_ne_nil
[98, 1]
[102, 73]
simp only
case ofNat m : ℕ ⊢ (match ofNat m with | ofNat m => Nat.toDigits 10 m | -[m+1] => [Char.ofNat 45] ++ Nat.toDigits 10 (Nat.succ m)) ≠ []
case ofNat m : ℕ ⊢ Nat.toDigits 10 m ≠ []
Please generate a tactic in lean4 to solve the state. STATE: case ofNat m : ℕ ⊢ (match ofNat m with | ofNat m => Nat.toDigits 10 m | -[m+1] => [Char.ofNat 45] ++ Nat.toDigits 10 (Nat.succ m)) ≠ [] TACTIC:
https://github.com/jeremysalwen/advent_of_lean_2022.git
96035d07c4f9f133fe79fe02cdf5792b597881c0
One.lean
Int.reprΔ_ne_nil
[98, 1]
[102, 73]
apply Nat.toDigits_ne_nil
case ofNat m : ℕ ⊢ Nat.toDigits 10 m ≠ []
no goals
Please generate a tactic in lean4 to solve the state. STATE: case ofNat m : ℕ ⊢ Nat.toDigits 10 m ≠ [] TACTIC: