Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit e2cda0b

Browse files
committed
chore(*): Prevent lemmas about the injectivity of coe_fn introducing un-reduced lambda terms (#8386)
This follows on from #6344, and fixes every result for `function.injective (λ` that is about coe_fn.
1 parent 54adb19 commit e2cda0b

File tree

7 files changed

+8
-8
lines changed

7 files changed

+8
-8
lines changed

src/algebra/lie/basic.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ lemma one_apply (x : L₁) : (1 : (L₁ →ₗ⁅R⁆ L₁)) x = x := rfl
246246

247247
instance : inhabited (L₁ →ₗ⁅R⁆ L₂) := ⟨0
248248

249-
lemma coe_injective : function.injective (λ f : L₁ →ₗ⁅R⁆ L₂, show L₁ → L₂, from f) :=
249+
lemma coe_injective : @function.injective (L₁ →ₗ⁅R⁆ L₂) (L₁ → L₂) coe_fn :=
250250
by rintro ⟨f, _⟩ ⟨g, _⟩ ⟨h⟩; congr
251251

252252
@[ext] lemma ext {f g : L₁ →ₗ⁅R⁆ L₂} (h : ∀ x, f x = g x) : f = g :=
@@ -452,7 +452,7 @@ instance : has_one (M →ₗ⁅R,L⁆ M) := ⟨{ map_lie' := by simp, ..(1 : M
452452

453453
instance : inhabited (M →ₗ⁅R,L⁆ N) := ⟨0
454454

455-
lemma coe_injective : function.injective (λ f : M →ₗ⁅R,L⁆ N, show M → N, from f) :=
455+
lemma coe_injective : @function.injective (M →ₗ⁅R,L⁆ N) (M → N) coe_fn :=
456456
by { rintros ⟨f, _⟩ ⟨g, _⟩ ⟨h⟩, congr, }
457457

458458
@[ext] lemma ext {f g : M →ₗ⁅R,L⁆ N} (h : ∀ m, f m = g m) : f = g :=

src/analysis/normed_space/enorm.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ variables {𝕜 : Type*} {V : Type*} [normed_field 𝕜] [add_comm_group V] [mod
4848

4949
instance : has_coe_to_fun (enorm 𝕜 V) := ⟨_, enorm.to_fun⟩
5050

51-
lemma coe_fn_injective : function.injective (λ (e : enorm 𝕜 V) (x : V), e x) :=
51+
lemma coe_fn_injective : @function.injective (enorm 𝕜 V) (V → ℝ≥0∞) coe_fn :=
5252
λ e₁ e₂ h, by cases e₁; cases e₂; congr; exact h
5353

5454
@[ext] lemma ext {e₁ e₂ : enorm 𝕜 V} (h : ∀ x, e₁ x = e₂ x) : e₁ = e₂ :=

src/data/equiv/basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ instance : has_coe_to_fun (α ≃ β) :=
8585
rfl
8686

8787
/-- The map `coe_fn : (r ≃ s) → (r → s)` is injective. -/
88-
theorem coe_fn_injective : function.injective (λ (e : α ≃ β) (x : α), e x)
88+
theorem coe_fn_injective : @function.injective (α ≃ β) (α → β) coe_fn
8989
| ⟨f₁, g₁, l₁, r₁⟩ ⟨f₂, g₂, l₂, r₂⟩ h :=
9090
have f₁ = f₂, from h,
9191
have g₁ = g₂, from l₁.eq_right_inverse (this.symm ▸ r₂),

src/linear_algebra/affine_space/affine_map.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ end
125125

126126
lemma ext_iff {f g : P1 →ᵃ[k] P2} : f = g ↔ ∀ p, f p = g p := ⟨λ h p, h ▸ rfl, ext⟩
127127

128-
lemma coe_fn_injective : function.injective (λ (f : P1 →ᵃ[k] P2) (x : P1), f x) :=
128+
lemma coe_fn_injective : @function.injective (P1 →ᵃ[k] P2) (P1 → P2) coe_fn :=
129129
λ f g H, ext $ congr_fun H
130130

131131
protected lemma congr_arg (f : P1 →ᵃ[k] P2) {x y : P1} (h : x = y) : f x = f y :=

src/order/rel_iso.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ theorem to_equiv_injective : injective (to_equiv : (r ≃r s) → α ≃ β)
438438

439439
/-- The map `coe_fn : (r ≃r s) → (α → β)` is injective. Lean fails to parse
440440
`function.injective (λ e : r ≃r s, (e : α → β))`, so we use a trick to say the same. -/
441-
theorem coe_fn_injective : function.injective (λ (e : r ≃r s) (x : α), e x) :=
441+
theorem coe_fn_injective : @function.injective (r ≃r s) (α → β) coe_fn :=
442442
equiv.coe_fn_injective.comp to_equiv_injective
443443

444444
@[ext] theorem ext ⦃f g : r ≃r s⦄ (h : ∀ x, f x = g x) : f = g :=

src/topology/algebra/module.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ by { intros f g H, cases f, cases g, congr' }
195195
(f : M →ₗ[R] M₂) = g ↔ f = g :=
196196
coe_injective.eq_iff
197197

198-
theorem coe_fn_injective : function.injective (λ f : M →L[R] M₂, show M → M₂, from f) :=
198+
theorem coe_fn_injective : @function.injective (M →L[R] M₂) (M → M₂) coe_fn :=
199199
linear_map.coe_injective.comp coe_injective
200200

201201
@[ext] theorem ext {f g : M →L[R] M₂} (h : ∀ x, f x = g x) : f = g :=

src/topology/locally_constant/basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ congr_arg (λ h : locally_constant X Y, h x) h
210210
theorem congr_arg (f : locally_constant X Y) {x y : X} (h : x = y) : f x = f y :=
211211
congr_arg (λ x : X, f x) h
212212

213-
theorem coe_injective : function.injective (λ (f : locally_constant X Y) (x : X), f x)
213+
theorem coe_injective : @function.injective (locally_constant X Y) (X → Y) coe_fn
214214
| ⟨f, hf⟩ ⟨g, hg⟩ h := have f = g, from h, by subst f
215215

216216
@[simp, norm_cast] theorem coe_inj {f g : locally_constant X Y} : (f : X → Y) = g ↔ f = g :=

0 commit comments

Comments
 (0)