l3lab/ntp-mathlib huggingface dataset:
theorem mulLeft_injective [NoZeroDivisors A] {x : A} (hx : x ≠ 0) :
    Function.Injective (mulLeft R x) := by
  letI : Nontrivial A := ⟨⟨x, 0, hx⟩⟩
  letI := NoZeroDivisors.to_isDomain A
  

Proof state:
R : Type u_1
A : Type u_2
inst✝³ : CommSemiring R
inst✝² : Ring A
inst✝¹ : Algebra R A
inst✝ : NoZeroDivisors A
x : A
hx : x ≠ 0
this✝ : Nontrivial A := { exists_pair_ne := Exists.intro x (Exists.intro 0 hx) }
this : IsDomain A := NoZeroDivisors.to_isDomain A
⊢ Function.Injective ⇑(mulLeft R x)

Next tactic:
exact mul_right_injective₀ hx
theorem mulRight_injective [NoZeroDivisors A] {x : A} (hx : x ≠ 0) :
    Function.Injective (mulRight R x) := by
  

Proof state:
R : Type u_1
A : Type u_2
inst✝³ : CommSemiring R
inst✝² : Ring A
inst✝¹ : Algebra R A
inst✝ : NoZeroDivisors A
x : A
hx : x ≠ 0
⊢ Function.Injective ⇑(mulRight R x)

Next tactic:
letI : Nontrivial A := ⟨⟨x, 0, hx⟩⟩
theorem mulRight_injective [NoZeroDivisors A] {x : A} (hx : x ≠ 0) :
    Function.Injective (mulRight R x) := by
  letI : Nontrivial A := ⟨⟨x, 0, hx⟩⟩
  

Proof state:
R : Type u_1
A : Type u_2
inst✝³ : CommSemiring R
inst✝² : Ring A
inst✝¹ : Algebra R A
inst✝ : NoZeroDivisors A
x : A
hx : x ≠ 0
this : Nontrivial A := { exists_pair_ne := Exists.intro x (Exists.intro 0 hx) }
⊢ Function.Injective ⇑(mulRight R x)

Next tactic:
letI := NoZeroDivisors.to_isDomain A
theorem mulRight_injective [NoZeroDivisors A] {x : A} (hx : x ≠ 0) :
    Function.Injective (mulRight R x) := by
  letI : Nontrivial A := ⟨⟨x, 0, hx⟩⟩
  letI := NoZeroDivisors.to_isDomain A
  

Proof state:
R : Type u_1
A : Type u_2
inst✝³ : CommSemiring R
inst✝² : Ring A
inst✝¹ : Algebra R A
inst✝ : NoZeroDivisors A
x : A
hx : x ≠ 0
this✝ : Nontrivial A := { exists_pair_ne := Exists.intro x (Exists.intro 0 hx) }
this : IsDomain A := NoZeroDivisors.to_isDomain A
⊢ Function.Injective ⇑(mulRight R x)

Next tactic:
exact mul_left_injective₀ hx
theorem mul_injective [NoZeroDivisors A] {x : A} (hx : x ≠ 0) : Function.Injective (mul R A x) := by
  

Proof state:
R : Type u_1
A : Type u_2
inst✝³ : CommSemiring R
inst✝² : Ring A
inst✝¹ : Algebra R A
inst✝ : NoZeroDivisors A
x : A
hx : x ≠ 0
⊢ Function.Injective ⇑((mul R A) x)

Next tactic:
letI : Nontrivial A := ⟨⟨x, 0, hx⟩⟩
theorem mul_injective [NoZeroDivisors A] {x : A} (hx : x ≠ 0) : Function.Injective (mul R A x) := by
  letI : Nontrivial A := ⟨⟨x, 0, hx⟩⟩
  

Proof state:
R : Type u_1
A : Type u_2
inst✝³ : CommSemiring R
inst✝² : Ring A
inst✝¹ : Algebra R A
inst✝ : NoZeroDivisors A
x : A
hx : x ≠ 0
this : Nontrivial A := { exists_pair_ne := Exists.intro x (Exists.intro 0 hx) }
⊢ Function.Injective ⇑((mul R A) x)

Next tactic:
letI := NoZeroDivisors.to_isDomain A
theorem mul_injective [NoZeroDivisors A] {x : A} (hx : x ≠ 0) : Function.Injective (mul R A x) := by
  letI : Nontrivial A := ⟨⟨x, 0, hx⟩⟩
  letI := NoZeroDivisors.to_isDomain A
  

Proof state:
R : Type u_1
A : Type u_2
inst✝³ : CommSemiring R
inst✝² : Ring A
inst✝¹ : Algebra R A
inst✝ : NoZeroDivisors A
x : A
hx : x ≠ 0
this✝ : Nontrivial A := { exists_pair_ne := Exists.intro x (Exists.intro 0 hx) }
this : IsDomain A := NoZeroDivisors.to_isDomain A
⊢ Function.Injective ⇑((mul R A) x)

Next tactic:
exact mul_right_injective₀ hx
theorem disjointed_le_id : disjointed ≤ (id : (ℕ → α) → ℕ → α) := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : GeneralizedBooleanAlgebra α
⊢ disjointed ≤ id

Next tactic:
rintro f n
theorem disjointed_le_id : disjointed ≤ (id : (ℕ → α) → ℕ → α) := by
  rintro f n
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : GeneralizedBooleanAlgebra α
f : ℕ → α
n : ℕ
⊢ disjointed f n ≤ id f n

Next tactic:
cases n
theorem disjointed_le_id : disjointed ≤ (id : (ℕ → α) → ℕ → α) := by
  rintro f n
  cases n
  · 

Proof state:
case zero
α : Type u_1
β : Type u_2
inst✝ : GeneralizedBooleanAlgebra α
f : ℕ → α
⊢ disjointed f Nat.zero ≤ id f Nat.zero

Next tactic:
rfl
theorem disjointed_le_id : disjointed ≤ (id : (ℕ → α) → ℕ → α) := by
  rintro f n
  cases n
  · rfl
  · 

Proof state:
case succ
α : Type u_1
β : Type u_2
inst✝ : GeneralizedBooleanAlgebra α
f : ℕ → α
n✝ : ℕ
⊢ disjointed f (Nat.succ n✝) ≤ id f (Nat.succ n✝)

Next tactic:
exact sdiff_le
theorem disjoint_disjointed (f : ℕ → α) : Pairwise (Disjoint on disjointed f) := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : GeneralizedBooleanAlgebra α
f : ℕ → α
⊢ Pairwise (Disjoint on disjointed f)

Next tactic:
refine' (Symmetric.pairwise_on Disjoint.symm _).2 fun m n h => _
theorem disjoint_disjointed (f : ℕ → α) : Pairwise (Disjoint on disjointed f) := by
  refine' (Symmetric.pairwise_on Disjoint.symm _).2 fun m n h => _
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : GeneralizedBooleanAlgebra α
f : ℕ → α
m n : ℕ
h : m < n
⊢ Disjoint (disjointed f m) (disjointed f n)

Next tactic:
cases n
theorem disjoint_disjointed (f : ℕ → α) : Pairwise (Disjoint on disjointed f) := by
  refine' (Symmetric.pairwise_on Disjoint.symm _).2 fun m n h => _
  cases n
  · 

Proof state:
case zero
α : Type u_1
β : Type u_2
inst✝ : GeneralizedBooleanAlgebra α
f : ℕ → α
m : ℕ
h : m < Nat.zero
⊢ Disjoint (disjointed f m) (disjointed f Nat.zero)

Next tactic:
exact (Nat.not_lt_zero _ h).elim
theorem disjoint_disjointed (f : ℕ → α) : Pairwise (Disjoint on disjointed f) := by
  refine' (Symmetric.pairwise_on Disjoint.symm _).2 fun m n h => _
  cases n
  · exact (Nat.not_lt_zero _ h).elim
  

Proof state:
case succ
α : Type u_1
β : Type u_2
inst✝ : GeneralizedBooleanAlgebra α
f : ℕ → α
m n✝ : ℕ
h : m < Nat.succ n✝
⊢ Disjoint (disjointed f m) (disjointed f (Nat.succ n✝))

Next tactic:
exact
    disjoint_sdiff_self_right.mono_left
      ((disjointed_le f m).trans (le_partialSups_of_le f (Nat.lt_add_one_iff.1 h)))
/-- An induction principle for `disjointed`. To define/prove something on `disjointed f n`, it's
enough to define/prove it for `f n` and being able to extend through diffs. -/
def disjointedRec {f : ℕ → α} {p : α → Sort*} (hdiff : ∀ ⦃t i⦄, p t → p (t \ f i)) :
    ∀ ⦃n⦄, p (f n) → p (disjointed f n)
  | 0 => id
  | n + 1 => fun h => by
    

Proof state:
α : Type u_1
β : Type u_2
inst✝ : GeneralizedBooleanAlgebra α
f : ℕ → α
p : α → Sort u_3
hdiff : ⦃t : α⦄ → ⦃i : ℕ⦄ → p t → p (t \ f i)
n : ℕ
h : p (f (n + 1))
⊢ p (disjointed f (n + 1))

Next tactic:
suffices H : ∀ k, p (f (n + 1) \ partialSups f k) from H n
/-- An induction principle for `disjointed`. To define/prove something on `disjointed f n`, it's
enough to define/prove it for `f n` and being able to extend through diffs. -/
def disjointedRec {f : ℕ → α} {p : α → Sort*} (hdiff : ∀ ⦃t i⦄, p t → p (t \ f i)) :
    ∀ ⦃n⦄, p (f n) → p (disjointed f n)
  | 0 => id
  | n + 1 => fun h => by
    suffices H : ∀ k, p (f (n + 1) \ partialSups f k) from H n
    

Proof state:
α : Type u_1
β : Type u_2
inst✝ : GeneralizedBooleanAlgebra α
f : ℕ → α
p : α → Sort u_3
hdiff : ⦃t : α⦄ → ⦃i : ℕ⦄ → p t → p (t \ f i)
n : ℕ
h : p (f (n + 1))
⊢ (k : ℕ) → p (f (n + 1) \ (partialSups f) k)

Next tactic:
rintro k
/-- An induction principle for `disjointed`. To define/prove something on `disjointed f n`, it's
enough to define/prove it for `f n` and being able to extend through diffs. -/
def disjointedRec {f : ℕ → α} {p : α → Sort*} (hdiff : ∀ ⦃t i⦄, p t → p (t \ f i)) :
    ∀ ⦃n⦄, p (f n) → p (disjointed f n)
  | 0 => id
  | n + 1 => fun h => by
    suffices H : ∀ k, p (f (n + 1) \ partialSups f k) from H n
    rintro k
    

Proof state:
α : Type u_1
β : Type u_2
inst✝ : GeneralizedBooleanAlgebra α
f : ℕ → α
p : α → Sort u_3
hdiff : ⦃t : α⦄ → ⦃i : ℕ⦄ → p t → p (t \ f i)
n : ℕ
h : p (f (n + 1))
k : ℕ
⊢ p (f (n + 1) \ (partialSups f) k)

Next tactic:
induction' k with k ih
/-- An induction principle for `disjointed`. To define/prove something on `disjointed f n`, it's
enough to define/prove it for `f n` and being able to extend through diffs. -/
def disjointedRec {f : ℕ → α} {p : α → Sort*} (hdiff : ∀ ⦃t i⦄, p t → p (t \ f i)) :
    ∀ ⦃n⦄, p (f n) → p (disjointed f n)
  | 0 => id
  | n + 1 => fun h => by
    suffices H : ∀ k, p (f (n + 1) \ partialSups f k) from H n
    rintro k
    induction' k with k ih
    · 

Proof state:
case zero
α : Type u_1
β : Type u_2
inst✝ : GeneralizedBooleanAlgebra α
f : ℕ → α
p : α → Sort u_3
hdiff : ⦃t : α⦄ → ⦃i : ℕ⦄ → p t → p (t \ f i)
n : ℕ
h : p (f (n + 1))
⊢ p (f (n + 1) \ (partialSups f) Nat.zero)

Next tactic:
exact hdiff h
/-- An induction principle for `disjointed`. To define/prove something on `disjointed f n`, it's
enough to define/prove it for `f n` and being able to extend through diffs. -/
def disjointedRec {f : ℕ → α} {p : α → Sort*} (hdiff : ∀ ⦃t i⦄, p t → p (t \ f i)) :
    ∀ ⦃n⦄, p (f n) → p (disjointed f n)
  | 0 => id
  | n + 1 => fun h => by
    suffices H : ∀ k, p (f (n + 1) \ partialSups f k) from H n
    rintro k
    induction' k with k ih
    · exact hdiff h
    

Proof state:
case succ
α : Type u_1
β : Type u_2
inst✝ : GeneralizedBooleanAlgebra α
f : ℕ → α
p : α → Sort u_3
hdiff : ⦃t : α⦄ → ⦃i : ℕ⦄ → p t → p (t \ f i)
n : ℕ
h : p (f (n + 1))
k : ℕ
ih : p (f (n + 1) \ (partialSups f) k)
⊢ p (f (n + 1) \ (partialSups f) (Nat.succ k))

Next tactic:
rw [partialSups_succ, ← sdiff_sdiff_left]
/-- An induction principle for `disjointed`. To define/prove something on `disjointed f n`, it's
enough to define/prove it for `f n` and being able to extend through diffs. -/
def disjointedRec {f : ℕ → α} {p : α → Sort*} (hdiff : ∀ ⦃t i⦄, p t → p (t \ f i)) :
    ∀ ⦃n⦄, p (f n) → p (disjointed f n)
  | 0 => id
  | n + 1 => fun h => by
    suffices H : ∀ k, p (f (n + 1) \ partialSups f k) from H n
    rintro k
    induction' k with k ih
    · exact hdiff h
    rw [partialSups_succ, ← sdiff_sdiff_left]
    

Proof state:
case succ
α : Type u_1
β : Type u_2
inst✝ : GeneralizedBooleanAlgebra α
f : ℕ → α
p : α → Sort u_3
hdiff : ⦃t : α⦄ → ⦃i : ℕ⦄ → p t → p (t \ f i)
n : ℕ
h : p (f (n + 1))
k : ℕ
ih : p (f (n + 1) \ (partialSups f) k)
⊢ p ((f (n + 1) \ (partialSups f) k) \ f (k + 1))

Next tactic:
exact hdiff ih
theorem Monotone.disjointed_eq {f : ℕ → α} (hf : Monotone f) (n : ℕ) :
    disjointed f (n + 1) = f (n + 1) \ f n := by 

Proof state:
α : Type u_1
β : Type u_2
inst✝ : GeneralizedBooleanAlgebra α
f : ℕ → α
hf : Monotone f
n : ℕ
⊢ disjointed f (n + 1) = f (n + 1) \ f n

Next tactic:
rw [disjointed_succ, hf.partialSups_eq]
@[simp]
theorem partialSups_disjointed (f : ℕ → α) : partialSups (disjointed f) = partialSups f := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : GeneralizedBooleanAlgebra α
f : ℕ → α
⊢ partialSups (disjointed f) = partialSups f

Next tactic:
ext n
@[simp]
theorem partialSups_disjointed (f : ℕ → α) : partialSups (disjointed f) = partialSups f := by
  ext n
  

Proof state:
case h.h
α : Type u_1
β : Type u_2
inst✝ : GeneralizedBooleanAlgebra α
f : ℕ → α
n : ℕ
⊢ (partialSups (disjointed f)) n = (partialSups f) n

Next tactic:
induction' n with k ih
@[simp]
theorem partialSups_disjointed (f : ℕ → α) : partialSups (disjointed f) = partialSups f := by
  ext n
  induction' n with k ih
  · 

Proof state:
case h.h.zero
α : Type u_1
β : Type u_2
inst✝ : GeneralizedBooleanAlgebra α
f : ℕ → α
⊢ (partialSups (disjointed f)) Nat.zero = (partialSups f) Nat.zero

Next tactic:
rw [partialSups_zero, partialSups_zero, disjointed_zero]
@[simp]
theorem partialSups_disjointed (f : ℕ → α) : partialSups (disjointed f) = partialSups f := by
  ext n
  induction' n with k ih
  · rw [partialSups_zero, partialSups_zero, disjointed_zero]
  · 

Proof state:
case h.h.succ
α : Type u_1
β : Type u_2
inst✝ : GeneralizedBooleanAlgebra α
f : ℕ → α
k : ℕ
ih : (partialSups (disjointed f)) k = (partialSups f) k
⊢ (partialSups (disjointed f)) (Nat.succ k) = (partialSups f) (Nat.succ k)

Next tactic:
rw [partialSups_succ, partialSups_succ, disjointed_succ, ih, sup_sdiff_self_right]
/-- `disjointed f` is the unique sequence that is pairwise disjoint and has the same partial sups
as `f`. -/
theorem disjointed_unique {f d : ℕ → α} (hdisj : Pairwise (Disjoint on d))
    (hsups : partialSups d = partialSups f) : d = disjointed f := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : GeneralizedBooleanAlgebra α
f d : ℕ → α
hdisj : Pairwise (Disjoint on d)
hsups : partialSups d = partialSups f
⊢ d = disjointed f

Next tactic:
ext n
/-- `disjointed f` is the unique sequence that is pairwise disjoint and has the same partial sups
as `f`. -/
theorem disjointed_unique {f d : ℕ → α} (hdisj : Pairwise (Disjoint on d))
    (hsups : partialSups d = partialSups f) : d = disjointed f := by
  ext n
  

Proof state:
case h
α : Type u_1
β : Type u_2
inst✝ : GeneralizedBooleanAlgebra α
f d : ℕ → α
hdisj : Pairwise (Disjoint on d)
hsups : partialSups d = partialSups f
n : ℕ
⊢ d n = disjointed f n

Next tactic:
cases' n with n
/-- `disjointed f` is the unique sequence that is pairwise disjoint and has the same partial sups
as `f`. -/
theorem disjointed_unique {f d : ℕ → α} (hdisj : Pairwise (Disjoint on d))
    (hsups : partialSups d = partialSups f) : d = disjointed f := by
  ext n
  cases' n with n
  · 

Proof state:
case h.zero
α : Type u_1
β : Type u_2
inst✝ : GeneralizedBooleanAlgebra α
f d : ℕ → α
hdisj : Pairwise (Disjoint on d)
hsups : partialSups d = partialSups f
⊢ d Nat.zero = disjointed f Nat.zero

Next tactic:
rw [← partialSups_zero d, hsups, partialSups_zero, disjointed_zero]
/-- `disjointed f` is the unique sequence that is pairwise disjoint and has the same partial sups
as `f`. -/
theorem disjointed_unique {f d : ℕ → α} (hdisj : Pairwise (Disjoint on d))
    (hsups : partialSups d = partialSups f) : d = disjointed f := by
  ext n
  cases' n with n
  · rw [← partialSups_zero d, hsups, partialSups_zero, disjointed_zero]
  

Proof state:
case h.succ
α : Type u_1
β : Type u_2
inst✝ : GeneralizedBooleanAlgebra α
f d : ℕ → α
hdisj : Pairwise (Disjoint on d)
hsups : partialSups d = partialSups f
n : ℕ
⊢ d (Nat.succ n) = disjointed f (Nat.succ n)

Next tactic:
suffices h : d n.succ = partialSups d n.succ \ partialSups d n by
    rw [h, hsups, partialSups_succ, disjointed_succ, sup_sdiff, sdiff_self, bot_sup_eq]
/-- `disjointed f` is the unique sequence that is pairwise disjoint and has the same partial sups
as `f`. -/
theorem disjointed_unique {f d : ℕ → α} (hdisj : Pairwise (Disjoint on d))
    (hsups : partialSups d = partialSups f) : d = disjointed f := by
  ext n
  cases' n with n
  · rw [← partialSups_zero d, hsups, partialSups_zero, disjointed_zero]
  suffices h : d n.succ = partialSups d n.succ \ partialSups d n by
    

Proof state:
α : Type u_1
β : Type u_2
inst✝ : GeneralizedBooleanAlgebra α
f d : ℕ → α
hdisj : Pairwise (Disjoint on d)
hsups : partialSups d = partialSups f
n : ℕ
h : d (Nat.succ n) = (partialSups d) (Nat.succ n) \ (partialSups d) n
⊢ d (Nat.succ n) = disjointed f (Nat.succ n)

Next tactic:
rw [h, hsups, partialSups_succ, disjointed_succ, sup_sdiff, sdiff_self, bot_sup_eq]
/-- `disjointed f` is the unique sequence that is pairwise disjoint and has the same partial sups
as `f`. -/
theorem disjointed_unique {f d : ℕ → α} (hdisj : Pairwise (Disjoint on d))
    (hsups : partialSups d = partialSups f) : d = disjointed f := by
  ext n
  cases' n with n
  · rw [← partialSups_zero d, hsups, partialSups_zero, disjointed_zero]
  suffices h : d n.succ = partialSups d n.succ \ partialSups d n by
    rw [h, hsups, partialSups_succ, disjointed_succ, sup_sdiff, sdiff_self, bot_sup_eq]
  

Proof state:
case h.succ
α : Type u_1
β : Type u_2
inst✝ : GeneralizedBooleanAlgebra α
f d : ℕ → α
hdisj : Pairwise (Disjoint on d)
hsups : partialSups d = partialSups f
n : ℕ
⊢ d (Nat.succ n) = (partialSups d) (Nat.succ n) \ (partialSups d) n

Next tactic:
rw [partialSups_succ, sup_sdiff, sdiff_self, bot_sup_eq, eq_comm, sdiff_eq_self_iff_disjoint]
/-- `disjointed f` is the unique sequence that is pairwise disjoint and has the same partial sups
as `f`. -/
theorem disjointed_unique {f d : ℕ → α} (hdisj : Pairwise (Disjoint on d))
    (hsups : partialSups d = partialSups f) : d = disjointed f := by
  ext n
  cases' n with n
  · rw [← partialSups_zero d, hsups, partialSups_zero, disjointed_zero]
  suffices h : d n.succ = partialSups d n.succ \ partialSups d n by
    rw [h, hsups, partialSups_succ, disjointed_succ, sup_sdiff, sdiff_self, bot_sup_eq]
  rw [partialSups_succ, sup_sdiff, sdiff_self, bot_sup_eq, eq_comm, sdiff_eq_self_iff_disjoint]
  

Proof state:
case h.succ
α : Type u_1
β : Type u_2
inst✝ : GeneralizedBooleanAlgebra α
f d : ℕ → α
hdisj : Pairwise (Disjoint on d)
hsups : partialSups d = partialSups f
n : ℕ
⊢ Disjoint ((partialSups d) n) (d (n + 1))

Next tactic:
suffices h : ∀ m ≤ n, Disjoint (partialSups d m) (d n.succ) from h n le_rfl
/-- `disjointed f` is the unique sequence that is pairwise disjoint and has the same partial sups
as `f`. -/
theorem disjointed_unique {f d : ℕ → α} (hdisj : Pairwise (Disjoint on d))
    (hsups : partialSups d = partialSups f) : d = disjointed f := by
  ext n
  cases' n with n
  · rw [← partialSups_zero d, hsups, partialSups_zero, disjointed_zero]
  suffices h : d n.succ = partialSups d n.succ \ partialSups d n by
    rw [h, hsups, partialSups_succ, disjointed_succ, sup_sdiff, sdiff_self, bot_sup_eq]
  rw [partialSups_succ, sup_sdiff, sdiff_self, bot_sup_eq, eq_comm, sdiff_eq_self_iff_disjoint]
  suffices h : ∀ m ≤ n, Disjoint (partialSups d m) (d n.succ) from h n le_rfl
  

Proof state:
case h.succ
α : Type u_1
β : Type u_2
inst✝ : GeneralizedBooleanAlgebra α
f d : ℕ → α
hdisj : Pairwise (Disjoint on d)
hsups : partialSups d = partialSups f
n : ℕ
⊢ ∀ m ≤ n, Disjoint ((partialSups d) m) (d (Nat.succ n))

Next tactic:
rintro m hm
/-- `disjointed f` is the unique sequence that is pairwise disjoint and has the same partial sups
as `f`. -/
theorem disjointed_unique {f d : ℕ → α} (hdisj : Pairwise (Disjoint on d))
    (hsups : partialSups d = partialSups f) : d = disjointed f := by
  ext n
  cases' n with n
  · rw [← partialSups_zero d, hsups, partialSups_zero, disjointed_zero]
  suffices h : d n.succ = partialSups d n.succ \ partialSups d n by
    rw [h, hsups, partialSups_succ, disjointed_succ, sup_sdiff, sdiff_self, bot_sup_eq]
  rw [partialSups_succ, sup_sdiff, sdiff_self, bot_sup_eq, eq_comm, sdiff_eq_self_iff_disjoint]
  suffices h : ∀ m ≤ n, Disjoint (partialSups d m) (d n.succ) from h n le_rfl
  rintro m hm
  

Proof state:
case h.succ
α : Type u_1
β : Type u_2
inst✝ : GeneralizedBooleanAlgebra α
f d : ℕ → α
hdisj : Pairwise (Disjoint on d)
hsups : partialSups d = partialSups f
n m : ℕ
hm : m ≤ n
⊢ Disjoint ((partialSups d) m) (d (Nat.succ n))

Next tactic:
induction' m with m ih
/-- `disjointed f` is the unique sequence that is pairwise disjoint and has the same partial sups
as `f`. -/
theorem disjointed_unique {f d : ℕ → α} (hdisj : Pairwise (Disjoint on d))
    (hsups : partialSups d = partialSups f) : d = disjointed f := by
  ext n
  cases' n with n
  · rw [← partialSups_zero d, hsups, partialSups_zero, disjointed_zero]
  suffices h : d n.succ = partialSups d n.succ \ partialSups d n by
    rw [h, hsups, partialSups_succ, disjointed_succ, sup_sdiff, sdiff_self, bot_sup_eq]
  rw [partialSups_succ, sup_sdiff, sdiff_self, bot_sup_eq, eq_comm, sdiff_eq_self_iff_disjoint]
  suffices h : ∀ m ≤ n, Disjoint (partialSups d m) (d n.succ) from h n le_rfl
  rintro m hm
  induction' m with m ih
  · 

Proof state:
case h.succ.zero
α : Type u_1
β : Type u_2
inst✝ : GeneralizedBooleanAlgebra α
f d : ℕ → α
hdisj : Pairwise (Disjoint on d)
hsups : partialSups d = partialSups f
n : ℕ
hm : Nat.zero ≤ n
⊢ Disjoint ((partialSups d) Nat.zero) (d (Nat.succ n))

Next tactic:
exact hdisj (Nat.succ_ne_zero _).symm
/-- `disjointed f` is the unique sequence that is pairwise disjoint and has the same partial sups
as `f`. -/
theorem disjointed_unique {f d : ℕ → α} (hdisj : Pairwise (Disjoint on d))
    (hsups : partialSups d = partialSups f) : d = disjointed f := by
  ext n
  cases' n with n
  · rw [← partialSups_zero d, hsups, partialSups_zero, disjointed_zero]
  suffices h : d n.succ = partialSups d n.succ \ partialSups d n by
    rw [h, hsups, partialSups_succ, disjointed_succ, sup_sdiff, sdiff_self, bot_sup_eq]
  rw [partialSups_succ, sup_sdiff, sdiff_self, bot_sup_eq, eq_comm, sdiff_eq_self_iff_disjoint]
  suffices h : ∀ m ≤ n, Disjoint (partialSups d m) (d n.succ) from h n le_rfl
  rintro m hm
  induction' m with m ih
  · exact hdisj (Nat.succ_ne_zero _).symm
  

Proof state:
case h.succ.succ
α : Type u_1
β : Type u_2
inst✝ : GeneralizedBooleanAlgebra α
f d : ℕ → α
hdisj : Pairwise (Disjoint on d)
hsups : partialSups d = partialSups f
n m : ℕ
ih : m ≤ n → Disjoint ((partialSups d) m) (d (Nat.succ n))
hm : Nat.succ m ≤ n
⊢ Disjoint ((partialSups d) (Nat.succ m)) (d (Nat.succ n))

Next tactic:
rw [partialSups_succ, disjoint_iff, inf_sup_right, sup_eq_bot_iff, ← disjoint_iff, ← disjoint_iff]
/-- `disjointed f` is the unique sequence that is pairwise disjoint and has the same partial sups
as `f`. -/
theorem disjointed_unique {f d : ℕ → α} (hdisj : Pairwise (Disjoint on d))
    (hsups : partialSups d = partialSups f) : d = disjointed f := by
  ext n
  cases' n with n
  · rw [← partialSups_zero d, hsups, partialSups_zero, disjointed_zero]
  suffices h : d n.succ = partialSups d n.succ \ partialSups d n by
    rw [h, hsups, partialSups_succ, disjointed_succ, sup_sdiff, sdiff_self, bot_sup_eq]
  rw [partialSups_succ, sup_sdiff, sdiff_self, bot_sup_eq, eq_comm, sdiff_eq_self_iff_disjoint]
  suffices h : ∀ m ≤ n, Disjoint (partialSups d m) (d n.succ) from h n le_rfl
  rintro m hm
  induction' m with m ih
  · exact hdisj (Nat.succ_ne_zero _).symm
  rw [partialSups_succ, disjoint_iff, inf_sup_right, sup_eq_bot_iff, ← disjoint_iff, ← disjoint_iff]
  

Proof state:
case h.succ.succ
α : Type u_1
β : Type u_2
inst✝ : GeneralizedBooleanAlgebra α
f d : ℕ → α
hdisj : Pairwise (Disjoint on d)
hsups : partialSups d = partialSups f
n m : ℕ
ih : m ≤ n → Disjoint ((partialSups d) m) (d (Nat.succ n))
hm : Nat.succ m ≤ n
⊢ Disjoint ((partialSups d) m) (d (Nat.succ n)) ∧ Disjoint (d (m + 1)) (d (Nat.succ n))

Next tactic:
exact ⟨ih (Nat.le_of_succ_le hm), hdisj (Nat.lt_succ_of_le hm).ne⟩
theorem disjointed_eq_inf_compl (f : ℕ → α) (n : ℕ) : disjointed f n = f n ⊓ ⨅ i < n, (f i)ᶜ := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝ : CompleteBooleanAlgebra α
f : ℕ → α
n : ℕ
⊢ disjointed f n = f n ⊓ ⨅ i, ⨅ (_ : i < n), (f i)ᶜ

Next tactic:
cases n
theorem disjointed_eq_inf_compl (f : ℕ → α) (n : ℕ) : disjointed f n = f n ⊓ ⨅ i < n, (f i)ᶜ := by
  cases n
  · 

Proof state:
case zero
α : Type u_1
β : Type u_2
inst✝ : CompleteBooleanAlgebra α
f : ℕ → α
⊢ disjointed f Nat.zero = f Nat.zero ⊓ ⨅ i, ⨅ (_ : i < Nat.zero), (f i)ᶜ

Next tactic:
rw [disjointed_zero, eq_comm, inf_eq_left]
theorem disjointed_eq_inf_compl (f : ℕ → α) (n : ℕ) : disjointed f n = f n ⊓ ⨅ i < n, (f i)ᶜ := by
  cases n
  · rw [disjointed_zero, eq_comm, inf_eq_left]
    

Proof state:
case zero
α : Type u_1
β : Type u_2
inst✝ : CompleteBooleanAlgebra α
f : ℕ → α
⊢ f Nat.zero ≤ ⨅ i, ⨅ (_ : i < Nat.zero), (f i)ᶜ

Next tactic:
simp_rw [le_iInf_iff]
theorem disjointed_eq_inf_compl (f : ℕ → α) (n : ℕ) : disjointed f n = f n ⊓ ⨅ i < n, (f i)ᶜ := by
  cases n
  · rw [disjointed_zero, eq_comm, inf_eq_left]
    simp_rw [le_iInf_iff]
    

Proof state:
case zero
α : Type u_1
β : Type u_2
inst✝ : CompleteBooleanAlgebra α
f : ℕ → α
⊢ ∀ i < Nat.zero, f Nat.zero ≤ (f i)ᶜ

Next tactic:
exact fun i hi => (i.not_lt_zero hi).elim
theorem disjointed_eq_inf_compl (f : ℕ → α) (n : ℕ) : disjointed f n = f n ⊓ ⨅ i < n, (f i)ᶜ := by
  cases n
  · rw [disjointed_zero, eq_comm, inf_eq_left]
    simp_rw [le_iInf_iff]
    exact fun i hi => (i.not_lt_zero hi).elim
  

Proof state:
case succ
α : Type u_1
β : Type u_2
inst✝ : CompleteBooleanAlgebra α
f : ℕ → α
n✝ : ℕ
⊢ disjointed f (Nat.succ n✝) = f (Nat.succ n✝) ⊓ ⨅ i, ⨅ (_ : i < Nat.succ n✝), (f i)ᶜ

Next tactic:
simp_rw [disjointed_succ, partialSups_eq_biSup, sdiff_eq, compl_iSup]
theorem disjointed_eq_inf_compl (f : ℕ → α) (n : ℕ) : disjointed f n = f n ⊓ ⨅ i < n, (f i)ᶜ := by
  cases n
  · rw [disjointed_zero, eq_comm, inf_eq_left]
    simp_rw [le_iInf_iff]
    exact fun i hi => (i.not_lt_zero hi).elim
  simp_rw [disjointed_succ, partialSups_eq_biSup, sdiff_eq, compl_iSup]
  

Proof state:
case succ
α : Type u_1
β : Type u_2
inst✝ : CompleteBooleanAlgebra α
f : ℕ → α
n✝ : ℕ
⊢ f (n✝ + 1) ⊓ ⨅ i, ⨅ (_ : i ≤ n✝), (f i)ᶜ = f (Nat.succ n✝) ⊓ ⨅ i, ⨅ (_ : i < Nat.succ n✝), (f i)ᶜ

Next tactic:
congr