data.sum.intervalMathlib.Data.Sum.Interval

This file has been ported!

Changes since the initial port

The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.

Changes in mathlib3

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(last sync)

feat(data/sum/interval): The lexicographic sum of two locally finite orders is locally finite (#11352)

This proves locally_finite_order (α ⊕ₗ β) where α and β are locally finite themselves.

Diff
@@ -3,6 +3,7 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yaël Dillies
 -/
+import data.finset.sum
 import data.sum.order
 import order.locally_finite
 
@@ -12,11 +13,8 @@ import order.locally_finite
 > THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
 > Any changes to this file require a corresponding PR to mathlib4.
 
-This file provides the `locally_finite_order` instance for the disjoint sum of two orders.
-
-## TODO
-
-Do the same for the lexicographic sum of orders.
+This file provides the `locally_finite_order` instance for the disjoint sum and linear sum of two
+orders and calculates the cardinality of their finite intervals.
 -/
 
 open function sum
@@ -99,6 +97,106 @@ lemma sum_lift₂_mono (h₁ : ∀ a b, f₁ a b ⊆ g₁ a b) (h₂ : ∀ a b,
 | (inr a) (inr b) := map_subset_map.2 (h₂ _ _)
 
 end sum_lift₂
+
+section sum_lex_lift
+variables (f₁ f₁' : α₁ → β₁ → finset γ₁) (f₂ f₂' : α₂ → β₂ → finset γ₂)
+          (g₁ g₁' : α₁ → β₂ → finset γ₁) (g₂ g₂' : α₁ → β₂ → finset γ₂)
+
+/-- Lifts maps `α₁ → β₁ → finset γ₁`, `α₂ → β₂ → finset γ₂`, `α₁ → β₂ → finset γ₁`,
+`α₂ → β₂ → finset γ₂`  to a map `α₁ ⊕ α₂ → β₁ ⊕ β₂ → finset (γ₁ ⊕ γ₂)`. Could be generalized to
+alternative monads if we can make sure to keep computability and universe polymorphism. -/
+def sum_lex_lift : Π (a : α₁ ⊕ α₂) (b : β₁ ⊕ β₂), finset (γ₁ ⊕ γ₂)
+| (inl a) (inl b) := (f₁ a b).map embedding.inl
+| (inl a) (inr b) := (g₁ a b).disj_sum (g₂ a b)
+| (inr a) (inl b) := ∅
+| (inr a) (inr b) := (f₂ a b).map ⟨_, inr_injective⟩
+
+@[simp] lemma sum_lex_lift_inl_inl (a : α₁) (b : β₁) :
+  sum_lex_lift f₁ f₂ g₁ g₂ (inl a) (inl b) = (f₁ a b).map embedding.inl := rfl
+
+@[simp] lemma sum_lex_lift_inl_inr (a : α₁) (b : β₂) :
+  sum_lex_lift f₁ f₂ g₁ g₂ (inl a) (inr b) = (g₁ a b).disj_sum (g₂ a b) := rfl
+
+@[simp] lemma sum_lex_lift_inr_inl (a : α₂) (b : β₁) :
+  sum_lex_lift f₁ f₂ g₁ g₂ (inr a) (inl b) = ∅ := rfl
+
+@[simp] lemma sum_lex_lift_inr_inr (a : α₂) (b : β₂) :
+  sum_lex_lift f₁ f₂ g₁ g₂ (inr a) (inr b) = (f₂ a b).map ⟨_, inr_injective⟩ := rfl
+
+variables {f₁ g₁ f₂ g₂ f₁' g₁' f₂' g₂'} {a : α₁ ⊕ α₂} {b : β₁ ⊕ β₂} {c : γ₁ ⊕ γ₂}
+
+lemma mem_sum_lex_lift :
+  c ∈ sum_lex_lift f₁ f₂ g₁ g₂ a b ↔
+    (∃ a₁ b₁ c₁, a = inl a₁ ∧ b = inl b₁ ∧ c = inl c₁ ∧ c₁ ∈ f₁ a₁ b₁) ∨
+    (∃ a₁ b₂ c₁, a = inl a₁ ∧ b = inr b₂ ∧ c = inl c₁ ∧ c₁ ∈ g₁ a₁ b₂) ∨
+    (∃ a₁ b₂ c₂, a = inl a₁ ∧ b = inr b₂ ∧ c = inr c₂ ∧ c₂ ∈ g₂ a₁ b₂) ∨
+     ∃ a₂ b₂ c₂, a = inr a₂ ∧ b = inr b₂ ∧ c = inr c₂ ∧ c₂ ∈ f₂ a₂ b₂ :=
+begin
+  split,
+  { cases a; cases b,
+    { rw [sum_lex_lift, mem_map],
+      rintro ⟨c, hc, rfl⟩,
+      exact or.inl ⟨a, b, c, rfl, rfl, rfl, hc⟩ },
+    { refine λ h, (mem_disj_sum.1 h).elim _ _,
+      { rintro ⟨c, hc, rfl⟩,
+        refine or.inr (or.inl ⟨a, b, c, rfl, rfl, rfl, hc⟩) },
+      { rintro ⟨c, hc, rfl⟩,
+        refine or.inr (or.inr $ or.inl ⟨a, b, c, rfl, rfl, rfl, hc⟩) } },
+    { refine λ h, (not_mem_empty _ h).elim },
+    { rw [sum_lex_lift, mem_map],
+      rintro ⟨c, hc, rfl⟩,
+      exact or.inr (or.inr $ or.inr $ ⟨a, b, c, rfl, rfl, rfl, hc⟩) } },
+  { rintro (⟨a, b, c, rfl, rfl, rfl, hc⟩ | ⟨a, b, c, rfl, rfl, rfl, hc⟩ |
+      ⟨a, b, c, rfl, rfl, rfl, hc⟩ | ⟨a, b, c, rfl, rfl, rfl, hc⟩),
+    { exact mem_map_of_mem _ hc },
+    { exact inl_mem_disj_sum.2 hc },
+    { exact inr_mem_disj_sum.2 hc },
+    { exact mem_map_of_mem _ hc } }
+end
+
+lemma inl_mem_sum_lex_lift {c₁ : γ₁} :
+  inl c₁ ∈ sum_lex_lift f₁ f₂ g₁ g₂ a b ↔
+    (∃ a₁ b₁, a = inl a₁ ∧ b = inl b₁ ∧ c₁ ∈ f₁ a₁ b₁) ∨
+     ∃ a₁ b₂, a = inl a₁ ∧ b = inr b₂ ∧ c₁ ∈ g₁ a₁ b₂ :=
+by simp [mem_sum_lex_lift]
+
+lemma inr_mem_sum_lex_lift {c₂ : γ₂} :
+  inr c₂ ∈ sum_lex_lift f₁ f₂ g₁ g₂ a b ↔
+    (∃ a₁ b₂, a = inl a₁ ∧ b = inr b₂ ∧ c₂ ∈ g₂ a₁ b₂) ∨
+     ∃ a₂ b₂, a = inr a₂ ∧ b = inr b₂ ∧ c₂ ∈ f₂ a₂ b₂ :=
+by simp [mem_sum_lex_lift]
+
+lemma sum_lex_lift_mono (hf₁ : ∀ a b, f₁ a b ⊆ f₁' a b) (hf₂ : ∀ a b, f₂ a b ⊆ f₂' a b)
+  (hg₁ : ∀ a b, g₁ a b ⊆ g₁' a b) (hg₂ : ∀ a b, g₂ a b ⊆ g₂' a b) (a : α₁ ⊕ α₂) (b : β₁ ⊕ β₂) :
+  sum_lex_lift f₁ f₂ g₁ g₂ a b ⊆ sum_lex_lift f₁' f₂' g₁' g₂' a b :=
+begin
+  cases a; cases b,
+  exacts [map_subset_map.2 (hf₁ _ _), disj_sum_mono (hg₁ _ _) (hg₂ _ _), subset.rfl,
+    map_subset_map.2 (hf₂ _ _)],
+end
+
+lemma sum_lex_lift_eq_empty :
+  (sum_lex_lift f₁ f₂ g₁ g₂ a b) = ∅ ↔ (∀ a₁ b₁, a = inl a₁ → b = inl b₁ → f₁ a₁ b₁ = ∅) ∧
+    (∀ a₁ b₂, a = inl a₁ → b = inr b₂ → g₁ a₁ b₂ = ∅ ∧ g₂ a₁ b₂ = ∅) ∧
+    ∀ a₂ b₂, a = inr a₂ → b = inr b₂ → f₂ a₂ b₂ = ∅ :=
+begin
+  refine ⟨λ h, ⟨_, _, _⟩, λ h, _⟩,
+  any_goals { rintro a b rfl rfl, exact map_eq_empty.1 h },
+  { rintro a b rfl rfl, exact disj_sum_eq_empty.1 h },
+  cases a; cases b,
+  { exact map_eq_empty.2 (h.1 _ _ rfl rfl) },
+  { simp [h.2.1 _ _ rfl rfl] },
+  { refl },
+  { exact map_eq_empty.2 (h.2.2 _ _ rfl rfl) }
+end
+
+lemma sum_lex_lift_nonempty :
+  (sum_lex_lift f₁ f₂ g₁ g₂ a b).nonempty ↔ (∃ a₁ b₁, a = inl a₁ ∧ b = inl b₁ ∧ (f₁ a₁ b₁).nonempty)
+    ∨ (∃ a₁ b₂, a = inl a₁ ∧ b = inr b₂ ∧ ((g₁ a₁ b₂).nonempty ∨ (g₂ a₁ b₂).nonempty))
+    ∨ ∃ a₂ b₂, a = inr a₂ ∧ b = inr b₂ ∧ (f₂ a₂ b₂).nonempty :=
+by simp [nonempty_iff_ne_empty, sum_lex_lift_eq_empty, not_and_distrib]
+
+end sum_lex_lift
 end finset
 
 open finset function
@@ -141,4 +239,84 @@ lemma Ioc_inr_inr : Ioc (inr b₁ : α ⊕ β) (inr b₂) = (Ioc b₁ b₂).map
 lemma Ioo_inr_inr : Ioo (inr b₁ : α ⊕ β) (inr b₂) = (Ioo b₁ b₂).map embedding.inr := rfl
 
 end disjoint
+
+/-! ### Lexicographical sum of orders -/
+
+namespace lex
+variables [preorder α] [preorder β] [order_top α] [order_bot β] [locally_finite_order α]
+  [locally_finite_order β]
+
+/-- Throwaway tactic. -/
+private meta def simp_lex : tactic unit :=
+`[refine to_lex.surjective.forall₃.2 _, rintro (a | a) (b | b) (c | c); simp only
+    [sum_lex_lift_inl_inl, sum_lex_lift_inl_inr, sum_lex_lift_inr_inl, sum_lex_lift_inr_inr,
+    inl_le_inl_iff, inl_le_inr, not_inr_le_inl, inr_le_inr_iff, inl_lt_inl_iff, inl_lt_inr,
+    not_inr_lt_inl, inr_lt_inr_iff, mem_Icc, mem_Ico, mem_Ioc, mem_Ioo, mem_Ici, mem_Ioi, mem_Iic,
+    mem_Iio, equiv.coe_to_embedding, to_lex_inj, exists_false, and_false, false_and, map_empty,
+    not_mem_empty, true_and, inl_mem_disj_sum, inr_mem_disj_sum, and_true, of_lex_to_lex, mem_map,
+    embedding.coe_fn_mk, exists_prop, exists_eq_right, embedding.inl_apply]]
+
+instance locally_finite_order : locally_finite_order (α ⊕ₗ β) :=
+{ finset_Icc := λ a b,
+    (sum_lex_lift Icc Icc (λ a _, Ici a) (λ _, Iic) (of_lex a) (of_lex b)).map to_lex.to_embedding,
+  finset_Ico := λ a b,
+    (sum_lex_lift Ico Ico (λ a _, Ici a) (λ _, Iio) (of_lex a) (of_lex b)).map to_lex.to_embedding,
+  finset_Ioc := λ a b,
+    (sum_lex_lift Ioc Ioc (λ a _, Ioi a) (λ _, Iic) (of_lex a) (of_lex b)).map to_lex.to_embedding,
+  finset_Ioo := λ a b,
+    (sum_lex_lift Ioo Ioo (λ a _, Ioi a) (λ _, Iio) (of_lex a) (of_lex b)).map to_lex.to_embedding,
+  finset_mem_Icc := by simp_lex,
+  finset_mem_Ico := by simp_lex,
+  finset_mem_Ioc := by simp_lex,
+  finset_mem_Ioo := by simp_lex }
+
+variables (a a₁ a₂ : α) (b b₁ b₂ : β)
+
+lemma Icc_inl_inl :
+  Icc (inlₗ a₁ : α ⊕ₗ β) (inlₗ a₂) = (Icc a₁ a₂).map (embedding.inl.trans to_lex.to_embedding) :=
+by { rw ←finset.map_map, refl }
+
+lemma Ico_inl_inl :
+  Ico (inlₗ a₁ : α ⊕ₗ β) (inlₗ a₂) = (Ico a₁ a₂).map (embedding.inl.trans to_lex.to_embedding) :=
+by { rw ←finset.map_map, refl }
+
+lemma Ioc_inl_inl :
+  Ioc (inlₗ a₁ : α ⊕ₗ β) (inlₗ a₂) = (Ioc a₁ a₂).map (embedding.inl.trans to_lex.to_embedding) :=
+by { rw ←finset.map_map, refl }
+
+lemma Ioo_inl_inl :
+  Ioo (inlₗ a₁ : α ⊕ₗ β) (inlₗ a₂) = (Ioo a₁ a₂).map (embedding.inl.trans to_lex.to_embedding) :=
+by { rw ←finset.map_map, refl }
+
+@[simp] lemma Icc_inl_inr :
+  Icc (inlₗ a) (inrₗ b) = ((Ici a).disj_sum (Iic b)).map to_lex.to_embedding := rfl
+@[simp] lemma Ico_inl_inr :
+  Ico (inlₗ a) (inrₗ b) = ((Ici a).disj_sum (Iio b)).map to_lex.to_embedding := rfl
+@[simp] lemma Ioc_inl_inr :
+  Ioc (inlₗ a) (inrₗ b) = ((Ioi a).disj_sum (Iic b)).map to_lex.to_embedding := rfl
+@[simp] lemma Ioo_inl_inr :
+  Ioo (inlₗ a) (inrₗ b) = ((Ioi a).disj_sum (Iio b)).map to_lex.to_embedding := rfl
+
+@[simp] lemma Icc_inr_inl : Icc (inrₗ b) (inlₗ a) = ∅ := rfl
+@[simp] lemma Ico_inr_inl : Ico (inrₗ b) (inlₗ a) = ∅ := rfl
+@[simp] lemma Ioc_inr_inl : Ioc (inrₗ b) (inlₗ a) = ∅ := rfl
+@[simp] lemma Ioo_inr_inl : Ioo (inrₗ b) (inlₗ a) = ∅ := rfl
+
+lemma Icc_inr_inr :
+  Icc (inrₗ b₁ : α ⊕ₗ β) (inrₗ b₂) = (Icc b₁ b₂).map (embedding.inr.trans to_lex.to_embedding) :=
+by { rw ←finset.map_map, refl }
+
+lemma Ico_inr_inr :
+  Ico (inrₗ b₁ : α ⊕ₗ β) (inrₗ b₂) = (Ico b₁ b₂).map (embedding.inr.trans to_lex.to_embedding) :=
+by { rw ←finset.map_map, refl }
+
+lemma Ioc_inr_inr :
+  Ioc (inrₗ b₁ : α ⊕ₗ β) (inrₗ b₂) = (Ioc b₁ b₂).map (embedding.inr.trans to_lex.to_embedding) :=
+by { rw ←finset.map_map, refl }
+
+lemma Ioo_inr_inr :
+  Ioo (inrₗ b₁ : α ⊕ₗ β) (inrₗ b₂) = (Ioo b₁ b₂).map (embedding.inr.trans to_lex.to_embedding) :=
+by { rw ←finset.map_map, refl }
+
+end lex
 end sum

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(first ported)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -5,7 +5,7 @@ Authors: Yaël Dillies
 -/
 import Data.Finset.Sum
 import Data.Sum.Order
-import Order.LocallyFinite
+import Order.Interval.Finset.Defs
 
 #align_import data.sum.interval from "leanprover-community/mathlib"@"48a058d7e39a80ed56858505719a0b2197900999"
 
Diff
@@ -129,6 +129,7 @@ section SumLexLift
 variable (f₁ f₁' : α₁ → β₁ → Finset γ₁) (f₂ f₂' : α₂ → β₂ → Finset γ₂)
   (g₁ g₁' : α₁ → β₂ → Finset γ₁) (g₂ g₂' : α₁ → β₂ → Finset γ₂)
 
+#print Finset.sumLexLift /-
 /-- Lifts maps `α₁ → β₁ → finset γ₁`, `α₂ → β₂ → finset γ₂`, `α₁ → β₂ → finset γ₁`,
 `α₂ → β₂ → finset γ₂`  to a map `α₁ ⊕ α₂ → β₁ ⊕ β₂ → finset (γ₁ ⊕ γ₂)`. Could be generalized to
 alternative monads if we can make sure to keep computability and universe polymorphism. -/
@@ -138,32 +139,42 @@ def sumLexLift : ∀ (a : Sum α₁ α₂) (b : Sum β₁ β₂), Finset (Sum γ
   | inr a, inl b => ∅
   | inr a, inr b => (f₂ a b).map ⟨_, inr_injective⟩
 #align finset.sum_lex_lift Finset.sumLexLift
+-/
 
+#print Finset.sumLexLift_inl_inl /-
 @[simp]
 theorem sumLexLift_inl_inl (a : α₁) (b : β₁) :
     sumLexLift f₁ f₂ g₁ g₂ (inl a) (inl b) = (f₁ a b).map Embedding.inl :=
   rfl
 #align finset.sum_lex_lift_inl_inl Finset.sumLexLift_inl_inl
+-/
 
+#print Finset.sumLexLift_inl_inr /-
 @[simp]
 theorem sumLexLift_inl_inr (a : α₁) (b : β₂) :
     sumLexLift f₁ f₂ g₁ g₂ (inl a) (inr b) = (g₁ a b).disjSum (g₂ a b) :=
   rfl
 #align finset.sum_lex_lift_inl_inr Finset.sumLexLift_inl_inr
+-/
 
+#print Finset.sumLexLift_inr_inl /-
 @[simp]
 theorem sumLexLift_inr_inl (a : α₂) (b : β₁) : sumLexLift f₁ f₂ g₁ g₂ (inr a) (inl b) = ∅ :=
   rfl
 #align finset.sum_lex_lift_inr_inl Finset.sumLexLift_inr_inl
+-/
 
+#print Finset.sumLexLift_inr_inr /-
 @[simp]
 theorem sumLexLift_inr_inr (a : α₂) (b : β₂) :
     sumLexLift f₁ f₂ g₁ g₂ (inr a) (inr b) = (f₂ a b).map ⟨_, inr_injective⟩ :=
   rfl
 #align finset.sum_lex_lift_inr_inr Finset.sumLexLift_inr_inr
+-/
 
 variable {f₁ g₁ f₂ g₂ f₁' g₁' f₂' g₂'} {a : Sum α₁ α₂} {b : Sum β₁ β₂} {c : Sum γ₁ γ₂}
 
+#print Finset.mem_sumLexLift /-
 theorem mem_sumLexLift :
     c ∈ sumLexLift f₁ f₂ g₁ g₂ a b ↔
       (∃ a₁ b₁ c₁, a = inl a₁ ∧ b = inl b₁ ∧ c = inl c₁ ∧ c₁ ∈ f₁ a₁ b₁) ∨
@@ -193,21 +204,27 @@ theorem mem_sumLexLift :
     · exact inr_mem_disj_sum.2 hc
     · exact mem_map_of_mem _ hc
 #align finset.mem_sum_lex_lift Finset.mem_sumLexLift
+-/
 
+#print Finset.inl_mem_sumLexLift /-
 theorem inl_mem_sumLexLift {c₁ : γ₁} :
     inl c₁ ∈ sumLexLift f₁ f₂ g₁ g₂ a b ↔
       (∃ a₁ b₁, a = inl a₁ ∧ b = inl b₁ ∧ c₁ ∈ f₁ a₁ b₁) ∨
         ∃ a₁ b₂, a = inl a₁ ∧ b = inr b₂ ∧ c₁ ∈ g₁ a₁ b₂ :=
   by simp [mem_sum_lex_lift]
 #align finset.inl_mem_sum_lex_lift Finset.inl_mem_sumLexLift
+-/
 
+#print Finset.inr_mem_sumLexLift /-
 theorem inr_mem_sumLexLift {c₂ : γ₂} :
     inr c₂ ∈ sumLexLift f₁ f₂ g₁ g₂ a b ↔
       (∃ a₁ b₂, a = inl a₁ ∧ b = inr b₂ ∧ c₂ ∈ g₂ a₁ b₂) ∨
         ∃ a₂ b₂, a = inr a₂ ∧ b = inr b₂ ∧ c₂ ∈ f₂ a₂ b₂ :=
   by simp [mem_sum_lex_lift]
 #align finset.inr_mem_sum_lex_lift Finset.inr_mem_sumLexLift
+-/
 
+#print Finset.sumLexLift_mono /-
 theorem sumLexLift_mono (hf₁ : ∀ a b, f₁ a b ⊆ f₁' a b) (hf₂ : ∀ a b, f₂ a b ⊆ f₂' a b)
     (hg₁ : ∀ a b, g₁ a b ⊆ g₁' a b) (hg₂ : ∀ a b, g₂ a b ⊆ g₂' a b) (a : Sum α₁ α₂)
     (b : Sum β₁ β₂) : sumLexLift f₁ f₂ g₁ g₂ a b ⊆ sumLexLift f₁' f₂' g₁' g₂' a b :=
@@ -216,7 +233,9 @@ theorem sumLexLift_mono (hf₁ : ∀ a b, f₁ a b ⊆ f₁' a b) (hf₂ : ∀ a
   exacts [map_subset_map.2 (hf₁ _ _), disj_sum_mono (hg₁ _ _) (hg₂ _ _), subset.rfl,
     map_subset_map.2 (hf₂ _ _)]
 #align finset.sum_lex_lift_mono Finset.sumLexLift_mono
+-/
 
+#print Finset.sumLexLift_eq_empty /-
 theorem sumLexLift_eq_empty :
     sumLexLift f₁ f₂ g₁ g₂ a b = ∅ ↔
       (∀ a₁ b₁, a = inl a₁ → b = inl b₁ → f₁ a₁ b₁ = ∅) ∧
@@ -232,7 +251,9 @@ theorem sumLexLift_eq_empty :
   · rfl
   · exact map_eq_empty.2 (h.2.2 _ _ rfl rfl)
 #align finset.sum_lex_lift_eq_empty Finset.sumLexLift_eq_empty
+-/
 
+#print Finset.sumLexLift_nonempty /-
 theorem sumLexLift_nonempty :
     (sumLexLift f₁ f₂ g₁ g₂ a b).Nonempty ↔
       (∃ a₁ b₁, a = inl a₁ ∧ b = inl b₁ ∧ (f₁ a₁ b₁).Nonempty) ∨
@@ -240,6 +261,7 @@ theorem sumLexLift_nonempty :
           ∃ a₂ b₂, a = inr a₂ ∧ b = inr b₂ ∧ (f₂ a₂ b₂).Nonempty :=
   by simp [nonempty_iff_ne_empty, sum_lex_lift_eq_empty, not_and_or]
 #align finset.sum_lex_lift_nonempty Finset.sumLexLift_nonempty
+-/
 
 end SumLexLift
 
@@ -394,6 +416,7 @@ private unsafe def simp_lex : tactic Unit :=
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1221522619.simp_lex -/
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1221522619.simp_lex -/
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1221522619.simp_lex -/
+#print Sum.Lex.locallyFiniteOrder /-
 instance locallyFiniteOrder : LocallyFiniteOrder (α ⊕ₗ β)
     where
   finsetIcc a b :=
@@ -417,88 +440,121 @@ instance locallyFiniteOrder : LocallyFiniteOrder (α ⊕ₗ β)
     run_tac
       simp_lex
 #align sum.lex.locally_finite_order Sum.Lex.locallyFiniteOrder
+-/
 
 variable (a a₁ a₂ : α) (b b₁ b₂ : β)
 
+#print Sum.Lex.Icc_inl_inl /-
 theorem Icc_inl_inl :
     Icc (inlₗ a₁ : α ⊕ₗ β) (inlₗ a₂) = (Icc a₁ a₂).map (Embedding.inl.trans toLex.toEmbedding) := by
   rw [← Finset.map_map]; rfl
 #align sum.lex.Icc_inl_inl Sum.Lex.Icc_inl_inl
+-/
 
+#print Sum.Lex.Ico_inl_inl /-
 theorem Ico_inl_inl :
     Ico (inlₗ a₁ : α ⊕ₗ β) (inlₗ a₂) = (Ico a₁ a₂).map (Embedding.inl.trans toLex.toEmbedding) := by
   rw [← Finset.map_map]; rfl
 #align sum.lex.Ico_inl_inl Sum.Lex.Ico_inl_inl
+-/
 
+#print Sum.Lex.Ioc_inl_inl /-
 theorem Ioc_inl_inl :
     Ioc (inlₗ a₁ : α ⊕ₗ β) (inlₗ a₂) = (Ioc a₁ a₂).map (Embedding.inl.trans toLex.toEmbedding) := by
   rw [← Finset.map_map]; rfl
 #align sum.lex.Ioc_inl_inl Sum.Lex.Ioc_inl_inl
+-/
 
+#print Sum.Lex.Ioo_inl_inl /-
 theorem Ioo_inl_inl :
     Ioo (inlₗ a₁ : α ⊕ₗ β) (inlₗ a₂) = (Ioo a₁ a₂).map (Embedding.inl.trans toLex.toEmbedding) := by
   rw [← Finset.map_map]; rfl
 #align sum.lex.Ioo_inl_inl Sum.Lex.Ioo_inl_inl
+-/
 
+#print Sum.Lex.Icc_inl_inr /-
 @[simp]
 theorem Icc_inl_inr : Icc (inlₗ a) (inrₗ b) = ((Ici a).disjSum (Iic b)).map toLex.toEmbedding :=
   rfl
 #align sum.lex.Icc_inl_inr Sum.Lex.Icc_inl_inr
+-/
 
+#print Sum.Lex.Ico_inl_inr /-
 @[simp]
 theorem Ico_inl_inr : Ico (inlₗ a) (inrₗ b) = ((Ici a).disjSum (Iio b)).map toLex.toEmbedding :=
   rfl
 #align sum.lex.Ico_inl_inr Sum.Lex.Ico_inl_inr
+-/
 
+#print Sum.Lex.Ioc_inl_inr /-
 @[simp]
 theorem Ioc_inl_inr : Ioc (inlₗ a) (inrₗ b) = ((Ioi a).disjSum (Iic b)).map toLex.toEmbedding :=
   rfl
 #align sum.lex.Ioc_inl_inr Sum.Lex.Ioc_inl_inr
+-/
 
+#print Sum.Lex.Ioo_inl_inr /-
 @[simp]
 theorem Ioo_inl_inr : Ioo (inlₗ a) (inrₗ b) = ((Ioi a).disjSum (Iio b)).map toLex.toEmbedding :=
   rfl
 #align sum.lex.Ioo_inl_inr Sum.Lex.Ioo_inl_inr
+-/
 
+#print Sum.Lex.Icc_inr_inl /-
 @[simp]
 theorem Icc_inr_inl : Icc (inrₗ b) (inlₗ a) = ∅ :=
   rfl
 #align sum.lex.Icc_inr_inl Sum.Lex.Icc_inr_inl
+-/
 
+#print Sum.Lex.Ico_inr_inl /-
 @[simp]
 theorem Ico_inr_inl : Ico (inrₗ b) (inlₗ a) = ∅ :=
   rfl
 #align sum.lex.Ico_inr_inl Sum.Lex.Ico_inr_inl
+-/
 
+#print Sum.Lex.Ioc_inr_inl /-
 @[simp]
 theorem Ioc_inr_inl : Ioc (inrₗ b) (inlₗ a) = ∅ :=
   rfl
 #align sum.lex.Ioc_inr_inl Sum.Lex.Ioc_inr_inl
+-/
 
+#print Sum.Lex.Ioo_inr_inl /-
 @[simp]
 theorem Ioo_inr_inl : Ioo (inrₗ b) (inlₗ a) = ∅ :=
   rfl
 #align sum.lex.Ioo_inr_inl Sum.Lex.Ioo_inr_inl
+-/
 
+#print Sum.Lex.Icc_inr_inr /-
 theorem Icc_inr_inr :
     Icc (inrₗ b₁ : α ⊕ₗ β) (inrₗ b₂) = (Icc b₁ b₂).map (Embedding.inr.trans toLex.toEmbedding) := by
   rw [← Finset.map_map]; rfl
 #align sum.lex.Icc_inr_inr Sum.Lex.Icc_inr_inr
+-/
 
+#print Sum.Lex.Ico_inr_inr /-
 theorem Ico_inr_inr :
     Ico (inrₗ b₁ : α ⊕ₗ β) (inrₗ b₂) = (Ico b₁ b₂).map (Embedding.inr.trans toLex.toEmbedding) := by
   rw [← Finset.map_map]; rfl
 #align sum.lex.Ico_inr_inr Sum.Lex.Ico_inr_inr
+-/
 
+#print Sum.Lex.Ioc_inr_inr /-
 theorem Ioc_inr_inr :
     Ioc (inrₗ b₁ : α ⊕ₗ β) (inrₗ b₂) = (Ioc b₁ b₂).map (Embedding.inr.trans toLex.toEmbedding) := by
   rw [← Finset.map_map]; rfl
 #align sum.lex.Ioc_inr_inr Sum.Lex.Ioc_inr_inr
+-/
 
+#print Sum.Lex.Ioo_inr_inr /-
 theorem Ioo_inr_inr :
     Ioo (inrₗ b₁ : α ⊕ₗ β) (inrₗ b₂) = (Ioo b₁ b₂).map (Embedding.inr.trans toLex.toEmbedding) := by
   rw [← Finset.map_map]; rfl
 #align sum.lex.Ioo_inr_inr Sum.Lex.Ioo_inr_inr
+-/
 
 end Lex
 
Diff
@@ -3,9 +3,9 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yaël Dillies
 -/
-import Mathbin.Data.Finset.Sum
-import Mathbin.Data.Sum.Order
-import Mathbin.Order.LocallyFinite
+import Data.Finset.Sum
+import Data.Sum.Order
+import Order.LocallyFinite
 
 #align_import data.sum.interval from "leanprover-community/mathlib"@"48a058d7e39a80ed56858505719a0b2197900999"
 
@@ -385,7 +385,7 @@ namespace Lex
 variable [Preorder α] [Preorder β] [OrderTop α] [OrderBot β] [LocallyFiniteOrder α]
   [LocallyFiniteOrder β]
 
-/- ./././Mathport/Syntax/Translate/Expr.lean:336:4: warning: unsupported (TODO): `[tacs] -/
+/- ./././Mathport/Syntax/Translate/Expr.lean:337:4: warning: unsupported (TODO): `[tacs] -/
 /-- Throwaway tactic. -/
 private unsafe def simp_lex : tactic Unit :=
   sorry
Diff
@@ -3,10 +3,11 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yaël Dillies
 -/
+import Mathbin.Data.Finset.Sum
 import Mathbin.Data.Sum.Order
 import Mathbin.Order.LocallyFinite
 
-#align_import data.sum.interval from "leanprover-community/mathlib"@"e46da4e335b8671848ac711ccb34b42538c0d800"
+#align_import data.sum.interval from "leanprover-community/mathlib"@"48a058d7e39a80ed56858505719a0b2197900999"
 
 /-!
 # Finite intervals in a disjoint union
@@ -14,11 +15,8 @@ import Mathbin.Order.LocallyFinite
 > THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
 > Any changes to this file require a corresponding PR to mathlib4.
 
-This file provides the `locally_finite_order` instance for the disjoint sum of two orders.
-
-## TODO
-
-Do the same for the lexicographic sum of orders.
+This file provides the `locally_finite_order` instance for the disjoint sum and linear sum of two
+orders and calculates the cardinality of their finite intervals.
 -/
 
 
@@ -126,6 +124,125 @@ theorem sumLift₂_mono (h₁ : ∀ a b, f₁ a b ⊆ g₁ a b) (h₂ : ∀ a b,
 
 end SumLift₂
 
+section SumLexLift
+
+variable (f₁ f₁' : α₁ → β₁ → Finset γ₁) (f₂ f₂' : α₂ → β₂ → Finset γ₂)
+  (g₁ g₁' : α₁ → β₂ → Finset γ₁) (g₂ g₂' : α₁ → β₂ → Finset γ₂)
+
+/-- Lifts maps `α₁ → β₁ → finset γ₁`, `α₂ → β₂ → finset γ₂`, `α₁ → β₂ → finset γ₁`,
+`α₂ → β₂ → finset γ₂`  to a map `α₁ ⊕ α₂ → β₁ ⊕ β₂ → finset (γ₁ ⊕ γ₂)`. Could be generalized to
+alternative monads if we can make sure to keep computability and universe polymorphism. -/
+def sumLexLift : ∀ (a : Sum α₁ α₂) (b : Sum β₁ β₂), Finset (Sum γ₁ γ₂)
+  | inl a, inl b => (f₁ a b).map Embedding.inl
+  | inl a, inr b => (g₁ a b).disjSum (g₂ a b)
+  | inr a, inl b => ∅
+  | inr a, inr b => (f₂ a b).map ⟨_, inr_injective⟩
+#align finset.sum_lex_lift Finset.sumLexLift
+
+@[simp]
+theorem sumLexLift_inl_inl (a : α₁) (b : β₁) :
+    sumLexLift f₁ f₂ g₁ g₂ (inl a) (inl b) = (f₁ a b).map Embedding.inl :=
+  rfl
+#align finset.sum_lex_lift_inl_inl Finset.sumLexLift_inl_inl
+
+@[simp]
+theorem sumLexLift_inl_inr (a : α₁) (b : β₂) :
+    sumLexLift f₁ f₂ g₁ g₂ (inl a) (inr b) = (g₁ a b).disjSum (g₂ a b) :=
+  rfl
+#align finset.sum_lex_lift_inl_inr Finset.sumLexLift_inl_inr
+
+@[simp]
+theorem sumLexLift_inr_inl (a : α₂) (b : β₁) : sumLexLift f₁ f₂ g₁ g₂ (inr a) (inl b) = ∅ :=
+  rfl
+#align finset.sum_lex_lift_inr_inl Finset.sumLexLift_inr_inl
+
+@[simp]
+theorem sumLexLift_inr_inr (a : α₂) (b : β₂) :
+    sumLexLift f₁ f₂ g₁ g₂ (inr a) (inr b) = (f₂ a b).map ⟨_, inr_injective⟩ :=
+  rfl
+#align finset.sum_lex_lift_inr_inr Finset.sumLexLift_inr_inr
+
+variable {f₁ g₁ f₂ g₂ f₁' g₁' f₂' g₂'} {a : Sum α₁ α₂} {b : Sum β₁ β₂} {c : Sum γ₁ γ₂}
+
+theorem mem_sumLexLift :
+    c ∈ sumLexLift f₁ f₂ g₁ g₂ a b ↔
+      (∃ a₁ b₁ c₁, a = inl a₁ ∧ b = inl b₁ ∧ c = inl c₁ ∧ c₁ ∈ f₁ a₁ b₁) ∨
+        (∃ a₁ b₂ c₁, a = inl a₁ ∧ b = inr b₂ ∧ c = inl c₁ ∧ c₁ ∈ g₁ a₁ b₂) ∨
+          (∃ a₁ b₂ c₂, a = inl a₁ ∧ b = inr b₂ ∧ c = inr c₂ ∧ c₂ ∈ g₂ a₁ b₂) ∨
+            ∃ a₂ b₂ c₂, a = inr a₂ ∧ b = inr b₂ ∧ c = inr c₂ ∧ c₂ ∈ f₂ a₂ b₂ :=
+  by
+  constructor
+  · cases a <;> cases b
+    · rw [sum_lex_lift, mem_map]
+      rintro ⟨c, hc, rfl⟩
+      exact Or.inl ⟨a, b, c, rfl, rfl, rfl, hc⟩
+    · refine' fun h => (mem_disj_sum.1 h).elim _ _
+      · rintro ⟨c, hc, rfl⟩
+        refine' Or.inr (Or.inl ⟨a, b, c, rfl, rfl, rfl, hc⟩)
+      · rintro ⟨c, hc, rfl⟩
+        refine' Or.inr (Or.inr <| Or.inl ⟨a, b, c, rfl, rfl, rfl, hc⟩)
+    · refine' fun h => (not_mem_empty _ h).elim
+    · rw [sum_lex_lift, mem_map]
+      rintro ⟨c, hc, rfl⟩
+      exact Or.inr (Or.inr <| Or.inr <| ⟨a, b, c, rfl, rfl, rfl, hc⟩)
+  · rintro
+      (⟨a, b, c, rfl, rfl, rfl, hc⟩ | ⟨a, b, c, rfl, rfl, rfl, hc⟩ | ⟨a, b, c, rfl, rfl, rfl, hc⟩ |
+          ⟨a, b, c, rfl, rfl, rfl, hc⟩)
+    · exact mem_map_of_mem _ hc
+    · exact inl_mem_disj_sum.2 hc
+    · exact inr_mem_disj_sum.2 hc
+    · exact mem_map_of_mem _ hc
+#align finset.mem_sum_lex_lift Finset.mem_sumLexLift
+
+theorem inl_mem_sumLexLift {c₁ : γ₁} :
+    inl c₁ ∈ sumLexLift f₁ f₂ g₁ g₂ a b ↔
+      (∃ a₁ b₁, a = inl a₁ ∧ b = inl b₁ ∧ c₁ ∈ f₁ a₁ b₁) ∨
+        ∃ a₁ b₂, a = inl a₁ ∧ b = inr b₂ ∧ c₁ ∈ g₁ a₁ b₂ :=
+  by simp [mem_sum_lex_lift]
+#align finset.inl_mem_sum_lex_lift Finset.inl_mem_sumLexLift
+
+theorem inr_mem_sumLexLift {c₂ : γ₂} :
+    inr c₂ ∈ sumLexLift f₁ f₂ g₁ g₂ a b ↔
+      (∃ a₁ b₂, a = inl a₁ ∧ b = inr b₂ ∧ c₂ ∈ g₂ a₁ b₂) ∨
+        ∃ a₂ b₂, a = inr a₂ ∧ b = inr b₂ ∧ c₂ ∈ f₂ a₂ b₂ :=
+  by simp [mem_sum_lex_lift]
+#align finset.inr_mem_sum_lex_lift Finset.inr_mem_sumLexLift
+
+theorem sumLexLift_mono (hf₁ : ∀ a b, f₁ a b ⊆ f₁' a b) (hf₂ : ∀ a b, f₂ a b ⊆ f₂' a b)
+    (hg₁ : ∀ a b, g₁ a b ⊆ g₁' a b) (hg₂ : ∀ a b, g₂ a b ⊆ g₂' a b) (a : Sum α₁ α₂)
+    (b : Sum β₁ β₂) : sumLexLift f₁ f₂ g₁ g₂ a b ⊆ sumLexLift f₁' f₂' g₁' g₂' a b :=
+  by
+  cases a <;> cases b
+  exacts [map_subset_map.2 (hf₁ _ _), disj_sum_mono (hg₁ _ _) (hg₂ _ _), subset.rfl,
+    map_subset_map.2 (hf₂ _ _)]
+#align finset.sum_lex_lift_mono Finset.sumLexLift_mono
+
+theorem sumLexLift_eq_empty :
+    sumLexLift f₁ f₂ g₁ g₂ a b = ∅ ↔
+      (∀ a₁ b₁, a = inl a₁ → b = inl b₁ → f₁ a₁ b₁ = ∅) ∧
+        (∀ a₁ b₂, a = inl a₁ → b = inr b₂ → g₁ a₁ b₂ = ∅ ∧ g₂ a₁ b₂ = ∅) ∧
+          ∀ a₂ b₂, a = inr a₂ → b = inr b₂ → f₂ a₂ b₂ = ∅ :=
+  by
+  refine' ⟨fun h => ⟨_, _, _⟩, fun h => _⟩
+  any_goals rintro a b rfl rfl; exact map_eq_empty.1 h
+  · rintro a b rfl rfl; exact disj_sum_eq_empty.1 h
+  cases a <;> cases b
+  · exact map_eq_empty.2 (h.1 _ _ rfl rfl)
+  · simp [h.2.1 _ _ rfl rfl]
+  · rfl
+  · exact map_eq_empty.2 (h.2.2 _ _ rfl rfl)
+#align finset.sum_lex_lift_eq_empty Finset.sumLexLift_eq_empty
+
+theorem sumLexLift_nonempty :
+    (sumLexLift f₁ f₂ g₁ g₂ a b).Nonempty ↔
+      (∃ a₁ b₁, a = inl a₁ ∧ b = inl b₁ ∧ (f₁ a₁ b₁).Nonempty) ∨
+        (∃ a₁ b₂, a = inl a₁ ∧ b = inr b₂ ∧ ((g₁ a₁ b₂).Nonempty ∨ (g₂ a₁ b₂).Nonempty)) ∨
+          ∃ a₂ b₂, a = inr a₂ ∧ b = inr b₂ ∧ (f₂ a₂ b₂).Nonempty :=
+  by simp [nonempty_iff_ne_empty, sum_lex_lift_eq_empty, not_and_or]
+#align finset.sum_lex_lift_nonempty Finset.sumLexLift_nonempty
+
+end SumLexLift
+
 end Finset
 
 open Finset Function
@@ -260,5 +377,130 @@ theorem Ioo_inr_inr : Ioo (inr b₁ : Sum α β) (inr b₂) = (Ioo b₁ b₂).ma
 
 end Disjoint
 
+/-! ### Lexicographical sum of orders -/
+
+
+namespace Lex
+
+variable [Preorder α] [Preorder β] [OrderTop α] [OrderBot β] [LocallyFiniteOrder α]
+  [LocallyFiniteOrder β]
+
+/- ./././Mathport/Syntax/Translate/Expr.lean:336:4: warning: unsupported (TODO): `[tacs] -/
+/-- Throwaway tactic. -/
+private unsafe def simp_lex : tactic Unit :=
+  sorry
+
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1221522619.simp_lex -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1221522619.simp_lex -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1221522619.simp_lex -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1221522619.simp_lex -/
+instance locallyFiniteOrder : LocallyFiniteOrder (α ⊕ₗ β)
+    where
+  finsetIcc a b :=
+    (sumLexLift Icc Icc (fun a _ => Ici a) (fun _ => Iic) (ofLex a) (ofLex b)).map toLex.toEmbedding
+  finsetIco a b :=
+    (sumLexLift Ico Ico (fun a _ => Ici a) (fun _ => Iio) (ofLex a) (ofLex b)).map toLex.toEmbedding
+  finsetIoc a b :=
+    (sumLexLift Ioc Ioc (fun a _ => Ioi a) (fun _ => Iic) (ofLex a) (ofLex b)).map toLex.toEmbedding
+  finsetIoo a b :=
+    (sumLexLift Ioo Ioo (fun a _ => Ioi a) (fun _ => Iio) (ofLex a) (ofLex b)).map toLex.toEmbedding
+  finset_mem_Icc := by
+    run_tac
+      simp_lex
+  finset_mem_Ico := by
+    run_tac
+      simp_lex
+  finset_mem_Ioc := by
+    run_tac
+      simp_lex
+  finset_mem_Ioo := by
+    run_tac
+      simp_lex
+#align sum.lex.locally_finite_order Sum.Lex.locallyFiniteOrder
+
+variable (a a₁ a₂ : α) (b b₁ b₂ : β)
+
+theorem Icc_inl_inl :
+    Icc (inlₗ a₁ : α ⊕ₗ β) (inlₗ a₂) = (Icc a₁ a₂).map (Embedding.inl.trans toLex.toEmbedding) := by
+  rw [← Finset.map_map]; rfl
+#align sum.lex.Icc_inl_inl Sum.Lex.Icc_inl_inl
+
+theorem Ico_inl_inl :
+    Ico (inlₗ a₁ : α ⊕ₗ β) (inlₗ a₂) = (Ico a₁ a₂).map (Embedding.inl.trans toLex.toEmbedding) := by
+  rw [← Finset.map_map]; rfl
+#align sum.lex.Ico_inl_inl Sum.Lex.Ico_inl_inl
+
+theorem Ioc_inl_inl :
+    Ioc (inlₗ a₁ : α ⊕ₗ β) (inlₗ a₂) = (Ioc a₁ a₂).map (Embedding.inl.trans toLex.toEmbedding) := by
+  rw [← Finset.map_map]; rfl
+#align sum.lex.Ioc_inl_inl Sum.Lex.Ioc_inl_inl
+
+theorem Ioo_inl_inl :
+    Ioo (inlₗ a₁ : α ⊕ₗ β) (inlₗ a₂) = (Ioo a₁ a₂).map (Embedding.inl.trans toLex.toEmbedding) := by
+  rw [← Finset.map_map]; rfl
+#align sum.lex.Ioo_inl_inl Sum.Lex.Ioo_inl_inl
+
+@[simp]
+theorem Icc_inl_inr : Icc (inlₗ a) (inrₗ b) = ((Ici a).disjSum (Iic b)).map toLex.toEmbedding :=
+  rfl
+#align sum.lex.Icc_inl_inr Sum.Lex.Icc_inl_inr
+
+@[simp]
+theorem Ico_inl_inr : Ico (inlₗ a) (inrₗ b) = ((Ici a).disjSum (Iio b)).map toLex.toEmbedding :=
+  rfl
+#align sum.lex.Ico_inl_inr Sum.Lex.Ico_inl_inr
+
+@[simp]
+theorem Ioc_inl_inr : Ioc (inlₗ a) (inrₗ b) = ((Ioi a).disjSum (Iic b)).map toLex.toEmbedding :=
+  rfl
+#align sum.lex.Ioc_inl_inr Sum.Lex.Ioc_inl_inr
+
+@[simp]
+theorem Ioo_inl_inr : Ioo (inlₗ a) (inrₗ b) = ((Ioi a).disjSum (Iio b)).map toLex.toEmbedding :=
+  rfl
+#align sum.lex.Ioo_inl_inr Sum.Lex.Ioo_inl_inr
+
+@[simp]
+theorem Icc_inr_inl : Icc (inrₗ b) (inlₗ a) = ∅ :=
+  rfl
+#align sum.lex.Icc_inr_inl Sum.Lex.Icc_inr_inl
+
+@[simp]
+theorem Ico_inr_inl : Ico (inrₗ b) (inlₗ a) = ∅ :=
+  rfl
+#align sum.lex.Ico_inr_inl Sum.Lex.Ico_inr_inl
+
+@[simp]
+theorem Ioc_inr_inl : Ioc (inrₗ b) (inlₗ a) = ∅ :=
+  rfl
+#align sum.lex.Ioc_inr_inl Sum.Lex.Ioc_inr_inl
+
+@[simp]
+theorem Ioo_inr_inl : Ioo (inrₗ b) (inlₗ a) = ∅ :=
+  rfl
+#align sum.lex.Ioo_inr_inl Sum.Lex.Ioo_inr_inl
+
+theorem Icc_inr_inr :
+    Icc (inrₗ b₁ : α ⊕ₗ β) (inrₗ b₂) = (Icc b₁ b₂).map (Embedding.inr.trans toLex.toEmbedding) := by
+  rw [← Finset.map_map]; rfl
+#align sum.lex.Icc_inr_inr Sum.Lex.Icc_inr_inr
+
+theorem Ico_inr_inr :
+    Ico (inrₗ b₁ : α ⊕ₗ β) (inrₗ b₂) = (Ico b₁ b₂).map (Embedding.inr.trans toLex.toEmbedding) := by
+  rw [← Finset.map_map]; rfl
+#align sum.lex.Ico_inr_inr Sum.Lex.Ico_inr_inr
+
+theorem Ioc_inr_inr :
+    Ioc (inrₗ b₁ : α ⊕ₗ β) (inrₗ b₂) = (Ioc b₁ b₂).map (Embedding.inr.trans toLex.toEmbedding) := by
+  rw [← Finset.map_map]; rfl
+#align sum.lex.Ioc_inr_inr Sum.Lex.Ioc_inr_inr
+
+theorem Ioo_inr_inr :
+    Ioo (inrₗ b₁ : α ⊕ₗ β) (inrₗ b₂) = (Ioo b₁ b₂).map (Embedding.inr.trans toLex.toEmbedding) := by
+  rw [← Finset.map_map]; rfl
+#align sum.lex.Ioo_inr_inr Sum.Lex.Ioo_inr_inr
+
+end Lex
+
 end Sum
 
Diff
@@ -2,15 +2,12 @@
 Copyright (c) 2022 Yaël Dillies. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yaël Dillies
-
-! This file was ported from Lean 3 source module data.sum.interval
-! leanprover-community/mathlib commit e46da4e335b8671848ac711ccb34b42538c0d800
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Data.Sum.Order
 import Mathbin.Order.LocallyFinite
 
+#align_import data.sum.interval from "leanprover-community/mathlib"@"e46da4e335b8671848ac711ccb34b42538c0d800"
+
 /-!
 # Finite intervals in a disjoint union
 
Diff
@@ -50,6 +50,7 @@ def sumLift₂ : ∀ (a : Sum α₁ α₂) (b : Sum β₁ β₂), Finset (Sum γ
 
 variable {f f₁ g₁ g f₂ g₂} {a : Sum α₁ α₂} {b : Sum β₁ β₂} {c : Sum γ₁ γ₂}
 
+#print Finset.mem_sumLift₂ /-
 theorem mem_sumLift₂ :
     c ∈ sumLift₂ f g a b ↔
       (∃ a₁ b₁ c₁, a = inl a₁ ∧ b = inl b₁ ∧ c = inl c₁ ∧ c₁ ∈ f a₁ b₁) ∨
@@ -67,7 +68,9 @@ theorem mem_sumLift₂ :
       exact Or.inr ⟨a, b, c, rfl, rfl, rfl, hc⟩
   · rintro (⟨a, b, c, rfl, rfl, rfl, h⟩ | ⟨a, b, c, rfl, rfl, rfl, h⟩) <;> exact mem_map_of_mem _ h
 #align finset.mem_sum_lift₂ Finset.mem_sumLift₂
+-/
 
+#print Finset.inl_mem_sumLift₂ /-
 theorem inl_mem_sumLift₂ {c₁ : γ₁} :
     inl c₁ ∈ sumLift₂ f g a b ↔ ∃ a₁ b₁, a = inl a₁ ∧ b = inl b₁ ∧ c₁ ∈ f a₁ b₁ :=
   by
@@ -76,7 +79,9 @@ theorem inl_mem_sumLift₂ {c₁ : γ₁} :
   rintro ⟨_, _, c₂, _, _, h, _⟩
   exact inl_ne_inr h
 #align finset.inl_mem_sum_lift₂ Finset.inl_mem_sumLift₂
+-/
 
+#print Finset.inr_mem_sumLift₂ /-
 theorem inr_mem_sumLift₂ {c₂ : γ₂} :
     inr c₂ ∈ sumLift₂ f g a b ↔ ∃ a₂ b₂, a = inr a₂ ∧ b = inr b₂ ∧ c₂ ∈ g a₂ b₂ :=
   by
@@ -85,7 +90,9 @@ theorem inr_mem_sumLift₂ {c₂ : γ₂} :
   rintro ⟨_, _, c₂, _, _, h, _⟩
   exact inr_ne_inl h
 #align finset.inr_mem_sum_lift₂ Finset.inr_mem_sumLift₂
+-/
 
+#print Finset.sumLift₂_eq_empty /-
 theorem sumLift₂_eq_empty :
     sumLift₂ f g a b = ∅ ↔
       (∀ a₁ b₁, a = inl a₁ → b = inl b₁ → f a₁ b₁ = ∅) ∧
@@ -99,14 +106,18 @@ theorem sumLift₂_eq_empty :
   · rfl
   · exact map_eq_empty.2 (h.2 _ _ rfl rfl)
 #align finset.sum_lift₂_eq_empty Finset.sumLift₂_eq_empty
+-/
 
+#print Finset.sumLift₂_nonempty /-
 theorem sumLift₂_nonempty :
     (sumLift₂ f g a b).Nonempty ↔
       (∃ a₁ b₁, a = inl a₁ ∧ b = inl b₁ ∧ (f a₁ b₁).Nonempty) ∨
         ∃ a₂ b₂, a = inr a₂ ∧ b = inr b₂ ∧ (g a₂ b₂).Nonempty :=
   by simp [nonempty_iff_ne_empty, sum_lift₂_eq_empty, not_and_or]
 #align finset.sum_lift₂_nonempty Finset.sumLift₂_nonempty
+-/
 
+#print Finset.sumLift₂_mono /-
 theorem sumLift₂_mono (h₁ : ∀ a b, f₁ a b ⊆ g₁ a b) (h₂ : ∀ a b, f₂ a b ⊆ g₂ a b) :
     ∀ a b, sumLift₂ f₁ f₂ a b ⊆ sumLift₂ g₁ g₂ a b
   | inl a, inl b => map_subset_map.2 (h₁ _ _)
@@ -114,6 +125,7 @@ theorem sumLift₂_mono (h₁ : ∀ a b, f₁ a b ⊆ g₁ a b) (h₂ : ∀ a b,
   | inr a, inl b => Subset.rfl
   | inr a, inr b => map_subset_map.2 (h₂ _ _)
 #align finset.sum_lift₂_mono Finset.sumLift₂_mono
+-/
 
 end SumLift₂
 
@@ -145,77 +157,109 @@ instance : LocallyFiniteOrder (Sum α β)
 
 variable (a₁ a₂ : α) (b₁ b₂ : β) (a b : Sum α β)
 
+#print Sum.Icc_inl_inl /-
 theorem Icc_inl_inl : Icc (inl a₁ : Sum α β) (inl a₂) = (Icc a₁ a₂).map Embedding.inl :=
   rfl
 #align sum.Icc_inl_inl Sum.Icc_inl_inl
+-/
 
+#print Sum.Ico_inl_inl /-
 theorem Ico_inl_inl : Ico (inl a₁ : Sum α β) (inl a₂) = (Ico a₁ a₂).map Embedding.inl :=
   rfl
 #align sum.Ico_inl_inl Sum.Ico_inl_inl
+-/
 
+#print Sum.Ioc_inl_inl /-
 theorem Ioc_inl_inl : Ioc (inl a₁ : Sum α β) (inl a₂) = (Ioc a₁ a₂).map Embedding.inl :=
   rfl
 #align sum.Ioc_inl_inl Sum.Ioc_inl_inl
+-/
 
+#print Sum.Ioo_inl_inl /-
 theorem Ioo_inl_inl : Ioo (inl a₁ : Sum α β) (inl a₂) = (Ioo a₁ a₂).map Embedding.inl :=
   rfl
 #align sum.Ioo_inl_inl Sum.Ioo_inl_inl
+-/
 
+#print Sum.Icc_inl_inr /-
 @[simp]
 theorem Icc_inl_inr : Icc (inl a₁) (inr b₂) = ∅ :=
   rfl
 #align sum.Icc_inl_inr Sum.Icc_inl_inr
+-/
 
+#print Sum.Ico_inl_inr /-
 @[simp]
 theorem Ico_inl_inr : Ico (inl a₁) (inr b₂) = ∅ :=
   rfl
 #align sum.Ico_inl_inr Sum.Ico_inl_inr
+-/
 
+#print Sum.Ioc_inl_inr /-
 @[simp]
 theorem Ioc_inl_inr : Ioc (inl a₁) (inr b₂) = ∅ :=
   rfl
 #align sum.Ioc_inl_inr Sum.Ioc_inl_inr
+-/
 
+#print Sum.Ioo_inl_inr /-
 @[simp]
 theorem Ioo_inl_inr : Ioo (inl a₁) (inr b₂) = ∅ :=
   rfl
 #align sum.Ioo_inl_inr Sum.Ioo_inl_inr
+-/
 
+#print Sum.Icc_inr_inl /-
 @[simp]
 theorem Icc_inr_inl : Icc (inr b₁) (inl a₂) = ∅ :=
   rfl
 #align sum.Icc_inr_inl Sum.Icc_inr_inl
+-/
 
+#print Sum.Ico_inr_inl /-
 @[simp]
 theorem Ico_inr_inl : Ico (inr b₁) (inl a₂) = ∅ :=
   rfl
 #align sum.Ico_inr_inl Sum.Ico_inr_inl
+-/
 
+#print Sum.Ioc_inr_inl /-
 @[simp]
 theorem Ioc_inr_inl : Ioc (inr b₁) (inl a₂) = ∅ :=
   rfl
 #align sum.Ioc_inr_inl Sum.Ioc_inr_inl
+-/
 
+#print Sum.Ioo_inr_inl /-
 @[simp]
 theorem Ioo_inr_inl : Ioo (inr b₁) (inl a₂) = ∅ :=
   rfl
 #align sum.Ioo_inr_inl Sum.Ioo_inr_inl
+-/
 
+#print Sum.Icc_inr_inr /-
 theorem Icc_inr_inr : Icc (inr b₁ : Sum α β) (inr b₂) = (Icc b₁ b₂).map Embedding.inr :=
   rfl
 #align sum.Icc_inr_inr Sum.Icc_inr_inr
+-/
 
+#print Sum.Ico_inr_inr /-
 theorem Ico_inr_inr : Ico (inr b₁ : Sum α β) (inr b₂) = (Ico b₁ b₂).map Embedding.inr :=
   rfl
 #align sum.Ico_inr_inr Sum.Ico_inr_inr
+-/
 
+#print Sum.Ioc_inr_inr /-
 theorem Ioc_inr_inr : Ioc (inr b₁ : Sum α β) (inr b₂) = (Ioc b₁ b₂).map Embedding.inr :=
   rfl
 #align sum.Ioc_inr_inr Sum.Ioc_inr_inr
+-/
 
+#print Sum.Ioo_inr_inr /-
 theorem Ioo_inr_inr : Ioo (inr b₁ : Sum α β) (inr b₂) = (Ioo b₁ b₂).map Embedding.inr :=
   rfl
 #align sum.Ioo_inr_inr Sum.Ioo_inr_inr
+-/
 
 end Disjoint
 
Diff
@@ -50,12 +50,6 @@ def sumLift₂ : ∀ (a : Sum α₁ α₂) (b : Sum β₁ β₂), Finset (Sum γ
 
 variable {f f₁ g₁ g f₂ g₂} {a : Sum α₁ α₂} {b : Sum β₁ β₂} {c : Sum γ₁ γ₂}
 
-/- warning: finset.mem_sum_lift₂ -> Finset.mem_sumLift₂ is a dubious translation:
-lean 3 declaration is
-  forall {α₁ : Type.{u1}} {α₂ : Type.{u2}} {β₁ : Type.{u3}} {β₂ : Type.{u4}} {γ₁ : Type.{u5}} {γ₂ : Type.{u6}} {f : α₁ -> β₁ -> (Finset.{u5} γ₁)} {g : α₂ -> β₂ -> (Finset.{u6} γ₂)} {a : Sum.{u1, u2} α₁ α₂} {b : Sum.{u3, u4} β₁ β₂} {c : Sum.{u5, u6} γ₁ γ₂}, Iff (Membership.Mem.{max u5 u6, max u5 u6} (Sum.{u5, u6} γ₁ γ₂) (Finset.{max u5 u6} (Sum.{u5, u6} γ₁ γ₂)) (Finset.hasMem.{max u5 u6} (Sum.{u5, u6} γ₁ γ₂)) c (Finset.sumLift₂.{u1, u2, u3, u4, u5, u6} α₁ α₂ β₁ β₂ γ₁ γ₂ f g a b)) (Or (Exists.{succ u1} α₁ (fun (a₁ : α₁) => Exists.{succ u3} β₁ (fun (b₁ : β₁) => Exists.{succ u5} γ₁ (fun (c₁ : γ₁) => And (Eq.{max (succ u1) (succ u2)} (Sum.{u1, u2} α₁ α₂) a (Sum.inl.{u1, u2} α₁ α₂ a₁)) (And (Eq.{max (succ u3) (succ u4)} (Sum.{u3, u4} β₁ β₂) b (Sum.inl.{u3, u4} β₁ β₂ b₁)) (And (Eq.{max (succ u5) (succ u6)} (Sum.{u5, u6} γ₁ γ₂) c (Sum.inl.{u5, u6} γ₁ γ₂ c₁)) (Membership.Mem.{u5, u5} γ₁ (Finset.{u5} γ₁) (Finset.hasMem.{u5} γ₁) c₁ (f a₁ b₁)))))))) (Exists.{succ u2} α₂ (fun (a₂ : α₂) => Exists.{succ u4} β₂ (fun (b₂ : β₂) => Exists.{succ u6} γ₂ (fun (c₂ : γ₂) => And (Eq.{max (succ u1) (succ u2)} (Sum.{u1, u2} α₁ α₂) a (Sum.inr.{u1, u2} α₁ α₂ a₂)) (And (Eq.{max (succ u3) (succ u4)} (Sum.{u3, u4} β₁ β₂) b (Sum.inr.{u3, u4} β₁ β₂ b₂)) (And (Eq.{max (succ u5) (succ u6)} (Sum.{u5, u6} γ₁ γ₂) c (Sum.inr.{u5, u6} γ₁ γ₂ c₂)) (Membership.Mem.{u6, u6} γ₂ (Finset.{u6} γ₂) (Finset.hasMem.{u6} γ₂) c₂ (g a₂ b₂)))))))))
-but is expected to have type
-  forall {α₁ : Type.{u4}} {α₂ : Type.{u3}} {β₁ : Type.{u2}} {β₂ : Type.{u1}} {γ₁ : Type.{u6}} {γ₂ : Type.{u5}} {f : α₁ -> β₁ -> (Finset.{u6} γ₁)} {g : α₂ -> β₂ -> (Finset.{u5} γ₂)} {a : Sum.{u4, u3} α₁ α₂} {b : Sum.{u2, u1} β₁ β₂} {c : Sum.{u6, u5} γ₁ γ₂}, Iff (Membership.mem.{max u6 u5, max u5 u6} (Sum.{u6, u5} γ₁ γ₂) (Finset.{max u5 u6} (Sum.{u6, u5} γ₁ γ₂)) (Finset.instMembershipFinset.{max u6 u5} (Sum.{u6, u5} γ₁ γ₂)) c (Finset.sumLift₂.{u4, u3, u2, u1, u6, u5} α₁ α₂ β₁ β₂ γ₁ γ₂ f g a b)) (Or (Exists.{succ u4} α₁ (fun (a₁ : α₁) => Exists.{succ u2} β₁ (fun (b₁ : β₁) => Exists.{succ u6} γ₁ (fun (c₁ : γ₁) => And (Eq.{max (succ u4) (succ u3)} (Sum.{u4, u3} α₁ α₂) a (Sum.inl.{u4, u3} α₁ α₂ a₁)) (And (Eq.{max (succ u2) (succ u1)} (Sum.{u2, u1} β₁ β₂) b (Sum.inl.{u2, u1} β₁ β₂ b₁)) (And (Eq.{max (succ u6) (succ u5)} (Sum.{u6, u5} γ₁ γ₂) c (Sum.inl.{u6, u5} γ₁ γ₂ c₁)) (Membership.mem.{u6, u6} γ₁ (Finset.{u6} γ₁) (Finset.instMembershipFinset.{u6} γ₁) c₁ (f a₁ b₁)))))))) (Exists.{succ u3} α₂ (fun (a₂ : α₂) => Exists.{succ u1} β₂ (fun (b₂ : β₂) => Exists.{succ u5} γ₂ (fun (c₂ : γ₂) => And (Eq.{max (succ u4) (succ u3)} (Sum.{u4, u3} α₁ α₂) a (Sum.inr.{u4, u3} α₁ α₂ a₂)) (And (Eq.{max (succ u2) (succ u1)} (Sum.{u2, u1} β₁ β₂) b (Sum.inr.{u2, u1} β₁ β₂ b₂)) (And (Eq.{max (succ u6) (succ u5)} (Sum.{u6, u5} γ₁ γ₂) c (Sum.inr.{u6, u5} γ₁ γ₂ c₂)) (Membership.mem.{u5, u5} γ₂ (Finset.{u5} γ₂) (Finset.instMembershipFinset.{u5} γ₂) c₂ (g a₂ b₂)))))))))
-Case conversion may be inaccurate. Consider using '#align finset.mem_sum_lift₂ Finset.mem_sumLift₂ₓ'. -/
 theorem mem_sumLift₂ :
     c ∈ sumLift₂ f g a b ↔
       (∃ a₁ b₁ c₁, a = inl a₁ ∧ b = inl b₁ ∧ c = inl c₁ ∧ c₁ ∈ f a₁ b₁) ∨
@@ -74,12 +68,6 @@ theorem mem_sumLift₂ :
   · rintro (⟨a, b, c, rfl, rfl, rfl, h⟩ | ⟨a, b, c, rfl, rfl, rfl, h⟩) <;> exact mem_map_of_mem _ h
 #align finset.mem_sum_lift₂ Finset.mem_sumLift₂
 
-/- warning: finset.inl_mem_sum_lift₂ -> Finset.inl_mem_sumLift₂ is a dubious translation:
-lean 3 declaration is
-  forall {α₁ : Type.{u1}} {α₂ : Type.{u2}} {β₁ : Type.{u3}} {β₂ : Type.{u4}} {γ₁ : Type.{u5}} {γ₂ : Type.{u6}} {f : α₁ -> β₁ -> (Finset.{u5} γ₁)} {g : α₂ -> β₂ -> (Finset.{u6} γ₂)} {a : Sum.{u1, u2} α₁ α₂} {b : Sum.{u3, u4} β₁ β₂} {c₁ : γ₁}, Iff (Membership.Mem.{max u5 u6, max u5 u6} (Sum.{u5, u6} γ₁ γ₂) (Finset.{max u5 u6} (Sum.{u5, u6} γ₁ γ₂)) (Finset.hasMem.{max u5 u6} (Sum.{u5, u6} γ₁ γ₂)) (Sum.inl.{u5, u6} γ₁ γ₂ c₁) (Finset.sumLift₂.{u1, u2, u3, u4, u5, u6} α₁ α₂ β₁ β₂ γ₁ γ₂ f g a b)) (Exists.{succ u1} α₁ (fun (a₁ : α₁) => Exists.{succ u3} β₁ (fun (b₁ : β₁) => And (Eq.{max (succ u1) (succ u2)} (Sum.{u1, u2} α₁ α₂) a (Sum.inl.{u1, u2} α₁ α₂ a₁)) (And (Eq.{max (succ u3) (succ u4)} (Sum.{u3, u4} β₁ β₂) b (Sum.inl.{u3, u4} β₁ β₂ b₁)) (Membership.Mem.{u5, u5} γ₁ (Finset.{u5} γ₁) (Finset.hasMem.{u5} γ₁) c₁ (f a₁ b₁))))))
-but is expected to have type
-  forall {α₁ : Type.{u4}} {α₂ : Type.{u3}} {β₁ : Type.{u2}} {β₂ : Type.{u1}} {γ₁ : Type.{u5}} {γ₂ : Type.{u6}} {f : α₁ -> β₁ -> (Finset.{u5} γ₁)} {g : α₂ -> β₂ -> (Finset.{u6} γ₂)} {a : Sum.{u4, u3} α₁ α₂} {b : Sum.{u2, u1} β₁ β₂} {c₁ : γ₁}, Iff (Membership.mem.{max u6 u5, max u6 u5} (Sum.{u5, u6} γ₁ γ₂) (Finset.{max u6 u5} (Sum.{u5, u6} γ₁ γ₂)) (Finset.instMembershipFinset.{max u5 u6} (Sum.{u5, u6} γ₁ γ₂)) (Sum.inl.{u5, u6} γ₁ γ₂ c₁) (Finset.sumLift₂.{u4, u3, u2, u1, u5, u6} α₁ α₂ β₁ β₂ γ₁ γ₂ f g a b)) (Exists.{succ u4} α₁ (fun (a₁ : α₁) => Exists.{succ u2} β₁ (fun (b₁ : β₁) => And (Eq.{max (succ u4) (succ u3)} (Sum.{u4, u3} α₁ α₂) a (Sum.inl.{u4, u3} α₁ α₂ a₁)) (And (Eq.{max (succ u2) (succ u1)} (Sum.{u2, u1} β₁ β₂) b (Sum.inl.{u2, u1} β₁ β₂ b₁)) (Membership.mem.{u5, u5} γ₁ (Finset.{u5} γ₁) (Finset.instMembershipFinset.{u5} γ₁) c₁ (f a₁ b₁))))))
-Case conversion may be inaccurate. Consider using '#align finset.inl_mem_sum_lift₂ Finset.inl_mem_sumLift₂ₓ'. -/
 theorem inl_mem_sumLift₂ {c₁ : γ₁} :
     inl c₁ ∈ sumLift₂ f g a b ↔ ∃ a₁ b₁, a = inl a₁ ∧ b = inl b₁ ∧ c₁ ∈ f a₁ b₁ :=
   by
@@ -89,12 +77,6 @@ theorem inl_mem_sumLift₂ {c₁ : γ₁} :
   exact inl_ne_inr h
 #align finset.inl_mem_sum_lift₂ Finset.inl_mem_sumLift₂
 
-/- warning: finset.inr_mem_sum_lift₂ -> Finset.inr_mem_sumLift₂ is a dubious translation:
-lean 3 declaration is
-  forall {α₁ : Type.{u1}} {α₂ : Type.{u2}} {β₁ : Type.{u3}} {β₂ : Type.{u4}} {γ₁ : Type.{u5}} {γ₂ : Type.{u6}} {f : α₁ -> β₁ -> (Finset.{u5} γ₁)} {g : α₂ -> β₂ -> (Finset.{u6} γ₂)} {a : Sum.{u1, u2} α₁ α₂} {b : Sum.{u3, u4} β₁ β₂} {c₂ : γ₂}, Iff (Membership.Mem.{max u5 u6, max u5 u6} (Sum.{u5, u6} γ₁ γ₂) (Finset.{max u5 u6} (Sum.{u5, u6} γ₁ γ₂)) (Finset.hasMem.{max u5 u6} (Sum.{u5, u6} γ₁ γ₂)) (Sum.inr.{u5, u6} γ₁ γ₂ c₂) (Finset.sumLift₂.{u1, u2, u3, u4, u5, u6} α₁ α₂ β₁ β₂ γ₁ γ₂ f g a b)) (Exists.{succ u2} α₂ (fun (a₂ : α₂) => Exists.{succ u4} β₂ (fun (b₂ : β₂) => And (Eq.{max (succ u1) (succ u2)} (Sum.{u1, u2} α₁ α₂) a (Sum.inr.{u1, u2} α₁ α₂ a₂)) (And (Eq.{max (succ u3) (succ u4)} (Sum.{u3, u4} β₁ β₂) b (Sum.inr.{u3, u4} β₁ β₂ b₂)) (Membership.Mem.{u6, u6} γ₂ (Finset.{u6} γ₂) (Finset.hasMem.{u6} γ₂) c₂ (g a₂ b₂))))))
-but is expected to have type
-  forall {α₁ : Type.{u4}} {α₂ : Type.{u3}} {β₁ : Type.{u2}} {β₂ : Type.{u1}} {γ₁ : Type.{u5}} {γ₂ : Type.{u6}} {f : α₁ -> β₁ -> (Finset.{u5} γ₁)} {g : α₂ -> β₂ -> (Finset.{u6} γ₂)} {a : Sum.{u4, u3} α₁ α₂} {b : Sum.{u2, u1} β₁ β₂} {c₂ : γ₂}, Iff (Membership.mem.{max u6 u5, max u6 u5} (Sum.{u5, u6} γ₁ γ₂) (Finset.{max u6 u5} (Sum.{u5, u6} γ₁ γ₂)) (Finset.instMembershipFinset.{max u6 u5} (Sum.{u5, u6} γ₁ γ₂)) (Sum.inr.{u5, u6} γ₁ γ₂ c₂) (Finset.sumLift₂.{u4, u3, u2, u1, u5, u6} α₁ α₂ β₁ β₂ γ₁ γ₂ f g a b)) (Exists.{succ u3} α₂ (fun (a₂ : α₂) => Exists.{succ u1} β₂ (fun (b₂ : β₂) => And (Eq.{max (succ u4) (succ u3)} (Sum.{u4, u3} α₁ α₂) a (Sum.inr.{u4, u3} α₁ α₂ a₂)) (And (Eq.{max (succ u2) (succ u1)} (Sum.{u2, u1} β₁ β₂) b (Sum.inr.{u2, u1} β₁ β₂ b₂)) (Membership.mem.{u6, u6} γ₂ (Finset.{u6} γ₂) (Finset.instMembershipFinset.{u6} γ₂) c₂ (g a₂ b₂))))))
-Case conversion may be inaccurate. Consider using '#align finset.inr_mem_sum_lift₂ Finset.inr_mem_sumLift₂ₓ'. -/
 theorem inr_mem_sumLift₂ {c₂ : γ₂} :
     inr c₂ ∈ sumLift₂ f g a b ↔ ∃ a₂ b₂, a = inr a₂ ∧ b = inr b₂ ∧ c₂ ∈ g a₂ b₂ :=
   by
@@ -104,12 +86,6 @@ theorem inr_mem_sumLift₂ {c₂ : γ₂} :
   exact inr_ne_inl h
 #align finset.inr_mem_sum_lift₂ Finset.inr_mem_sumLift₂
 
-/- warning: finset.sum_lift₂_eq_empty -> Finset.sumLift₂_eq_empty is a dubious translation:
-lean 3 declaration is
-  forall {α₁ : Type.{u1}} {α₂ : Type.{u2}} {β₁ : Type.{u3}} {β₂ : Type.{u4}} {γ₁ : Type.{u5}} {γ₂ : Type.{u6}} {f : α₁ -> β₁ -> (Finset.{u5} γ₁)} {g : α₂ -> β₂ -> (Finset.{u6} γ₂)} {a : Sum.{u1, u2} α₁ α₂} {b : Sum.{u3, u4} β₁ β₂}, Iff (Eq.{succ (max u5 u6)} (Finset.{max u5 u6} (Sum.{u5, u6} γ₁ γ₂)) (Finset.sumLift₂.{u1, u2, u3, u4, u5, u6} α₁ α₂ β₁ β₂ γ₁ γ₂ f g a b) (EmptyCollection.emptyCollection.{max u5 u6} (Finset.{max u5 u6} (Sum.{u5, u6} γ₁ γ₂)) (Finset.hasEmptyc.{max u5 u6} (Sum.{u5, u6} γ₁ γ₂)))) (And (forall (a₁ : α₁) (b₁ : β₁), (Eq.{max (succ u1) (succ u2)} (Sum.{u1, u2} α₁ α₂) a (Sum.inl.{u1, u2} α₁ α₂ a₁)) -> (Eq.{max (succ u3) (succ u4)} (Sum.{u3, u4} β₁ β₂) b (Sum.inl.{u3, u4} β₁ β₂ b₁)) -> (Eq.{succ u5} (Finset.{u5} γ₁) (f a₁ b₁) (EmptyCollection.emptyCollection.{u5} (Finset.{u5} γ₁) (Finset.hasEmptyc.{u5} γ₁)))) (forall (a₂ : α₂) (b₂ : β₂), (Eq.{max (succ u1) (succ u2)} (Sum.{u1, u2} α₁ α₂) a (Sum.inr.{u1, u2} α₁ α₂ a₂)) -> (Eq.{max (succ u3) (succ u4)} (Sum.{u3, u4} β₁ β₂) b (Sum.inr.{u3, u4} β₁ β₂ b₂)) -> (Eq.{succ u6} (Finset.{u6} γ₂) (g a₂ b₂) (EmptyCollection.emptyCollection.{u6} (Finset.{u6} γ₂) (Finset.hasEmptyc.{u6} γ₂)))))
-but is expected to have type
-  forall {α₁ : Type.{u4}} {α₂ : Type.{u3}} {β₁ : Type.{u2}} {β₂ : Type.{u1}} {γ₁ : Type.{u6}} {γ₂ : Type.{u5}} {f : α₁ -> β₁ -> (Finset.{u6} γ₁)} {g : α₂ -> β₂ -> (Finset.{u5} γ₂)} {a : Sum.{u4, u3} α₁ α₂} {b : Sum.{u2, u1} β₁ β₂}, Iff (Eq.{max (succ u6) (succ u5)} (Finset.{max u5 u6} (Sum.{u6, u5} γ₁ γ₂)) (Finset.sumLift₂.{u4, u3, u2, u1, u6, u5} α₁ α₂ β₁ β₂ γ₁ γ₂ f g a b) (EmptyCollection.emptyCollection.{max u6 u5} (Finset.{max u5 u6} (Sum.{u6, u5} γ₁ γ₂)) (Finset.instEmptyCollectionFinset.{max u6 u5} (Sum.{u6, u5} γ₁ γ₂)))) (And (forall (a₁ : α₁) (b₁ : β₁), (Eq.{max (succ u4) (succ u3)} (Sum.{u4, u3} α₁ α₂) a (Sum.inl.{u4, u3} α₁ α₂ a₁)) -> (Eq.{max (succ u2) (succ u1)} (Sum.{u2, u1} β₁ β₂) b (Sum.inl.{u2, u1} β₁ β₂ b₁)) -> (Eq.{succ u6} (Finset.{u6} γ₁) (f a₁ b₁) (EmptyCollection.emptyCollection.{u6} (Finset.{u6} γ₁) (Finset.instEmptyCollectionFinset.{u6} γ₁)))) (forall (a₂ : α₂) (b₂ : β₂), (Eq.{max (succ u4) (succ u3)} (Sum.{u4, u3} α₁ α₂) a (Sum.inr.{u4, u3} α₁ α₂ a₂)) -> (Eq.{max (succ u2) (succ u1)} (Sum.{u2, u1} β₁ β₂) b (Sum.inr.{u2, u1} β₁ β₂ b₂)) -> (Eq.{succ u5} (Finset.{u5} γ₂) (g a₂ b₂) (EmptyCollection.emptyCollection.{u5} (Finset.{u5} γ₂) (Finset.instEmptyCollectionFinset.{u5} γ₂)))))
-Case conversion may be inaccurate. Consider using '#align finset.sum_lift₂_eq_empty Finset.sumLift₂_eq_emptyₓ'. -/
 theorem sumLift₂_eq_empty :
     sumLift₂ f g a b = ∅ ↔
       (∀ a₁ b₁, a = inl a₁ → b = inl b₁ → f a₁ b₁ = ∅) ∧
@@ -124,12 +100,6 @@ theorem sumLift₂_eq_empty :
   · exact map_eq_empty.2 (h.2 _ _ rfl rfl)
 #align finset.sum_lift₂_eq_empty Finset.sumLift₂_eq_empty
 
-/- warning: finset.sum_lift₂_nonempty -> Finset.sumLift₂_nonempty is a dubious translation:
-lean 3 declaration is
-  forall {α₁ : Type.{u1}} {α₂ : Type.{u2}} {β₁ : Type.{u3}} {β₂ : Type.{u4}} {γ₁ : Type.{u5}} {γ₂ : Type.{u6}} {f : α₁ -> β₁ -> (Finset.{u5} γ₁)} {g : α₂ -> β₂ -> (Finset.{u6} γ₂)} {a : Sum.{u1, u2} α₁ α₂} {b : Sum.{u3, u4} β₁ β₂}, Iff (Finset.Nonempty.{max u5 u6} (Sum.{u5, u6} γ₁ γ₂) (Finset.sumLift₂.{u1, u2, u3, u4, u5, u6} α₁ α₂ β₁ β₂ γ₁ γ₂ f g a b)) (Or (Exists.{succ u1} α₁ (fun (a₁ : α₁) => Exists.{succ u3} β₁ (fun (b₁ : β₁) => And (Eq.{max (succ u1) (succ u2)} (Sum.{u1, u2} α₁ α₂) a (Sum.inl.{u1, u2} α₁ α₂ a₁)) (And (Eq.{max (succ u3) (succ u4)} (Sum.{u3, u4} β₁ β₂) b (Sum.inl.{u3, u4} β₁ β₂ b₁)) (Finset.Nonempty.{u5} γ₁ (f a₁ b₁)))))) (Exists.{succ u2} α₂ (fun (a₂ : α₂) => Exists.{succ u4} β₂ (fun (b₂ : β₂) => And (Eq.{max (succ u1) (succ u2)} (Sum.{u1, u2} α₁ α₂) a (Sum.inr.{u1, u2} α₁ α₂ a₂)) (And (Eq.{max (succ u3) (succ u4)} (Sum.{u3, u4} β₁ β₂) b (Sum.inr.{u3, u4} β₁ β₂ b₂)) (Finset.Nonempty.{u6} γ₂ (g a₂ b₂)))))))
-but is expected to have type
-  forall {α₁ : Type.{u4}} {α₂ : Type.{u3}} {β₁ : Type.{u2}} {β₂ : Type.{u1}} {γ₁ : Type.{u6}} {γ₂ : Type.{u5}} {f : α₁ -> β₁ -> (Finset.{u6} γ₁)} {g : α₂ -> β₂ -> (Finset.{u5} γ₂)} {a : Sum.{u4, u3} α₁ α₂} {b : Sum.{u2, u1} β₁ β₂}, Iff (Finset.Nonempty.{max u6 u5} (Sum.{u6, u5} γ₁ γ₂) (Finset.sumLift₂.{u4, u3, u2, u1, u6, u5} α₁ α₂ β₁ β₂ γ₁ γ₂ f g a b)) (Or (Exists.{succ u4} α₁ (fun (a₁ : α₁) => Exists.{succ u2} β₁ (fun (b₁ : β₁) => And (Eq.{max (succ u4) (succ u3)} (Sum.{u4, u3} α₁ α₂) a (Sum.inl.{u4, u3} α₁ α₂ a₁)) (And (Eq.{max (succ u2) (succ u1)} (Sum.{u2, u1} β₁ β₂) b (Sum.inl.{u2, u1} β₁ β₂ b₁)) (Finset.Nonempty.{u6} γ₁ (f a₁ b₁)))))) (Exists.{succ u3} α₂ (fun (a₂ : α₂) => Exists.{succ u1} β₂ (fun (b₂ : β₂) => And (Eq.{max (succ u4) (succ u3)} (Sum.{u4, u3} α₁ α₂) a (Sum.inr.{u4, u3} α₁ α₂ a₂)) (And (Eq.{max (succ u2) (succ u1)} (Sum.{u2, u1} β₁ β₂) b (Sum.inr.{u2, u1} β₁ β₂ b₂)) (Finset.Nonempty.{u5} γ₂ (g a₂ b₂)))))))
-Case conversion may be inaccurate. Consider using '#align finset.sum_lift₂_nonempty Finset.sumLift₂_nonemptyₓ'. -/
 theorem sumLift₂_nonempty :
     (sumLift₂ f g a b).Nonempty ↔
       (∃ a₁ b₁, a = inl a₁ ∧ b = inl b₁ ∧ (f a₁ b₁).Nonempty) ∨
@@ -137,12 +107,6 @@ theorem sumLift₂_nonempty :
   by simp [nonempty_iff_ne_empty, sum_lift₂_eq_empty, not_and_or]
 #align finset.sum_lift₂_nonempty Finset.sumLift₂_nonempty
 
-/- warning: finset.sum_lift₂_mono -> Finset.sumLift₂_mono is a dubious translation:
-lean 3 declaration is
-  forall {α₁ : Type.{u1}} {α₂ : Type.{u2}} {β₁ : Type.{u3}} {β₂ : Type.{u4}} {γ₁ : Type.{u5}} {γ₂ : Type.{u6}} {f₁ : α₁ -> β₁ -> (Finset.{u5} γ₁)} {g₁ : α₁ -> β₁ -> (Finset.{u5} γ₁)} {f₂ : α₂ -> β₂ -> (Finset.{u6} γ₂)} {g₂ : α₂ -> β₂ -> (Finset.{u6} γ₂)}, (forall (a : α₁) (b : β₁), HasSubset.Subset.{u5} (Finset.{u5} γ₁) (Finset.hasSubset.{u5} γ₁) (f₁ a b) (g₁ a b)) -> (forall (a : α₂) (b : β₂), HasSubset.Subset.{u6} (Finset.{u6} γ₂) (Finset.hasSubset.{u6} γ₂) (f₂ a b) (g₂ a b)) -> (forall (a : Sum.{u1, u2} α₁ α₂) (b : Sum.{u3, u4} β₁ β₂), HasSubset.Subset.{max u5 u6} (Finset.{max u5 u6} (Sum.{u5, u6} γ₁ γ₂)) (Finset.hasSubset.{max u5 u6} (Sum.{u5, u6} γ₁ γ₂)) (Finset.sumLift₂.{u1, u2, u3, u4, u5, u6} α₁ α₂ β₁ β₂ γ₁ γ₂ f₁ f₂ a b) (Finset.sumLift₂.{u1, u2, u3, u4, u5, u6} α₁ α₂ β₁ β₂ γ₁ γ₂ g₁ g₂ a b))
-but is expected to have type
-  forall {α₁ : Type.{u4}} {α₂ : Type.{u3}} {β₁ : Type.{u2}} {β₂ : Type.{u1}} {γ₁ : Type.{u6}} {γ₂ : Type.{u5}} {f₁ : α₁ -> β₁ -> (Finset.{u6} γ₁)} {g₁ : α₁ -> β₁ -> (Finset.{u6} γ₁)} {f₂ : α₂ -> β₂ -> (Finset.{u5} γ₂)} {g₂ : α₂ -> β₂ -> (Finset.{u5} γ₂)}, (forall (a : α₁) (b : β₁), HasSubset.Subset.{u6} (Finset.{u6} γ₁) (Finset.instHasSubsetFinset.{u6} γ₁) (f₁ a b) (g₁ a b)) -> (forall (a : α₂) (b : β₂), HasSubset.Subset.{u5} (Finset.{u5} γ₂) (Finset.instHasSubsetFinset.{u5} γ₂) (f₂ a b) (g₂ a b)) -> (forall (a : Sum.{u4, u3} α₁ α₂) (b : Sum.{u2, u1} β₁ β₂), HasSubset.Subset.{max u5 u6} (Finset.{max u5 u6} (Sum.{u6, u5} γ₁ γ₂)) (Finset.instHasSubsetFinset.{max u6 u5} (Sum.{u6, u5} γ₁ γ₂)) (Finset.sumLift₂.{u4, u3, u2, u1, u6, u5} α₁ α₂ β₁ β₂ γ₁ γ₂ f₁ f₂ a b) (Finset.sumLift₂.{u4, u3, u2, u1, u6, u5} α₁ α₂ β₁ β₂ γ₁ γ₂ g₁ g₂ a b))
-Case conversion may be inaccurate. Consider using '#align finset.sum_lift₂_mono Finset.sumLift₂_monoₓ'. -/
 theorem sumLift₂_mono (h₁ : ∀ a b, f₁ a b ⊆ g₁ a b) (h₂ : ∀ a b, f₂ a b ⊆ g₂ a b) :
     ∀ a b, sumLift₂ f₁ f₂ a b ⊆ sumLift₂ g₁ g₂ a b
   | inl a, inl b => map_subset_map.2 (h₁ _ _)
@@ -181,170 +145,74 @@ instance : LocallyFiniteOrder (Sum α β)
 
 variable (a₁ a₂ : α) (b₁ b₂ : β) (a b : Sum α β)
 
-/- warning: sum.Icc_inl_inl -> Sum.Icc_inl_inl is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : Preorder.{u1} α] [_inst_2 : Preorder.{u2} β] [_inst_3 : LocallyFiniteOrder.{u1} α _inst_1] [_inst_4 : LocallyFiniteOrder.{u2} β _inst_2] (a₁ : α) (a₂ : α), Eq.{succ (max u1 u2)} (Finset.{max u1 u2} (Sum.{u1, u2} α β)) (Finset.Icc.{max u1 u2} (Sum.{u1, u2} α β) (Sum.preorder.{u1, u2} α β _inst_1 _inst_2) (Sum.locallyFiniteOrder.{u1, u2} α β _inst_1 _inst_2 _inst_3 _inst_4) (Sum.inl.{u1, u2} α β a₁) (Sum.inl.{u1, u2} α β a₂)) (Finset.map.{u1, max u1 u2} α (Sum.{u1, u2} α β) (Function.Embedding.inl.{u1, u2} α β) (Finset.Icc.{u1} α _inst_1 _inst_3 a₁ a₂))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} [_inst_1 : Preorder.{u2} α] [_inst_2 : Preorder.{u1} β] [_inst_3 : LocallyFiniteOrder.{u2} α _inst_1] [_inst_4 : LocallyFiniteOrder.{u1} β _inst_2] (a₁ : α) (a₂ : α), Eq.{max (succ u2) (succ u1)} (Finset.{max u2 u1} (Sum.{u2, u1} α β)) (Finset.Icc.{max u2 u1} (Sum.{u2, u1} α β) (Sum.instPreorderSum.{u2, u1} α β _inst_1 _inst_2) (Sum.instLocallyFiniteOrderSumInstPreorderSum.{u2, u1} α β _inst_1 _inst_2 _inst_3 _inst_4) (Sum.inl.{u2, u1} α β a₁) (Sum.inl.{u2, u1} α β a₂)) (Finset.map.{u2, max u1 u2} α (Sum.{u2, u1} α β) (Function.Embedding.inl.{u2, u1} α β) (Finset.Icc.{u2} α _inst_1 _inst_3 a₁ a₂))
-Case conversion may be inaccurate. Consider using '#align sum.Icc_inl_inl Sum.Icc_inl_inlₓ'. -/
 theorem Icc_inl_inl : Icc (inl a₁ : Sum α β) (inl a₂) = (Icc a₁ a₂).map Embedding.inl :=
   rfl
 #align sum.Icc_inl_inl Sum.Icc_inl_inl
 
-/- warning: sum.Ico_inl_inl -> Sum.Ico_inl_inl is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : Preorder.{u1} α] [_inst_2 : Preorder.{u2} β] [_inst_3 : LocallyFiniteOrder.{u1} α _inst_1] [_inst_4 : LocallyFiniteOrder.{u2} β _inst_2] (a₁ : α) (a₂ : α), Eq.{succ (max u1 u2)} (Finset.{max u1 u2} (Sum.{u1, u2} α β)) (Finset.Ico.{max u1 u2} (Sum.{u1, u2} α β) (Sum.preorder.{u1, u2} α β _inst_1 _inst_2) (Sum.locallyFiniteOrder.{u1, u2} α β _inst_1 _inst_2 _inst_3 _inst_4) (Sum.inl.{u1, u2} α β a₁) (Sum.inl.{u1, u2} α β a₂)) (Finset.map.{u1, max u1 u2} α (Sum.{u1, u2} α β) (Function.Embedding.inl.{u1, u2} α β) (Finset.Ico.{u1} α _inst_1 _inst_3 a₁ a₂))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} [_inst_1 : Preorder.{u2} α] [_inst_2 : Preorder.{u1} β] [_inst_3 : LocallyFiniteOrder.{u2} α _inst_1] [_inst_4 : LocallyFiniteOrder.{u1} β _inst_2] (a₁ : α) (a₂ : α), Eq.{max (succ u2) (succ u1)} (Finset.{max u2 u1} (Sum.{u2, u1} α β)) (Finset.Ico.{max u2 u1} (Sum.{u2, u1} α β) (Sum.instPreorderSum.{u2, u1} α β _inst_1 _inst_2) (Sum.instLocallyFiniteOrderSumInstPreorderSum.{u2, u1} α β _inst_1 _inst_2 _inst_3 _inst_4) (Sum.inl.{u2, u1} α β a₁) (Sum.inl.{u2, u1} α β a₂)) (Finset.map.{u2, max u1 u2} α (Sum.{u2, u1} α β) (Function.Embedding.inl.{u2, u1} α β) (Finset.Ico.{u2} α _inst_1 _inst_3 a₁ a₂))
-Case conversion may be inaccurate. Consider using '#align sum.Ico_inl_inl Sum.Ico_inl_inlₓ'. -/
 theorem Ico_inl_inl : Ico (inl a₁ : Sum α β) (inl a₂) = (Ico a₁ a₂).map Embedding.inl :=
   rfl
 #align sum.Ico_inl_inl Sum.Ico_inl_inl
 
-/- warning: sum.Ioc_inl_inl -> Sum.Ioc_inl_inl is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : Preorder.{u1} α] [_inst_2 : Preorder.{u2} β] [_inst_3 : LocallyFiniteOrder.{u1} α _inst_1] [_inst_4 : LocallyFiniteOrder.{u2} β _inst_2] (a₁ : α) (a₂ : α), Eq.{succ (max u1 u2)} (Finset.{max u1 u2} (Sum.{u1, u2} α β)) (Finset.Ioc.{max u1 u2} (Sum.{u1, u2} α β) (Sum.preorder.{u1, u2} α β _inst_1 _inst_2) (Sum.locallyFiniteOrder.{u1, u2} α β _inst_1 _inst_2 _inst_3 _inst_4) (Sum.inl.{u1, u2} α β a₁) (Sum.inl.{u1, u2} α β a₂)) (Finset.map.{u1, max u1 u2} α (Sum.{u1, u2} α β) (Function.Embedding.inl.{u1, u2} α β) (Finset.Ioc.{u1} α _inst_1 _inst_3 a₁ a₂))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} [_inst_1 : Preorder.{u2} α] [_inst_2 : Preorder.{u1} β] [_inst_3 : LocallyFiniteOrder.{u2} α _inst_1] [_inst_4 : LocallyFiniteOrder.{u1} β _inst_2] (a₁ : α) (a₂ : α), Eq.{max (succ u2) (succ u1)} (Finset.{max u2 u1} (Sum.{u2, u1} α β)) (Finset.Ioc.{max u2 u1} (Sum.{u2, u1} α β) (Sum.instPreorderSum.{u2, u1} α β _inst_1 _inst_2) (Sum.instLocallyFiniteOrderSumInstPreorderSum.{u2, u1} α β _inst_1 _inst_2 _inst_3 _inst_4) (Sum.inl.{u2, u1} α β a₁) (Sum.inl.{u2, u1} α β a₂)) (Finset.map.{u2, max u1 u2} α (Sum.{u2, u1} α β) (Function.Embedding.inl.{u2, u1} α β) (Finset.Ioc.{u2} α _inst_1 _inst_3 a₁ a₂))
-Case conversion may be inaccurate. Consider using '#align sum.Ioc_inl_inl Sum.Ioc_inl_inlₓ'. -/
 theorem Ioc_inl_inl : Ioc (inl a₁ : Sum α β) (inl a₂) = (Ioc a₁ a₂).map Embedding.inl :=
   rfl
 #align sum.Ioc_inl_inl Sum.Ioc_inl_inl
 
-/- warning: sum.Ioo_inl_inl -> Sum.Ioo_inl_inl is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : Preorder.{u1} α] [_inst_2 : Preorder.{u2} β] [_inst_3 : LocallyFiniteOrder.{u1} α _inst_1] [_inst_4 : LocallyFiniteOrder.{u2} β _inst_2] (a₁ : α) (a₂ : α), Eq.{succ (max u1 u2)} (Finset.{max u1 u2} (Sum.{u1, u2} α β)) (Finset.Ioo.{max u1 u2} (Sum.{u1, u2} α β) (Sum.preorder.{u1, u2} α β _inst_1 _inst_2) (Sum.locallyFiniteOrder.{u1, u2} α β _inst_1 _inst_2 _inst_3 _inst_4) (Sum.inl.{u1, u2} α β a₁) (Sum.inl.{u1, u2} α β a₂)) (Finset.map.{u1, max u1 u2} α (Sum.{u1, u2} α β) (Function.Embedding.inl.{u1, u2} α β) (Finset.Ioo.{u1} α _inst_1 _inst_3 a₁ a₂))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} [_inst_1 : Preorder.{u2} α] [_inst_2 : Preorder.{u1} β] [_inst_3 : LocallyFiniteOrder.{u2} α _inst_1] [_inst_4 : LocallyFiniteOrder.{u1} β _inst_2] (a₁ : α) (a₂ : α), Eq.{max (succ u2) (succ u1)} (Finset.{max u2 u1} (Sum.{u2, u1} α β)) (Finset.Ioo.{max u2 u1} (Sum.{u2, u1} α β) (Sum.instPreorderSum.{u2, u1} α β _inst_1 _inst_2) (Sum.instLocallyFiniteOrderSumInstPreorderSum.{u2, u1} α β _inst_1 _inst_2 _inst_3 _inst_4) (Sum.inl.{u2, u1} α β a₁) (Sum.inl.{u2, u1} α β a₂)) (Finset.map.{u2, max u1 u2} α (Sum.{u2, u1} α β) (Function.Embedding.inl.{u2, u1} α β) (Finset.Ioo.{u2} α _inst_1 _inst_3 a₁ a₂))
-Case conversion may be inaccurate. Consider using '#align sum.Ioo_inl_inl Sum.Ioo_inl_inlₓ'. -/
 theorem Ioo_inl_inl : Ioo (inl a₁ : Sum α β) (inl a₂) = (Ioo a₁ a₂).map Embedding.inl :=
   rfl
 #align sum.Ioo_inl_inl Sum.Ioo_inl_inl
 
-/- warning: sum.Icc_inl_inr -> Sum.Icc_inl_inr is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : Preorder.{u1} α] [_inst_2 : Preorder.{u2} β] [_inst_3 : LocallyFiniteOrder.{u1} α _inst_1] [_inst_4 : LocallyFiniteOrder.{u2} β _inst_2] (a₁ : α) (b₂ : β), Eq.{succ (max u1 u2)} (Finset.{max u1 u2} (Sum.{u1, u2} α β)) (Finset.Icc.{max u1 u2} (Sum.{u1, u2} α β) (Sum.preorder.{u1, u2} α β _inst_1 _inst_2) (Sum.locallyFiniteOrder.{u1, u2} α β _inst_1 _inst_2 _inst_3 _inst_4) (Sum.inl.{u1, u2} α β a₁) (Sum.inr.{u1, u2} α β b₂)) (EmptyCollection.emptyCollection.{max u1 u2} (Finset.{max u1 u2} (Sum.{u1, u2} α β)) (Finset.hasEmptyc.{max u1 u2} (Sum.{u1, u2} α β)))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} [_inst_1 : Preorder.{u2} α] [_inst_2 : Preorder.{u1} β] [_inst_3 : LocallyFiniteOrder.{u2} α _inst_1] [_inst_4 : LocallyFiniteOrder.{u1} β _inst_2] (a₁ : α) (b₂ : β), Eq.{max (succ u2) (succ u1)} (Finset.{max u1 u2} (Sum.{u2, u1} α β)) (Finset.Icc.{max u1 u2} (Sum.{u2, u1} α β) (Sum.instPreorderSum.{u2, u1} α β _inst_1 _inst_2) (Sum.instLocallyFiniteOrderSumInstPreorderSum.{u2, u1} α β _inst_1 _inst_2 _inst_3 _inst_4) (Sum.inl.{u2, u1} α β a₁) (Sum.inr.{u2, u1} α β b₂)) (EmptyCollection.emptyCollection.{max u2 u1} (Finset.{max u1 u2} (Sum.{u2, u1} α β)) (Finset.instEmptyCollectionFinset.{max u2 u1} (Sum.{u2, u1} α β)))
-Case conversion may be inaccurate. Consider using '#align sum.Icc_inl_inr Sum.Icc_inl_inrₓ'. -/
 @[simp]
 theorem Icc_inl_inr : Icc (inl a₁) (inr b₂) = ∅ :=
   rfl
 #align sum.Icc_inl_inr Sum.Icc_inl_inr
 
-/- warning: sum.Ico_inl_inr -> Sum.Ico_inl_inr is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : Preorder.{u1} α] [_inst_2 : Preorder.{u2} β] [_inst_3 : LocallyFiniteOrder.{u1} α _inst_1] [_inst_4 : LocallyFiniteOrder.{u2} β _inst_2] (a₁ : α) (b₂ : β), Eq.{succ (max u1 u2)} (Finset.{max u1 u2} (Sum.{u1, u2} α β)) (Finset.Ico.{max u1 u2} (Sum.{u1, u2} α β) (Sum.preorder.{u1, u2} α β _inst_1 _inst_2) (Sum.locallyFiniteOrder.{u1, u2} α β _inst_1 _inst_2 _inst_3 _inst_4) (Sum.inl.{u1, u2} α β a₁) (Sum.inr.{u1, u2} α β b₂)) (EmptyCollection.emptyCollection.{max u1 u2} (Finset.{max u1 u2} (Sum.{u1, u2} α β)) (Finset.hasEmptyc.{max u1 u2} (Sum.{u1, u2} α β)))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} [_inst_1 : Preorder.{u2} α] [_inst_2 : Preorder.{u1} β] [_inst_3 : LocallyFiniteOrder.{u2} α _inst_1] [_inst_4 : LocallyFiniteOrder.{u1} β _inst_2] (a₁ : α) (b₂ : β), Eq.{max (succ u2) (succ u1)} (Finset.{max u1 u2} (Sum.{u2, u1} α β)) (Finset.Ico.{max u1 u2} (Sum.{u2, u1} α β) (Sum.instPreorderSum.{u2, u1} α β _inst_1 _inst_2) (Sum.instLocallyFiniteOrderSumInstPreorderSum.{u2, u1} α β _inst_1 _inst_2 _inst_3 _inst_4) (Sum.inl.{u2, u1} α β a₁) (Sum.inr.{u2, u1} α β b₂)) (EmptyCollection.emptyCollection.{max u2 u1} (Finset.{max u1 u2} (Sum.{u2, u1} α β)) (Finset.instEmptyCollectionFinset.{max u2 u1} (Sum.{u2, u1} α β)))
-Case conversion may be inaccurate. Consider using '#align sum.Ico_inl_inr Sum.Ico_inl_inrₓ'. -/
 @[simp]
 theorem Ico_inl_inr : Ico (inl a₁) (inr b₂) = ∅ :=
   rfl
 #align sum.Ico_inl_inr Sum.Ico_inl_inr
 
-/- warning: sum.Ioc_inl_inr -> Sum.Ioc_inl_inr is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : Preorder.{u1} α] [_inst_2 : Preorder.{u2} β] [_inst_3 : LocallyFiniteOrder.{u1} α _inst_1] [_inst_4 : LocallyFiniteOrder.{u2} β _inst_2] (a₁ : α) (b₂ : β), Eq.{succ (max u1 u2)} (Finset.{max u1 u2} (Sum.{u1, u2} α β)) (Finset.Ioc.{max u1 u2} (Sum.{u1, u2} α β) (Sum.preorder.{u1, u2} α β _inst_1 _inst_2) (Sum.locallyFiniteOrder.{u1, u2} α β _inst_1 _inst_2 _inst_3 _inst_4) (Sum.inl.{u1, u2} α β a₁) (Sum.inr.{u1, u2} α β b₂)) (EmptyCollection.emptyCollection.{max u1 u2} (Finset.{max u1 u2} (Sum.{u1, u2} α β)) (Finset.hasEmptyc.{max u1 u2} (Sum.{u1, u2} α β)))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} [_inst_1 : Preorder.{u2} α] [_inst_2 : Preorder.{u1} β] [_inst_3 : LocallyFiniteOrder.{u2} α _inst_1] [_inst_4 : LocallyFiniteOrder.{u1} β _inst_2] (a₁ : α) (b₂ : β), Eq.{max (succ u2) (succ u1)} (Finset.{max u1 u2} (Sum.{u2, u1} α β)) (Finset.Ioc.{max u1 u2} (Sum.{u2, u1} α β) (Sum.instPreorderSum.{u2, u1} α β _inst_1 _inst_2) (Sum.instLocallyFiniteOrderSumInstPreorderSum.{u2, u1} α β _inst_1 _inst_2 _inst_3 _inst_4) (Sum.inl.{u2, u1} α β a₁) (Sum.inr.{u2, u1} α β b₂)) (EmptyCollection.emptyCollection.{max u2 u1} (Finset.{max u1 u2} (Sum.{u2, u1} α β)) (Finset.instEmptyCollectionFinset.{max u2 u1} (Sum.{u2, u1} α β)))
-Case conversion may be inaccurate. Consider using '#align sum.Ioc_inl_inr Sum.Ioc_inl_inrₓ'. -/
 @[simp]
 theorem Ioc_inl_inr : Ioc (inl a₁) (inr b₂) = ∅ :=
   rfl
 #align sum.Ioc_inl_inr Sum.Ioc_inl_inr
 
-/- warning: sum.Ioo_inl_inr -> Sum.Ioo_inl_inr is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : Preorder.{u1} α] [_inst_2 : Preorder.{u2} β] [_inst_3 : LocallyFiniteOrder.{u1} α _inst_1] [_inst_4 : LocallyFiniteOrder.{u2} β _inst_2] (a₁ : α) (b₂ : β), Eq.{succ (max u1 u2)} (Finset.{max u1 u2} (Sum.{u1, u2} α β)) (Finset.Ioo.{max u1 u2} (Sum.{u1, u2} α β) (Sum.preorder.{u1, u2} α β _inst_1 _inst_2) (Sum.locallyFiniteOrder.{u1, u2} α β _inst_1 _inst_2 _inst_3 _inst_4) (Sum.inl.{u1, u2} α β a₁) (Sum.inr.{u1, u2} α β b₂)) (EmptyCollection.emptyCollection.{max u1 u2} (Finset.{max u1 u2} (Sum.{u1, u2} α β)) (Finset.hasEmptyc.{max u1 u2} (Sum.{u1, u2} α β)))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} [_inst_1 : Preorder.{u2} α] [_inst_2 : Preorder.{u1} β] [_inst_3 : LocallyFiniteOrder.{u2} α _inst_1] [_inst_4 : LocallyFiniteOrder.{u1} β _inst_2] (a₁ : α) (b₂ : β), Eq.{max (succ u2) (succ u1)} (Finset.{max u1 u2} (Sum.{u2, u1} α β)) (Finset.Ioo.{max u1 u2} (Sum.{u2, u1} α β) (Sum.instPreorderSum.{u2, u1} α β _inst_1 _inst_2) (Sum.instLocallyFiniteOrderSumInstPreorderSum.{u2, u1} α β _inst_1 _inst_2 _inst_3 _inst_4) (Sum.inl.{u2, u1} α β a₁) (Sum.inr.{u2, u1} α β b₂)) (EmptyCollection.emptyCollection.{max u2 u1} (Finset.{max u1 u2} (Sum.{u2, u1} α β)) (Finset.instEmptyCollectionFinset.{max u2 u1} (Sum.{u2, u1} α β)))
-Case conversion may be inaccurate. Consider using '#align sum.Ioo_inl_inr Sum.Ioo_inl_inrₓ'. -/
 @[simp]
 theorem Ioo_inl_inr : Ioo (inl a₁) (inr b₂) = ∅ :=
   rfl
 #align sum.Ioo_inl_inr Sum.Ioo_inl_inr
 
-/- warning: sum.Icc_inr_inl -> Sum.Icc_inr_inl is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : Preorder.{u1} α] [_inst_2 : Preorder.{u2} β] [_inst_3 : LocallyFiniteOrder.{u1} α _inst_1] [_inst_4 : LocallyFiniteOrder.{u2} β _inst_2] (a₂ : α) (b₁ : β), Eq.{succ (max u1 u2)} (Finset.{max u1 u2} (Sum.{u1, u2} α β)) (Finset.Icc.{max u1 u2} (Sum.{u1, u2} α β) (Sum.preorder.{u1, u2} α β _inst_1 _inst_2) (Sum.locallyFiniteOrder.{u1, u2} α β _inst_1 _inst_2 _inst_3 _inst_4) (Sum.inr.{u1, u2} α β b₁) (Sum.inl.{u1, u2} α β a₂)) (EmptyCollection.emptyCollection.{max u1 u2} (Finset.{max u1 u2} (Sum.{u1, u2} α β)) (Finset.hasEmptyc.{max u1 u2} (Sum.{u1, u2} α β)))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} [_inst_1 : Preorder.{u2} α] [_inst_2 : Preorder.{u1} β] [_inst_3 : LocallyFiniteOrder.{u2} α _inst_1] [_inst_4 : LocallyFiniteOrder.{u1} β _inst_2] (a₂ : α) (b₁ : β), Eq.{max (succ u2) (succ u1)} (Finset.{max u1 u2} (Sum.{u2, u1} α β)) (Finset.Icc.{max u1 u2} (Sum.{u2, u1} α β) (Sum.instPreorderSum.{u2, u1} α β _inst_1 _inst_2) (Sum.instLocallyFiniteOrderSumInstPreorderSum.{u2, u1} α β _inst_1 _inst_2 _inst_3 _inst_4) (Sum.inr.{u2, u1} α β b₁) (Sum.inl.{u2, u1} α β a₂)) (EmptyCollection.emptyCollection.{max u2 u1} (Finset.{max u1 u2} (Sum.{u2, u1} α β)) (Finset.instEmptyCollectionFinset.{max u2 u1} (Sum.{u2, u1} α β)))
-Case conversion may be inaccurate. Consider using '#align sum.Icc_inr_inl Sum.Icc_inr_inlₓ'. -/
 @[simp]
 theorem Icc_inr_inl : Icc (inr b₁) (inl a₂) = ∅ :=
   rfl
 #align sum.Icc_inr_inl Sum.Icc_inr_inl
 
-/- warning: sum.Ico_inr_inl -> Sum.Ico_inr_inl is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : Preorder.{u1} α] [_inst_2 : Preorder.{u2} β] [_inst_3 : LocallyFiniteOrder.{u1} α _inst_1] [_inst_4 : LocallyFiniteOrder.{u2} β _inst_2] (a₂ : α) (b₁ : β), Eq.{succ (max u1 u2)} (Finset.{max u1 u2} (Sum.{u1, u2} α β)) (Finset.Ico.{max u1 u2} (Sum.{u1, u2} α β) (Sum.preorder.{u1, u2} α β _inst_1 _inst_2) (Sum.locallyFiniteOrder.{u1, u2} α β _inst_1 _inst_2 _inst_3 _inst_4) (Sum.inr.{u1, u2} α β b₁) (Sum.inl.{u1, u2} α β a₂)) (EmptyCollection.emptyCollection.{max u1 u2} (Finset.{max u1 u2} (Sum.{u1, u2} α β)) (Finset.hasEmptyc.{max u1 u2} (Sum.{u1, u2} α β)))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} [_inst_1 : Preorder.{u2} α] [_inst_2 : Preorder.{u1} β] [_inst_3 : LocallyFiniteOrder.{u2} α _inst_1] [_inst_4 : LocallyFiniteOrder.{u1} β _inst_2] (a₂ : α) (b₁ : β), Eq.{max (succ u2) (succ u1)} (Finset.{max u1 u2} (Sum.{u2, u1} α β)) (Finset.Ico.{max u1 u2} (Sum.{u2, u1} α β) (Sum.instPreorderSum.{u2, u1} α β _inst_1 _inst_2) (Sum.instLocallyFiniteOrderSumInstPreorderSum.{u2, u1} α β _inst_1 _inst_2 _inst_3 _inst_4) (Sum.inr.{u2, u1} α β b₁) (Sum.inl.{u2, u1} α β a₂)) (EmptyCollection.emptyCollection.{max u2 u1} (Finset.{max u1 u2} (Sum.{u2, u1} α β)) (Finset.instEmptyCollectionFinset.{max u2 u1} (Sum.{u2, u1} α β)))
-Case conversion may be inaccurate. Consider using '#align sum.Ico_inr_inl Sum.Ico_inr_inlₓ'. -/
 @[simp]
 theorem Ico_inr_inl : Ico (inr b₁) (inl a₂) = ∅ :=
   rfl
 #align sum.Ico_inr_inl Sum.Ico_inr_inl
 
-/- warning: sum.Ioc_inr_inl -> Sum.Ioc_inr_inl is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : Preorder.{u1} α] [_inst_2 : Preorder.{u2} β] [_inst_3 : LocallyFiniteOrder.{u1} α _inst_1] [_inst_4 : LocallyFiniteOrder.{u2} β _inst_2] (a₂ : α) (b₁ : β), Eq.{succ (max u1 u2)} (Finset.{max u1 u2} (Sum.{u1, u2} α β)) (Finset.Ioc.{max u1 u2} (Sum.{u1, u2} α β) (Sum.preorder.{u1, u2} α β _inst_1 _inst_2) (Sum.locallyFiniteOrder.{u1, u2} α β _inst_1 _inst_2 _inst_3 _inst_4) (Sum.inr.{u1, u2} α β b₁) (Sum.inl.{u1, u2} α β a₂)) (EmptyCollection.emptyCollection.{max u1 u2} (Finset.{max u1 u2} (Sum.{u1, u2} α β)) (Finset.hasEmptyc.{max u1 u2} (Sum.{u1, u2} α β)))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} [_inst_1 : Preorder.{u2} α] [_inst_2 : Preorder.{u1} β] [_inst_3 : LocallyFiniteOrder.{u2} α _inst_1] [_inst_4 : LocallyFiniteOrder.{u1} β _inst_2] (a₂ : α) (b₁ : β), Eq.{max (succ u2) (succ u1)} (Finset.{max u1 u2} (Sum.{u2, u1} α β)) (Finset.Ioc.{max u1 u2} (Sum.{u2, u1} α β) (Sum.instPreorderSum.{u2, u1} α β _inst_1 _inst_2) (Sum.instLocallyFiniteOrderSumInstPreorderSum.{u2, u1} α β _inst_1 _inst_2 _inst_3 _inst_4) (Sum.inr.{u2, u1} α β b₁) (Sum.inl.{u2, u1} α β a₂)) (EmptyCollection.emptyCollection.{max u2 u1} (Finset.{max u1 u2} (Sum.{u2, u1} α β)) (Finset.instEmptyCollectionFinset.{max u2 u1} (Sum.{u2, u1} α β)))
-Case conversion may be inaccurate. Consider using '#align sum.Ioc_inr_inl Sum.Ioc_inr_inlₓ'. -/
 @[simp]
 theorem Ioc_inr_inl : Ioc (inr b₁) (inl a₂) = ∅ :=
   rfl
 #align sum.Ioc_inr_inl Sum.Ioc_inr_inl
 
-/- warning: sum.Ioo_inr_inl -> Sum.Ioo_inr_inl is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : Preorder.{u1} α] [_inst_2 : Preorder.{u2} β] [_inst_3 : LocallyFiniteOrder.{u1} α _inst_1] [_inst_4 : LocallyFiniteOrder.{u2} β _inst_2] (a₂ : α) (b₁ : β), Eq.{succ (max u1 u2)} (Finset.{max u1 u2} (Sum.{u1, u2} α β)) (Finset.Ioo.{max u1 u2} (Sum.{u1, u2} α β) (Sum.preorder.{u1, u2} α β _inst_1 _inst_2) (Sum.locallyFiniteOrder.{u1, u2} α β _inst_1 _inst_2 _inst_3 _inst_4) (Sum.inr.{u1, u2} α β b₁) (Sum.inl.{u1, u2} α β a₂)) (EmptyCollection.emptyCollection.{max u1 u2} (Finset.{max u1 u2} (Sum.{u1, u2} α β)) (Finset.hasEmptyc.{max u1 u2} (Sum.{u1, u2} α β)))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} [_inst_1 : Preorder.{u2} α] [_inst_2 : Preorder.{u1} β] [_inst_3 : LocallyFiniteOrder.{u2} α _inst_1] [_inst_4 : LocallyFiniteOrder.{u1} β _inst_2] (a₂ : α) (b₁ : β), Eq.{max (succ u2) (succ u1)} (Finset.{max u1 u2} (Sum.{u2, u1} α β)) (Finset.Ioo.{max u1 u2} (Sum.{u2, u1} α β) (Sum.instPreorderSum.{u2, u1} α β _inst_1 _inst_2) (Sum.instLocallyFiniteOrderSumInstPreorderSum.{u2, u1} α β _inst_1 _inst_2 _inst_3 _inst_4) (Sum.inr.{u2, u1} α β b₁) (Sum.inl.{u2, u1} α β a₂)) (EmptyCollection.emptyCollection.{max u2 u1} (Finset.{max u1 u2} (Sum.{u2, u1} α β)) (Finset.instEmptyCollectionFinset.{max u2 u1} (Sum.{u2, u1} α β)))
-Case conversion may be inaccurate. Consider using '#align sum.Ioo_inr_inl Sum.Ioo_inr_inlₓ'. -/
 @[simp]
 theorem Ioo_inr_inl : Ioo (inr b₁) (inl a₂) = ∅ :=
   rfl
 #align sum.Ioo_inr_inl Sum.Ioo_inr_inl
 
-/- warning: sum.Icc_inr_inr -> Sum.Icc_inr_inr is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : Preorder.{u1} α] [_inst_2 : Preorder.{u2} β] [_inst_3 : LocallyFiniteOrder.{u1} α _inst_1] [_inst_4 : LocallyFiniteOrder.{u2} β _inst_2] (b₁ : β) (b₂ : β), Eq.{succ (max u1 u2)} (Finset.{max u1 u2} (Sum.{u1, u2} α β)) (Finset.Icc.{max u1 u2} (Sum.{u1, u2} α β) (Sum.preorder.{u1, u2} α β _inst_1 _inst_2) (Sum.locallyFiniteOrder.{u1, u2} α β _inst_1 _inst_2 _inst_3 _inst_4) (Sum.inr.{u1, u2} α β b₁) (Sum.inr.{u1, u2} α β b₂)) (Finset.map.{u2, max u1 u2} β (Sum.{u1, u2} α β) (Function.Embedding.inr.{u1, u2} α β) (Finset.Icc.{u2} β _inst_2 _inst_4 b₁ b₂))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} [_inst_1 : Preorder.{u2} α] [_inst_2 : Preorder.{u1} β] [_inst_3 : LocallyFiniteOrder.{u2} α _inst_1] [_inst_4 : LocallyFiniteOrder.{u1} β _inst_2] (b₁ : β) (b₂ : β), Eq.{max (succ u2) (succ u1)} (Finset.{max u2 u1} (Sum.{u2, u1} α β)) (Finset.Icc.{max u2 u1} (Sum.{u2, u1} α β) (Sum.instPreorderSum.{u2, u1} α β _inst_1 _inst_2) (Sum.instLocallyFiniteOrderSumInstPreorderSum.{u2, u1} α β _inst_1 _inst_2 _inst_3 _inst_4) (Sum.inr.{u2, u1} α β b₁) (Sum.inr.{u2, u1} α β b₂)) (Finset.map.{u1, max u1 u2} β (Sum.{u2, u1} α β) (Function.Embedding.inr.{u2, u1} α β) (Finset.Icc.{u1} β _inst_2 _inst_4 b₁ b₂))
-Case conversion may be inaccurate. Consider using '#align sum.Icc_inr_inr Sum.Icc_inr_inrₓ'. -/
 theorem Icc_inr_inr : Icc (inr b₁ : Sum α β) (inr b₂) = (Icc b₁ b₂).map Embedding.inr :=
   rfl
 #align sum.Icc_inr_inr Sum.Icc_inr_inr
 
-/- warning: sum.Ico_inr_inr -> Sum.Ico_inr_inr is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : Preorder.{u1} α] [_inst_2 : Preorder.{u2} β] [_inst_3 : LocallyFiniteOrder.{u1} α _inst_1] [_inst_4 : LocallyFiniteOrder.{u2} β _inst_2] (b₁ : β) (b₂ : β), Eq.{succ (max u1 u2)} (Finset.{max u1 u2} (Sum.{u1, u2} α β)) (Finset.Ico.{max u1 u2} (Sum.{u1, u2} α β) (Sum.preorder.{u1, u2} α β _inst_1 _inst_2) (Sum.locallyFiniteOrder.{u1, u2} α β _inst_1 _inst_2 _inst_3 _inst_4) (Sum.inr.{u1, u2} α β b₁) (Sum.inr.{u1, u2} α β b₂)) (Finset.map.{u2, max u1 u2} β (Sum.{u1, u2} α β) (Function.Embedding.inr.{u1, u2} α β) (Finset.Ico.{u2} β _inst_2 _inst_4 b₁ b₂))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} [_inst_1 : Preorder.{u2} α] [_inst_2 : Preorder.{u1} β] [_inst_3 : LocallyFiniteOrder.{u2} α _inst_1] [_inst_4 : LocallyFiniteOrder.{u1} β _inst_2] (b₁ : β) (b₂ : β), Eq.{max (succ u2) (succ u1)} (Finset.{max u2 u1} (Sum.{u2, u1} α β)) (Finset.Ico.{max u2 u1} (Sum.{u2, u1} α β) (Sum.instPreorderSum.{u2, u1} α β _inst_1 _inst_2) (Sum.instLocallyFiniteOrderSumInstPreorderSum.{u2, u1} α β _inst_1 _inst_2 _inst_3 _inst_4) (Sum.inr.{u2, u1} α β b₁) (Sum.inr.{u2, u1} α β b₂)) (Finset.map.{u1, max u1 u2} β (Sum.{u2, u1} α β) (Function.Embedding.inr.{u2, u1} α β) (Finset.Ico.{u1} β _inst_2 _inst_4 b₁ b₂))
-Case conversion may be inaccurate. Consider using '#align sum.Ico_inr_inr Sum.Ico_inr_inrₓ'. -/
 theorem Ico_inr_inr : Ico (inr b₁ : Sum α β) (inr b₂) = (Ico b₁ b₂).map Embedding.inr :=
   rfl
 #align sum.Ico_inr_inr Sum.Ico_inr_inr
 
-/- warning: sum.Ioc_inr_inr -> Sum.Ioc_inr_inr is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : Preorder.{u1} α] [_inst_2 : Preorder.{u2} β] [_inst_3 : LocallyFiniteOrder.{u1} α _inst_1] [_inst_4 : LocallyFiniteOrder.{u2} β _inst_2] (b₁ : β) (b₂ : β), Eq.{succ (max u1 u2)} (Finset.{max u1 u2} (Sum.{u1, u2} α β)) (Finset.Ioc.{max u1 u2} (Sum.{u1, u2} α β) (Sum.preorder.{u1, u2} α β _inst_1 _inst_2) (Sum.locallyFiniteOrder.{u1, u2} α β _inst_1 _inst_2 _inst_3 _inst_4) (Sum.inr.{u1, u2} α β b₁) (Sum.inr.{u1, u2} α β b₂)) (Finset.map.{u2, max u1 u2} β (Sum.{u1, u2} α β) (Function.Embedding.inr.{u1, u2} α β) (Finset.Ioc.{u2} β _inst_2 _inst_4 b₁ b₂))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} [_inst_1 : Preorder.{u2} α] [_inst_2 : Preorder.{u1} β] [_inst_3 : LocallyFiniteOrder.{u2} α _inst_1] [_inst_4 : LocallyFiniteOrder.{u1} β _inst_2] (b₁ : β) (b₂ : β), Eq.{max (succ u2) (succ u1)} (Finset.{max u2 u1} (Sum.{u2, u1} α β)) (Finset.Ioc.{max u2 u1} (Sum.{u2, u1} α β) (Sum.instPreorderSum.{u2, u1} α β _inst_1 _inst_2) (Sum.instLocallyFiniteOrderSumInstPreorderSum.{u2, u1} α β _inst_1 _inst_2 _inst_3 _inst_4) (Sum.inr.{u2, u1} α β b₁) (Sum.inr.{u2, u1} α β b₂)) (Finset.map.{u1, max u1 u2} β (Sum.{u2, u1} α β) (Function.Embedding.inr.{u2, u1} α β) (Finset.Ioc.{u1} β _inst_2 _inst_4 b₁ b₂))
-Case conversion may be inaccurate. Consider using '#align sum.Ioc_inr_inr Sum.Ioc_inr_inrₓ'. -/
 theorem Ioc_inr_inr : Ioc (inr b₁ : Sum α β) (inr b₂) = (Ioc b₁ b₂).map Embedding.inr :=
   rfl
 #align sum.Ioc_inr_inr Sum.Ioc_inr_inr
 
-/- warning: sum.Ioo_inr_inr -> Sum.Ioo_inr_inr is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : Preorder.{u1} α] [_inst_2 : Preorder.{u2} β] [_inst_3 : LocallyFiniteOrder.{u1} α _inst_1] [_inst_4 : LocallyFiniteOrder.{u2} β _inst_2] (b₁ : β) (b₂ : β), Eq.{succ (max u1 u2)} (Finset.{max u1 u2} (Sum.{u1, u2} α β)) (Finset.Ioo.{max u1 u2} (Sum.{u1, u2} α β) (Sum.preorder.{u1, u2} α β _inst_1 _inst_2) (Sum.locallyFiniteOrder.{u1, u2} α β _inst_1 _inst_2 _inst_3 _inst_4) (Sum.inr.{u1, u2} α β b₁) (Sum.inr.{u1, u2} α β b₂)) (Finset.map.{u2, max u1 u2} β (Sum.{u1, u2} α β) (Function.Embedding.inr.{u1, u2} α β) (Finset.Ioo.{u2} β _inst_2 _inst_4 b₁ b₂))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} [_inst_1 : Preorder.{u2} α] [_inst_2 : Preorder.{u1} β] [_inst_3 : LocallyFiniteOrder.{u2} α _inst_1] [_inst_4 : LocallyFiniteOrder.{u1} β _inst_2] (b₁ : β) (b₂ : β), Eq.{max (succ u2) (succ u1)} (Finset.{max u2 u1} (Sum.{u2, u1} α β)) (Finset.Ioo.{max u2 u1} (Sum.{u2, u1} α β) (Sum.instPreorderSum.{u2, u1} α β _inst_1 _inst_2) (Sum.instLocallyFiniteOrderSumInstPreorderSum.{u2, u1} α β _inst_1 _inst_2 _inst_3 _inst_4) (Sum.inr.{u2, u1} α β b₁) (Sum.inr.{u2, u1} α β b₂)) (Finset.map.{u1, max u1 u2} β (Sum.{u2, u1} α β) (Function.Embedding.inr.{u2, u1} α β) (Finset.Ioo.{u1} β _inst_2 _inst_4 b₁ b₂))
-Case conversion may be inaccurate. Consider using '#align sum.Ioo_inr_inr Sum.Ioo_inr_inrₓ'. -/
 theorem Ioo_inr_inr : Ioo (inr b₁ : Sum α β) (inr b₂) = (Ioo b₁ b₂).map Embedding.inr :=
   rfl
 #align sum.Ioo_inr_inr Sum.Ioo_inr_inr
Diff
@@ -116,10 +116,7 @@ theorem sumLift₂_eq_empty :
         ∀ a₂ b₂, a = inr a₂ → b = inr b₂ → g a₂ b₂ = ∅ :=
   by
   refine' ⟨fun h => _, fun h => _⟩
-  ·
-    constructor <;>
-      · rintro a b rfl rfl
-        exact map_eq_empty.1 h
+  · constructor <;> · rintro a b rfl rfl; exact map_eq_empty.1 h
   cases a <;> cases b
   · exact map_eq_empty.2 (h.1 _ _ rfl rfl)
   · rfl

Changes in mathlib4

mathlib3
mathlib4
chore: adapt to multiple goal linter 1 (#12338)

A PR accompanying #12339.

Zulip discussion

Diff
@@ -60,7 +60,7 @@ theorem mem_sumLift₂ :
 theorem inl_mem_sumLift₂ {c₁ : γ₁} :
     inl c₁ ∈ sumLift₂ f g a b ↔ ∃ a₁ b₁, a = inl a₁ ∧ b = inl b₁ ∧ c₁ ∈ f a₁ b₁ := by
   rw [mem_sumLift₂, or_iff_left]
-  simp only [inl.injEq, exists_and_left, exists_eq_left']
+  · simp only [inl.injEq, exists_and_left, exists_eq_left']
   rintro ⟨_, _, c₂, _, _, h, _⟩
   exact inl_ne_inr h
 #align finset.inl_mem_sum_lift₂ Finset.inl_mem_sumLift₂
@@ -68,7 +68,7 @@ theorem inl_mem_sumLift₂ {c₁ : γ₁} :
 theorem inr_mem_sumLift₂ {c₂ : γ₂} :
     inr c₂ ∈ sumLift₂ f g a b ↔ ∃ a₂ b₂, a = inr a₂ ∧ b = inr b₂ ∧ c₂ ∈ g a₂ b₂ := by
   rw [mem_sumLift₂, or_iff_right]
-  simp only [inr.injEq, exists_and_left, exists_eq_left']
+  · simp only [inr.injEq, exists_and_left, exists_eq_left']
   rintro ⟨_, _, c₂, _, _, h, _⟩
   exact inr_ne_inl h
 #align finset.inr_mem_sum_lift₂ Finset.inr_mem_sumLift₂
chore: Move intervals (#11765)

Move Set.Ixx, Finset.Ixx, Multiset.Ixx together under two different folders:

  • Order.Interval for their definition and basic properties
  • Algebra.Order.Interval for their algebraic properties

Move the definitions of Multiset.Ixx to what is now Order.Interval.Multiset. I believe we could just delete this file in a later PR as nothing uses it (and I already had doubts when defining Multiset.Ixx three years ago).

Move the algebraic results out of what is now Order.Interval.Finset.Basic to a new file Algebra.Order.Interval.Finset.Basic.

Diff
@@ -5,7 +5,7 @@ Authors: Yaël Dillies
 -/
 import Mathlib.Data.Finset.Sum
 import Mathlib.Data.Sum.Order
-import Mathlib.Order.LocallyFinite
+import Mathlib.Order.Interval.Finset.Defs
 
 #align_import data.sum.interval from "leanprover-community/mathlib"@"48a058d7e39a80ed56858505719a0b2197900999"
 
chore: avoid Ne.def (adaptation for nightly-2024-03-27) (#11801)
Diff
@@ -212,7 +212,7 @@ lemma sumLexLift_nonempty :
           ∃ a₂ b₂, a = inr a₂ ∧ b = inr b₂ ∧ (f₂ a₂ b₂).Nonempty := by
   -- porting note (#10745): was `simp [nonempty_iff_ne_empty, sumLexLift_eq_empty, not_and_or]`.
   -- Could add `-exists_and_left, -not_and, -exists_and_right` but easier to squeeze.
-  simp only [nonempty_iff_ne_empty, Ne.def, sumLexLift_eq_empty, not_and_or, exists_prop,
+  simp only [nonempty_iff_ne_empty, Ne, sumLexLift_eq_empty, not_and_or, exists_prop,
     not_forall]
 #align finset.sum_lex_lift_nonempty Finset.sumLexLift_nonempty
 
style: homogenise porting notes (#11145)

Homogenises porting notes via capitalisation and addition of whitespace.

It makes the following changes:

  • converts "--porting note" into "-- Porting note";
  • converts "porting note" into "Porting note".
Diff
@@ -336,7 +336,7 @@ local elab "simp_lex" : tactic => do
         mem_Iic, mem_Iio, Equiv.coe_toEmbedding, toLex_inj, exists_false, and_false, false_and,
         map_empty, not_mem_empty, true_and, inl_mem_disjSum, inr_mem_disjSum, and_true, ofLex_toLex,
         mem_map, Embedding.coeFn_mk, exists_prop, exists_eq_right, Embedding.inl_apply,
-        -- porting note: added
+        -- Porting note: added
         inl.injEq, inr.injEq]
   )
 
chore: Rename LocallyFiniteOrder instances (#11076)

The generated names were too long

Diff
@@ -232,7 +232,7 @@ section Disjoint
 
 variable [Preorder α] [Preorder β] [LocallyFiniteOrder α] [LocallyFiniteOrder β]
 
-instance : LocallyFiniteOrder (Sum α β)
+instance instLocallyFiniteOrder : LocallyFiniteOrder (Sum α β)
     where
   finsetIcc := sumLift₂ Icc Icc
   finsetIco := sumLift₂ Ico Ico
chore: classify dsimp cannot prove this porting notes (#10676)

Classifies by adding issue number (#10675) to porting notes claiming dsimp cannot prove this.

Diff
@@ -276,7 +276,7 @@ theorem Ioc_inl_inr : Ioc (inl a₁) (inr b₂) = ∅ :=
   rfl
 #align sum.Ioc_inl_inr Sum.Ioc_inl_inr
 
-@[simp, nolint simpNF] -- Porting note: dsimp can not prove this
+@[simp, nolint simpNF] -- Porting note (#10675): dsimp can not prove this
 theorem Ioo_inl_inr : Ioo (inl a₁) (inr b₂) = ∅ := by
   rfl
 #align sum.Ioo_inl_inr Sum.Ioo_inl_inr
@@ -296,7 +296,7 @@ theorem Ioc_inr_inl : Ioc (inr b₁) (inl a₂) = ∅ :=
   rfl
 #align sum.Ioc_inr_inl Sum.Ioc_inr_inl
 
-@[simp, nolint simpNF] -- Porting note: dsimp can not prove this
+@[simp, nolint simpNF] -- Porting note (#10675): dsimp can not prove this
 theorem Ioo_inr_inl : Ioo (inr b₁) (inl a₂) = ∅ := by
   rfl
 #align sum.Ioo_inr_inl Sum.Ioo_inr_inl
@@ -393,19 +393,19 @@ lemma Ioc_inl_inr : Ioc (inlₗ a) (inrₗ b) = ((Ioi a).disjSum (Iic b)).map to
 lemma Ioo_inl_inr : Ioo (inlₗ a) (inrₗ b) = ((Ioi a).disjSum (Iio b)).map toLex.toEmbedding := rfl
 #align sum.lex.Ioo_inl_inr Sum.Lex.Ioo_inl_inr
 
-@[simp, nolint simpNF] -- Porting note: dsimp cannot prove this
+@[simp, nolint simpNF] -- Porting note (#10675): dsimp cannot prove this
 lemma Icc_inr_inl : Icc (inrₗ b) (inlₗ a) = ∅ := rfl
 #align sum.lex.Icc_inr_inl Sum.Lex.Icc_inr_inl
 
-@[simp, nolint simpNF] -- Porting note: dsimp cannot prove this
+@[simp, nolint simpNF] -- Porting note (#10675): dsimp cannot prove this
 lemma Ico_inr_inl : Ico (inrₗ b) (inlₗ a) = ∅ := rfl
 #align sum.lex.Ico_inr_inl Sum.Lex.Ico_inr_inl
 
-@[simp, nolint simpNF] -- Porting note: dsimp cannot prove this
+@[simp, nolint simpNF] -- Porting note (#10675): dsimp cannot prove this
 lemma Ioc_inr_inl : Ioc (inrₗ b) (inlₗ a) = ∅ := rfl
 #align sum.lex.Ioc_inr_inl Sum.Lex.Ioc_inr_inl
 
-@[simp, nolint simpNF] -- Porting note: dsimp cannot prove this
+@[simp, nolint simpNF] -- Porting note (#10675): dsimp cannot prove this
 lemma Ioo_inr_inl : Ioo (inrₗ b) (inlₗ a) = ∅ := rfl
 #align sum.lex.Ioo_inr_inl Sum.Lex.Ioo_inr_inl
 
chore: classify was simp porting notes (#10746)

Classifies by adding issue number (#10745) to porting notes claiming was simp.

Diff
@@ -210,8 +210,8 @@ lemma sumLexLift_nonempty :
       (∃ a₁ b₁, a = inl a₁ ∧ b = inl b₁ ∧ (f₁ a₁ b₁).Nonempty) ∨
         (∃ a₁ b₂, a = inl a₁ ∧ b = inr b₂ ∧ ((g₁ a₁ b₂).Nonempty ∨ (g₂ a₁ b₂).Nonempty)) ∨
           ∃ a₂ b₂, a = inr a₂ ∧ b = inr b₂ ∧ (f₂ a₂ b₂).Nonempty := by
-  -- porting note: was `simp [nonempty_iff_ne_empty, sumLexLift_eq_empty, not_and_or]`. Could
-  -- add `-exists_and_left, -not_and, -exists_and_right` but easier to squeeze.
+  -- porting note (#10745): was `simp [nonempty_iff_ne_empty, sumLexLift_eq_empty, not_and_or]`.
+  -- Could add `-exists_and_left, -not_and, -exists_and_right` but easier to squeeze.
   simp only [nonempty_iff_ne_empty, Ne.def, sumLexLift_eq_empty, not_and_or, exists_prop,
     not_forall]
 #align finset.sum_lex_lift_nonempty Finset.sumLexLift_nonempty
chore: cleanup spaces (#9745)
Diff
@@ -147,7 +147,7 @@ lemma mem_sumLexLift :
           (∃ a₁ b₂ c₂, a = inl a₁ ∧ b = inr b₂ ∧ c = inr c₂ ∧ c₂ ∈ g₂ a₁ b₂) ∨
             ∃ a₂ b₂ c₂, a = inr a₂ ∧ b = inr b₂ ∧ c = inr c₂ ∧ c₂ ∈ f₂ a₂ b₂ := by
   constructor
-  · obtain a | a := a <;> obtain b | b :=  b
+  · obtain a | a := a <;> obtain b | b := b
     · rw [sumLexLift, mem_map]
       rintro ⟨c, hc, rfl⟩
       exact Or.inl ⟨a, b, c, rfl, rfl, rfl, hc⟩
chore(*): replace $ with <| (#9319)

See Zulip thread for the discussion.

Diff
@@ -155,11 +155,11 @@ lemma mem_sumLexLift :
       · rintro ⟨c, hc, rfl⟩
         exact Or.inr (Or.inl ⟨a, b, c, rfl, rfl, rfl, hc⟩)
       · rintro ⟨c, hc, rfl⟩
-        exact Or.inr (Or.inr $ Or.inl ⟨a, b, c, rfl, rfl, rfl, hc⟩)
+        exact Or.inr (Or.inr <| Or.inl ⟨a, b, c, rfl, rfl, rfl, hc⟩)
     · exact fun h ↦ (not_mem_empty _ h).elim
     · rw [sumLexLift, mem_map]
       rintro ⟨c, hc, rfl⟩
-      exact Or.inr (Or.inr $ Or.inr $ ⟨a, b, c, rfl, rfl, rfl, hc⟩)
+      exact Or.inr (Or.inr <| Or.inr <| ⟨a, b, c, rfl, rfl, rfl, hc⟩)
   · rintro (⟨a, b, c, rfl, rfl, rfl, hc⟩ | ⟨a, b, c, rfl, rfl, rfl, hc⟩ |
       ⟨a, b, c, rfl, rfl, rfl, hc⟩ | ⟨a, b, c, rfl, rfl, rfl, hc⟩)
     · exact mem_map_of_mem _ hc
feat: The lexicographic sum of two locally finite orders is locally finite (#6340)

Forward-ports https://github.com/leanprover-community/mathlib/pull/11352

Co-authored-by: Eric Wieser <wieser.eric@gmail.com>

Diff
@@ -3,19 +3,17 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yaël Dillies
 -/
+import Mathlib.Data.Finset.Sum
 import Mathlib.Data.Sum.Order
 import Mathlib.Order.LocallyFinite
 
-#align_import data.sum.interval from "leanprover-community/mathlib"@"861a26926586cd46ff80264d121cdb6fa0e35cc1"
+#align_import data.sum.interval from "leanprover-community/mathlib"@"48a058d7e39a80ed56858505719a0b2197900999"
 
 /-!
 # Finite intervals in a disjoint union
 
-This file provides the `LocallyFiniteOrder` instance for the disjoint sum of two orders.
-
-## TODO
-
-Do the same for the lexicographic sum of orders.
+This file provides the `LocallyFiniteOrder` instance for the disjoint sum and linear sum of two
+orders and calculates the cardinality of their finite intervals.
 -/
 
 
@@ -107,6 +105,118 @@ theorem sumLift₂_mono (h₁ : ∀ a b, f₁ a b ⊆ g₁ a b) (h₂ : ∀ a b,
 
 end SumLift₂
 
+section SumLexLift
+variable (f₁ f₁' : α₁ → β₁ → Finset γ₁) (f₂ f₂' : α₂ → β₂ → Finset γ₂)
+  (g₁ g₁' : α₁ → β₂ → Finset γ₁) (g₂ g₂' : α₁ → β₂ → Finset γ₂)
+
+/-- Lifts maps `α₁ → β₁ → Finset γ₁`, `α₂ → β₂ → Finset γ₂`, `α₁ → β₂ → Finset γ₁`,
+`α₂ → β₂ → Finset γ₂`  to a map `α₁ ⊕ α₂ → β₁ ⊕ β₂ → Finset (γ₁ ⊕ γ₂)`. Could be generalized to
+alternative monads if we can make sure to keep computability and universe polymorphism. -/
+def sumLexLift : Sum α₁ α₂ → Sum β₁ β₂ → Finset (Sum γ₁ γ₂)
+  | inl a, inl b => (f₁ a b).map Embedding.inl
+  | inl a, inr b => (g₁ a b).disjSum (g₂ a b)
+  | inr _, inl _ => ∅
+  | inr a, inr b => (f₂ a b).map ⟨_, inr_injective⟩
+#align finset.sum_lex_lift Finset.sumLexLift
+
+@[simp]
+lemma sumLexLift_inl_inl (a : α₁) (b : β₁) :
+    sumLexLift f₁ f₂ g₁ g₂ (inl a) (inl b) = (f₁ a b).map Embedding.inl := rfl
+#align finset.sum_lex_lift_inl_inl Finset.sumLexLift_inl_inl
+
+@[simp]
+lemma sumLexLift_inl_inr (a : α₁) (b : β₂) :
+    sumLexLift f₁ f₂ g₁ g₂ (inl a) (inr b) = (g₁ a b).disjSum (g₂ a b) := rfl
+#align finset.sum_lex_lift_inl_inr Finset.sumLexLift_inl_inr
+
+@[simp]
+lemma sumLexLift_inr_inl (a : α₂) (b : β₁) : sumLexLift f₁ f₂ g₁ g₂ (inr a) (inl b) = ∅ := rfl
+#align finset.sum_lex_lift_inr_inl Finset.sumLexLift_inr_inl
+
+@[simp]
+lemma sumLexLift_inr_inr (a : α₂) (b : β₂) :
+    sumLexLift f₁ f₂ g₁ g₂ (inr a) (inr b) = (f₂ a b).map ⟨_, inr_injective⟩ := rfl
+#align finset.sum_lex_lift_inr_inr Finset.sumLexLift_inr_inr
+
+variable {f₁ g₁ f₂ g₂ f₁' g₁' f₂' g₂'} {a : Sum α₁ α₂} {b : Sum β₁ β₂} {c : Sum γ₁ γ₂}
+
+lemma mem_sumLexLift :
+    c ∈ sumLexLift f₁ f₂ g₁ g₂ a b ↔
+      (∃ a₁ b₁ c₁, a = inl a₁ ∧ b = inl b₁ ∧ c = inl c₁ ∧ c₁ ∈ f₁ a₁ b₁) ∨
+        (∃ a₁ b₂ c₁, a = inl a₁ ∧ b = inr b₂ ∧ c = inl c₁ ∧ c₁ ∈ g₁ a₁ b₂) ∨
+          (∃ a₁ b₂ c₂, a = inl a₁ ∧ b = inr b₂ ∧ c = inr c₂ ∧ c₂ ∈ g₂ a₁ b₂) ∨
+            ∃ a₂ b₂ c₂, a = inr a₂ ∧ b = inr b₂ ∧ c = inr c₂ ∧ c₂ ∈ f₂ a₂ b₂ := by
+  constructor
+  · obtain a | a := a <;> obtain b | b :=  b
+    · rw [sumLexLift, mem_map]
+      rintro ⟨c, hc, rfl⟩
+      exact Or.inl ⟨a, b, c, rfl, rfl, rfl, hc⟩
+    · refine' fun h ↦ (mem_disjSum.1 h).elim _ _
+      · rintro ⟨c, hc, rfl⟩
+        exact Or.inr (Or.inl ⟨a, b, c, rfl, rfl, rfl, hc⟩)
+      · rintro ⟨c, hc, rfl⟩
+        exact Or.inr (Or.inr $ Or.inl ⟨a, b, c, rfl, rfl, rfl, hc⟩)
+    · exact fun h ↦ (not_mem_empty _ h).elim
+    · rw [sumLexLift, mem_map]
+      rintro ⟨c, hc, rfl⟩
+      exact Or.inr (Or.inr $ Or.inr $ ⟨a, b, c, rfl, rfl, rfl, hc⟩)
+  · rintro (⟨a, b, c, rfl, rfl, rfl, hc⟩ | ⟨a, b, c, rfl, rfl, rfl, hc⟩ |
+      ⟨a, b, c, rfl, rfl, rfl, hc⟩ | ⟨a, b, c, rfl, rfl, rfl, hc⟩)
+    · exact mem_map_of_mem _ hc
+    · exact inl_mem_disjSum.2 hc
+    · exact inr_mem_disjSum.2 hc
+    · exact mem_map_of_mem _ hc
+#align finset.mem_sum_lex_lift Finset.mem_sumLexLift
+
+lemma inl_mem_sumLexLift {c₁ : γ₁} :
+    inl c₁ ∈ sumLexLift f₁ f₂ g₁ g₂ a b ↔
+      (∃ a₁ b₁, a = inl a₁ ∧ b = inl b₁ ∧ c₁ ∈ f₁ a₁ b₁) ∨
+        ∃ a₁ b₂, a = inl a₁ ∧ b = inr b₂ ∧ c₁ ∈ g₁ a₁ b₂ := by
+  simp [mem_sumLexLift]
+#align finset.inl_mem_sum_lex_lift Finset.inl_mem_sumLexLift
+
+lemma inr_mem_sumLexLift {c₂ : γ₂} :
+    inr c₂ ∈ sumLexLift f₁ f₂ g₁ g₂ a b ↔
+      (∃ a₁ b₂, a = inl a₁ ∧ b = inr b₂ ∧ c₂ ∈ g₂ a₁ b₂) ∨
+        ∃ a₂ b₂, a = inr a₂ ∧ b = inr b₂ ∧ c₂ ∈ f₂ a₂ b₂ := by
+  simp [mem_sumLexLift]
+#align finset.inr_mem_sum_lex_lift Finset.inr_mem_sumLexLift
+
+lemma sumLexLift_mono (hf₁ : ∀ a b, f₁ a b ⊆ f₁' a b) (hf₂ : ∀ a b, f₂ a b ⊆ f₂' a b)
+    (hg₁ : ∀ a b, g₁ a b ⊆ g₁' a b) (hg₂ : ∀ a b, g₂ a b ⊆ g₂' a b) (a : Sum α₁ α₂)
+    (b : Sum β₁ β₂) : sumLexLift f₁ f₂ g₁ g₂ a b ⊆ sumLexLift f₁' f₂' g₁' g₂' a b := by
+  cases a <;> cases b
+  exacts [map_subset_map.2 (hf₁ _ _), disjSum_mono (hg₁ _ _) (hg₂ _ _), Subset.rfl,
+    map_subset_map.2 (hf₂ _ _)]
+#align finset.sum_lex_lift_mono Finset.sumLexLift_mono
+
+lemma sumLexLift_eq_empty :
+    sumLexLift f₁ f₂ g₁ g₂ a b = ∅ ↔
+      (∀ a₁ b₁, a = inl a₁ → b = inl b₁ → f₁ a₁ b₁ = ∅) ∧
+        (∀ a₁ b₂, a = inl a₁ → b = inr b₂ → g₁ a₁ b₂ = ∅ ∧ g₂ a₁ b₂ = ∅) ∧
+          ∀ a₂ b₂, a = inr a₂ → b = inr b₂ → f₂ a₂ b₂ = ∅ := by
+  refine' ⟨fun h ↦ ⟨_, _, _⟩, fun h ↦ _⟩
+  any_goals rintro a b rfl rfl; exact map_eq_empty.1 h
+  · rintro a b rfl rfl; exact disjSum_eq_empty.1 h
+  cases a <;> cases b
+  · exact map_eq_empty.2 (h.1 _ _ rfl rfl)
+  · simp [h.2.1 _ _ rfl rfl]
+  · rfl
+  · exact map_eq_empty.2 (h.2.2 _ _ rfl rfl)
+#align finset.sum_lex_lift_eq_empty Finset.sumLexLift_eq_empty
+
+lemma sumLexLift_nonempty :
+    (sumLexLift f₁ f₂ g₁ g₂ a b).Nonempty ↔
+      (∃ a₁ b₁, a = inl a₁ ∧ b = inl b₁ ∧ (f₁ a₁ b₁).Nonempty) ∨
+        (∃ a₁ b₂, a = inl a₁ ∧ b = inr b₂ ∧ ((g₁ a₁ b₂).Nonempty ∨ (g₂ a₁ b₂).Nonempty)) ∨
+          ∃ a₂ b₂, a = inr a₂ ∧ b = inr b₂ ∧ (f₂ a₂ b₂).Nonempty := by
+  -- porting note: was `simp [nonempty_iff_ne_empty, sumLexLift_eq_empty, not_and_or]`. Could
+  -- add `-exists_and_left, -not_and, -exists_and_right` but easier to squeeze.
+  simp only [nonempty_iff_ne_empty, Ne.def, sumLexLift_eq_empty, not_and_or, exists_prop,
+    not_forall]
+#align finset.sum_lex_lift_nonempty Finset.sumLexLift_nonempty
+
+end SumLexLift
 end Finset
 
 open Finset Function
@@ -209,4 +319,115 @@ theorem Ioo_inr_inr : Ioo (inr b₁ : Sum α β) (inr b₂) = (Ioo b₁ b₂).ma
 
 end Disjoint
 
+/-! ### Lexicographical sum of orders -/
+
+namespace Lex
+variable [Preorder α] [Preorder β] [OrderTop α] [OrderBot β] [LocallyFiniteOrder α]
+  [LocallyFiniteOrder β]
+
+/-- Throwaway tactic. -/
+local elab "simp_lex" : tactic => do
+  Lean.Elab.Tactic.evalTactic <| ← `(tactic|
+    refine toLex.surjective.forall₃.2 ?_;
+    rintro (a | a) (b | b) (c | c) <;> simp only
+      [sumLexLift_inl_inl, sumLexLift_inl_inr, sumLexLift_inr_inl, sumLexLift_inr_inr,
+        inl_le_inl_iff, inl_le_inr, not_inr_le_inl, inr_le_inr_iff, inl_lt_inl_iff, inl_lt_inr,
+        not_inr_lt_inl, inr_lt_inr_iff, mem_Icc, mem_Ico, mem_Ioc, mem_Ioo, mem_Ici, mem_Ioi,
+        mem_Iic, mem_Iio, Equiv.coe_toEmbedding, toLex_inj, exists_false, and_false, false_and,
+        map_empty, not_mem_empty, true_and, inl_mem_disjSum, inr_mem_disjSum, and_true, ofLex_toLex,
+        mem_map, Embedding.coeFn_mk, exists_prop, exists_eq_right, Embedding.inl_apply,
+        -- porting note: added
+        inl.injEq, inr.injEq]
+  )
+
+instance locallyFiniteOrder : LocallyFiniteOrder (α ⊕ₗ β) where
+  finsetIcc a b :=
+    (sumLexLift Icc Icc (fun a _ => Ici a) (fun _ => Iic) (ofLex a) (ofLex b)).map toLex.toEmbedding
+  finsetIco a b :=
+    (sumLexLift Ico Ico (fun a _ => Ici a) (fun _ => Iio) (ofLex a) (ofLex b)).map toLex.toEmbedding
+  finsetIoc a b :=
+    (sumLexLift Ioc Ioc (fun a _ => Ioi a) (fun _ => Iic) (ofLex a) (ofLex b)).map toLex.toEmbedding
+  finsetIoo a b :=
+    (sumLexLift Ioo Ioo (fun a _ => Ioi a) (fun _ => Iio) (ofLex a) (ofLex b)).map toLex.toEmbedding
+  finset_mem_Icc := by simp_lex
+  finset_mem_Ico := by simp_lex
+  finset_mem_Ioc := by simp_lex
+  finset_mem_Ioo := by simp_lex
+#align sum.lex.locally_finite_order Sum.Lex.locallyFiniteOrder
+
+variable (a a₁ a₂ : α) (b b₁ b₂ : β)
+
+lemma Icc_inl_inl :
+    Icc (inlₗ a₁ : α ⊕ₗ β) (inlₗ a₂) = (Icc a₁ a₂).map (Embedding.inl.trans toLex.toEmbedding) := by
+  rw [← Finset.map_map]; rfl
+#align sum.lex.Icc_inl_inl Sum.Lex.Icc_inl_inl
+
+lemma Ico_inl_inl :
+    Ico (inlₗ a₁ : α ⊕ₗ β) (inlₗ a₂) = (Ico a₁ a₂).map (Embedding.inl.trans toLex.toEmbedding) := by
+  rw [← Finset.map_map]; rfl
+#align sum.lex.Ico_inl_inl Sum.Lex.Ico_inl_inl
+
+lemma Ioc_inl_inl :
+    Ioc (inlₗ a₁ : α ⊕ₗ β) (inlₗ a₂) = (Ioc a₁ a₂).map (Embedding.inl.trans toLex.toEmbedding) := by
+  rw [← Finset.map_map]; rfl
+#align sum.lex.Ioc_inl_inl Sum.Lex.Ioc_inl_inl
+
+lemma Ioo_inl_inl :
+    Ioo (inlₗ a₁ : α ⊕ₗ β) (inlₗ a₂) = (Ioo a₁ a₂).map (Embedding.inl.trans toLex.toEmbedding) := by
+  rw [← Finset.map_map]; rfl
+#align sum.lex.Ioo_inl_inl Sum.Lex.Ioo_inl_inl
+
+@[simp]
+lemma Icc_inl_inr : Icc (inlₗ a) (inrₗ b) = ((Ici a).disjSum (Iic b)).map toLex.toEmbedding := rfl
+#align sum.lex.Icc_inl_inr Sum.Lex.Icc_inl_inr
+
+@[simp]
+lemma Ico_inl_inr : Ico (inlₗ a) (inrₗ b) = ((Ici a).disjSum (Iio b)).map toLex.toEmbedding := rfl
+#align sum.lex.Ico_inl_inr Sum.Lex.Ico_inl_inr
+
+@[simp]
+lemma Ioc_inl_inr : Ioc (inlₗ a) (inrₗ b) = ((Ioi a).disjSum (Iic b)).map toLex.toEmbedding := rfl
+#align sum.lex.Ioc_inl_inr Sum.Lex.Ioc_inl_inr
+
+@[simp]
+lemma Ioo_inl_inr : Ioo (inlₗ a) (inrₗ b) = ((Ioi a).disjSum (Iio b)).map toLex.toEmbedding := rfl
+#align sum.lex.Ioo_inl_inr Sum.Lex.Ioo_inl_inr
+
+@[simp, nolint simpNF] -- Porting note: dsimp cannot prove this
+lemma Icc_inr_inl : Icc (inrₗ b) (inlₗ a) = ∅ := rfl
+#align sum.lex.Icc_inr_inl Sum.Lex.Icc_inr_inl
+
+@[simp, nolint simpNF] -- Porting note: dsimp cannot prove this
+lemma Ico_inr_inl : Ico (inrₗ b) (inlₗ a) = ∅ := rfl
+#align sum.lex.Ico_inr_inl Sum.Lex.Ico_inr_inl
+
+@[simp, nolint simpNF] -- Porting note: dsimp cannot prove this
+lemma Ioc_inr_inl : Ioc (inrₗ b) (inlₗ a) = ∅ := rfl
+#align sum.lex.Ioc_inr_inl Sum.Lex.Ioc_inr_inl
+
+@[simp, nolint simpNF] -- Porting note: dsimp cannot prove this
+lemma Ioo_inr_inl : Ioo (inrₗ b) (inlₗ a) = ∅ := rfl
+#align sum.lex.Ioo_inr_inl Sum.Lex.Ioo_inr_inl
+
+lemma Icc_inr_inr :
+    Icc (inrₗ b₁ : α ⊕ₗ β) (inrₗ b₂) = (Icc b₁ b₂).map (Embedding.inr.trans toLex.toEmbedding) := by
+  rw [← Finset.map_map]; rfl
+#align sum.lex.Icc_inr_inr Sum.Lex.Icc_inr_inr
+
+lemma Ico_inr_inr :
+    Ico (inrₗ b₁ : α ⊕ₗ β) (inrₗ b₂) = (Ico b₁ b₂).map (Embedding.inr.trans toLex.toEmbedding) := by
+  rw [← Finset.map_map]; rfl
+#align sum.lex.Ico_inr_inr Sum.Lex.Ico_inr_inr
+
+lemma Ioc_inr_inr :
+    Ioc (inrₗ b₁ : α ⊕ₗ β) (inrₗ b₂) = (Ioc b₁ b₂).map (Embedding.inr.trans toLex.toEmbedding) := by
+  rw [← Finset.map_map]; rfl
+#align sum.lex.Ioc_inr_inr Sum.Lex.Ioc_inr_inr
+
+lemma Ioo_inr_inr :
+    Ioo (inrₗ b₁ : α ⊕ₗ β) (inrₗ b₂) = (Ioo b₁ b₂).map (Embedding.inr.trans toLex.toEmbedding) := by
+  rw [← Finset.map_map]; rfl
+#align sum.lex.Ioo_inr_inr Sum.Lex.Ioo_inr_inr
+
+end Lex
 end Sum
chore: banish Type _ and Sort _ (#6499)

We remove all possible occurences of Type _ and Sort _ in favor of Type* and Sort*.

This has nice performance benefits.

Diff
@@ -23,7 +23,7 @@ open Function Sum
 
 namespace Finset
 
-variable {α₁ α₂ β₁ β₂ γ₁ γ₂ : Type _}
+variable {α₁ α₂ β₁ β₂ γ₁ γ₂ : Type*}
 
 section SumLift₂
 
@@ -113,7 +113,7 @@ open Finset Function
 
 namespace Sum
 
-variable {α β : Type _}
+variable {α β : Type*}
 
 /-! ### Disjoint sum of orders -/
 
chore: script to replace headers with #align_import statements (#5979)

Open in Gitpod

Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -2,15 +2,12 @@
 Copyright (c) 2022 Yaël Dillies. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yaël Dillies
-
-! This file was ported from Lean 3 source module data.sum.interval
-! leanprover-community/mathlib commit 861a26926586cd46ff80264d121cdb6fa0e35cc1
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.Data.Sum.Order
 import Mathlib.Order.LocallyFinite
 
+#align_import data.sum.interval from "leanprover-community/mathlib"@"861a26926586cd46ff80264d121cdb6fa0e35cc1"
+
 /-!
 # Finite intervals in a disjoint union
 
Refactor uses to rename_i that have easy fixes (#2429)
Diff
@@ -50,7 +50,7 @@ theorem mem_sumLift₂ :
       (∃ a₁ b₁ c₁, a = inl a₁ ∧ b = inl b₁ ∧ c = inl c₁ ∧ c₁ ∈ f a₁ b₁) ∨
         ∃ a₂ b₂ c₂, a = inr a₂ ∧ b = inr b₂ ∧ c = inr c₂ ∧ c₂ ∈ g a₂ b₂ := by
   constructor
-  · cases a <;> cases b <;> rename_i a b
+  · cases' a with a a <;> cases' b with b b
     · rw [sumLift₂, mem_map]
       rintro ⟨c, hc, rfl⟩
       exact Or.inl ⟨a, b, c, rfl, rfl, rfl, hc⟩
feat: port Data.Sum.Interval (#1962)

Co-authored-by: Lukas Miaskiwskyi <lukas.mias@gmail.com>

Dependencies 7 + 227

228 files ported (97.0%)
100388 lines ported (97.0%)
Show graph

The unported dependencies are