File tree Expand file tree Collapse file tree 3 files changed +30
-3
lines changed
src/Lean/Meta/Constructions Expand file tree Collapse file tree 3 files changed +30
-3
lines changed Original file line number Diff line number Diff line change @@ -262,9 +262,9 @@ def mkNoConfusionCoreImp (indName : Name) : MetaM Unit := do
262262 (value := e)
263263 (hints := ReducibilityHints.abbrev)))
264264 setReducibleAttribute declName
265- let arity := info.numParams + 1 + 3 * (info.numIndices + 1 )
266- let lhsPos := info.numParams + 1 + info.numIndices
267- let rhsPos := info.numParams + 1 + info.numIndices + 1 + info.numIndices
265+ let arity := 1 + 3 * (info.numParams + info.numIndices + 1 )
266+ let lhsPos := 1 + info.numParams + info.numIndices
267+ let rhsPos := 1 + 2 * info.numParams + 2 * info.numIndices + 1
268268 modifyEnv fun env => markNoConfusion env declName (.regular arity lhsPos rhsPos)
269269 modifyEnv fun env => addProtected env declName
270270
Original file line number Diff line number Diff line change 11#include " util/options.h"
22
3+ // Please update stage0
4+
35namespace lean {
46options get_default_options () {
57 options opts;
Original file line number Diff line number Diff line change 1+ import Lean
2+
3+ variable {α β γ δ : Sort _}
4+
5+ structure Prod' (α : Type u) (β : Type v) where
6+ /--
7+ Constructs a pair. This is usually written `(x, y)` instead of `Prod.mk x y`.
8+ -/
9+ mk ::
10+ /-- The first element of a pair. -/
11+ fst : α
12+ /-- The second element of a pair. -/
13+ snd : β
14+
15+ def mk.injArrow' {α : Type _} {β : Type _} {x₁ : α} {y₁ : β} {x₂ : α} {y₂ : β} :
16+ Prod'.mk x₁ y₁ = Prod'.mk x₂ y₂ → ∀ ⦃P : Sort _⦄, (x₁ = x₂ → y₁ = y₂ → P) → P :=
17+ fun h₁ _ h₂ ↦ Prod'.noConfusion rfl rfl (heq_of_eq h₁)
18+ (fun h₃ h₄ ↦ h₂ (eq_of_heq h₃) (eq_of_heq h₄))
19+
20+ -- Also for structures in Init:
21+
22+ def mk.injArrow {α : Type _} {β : Type _} {x₁ : α} {y₁ : β} {x₂ : α} {y₂ : β} :
23+ Prod.mk x₁ y₁ = Prod.mk x₂ y₂ → ∀ ⦃P : Sort _⦄, (x₁ = x₂ → y₁ = y₂ → P) → P :=
24+ fun h₁ _ h₂ ↦ Prod.noConfusion rfl rfl (heq_of_eq h₁)
25+ (fun h₃ h₄ ↦ h₂ (eq_of_heq h₃) (eq_of_heq h₄))
You can’t perform that action at this time.
0 commit comments