Theorem: Finmap.keysLookupEquiv_apply_coe_fst
File: Mathlib/Data/Finmap.lean

Proof steps:
state_before: α : Type u
β : α → Type v
inst✝ : DecidableEq α
f : { f // ∀ (i : α), (f.2 i).isSome = true ↔ i ∈ f.1 }
⊢ ((↑f).1.sigma fun i => ((↑f).2 i).toFinset).val.NodupKeys
state_after: α : Type u
β : α → Type v
inst✝ : DecidableEq α
f : { f // ∀ (i : α), (f.2 i).isSome = true ↔ i ∈ f.1 }
⊢ ∀ x ∈ ((↑f).1.sigma fun i => ((↑f).2 i).toFinset).val,
    ∀ y ∈ ((↑f).1.sigma fun i => ((↑f).2 i).toFinset).val, x.fst = y.fst → x = y
tactic: refine Multiset.nodup_keys.1 ((Finset.nodup _).map_on ?_)
state_before: α : Type u
β : α → Type v
inst✝ : DecidableEq α
f : { f // ∀ (i : α), (f.2 i).isSome = true ↔ i ∈ f.1 }
⊢ ∀ x ∈ ((↑f).1.sigma fun i => ((↑f).2 i).toFinset).val,
    ∀ y ∈ ((↑f).1.sigma fun i => ((↑f).2 i).toFinset).val, x.fst = y.fst → x = y
state_after: α : Type u
β : α → Type v
inst✝ : DecidableEq α
f : { f // ∀ (i : α), (f.2 i).isSome = true ↔ i ∈ f.1 }
⊢ ∀ (x : (a : α) × β a),
    x.fst ∈ (↑f).1 ∧ (↑f).2 x.fst = some x.snd →
      ∀ (y : (a : α) × β a), y.fst ∈ (↑f).1 ∧ (↑f).2 y.fst = some y.snd → x.fst = y.fst → x = y
tactic: simp only [Finset.mem_val, Finset.mem_sigma, Option.mem_toFinset, Option.mem_def]
state_before: α : Type u
β : α → Type v
inst✝ : DecidableEq α
f : { f // ∀ (i : α), (f.2 i).isSome = true ↔ i ∈ f.1 }
⊢ ∀ (x : (a : α) × β a),
    x.fst ∈ (↑f).1 ∧ (↑f).2 x.fst = some x.snd →
      ∀ (y : (a : α) × β a), y.fst ∈ (↑f).1 ∧ (↑f).2 y.fst = some y.snd → x.fst = y.fst → x = y
state_after: case mk.intro.mk.intro
α : Type u
β : α → Type v
inst✝ : DecidableEq α
f : { f // ∀ (i : α), (f.2 i).isSome = true ↔ i ∈ f.1 }
i : α
x : β i
left✝¹ : ⟨i, x⟩.fst ∈ (↑f).1
hx : (↑f).2 ⟨i, x⟩.fst = some ⟨i, x⟩.snd
y : β i
left✝ : ⟨i, y⟩.fst ∈ (↑f).1
hy : (↑f).2 ⟨i, y⟩.fst = some ⟨i, y⟩.snd
⊢ ⟨i, x⟩ = ⟨i, y⟩
tactic: rintro ⟨i, x⟩ ⟨_, hx⟩ ⟨j, y⟩ ⟨_, hy⟩ (rfl : i = j)
state_before: case mk.intro.mk.intro
α : Type u
β : α → Type v
inst✝ : DecidableEq α
f : { f // ∀ (i : α), (f.2 i).isSome = true ↔ i ∈ f.1 }
i : α
x : β i
left✝¹ : ⟨i, x⟩.fst ∈ (↑f).1
hx : (↑f).2 ⟨i, x⟩.fst = some ⟨i, x⟩.snd
y : β i
left✝ : ⟨i, y⟩.fst ∈ (↑f).1
hy : (↑f).2 ⟨i, y⟩.fst = some ⟨i, y⟩.snd
⊢ ⟨i, x⟩ = ⟨i, y⟩
state_after: no goals
tactic: simpa using hx.symm.trans hy
state_before: α : Type u
β : α → Type v
inst✝ : DecidableEq α
f : Finmap β
⊢ ((fun f => { entries := ((↑f).1.sigma fun i => ((↑f).2 i).toFinset).val, nodupKeys := ⋯ })
        ((fun s => ⟨(s.keys, fun i => lookup i s), ⋯⟩) f)).entries =
    f.entries
state_after: no goals
tactic: simp
state_before: α : Type u
β : α → Type v
inst✝ : DecidableEq α
x✝ : { f // ∀ (i : α), (f.2 i).isSome = true ↔ i ∈ f.1 }
s : Finset α
f : (a : α) → Option (β a)
hf : ∀ (i : α), ((s, f).2 i).isSome = true ↔ i ∈ (s, f).1
⊢ (fun s => ⟨(s.keys, fun i => lookup i s), ⋯⟩)
      ((fun f => { entries := ((↑f).1.sigma fun i => ((↑f).2 i).toFinset).val, nodupKeys := ⋯ }) ⟨(s, f), hf⟩) =
    ⟨(s, f), hf⟩
state_after: α : Type u
β : α → Type v
inst✝ : DecidableEq α
x✝ : { f // ∀ (i : α), (f.2 i).isSome = true ↔ i ∈ f.1 }
s : Finset α
f : (a : α) → Option (β a)
hf : ∀ (i : α), (f i).isSome = true ↔ i ∈ s
⊢ (fun s => ⟨(s.keys, fun i => lookup i s), ⋯⟩)
      ((fun f => { entries := ((↑f).1.sigma fun i => ((↑f).2 i).toFinset).val, nodupKeys := ⋯ }) ⟨(s, f), hf⟩) =
    ⟨(s, f), hf⟩
tactic: dsimp only at hf
state_before: α : Type u
β : α → Type v
inst✝ : DecidableEq α
x✝ : { f // ∀ (i : α), (f.2 i).isSome = true ↔ i ∈ f.1 }
s : Finset α
f : (a : α) → Option (β a)
hf : ∀ (i : α), (f i).isSome = true ↔ i ∈ s
⊢ (fun s => ⟨(s.keys, fun i => lookup i s), ⋯⟩)
      ((fun f => { entries := ((↑f).1.sigma fun i => ((↑f).2 i).toFinset).val, nodupKeys := ⋯ }) ⟨(s, f), hf⟩) =
    ⟨(s, f), hf⟩
state_after: case a.a.a
α : Type u
β : α → Type v
inst✝ : DecidableEq α
x✝ : { f // ∀ (i : α), (f.2 i).isSome = true ↔ i ∈ f.1 }
s : Finset α
f : (a : α) → Option (β a)
hf : ∀ (i : α), (f i).isSome = true ↔ i ∈ s
a✝ : α
⊢ a✝ ∈
      (↑((fun s => ⟨(s.keys, fun i => lookup i s), ⋯⟩)
            ((fun f => { entries := ((↑f).1.sigma fun i => ((↑f).2 i).toFinset).val, nodupKeys := ⋯ })
              ⟨(s, f), hf⟩))).1 ↔
    a✝ ∈ (↑⟨(s, f), hf⟩).1

case a.a.h.a
α : Type u
β : α → Type v
inst✝ : DecidableEq α
x✝¹ : { f // ∀ (i : α), (f.2 i).isSome = true ↔ i ∈ f.1 }
s : Finset α
f : (a : α) → Option (β a)
hf : ∀ (i : α), (f i).isSome = true ↔ i ∈ s
x✝ : α
a✝ : β x✝
⊢ a✝ ∈
      (↑((fun s => ⟨(s.keys, fun i => lookup i s), ⋯⟩)
              ((fun f => { entries := ((↑f).1.sigma fun i => ((↑f).2 i).toFinset).val, nodupKeys := ⋯ })
                ⟨(s, f), hf⟩))).2
        x✝ ↔
    a✝ ∈ (↑⟨(s, f), hf⟩).2 x✝
tactic: ext