Theorem: Finset.mem_dfinsupp_iff
File: Mathlib/Data/Dfinsupp/Interval.lean

tactic: refine' mem_map.trans ⟨_, _⟩
state_before: ι : Type u_1
α : ι → Type u_2
inst✝² : DecidableEq ι
inst✝¹ : (i : ι) → Zero (α i)
s : Finset ι
f : Π₀ (i : ι), α i
t : (i : ι) → Finset (α i)
inst✝ : (i : ι) → DecidableEq (α i)
⊢ f ∈ dfinsupp s t ↔ support f ⊆ s ∧ ∀ (i : ι), i ∈ s → ↑f i ∈ t i

tactic: rintro ⟨f, hf, rfl⟩
state_before: case refine'_1
ι : Type u_1
α : ι → Type u_2
inst✝² : DecidableEq ι
inst✝¹ : (i : ι) → Zero (α i)
s : Finset ι
f : Π₀ (i : ι), α i
t : (i : ι) → Finset (α i)
inst✝ : (i : ι) → DecidableEq (α i)
⊢ (∃ a,
      a ∈ pi s t ∧
        ↑{ toFun := fun f => Dfinsupp.mk s fun i => f ↑i (_ : ↑i ∈ ↑s),
                inj' := (_ : Function.Injective (Dfinsupp.mk s ∘ fun f i => f ↑i (_ : ↑i ∈ ↑s))) }
            a =
          f) →
    support f ⊆ s ∧ ∀ (i : ι), i ∈ s → ↑f i ∈ t i

tactic: rw [Function.Embedding.coeFn_mk]
state_before: case refine'_1.intro.intro
ι : Type u_1
α : ι → Type u_2
inst✝² : DecidableEq ι
inst✝¹ : (i : ι) → Zero (α i)
s : Finset ι
t : (i : ι) → Finset (α i)
inst✝ : (i : ι) → DecidableEq (α i)
f : (a : ι) → a ∈ s → (fun i => α i) a
hf : f ∈ pi s t
⊢ support
        (↑{ toFun := fun f => Dfinsupp.mk s fun i => f ↑i (_ : ↑i ∈ ↑s),
              inj' := (_ : Function.Injective (Dfinsupp.mk s ∘ fun f i => f ↑i (_ : ↑i ∈ ↑s))) }
          f) ⊆
      s ∧
    ∀ (i : ι),
      i ∈ s →
        ↑(↑{ toFun := fun f => Dfinsupp.mk s fun i => f ↑i (_ : ↑i ∈ ↑s),
                    inj' := (_ : Function.Injective (Dfinsupp.mk s ∘ fun f i => f ↑i (_ : ↑i ∈ ↑s))) }
                f)
            i ∈
          t i

tactic: refine' ⟨support_mk_subset, fun i hi => _⟩
state_before: case refine'_1.intro.intro
ι : Type u_1
α : ι → Type u_2
inst✝² : DecidableEq ι
inst✝¹ : (i : ι) → Zero (α i)
s : Finset ι
t : (i : ι) → Finset (α i)
inst✝ : (i : ι) → DecidableEq (α i)
f : (a : ι) → a ∈ s → (fun i => α i) a
hf : f ∈ pi s t
⊢ support (Dfinsupp.mk s fun i => f ↑i (_ : ↑i ∈ ↑s)) ⊆ s ∧
    ∀ (i : ι), i ∈ s → ↑(Dfinsupp.mk s fun i => f ↑i (_ : ↑i ∈ ↑s)) i ∈ t i

tactic: convert mem_pi.1 hf i hi
state_before: case refine'_1.intro.intro
ι : Type u_1
α : ι → Type u_2
inst✝² : DecidableEq ι
inst✝¹ : (i : ι) → Zero (α i)
s : Finset ι
t : (i : ι) → Finset (α i)
inst✝ : (i : ι) → DecidableEq (α i)
f : (a : ι) → a ∈ s → (fun i => α i) a
hf : f ∈ pi s t
i : ι
hi : i ∈ s
⊢ ↑(Dfinsupp.mk s fun i => f ↑i (_ : ↑i ∈ ↑s)) i ∈ t i

tactic: exact mk_of_mem hi
state_before: case h.e'_4
ι : Type u_1
α : ι → Type u_2
inst✝² : DecidableEq ι
inst✝¹ : (i : ι) → Zero (α i)
s : Finset ι
t : (i : ι) → Finset (α i)
inst✝ : (i : ι) → DecidableEq (α i)
f : (a : ι) → a ∈ s → (fun i => α i) a
hf : f ∈ pi s t
i : ι
hi : i ∈ s
⊢ ↑(Dfinsupp.mk s fun i => f ↑i (_ : ↑i ∈ ↑s)) i = f i hi

tactic: refine' fun h => ⟨fun i _ => f i, mem_pi.2 h.2, _⟩
state_before: case refine'_2
ι : Type u_1
α : ι → Type u_2
inst✝² : DecidableEq ι
inst✝¹ : (i : ι) → Zero (α i)
s : Finset ι
f : Π₀ (i : ι), α i
t : (i : ι) → Finset (α i)
inst✝ : (i : ι) → DecidableEq (α i)
⊢ (support f ⊆ s ∧ ∀ (i : ι), i ∈ s → ↑f i ∈ t i) →
    ∃ a,
      a ∈ pi s t ∧
        ↑{ toFun := fun f => Dfinsupp.mk s fun i => f ↑i (_ : ↑i ∈ ↑s),
                inj' := (_ : Function.Injective (Dfinsupp.mk s ∘ fun f i => f ↑i (_ : ↑i ∈ ↑s))) }
            a =
          f

tactic: ext i
state_before: case refine'_2
ι : Type u_1
α : ι → Type u_2
inst✝² : DecidableEq ι
inst✝¹ : (i : ι) → Zero (α i)
s : Finset ι
f : Π₀ (i : ι), α i
t : (i : ι) → Finset (α i)
inst✝ : (i : ι) → DecidableEq (α i)
h : support f ⊆ s ∧ ∀ (i : ι), i ∈ s → ↑f i ∈ t i
⊢ (↑{ toFun := fun f => Dfinsupp.mk s fun i => f ↑i (_ : ↑i ∈ ↑s),
          inj' := (_ : Function.Injective (Dfinsupp.mk s ∘ fun f i => f ↑i (_ : ↑i ∈ ↑s))) }
      fun i x => ↑f i) =
    f

tactic: dsimp
state_before: case refine'_2.h
ι : Type u_1
α : ι → Type u_2
inst✝² : DecidableEq ι
inst✝¹ : (i : ι) → Zero (α i)
s : Finset ι
f : Π₀ (i : ι), α i
t : (i : ι) → Finset (α i)
inst✝ : (i : ι) → DecidableEq (α i)
h : support f ⊆ s ∧ ∀ (i : ι), i ∈ s → ↑f i ∈ t i
i : ι
⊢ ↑(↑{ toFun := fun f => Dfinsupp.mk s fun i => f ↑i (_ : ↑i ∈ ↑s),
              inj' := (_ : Function.Injective (Dfinsupp.mk s ∘ fun f i => f ↑i (_ : ↑i ∈ ↑s))) }
          fun i x => ↑f i)
      i =
    ↑f i

tactic: exact ite_eq_left_iff.2 fun hi => (not_mem_support_iff.1 fun H => hi <| h.1 H).symm
state_before: case refine'_2.h
ι : Type u_1
α : ι → Type u_2
inst✝² : DecidableEq ι
inst✝¹ : (i : ι) → Zero (α i)
s : Finset ι
f : Π₀ (i : ι), α i
t : (i : ι) → Finset (α i)
inst✝ : (i : ι) → DecidableEq (α i)
h : support f ⊆ s ∧ ∀ (i : ι), i ∈ s → ↑f i ∈ t i
i : ι
⊢ (if i ∈ s then ↑f i else 0) = ↑f i