%   ORIGINAL: h4/llist/LFLATTEN__THM_c2
% Assm: HL_TRUTH: T
% Assm: HL_FALSITY: ~F
% Assm: HL_BOOL_CASES: !t. (t <=> T) \/ (t <=> F)
% Assm: HL_EXT: !f g. (!x. f x = g x) ==> f = g
% Assm: h4/bool/TRUTH: T
% Assm: h4/bool/IMP__ANTISYM__AX: !t2 t1. (t1 ==> t2) ==> (t2 ==> t1) ==> (t1 <=> t2)
% Assm: h4/bool/FALSITY: !t. F ==> t
% Assm: h4/bool/AND__CLAUSES_c0: !t. T /\ t <=> t
% Assm: h4/bool/AND__CLAUSES_c2: !t. F /\ t <=> F
% Assm: h4/bool/REFL__CLAUSE: !x. x = x <=> T
% Assm: h4/bool/EQ__SYM__EQ: !y x. x = y <=> y = x
% Assm: h4/bool/AND__IMP__INTRO: !t3 t2 t1. t1 ==> t2 ==> t3 <=> t1 /\ t2 ==> t3
% Assm: h4/bool/COND__CONG: !y_27 y x_27 x Q P. (P <=> Q) /\ (Q ==> x = x_27) /\ (~Q ==> y = y_27) ==> h4/bool/COND P x y = h4/bool/COND Q x_27 y_27
% Assm: h4/bool/bool__case__thm_c1: !t2 t1. h4/bool/COND F t1 t2 = t2
% Assm: h4/option/THE__DEF: !x. h4/option/THE (h4/option/SOME x) = x
% Assm: h4/llist/LHD__THM_c1: !t h. h4/llist/LHD (h4/llist/LCONS h t) = h4/option/SOME h
% Assm: h4/llist/LTL__THM_c1: !t h. h4/llist/LTL (h4/llist/LCONS h t) = h4/option/SOME t
% Assm: h4/llist/LCONS__NOT__NIL_c0: !t h. ~(h4/llist/LCONS h t = h4/llist/LNIL)
% Assm: h4/llist/LCONS__11: !t2 t1 h2 h1. h4/llist/LCONS h1 t1 = h4/llist/LCONS h2 t2 <=> h1 = h2 /\ t1 = t2
% Assm: h4/llist/LL__ALL__THM_c1: !t h P. h4/llist/every P (h4/llist/LCONS h t) <=> P h /\ h4/llist/every P t
% Assm: h4/llist/LFLATTEN0: !ll. h4/llist/LFLATTEN ll = h4/bool/COND (h4/llist/every ($equals h4/llist/LNIL) ll) h4/llist/LNIL (h4/bool/COND (h4/option/THE (h4/llist/LHD ll) = h4/llist/LNIL) (h4/llist/LFLATTEN (h4/option/THE (h4/llist/LTL ll))) (h4/llist/LCONS (h4/option/THE (h4/llist/LHD (h4/option/THE (h4/llist/LHD ll)))) (h4/llist/LFLATTEN (h4/llist/LCONS (h4/option/THE (h4/llist/LTL (h4/option/THE (h4/llist/LHD ll)))) (h4/option/THE (h4/llist/LTL ll))))))
% Goal: !tl t h. h4/llist/LFLATTEN (h4/llist/LCONS (h4/llist/LCONS h t) tl) = h4/llist/LCONS h (h4/llist/LFLATTEN (h4/llist/LCONS t tl))
%   PROCESSED
% Assm [HLu_TRUTH]: T
% Assm [HLu_FALSITY]: ~F
% Assm [HLu_BOOLu_CASES]: !t. (t <=> T) \/ (t <=> F)
% Assm [HLu_EXT]: !f g. (!x. happ f x = happ g x) ==> f = g
% Assm [h4s_bools_TRUTH]: T
% Assm [h4s_bools_IMPu_u_ANTISYMu_u_AX]: !t2 t1. (t1 ==> t2) ==> (t2 ==> t1) ==> (t1 <=> t2)
% Assm [h4s_bools_FALSITY]: !t. F ==> t
% Assm [h4s_bools_ANDu_u_CLAUSESu_c0]: !t. T /\ t <=> t
% Assm [h4s_bools_ANDu_u_CLAUSESu_c2]: !t. F /\ t <=> F
% Assm [h4s_bools_REFLu_u_CLAUSE]: !x. x = x <=> T
% Assm [h4s_bools_EQu_u_SYMu_u_EQ]: !y x. x = y <=> y = x
% Assm [h4s_bools_ANDu_u_IMPu_u_INTRO]: !t3 t2 t1. t1 ==> t2 ==> t3 <=> t1 /\ t2 ==> t3
% Assm [h4s_bools_CONDu_u_CONG]: !y_27 y x_27 x Q P. (P <=> Q) /\ (Q ==> x = x_27) /\ (~Q ==> y = y_27) ==> h4/bool/COND P x y = h4/bool/COND Q x_27 y_27
% Assm [h4s_bools_boolu_u_caseu_u_thmu_c1]: !t2 t1. h4/bool/COND F t1 t2 = t2
% Assm [h4s_options_THEu_u_DEF]: !x. h4/option/THE (h4/option/SOME x) = x
% Assm [h4s_llists_LHDu_u_THMu_c1]: !t h. h4/llist/LHD (h4/llist/LCONS h t) = h4/option/SOME h
% Assm [h4s_llists_LTLu_u_THMu_c1]: !t h. h4/llist/LTL (h4/llist/LCONS h t) = h4/option/SOME t
% Assm [h4s_llists_LCONSu_u_NOTu_u_NILu_c0]: !t h. ~(h4/llist/LCONS h t = h4/llist/LNIL)
% Assm [h4s_llists_LCONSu_u_11]: !t2 t1 h2 h1. h4/llist/LCONS h1 t1 = h4/llist/LCONS h2 t2 <=> h1 = h2 /\ t1 = t2
% Assm [h4s_llists_LLu_u_ALLu_u_THMu_c1]: !t h P. h4/llist/every P (h4/llist/LCONS h t) <=> happ P h /\ h4/llist/every P t
% Assm [h4s_llists_LFLATTEN0]: !ll. ?v. (v <=> h4/option/THE (h4/llist/LHD ll) = h4/llist/LNIL) /\ h4/llist/LFLATTEN ll = h4/bool/COND (h4/llist/every ($equals h4/llist/LNIL) ll) h4/llist/LNIL (h4/bool/COND v (h4/llist/LFLATTEN (h4/option/THE (h4/llist/LTL ll))) (h4/llist/LCONS (h4/option/THE (h4/llist/LHD (h4/option/THE (h4/llist/LHD ll)))) (h4/llist/LFLATTEN (h4/llist/LCONS (h4/option/THE (h4/llist/LTL (h4/option/THE (h4/llist/LHD ll)))) (h4/option/THE (h4/llist/LTL ll))))))
% Goal: !tl t h. h4/llist/LFLATTEN (h4/llist/LCONS (h4/llist/LCONS h t) tl) = h4/llist/LCONS h (h4/llist/LFLATTEN (h4/llist/LCONS t tl))
fof(aHLu_TRUTH, axiom, p(s(t_bool,t0))).
fof(aHLu_FALSITY, axiom, ~ (p(s(t_bool,f)))).
fof(aHLu_BOOLu_CASES, axiom, ![V_t]: (s(t_bool,V_t) = s(t_bool,t0) | s(t_bool,V_t) = s(t_bool,f))).
fof(aHLu_EXT, axiom, ![TV_Q171605,TV_Q171601]: ![V_f, V_g]: (![V_x]: s(TV_Q171601,happ(s(t_fun(TV_Q171605,TV_Q171601),V_f),s(TV_Q171605,V_x))) = s(TV_Q171601,happ(s(t_fun(TV_Q171605,TV_Q171601),V_g),s(TV_Q171605,V_x))) => s(t_fun(TV_Q171605,TV_Q171601),V_f) = s(t_fun(TV_Q171605,TV_Q171601),V_g))).
fof(ah4s_bools_TRUTH, axiom, p(s(t_bool,t0))).
fof(ah4s_bools_IMPu_u_ANTISYMu_u_AX, axiom, ![V_t2, V_t1]: ((p(s(t_bool,V_t1)) => p(s(t_bool,V_t2))) => ((p(s(t_bool,V_t2)) => p(s(t_bool,V_t1))) => s(t_bool,V_t1) = s(t_bool,V_t2)))).
fof(ah4s_bools_FALSITY, axiom, ![V_t]: (p(s(t_bool,f)) => p(s(t_bool,V_t)))).
fof(ah4s_bools_ANDu_u_CLAUSESu_c0, axiom, ![V_t]: ((p(s(t_bool,t0)) & p(s(t_bool,V_t))) <=> p(s(t_bool,V_t)))).
fof(ah4s_bools_ANDu_u_CLAUSESu_c2, axiom, ![V_t]: ((p(s(t_bool,f)) & p(s(t_bool,V_t))) <=> p(s(t_bool,f)))).
fof(ah4s_bools_REFLu_u_CLAUSE, axiom, ![TV_u_27a]: ![V_x]: (s(TV_u_27a,V_x) = s(TV_u_27a,V_x) <=> p(s(t_bool,t0)))).
fof(ah4s_bools_EQu_u_SYMu_u_EQ, axiom, ![TV_u_27a]: ![V_y, V_x]: (s(TV_u_27a,V_x) = s(TV_u_27a,V_y) <=> s(TV_u_27a,V_y) = s(TV_u_27a,V_x))).
fof(ah4s_bools_ANDu_u_IMPu_u_INTRO, axiom, ![V_t3, V_t2, V_t1]: ((p(s(t_bool,V_t1)) => (p(s(t_bool,V_t2)) => p(s(t_bool,V_t3)))) <=> ((p(s(t_bool,V_t1)) & p(s(t_bool,V_t2))) => p(s(t_bool,V_t3))))).
fof(ah4s_bools_CONDu_u_CONG, axiom, ![TV_u_27a]: ![V_yu_27, V_y, V_xu_27, V_x, V_Q, V_P]: ((s(t_bool,V_P) = s(t_bool,V_Q) & ((p(s(t_bool,V_Q)) => s(TV_u_27a,V_x) = s(TV_u_27a,V_xu_27)) & (~ (p(s(t_bool,V_Q))) => s(TV_u_27a,V_y) = s(TV_u_27a,V_yu_27)))) => s(TV_u_27a,h4s_bools_cond(s(t_bool,V_P),s(TV_u_27a,V_x),s(TV_u_27a,V_y))) = s(TV_u_27a,h4s_bools_cond(s(t_bool,V_Q),s(TV_u_27a,V_xu_27),s(TV_u_27a,V_yu_27))))).
fof(ah4s_bools_boolu_u_caseu_u_thmu_c1, axiom, ![TV_u_27a]: ![V_t2, V_t1]: s(TV_u_27a,h4s_bools_cond(s(t_bool,f),s(TV_u_27a,V_t1),s(TV_u_27a,V_t2))) = s(TV_u_27a,V_t2)).
fof(ah4s_options_THEu_u_DEF, axiom, ![TV_u_27a]: ![V_x]: s(TV_u_27a,h4s_options_the(s(t_h4s_options_option(TV_u_27a),h4s_options_some(s(TV_u_27a,V_x))))) = s(TV_u_27a,V_x)).
fof(ah4s_llists_LHDu_u_THMu_c1, axiom, ![TV_u_27b]: ![V_t, V_h]: s(t_h4s_options_option(TV_u_27b),h4s_llists_lhd(s(t_h4s_llists_llist(TV_u_27b),h4s_llists_lcons(s(TV_u_27b,V_h),s(t_h4s_llists_llist(TV_u_27b),V_t))))) = s(t_h4s_options_option(TV_u_27b),h4s_options_some(s(TV_u_27b,V_h)))).
fof(ah4s_llists_LTLu_u_THMu_c1, axiom, ![TV_u_27b]: ![V_t, V_h]: s(t_h4s_options_option(t_h4s_llists_llist(TV_u_27b)),h4s_llists_ltl(s(t_h4s_llists_llist(TV_u_27b),h4s_llists_lcons(s(TV_u_27b,V_h),s(t_h4s_llists_llist(TV_u_27b),V_t))))) = s(t_h4s_options_option(t_h4s_llists_llist(TV_u_27b)),h4s_options_some(s(t_h4s_llists_llist(TV_u_27b),V_t)))).
fof(ah4s_llists_LCONSu_u_NOTu_u_NILu_c0, axiom, ![TV_u_27a]: ![V_t, V_h]: ~ (s(t_h4s_llists_llist(TV_u_27a),h4s_llists_lcons(s(TV_u_27a,V_h),s(t_h4s_llists_llist(TV_u_27a),V_t))) = s(t_h4s_llists_llist(TV_u_27a),h4s_llists_lnil))).
fof(ah4s_llists_LCONSu_u_11, axiom, ![TV_u_27a]: ![V_t2, V_t1, V_h2, V_h1]: (s(t_h4s_llists_llist(TV_u_27a),h4s_llists_lcons(s(TV_u_27a,V_h1),s(t_h4s_llists_llist(TV_u_27a),V_t1))) = s(t_h4s_llists_llist(TV_u_27a),h4s_llists_lcons(s(TV_u_27a,V_h2),s(t_h4s_llists_llist(TV_u_27a),V_t2))) <=> (s(TV_u_27a,V_h1) = s(TV_u_27a,V_h2) & s(t_h4s_llists_llist(TV_u_27a),V_t1) = s(t_h4s_llists_llist(TV_u_27a),V_t2)))).
fof(ah4s_llists_LLu_u_ALLu_u_THMu_c1, axiom, ![TV_u_27a]: ![V_t, V_h, V_P]: (p(s(t_bool,h4s_llists_every(s(t_fun(TV_u_27a,t_bool),V_P),s(t_h4s_llists_llist(TV_u_27a),h4s_llists_lcons(s(TV_u_27a,V_h),s(t_h4s_llists_llist(TV_u_27a),V_t)))))) <=> (p(s(t_bool,happ(s(t_fun(TV_u_27a,t_bool),V_P),s(TV_u_27a,V_h)))) & p(s(t_bool,h4s_llists_every(s(t_fun(TV_u_27a,t_bool),V_P),s(t_h4s_llists_llist(TV_u_27a),V_t))))))).
fof(ah4s_llists_LFLATTEN0, axiom, ![TV_u_27a]: ![V_ll]: ?[V_v]: ((p(s(t_bool,V_v)) <=> s(t_h4s_llists_llist(TV_u_27a),h4s_options_the(s(t_h4s_options_option(t_h4s_llists_llist(TV_u_27a)),h4s_llists_lhd(s(t_h4s_llists_llist(t_h4s_llists_llist(TV_u_27a)),V_ll))))) = s(t_h4s_llists_llist(TV_u_27a),h4s_llists_lnil)) & s(t_h4s_llists_llist(TV_u_27a),h4s_llists_lflatten(s(t_h4s_llists_llist(t_h4s_llists_llist(TV_u_27a)),V_ll))) = s(t_h4s_llists_llist(TV_u_27a),h4s_bools_cond(s(t_bool,h4s_llists_every(s(t_fun(t_h4s_llists_llist(TV_u_27a),t_bool),d_equals(s(t_h4s_llists_llist(TV_u_27a),h4s_llists_lnil))),s(t_h4s_llists_llist(t_h4s_llists_llist(TV_u_27a)),V_ll))),s(t_h4s_llists_llist(TV_u_27a),h4s_llists_lnil),s(t_h4s_llists_llist(TV_u_27a),h4s_bools_cond(s(t_bool,V_v),s(t_h4s_llists_llist(TV_u_27a),h4s_llists_lflatten(s(t_h4s_llists_llist(t_h4s_llists_llist(TV_u_27a)),h4s_options_the(s(t_h4s_options_option(t_h4s_llists_llist(t_h4s_llists_llist(TV_u_27a))),h4s_llists_ltl(s(t_h4s_llists_llist(t_h4s_llists_llist(TV_u_27a)),V_ll))))))),s(t_h4s_llists_llist(TV_u_27a),h4s_llists_lcons(s(TV_u_27a,h4s_options_the(s(t_h4s_options_option(TV_u_27a),h4s_llists_lhd(s(t_h4s_llists_llist(TV_u_27a),h4s_options_the(s(t_h4s_options_option(t_h4s_llists_llist(TV_u_27a)),h4s_llists_lhd(s(t_h4s_llists_llist(t_h4s_llists_llist(TV_u_27a)),V_ll))))))))),s(t_h4s_llists_llist(TV_u_27a),h4s_llists_lflatten(s(t_h4s_llists_llist(t_h4s_llists_llist(TV_u_27a)),h4s_llists_lcons(s(t_h4s_llists_llist(TV_u_27a),h4s_options_the(s(t_h4s_options_option(t_h4s_llists_llist(TV_u_27a)),h4s_llists_ltl(s(t_h4s_llists_llist(TV_u_27a),h4s_options_the(s(t_h4s_options_option(t_h4s_llists_llist(TV_u_27a)),h4s_llists_lhd(s(t_h4s_llists_llist(t_h4s_llists_llist(TV_u_27a)),V_ll))))))))),s(t_h4s_llists_llist(t_h4s_llists_llist(TV_u_27a)),h4s_options_the(s(t_h4s_options_option(t_h4s_llists_llist(t_h4s_llists_llist(TV_u_27a))),h4s_llists_ltl(s(t_h4s_llists_llist(t_h4s_llists_llist(TV_u_27a)),V_ll))))))))))))))))).
fof(ch4s_llists_LFLATTENu_u_THMu_c2, conjecture, ![TV_u_27d]: ![V_tl, V_t, V_h]: s(t_h4s_llists_llist(TV_u_27d),h4s_llists_lflatten(s(t_h4s_llists_llist(t_h4s_llists_llist(TV_u_27d)),h4s_llists_lcons(s(t_h4s_llists_llist(TV_u_27d),h4s_llists_lcons(s(TV_u_27d,V_h),s(t_h4s_llists_llist(TV_u_27d),V_t))),s(t_h4s_llists_llist(t_h4s_llists_llist(TV_u_27d)),V_tl))))) = s(t_h4s_llists_llist(TV_u_27d),h4s_llists_lcons(s(TV_u_27d,V_h),s(t_h4s_llists_llist(TV_u_27d),h4s_llists_lflatten(s(t_h4s_llists_llist(t_h4s_llists_llist(TV_u_27d)),h4s_llists_lcons(s(t_h4s_llists_llist(TV_u_27d),V_t),s(t_h4s_llists_llist(t_h4s_llists_llist(TV_u_27d)),V_tl)))))))).
