Theorem: Profinite.NobelingProof.spanFinBasis.span
File: Mathlib/Topology/Category/Profinite/Nobeling.lean

tactic: intro f _
state_before: I : Type u
inst✝¹ : LinearOrder I
inst✝ : IsWellOrder I fun x x_1 => x < x_1
C : Set (I → Bool)
s : Finset I
⊢ ⊤ ≤ Submodule.span ℤ (Set.range (spanFinBasis C s))
state_after: I : Type u
inst✝¹ : LinearOrder I
inst✝ : IsWellOrder I fun x x_1 => x < x_1
C : Set (I → Bool)
s : Finset I
f : LocallyConstant ↑(π C fun x => x ∈ s) ℤ
a✝ : f ∈ ⊤
⊢ f ∈ Submodule.span ℤ (Set.range (spanFinBasis C s))

tactic: rw [Finsupp.mem_span_range_iff_exists_finsupp]
state_before: I : Type u
inst✝¹ : LinearOrder I
inst✝ : IsWellOrder I fun x x_1 => x < x_1
C : Set (I → Bool)
s : Finset I
f : LocallyConstant ↑(π C fun x => x ∈ s) ℤ
a✝ : f ∈ ⊤
⊢ f ∈ Submodule.span ℤ (Set.range (spanFinBasis C s))
state_after: I : Type u
inst✝¹ : LinearOrder I
inst✝ : IsWellOrder I fun x x_1 => x < x_1
C : Set (I → Bool)
s : Finset I
f : LocallyConstant ↑(π C fun x => x ∈ s) ℤ
a✝ : f ∈ ⊤
⊢ ∃ c, (c.sum fun i a => a • spanFinBasis C s i) = f

tactic: use Finsupp.onFinset (Finset.univ) f.toFun (fun _ _ ↦ Finset.mem_univ _)
state_before: I : Type u
inst✝¹ : LinearOrder I
inst✝ : IsWellOrder I fun x x_1 => x < x_1
C : Set (I → Bool)
s : Finset I
f : LocallyConstant ↑(π C fun x => x ∈ s) ℤ
a✝ : f ∈ ⊤
⊢ ∃ c, (c.sum fun i a => a • spanFinBasis C s i) = f
state_after: case h
I : Type u
inst✝¹ : LinearOrder I
inst✝ : IsWellOrder I fun x x_1 => x < x_1
C : Set (I → Bool)
s : Finset I
f : LocallyConstant ↑(π C fun x => x ∈ s) ℤ
a✝ : f ∈ ⊤
⊢ ((Finsupp.onFinset Finset.univ f.toFun ⋯).sum fun i a => a • spanFinBasis C s i) = f

tactic: ext x
state_before: case h
I : Type u
inst✝¹ : LinearOrder I
inst✝ : IsWellOrder I fun x x_1 => x < x_1
C : Set (I → Bool)
s : Finset I
f : LocallyConstant ↑(π C fun x => x ∈ s) ℤ
a✝ : f ∈ ⊤
⊢ ((Finsupp.onFinset Finset.univ f.toFun ⋯).sum fun i a => a • spanFinBasis C s i) = f
state_after: case h.h
I : Type u
inst✝¹ : LinearOrder I
inst✝ : IsWellOrder I fun x x_1 => x < x_1
C : Set (I → Bool)
s : Finset I
f : LocallyConstant ↑(π C fun x => x ∈ s) ℤ
a✝ : f ∈ ⊤
x : ↑(π C fun x => x ∈ s)
⊢ ((Finsupp.onFinset Finset.univ f.toFun ⋯).sum fun i a => a • spanFinBasis C s i) x = f x

tactic: change LocallyConstant.evalₗ ℤ x _ = _
state_before: case h.h
I : Type u
inst✝¹ : LinearOrder I
inst✝ : IsWellOrder I fun x x_1 => x < x_1
C : Set (I → Bool)
s : Finset I
f : LocallyConstant ↑(π C fun x => x ∈ s) ℤ
a✝ : f ∈ ⊤
x : ↑(π C fun x => x ∈ s)
⊢ ((Finsupp.onFinset Finset.univ f.toFun ⋯).sum fun i a => a • spanFinBasis C s i) x = f x
state_after: case h.h
I : Type u
inst✝¹ : LinearOrder I
inst✝ : IsWellOrder I fun x x_1 => x < x_1
C : Set (I → Bool)
s : Finset I
f : LocallyConstant ↑(π C fun x => x ∈ s) ℤ
a✝ : f ∈ ⊤
x : ↑(π C fun x => x ∈ s)
⊢ (LocallyConstant.evalₗ ℤ x) ((Finsupp.onFinset Finset.univ f.toFun ⋯).sum fun i a => a • spanFinBasis C s i) = f x

tactic: simp only [zsmul_eq_mul, map_finsupp_sum, LocallyConstant.evalₗ_apply,
  LocallyConstant.coe_mul, Pi.mul_apply, spanFinBasis, LocallyConstant.coe_mk, mul_ite, mul_one,
  mul_zero, Finsupp.sum_ite_eq, Finsupp.mem_support_iff, ne_eq, ite_not]
state_before: case h.h
I : Type u
inst✝¹ : LinearOrder I
inst✝ : IsWellOrder I fun x x_1 => x < x_1
C : Set (I → Bool)
s : Finset I
f : LocallyConstant ↑(π C fun x => x ∈ s) ℤ
a✝ : f ∈ ⊤
x : ↑(π C fun x => x ∈ s)
⊢ (LocallyConstant.evalₗ ℤ x) ((Finsupp.onFinset Finset.univ f.toFun ⋯).sum fun i a => a • spanFinBasis C s i) = f x
state_after: case h.h
I : Type u
inst✝¹ : LinearOrder I
inst✝ : IsWellOrder I fun x x_1 => x < x_1
C : Set (I → Bool)
s : Finset I
f : LocallyConstant ↑(π C fun x => x ∈ s) ℤ
a✝ : f ∈ ⊤
x : ↑(π C fun x => x ∈ s)
⊢ (if (Finsupp.onFinset Finset.univ f.toFun ⋯) x = 0 then 0 else ↑((Finsupp.onFinset Finset.univ f.toFun ⋯) x) x) = f x

tactic: split_ifs with h <;> [exact h.symm; rfl]
state_before: case h.h
I : Type u
inst✝¹ : LinearOrder I
inst✝ : IsWellOrder I fun x x_1 => x < x_1
C : Set (I → Bool)
s : Finset I
f : LocallyConstant ↑(π C fun x => x ∈ s) ℤ
a✝ : f ∈ ⊤
x : ↑(π C fun x => x ∈ s)
⊢ (if (Finsupp.onFinset Finset.univ f.toFun ⋯) x = 0 then 0 else ↑((Finsupp.onFinset Finset.univ f.toFun ⋯) x) x) = f x
state_after: no goals