Cslib.LambdaCalculus.LocallyNameless.Context.mapVal_keys
theoremverifiedformalizationimported Lean
A mapping of values preserves keys.
Statement
set_option autoImplicit true in set_option relaxedAutoImplicit true in open Cslib Cslib.LambdaCalculus Cslib.LambdaCalculus.LocallyNameless Cslib.LambdaCalculus.LocallyNameless.Context in universe u v in variable {α : Type u} {β : Type v} in variable [DecidableEq α] in open List in attribute [local grind =] Option.mem_def in attribute [local grind _=_] List.append_eq in attribute [local grind =] List.Nodup in attribute [local grind _=_] List.singleton_append in attribute [local grind =] Option.or_eq_some_iff in attribute [local grind =] Option.or_eq_none_iff in attribute [local grind _=_] List.mem_toFinset in attribute [local grind =] List.nodupKeys_middle in attribute [local grind →] List.perm_nodupKeys in variable {Γ Δ : Context α β} in omit [DecidableEq α] in @[grind .] lemma Cslib.LambdaCalculus.LocallyNameless.Context.mapVal_keys (f) : Γ.keys = (Γ.mapVal f).keys
- Formalizes
- CSLib, `Cslib.LambdaCalculus.LocallyNameless.Context.mapVal_keys`
- Lean proof
- By Chris Henson, from github.com/leanprover/cslib at
3951377e5a3f(Copyright (c) 2025 Chris Henson. All rights reserved, Apache-2.0). Compiled here against leanprover/lean4:v4.33.1, Mathlib v4.33.1; written for leanprover/lean4:v4.33.0.Cslib.LambdaCalculus.LocallyNameless.Context.mapVal_keys← Cslib.LambdaCalculus.LocallyNameless.Context.mapVal_keys (Cslib/Languages/LambdaCalculus/LocallyNameless/Context.lean:77): adapted
What was changed in
Cslib.LambdaCalculus.LocallyNameless.Context.mapVal_keys--- Cslib/Languages/LambdaCalculus/LocallyNameless/Context.lean:77 (Cslib.LambdaCalculus.LocallyNameless.Context.mapVal_keys) +++ as compiled here @@ -1,5 +1,21 @@ +set_option autoImplicit true in +set_option relaxedAutoImplicit true in +open Cslib Cslib.LambdaCalculus Cslib.LambdaCalculus.LocallyNameless Cslib.LambdaCalculus.LocallyNameless.Context in +universe u v in +variable {α : Type u} {β : Type v} in +variable [DecidableEq α] in +open List in +attribute [local grind =] Option.mem_def in +attribute [local grind _=_] List.append_eq in +attribute [local grind =] List.Nodup in +attribute [local grind _=_] List.singleton_append in +attribute [local grind =] Option.or_eq_some_iff in +attribute [local grind =] Option.or_eq_none_iff in +attribute [local grind _=_] List.mem_toFinset in +attribute [local grind =] List.nodupKeys_middle in +attribute [local grind →] List.perm_nodupKeys in +variable {Γ Δ : Context α β} in omit [DecidableEq α] in -/-- A mapping of values preserves keys. -/ -@[scoped grind .] -lemma mapVal_keys (f) : Γ.keys = (Γ.mapVal f).keys := by +@[grind .] +lemma Cslib.LambdaCalculus.LocallyNameless.Context.mapVal_keys (f) : Γ.keys = (Γ.mapVal f).keys := by induction Γ <;> grind - Verified
- 08 Oct 2026
- Axioms
Classical.choiceQuot.soundpropext- Built on 4
- Cslib.LambdaCalculus.LocallyNameless.Context.instHasWellFormedCslib.LambdaCalculus.LocallyNameless.Context.instHasWellFormed
- Cslib.LambdaCalculus.LocallyNameless.Context.domThe domain of a context is the finite set of free variables it uses.
- Cslib.LambdaCalculus.LocallyNameless.Context.mapValA mapping of values within a context.
- Cslib.LambdaCalculus.LocallyNameless.ContextA typing context is a list of free variables and corresponding types.
Lean source view module on GitHub
Choose a tactic — a marked line — to see the goals Lean had before and after it, as in Lean’s infoview. Step with ← → or j k.
set_option autoImplicit true inset_option relaxedAutoImplicit true inopen Cslib Cslib.LambdaCalculus Cslib.LambdaCalculus.LocallyNameless Cslib.LambdaCalculus.LocallyNameless.Context inuniverse u v invariable {α : Type u} {β : Type v} invariable [DecidableEq α] inopen List inattribute [local grind =] Option.mem_def inattribute [local grind _=_] List.append_eq inattribute [local grind =] List.Nodup inattribute [local grind _=_] List.singleton_append inattribute [local grind =] Option.or_eq_some_iff inattribute [local grind =] Option.or_eq_none_iff inattribute [local grind _=_] List.mem_toFinset inattribute [local grind =] List.nodupKeys_middle inattribute [local grind →] List.perm_nodupKeys invariable {Γ Δ : Context α β} inomit [DecidableEq α] in/-- A mapping of values preserves keys. -/@[grind .]lemma Cslib.LambdaCalculus.LocallyNameless.Context.mapVal_keys (f) : Γ.keys = (Γ.mapVal f).keys := by induction Γ <;> grind