@@ -24,39 +24,35 @@ universe u
2424
2525variable {α : Type u}
2626
27- -- adding `@[implicit_reducible]` causes downstream breakage
28- set_option warn.classDefReducibility false in
2927/-- A function to create a provable equal copy of a top order
3028with possibly different definitional equalities. -/
29+ @[implicit_reducible]
3130def OrderTop.copy {h : LE α} {h' : LE α} (c : @OrderTop α h')
3231 (top : α) (eq_top : top = (by infer_instance : Top α).top)
3332 (le_eq : ∀ x y : α, (@LE.le α h) x y ↔ x ≤ y) : @OrderTop α h :=
3433 @OrderTop.mk α h { top := top } fun _ ↦ by simp [eq_top, le_eq]
3534
36- -- adding `@[implicit_reducible]` causes downstream breakage
37- set_option warn.classDefReducibility false in
3835/-- A function to create a provable equal copy of a bottom order
3936with possibly different definitional equalities. -/
37+ @[implicit_reducible]
4038def OrderBot.copy {h : LE α} {h' : LE α} (c : @OrderBot α h')
4139 (bot : α) (eq_bot : bot = (by infer_instance : Bot α).bot)
4240 (le_eq : ∀ x y : α, (@LE.le α h) x y ↔ x ≤ y) : @OrderBot α h :=
4341 @OrderBot.mk α h { bot := bot } fun _ ↦ by simp [eq_bot, le_eq]
4442
45- -- adding `@[implicit_reducible]` causes downstream breakage
46- set_option warn.classDefReducibility false in
4743/-- A function to create a provable equal copy of a bounded order
4844with possibly different definitional equalities. -/
45+ @[implicit_reducible]
4946def BoundedOrder.copy {h : LE α} {h' : LE α} (c : @BoundedOrder α h')
5047 (top : α) (eq_top : top = (by infer_instance : Top α).top)
5148 (bot : α) (eq_bot : bot = (by infer_instance : Bot α).bot)
5249 (le_eq : ∀ x y : α, (@LE.le α h) x y ↔ x ≤ y) : @BoundedOrder α h :=
5350 @BoundedOrder.mk α h (@OrderTop.mk α h { top := top } (fun _ ↦ by simp [eq_top, le_eq]))
5451 (@OrderBot.mk α h { bot := bot } (fun _ ↦ by simp [eq_bot, le_eq]))
5552
56- -- adding `@[implicit_reducible]` causes downstream breakage
57- set_option warn.classDefReducibility false in
5853/-- A function to create a provable equal copy of a lattice
5954with possibly different definitional equalities. -/
55+ @[implicit_reducible]
6056def Lattice.copy (c : Lattice α)
6157 (le : α → α → Prop ) (eq_le : le = (by infer_instance : LE α).le)
6258 (sup : α → α → α) (eq_sup : sup = (by infer_instance : Max α).max)
@@ -75,23 +71,19 @@ def Lattice.copy (c : Lattice α)
7571 inf_le_right := by intros; simp [eq_le, eq_inf]
7672 le_inf := by intro _ _ _ hac hbc; simp_rw [eq_le] at hac hbc ⊢; simp [eq_inf, hac, hbc]
7773
78- -- adding `@[implicit_reducible]` causes downstream breakage
79- set_option warn.classDefReducibility false in
80- set_option backward.isDefEq.respectTransparency false in
8174/-- A function to create a provable equal copy of a distributive lattice
8275with possibly different definitional equalities. -/
76+ @[implicit_reducible]
8377def DistribLattice.copy (c : DistribLattice α)
8478 (le : α → α → Prop ) (eq_le : le = (by infer_instance : LE α).le)
8579 (sup : α → α → α) (eq_sup : sup = (by infer_instance : Max α).max)
8680 (inf : α → α → α) (eq_inf : inf = (by infer_instance : Min α).min) : DistribLattice α where
8781 toLattice := Lattice.copy (@DistribLattice.toLattice α c) le eq_le sup eq_sup inf eq_inf
8882 le_sup_inf := by intros; simp +instances [eq_le, eq_sup, eq_inf, le_sup_inf]
8983
90- -- adding `@[implicit_reducible]` causes downstream breakage
91- set_option warn.classDefReducibility false in
92- set_option backward.isDefEq.respectTransparency false in
9384/-- A function to create a provable equal copy of a generalised heyting algebra
9485with possibly different definitional equalities. -/
86+ @[implicit_reducible]
9587def GeneralizedHeytingAlgebra.copy (c : GeneralizedHeytingAlgebra α)
9688 (le : α → α → Prop ) (eq_le : le = (by infer_instance : LE α).le)
9789 (top : α) (eq_top : top = (by infer_instance : Top α).top)
@@ -105,11 +97,9 @@ def GeneralizedHeytingAlgebra.copy (c : GeneralizedHeytingAlgebra α)
10597 himp := himp
10698 le_himp_iff _ _ _ := by simp +instances [eq_le, eq_himp, eq_inf]
10799
108- -- adding `@[implicit_reducible]` causes downstream breakage
109- set_option warn.classDefReducibility false in
110- set_option backward.isDefEq.respectTransparency false in
111100/-- A function to create a provable equal copy of a generalised co-Heyting algebra
112101with possibly different definitional equalities. -/
102+ @[implicit_reducible]
113103def GeneralizedCoheytingAlgebra.copy (c : GeneralizedCoheytingAlgebra α)
114104 (le : α → α → Prop ) (eq_le : le = (by infer_instance : LE α).le)
115105 (bot : α) (eq_bot : bot = (by infer_instance : Bot α).bot)
@@ -123,11 +113,9 @@ def GeneralizedCoheytingAlgebra.copy (c : GeneralizedCoheytingAlgebra α)
123113 sdiff := sdiff
124114 sdiff_le_iff := by simp +instances [eq_le, eq_sdiff, eq_sup]
125115
126- -- adding `@[implicit_reducible]` causes downstream breakage
127- set_option warn.classDefReducibility false in
128- set_option backward.isDefEq.respectTransparency false in
129116/-- A function to create a provable equal copy of a heyting algebra
130117with possibly different definitional equalities. -/
118+ @[implicit_reducible]
131119def HeytingAlgebra.copy (c : HeytingAlgebra α)
132120 (le : α → α → Prop ) (eq_le : le = (by infer_instance : LE α).le)
133121 (top : α) (eq_top : top = (by infer_instance : Top α).top)
@@ -145,11 +133,9 @@ def HeytingAlgebra.copy (c : HeytingAlgebra α)
145133 compl := compl
146134 himp_bot := by simp +instances [eq_le, eq_himp, eq_bot, eq_compl]
147135
148- -- adding `@[implicit_reducible]` causes downstream breakage
149- set_option warn.classDefReducibility false in
150- set_option backward.isDefEq.respectTransparency false in
151136/-- A function to create a provable equal copy of a co-Heyting algebra
152137with possibly different definitional equalities. -/
138+ @[implicit_reducible]
153139def CoheytingAlgebra.copy (c : CoheytingAlgebra α)
154140 (le : α → α → Prop ) (eq_le : le = (by infer_instance : LE α).le)
155141 (top : α) (eq_top : top = (by infer_instance : Top α).top)
@@ -167,10 +153,9 @@ def CoheytingAlgebra.copy (c : CoheytingAlgebra α)
167153 hnot := hnot
168154 top_sdiff := by simp +instances [eq_le, eq_sdiff, eq_top, eq_hnot]
169155
170- -- adding `@[implicit_reducible]` causes downstream breakage
171- set_option warn.classDefReducibility false in
172156/-- A function to create a provable equal copy of a bi-Heyting algebra
173157with possibly different definitional equalities. -/
158+ @[implicit_reducible]
174159def BiheytingAlgebra.copy (c : BiheytingAlgebra α)
175160 (le : α → α → Prop ) (eq_le : le = (by infer_instance : LE α).le)
176161 (top : α) (eq_top : top = (by infer_instance : Top α).top)
@@ -187,11 +172,9 @@ def BiheytingAlgebra.copy (c : BiheytingAlgebra α)
187172 __ := CoheytingAlgebra.copy (@BiheytingAlgebra.toCoheytingAlgebra α c) le eq_le top eq_top bot
188173 eq_bot sup eq_sup inf eq_inf sdiff eq_sdiff hnot eq_hnot
189174
190- -- adding `@[implicit_reducible]` causes downstream breakage
191- set_option warn.classDefReducibility false in
192- set_option backward.isDefEq.respectTransparency false in
193175/-- A function to create a provable equal copy of a complete lattice
194176with possibly different definitional equalities. -/
177+ @[implicit_reducible]
195178def CompleteLattice.copy (c : CompleteLattice α)
196179 (le : α → α → Prop ) (eq_le : le = (by infer_instance : LE α).le)
197180 (top : α) (eq_top : top = (by infer_instance : Top α).top)
@@ -211,10 +194,9 @@ def CompleteLattice.copy (c : CompleteLattice α)
211194 le_top := by intros; simp +instances [eq_le, eq_top]
212195 bot_le := by intros; simp +instances [eq_le, eq_bot]
213196
214- -- adding `@[implicit_reducible]` causes downstream breakage
215- set_option warn.classDefReducibility false in
216197/-- A function to create a provable equal copy of a frame with possibly different definitional
217198equalities. -/
199+ @[implicit_reducible]
218200def Frame.copy (c : Frame α) (le : α → α → Prop ) (eq_le : le = (by infer_instance : LE α).le)
219201 (top : α) (eq_top : top = (by infer_instance : Top α).top)
220202 (bot : α) (eq_bot : bot = (by infer_instance : Bot α).bot)
@@ -229,10 +211,9 @@ def Frame.copy (c : Frame α) (le : α → α → Prop) (eq_le : le = (by infer_
229211 __ := HeytingAlgebra.copy (@Frame.toHeytingAlgebra α c)
230212 le eq_le top eq_top bot eq_bot sup eq_sup inf eq_inf himp eq_himp compl eq_compl
231213
232- -- adding `@[implicit_reducible]` causes downstream breakage
233- set_option warn.classDefReducibility false in
234214/-- A function to create a provable equal copy of a coframe with possibly different definitional
235215equalities. -/
216+ @[implicit_reducible]
236217def Coframe.copy (c : Coframe α) (le : α → α → Prop ) (eq_le : le = (by infer_instance : LE α).le)
237218 (top : α) (eq_top : top = (by infer_instance : Top α).top)
238219 (bot : α) (eq_bot : bot = (by infer_instance : Bot α).bot)
@@ -247,10 +228,9 @@ def Coframe.copy (c : Coframe α) (le : α → α → Prop) (eq_le : le = (by in
247228 __ := CoheytingAlgebra.copy (@Coframe.toCoheytingAlgebra α c)
248229 le eq_le top eq_top bot eq_bot sup eq_sup inf eq_inf sdiff eq_sdiff hnot eq_hnot
249230
250- -- adding `@[implicit_reducible]` causes downstream breakage
251- set_option warn.classDefReducibility false in
252231/-- A function to create a provable equal copy of a complete distributive lattice
253232with possibly different definitional equalities. -/
233+ @[implicit_reducible]
254234def CompleteDistribLattice.copy (c : CompleteDistribLattice α)
255235 (le : α → α → Prop ) (eq_le : le = (by infer_instance : LE α).le)
256236 (top : α) (eq_top : top = (by infer_instance : Top α).top)
@@ -269,10 +249,9 @@ def CompleteDistribLattice.copy (c : CompleteDistribLattice α)
269249 __ := Coframe.copy (@CompleteDistribLattice.toCoframe α c) le eq_le top eq_top bot eq_bot sup
270250 eq_sup inf eq_inf sdiff eq_sdiff hnot eq_hnot sSup eq_sSup sInf eq_sInf
271251
272- -- adding `@[implicit_reducible]` causes downstream breakage
273- set_option warn.classDefReducibility false in
274252/-- A function to create a provable equal copy of a conditionally complete lattice
275253with possibly different definitional equalities. -/
254+ @[implicit_reducible]
276255def ConditionallyCompleteLattice.copy (c : ConditionallyCompleteLattice α)
277256 (le : α → α → Prop ) (eq_le : le = (by infer_instance : LE α).le)
278257 (sup : α → α → α) (eq_sup : sup = (by infer_instance : Max α).max)
0 commit comments