Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - feat: adaptations for leanprover/lean4#2964 #9176

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion Mathlib/Data/List/Join.lean
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ theorem join_filter_isEmpty_eq_false [DecidablePred fun l : List α => l.isEmpty
| [] :: L => by
simp [join_filter_isEmpty_eq_false (L := L), isEmpty_iff_eq_nil]
| (a :: l) :: L => by
simp [join_filter_isEmpty_eq_false (L := L), isEmpty_cons]
simp [join_filter_isEmpty_eq_false (L := L)]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this some merge weirdness, or genuinely intended as part of this patch?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure. This is what is currently on nightly-testing: it doesn't seem to be on @Vtec234's lean-pr-testing-2964 branch...

Given it's a good change I'm inclined to just sneak it in here?

#align list.join_filter_empty_eq_ff List.join_filter_isEmpty_eq_false

@[simp]
Expand Down
28 changes: 8 additions & 20 deletions Mathlib/GroupTheory/Perm/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -570,30 +570,18 @@ theorem swap_eq_one_iff {i j : α} : swap i j = (1 : Perm α) ↔ i = j :=
swap_eq_refl_iff
#align equiv.swap_eq_one_iff Equiv.swap_eq_one_iff

theorem swap_mul_eq_iff {i j : α} {σ : Perm α} : swap i j * σ = σ ↔ i = j :=
⟨fun h => by
-- Porting note: added `_root_.`
have swap_id : swap i j = 1 := mul_right_cancel (_root_.trans h (one_mul σ).symm)
rw [← swap_apply_right i j, swap_id]
rfl,
fun h => by erw [h, swap_self, one_mul]⟩
theorem swap_mul_eq_iff {i j : α} {σ : Perm α} : swap i j * σ = σ ↔ i = j := by
rw [mul_left_eq_self, swap_eq_one_iff]
semorrison marked this conversation as resolved.
Show resolved Hide resolved
#align equiv.swap_mul_eq_iff Equiv.swap_mul_eq_iff

theorem mul_swap_eq_iff {i j : α} {σ : Perm α} : σ * swap i j = σ ↔ i = j :=
⟨fun h => by
-- Porting note: added `_root_.`
have swap_id : swap i j = 1 := mul_left_cancel (_root_.trans h (one_mul σ).symm)
rw [← swap_apply_right i j, swap_id]
rfl,
fun h => by erw [h, swap_self, mul_one]⟩
theorem mul_swap_eq_iff {i j : α} {σ : Perm α} : σ * swap i j = σ ↔ i = j := by
rw [mul_right_eq_self, swap_eq_one_iff]
#align equiv.mul_swap_eq_iff Equiv.mul_swap_eq_iff

theorem swap_mul_swap_mul_swap {x y z : α} (hwz : x ≠ y) (hxz : x ≠ z) :
swap y z * swap x y * swap y z = swap z x :=
Equiv.ext fun n => by
simp only [swap_apply_def, Perm.mul_apply]
-- Porting note: was `cc`
split_ifs <;> aesop
theorem swap_mul_swap_mul_swap {x y z : α} (hxy : x ≠ y) (hxz : x ≠ z) :
swap y z * swap x y * swap y z = swap z x := by
nth_rewrite 2 [← swap_inv]
rw [← swap_apply_apply, swap_apply_left, swap_apply_of_ne_of_ne hxy hxz, swap_comm]
#align equiv.swap_mul_swap_mul_swap Equiv.swap_mul_swap_mul_swap

end Swap
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Tactic/Widget/Calc.lean
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,6 @@ elab_rules : tactic
let json := open scoped Std.Json in json% {"replaceRange": $(replaceRange),
"isFirst": $(isFirst),
"indent": $(indent)}
ProofWidgets.savePanelWidgetInfo proofTerm `CalcPanel (pure json)
Widget.savePanelWidgetInfo CalcPanel.javascriptHash (pure json) proofTerm
isFirst := false
evalCalc (← `(tactic|calc%$calcstx $stx))
3 changes: 2 additions & 1 deletion Mathlib/Tactic/Widget/Congrm.lean
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,5 @@ open scoped Json in
subexpressions in the goal.-/
elab stx:"congrm?" : tactic => do
let some replaceRange := (← getFileMap).rangeOfStx? stx | return
savePanelWidgetInfo stx ``CongrmSelectionPanel $ pure $ json% { replaceRange: $(replaceRange) }
Vtec234 marked this conversation as resolved.
Show resolved Hide resolved
Widget.savePanelWidgetInfo CongrmSelectionPanel.javascriptHash
(pure $ json% { replaceRange: $(replaceRange) }) stx
3 changes: 2 additions & 1 deletion Mathlib/Tactic/Widget/Conv.lean
Original file line number Diff line number Diff line change
Expand Up @@ -133,4 +133,5 @@ open scoped Json in
in the goal.-/
elab stx:"conv?" : tactic => do
let some replaceRange := (← getFileMap).rangeOfStx? stx | return
savePanelWidgetInfo stx ``ConvSelectionPanel $ pure $ json% { replaceRange: $(replaceRange) }
Widget.savePanelWidgetInfo ConvSelectionPanel.javascriptHash
(pure $ json% { replaceRange: $(replaceRange) }) stx
3 changes: 2 additions & 1 deletion Mathlib/Tactic/Widget/Gcongr.lean
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,5 @@ open scoped Json in
subexpressions in the goal.-/
elab stx:"gcongr?" : tactic => do
let some replaceRange := (← getFileMap).rangeOfStx? stx | return
savePanelWidgetInfo stx ``GCongrSelectionPanel $ pure $ json% { replaceRange: $(replaceRange) }
Widget.savePanelWidgetInfo GCongrSelectionPanel.javascriptHash
(pure $ json% { replaceRange: $(replaceRange) }) stx
6 changes: 3 additions & 3 deletions lake-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[{"url": "https://github.com/leanprover/std4",
"type": "git",
"subDir": null,
"rev": "49b36f282e56ce9a695923e2df156cd4abf33fc8",
"rev": "4165f2c46b6dffcca0abbacb1cea2dafa1282166",
"name": "std",
"manifestFile": "lake-manifest.json",
"inputRev": "bump/v4.5.0",
Expand All @@ -31,10 +31,10 @@
{"url": "https://github.com/leanprover-community/ProofWidgets4",
"type": "git",
"subDir": null,
"rev": "909febc72b4f64628f8d35cd0554f8a90b6e0749",
"rev": "bf61e90de075abfa27f638922e7aafafdce77c44",
"name": "proofwidgets",
"manifestFile": "lake-manifest.json",
"inputRev": "v0.0.23",
"inputRev": "v0.0.24-pre2",
"inherited": false,
"configFile": "lakefile.lean"},
{"url": "https://github.com/leanprover/lean4-cli",
Expand Down
2 changes: 1 addition & 1 deletion lakefile.lean
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ require «doc-gen4» from git "https://github.com/leanprover/doc-gen4" @ "main"
require std from git "https://github.com/leanprover/std4" @ "bump/v4.5.0"
require Qq from git "https://github.com/leanprover-community/quote4" @ "master"
require aesop from git "https://github.com/leanprover-community/aesop" @ "master"
require proofwidgets from git "https://github.com/leanprover-community/ProofWidgets4" @ "v0.0.23"
require proofwidgets from git "https://github.com/leanprover-community/ProofWidgets4" @ "v0.0.24-pre2"
require Cli from git "https://github.com/leanprover/lean4-cli" @ "main"

/-!
Expand Down
2 changes: 1 addition & 1 deletion lean-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
leanprover/lean4:nightly-2023-12-19
leanprover/lean4:nightly-2023-12-21