forked from leanprover-community/mathlib
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(tactic/set): use provided type for new variable (leanprover-commu…
…nity#3126) closes leanprover-community#3111 Co-authored-by: Rob Lewis <rob.y.lewis@gmail.com>
- Loading branch information
1 parent
5cc619f
commit 2e8d674
Showing
3 changed files
with
45 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import data.matrix.notation | ||
|
||
example (x : ℕ) (h : x = 3) : x + x + x = 9 := | ||
begin | ||
set y := x with ←h_xy, | ||
guard_hyp y := ℕ, | ||
guard_hyp h_xy := x = y, | ||
guard_hyp h := y = 3, | ||
guard_target y + y + y = 9, | ||
set! z : ℕ := y, | ||
guard_target y + y + y = 9, | ||
simp [h] | ||
end | ||
|
||
example : true := | ||
let X1 := (![![1, 0], ![0, 0]] : matrix (fin 2) (fin 2) ℕ), -- X1 : fin 1.succ → fin 2 → ℕ | ||
X2 : matrix (fin 2) (fin 2) ℕ := ![![1, 0], ![0, 0]] in -- X2 : matrix (fin 2) (fin 2) ℕ | ||
begin | ||
set Y1 := (![![1, 0], ![0, 0]] : matrix (fin 2) (fin 2) ℕ), | ||
set Y2 : matrix (fin 2) (fin 2) ℕ := ![![1, 0], ![0, 0]], | ||
let Z1 := (![![1, 0], ![0, 0]] : matrix (fin 2) (fin 2) ℕ), | ||
let Z2 : matrix (fin 2) (fin 2) ℕ := ![![1, 0], ![0, 0]], | ||
guard_hyp Y2 := matrix (fin 2) (fin 2) ℕ, | ||
trivial | ||
end | ||
|
||
def T {α : Type} := ℕ | ||
def v : @T ℕ := nat.zero | ||
|
||
def S := @T ℕ | ||
def u : S := nat.zero | ||
|
||
def p : true := | ||
begin | ||
set a : T := v, | ||
set b : T := u, -- the type `T` can't be fully elaborated without the body but this is fine | ||
trivial | ||
end |