Skip to content

Commit 30a52b7

Browse files
feat: add [ext] attribute to Array.ext (#4970)
This fixes a minor papercut.
1 parent 5da9038 commit 30a52b7

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/Init/Ext.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ end Elab.Tactic.Ext
7878
end Lean
7979

8080
attribute [ext] Prod PProd Sigma PSigma
81-
attribute [ext] funext propext Subtype.eq
81+
attribute [ext] funext propext Subtype.eq Array.ext
8282

8383
@[ext] protected theorem PUnit.ext (x y : PUnit) : x = y := rfl
8484
protected theorem Unit.ext (x y : Unit) : x = y := rfl

tests/lean/run/ext.lean

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@ example (f : ℕ × (ℕ → ℕ)) : f = f := by
8282
example (f : Empty → Empty) : f = f := by
8383
ext ⟨⟩
8484

85+
example (xs : Array α) : xs.map id = xs := by
86+
ext
87+
. simp
88+
. simp
89+
8590
@[ext (iff := false)] theorem ext_intros {n m : Nat} (w : ∀ n m : Nat, n = m) : n = m := by apply w
8691

8792
#guard_msgs (drop warning) in

0 commit comments

Comments
 (0)