Built with
doc-gen4 , running Lean4.
Bubbles (
) indicate interactive fragments: hover for details, tap to reveal contents.
Use
Ctrl+↑ Ctrl+↓ to navigate,
Ctrl+🖱️ to focus.
On Mac, use
Cmd instead of
Ctrl .
import Pretty.Defs.Basic
import Pretty.Claims.Render
import Pretty.Supports.FactoryMath
/-!
## Theorems about the measure computation/rendering relation ($⇓_\mathbb{M}$)
-/
/--
Determinism of the measure computation relation (Section 5.3)
-/
theorem MeasRender_deterministic { F : Factory α } { m₁ m₂ : Meas }
( h₁ : @ MeasRender α F d c i m₁ ) ( h₂ : @ MeasRender α F d c i m₂ ) : m₁ = m₂ := by
induction h₁ generalizing m₂ text nl concat α : Type d : Doc c, i : ℕ F : Factory α m₁ : Meas d✝ : Doc c✝, i✝, n✝, last✝ : ℕ cost✝ : α x✝, y✝ : ℕ h✝ : MeasRender F d✝ c✝ (i✝ + n✝ ) { last := last✝ , cost := cost✝ , doc := d✝ , x := x✝ , y := y✝ } h_ih✝ : ∀ {m₂ : Meas }, MeasRender F d✝ c✝ (i✝ + n✝ ) m₂ → { last := last✝ , cost := cost✝ , doc := d✝ , x := x✝ , y := y✝ } = m₂ m₂ : Meas h₂ : MeasRender F (Doc.nest n✝ d✝ ) c✝ i✝ m₂ nest { last := last✝ , cost := cost✝ , doc := Doc.nest n✝ d✝ , x := x✝ , y := y✝ } = m₂ α : Type d : Doc c, i : ℕ F : Factory α m₁ : Meas d✝ : Doc c✝, last✝ : ℕ cost✝ : α x✝, y✝, i✝ : ℕ h✝ : MeasRender F d✝ c✝ c✝ { last := last✝ , cost := cost✝ , doc := d✝ , x := x✝ , y := y✝ } h_ih✝ : ∀ {m₂ : Meas }, MeasRender F d✝ c✝ c✝ m₂ → { last := last✝ , cost := cost✝ , doc := d✝ , x := x✝ , y := y✝ } = m₂ m₂ : Meas h₂ : MeasRender F (Doc.align d✝ ) c✝ i✝ m₂ align { last := last✝ , cost := cost✝ , doc := Doc.align d✝ , x := x✝ , y := max i✝ y✝ } = m₂
case text | nl => dwi { cases h₂ }
case nest ih : ?m.145 d✝ c✝ (i✝ + n✝ ) { last := last✝ , cost := cost✝ , doc := d✝ , x := x✝ , y := y✝ } h✝ ih | align ih : ?m.145 d✝ c✝ c✝ { last := last✝ , cost := cost✝ , doc := d✝ , x := x✝ , y := y✝ } h✝
ih =>
α : Type d : Doc c, i : ℕ F : Factory α m₁ : Meas d✝ : Doc c✝, last✝ : ℕ cost✝ : α x✝, y✝, i✝ : ℕ h✝ : MeasRender F d✝ c✝ c✝ { last := last✝ , cost := cost✝ , doc := d✝ , x := x✝ , y := y✝ } ih : ∀ {m₂ : Meas }, MeasRender F d✝ c✝ c✝ m₂ → { last := last✝ , cost := cost✝ , doc := d✝ , x := x✝ , y := y✝ } = m₂ m₂ : Meas h₂ : MeasRender F (Doc.align d✝ ) c✝ i✝ m₂ { last := last✝ , cost := cost✝ , doc := Doc.align d✝ , x := x✝ , y := max i✝ y✝ } = m₂ rename Doc => d α : Type d✝ : Doc c, i : ℕ F : Factory α m₁ : Meas d : Doc c✝, last✝ : ℕ cost✝ : α x✝, y✝, i✝ : ℕ h✝ : MeasRender F d c✝ c✝ { last := last✝ , cost := cost✝ , doc := d , x := x✝ , y := y✝ } ih : ∀ {m₂ : Meas }, MeasRender F d c✝ c✝ m₂ → { last := last✝ , cost := cost✝ , doc := d , x := x✝ , y := y✝ } = m₂ m₂ : Meas h₂ : MeasRender F (Doc.align d ) c✝ i✝ m₂ { last := last✝ , cost := cost✝ , doc := Doc.align d , x := x✝ , y := max i✝ y✝ } = m₂
α : Type d : Doc c, i : ℕ F : Factory α m₁ : Meas d✝ : Doc c✝, last✝ : ℕ cost✝ : α x✝, y✝, i✝ : ℕ h✝ : MeasRender F d✝ c✝ c✝ { last := last✝ , cost := cost✝ , doc := d✝ , x := x✝ , y := y✝ } ih : ∀ {m₂ : Meas }, MeasRender F d✝ c✝ c✝ m₂ → { last := last✝ , cost := cost✝ , doc := d✝ , x := x✝ , y := y✝ } = m₂ m₂ : Meas h₂ : MeasRender F (Doc.align d✝ ) c✝ i✝ m₂ { last := last✝ , cost := cost✝ , doc := Doc.align d✝ , x := x✝ , y := max i✝ y✝ } = m₂ cases h₂ α : Type d✝ : Doc c, i : ℕ F : Factory α m₁ : Meas d : Doc c✝, i✝, n✝, last✝¹ : ℕ cost✝¹ : α x✝¹, y✝¹ : ℕ h✝¹ : MeasRender F d c✝ (i✝ + n✝ ) { last := last✝¹ , cost := cost✝¹ , doc := d , x := x✝¹ , y := y✝¹ } ih : ∀ {m₂ : Meas }, MeasRender F d c✝ (i✝ + n✝ ) m₂ → { last := last✝¹ , cost := cost✝¹ , doc := d , x := x✝¹ , y := y✝¹ } = m₂ last✝ : ℕ cost✝ : α x✝, y✝ : ℕ h✝ : MeasRender F d c✝ (i✝ + n✝ ) { last := last✝ , cost := cost✝ , doc := d , x := x✝ , y := y✝ } nest { last := last✝¹ , cost := cost✝¹ , doc := Doc.nest n✝ d , x := x✝¹ , y := y✝¹ } = { last := last✝ , cost := cost✝ , doc := Doc.nest n✝ d , x := x✝ , y := y✝ }
α : Type d : Doc c, i : ℕ F : Factory α m₁ : Meas d✝ : Doc c✝, last✝ : ℕ cost✝ : α x✝, y✝, i✝ : ℕ h✝ : MeasRender F d✝ c✝ c✝ { last := last✝ , cost := cost✝ , doc := d✝ , x := x✝ , y := y✝ } ih : ∀ {m₂ : Meas }, MeasRender F d✝ c✝ c✝ m₂ → { last := last✝ , cost := cost✝ , doc := d✝ , x := x✝ , y := y✝ } = m₂ m₂ : Meas h₂ : MeasRender F (Doc.align d✝ ) c✝ i✝ m₂ { last := last✝ , cost := cost✝ , doc := Doc.align d✝ , x := x✝ , y := max i✝ y✝ } = m₂ rename_i last₂ cost₂ x₂ y₂ h₂ : MeasRender F d c✝ (i✝ + n✝ ) { last := last₂ , cost := cost₂ , doc := d , x := x₂ , y := y₂ } h₂ α : Type d✝ : Doc c, i : ℕ F : Factory α m₁ : Meas d : Doc c✝, last✝ : ℕ cost✝ : α x✝, y✝, i✝ : ℕ h✝ : MeasRender F d c✝ c✝ { last := last✝ , cost := cost✝ , doc := d , x := x✝ , y := y✝ } ih : ∀ {m₂ : Meas }, MeasRender F d c✝ c✝ m₂ → { last := last✝ , cost := cost✝ , doc := d , x := x✝ , y := y✝ } = m₂ last₂ : ℕ cost₂ : α x₂, y₂ : ℕ h₂ : MeasRender F d c✝ c✝ { last := last₂ , cost := cost₂ , doc := d , x := x₂ , y := y₂ } align { last := last✝ , cost := cost✝ , doc := Doc.align d , x := x✝ , y := max i✝ y✝ } = { last := last₂ , cost := cost₂ , doc := Doc.align d , x := x₂ , y := max i✝ y₂ }
α : Type d : Doc c, i : ℕ F : Factory α m₁ : Meas d✝ : Doc c✝, last✝ : ℕ cost✝ : α x✝, y✝, i✝ : ℕ h✝ : MeasRender F d✝ c✝ c✝ { last := last✝ , cost := cost✝ , doc := d✝ , x := x✝ , y := y✝ } ih : ∀ {m₂ : Meas }, MeasRender F d✝ c✝ c✝ m₂ → { last := last✝ , cost := cost✝ , doc := d✝ , x := x✝ , y := y✝ } = m₂ m₂ : Meas h₂ : MeasRender F (Doc.align d✝ ) c✝ i✝ m₂ { last := last✝ , cost := cost✝ , doc := Doc.align d✝ , x := x✝ , y := max i✝ y✝ } = m₂ dwi { α : Type d✝ : Doc c, i : ℕ F : Factory α m₁ : Meas d : Doc c✝, i✝, n✝, last✝ : ℕ cost✝ : α x✝, y✝ : ℕ h✝ : MeasRender F d c✝ (i✝ + n✝ ) { last := last✝ , cost := cost✝ , doc := d , x := x✝ , y := y✝ } ih : ∀ {m₂ : Meas }, MeasRender F d c✝ (i✝ + n✝ ) m₂ → { last := last✝ , cost := cost✝ , doc := d , x := x✝ , y := y✝ } = m₂ last₂ : ℕ cost₂ : α x₂, y₂ : ℕ h₂ : MeasRender F d c✝ (i✝ + n✝ ) { last := last₂ , cost := cost₂ , doc := d , x := x₂ , y := y₂ } nest { last := last✝ , cost := cost✝ , doc := Doc.nest n✝ d , x := x✝ , y := y✝ } = { last := last₂ , cost := cost₂ , doc := Doc.nest n✝ d , x := x₂ , y := y₂ } cases ih : ?m.145 d c✝ (i✝ + n✝ ) { last := last✝ , cost := cost✝ , doc := d , x := x✝ , y := y✝ } h✝ ih h₂ : MeasRender F d c✝ c✝ { last := last₂ , cost := cost₂ , doc := d , x := x₂ , y := y₂ } h₂ α : Type d✝ : Doc c, i : ℕ F : Factory α m₁ : Meas d : Doc c✝, last✝ : ℕ cost✝ : α x✝, y✝, i✝ : ℕ h✝ : MeasRender F d c✝ c✝ { last := last✝ , cost := cost✝ , doc := d , x := x✝ , y := y✝ } ih : ∀ {m₂ : Meas }, MeasRender F d c✝ c✝ m₂ → { last := last✝ , cost := cost✝ , doc := d , x := x✝ , y := y✝ } = m₂ h₂ : MeasRender F d c✝ c✝ { last := last✝ , cost := cost✝ , doc := d , x := x✝ , y := y✝ } align.refl { last := last✝ , cost := cost✝ , doc := Doc.align d , x := x✝ , y := max i✝ y✝ } = { last := last✝ , cost := cost✝ , doc := Doc.align d , x := x✝ , y := max i✝ y✝ } }
case concat ihₗ : ?m.145 d₁✝ c✝ i✝ m₁✝ h₁✝
ihₗ ihᵣ : ?m.145 d₂✝ m₁✝ .last i✝ m₂✝ h₂✝
ihᵣ =>
cases h₂
case concat h₂ h₁ h =>
cases ihₗ : ?m.145 d₁✝ c✝ i✝ m₁✝¹ h₁✝
ihₗ h₁
cases ihᵣ : ?m.145 d₂✝ m₁✝ .last i✝ m₂✝¹ h₂✝
ihᵣ h₂
simp [*]
/--
Correctness of the measure computation relation
when it results in one line (first part of Theorem 5.3)
-/
theorem MeasRender_single_correct ( F : Factory α )
( h_render : Render d c i { fst := s , rst := [] } h_render : Render d c i ⟨ s , [] ⟩) :
∃ cost y , MeasRender F d c i ⟨ c + s . length , cost , d , c + s . length , y ⟩ := by
induction d generalizing c i s text nl α : Type F : Factory α d₁✝, d₂✝ : Doc d₁_ih✝ : ∀ {c i : ℕ } {s : String },
Render d₁✝ c i { fst := s , rst := [] } →
∃ cost y ,
MeasRender F d₁✝ c i { last := c + String.length s , cost := cost , doc := d₁✝ , x := c + String.length s , y := y } d₂_ih✝ : ∀ {c i : ℕ } {s : String },
Render d₂✝ c i { fst := s , rst := [] } →
∃ cost y ,
MeasRender F d₂✝ c i { last := c + String.length s , cost := cost , doc := d₂✝ , x := c + String.length s , y := y } c, i : ℕ s : String h_render : Render (Doc.concat d₁✝ d₂✝ ) c i { fst := s , rst := [] } concat nest align α : Type F : Factory α d₁✝, d₂✝ : Doc d₁_ih✝ : ∀ {c i : ℕ } {s : String },
Render d₁✝ c i { fst := s , rst := [] } →
∃ cost y ,
MeasRender F d₁✝ c i { last := c + String.length s , cost := cost , doc := d₁✝ , x := c + String.length s , y := y } d₂_ih✝ : ∀ {c i : ℕ } {s : String },
Render d₂✝ c i { fst := s , rst := [] } →
∃ cost y ,
MeasRender F d₂✝ c i { last := c + String.length s , cost := cost , doc := d₂✝ , x := c + String.length s , y := y } c, i : ℕ s : String h_render : Render (Doc.choice d₁✝ d₂✝ ) c i { fst := s , rst := [] } choice
case text =>
exists F . text c s . length , i
cases h_render
constructor
case nl => exists F . text c s . length , i
case nest ih =>
cases h_render
rename_i h : Render d✝ c (i + n✝ ) { fst := s , rst := [] } h
let ⟨ cost , y , hh ⟩ := ih h : Render d✝ c (i + n✝ ) { fst := s , rst := [] } h α : Type F : Factory α n✝ : ℕ d✝ : Doc ih : ∀ {c i : ℕ } {s : String },
Render d✝ c i { fst := s , rst := [] } →
∃ cost y ,
MeasRender F d✝ c i { last := c + String.length s , cost := cost , doc := d✝ , x := c + String.length s , y := y } c, i : ℕ s : String h : Render d✝ c (i + n✝ ) { fst := s , rst := [] } cost : α y : ℕ hh : MeasRender F d✝ c (i + n✝ ) { last := c + String.length s , cost := cost , doc := d✝ , x := c + String.length s , y := y } nest
exists cost , y α : Type F : Factory α n✝ : ℕ d✝ : Doc ih : ∀ {c i : ℕ } {s : String },
Render d✝ c i { fst := s , rst := [] } →
∃ cost y ,
MeasRender F d✝ c i { last := c + String.length s , cost := cost , doc := d✝ , x := c + String.length s , y := y } c, i : ℕ s : String h : Render d✝ c (i + n✝ ) { fst := s , rst := [] } cost : α y : ℕ hh : MeasRender F d✝ c (i + n✝ ) { last := c + String.length s , cost := cost , doc := d✝ , x := c + String.length s , y := y } nest
constructor α : Type F : Factory α n✝ : ℕ d✝ : Doc ih : ∀ {c i : ℕ } {s : String },
Render d✝ c i { fst := s , rst := [] } →
∃ cost y ,
MeasRender F d✝ c i { last := c + String.length s , cost := cost , doc := d✝ , x := c + String.length s , y := y } c, i : ℕ s : String h : Render d✝ c (i + n✝ ) { fst := s , rst := [] } cost : α y : ℕ hh : MeasRender F d✝ c (i + n✝ ) { last := c + String.length s , cost := cost , doc := d✝ , x := c + String.length s , y := y } nest.h
assumption
case align ih =>
cases h_render
rename_i h : Render d✝ c c { fst := s , rst := [] } h
let ⟨ cost , y , hh ⟩ := ih h : Render d✝ c c { fst := s , rst := [] } h α : Type F : Factory α d✝ : Doc ih : ∀ {c i : ℕ } {s : String },
Render d✝ c i { fst := s , rst := [] } →
∃ cost y ,
MeasRender F d✝ c i { last := c + String.length s , cost := cost , doc := d✝ , x := c + String.length s , y := y } c, i : ℕ s : String h : Render d✝ c c { fst := s , rst := [] } cost : α y : ℕ hh : MeasRender F d✝ c c { last := c + String.length s , cost := cost , doc := d✝ , x := c + String.length s , y := y } align
exists cost , ( max : {α : Type ?u.11587} → [self : Max α ] → α → α → α max i y ) α : Type F : Factory α d✝ : Doc ih : ∀ {c i : ℕ } {s : String },
Render d✝ c i { fst := s , rst := [] } →
∃ cost y ,
MeasRender F d✝ c i { last := c + String.length s , cost := cost , doc := d✝ , x := c + String.length s , y := y } c, i : ℕ s : String h : Render d✝ c c { fst := s , rst := [] } cost : α y : ℕ hh : MeasRender F d✝ c c { last := c + String.length s , cost := cost , doc := d✝ , x := c + String.length s , y := y } align
constructor α : Type F : Factory α d✝ : Doc ih : ∀ {c i : ℕ } {s : String },
Render d✝ c i { fst := s , rst := [] } →
∃ cost y ,
MeasRender F d✝ c i { last := c + String.length s , cost := cost , doc := d✝ , x := c + String.length s , y := y } c, i : ℕ s : String h : Render d✝ c c { fst := s , rst := [] } cost : α y : ℕ hh : MeasRender F d✝ c c { last := c + String.length s , cost := cost , doc := d✝ , x := c + String.length s , y := y } align.h
assumption
case concat ih₁ ih₂ =>
α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String },
Render d₁✝ c i { fst := s , rst := [] } →
∃ cost y ,
MeasRender F d₁✝ c i { last := c + String.length s , cost := cost , doc := d₁✝ , x := c + String.length s , y := y } ih₂ : ∀ {c i : ℕ } {s : String },
Render d₂✝ c i { fst := s , rst := [] } →
∃ cost y ,
MeasRender F d₂✝ c i { last := c + String.length s , cost := cost , doc := d₂✝ , x := c + String.length s , y := y } c, i : ℕ s : String h_render : Render (Doc.concat d₁✝ d₂✝ ) c i { fst := s , rst := [] } generalize h_layout : Layout.mk s [] = L at h_render α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String },
Render d₁✝ c i { fst := s , rst := [] } →
∃ cost y ,
MeasRender F d₁✝ c i { last := c + String.length s , cost := cost , doc := d₁✝ , x := c + String.length s , y := y } ih₂ : ∀ {c i : ℕ } {s : String },
Render d₂✝ c i { fst := s , rst := [] } →
∃ cost y ,
MeasRender F d₂✝ c i { last := c + String.length s , cost := cost , doc := d₂✝ , x := c + String.length s , y := y } c, i : ℕ s : String L : Layout h_layout : { fst := s , rst := [] } = L h_render : Render (Doc.concat d₁✝ d₂✝ ) c i L
α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String },
Render d₁✝ c i { fst := s , rst := [] } →
∃ cost y ,
MeasRender F d₁✝ c i { last := c + String.length s , cost := cost , doc := d₁✝ , x := c + String.length s , y := y } ih₂ : ∀ {c i : ℕ } {s : String },
Render d₂✝ c i { fst := s , rst := [] } →
∃ cost y ,
MeasRender F d₂✝ c i { last := c + String.length s , cost := cost , doc := d₂✝ , x := c + String.length s , y := y } c, i : ℕ s : String h_render : Render (Doc.concat d₁✝ d₂✝ ) c i { fst := s , rst := [] } cases h_render α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String },
Render d₁✝ c i { fst := s , rst := [] } →
∃ cost y ,
MeasRender F d₁✝ c i { last := c + String.length s , cost := cost , doc := d₁✝ , x := c + String.length s , y := y } ih₂ : ∀ {c i : ℕ } {s : String },
Render d₂✝ c i { fst := s , rst := [] } →
∃ cost y ,
MeasRender F d₂✝ c i { last := c + String.length s , cost := cost , doc := d₂✝ , x := c + String.length s , y := y } c, i : ℕ s, s✝, t✝ : String ts✝ : List String h₁✝ : Render d₁✝ c i { fst := s✝ , rst := [] } h₂✝ : Render d₂✝ (c + String.length s✝ ) i { fst := t✝ , rst := ts✝ } h_layout : { fst := s , rst := [] } = { fst := s✝ ++ t✝ , rst := ts✝ } concat_one α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String },
Render d₁✝ c i { fst := s , rst := [] } →
∃ cost y ,
MeasRender F d₁✝ c i { last := c + String.length s , cost := cost , doc := d₁✝ , x := c + String.length s , y := y } ih₂ : ∀ {c i : ℕ } {s : String },
Render d₂✝ c i { fst := s , rst := [] } →
∃ cost y ,
MeasRender F d₂✝ c i { last := c + String.length s , cost := cost , doc := d₂✝ , x := c + String.length s , y := y } c, i : ℕ s : String ss✝ : List String slast✝, s✝, t✝ : String ts✝ : List String h_non_empty✝ : ss✝ ≠ [] h_last✝ : slast✝ = List.getLast ss✝ h_non_empty✝ h₂✝ : Render d₂✝ (String.length slast✝ ) i { fst := t✝ , rst := ts✝ } h₁✝ : Render d₁✝ c i { fst := s✝ , rst := ss✝ } h_layout : { fst := s , rst := [] } = { fst := s✝ , rst := List.dropLast ss✝ ++ [slast✝ ++ t✝ ] ++ ts✝ } concat_multi
α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String },
Render d₁✝ c i { fst := s , rst := [] } →
∃ cost y ,
MeasRender F d₁✝ c i { last := c + String.length s , cost := cost , doc := d₁✝ , x := c + String.length s , y := y } ih₂ : ∀ {c i : ℕ } {s : String },
Render d₂✝ c i { fst := s , rst := [] } →
∃ cost y ,
MeasRender F d₂✝ c i { last := c + String.length s , cost := cost , doc := d₂✝ , x := c + String.length s , y := y } c, i : ℕ s : String h_render : Render (Doc.concat d₁✝ d₂✝ ) c i { fst := s , rst := [] } case concat_one d₁ d₂ s₁ s₂ _ h₁ : Render d₁ c i { fst := s₁ , rst := [] } h₁ h₂ =>
α : Type F : Factory α d₁, d₂ : Doc ih₁ : ∀ {c i : ℕ } {s : String },
Render d₁ c i { fst := s , rst := [] } →
∃ cost y ,
MeasRender F d₁ c i { last := c + String.length s , cost := cost , doc := d₁ , x := c + String.length s , y := y } ih₂ : ∀ {c i : ℕ } {s : String },
Render d₂ c i { fst := s , rst := [] } →
∃ cost y ,
MeasRender F d₂ c i { last := c + String.length s , cost := cost , doc := d₂ , x := c + String.length s , y := y } c, i : ℕ s, s₁, s₂ : String ts✝ : List String h₁ : Render d₁ c i { fst := s₁ , rst := [] } h₂ : Render d₂ (c + String.length s₁ ) i { fst := s₂ , rst := ts✝ } h_layout : { fst := s , rst := [] } = { fst := s₁ ++ s₂ , rst := ts✝ } cases h_layout : { fst := s , rst := [] } = { fst := s₁ ++ s₂ , rst := ts✝ } h_layout α : Type F : Factory α d₁, d₂ : Doc ih₁ : ∀ {c i : ℕ } {s : String },
Render d₁ c i { fst := s , rst := [] } →
∃ cost y ,
MeasRender F d₁ c i { last := c + String.length s , cost := cost , doc := d₁ , x := c + String.length s , y := y } ih₂ : ∀ {c i : ℕ } {s : String },
Render d₂ c i { fst := s , rst := [] } →
∃ cost y ,
MeasRender F d₂ c i { last := c + String.length s , cost := cost , doc := d₂ , x := c + String.length s , y := y } c, i : ℕ s₁, s₂ : String h₁ : Render d₁ c i { fst := s₁ , rst := [] } h₂ : Render d₂ (c + String.length s₁ ) i { fst := s₂ , rst := [] } refl
α : Type F : Factory α d₁, d₂ : Doc ih₁ : ∀ {c i : ℕ } {s : String },
Render d₁ c i { fst := s , rst := [] } →
∃ cost y ,
MeasRender F d₁ c i { last := c + String.length s , cost := cost , doc := d₁ , x := c + String.length s , y := y } ih₂ : ∀ {c i : ℕ } {s : String },
Render d₂ c i { fst := s , rst := [] } →
∃ cost y ,
MeasRender F d₂ c i { last := c + String.length s , cost := cost , doc := d₂ , x := c + String.length s , y := y } c, i : ℕ s, s₁, s₂ : String ts✝ : List String h₁ : Render d₁ c i { fst := s₁ , rst := [] } h₂ : Render d₂ (c + String.length s₁ ) i { fst := s₂ , rst := ts✝ } h_layout : { fst := s , rst := [] } = { fst := s₁ ++ s₂ , rst := ts✝ } let ⟨ cost₁ , y₁ , _⟩ := ih₁ h₁ : Render d₁ c i { fst := s₁ , rst := [] } h₁ α : Type F : Factory α d₁, d₂ : Doc ih₁ : ∀ {c i : ℕ } {s : String },
Render d₁ c i { fst := s , rst := [] } →
∃ cost y ,
MeasRender F d₁ c i { last := c + String.length s , cost := cost , doc := d₁ , x := c + String.length s , y := y } ih₂ : ∀ {c i : ℕ } {s : String },
Render d₂ c i { fst := s , rst := [] } →
∃ cost y ,
MeasRender F d₂ c i { last := c + String.length s , cost := cost , doc := d₂ , x := c + String.length s , y := y } c, i : ℕ s₁, s₂ : String h₁ : Render d₁ c i { fst := s₁ , rst := [] } h₂ : Render d₂ (c + String.length s₁ ) i { fst := s₂ , rst := [] } cost₁ : α y₁ : ℕ h✝ : MeasRender F d₁ c i { last := c + String.length s₁ , cost := cost₁ , doc := d₁ , x := c + String.length s₁ , y := y₁ } refl
α : Type F : Factory α d₁, d₂ : Doc ih₁ : ∀ {c i : ℕ } {s : String },
Render d₁ c i { fst := s , rst := [] } →
∃ cost y ,
MeasRender F d₁ c i { last := c + String.length s , cost := cost , doc := d₁ , x := c + String.length s , y := y } ih₂ : ∀ {c i : ℕ } {s : String },
Render d₂ c i { fst := s , rst := [] } →
∃ cost y ,
MeasRender F d₂ c i { last := c + String.length s , cost := cost , doc := d₂ , x := c + String.length s , y := y } c, i : ℕ s, s₁, s₂ : String ts✝ : List String h₁ : Render d₁ c i { fst := s₁ , rst := [] } h₂ : Render d₂ (c + String.length s₁ ) i { fst := s₂ , rst := ts✝ } h_layout : { fst := s , rst := [] } = { fst := s₁ ++ s₂ , rst := ts✝ } let ⟨ cost₂ , y₂ , _⟩ := ih₂ h₂ α : Type F : Factory α d₁, d₂ : Doc ih₁ : ∀ {c i : ℕ } {s : String },
Render d₁ c i { fst := s , rst := [] } →
∃ cost y ,
MeasRender F d₁ c i { last := c + String.length s , cost := cost , doc := d₁ , x := c + String.length s , y := y } ih₂ : ∀ {c i : ℕ } {s : String },
Render d₂ c i { fst := s , rst := [] } →
∃ cost y ,
MeasRender F d₂ c i { last := c + String.length s , cost := cost , doc := d₂ , x := c + String.length s , y := y } c, i : ℕ s₁, s₂ : String h₁ : Render d₁ c i { fst := s₁ , rst := [] } h₂ : Render d₂ (c + String.length s₁ ) i { fst := s₂ , rst := [] } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁ c i { last := c + String.length s₁ , cost := cost₁ , doc := d₁ , x := c + String.length s₁ , y := y₁ } cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂ (c + String.length s₁ ) i
{ last := c + String.length s₁ + String.length s₂ , cost := cost₂ , doc := d₂ ,
x := c + String.length s₁ + String.length s₂ , y := y₂ } refl
α : Type F : Factory α d₁, d₂ : Doc ih₁ : ∀ {c i : ℕ } {s : String },
Render d₁ c i { fst := s , rst := [] } →
∃ cost y ,
MeasRender F d₁ c i { last := c + String.length s , cost := cost , doc := d₁ , x := c + String.length s , y := y } ih₂ : ∀ {c i : ℕ } {s : String },
Render d₂ c i { fst := s , rst := [] } →
∃ cost y ,
MeasRender F d₂ c i { last := c + String.length s , cost := cost , doc := d₂ , x := c + String.length s , y := y } c, i : ℕ s, s₁, s₂ : String ts✝ : List String h₁ : Render d₁ c i { fst := s₁ , rst := [] } h₂ : Render d₂ (c + String.length s₁ ) i { fst := s₂ , rst := ts✝ } h_layout : { fst := s , rst := [] } = { fst := s₁ ++ s₂ , rst := ts✝ } exists F . concat cost₁ cost₂ , max : {α : Type ?u.13779} → [self : Max α ] → α → α → α max y₁ y₂ α : Type F : Factory α d₁, d₂ : Doc ih₁ : ∀ {c i : ℕ } {s : String },
Render d₁ c i { fst := s , rst := [] } →
∃ cost y ,
MeasRender F d₁ c i { last := c + String.length s , cost := cost , doc := d₁ , x := c + String.length s , y := y } ih₂ : ∀ {c i : ℕ } {s : String },
Render d₂ c i { fst := s , rst := [] } →
∃ cost y ,
MeasRender F d₂ c i { last := c + String.length s , cost := cost , doc := d₂ , x := c + String.length s , y := y } c, i : ℕ s₁, s₂ : String h₁ : Render d₁ c i { fst := s₁ , rst := [] } h₂ : Render d₂ (c + String.length s₁ ) i { fst := s₂ , rst := [] } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁ c i { last := c + String.length s₁ , cost := cost₁ , doc := d₁ , x := c + String.length s₁ , y := y₁ } cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂ (c + String.length s₁ ) i
{ last := c + String.length s₁ + String.length s₂ , cost := cost₂ , doc := d₂ ,
x := c + String.length s₁ + String.length s₂ , y := y₂ } refl
α : Type F : Factory α d₁, d₂ : Doc ih₁ : ∀ {c i : ℕ } {s : String },
Render d₁ c i { fst := s , rst := [] } →
∃ cost y ,
MeasRender F d₁ c i { last := c + String.length s , cost := cost , doc := d₁ , x := c + String.length s , y := y } ih₂ : ∀ {c i : ℕ } {s : String },
Render d₂ c i { fst := s , rst := [] } →
∃ cost y ,
MeasRender F d₂ c i { last := c + String.length s , cost := cost , doc := d₂ , x := c + String.length s , y := y } c, i : ℕ s, s₁, s₂ : String ts✝ : List String h₁ : Render d₁ c i { fst := s₁ , rst := [] } h₂ : Render d₂ (c + String.length s₁ ) i { fst := s₂ , rst := ts✝ } h_layout : { fst := s , rst := [] } = { fst := s₁ ++ s₂ , rst := ts✝ } have h_ans : { last := c + String.length ( s₁ ++ s₂ ),
cost := F . concat cost₁ cost₂ ,
doc := Doc.concat d₁ d₂ ,
x := c + String.length ( s₁ ++ s₂ ), y := max : {α : Type ?u.16231} → [self : Max α ] → α → α → α max y₁ y₂ } =
Meas.concat : {α : Type } → Factory α → Meas → Meas → Meas Meas.concat F
{ last := c + String.length s₁ ,
cost := cost₁ ,
doc := d₁ , x := c + String.length s₁ ,
y := y₁ }
{ last := c + String.length s₁ + String.length s₂ ,
cost := cost₂ ,
doc := d₂ ,
x := c + String.length s₁ + String.length s₂ ,
y := y₂ } := α : Type F : Factory α d₁, d₂ : Doc ih₁ : ∀ {c i : ℕ } {s : String },
Render d₁ c i { fst := s , rst := [] } →
∃ cost y ,
MeasRender F d₁ c i { last := c + String.length s , cost := cost , doc := d₁ , x := c + String.length s , y := y } ih₂ : ∀ {c i : ℕ } {s : String },
Render d₂ c i { fst := s , rst := [] } →
∃ cost y ,
MeasRender F d₂ c i { last := c + String.length s , cost := cost , doc := d₂ , x := c + String.length s , y := y } c, i : ℕ s₁, s₂ : String h₁ : Render d₁ c i { fst := s₁ , rst := [] } h₂ : Render d₂ (c + String.length s₁ ) i { fst := s₂ , rst := [] } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁ c i { last := c + String.length s₁ , cost := cost₁ , doc := d₁ , x := c + String.length s₁ , y := y₁ } cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂ (c + String.length s₁ ) i
{ last := c + String.length s₁ + String.length s₂ , cost := cost₂ , doc := d₂ ,
x := c + String.length s₁ + String.length s₂ , y := y₂ } refl by
α : Type F : Factory α d₁, d₂ : Doc ih₁ : ∀ {c i : ℕ } {s : String },
Render d₁ c i { fst := s , rst := [] } →
∃ cost y ,
MeasRender F d₁ c i { last := c + String.length s , cost := cost , doc := d₁ , x := c + String.length s , y := y } ih₂ : ∀ {c i : ℕ } {s : String },
Render d₂ c i { fst := s , rst := [] } →
∃ cost y ,
MeasRender F d₂ c i { last := c + String.length s , cost := cost , doc := d₂ , x := c + String.length s , y := y } c, i : ℕ s₁, s₂ : String h₁ : Render d₁ c i { fst := s₁ , rst := [] } h₂ : Render d₂ (c + String.length s₁ ) i { fst := s₂ , rst := [] } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁ c i { last := c + String.length s₁ , cost := cost₁ , doc := d₁ , x := c + String.length s₁ , y := y₁ } cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂ (c + String.length s₁ ) i
{ last := c + String.length s₁ + String.length s₂ , cost := cost₂ , doc := d₂ ,
x := c + String.length s₁ + String.length s₂ , y := y₂ } { last := c + String.length (s₁ ++ s₂ ) , cost := Factory.concat F cost₁ cost₂ , doc := Doc.concat d₁ d₂ ,
x := c + String.length (s₁ ++ s₂ ) , y := max y₁ y₂ } = Meas.concat F { last := c + String.length s₁ , cost := cost₁ , doc := d₁ , x := c + String.length s₁ , y := y₁ }
{ last := c + String.length s₁ + String.length s₂ , cost := cost₂ , doc := d₂ ,
x := c + String.length s₁ + String.length s₂ , y := y₂ } simp_arith [ Meas.concat : {α : Type } → Factory α → Meas → Meas → Meas Meas.concat]
α : Type F : Factory α d₁, d₂ : Doc ih₁ : ∀ {c i : ℕ } {s : String },
Render d₁ c i { fst := s , rst := [] } →
∃ cost y ,
MeasRender F d₁ c i { last := c + String.length s , cost := cost , doc := d₁ , x := c + String.length s , y := y } ih₂ : ∀ {c i : ℕ } {s : String },
Render d₂ c i { fst := s , rst := [] } →
∃ cost y ,
MeasRender F d₂ c i { last := c + String.length s , cost := cost , doc := d₂ , x := c + String.length s , y := y } c, i : ℕ s, s₁, s₂ : String ts✝ : List String h₁ : Render d₁ c i { fst := s₁ , rst := [] } h₂ : Render d₂ (c + String.length s₁ ) i { fst := s₂ , rst := ts✝ } h_layout : { fst := s , rst := [] } = { fst := s₁ ++ s₂ , rst := ts✝ } dwi { α : Type F : Factory α d₁, d₂ : Doc ih₁ : ∀ {c i : ℕ } {s : String },
Render d₁ c i { fst := s , rst := [] } →
∃ cost y ,
MeasRender F d₁ c i { last := c + String.length s , cost := cost , doc := d₁ , x := c + String.length s , y := y } ih₂ : ∀ {c i : ℕ } {s : String },
Render d₂ c i { fst := s , rst := [] } →
∃ cost y ,
MeasRender F d₂ c i { last := c + String.length s , cost := cost , doc := d₂ , x := c + String.length s , y := y } c, i : ℕ s₁, s₂ : String h₁ : Render d₁ c i { fst := s₁ , rst := [] } h₂ : Render d₂ (c + String.length s₁ ) i { fst := s₂ , rst := [] } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁ c i { last := c + String.length s₁ , cost := cost₁ , doc := d₁ , x := c + String.length s₁ , y := y₁ } cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂ (c + String.length s₁ ) i
{ last := c + String.length s₁ + String.length s₂ , cost := cost₂ , doc := d₂ ,
x := c + String.length s₁ + String.length s₂ , y := y₂ } h_ans : { last := c + String.length (s₁ ++ s₂ ) , cost := Factory.concat F cost₁ cost₂ , doc := Doc.concat d₁ d₂ ,
x := c + String.length (s₁ ++ s₂ ) , y := max y₁ y₂ } = Meas.concat F { last := c + String.length s₁ , cost := cost₁ , doc := d₁ , x := c + String.length s₁ , y := y₁ }
{ last := c + String.length s₁ + String.length s₂ , cost := cost₂ , doc := d₂ ,
x := c + String.length s₁ + String.length s₂ , y := y₂ } refl constructor α : Type F : Factory α d₁, d₂ : Doc ih₁ : ∀ {c i : ℕ } {s : String },
Render d₁ c i { fst := s , rst := [] } →
∃ cost y ,
MeasRender F d₁ c i { last := c + String.length s , cost := cost , doc := d₁ , x := c + String.length s , y := y } ih₂ : ∀ {c i : ℕ } {s : String },
Render d₂ c i { fst := s , rst := [] } →
∃ cost y ,
MeasRender F d₂ c i { last := c + String.length s , cost := cost , doc := d₂ , x := c + String.length s , y := y } c, i : ℕ s₁, s₂ : String h₁ : Render d₁ c i { fst := s₁ , rst := [] } h₂ : Render d₂ (c + String.length s₁ ) i { fst := s₂ , rst := [] } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁ c i { last := c + String.length s₁ , cost := cost₁ , doc := d₁ , x := c + String.length s₁ , y := y₁ } cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂ (c + String.length s₁ ) i
{ last := c + String.length s₁ + String.length s₂ , cost := cost₂ , doc := d₂ ,
x := c + String.length s₁ + String.length s₂ , y := y₂ } h_ans : { last := c + String.length (s₁ ++ s₂ ) , cost := Factory.concat F cost₁ cost₂ , doc := Doc.concat d₁ d₂ ,
x := c + String.length (s₁ ++ s₂ ) , y := max y₁ y₂ } = Meas.concat F { last := c + String.length s₁ , cost := cost₁ , doc := d₁ , x := c + String.length s₁ , y := y₁ }
{ last := c + String.length s₁ + String.length s₂ , cost := cost₂ , doc := d₂ ,
x := c + String.length s₁ + String.length s₂ , y := y₂ } refl.h₁ α : Type F : Factory α d₁, d₂ : Doc ih₁ : ∀ {c i : ℕ } {s : String },
Render d₁ c i { fst := s , rst := [] } →
∃ cost y ,
MeasRender F d₁ c i { last := c + String.length s , cost := cost , doc := d₁ , x := c + String.length s , y := y } ih₂ : ∀ {c i : ℕ } {s : String },
Render d₂ c i { fst := s , rst := [] } →
∃ cost y ,
MeasRender F d₂ c i { last := c + String.length s , cost := cost , doc := d₂ , x := c + String.length s , y := y } c, i : ℕ s₁, s₂ : String h₁ : Render d₁ c i { fst := s₁ , rst := [] } h₂ : Render d₂ (c + String.length s₁ ) i { fst := s₂ , rst := [] } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁ c i { last := c + String.length s₁ , cost := cost₁ , doc := d₁ , x := c + String.length s₁ , y := y₁ } cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂ (c + String.length s₁ ) i
{ last := c + String.length s₁ + String.length s₂ , cost := cost₂ , doc := d₂ ,
x := c + String.length s₁ + String.length s₂ , y := y₂ } h_ans : { last := c + String.length (s₁ ++ s₂ ) , cost := Factory.concat F cost₁ cost₂ , doc := Doc.concat d₁ d₂ ,
x := c + String.length (s₁ ++ s₂ ) , y := max y₁ y₂ } = Meas.concat F { last := c + String.length s₁ , cost := cost₁ , doc := d₁ , x := c + String.length s₁ , y := y₁ }
{ last := c + String.length s₁ + String.length s₂ , cost := cost₂ , doc := d₂ ,
x := c + String.length s₁ + String.length s₂ , y := y₂ } refl.h₂ α : Type F : Factory α d₁, d₂ : Doc ih₁ : ∀ {c i : ℕ } {s : String },
Render d₁ c i { fst := s , rst := [] } →
∃ cost y ,
MeasRender F d₁ c i { last := c + String.length s , cost := cost , doc := d₁ , x := c + String.length s , y := y } ih₂ : ∀ {c i : ℕ } {s : String },
Render d₂ c i { fst := s , rst := [] } →
∃ cost y ,
MeasRender F d₂ c i { last := c + String.length s , cost := cost , doc := d₂ , x := c + String.length s , y := y } c, i : ℕ s₁, s₂ : String h₁ : Render d₁ c i { fst := s₁ , rst := [] } h₂ : Render d₂ (c + String.length s₁ ) i { fst := s₂ , rst := [] } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁ c i { last := c + String.length s₁ , cost := cost₁ , doc := d₁ , x := c + String.length s₁ , y := y₁ } cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂ (c + String.length s₁ ) i
{ last := c + String.length s₁ + String.length s₂ , cost := cost₂ , doc := d₂ ,
x := c + String.length s₁ + String.length s₂ , y := y₂ } h_ans : { last := c + String.length (s₁ ++ s₂ ) , cost := Factory.concat F cost₁ cost₂ , doc := Doc.concat d₁ d₂ ,
x := c + String.length (s₁ ++ s₂ ) , y := max y₁ y₂ } = Meas.concat F { last := c + String.length s₁ , cost := cost₁ , doc := d₁ , x := c + String.length s₁ , y := y₁ }
{ last := c + String.length s₁ + String.length s₂ , cost := cost₂ , doc := d₂ ,
x := c + String.length s₁ + String.length s₂ , y := y₂ } refl.h α : Type F : Factory α d₁, d₂ : Doc ih₁ : ∀ {c i : ℕ } {s : String },
Render d₁ c i { fst := s , rst := [] } →
∃ cost y ,
MeasRender F d₁ c i { last := c + String.length s , cost := cost , doc := d₁ , x := c + String.length s , y := y } ih₂ : ∀ {c i : ℕ } {s : String },
Render d₂ c i { fst := s , rst := [] } →
∃ cost y ,
MeasRender F d₂ c i { last := c + String.length s , cost := cost , doc := d₂ , x := c + String.length s , y := y } c, i : ℕ s₁, s₂ : String h₁ : Render d₁ c i { fst := s₁ , rst := [] } h₂ : Render d₂ (c + String.length s₁ ) i { fst := s₂ , rst := [] } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁ c i { last := c + String.length s₁ , cost := cost₁ , doc := d₁ , x := c + String.length s₁ , y := y₁ } cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂ (c + String.length s₁ ) i
{ last := c + String.length s₁ + String.length s₂ , cost := cost₂ , doc := d₂ ,
x := c + String.length s₁ + String.length s₂ , y := y₂ } h_ans : { last := c + String.length (s₁ ++ s₂ ) , cost := Factory.concat F cost₁ cost₂ , doc := Doc.concat d₁ d₂ ,
x := c + String.length (s₁ ++ s₂ ) , y := max y₁ y₂ } = Meas.concat F { last := c + String.length s₁ , cost := cost₁ , doc := d₁ , x := c + String.length s₁ , y := y₁ }
{ last := c + String.length s₁ + String.length s₂ , cost := cost₂ , doc := d₂ ,
x := c + String.length s₁ + String.length s₂ , y := y₂ } refl.m₁ Meas
α : Type F : Factory α d₁, d₂ : Doc ih₁ : ∀ {c i : ℕ } {s : String },
Render d₁ c i { fst := s , rst := [] } →
∃ cost y ,
MeasRender F d₁ c i { last := c + String.length s , cost := cost , doc := d₁ , x := c + String.length s , y := y } ih₂ : ∀ {c i : ℕ } {s : String },
Render d₂ c i { fst := s , rst := [] } →
∃ cost y ,
MeasRender F d₂ c i { last := c + String.length s , cost := cost , doc := d₂ , x := c + String.length s , y := y } c, i : ℕ s₁, s₂ : String h₁ : Render d₁ c i { fst := s₁ , rst := [] } h₂ : Render d₂ (c + String.length s₁ ) i { fst := s₂ , rst := [] } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁ c i { last := c + String.length s₁ , cost := cost₁ , doc := d₁ , x := c + String.length s₁ , y := y₁ } cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂ (c + String.length s₁ ) i
{ last := c + String.length s₁ + String.length s₂ , cost := cost₂ , doc := d₂ ,
x := c + String.length s₁ + String.length s₂ , y := y₂ } h_ans : { last := c + String.length (s₁ ++ s₂ ) , cost := Factory.concat F cost₁ cost₂ , doc := Doc.concat d₁ d₂ ,
x := c + String.length (s₁ ++ s₂ ) , y := max y₁ y₂ } = Meas.concat F { last := c + String.length s₁ , cost := cost₁ , doc := d₁ , x := c + String.length s₁ , y := y₁ }
{ last := c + String.length s₁ + String.length s₂ , cost := cost₂ , doc := d₂ ,
x := c + String.length s₁ + String.length s₂ , y := y₂ } refl.m₂ Meas
}
α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String },
Render d₁✝ c i { fst := s , rst := [] } →
∃ cost y ,
MeasRender F d₁✝ c i { last := c + String.length s , cost := cost , doc := d₁✝ , x := c + String.length s , y := y } ih₂ : ∀ {c i : ℕ } {s : String },
Render d₂✝ c i { fst := s , rst := [] } →
∃ cost y ,
MeasRender F d₂✝ c i { last := c + String.length s , cost := cost , doc := d₂✝ , x := c + String.length s , y := y } c, i : ℕ s : String h_render : Render (Doc.concat d₁✝ d₂✝ ) c i { fst := s , rst := [] } case concat_multi =>
α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String },
Render d₁✝ c i { fst := s , rst := [] } →
∃ cost y ,
MeasRender F d₁✝ c i { last := c + String.length s , cost := cost , doc := d₁✝ , x := c + String.length s , y := y } ih₂ : ∀ {c i : ℕ } {s : String },
Render d₂✝ c i { fst := s , rst := [] } →
∃ cost y ,
MeasRender F d₂✝ c i { last := c + String.length s , cost := cost , doc := d₂✝ , x := c + String.length s , y := y } c, i : ℕ s : String ss✝ : List String slast✝, s✝, t✝ : String ts✝ : List String h_non_empty✝ : ss✝ ≠ [] h_last✝ : slast✝ = List.getLast ss✝ h_non_empty✝ h₂✝ : Render d₂✝ (String.length slast✝ ) i { fst := t✝ , rst := ts✝ } h₁✝ : Render d₁✝ c i { fst := s✝ , rst := ss✝ } h_layout : { fst := s , rst := [] } = { fst := s✝ , rst := List.dropLast ss✝ ++ [slast✝ ++ t✝ ] ++ ts✝ } injection h_layout : { fst := s , rst := [] } = { fst := s✝ , rst := List.dropLast ss✝ ++ [slast✝ ++ t✝ ] ++ ts✝ } h_layout α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String },
Render d₁✝ c i { fst := s , rst := [] } →
∃ cost y ,
MeasRender F d₁✝ c i { last := c + String.length s , cost := cost , doc := d₁✝ , x := c + String.length s , y := y } ih₂ : ∀ {c i : ℕ } {s : String },
Render d₂✝ c i { fst := s , rst := [] } →
∃ cost y ,
MeasRender F d₂✝ c i { last := c + String.length s , cost := cost , doc := d₂✝ , x := c + String.length s , y := y } c, i : ℕ s : String ss✝ : List String slast✝, s✝, t✝ : String ts✝ : List String h_non_empty✝ : ss✝ ≠ [] h_last✝ : slast✝ = List.getLast ss✝ h_non_empty✝ h₂✝ : Render d₂✝ (String.length slast✝ ) i { fst := t✝ , rst := ts✝ } h₁✝ : Render d₁✝ c i { fst := s✝ , rst := ss✝ } fst_eq✝ : s = s✝ rst_eq✝ : [] = List.dropLast ss✝ ++ [slast✝ ++ t✝ ] ++ ts✝
α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String },
Render d₁✝ c i { fst := s , rst := [] } →
∃ cost y ,
MeasRender F d₁✝ c i { last := c + String.length s , cost := cost , doc := d₁✝ , x := c + String.length s , y := y } ih₂ : ∀ {c i : ℕ } {s : String },
Render d₂✝ c i { fst := s , rst := [] } →
∃ cost y ,
MeasRender F d₂✝ c i { last := c + String.length s , cost := cost , doc := d₂✝ , x := c + String.length s , y := y } c, i : ℕ s : String ss✝ : List String slast✝, s✝, t✝ : String ts✝ : List String h_non_empty✝ : ss✝ ≠ [] h_last✝ : slast✝ = List.getLast ss✝ h_non_empty✝ h₂✝ : Render d₂✝ (String.length slast✝ ) i { fst := t✝ , rst := ts✝ } h₁✝ : Render d₁✝ c i { fst := s✝ , rst := ss✝ } h_layout : { fst := s , rst := [] } = { fst := s✝ , rst := List.dropLast ss✝ ++ [slast✝ ++ t✝ ] ++ ts✝ } simp at *
case choice =>
α : Type F : Factory α d₁✝, d₂✝ : Doc d₁_ih✝ : ∀ {c i : ℕ } {s : String },
Render d₁✝ c i { fst := s , rst := [] } →
∃ cost y ,
MeasRender F d₁✝ c i { last := c + String.length s , cost := cost , doc := d₁✝ , x := c + String.length s , y := y } d₂_ih✝ : ∀ {c i : ℕ } {s : String },
Render d₂✝ c i { fst := s , rst := [] } →
∃ cost y ,
MeasRender F d₂✝ c i { last := c + String.length s , cost := cost , doc := d₂✝ , x := c + String.length s , y := y } c, i : ℕ s : String h_render : Render (Doc.choice d₁✝ d₂✝ ) c i { fst := s , rst := [] } cases h_render
/--
Correctness of the measure computation relation
when it results in multiple lines (second part of Theorem 5.3)
-/
theorem MeasRender_multi_correct ( F : Factory α )
( h_render : Render d c i { fst := s , rst := ss } h_render : Render d c i ⟨ s , ss ⟩) ( h_non_empty : ss ≠ [] ) :
∃ cost y , MeasRender F d c i ⟨( List.getLast : {α : Type ?u.28279} → (as : List α ) → as ≠ [] → α List.getLast ss h_non_empty ). length ,
cost , d ,
Layout.max_with_offset c ⟨ s , ss ⟩, y ⟩ := by
induction d generalizing c i s ss text nl α : Type F : Factory α d₁✝, d₂✝ : Doc d₁_ih✝ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } d₂_ih✝ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String h_render : Render (Doc.concat d₁✝ d₂✝ ) c i { fst := s , rst := ss } h_non_empty : ss ≠ [] concat α : Type F : Factory α n✝ : ℕ d✝ : Doc d_ih✝ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String h_render : Render (Doc.nest n✝ d✝ ) c i { fst := s , rst := ss } h_non_empty : ss ≠ [] nest α : Type F : Factory α d✝ : Doc d_ih✝ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String h_render : Render (Doc.align d✝ ) c i { fst := s , rst := ss } h_non_empty : ss ≠ [] align α : Type F : Factory α d₁✝, d₂✝ : Doc d₁_ih✝ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } d₂_ih✝ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String h_render : Render (Doc.choice d₁✝ d₂✝ ) c i { fst := s , rst := ss } h_non_empty : ss ≠ [] choice
case text =>
cases h_render
simp at h_non_empty
case nl =>
exists F . nl i , i
cases h_render
simp only [
String.length , List.asString , ne_eq : ∀ {α : Sort ?u.29442} (a b : α ), (a ≠ b ) = ¬ a = b ne_eq, List.getLast_singleton' : ∀ {α : Type ?u.29451} (a : α ), List.getLast [a ] (_ : [a ] ≠ [] ) = a List.getLast_singleton',
List.length_replicate , Layout.max_with_offset , List.length_nil ,
add_zero , List.foldl : {α : Type ?u.29501} → {β : Type ?u.29500} → (α → β → α ) → α → List β → α List.foldl, ge_iff_le : ∀ {α : Type ?u.29953} [inst : LE α ] {a b : α }, a ≥ b ↔ b ≤ a ge_iff_le, nonpos_iff_eq_zero , zero_le ,
max_eq_right
]
constructor
case nest ih =>
α : Type F : Factory α n✝ : ℕ d✝ : Doc ih : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String h_render : Render (Doc.nest n✝ d✝ ) c i { fst := s , rst := ss } h_non_empty : ss ≠ [] cases h_render α : Type F : Factory α n✝ : ℕ d✝ : Doc ih : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String h_non_empty : ss ≠ [] h✝ : Render d✝ c (i + n✝ ) { fst := s , rst := ss } nest
α : Type F : Factory α n✝ : ℕ d✝ : Doc ih : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String h_render : Render (Doc.nest n✝ d✝ ) c i { fst := s , rst := ss } h_non_empty : ss ≠ [] rename_i h : Render d✝ c (i + n✝ ) { fst := s , rst := ss } h α : Type F : Factory α n✝ : ℕ d✝ : Doc ih : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String h_non_empty : ss ≠ [] h : Render d✝ c (i + n✝ ) { fst := s , rst := ss } nest
α : Type F : Factory α n✝ : ℕ d✝ : Doc ih : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String h_render : Render (Doc.nest n✝ d✝ ) c i { fst := s , rst := ss } h_non_empty : ss ≠ [] let ⟨ cost , ⟨ y , _⟩⟩ := ih h : Render d✝ c (i + n✝ ) { fst := s , rst := ss } h h_non_empty α : Type F : Factory α n✝ : ℕ d✝ : Doc ih : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String h_non_empty : ss ≠ [] h : Render d✝ c (i + n✝ ) { fst := s , rst := ss } cost : α y : ℕ h✝ : MeasRender F d✝ c (i + n✝ )
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } nest
α : Type F : Factory α n✝ : ℕ d✝ : Doc ih : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String h_render : Render (Doc.nest n✝ d✝ ) c i { fst := s , rst := ss } h_non_empty : ss ≠ [] exists cost , y α : Type F : Factory α n✝ : ℕ d✝ : Doc ih : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String h_non_empty : ss ≠ [] h : Render d✝ c (i + n✝ ) { fst := s , rst := ss } cost : α y : ℕ h✝ : MeasRender F d✝ c (i + n✝ )
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } nest
α : Type F : Factory α n✝ : ℕ d✝ : Doc ih : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String h_render : Render (Doc.nest n✝ d✝ ) c i { fst := s , rst := ss } h_non_empty : ss ≠ [] constructor α : Type F : Factory α n✝ : ℕ d✝ : Doc ih : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String h_non_empty : ss ≠ [] h : Render d✝ c (i + n✝ ) { fst := s , rst := ss } cost : α y : ℕ h✝ : MeasRender F d✝ c (i + n✝ )
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } nest.h
α : Type F : Factory α n✝ : ℕ d✝ : Doc ih : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String h_render : Render (Doc.nest n✝ d✝ ) c i { fst := s , rst := ss } h_non_empty : ss ≠ [] assumption
case align ih =>
α : Type F : Factory α d✝ : Doc ih : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String h_render : Render (Doc.align d✝ ) c i { fst := s , rst := ss } h_non_empty : ss ≠ [] cases h_render α : Type F : Factory α d✝ : Doc ih : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String h_non_empty : ss ≠ [] h✝ : Render d✝ c c { fst := s , rst := ss } align
α : Type F : Factory α d✝ : Doc ih : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String h_render : Render (Doc.align d✝ ) c i { fst := s , rst := ss } h_non_empty : ss ≠ [] rename_i h : Render d✝ c c { fst := s , rst := ss } h α : Type F : Factory α d✝ : Doc ih : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String h_non_empty : ss ≠ [] h : Render d✝ c c { fst := s , rst := ss } align
α : Type F : Factory α d✝ : Doc ih : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String h_render : Render (Doc.align d✝ ) c i { fst := s , rst := ss } h_non_empty : ss ≠ [] let ⟨ cost , ⟨ y , _⟩⟩ := ih h : Render d✝ c c { fst := s , rst := ss } h h_non_empty α : Type F : Factory α d✝ : Doc ih : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String h_non_empty : ss ≠ [] h : Render d✝ c c { fst := s , rst := ss } cost : α y : ℕ h✝ : MeasRender F d✝ c c
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } align
α : Type F : Factory α d✝ : Doc ih : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String h_render : Render (Doc.align d✝ ) c i { fst := s , rst := ss } h_non_empty : ss ≠ [] exists cost , ( max : {α : Type ?u.33046} → [self : Max α ] → α → α → α max i y ) α : Type F : Factory α d✝ : Doc ih : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String h_non_empty : ss ≠ [] h : Render d✝ c c { fst := s , rst := ss } cost : α y : ℕ h✝ : MeasRender F d✝ c c
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } align
α : Type F : Factory α d✝ : Doc ih : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String h_render : Render (Doc.align d✝ ) c i { fst := s , rst := ss } h_non_empty : ss ≠ [] constructor α : Type F : Factory α d✝ : Doc ih : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String h_non_empty : ss ≠ [] h : Render d✝ c c { fst := s , rst := ss } cost : α y : ℕ h✝ : MeasRender F d✝ c c
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } align.h
α : Type F : Factory α d✝ : Doc ih : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String h_render : Render (Doc.align d✝ ) c i { fst := s , rst := ss } h_non_empty : ss ≠ [] assumption
case choice => α : Type F : Factory α d₁✝, d₂✝ : Doc d₁_ih✝ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } d₂_ih✝ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String h_render : Render (Doc.choice d₁✝ d₂✝ ) c i { fst := s , rst := ss } h_non_empty : ss ≠ [] cases h_render
case concat ih₁ ih₂ =>
α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String h_render : Render (Doc.concat d₁✝ d₂✝ ) c i { fst := s , rst := ss } h_non_empty : ss ≠ [] cases h_render α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ ss : List String h_non_empty : ss ≠ [] s✝, t✝ : String h₁✝ : Render d₁✝ c i { fst := s✝ , rst := [] } h₂✝ : Render d₂✝ (c + String.length s✝ ) i { fst := t✝ , rst := ss } concat_one α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss✝ : List String slast✝, t✝ : String ts✝ : List String h_non_empty✝ : ss✝ ≠ [] h_last✝ : slast✝ = List.getLast ss✝ h_non_empty✝ h₂✝ : Render d₂✝ (String.length slast✝ ) i { fst := t✝ , rst := ts✝ } h₁✝ : Render d₁✝ c i { fst := s , rst := ss✝ } h_non_empty : List.dropLast ss✝ ++ [slast✝ ++ t✝ ] ++ ts✝ ≠ [] concat_multi
α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String h_render : Render (Doc.concat d₁✝ d₂✝ ) c i { fst := s , rst := ss } h_non_empty : ss ≠ [] case concat_one s t h₁ : Render d₁✝ c i { fst := s , rst := [] } h₁ h₂ =>
α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ ss : List String h_non_empty : ss ≠ [] s, t : String h₁ : Render d₁✝ c i { fst := s , rst := [] } h₂ : Render d₂✝ (c + String.length s ) i { fst := t , rst := ss } let ⟨ cost₁ , ⟨ y₁ , _⟩⟩ := MeasRender_single_correct F h₁ : Render d₁✝ c i { fst := s , rst := [] } h₁ α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ ss : List String h_non_empty : ss ≠ [] s, t : String h₁ : Render d₁✝ c i { fst := s , rst := [] } h₂ : Render d₂✝ (c + String.length s ) i { fst := t , rst := ss } cost₁ : α y₁ : ℕ h✝ : MeasRender F d₁✝ c i { last := c + String.length s , cost := cost₁ , doc := d₁✝ , x := c + String.length s , y := y₁ }
α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ ss : List String h_non_empty : ss ≠ [] s, t : String h₁ : Render d₁✝ c i { fst := s , rst := [] } h₂ : Render d₂✝ (c + String.length s ) i { fst := t , rst := ss } let ⟨ cost₂ , ⟨ y₂ , _⟩⟩ := ih₂ h₂ h_non_empty α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ ss : List String h_non_empty : ss ≠ [] s, t : String h₁ : Render d₁✝ c i { fst := s , rst := [] } h₂ : Render d₂✝ (c + String.length s ) i { fst := t , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i { last := c + String.length s , cost := cost₁ , doc := d₁✝ , x := c + String.length s , y := y₁ } cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (c + String.length s ) i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost₂ , doc := d₂✝ ,
x := Layout.max_with_offset (c + String.length s ) { fst := t , rst := ss } , y := y₂ }
α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ ss : List String h_non_empty : ss ≠ [] s, t : String h₁ : Render d₁✝ c i { fst := s , rst := [] } h₂ : Render d₂✝ (c + String.length s ) i { fst := t , rst := ss } exists F . concat cost₁ cost₂ , max : {α : Type ?u.35617} → [self : Max α ] → α → α → α max y₁ y₂ α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ ss : List String h_non_empty : ss ≠ [] s, t : String h₁ : Render d₁✝ c i { fst := s , rst := [] } h₂ : Render d₂✝ (c + String.length s ) i { fst := t , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i { last := c + String.length s , cost := cost₁ , doc := d₁✝ , x := c + String.length s , y := y₁ } cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (c + String.length s ) i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost₂ , doc := d₂✝ ,
x := Layout.max_with_offset (c + String.length s ) { fst := t , rst := ss } , y := y₂ }
α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ ss : List String h_non_empty : ss ≠ [] s, t : String h₁ : Render d₁✝ c i { fst := s , rst := [] } h₂ : Render d₂✝ (c + String.length s ) i { fst := t , rst := ss } have h_x : Layout.max_with_offset c ⟨ s ++ t , ss ⟩ =
max : {α : Type ?u.38128} → [self : Max α ] → α → α → α max ( c + s . length ) ( Layout.max_with_offset ( c + s . length ) ⟨ t , ss ⟩) := α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ ss : List String h_non_empty : ss ≠ [] s, t : String h₁ : Render d₁✝ c i { fst := s , rst := [] } h₂ : Render d₂✝ (c + String.length s ) i { fst := t , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i { last := c + String.length s , cost := cost₁ , doc := d₁✝ , x := c + String.length s , y := y₁ } cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (c + String.length s ) i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost₂ , doc := d₂✝ ,
x := Layout.max_with_offset (c + String.length s ) { fst := t , rst := ss } , y := y₂ } by α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ ss : List String h_non_empty : ss ≠ [] s, t : String h₁ : Render d₁✝ c i { fst := s , rst := [] } h₂ : Render d₂✝ (c + String.length s ) i { fst := t , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i { last := c + String.length s , cost := cost₁ , doc := d₁✝ , x := c + String.length s , y := y₁ } cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (c + String.length s ) i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost₂ , doc := d₂✝ ,
x := Layout.max_with_offset (c + String.length s ) { fst := t , rst := ss } , y := y₂ } { α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ ss : List String h_non_empty : ss ≠ [] s, t : String h₁ : Render d₁✝ c i { fst := s , rst := [] } h₂ : Render d₂✝ (c + String.length s ) i { fst := t , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i { last := c + String.length s , cost := cost₁ , doc := d₁✝ , x := c + String.length s , y := y₁ } cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (c + String.length s ) i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost₂ , doc := d₂✝ ,
x := Layout.max_with_offset (c + String.length s ) { fst := t , rst := ss } , y := y₂ }
α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ ss : List String h_non_empty : ss ≠ [] s, t : String h₁ : Render d₁✝ c i { fst := s , rst := [] } h₂ : Render d₂✝ (c + String.length s ) i { fst := t , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i { last := c + String.length s , cost := cost₁ , doc := d₁✝ , x := c + String.length s , y := y₁ } cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (c + String.length s ) i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost₂ , doc := d₂✝ ,
x := Layout.max_with_offset (c + String.length s ) { fst := t , rst := ss } , y := y₂ } simp [ Layout.max_with_offset , String.length , String.append , Nat.add_assoc : ∀ (n m k : ℕ ), n + m + k = n + (m + k ) Nat.add_assoc]
}
α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ ss : List String h_non_empty : ss ≠ [] s, t : String h₁ : Render d₁✝ c i { fst := s , rst := [] } h₂ : Render d₂✝ (c + String.length s ) i { fst := t , rst := ss } rw [ α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ ss : List String h_non_empty : ss ≠ [] s, t : String h₁ : Render d₁✝ c i { fst := s , rst := [] } h₂ : Render d₂✝ (c + String.length s ) i { fst := t , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i { last := c + String.length s , cost := cost₁ , doc := d₁✝ , x := c + String.length s , y := y₁ } cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (c + String.length s ) i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost₂ , doc := d₂✝ ,
x := Layout.max_with_offset (c + String.length s ) { fst := t , rst := ss } , y := y₂ } h_x : Layout.max_with_offset c { fst := s ++ t , rst := ss } = max (c + String.length s ) (Layout.max_with_offset (c + String.length s ) { fst := t , rst := ss } )h_x α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ ss : List String h_non_empty : ss ≠ [] s, t : String h₁ : Render d₁✝ c i { fst := s , rst := [] } h₂ : Render d₂✝ (c + String.length s ) i { fst := t , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i { last := c + String.length s , cost := cost₁ , doc := d₁✝ , x := c + String.length s , y := y₁ } cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (c + String.length s ) i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost₂ , doc := d₂✝ ,
x := Layout.max_with_offset (c + String.length s ) { fst := t , rst := ss } , y := y₂ } h_x : Layout.max_with_offset c { fst := s ++ t , rst := ss } = max (c + String.length s ) (Layout.max_with_offset (c + String.length s ) { fst := t , rst := ss } )] α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ ss : List String h_non_empty : ss ≠ [] s, t : String h₁ : Render d₁✝ c i { fst := s , rst := [] } h₂ : Render d₂✝ (c + String.length s ) i { fst := t , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i { last := c + String.length s , cost := cost₁ , doc := d₁✝ , x := c + String.length s , y := y₁ } cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (c + String.length s ) i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost₂ , doc := d₂✝ ,
x := Layout.max_with_offset (c + String.length s ) { fst := t , rst := ss } , y := y₂ } h_x : Layout.max_with_offset c { fst := s ++ t , rst := ss } = max (c + String.length s ) (Layout.max_with_offset (c + String.length s ) { fst := t , rst := ss } )
α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ ss : List String h_non_empty : ss ≠ [] s, t : String h₁ : Render d₁✝ c i { fst := s , rst := [] } h₂ : Render d₂✝ (c + String.length s ) i { fst := t , rst := ss } dwi { α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ ss : List String h_non_empty : ss ≠ [] s, t : String h₁ : Render d₁✝ c i { fst := s , rst := [] } h₂ : Render d₂✝ (c + String.length s ) i { fst := t , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i { last := c + String.length s , cost := cost₁ , doc := d₁✝ , x := c + String.length s , y := y₁ } cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (c + String.length s ) i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost₂ , doc := d₂✝ ,
x := Layout.max_with_offset (c + String.length s ) { fst := t , rst := ss } , y := y₂ } h_x : Layout.max_with_offset c { fst := s ++ t , rst := ss } = max (c + String.length s ) (Layout.max_with_offset (c + String.length s ) { fst := t , rst := ss } )apply MeasRender.concat α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ ss : List String h_non_empty : ss ≠ [] s, t : String h₁ : Render d₁✝ c i { fst := s , rst := [] } h₂ : Render d₂✝ (c + String.length s ) i { fst := t , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i { last := c + String.length s , cost := cost₁ , doc := d₁✝ , x := c + String.length s , y := y₁ } cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (c + String.length s ) i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost₂ , doc := d₂✝ ,
x := Layout.max_with_offset (c + String.length s ) { fst := t , rst := ss } , y := y₂ } h_x : Layout.max_with_offset c { fst := s ++ t , rst := ss } = max (c + String.length s ) (Layout.max_with_offset (c + String.length s ) { fst := t , rst := ss } )h₁ α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ ss : List String h_non_empty : ss ≠ [] s, t : String h₁ : Render d₁✝ c i { fst := s , rst := [] } h₂ : Render d₂✝ (c + String.length s ) i { fst := t , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i { last := c + String.length s , cost := cost₁ , doc := d₁✝ , x := c + String.length s , y := y₁ } cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (c + String.length s ) i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost₂ , doc := d₂✝ ,
x := Layout.max_with_offset (c + String.length s ) { fst := t , rst := ss } , y := y₂ } h_x : Layout.max_with_offset c { fst := s ++ t , rst := ss } = max (c + String.length s ) (Layout.max_with_offset (c + String.length s ) { fst := t , rst := ss } )h₂ α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ ss : List String h_non_empty : ss ≠ [] s, t : String h₁ : Render d₁✝ c i { fst := s , rst := [] } h₂ : Render d₂✝ (c + String.length s ) i { fst := t , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i { last := c + String.length s , cost := cost₁ , doc := d₁✝ , x := c + String.length s , y := y₁ } cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (c + String.length s ) i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost₂ , doc := d₂✝ ,
x := Layout.max_with_offset (c + String.length s ) { fst := t , rst := ss } , y := y₂ } h_x : Layout.max_with_offset c { fst := s ++ t , rst := ss } = max (c + String.length s ) (Layout.max_with_offset (c + String.length s ) { fst := t , rst := ss } )h α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ ss : List String h_non_empty : ss ≠ [] s, t : String h₁ : Render d₁✝ c i { fst := s , rst := [] } h₂ : Render d₂✝ (c + String.length s ) i { fst := t , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i { last := c + String.length s , cost := cost₁ , doc := d₁✝ , x := c + String.length s , y := y₁ } cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (c + String.length s ) i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost₂ , doc := d₂✝ ,
x := Layout.max_with_offset (c + String.length s ) { fst := t , rst := ss } , y := y₂ } h_x : Layout.max_with_offset c { fst := s ++ t , rst := ss } = max (c + String.length s ) (Layout.max_with_offset (c + String.length s ) { fst := t , rst := ss } )m₁ Meas
α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ ss : List String h_non_empty : ss ≠ [] s, t : String h₁ : Render d₁✝ c i { fst := s , rst := [] } h₂ : Render d₂✝ (c + String.length s ) i { fst := t , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i { last := c + String.length s , cost := cost₁ , doc := d₁✝ , x := c + String.length s , y := y₁ } cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (c + String.length s ) i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost₂ , doc := d₂✝ ,
x := Layout.max_with_offset (c + String.length s ) { fst := t , rst := ss } , y := y₂ } h_x : Layout.max_with_offset c { fst := s ++ t , rst := ss } = max (c + String.length s ) (Layout.max_with_offset (c + String.length s ) { fst := t , rst := ss } )m₂ Meas
}
α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String h_render : Render (Doc.concat d₁✝ d₂✝ ) c i { fst := s , rst := ss } h_non_empty : ss ≠ [] case concat_multi ss slast t ts _ h_last h₂ h₁ : Render d₁✝ c i { fst := s , rst := ss } h₁ =>
α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String ts : List String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := ts } h₁ : Render d₁✝ c i { fst := s , rst := ss } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ ts ≠ [] let ⟨ cost₁ , ⟨ y₁ , _⟩⟩ := ih₁ h₁ : Render d₁✝ c i { fst := s , rst := ss } h₁ ( α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String ts : List String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := ts } h₁ : Render d₁✝ c i { fst := s , rst := ss } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ ts ≠ [] by α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String ts : List String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := ts } h₁ : Render d₁✝ c i { fst := s , rst := ss } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ ts ≠ [] assumption ) α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String ts : List String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := ts } h₁ : Render d₁✝ c i { fst := s , rst := ss } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ ts ≠ [] cost₁ : α y₁ : ℕ h✝ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ }
α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String ts : List String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := ts } h₁ : Render d₁✝ c i { fst := s , rst := ss } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ ts ≠ [] have h_droplast : List.map String.length ss =
List.map String.length
( List.dropLast ss ++ [ List.getLast : {α : Type ?u.59423} → (as : List α ) → as ≠ [] → α List.getLast ss ( α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String ts : List String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := ts } h₁ : Render d₁✝ c i { fst := s , rst := ss } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ ts ≠ [] cost₁ : α y₁ : ℕ h✝ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } by α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String ts : List String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := ts } h₁ : Render d₁✝ c i { fst := s , rst := ss } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ ts ≠ [] cost₁ : α y₁ : ℕ h✝ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } assumption )]) := α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String ts : List String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := ts } h₁ : Render d₁✝ c i { fst := s , rst := ss } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ ts ≠ [] cost₁ : α y₁ : ℕ h✝ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } by
α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String ts : List String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := ts } h₁ : Render d₁✝ c i { fst := s , rst := ss } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ ts ≠ [] cost₁ : α y₁ : ℕ h✝ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } simp [ List.dropLast_append_getLast ]
α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String ts : List String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := ts } h₁ : Render d₁✝ c i { fst := s , rst := ss } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ ts ≠ [] cases ts α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := [] } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ [] ≠ [] nil α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )head✝ : String tail✝ : List String h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := head✝ :: tail✝ } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ head✝ :: tail✝ ≠ [] cons
α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String ts : List String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := ts } h₁ : Render d₁✝ c i { fst := s , rst := ss } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ ts ≠ [] case nil =>
α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := [] } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ [] ≠ [] let ⟨ cost₂ , ⟨ y₂ , _⟩⟩ := MeasRender_single_correct F h₂ α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := [] } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ [] ≠ [] cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (String.length slast ) i
{ last := String.length slast + String.length t , cost := cost₂ , doc := d₂✝ ,
x := String.length slast + String.length t , y := y₂ }
α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := [] } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ [] ≠ [] exists F . concat cost₁ cost₂ , max : {α : Type ?u.59969} → [self : Max α ] → α → α → α max y₁ y₂ α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := [] } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ [] ≠ [] cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (String.length slast ) i
{ last := String.length slast + String.length t , cost := cost₂ , doc := d₂✝ ,
x := String.length slast + String.length t , y := y₂ }
α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := [] } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ [] ≠ [] have h_x : Layout.max_with_offset c ⟨ s , List.dropLast ss ++ [ slast ++ t ] ++ [] ⟩ =
max : {α : Type ?u.62650} → [self : Max α ] → α → α → α max ( Layout.max_with_offset c ⟨ s , ss ⟩) ( slast . length + t . length ) := α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := [] } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ [] ≠ [] cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (String.length slast ) i
{ last := String.length slast + String.length t , cost := cost₂ , doc := d₂✝ ,
x := String.length slast + String.length t , y := y₂ } by α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := [] } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ [] ≠ [] cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (String.length slast ) i
{ last := String.length slast + String.length t , cost := cost₂ , doc := d₂✝ ,
x := String.length slast + String.length t , y := y₂ } { α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := [] } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ [] ≠ [] cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (String.length slast ) i
{ last := String.length slast + String.length t , cost := cost₂ , doc := d₂✝ ,
x := String.length slast + String.length t , y := y₂ }
α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := [] } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ [] ≠ [] cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (String.length slast ) i
{ last := String.length slast + String.length t , cost := cost₂ , doc := d₂✝ ,
x := String.length slast + String.length t , y := y₂ } simp [ Layout.max_with_offset ] α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := [] } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ [] ≠ [] cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (String.length slast ) i
{ last := String.length slast + String.length t , cost := cost₂ , doc := d₂✝ ,
x := String.length slast + String.length t , y := y₂ }
α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := [] } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ [] ≠ [] cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (String.length slast ) i
{ last := String.length slast + String.length t , cost := cost₂ , doc := d₂✝ ,
x := String.length slast + String.length t , y := y₂ } rw [ α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := [] } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ [] ≠ [] cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (String.length slast ) i
{ last := String.length slast + String.length t , cost := cost₂ , doc := d₂✝ ,
x := String.length slast + String.length t , y := y₂ } h_droplast , α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := [] } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ [] ≠ [] cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (String.length slast ) i
{ last := String.length slast + String.length t , cost := cost₂ , doc := d₂✝ ,
x := String.length slast + String.length t , y := y₂ } α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := [] } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ [] ≠ [] cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (String.length slast ) i
{ last := String.length slast + String.length t , cost := cost₂ , doc := d₂✝ ,
x := String.length slast + String.length t , y := y₂ } List.map_append , α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := [] } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ [] ≠ [] cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (String.length slast ) i
{ last := String.length slast + String.length t , cost := cost₂ , doc := d₂✝ ,
x := String.length slast + String.length t , y := y₂ } α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := [] } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ [] ≠ [] cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (String.length slast ) i
{ last := String.length slast + String.length t , cost := cost₂ , doc := d₂✝ ,
x := String.length slast + String.length t , y := y₂ } List.foldl_append α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := [] } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ [] ≠ [] cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (String.length slast ) i
{ last := String.length slast + String.length t , cost := cost₂ , doc := d₂✝ ,
x := String.length slast + String.length t , y := y₂ } ] α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := [] } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ [] ≠ [] cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (String.length slast ) i
{ last := String.length slast + String.length t , cost := cost₂ , doc := d₂✝ ,
x := String.length slast + String.length t , y := y₂ }
α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := [] } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ [] ≠ [] cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (String.length slast ) i
{ last := String.length slast + String.length t , cost := cost₂ , doc := d₂✝ ,
x := String.length slast + String.length t , y := y₂ } subst h_last α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String t : String h_non_empty✝ : ss ≠ [] h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )cost₂ : α y₂ : ℕ h₂ : Render d₂✝ (String.length (List.getLast ss h_non_empty✝ ) ) i { fst := t , rst := [] } h_non_empty : List.dropLast ss ++ [List.getLast ss h_non_empty✝ ++ t ] ++ [] ≠ [] h✝ : MeasRender F d₂✝ (String.length (List.getLast ss h_non_empty✝ ) ) i
{ last := String.length (List.getLast ss h_non_empty✝ ) + String.length t , cost := cost₂ , doc := d₂✝ ,
x := String.length (List.getLast ss h_non_empty✝ ) + String.length t , y := y₂ }
α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := [] } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ [] ≠ [] cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (String.length slast ) i
{ last := String.length slast + String.length t , cost := cost₂ , doc := d₂✝ ,
x := String.length slast + String.length t , y := y₂ } simp [ max_assoc ]
}
α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := [] } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ [] ≠ [] rw [ α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := [] } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ [] ≠ [] cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (String.length slast ) i
{ last := String.length slast + String.length t , cost := cost₂ , doc := d₂✝ ,
x := String.length slast + String.length t , y := y₂ } h_x : Layout.max_with_offset c { fst := s , rst := List.dropLast ss ++ [slast ++ t ] ++ [] } = max (Layout.max_with_offset c { fst := s , rst := ss } ) (String.length slast + String.length t )h_x α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := [] } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ [] ≠ [] cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (String.length slast ) i
{ last := String.length slast + String.length t , cost := cost₂ , doc := d₂✝ ,
x := String.length slast + String.length t , y := y₂ } h_x : Layout.max_with_offset c { fst := s , rst := List.dropLast ss ++ [slast ++ t ] ++ [] } = max (Layout.max_with_offset c { fst := s , rst := ss } ) (String.length slast + String.length t )] α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := [] } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ [] ≠ [] cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (String.length slast ) i
{ last := String.length slast + String.length t , cost := cost₂ , doc := d₂✝ ,
x := String.length slast + String.length t , y := y₂ } h_x : Layout.max_with_offset c { fst := s , rst := List.dropLast ss ++ [slast ++ t ] ++ [] } = max (Layout.max_with_offset c { fst := s , rst := ss } ) (String.length slast + String.length t )
α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := [] } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ [] ≠ [] dwi { α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := [] } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ [] ≠ [] cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (String.length slast ) i
{ last := String.length slast + String.length t , cost := cost₂ , doc := d₂✝ ,
x := String.length slast + String.length t , y := y₂ } h_x : Layout.max_with_offset c { fst := s , rst := List.dropLast ss ++ [slast ++ t ] ++ [] } = max (Layout.max_with_offset c { fst := s , rst := ss } ) (String.length slast + String.length t )apply MeasRender.concat α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := [] } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ [] ≠ [] cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (String.length slast ) i
{ last := String.length slast + String.length t , cost := cost₂ , doc := d₂✝ ,
x := String.length slast + String.length t , y := y₂ } h_x : Layout.max_with_offset c { fst := s , rst := List.dropLast ss ++ [slast ++ t ] ++ [] } = max (Layout.max_with_offset c { fst := s , rst := ss } ) (String.length slast + String.length t )h₁ α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := [] } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ [] ≠ [] cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (String.length slast ) i
{ last := String.length slast + String.length t , cost := cost₂ , doc := d₂✝ ,
x := String.length slast + String.length t , y := y₂ } h_x : Layout.max_with_offset c { fst := s , rst := List.dropLast ss ++ [slast ++ t ] ++ [] } = max (Layout.max_with_offset c { fst := s , rst := ss } ) (String.length slast + String.length t )h₂ α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := [] } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ [] ≠ [] cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (String.length slast ) i
{ last := String.length slast + String.length t , cost := cost₂ , doc := d₂✝ ,
x := String.length slast + String.length t , y := y₂ } h_x : Layout.max_with_offset c { fst := s , rst := List.dropLast ss ++ [slast ++ t ] ++ [] } = max (Layout.max_with_offset c { fst := s , rst := ss } ) (String.length slast + String.length t )h α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := [] } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ [] ≠ [] cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (String.length slast ) i
{ last := String.length slast + String.length t , cost := cost₂ , doc := d₂✝ ,
x := String.length slast + String.length t , y := y₂ } h_x : Layout.max_with_offset c { fst := s , rst := List.dropLast ss ++ [slast ++ t ] ++ [] } = max (Layout.max_with_offset c { fst := s , rst := ss } ) (String.length slast + String.length t )m₁ Meas
α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := [] } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ [] ≠ [] cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (String.length slast ) i
{ last := String.length slast + String.length t , cost := cost₂ , doc := d₂✝ ,
x := String.length slast + String.length t , y := y₂ } h_x : Layout.max_with_offset c { fst := s , rst := List.dropLast ss ++ [slast ++ t ] ++ [] } = max (Layout.max_with_offset c { fst := s , rst := ss } ) (String.length slast + String.length t )m₂ Meas
} α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := [] } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ [] ≠ [] cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (String.length slast ) i
{ last := String.length slast + String.length t , cost := cost₂ , doc := d₂✝ ,
x := String.length slast + String.length t , y := y₂ } h_x : Layout.max_with_offset c { fst := s , rst := List.dropLast ss ++ [slast ++ t ] ++ [] } = max (Layout.max_with_offset c { fst := s , rst := ss } ) (String.length slast + String.length t )h₂ α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := [] } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ [] ≠ [] cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (String.length slast ) i
{ last := String.length slast + String.length t , cost := cost₂ , doc := d₂✝ ,
x := String.length slast + String.length t , y := y₂ } h_x : Layout.max_with_offset c { fst := s , rst := List.dropLast ss ++ [slast ++ t ] ++ [] } = max (Layout.max_with_offset c { fst := s , rst := ss } ) (String.length slast + String.length t )h { last := String.length (List.getLast (List.dropLast ss ++ [slast ++ t ] ++ [] ) h_non_empty ) ,
cost := Factory.concat F cost₁ cost₂ , doc := Doc.concat d₁✝ d₂✝ ,
x := max (Layout.max_with_offset c { fst := s , rst := ss } ) (String.length slast + String.length t ) ,
y := max y₁ y₂ } = Meas.concat F
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ }
?m₂ α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := [] } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ [] ≠ [] cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (String.length slast ) i
{ last := String.length slast + String.length t , cost := cost₂ , doc := d₂✝ ,
x := String.length slast + String.length t , y := y₂ } h_x : Layout.max_with_offset c { fst := s , rst := List.dropLast ss ++ [slast ++ t ] ++ [] } = max (Layout.max_with_offset c { fst := s , rst := ss } ) (String.length slast + String.length t )m₂ Meas
α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := [] } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ [] ≠ [] case h₂ => α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := [] } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ [] ≠ [] cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (String.length slast ) i
{ last := String.length slast + String.length t , cost := cost₂ , doc := d₂✝ ,
x := String.length slast + String.length t , y := y₂ } h_x : Layout.max_with_offset c { fst := s , rst := List.dropLast ss ++ [slast ++ t ] ++ [] } = max (Layout.max_with_offset c { fst := s , rst := ss } ) (String.length slast + String.length t )subst h_last α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String t : String h_non_empty✝ : ss ≠ [] h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )cost₂ : α y₂ : ℕ h₂ : Render d₂✝ (String.length (List.getLast ss h_non_empty✝ ) ) i { fst := t , rst := [] } h_non_empty : List.dropLast ss ++ [List.getLast ss h_non_empty✝ ++ t ] ++ [] ≠ [] h✝ : MeasRender F d₂✝ (String.length (List.getLast ss h_non_empty✝ ) ) i
{ last := String.length (List.getLast ss h_non_empty✝ ) + String.length t , cost := cost₂ , doc := d₂✝ ,
x := String.length (List.getLast ss h_non_empty✝ ) + String.length t , y := y₂ } h_x : Layout.max_with_offset c { fst := s , rst := List.dropLast ss ++ [List.getLast ss h_non_empty✝ ++ t ] ++ [] } = max (Layout.max_with_offset c { fst := s , rst := ss } )
(String.length (List.getLast ss h_non_empty✝ ) + String.length t ); α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String t : String h_non_empty✝ : ss ≠ [] h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )cost₂ : α y₂ : ℕ h₂ : Render d₂✝ (String.length (List.getLast ss h_non_empty✝ ) ) i { fst := t , rst := [] } h_non_empty : List.dropLast ss ++ [List.getLast ss h_non_empty✝ ++ t ] ++ [] ≠ [] h✝ : MeasRender F d₂✝ (String.length (List.getLast ss h_non_empty✝ ) ) i
{ last := String.length (List.getLast ss h_non_empty✝ ) + String.length t , cost := cost₂ , doc := d₂✝ ,
x := String.length (List.getLast ss h_non_empty✝ ) + String.length t , y := y₂ } h_x : Layout.max_with_offset c { fst := s , rst := List.dropLast ss ++ [List.getLast ss h_non_empty✝ ++ t ] ++ [] } = max (Layout.max_with_offset c { fst := s , rst := ss } )
(String.length (List.getLast ss h_non_empty✝ ) + String.length t ) α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := [] } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ [] ≠ [] cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (String.length slast ) i
{ last := String.length slast + String.length t , cost := cost₂ , doc := d₂✝ ,
x := String.length slast + String.length t , y := y₂ } h_x : Layout.max_with_offset c { fst := s , rst := List.dropLast ss ++ [slast ++ t ] ++ [] } = max (Layout.max_with_offset c { fst := s , rst := ss } ) (String.length slast + String.length t )simpa
α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := [] } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ [] ≠ [] case h => α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := [] } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ [] ≠ [] cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (String.length slast ) i
{ last := String.length slast + String.length t , cost := cost₂ , doc := d₂✝ ,
x := String.length slast + String.length t , y := y₂ } h_x : Layout.max_with_offset c { fst := s , rst := List.dropLast ss ++ [slast ++ t ] ++ [] } = max (Layout.max_with_offset c { fst := s , rst := ss } ) (String.length slast + String.length t ){ last := String.length (List.getLast (List.dropLast ss ++ [slast ++ t ] ++ [] ) h_non_empty ) ,
cost := Factory.concat F cost₁ cost₂ , doc := Doc.concat d₁✝ d₂✝ ,
x := max (Layout.max_with_offset c { fst := s , rst := ss } ) (String.length slast + String.length t ) ,
y := max y₁ y₂ } = Meas.concat F
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ }
{ last := String.length (List.getLast ss h_non_empty✝ ) + String.length t , cost := cost₂ , doc := d₂✝ ,
x := String.length (List.getLast ss h_non_empty✝ ) + String.length t , y := y₂ } simp [ Meas.concat : {α : Type } → Factory α → Meas → Meas → Meas Meas.concat, *]
α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String ts : List String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := ts } h₁ : Render d₁✝ c i { fst := s , rst := ss } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ ts ≠ [] case cons hd tl =>
α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )hd : String tl : List String h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := hd :: tl } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ hd :: tl ≠ [] let ⟨ cost₂ , ⟨ y₂ , _⟩⟩ := ih₂ h₂ ( α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )hd : String tl : List String h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := hd :: tl } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ hd :: tl ≠ [] by α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )hd : String tl : List String h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := hd :: tl } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ hd :: tl ≠ [] simp ) α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )hd : String tl : List String h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := hd :: tl } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ hd :: tl ≠ [] cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (String.length slast ) i
{ last := String.length (List.getLast (hd :: tl ) (_ : ¬ hd :: tl = [] ) ) , cost := cost₂ , doc := d₂✝ ,
x := Layout.max_with_offset (String.length slast ) { fst := t , rst := hd :: tl } , y := y₂ }
α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )hd : String tl : List String h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := hd :: tl } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ hd :: tl ≠ [] exists F . concat cost₁ cost₂ , max : {α : Type ?u.147126} → [self : Max α ] → α → α → α max y₁ y₂ α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )hd : String tl : List String h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := hd :: tl } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ hd :: tl ≠ [] cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (String.length slast ) i
{ last := String.length (List.getLast (hd :: tl ) (_ : ¬ hd :: tl = [] ) ) , cost := cost₂ , doc := d₂✝ ,
x := Layout.max_with_offset (String.length slast ) { fst := t , rst := hd :: tl } , y := y₂ }
α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )hd : String tl : List String h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := hd :: tl } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ hd :: tl ≠ [] have h_x : Layout.max_with_offset c ⟨ s , List.dropLast ss ++ [ slast ++ t ] ++ hd :: tl ⟩ =
max : {α : Type ?u.149907} → [self : Max α ] → α → α → α max ( Layout.max_with_offset c ⟨ s , ss ⟩)
( Layout.max_with_offset slast . length ⟨ t , hd :: tl ⟩) := α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )hd : String tl : List String h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := hd :: tl } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ hd :: tl ≠ [] cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (String.length slast ) i
{ last := String.length (List.getLast (hd :: tl ) (_ : ¬ hd :: tl = [] ) ) , cost := cost₂ , doc := d₂✝ ,
x := Layout.max_with_offset (String.length slast ) { fst := t , rst := hd :: tl } , y := y₂ } by α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )hd : String tl : List String h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := hd :: tl } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ hd :: tl ≠ [] cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (String.length slast ) i
{ last := String.length (List.getLast (hd :: tl ) (_ : ¬ hd :: tl = [] ) ) , cost := cost₂ , doc := d₂✝ ,
x := Layout.max_with_offset (String.length slast ) { fst := t , rst := hd :: tl } , y := y₂ } { α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )hd : String tl : List String h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := hd :: tl } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ hd :: tl ≠ [] cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (String.length slast ) i
{ last := String.length (List.getLast (hd :: tl ) (_ : ¬ hd :: tl = [] ) ) , cost := cost₂ , doc := d₂✝ ,
x := Layout.max_with_offset (String.length slast ) { fst := t , rst := hd :: tl } , y := y₂ }
α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )hd : String tl : List String h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := hd :: tl } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ hd :: tl ≠ [] cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (String.length slast ) i
{ last := String.length (List.getLast (hd :: tl ) (_ : ¬ hd :: tl = [] ) ) , cost := cost₂ , doc := d₂✝ ,
x := Layout.max_with_offset (String.length slast ) { fst := t , rst := hd :: tl } , y := y₂ } simp only [
Layout.max_with_offset , List.append_assoc : ∀ {α : Type ?u.149934} (as bs cs : List α ), as ++ bs ++ cs = as ++ (bs ++ cs ) List.append_assoc, List.singleton_append : ∀ {α : Type ?u.149951} {x : α } {l : List α }, [x ] ++ l = x :: l List.singleton_append,
List.map_append , List.map : {α : Type ?u.149989} → {β : Type ?u.149988} → (α → β ) → List α → List β List.map, String.length_append , List.foldl_append ,
List.foldl : {α : Type ?u.150329} → {β : Type ?u.150328} → (α → β → α ) → α → List β → α List.foldl, ge_iff_le : ∀ {α : Type ?u.150369} [inst : LE α ] {a b : α }, a ≥ b ↔ b ≤ a ge_iff_le, le_max_iff , max_le_iff , nonpos_iff_eq_zero ,
zero_le , max_eq_right
] α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )hd : String tl : List String h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := hd :: tl } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ hd :: tl ≠ [] cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (String.length slast ) i
{ last := String.length (List.getLast (hd :: tl ) (_ : ¬ hd :: tl = [] ) ) , cost := cost₂ , doc := d₂✝ ,
x := Layout.max_with_offset (String.length slast ) { fst := t , rst := hd :: tl } , y := y₂ }
α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )hd : String tl : List String h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := hd :: tl } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ hd :: tl ≠ [] cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (String.length slast ) i
{ last := String.length (List.getLast (hd :: tl ) (_ : ¬ hd :: tl = [] ) ) , cost := cost₂ , doc := d₂✝ ,
x := Layout.max_with_offset (String.length slast ) { fst := t , rst := hd :: tl } , y := y₂ } rw [ α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )hd : String tl : List String h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := hd :: tl } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ hd :: tl ≠ [] cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (String.length slast ) i
{ last := String.length (List.getLast (hd :: tl ) (_ : ¬ hd :: tl = [] ) ) , cost := cost₂ , doc := d₂✝ ,
x := Layout.max_with_offset (String.length slast ) { fst := t , rst := hd :: tl } , y := y₂ } h_droplast , α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )hd : String tl : List String h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := hd :: tl } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ hd :: tl ≠ [] cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (String.length slast ) i
{ last := String.length (List.getLast (hd :: tl ) (_ : ¬ hd :: tl = [] ) ) , cost := cost₂ , doc := d₂✝ ,
x := Layout.max_with_offset (String.length slast ) { fst := t , rst := hd :: tl } , y := y₂ } α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )hd : String tl : List String h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := hd :: tl } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ hd :: tl ≠ [] cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (String.length slast ) i
{ last := String.length (List.getLast (hd :: tl ) (_ : ¬ hd :: tl = [] ) ) , cost := cost₂ , doc := d₂✝ ,
x := Layout.max_with_offset (String.length slast ) { fst := t , rst := hd :: tl } , y := y₂ } List.map_append , α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )hd : String tl : List String h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := hd :: tl } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ hd :: tl ≠ [] cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (String.length slast ) i
{ last := String.length (List.getLast (hd :: tl ) (_ : ¬ hd :: tl = [] ) ) , cost := cost₂ , doc := d₂✝ ,
x := Layout.max_with_offset (String.length slast ) { fst := t , rst := hd :: tl } , y := y₂ } α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )hd : String tl : List String h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := hd :: tl } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ hd :: tl ≠ [] cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (String.length slast ) i
{ last := String.length (List.getLast (hd :: tl ) (_ : ¬ hd :: tl = [] ) ) , cost := cost₂ , doc := d₂✝ ,
x := Layout.max_with_offset (String.length slast ) { fst := t , rst := hd :: tl } , y := y₂ } List.foldl_append α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )hd : String tl : List String h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := hd :: tl } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ hd :: tl ≠ [] cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (String.length slast ) i
{ last := String.length (List.getLast (hd :: tl ) (_ : ¬ hd :: tl = [] ) ) , cost := cost₂ , doc := d₂✝ ,
x := Layout.max_with_offset (String.length slast ) { fst := t , rst := hd :: tl } , y := y₂ } ] α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )hd : String tl : List String h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := hd :: tl } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ hd :: tl ≠ [] cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (String.length slast ) i
{ last := String.length (List.getLast (hd :: tl ) (_ : ¬ hd :: tl = [] ) ) , cost := cost₂ , doc := d₂✝ ,
x := Layout.max_with_offset (String.length slast ) { fst := t , rst := hd :: tl } , y := y₂ }
α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )hd : String tl : List String h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := hd :: tl } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ hd :: tl ≠ [] cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (String.length slast ) i
{ last := String.length (List.getLast (hd :: tl ) (_ : ¬ hd :: tl = [] ) ) , cost := cost₂ , doc := d₂✝ ,
x := Layout.max_with_offset (String.length slast ) { fst := t , rst := hd :: tl } , y := y₂ } subst h_last α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String t : String h_non_empty✝ : ss ≠ [] h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )hd : String tl : List String cost₂ : α y₂ : ℕ h₂ : Render d₂✝ (String.length (List.getLast ss h_non_empty✝ ) ) i { fst := t , rst := hd :: tl } h_non_empty : List.dropLast ss ++ [List.getLast ss h_non_empty✝ ++ t ] ++ hd :: tl ≠ [] h✝ : MeasRender F d₂✝ (String.length (List.getLast ss h_non_empty✝ ) ) i
{ last := String.length (List.getLast (hd :: tl ) (_ : ¬ hd :: tl = [] ) ) , cost := cost₂ , doc := d₂✝ ,
x := Layout.max_with_offset (String.length (List.getLast ss h_non_empty✝ ) ) { fst := t , rst := hd :: tl } , y := y₂ }
α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )hd : String tl : List String h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := hd :: tl } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ hd :: tl ≠ [] cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (String.length slast ) i
{ last := String.length (List.getLast (hd :: tl ) (_ : ¬ hd :: tl = [] ) ) , cost := cost₂ , doc := d₂✝ ,
x := Layout.max_with_offset (String.length slast ) { fst := t , rst := hd :: tl } , y := y₂ } simp only [
ge_iff_le : ∀ {α : Type ?u.152992} [inst : LE α ] {a b : α }, a ≥ b ↔ b ≤ a ge_iff_le, le_max_iff , max_le_iff , max_assoc , List.foldl : {α : Type ?u.153059} → {β : Type ?u.153058} → (α → β → α ) → α → List β → α List.foldl,
add_le_iff_nonpos_right , nonpos_iff_eq_zero , le_add_iff_nonneg_right ,
zero_le , and_true , true_or , max_eq_right
] α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String t : String h_non_empty✝ : ss ≠ [] h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )hd : String tl : List String cost₂ : α y₂ : ℕ h₂ : Render d₂✝ (String.length (List.getLast ss h_non_empty✝ ) ) i { fst := t , rst := hd :: tl } h_non_empty : List.dropLast ss ++ [List.getLast ss h_non_empty✝ ++ t ] ++ hd :: tl ≠ [] h✝ : MeasRender F d₂✝ (String.length (List.getLast ss h_non_empty✝ ) ) i
{ last := String.length (List.getLast (hd :: tl ) (_ : ¬ hd :: tl = [] ) ) , cost := cost₂ , doc := d₂✝ ,
x := Layout.max_with_offset (String.length (List.getLast ss h_non_empty✝ ) ) { fst := t , rst := hd :: tl } , y := y₂ }
α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )hd : String tl : List String h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := hd :: tl } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ hd :: tl ≠ [] cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (String.length slast ) i
{ last := String.length (List.getLast (hd :: tl ) (_ : ¬ hd :: tl = [] ) ) , cost := cost₂ , doc := d₂✝ ,
x := Layout.max_with_offset (String.length slast ) { fst := t , rst := hd :: tl } , y := y₂ } dwi { α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String t : String h_non_empty✝ : ss ≠ [] h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )hd : String tl : List String cost₂ : α y₂ : ℕ h₂ : Render d₂✝ (String.length (List.getLast ss h_non_empty✝ ) ) i { fst := t , rst := hd :: tl } h_non_empty : List.dropLast ss ++ [List.getLast ss h_non_empty✝ ++ t ] ++ hd :: tl ≠ [] h✝ : MeasRender F d₂✝ (String.length (List.getLast ss h_non_empty✝ ) ) i
{ last := String.length (List.getLast (hd :: tl ) (_ : ¬ hd :: tl = [] ) ) , cost := cost₂ , doc := d₂✝ ,
x := Layout.max_with_offset (String.length (List.getLast ss h_non_empty✝ ) ) { fst := t , rst := hd :: tl } , y := y₂ } apply congr : ∀ {α : Sort ?u.159710} {β : Sort ?u.159709} {f₁ f₂ : α → β } {a₁ a₂ : α }, f₁ = f₂ → a₁ = a₂ → f₁ a₁ = f₂ a₂ congrα : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String t : String h_non_empty✝ : ss ≠ [] h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )hd : String tl : List String cost₂ : α y₂ : ℕ h₂ : Render d₂✝ (String.length (List.getLast ss h_non_empty✝ ) ) i { fst := t , rst := hd :: tl } h_non_empty : List.dropLast ss ++ [List.getLast ss h_non_empty✝ ++ t ] ++ hd :: tl ≠ [] h✝ : MeasRender F d₂✝ (String.length (List.getLast ss h_non_empty✝ ) ) i
{ last := String.length (List.getLast (hd :: tl ) (_ : ¬ hd :: tl = [] ) ) , cost := cost₂ , doc := d₂✝ ,
x := Layout.max_with_offset (String.length (List.getLast ss h_non_empty✝ ) ) { fst := t , rst := hd :: tl } , y := y₂ } h₁ α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String t : String h_non_empty✝ : ss ≠ [] h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )hd : String tl : List String cost₂ : α y₂ : ℕ h₂ : Render d₂✝ (String.length (List.getLast ss h_non_empty✝ ) ) i { fst := t , rst := hd :: tl } h_non_empty : List.dropLast ss ++ [List.getLast ss h_non_empty✝ ++ t ] ++ hd :: tl ≠ [] h✝ : MeasRender F d₂✝ (String.length (List.getLast ss h_non_empty✝ ) ) i
{ last := String.length (List.getLast (hd :: tl ) (_ : ¬ hd :: tl = [] ) ) , cost := cost₂ , doc := d₂✝ ,
x := Layout.max_with_offset (String.length (List.getLast ss h_non_empty✝ ) ) { fst := t , rst := hd :: tl } , y := y₂ } h₂ } α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String t : String h_non_empty✝ : ss ≠ [] h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )hd : String tl : List String cost₂ : α y₂ : ℕ h₂ : Render d₂✝ (String.length (List.getLast ss h_non_empty✝ ) ) i { fst := t , rst := hd :: tl } h_non_empty : List.dropLast ss ++ [List.getLast ss h_non_empty✝ ++ t ] ++ hd :: tl ≠ [] h✝ : MeasRender F d₂✝ (String.length (List.getLast ss h_non_empty✝ ) ) i
{ last := String.length (List.getLast (hd :: tl ) (_ : ¬ hd :: tl = [] ) ) , cost := cost₂ , doc := d₂✝ ,
x := Layout.max_with_offset (String.length (List.getLast ss h_non_empty✝ ) ) { fst := t , rst := hd :: tl } , y := y₂ } h₂
α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )hd : String tl : List String h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := hd :: tl } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ hd :: tl ≠ [] cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (String.length slast ) i
{ last := String.length (List.getLast (hd :: tl ) (_ : ¬ hd :: tl = [] ) ) , cost := cost₂ , doc := d₂✝ ,
x := Layout.max_with_offset (String.length slast ) { fst := t , rst := hd :: tl } , y := y₂ } case h₂ => α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String t : String h_non_empty✝ : ss ≠ [] h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )hd : String tl : List String cost₂ : α y₂ : ℕ h₂ : Render d₂✝ (String.length (List.getLast ss h_non_empty✝ ) ) i { fst := t , rst := hd :: tl } h_non_empty : List.dropLast ss ++ [List.getLast ss h_non_empty✝ ++ t ] ++ hd :: tl ≠ [] h✝ : MeasRender F d₂✝ (String.length (List.getLast ss h_non_empty✝ ) ) i
{ last := String.length (List.getLast (hd :: tl ) (_ : ¬ hd :: tl = [] ) ) , cost := cost₂ , doc := d₂✝ ,
x := Layout.max_with_offset (String.length (List.getLast ss h_non_empty✝ ) ) { fst := t , rst := hd :: tl } , y := y₂ } simp [ List.fold_max_max_eq_max_fold_max ]
}
α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )hd : String tl : List String h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := hd :: tl } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ hd :: tl ≠ [] rw [ α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )hd : String tl : List String h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := hd :: tl } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ hd :: tl ≠ [] cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (String.length slast ) i
{ last := String.length (List.getLast (hd :: tl ) (_ : ¬ hd :: tl = [] ) ) , cost := cost₂ , doc := d₂✝ ,
x := Layout.max_with_offset (String.length slast ) { fst := t , rst := hd :: tl } , y := y₂ } h_x : Layout.max_with_offset c { fst := s , rst := List.dropLast ss ++ [slast ++ t ] ++ hd :: tl } = max (Layout.max_with_offset c { fst := s , rst := ss } )
(Layout.max_with_offset (String.length slast ) { fst := t , rst := hd :: tl } )h_x α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )hd : String tl : List String h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := hd :: tl } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ hd :: tl ≠ [] cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (String.length slast ) i
{ last := String.length (List.getLast (hd :: tl ) (_ : ¬ hd :: tl = [] ) ) , cost := cost₂ , doc := d₂✝ ,
x := Layout.max_with_offset (String.length slast ) { fst := t , rst := hd :: tl } , y := y₂ } h_x : Layout.max_with_offset c { fst := s , rst := List.dropLast ss ++ [slast ++ t ] ++ hd :: tl } = max (Layout.max_with_offset c { fst := s , rst := ss } )
(Layout.max_with_offset (String.length slast ) { fst := t , rst := hd :: tl } )] α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )hd : String tl : List String h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := hd :: tl } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ hd :: tl ≠ [] cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (String.length slast ) i
{ last := String.length (List.getLast (hd :: tl ) (_ : ¬ hd :: tl = [] ) ) , cost := cost₂ , doc := d₂✝ ,
x := Layout.max_with_offset (String.length slast ) { fst := t , rst := hd :: tl } , y := y₂ } h_x : Layout.max_with_offset c { fst := s , rst := List.dropLast ss ++ [slast ++ t ] ++ hd :: tl } = max (Layout.max_with_offset c { fst := s , rst := ss } )
(Layout.max_with_offset (String.length slast ) { fst := t , rst := hd :: tl } )
α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )hd : String tl : List String h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := hd :: tl } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ hd :: tl ≠ [] dwi { α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )hd : String tl : List String h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := hd :: tl } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ hd :: tl ≠ [] cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (String.length slast ) i
{ last := String.length (List.getLast (hd :: tl ) (_ : ¬ hd :: tl = [] ) ) , cost := cost₂ , doc := d₂✝ ,
x := Layout.max_with_offset (String.length slast ) { fst := t , rst := hd :: tl } , y := y₂ } h_x : Layout.max_with_offset c { fst := s , rst := List.dropLast ss ++ [slast ++ t ] ++ hd :: tl } = max (Layout.max_with_offset c { fst := s , rst := ss } )
(Layout.max_with_offset (String.length slast ) { fst := t , rst := hd :: tl } )constructor α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )hd : String tl : List String h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := hd :: tl } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ hd :: tl ≠ [] cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (String.length slast ) i
{ last := String.length (List.getLast (hd :: tl ) (_ : ¬ hd :: tl = [] ) ) , cost := cost₂ , doc := d₂✝ ,
x := Layout.max_with_offset (String.length slast ) { fst := t , rst := hd :: tl } , y := y₂ } h_x : Layout.max_with_offset c { fst := s , rst := List.dropLast ss ++ [slast ++ t ] ++ hd :: tl } = max (Layout.max_with_offset c { fst := s , rst := ss } )
(Layout.max_with_offset (String.length slast ) { fst := t , rst := hd :: tl } )h₁ α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )hd : String tl : List String h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := hd :: tl } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ hd :: tl ≠ [] cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (String.length slast ) i
{ last := String.length (List.getLast (hd :: tl ) (_ : ¬ hd :: tl = [] ) ) , cost := cost₂ , doc := d₂✝ ,
x := Layout.max_with_offset (String.length slast ) { fst := t , rst := hd :: tl } , y := y₂ } h_x : Layout.max_with_offset c { fst := s , rst := List.dropLast ss ++ [slast ++ t ] ++ hd :: tl } = max (Layout.max_with_offset c { fst := s , rst := ss } )
(Layout.max_with_offset (String.length slast ) { fst := t , rst := hd :: tl } )h₂ α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )hd : String tl : List String h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := hd :: tl } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ hd :: tl ≠ [] cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (String.length slast ) i
{ last := String.length (List.getLast (hd :: tl ) (_ : ¬ hd :: tl = [] ) ) , cost := cost₂ , doc := d₂✝ ,
x := Layout.max_with_offset (String.length slast ) { fst := t , rst := hd :: tl } , y := y₂ } h_x : Layout.max_with_offset c { fst := s , rst := List.dropLast ss ++ [slast ++ t ] ++ hd :: tl } = max (Layout.max_with_offset c { fst := s , rst := ss } )
(Layout.max_with_offset (String.length slast ) { fst := t , rst := hd :: tl } )h α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )hd : String tl : List String h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := hd :: tl } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ hd :: tl ≠ [] cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (String.length slast ) i
{ last := String.length (List.getLast (hd :: tl ) (_ : ¬ hd :: tl = [] ) ) , cost := cost₂ , doc := d₂✝ ,
x := Layout.max_with_offset (String.length slast ) { fst := t , rst := hd :: tl } , y := y₂ } h_x : Layout.max_with_offset c { fst := s , rst := List.dropLast ss ++ [slast ++ t ] ++ hd :: tl } = max (Layout.max_with_offset c { fst := s , rst := ss } )
(Layout.max_with_offset (String.length slast ) { fst := t , rst := hd :: tl } )m₁ Meas
α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )hd : String tl : List String h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := hd :: tl } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ hd :: tl ≠ [] cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (String.length slast ) i
{ last := String.length (List.getLast (hd :: tl ) (_ : ¬ hd :: tl = [] ) ) , cost := cost₂ , doc := d₂✝ ,
x := Layout.max_with_offset (String.length slast ) { fst := t , rst := hd :: tl } , y := y₂ } h_x : Layout.max_with_offset c { fst := s , rst := List.dropLast ss ++ [slast ++ t ] ++ hd :: tl } = max (Layout.max_with_offset c { fst := s , rst := ss } )
(Layout.max_with_offset (String.length slast ) { fst := t , rst := hd :: tl } )m₂ Meas
} α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )hd : String tl : List String h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := hd :: tl } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ hd :: tl ≠ [] cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (String.length slast ) i
{ last := String.length (List.getLast (hd :: tl ) (_ : ¬ hd :: tl = [] ) ) , cost := cost₂ , doc := d₂✝ ,
x := Layout.max_with_offset (String.length slast ) { fst := t , rst := hd :: tl } , y := y₂ } h_x : Layout.max_with_offset c { fst := s , rst := List.dropLast ss ++ [slast ++ t ] ++ hd :: tl } = max (Layout.max_with_offset c { fst := s , rst := ss } )
(Layout.max_with_offset (String.length slast ) { fst := t , rst := hd :: tl } )h₂ α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )hd : String tl : List String h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := hd :: tl } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ hd :: tl ≠ [] cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (String.length slast ) i
{ last := String.length (List.getLast (hd :: tl ) (_ : ¬ hd :: tl = [] ) ) , cost := cost₂ , doc := d₂✝ ,
x := Layout.max_with_offset (String.length slast ) { fst := t , rst := hd :: tl } , y := y₂ } h_x : Layout.max_with_offset c { fst := s , rst := List.dropLast ss ++ [slast ++ t ] ++ hd :: tl } = max (Layout.max_with_offset c { fst := s , rst := ss } )
(Layout.max_with_offset (String.length slast ) { fst := t , rst := hd :: tl } )h { last := String.length (List.getLast (List.dropLast ss ++ [slast ++ t ] ++ hd :: tl ) h_non_empty ) ,
cost := Factory.concat F cost₁ cost₂ , doc := Doc.concat d₁✝ d₂✝ ,
x :=
max (Layout.max_with_offset c { fst := s , rst := ss } )
(Layout.max_with_offset (String.length slast ) { fst := t , rst := hd :: tl } ) ,
y := max y₁ y₂ } = Meas.concat F
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ }
?m₂ α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )hd : String tl : List String h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := hd :: tl } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ hd :: tl ≠ [] cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (String.length slast ) i
{ last := String.length (List.getLast (hd :: tl ) (_ : ¬ hd :: tl = [] ) ) , cost := cost₂ , doc := d₂✝ ,
x := Layout.max_with_offset (String.length slast ) { fst := t , rst := hd :: tl } , y := y₂ } h_x : Layout.max_with_offset c { fst := s , rst := List.dropLast ss ++ [slast ++ t ] ++ hd :: tl } = max (Layout.max_with_offset c { fst := s , rst := ss } )
(Layout.max_with_offset (String.length slast ) { fst := t , rst := hd :: tl } )m₂ Meas
α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )hd : String tl : List String h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := hd :: tl } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ hd :: tl ≠ [] case h₂ =>
α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )hd : String tl : List String h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := hd :: tl } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ hd :: tl ≠ [] cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (String.length slast ) i
{ last := String.length (List.getLast (hd :: tl ) (_ : ¬ hd :: tl = [] ) ) , cost := cost₂ , doc := d₂✝ ,
x := Layout.max_with_offset (String.length slast ) { fst := t , rst := hd :: tl } , y := y₂ } h_x : Layout.max_with_offset c { fst := s , rst := List.dropLast ss ++ [slast ++ t ] ++ hd :: tl } = max (Layout.max_with_offset c { fst := s , rst := ss } )
(Layout.max_with_offset (String.length slast ) { fst := t , rst := hd :: tl } )subst h_last α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String t : String h_non_empty✝ : ss ≠ [] h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )hd : String tl : List String cost₂ : α y₂ : ℕ h₂ : Render d₂✝ (String.length (List.getLast ss h_non_empty✝ ) ) i { fst := t , rst := hd :: tl } h_non_empty : List.dropLast ss ++ [List.getLast ss h_non_empty✝ ++ t ] ++ hd :: tl ≠ [] h✝ : MeasRender F d₂✝ (String.length (List.getLast ss h_non_empty✝ ) ) i
{ last := String.length (List.getLast (hd :: tl ) (_ : ¬ hd :: tl = [] ) ) , cost := cost₂ , doc := d₂✝ ,
x := Layout.max_with_offset (String.length (List.getLast ss h_non_empty✝ ) ) { fst := t , rst := hd :: tl } , y := y₂ } h_x : Layout.max_with_offset c { fst := s , rst := List.dropLast ss ++ [List.getLast ss h_non_empty✝ ++ t ] ++ hd :: tl } = max (Layout.max_with_offset c { fst := s , rst := ss } )
(Layout.max_with_offset (String.length (List.getLast ss h_non_empty✝ ) ) { fst := t , rst := hd :: tl } )
α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )hd : String tl : List String h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := hd :: tl } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ hd :: tl ≠ [] cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (String.length slast ) i
{ last := String.length (List.getLast (hd :: tl ) (_ : ¬ hd :: tl = [] ) ) , cost := cost₂ , doc := d₂✝ ,
x := Layout.max_with_offset (String.length slast ) { fst := t , rst := hd :: tl } , y := y₂ } h_x : Layout.max_with_offset c { fst := s , rst := List.dropLast ss ++ [slast ++ t ] ++ hd :: tl } = max (Layout.max_with_offset c { fst := s , rst := ss } )
(Layout.max_with_offset (String.length slast ) { fst := t , rst := hd :: tl } )simpa [ List.getLast_append' ]
α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )hd : String tl : List String h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := hd :: tl } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ hd :: tl ≠ [] case h => α : Type F : Factory α d₁✝, d₂✝ : Doc ih₁ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₁✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } ih₂ : ∀ {c i : ℕ } {s : String } {ss : List String },
Render d₂✝ c i { fst := s , rst := ss } →
∀ (h_non_empty : ss ≠ [] ),
∃ cost y ,
MeasRender F d₂✝ c i
{ last := String.length (List.getLast ss h_non_empty ) , cost := cost , doc := d₂✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y } c, i : ℕ s : String ss : List String slast, t : String h_non_empty✝ : ss ≠ [] h_last : slast = List.getLast ss h_non_empty✝ h₁ : Render d₁✝ c i { fst := s , rst := ss } cost₁ : α y₁ : ℕ h✝¹ : MeasRender F d₁✝ c i
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ } h_droplast : List.map String.length ss = List.map String.length (List.dropLast ss ++ [List.getLast ss h_non_empty✝ ] )hd : String tl : List String h₂ : Render d₂✝ (String.length slast ) i { fst := t , rst := hd :: tl } h_non_empty : List.dropLast ss ++ [slast ++ t ] ++ hd :: tl ≠ [] cost₂ : α y₂ : ℕ h✝ : MeasRender F d₂✝ (String.length slast ) i
{ last := String.length (List.getLast (hd :: tl ) (_ : ¬ hd :: tl = [] ) ) , cost := cost₂ , doc := d₂✝ ,
x := Layout.max_with_offset (String.length slast ) { fst := t , rst := hd :: tl } , y := y₂ } h_x : Layout.max_with_offset c { fst := s , rst := List.dropLast ss ++ [slast ++ t ] ++ hd :: tl } = max (Layout.max_with_offset c { fst := s , rst := ss } )
(Layout.max_with_offset (String.length slast ) { fst := t , rst := hd :: tl } ){ last := String.length (List.getLast (List.dropLast ss ++ [slast ++ t ] ++ hd :: tl ) h_non_empty ) ,
cost := Factory.concat F cost₁ cost₂ , doc := Doc.concat d₁✝ d₂✝ ,
x :=
max (Layout.max_with_offset c { fst := s , rst := ss } )
(Layout.max_with_offset (String.length slast ) { fst := t , rst := hd :: tl } ) ,
y := max y₁ y₂ } = Meas.concat F
{ last := String.length (List.getLast ss h_non_empty✝ ) , cost := cost₁ , doc := d₁✝ ,
x := Layout.max_with_offset c { fst := s , rst := ss } , y := y₁ }
{ last := String.length (List.getLast (hd :: tl ) (_ : ¬ hd :: tl = [] ) ) , cost := cost₂ , doc := d₂✝ ,
x := Layout.max_with_offset (String.length (List.getLast ss h_non_empty✝ ) ) { fst := t , rst := hd :: tl } ,
y := y₂ } simp_arith [ Meas.concat : {α : Type } → Factory α → Meas → Meas → Meas Meas.concat, *, List.getLast_append' ]
/--
Totality of the measure computation relation (Section 5.3)
-/
theorem MeasRender_total ( F : Factory α ) ( d : Doc ) ( c i : ℕ ) ( h : Choiceless d ) :
∃ m , MeasRender F d c i m := by
let ⟨⟨ s , ss ⟩, h : Render d c i { fst := s , rst := ss } h ⟩ := Render_total c i h
cases ss
case nil =>
let ⟨ cost , ⟨ y , _⟩⟩ := MeasRender_single_correct F h : Render d c i { fst := s , rst := [] } h
exists ⟨ c + s . length , cost , d , c + s . length , y ⟩
case cons hd tl =>
let ⟨ cost , ⟨ y , _⟩⟩ := MeasRender_multi_correct F h : Render d c i { fst := s , rst := hd :: tl } h ( by simp )
exists ⟨( List.getLast : {α : Type ?u.212538} → (as : List α ) → as ≠ [] → α List.getLast ( hd :: tl ) ( by simp )). length , cost ,
d , Layout.max_with_offset c ( Layout.mk s ( hd :: tl )), y ⟩